modules/admin-full: xhr fixes
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 15:23:21 +0000 (15:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 15:23:21 +0000 (15:23 +0000)
modules/admin-full/luasrc/view/admin_network/iface_overview.htm
modules/admin-full/luasrc/view/admin_network/iface_status.htm
modules/admin-full/luasrc/view/admin_network/lease_status.htm
modules/admin-full/luasrc/view/admin_network/wifi_overview.htm
modules/admin-full/luasrc/view/admin_network/wifi_status.htm

index 08bac76b97c0c192b31d5c8f72a4ff32f313c396..f77ee63e651f879d450b07153bad472a6e80b22d 100644 (file)
@@ -66,7 +66,7 @@ $Id$
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
        var arptable = <%=luci.http.write_json(arpcache)%>;
 
-       (function() {
+       var update_status = function() {
                iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(netlist, ","))%>', null,
                        function(x, ifcs)
                        {
@@ -161,11 +161,13 @@ $Id$
                                                }
                                        }
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <fieldset class="cbi-section" style="display:none">
index 34e3dddfd3387c4c3d41bc656d716f9472476fc7..11590e17353ea570f332aa932b2b8a01972cf452 100644 (file)
@@ -2,7 +2,7 @@
 
 <script type="text/javascript"><![CDATA[
        var iwxhr = new XHR();
-       (function() {
+       var update_status = function() {
                iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "iface_status", self.network)%>', null,
                        function(x, ifc)
                        {
                                        else if (d)
                                                d.innerHTML = '<%:Interface not present or not connected yet.%>';
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <table>
index 6f90640cb38a0e5b1be9afe48d5df5611dd7eba5..1d7c916f265058f3a443ec51f1312e76745f4469 100644 (file)
@@ -1,6 +1,6 @@
 <script type="text/javascript"><![CDATA[
        var stxhr = new XHR();
-       (function() {
+       var update_status = function() {
                stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "dhcplease_status")%>', null,
                        function(x, st)
                        {
                                                tb.rows[0].parentNode.appendChild(tr);
                                        }
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <fieldset class="cbi-section">
index d47ad0856c9d23164caa4cdd9fd6dfbd04b07f98..f0d624cc2f8d37bb9b18dcb85e515405ba0a6a43 100644 (file)
@@ -97,7 +97,7 @@ $Id$
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
        var arptable = <%=luci.http.write_json(arpcache)%>;
 
-       (function() {
+       var update_status = function() {
                iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", table.concat(netlist, ","))%>', null,
                        function(x, st)
                        {
@@ -241,11 +241,13 @@ $Id$
                                                        img.src = '<%=resource%>/icons/wifi' + (devup[dev] ? '' : '_disabled') + '.png';
                                        }
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <h2><a id="content" name="content"><%:Wireless Overview%></a></h2>
index e81ff06bdad3afb9167a93e80cb025a2d6b0fa4a..e4ba48277063c6212099227006b7b3f00680b4fd 100644 (file)
@@ -2,7 +2,7 @@
 
 <script type="text/javascript"><![CDATA[
        var iwxhr = new XHR();
-       (function() {
+       var update_status = function() {
                iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null,
                        function(x, iw)
                        {
                                        else if (d)
                                                d.innerHTML = '<%:Wireless is disabled or not associated%>';
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <table>