Widget:TimerTest2: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<script type= | <script type='text/javascript'> | ||
$.getScript( 'http://ec2-50-19-198-137.compute-1.amazonaws.com/includes/raty/jquery.timer.js',function(){ | $.getScript( 'http://ec2-50-19-198-137.compute-1.amazonaws.com/includes/raty/jquery.timer.js',function(){ | ||
mw.loader.using('mediawiki.user',function(){ | mw.loader.using('mediawiki.user',function(){ | ||
Line 25: | Line 25: | ||
init = function(){ | init = function(){ | ||
$timer1 = $('#output1'); | $timer1 = $('#output1'); | ||
window.Timer1 = $.timer(updateTimer, incrementTime, true); | |||
}; | }; | ||
this.pause = function(){ | this.pause = function(){ | ||
window.Timer1.pause().once(); | |||
}; | }; | ||
this.play = function(){ | this.play = function(){ | ||
if(!this.Timer.isActive){ | if(!this.Timer.isActive){ | ||
window.Timer1.play().once(); | |||
} | } | ||
}; | }; | ||
Line 46: | Line 45: | ||
currentTime -=incrementTime; | currentTime -=incrementTime; | ||
if(currentTime === 100){ | if(currentTime === 100){ | ||
window.Timer1.pause(); | |||
alert("Click OK to continue accruing CME Time"); | alert("Click OK to continue accruing CME Time"); | ||
window.Timer2.pause().once(); | |||
currentTime = 5000; | currentTime = 5000; | ||
} | } | ||
Line 54: | Line 53: | ||
init = function(){ | init = function(){ | ||
$timer2 = $('#output2'); | $timer2 = $('#output2'); | ||
window.Timer2 = $.timer(updateTimer, incrementTime, true); | |||
}; | }; | ||
this.resetTimer = function(){ | this.resetTimer = function(){ | ||
currentTime = 120000; | currentTime = 120000; | ||
if(! | if(!window.Timer2.isActive){ | ||
window.Timer2.play().once(); | |||
} | } | ||
window.Timer1.play(); | |||
} | } | ||
$(init); | $(init); |