diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2014-11-27 18:31:24 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2014-11-27 18:31:48 +0900 |
commit | 1c5dcd53d386ae72f549dc942e784b85e6161842 (patch) | |
tree | 255b2cc5de0b214b3fe6ac512f41187af9e2bb2b /js | |
parent | e5a37cb18f62c8f5b471a22e302b5c00347d2370 (diff) | |
download | schoolclock-1c5dcd53d386ae72f549dc942e784b85e6161842.tar.gz |
indentation
Diffstat (limited to 'js')
-rw-r--r-- | js/main.js | 66 |
1 files changed, 33 insertions, 33 deletions
@@ -76,17 +76,17 @@ function updateClasses () else var colour = ""; $('#classes').append('<div class="col-md-2"' + colour + '> \ - <h1>' + classstring + '</h1> \ - <p class="text-center"> \ - <a id="' + classstring + 'points" class="btn btn-info btn-lg">' + classes[i].points + ' points</a> \ - </p> \ - <p class="text-center"> \ - <a id="' + classstring + 'time" class="btn btn-warning">' + minutes + ':' + seconds + ' this week</a> \ - </p> \ - <p class="text-center"> \ - <a id="' + classstring + 'random" class="btn btn-success">Lucky number</a> \ - </p> \ - </div>'); +<h1>' + classstring + '</h1> \ +<p class="text-center"> \ +<a id="' + classstring + 'points" class="btn btn-info btn-lg">' + classes[i].points + ' points</a> \ +</p> \ +<p class="text-center"> \ +<a id="' + classstring + 'time" class="btn btn-warning">' + minutes + ':' + seconds + ' this week</a> \ +</p> \ +<p class="text-center"> \ +<a id="' + classstring + 'random" class="btn btn-success">Lucky number</a> \ +</p> \ +</div>'); } // now put functions on the buttons @@ -229,7 +229,7 @@ $(document).bind('keydown', 'b', function (){$.ionSound.play("school_bell");}); // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random function getRandomInt(min, max) { - return Math.floor(Math.random() * (max - min)) + min; + return Math.floor(Math.random() * (max - min)) + min; } function activityClockGo($seconds) @@ -240,21 +240,21 @@ function activityClockGo($seconds) function timeWastingClockReset() { - if (timeWastingClock.getTime() != 0) - { - var $timeWastingClockResetConfirm = confirm("Are you sure?"); - if ($timeWastingClockResetConfirm) + if (timeWastingClock.getTime() != 0) { - if ($timeWastingClockRunning) - { - $('#timeWastingClockGo').html('Start <u>t</u>imer'); - timeWastingClock.stop(); - $timeWastingClockRunning = false; - } - $.jStorage.set("time_wasted", 0); - timeWastingClock.setTime(0); + var $timeWastingClockResetConfirm = confirm("Are you sure?"); + if ($timeWastingClockResetConfirm) + { + if ($timeWastingClockRunning) + { + $('#timeWastingClockGo').html('Start <u>t</u>imer'); + timeWastingClock.stop(); + $timeWastingClockRunning = false; + } + $.jStorage.set("time_wasted", 0); + timeWastingClock.setTime(0); + } } - } } function activityClockReset() @@ -272,12 +272,12 @@ function activityClockCustom() // mplungjan on stack overflow: http://stackoverflow.com/a/15397495 function nth(d) { - if(d>3 && d<21) return 'th'; // thanks kennebec - switch (d % 10) { - case 1: return "st"; - case 2: return "nd"; - case 3: return "rd"; - default: return "th"; + if(d>3 && d<21) return 'th'; // thanks kennebec + switch (d % 10) { + case 1: return "st"; + case 2: return "nd"; + case 3: return "rd"; + default: return "th"; } } @@ -287,9 +287,9 @@ function toggleDateStyle() var today = new Date(); var month = "January,February,March,April,May,June,July,August,September,October,November,December" - .split(",")[today.getMonth()]; + .split(",")[today.getMonth()]; var day = "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" - .split(",")[today.getDay()]; + .split(",")[today.getDay()]; var date = today.getDate(); var British = day + " " + date + nth(date) + " " + month + " " + today.getFullYear(); var American = day + " " + month + " " + date + nth(date) + ", " + today.getFullYear(); |