Don't return an archived image url if 404 redirect is disabled. Always enable image retrying on loading error. Close #196

This commit is contained in:
Nicolas Stepien 2012-02-08 00:41:00 +01:00
parent 1da1413b15
commit 504d03b9d2
2 changed files with 4 additions and 2 deletions

View File

@ -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() {

View File

@ -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: ->