Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Mar 15, 2020
1 parent 6b450fb commit f1b29dd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
function keydown(e) {
var currKey = 0, e = e || event;
if (e.keyCode == 13) {
if (document.getElementById("focus-work-set").checked && document.getElementById("focus-rest-set").checked && store.get("infinity"))
if (document.getElementById("focus-work-set").checked && document.getElementById("focus-rest-set").checked)
alert(i18n.__('all-focus-mode-warn'));
else
window.location.href = "timer.html?title=" + $("#title").val()
Expand Down Expand Up @@ -271,7 +271,7 @@
if (store.get("infinity")) infinityMode();
if (store.get("autostarttask") && store.get("just-launched") &&
(!store.get("just-relaunched"))) {//auto-send the form is autostarttask is on
if (item.focusWhenWorking && item.focusWhenResting && store.get("infinity"))
if (item.focusWhenWorking && item.focusWhenResting)
alert(i18n.__('all-focus-mode-warn'));
else
window.location.href =
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@
"without-permission-part-1": "Permission denied. This setting failed to execute.",
"without-permission-part-2": "Please go to System Preferences -> Security & Privacy -> Privacy -> Automation and check the sections below the name of wnr.",
"permission-ask": "If a dialog box is shown, allow it. Or else you'll fail to set auto start settings. ",
"all-focus-mode-warn": "When infinity mode is on, you cannot set both periods to focus.",
"all-focus-mode-warn": "You cannot set both periods to focus.",
"copy": "Copy",
"paste": "Paste",
"select-all": "Select All",
"cut": "Cut",
"should-sent": "Data sending setting: ",
"should-sent-msg-part-1": "We will collect some non-privacy information anonymously, such as which country you came from. Your settings and usage logs won't be uploaded. You have the right to secede, though we sincerely want to have some basic data to improve our service quality. Your data won't be identified and will be stored anonymously, and will never be shown for commercial use. ",
"should-sent-msg-part-2": "If it is needed, you can refer to our analysis service provider's",
Expand Down
3 changes: 2 additions & 1 deletion locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@
"without-permission-part-1": "没有权限,可能无法设置开机自启。",
"without-permission-part-2": "请前往系统偏好设置->安全性和隐私->自动化,找到wnr并勾选附属的权限,否则无法设置。",
"permission-ask": "如果弹出一个权限申请框,请允许,否则无法设置开机自启。",
"all-focus-mode-warn": "不允许在无限模式下,把工作和休息时都设置为专心模式",
"all-focus-mode-warn": "不允许把工作和休息时都设置为专心模式",
"copy": "复制",
"paste": "粘贴",
"select-all": "全选",
"cut": "剪切",
"should-sent": "使用数据发送设置:",
"should-sent-msg-part-1": "我们会匿名采集打开wnr的次数、你来自什么国家等不重要的非隐私数据;你的使用记录、设置等不会被上传。你有权拒绝上传数据,虽然我们希望获得数据以改进服务。数据不会用于商业目的公开,并将会被匿名保存。",
"should-sent-msg-part-2": "如果需要,你可以查看我们的服务提供商的",
Expand Down
3 changes: 2 additions & 1 deletion locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@
"without-permission-part-1": "沒有權限,可能無法設置開機自啓。",
"without-permission-part-2": "請前往系統偏好設置->安全性和隱私->自動化,找到wnr並勾選附屬的權限,否則無法設置。",
"permission-ask": "如果彈出一個權限申請框,請允許,否則無法設置開機自啓。",
"all-focus-mode-warn": "不允許在無限模式下,把工作和休息時都設置爲專心模式",
"all-focus-mode-warn": "不允許把工作和休息時都設置爲專心模式",
"copy": "複制",
"paste": "粘貼",
"select-all": "全選",
"cut": "剪切",
"should-sent": "使用數據發送設置:",
"should-sent-msg-part-1": "我們會匿名采集打開wnr的次數、你來自什麽國家等不重要的非隱私數據;你的使用記錄、設置等不會被上傳。你有權拒絕上傳數據,雖然我們希望獲得數據以改進服務。數據不會用于商業目的公開,並將會被匿名保存。",
"should-sent-msg-part-2": "如果需要,你可以查看我們的服務提供商的",
Expand Down
25 changes: 16 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ function macOSFullscreenSolution(isFullScreen) {
var template = [{
label: 'wnr',
submenu: [{
label: i18n.__('about'),
enabled: !isTimerWin,
click: function () {
about();
}
}, {
type: 'separator'
}, {
label: i18n.__('quit'),
accelerator: 'CmdOrCtrl+Q',
enabled: !store.get('islocked'),
Expand All @@ -537,6 +545,9 @@ function macOSFullscreenSolution(isFullScreen) {
}, {
label: i18n.__('select-all'),
role: "selectAll"
}, {
label: i18n.__('cut'),
role: "cut"
}]
}, {
label: i18n.__('operations'),
Expand All @@ -558,12 +569,6 @@ function macOSFullscreenSolution(isFullScreen) {
click: function () {
tourguide();
}
}, {
label: i18n.__('about'),
enabled: !isTimerWin,
click: function () {
about();
}
}, {
type: 'separator'
}, {
Expand All @@ -582,6 +587,11 @@ function macOSFullscreenSolution(isFullScreen) {
var template = [{
label: 'wnr',
submenu: [{
label: i18n.__('about'),
enabled: false
}, {
type: 'separator'
}, {
label: i18n.__('quit'),
enabled: false
}]
Expand All @@ -596,9 +606,6 @@ function macOSFullscreenSolution(isFullScreen) {
}, {
label: i18n.__('tourguide'),
enabled: false
}, {
label: i18n.__('about'),
enabled: false
}, {
type: 'separator'
}, {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wnr",
"version": "1.12.3",
"version": "1.13.0",
"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

0 comments on commit f1b29dd

Please sign in to comment.