diff --git a/4chan_x.js b/4chan_x.js index 35f48e7f6..c0acd8a3f 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1588,21 +1588,6 @@ return _results; }); } - if (getConfig('Image Preloading')) { - g.callbacks.push(function(root) { - var parent, thumb, thumbs, _i, _len, _results; - thumbs = $$('img[md5]', root); - _results = []; - for (_i = 0, _len = thumbs.length; _i < _len; _i++) { - thumb = thumbs[_i]; - parent = thumb.parentNode; - _results.push(el = n('img', { - src: parent.href - })); - } - return _results; - }); - } if (getConfig('Localize Time')) { g.callbacks.push(function(root) { var date, day, dotw, hour, min_sec, month, s, span, spans, year, _i, _len, _ref, _results; @@ -1803,6 +1788,21 @@ d.addEventListener('keypress', keypress, true); } if (g.REPLY) { + if (getConfig('Image Preloading')) { + g.callbacks.push(function(root) { + var parent, thumb, thumbs, _i, _len, _results; + thumbs = $$('img[md5]', root); + _results = []; + for (_i = 0, _len = thumbs.length; _i < _len; _i++) { + thumb = thumbs[_i]; + parent = thumb.parentNode; + _results.push(el = n('img', { + src: parent.href + })); + } + return _results; + }); + } if (getConfig('Thread Updater')) { updaterMake(); } diff --git a/script.coffee b/script.coffee index 7597296f0..b0766578e 100644 --- a/script.coffee +++ b/script.coffee @@ -698,7 +698,7 @@ quickReply = (link, text) -> inBefore submit, auto mv clone, qr mv qr, d.body - qr.style.width = qr.offsetWidth + qr.style.width = qr.offsetWidth #lock $('input[title=autohide]:checked', qr)?.click() textarea = $('textarea', qr) @@ -1211,13 +1211,6 @@ if getConfig 'Image Expansion' thumb.parentNode.addEventListener 'click', imageClick, true if g.expand then imageToggle thumb.parentNode -if getConfig 'Image Preloading' - g.callbacks.push (root) -> - thumbs = $$ 'img[md5]', root - for thumb in thumbs - parent = thumb.parentNode - el = n 'img', src: parent.href - if getConfig 'Localize Time' g.callbacks.push (root) -> spans = $$ 'span[id^=no]', root @@ -1360,6 +1353,12 @@ if getConfig 'Keybinds' d.addEventListener 'keypress', keypress, true if g.REPLY + if getConfig 'Image Preloading' + g.callbacks.push (root) -> + thumbs = $$ 'img[md5]', root + for thumb in thumbs + parent = thumb.parentNode + el = n 'img', src: parent.href if getConfig 'Thread Updater' updaterMake() if getConfig('Quick Reply') and getConfig 'Persistent QR'