Fix #48
This commit is contained in:
parent
8616dbc3a3
commit
d321baef64
@ -1,3 +1,6 @@
|
||||
seaweedchan:
|
||||
- Fix update checking
|
||||
|
||||
### 1.1.9 - 2013-05-02
|
||||
seaweedchan
|
||||
- Fix boards with previously deleted archives not switching to new archives
|
||||
@ -21,7 +24,6 @@ seaweedchan:
|
||||
- Add paste.installgentoo.com embedding
|
||||
- Added `Posting Success Notifications` option to make "Post Successful!" and "_____ uploaded" notifications optional
|
||||
- Added `Allow False Positives` option under Linkification, giving the user more control over what's linkified.
|
||||
- Fix URL for update checking
|
||||
|
||||
### 1.1.6 - 2013-05-01
|
||||
seaweedchan:
|
||||
|
||||
@ -42,7 +42,7 @@ module.exports = (grunt) ->
|
||||
options: concatOptions
|
||||
files:
|
||||
'LICENSE': 'src/General/meta/banner.js',
|
||||
'builds/version': 'src/General/meta/version.js'
|
||||
'latest.js': 'src/General/meta/latest.js'
|
||||
|
||||
crx:
|
||||
options: concatOptions
|
||||
|
||||
@ -10045,6 +10045,17 @@
|
||||
obj.callback.isAddon = true;
|
||||
return Klass.prototype.callbacks.push(obj.callback);
|
||||
},
|
||||
message: function(e) {
|
||||
var el, version;
|
||||
|
||||
version = e.data.version;
|
||||
if (version && version !== g.VERSION) {
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
},
|
||||
checkUpdate: function() {
|
||||
var freq, items, now;
|
||||
|
||||
@ -10061,27 +10072,12 @@
|
||||
if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) {
|
||||
return;
|
||||
}
|
||||
return $.ajax('https://github.com/seaweedchan/4chan-x/raw/master/builds/version', {
|
||||
onload: function() {
|
||||
var el, version;
|
||||
|
||||
if (this.status !== 200) {
|
||||
return;
|
||||
}
|
||||
version = this.response;
|
||||
if (!/^\d\.\d+\.\d+$/.test(version)) {
|
||||
return;
|
||||
}
|
||||
if (g.VERSION === version) {
|
||||
$.set('lastupdate', now);
|
||||
return;
|
||||
}
|
||||
$.set('lastchecked', now);
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
return $.ready(function() {
|
||||
$.on(window, 'message', Main.message);
|
||||
$.set('lastUpdate', now);
|
||||
return $.add(d.head, $.el('script', {
|
||||
src: 'https://github.com/seaweedchan/4chan-x/raw/master/latest.js'
|
||||
}));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@ -10068,6 +10068,17 @@
|
||||
obj.callback.isAddon = true;
|
||||
return Klass.prototype.callbacks.push(obj.callback);
|
||||
},
|
||||
message: function(e) {
|
||||
var el, version;
|
||||
|
||||
version = e.data.version;
|
||||
if (version && version !== g.VERSION) {
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
},
|
||||
checkUpdate: function() {
|
||||
var freq, items, now;
|
||||
|
||||
@ -10084,27 +10095,12 @@
|
||||
if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) {
|
||||
return;
|
||||
}
|
||||
return $.ajax('https://github.com/seaweedchan/4chan-x/raw/master/builds/version', {
|
||||
onload: function() {
|
||||
var el, version;
|
||||
|
||||
if (this.status !== 200) {
|
||||
return;
|
||||
}
|
||||
version = this.response;
|
||||
if (!/^\d\.\d+\.\d+$/.test(version)) {
|
||||
return;
|
||||
}
|
||||
if (g.VERSION === version) {
|
||||
$.set('lastupdate', now);
|
||||
return;
|
||||
}
|
||||
$.set('lastchecked', now);
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
return $.ready(function() {
|
||||
$.on(window, 'message', Main.message);
|
||||
$.set('lastUpdate', now);
|
||||
return $.add(d.head, $.el('script', {
|
||||
src: 'https://github.com/seaweedchan/4chan-x/raw/master/latest.js'
|
||||
}));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@ -10049,6 +10049,17 @@
|
||||
obj.callback.isAddon = true;
|
||||
return Klass.prototype.callbacks.push(obj.callback);
|
||||
},
|
||||
message: function(e) {
|
||||
var el, version;
|
||||
|
||||
version = e.data.version;
|
||||
if (version && version !== g.VERSION) {
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
},
|
||||
checkUpdate: function() {
|
||||
var freq, items, now;
|
||||
|
||||
@ -10065,27 +10076,12 @@
|
||||
if (items.lastupdate > now - freq || items.lastchecked > now - $.DAY) {
|
||||
return;
|
||||
}
|
||||
return $.ajax('https://github.com/seaweedchan/4chan-x/raw/master/builds/version', {
|
||||
onload: function() {
|
||||
var el, version;
|
||||
|
||||
if (this.status !== 200) {
|
||||
return;
|
||||
}
|
||||
version = this.response;
|
||||
if (!/^\d\.\d+\.\d+$/.test(version)) {
|
||||
return;
|
||||
}
|
||||
if (g.VERSION === version) {
|
||||
$.set('lastupdate', now);
|
||||
return;
|
||||
}
|
||||
$.set('lastchecked', now);
|
||||
el = $.el('span', {
|
||||
innerHTML: "Update: 4chan X v" + version + " is out, get it <a href=http://seaweedchan.github.io/4chan-x/ target=_blank>here</a>."
|
||||
});
|
||||
return new Notification('info', el, 120);
|
||||
}
|
||||
return $.ready(function() {
|
||||
$.on(window, 'message', Main.message);
|
||||
$.set('lastUpdate', now);
|
||||
return $.add(d.head, $.el('script', {
|
||||
src: 'https://github.com/seaweedchan/4chan-x/raw/master/latest.js'
|
||||
}));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@ -1 +0,0 @@
|
||||
1.1.9
|
||||
@ -1 +1 @@
|
||||
postMessage({version:'1.1.10'},'*')
|
||||
postMessage({version:'1.1.9'},'*')
|
||||
|
||||
@ -286,6 +286,13 @@ Main =
|
||||
obj.callback.isAddon = true
|
||||
Klass::callbacks.push obj.callback
|
||||
|
||||
message: (e) ->
|
||||
{version} = e.data
|
||||
if version and version isnt g.VERSION
|
||||
el = $.el 'span',
|
||||
innerHTML: "Update: <%= meta.name %> v#{version} is out, get it <a href=<%= meta.page %> target=_blank>here</a>."
|
||||
new Notification 'info', el, 120
|
||||
|
||||
checkUpdate: ->
|
||||
return unless Conf['Check for Updates'] and Main.isThisPageLegit()
|
||||
# Check for updates after:
|
||||
@ -300,18 +307,11 @@ Main =
|
||||
$.get items, (items) ->
|
||||
if items.lastupdate > now - freq or items.lastchecked > now - $.DAY
|
||||
return
|
||||
$.ajax '<%= meta.repo %>raw/<%= meta.mainBranch %>/<%= meta.buildsPath %>version', onload: ->
|
||||
return unless @status is 200
|
||||
version = @response
|
||||
return unless /^\d\.\d+\.\d+$/.test version
|
||||
if g.VERSION is version
|
||||
# Don't check for updates too frequently if there wasn't one in a 'long' time.
|
||||
$.set 'lastupdate', now
|
||||
return
|
||||
$.set 'lastchecked', now
|
||||
el = $.el 'span',
|
||||
innerHTML: "Update: <%= meta.name %> v#{version} is out, get it <a href=<%= meta.page %> target=_blank>here</a>."
|
||||
new Notification 'info', el, 120
|
||||
$.ready ->
|
||||
$.on window, 'message', Main.message
|
||||
$.set 'lastUpdate', now
|
||||
$.add d.head, $.el 'script',
|
||||
src: '<%= meta.repo %>raw/<%= meta.mainBranch %>/latest.js'
|
||||
|
||||
handleErrors: (errors) ->
|
||||
unless errors instanceof Array
|
||||
|
||||
1
src/General/meta/latest.js
Normal file
1
src/General/meta/latest.js
Normal file
@ -0,0 +1 @@
|
||||
postMessage({version:'<%= version %>'},'*')
|
||||
@ -1 +0,0 @@
|
||||
<%= version %>
|
||||
Loading…
x
Reference in New Issue
Block a user