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

View File

@ -1305,6 +1305,7 @@ sauce =
g.callbacks.push sauce.cb.node
cb:
node: (root) ->
return if root.className is 'inline'
prefixes = (s for s in ($.config('flavors').split '\n') when s[0] != '#')
names = (prefix.match(/(\w+)\./)[1] for prefix in prefixes)
if span = $ 'span.filesize', root
@ -1484,13 +1485,14 @@ reportButton =
g.callbacks.push reportButton.cb.node
cb:
node: (root) ->
span = $ 'span[id^=no]', root
a = $.el 'a',
className: 'reportbutton'
innerHTML: '[ ! ]'
if not a = $ 'a.reportbutton', root
span = $ 'span[id^=no]', root
a = $.el 'a',
className: 'reportbutton'
innerHTML: '[ ! ]'
$.after span, a
$.after span, $.tn(' ')
$.bind a, 'click', reportButton.cb.report
$.after span, a
$.after span, $.tn(' ')
report: (e) ->
reportButton.report this
report: (target) ->
@ -1508,6 +1510,7 @@ unread =
cb:
node: (root) ->
return if root.className is 'inline'
unread.replies.push root
unread.updateTitle()
Favicon.update()