From 359babd914a02839b786dbbb4896b03626bc2fa9 Mon Sep 17 00:00:00 2001 From: jizzyjugs Date: Fri, 7 Sep 2012 20:28:15 -0700 Subject: [PATCH 1/5] Update script.coffee Disables the 4chan built-in extension on first run --- script.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/script.coffee b/script.coffee index 8f8a34812..b15acea03 100644 --- a/script.coffee +++ b/script.coffee @@ -2007,6 +2007,7 @@ Options = Favicon.init() unless Favicon.el $.set 'firstrun', true Options.dialog() + localStorage.setItem '4chan-settings', '{"disableAll":true}' dialog: -> dialog = $.el 'div' From 5469bdf6640c313d6bf5c8910a6b23baf22da34d Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 8 Sep 2012 17:22:15 +0200 Subject: [PATCH 2/5] Actually disable 4chan's inline extension on first-run before it had the time to execute. --- 4chan_x.user.js | 22 ++++++++++++++-------- script.coffee | 18 +++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 6a3487b9c..a77833e17 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2540,6 +2540,19 @@ Options = { init: function() { + if (!$.get('firstrun')) { + $.set('firstrun', true); + localStorage.setItem('4chan-settings', '{"disableAll":true}'); + $.ready(function() { + if (!Favicon.el) { + Favicon.init(); + } + return Options.dialog(); + }); + } + return $.ready(Options.initReady); + }, + initReady: function() { var a, settings, _i, _len, _ref; _ref = ['navtopright', 'navbotright']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -2552,13 +2565,6 @@ $.on(a, 'click', Options.dialog); $.prepend($.id(settings), [$.tn('['), a, $.tn('] ')]); } - if (!$.get('firstrun')) { - if (!Favicon.el) { - Favicon.init(); - } - $.set('firstrun', true); - return Options.dialog(); - } }, dialog: function() { var arr, back, checked, description, dialog, favicon, fileInfo, filter, hiddenNum, hiddenThreads, indicator, indicators, input, key, li, obj, overlay, sauce, time, tr, ul, _i, _len, _ref, _ref1, _ref2; @@ -4972,7 +4978,7 @@ }); return; } - $.ready(Options.init); + Options.init(); if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) { Main.css += '#postForm { display: none; }'; } diff --git a/script.coffee b/script.coffee index b15acea03..9aba6b73a 100644 --- a/script.coffee +++ b/script.coffee @@ -1995,6 +1995,15 @@ QR = Options = init: -> + unless $.get 'firstrun' + $.set 'firstrun', true + localStorage.setItem '4chan-settings', '{"disableAll":true}' + $.ready -> + # Prevent race conditions + Favicon.init() unless Favicon.el + Options.dialog() + $.ready Options.initReady + initReady: -> for settings in ['navtopright', 'navbotright'] a = $.el 'a', href: 'javascript:;' @@ -2002,12 +2011,7 @@ Options = textContent: '4chan X Settings' $.on a, 'click', Options.dialog $.prepend $.id(settings), [$.tn('['), a, $.tn('] ')] - unless $.get 'firstrun' - # Prevent race conditions - Favicon.init() unless Favicon.el - $.set 'firstrun', true - Options.dialog() - localStorage.setItem '4chan-settings', '{"disableAll":true}' + return dialog: -> dialog = $.el 'div' @@ -3872,7 +3876,7 @@ Main = location.href = url if url return - $.ready Options.init + Options.init() if Conf['Quick Reply'] and Conf['Hide Original Post Form'] Main.css += '#postForm { display: none; }' From 09563c9a710c9d33f2afea0858bd70d4d21a2f03 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 8 Sep 2012 22:44:20 +0200 Subject: [PATCH 3/5] Use base64'd @icon, fix Scriptish's updater. --- 4chan_x.user.js | 2 +- Cakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a77833e17..8fb052401 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -15,7 +15,7 @@ // @run-at document-start // @updateURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js // @downloadURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js -// @icon http://mayhemydg.github.com/4chan-x/favicon.gif +// @icon data:image/gif;base64,R0lGODlhEAAQAKECAAAAAGbMM////////yH5BAEKAAIALAAAAAAQABAAAAIxlI+pq+D9DAgUoFkPDlbs7lGiI2bSVnKglnJMOL6omczxVZK3dH/41AG6Lh7i6qUoAAA7 // ==/UserScript== /* LICENSE diff --git a/Cakefile b/Cakefile index e7c0ee80e..e8cbd6239 100644 --- a/Cakefile +++ b/Cakefile @@ -22,7 +22,7 @@ HEADER = """ // @run-at document-start // @updateURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js // @downloadURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js -// @icon http://mayhemydg.github.com/4chan-x/favicon.gif +// @icon data:image/gif;base64,R0lGODlhEAAQAKECAAAAAGbMM////////yH5BAEKAAIALAAAAAAQABAAAAIxlI+pq+D9DAgUoFkPDlbs7lGiI2bSVnKglnJMOL6omczxVZK3dH/41AG6Lh7i6qUoAAA7 // ==/UserScript== /* LICENSE From a110410f5cb737e022661c7fc92ff62315a6aba2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 8 Sep 2012 22:55:55 +0200 Subject: [PATCH 4/5] Add @grants. --- 4chan_x.user.js | 4 ++++ Cakefile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 8fb052401..8d007e76a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -12,6 +12,10 @@ // @include https://images.4chan.org/* // @include http://sys.4chan.org/* // @include https://sys.4chan.org/* +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_deleteValue +// @grant GM_openInTab // @run-at document-start // @updateURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js // @downloadURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js diff --git a/Cakefile b/Cakefile index e8cbd6239..156919d1f 100644 --- a/Cakefile +++ b/Cakefile @@ -19,6 +19,10 @@ HEADER = """ // @include https://images.4chan.org/* // @include http://sys.4chan.org/* // @include https://sys.4chan.org/* +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_deleteValue +// @grant GM_openInTab // @run-at document-start // @updateURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js // @downloadURL https://github.com/MayhemYDG/4chan-x/raw/stable/4chan_x.user.js From e12c9a9f7ae08902f253a624e616678837badd58 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 8 Sep 2012 22:56:39 +0200 Subject: [PATCH 5/5] Changelog. --- changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog b/changelog index bb5cac57a..c0fa5084e 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Fix compatibility with Scriptish's auto-udpater. 2.34.10 - Mayhem