@ -6,34 +6,67 @@ function init(){
height : 89
height : 89
} ) ;
} ) ;
var space = $ ( "<div style='font-size:15px'>h</div>" ) . ubwbutton ( { w : 17 , h : 68 } ) ;
var space = $ ( "<div style='font-size:15px'>h</div>" ) . ubwbutton ( {
w : 17 ,
h : 68
} ) ;
space . find ( ".ubw-button-body" ) . css ( {
space . find ( ".ubw-button-body" ) . css ( {
borderLeft : "none" ,
borderLeft : "none" ,
borderRight : "none"
borderRight : "none"
} ) ;
} ) ;
var spaceb = $ ( "<div style='font-size:15px'>m</div>" ) . ubwbutton ( { w : 17 , h : 68 } ) ;
var spaceb = $ ( "<div style='font-size:15px'>m</div>" ) . ubwbutton ( {
w : 17 ,
h : 68
} ) ;
spaceb . find ( ".ubw-button-body" ) . css ( {
spaceb . find ( ".ubw-button-body" ) . css ( {
borderLeft : "none" ,
borderLeft : "none" ,
borderRight : "none"
borderRight : "none"
} ) ;
} ) ;
spaceb . find ( ".ubw-button-canvas" ) . unbind ( "mouseenter" ) ;
spaceb . find ( ".ubw-button-canvas" ) . unbind ( "mouseenter" ) ;
var spacec = $ ( "<div style='font-size:15px'>s</div>" ) . ubwbutton ( { w : 17 , h : 68 } ) ;
var spacec = $ ( "<div style='font-size:15px'>s</div>" ) . ubwbutton ( {
w : 17 ,
h : 68
} ) ;
spacec . find ( ".ubw-button-body" ) . css ( {
spacec . find ( ".ubw-button-body" ) . css ( {
borderLeft : "none" ,
borderLeft : "none" ,
borderRight : "none"
borderRight : "none"
} ) ;
} ) ;
spacec . find ( ".ubw-button-canvas" ) . unbind ( "mouseenter" ) ;
spacec . find ( ".ubw-button-canvas" ) . unbind ( "mouseenter" ) ;
var hours = $ ( "<div class='scroll' id='hours'>00</div>" ) . ubwbutton ( { w : 52 , h : 68 } , { bottom : 1 , top : 1 , right : 0 , left : 0 } ) ;
var hours = $ ( "<div class='scroll' id='hours'>00</div>" ) . ubwbutton ( {
w : 52 ,
h : 68
} , {
bottom : 1 ,
top : 1 ,
right : 0 ,
left : 0
} ) ;
hours . find ( ".ubw-button-body" ) . css ( {
hours . find ( ".ubw-button-body" ) . css ( {
borderRight : "none"
borderRight : "none"
} ) ;
} ) ;
var minutes = $ ( "<div class='scroll' id='minutes'>00</div>" ) . ubwbutton ( { w : 52 , h : 68 } , { bottom : 1 , top : 1 , right : 0 , left : 0 } ) ;
var minutes = $ ( "<div class='scroll' id='minutes'>00</div>" ) . ubwbutton ( {
w : 52 ,
h : 68
} , {
bottom : 1 ,
top : 1 ,
right : 0 ,
left : 0
} ) ;
minutes . find ( ".ubw-button-body" ) . css ( {
minutes . find ( ".ubw-button-body" ) . css ( {
borderLeft : "none" ,
borderLeft : "none" ,
borderRight : "none"
borderRight : "none"
} ) ;
} ) ;
var seconds = $ ( "<div class='scroll' id='seconds'>00</div>" ) . ubwbutton ( { w : 52 , h : 68 } , { bottom : 1 , top : 1 , right : 0 , left : 0 } ) ;
var seconds = $ ( "<div class='scroll' id='seconds'>00</div>" ) . ubwbutton ( {
w : 52 ,
h : 68
} , {
bottom : 1 ,
top : 1 ,
right : 0 ,
left : 0
} ) ;
seconds . find ( ".ubw-button-body" ) . css ( {
seconds . find ( ".ubw-button-body" ) . css ( {
borderLeft : "none" ,
borderLeft : "none" ,
borderRight : "none"
borderRight : "none"
@ -65,9 +98,9 @@ function init(){
window . widget . onremove = function ( ) {
window . widget . onremove = function ( ) {
if ( play ) {
if ( play ) {
$ ( "#pausebutton" ) . trigger ( "click" ) ;
$ ( "#pausebutton" ) . trigger ( "click" ) ;
}
} ;
} ;
} ;
}
} ;
pause . toggle (
pause . toggle (
function ( ) {
function ( ) {
@ -76,6 +109,10 @@ function init(){
$ ( this ) . find ( "img" ) . attr ( "src" , "images/button_play_invert.png" ) ;
$ ( this ) . find ( "img" ) . attr ( "src" , "images/button_play_invert.png" ) ;
} ,
} ,
function ( ) {
function ( ) {
if ( $ ( "#hours" ) . find ( ".ubw-button-content" ) . text ( ) != "00" ||
$ ( "#minutes" ) . find ( ".ubw-button-content" ) . text ( ) != "00" ||
$ ( "#seconds" ) . find ( ".ubw-button-content" ) . text ( ) != "00" ) {
play = true ;
play = true ;
var timeInSeconds = parseInt ( $ ( "#seconds" ) . find ( ".ubw-button-content" ) . text ( ) , 10 ) +
var timeInSeconds = parseInt ( $ ( "#seconds" ) . find ( ".ubw-button-content" ) . text ( ) , 10 ) +
parseInt ( $ ( "#minutes" ) . find ( ".ubw-button-content" ) . text ( ) , 10 ) * 60 +
parseInt ( $ ( "#minutes" ) . find ( ".ubw-button-content" ) . text ( ) , 10 ) * 60 +
@ -85,6 +122,7 @@ function init(){
$ ( this ) . find ( "img" ) . attr ( "src" , "images/button_pause_invert.png" ) ;
$ ( this ) . find ( "img" ) . attr ( "src" , "images/button_pause_invert.png" ) ;
}
}
}
) ; / * . m o u s e e n t e r ( f u n c t i o n ( ) {
) ; / * . m o u s e e n t e r ( f u n c t i o n ( ) {
var o = $ ( this ) . find ( "img" ) . attr ( "src" ) ;
var o = $ ( this ) . find ( "img" ) . attr ( "src" ) ;
$ ( this ) . find ( "img" ) . attr ( "src" , o . split ( "." ) [ 0 ] + "xov.png" ) ;
$ ( this ) . find ( "img" ) . attr ( "src" , o . split ( "." ) [ 0 ] + "xov.png" ) ;
@ -93,23 +131,43 @@ function init(){
$ ( this ) . find ( "img" ) . attr ( "src" , o . split ( "x" ) [ 0 ] + ".png" ) ;
$ ( this ) . find ( "img" ) . attr ( "src" , o . split ( "x" ) [ 0 ] + ".png" ) ;
} ) ; * /
} ) ; * /
setTimeout ( function ( ) { pause . trigger ( "click" ) } , 200 ) ;
setTimeout ( function ( ) {
pause . trigger ( "click" )
} , 200 ) ;
hours
hours
. bind ( "mousedown" , { button : hours } , timeButtonDownHandler )
. bind ( "mousedown" , {
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , { button : hours } , addbtn ) ;
button : hours
} , timeButtonDownHandler )
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , {
button : hours
} , addbtn ) ;
hours
hours
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , { button : hours } , rembtn ) ;
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , {
button : hours
} , rembtn ) ;
minutes
minutes
. bind ( "mousedown" , { button : minutes } , timeButtonDownHandler )
. bind ( "mousedown" , {
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , { button : minutes } , addbtn ) ;
button : minutes
} , timeButtonDownHandler )
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , {
button : minutes
} , addbtn ) ;
minutes
minutes
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , { button : minutes } , rembtn ) ;
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , {
button : minutes
} , rembtn ) ;
seconds
seconds
. bind ( "mousedown" , { button : seconds } , timeButtonDownHandler )
. bind ( "mousedown" , {
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , { button : seconds } , addbtn ) ;
button : seconds
} , timeButtonDownHandler )
. find ( ".ubw-button-arrowTop" ) . bind ( "mousedown" , {
button : seconds
} , addbtn ) ;
seconds
seconds
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , { button : seconds } , rembtn ) ;
. find ( ".ubw-button-arrowBottom" ) . bind ( "mousedown" , {
button : seconds
} , rembtn ) ;
$ ( document ) . mouseup ( function ( ) {
$ ( document ) . mouseup ( function ( ) {
/ * i f ( i s S c r o l l i n g ) {
/ * i f ( i s S c r o l l i n g ) {
@ -140,7 +198,6 @@ function init(){
. append ( btnsWrapper ) ;
. append ( btnsWrapper ) ;
clearTimeout ( currentTimer ) ;
clearTimeout ( currentTimer ) ;
updateChronometer ( 0 ) ;
var currentTimer = null ;
var currentTimer = null ;
var incDecTime = null ;
var incDecTime = null ;
@ -160,8 +217,10 @@ function init(){
content . text ( formatTime ( parseInt ( content . text ( ) ) + 1 ) ) ;
content . text ( formatTime ( parseInt ( content . text ( ) ) + 1 ) ) ;
incDecTime = setTimeout ( function ( ) { addbtn ( m ) } , 150 ) ;
incDecTime = setTimeout ( function ( ) {
} ;
addbtn ( m )
} , 150 ) ;
}
function rembtn ( m ) {
function rembtn ( m ) {
@ -174,12 +233,17 @@ function init(){
content . text ( formatTime ( parseInt ( content . text ( ) ) - 1 ) ) ;
content . text ( formatTime ( parseInt ( content . text ( ) ) - 1 ) ) ;
incDecTime = setTimeout ( function ( ) { rembtn ( m ) } , 150 ) ;
incDecTime = setTimeout ( function ( ) {
} ;
rembtn ( m ) ;
} , 150 ) ;
}
function timeButtonDownHandler ( m ) {
function timeButtonDownHandler ( m ) {
var button = m . data . button ;
var button = m . data . button ;
var mouseStart = { pageX : m . pageX , pageY : m . pageY } ;
var mouseStart = {
pageX : m . pageX ,
pageY : m . pageY
} ;
var content = button . find ( ".ubw-button-content" ) ;
var content = button . find ( ".ubw-button-content" ) ;
var val = content . text ( ) ;
var val = content . text ( ) ;
isScrolling = true ;
isScrolling = true ;
@ -204,44 +268,52 @@ function init(){
content . text ( content . text ( ) % 60 ) ;
content . text ( content . text ( ) % 60 ) ;
if ( content . text ( ) < 0 ) content . text ( 0 ) ;
if ( content . text ( ) < 0 ) content . text ( 0 ) ;
} ) ; * /
} ) ; * /
} ;
}
function buttonOverHandler ( e ) {
function buttonOverHandler ( e ) {
var button = e . data . button ;
var button = e . data . button ;
var buttonbody = button . find ( ".ubw-button-body" ) ;
var buttonbody = button . find ( ".ubw-button-body" ) ;
button . css ( { zIndex : 1 } )
button . css ( {
zIndex : 1
} )
buttonbody . removeClass ( "ubw-button-out" )
buttonbody . removeClass ( "ubw-button-out" )
. addClass ( "ubw-button-over" )
. addClass ( "ubw-button-over" )
. css ( { fontSize : "125%" } ) ;
. css ( {
fontSize : "125%"
} ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowTop" ) . children ( "img" ) . attr ( "src" , "images/arrows_over/top.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowTop" ) . children ( "img" ) . attr ( "src" , "images/arrows_over/top.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowBottom" ) . children ( "img" ) . attr ( "src" , "images/arrows_over/bottom.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowBottom" ) . children ( "img" ) . attr ( "src" , "images/arrows_over/bottom.png" ) ;
} ;
}
function buttonOutHandler ( e ) {
function buttonOutHandler ( e ) {
var button = e . data . button ;
var button = e . data . button ;
var buttonbody = button . find ( ".ubw-button-body" ) ;
var buttonbody = button . find ( ".ubw-button-body" ) ;
button . css ( { zIndex : 0 } ) ;
button . css ( {
zIndex : 0
} ) ;
buttonbody . removeClass ( "ubw-button-over" )
buttonbody . removeClass ( "ubw-button-over" )
. addClass ( "ubw-button-out" )
. addClass ( "ubw-button-out" )
. css ( {
. css ( {
fontSize : "100%" ,
fontSize : "100%"
} ) ;
} ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowTop" ) . children ( "img" ) . attr ( "src" , "images/arrows_out/top.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowTop" ) . children ( "img" ) . attr ( "src" , "images/arrows_out/top.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowBottom" ) . children ( "img" ) . attr ( "src" , "images/arrows_out/top.png" ) ;
button . find ( ".ubw-button-canvas" ) . find ( ".ubw-button-arrowBottom" ) . children ( "img" ) . attr ( "src" , "images/arrows_out/top.png" ) ;
} ;
}
function updateChronometerReverse ( seconds ) {
function updateChronometerReverse ( seconds ) {
currentTimer = setTimeout ( function ( ) { updateChronometerReverse ( seconds - 1 ) } , 1000 ) ;
currentTimer = setTimeout ( function ( ) {
updateChronometerReverse ( seconds - 1 )
} , 1000 ) ;
if ( seconds < 6 && seconds > 0 ) {
if ( seconds < 6 && seconds > 0 ) {
DHTMLSound ( 'beep.wav' ) ;
DHTMLSound ( 'beep.wav' ) ;
} else if ( seconds === 0 ) {
} else if ( seconds === 0 ) {
DHTMLSound ( 'finalbeep.wav' ) ;
DHTMLSound ( 'finalbeep.wav' ) ;
} ;
}
if ( seconds < 1 ) {
if ( seconds < 1 ) {
seconds = 0 ;
seconds = 0 ;