diff --git a/4chan_x.user.js b/4chan_x.user.js index e3d2c3077..4d709948b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2019,11 +2019,11 @@ return g.callbacks.push(Time.node); }, node: function(root) { - var day, hour, min, month, node, time, year, _, _ref; + var day, hour, min, month, node, posttime, time, year, _, _ref; if (root.className === 'inline') { return; } - node = root.className === 'op' ? $('.posttime', root) : $('span[id]', root).previousSibling; + node = (posttime = $('.posttime', root)) ? posttime : $('span[id]', root).previousSibling; _ref = node.textContent.match(/(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/), _ = _ref[0], month = _ref[1], day = _ref[2], year = _ref[3], hour = _ref[4], min = _ref[5]; year = "20" + year; month -= 1; diff --git a/script.coffee b/script.coffee index 3902c1b1d..e21603597 100644 --- a/script.coffee +++ b/script.coffee @@ -1566,7 +1566,7 @@ Time = g.callbacks.push Time.node node: (root) -> return if root.className is 'inline' - node = if root.className is 'op' then $('.posttime', root) else $('span[id]', root).previousSibling + node = if posttime = $('.posttime', root) then posttime else $('span[id]', root).previousSibling [_, month, day, year, hour, min] = node.textContent.match /(\d+)\/(\d+)\/(\d+)\(\w+\)(\d+):(\d+)/ year = "20#{year}"