Don't parse catalog quotelinks. Hopefully I didn't miss any.

This commit is contained in:
Nicolas Stepien 2012-12-11 13:11:28 +01:00
parent 3c6d7e0c4f
commit 4c85e87d7e
2 changed files with 23 additions and 20 deletions

View File

@ -856,12 +856,13 @@
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if ((el = $.id(quote.hash.slice(1))) && el.hidden) {
$.addClass(quote, 'filtered');
if (Conf['Recursive Filtering'] && post.ID !== post.threadID) {
show_stub = !!$.x('preceding-sibling::div[contains(@class,"stub")]', el);
ReplyHiding.hide(post.root, show_stub);
}
if (!((el = $.id(quote.hash.slice(1))) && !/catalog$/.test(quote.pathname) && el.hidden)) {
continue;
}
$.addClass(quote, 'filtered');
if (Conf['Recursive Filtering'] && post.ID !== post.threadID) {
show_stub = !!$.x('preceding-sibling::div[contains(@class,"stub")]', el);
ReplyHiding.hide(post.root, show_stub);
}
}
}
@ -4024,7 +4025,7 @@
if (quote.parentNode.parentNode.className === 'capcodeReplies') {
break;
}
if (qid = quote.hash.slice(2)) {
if (!/catalog$/.test(quote.pathname) && (qid = quote.hash.slice(2))) {
quotes[qid] = true;
}
}
@ -4065,7 +4066,7 @@
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (!(quote.hash || /\bdeadlink\b/.test(quote.className))) {
if (!(quote.hash && !/catalog$/.test(quote.pathname) || /\bdeadlink\b/.test(quote.className))) {
continue;
}
$.on(quote, 'click', QuoteInline.toggle);
@ -4158,9 +4159,10 @@
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.hash || /\bdeadlink\b/.test(quote.className)) {
$.on(quote, 'mouseover', QuotePreview.mouseover);
if (!(quote.hash && !/catalog$/.test(quote.pathname) || /\bdeadlink\b/.test(quote.className))) {
continue;
}
$.on(quote, 'mouseover', QuotePreview.mouseover);
}
_ref1 = post.backlinks;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
@ -4297,7 +4299,7 @@
_ref = post.quotes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (!quote.hash) {
if (!(quote.hash && !/catalog$/.test(quote.pathname))) {
continue;
}
path = quote.pathname.split('/');

View File

@ -706,11 +706,11 @@ StrikethroughQuotes =
node: (post) ->
return if post.isInlined
for quote in post.quotes
if (el = $.id quote.hash[1..]) and el.hidden
$.addClass quote, 'filtered'
if Conf['Recursive Filtering'] and post.ID isnt post.threadID
show_stub = !!$.x 'preceding-sibling::div[contains(@class,"stub")]', el
ReplyHiding.hide post.root, show_stub
continue unless (el = $.id quote.hash[1..]) and !/catalog$/.test(quote.pathname) and el.hidden
$.addClass quote, 'filtered'
if Conf['Recursive Filtering'] and post.ID isnt post.threadID
show_stub = !!$.x 'preceding-sibling::div[contains(@class,"stub")]', el
ReplyHiding.hide post.root, show_stub
return
ExpandComment =
@ -3319,7 +3319,7 @@ QuoteBacklink =
# Stop at 'Admin/Mod/Dev Replies:' on /q/
break if quote.parentNode.parentNode.className is 'capcodeReplies'
# Don't process >>>/b/.
if qid = quote.hash[2..]
if !/catalog$/.test(quote.pathname) and qid = quote.hash[2..]
# Duplicate quotes get overwritten.
quotes[qid] = true
a = $.el 'a',
@ -3347,7 +3347,7 @@ QuoteInline =
Main.callbacks.push @node
node: (post) ->
for quote in post.quotes
continue unless quote.hash or /\bdeadlink\b/.test quote.className
continue unless quote.hash and !/catalog$/.test(quote.pathname) or /\bdeadlink\b/.test quote.className
$.on quote, 'click', QuoteInline.toggle
for quote in post.backlinks
$.on quote, 'click', QuoteInline.toggle
@ -3416,7 +3416,8 @@ QuotePreview =
Main.callbacks.push @node
node: (post) ->
for quote in post.quotes
$.on quote, 'mouseover', QuotePreview.mouseover if quote.hash or /\bdeadlink\b/.test quote.className
continue unless quote.hash and !/catalog$/.test(quote.pathname) or /\bdeadlink\b/.test quote.className
$.on quote, 'mouseover', QuotePreview.mouseover
for quote in post.backlinks
$.on quote, 'mouseover', QuotePreview.mouseover
return
@ -3511,7 +3512,7 @@ QuoteCT =
node: (post) ->
return if post.isInlined and not post.isCrosspost
for quote in post.quotes
unless quote.hash
unless quote.hash and !/catalog$/.test quote.pathname
# Make sure this isn't a link to the board we're on.
continue
path = quote.pathname.split '/'