forked from RoderickQiu/wnr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
timer.html
594 lines (558 loc) · 29.7 KB
/
timer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
<!DOCTYPE html>
<html>
<head>
<title>wnr</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimal-ui" />
<script>
window.$ = require("jquery/dist/jquery.slim.min.js");
require("bootstrap/dist/js/bootstrap.min.js");
</script>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="res/fonts/iconfont.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<script src="supporter.js"></script>
<div class="d-flex mx-auto justify-content-center align-items-center text-dark" id="main">
<div id="time-bar" class="text-muted"></div>
<div id="time-bar-macos" class="text-muted"></div><!-- time-bar for systems -->
<div id="controller">
<a href="javascript:getHelp('guide/1-basic-usage')" class="small work"><i class="iconfont icon-info"
id="helper"></i></a>
<a href="javascript:floatingOpener()" class="small work should-lock"><i class="iconfont icon-suoxiao"
id="mini-mode"></i></a>
<a href="javascript:call('window-hide')" class="small work" id="win-hider"><i
class="iconfont icon-dockpanel" id="window-hide"></i></a><span id="no-use-space"> </span>
<a href="javascript:call('window-minimize')" class="small work"><i class="iconfont icon-minus"
id="window-minimize"></i></a><span class="should-lock"> </span>
<a href="javascript:call('window-close-chk')" class="small work should-lock"><i class="iconfont icon-close"
id="exit"></i></a>
<script>
$('#helper').attr('title', i18n.__('helper'));
$('#mini-mode').attr('title', i18n.__('mini-mode'));
$('#window-hide').attr('title', i18n.__('window-hide'));
$('#window-minimize').attr('title', i18n.__('window-minimize'));
$('#exit').attr('title', i18n.__('exit'));
</script>
</div>
<div id="timer" class="justify-content-center align-content-center text-center">
<div id="title" class="text-center h4"></div>
<div id="notes" class="text-center small text-muted"></div><br /><br />
<div id="work-rest" class="text-center work">
<script>document.write(i18n.__('working'));</script>
</div><br />
<div id="now-timing" class="text-center h1 work"></div><br />
<div class="text-center"><a id="stopper" href="javascript:stopper()" class="text-muted"><i
class="iconfont icon-pause"></i></a></div><br />
<div class="text-center text-muted" id="more-options">
<a href="javascript:backcheck()" class="text-muted"><i class="iconfont icon-previous"
id="back-index"></i></a>
<span id="skipper-space" class="should-lock"> </span>
<a href="javascript:skipper()" class="text-muted">
<i class="iconfont icon-fastforward" id="skipper"></i>
</a>
<br />
<input name="passcode-locker" id="passcode-rechecker" type="password" maxlength="11"
onkeydown="if(event.keyCode == 13) recheck($('#passcode-rechecker').val());" />
</div>
<br />
<div class="text-center lead" id="backer">
<a href="javascript:backcheck()" class="text-muted"><i class="iconfont icon-previous"
id="backindex2"></i></a>
</div>
<div class="text-center text-muted" id="only-one">
<h3>
<script>document.write(i18n.__('only-one-min-left'));</script>
</h3>
</div>
<div id="fullscreen-experience-tip" class="small font-weight-bold text-muted text-center">
<script>document.write(i18n.__('fullscreen-experience-tip') +
'<br /><a href="javascript:mistakeResolver()" class="rest">' +
i18n.__('fullscreen-experience-tip-mistake') + '</a>');</script>
</div>
<div id="fullscreen-too-long-tip" class="small font-weight-bold text-muted text-center">
<script>document.write(i18n.__('fullscreen-too-long-tip') +
'<br /><a href="javascript:mistakeResolver()" class="rest">' +
i18n.__('fullscreen-experience-tip-mistake') + '</a>');</script>
</div>
<script>
$('#passcode-rechecker').attr('placeholder', i18n.__('quit-from-timer-in-lock-mode-msg'));
$('#back-index').attr('title', i18n.__('back-index'));
$('#backindex2').attr('title', i18n.__('back-index'));
$('#backer').css('display', 'none');
$('#skipper').attr('title', i18n.__('skipper'));
if (process.platform == "darwin") $("#controller").css("display", "none");
</script>
</div>
</div><!-- for things with 'work' mark, when it's resting, the color should be changed -->
<div id="bottom-bar"> </div>
<script>
if (process.platform == "darwin") {
$("#win-hider").css("display", "none");
$("#no-use-space").css("display", "none");
}
if (store.get('localtime') == false) {
$("#time-bar").remove();
$("#time-bar-macos").remove();
}
if (store.get('disable-pausing') == true) {
$("#stopper").remove();
}
$("#only-one").css("display", "none");
$("#passcode-rechecker").css("display", "none");
store.set('just-launched', false);
hasFloating = false, canOpenFloating = true;
function floatingOpener() {
if (canOpenFloating) {
call("window-hide");
call("floating");
hasFloating = true;
//repeat so always able to be sent
for (let floatingRepeater = 1; floatingRepeater < 5; floatingRepeater++)
setTimeout(function () { ipc.send("floating-conversation", { topic: "time-left", val: Math.floor((((method == 1) ? workTime : restTime) - new Date().getTime() + startTime) / 60000), percentage: Math.round(lastRecordedProgress * 100), method: method, isWorking: isClockWorking }); }, 500 * floatingRepeater);
}
}
//for first time users
function mistakeResolver() {
call('floating-destroy');
timingData.set("last-recorded-minutes-left", -1);
timingData.set("last-recorded-hours-left", -1);
store.set("fullscreen-experience", true);
call('relauncher');
}
$("#fullscreen-experience-tip").css("display", "none");
//lock mode settings
function recheck(passcode) {
var md5 = require('crypto-js/md5');
if (passcode == "") ipc.send("alert", i18n.__('locker-settings-empty-password'));
else if (passcode == store.get('lockerpasscode') || md5(passcode).toString() == store.get('lockerpasscode')) backer();
else ipc.send("alert", i18n.__('locker-settings-input-tip-wrong-password'));
}
function backcheck() {
if (store.get("islocked")) $("#passcode-rechecker").css("display", "inline");
else backer();
}
function backer() {
call('floating-destroy');
timingData.set("last-recorded-minutes-left", -1);
timingData.set("last-recorded-hours-left", -1);
window.location.href = "index.html";
}
function keydownOnError(e) {
var currKey = 0, e = e || event;
if (e.keyCode == 13) backer();
}
var $_GET = (function () {
var url = window.document.location.href.toString();
var u = url.split("?");
if (typeof (u[1]) == "string") {
u = u[1].split("&");
var get = {};
for (var i in u) {
var j = u[i].split("=");
get[j[0]] = j[1];
}
return get;
} else {
return {};
}
})();
var title = decodeURI($_GET['title']),
note = decodeURI($_GET['note']),
workTime = decodeURI($_GET['work-time']) * 60000,
restTime = decodeURI($_GET['rest-time']) * 60000,//use ms
loop = decodeURI($_GET['loop']),
workTimeFocused = (decodeURI($_GET['work-time-focused']) == "false") ? false : true,
restTimeFocused = (decodeURI($_GET['rest-time-focused']) == "false") ? false : true,
restored = (decodeURI($_GET['restored']) == "false") ? false : true,
methodFromStart = Number(decodeURI($_GET['method'])),
h = i18n.__('h'),
min = i18n.__('min'),
s = i18n.__('s'),
player = document.createElement("audio"),//alert player
stopperTimeout = null,
pausingTimeout = null;
ipc.send('focus-mode-settings', { workTimeFocused: workTimeFocused, restTimeFocused: restTimeFocused });
timingData.set("last-recorded-state", {
workTime: workTime / 60000,
restTime: restTime / 60000,
loop: loop,
title: title,
note: note,
isWorkTimeFocused: workTimeFocused,
isRestTimeFocused: restTimeFocused,
method: methodFromStart
});
var $nowTiming = $("#now-timing"), $bottomBar = $("#bottom-bar"), $timeBar = $("#time-bar"), $timeBarMacOS = $("#time-bar-macos");//cache frequently using doms
if ((loop < 1 && loop != 0) || (workTime <= 60000 && workTime != 12000) || (restTime <= 60000 && restTime != 12000) || isNaN(workTime) || isNaN(restTime) || isNaN(loop)) {//use ms for 1s
timingData.set("last-recorded-minutes-left", 0);
timingData.set("last-recorded-hours-left", 0);
$("#timer").html("<p class='text-center text-muted lead' id='timer-error'>" + i18n.__('not-enough') + "<br/><a href='javascript:backer()' class='work'>" + i18n.__('back') + "</a></p>");
$("#timer").css("width", "75%");
isTimerWindow(false);
document.onkeydown = keydownOnError;
} else if (workTime > 86400000 || restTime > 86400000 || (workTime + restTime) * loop > 86400000) {
timingData.set("last-recorded-minutes-left", 0);
timingData.set("last-recorded-hours-left", 0);
$("#timer").html("<p class='text-center text-muted lead' id='timer-error'>" + i18n.__('too-long') + "<br/><a href='javascript:backer()' class='work'>" + i18n.__('back') + "</a></p>");
$("#timer").css("width", "75%");
isTimerWindow(false);
document.onkeydown = keydownOnError;
} else {
isTimerWindow(true);
if (title) $("#title").html(title);
if (note) $("#notes").html(note);
$("#fullscreen-too-long-tip").css("display", "none");
if (workTimeFocused) {
if (styleCache.get("is-shadowless") != true) $("html").css("border", "none");
$bottomBar.css("background-color", "#ea545419");
$bottomBar.css("height", "100%");
ipc.send('warning-giver-restend');
$("#controller").css("display", "none");
$("#more-options").css("display", "none");
$timeBar.addClass("time-bar-focus");
$timeBarMacOS.addClass("time-bar-focus");
$nowTiming.addClass("display-1");
$nowTiming.removeClass("h1");
if (!store.get("no-check-time-end")) stopperTimeout = setTimeout(stopper, 500);
ipc.once('warning-closed', function () {
stopper();
$("#skipper").css("display", "inline");
if (!store.get("islocked")) $("#skipper-space").css("display", "inline");
});
if (store.get("fullscreen-experience") != true) {
$("#fullscreen-experience-tip").css("display", "inline-block");
store.set("fullscreen-experience", true);
} else if (workTime >= 600000 && restored == false) {
$("#fullscreen-too-long-tip").css("display", "block");
setTimeout(function () {
$("#fullscreen-too-long-tip").css("display", "none");
}, 12000);
}
}
//method: 1-work / 2-rest, times: time-reset times, moreThanOneMin: more than 1 min left
var startTime,
int,
tempVariable,
nowTime,
timeGot,
seconds,
minutes,
hours,
method = 1,
times = 0,
isClockWorking = 1,
moreThanOneMin = 1,
lastRecordedMinutesLeft = -1,
lastRecordedHoursLeft = -1,
systemName = process.platform,
progress = 0.00,
lastRecordedProgress = 0.00,
wasCounting = true,
shouldNap,
napInterval = 0,
lastNapSecond = 0,
canStop = true;
if (store.get("nap")) {
shouldNap = true;
napInterval = (store.has("nap-time") ? store.get("nap-time") : 10) * 60;
if (isNaN(napInterval)) napInterval = 600;
lastNapSecond = workTime / 1000;
} else shouldNap = false;
startTime = new Date().getTime();
int = setInterval(clock, 250);
if (methodFromStart == 2) skipper();
ipc.on('start-or-stop', function () {
if (canStop) {
if (store.get("disable-pausing") == true)
ipc.send("alert", i18n.__('pausing-disabled'));
else {
stopper();
ipc.send("floating-conversation", { topic: "stop-sync", val: isClockWorking });
}
}
});
ipc.on('alter-start-stop', function (event, message) {
if (message == "start") {
if ((!isClockWorking) && (wasCounting)) {
stopper();
ipc.send("floating-conversation", { topic: "stop-sync", val: isClockWorking });
wasCounting = !wasCounting;
}
} else if (message == "stop") {
if (isClockWorking && wasCounting) {
stopper();
ipc.send("floating-conversation", { topic: "stop-sync", val: isClockWorking });
wasCounting = !wasCounting;
}
}
});
ipc.on('floating-message', function (event, message) {
if (message == "skipper") skipper();
else if (message == "back") backcheck();
else if (message == "stop") stopper();
else if (message == "enter") floatingOpener();
else if (message == "closed") hasFloating = false;
});
function stopper() {
wasCounting = !wasCounting;
if (isClockWorking) {
window.clearInterval(int);
$("#stopper").html("<i class='iconfont icon-play' aria-hidden='true'></i>");
isClockWorking = 0;//to stop
ipc.send("tray-image-change", "stop");
if (store.get("alarmtip") != false) pausingTimeout = setInterval(function () { ipc.send("notify", { title: i18n.__('alarm-for-not-using-wnr-dialog-box-title'), msg: i18n.__('alarm-for-not-using-wnr-dialog-box-content') }); }, 600000);
} else {
if (method == 1) startTime = new Date().getTime() - (workTime - hours * 3600000 - minutes * 60000 - seconds * 1000);
else startTime = new Date().getTime() - (restTime - hours * 3600000 - minutes * 60000 - seconds * 1000);
int = self.setInterval(clock, 250);
$("#stopper").html("<i class='iconfont icon-pause' aria-hidden='true'></i>");
isClockWorking = 1;//to restart
ipc.send("tray-image-change", "start");
if (pausingTimeout) window.clearInterval(pausingTimeout);
}
}
function warningGiver(isend) {
moreThanOneMin = 1;
lastRecordedMinutesLeft = -1, lastRecordedHoursLeft = -1, lastRecordedProgress = 0.00;
canStop = false;
timingData.set("last-recorded-minutes-left", -1);
timingData.set("last-recorded-hours-left", -1);
if (store.get("sound") != false) {
if (isend != 0) {
player.src = path.join(__dirname, "\\res\\sound\\" + (store.has("time-end-sound") ? store.get("time-end-sound") : "tick") + ".mp3");
} else {
player.src = path.join(__dirname, "\\res\\sound\\" + (store.has("all-end-sound") ? store.get("all-end-sound") : "piano") + ".mp3");
}
player.loop = true;
player.play();
if (store.get("no-check-time-end")) {
setTimeout(function () {
player.loop = false;
}, 3000);
$("#skipper").css("display", "inline");
if (!store.get("islocked")) $("#skipper-space").css("display", "inline");
canStop = true;
} else
setTimeout(function () {
player.loop = false;
}, 20000);
}//different sound for different circumstances
if (isend == 0) ipc.send('warning-giver-all-task-end');
else {
if (isend == 1) ipc.send('warning-giver-workend');
else ipc.send('warning-giver-restend');
if (!store.get("no-check-time-end")) stopperTimeout = setTimeout(stopper, 500);
ipc.once('warning-closed', function () {
player.loop = false;
player.pause();
stopper();
$("#skipper").css("display", "inline");
if (!store.get("islocked")) $("#skipper-space").css("display", "inline");
canStop = true;
});
}
}
function themeChanger() {
if (method == 1) {
$("#only-one").css("display", "none");
$(".work").addClass("rest");
$(".work").removeClass("work");
$("#work-rest").html(i18n.__('resting'));
$bottomBar.css("background-color", "#5490ea99");
method = 2;
timingData.set("last-recorded-state.method", 2);
if (restTimeFocused == true) {
if (styleCache.get("is-shadowless") != true) $("html").css("border", "none");
$bottomBar.css("background-color", "#5490ea19");
$bottomBar.css("height", "100%");
$("#controller").css("display", "none");
$("#more-options").css("display", "none");
$timeBarMacOS.addClass("time-bar-focus");
$timeBar.addClass("time-bar-focus");
$nowTiming.addClass("display-1");
$nowTiming.removeClass("h1");
if (store.get("fullscreen-experience") != true) {
$("#fullscreen-experience-tip").css("display", "inline-block");
store.set("fullscreen-experience", true);
}
} else {
if (hasFloating) {
floatingOpener();
$("#skipper").css("display", "inline");
}
if (workTimeFocused == true) {
if (styleCache.get('isdark')) $('html').css("border", "#ffffff33 1px solid");
$bottomBar.css("height", "1.9%");
if (systemName != "darwin") $("#controller").css("display", "block");
$("#more-options").css("display", "block");
$(".time-bar-focus").removeClass("time-bar-focus");
$nowTiming.removeClass("display-1");
$nowTiming.addClass("h1");
$("#fullscreen-experience-tip").css("display", "none");
}
}
warningGiver(1);
} else {
$("#only-one").css("display", "none");
$(".rest").addClass("work");
$(".rest").removeClass("rest");
$("#work-rest").html(i18n.__('working'));
$bottomBar.css("background-color", "#ea545499");
method = 1;
timingData.set("last-recorded-state.method", 1);
if (systemName != "darwin") $("#controller").css("display", "block");
if (workTimeFocused == true) {
if (styleCache.get("is-shadowless") != true) $("html").css("border", "none");
$bottomBar.css("background-color", "#ea545419");
$bottomBar.css("height", "100%");
$("#controller").css("display", "none");
$("#more-options").css("display", "none");
$timeBar.addClass("time-bar-focus");
$timeBarMacOS.addClass("time-bar-focus");
$nowTiming.addClass("display-1");
$nowTiming.removeClass("h1");
if (store.get("fullscreen-experience") != true) {
$("#fullscreen-experience-tip").css("display", "inline-block");
store.set("fullscreen-experience", true);
}
} else {
if (hasFloating) {
floatingOpener();
$("#skipper").css("display", "inline");
}
if (restTimeFocused == true) {
if (styleCache.get('isdark')) $('html').css("border", "#ffffff33 1px solid");
$bottomBar.css("height", "1.9%");
$("#more-options").css("display", "block");
$(".time-bar-focus").removeClass("time-bar-focus");
$nowTiming.removeClass("display-1");
$nowTiming.addClass("h1");
$("#fullscreen-experience-tip").css("display", "none");
}
}
if (shouldNap) {
lastNapSecond = workTime / 1000;
}
warningGiver(2);
}
}
function ender() {
canStop = false;
window.clearInterval(int);
$("#only-one").css("display", "none");
$("#fullscreen-experience-tip").css("display", "none");
$("#work-rest").text("");
$nowTiming.text(i18n.__('ended'));
isClockWorking = 0;
$("#stopper").text("");
$bottomBar.css("width", "0%");
ipc.send("progress-bar-set", 2);//the progress-bar-set is using (1-message), so when message is 2, the answer is -1
if (systemName != "darwin") $("#controller").css("display", "block");
$("#backer").css("display", "block");
$("#more-options").css("display", "none");
if (styleCache.get('isdark')) $('html').css("border", "#ffffff33 1px solid");
if (restTimeFocused == true) {
$(".time-bar-focus").removeClass("time-bar-focus");
$nowTiming.removeClass("display-1");
$nowTiming.addClass("h1");
}
warningGiver(0);
}
function skipper() {
canOpenFloating = true;
if (pausingTimeout) window.clearInterval(pausingTimeout);
$("#skipper").css("display", "none");
$("#skipper-space").css("display", "none");
$("#passcode-rechecker").css("display", "none");
times++;
if (isClockWorking) {
if (times < loop * 2 || (loop == 0 && ((method == 2 && restored == true) == false))) {
startTime = new Date().getTime();
themeChanger();
} else if ((times == loop * 2) || ((method == 2 && restored == true) == true)) {
ender();
}
} else {
stopper();
setTimeout(function () {
if (times < loop * 2 || (loop == 0 && ((method == 2 && restored == true) == false))) {
startTime = new Date().getTime();
themeChanger();
} else if ((times == loop * 2) || ((method == 2 && restored == true) == true)) {
ender();
}
}, 250);
}
}
function positionCover(str) {//cover the positions of '0'
var num;
str >= 10 ? num = str : num = "0" + str;
return num;
}
function clock() {
nowTime = new Date();
tempVariable = nowTime.getTime();
if (method == 1) seconds = Math.floor((workTime - tempVariable + startTime) / 1000);
else seconds = Math.floor((restTime - tempVariable + startTime) / 1000);
if (seconds > 0) {
if (method == 1) {
progress = ((seconds / workTime) * 1000).toFixed(2);
} else {
progress = ((seconds / restTime) * 1000).toFixed(2);
}
if (progress != lastRecordedProgress) {
lastRecordedProgress = progress;
naturalProgress = Math.round(lastRecordedProgress * 100);
ipc.send("progress-bar-set", naturalProgress);
if (hasFloating) ipc.send("floating-conversation", { topic: "time-left", val: Math.floor(seconds / 60), percentage: naturalProgress, method: method, isWorking: isClockWorking });
$bottomBar.css("width", naturalProgress + "%");
}
if (shouldNap && method == 1) {
if (lastNapSecond - seconds > napInterval) {
lastNapSecond = seconds;
ipc.send("notify", { title: i18n.__('should-nap-now'), msg: i18n.__('should-nap-now-msg') });
}
}
hours = Math.floor(seconds / 3600);
minutes = Math.floor((seconds - hours * 3600) / 60);
seconds -= hours * 3600 + minutes * 60;
$nowTiming.text(hours + h + minutes + min + seconds + s);
if (hours == 0 && minutes == 0 && seconds < 10) canOpenFloating = false;
timeGot = positionCover(nowTime.getHours()) + ":" + positionCover(nowTime.getMinutes());
if (systemName != "darwin") $timeBar.html(timeGot);
else $timeBarMacOS.html(timeGot);//display the current time
if (lastRecordedHoursLeft != hours) {
lastRecordedHoursLeft = hours;
timingData.set("last-recorded-hours-left", lastRecordedHoursLeft);
}
if (lastRecordedMinutesLeft != minutes) {
lastRecordedMinutesLeft = minutes;
timingData.set("last-recorded-minutes-left", lastRecordedMinutesLeft + 1);
}
if (minutes == 0 && moreThanOneMin && hours == 0) {
if (store.get("onemintip") != false) {
if ((method == 1 && workTimeFocused == false) || (method == 2 && restTimeFocused == false))
ipc.send("only-one-min-left");
else {
if (store.get("sound") != false) {
player.src = path.join(__dirname, "\\res\\sound\\only-one.wav");
player.loop = false;
player.play();
}
$("#only-one").css("display", "block");
}
}
moreThanOneMin = 0;
}
} else {
skipper();
}
}
}
</script>
<script src="renderer.js"></script>
</body>
</html>