removed moment.js dependency
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
<link rel="stylesheet" type="text/css" href="css/custom.css" />
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="js/jquery-1.9.1.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/moment.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/routie.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="js/ejs.js"></script>
|
||||
|
||||
|
@@ -64,20 +64,20 @@ if (typeof(sw) == 'undefined') {
|
||||
var playforwords = 10;
|
||||
sw.correctWords = 0;
|
||||
sw.wrongWords = 0;
|
||||
sw.time = moment();
|
||||
sw.time = Math.round((new Date()).getTime() / 1000);
|
||||
sw.gameover = false;
|
||||
|
||||
var updateBadges = function() {
|
||||
$('.num-of-words-wrong').html(sw.wrongWords + (sw.wrongWords == 1 ? ' word' : ' words'));
|
||||
$('.num-of-words').html(sw.correctWords + (sw.correctWords == 1 ? ' word' : ' words'));
|
||||
$('.time-words').html(moment.duration(moment() - sw.time).seconds());
|
||||
$('.time-words').html(Math.round((new Date()).getTime() / 1000) - sw.time);
|
||||
|
||||
if(playforwords > sw.correctWords + sw.wrongWords) {
|
||||
setTimeout(function() {
|
||||
updateBadges();
|
||||
}, 100);
|
||||
} else {
|
||||
sw.finaltime = moment.duration(moment() - sw.time).seconds();
|
||||
sw.finaltime = Math.round((new Date()).getTime() / 1000) - sw.time;
|
||||
sw.gameover = true;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user