[wiki-lenny/static/] ajout des ressources statiques du wiki dans le repo (css)
darcs-hash:20081109214403-bd074-aea913ab711cbdb465ead1d96003dbcf5b52c7c3.gz
This commit is contained in:
parent
6b3f3a1c17
commit
3275986a70
92 changed files with 4356 additions and 0 deletions
45
wiki-lenny/static/common/js/countdown.js
Normal file
45
wiki-lenny/static/common/js/countdown.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
var state = 0; // 0: start; 1: long count; 2: short count; 3: timeout; 4/5: blink
|
||||
var counter = 0, step = 1, delay = 1;
|
||||
|
||||
function countdown() {
|
||||
// change state if counter is down
|
||||
if (counter <= 1) {
|
||||
state += 1
|
||||
if (state == 1) {
|
||||
counter = countdown_timeout_min
|
||||
step = 1
|
||||
delay = 60000
|
||||
}
|
||||
if (state == 2) {
|
||||
counter = 60
|
||||
step = 5
|
||||
delay = step * 1000
|
||||
}
|
||||
if (state == 3 || state == 5) {
|
||||
window.status = countdown_lock_expire
|
||||
state = 3
|
||||
counter = 1
|
||||
step = 1
|
||||
delay = 500
|
||||
}
|
||||
if (state == 4) {
|
||||
// blink the above text
|
||||
window.status = " "
|
||||
counter = 1
|
||||
delay = 250
|
||||
}
|
||||
}
|
||||
|
||||
// display changes
|
||||
if (state < 3) {
|
||||
var msg
|
||||
if (state == 1) msg = countdown_lock_mins
|
||||
if (state == 2) msg = countdown_lock_secs
|
||||
window.status = msg.replace(/#/, counter)
|
||||
}
|
||||
counter -= step
|
||||
|
||||
// Set timer for next update
|
||||
setTimeout("countdown()", delay);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue