diff --git a/4chan_x.user.js b/4chan_x.user.js index 8d007e76a..b33a029ec 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -86,6 +86,7 @@ Config = { main: { Enhancing: { + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'], '404 Redirect': [true, 'Redirect dead threads and images'], 'Keybinds': [true, 'Binds actions to keys'], 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'], @@ -2544,16 +2545,6 @@ 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() { @@ -2569,6 +2560,13 @@ $.on(a, 'click', Options.dialog); $.prepend($.id(settings), [$.tn('['), a, $.tn('] ')]); } + if (!$.get('firstrun')) { + $.set('firstrun', true); + if (!Favicon.el) { + Favicon.init(); + } + 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; @@ -4982,6 +4980,9 @@ }); return; } + if (Conf['Disable 4chan\'s extension']) { + localStorage.setItem('4chan-settings', '{"disableAll":true}'); + } Options.init(); if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) { Main.css += '#postForm { display: none; }'; diff --git a/changelog b/changelog index c0fa5084e..289350675 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,6 @@ master - Mayhem + Add an option to disable 4chan's inline extension. Enabled by default. Fix compatibility with Scriptish's auto-udpater. 2.34.10 diff --git a/script.coffee b/script.coffee index 9aba6b73a..4d80584e1 100644 --- a/script.coffee +++ b/script.coffee @@ -1,6 +1,7 @@ Config = main: Enhancing: + 'Disable 4chan\'s extension': [true, 'Avoid conflicts between 4chan X and 4chan\'s inline extension.'] '404 Redirect': [true, 'Redirect dead threads and images'] 'Keybinds': [true, 'Binds actions to keys'] 'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'] @@ -1995,13 +1996,6 @@ 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'] @@ -2011,7 +2005,11 @@ Options = textContent: '4chan X Settings' $.on a, 'click', Options.dialog $.prepend $.id(settings), [$.tn('['), a, $.tn('] ')] - return + unless $.get 'firstrun' + $.set 'firstrun', true + # Prevent race conditions + Favicon.init() unless Favicon.el + Options.dialog() dialog: -> dialog = $.el 'div' @@ -3876,6 +3874,9 @@ Main = location.href = url if url return + if Conf['Disable 4chan\'s extension'] + localStorage.setItem '4chan-settings', '{"disableAll":true}' + Options.init() if Conf['Quick Reply'] and Conf['Hide Original Post Form']