Fix Quote Hash Navigation on Backlinks (again)

This commit is contained in:
Zixaphir 2014-03-06 21:20:26 -07:00
parent bc15231170
commit 7bc8447d3f
4 changed files with 23 additions and 12 deletions

View File

@ -5263,6 +5263,9 @@
} }
if (Conf['Quote Inlining']) { if (Conf['Quote Inlining']) {
$.on(a, 'click', QuoteInline.toggle); $.on(a, 'click', QuoteInline.toggle);
if (Conf['Quote Hash Navigation']) {
QuoteInline.qiQuote(a, quoter.isHidden);
}
} }
return frag; return frag;
} }
@ -5274,10 +5277,11 @@
return; return;
} }
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) { this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
if (!clone) { $.on(link, 'click', QuoteInline.toggle);
$.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'))); if (clone) {
return;
} }
return $.on(link, 'click', QuoteInline.toggle); return QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
} : function(link) { } : function(link) {
return $.on(link, 'click', QuoteInline.toggle); return $.on(link, 'click', QuoteInline.toggle);
}; };
@ -5310,11 +5314,11 @@
if (hidden) { if (hidden) {
name += "filtered"; name += "filtered";
} }
return $.el('a', { return $.after(link, $.el('a', {
className: name, className: name,
textContent: '#', textContent: '#',
href: link.href href: link.href
}); }));
}, },
toggle: function(e) { toggle: function(e) {
var boardID, context, postID, threadID, _ref; var boardID, context, postID, threadID, _ref;

View File

@ -5315,6 +5315,9 @@
} }
if (Conf['Quote Inlining']) { if (Conf['Quote Inlining']) {
$.on(a, 'click', QuoteInline.toggle); $.on(a, 'click', QuoteInline.toggle);
if (Conf['Quote Hash Navigation']) {
QuoteInline.qiQuote(a, quoter.isHidden);
}
} }
return frag; return frag;
} }
@ -5326,10 +5329,11 @@
return; return;
} }
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) { this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
if (!clone) { $.on(link, 'click', QuoteInline.toggle);
$.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'))); if (clone) {
return;
} }
return $.on(link, 'click', QuoteInline.toggle); return QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
} : function(link) { } : function(link) {
return $.on(link, 'click', QuoteInline.toggle); return $.on(link, 'click', QuoteInline.toggle);
}; };
@ -5362,11 +5366,11 @@
if (hidden) { if (hidden) {
name += "filtered"; name += "filtered";
} }
return $.el('a', { return $.after(link, $.el('a', {
className: name, className: name,
textContent: '#', textContent: '#',
href: link.href href: link.href
}); }));
}, },
toggle: function(e) { toggle: function(e) {
var boardID, context, postID, threadID, _ref; var boardID, context, postID, threadID, _ref;

View File

@ -69,4 +69,6 @@ QuoteBacklink =
$.on a, 'mouseover', QuotePreview.mouseover $.on a, 'mouseover', QuotePreview.mouseover
if Conf['Quote Inlining'] if Conf['Quote Inlining']
$.on a, 'click', QuoteInline.toggle $.on a, 'click', QuoteInline.toggle
if Conf['Quote Hash Navigation']
QuoteInline.qiQuote a, quoter.isHidden
frag frag

View File

@ -4,8 +4,9 @@ QuoteInline =
@process = if Conf['Quote Hash Navigation'] @process = if Conf['Quote Hash Navigation']
(link, clone) -> (link, clone) ->
$.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone
$.on link, 'click', QuoteInline.toggle $.on link, 'click', QuoteInline.toggle
return if clone
QuoteInline.qiQuote link, $.hasClass link, 'filtered'
else else
(link) -> (link) ->
@ -28,7 +29,7 @@ QuoteInline =
qiQuote: (link, hidden) -> qiQuote: (link, hidden) ->
name = "hashlink" name = "hashlink"
name += "filtered" if hidden name += "filtered" if hidden
$.el 'a', $.after link, $.el 'a',
className: name className: name
textContent: '#' textContent: '#'
href: link.href href: link.href