Merge branch 'master' of github.com:MayhemYDG/4chan-x into qr
Conflicts: 4chan_x.user.js script.coffee
This commit is contained in:
commit
91f7de90e5
@ -1,6 +1,6 @@
|
||||
// ==UserScript==
|
||||
// @name 4chan x
|
||||
// @version 2.24.3
|
||||
// @version 2.24.4
|
||||
// @namespace aeosynth
|
||||
// @description Adds various features.
|
||||
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||
@ -17,7 +17,7 @@
|
||||
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
|
||||
* Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
|
||||
* http://mayhemydg.github.com/4chan-x/
|
||||
* 4chan X 2.24.3
|
||||
* 4chan X 2.24.4
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@ -48,6 +48,8 @@
|
||||
*
|
||||
* CONTRIBUTORS
|
||||
*
|
||||
* e000 - cooldown sanity check
|
||||
* ahokadesuka - scroll back when unexpanding images
|
||||
* Shou- - pentadactyl fixes
|
||||
* ferongr - new favicons
|
||||
* xat- - new favicons
|
||||
@ -199,7 +201,7 @@
|
||||
|
||||
NAMESPACE = '4chan_x.';
|
||||
|
||||
VERSION = '2.24.3';
|
||||
VERSION = '2.24.4';
|
||||
|
||||
SECOND = 1000;
|
||||
|
||||
@ -2895,9 +2897,12 @@
|
||||
}
|
||||
},
|
||||
toggle: function(a) {
|
||||
var thumb;
|
||||
var rect, thumb;
|
||||
thumb = a.firstChild;
|
||||
if (thumb.hidden) {
|
||||
rect = a.parentNode.getBoundingClientRect();
|
||||
if (rect.top < 0) d.body.scrollTop += rect.top;
|
||||
if (rect.left < 0) d.body.scrollLeft += rect.left;
|
||||
return imgExpand.contract(thumb);
|
||||
} else {
|
||||
return imgExpand.expand(thumb);
|
||||
@ -2909,9 +2914,10 @@
|
||||
},
|
||||
expand: function(thumb, url) {
|
||||
var a, filesize, img, max;
|
||||
if (thumb.hidden) return;
|
||||
a = thumb.parentNode;
|
||||
img = $.el('img', {
|
||||
src: url ? url : a.href
|
||||
src: url || a.href
|
||||
});
|
||||
if (engine === 'gecko' && a.parentNode.className !== 'op') {
|
||||
filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent;
|
||||
@ -2923,28 +2929,29 @@
|
||||
return $.add(a, img);
|
||||
},
|
||||
error: function() {
|
||||
var req, src, thumb, url;
|
||||
var href, req, src, thumb, url;
|
||||
href = this.parentNode.href;
|
||||
thumb = this.previousSibling;
|
||||
imgExpand.contract(thumb);
|
||||
src = this.src.split('/');
|
||||
if (url = redirect.image(src[3], src[5])) {
|
||||
return imgExpand.expand(thumb, url);
|
||||
} else if (engine === 'webkit') {
|
||||
src = href.split('/');
|
||||
if (this.src.split('/')[2] === 'images.4chan.org' && (url = redirect.image(src[3], src[5]))) {
|
||||
setTimeout(imgExpand.expand, 10000, thumb, url);
|
||||
return;
|
||||
}
|
||||
url = href + '?' + Date.now();
|
||||
if (engine === 'webkit') {
|
||||
return req = $.ajax(this.src, (function() {
|
||||
if (this.status !== 404) {
|
||||
return setTimeout(imgExpand.retry, 10000, thumb);
|
||||
return setTimeout(imgExpand.expand, 10000, thumb, url);
|
||||
}
|
||||
}), {
|
||||
type: 'head',
|
||||
event: 'onreadystatechange'
|
||||
});
|
||||
} else if (!g.dead) {
|
||||
return setTimeout(imgExpand.retry, 10000, thumb);
|
||||
return setTimeout(imgExpand.expand, 10000, thumb, url);
|
||||
}
|
||||
},
|
||||
retry: function(thumb) {
|
||||
if (!thumb.hidden) return imgExpand.expand(thumb);
|
||||
},
|
||||
dialog: function() {
|
||||
var controls, form, imageType, select;
|
||||
controls = $.el('div', {
|
||||
|
||||
4
Cakefile
4
Cakefile
@ -2,7 +2,7 @@
|
||||
{exec} = require 'child_process'
|
||||
fs = require 'fs'
|
||||
|
||||
VERSION = '2.24.3'
|
||||
VERSION = '2.24.4'
|
||||
|
||||
HEADER = """
|
||||
// ==UserScript==
|
||||
@ -55,6 +55,8 @@ HEADER = """
|
||||
*
|
||||
* CONTRIBUTORS
|
||||
*
|
||||
* e000 - cooldown sanity check
|
||||
* ahokadesuka - scroll back when unexpanding images
|
||||
* Shou- - pentadactyl fixes
|
||||
* ferongr - new favicons
|
||||
* xat- - new favicons
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
master
|
||||
|
||||
2.24.4
|
||||
- ahokadesuka
|
||||
Scroll back up when unexpanding images.
|
||||
- e000
|
||||
Prevent absurd cooldown durations.
|
||||
- Mayhem
|
||||
Better image expanding reload, should fool CloudFlare's cache.
|
||||
|
||||
2.24.3
|
||||
- Mayhem
|
||||
Set image limit in Thread Stats to 252 for /a/ and /v/, default to 152.
|
||||
|
||||
@ -1 +1 @@
|
||||
postMessage({version:'2.24.3'},'*');
|
||||
postMessage({version:'2.24.4'},'*');
|
||||
|
||||
@ -121,7 +121,7 @@ conf = {}
|
||||
) null, config
|
||||
|
||||
NAMESPACE = '4chan_x.'
|
||||
VERSION = '2.24.3'
|
||||
VERSION = '2.24.4'
|
||||
SECOND = 1000
|
||||
MINUTE = 60*SECOND
|
||||
HOUR = 60*MINUTE
|
||||
@ -2213,6 +2213,9 @@ imgExpand =
|
||||
toggle: (a) ->
|
||||
thumb = a.firstChild
|
||||
if thumb.hidden
|
||||
rect = a.parentNode.getBoundingClientRect()
|
||||
d.body.scrollTop += rect.top if rect.top < 0
|
||||
d.body.scrollLeft += rect.left if rect.left < 0
|
||||
imgExpand.contract thumb
|
||||
else
|
||||
imgExpand.expand thumb
|
||||
@ -2222,9 +2225,10 @@ imgExpand =
|
||||
$.rm thumb.nextSibling
|
||||
|
||||
expand: (thumb, url) ->
|
||||
return if thumb.hidden
|
||||
a = thumb.parentNode
|
||||
img = $.el 'img',
|
||||
src: if url then url else a.href
|
||||
src: url or a.href
|
||||
if engine is 'gecko' and a.parentNode.className isnt 'op'
|
||||
filesize = $.x('preceding-sibling::span[@class="filesize"]', a).textContent
|
||||
max = filesize.match /(\d+)x/
|
||||
@ -2234,22 +2238,23 @@ imgExpand =
|
||||
$.add a, img
|
||||
|
||||
error: ->
|
||||
href = @parentNode.href
|
||||
thumb = @previousSibling
|
||||
imgExpand.contract thumb
|
||||
src = @src.split '/'
|
||||
if url = redirect.image src[3], src[5]
|
||||
imgExpand.expand thumb, url
|
||||
src = href.split '/'
|
||||
if @src.split('/')[2] is 'images.4chan.org' and url = redirect.image src[3], src[5]
|
||||
setTimeout imgExpand.expand, 10000, thumb, url
|
||||
return
|
||||
url = href + '?' + Date.now()
|
||||
#navigator.online is not x-browser/os yet
|
||||
else if engine is 'webkit'
|
||||
if engine is 'webkit'
|
||||
req = $.ajax @src, (->
|
||||
setTimeout imgExpand.retry, 10000, thumb if @status isnt 404
|
||||
setTimeout imgExpand.expand, 10000, thumb, url if @status isnt 404
|
||||
), type: 'head', event: 'onreadystatechange'
|
||||
#Firefox returns a status code of 0 because of the same origin policy
|
||||
#Oprah doesn't send any request
|
||||
else unless g.dead
|
||||
setTimeout imgExpand.retry, 10000, thumb
|
||||
retry: (thumb) ->
|
||||
imgExpand.expand thumb unless thumb.hidden
|
||||
setTimeout imgExpand.expand, 10000, thumb, url
|
||||
|
||||
dialog: ->
|
||||
controls = $.el 'div',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user