From 9a3ec939f939cb350a549dca1510c12988398ccc Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 23 Jun 2015 13:13:07 +0545 Subject: Standardize widget iform and submit names The log and picture widgets were both using "iforma" and "submita". Actually it did not break anything because it was only the form name repeated, not id. And nothing was using these names. Traffic Graphs widget was using just "iform". That is a bit dangerous for the future. I got tricked when cut-pasting some code to make some settings options for the Gateways widget. I kept "iform" and then wondered for a while why my Traffic Graphs widget show-hide settings would not save. There was traffic graph JS that referred to just "iform" and that started modifying the "iform" in my new Gateways widget code. Rather than having names "iforma", "iformb"... "submita", "submitb"... it seems much less risk of accidental duplication if these are named like: name_of_widget_iform name_of_widget_submit I don't think there is any user-visible bug in 2.2.* - so this standardization could just go into 2.3 --- usr/local/www/widgets/javascript/traffic_graph.js | 4 ++-- usr/local/www/widgets/widgets/log.widget.php | 4 ++-- usr/local/www/widgets/widgets/picture.widget.php | 4 ++-- usr/local/www/widgets/widgets/rss.widget.php | 4 ++-- usr/local/www/widgets/widgets/services_status.widget.php | 4 ++-- usr/local/www/widgets/widgets/thermal_sensors.widget.php | 2 +- usr/local/www/widgets/widgets/traffic_graphs.widget.php | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/widgets/javascript/traffic_graph.js b/usr/local/www/widgets/javascript/traffic_graph.js index 83fc481..66a70f5 100644 --- a/usr/local/www/widgets/javascript/traffic_graph.js +++ b/usr/local/www/widgets/javascript/traffic_graph.js @@ -12,7 +12,7 @@ function trafficshowDiv(incDiv,swapButtons) { textlink = d.getElementById(selectIntLink); textlink.style.display = "none"; } - document.iform["shown[" + incDiv + "]"].value = "show"; + document.traffic_graphs_widget_iform["shown[" + incDiv + "]"].value = "show"; } function trafficminimizeDiv(incDiv,swapButtons) { @@ -29,6 +29,6 @@ function trafficminimizeDiv(incDiv,swapButtons) { textlink = d.getElementById(selectIntLink); textlink.style.display = "none"; } - document.iform["shown[" + incDiv + "]"].value = "hide"; + document.traffic_graphs_widget_iform["shown[" + incDiv + "]"].value = "hide"; } diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php index 47a522c..45205a4 100644 --- a/usr/local/www/widgets/widgets/log.widget.php +++ b/usr/local/www/widgets/widgets/log.widget.php @@ -162,7 +162,7 @@ function format_log_line(row) { diff --git a/usr/local/www/widgets/widgets/picture.widget.php b/usr/local/www/widgets/widgets/picture.widget.php index 681634a..02a002a 100644 --- a/usr/local/www/widgets/widgets/picture.widget.php +++ b/usr/local/www/widgets/widgets/picture.widget.php @@ -74,9 +74,9 @@ if ($_POST) { diff --git a/usr/local/www/widgets/widgets/rss.widget.php b/usr/local/www/widgets/widgets/rss.widget.php index cfe77a3..0850039 100644 --- a/usr/local/www/widgets/widgets/rss.widget.php +++ b/usr/local/www/widgets/widgets/rss.widget.php @@ -89,7 +89,7 @@ if ($config['widgets']['rssfeed']) {