TheDesk Usamin (18.6.0) - fix

This commit is contained in:
Cutls 2019-06-16 01:08:10 +09:00
parent 334fbdab3f
commit dda9469874
13 changed files with 71 additions and 67 deletions

View File

@ -78,19 +78,19 @@
<script type="text/javascript" src="./js/common/jquery.js"></script> <script type="text/javascript" src="./js/common/jquery.js"></script>
<script type="text/javascript" src="./js/platform/first-not-view.js"></script> <script type="text/javascript" src="./js/platform/first-not-view.js"></script>
<script type="text/javascript" src="./js/common/materialize.js"></script> <script type="text/javascript" src="./js/common/materialize.js"></script>
<img src="./img/desk.png" style="max-width:70%;"> <img src="./img/desk.png" style="max-width:62%;">
<h5>TheDesk</h5> <h5>TheDesk</h5>
<div class='container'> <div class="container">
<div class='area-name1'>Display version</div> <div class="area-name1">Display version</div>
<div class='area-data1' id="now"></div> <div class="area-data1" id="now"></div>
<div class='area-name2'>Internal version</div> <div class="area-name2">Internal version</div>
<div class='area-data2' id="ver"></div> <div class="area-data2" id="ver"></div>
<div class='area-name3'>Chromium</div> <div class="area-name3">Chromium</div>
<div class='area-data3' id="chrome"></div> <div class="area-data3" id="chrome"></div>
<div class='area-name4'>Electron</div> <div class="area-name4">Electron</div>
<div class='area-data4' id="electron"></div> <div class="area-data4" id="electron"></div>
<div class='area-name5'>Node.js</div> <div class="area-name5">Node.js</div>
<div class='area-data5' id="node"></div> <div class="area-data5" id="node"></div>
</div> </div>
<div class="cp">Copyright &copy; TheDesk 2018<br> <div class="cp">Copyright &copy; TheDesk 2018<br>
Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br> Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br>
@ -104,13 +104,11 @@
class="material-icons left">close</i>Close</button> class="material-icons left">close</i>Close</button>
<script type="text/javascript" src="./js/ui/theme.js"></script> <script type="text/javascript" src="./js/ui/theme.js"></script>
<script> <script>
postMessage(["sendSinmpleIpc", "aboutData"], "*") var about = JSON.parse(localStorage.getItem("about"));
function renderAbout(args) {
$("#now").text(localStorage.getItem("ver")); $("#now").text(localStorage.getItem("ver"));
$("#node").text(args[0]); $("#node").text(about[0]);
$("#chrome").text(args[1]); $("#chrome").text(about[1]);
$("#electron").text(args[2]); $("#electron").text(about[2]);
}
if (location.search) { if (location.search) {
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/); var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/);
var ver = m[1]; var ver = m[1];

View File

