Function, make sauce work without ++unread
This commit is contained in:
parent
ef6937f689
commit
696b25c290
17
4chan_x.js
17
4chan_x.js
@ -1595,7 +1595,7 @@
|
|||||||
cb: {
|
cb: {
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
var i, link, names, prefix, prefixes, s, span, suffix, _len, _results;
|
var i, link, names, prefix, prefixes, s, span, suffix, _len, _results;
|
||||||
if (root.className === 'inline') {
|
if (root.className === 'inline' && root.className !== 'crossquote') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
prefixes = (function() {
|
prefixes = (function() {
|
||||||
@ -1745,10 +1745,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (el = d.getElementById(id)) {
|
if (el = d.getElementById(id)) {
|
||||||
inline = $.el('table', {
|
inline = quoteInline.table(id, el.innerHTML);
|
||||||
className: 'inline',
|
|
||||||
innerHTML: "<tbody><tr><td class=reply id=i" + id + ">" + el.innerHTML + "</td></tr></tbody>"
|
|
||||||
});
|
|
||||||
if (this.className === 'backlink') {
|
if (this.className === 'backlink') {
|
||||||
$.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline);
|
$.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline);
|
||||||
return $.hide($.x('ancestor::table[1]', el));
|
return $.hide($.x('ancestor::table[1]', el));
|
||||||
@ -1795,11 +1792,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newInline = $.el('table', {
|
newInline = quoteInline.table(id, html);
|
||||||
|
$.addClass(newInline, 'crossquote');
|
||||||
|
return $.replace(inline, newInline);
|
||||||
|
},
|
||||||
|
table: function(id, html) {
|
||||||
|
return $.el('table', {
|
||||||
|
className: 'inline',
|
||||||
innerHTML: "<tbody><tr><td class=reply id=i" + id + ">" + html + "</td></tr></tbody>"
|
innerHTML: "<tbody><tr><td class=reply id=i" + id + ">" + html + "</td></tr></tbody>"
|
||||||
});
|
});
|
||||||
$.replace(inline, newInline);
|
|
||||||
return newInline.className = 'inline';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
quotePreview = {
|
quotePreview = {
|
||||||
|
|||||||
@ -1306,7 +1306,7 @@ sauce =
|
|||||||
g.callbacks.push sauce.cb.node
|
g.callbacks.push sauce.cb.node
|
||||||
cb:
|
cb:
|
||||||
node: (root) ->
|
node: (root) ->
|
||||||
return if root.className is 'inline'
|
return if root.className is 'inline' and root.className isnt 'crossquote'
|
||||||
prefixes = (s for s in ($.config('flavors').split '\n') when s[0] != '#')
|
prefixes = (s for s in ($.config('flavors').split '\n') when s[0] != '#')
|
||||||
names = (prefix.match(/(\w+)\./)[1] for prefix in prefixes)
|
names = (prefix.match(/(\w+)\./)[1] for prefix in prefixes)
|
||||||
if span = $ 'span.filesize', root
|
if span = $ 'span.filesize', root
|
||||||
@ -1394,9 +1394,7 @@ quoteInline =
|
|||||||
$.show $.x 'ancestor::table[1]', d.getElementById id
|
$.show $.x 'ancestor::table[1]', d.getElementById id
|
||||||
return
|
return
|
||||||
if el = d.getElementById id
|
if el = d.getElementById id
|
||||||
inline = $.el 'table',
|
inline = quoteInline.table id, el.innerHTML
|
||||||
className: 'inline'
|
|
||||||
innerHTML: "<tbody><tr><td class=reply id=i#{id}>#{el.innerHTML}</td></tr></tbody>"
|
|
||||||
if @className is 'backlink'
|
if @className is 'backlink'
|
||||||
$.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline
|
$.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline
|
||||||
$.hide $.x 'ancestor::table[1]', el
|
$.hide $.x 'ancestor::table[1]', el
|
||||||
@ -1430,10 +1428,13 @@ quoteInline =
|
|||||||
if reply.id == id
|
if reply.id == id
|
||||||
html = reply.innerHTML
|
html = reply.innerHTML
|
||||||
break
|
break
|
||||||
newInline = $.el 'table',
|
newInline = quoteInline.table id, html
|
||||||
innerHTML: "<tbody><tr><td class=reply id=i#{id}>#{html}</td></tr></tbody>"
|
$.addClass newInline, 'crossquote'
|
||||||
$.replace inline, newInline
|
$.replace inline, newInline
|
||||||
newInline.className = 'inline'
|
table: (id, html) ->
|
||||||
|
$.el 'table',
|
||||||
|
className: 'inline'
|
||||||
|
innerHTML: "<tbody><tr><td class=reply id=i#{id}>#{html}</td></tr></tbody>"
|
||||||
|
|
||||||
quotePreview =
|
quotePreview =
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user