Init features ASAP.
This commit is contained in:
parent
53648e232d
commit
28e0b83466
132
4chan_x.user.js
132
4chan_x.user.js
@ -61,7 +61,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, QR, SECOND, Time, anonymize, conf, config, d, expandComment, expandThread, filter, firstRun, flatten, g, getTitle, imgExpand, imgGif, imgHover, imgPreloading, key, keybinds, log, nav, options, pathname, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, temp, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher;
|
var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, QR, SECOND, Time, anonymize, conf, config, d, expandComment, expandThread, filter, firstRun, flatten, g, getTitle, imgExpand, imgGif, imgHover, imgPreloading, key, keybinds, log, nav, options, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher;
|
||||||
var __slice = Array.prototype.slice;
|
var __slice = Array.prototype.slice;
|
||||||
config = {
|
config = {
|
||||||
main: {
|
main: {
|
||||||
@ -502,19 +502,6 @@
|
|||||||
val = conf[key];
|
val = conf[key];
|
||||||
conf[key] = $.get(key, val);
|
conf[key] = $.get(key, val);
|
||||||
}
|
}
|
||||||
pathname = location.pathname.substring(1).split('/');
|
|
||||||
g.BOARD = pathname[0], temp = pathname[1];
|
|
||||||
if (temp === 'res') {
|
|
||||||
g.REPLY = temp;
|
|
||||||
g.THREAD_ID = pathname[2];
|
|
||||||
} else {
|
|
||||||
g.PAGENUM = parseInt(temp) || 0;
|
|
||||||
}
|
|
||||||
g.hiddenReplies = $.get("hiddenReplies/" + g.BOARD + "/", {});
|
|
||||||
g.chanOffset = 5 - new Date().getTimezoneOffset() / 60;
|
|
||||||
if ($.isDST()) {
|
|
||||||
g.chanOffset--;
|
|
||||||
}
|
|
||||||
$$ = function(selector, root) {
|
$$ = function(selector, root) {
|
||||||
if (root == null) {
|
if (root == null) {
|
||||||
root = d.body;
|
root = d.body;
|
||||||
@ -688,7 +675,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggle: function(thread) {
|
toggle: function(thread) {
|
||||||
var a, backlink, num, prev, table, threadID, _i, _len, _ref, _ref2, _results;
|
var a, backlink, num, pathname, prev, table, threadID, _i, _len, _ref, _ref2, _results;
|
||||||
threadID = thread.firstChild.id;
|
threadID = thread.firstChild.id;
|
||||||
pathname = "/" + g.BOARD + "/res/" + threadID;
|
pathname = "/" + g.BOARD + "/res/" + threadID;
|
||||||
a = $('.omittedposts', thread);
|
a = $('.omittedposts', thread);
|
||||||
@ -1803,7 +1790,7 @@
|
|||||||
init: function() {
|
init: function() {
|
||||||
var a, hiddenThreads, op, thread, _i, _len, _ref, _results;
|
var a, hiddenThreads, op, thread, _i, _len, _ref, _results;
|
||||||
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
|
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
|
||||||
_ref = $$('div.thread');
|
_ref = $$('.thread');
|
||||||
_results = [];
|
_results = [];
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
thread = _ref[_i];
|
thread = _ref[_i];
|
||||||
@ -2188,15 +2175,20 @@
|
|||||||
};
|
};
|
||||||
Time = {
|
Time = {
|
||||||
init: function() {
|
init: function() {
|
||||||
|
var chanOffset;
|
||||||
Time.foo();
|
Time.foo();
|
||||||
|
chanOffset = 5 - new Date().getTimezoneOffset() / 60;
|
||||||
|
if ($.isDST()) {
|
||||||
|
chanOffset--;
|
||||||
|
}
|
||||||
this.parse = Date.parse('10/11/11(Tue)18:53') ? function(node) {
|
this.parse = Date.parse('10/11/11(Tue)18:53') ? function(node) {
|
||||||
return new Date(Date.parse(node.textContent) + g.chanOffset * HOUR);
|
return new Date(Date.parse(node.textContent) + chanOffset * HOUR);
|
||||||
} : function(node) {
|
} : function(node) {
|
||||||
var day, hour, min, month, year, _, _ref;
|
var day, hour, min, month, year, _, _ref;
|
||||||
_ref = node.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5];
|
_ref = node.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5];
|
||||||
year = "20" + year;
|
year = "20" + year;
|
||||||
month -= 1;
|
month -= 1;
|
||||||
hour = g.chanOffset + Number(hour);
|
hour = chanOffset + Number(hour);
|
||||||
return new Date(year, month, day, hour, min);
|
return new Date(year, month, day, hour, min);
|
||||||
};
|
};
|
||||||
return g.callbacks.push(Time.node);
|
return g.callbacks.push(Time.node);
|
||||||
@ -2397,7 +2389,7 @@
|
|||||||
return this.classList.toggle('inlined');
|
return this.classList.toggle('inlined');
|
||||||
},
|
},
|
||||||
add: function(q, id) {
|
add: function(q, id) {
|
||||||
var el, inline, root, threadID;
|
var el, inline, pathname, root, threadID;
|
||||||
root = q.parentNode.nodeName === 'FONT' ? q.parentNode : q.nextSibling ? q.nextSibling : q;
|
root = q.parentNode.nodeName === 'FONT' ? q.parentNode : q.nextSibling ? q.nextSibling : q;
|
||||||
if (el = $.id(id)) {
|
if (el = $.id(id)) {
|
||||||
inline = quoteInline.table(id, el.innerHTML);
|
inline = quoteInline.table(id, el.innerHTML);
|
||||||
@ -2961,24 +2953,25 @@
|
|||||||
};
|
};
|
||||||
Main = {
|
Main = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var cutoff, hiddenThreads, id, lastChecked, nodes, now, timestamp, _ref;
|
var cutoff, hiddenThreads, id, lastChecked, now, pathname, reqUpdate, temp, timestamp, _ref;
|
||||||
$.unbind(document, 'DOMContentLoaded', Main.init);
|
|
||||||
if (location.hostname === 'sys.4chan.org') {
|
if (location.hostname === 'sys.4chan.org') {
|
||||||
QR.sys();
|
QR.sys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (conf['404 Redirect'] && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) {
|
|
||||||
redirect();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!$('#navtopr')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$.bind(window, 'message', Main.message);
|
$.bind(window, 'message', Main.message);
|
||||||
Favicon.init();
|
pathname = location.pathname.substring(1).split('/');
|
||||||
|
g.BOARD = pathname[0], temp = pathname[1];
|
||||||
|
if (temp === 'res') {
|
||||||
|
g.REPLY = temp;
|
||||||
|
g.THREAD_ID = pathname[2];
|
||||||
|
} else {
|
||||||
|
g.PAGENUM = parseInt(temp) || 0;
|
||||||
|
}
|
||||||
|
g.hiddenReplies = $.get("hiddenReplies/" + g.BOARD + "/", {});
|
||||||
lastChecked = $.get('lastChecked', 0);
|
lastChecked = $.get('lastChecked', 0);
|
||||||
now = Date.now();
|
now = Date.now();
|
||||||
if (lastChecked < now - 1 * DAY) {
|
reqUpdate = lastChecked < now - 1 * DAY;
|
||||||
|
if (reqUpdate) {
|
||||||
$.set('lastChecked', now);
|
$.set('lastChecked', now);
|
||||||
cutoff = now - 7 * DAY;
|
cutoff = now - 7 * DAY;
|
||||||
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
|
hiddenThreads = $.get("hiddenThreads/" + g.BOARD + "/", {});
|
||||||
@ -2998,19 +2991,14 @@
|
|||||||
$.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
|
$.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads);
|
||||||
$.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
|
$.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
|
||||||
}
|
}
|
||||||
$.addStyle(Main.css);
|
|
||||||
threading.init();
|
|
||||||
if (conf['Filter']) {
|
if (conf['Filter']) {
|
||||||
filter.init();
|
filter.init();
|
||||||
}
|
}
|
||||||
if (conf['Reply Hiding']) {
|
if (conf['Reply Hiding']) {
|
||||||
replyHiding.init();
|
replyHiding.init();
|
||||||
}
|
}
|
||||||
if (conf['Image Expansion']) {
|
if (conf['Anonymize']) {
|
||||||
imgExpand.init();
|
anonymize.init();
|
||||||
}
|
|
||||||
if (conf['Image Auto-Gif']) {
|
|
||||||
imgGif.init();
|
|
||||||
}
|
}
|
||||||
if (conf['Time Formatting']) {
|
if (conf['Time Formatting']) {
|
||||||
Time.init();
|
Time.init();
|
||||||
@ -3018,18 +3006,12 @@
|
|||||||
if (conf['Sauce']) {
|
if (conf['Sauce']) {
|
||||||
sauce.init();
|
sauce.init();
|
||||||
}
|
}
|
||||||
if (conf['Reveal Spoilers'] && $('.postarea label')) {
|
if (conf['Image Auto-Gif']) {
|
||||||
revealSpoilers.init();
|
imgGif.init();
|
||||||
}
|
|
||||||
if (conf['Anonymize']) {
|
|
||||||
anonymize.init();
|
|
||||||
}
|
}
|
||||||
if (conf['Image Hover']) {
|
if (conf['Image Hover']) {
|
||||||
imgHover.init();
|
imgHover.init();
|
||||||
}
|
}
|
||||||
if (conf['Quick Reply']) {
|
|
||||||
QR.init();
|
|
||||||
}
|
|
||||||
if (conf['Report Button']) {
|
if (conf['Report Button']) {
|
||||||
reportButton.init();
|
reportButton.init();
|
||||||
}
|
}
|
||||||
@ -3045,6 +3027,39 @@
|
|||||||
if (conf['Indicate OP quote']) {
|
if (conf['Indicate OP quote']) {
|
||||||
quoteOP.init();
|
quoteOP.init();
|
||||||
}
|
}
|
||||||
|
if (g.REPLY) {
|
||||||
|
if (conf['Image Preloading']) {
|
||||||
|
imgPreloading.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (d.body) {
|
||||||
|
return Main.onLoad();
|
||||||
|
} else {
|
||||||
|
return $.bind(d, 'DOMContentLoaded', Main.onLoad);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad: function() {
|
||||||
|
var nodes;
|
||||||
|
$.unbind(document, 'DOMContentLoaded', Main.onLoad);
|
||||||
|
if (conf['404 Redirect'] && d.title === '4chan - 404' && /^\d+$/.test(g.THREAD_ID)) {
|
||||||
|
redirect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!$('#navtopr')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.addStyle(Main.css);
|
||||||
|
threading.init();
|
||||||
|
Favicon.init();
|
||||||
|
if (conf['Image Expansion']) {
|
||||||
|
imgExpand.init();
|
||||||
|
}
|
||||||
|
if (conf['Reveal Spoilers'] && $('.postarea label')) {
|
||||||
|
revealSpoilers.init();
|
||||||
|
}
|
||||||
|
if (conf['Quick Reply']) {
|
||||||
|
QR.init();
|
||||||
|
}
|
||||||
if (conf['Thread Watcher']) {
|
if (conf['Thread Watcher']) {
|
||||||
watcher.init();
|
watcher.init();
|
||||||
}
|
}
|
||||||
@ -3055,34 +3070,31 @@
|
|||||||
if (conf['Thread Updater']) {
|
if (conf['Thread Updater']) {
|
||||||
updater.init();
|
updater.init();
|
||||||
}
|
}
|
||||||
if (conf['Image Preloading']) {
|
|
||||||
imgPreloading.init();
|
|
||||||
}
|
|
||||||
if (conf['Post in Title']) {
|
|
||||||
titlePost.init();
|
|
||||||
}
|
|
||||||
if (conf['Thread Stats']) {
|
if (conf['Thread Stats']) {
|
||||||
threadStats.init();
|
threadStats.init();
|
||||||
}
|
}
|
||||||
if (conf['Unread Count']) {
|
|
||||||
unread.init();
|
|
||||||
}
|
|
||||||
if (conf['Reply Navigation']) {
|
if (conf['Reply Navigation']) {
|
||||||
nav.init();
|
nav.init();
|
||||||
}
|
}
|
||||||
|
if (conf['Post in Title']) {
|
||||||
|
titlePost.init();
|
||||||
|
}
|
||||||
|
if (conf['Unread Count']) {
|
||||||
|
unread.init();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (conf['Thread Hiding']) {
|
if (conf['Thread Hiding']) {
|
||||||
threadHiding.init();
|
threadHiding.init();
|
||||||
}
|
}
|
||||||
if (conf['Index Navigation']) {
|
|
||||||
nav.init();
|
|
||||||
}
|
|
||||||
if (conf['Thread Expansion']) {
|
if (conf['Thread Expansion']) {
|
||||||
expandThread.init();
|
expandThread.init();
|
||||||
}
|
}
|
||||||
if (conf['Comment Expansion']) {
|
if (conf['Comment Expansion']) {
|
||||||
expandComment.init();
|
expandComment.init();
|
||||||
}
|
}
|
||||||
|
if (conf['Index Navigation']) {
|
||||||
|
nav.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nodes = $$('.op, a + table');
|
nodes = $$('.op, a + table');
|
||||||
g.callbacks.forEach(function(callback) {
|
g.callbacks.forEach(function(callback) {
|
||||||
@ -3380,9 +3392,5 @@
|
|||||||
}\
|
}\
|
||||||
'
|
'
|
||||||
};
|
};
|
||||||
if (d.body) {
|
Main.init();
|
||||||
Main.init();
|
|
||||||
} else {
|
|
||||||
$.bind(d, 'DOMContentLoaded', Main.init);
|
|
||||||
}
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|||||||
125
script.coffee
125
script.coffee
@ -374,20 +374,6 @@ else
|
|||||||
for key, val of conf
|
for key, val of conf
|
||||||
conf[key] = $.get key, val
|
conf[key] = $.get key, val
|
||||||
|
|
||||||
pathname = location.pathname.substring(1).split('/')
|
|
||||||
[g.BOARD, temp] = pathname
|
|
||||||
if temp is 'res'
|
|
||||||
g.REPLY = temp
|
|
||||||
g.THREAD_ID = pathname[2]
|
|
||||||
else
|
|
||||||
g.PAGENUM = parseInt(temp) or 0
|
|
||||||
|
|
||||||
g.hiddenReplies = $.get "hiddenReplies/#{g.BOARD}/", {}
|
|
||||||
# GMT -8 is given as +480; would GMT +8 be -480 ?
|
|
||||||
g.chanOffset = 5 - new Date().getTimezoneOffset() / 60
|
|
||||||
# 4chan = EST = GMT -5
|
|
||||||
g.chanOffset-- if $.isDST()
|
|
||||||
|
|
||||||
$$ = (selector, root=d.body) ->
|
$$ = (selector, root=d.body) ->
|
||||||
Array::slice.call root.querySelectorAll selector
|
Array::slice.call root.querySelectorAll selector
|
||||||
|
|
||||||
@ -1359,7 +1345,7 @@ threading =
|
|||||||
threadHiding =
|
threadHiding =
|
||||||
init: ->
|
init: ->
|
||||||
hiddenThreads = $.get "hiddenThreads/#{g.BOARD}/", {}
|
hiddenThreads = $.get "hiddenThreads/#{g.BOARD}/", {}
|
||||||
for thread in $$ 'div.thread'
|
for thread in $$ '.thread'
|
||||||
op = thread.firstChild
|
op = thread.firstChild
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
textContent: '[ - ]'
|
textContent: '[ - ]'
|
||||||
@ -1669,16 +1655,21 @@ Time =
|
|||||||
init: ->
|
init: ->
|
||||||
Time.foo()
|
Time.foo()
|
||||||
|
|
||||||
|
# GMT -8 is given as +480; would GMT +8 be -480 ?
|
||||||
|
chanOffset = 5 - new Date().getTimezoneOffset() / 60
|
||||||
|
# 4chan = EST = GMT -5
|
||||||
|
chanOffset-- if $.isDST()
|
||||||
|
|
||||||
@parse =
|
@parse =
|
||||||
if Date.parse '10/11/11(Tue)18:53'
|
if Date.parse '10/11/11(Tue)18:53'
|
||||||
(node) -> new Date Date.parse(node.textContent) + g.chanOffset*HOUR
|
(node) -> new Date Date.parse(node.textContent) + chanOffset*HOUR
|
||||||
else # Firefox the Archaic cannot parse 4chan's time
|
else # Firefox the Archaic cannot parse 4chan's time
|
||||||
(node) ->
|
(node) ->
|
||||||
[_, month, day, year, hour, min] =
|
[_, month, day, year, hour, min] =
|
||||||
node.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/
|
node.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/
|
||||||
year = "20#{year}"
|
year = "20#{year}"
|
||||||
month -= 1 #months start at 0
|
month -= 1 #months start at 0
|
||||||
hour = g.chanOffset + Number hour
|
hour = chanOffset + Number hour
|
||||||
new Date year, month, day, hour, min
|
new Date year, month, day, hour, min
|
||||||
|
|
||||||
g.callbacks.push Time.node
|
g.callbacks.push Time.node
|
||||||
@ -2245,22 +2236,27 @@ firstRun =
|
|||||||
|
|
||||||
Main =
|
Main =
|
||||||
init: ->
|
init: ->
|
||||||
$.unbind document, 'DOMContentLoaded', Main.init
|
|
||||||
if location.hostname is 'sys.4chan.org'
|
if location.hostname is 'sys.4chan.org'
|
||||||
QR.sys()
|
QR.sys()
|
||||||
return
|
return
|
||||||
if conf['404 Redirect'] and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID
|
|
||||||
redirect()
|
|
||||||
return
|
|
||||||
if not $ '#navtopr'
|
|
||||||
return
|
|
||||||
|
|
||||||
$.bind window, 'message', Main.message
|
$.bind window, 'message', Main.message
|
||||||
Favicon.init()
|
|
||||||
|
pathname = location.pathname.substring(1).split('/')
|
||||||
|
[g.BOARD, temp] = pathname
|
||||||
|
if temp is 'res'
|
||||||
|
g.REPLY = temp
|
||||||
|
g.THREAD_ID = pathname[2]
|
||||||
|
else
|
||||||
|
g.PAGENUM = parseInt(temp) or 0
|
||||||
|
|
||||||
|
g.hiddenReplies = $.get "hiddenReplies/#{g.BOARD}/", {}
|
||||||
|
|
||||||
lastChecked = $.get 'lastChecked', 0
|
lastChecked = $.get 'lastChecked', 0
|
||||||
now = Date.now()
|
now = Date.now()
|
||||||
if lastChecked < now - 1*DAY
|
reqUpdate = lastChecked < now - 1*DAY
|
||||||
|
|
||||||
|
if reqUpdate
|
||||||
$.set 'lastChecked', now
|
$.set 'lastChecked', now
|
||||||
|
|
||||||
cutoff = now - 7*DAY
|
cutoff = now - 7*DAY
|
||||||
@ -2277,22 +2273,16 @@ Main =
|
|||||||
$.set "hiddenThreads/#{g.BOARD}/", hiddenThreads
|
$.set "hiddenThreads/#{g.BOARD}/", hiddenThreads
|
||||||
$.set "hiddenReplies/#{g.BOARD}/", g.hiddenReplies
|
$.set "hiddenReplies/#{g.BOARD}/", g.hiddenReplies
|
||||||
|
|
||||||
$.addStyle Main.css
|
|
||||||
|
|
||||||
#major features
|
#major features
|
||||||
threading.init()
|
|
||||||
|
|
||||||
if conf['Filter']
|
if conf['Filter']
|
||||||
filter.init()
|
filter.init()
|
||||||
|
|
||||||
if conf['Reply Hiding']
|
if conf['Reply Hiding']
|
||||||
replyHiding.init()
|
replyHiding.init()
|
||||||
|
|
||||||
if conf['Image Expansion']
|
if conf['Anonymize']
|
||||||
imgExpand.init()
|
anonymize.init()
|
||||||
|
|
||||||
if conf['Image Auto-Gif']
|
|
||||||
imgGif.init()
|
|
||||||
|
|
||||||
if conf['Time Formatting']
|
if conf['Time Formatting']
|
||||||
Time.init()
|
Time.init()
|
||||||
@ -2300,18 +2290,12 @@ Main =
|
|||||||
if conf['Sauce']
|
if conf['Sauce']
|
||||||
sauce.init()
|
sauce.init()
|
||||||
|
|
||||||
if conf['Reveal Spoilers'] and $('.postarea label')
|
if conf['Image Auto-Gif']
|
||||||
revealSpoilers.init()
|
imgGif.init()
|
||||||
|
|
||||||
if conf['Anonymize']
|
|
||||||
anonymize.init()
|
|
||||||
|
|
||||||
if conf['Image Hover']
|
if conf['Image Hover']
|
||||||
imgHover.init()
|
imgHover.init()
|
||||||
|
|
||||||
if conf['Quick Reply']
|
|
||||||
QR.init()
|
|
||||||
|
|
||||||
if conf['Report Button']
|
if conf['Report Button']
|
||||||
reportButton.init()
|
reportButton.init()
|
||||||
|
|
||||||
@ -2327,6 +2311,38 @@ Main =
|
|||||||
if conf['Indicate OP quote']
|
if conf['Indicate OP quote']
|
||||||
quoteOP.init()
|
quoteOP.init()
|
||||||
|
|
||||||
|
if g.REPLY
|
||||||
|
if conf['Image Preloading']
|
||||||
|
imgPreloading.init()
|
||||||
|
|
||||||
|
|
||||||
|
if d.body
|
||||||
|
Main.onLoad()
|
||||||
|
else
|
||||||
|
$.bind d, 'DOMContentLoaded', Main.onLoad
|
||||||
|
|
||||||
|
onLoad: ->
|
||||||
|
$.unbind document, 'DOMContentLoaded', Main.onLoad
|
||||||
|
if conf['404 Redirect'] and d.title is '4chan - 404' and /^\d+$/.test g.THREAD_ID
|
||||||
|
redirect()
|
||||||
|
return
|
||||||
|
if not $ '#navtopr'
|
||||||
|
return
|
||||||
|
$.addStyle Main.css
|
||||||
|
threading.init()
|
||||||
|
Favicon.init()
|
||||||
|
|
||||||
|
|
||||||
|
#major features
|
||||||
|
if conf['Image Expansion']
|
||||||
|
imgExpand.init()
|
||||||
|
|
||||||
|
if conf['Reveal Spoilers'] and $('.postarea label')
|
||||||
|
revealSpoilers.init()
|
||||||
|
|
||||||
|
if conf['Quick Reply']
|
||||||
|
QR.init()
|
||||||
|
|
||||||
if conf['Thread Watcher']
|
if conf['Thread Watcher']
|
||||||
watcher.init()
|
watcher.init()
|
||||||
|
|
||||||
@ -2337,34 +2353,32 @@ Main =
|
|||||||
if conf['Thread Updater']
|
if conf['Thread Updater']
|
||||||
updater.init()
|
updater.init()
|
||||||
|
|
||||||
if conf['Image Preloading']
|
|
||||||
imgPreloading.init()
|
|
||||||
|
|
||||||
if conf['Post in Title']
|
|
||||||
titlePost.init()
|
|
||||||
|
|
||||||
if conf['Thread Stats']
|
if conf['Thread Stats']
|
||||||
threadStats.init()
|
threadStats.init()
|
||||||
|
|
||||||
if conf['Unread Count']
|
|
||||||
unread.init()
|
|
||||||
|
|
||||||
if conf['Reply Navigation']
|
if conf['Reply Navigation']
|
||||||
nav.init()
|
nav.init()
|
||||||
|
|
||||||
|
if conf['Post in Title']
|
||||||
|
titlePost.init()
|
||||||
|
|
||||||
|
if conf['Unread Count']
|
||||||
|
unread.init()
|
||||||
|
|
||||||
else #not reply
|
else #not reply
|
||||||
if conf['Thread Hiding']
|
if conf['Thread Hiding']
|
||||||
threadHiding.init()
|
threadHiding.init()
|
||||||
|
|
||||||
if conf['Index Navigation']
|
|
||||||
nav.init()
|
|
||||||
|
|
||||||
if conf['Thread Expansion']
|
if conf['Thread Expansion']
|
||||||
expandThread.init()
|
expandThread.init()
|
||||||
|
|
||||||
if conf['Comment Expansion']
|
if conf['Comment Expansion']
|
||||||
expandComment.init()
|
expandComment.init()
|
||||||
|
|
||||||
|
if conf['Index Navigation']
|
||||||
|
nav.init()
|
||||||
|
|
||||||
|
|
||||||
nodes = $$ '.op, a + table'
|
nodes = $$ '.op, a + table'
|
||||||
g.callbacks.forEach (callback) ->
|
g.callbacks.forEach (callback) ->
|
||||||
try
|
try
|
||||||
@ -2652,7 +2666,4 @@ Main =
|
|||||||
}
|
}
|
||||||
'
|
'
|
||||||
|
|
||||||
if d.body
|
Main.init()
|
||||||
Main.init()
|
|
||||||
else
|
|
||||||
$.bind d, 'DOMContentLoaded', Main.init
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user