Rename onLoad to ready.

This commit is contained in:
Nicolas Stepien 2012-01-07 18:12:03 +01:00
parent 91772a4110
commit cb6b786202
2 changed files with 14 additions and 14 deletions

View File

@ -307,7 +307,7 @@
};
$.extend($, {
onLoad: function(fc) {
ready: function(fc) {
var cb;
if (/interactive|complete/.test(d.readyState)) return fc();
cb = function() {
@ -3084,20 +3084,20 @@
g.PAGENUM = parseInt(temp) || 0;
}
if (location.hostname === 'sys.4chan.org') {
$.onLoad(qr.sys);
$.ready(qr.sys);
return;
}
if (location.hostname === 'images.4chan.org') {
$.onLoad(function() {
$.ready(function() {
if (d.title === '4chan - 404') return redirect.init();
});
return;
}
$.onLoad(options.init);
$.ready(options.init);
$.on(window, 'message', Main.message);
now = Date.now();
if (conf['Check for Updates'] && $.get('lastUpdate', 0) < now - 6 * HOUR) {
$.onLoad(function() {
$.ready(function() {
return $.add(d.head, $.el('script', {
src: 'https://raw.github.com/mayhemydg/4chan-x/master/latest.js'
}));
@ -3135,9 +3135,9 @@
if (conf['Quote Backlinks']) quoteBacklink.init();
if (conf['Indicate OP quote']) quoteOP.init();
if (conf['Indicate Cross-thread Quotes']) quoteDR.init();
return $.onLoad(Main.onLoad);
return $.ready(Main.ready);
},
onLoad: function() {
ready: function() {
var callback, canPost, form, node, nodes, _i, _j, _len, _len2, _ref;
if (conf['404 Redirect'] && d.title === '4chan - 404') {
redirect.init();

View File

@ -221,7 +221,7 @@ $.extend = (object, properties) ->
object
$.extend $,
onLoad: (fc) ->
ready: (fc) ->
if /interactive|complete/.test d.readyState
return fc()
cb = ->
@ -2390,19 +2390,19 @@ Main =
g.PAGENUM = parseInt(temp) or 0
if location.hostname is 'sys.4chan.org'
$.onLoad qr.sys
$.ready qr.sys
return
if location.hostname is 'images.4chan.org'
$.onLoad -> redirect.init() if d.title is '4chan - 404'
$.ready -> redirect.init() if d.title is '4chan - 404'
return
$.onLoad options.init
$.ready options.init
$.on window, 'message', Main.message
now = Date.now()
if conf['Check for Updates'] and $.get('lastUpdate', 0) < now - 6*HOUR
$.onLoad -> $.add d.head, $.el 'script', src: 'https://raw.github.com/mayhemydg/4chan-x/master/latest.js'
$.ready -> $.add d.head, $.el 'script', src: 'https://raw.github.com/mayhemydg/4chan-x/master/latest.js'
$.set 'lastUpdate', now
g.hiddenReplies = $.get "hiddenReplies/#{g.BOARD}/", {}
@ -2468,9 +2468,9 @@ Main =
quoteDR.init()
$.onLoad Main.onLoad
$.ready Main.ready
onLoad: ->
ready: ->
if conf['404 Redirect'] and d.title is '4chan - 404'
redirect.init()
return