diff options
author | Vinicius Coque <vcoque@gmail.com> | 2011-10-22 17:02:04 -0200 |
---|---|---|
committer | Vinicius Coque <vcoque@gmail.com> | 2011-10-22 17:02:04 -0200 |
commit | 78d84a88e0f87ad2b44aa8f3c6b5d37fee2135e7 (patch) | |
tree | e48a0180abb2b9ddb7e788f82fba0cf9b1115149 /usr/local | |
parent | ef9773a56a97730724d74200c3ce59b288cab1bb (diff) | |
download | pfsense-78d84a88e0f87ad2b44aa8f3c6b5d37fee2135e7.zip pfsense-78d84a88e0f87ad2b44aa8f3c6b5d37fee2135e7.tar.gz |
Converting from prototype to jQuery status_*
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/status_filter_reload.php | 14 | ||||
-rwxr-xr-x | usr/local/www/status_queues.php | 22 | ||||
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 4 |
3 files changed, 20 insertions, 20 deletions
diff --git a/usr/local/www/status_filter_reload.php b/usr/local/www/status_filter_reload.php index a5dd334..78c6f8d 100644 --- a/usr/local/www/status_filter_reload.php +++ b/usr/local/www/status_filter_reload.php @@ -101,18 +101,18 @@ function update_data(obj) { result_text = result_text.replace("\n",""); result_text = result_text.replace("\r",""); if (result_text) { - $('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> ' + result_text + '...'; + jQuery('#status').html('<img src="/themes/metallic/images/misc/loader.gif"> ' + result_text + '...'); } else { - $('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> Obtaining filter status...'; + jQuery('#status').html('<img src="/themes/metallic/images/misc/loader.gif"> Obtaining filter status...'); } if(result_text == "Initializing") { - $('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> Initializing...'; + jQuery('#status').html('<img src="/themes/metallic/images/misc/loader.gif"> Initializing...'); } else if(result_text == "Done") { new Effect.Highlight($('status')); - $('status').innerHTML = 'Done. The filter rules have been reloaded.'; - $('reloadinfo').style.visibility="hidden"; - $('doneurl').style.visibility="visible"; - $('doneurl').innerHTML = "<p/><a href='status_queues.php'>Queue Status</a>"; + jQuery('#status').html('Done. The filter rules have been reloaded.'); + jQuery('#reloadinfo').css("visibility","hidden"); + jQuery('#doneurl').css("visibility","visible"); + jQuery('#doneurl').html("<p/><a href='status_queues.php'>Queue Status</a>"); } window.setTimeout('update_status_thread()', 2500); } diff --git a/usr/local/www/status_queues.php b/usr/local/www/status_queues.php index a317bdf..32dfd09 100755 --- a/usr/local/www/status_queues.php +++ b/usr/local/www/status_queues.php @@ -82,13 +82,13 @@ if ($_REQUEST['getactivity']) { $packet_s = round(400 * (1 - $q['pkts']/ $total_packets_s), 0); - $finscript .= "$('queue{$q['name']}{$q['interface']}widthb').width='{$packet_s}';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}widtha').width='" . (400 - $packet_s) . "';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}pps').value = '{$q['measured']}/pps';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}bps').value = '{$q['measuredspeed']}';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}borrows').value = '{$q['borrows']} borrows';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}suspends').value = '{$q['suspends']} suspends';"; - $finscript .= "$('queue{$q['name']}{$q['interface']}drops').value = '{$q['droppedpkts']} drops';"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}widthb').width('{$packet_s}');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}widtha').width('" . (400 - $packet_s) . "');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}pps').val('{$q['measured']}/pps');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}bps').val('{$q['measuredspeed']}');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}borrows').val('{$q['borrows']} borrows');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}suspends').val('{$q['suspends']} suspends');"; + $finscript .= "jQuery('#queue{$q['name']}{$q['interface']}drops').val('{$q['droppedpkts']} drops');"; } header("Content-type: text/javascript"); echo $finscript; @@ -115,12 +115,12 @@ if(!is_array($config['shaper']['queue']) && count($config['shaper']['queue']) < function getqueueactivity() { var url = "/status_queues.php"; var pars = 'getactivity=yes'; - var myAjax = new Ajax.Request( + jQuery.ajax( url, { - method: 'post', - parameters: pars, - onComplete: activitycallback + type: 'post', + data: pars, + complete: activitycallback }); } function activitycallback(transport) { diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index e548530..5ef7add 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -605,9 +605,9 @@ function get_dates($curperiod, $graph) { if($curperiod == "current") { $end = $dates['end']; } - /* generate update events utilizing prototype $('') feature */ + /* generate update events utilizing jQuery('') feature */ echo "\n"; - echo "\t\t\$('{$graph}-{$curoption}-{$curdatabase}').src='status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid;\n"; + echo "\t\tjQuery('#{$graph}-{$curoption}-{$curdatabase}').attr('src','status_rrd_graph_img.php?start={$start}&graph={$graph}&database={$curdatabase}&style={$curstyle}&tmp=' + randomid);\n"; } } ?> |