Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
approvedGitRepositories:
- "**"

compressionLevel: mixed

enableGlobalCache: false

enableScripts: true

nodeLinker: node-modules
15 changes: 15 additions & 0 deletions custom-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,28 @@
<body>
<script src="supporter.js"></script>
<style>
html, body {
width: 100%;
margin: 0;
}

#main {
width: 100%;
box-sizing: border-box;
padding: 10px 12px;
}

#timer {
flex: 1 1 auto;
width: 100% !important;
max-width: 100%;
min-width: 0;
}

#dialog-msg,
#dialog-detail {
width: 100%;
margin-bottom: 12px;
}

#dialog-buttons {
Expand Down
16 changes: 14 additions & 2 deletions floating.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</div>
<div id="floating-hover" onmouseover="hover()" onmouseleave="unhover()" ontouchstart="semihover()">
<div class="small" id="floating-stopper" style="margin-top: 8px;">
<div class="small" id="floating-stopper">
<a id="stopper" href="#" role="button" class="text-muted" draggable="false">
<i class="iconfont icon-pause"></i>
</a>
Expand Down Expand Up @@ -102,6 +102,16 @@
}
}

function renderSkipperIcon(isReset) {
if (isReset) {
$("#floating-skipper a").html('<span class="reset-icon" id="skipper" aria-hidden="true">&#8634;</span>');
$('#skipper').attr('title', i18n.__('positive-reset-tip'));
} else {
$("#floating-skipper a").html("<i class='iconfont icon-fastforward' id='skipper'></i>");
$('#skipper').attr('title', i18n.__('skipper'));
}
}

const STOPPER_DEBOUNCE_MS = 320;
function stopper(ev) {
if (ev && ev.preventDefault) ev.preventDefault();
Expand Down Expand Up @@ -222,6 +232,7 @@
.addClass("work")
.removeClass("positive rest onlyRest");
$("#time-left-msg").text(i18n.__('min-left'));
renderSkipperIcon(false);
$('#floating-bottom-bar').css("background-color", newWorkColor + "19");
$('#floating-bottom-bar').css("display", "block");
method = 1;
Expand All @@ -233,6 +244,7 @@
$(".work").removeClass("onlyRest");
$('#floating-bottom-bar').css("display", "none");
$("#time-left-msg").text(i18n.__('min-already'));
renderSkipperIcon(true);
method = 3;
}

Expand Down Expand Up @@ -282,4 +294,4 @@
<script src="theme.js"></script>
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -722,4 +722,4 @@ <h6 id="new-feature-title" class="rest align-content-center small text-left"></h
<script src="theme.js"></script>
</body>

</html>
</html>
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"tip": "Press Enter to submit",
"back-index": "Give up the schedule & Back",
"skipper": "Skip current timer",
"positive-reset": "Reset",
"positive-reset-tip": "Reset the current stopwatch to zero and start again; saved statistics will not be cleared.",
"not-enough": "Some items weren't set or the time is less than 5s, so the timer cannot start.",
"too-long": "The time is too long. Please make it less than a day.",
"back": "Back",
Expand Down
2 changes: 2 additions & 0 deletions locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"tip": "输入各个项目,然后按 Enter 键开始计时",
"back-index": "结束当前计时返回首页",
"skipper": "提前跳过当前的时间",
"positive-reset": "重置",
"positive-reset-tip": "将当前正计时归零并重新开始;已记录的统计不会被清空。",
"not-enough": "请合法输入工作时间、休息时间和循环次数。暂时不支持 5 秒以下的时间。",
"too-long": "长度超过一天的计划暂时不能添加。",
"back": "返回",
Expand Down
2 changes: 2 additions & 0 deletions locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"tip": "輸入各個項目,然後按 Enter 鍵開始計時",
"back-index": "結束當前計時返回首頁",
"skipper": "提前跳過當前的時間",
"positive-reset": "重置",
"positive-reset-tip": "將當前正計時歸零並重新開始;已記錄的統計不會被清空。",
"not-enough": "請合法輸入工作時間、休息時間和循環次數。暫時不支持 5 秒以下的時間。",
"too-long": "長度超過一天的計劃暫時不能添加。",
"back": "返回",
Expand Down
35 changes: 33 additions & 2 deletions preferences-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@ function preferenceCreator(items, container, inner) {
break;
}
}
initializeSettingsTipToggles(container);
}

function initializeSettingsTipToggles(container) {
$(container).find('p.settings-msg').each(function () {
let tip = $(this);
if (tip.data('settings-tip-ready') || tip.hasClass('d-none')) return;
if ($.trim(tip.text()) === '' && tip.find('a').length === 0) return;

let button = $(`
<button type="button" class="settings-tip-toggle" aria-expanded="false" title="${ i18n.__('helper') }">
?
</button>
`);

tip.data('settings-tip-ready', true);
tip.addClass('settings-tip-content settings-tip-collapsed');
tip.attr('aria-hidden', 'true');

let label = tip.prevAll('label:first');
if (label.length > 0) label.after(button);
else tip.before(button);

button.on('click', function () {
let expanded = button.attr('aria-expanded') === 'true';
button.attr('aria-expanded', expanded ? 'false' : 'true');
tip.toggleClass('settings-tip-collapsed', expanded);
tip.attr('aria-hidden', expanded ? 'true' : 'false');
});
});
}

