improve: update

This commit is contained in:
cutls 2019-10-25 00:04:53 +09:00
parent 0677c24887
commit bb08ec2435
4 changed files with 263 additions and 262 deletions

View File

@ -2,15 +2,18 @@
"updatehere":"Get latest TheDesk", "updatehere":"Get latest TheDesk",
"download":"Start", "download":"Start",
"portable":"Portable ver.", "portable":"Portable ver.",
"installer":"Installer ver.", "installer":"Installer(Recommended)",
"snap":"Snap ver may be on Snapcraft", "linux":"zip",
"unrewrite":"Not rewrite", "linuxdeb":"deb(Recommended on buntu, Debian)",
"linuxsnap":"snap",
"snap":"Get it on Snapcraft",
"sureupd":"You may lose a cool experience!", "sureupd":"You may lose a cool experience!",
"skipupd":"Skip this update", "skipupd":"Skip this update",
"nexttl":"Until next TL loading", "nexttl":"Hidden until next TL loading",
"nextver":"Until next version", "nextver":"Hidden until next version",
"problem1":"Some problems?", "problem1":"Some problems?",
"problem2":"Please download on <a href='https://thedesk.top'>Oficial HP</a>.", "problem2":"Please download on <a href='https://thedesk.top'>Oficial HP</a>.",
"continue":"Continue updating", "continue":"Continue updating",
"dlnow":"Downloading..." "dlnow":"Downloading...",
"checkWhatIsNew": "What is new?"
} }

View File

@ -9,10 +9,11 @@
"snap":"snap版はSnapcraft等よりDLしてください。", "snap":"snap版はSnapcraft等よりDLしてください。",
"sureupd":"アップデートは必ず行ってください", "sureupd":"アップデートは必ず行ってください",
"skipupd":"アップデートをスキップする", "skipupd":"アップデートをスキップする",
"nexttl":"次回TL表示時まで", "nexttl":"次回TL表示時までスキップ",
"nextver":"次のバージョンが出るまで", "nextver":"次のバージョンが出るまでスキップ",
"problem1":"問題が発生しますか?", "problem1":"問題が発生しますか?",
"problem2":"<a href='https://thedesk.top'>公式HP</a>からダウンロードをお試しください。", "problem2":"<a href='https://thedesk.top'>公式HP</a>からダウンロードをお試しください。",
"continue":"アップデートを続行", "continue":"アップデートを続行",
"dlnow":"ダウンロード中" "dlnow":"ダウンロード中",
"checkWhatIsNew": "アップデート内容"
} }

View File

@ -380,10 +380,10 @@
onclick="spotifyAuth()" class="btn waves-effect" style="width:100px;">@@set@@</button></div> onclick="spotifyAuth()" class="btn waves-effect" style="width:100px;">@@set@@</button></div>
<a onclick="spotifyConnect()" class="btn waves-effect nex" <a onclick="spotifyConnect()" class="btn waves-effect nex"
style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-enable"><i style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-enable"><i
class="fa fa-spotify left"></i>@@connect@@</a> class="fab fa-spotify left"></i>@@connect@@</a>
<a onclick="spotifyDisconnect()" class="btn waves-effect nex disabled" <a onclick="spotifyDisconnect()" class="btn waves-effect nex disabled"
style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-disable"><i style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-disable"><i
class="fa fa-spotify left"></i>@@disconnect@@</a> class="fab fa-spotify left"></i>@@disconnect@@</a>
<h5>@@templateedit@@</h5> <h5>@@templateedit@@</h5>
@@templateeditwarn@@<br> @@templateeditwarn@@<br>
<textarea id="np-temp" class="materialize-textarea" data-length="500">#NowPlaying {song} / {album} / {artist} <textarea id="np-temp" class="materialize-textarea" data-length="500">#NowPlaying {song} / {album} / {artist}

View File

