Repository: cordova-docs
Updated Branches:
  refs/heads/master b3ffbe62b -> 187a4fe99


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/187a4fe9/docs/it/3.5.0/cordova/events/events.batterystatus.md
----------------------------------------------------------------------
diff --git a/docs/it/3.5.0/cordova/events/events.batterystatus.md 
b/docs/it/3.5.0/cordova/events/events.batterystatus.md
new file mode 100644
index 0000000..4efb7f6
--- /dev/null
+++ b/docs/it/3.5.0/cordova/events/events.batterystatus.md
@@ -0,0 +1,90 @@
+---
+
+license: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+    
+         Unless required by applicable law or agreed to in writing,
+         software distributed under the License is distributed on an
+         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+         KIND, either express or implied.  See the License for the
+         specific language governing permissions and limitations
+    
+
+   under the License.
+---
+
+# batterystatus
+
+Quando c'è un cambiamento di stato della batteria, viene generato l'evento.
+
+    window.addEventListener("batterystatus", yourCallbackFunction, false);
+    
+
+## Dettagli
+
+Questo evento viene generato quando la percentuale di carica della batteria 
cambia almeno l'1 per cento, o se il dispositivo è collegato o scollegato.
+
+Il gestore di stato della batteria viene passato un oggetto che contiene due 
proprietà:
+
+*   **livello**: la percentuale di carica della batteria (0-100). *(Numero)*
+
+*   **isPlugged**: un valore booleano che indica se il dispositivo è 
collegato poll *(Boolean)*
+
+Applicazioni in genere è necessario utilizzare `window.addEventListener` per 
fissare un listener di eventi una volta il `deviceready` evento incendi.
+
+## Piattaforme supportate
+
+*   iOS
+*   Android
+*   BlackBerry WebWorks (OS 5.0 e superiori)
+*   Windows Phone 7 e 8
+*   Tizen
+
+## Windows Phone 7 e 8 stranezze
+
+Windows Phone 7 non fornisce le API native per determinare il livello della 
batteria, così la `level` proprietà non è disponibile. Il `isPlugged` 
parametro *è* supportato.
+
+## Esempio rapido
+
+    window.addEventListener("batterystatus", onBatteryStatus, false);
+    
+    function onBatteryStatus(info) {
+        // Handle the online event
+        console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
+    }
+    
+
+## Esempio completo
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Device Ready Example</title>
+    
+        <script type="text/javascript" charset="utf-8" 
src="cordova.js"></script>
+        <script type="text/javascript" charset="utf-8">
+    
+        // Wait for device API libraries to load
+        //
+        function onLoad() {
+            document.addEventListener("deviceready", onDeviceReady, false);
+        }
+    
+        // device APIs are available
+        //
+        function onDeviceReady() {
+            window.addEventListener("batterystatus", onBatteryStatus, false);
+        }
+    
+        // Handle the batterystatus event
+        //
+        function onBatteryStatus(info) {
+            console.log("Level: " + info.level + " isPlugged: " + 
info.isPlugged);
+        }
+    
+        </script>
+      </head>
+      <body onload="onLoad()">
+      </body>
+    </html>
\ No newline at end of file

Reply via email to