Refactoring masturbation.
This commit is contained in:
parent
6083136a85
commit
078db94ee8
@ -3312,16 +3312,14 @@
|
|||||||
var href, src, thumb, timeoutID, url;
|
var href, src, thumb, timeoutID, url;
|
||||||
href = this.parentNode.href;
|
href = this.parentNode.href;
|
||||||
thumb = this.previousSibling;
|
thumb = this.previousSibling;
|
||||||
imgExpand.contract(thumb);
|
|
||||||
src = href.split('/');
|
src = href.split('/');
|
||||||
if (this.src.split('/')[2] === 'images.4chan.org' && (url = redirect.image(src[3], src[5]))) {
|
imgExpand.contract(thumb);
|
||||||
setTimeout(imgExpand.expand, 10000, thumb, url);
|
if (!(this.src.split('/')[2] === 'images.4chan.org' && (url = redirect.image(src[3], src[5])))) {
|
||||||
return;
|
if (g.dead) return;
|
||||||
|
url = href + '?' + Date.now();
|
||||||
}
|
}
|
||||||
if (g.dead) return;
|
|
||||||
url = href + '?' + Date.now();
|
|
||||||
timeoutID = setTimeout(imgExpand.expand, 10000, thumb, url);
|
timeoutID = setTimeout(imgExpand.expand, 10000, thumb, url);
|
||||||
return $.ajax(this.src, {
|
return $.ajax(url, {
|
||||||
onreadystatechange: (function() {
|
onreadystatechange: (function() {
|
||||||
if (this.status === 404) return clearTimeout(timeoutID);
|
if (this.status === 404) return clearTimeout(timeoutID);
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2537,20 +2537,18 @@ imgExpand =
|
|||||||
$.add a, img
|
$.add a, img
|
||||||
|
|
||||||
error: ->
|
error: ->
|
||||||
href = @parentNode.href
|
href = @parentNode.href
|
||||||
thumb = @previousSibling
|
thumb = @previousSibling
|
||||||
|
src = href.split '/'
|
||||||
imgExpand.contract thumb
|
imgExpand.contract thumb
|
||||||
src = href.split '/'
|
unless @src.split('/')[2] is 'images.4chan.org' and url = redirect.image src[3], src[5]
|
||||||
if @src.split('/')[2] is 'images.4chan.org' and url = redirect.image src[3], src[5]
|
return if g.dead
|
||||||
setTimeout imgExpand.expand, 10000, thumb, url
|
# CloudFlare may cache banned pages instead of images.
|
||||||
return
|
# This will fool CloudFlare's cache.
|
||||||
return if g.dead
|
url = href + '?' + Date.now()
|
||||||
# CloudFlare may cache banned pages instead of images.
|
|
||||||
# This will fool CloudFlare's cache.
|
|
||||||
url = href + '?' + Date.now()
|
|
||||||
#navigator.online is not x-browser/os yet
|
#navigator.online is not x-browser/os yet
|
||||||
timeoutID = setTimeout imgExpand.expand, 10000, thumb, url
|
timeoutID = setTimeout imgExpand.expand, 10000, thumb, url
|
||||||
$.ajax @src, onreadystatechange: (-> clearTimeout timeoutID if @status is 404),
|
$.ajax url, onreadystatechange: (-> clearTimeout timeoutID if @status is 404),
|
||||||
type: 'head'
|
type: 'head'
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user