Permalink
Browse files

Tidy up pechaKucha js code

  • Loading branch information...
1 parent 13eefc0 commit ec2b3caa4720801f9b4ec412e82bf688dfc61b61 @mocoso committed Feb 6, 2010
Showing with 6 additions and 13 deletions.
  1. +6 −13 pechakucha.js
View
@@ -29,30 +29,23 @@ function setUpPechaKucha()
// See http://www.pecha-kucha.org/ for more details
function pechaKucha()
{
- pechaKuchaRunning = true
- $("#pechaKuchaInfo").text(pechaKuchaStatus(0));
- if (pechaKuchaRunning) {
+ if (!pechaKuchaRunning) {
+ pechaKuchaRunning = true
+ $("#pechaKuchaInfo").text(pechaKuchaStatus(0));
var seconds = 0;
setInterval(function() {
seconds++;
- $("#pechaKuchaInfo").text(pechaKuchaStatus(seconds))
+ $("#pechaKuchaInfo").text(pechaKuchaStatus(seconds));
if (seconds == 20) {
seconds = 0;
nextStep();
}
}, 1000);
-}
+ }
}
function pechaKuchaStatus(seconds) {
- if (pechaKuchaRunning) {
- if (seconds > 14) {
- var transitionCountDown = ' (' + (20 - seconds) + ')';
- } else {
- var transitionCountDown = '';
- }
- return ' - 20x20 mode' + transitionCountDown;
- }
+ return ' - 20x20 mode (' + (20 - seconds) + 's)';
}
$(function(){

0 comments on commit ec2b3ca

Please sign in to comment.