thedesk/app/view/ps/update.html

254 lines
9.2 KiB
HTML
Raw Normal View History

2019-02-05 13:33:32 +11:00
<!doctype html>
2019-05-07 01:42:06 +10:00
<html lang="ps">
2019-05-19 17:39:30 +10:00
<head>
<title>Update - TheDesk</title>
2019-06-22 01:22:45 +10:00
<link href="../../node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet">
2019-05-19 17:39:30 +10:00
<link href="../../css/master.css" type="text/css" rel="stylesheet">
<meta charset="utf-8">
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'thedesk']);
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
2019-02-05 13:33:32 +11:00
</head>
2019-05-19 17:39:30 +10:00
2019-02-05 13:33:32 +11:00
<body>
2019-05-19 17:39:30 +10:00
<style>
body {
font-family: 'Open Sans';
-webkit-app-region: drag;
cursor: move;
padding: 10px;
text-align: right;
}
#start {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: calc(100vh - 2.5rem);
text-align: center;
}
#checkbox {
text-align: left;
}
a,
button,
input,
label,
i {
-webkit-app-region: no-drag;
}
#updskip {
display: flex;
justify-content: center;
align-items: center;
}
.skipbtn {
display: block;
float: left;
width: 200px;
height: 200px;
border: 1px solid;
margin-left: 5px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid;
overflow: hidden;
}
.skipbtn:hover {
background-color: #b3e5fc;
transition: all 0.3s ease-in-out;
}
#prog {
font-size: 200%;
}
</style>
2019-06-22 01:22:45 +10:00
<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
2019-05-19 17:39:30 +10:00
<script type="text/javascript" src="../../js/platform/first.js"></script>
2019-06-22 01:22:45 +10:00
<script type="text/javascript" src="../../node_modules/materialize-css/dist/js/materialize.js"></script>
2019-05-19 17:39:30 +10:00
<i class="material-icons pointer waves-effect" onclick="about();">info</i>
<i class="material-icons pointer waves-effect" onclick="skipper();">clear</i>
<!--a href="update.html">Reload</a-->
<div id="start">
<div id="box" class="show">
<h2>TheDesk</h2>
<p>crwdns669:0crwdne669:0</p>
<span id="now"></span><b id="ver"></b><br>
<span id="det"></span><br>
<button class="waves-effect btn windows hide" onclick="update('install')"
style="margin-left:15px;">crwdns2382:0crwdne2382:0</button>
<button class="waves-effect btn windows hide" onclick="update('portable')"
style="margin-left:15px;">crwdns1950:0crwdne1950:0</button>
<button class="waves-effect btn linux hide" onclick="update('linux')"
style="margin-left:15px;">crwdns670:0crwdne670:0</button>
<button class="waves-effect btn mac hide" onclick="update('mac')"
style="margin-left:15px;">crwdns670:0crwdne670:0</button>
<br>
crwdns678:0crwdne678:0<br>crwdns679:0crwdne679:0
</div>
<div id="skipper" class="hide">
<h4>crwdns674:0crwdne674:0</h4>
crwdns675:0crwdne675:0<br>
<div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light">
<div>crwdns676:0crwdne676:0</div>
</a>
<a onclick="nextv();" class="pointer skipbtn waves-effect waves-light">
<div>crwdns677:0crwdne677:0</div>
</a>
</div>
<a class="pointer waves-effect" onclick="skipper();" style="margin-top:5px">crwdns680:0crwdne680:0</a>
</div>
<div id="dlnow" class="hide">
<h4>crwdns681:0crwdne681:0</h4>
<h4 id="prog"></h4>
2019-05-26 21:42:52 +10:00
<div class="progress">
<div class="determinate" style="width: 0%"></div>
</div>
2019-02-05 13:33:32 +11:00
</div>
</div>
2019-05-19 17:39:30 +10:00
<script type="text/javascript" src="../../js/common/about.js"></script>
<script type="text/javascript" src="../../js/platform/end.js"></script>
<script>
function skipper() {
$("#dlnow").addClass("hide");
$("#box").toggleClass("show");
if ($("#box").hasClass("hide") && $("#skipper").hasClass("hide")) {
$("#skipper").removeClass("hide");
$("#skipper").addClass("show");
} else {
$("#box").toggleClass("hide");
$("#skipper").toggleClass("hide");
$("#skipper").toggleClass("show");
2019-02-27 03:51:37 +11:00
}
}
2019-05-19 17:39:30 +10:00
verck();
function update(sel) {
$("#box").toggleClass("show");
$("#box").toggleClass("hide");
$("#dlnow").toggleClass("hide");
$("#dlnow").toggleClass("show");
$("#prog").text("");
2019-06-16 00:07:18 +10:00
var bit = localStorage.getItem("bit");
2019-05-19 17:39:30 +10:00
var start = "https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: { 'content-type': 'application/json' },
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
if (sel == "install") {
if (bit == "x64") {
var url = json["winx64"];
var file = "TheDesk-setup.exe";
} else if (bit == "ia32") {
var url = json["winia32"];
var file = "TheDesk-setup-ia32.exe";
}
} else if (sel == "portable") {
if (bit == "x64") {
var url = json["winx64p"];
var file = "TheDesk.exe";
} else if (bit == "ia32") {
var url = json["winia32p"];
var file = "TheDesk-ia32.exe";
}
} else if (sel == "linux") {
if (bit == "x64") {
var url = json["linuxx64"];
var file = "TheDesk-linux-x64.zip";
} else if (bit == "ia32") {
var url = json["linuxia64"];
var file = "TheDesk-linux-ia32.zip";
}
} else if (sel == "mac") {
var url = json["mac"];
shell.openExternal(url);
2019-05-26 21:42:52 +10:00
return false;
2019-05-19 17:39:30 +10:00
}
2019-06-15 03:23:41 +10:00
postMessage(["downloadButton", [url, file]], "*")
2019-05-19 17:39:30 +10:00
});
}
function quit() {
2019-06-15 03:23:41 +10:00
postMessage(["sendSinmpleIpc", "quit"], "*")
2019-05-19 17:39:30 +10:00
}
2019-06-15 03:23:41 +10:00
function updateProg(arg) {
2019-05-19 17:39:30 +10:00
console.log(arg);
2019-06-15 03:23:41 +10:00
$(".determinate").css("width", arg * 100 + "%");
2019-05-19 17:39:30 +10:00
$("#prog").text(Math.floor(arg * 100) + "%");
2019-06-15 03:23:41 +10:00
}
function updateMess(arg) {
2019-05-19 17:39:30 +10:00
console.log(arg);
$("#prog").text(arg);
2019-06-15 03:23:41 +10:00
}
2019-05-19 17:39:30 +10:00
function verck() {
2019-06-16 00:07:18 +10:00
var platform = localStorage.getItem("platform");
var bit = localStorage.getItem("bit");
2019-05-19 17:39:30 +10:00
if (platform == "win32") {
$('.windows').removeClass("hide")
} else if (platform == "linux") {
$('.linux').removeClass("hide")
} else if (platform == "darwin") {
$('.mac').removeClass("hide")
2019-04-23 00:16:57 +10:00
}
2019-05-19 17:39:30 +10:00
var start = "https://thedesk.top/ver.json";
fetch(start, {
method: 'GET',
headers: { 'content-type': 'application/json' },
}).then(function (response) {
return response.json();
}).catch(function (error) {
todo(error);
console.error(error);
}).then(function (json) {
console.log(json);
if (platform == "win32") {
$("#ver").text(json.desk);
localStorage.setItem("next-ver", json.desk);
} else if (platform == "linux") {
$("#ver").text(json.desk_linux);
localStorage.setItem("next-ver", json.desk_linux);
} else if (platform == "darwin") {
$("#ver").text(json.desk_mac);
localStorage.setItem("next-ver", json.desk_mac);
}
var lang = "ps";
if (lang == "ja") {
$("#det").html(json.detail);
} else {
$("#det").html(json.detail_en);
}
$("#now").text(localStorage.getItem("ver"));
});
}
function nextv() {
localStorage.setItem("new-ver-skip", "true");
window.close();
}
function enc(ver) {
var ver = ver.replace(/\s/g, "");
var ver = ver.replace(/\(/g, "-");
var ver = ver.replace(/\)/g, "");
var ver = ver.replace(/\[/g, "_");
var ver = ver.replace(/\]/g, "");
return ver;
}
</script>