From cb6b786202b8dea938fbf5ebdfc22dbe6c59bbd6 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 7 Jan 2012 18:12:03 +0100 Subject: [PATCH] Rename onLoad to ready. --- 4chan_x.user.js | 14 +++++++------- script.coffee | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 35824bf30..c3869252c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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(); diff --git a/script.coffee b/script.coffee index 5730551de..46ba26ef6 100644 --- a/script.coffee +++ b/script.coffee @@ -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