From 504d03b9d2ecc3a2ccd0614ec75cb442ea1db577 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 8 Feb 2012 00:41:00 +0100 Subject: [PATCH] Don't return an archived image url if 404 redirect is disabled. Always enable image retrying on loading error. Close #196 --- 4chan_x.user.js | 3 ++- script.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 700c55e54..fe00db510 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3190,6 +3190,7 @@ if (url) return location.href = url; }, image: function(board, filename) { + if (!conf['404 Redirect']) return; switch (board) { case 'a': case 'jp': @@ -3371,7 +3372,7 @@ img = $.el('img', { src: url || a.href }); - if (conf['404 Redirect']) $.on(img, 'error', imgExpand.error); + $.on(img, 'error', imgExpand.error); return $.add(a, img); }, error: function() { diff --git a/script.coffee b/script.coffee index b0f44e665..ec4bcde14 100644 --- a/script.coffee +++ b/script.coffee @@ -2500,6 +2500,7 @@ redirect = redirect.thread() location.href = url if url image: (board, filename) -> #board must be given, the image can originate from a cross-quote + return unless conf['404 Redirect'] switch board when 'a', 'jp', 'm', 'tg', 'tv', 'u' "http://archive.foolz.us/#{board}/full_image/#{filename}" @@ -2605,7 +2606,7 @@ imgExpand = a = thumb.parentNode img = $.el 'img', src: url or a.href - $.on img, 'error', imgExpand.error if conf['404 Redirect'] + $.on img, 'error', imgExpand.error $.add a, img error: ->