Skip to content

Commit ca9a3ec

Browse files
committed
update website & win7 more compatible
1 parent ab397ef commit ca9a3ec

File tree

6 files changed

+66
-25
lines changed

6 files changed

+66
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ This application is being frequently updated, so does this list.
7777

7878
## Contact
7979

80-
- Homepage: [wnr.scris.top](https://wnr.scris.top/).
80+
- Homepage: [getwnr.com](https://getwnr.com/).
8181

8282
- Downloads: [Releases](https://github.com/RoderickQiu/wnr/releases/).
8383

84-
- Need Help: [Go to Help Page](https://wnr.scris.top/guide/1-basic-usage.html) or [Contact Me](mailto:scrisqiu@hotmail.com).
84+
- Need Help: [Go to Help Page](https://getwnr.com/guide/1-basic-usage.html) or [Contact Me](mailto:scrisqiu@hotmail.com).
8585

8686
- Any issues or pull requests are appreciated.
8787

main.js

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, BrowserWindow, ipcMain, Tray, Menu, globalShortcut, dialog, shell, powerSaveBlocker, powerMonitor, Notification, nativeTheme } = require('electron')
1+
const { app, BrowserWindow, ipcMain, Tray, Menu, globalShortcut, dialog, shell, powerSaveBlocker, powerMonitor, systemPreferences, Notification, nativeTheme } = require('electron')
22
const Store = require('electron-store');
33
const store = new Store();
44
const path = require("path");
@@ -9,7 +9,7 @@ var Registry = require('winreg')
99
let win, settingsWin = null, aboutWin = null, tourWin = null;
1010
let tray = null, contextMenu = null;
1111
let resetAlarm = null, powerSaveBlockerId = null;
12-
let isTimerWin = null, isWorkMode = null;
12+
let isTimerWin = null, isWorkMode = null, isShadowless = null;
1313
let timeLeftTip = null;
1414
let predefinedTasks = null;
1515
let pushNotificationLink = null
@@ -175,8 +175,8 @@ app.on('ready', () => {
175175
})
176176

177177
globalShortcut.register('CommandOrControl+Shift+L', () => {
178-
let focusWin = BrowserWindow.getFocusedWindow()
179-
focusWin && focusWin.toggleDevTools()
178+
let focusWin = BrowserWindow.getFocusedWindow();
179+
focusWin && focusWin.toggleDevTools();
180180
})//toggle devtools
181181

182182
if (store.get('islocked')) {//locked mode
@@ -282,6 +282,40 @@ app.on('ready', () => {
282282
powerSaveBlockerId = powerSaveBlocker.start('prevent-app-suspension');
283283
if (win != null) win.webContents.send('alter-start-stop', 'start')
284284
})
285+
286+
if (process.platform == "win32") {
287+
var regKey = new Registry({
288+
hive: Registry.HKCU,
289+
key: '\\Control Panel\\Desktop\\'
290+
})
291+
regKey.values(function (err, items) {
292+
if (err)
293+
return 'unset';
294+
else {
295+
for (var i = 0; i < items.length; i++) {
296+
if (items[i].name == 'UserPreferencesMask') {
297+
if (parseInt(items[i].value, 16).toString(2).charAt(21) == 1 && systemPreferences.isAeroGlassEnabled()) {
298+
isShadowless = false;
299+
try {
300+
store.set("is-shadowless", false);
301+
}
302+
catch (e) {
303+
console.log(e);
304+
}
305+
} else {
306+
isShadowless = true;
307+
try {
308+
store.set("is-shadowless", true);
309+
}
310+
catch (e) {
311+
console.log(e);
312+
}
313+
}
314+
}
315+
}
316+
}
317+
})
318+
}//backport when shadow disabled
285319
})
286320

287321
function notificationSolution(title, body, func) {
@@ -354,7 +388,7 @@ function traySolution(isFullScreen) {
354388
}, {
355389
label: i18n.__('website'),
356390
click: function () {
357-
shell.openExternal('https://wnr.scris.top/');
391+
shell.openExternal('https://getwnr.com/');
358392
}
359393
}, {
360394
label: i18n.__('github'),
@@ -455,7 +489,7 @@ function macOSFullscreenSolution(isFullScreen) {
455489
}, {
456490
label: i18n.__('website'),
457491
click: function () {
458-
shell.openExternal('https://wnr.scris.top/');
492+
shell.openExternal('https://getwnr.com/');
459493
}
460494
}, {
461495
label: i18n.__('github'),
@@ -726,17 +760,19 @@ ipcMain.on('delete-all-data', function () {
726760
})
727761

728762
function windowCloseChk() {
729-
dialog.showMessageBox(win, {
730-
title: i18n.__('window-close-dialog-box-title'),
731-
type: "warning",
732-
message: i18n.__('window-close-dialog-box-content'),
733-
checkboxLabel: i18n.__('window-close-dialog-box-chk'),
734-
checkboxChecked: false
735-
}).then(function (msger) {
736-
if (msger.checkboxChecked) {
737-
app.quit()
738-
}
739-
})
763+
if (app.isPackaged)
764+
dialog.showMessageBox(win, {
765+
title: i18n.__('window-close-dialog-box-title'),
766+
type: "warning",
767+
message: i18n.__('window-close-dialog-box-content'),
768+
checkboxLabel: i18n.__('window-close-dialog-box-chk'),
769+
checkboxChecked: false
770+
}).then(function (msger) {
771+
if (msger.checkboxChecked) {
772+
app.quit()
773+
}
774+
})
775+
else app.quit()
740776
}
741777
ipcMain.on('window-close-chk', windowCloseChk);
742778

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wnr",
3-
"version": "1.12.2",
3+
"version": "1.12.3",
44
"description": "It's a timer app with strong expansibility for computers. The name is an abbr of \"Work and Rest\".",
55
"main": "main.js",
66
"scripts": {
@@ -15,7 +15,7 @@
1515
},
1616
"author": "RoderickQiu",
1717
"license": "MPL-2.0",
18-
"homepage": "https://wnr.scris.top",
18+
"homepage": "https://getwnr.com",
1919
"appId": "com.scrisstudio.wnr",
2020
"copyright": "(c) Roderick Qiu",
2121
"productName": "wnr",

renderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ function isLockMode() {
88
$('#predefined-tasks-divider').css('display', 'none');
99
}
1010
}//lock mode settings
11-
isLockMode()
11+
isLockMode()
12+
13+
if (store.get("is-shadowless")) {
14+
$('html').css('border', '#33333333 1px solid')
15+
}

res/builder/win.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const config = {
1717
"nsis": {
1818
"installerLanguages": [
1919
"en-US",
20-
"zh-CN"
20+
"zh-CN",
21+
"zh-TW"
2122
],
2223
"guid": "B5BF1EA0-B474-40D3-B31E-6AD92477CCAF",
2324
"license": "LICENSE",

supporter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function call(content) {
2525

2626
function getHelp(idCode) {
2727
require('electron').shell.openExternal(store.get("i18n") == 'zh' ?
28-
'https://wnr.scris.top/zh/' + idCode + '.html' :
29-
'https://wnr.scris.top/' + idCode + '.html');
28+
'https://getwnr.com/zh/' + idCode + '.html' :
29+
'https://getwnr.com/' + idCode + '.html');
3030
}
3131

3232
function isInDark() {

0 commit comments

Comments
 (0)