Skip to content

Commit

Permalink
remove checkUpdate function, change version number to 2.63
Browse files Browse the repository at this point in the history
  • Loading branch information
arifhn committed Dec 22, 2014
1 parent bded680 commit a4c8373
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions kaskus_spoiler_alert.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// @include *.kaskus.*/post/*
// @include *.kaskus.*/show_post/*
// @include *.kaskus.*/group/discussion/*
// @version 2.62
// @version 2.63
// @author arifhn
// ==/UserScript==
/**
Expand Down Expand Up @@ -137,40 +137,6 @@
*/
(function() {
var script = {
srcurl : 'http://userscripts.org/scripts/source/73498.user.js',
version : '2.62',
metaurl : 'http://userscripts.org/scripts/source/73498.meta.js',

checkUpdate : function() {
// 12 hour = (12 hour * 60 * 60 * 1000 ms)
var interval = 1000 * 60 * 60 * 12;
var lastCheck = parseInt(script.getValue("KASKUS_SPA_LAST_CHECK", "0"));
if (lastCheck + interval <= new Date().getTime()) {
GM_xmlhttpRequest( {
method : 'GET',
url : script.metaurl,
onload : function(response) {
if (response.status == 200) {
var onlineVersion = response.responseText
.match(/@version(?:[^\d]+)([\d\.]+)/)[1];
if (parseFloat(onlineVersion) > parseFloat(script.version)) {
var c = confirm("Kaskus Spoiler Alert released a new version "
+ onlineVersion
+ ", do you want to update?");
if (c) {
window.location.href = script.srcurl;
}
}
}
script.putValue("KASKUS_SPA_LAST_CHECK", new Date()
.getTime()
+ "");
}
});
}
},


putValue: function(key, value) {
if(typeof window.localStorage != 'undefined') {
localStorage[key] = value;
Expand Down Expand Up @@ -806,6 +772,5 @@
}
};

script.checkUpdate();
VBPage.setupKSA();
})();

0 comments on commit a4c8373

Please sign in to comment.