We don't need DOMNodeInserted to add the main stylesheet anymore.
This commit is contained in:
parent
0e40b115a3
commit
db3a3fbc2b
@ -406,7 +406,7 @@
|
|||||||
style = $.el('style', {
|
style = $.el('style', {
|
||||||
textContent: css
|
textContent: css
|
||||||
});
|
});
|
||||||
$.add(d.head, style);
|
$.add(d.head || d.documentElement, style);
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
x: function(path, root) {
|
x: function(path, root) {
|
||||||
@ -5044,7 +5044,7 @@
|
|||||||
if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) {
|
if (Conf['Quick Reply'] && Conf['Hide Original Post Form']) {
|
||||||
Main.css += '#postForm { display: none; }';
|
Main.css += '#postForm { display: none; }';
|
||||||
}
|
}
|
||||||
Main.addStyle();
|
$.addStyle(Main.css);
|
||||||
now = Date.now();
|
now = Date.now();
|
||||||
if (Conf['Check for Updates'] && $.get('lastUpdate', 0) < now - 6 * $.HOUR) {
|
if (Conf['Check for Updates'] && $.get('lastUpdate', 0) < now - 6 * $.HOUR) {
|
||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
@ -5253,14 +5253,6 @@
|
|||||||
Conf[parent] = obj;
|
Conf[parent] = obj;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addStyle: function() {
|
|
||||||
$.off(d, 'DOMNodeInserted', Main.addStyle);
|
|
||||||
if (d.head) {
|
|
||||||
return $.addStyle(Main.css);
|
|
||||||
} else {
|
|
||||||
return $.on(d, 'DOMNodeInserted', Main.addStyle);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
message: function(e) {
|
message: function(e) {
|
||||||
var version;
|
var version;
|
||||||
version = e.data.version;
|
version = e.data.version;
|
||||||
|
|||||||
@ -315,7 +315,8 @@ $.extend $,
|
|||||||
addStyle: (css) ->
|
addStyle: (css) ->
|
||||||
style = $.el 'style',
|
style = $.el 'style',
|
||||||
textContent: css
|
textContent: css
|
||||||
$.add d.head, style
|
# XXX Only Chrome has no d.head on document-start.
|
||||||
|
$.add d.head or d.documentElement, style
|
||||||
style
|
style
|
||||||
x: (path, root=d.body) ->
|
x: (path, root=d.body) ->
|
||||||
# XPathResult.ANY_UNORDERED_NODE_TYPE is 8
|
# XPathResult.ANY_UNORDERED_NODE_TYPE is 8
|
||||||
@ -4031,7 +4032,7 @@ Main =
|
|||||||
if Conf['Quick Reply'] and Conf['Hide Original Post Form']
|
if Conf['Quick Reply'] and Conf['Hide Original Post Form']
|
||||||
Main.css += '#postForm { display: none; }'
|
Main.css += '#postForm { display: none; }'
|
||||||
|
|
||||||
Main.addStyle()
|
$.addStyle Main.css
|
||||||
|
|
||||||
now = Date.now()
|
now = Date.now()
|
||||||
if Conf['Check for Updates'] and $.get('lastUpdate', 0) < now - 6*$.HOUR
|
if Conf['Check for Updates'] and $.get('lastUpdate', 0) < now - 6*$.HOUR
|
||||||
@ -4214,13 +4215,6 @@ Main =
|
|||||||
Conf[parent] = obj
|
Conf[parent] = obj
|
||||||
return
|
return
|
||||||
|
|
||||||
addStyle: ->
|
|
||||||
$.off d, 'DOMNodeInserted', Main.addStyle
|
|
||||||
if d.head
|
|
||||||
$.addStyle Main.css
|
|
||||||
else # XXX fox
|
|
||||||
$.on d, 'DOMNodeInserted', Main.addStyle
|
|
||||||
|
|
||||||
message: (e) ->
|
message: (e) ->
|
||||||
{version} = e.data
|
{version} = e.data
|
||||||
if version and version isnt Main.version and confirm 'An updated version of 4chan X is available, would you like to install it now?'
|
if version and version isnt Main.version and confirm 'An updated version of 4chan X is available, would you like to install it now?'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user