diff --git a/4chan_x.user.js b/4chan_x.user.js index bf3c12f87..333e2f9a1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -97,7 +97,7 @@ 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, Posting: { - 'Quick Reply': [true, 'WMD.'], + 'Quick Reply': [true, 'Weapon of mass destruction.'], 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], 'Auto Hide QR': [false, 'Automatically hide the quick reply when posting.'], 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], @@ -1020,6 +1020,9 @@ $.asap((function() { return d.body; }), function() { + if ($('link[href*="favicon-status.ico"]', d.head)) { + return; + } return $.prepend(d.body, Header.headerEl); }); return $.asap((function() { @@ -4738,15 +4741,9 @@ $.on(d, 'dragover', QR.dragOver); $.on(d, 'drop', QR.dropFile); $.on(d, 'dragstart dragend', QR.drag); - $.on(d, '4chanXInitFinished', function() { - if (!Conf['Persistent QR']) { - return; - } - QR.open(); - if (Conf['Auto Hide QR']) { - return QR.hide(); - } - }); + if (Conf['Persistent QR']) { + $.on(d, '4chanXInitFinished', QR.persist); + } $.on(d, 'ThreadUpdate', function() { if (g.DEAD) { return QR.abort(); @@ -4762,6 +4759,12 @@ node: function() { return $.on($('a[title="Quote this post"]', this.nodes.info), 'click', QR.quote); }, + persist: function() { + QR.open(); + if (Conf['Auto Hide QR']) { + return QR.hide(); + } + }, open: function() { if (QR.el) { QR.el.hidden = false; @@ -6091,6 +6094,9 @@ }, initStyle: function() { var MutationObserver, mainStyleSheet, observer, setStyle, style, styleSheets, _ref; + if ($('link[href*="favicon-status.ico"]', d.head)) { + return; + } if ((_ref = $('link[href*=mobile]', d.head)) != null) { _ref.disabled = true; } diff --git a/src/config.coffee b/src/config.coffee index 46973074d..4b45be5ae 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -42,7 +42,7 @@ Config = 'Auto Watch': [true, 'Automatically watch threads you start.'] 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] Posting: - 'Quick Reply': [true, 'WMD.'] + 'Quick Reply': [true, 'Weapon of mass destruction.'] 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'] 'Auto Hide QR': [false, 'Automatically hide the quick reply when posting.'] 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'] diff --git a/src/features.coffee b/src/features.coffee index 3df47c2e9..9c810bf76 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -46,6 +46,9 @@ Header = order: 105 $.asap (-> d.body), -> + if $ 'link[href*="favicon-status.ico"]', d.head + # 404 error page or similar. + return $.prepend d.body, Header.headerEl $.asap (-> $.id 'boardNavDesktop'), @setBoardList diff --git a/src/main.coffee b/src/main.coffee index a6fe0a1fc..ee6bd9b46 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -350,6 +350,9 @@ Main = $.ready Main.initReady initStyle: -> + if $ 'link[href*="favicon-status.ico"]', d.head + # 404 error page or similar. + return # disable the mobile layout $('link[href*=mobile]', d.head)?.disabled = true $.addClass doc, $.engine diff --git a/src/qr.coffee b/src/qr.coffee index d01512356..b82a9529a 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -25,13 +25,10 @@ QR = el: link order: 10 - $.on d, 'dragover', QR.dragOver - $.on d, 'drop', QR.dropFile - $.on d, 'dragstart dragend', QR.drag - $.on d, '4chanXInitFinished', -> - return unless Conf['Persistent QR'] - QR.open() - QR.hide() if Conf['Auto Hide QR'] + $.on d, 'dragover', QR.dragOver + $.on d, 'drop', QR.dropFile + $.on d, 'dragstart dragend', QR.drag + $.on d, '4chanXInitFinished', QR.persist if Conf['Persistent QR'] $.on d, 'ThreadUpdate', -> if g.DEAD QR.abort() @@ -45,6 +42,9 @@ QR = node: -> $.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote + persist: -> + QR.open() + QR.hide() if Conf['Auto Hide QR'] open: -> if QR.el QR.el.hidden = false