Improve the Typing Test in pad

This commit is contained in:
yflory committed 2018-11-08 10:46:07 +01:00
1 parent a5b04bd62a
commit 82c3c7f50b
2 files changed
+22 -1

No files matched your search

+20
View File
@@ -56,8 +56,28 @@ define(function () {
};
};
var testInput2 = function (editor) {
var i = 0,
input = " The quick red fox jumps over the lazy brown dog.",
l = input.length,
interval;
var cancel = function () {
if (interval) { interval.cancel(); }
};
interval = setRandomizedInterval(function () {
editor.insertText(input.charAt(i));
i = (i + 1) % l;
}, 200, 50);
return {
cancel: cancel
};
};
return {
testInput: testInput,
testInput2: testInput2,
setRandomizedInterval: setRandomizedInterval
};
});