Don't know how I missed that while merging...
This commit is contained in:
parent
f167a2f657
commit
75c76d5ed0
@ -15752,12 +15752,10 @@
|
|||||||
switch (view) {
|
switch (view) {
|
||||||
case 'index':
|
case 'index':
|
||||||
delete g.THREADID;
|
delete g.THREADID;
|
||||||
QR.link.textContent = 'Start a Thread';
|
|
||||||
$.off(d, 'ThreadUpdate', QR.statusCheck);
|
$.off(d, 'ThreadUpdate', QR.statusCheck);
|
||||||
return $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
return $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
||||||
case 'thread':
|
case 'thread':
|
||||||
g.THREADID = +window.location.pathname.split('/')[3];
|
g.THREADID = +window.location.pathname.split('/')[3];
|
||||||
QR.link.textContent = 'Reply to Thread';
|
|
||||||
$.on(d, 'ThreadUpdate', QR.statusCheck);
|
$.on(d, 'ThreadUpdate', QR.statusCheck);
|
||||||
return $.off(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
return $.off(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
||||||
}
|
}
|
||||||
@ -17245,7 +17243,7 @@
|
|||||||
return $.ready(Main.initReady);
|
return $.ready(Main.initReady);
|
||||||
},
|
},
|
||||||
initReady: function() {
|
initReady: function() {
|
||||||
var GMver, err, errors, href, i, passLink, post, postRoot, posts, styleSelector, thread, threadRoot, v, _i, _j, _len, _len1, _ref, _ref1, _ref2;
|
var GMver, err, href, i, passLink, styleSelector, v, _i, _len, _ref, _ref1;
|
||||||
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
|
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
|
||||||
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
|
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
|
||||||
href = Redirect.to('thread', {
|
href = Redirect.to('thread', {
|
||||||
@ -17257,35 +17255,6 @@
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g.VIEW === 'thread' && (threadRoot = $('.thread'))) {
|
|
||||||
thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
|
|
||||||
posts = [];
|
|
||||||
_ref1 = $$('.thread > .postContainer', threadRoot);
|
|
||||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
|
||||||
postRoot = _ref1[_i];
|
|
||||||
try {
|
|
||||||
posts.push(post = new Post(postRoot, thread, g.BOARD, {
|
|
||||||
isOriginalMarkup: true
|
|
||||||
}));
|
|
||||||
} catch (_error) {
|
|
||||||
err = _error;
|
|
||||||
if (!errors) {
|
|
||||||
errors = [];
|
|
||||||
}
|
|
||||||
errors.push({
|
|
||||||
message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
|
|
||||||
error: err
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (errors) {
|
|
||||||
Main.handleErrors(errors);
|
|
||||||
}
|
|
||||||
Main.callbackNodes(Thread, [thread]);
|
|
||||||
Main.callbackNodesDB(Post, posts, function() {
|
|
||||||
return $.event('4chanXInitFinished');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (styleSelector = $.id('styleSelector')) {
|
if (styleSelector = $.id('styleSelector')) {
|
||||||
passLink = $.el('a', {
|
passLink = $.el('a', {
|
||||||
textContent: '4chan Pass',
|
textContent: '4chan Pass',
|
||||||
@ -17302,9 +17271,9 @@
|
|||||||
$.event('4chanXInitFinished');
|
$.event('4chanXInitFinished');
|
||||||
}
|
}
|
||||||
GMver = GM_info.version.split('.');
|
GMver = GM_info.version.split('.');
|
||||||
_ref2 = "1.13".split('.');
|
_ref1 = "1.13".split('.');
|
||||||
for (i = _j = 0, _len1 = _ref2.length; _j < _len1; i = ++_j) {
|
for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
|
||||||
v = _ref2[i];
|
v = _ref1[i];
|
||||||
if (v === GMver[i]) {
|
if (v === GMver[i]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15748,12 +15748,10 @@
|
|||||||
switch (view) {
|
switch (view) {
|
||||||
case 'index':
|
case 'index':
|
||||||
delete g.THREADID;
|
delete g.THREADID;
|
||||||
QR.link.textContent = 'Start a Thread';
|
|
||||||
$.off(d, 'ThreadUpdate', QR.statusCheck);
|
$.off(d, 'ThreadUpdate', QR.statusCheck);
|
||||||
return $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
return $.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
||||||
case 'thread':
|
case 'thread':
|
||||||
g.THREADID = +window.location.pathname.split('/')[3];
|
g.THREADID = +window.location.pathname.split('/')[3];
|
||||||
QR.link.textContent = 'Reply to Thread';
|
|
||||||
$.on(d, 'ThreadUpdate', QR.statusCheck);
|
$.on(d, 'ThreadUpdate', QR.statusCheck);
|
||||||
return $.off(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
return $.off(d, 'IndexRefresh', QR.generatePostableThreadsList);
|
||||||
}
|
}
|
||||||
@ -17233,7 +17231,7 @@
|
|||||||
return $.ready(Main.initReady);
|
return $.ready(Main.initReady);
|
||||||
},
|
},
|
||||||
initReady: function() {
|
initReady: function() {
|
||||||
var err, errors, href, passLink, post, postRoot, posts, styleSelector, thread, threadRoot, _i, _len, _ref, _ref1;
|
var err, href, passLink, styleSelector, _ref;
|
||||||
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
|
if ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found') {
|
||||||
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
|
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
|
||||||
href = Redirect.to('thread', {
|
href = Redirect.to('thread', {
|
||||||
@ -17245,35 +17243,6 @@
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (g.VIEW === 'thread' && (threadRoot = $('.thread'))) {
|
|
||||||
thread = new Thread(+threadRoot.id.slice(1), g.BOARD);
|
|
||||||
posts = [];
|
|
||||||
_ref1 = $$('.thread > .postContainer', threadRoot);
|
|
||||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
|
||||||
postRoot = _ref1[_i];
|
|
||||||
try {
|
|
||||||
posts.push(post = new Post(postRoot, thread, g.BOARD, {
|
|
||||||
isOriginalMarkup: true
|
|
||||||
}));
|
|
||||||
} catch (_error) {
|
|
||||||
err = _error;
|
|
||||||
if (!errors) {
|
|
||||||
errors = [];
|
|
||||||
}
|
|
||||||
errors.push({
|
|
||||||
message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.",
|
|
||||||
error: err
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (errors) {
|
|
||||||
Main.handleErrors(errors);
|
|
||||||
}
|
|
||||||
Main.callbackNodes(Thread, [thread]);
|
|
||||||
Main.callbackNodesDB(Post, posts, function() {
|
|
||||||
return $.event('4chanXInitFinished');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (styleSelector = $.id('styleSelector')) {
|
if (styleSelector = $.id('styleSelector')) {
|
||||||
passLink = $.el('a', {
|
passLink = $.el('a', {
|
||||||
textContent: '4chan Pass',
|
textContent: '4chan Pass',
|
||||||
|
|||||||
@ -119,24 +119,6 @@ Main =
|
|||||||
location.replace href or "/#{g.BOARD}/"
|
location.replace href or "/#{g.BOARD}/"
|
||||||
return
|
return
|
||||||
|
|
||||||
if g.VIEW is 'thread' and threadRoot = $ '.thread'
|
|
||||||
thread = new Thread +threadRoot.id[1..], g.BOARD
|
|
||||||
posts = []
|
|
||||||
for postRoot in $$ '.thread > .postContainer', threadRoot
|
|
||||||
try
|
|
||||||
posts.push post = new Post postRoot, thread, g.BOARD, {isOriginalMarkup: true}
|
|
||||||
catch err
|
|
||||||
# Skip posts that we failed to parse.
|
|
||||||
errors = [] unless errors
|
|
||||||
errors.push
|
|
||||||
message: "Parsing of Post No.#{postRoot.id.match /\d+/} failed. Post will be skipped."
|
|
||||||
error: err
|
|
||||||
Main.handleErrors errors if errors
|
|
||||||
|
|
||||||
Main.callbackNodes Thread, [thread]
|
|
||||||
Main.callbackNodesDB Post, posts, ->
|
|
||||||
$.event '4chanXInitFinished'
|
|
||||||
|
|
||||||
if styleSelector = $.id 'styleSelector'
|
if styleSelector = $.id 'styleSelector'
|
||||||
passLink = $.el 'a',
|
passLink = $.el 'a',
|
||||||
textContent: '4chan Pass'
|
textContent: '4chan Pass'
|
||||||
|
|||||||
@ -94,12 +94,10 @@ Navigate =
|
|||||||
switch view
|
switch view
|
||||||
when 'index'
|
when 'index'
|
||||||
delete g.THREADID
|
delete g.THREADID
|
||||||
QR.link.textContent = 'Start a Thread'
|
|
||||||
$.off d, 'ThreadUpdate', QR.statusCheck
|
$.off d, 'ThreadUpdate', QR.statusCheck
|
||||||
$.on d, 'IndexRefresh', QR.generatePostableThreadsList
|
$.on d, 'IndexRefresh', QR.generatePostableThreadsList
|
||||||
when 'thread'
|
when 'thread'
|
||||||
g.THREADID = +window.location.pathname.split('/')[3]
|
g.THREADID = +window.location.pathname.split('/')[3]
|
||||||
QR.link.textContent = 'Reply to Thread'
|
|
||||||
$.on d, 'ThreadUpdate', QR.statusCheck
|
$.on d, 'ThreadUpdate', QR.statusCheck
|
||||||
$.off d, 'IndexRefresh', QR.generatePostableThreadsList
|
$.off d, 'IndexRefresh', QR.generatePostableThreadsList
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user