Network tweak: get the Last-Modified header when we open the thread via a HEAD request.
This commit is contained in:
parent
b95dc1d9a2
commit
063ea136ba
@ -2851,6 +2851,15 @@
|
|||||||
this.thread = $.id("t" + g.THREAD_ID);
|
this.thread = $.id("t" + g.THREAD_ID);
|
||||||
this.unsuccessfulFetchCount = 0;
|
this.unsuccessfulFetchCount = 0;
|
||||||
this.lastModified = '0';
|
this.lastModified = '0';
|
||||||
|
$.ajax("//api.4chan.org/" + g.BOARD + "/res/" + g.THREAD_ID + ".json", {
|
||||||
|
type: 'head',
|
||||||
|
onload: function() {
|
||||||
|
if (this.status !== 200) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return Updater.lastModified = this.getResponseHeader('Last-Modified');
|
||||||
|
}
|
||||||
|
});
|
||||||
_ref = $$('input', dialog);
|
_ref = $$('input', dialog);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
input = _ref[_i];
|
input = _ref[_i];
|
||||||
|
|||||||
@ -2281,6 +2281,11 @@ Updater =
|
|||||||
|
|
||||||
@unsuccessfulFetchCount = 0
|
@unsuccessfulFetchCount = 0
|
||||||
@lastModified = '0'
|
@lastModified = '0'
|
||||||
|
$.ajax "//api.4chan.org/#{g.BOARD}/res/#{g.THREAD_ID}.json",
|
||||||
|
type: 'head'
|
||||||
|
onload: ->
|
||||||
|
return if @status isnt 200
|
||||||
|
Updater.lastModified = @getResponseHeader 'Last-Modified'
|
||||||
|
|
||||||
for input in $$ 'input', dialog
|
for input in $$ 'input', dialog
|
||||||
if input.type is 'checkbox'
|
if input.type is 'checkbox'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user