From 3f98044a3dcb281a433ea6335285ecdf5da23d96 Mon Sep 17 00:00:00 2001 From: Francisco Cavalcante Date: Fri, 22 Jan 2016 14:20:24 -0200 Subject: Replaced jQuery to $ in same files --- src/usr/local/www/edit.php | 32 +++---- src/usr/local/www/filebrowser/browser.js | 28 +++--- src/usr/local/www/filebrowser/browser.php | 8 +- src/usr/local/www/guiconfig.inc | 2 +- src/usr/local/www/pkg.php | 4 +- src/usr/local/www/pkg_edit.php | 18 ++-- src/usr/local/www/status_logs_filter.php | 2 +- src/usr/local/www/status_logs_filter_dynamic.php | 20 ++-- src/usr/local/www/status_openvpn.php | 14 +-- src/usr/local/www/status_queues.php | 26 +++--- src/usr/local/www/widgets/javascript/cpu_graphs.js | 8 +- .../www/widgets/javascript/thermal_sensors.js | 6 +- .../local/www/widgets/javascript/traffic_graph.js | 8 +- .../www/widgets/widgets/dyn_dns_status.widget.php | 4 +- .../www/widgets/widgets/ntp_status.widget.php | 4 +- .../local/www/widgets/widgets/openvpn.widget.php | 6 +- .../widgets/widgets/system_information.widget.php | 104 ++++++++++----------- src/usr/local/www/wizard.php | 4 +- 18 files changed, 149 insertions(+), 149 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/edit.php b/src/usr/local/www/edit.php index a11f472..1b6a43d 100644 --- a/src/usr/local/www/edit.php +++ b/src/usr/local/www/edit.php @@ -207,19 +207,19 @@ require("head.inc"); }); function loadFile() { - jQuery("#fileStatus").html(""); - jQuery("#fileStatusBox").show(500); - jQuery.ajax( + $("#fileStatus").html(""); + $("#fileStatusBox").show(500); + $.ajax( "", { type: "post", - data: "action=load&file=" + jQuery("#fbTarget").val(), + data: "action=load&file=" + $("#fbTarget").val(), complete: loadComplete } ); } function loadComplete(req) { - jQuery("#fileContent").show(1000); + $("#fileContent").show(1000); var values = req.responseText.split("|"); values.shift(); values.pop(); @@ -227,30 +227,30 @@ require("head.inc"); var file = values.shift(); var fileContent = window.atob(values.join("|")); - jQuery("#fileContent").val(fileContent); + $("#fileContent").val(fileContent); } else { - jQuery("#fileStatus").html(values[0]); - jQuery("#fileContent").val(""); + $("#fileStatus").html(values[0]); + $("#fileContent").val(""); } - jQuery("#fileContent").show(1000); + $("#fileContent").show(1000); } function saveFile(file) { - jQuery("#fileStatus").html(""); - jQuery("#fileStatusBox").show(500); + $("#fileStatus").html(""); + $("#fileStatusBox").show(500); - var fileContent = Base64.encode(jQuery("#fileContent").val()); + var fileContent = Base64.encode($("#fileContent").val()); fileContent = fileContent.replace(/\+/g, "%2B"); - jQuery.ajax( + $.ajax( "", { type: "post", - data: "action=save&file=" + jQuery("#fbTarget").val() + + data: "action=save&file=" + $("#fbTarget").val() + "&data=" + fileContent, complete: function(req) { var values = req.responseText.split("|"); - jQuery("#fileStatus").html(values[1]); + $("#fileStatus").html(values[1]); } } ); @@ -397,7 +397,7 @@ var Base64 = { events.push(function() { - jQuery("#fbTarget").val(""); + $("#fbTarget").val(""); loadFile(); }); diff --git a/src/usr/local/www/filebrowser/browser.js b/src/usr/local/www/filebrowser/browser.js index 54e07ee..6e75272 100644 --- a/src/usr/local/www/filebrowser/browser.js +++ b/src/usr/local/www/filebrowser/browser.js @@ -1,22 +1,22 @@ -jQuery(document).ready( +$(document).ready( function() { - jQuery("#fbOpen").click( + $("#fbOpen").click( function() { - jQuery("#fbBrowser").fadeIn(750); - fbBrowse(jQuery("#fbTarget").val()); + $("#fbBrowser").fadeIn(750); + fbBrowse($("#fbTarget").val()); } ); } ); function fbBrowse(path) { - jQuery("#fileContent").fadeOut(); + $("#fileContent").fadeOut(); - if (jQuery("#fbCurrentDir")) { - jQuery("#fbCurrentDir").html("Loading ..."); + if ($("#fbCurrentDir")) { + $("#fbCurrentDir").html("Loading ..."); } - jQuery.ajax( + $.ajax( "/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"), { type: "get", complete: fbComplete } ); @@ -24,20 +24,20 @@ function fbBrowse(path) { } function fbComplete(req) { - jQuery("#fbBrowser").html(req.responseText); + $("#fbBrowser").html(req.responseText); var actions = { fbHome: function() { fbBrowse("/"); }, - fbClose: function() { jQuery("#fbBrowser").fadeOut(750); }, + fbClose: function() { $("#fbBrowser").fadeOut(750); }, fbDir: function() { fbBrowse(this.id); }, - fbFile: function() { jQuery("#fbTarget").val(this.id); } + fbFile: function() { $("#fbTarget").val(this.id); } } for (var type in actions) { - jQuery("#fbBrowser ." + type).each( + $("#fbBrowser ." + type).each( function() { - jQuery(this).click(actions[type]); - jQuery(this).css("cursor","pointer"); + $(this).click(actions[type]); + $(this).css("cursor","pointer"); } ); } diff --git a/src/usr/local/www/filebrowser/browser.php b/src/usr/local/www/filebrowser/browser.php index 30876aa..c048187 100644 --- a/src/usr/local/www/filebrowser/browser.php +++ b/src/usr/local/www/filebrowser/browser.php @@ -46,11 +46,11 @@ if (is_file($path)) { @@ -82,7 +82,7 @@ foreach ($dirs as $dir): "; + $savebutton = ""; } echo << 0) {\n"; - echo "\t\t\tjQuery('input[name=\"{$enablefield}\"]').prop('disabled',true);\n"; + echo "\t\tif ($('input[name=\"{$enablefield}\"]').length > 0) {\n"; + echo "\t\t\t$('input[name=\"{$enablefield}\"]').prop('disabled',true);\n"; echo "\t\t}\n"; } } if (isset($field['checkenablefields'])) { foreach (explode(',', $field['checkenablefields']) as $checkenablefield) { - echo "\t\tif (jQuery('input[name=\"{$checkenablefield}\"]').length > 0) {\n"; - echo "\t\t\tjQuery('input[name=\"{$checkenablefield}\"]').prop('checked',true);\n"; + echo "\t\tif ($('input[name=\"{$checkenablefield}\"]').length > 0) {\n"; + echo "\t\t\t$('input[name=\"{$checkenablefield}\"]').prop('checked',true);\n"; echo "\t\t}\n"; } } @@ -1555,16 +1555,16 @@ if ($pkg['fields']['field'] != "") { ?> if (isset($field['enablefields'])) { foreach (explode(',', $field['enablefields']) as $enablefield) { - echo "\t\tif (jQuery('input[name=\"{$enablefield}\"]').length > 0) {\n"; - echo "\t\t\tjQuery('input[name=\"{$enablefield}\"]').prop('disabled',false);\n"; + echo "\t\tif ($('input[name=\"{$enablefield}\"]').length > 0) {\n"; + echo "\t\t\t$('input[name=\"{$enablefield}\"]').prop('disabled',false);\n"; echo "\t\t}\n"; } } if (isset($field['checkenablefields'])) { foreach (explode(',', $field['checkenablefields']) as $checkenablefield) { - echo "\t\tif (jQuery('input[name=\"{$checkenablefield}\"]').length > 0) {\n"; - echo "\t\t\tjQuery('input[name=\"{$checkenablefield}\"]').prop('checked',false);\n"; + echo "\t\tif ($('input[name=\"{$checkenablefield}\"]').length > 0) {\n"; + echo "\t\t\t$('input[name=\"{$checkenablefield}\"]').prop('checked',false);\n"; echo "\t\t}\n"; } } diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php index e964442..2a2f008 100644 --- a/src/usr/local/www/status_logs_filter.php +++ b/src/usr/local/www/status_logs_filter.php @@ -398,7 +398,7 @@ function resolve_ip_callback(transport) { var resolve_class = htmlspecialchars(response.resolve_ip.replace(/[.:]/g, '-')); var resolve_text = '
' + htmlspecialchars(response.resolve_text) + '<\/small>'; - jQuery('span.RESOLVE-' + resolve_class).html(resolve_text); + $('span.RESOLVE-' + resolve_class).html(resolve_text); } // From http://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php index b4be38a..92e95dc 100755 --- a/src/usr/local/www/status_logs_filter_dynamic.php +++ b/src/usr/local/www/status_logs_filter_dynamic.php @@ -322,7 +322,7 @@ function update_table_rows(data) { data = data.slice(startat, data.length); - var rows = jQuery('#filter-log-entries>tr'); + var rows = $('#filter-log-entries>tr'); // Number of rows to move by var move = rows.length + data.length - nentries; @@ -333,38 +333,38 @@ function update_table_rows(data) { if (isReverse == false) { for (var i = move; i < rows.length; i++) { - jQuery(rows[i - move]).html(jQuery(rows[i]).html()); + $(rows[i - move]).html($(rows[i]).html()); } - var tbody = jQuery('#filter-log-entries'); + var tbody = $('#filter-log-entries'); for (var i = 0; i < data.length; i++) { var rowIndex = rows.length - move + i; if (rowIndex < rows.length) { - jQuery(rows[rowIndex]).html(data[i]); + $(rows[rowIndex]).html(data[i]); } else { - jQuery(tbody).append('
' + data[i] + ''); + $(tbody).append('' + data[i] + ''); } } } else { for (var i = rows.length - 1; i >= move; i--) { - jQuery(rows[i]).html(jQuery(rows[i - move]).html()); + $(rows[i]).html($(rows[i - move]).html()); } - var tbody = jQuery('#filter-log-entries'); + var tbody = $('#filter-log-entries'); for (var i = 0; i < data.length; i++) { var rowIndex = move - 1 - i; if (rowIndex >= 0) { - jQuery(rows[rowIndex]).html(data[i]); + $(rows[rowIndex]).html(data[i]); } else { - jQuery(tbody).prepend('' + data[i] + ''); + $(tbody).prepend('' + data[i] + ''); } } } // Much easier to go through each of the rows once they've all be added. - rows = jQuery('#filter-log-entries>tr'); + rows = $('#filter-log-entries>tr'); for (var i = 0; i < rows.length; i++) { rows[i].className = i % 2 == 0 ? 'listMRodd' : 'listMReven'; } diff --git a/src/usr/local/www/status_openvpn.php b/src/usr/local/www/status_openvpn.php index fe70a47..d958a67 100644 --- a/src/usr/local/www/status_openvpn.php +++ b/src/usr/local/www/status_openvpn.php @@ -96,14 +96,14 @@ include("head.inc"); ?> //" + "?action=kill&port=" + mport + "&remipp=" + remipp, { type: "get", complete: killComplete } @@ -117,8 +117,8 @@ include("head.inc"); ?> return; } - jQuery('tr[name="r:' + values[1] + ":" + values[2] + '"]').each( - function(index,row) { jQuery(row).fadeOut(1000); } + $('tr[name="r:' + values[1] + ":" + values[2] + '"]').each( + function(index,row) { $(row).fadeOut(1000); } ); } //]]> diff --git a/src/usr/local/www/status_queues.php b/src/usr/local/www/status_queues.php index 9568b75..bc27f26 100644 --- a/src/usr/local/www/status_queues.php +++ b/src/usr/local/www/status_queues.php @@ -129,13 +129,13 @@ if ($_REQUEST['getactivity']) { if ($packet_s < 0) { $packet_s = 0; } - $finscript .= "jQuery('#queue{$q->queuename}width').css('width','{$packet_s}%');"; - $finscript .= "jQuery('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');"; - $finscript .= "jQuery('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');"; - $finscript .= "jQuery('#queue{$q->queuename}borrows').val('{$q->borrows}');"; - $finscript .= "jQuery('#queue{$q->queuename}suspends').val('{$q->suspends}');"; - $finscript .= "jQuery('#queue{$q->queuename}drops').val('{$q->drops}');"; - $finscript .= "jQuery('#queue{$q->queuename}length').val('{$q->queuelength}');"; + $finscript .= "$('#queue{$q->queuename}width').css('width','{$packet_s}%');"; + $finscript .= "$('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');"; + $finscript .= "$('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');"; + $finscript .= "$('#queue{$q->queuename}borrows').val('{$q->borrows}');"; + $finscript .= "$('#queue{$q->queuename}suspends').val('{$q->suspends}');"; + $finscript .= "$('#queue{$q->queuename}drops').val('{$q->drops}');"; + $finscript .= "$('#queue{$q->queuename}length').val('{$q->queuelength}');"; } unset($statistics, $altqstats); header("Content-type: text/javascript"); @@ -160,8 +160,8 @@ if (!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) < // @@ -224,11 +224,11 @@ else: ?>
- Home + Home - Close + Close
-
+
 
@@ -149,7 +149,7 @@ foreach ($files as $file):
-
+
 
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 21e96ba..b86a0ba 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -354,7 +354,7 @@ function print_info_box_np_undo($msg, $name = "apply", $value = "Apply changes", $nifty_blackbox = "#000000"; if (!$savebutton) { - $savebutton = "