@ -1,24 +1,20 @@
<!doctype html> <!DOCTYPE html>
<html lang="@@lang@@"> <html lang="@@lang@@">
<head> <head>
<title>Update - TheDesk</title> <title>Update - TheDesk</title>
<link href="../../node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet"> <link href="../../node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet" />
<link href="../../css/master.css" type="text/css" rel="stylesheet"> <link href="../../css/master.css" type="text/css" rel="stylesheet" />
<meta charset="utf-8"> <meta charset="utf-8" />
@@comment-start@@ @@comment-start@@
<script type="text/javascript"> <script type="text/javascript">
var _jipt = []; var _jipt = [];
_jipt.push(['project', 'thedesk']); _jipt.push(["project", "thedesk"]);
</script> </script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script> <script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ @@comment-end@@
</head>
<body>
<style> <style>
body { body {
font-family: 'Open Sans'; font-family: "Open Sans";
-webkit-app-region: drag; -webkit-app-region: drag;
cursor: move; cursor: move;
padding: 10px; padding: 10px;
@ -55,26 +51,32 @@
.skipbtn { .skipbtn {
display: block; display: block;
float: left; float: left;
width: 200px; width: 250px;
height: 200px; height: 200px;
border: 1px solid; border: 1px solid;
margin-left: 5px; margin-left: 5px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border: 1px solid; border: 1px solid #c26363;
overflow: hidden; overflow: hidden;
color: #c26363
} }
.skipbtn:hover { .skipbtn:hover {
background-color: #b3e5fc; background-color: #c26363;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
color:white;
} }
#prog { #prog {
font-size: 200%; font-size: 200%;
} }
</style> </style>
<link href="../../node_modules/@fortawesome/fontawesome-free/css/all.min.css" type="text/css" rel="stylesheet" />
</head>
<body>
<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script> <script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../node_modules/materialize-css/dist/js/materialize.js"></script> <script type="text/javascript" src="../../node_modules/materialize-css/dist/js/materialize.js"></script>
@ -85,26 +87,20 @@
<div id="box" class="show"> <div id="box" class="show">
<h2>TheDesk</h2> <h2>TheDesk</h2>
<p>@@updatehere@@</p> <p>@@updatehere@@</p>
<span id="now"></span><b id="ver"></b><br> <span id="now"></span><b id="ver"></b><br />
<span id="det"></span><br> <a href="" id="github" class="btn waves-effect grey darken-1"><i class="fab fa-github left"></i>@@checkWhatIsNew@@</a><br />
<button class="waves-effect btn windows hide" onclick="update('install')" <button class="waves-effect btn windows hide" onclick="update('install')" style="margin-left:15px;">@@installer@@</button>
style="margin-left:15px;">@@installer@@</button> <button class="waves-effect btn windows hide" onclick="update('portable')" style="margin-left:15px;">@@portable@@</button>
<button class="waves-effect btn windows hide" onclick="update('portable')" <button class="waves-effect btn linux hide" onclick="update('linux')" style="margin-left:15px;">@@linux@@</button>
style="margin-left:15px;">@@portable@@</button> <button class="waves-effect btn linux hide" onclick="update('linuxdeb')" style="margin-left:15px;">@@linuxdeb@@</button>
<button class="waves-effect btn linux hide" onclick="update('linux')" <button class="waves-effect btn linux hide" onclick="update('linuxsnap')" style="margin-left:15px;">@@linuxsnap@@</button>
style="margin-left:15px;">@@linux@@</button> <button class="waves-effect btn mac hide" onclick="update('mac')" style="margin-left:15px;">@@download@@</button>
<button class="waves-effect btn linux hide" onclick="update('linuxdeb')" <br />
style="margin-left:15px;">@@linuxdeb@@</button> @@problem1@@<br />@@problem2@@
<button class="waves-effect btn linux hide" onclick="update('linuxsnap')"
style="margin-left:15px;">@@linuxsnap@@</button>
<button class="waves-effect btn mac hide" onclick="update('mac')"
style="margin-left:15px;">@@download@@</button>
<br>
@@problem1@@<br>@@problem2@@
</div> </div>
<div id="skipper" class="hide"> <div id="skipper" class="hide">
<h4>@@sureupd@@</h4> <h4>@@skipupd@@</h4>
@@skipupd@@<br> @@sureupd@@<br />
<div id="updskip"> <div id="updskip">
<a onclick="window.close();" class="pointer skipbtn waves-effect waves-light"> <a onclick="window.close();" class="pointer skipbtn waves-effect waves-light">
<div>@@nexttl@@</div> <div>@@nexttl@@</div>
@ -148,14 +144,17 @@
var bit = localStorage.getItem("bit"); var bit = localStorage.getItem("bit");
var start = "https://thedesk.top/ver.json"; var start = "https://thedesk.top/ver.json";
fetch(start, { fetch(start, {
method: 'GET', method: "GET",
headers: { 'content-type': 'application/json' }, headers: { "content-type": "application/json" }
}).then(function (response) { })
.then(function(response) {
return response.json(); return response.json();
}).catch(function (error) { })
.catch(function(error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function (json) { })
.then(function(json) {
if (sel == "install") { if (sel == "install") {
if (bit == "x64") { if (bit == "x64") {
var url = json["winx64"]; var url = json["winx64"];
@ -177,24 +176,19 @@
var file = "thedesk.zip"; var file = "thedesk.zip";
} else if (sel == "linuxdeb") { } else if (sel == "linuxdeb") {
var url = json["linuxdeb"]; var url = json["linuxdeb"];
var url = json["mac"]; var file = "thedesk_" + json.unique_linux + "_amd64.deb";
postMessage(["openUrl", url], "*")
return false;
} else if (sel == "linuxsnap") { } else if (sel == "linuxsnap") {
var url = json["linuxsnap"]; var url = json["linuxsnap"];
postMessage(["openUrl", url], "*") var file = "thedesk_" + json.unique_linux + "_amd64.snap";
return false;
} else if (sel == "mac") { } else if (sel == "mac") {
var url = json["mac"]; var url = json["mac"];
postMessage(["openUrl", url], "*") var file = "TheDesk-" + json.unique_mac + ".dmg";
return false;
} }
postMessage(["downloadButton", [url, file]], "*") postMessage(["downloadButton", [url, file]], "*");
}); });
} }
function quit() { function quit() {
postMessage(["sendSinmpleIpc", "quit"], "*") postMessage(["sendSinmpleIpc", "quit"], "*");
} }
function updateProg(arg) { function updateProg(arg) {
console.log(arg); console.log(arg);
@ -209,42 +203,43 @@
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem("platform");
var bit = localStorage.getItem("bit"); var bit = localStorage.getItem("bit");
if (platform == "win32") { if (platform == "win32") {
$('.windows').removeClass("hide") $(".windows").removeClass("hide");
} else if (platform == "linux") { } else if (platform == "linux") {
$('.linux').removeClass("hide") $(".linux").removeClass("hide");
} else if (platform == "darwin") { } else if (platform == "darwin") {
$('.mac').removeClass("hide") $(".mac").removeClass("hide");
} }
var start = "https://thedesk.top/ver.json"; var start = "https://thedesk.top/ver.json";
fetch(start, { fetch(start, {
method: 'GET', method: "GET",
headers: { 'content-type': 'application/json' }, headers: { "content-type": "application/json" }
}).then(function (response) { })
.then(function(response) {
return response.json(); return response.json();
}).catch(function (error) { })
.catch(function(error) {
todo(error); todo(error);
console.error(error); console.error(error);
}).then(function (json) { })
.then(function(json) {
console.log(json); console.log(json);
if (platform == "win32") { if (platform == "win32") {
$("#ver").text(json.desk); $("#ver").text(json.desk);
localStorage.setItem("next-ver", json.desk); localStorage.setItem("next-ver", json.desk);
var url = "https://github.com/cutls/TheDesk/releases/tag/v" + json.unique;
} else if (platform == "linux") { } else if (platform == "linux") {
$("#ver").text(json.desk_linux); $("#ver").text(json.desk_linux);
localStorage.setItem("next-ver", json.desk_linux); localStorage.setItem("next-ver", json.desk_linux);
var url = "https://github.com/cutls/TheDesk/releases/tag/v" + json.unique_linux;
} else if (platform == "darwin") { } else if (platform == "darwin") {
$("#ver").text(json.desk_mac); $("#ver").text(json.desk_mac);
localStorage.setItem("next-ver", json.desk_mac); localStorage.setItem("next-ver", json.desk_mac);
var url = "https://github.com/cutls/TheDesk/releases/tag/v" + json.unique_mac;
} }
var lang = "@@lang@@";
if (lang == "ja") { $("#github").attr("href", url);
$("#det").html(json.detail);
} else {
$("#det").html(json.detail_en);
}
$("#now").text(localStorage.getItem("ver")); $("#now").text(localStorage.getItem("ver"));
}); });
} }
function nextv() { function nextv() {
@ -260,3 +255,5 @@
return ver; return ver;
} }
</script> </script>
</body>
</html>