From 46dbc9ae62c706cf839999918df7b11645311ce9 Mon Sep 17 00:00:00 2001 From: Cutls Date: Mon, 26 Aug 2019 21:06:07 +0900 Subject: [PATCH] Add: GIt hash --- app/about.html | 27 ++++++++++++++++++++------- app/css/tl.css | 4 ++++ app/js/platform/preload.js | 1 + app/js/ui/tips.js | 2 +- app/main.js | 2 +- app/main/dl.js | 4 +--- app/main/language.js | 7 ++++--- app/main/system.js | 8 +++++--- app/view/make/index.sample.html | 4 ++-- app/view/make/language/en/update.json | 2 +- app/view/make/language/ja/update.json | 2 +- app/view/make/make.js | 1 + app/view/make/setting.sample.html | 6 ++++-- app/view/make/update.sample.html | 2 +- 14 files changed, 47 insertions(+), 25 deletions(-) diff --git a/app/about.html b/app/about.html index a4ccca0b..290933a6 100644 --- a/app/about.html +++ b/app/about.html @@ -15,6 +15,8 @@ font-family: 'Open Sans'; -webkit-app-region: drag; cursor: move; + padding: 5px; + padding-top: 15px; } a, @@ -27,7 +29,7 @@ display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr 1fr 1fr; - grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5'; + grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5''name6 data6'; text-align: left; margin: 5px; } @@ -71,6 +73,14 @@ .area-data5 { grid-area: data5; } + + .area-name6 { + grid-area: name6; + } + + .area-data6 { + grid-area: data6; + } @@ -85,12 +95,14 @@
Internal version
-
Chromium
-
-
Electron
-
-
Node.js
-
+
Commit(7chars)
+
+
Chromium
+
+
Electron
+
+
Node.js
+
Copyright © TheDesk 2018
Main developer(author): Cutls P
@@ -114,6 +126,7 @@ var ver = m[1]; $("#ver").text(ver); } + $("#hash").html('' + about[3].slice(0, 7) + ''); $(document).on('click', 'a', e => { var url = $(e.target).attr('href'); postMessage(["openUrl", url], "*") diff --git a/app/css/tl.css b/app/css/tl.css index d0fbe093..82db5723 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -47,6 +47,10 @@ #bottom .leftside { display: flex; } +#tips{ + display: flex; + align-items: center; +} #bottom #tips img { vertical-align: -3px; } diff --git a/app/js/platform/preload.js b/app/js/platform/preload.js index cd4becb2..aea35298 100644 --- a/app/js/platform/preload.js +++ b/app/js/platform/preload.js @@ -2,6 +2,7 @@ var electron = require("electron"); const shell = electron.shell; var ipc = electron.ipcRenderer; onmessage = function (e) { + console.log(e) if (e.data[0] == "openUrl") { urls = e.data[1].match(/https?:\/\/(.+)/); if (urls) { diff --git a/app/js/ui/tips.js b/app/js/ui/tips.js index 9167f59b..4318a0f8 100644 --- a/app/js/ui/tips.js +++ b/app/js/ui/tips.js @@ -25,7 +25,7 @@ function tips(mode) { clearInterval(spotStart); if (mode == "ver") { tipsToggle() - $("#tips-text").html('TheDesk ' + localStorage.getItem("ver") + '[supervisor_account1+]') + $("#tips-text").html('TheDesk ' + localStorage.getItem("ver") + ' {'+ gitHash.slice(0, 7) +'} [supervisor_account1+]') localStorage.setItem("tips", "ver") } else if (mode == "clock") { tipsToggle() diff --git a/app/main.js b/app/main.js index 4ee004bf..ed1aabbd 100644 --- a/app/main.js +++ b/app/main.js @@ -202,7 +202,7 @@ function createWindow() { var platform = process.platform; var bit = process.arch; - Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir))); + Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname))); //CSS css.css(mainWindow); //アップデータとダウンロード diff --git a/app/main/dl.js b/app/main/dl.js index 2bc3cfee..95bd49f9 100644 --- a/app/main/dl.js +++ b/app/main/dl.js @@ -26,11 +26,9 @@ function dl(mainWindow, lang_path, base, dirname) { "transparent": false, // ウィンドウの背景を透過 "frame": false, // 枠の無いウィンドウ "resizable": false - }); - //updatewin.openDevTools() + }) var lang = fs.readFileSync(lang_path, 'utf8'); updatewin.loadURL(base + lang + '/update.html'); - return "true" } else { return false; diff --git a/app/main/language.js b/app/main/language.js index 6c86269b..07ef568c 100644 --- a/app/main/language.js +++ b/app/main/language.js @@ -1,11 +1,12 @@ // Create the Application's main menu -function templete(lang, mainWindow, packaged, dir) { +function templete(lang, mainWindow, packaged, dir, dirname) { if(lang !="ja" && lang != "en"){ lang = "en" } const electron = require("electron"); const app = electron.app; const BrowserWindow = electron.BrowserWindow; + const join = require('path').join; const dict = { "application": { "ja": "アプリケーション", @@ -101,9 +102,9 @@ function templete(lang, mainWindow, packaged, dir) { webviewTag: false, nodeIntegration: false, contextIsolation: true, - preload: "../js/platform/preload.js" + preload: join(dirname , "js", "platform", "preload.js") }, - width: 300, height: 460, + width: 300, height: 500, "transparent": false, // ウィンドウの背景を透過 "frame": false, // 枠の無いウィンドウ "resizable": false diff --git a/app/main/system.js b/app/main/system.js index 6caa38b1..c1c8ffb7 100644 --- a/app/main/system.js +++ b/app/main/system.js @@ -130,10 +130,12 @@ function system(mainWindow, dir, lang, dirname) { var window = new BrowserWindow({ webPreferences: { webviewTag: false, - nodeIntegration: false + nodeIntegration: false, + contextIsolation: true, + preload: join(dirname, "js", "platform", "preload.js") }, width: 300, - height: 480, + height: 500, "transparent": false, // ウィンドウの背景を透過 "frame": false, // 枠の無いウィンドウ "resizable": false @@ -156,7 +158,7 @@ function system(mainWindow, dir, lang, dirname) { webviewTag: false, nodeIntegration: false, contextIsolation: true, - preload: join(dirname,"js", "platform", "preload.js") + preload: join(dirname, "js", "platform", "preload.js") }, width: 350, height: 200, diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index 4c48af3e..32dcf917 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -992,10 +992,10 @@
- + bubble_chart -
+
diff --git a/app/view/make/language/en/update.json b/app/view/make/language/en/update.json index d3a26a51..14d61245 100644 --- a/app/view/make/language/en/update.json +++ b/app/view/make/language/en/update.json @@ -10,7 +10,7 @@ "nexttl":"Until next TL loading", "nextver":"Until next version", "problem1":"Some problems?", - "problem2":"Please download on Oficial HP.", + "problem2":"Please download on Oficial HP.", "continue":"Continue updating", "dlnow":"Downloading..." } diff --git a/app/view/make/language/ja/update.json b/app/view/make/language/ja/update.json index 7ee4fb4e..4cfc2e56 100644 --- a/app/view/make/language/ja/update.json +++ b/app/view/make/language/ja/update.json @@ -9,7 +9,7 @@ "nexttl":"次回TL表示時まで", "nextver":"次のバージョンが出るまで", "problem1":"問題が発生しますか?", - "problem2":"公式HPからダウンロードをお試しください。", + "problem2":"公式HPからダウンロードをお試しください。", "continue":"アップデートを続行", "dlnow":"ダウンロード中" } \ No newline at end of file diff --git a/app/view/make/make.js b/app/view/make/make.js index e40eaaa0..18311753 100644 --- a/app/view/make/make.js +++ b/app/view/make/make.js @@ -43,6 +43,7 @@ for (let i = 0; i < samples.length; i++) { } source = source.replace(/@@versionLetter@@/g, ver) source = source.replace(/@@gitHash@@/g, gitHash) + source = source.replace(/@@gitHashShort@@/g, gitHash.slice(0, 7)) source = source.replace(/@@lang@@/g, lang) source = source.replace(/@@langlist@@/g, langstr) fs.writeFileSync("../" + lang + "/" + pages[i], source) diff --git a/app/view/make/setting.sample.html b/app/view/make/setting.sample.html index fa55e80a..8b71a299 100644 --- a/app/view/make/setting.sample.html +++ b/app/view/make/setting.sample.html @@ -449,14 +449,16 @@ style="width:100%; max-width:500px;">Developer: Cutls@cutls.com
+ TheDesk @ @@gitHash@@
+
Kyash

@@checkup@@
OSS License@@ossJP@@
+
Copyright © TheDesk 2018 - Under GNU General Public License v3.0 and Terms of Use/Privacy + Under GNU General Public License v3.0 and Privacy Policy
Developer: Cutls P( @Cutls@cutls.com) diff --git a/app/view/make/update.sample.html b/app/view/make/update.sample.html index a1209142..a30df66a 100644 --- a/app/view/make/update.sample.html +++ b/app/view/make/update.sample.html @@ -178,7 +178,7 @@ } } else if (sel == "mac") { var url = json["mac"]; - shell.openExternal(url); + postMessage(["openUrl", url], "*") return false; } postMessage(["downloadButton", [url, file]], "*")