Fix #34
This commit is contained in:
parent
4497836e7a
commit
c82a548e41
@ -1,5 +1,6 @@
|
|||||||
seaweedchan:
|
seaweedchan:
|
||||||
- Chrome doesn't get .null, so don't style it
|
- Chrome doesn't get .null, so don't style it
|
||||||
|
- Fix count when auto update is disabled and set updater text to "Update"
|
||||||
|
|
||||||
### 1.1.2 - 2013-04-26
|
### 1.1.2 - 2013-04-26
|
||||||
seaweedchan:
|
seaweedchan:
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.2 - 2013-04-27
|
* 4chan X - Version 1.1.2 - 2013-04-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.2 - 2013-04-27
|
* 4chan X - Version 1.1.2 - 2013-04-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -6668,6 +6668,8 @@
|
|||||||
if (input.name === 'Scroll BG') {
|
if (input.name === 'Scroll BG') {
|
||||||
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
||||||
ThreadUpdater.cb.scrollBG();
|
ThreadUpdater.cb.scrollBG();
|
||||||
|
} else if (input.name === 'Auto Update') {
|
||||||
|
$.on(input, 'change', ThreadUpdater.update);
|
||||||
}
|
}
|
||||||
subEntries.push({
|
subEntries.push({
|
||||||
el: el
|
el: el
|
||||||
@ -6763,7 +6765,8 @@
|
|||||||
if (ThreadUpdater.online) {
|
if (ThreadUpdater.online) {
|
||||||
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
||||||
} else {
|
} else {
|
||||||
return clearTimeout(ThreadUpdater.timeoutID);
|
clearTimeout(ThreadUpdater.timeoutID);
|
||||||
|
return ThreadUpdater.set('timer', 'Update');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
interval: function() {
|
interval: function() {
|
||||||
@ -6785,7 +6788,9 @@
|
|||||||
g.DEAD = false;
|
g.DEAD = false;
|
||||||
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
||||||
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
g.DEAD = true;
|
g.DEAD = true;
|
||||||
@ -6799,8 +6804,10 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ThreadUpdater.outdateCount++;
|
if (Conf['Auto Update']) {
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
ThreadUpdater.outdateCount++;
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Status Code 304: Not modified
|
Status Code 304: Not modified
|
||||||
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
||||||
@ -6866,7 +6873,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ThreadUpdater.seconds = 0;
|
ThreadUpdater.seconds = 0;
|
||||||
ThreadUpdater.set('timer', '...');
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', '...');
|
||||||
|
} else {
|
||||||
|
ThreadUpdater.set('timer', 'Update');
|
||||||
|
}
|
||||||
if (ThreadUpdater.req) {
|
if (ThreadUpdater.req) {
|
||||||
ThreadUpdater.req.onloadend = null;
|
ThreadUpdater.req.onloadend = null;
|
||||||
ThreadUpdater.req.abort();
|
ThreadUpdater.req.abort();
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.2 - 2013-04-27
|
* 4chan X - Version 1.1.2 - 2013-04-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -6689,6 +6689,8 @@
|
|||||||
if (input.name === 'Scroll BG') {
|
if (input.name === 'Scroll BG') {
|
||||||
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
||||||
ThreadUpdater.cb.scrollBG();
|
ThreadUpdater.cb.scrollBG();
|
||||||
|
} else if (input.name === 'Auto Update') {
|
||||||
|
$.on(input, 'change', ThreadUpdater.update);
|
||||||
}
|
}
|
||||||
subEntries.push({
|
subEntries.push({
|
||||||
el: el
|
el: el
|
||||||
@ -6784,7 +6786,8 @@
|
|||||||
if (ThreadUpdater.online) {
|
if (ThreadUpdater.online) {
|
||||||
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
||||||
} else {
|
} else {
|
||||||
return clearTimeout(ThreadUpdater.timeoutID);
|
clearTimeout(ThreadUpdater.timeoutID);
|
||||||
|
return ThreadUpdater.set('timer', 'Update');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
interval: function() {
|
interval: function() {
|
||||||
@ -6806,7 +6809,9 @@
|
|||||||
g.DEAD = false;
|
g.DEAD = false;
|
||||||
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
||||||
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
g.DEAD = true;
|
g.DEAD = true;
|
||||||
@ -6820,8 +6825,10 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ThreadUpdater.outdateCount++;
|
if (Conf['Auto Update']) {
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
ThreadUpdater.outdateCount++;
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Status Code 304: Not modified
|
Status Code 304: Not modified
|
||||||
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
||||||
@ -6887,7 +6894,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ThreadUpdater.seconds = 0;
|
ThreadUpdater.seconds = 0;
|
||||||
ThreadUpdater.set('timer', '...');
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', '...');
|
||||||
|
} else {
|
||||||
|
ThreadUpdater.set('timer', 'Update');
|
||||||
|
}
|
||||||
if (ThreadUpdater.req) {
|
if (ThreadUpdater.req) {
|
||||||
ThreadUpdater.req.onloadend = null;
|
ThreadUpdater.req.onloadend = null;
|
||||||
ThreadUpdater.req.abort();
|
ThreadUpdater.req.abort();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.1.2 - 2013-04-27
|
* 4chan X - Version 1.1.2 - 2013-04-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -6668,6 +6668,8 @@
|
|||||||
if (input.name === 'Scroll BG') {
|
if (input.name === 'Scroll BG') {
|
||||||
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
$.on(input, 'change', ThreadUpdater.cb.scrollBG);
|
||||||
ThreadUpdater.cb.scrollBG();
|
ThreadUpdater.cb.scrollBG();
|
||||||
|
} else if (input.name === 'Auto Update') {
|
||||||
|
$.on(input, 'change', ThreadUpdater.update);
|
||||||
}
|
}
|
||||||
subEntries.push({
|
subEntries.push({
|
||||||
el: el
|
el: el
|
||||||
@ -6763,7 +6765,8 @@
|
|||||||
if (ThreadUpdater.online) {
|
if (ThreadUpdater.online) {
|
||||||
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
return ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);
|
||||||
} else {
|
} else {
|
||||||
return clearTimeout(ThreadUpdater.timeoutID);
|
clearTimeout(ThreadUpdater.timeoutID);
|
||||||
|
return ThreadUpdater.set('timer', 'Update');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
interval: function() {
|
interval: function() {
|
||||||
@ -6785,7 +6788,9 @@
|
|||||||
g.DEAD = false;
|
g.DEAD = false;
|
||||||
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
ThreadUpdater.parse(JSON.parse(req.response).posts);
|
||||||
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
ThreadUpdater.lastModified = req.getResponseHeader('Last-Modified');
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
g.DEAD = true;
|
g.DEAD = true;
|
||||||
@ -6799,8 +6804,10 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ThreadUpdater.outdateCount++;
|
if (Conf['Auto Update']) {
|
||||||
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
ThreadUpdater.outdateCount++;
|
||||||
|
ThreadUpdater.set('timer', ThreadUpdater.getInterval());
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Status Code 304: Not modified
|
Status Code 304: Not modified
|
||||||
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
||||||
@ -6866,7 +6873,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ThreadUpdater.seconds = 0;
|
ThreadUpdater.seconds = 0;
|
||||||
ThreadUpdater.set('timer', '...');
|
if (Conf['Auto Update']) {
|
||||||
|
ThreadUpdater.set('timer', '...');
|
||||||
|
} else {
|
||||||
|
ThreadUpdater.set('timer', 'Update');
|
||||||
|
}
|
||||||
if (ThreadUpdater.req) {
|
if (ThreadUpdater.req) {
|
||||||
ThreadUpdater.req.onloadend = null;
|
ThreadUpdater.req.onloadend = null;
|
||||||
ThreadUpdater.req.abort();
|
ThreadUpdater.req.abort();
|
||||||
|
|||||||
@ -28,6 +28,8 @@ ThreadUpdater =
|
|||||||
if input.name is 'Scroll BG'
|
if input.name is 'Scroll BG'
|
||||||
$.on input, 'change', ThreadUpdater.cb.scrollBG
|
$.on input, 'change', ThreadUpdater.cb.scrollBG
|
||||||
ThreadUpdater.cb.scrollBG()
|
ThreadUpdater.cb.scrollBG()
|
||||||
|
else if input.name is 'Auto Update'
|
||||||
|
$.on input, 'change', ThreadUpdater.update
|
||||||
subEntries.push el: el
|
subEntries.push el: el
|
||||||
|
|
||||||
settings = $.el 'span',
|
settings = $.el 'span',
|
||||||
@ -74,7 +76,9 @@ ThreadUpdater =
|
|||||||
if ThreadUpdater.online = navigator.onLine
|
if ThreadUpdater.online = navigator.onLine
|
||||||
ThreadUpdater.outdateCount = 0
|
ThreadUpdater.outdateCount = 0
|
||||||
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
||||||
|
|
||||||
ThreadUpdater.update()
|
ThreadUpdater.update()
|
||||||
|
|
||||||
ThreadUpdater.set 'status', null, null
|
ThreadUpdater.set 'status', null, null
|
||||||
else
|
else
|
||||||
ThreadUpdater.set 'timer', null
|
ThreadUpdater.set 'timer', null
|
||||||
@ -106,6 +110,7 @@ ThreadUpdater =
|
|||||||
ThreadUpdater.timeoutID = setTimeout ThreadUpdater.timeout, 1000
|
ThreadUpdater.timeoutID = setTimeout ThreadUpdater.timeout, 1000
|
||||||
else
|
else
|
||||||
clearTimeout ThreadUpdater.timeoutID
|
clearTimeout ThreadUpdater.timeoutID
|
||||||
|
ThreadUpdater.set 'timer', 'Update'
|
||||||
interval: ->
|
interval: ->
|
||||||
val = +@value
|
val = +@value
|
||||||
if val < 1 then val = 1
|
if val < 1 then val = 1
|
||||||
@ -118,7 +123,8 @@ ThreadUpdater =
|
|||||||
g.DEAD = false
|
g.DEAD = false
|
||||||
ThreadUpdater.parse JSON.parse(req.response).posts
|
ThreadUpdater.parse JSON.parse(req.response).posts
|
||||||
ThreadUpdater.lastModified = req.getResponseHeader 'Last-Modified'
|
ThreadUpdater.lastModified = req.getResponseHeader 'Last-Modified'
|
||||||
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
if Conf['Auto Update']
|
||||||
|
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
||||||
when 404
|
when 404
|
||||||
g.DEAD = true
|
g.DEAD = true
|
||||||
ThreadUpdater.set 'timer', null
|
ThreadUpdater.set 'timer', null
|
||||||
@ -129,8 +135,9 @@ ThreadUpdater =
|
|||||||
404: true
|
404: true
|
||||||
thread: ThreadUpdater.thread
|
thread: ThreadUpdater.thread
|
||||||
else
|
else
|
||||||
ThreadUpdater.outdateCount++
|
if Conf['Auto Update']
|
||||||
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
ThreadUpdater.outdateCount++
|
||||||
|
ThreadUpdater.set 'timer', ThreadUpdater.getInterval()
|
||||||
###
|
###
|
||||||
Status Code 304: Not modified
|
Status Code 304: Not modified
|
||||||
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
By sending the `If-Modified-Since` header we get a proper status code, and no response.
|
||||||
@ -188,7 +195,10 @@ ThreadUpdater =
|
|||||||
update: ->
|
update: ->
|
||||||
return unless ThreadUpdater.online
|
return unless ThreadUpdater.online
|
||||||
ThreadUpdater.seconds = 0
|
ThreadUpdater.seconds = 0
|
||||||
ThreadUpdater.set 'timer', '...'
|
if Conf['Auto Update']
|
||||||
|
ThreadUpdater.set 'timer', '...'
|
||||||
|
else
|
||||||
|
ThreadUpdater.set 'timer', 'Update'
|
||||||
if ThreadUpdater.req
|
if ThreadUpdater.req
|
||||||
# abort() triggers onloadend, we don't want that.
|
# abort() triggers onloadend, we don't want that.
|
||||||
ThreadUpdater.req.onloadend = null
|
ThreadUpdater.req.onloadend = null
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user