From: hyungsun.ryu Date: Tue, 14 Mar 2017 06:27:37 +0000 (+0900) Subject: [webdeviceAPI] Remove unsupported API guides. X-Git-Tag: GitHub/PR#40/tizen-studio~197^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67c4d8a0f5fd83445ae18578f09450778a7b5bf5;p=sdk%2Fonline-doc.git [webdeviceAPI] Remove unsupported API guides. Tizen doesn't support |chargingTime| and |dischargingTime| API of Battery Status. Hence, guides about the APIs have to be removed. Change-Id: I0f82d65a4996d3a95edf9dab823154fca8ef099a Signed-off-by: hyungsun.ryu --- diff --git a/org.tizen.guides/html/images/changing_batterystatus.png b/org.tizen.guides/html/images/changing_batterystatus.png index 9b1f645..870271a 100644 Binary files a/org.tizen.guides/html/images/changing_batterystatus.png and b/org.tizen.guides/html/images/changing_batterystatus.png differ diff --git a/org.tizen.guides/html/images/charging_battery.png b/org.tizen.guides/html/images/charging_battery.png index 98a4555..d2d2a46 100644 Binary files a/org.tizen.guides/html/images/charging_battery.png and b/org.tizen.guides/html/images/charging_battery.png differ diff --git a/org.tizen.guides/html/web/w3c/device/battery_w.htm b/org.tizen.guides/html/web/w3c/device/battery_w.htm index fbde55b..f583213 100644 --- a/org.tizen.guides/html/web/w3c/device/battery_w.htm +++ b/org.tizen.guides/html/web/w3c/device/battery_w.htm @@ -71,8 +71,6 @@

Define the elements used to display the battery status information on the screen:

 <div>charging: <span id="charging"></span></div>
-<div>chargingTime: <span id="chargingTime"></span></div>
-<div>dischargingTime: <span id="dischargingTime"></span></div>
 <div>level: <span id="level"></span></div>
 
@@ -100,14 +98,6 @@          document.querySelector('#charging').textContent =             battery.charging ? 'charging' : 'not charging'; -         /* Battery charging time: seconds (for example, 3600) or Infinity */ -         document.querySelector('#chargingTime').textContent = -            battery.chargingTime / 60; - -         /* Battery life: seconds (for example, 3600) or Infinity */ -         document.querySelector('#dischargingTime').textContent = -            battery.dischargingTime / 60; -          /* Battery.level: between 0 and 1 (for example, 0.50) */          document.querySelector('#level').textContent =             Math.floor(battery.level * 100) + '%'; @@ -159,10 +149,6 @@    /* Detects changes in the battery charging status */    battery.addEventListener('chargingchange', getBatteryState); -   /* Detects changes in the battery charging time */ -   battery.addEventListener('chargingtimechange', getBatteryState); -   /* Detects changes in the battery discharging time */ -   battery.addEventListener('dischargingtimechange', getBatteryState);    /* Detects changes in the battery level */    battery.addEventListener('levelchange', getBatteryState); </script> @@ -178,29 +164,11 @@       var message = "";       var charging = battery.charging; -      var chargingTime = getTimeFormat(battery.chargingTime); -      var dischargingTime = getTimeFormat(battery.dischargingTime);       var level = Math.floor(battery.level * 100);       if (charging == false && level < 100)       {          /* Not charging */ -         message = dischargingTime.hour + ":" + dischargingTime.minute + -            " remained."; -         if (battery.dischargingTime == "Infinity") -         { -            message = ""; -         } -      } -      else if (charging && level < 100) -      { -         /* Charging */ -         message = "Charging is complete after " -                   + chargingTime.hour + ":" + chargingTime.minute; -         if (battery.chargingTime == "Infinity") -         { -            message = ""; -         }       }       else if (level == 100)       { @@ -213,22 +181,9 @@       document.querySelector('#progress').value = level;       document.querySelector('#message').textContent = message;    } - -   /* Time is received in seconds, converted to hours and minutes, and returned */ -   function getTimeFormat(time) -   { -      /* Time parameter is second */ -      var tempMinute = time / 60; - -      var hour = parseInt(tempMinute / 60, 10); -      var minute = parseInt(tempMinute % 60, 10); -      minute = minute < 10 ? "0" + minute : minute; - -      return {"hour": hour, "minute": minute}; -   } </script> -

If the battery is not charging, a message is displayed telling you to charge the battery. You can see how much time remains until the battery runs out. In the battery is charging, you can see the time left until it is fully charged.

+

If the battery is not charging, a message is displayed telling you to charge the battery.

You can use a progress bar to display the battery charging level.