mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
reviewer-bottom
This commit is contained in:
parent
de29b02089
commit
cdcf482913
2 changed files with 12 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
/* Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
var time; // set in python code
|
var time: number; // set in python code
|
||||||
|
|
||||||
var maxTime = 0;
|
let maxTime = 0;
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#ansbut").focus();
|
$("#ansbut").focus();
|
||||||
updateTime();
|
updateTime();
|
||||||
|
@ -13,22 +13,23 @@ $(function () {
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
var updateTime = function () {
|
let updateTime = function () {
|
||||||
var timeNode = $("#time");
|
let timeNode = $("#time");
|
||||||
if (!maxTime) {
|
if (!maxTime) {
|
||||||
timeNode.text("");
|
timeNode.text("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
time = Math.min(maxTime, time);
|
time = Math.min(maxTime, time);
|
||||||
var m = Math.floor(time / 60);
|
const m = Math.floor(time / 60);
|
||||||
var s = time % 60;
|
const s = time % 60;
|
||||||
|
let sStr = s.toString();
|
||||||
if (s < 10) {
|
if (s < 10) {
|
||||||
s = "0" + s;
|
sStr = "0" + s;
|
||||||
}
|
}
|
||||||
if (maxTime === time) {
|
if (maxTime === time) {
|
||||||
timeNode.html("<font color=red>" + m + ":" + s + "</font>");
|
timeNode.html("<font color=red>" + m + ":" + sStr + "</font>");
|
||||||
} else {
|
} else {
|
||||||
timeNode.text(m + ":" + s);
|
timeNode.text(m + ":" + sStr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ function showAnswer(txt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectedAnswerButton() {
|
function selectedAnswerButton() {
|
||||||
var node = document.activeElement;
|
let node = document.activeElement as HTMLElement;
|
||||||
if (!node) {
|
if (!node) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
1
web/.gitignore
vendored
1
web/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
webview.js
|
webview.js
|
||||||
deckbrowser.js
|
deckbrowser.js
|
||||||
overview.js
|
overview.js
|
||||||
|
reviewer-bottom.js
|
||||||
|
|
Loading…
Reference in a new issue