2009/dap/system-info Overview.html,1.76,1.77

Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv6747

Modified Files:
	Overview.html 
Log Message:
add a new function to check if a property is available on a given user agent


Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- Overview.html	15 Feb 2010 13:50:03 -0000	1.76
+++ Overview.html	15 Feb 2010 14:27:00 -0000	1.77
@@ -232,8 +232,7 @@
             <dl class="parameters">
               <dt>DOMString propertyId</dt>
               <dd>The URI or name of the property to
-              retrieve. The URI of a property is the concatenation of
-              the string</dd>
+              retrieve.</dd>
 
 
               <dt>SuccessCB successCallback</dt>
@@ -315,9 +314,22 @@
               <dd>function called when an error occurred while modifying the property</dd>
             </dl>
           </dd>
+          <dt>boolean has()</dt>
+          <dd>
+            This function is used to determine if the user agent
+            supports a specific property, whose name or URI is passed
+            as a parameter.  It MUST return <code>true</code> if the
+            user agent is able to report the value of a property, and
+            <code>false</code> otherwise.
+            <dl class="parameters">
+              <dt>DOMString propertyId</dt>
+              <dd>The URI or the name of the property to check for.</dd>
+            </dl>
+          </dd>
+          
         </dl>
 
-        <p>All functions return a <a>PendingOp</a> object, defined in [[!CORE-DEVICE]], which has a <a>cancel</a> function allowing the asynchronous operation to be interrupted.</p>
+        <p>All functions except <a>has</a> return a <a>PendingOp</a> object, defined in [[!CORE-DEVICE]], which has a <a>cancel</a> function allowing the asynchronous operation to be interrupted.</p>
 
         <section>
           <h2>Callback interfaces</h2>
@@ -443,7 +455,8 @@
           <h4>ECMAScript Example</h4>
           <pre class="sh_javascript example">// Alert the user when the power level is below 20%
 
-navigator.system.watch("Power",success,null,{lowThreshold:0.2});
+if (navigator.system.has("Power"))
+  navigator.system.watch("Power",success,null,{lowThreshold:0.2});
 
 function success(power) {
   alert("Low battery level: "+power.level);

Received on Monday, 15 February 2010 14:27:03 UTC