Skip to content

Commit

Permalink
Merge pull request #41 from blp1526/typo
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
blp1526 committed Jan 17, 2016
2 parents f0c9d9f + 75203c4 commit 3f1a9dd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions index.js
@@ -1,7 +1,15 @@
const SayCmd = require(process.cwd() + '/src/js/renderer/SayCmd');
const Timekeeper = require(process.cwd() + '/src/js/renderer/Timekeeper');
const pluralize = require('pluralize');
var timeoutlId;
var timeoutId;

var clearTimeoutDisplay = function(id) {
clearTimeout(id);
document.getElementById("stop").disabled = true;
document.getElementById("play").disabled = false;
document.getElementById("statusBarLeft").innerText = "";
document.getElementById("statusBarRight").innerText = "";
};

SayCmd.voiceList(function(result) {
var voiceName = document.getElementById("voiceName");
Expand Down Expand Up @@ -30,7 +38,7 @@ document.getElementById("play").addEventListener("click", function() {
SayCmd.spawnSync(voiceName, tk.message("start"));
document.getElementById("statusBarLeft").innerText = tk.speakerName;
function repetition() {
timeoutlId = setTimeout(repetition, 1000);
timeoutId = setTimeout(repetition, 1000);
var minutes = ("0" + parseInt(tk.currentSeconds / 60)).substr(-2);
var seconds = ("0" + (tk.currentSeconds - (60 * minutes))).substr(-2);
document.getElementById("statusBarRight").innerText = `${minutes}:${seconds}`;
Expand All @@ -43,11 +51,7 @@ document.getElementById("play").addEventListener("click", function() {
}
if (tk.currentSeconds < 1) {
SayCmd.spawn(voiceName, tk.message("finish"));
clearTimeout(timeoutlId);
document.getElementById("stop").disabled = true;
document.getElementById("play").disabled = false;
document.getElementById("statusBarLeft").innerText = "";
document.getElementById("statusBarRight").innerText = "";
clearTimeoutDisplay(timeoutId);
}
}
tk.currentSeconds--;
Expand All @@ -59,11 +63,7 @@ document.getElementById("play").addEventListener("click", function() {
});

document.getElementById("stop").addEventListener('click', function() {
clearTimeout(timeoutlId);
document.getElementById("stop").disabled = true;
document.getElementById("play").disabled = false;
document.getElementById("statusBarLeft").innerText = "";
document.getElementById("statusBarRight").innerText = "";
clearTimeoutDisplay(timeoutId);
});

var activate = function() {
Expand Down

0 comments on commit 3f1a9dd

Please sign in to comment.