W3C home > Mailing lists > Public > public-dap-commits@w3.org > September 2011

2009/dap/docs/battery-status battery-status.js,1.2,1.3

From: Anssi Kostiainen via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 15 Sep 2011 07:45:38 +0000
To: public-dap-commits@w3.org
Message-Id: <E1R46de-000189-5q@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/docs/battery-status
In directory hutz:/tmp/cvs-serv4331

Modified Files:
	battery-status.js 
Log Message:
declare implied globals

Index: battery-status.js
===================================================================
RCS file: /sources/public/2009/dap/docs/battery-status/battery-status.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- battery-status.js	9 Sep 2011 05:06:46 -0000	1.2
+++ battery-status.js	15 Sep 2011 07:45:36 -0000	1.3
@@ -1,17 +1,11 @@
-window.onload = function () {
-  if (!isInputTypeRangeSupported()) {
-    $('warning').innerHTML =
-      'Your browser does not support &lt;input type="range"&gt;, ' +
-      'which means this demo will be crippled.';
-    $('warning').style.display = 'block';
-  }
-  onIsPluggedChange(false);
-};
-
+/*globals $*/
 var _BATTERYLOW_THRESHOLD = 20,
     _BATTERYCRITICAL_THRESHOLD = 10,
     _BATTERY_CHARGING_INTERVAL = 1000,
-    _BATTERY_DEPLETING_INTERVAL = 500;
+    _BATTERY_DEPLETING_INTERVAL = 500,
+    _battery,
+    _battery_charging,
+    _battery_depleting;
 
 function BatteryStatusEventSource() {
   // _battery is a singleton
@@ -22,7 +16,6 @@
 }
 
 BatteryStatusEventSource.prototype = {
-  // should isPlugged be nullable or should the default be true?
   e: { type: '', isPlugged: true, level: null, status: null },
   onbatterystatus: null,
   onbatterylow: null,
@@ -124,4 +117,14 @@
   var i = document.createElement('input');
   i.setAttribute('type', 'range');
   return i.type !== 'text';
-}
\ No newline at end of file
+}
+
+window.onload = function () {
+  if (!isInputTypeRangeSupported()) {
+    $('warning').innerHTML =
+      'Your browser does not support &lt;input type="range"&gt;, ' +
+      'which means this demo will be crippled.';
+    $('warning').style.display = 'block';
+  }
+  onIsPluggedChange(false);
+};
\ No newline at end of file
Received on Thursday, 15 September 2011 07:45:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 15 September 2011 07:45:46 GMT