Don't affect 404/error pages.

This commit is contained in:
Nicolas Stepien 2013-02-17 20:15:25 +01:00
parent a20d9f7e8b
commit bbd96ad959
5 changed files with 30 additions and 18 deletions

View File

@ -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;
}

View File

@ -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.']

View File

@ -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

View File

@ -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

View File

@ -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