Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Jul 1, 2019
1 parent 01076dd commit 25ea7cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
if (e.keyCode == 13) {
window.location.href = "timer.html?title=" + $("#title").val() + "&work-time=" + $("#work-time").val() + "&rest-time=" + $("#rest-time").val() + "&loop=" + $("#loop").val() + "&note=" + $("#note").val();
}
if (e.keyCode == 38 || e.keyCode == 40 || e.keyCode == 110 || e.keyCode == 69) {
/*if (e.keyCode == 38 || e.keyCode == 40 || e.keyCode == 110 || e.keyCode == 69) {
return false;
}
}*/
}
document.onkeydown = keydown;
</script>
Expand Down Expand Up @@ -142,16 +142,16 @@
<script>
var timecnt, myDate, h, min;
function sumGet() {
timecnt = (parseInt($("#work-time").val()) + parseInt($("#rest-time").val())) * parseInt($("#loop").val());
timecnt = (Number($("#work-time").val()) + Number($("#rest-time").val())) * Number($("#loop").val());
$("#allsum-num").html(timecnt);
myDate = new Date();
h = myDate.getHours() + parseInt(timecnt / 60);
h = myDate.getHours() + Number(timecnt / 60);
min = myDate.getMinutes() + timecnt % 60;
if (min >= 60) min -= 60, h++;
while (h >= 24) h -= 24;
$("#to-num-h").html(h);
if (min >= 10) $("#to-num-min").html(min);
else $("#to-num-min").html("0" + min);
$("#to-num-h").html(parseInt(h));
if (min >= 10) $("#to-num-min").html(parseInt(min));
else $("#to-num-min").html("0" + parseInt(min));
}
function defaultSet(workTime, restTime, loopFor) {
$("#work-time").val(workTime);
Expand All @@ -163,13 +163,13 @@
$("#work-time").val(store.get("worktime"));
$("#rest-time").val(store.get("resttime"));
$("#loop").val(store.get("looptime"));
if ((parseInt($("#work-time").val()) + parseInt($("#rest-time").val())) * parseInt($("#loop").val())) sumGet();
if ((Number($("#work-time").val()) + Number($("#rest-time").val())) * Number($("#loop").val())) sumGet();
if (process.platform == "darwin") {
$("#win-hider").css("display", "none");
$("#no-use-space").css("display", "none");
}
function allSet() {
if ((parseInt($("#work-time").val()) + parseInt($("#rest-time").val())) * parseInt($("#loop").val())) sumGet();
if ((Number($("#work-time").val()) + Number($("#rest-time").val())) * Number($("#loop").val())) sumGet();
else {
$("#allsum-num").html("---");
$("#to-num-h").html("--");
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.4.0",
"version": "1.5.1",
"description": "It's a timer app with strong expansibility for computers. The name is a abbr of \"Work and Rest\".",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion timer.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
var h = i18n.__('h');
var min = i18n.__('min');
var s = i18n.__('s');
if (!worktime || !resttime || !loop || worktime == 6000000 || resttime == 6000000) {//use ms for 1s, former edited by mistakes
if (!loop || worktime <= 60000 || resttime <= 60000) {//use ms for 1s
$("#timer").html("<p class='text-center text-muted lead'>" + i18n.__('notenough') + "<br/><a href='index.html' class='work'>" + i18n.__('back') + "</a></p>");
$("#timer").css("width", "75%");
isTimerWindow(false);
Expand Down

0 comments on commit 25ea7cb

Please sign in to comment.