2018-01-28 23:22:43 +11:00
|
|
|
//バージョンチェッカー
|
|
|
|
function verck(ver) {
|
2018-05-26 02:37:35 +10:00
|
|
|
if(localStorage.getItem("ver")!=ver){
|
|
|
|
localStorage.setItem("ver", ver);
|
|
|
|
console.log("Thank you for your update");
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#releasenote').modal('open');
|
|
|
|
verp=ver.replace( '(', '');
|
|
|
|
verp=verp.replace( '.', '-');
|
2018-06-12 01:44:28 +10:00
|
|
|
verp=verp.replace( '.', '-');
|
2018-05-26 02:37:35 +10:00
|
|
|
verp=verp.replace( '[', '-');
|
|
|
|
verp=verp.replace( ']', '');
|
|
|
|
verp=verp.replace( ')', '');
|
|
|
|
verp=verp.replace( ' ', '_');
|
2018-06-12 01:44:28 +10:00
|
|
|
console.log(verp);
|
2018-05-26 02:37:35 +10:00
|
|
|
$("#release-"+verp).show();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-03-14 05:31:31 +11:00
|
|
|
var l = 5;
|
|
|
|
|
|
|
|
// 生成する文字列に含める文字セット
|
|
|
|
var c = "abcdefghijklmnopqrstuvwxyz0123456789";
|
2018-07-07 03:51:48 +10:00
|
|
|
var electron = require("electron");
|
|
|
|
var remote=electron.remote;
|
|
|
|
var platform=remote.process.platform;
|
|
|
|
if(platform=="darwin"){
|
|
|
|
var newest=mess.desk_mac;
|
|
|
|
}else{
|
|
|
|
var newest=mess.desk;
|
|
|
|
}
|
|
|
|
var cl = c.length;
|
|
|
|
var r = "";
|
|
|
|
for(var i=0; i<l; i++){
|
|
|
|
r += c[Math.floor(Math.random()*cl)];
|
|
|
|
}
|
|
|
|
var start = "https://thedesk.top/ver.json";
|
|
|
|
fetch(start, {
|
|
|
|
method: 'GET'
|
|
|
|
}).then(function(response) {
|
|
|
|
return response.json();
|
|
|
|
}).catch(function(error) {
|
|
|
|
todo(error);
|
|
|
|
console.error(error);
|
|
|
|
}).then(function(mess) {
|
|
|
|
console.log(mess);
|
|
|
|
if (mess) {
|
|
|
|
if (newest == ver) {
|
|
|
|
todo("お使いのバージョン" + mess.desk + "は最新です。");
|
|
|
|
//betaならアプデチェックしない
|
|
|
|
} else if (ver != "beta") {
|
|
|
|
localStorage.removeItem("instance")
|
|
|
|
|
|
|
|
var ipc = electron.ipcRenderer;
|
|
|
|
ipc.send('update', "true");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//バージョンチェッカー
|
|
|
|
function verck(ver) {
|
|
|
|
if(localStorage.getItem("ver")!=ver){
|
|
|
|
localStorage.setItem("ver", ver);
|
|
|
|
console.log("Thank you for your update");
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#releasenote').modal('open');
|
|
|
|
verp=ver.replace( '(', '');
|
|
|
|
verp=verp.replace( '.', '-');
|
|
|
|
verp=verp.replace( '.', '-');
|
|
|
|
verp=verp.replace( '[', '-');
|
|
|
|
verp=verp.replace( ']', '');
|
|
|
|
verp=verp.replace( ')', '');
|
|
|
|
verp=verp.replace( ' ', '_');
|
|
|
|
console.log(verp);
|
|
|
|
$("#release-"+verp).show();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var l = 5;
|
2018-03-14 05:31:31 +11:00
|
|
|
|
2018-07-07 03:51:48 +10:00
|
|
|
// 生成する文字列に含める文字セット
|
|
|
|
var c = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
|
|
|
2018-03-14 05:31:31 +11:00
|
|
|
var cl = c.length;
|
|
|
|
var r = "";
|
|
|
|
for(var i=0; i<l; i++){
|
|
|
|
r += c[Math.floor(Math.random()*cl)];
|
|
|
|
}
|
|
|
|
var start = "https://thedesk.top/ver.json";
|
2018-01-28 23:22:43 +11:00
|
|
|
fetch(start, {
|
|
|
|
method: 'GET'
|
|
|
|
}).then(function(response) {
|
|
|
|
return response.json();
|
|
|
|
}).catch(function(error) {
|
|
|
|
todo(error);
|
|
|
|
console.error(error);
|
|
|
|
}).then(function(mess) {
|
|
|
|
console.log(mess);
|
|
|
|
if (mess) {
|
2018-07-07 03:51:48 +10:00
|
|
|
var electron = require("electron");
|
|
|
|
var remote=electron.remote;
|
|
|
|
var platform=remote.process.platform;
|
|
|
|
if(platform=="darwin"){
|
|
|
|
var newest=mess.desk_mac;
|
|
|
|
}else{
|
|
|
|
var newest=mess.desk;
|
|
|
|
}
|
|
|
|
if (newest == ver) {
|
2018-01-28 23:22:43 +11:00
|
|
|
todo("お使いのバージョン" + mess.desk + "は最新です。");
|
|
|
|
//betaならアプデチェックしない
|
|
|
|
} else if (ver != "beta") {
|
2018-02-25 19:41:34 +11:00
|
|
|
localStorage.removeItem("instance")
|
2018-07-22 23:03:46 +10:00
|
|
|
if(localStorage.getItem("new-ver-skip")){
|
|
|
|
if(localStorage.getItem("next-ver")!=newest){
|
|
|
|
var ipc = electron.ipcRenderer;
|
|
|
|
ipc.send('update', "true");
|
|
|
|
}else{
|
|
|
|
todo("アップデートはスキップされました。");
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
var ipc = electron.ipcRenderer;
|
|
|
|
ipc.send('update', "true");
|
|
|
|
}
|
2018-01-28 23:22:43 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|