Network tweak: get the Last-Modified header when we open the thread via a HEAD request.

This commit is contained in:
Nicolas Stepien 2012-09-07 22:20:26 +02:00
parent b95dc1d9a2
commit 063ea136ba
2 changed files with 14 additions and 0 deletions

View File

@ -2851,6 +2851,15 @@
this.thread = $.id("t" + g.THREAD_ID);
this.unsuccessfulFetchCount = 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);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
input = _ref[_i];

View File

@ -2281,6 +2281,11 @@ Updater =
@unsuccessfulFetchCount = 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
if input.type is 'checkbox'