2010-09-14 23:38:29 +02:00
$ ( document ) . ready ( function ( ) {
2010-09-17 15:38:57 +02:00
$ ( 'body' ) . append ( '<a href="#city" id="city-menu"><img src="images/interface/weather.png" /></a><div style="display:none;"><div id="city"></div></div>' ) ;
$ ( '#menu-bar' ) . prepend ( $ ( '#city-menu' ) ) ;
2010-09-21 16:00:04 +02:00
$ ( '#city' ) . append ( '<h3>Quelle ville pour la meteo ?</h3><br/><input type="text" id="cityChoice" name="cityChoice"/><span id="city-submit" class="green-button">Enregistrer</span>' ) ;
2010-09-15 23:36:14 +02:00
$ ( '#city-menu' ) . fancybox ( {
'zoomSpeedIn' : 600 ,
'zoomSpeedOut' : 500 ,
'easingIn' : 'easeOutBack' ,
'easingOut' : 'easeInBack' ,
'hideOnContentClick' : false ,
'padding' : 15
} ) ;
$ ( '#city-submit' ) . live ( 'click' , function ( ) {
var ville = $ ( '#cityChoice' ) . val ( ) ;
if ( ville != '' || ville != null ) {
2010-09-20 16:39:08 +02:00
$ . get ( 'ajax/update.php' , { id : 'weather' , city : ville } , function ( msg ) {
2010-09-15 23:36:14 +02:00
location . reload ( ) ;
} ) ;
} else {
$ ( '#city' ) . append ( '<span class="error">City can\'t be empty.</span>' ) ;
}
} ) ;
2010-09-14 23:38:29 +02:00
var tmp ;
/* A helper function for converting a set of elements to draggables: */
make _draggable ( $ ( '#weather' ) ) ;
} ) ;