Fix 4chan X on /f/. Small optimizations while I'm at it. Close #129

This commit is contained in:
Nicolas Stepien 2012-01-29 03:19:54 +01:00
parent 0dce1dd7a9
commit 047f056c4c
3 changed files with 11 additions and 7 deletions

View File

@ -2276,9 +2276,9 @@
return g.callbacks.push(Time.node);
},
node: function(root) {
var node, posttime, time;
var node, time;
if (root.className === 'inline') return;
node = (posttime = $('.posttime', root)) ? posttime : $('span[id]', root).previousSibling;
node = $('.posttime', root) || $('span[id]', root).previousSibling;
Time.date = Time.parse(node);
time = $.el('time', {
textContent: ' ' + Time.funk(Time) + ' '
@ -3165,7 +3165,8 @@
if (conf['Comment Expansion']) expandComment.init();
if (conf['Index Navigation']) nav.init();
}
nodes = $$('.op, a + table');
form = $('body > form');
nodes = $$('.op, a + table', form);
_ref = g.callbacks;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
callback = _ref[_i];
@ -3178,7 +3179,7 @@
alert(err);
}
}
return $.on($('form[name=delform]'), 'DOMNodeInserted', Main.node);
return $.on(form, 'DOMNodeInserted', Main.node);
},
message: function(e) {
var data, origin;

View File

@ -1,4 +1,6 @@
master
- Mayhem
Fix 4chan X on /f/.
2.24.5
- Mayhem

View File

@ -1824,7 +1824,7 @@ Time =
g.callbacks.push Time.node
node: (root) ->
return if root.className is 'inline'
node = if posttime = $('.posttime', root) then posttime else $('span[id]', root).previousSibling
node = $('.posttime', root) or $('span[id]', root).previousSibling
Time.date = Time.parse node
time = $.el 'time',
textContent: ' ' + Time.funk(Time) + ' '
@ -2532,14 +2532,15 @@ Main =
nav.init()
nodes = $$ '.op, a + table'
form = $ 'body > form'
nodes = $$ '.op, a + table', form
for callback in g.callbacks
try
for node in nodes
callback node
catch err
alert err
$.on $('form[name=delform]'), 'DOMNodeInserted', Main.node
$.on form, 'DOMNodeInserted', Main.node
message: (e) ->
{origin, data} = e