diff options
-rw-r--r-- | js/main.js | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -1,9 +1,9 @@ /* * TODO: * - * - make all buttons work - * - add all hotkeys - * - rework use of global variables + * - rework use of global variables and functions into OO idioms + * - initialise time wasting clock from storage in OO idiom rather + * than just stray function call */ $.ionSound({ @@ -94,7 +94,23 @@ function timeWastingClockReset() } } +function activityClockReset() +{ + activityClock.stop(); + activityClock.setTime(0); +} + +function activityClockCustom() +{ + var minutes = prompt("Number of minutes", "0"); + var seconds = prompt("Number of seconds"); + activityClockGo(parseInt(minutes) * 60 + parseInt(seconds)); +} + $(document).bind('keydown', 's', timeWastingClockReset); +$(document).bind('keydown', 'r', activityClockReset); +$(document).bind('keydown', 'c', activityClockCustom); + $(document).bind('keydown', '0', function (){activityClockGo(30);}); $(document).bind('keydown', '1', function (){activityClockGo(60);}); $(document).bind('keydown', '9', function (){activityClockGo(90);}); @@ -113,6 +129,12 @@ $(document).ready(function(){ $('#timeWastingClockReset').button(); $('#timeWastingClockReset').click(timeWastingClockReset); + $('#activityClockReset').button(); + $('#activityClockReset').click(activityClockReset); + + $('#activityClockCustom').button(); + $('#activityClockCustom').click(activityClockCustom); + $('#activityClock30s').button(); $('#activityClock30s').click(function (){activityClockGo(30);}) |