[Phphtmllib-devel] SF.net SVN: phphtmllib:[3295] trunk/open2300/htdocs/js/main.js
Status: Beta
Brought to you by:
hemna
From: <he...@us...> - 2009-11-24 23:59:04
|
Revision: 3295 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3295&view=rev Author: hemna Date: 2009-11-24 23:58:51 +0000 (Tue, 24 Nov 2009) Log Message: ----------- small cleanup Modified Paths: -------------- trunk/open2300/htdocs/js/main.js Modified: trunk/open2300/htdocs/js/main.js =================================================================== --- trunk/open2300/htdocs/js/main.js 2009-11-24 17:22:54 UTC (rev 3294) +++ trunk/open2300/htdocs/js/main.js 2009-11-24 23:58:51 UTC (rev 3295) @@ -18,8 +18,7 @@ },2); new PeriodicalExecuter(function(pe) { - d = new Date(); - new Ajax.Updater('idCurrentConditions','/?ajax=1&ajaxid=idCurrentConditions&target=current-conditions&junk='+d.getSeconds() , + new Ajax.Updater('idCurrentConditions','/?ajax=1&ajaxid=idCurrentConditions&target=current-conditions&junk='+get_junk() , {method:'get',asynchronous:true,evalScripts:true, onComplete: function() { new Effect.Highlight('idcclastupdate', {duration: 5.0}); @@ -29,11 +28,11 @@ 63); new PeriodicalExecuter(function(pe) { - d = new Date(); + var junk = get_junk(); Effect.Fade('idTempDewLineGraph', {duration: 0.5, afterFinish: function() { img = new Image(); - img.src = '/?target=temp-dew-point-line-graph&junk='+d.getTime(); + img.src = '/?target=temp-dew-point-line-graph&junk='+junk; img.id='idTempDewLineGraph'; $('idTempDewLineGraphdiv').update(); $('idTempDewLineGraphdiv').appendChild(img); @@ -43,7 +42,7 @@ Effect.Fade('idPressureLineGraph', {duration: 0.6, afterFinish: function() { img = new Image(); - img.src = '/?target=pressure-line-graph&junk='+d.getTime(); + img.src = '/?target=pressure-line-graph&junk='+junk; img.id='idPressureLineGraph'; $('idPressureLineGraphdiv').update(); $('idPressureLineGraphdiv').appendChild(img); @@ -53,7 +52,7 @@ Effect.Fade('idRainLineGraph', {duration: 0.7, afterFinish: function() { img = new Image(); - img.src = '/?target=rain-line-graph&junk='+d.getTime(); + img.src = '/?target=rain-line-graph&junk='+junk; img.id='idRainLineGraph'; $('idRainLineGraphdiv').update(); $('idRainLineGraphdiv').appendChild(img); @@ -63,7 +62,7 @@ Effect.Fade('idWindSpeedLineGraph', {duration: 0.7, afterFinish: function() { img = new Image(); - img.src = '/?target=wind-speed-line-graph&junk='+d.getTime(); + img.src = '/?target=wind-speed-line-graph&junk='+junk; img.id='idWindSpeedLineGraph'; $('idWindSpeedLineGraphdiv').update(); $('idWindSpeedLineGraphdiv').appendChild(img); @@ -72,7 +71,7 @@ Effect.Fade('idRadarImg', {duration: 0.7, afterFinish: function() { img = new Image(); - img.src = "http://radblast-mi.wunderground.com/cgi-bin/radar/WUNIDS_map?station=DAX&brand=wui&num=1&delay=15&type=N0R&frame=0&scale=0.326&noclutter=0&t=1235942643&lat=38.81977081&lon=-121.02596283&label=Pilot+Hill%2C+CA&showstorms=0&map.x=400&map.y=240¢erx=145¢ery=359&transx=-255&transy=119&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&junk="+d.getTime(); + img.src = "http://radblast-mi.wunderground.com/cgi-bin/radar/WUNIDS_map?station=DAX&brand=wui&num=1&delay=15&type=N0R&frame=0&scale=0.326&noclutter=0&t=1235942643&lat=38.81977081&lon=-121.02596283&label=Pilot+Hill%2C+CA&showstorms=0&map.x=400&map.y=240¢erx=145¢ery=359&transx=-255&transy=119&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&junk="+junk; img.id='idRadarImg'; img.width=480; img.height=320; @@ -83,11 +82,17 @@ }, 65); + + //update the image + new PeriodicalExecuter(function(pe) { + var img = $('idCamImg'); + img.src="http://wx.hemna.com/cam/cam.jpg?junk="+get_junk(); + },30); + } function start_weather_dl_updates() { - set_orig_time(new Date()); var counter = new PeriodicalExecuter(function() { @@ -99,28 +104,28 @@ conds['ages'] = time.getSeconds() - orig_time.getSeconds(); $('idUpdateSeconds').update(convertTime(new_ts - orig_ts)); -},2); + },2); - new PeriodicalExecuter(function(pe) { - d = new Date(); - new Ajax.Updater('idCurrentConditions','/?ajax=1&ajaxid=idCurrentConditions&target=current-conditions&junk='+d.getSeconds() , + new PeriodicalExecuter(function(pe) { + new Ajax.Updater('idCurrentConditions','/?ajax=1&ajaxid=idCurrentConditions&target=current-conditions&junk='+get_junk() , {method:'get',asynchronous:true,evalScripts:true, onComplete: function() { new Effect.Highlight('idcclastupdate', {duration: 5.0}); set_orig_time(new Date()); }}) - }, - 63); - + }, + 63); } - new PeriodicalExecuter(function(pe) { - d = new Date(); - img = $('idCamImg'); - img.src="http://wx.hemna.com/cam/cam.jpg?junk="+d.getSeconds(); - }, - 30); + + + +function get_junk() { + var d = new Date(); + return d.getDate()+d.getHours()+d.getSeconds(); +} + function set_orig_time(new_time) { orig_time = new_time; orig_ts =Math.round(orig_time.getTime()/1000); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |