Clean up, improve, retry arbitrarily every 10 seconds as to not shit up 4chan's servers even more.
This commit is contained in:
parent
3333bfe488
commit
62f697cca6
@ -2728,16 +2728,23 @@
|
|||||||
_ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1];
|
_ref = filesize.textContent.match(/(\d+)x/), _ = _ref[0], max = _ref[1];
|
||||||
img.style.maxWidth = "-moz-calc(" + max + "px)";
|
img.style.maxWidth = "-moz-calc(" + max + "px)";
|
||||||
}
|
}
|
||||||
$.bind(img, 'error', function(e) {
|
$.bind(img, 'error', imgExpand.error);
|
||||||
thumb = this.previousSibling;
|
|
||||||
imgExpand.contract(thumb);
|
|
||||||
if (!g.dead) {
|
|
||||||
return setTimeout(imgExpand.expand, 1000, thumb);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
thumb.hidden = true;
|
thumb.hidden = true;
|
||||||
return $.add(a, img);
|
return $.add(a, img);
|
||||||
},
|
},
|
||||||
|
error: function(e) {
|
||||||
|
var thumb;
|
||||||
|
thumb = this.previousSibling;
|
||||||
|
imgExpand.contract(thumb);
|
||||||
|
if (!g.dead) {
|
||||||
|
return setTimeout(imgExpand.retry, 10000, thumb);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
retry: function(thumb) {
|
||||||
|
if (!(g.dead || thumb.hidden)) {
|
||||||
|
return imgExpand.expand(thumb);
|
||||||
|
}
|
||||||
|
},
|
||||||
dialog: function() {
|
dialog: function() {
|
||||||
var controls, delform, imageType, option, select, _i, _len, _ref;
|
var controls, delform, imageType, option, select, _i, _len, _ref;
|
||||||
controls = $.el('div', {
|
controls = $.el('div', {
|
||||||
|
|||||||
@ -2021,14 +2021,19 @@ imgExpand =
|
|||||||
filesize = $ 'span.filesize', a.parentNode
|
filesize = $ 'span.filesize', a.parentNode
|
||||||
[_, max] = filesize.textContent.match /(\d+)x/
|
[_, max] = filesize.textContent.match /(\d+)x/
|
||||||
img.style.maxWidth = "-moz-calc(#{max}px)"
|
img.style.maxWidth = "-moz-calc(#{max}px)"
|
||||||
$.bind img, 'error', (e) ->
|
$.bind img, 'error', imgExpand.error
|
||||||
thumb = @previousSibling
|
|
||||||
imgExpand.contract thumb
|
|
||||||
unless g.dead
|
|
||||||
setTimeout imgExpand.expand, 1000, thumb
|
|
||||||
thumb.hidden = true
|
thumb.hidden = true
|
||||||
$.add a, img
|
$.add a, img
|
||||||
|
|
||||||
|
error: (e) ->
|
||||||
|
thumb = @previousSibling
|
||||||
|
imgExpand.contract thumb
|
||||||
|
#navigator.online is not x-browser/os yet
|
||||||
|
#can't easily check if the image/post is deleted
|
||||||
|
setTimeout imgExpand.retry, 10000, thumb unless g.dead
|
||||||
|
retry: (thumb) ->
|
||||||
|
imgExpand.expand thumb unless g.dead or thumb.hidden
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
controls = $.el 'div',
|
controls = $.el 'div',
|
||||||
id: 'imgControls'
|
id: 'imgControls'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user