diff --git a/4chan_x.user.js b/4chan_x.user.js index 20e7311ef..a3173cd2a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2570,9 +2570,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) + ' ' @@ -3450,7 +3450,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]; @@ -3463,7 +3464,7 @@ alert(err); } } - return $.on($('form[name=delform]'), 'DOMNodeInserted', Main.node); + return $.on(form, 'DOMNodeInserted', Main.node); }, message: function(e) { var data, version; diff --git a/changelog b/changelog index 83fb8f7e9..cde88ebe9 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Fix 4chan X on /f/. 2.24.5 - Mayhem diff --git a/script.coffee b/script.coffee index 35cf46ab4..d78d0129f 100644 --- a/script.coffee +++ b/script.coffee @@ -2026,7 +2026,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) + ' ' @@ -2719,14 +2719,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) -> {data} = e