@ -41,7 +41,9 @@ onmessage = function (e) {
} else if (e.data[0] == "themeJsonRequest") { } else if (e.data[0] == "themeJsonRequest") {
ipc.send('theme-json-request', e.data[1]); ipc.send('theme-json-request', e.data[1]);
} else if (e.data[0] == "ha") { } else if (e.data[0] == "ha") {
ipc.send('ha', had); ipc.send('ha', e.data[1]);
} else if (e.data[0] == "aboutData") {
ipc.send('aboutData', "");
} else if (e.data[0] == "itunes") { } else if (e.data[0] == "itunes") {
console.log("NowPlaying" + ipc.listenerCount('itunes-np')) console.log("NowPlaying" + ipc.listenerCount('itunes-np'))
if (ipc.listenerCount('itunes-np') > 1) { if (ipc.listenerCount('itunes-np') > 1) {
@ -60,6 +62,7 @@ ipc.send("getPlatform", "")
ipc.on('platform', function (event, args) { ipc.on('platform', function (event, args) {
localStorage.setItem("platform", args[0]) localStorage.setItem("platform", args[0])
localStorage.setItem("bit", args[1]) localStorage.setItem("bit", args[1])
localStorage.setItem("about", JSON.stringify([args[2], args[3], args[4]]))
}) })
ipc.on('winstore', function (event, arg) { ipc.on('winstore', function (event, arg) {
localStorage.setItem("winstore", arg) localStorage.setItem("winstore", arg)
@ -239,10 +242,6 @@ ipc.on('prog', function (event, arg) {
ipc.on('mess', function (event, arg) { ipc.on('mess', function (event, arg) {
postMessage(["updateMess", arg], "*") postMessage(["updateMess", arg], "*")
}) })
//about.html
ipc.on('aboutDataRender', function (event, arg) {
postMessage(["renderAbout", arg], "*")
})
var webviewDom = document.getElementById('webview'); var webviewDom = document.getElementById('webview');
if (webviewDom) { if (webviewDom) {
webviewDom.addEventListener('new-window', function (e) { webviewDom.addEventListener('new-window', function (e) {

View File

@ -460,8 +460,7 @@ function webviewParse(url, key, insert, icnsert, css) {
'<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key + '<div class="column-hide notf-indv-box z-depth-4" id="notf-box_' + key +
'"></div><div class="column-hide notf-indv-box" id="util-box_' + key + '"></div><div class="column-hide notf-indv-box" id="util-box_' + key +
'" style="padding:5px;">' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '" style="width:100%;height:100%;"><div id="timeline_' + key + '" style="padding:5px;">' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '" style="width:100%;height:100%;"><div id="timeline_' + key +
'" class="tl" tlid="' + key + '" data-type="webview" style="width:100%;height:100%;"><webview src="' + url + '" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js"></webview></div></div></div>'; '" class="tl" tlid="' + key + '" data-type="webview" style="width:100%;height:100%;"><webview src="' + url + '" style="width:100%;height:100%;" id="webview" preload="./js/platform/twitter.js" nodeintegration="true">disabled</webview></div></div></div>';
return html; return html;
} }
function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, animecss, q) { function unstreamingTL(type, key, basekey, insert, icnsert, left_fold, css, animecss, q) {

View File

@ -96,30 +96,30 @@ function createWindow() {
if (platform == "linux") { if (platform == "linux") {
var arg = { var arg = {
webPreferences: { webPreferences: {
webviewTag: false, webviewTag: true,
nodeIntegration: false, nodeIntegration: false,
contextIsolation: true, contextIsolation: true,
preload: join(__dirname,"js", "platform", "preload.js") preload: join(__dirname, "js", "platform", "preload.js")
}, },
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, icon: __dirname + '/desk.png' width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, icon: __dirname + '/desk.png'
} }
} else if (platform == "win32") { } else if (platform == "win32") {
var arg = { var arg = {
webPreferences: { webPreferences: {
webviewTag: false, webviewTag: true,
nodeIntegration: false, nodeIntegration: false,
contextIsolation: true, contextIsolation: true,
preload: join(__dirname,"js", "platform", "preload.js") preload: join(__dirname, "js", "platform", "preload.js")
}, },
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true
} }
} else if (platform == "darwin") { } else if (platform == "darwin") {
var arg = { var arg = {
webPreferences: { webPreferences: {
webviewTag: false, webviewTag: true,
nodeIntegration: false, nodeIntegration: false,
contextIsolation: true, contextIsolation: true,
preload: join(__dirname,"js", "platform", "preload.js") preload: join(__dirname, "js", "platform", "preload.js")
}, },
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true
} }
@ -173,9 +173,12 @@ function createWindow() {
var platform = process.platform; var platform = process.platform;
var bit = process.arch; var bit = process.arch;
if (platform == "darwin") { if (process.argv.indexOf("--dev") === -1) {
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, false, dir))); packaged = true;
} else {
packaged = false;
} }
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir)));
//CSS //CSS
css.css(mainWindow); css.css(mainWindow);
//アップデータとダウンロード //アップデータとダウンロード

View File

@ -24,9 +24,8 @@ function dl(mainWindow, lang_path, base, dirname) {
width: 600, width: 600,
height: 400, height: 400,
"transparent": false, // ウィンドウの背景を透過 "transparent": false, // ウィンドウの背景を透過
"frame": true, // 枠の無いウィンドウ "frame": false, // 枠の無いウィンドウ
"resizable": true, "resizable": false
"modal": true
}); });
var lang = fs.readFileSync(lang_path, 'utf8'); var lang = fs.readFileSync(lang_path, 'utf8');
updatewin.loadURL(base + lang + '/update.html'); updatewin.loadURL(base + lang + '/update.html');

View File

@ -65,6 +65,28 @@ function templete(lang, mainWindow, packaged, dir) {
"en": "Close" "en": "Close"
} }
} }
if(packaged){
var ifDev = [
{
label: dict.reload[lang],
accelerator: 'CmdOrCtrl+R',
click: function () { mainWindow.reload(); }
}
]
}else{
var ifDev = [
{
label: 'Toggle Developer Tools',
accelerator: 'Alt+Command+I',
click: function () { if (!packaged) { mainWindow.toggleDevTools(); } }
},
{
label: dict.reload[lang],
accelerator: 'CmdOrCtrl+R',
click: function () { mainWindow.reload(); }
}
]
}
const menu = [{ const menu = [{
label: dict.application[lang], label: dict.application[lang],
submenu: [ submenu: [
@ -103,18 +125,7 @@ function templete(lang, mainWindow, packaged, dir) {
] ]
}, { }, {
label: dict.view[lang], label: dict.view[lang],
submenu: [ submenu: ifDev
{
label: 'Toggle Developer Tools',
accelerator: 'Alt+Command+I',
click: function () { if (!packaged) { mainWindow.toggleDevTools(); } }
},
{
label: dict.reload[lang],
accelerator: 'CmdOrCtrl+R',
click: function () { mainWindow.reload(); }
}
]
}, },
{ {
label: dict.window[lang], label: dict.window[lang],

View File

@ -42,7 +42,7 @@ function system(mainWindow, dir, lang, dirname) {
}); });
//プラットフォーム //プラットフォーム
ipc.on('getPlatform', function (e, arg) { ipc.on('getPlatform', function (e, arg) {
e.sender.webContents.send('platform', [process.platform, process.arch]); e.sender.webContents.send('platform', [process.platform, process.arch, process.version, process.versions.chrome, process.versions.electron]);
}) })
//言語 //言語
ipc.on('lang', function (e, arg) { ipc.on('lang', function (e, arg) {
@ -137,30 +137,23 @@ function system(mainWindow, dir, lang, dirname) {
}) })
ipc.on('quit', (e, args) => { ipc.on('quit', (e, args) => {
app.quit(); app.quit();
}); });
ipc.on('about', (e, args) => { ipc.on('about', (e, args) => {
about(); about();
}); });
ipc.on('aboutData', (e, args) => {
e.sender.webContents.send('aboutDataRender', [process.version, process.versions.chrome, process.versions.electron]);
});
function about() { function about() {
var ver = app.getVersion() var ver = app.getVersion()
var window = new BrowserWindow({ var window = new BrowserWindow({
webPreferences: { webPreferences: {
webviewTag: false, webviewTag: false,
nodeIntegration: false, nodeIntegration: false
contextIsolation: false,
preload: join(dirname,"js", "platform", "preload.js")
}, },
width: 300, width: 300,
height: 480, height: 480,
"transparent": false, // ウィンドウの背景を透過 "transparent": false, // ウィンドウの背景を透過
"frame": true, // 枠の無いウィンドウ "frame": false, // 枠の無いウィンドウ
"resizable": true "resizable": false
}); });
window.loadURL(dir + '/about.html?ver=' + ver); window.loadURL(dir + '/about.html?ver=' + ver);
return "true" return "true"

View File

@ -7,6 +7,7 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"construct": "cd view/make && node make", "construct": "cd view/make && node make",
"dev": "electron ./ --dev",
"dist": "build --linux snap", "dist": "build --linux snap",
"build:js": "node build.js", "build:js": "node build.js",
"build": "electron-builder", "build": "electron-builder",

View File

@ -684,7 +684,8 @@
<h5>Release Note Usamin (18.6.0)</h5> <h5>Release Note Usamin (18.6.0)</h5>
・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br> ・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br>
・投票済みのアンケートについて修正。<br> ・投票済みのアンケートについて修正。<br>
<b>セキュリティの大幅な強化。</b> <b>セキュリティの大幅な強化。</b><br>
・ご注意<img class="emoji" draggable="false" alt="⚠️" src="https://twemoji.maxcdn.com/2/72x72/26a0.png">: TweetDeck統合は設定で有効にしないと使えなくなりました。
<br> <br>
<h5>ThinkingDeskラベル</h5> <h5>ThinkingDeskラベル</h5>
<img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br> <img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br>

View File

@ -684,7 +684,8 @@
<h5>Release Note Usamin (18.6.0)</h5> <h5>Release Note Usamin (18.6.0)</h5>
・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br> ・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br>
・投票済みのアンケートについて修正。<br> ・投票済みのアンケートについて修正。<br>
<b>セキュリティの大幅な強化。</b> <b>セキュリティの大幅な強化。</b><br>
・ご注意<img class="emoji" draggable="false" alt="⚠️" src="https://twemoji.maxcdn.com/2/72x72/26a0.png">: TweetDeck統合は設定で有効にしないと使えなくなりました。
<br> <br>
<h5>ThinkingDeskラベル</h5> <h5>ThinkingDeskラベル</h5>
<img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br> <img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br>

View File

@ -684,7 +684,8 @@
<h5>Release Note Usamin (18.6.0)</h5> <h5>Release Note Usamin (18.6.0)</h5>
・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br> ・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br>
・投票済みのアンケートについて修正。<br> ・投票済みのアンケートについて修正。<br>
<b>セキュリティの大幅な強化。</b> <b>セキュリティの大幅な強化。</b><br>
・ご注意<img class="emoji" draggable="false" alt="⚠️" src="https://twemoji.maxcdn.com/2/72x72/26a0.png">: TweetDeck統合は設定で有効にしないと使えなくなりました。
<br> <br>
<h5>ThinkingDeskラベル</h5> <h5>ThinkingDeskラベル</h5>
<img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br> <img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br>

View File

@ -684,7 +684,8 @@
<h5>Release Note Usamin (18.6.0)</h5> <h5>Release Note Usamin (18.6.0)</h5>
・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br> ・アカウント選択のデザイン修正。クリック直後に閉じてしまうバグを修正。<br>
・投票済みのアンケートについて修正。<br> ・投票済みのアンケートについて修正。<br>
<b>セキュリティの大幅な強化。</b> <b>セキュリティの大幅な強化。</b><br>
・ご注意<img class="emoji" draggable="false" alt="⚠️" src="https://twemoji.maxcdn.com/2/72x72/26a0.png">: TweetDeck統合は設定で有効にしないと使えなくなりました。
<br> <br>
<h5>ThinkingDeskラベル</h5> <h5>ThinkingDeskラベル</h5>
<img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br> <img src="../../img/thinkingdesk.png" style="width:100px;" draggable="false"><br>

3
package-lock.json generated
View File

@ -1,3 +0,0 @@
{
"lockfileVersion": 1
}