function titleSolution(obj, parent) {
Expand Down Expand Up @@ -708,9 +738,9 @@ function domString(type) {
onkeydown="if(event.keyCode === 13) lock($('#passcode-locker').val(), $('#passcode-locker-again').val());"
type="password" />
<br /><br/>
<div class="text-muted small">
<small class="text-grey settings-title">
${ store.get('islocked') ? i18n.__('locker-settings-input-tip-lock-mode-on') : i18n.__('locker-settings-input-tip-lock-mode-off') }
</div></div></div>
</small></div></div>
<br/>`
;
break;
Expand Down Expand Up @@ -1091,6 +1121,7 @@ function colorSet(id) {
ipc.send("logger", $("#color-" + id).val());
themeColorList[id] = $("#color-" + id).val();
store.set("theme-color", themeColorList);
ipc.send("theme-color-changed");
}

function colorInitializer() {
Expand Down
2 changes: 1 addition & 1 deletion renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ ipc.on('zoom-ratio-feedback', () => zoomRatioChange());

ipc.on('alert', (event, message) => {
alert(message);
})
})
19 changes: 10 additions & 9 deletions statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,16 @@ <h2 class="text-muted">
topPadding: 19,
bottomPadding: 39,
datasets: [{
fillColor: '#5490eacc',
fillColor: newWorkColor + 'cc',
data: thisWeekWorkTimesInHour
}, {
fillColor: '#ea5454cc',
fillColor: newRestColor + 'cc',
data: thisWeekRestTimesInHour
}, {
fillColor: '#a26ae5cc',
fillColor: newOnlyRestColor + 'cc',
data: thisWeekOnlyRestTimesInHour
}, {
fillColor: '#17a2b8cc',
fillColor: newPositiveColor + 'cc',
data: thisWeekPositiveTimesInHour
}]
}
Expand Down Expand Up @@ -527,16 +527,16 @@ <h2 class="text-muted">
bottomPadding: 59,
showValue: false,
datasets: [{
fillColor: '#5490eacc',
fillColor: newWorkColor + 'cc',
data: thisYearWorkTimesInHour
}, {
fillColor: '#ea5454cc',
fillColor: newRestColor + 'cc',
data: thisYearRestTimesInHour
}, {
fillColor: '#a26ae5cc',
fillColor: newOnlyRestColor + 'cc',
data: thisYearOnlyRestTimesInHour
}, {
fillColor: '#17a2b8cc',
fillColor: newPositiveColor + 'cc',
data: thisYearPositiveTimesInHour
}]
}
Expand Down Expand Up @@ -586,6 +586,7 @@ <h2 class="text-muted">

</script>
<script src="renderer.js"></script>
<script src="theme.js"></script>
</body>

</html>
</html>
75 changes: 75 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ li input:nth-last-child(4)::after {
font-size: inherit;
}

.reset-icon {
display: inline-block;
font-size: 1rem;
line-height: 1;
font-style: normal;
vertical-align: 0em;
}

.display-1 {
font-weight: lighter;
}
Expand Down Expand Up @@ -250,6 +258,28 @@ li input:nth-last-child(4)::after {
transform: translateY(-2px);
}

.positive-reset-label {
font-size: 0.72rem;
margin: 0 3px 0 3px;
transform: translateY(-2px);
}

.positive-reset-button {
display: inline;
}

.positive-reset-button .reset-icon {
width: 0.9em;
font-size: 1.04rem;
font-weight: 700;
line-height: 1;
display: inline-block;
margin-left: 2px;
text-align: center;
transform: translateY(-3px);
vertical-align: baseline;
}

.controller-msg-big {
padding: 0;
margin: 0 3px 0 3px;
Expand Down Expand Up @@ -357,6 +387,38 @@ li input:nth-last-child(4)::after {
padding-top: 5px;
}

.settings-tip-toggle {
width: 18px;
height: 18px;
margin: 0 0 2px 6px;
padding: 0;
border: 1px solid #6c757d55;
border-radius: 50%;
background: transparent;
color: #6c757d;
font-size: 12px;
line-height: 16px;
text-align: center;
vertical-align: middle;
cursor: pointer;
}

.settings-tip-toggle:hover, .settings-tip-toggle:focus {
color: #5490ea;
border-color: #5490ea;
outline: none;
}

.settings-tip-toggle[aria-expanded="true"] {
color: #5490ea;
border-color: #5490ea;
background: #5490ea12;
}

.settings-tip-content.settings-tip-collapsed {
display: none;
}

.settings-check {
margin: -4px 6px 2px 2px !important;
}
Expand Down Expand Up @@ -638,6 +700,11 @@ li input:nth-last-child(4)::after {
margin-top: 8px;
}

#settings-container .webdav-sync-toggle-row > .text-left > label {
font-size: inherit;
color: inherit;
}

#settings-container .dropdown-reserved-button {
font-size: inherit !important;
}
Expand Down Expand Up @@ -711,6 +778,7 @@ li input:nth-last-child(4)::after {
#time-bar {
left: 10px;
padding: 2px;
top: 10px;
}

#logo-bar {
Expand Down Expand Up @@ -1018,6 +1086,7 @@ li input:nth-last-child(4)::after {
color: #6c757d !important;
line-height: 2;
font-weight: 500 !important;
-webkit-app-region: no-drag;
}

#time-statistics-sub-bar a {
Expand Down Expand Up @@ -1065,6 +1134,12 @@ li input:nth-last-child(4)::after {
-webkit-user-select: none;
}

.index-page #statistics-back {
top: 6px;
bottom: auto;
font-size: 20px;
}

.reserved-cycle, .dropdown-reserved-button, .dropdown-menu-reserved {
width: 96px !important;
font-size: small;
Expand Down
1 change: 1 addition & 0 deletions supporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function isInDark() {

ipc.on('darkModeChanges', () => {
isInDark();
if (typeof reloadTheme === 'function') reloadTheme();
});//dark mode settings
ipc.on('darkModeChanges-settings', function () {
isInDark();
Expand Down
Loading
Loading