ajout du mode "pause"

master
adplantade 5 years ago
parent 09fac3538e
commit c2213b0312

@ -3,6 +3,7 @@ var start = 0
var end = 0 var end = 0
var diff = 0 var diff = 0
var timerID = 0 var timerID = 0
var paused=true;
function chrono(){ function chrono(){
end = new Date() end = new Date()
diff = end - start diff = end - start
@ -34,14 +35,18 @@ function chronoStart(){
document.chronoForm.reset.onclick = chronoReset document.chronoForm.reset.onclick = chronoReset
*/ */
start = new Date() start = new Date()
paused=false;
chrono() chrono()
} }
function chronoContinue(){ function chronoContinue(){
/*
document.chronoForm.startstop.value = "stop!" document.chronoForm.startstop.value = "stop!"
document.chronoForm.startstop.onclick = chronoStop document.chronoForm.startstop.onclick = chronoStop
document.chronoForm.reset.onclick = chronoReset document.chronoForm.reset.onclick = chronoReset
*/
start = new Date()-diff start = new Date()-diff
start = new Date(start) start = new Date(start)
paused=false;
chrono() chrono()
} }
function chronoReset(){ function chronoReset(){
@ -58,5 +63,6 @@ function chronoStop(){
document.chronoForm.startstop.onclick = chronoContinue document.chronoForm.startstop.onclick = chronoContinue
document.chronoForm.reset.onclick = chronoStopReset document.chronoForm.reset.onclick = chronoStopReset
*/ */
paused=true;
clearTimeout(timerID) clearTimeout(timerID)
} }

@ -618,6 +618,8 @@ function events() {
function mdManager(e){ function mdManager(e){
mousePos = [e.currentTarget.id.substring(6),compas(e.clientX,e.clientY,e.currentTarget)]; mousePos = [e.currentTarget.id.substring(6),compas(e.clientX,e.clientY,e.currentTarget)];
if(paused)
chronoContinue();
document.getElementById(e.currentTarget.id).classList.add('vitrail-select'); document.getElementById(e.currentTarget.id).classList.add('vitrail-select');
} }

Loading…
Cancel
Save