tweaks for inline root

This commit is contained in:
James Campos 2011-05-14 09:43:19 -07:00
parent da42517019
commit 2101e7cdf0
2 changed files with 25 additions and 14 deletions

View File

@ -1604,6 +1604,9 @@
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') {
return;
}
prefixes = (function() { prefixes = (function() {
var _i, _len, _ref, _results; var _i, _len, _ref, _results;
_ref = $.config('flavors').split('\n'); _ref = $.config('flavors').split('\n');
@ -1880,14 +1883,16 @@
cb: { cb: {
node: function(root) { node: function(root) {
var a, span; var a, span;
span = $('span[id^=no]', root); if (!(a = $('a.reportbutton', root))) {
a = $.el('a', { span = $('span[id^=no]', root);
className: 'reportbutton', a = $.el('a', {
innerHTML: '[ ! ]' className: 'reportbutton',
}); innerHTML: '[ ! ]'
$.bind(a, 'click', reportButton.cb.report); });
$.after(span, a); $.after(span, a);
return $.after(span, $.tn(' ')); $.after(span, $.tn(' '));
}
return $.bind(a, 'click', reportButton.cb.report);
}, },
report: function(e) { report: function(e) {
return reportButton.report(this); return reportButton.report(this);
@ -1910,6 +1915,9 @@
}, },
cb: { cb: {
node: function(root) { node: function(root) {
if (root.className === 'inline') {
return;
}
unread.replies.push(root); unread.replies.push(root);
unread.updateTitle(); unread.updateTitle();
return Favicon.update(); return Favicon.update();

View File

@ -1305,6 +1305,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'
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
@ -1484,13 +1485,14 @@ reportButton =
g.callbacks.push reportButton.cb.node g.callbacks.push reportButton.cb.node
cb: cb:
node: (root) -> node: (root) ->
span = $ 'span[id^=no]', root if not a = $ 'a.reportbutton', root
a = $.el 'a', span = $ 'span[id^=no]', root
className: 'reportbutton' a = $.el 'a',
innerHTML: '[ ! ]' className: 'reportbutton'
innerHTML: '[ ! ]'
$.after span, a
$.after span, $.tn(' ')
$.bind a, 'click', reportButton.cb.report $.bind a, 'click', reportButton.cb.report
$.after span, a
$.after span, $.tn(' ')
report: (e) -> report: (e) ->
reportButton.report this reportButton.report this
report: (target) -> report: (target) ->
@ -1508,6 +1510,7 @@ unread =
cb: cb:
node: (root) -> node: (root) ->
return if root.className is 'inline'
unread.replies.push root unread.replies.push root
unread.updateTitle() unread.updateTitle()
Favicon.update() Favicon.update()