Skip to content

Commit

Permalink
optimized + celebrate for 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Dec 29, 2019
1 parent 869eed9 commit 412f0e4
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 400 deletions.
6 changes: 6 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"type": "shell",
"command": "yarn",
"group": "none"
},
{
"label": "autoclean",
"type": "shell",
"command": "yarn autoclean --force",
"group": "none"
}
]
}
45 changes: 45 additions & 0 deletions .yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
images
assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
appveyor.yml
circle.yml
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml

# misc
*.md
4 changes: 4 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
$('#issues').attr('title', i18n.__('issues'));
</script>
</p>
<p class="extreme-small text-muted">
&copy; 2019-2020 <a href="https://r-q.name/">Roderick Qiu.</a>
</p>
<p class="extreme-small">&nbsp;</p>
<p class="extreme-small">
<a class="rest"
href="javascript:require('electron').shell.openExternal('https://wnr.scris.top/acknoledgements.html')">Acknoledgements</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/bangzhu.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2 class="h4">2、其他</h2>
<footer class="footer mx-auto py-4 text-center m">
<div class="container">
<span class="text-muted">
&copy; 2019 <a href="https://roderickqiu.scris.top/">Roderick Qiu.</a>
&copy; 2019-2020 <a href="https://r-q.name/">Roderick Qiu.</a>
</span>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2 class="h4">2. Other things</h2>
<div class="container">
<span class="small text-muted">The name is a abbr of <i>"Work & Rest"</i>.</span><br />
<span class="text-muted">
&copy; 2019 <a href="https://roderickqiu.scris.top/">Roderick Qiu.</a>
&copy; 2019-2020 <a href="https://r-q.name/">Roderick Qiu.</a>
</span>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1 class="display-4"><span class="work">w</span><span class="text-black-50">n</
<div class="container">
<span class="small text-muted">The name is an abbr of <i>"Work & Rest"</i>.</span><br />
<span class="text-muted">
&copy; 2019 <a href="https://roderickqiu.scris.top/">Roderick Qiu.</a>
&copy; 2019-2020 <a href="https://r-q.name/">Roderick Qiu.</a>
</span>
</div>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion docs/zh.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1 class="display-4"><span class="work">w</span><span class="text-black-50">n</
<footer class="footer mx-auto py-4" id="footer">
<div class="container">
<span class="text-muted">
&copy; 2019 <a href="https://roderickqiu.scris.top/">Roderick Qiu.</a>
&copy; 2019-2020 <a href="https://r-q.name/">Roderick Qiu.</a>
</span>
</div>
</footer>
Expand Down
48 changes: 42 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ function createWindow() {
width: 364,
height: 360,
frame: false,
backgroundColor: "#FEFEFE",
resizable: false,
maximizable: false,
show: false,
hasShadow: true,
webPreferences: { nodeIntegration: true },
webPreferences: { nodeIntegration: true, webgl: false },
titleBarStyle: "hiddenInset",
title: "wnr",
icon: "./res/icons/wnrIcon.png"
Expand Down Expand Up @@ -69,9 +70,11 @@ function alarmSet() {
wait: true // Wait with callback, until user action is taken against notification
}
);
if (win != null) if (!win.isVisible()) win.show();
notifier.on('click', function (notifierObject, options, event) {
if (win != null) if (!win.isVisible()) win.show();
});
}
}, 1200000)//不断提示使用wnr
}, 600000)//不断提示使用wnr
}
}

Expand Down Expand Up @@ -488,7 +491,18 @@ ipcMain.on('minimizer', function () {
function about() {
if (app.isReady()) {
if (win != null) {
aboutWin = new BrowserWindow({ parent: win, width: 256, height: 233, resizable: false, frame: false, show: false, center: true, titleBarStyle: "hidden", webPreferences: { nodeIntegration: true } });
aboutWin = new BrowserWindow({
parent: win,
width: 279,
height: 256,
backgroundColor: "#FEFEFE",
resizable: false,
frame: false,
show: false,
center: true,
titleBarStyle: "hidden",
webPreferences: { nodeIntegration: true }
});
aboutWin.loadFile("about.html");
if (store.get("top") == true) aboutWin.setAlwaysOnTop(true);
aboutWin.once('ready-to-show', () => {
Expand All @@ -505,7 +519,18 @@ ipcMain.on('about', about);
function settings() {
if (app.isReady()) {
if (win != null) {
settingsWin = new BrowserWindow({ parent: win, width: 729, height: 486, resizable: false, frame: false, show: false, center: true, webPreferences: { nodeIntegration: true }, titleBarStyle: "hidden" });
settingsWin = new BrowserWindow({
parent: win,
width: 729,
height: 486,
backgroundColor: "#FEFEFE",
resizable: false,
frame: false,
show: false,
center: true,
webPreferences: { nodeIntegration: true },
titleBarStyle: "hidden"
});
settingsWin.loadFile("settings.html");
if (store.get("top") == true) settingsWin.setAlwaysOnTop(true);
settingsWin.once('ready-to-show', () => {
Expand Down Expand Up @@ -535,7 +560,18 @@ ipcMain.on('settings', settings);
function tourguide() {
if (app.isReady()) {
if (win != null) {
tourWin = new BrowserWindow({ parent: win, width: 729, height: 600, resizable: false, frame: false, show: false, center: true, titleBarStyle: "hidden", webPreferences: { nodeIntegration: true } });
tourWin = new BrowserWindow({
parent: win,
width: 729,
height: 600,
backgroundColor: "#FEFEFE",
resizable: false,
frame: false,
show: false,
center: true,
titleBarStyle: "hidden",
webPreferences: { nodeIntegration: true }
});
tourWin.loadFile("tourguide.html");
if (store.get("top") == true) tourWin.setAlwaysOnTop(true);
tourWin.once('ready-to-show', () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wnr",
"version": "1.6.1",
"version": "1.6.2",
"description": "It's a timer app with strong expansibility for computers. The name is an abbr of \"Work and Rest\".",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"winreg": "1.2.4"
},
"devDependencies": {
"electron": "6.1.4",
"electron": "7.1.7",
"electron-builder": "22.1.0"
}
}
11 changes: 10 additions & 1 deletion res/builder/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ const config = {
"target": [
"dir"
],
"icon": "res/icons/wnrIcon.png"
"icon": "res/icons/wnrIcon.png",
"files": [
"**/*",
//! to exclude
"!res/preview/",
"!res/icons/*Mac*",
"!res/icons/*Win*",
"!res/icons/*.psd",
"!node_modules/node-notifier/vendor/snoreToast/*"
]
}
}

Expand Down
10 changes: 9 additions & 1 deletion res/builder/mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ const config = {
"dir"
],
"icon": "res/icons/iconMac.icns",
"darkModeSupport": true
"darkModeSupport": true,
"files": [
"**/*",
//! to exclude
"!res/preview/",
"!res/icons/*Win*",
"!res/icons/*.psd",
"!node_modules/node-notifier/vendor/snoreToast/*"
]
}
}

Expand Down
9 changes: 8 additions & 1 deletion res/builder/win.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ const config = {
"target": [
"dir"
],
"icon": "res/icons/iconWin.ico"
"icon": "res/icons/iconWin.ico",
"files": [
"**/*",
//! to exclude
"!res/preview/",
"!res/icons/*Mac*",
"!res/icons/*.psd"
]
}
}

Expand Down
Loading

0 comments on commit 412f0e4

Please sign in to comment.