diff options
author | Bill Marquette <bill.marquette@gmail.com> | 2009-03-14 01:25:46 -0500 |
---|---|---|
committer | Bill Marquette <bill.marquette@gmail.com> | 2009-03-14 01:26:52 -0500 |
commit | 01da41cf8a21a07734e25a5bce4c2d35f81a0134 (patch) | |
tree | 3500d038d20cbf08e1d6dc3102304cf5f5df1f1b /usr/local/www/javascript | |
parent | 9050b9f970dc6531c749be488f57f7c14a89b77a (diff) | |
download | pfsense-01da41cf8a21a07734e25a5bce4c2d35f81a0134.zip pfsense-01da41cf8a21a07734e25a5bce4c2d35f81a0134.tar.gz |
Sajax is no more, long live Prototype
This eliminates one AJAX library, but not all "non-Prototype" AJAX code
Diffstat (limited to 'usr/local/www/javascript')
-rw-r--r-- | usr/local/www/javascript/index/ajax.js (renamed from usr/local/www/javascript/index/sajax.js) | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/usr/local/www/javascript/index/sajax.js b/usr/local/www/javascript/index/ajax.js index f44f8f0..79bd898 100644 --- a/usr/local/www/javascript/index/sajax.js +++ b/usr/local/www/javascript/index/ajax.js @@ -6,8 +6,15 @@ var update_interval = 11000; function updateMeters() { - x_get_stats(stats); - window.setTimeout('updateMeters()', update_interval); + url = '/getstats.php' + + new Ajax.Request(url, { + method: 'get', + onSuccess: function(transport) { + stats(transport.responseText); + } + }); + setTimeout('updateMeters()', update_interval); } function stats(x) { @@ -133,16 +140,15 @@ function updateInterfaces(x){ } function widgetActive(x) { - var widget = document.getElementById(x + '-container'); + var widget = $(x + '-container'); if (widget.style.display != "none") return true; else return false; } -/* start ajax helper "thread" if not started */ -if(!ajaxStarted) { - window.setTimeout('updateMeters()', update_interval); - var ajaxStarted = true; -} +/* start updater */ +document.observe('dom:loaded', function(){ + setTimeout('updateMeters()', update_interval); +}); |