UNPKG

103 kBHTMLView Raw
1<!DOCTYPE html>
2
3<html lang="en">
4<head>
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width">
7 <title>CrossBrowdy API documentation Namespace: Battery</title>
8
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
13
14 <link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">
15
16</head>
17
18<body style="min-width:800px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
19
20<div class="navbar navbar-default navbar-fixed-top ">
21<div class="container">
22 <div class="navbar-header">
23 <a class="navbar-brand" href="index.html">CrossBrowdy API documentation</a>
24 <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
25 <span class="icon-bar"></span>
26 <span class="icon-bar"></span>
27 <span class="icon-bar"></span>
28 </button>
29 </div>
30 <div class="navbar-collapse collapse" id="topNavigation">
31 <ul class="nav navbar-nav">
32
33 <li class="dropdown">
34 <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
35 <ul class="dropdown-menu inline">
36 <li><a href="CB_Arrays.html">CB_Arrays</a></li><li><a href="CB_AudioDetector.html">CB_AudioDetector</a></li><li><a href="CB_baseSymbols.html">CB_baseSymbols</a></li><li><a href="CB_Client.html">CB_Client</a></li><li><a href="CB_Collisions.html">CB_Collisions</a></li><li><a href="CB_Configuration.html">CB_Configuration</a></li><li><a href="CB_Configuration.CrossBase.html">CB_Configuration.CrossBase</a></li><li><a href="CB_Configuration.CrossBrowdy.html">CB_Configuration.CrossBrowdy</a></li><li><a href="CB_Controllers.html">CB_Controllers</a></li><li><a href="CB_Controllers_Proprietary.html">CB_Controllers_Proprietary</a></li><li><a href="CB_Controllers_Proprietary.WII.html">CB_Controllers_Proprietary.WII</a></li><li><a href="CB_Controllers_Proprietary.WII_U.html">CB_Controllers_Proprietary.WII_U</a></li><li><a href="CB_Device.html">CB_Device</a></li><li><a href="CB_Device.AmbientLight.html">CB_Device.AmbientLight</a></li><li><a href="CB_Device.Battery.html">CB_Device.Battery</a></li><li><a href="CB_Device.Location.html">CB_Device.Location</a></li><li><a href="CB_Device.Motion.html">CB_Device.Motion</a></li><li><a href="CB_Device.Orientation.html">CB_Device.Orientation</a></li><li><a href="CB_Device.Proximity.html">CB_Device.Proximity</a></li><li><a href="CB_Device.Vibration.html">CB_Device.Vibration</a></li><li><a href="CB_Elements.html">CB_Elements</a></li><li><a href="CB_Events.html">CB_Events</a></li><li><a href="CB_Keyboard.html">CB_Keyboard</a></li><li><a href="CB_Keyboard.chars.html">CB_Keyboard.chars</a></li><li><a href="CB_Keyboard.extended.html">CB_Keyboard.extended</a></li><li><a href="CB_Keyboard.keys.html">CB_Keyboard.keys</a></li><li><a href="CB_Modules.html">CB_Modules</a></li><li><a href="CB_Mouse.html">CB_Mouse</a></li><li><a href="CB_Mouse.CursorImage.html">CB_Mouse.CursorImage</a></li><li><a href="CB_Net.html">CB_Net</a></li><li><a href="CB_Net.Fetch.html">CB_Net.Fetch</a></li><li><a href="CB_Net.REST.html">CB_Net.REST</a></li><li><a href="CB_Net.Sockets.html">CB_Net.Sockets</a></li><li><a href="CB_Net.Sockets.SockJS.html">CB_Net.Sockets.SockJS</a></li><li><a href="CB_Net.XHR.html">CB_Net.XHR</a></li><li><a href="CB_Pointer.html">CB_Pointer</a></li><li><a href="CB_Screen.html">CB_Screen</a></li><li><a href="CB_Speaker.html">CB_Speaker</a></li><li><a href="CB_Touch.html">CB_Touch</a></li>
37 </ul>
38 </li>
39
40 <li class="dropdown">
41 <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
42 <ul class="dropdown-menu inline">
43 <li><a href="CB_AudioFile.html">CB_AudioFile</a></li><li><a href="CB_AudioFile_API.AAPI.html">CB_AudioFile_API.AAPI</a></li><li><a href="CB_AudioFile_API.ACMP.html">CB_AudioFile_API.ACMP</a></li><li><a href="CB_AudioFile_API.SM2.html">CB_AudioFile_API.SM2</a></li><li><a href="CB_AudioFile_API.WAAPI.html">CB_AudioFile_API.WAAPI</a></li><li><a href="CB_AudioFileCache.html">CB_AudioFileCache</a></li><li><a href="CB_AudioFileSprites.html">CB_AudioFileSprites</a></li><li><a href="CB_AudioFileSpritesPool.html">CB_AudioFileSpritesPool</a></li><li><a href="CB_Canvas.html">CB_Canvas</a></li><li><a href="CB_GraphicSprites.html">CB_GraphicSprites</a></li><li><a href="CB_GraphicSpritesScene.html">CB_GraphicSpritesScene</a></li>
44 </ul>
45 </li>
46
47 <li class="dropdown">
48 <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
49 <ul class="dropdown-menu inline">
50 <li><a href="global.html#CB_addCredits">CB_addCredits</a></li><li><a href="global.html#CB_BASE_NAME">CB_BASE_NAME</a></li><li><a href="global.html#CB_baseToBase">CB_baseToBase</a></li><li><a href="global.html#CB_baseToInt">CB_baseToInt</a></li><li><a href="global.html#CB_br2nl">CB_br2nl</a></li><li><a href="global.html#CB_brToNl">CB_brToNl</a></li><li><a href="global.html#CB_combineArraysOrObjects">CB_combineArraysOrObjects</a></li><li><a href="global.html#CB_combineAutomatically">CB_combineAutomatically</a></li><li><a href="global.html#CB_combineJSON">CB_combineJSON</a></li><li><a href="global.html#CB_combineURIParameters">CB_combineURIParameters</a></li><li><a href="global.html#CB_combineURLParameters">CB_combineURLParameters</a></li><li><a href="global.html#CB_console">CB_console</a></li><li><a href="global.html#CB_copyObject">CB_copyObject</a></li><li><a href="global.html#CB_countDecimalDigits">CB_countDecimalDigits</a></li><li><a href="global.html#CB_countDecimalPart">CB_countDecimalPart</a></li><li><a href="global.html#CB_countDecimals">CB_countDecimals</a></li><li><a href="global.html#CB_countIntegerDigits">CB_countIntegerDigits</a></li><li><a href="global.html#CB_countIntegerPart">CB_countIntegerPart</a></li><li><a href="global.html#CB_credits">CB_credits</a></li><li><a href="global.html#CB_CREDITS_DEFAULT">CB_CREDITS_DEFAULT</a></li><li><a href="global.html#CB_forceString">CB_forceString</a></li><li><a href="global.html#CB_forEach">CB_forEach</a></li><li><a href="global.html#CB_getBase64StringObject">CB_getBase64StringObject</a></li><li><a href="global.html#CB_getCookie">CB_getCookie</a></li><li><a href="global.html#CB_getDatum">CB_getDatum</a></li><li><a href="global.html#CB_getJSONPropertyValue">CB_getJSONPropertyValue</a></li><li><a href="global.html#CB_getLZStringObject">CB_getLZStringObject</a></li><li><a href="global.html#CB_getValueIndex">CB_getValueIndex</a></li><li><a href="global.html#CB_getValuePath">CB_getValuePath</a></li><li><a href="global.html#CB_includeJSFile">CB_includeJSFile</a></li><li><a href="global.html#CB_indexOf">CB_indexOf</a></li><li><a href="global.html#CB_init">CB_init</a></li><li><a href="global.html#CB_intToBase">CB_intToBase</a></li><li><a href="global.html#CB_isArray">CB_isArray</a></li><li><a href="global.html#CB_isEmail">CB_isEmail</a></li><li><a href="global.html#CB_isFileLocal">CB_isFileLocal</a></li><li><a href="global.html#CB_isString">CB_isString</a></li><li><a href="global.html#CB_lastIndexOf">CB_lastIndexOf</a></li><li><a href="global.html#CB_ltrim">CB_ltrim</a></li><li><a href="global.html#CB_NAME">CB_NAME</a></li><li><a href="global.html#CB_nl2br">CB_nl2br</a></li><li><a href="global.html#CB_nlToBr">CB_nlToBr</a></li><li><a href="global.html#CB_numberFormat">CB_numberFormat</a></li><li><a href="global.html#CB_numberOfDecimalDigits">CB_numberOfDecimalDigits</a></li><li><a href="global.html#CB_numberOfDecimals">CB_numberOfDecimals</a></li><li><a href="global.html#CB_numberOfIntegerDigits">CB_numberOfIntegerDigits</a></li><li><a href="global.html#CB_OPTIONS">CB_OPTIONS</a></li><li><a href="global.html#CB_parseJSON">CB_parseJSON</a></li><li><a href="global.html#CB_parseString">CB_parseString</a></li><li><a href="global.html#CB_regularExpressionString">CB_regularExpressionString</a></li><li><a href="global.html#CB_renderString">CB_renderString</a></li><li><a href="global.html#CB_replaceAll">CB_replaceAll</a></li><li><a href="global.html#CB_rtrim">CB_rtrim</a></li><li><a href="global.html#CB_scriptPath">CB_scriptPath</a></li><li><a href="global.html#CB_scriptPathCalculate">CB_scriptPathCalculate</a></li><li><a href="global.html#CB_setCookie">CB_setCookie</a></li><li><a href="global.html#CB_setDatum">CB_setDatum</a></li><li><a href="global.html#CB_sizeof">CB_sizeof</a></li><li><a href="global.html#CB_sizeOf">CB_sizeOf</a></li><li><a href="global.html#CB_stringifyJSON">CB_stringifyJSON</a></li><li><a href="global.html#CB_symmetricCall">CB_symmetricCall</a></li><li><a href="global.html#CB_symmetricCallClear">CB_symmetricCallClear</a></li><li><a href="global.html#CB_this">CB_this</a></li><li><a href="global.html#CB_trim">CB_trim</a></li><li><a href="global.html#CB_VERSION">CB_VERSION</a></li>
51 </ul>
52 </li>
53
54 </ul>
55
56 <div class="col-sm-3 col-md-3">
57 <form class="navbar-form" role="search">
58 <div class="input-group">
59 <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
60 <div class="input-group-btn">
61 <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
62 </div>
63 </div>
64 </form>
65 </div>
66
67 </div>
68
69</div>
70</div>
71
72
73<div class="container" id="toc-content" style="width:100%;">
74<div class="row" style="width:100%;">
75
76
77 <div class="col-md-8" style="width:85%;">
78
79 <div id="main">
80
81
82
83 <h1 class="page-title">Namespace: Battery</h1>
84
85<section>
86
87<header>
88
89 <h2>
90 <span class="ancestors"><a href="CB_Device.html">CB_Device</a>.</span>
91
92 Battery
93 </h2>
94
95
96</header>
97
98
99<article>
100 <div class="container-overview">
101
102
103 <div class="description"><p>Static class to manage the device's battery. It will return itself if it is tried to be instantiated.</p></div>
104
105
106
107<dl class="details">
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
138 <dd class="tag-source">
139 <ul class="dummy">
140 <li>
141 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
142 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-746">line 746</a>
143 </li>
144 </ul>
145 </dd>
146
147
148
149
150
151
152
153 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
154 <dd class="tag-todo">
155 <ul>
156 <li>Normalize more differences between web clients.</li>
157 </ul>
158 </dd>
159
160</dl>
161
162
163
164
165 </div>
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180 <h3 class="subsection-title">Methods</h3>
181
182 <dl>
183
184<hr>
185<dt>
186 <h4 class="name" id=".cordova_onChange"><span class="type-signature">&lt;static> </span>cordova_onChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"></span></h4>
187
188
189</dt>
190<dd>
191
192
193 <div class="description">
194 <p>Sets a function to execute when the &quot;batterystatus&quot; event of the battery is fired or removes it. Using the <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a>.</p>
195 </div>
196
197
198
199
200
201
202
203
204 <h5>Parameters:</h5>
205
206
207<table class="params table table-striped">
208 <thead>
209 <tr>
210
211 <th style="width:12%; min-width:110px;">Name</th>
212
213
214 <th style="width:12%; min-width:110px;">Type</th>
215
216
217 <th style="width:12%; min-width:110px;">Argument</th>
218
219
220
221 <th style="width:12%; min-width:110px;">Default</th>
222
223
224 <th class="last" style="min-width:310px;">Description</th>
225 </tr>
226 </thead>
227
228 <tbody>
229
230
231 <tr>
232
233 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
234
235
236 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
237
238
239<span class="param-type">function</span>
240|
241
242<span class="param-type">null</span>
243
244
245
246
247 </td>
248
249
250 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
251
252
253
254
255
256 </td>
257
258
259
260 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
261
262 </td>
263
264
265 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://github.com/apache/cordova-plugin-battery-status">https://github.com/apache/cordova-plugin-battery-status</a>. If a null value is used, the event will be removed.</p></td>
266 </tr>
267
268
269
270 <tr>
271
272 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
273
274
275 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
276
277
278<span class="param-type">boolean</span>
279
280
281
282
283 </td>
284
285
286 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
287
288 &lt;optional><br>
289
290
291
292
293
294 </td>
295
296
297
298 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
299
300 true
301
302 </td>
303
304
305 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
306 </tr>
307
308
309
310 <tr>
311
312 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
313
314
315 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
316
317
318<span class="param-type">float</span>
319
320
321
322
323 </td>
324
325
326 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
327
328 &lt;optional><br>
329
330
331
332
333
334 </td>
335
336
337
338 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
339
340 false
341
342 </td>
343
344
345 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
346 </tr>
347
348
349 </tbody>
350</table>
351
352
353
354
355<dl class="details">
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
386 <dd class="tag-source">
387 <ul class="dummy">
388 <li>
389 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
390 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-976">line 976</a>
391 </li>
392 </ul>
393 </dd>
394
395
396
397
398
399
400
401</dl>
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417</dd>
418
419
420
421<hr>
422<dt>
423 <h4 class="name" id=".cordova_onCritical"><span class="type-signature">&lt;static> </span>cordova_onCritical<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"></span></h4>
424
425
426</dt>
427<dd>
428
429
430 <div class="description">
431 <p>Sets a function to execute when the &quot;batterycritical&quot; event of the battery is fired or removes it. Using the <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a>.</p>
432 </div>
433
434
435
436
437
438
439
440
441 <h5>Parameters:</h5>
442
443
444<table class="params table table-striped">
445 <thead>
446 <tr>
447
448 <th style="width:12%; min-width:110px;">Name</th>
449
450
451 <th style="width:12%; min-width:110px;">Type</th>
452
453
454 <th style="width:12%; min-width:110px;">Argument</th>
455
456
457
458 <th style="width:12%; min-width:110px;">Default</th>
459
460
461 <th class="last" style="min-width:310px;">Description</th>
462 </tr>
463 </thead>
464
465 <tbody>
466
467
468 <tr>
469
470 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
471
472
473 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
474
475
476<span class="param-type">function</span>
477|
478
479<span class="param-type">null</span>
480
481
482
483
484 </td>
485
486
487 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
488
489
490
491
492
493 </td>
494
495
496
497 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
498
499 </td>
500
501
502 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://github.com/apache/cordova-plugin-battery-status">https://github.com/apache/cordova-plugin-battery-status</a>. If a null value is used, the event will be removed.</p></td>
503 </tr>
504
505
506
507 <tr>
508
509 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
510
511
512 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
513
514
515<span class="param-type">boolean</span>
516
517
518
519
520 </td>
521
522
523 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
524
525 &lt;optional><br>
526
527
528
529
530
531 </td>
532
533
534
535 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
536
537 true
538
539 </td>
540
541
542 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
543 </tr>
544
545
546
547 <tr>
548
549 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
550
551
552 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
553
554
555<span class="param-type">float</span>
556
557
558
559
560 </td>
561
562
563 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
564
565 &lt;optional><br>
566
567
568
569
570
571 </td>
572
573
574
575 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
576
577 false
578
579 </td>
580
581
582 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
583 </tr>
584
585
586 </tbody>
587</table>
588
589
590
591
592<dl class="details">
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
623 <dd class="tag-source">
624 <ul class="dummy">
625 <li>
626 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
627 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-1002">line 1002</a>
628 </li>
629 </ul>
630 </dd>
631
632
633
634
635
636
637
638</dl>
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654</dd>
655
656
657
658<hr>
659<dt>
660 <h4 class="name" id=".cordova_onLow"><span class="type-signature">&lt;static> </span>cordova_onLow<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"></span></h4>
661
662
663</dt>
664<dd>
665
666
667 <div class="description">
668 <p>Sets a function to execute when the &quot;batterylow&quot; event of the battery is fired or removes it. Using the <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a>.</p>
669 </div>
670
671
672
673
674
675
676
677
678 <h5>Parameters:</h5>
679
680
681<table class="params table table-striped">
682 <thead>
683 <tr>
684
685 <th style="width:12%; min-width:110px;">Name</th>
686
687
688 <th style="width:12%; min-width:110px;">Type</th>
689
690
691 <th style="width:12%; min-width:110px;">Argument</th>
692
693
694
695 <th style="width:12%; min-width:110px;">Default</th>
696
697
698 <th class="last" style="min-width:310px;">Description</th>
699 </tr>
700 </thead>
701
702 <tbody>
703
704
705 <tr>
706
707 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
708
709
710 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
711
712
713<span class="param-type">function</span>
714|
715
716<span class="param-type">null</span>
717
718
719
720
721 </td>
722
723
724 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
725
726
727
728
729
730 </td>
731
732
733
734 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
735
736 </td>
737
738
739 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://github.com/apache/cordova-plugin-battery-status">https://github.com/apache/cordova-plugin-battery-status</a>. If a null value is used, the event will be removed.</p></td>
740 </tr>
741
742
743
744 <tr>
745
746 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
747
748
749 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
750
751
752<span class="param-type">boolean</span>
753
754
755
756
757 </td>
758
759
760 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
761
762 &lt;optional><br>
763
764
765
766
767
768 </td>
769
770
771
772 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
773
774 true
775
776 </td>
777
778
779 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
780 </tr>
781
782
783
784 <tr>
785
786 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
787
788
789 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
790
791
792<span class="param-type">float</span>
793
794
795
796
797 </td>
798
799
800 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
801
802 &lt;optional><br>
803
804
805
806
807
808 </td>
809
810
811
812 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
813
814 false
815
816 </td>
817
818
819 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
820 </tr>
821
822
823 </tbody>
824</table>
825
826
827
828
829<dl class="details">
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
860 <dd class="tag-source">
861 <ul class="dummy">
862 <li>
863 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
864 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-989">line 989</a>
865 </li>
866 </ul>
867 </dd>
868
869
870
871
872
873
874
875</dl>
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891</dd>
892
893
894
895<hr>
896<dt>
897 <h4 class="name" id=".get"><span class="type-signature">&lt;static> </span>get<span class="signature">( [callbackOk] [, chargingOnFail] [, levelOnFail] [, chargingTimeOnFail] [, dischargingTimeOnFail])</span><span class="type-signature"> &rarr; {Object|Promise}</span></h4>
898
899
900</dt>
901<dd>
902
903
904 <div class="description">
905 <p>Gets the battery object (<a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a>) using the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) if available or falling back to <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a> emulating the object if possible or a fake object otherwise. It could be synchronous or asynchronous depending on the client.<br> <br /><br> When the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available, the generated object will always contain null values for the &quot;onchargingchange&quot;, &quot;onchargingtimechage&quot;, &quot;ondischargingtimechange&quot; and &quot;onlevelchange&quot; properties. The &quot;charging&quot; and &quot;level&quot; properties will be tried to be calculated by using <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a> if possible.<br> <br /><br> The return will be synchronous only when <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is not available. The best practice is to ignore the immediate return value and just trust the first parameter passed to the &quot;callbackOk&quot; function once it is called, since this one will be the final battery object (real or fake).</p>
906 </div>
907
908
909
910
911
912
913
914
915 <h5>Parameters:</h5>
916
917
918<table class="params table table-striped">
919 <thead>
920 <tr>
921
922 <th style="width:12%; min-width:110px;">Name</th>
923
924
925 <th style="width:12%; min-width:110px;">Type</th>
926
927
928 <th style="width:12%; min-width:110px;">Argument</th>
929
930
931
932
933 <th class="last" style="min-width:310px;">Description</th>
934 </tr>
935 </thead>
936
937 <tbody>
938
939
940 <tr>
941
942 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>callbackOk</code></td>
943
944
945 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
946
947
948<span class="param-type">function</span>
949
950
951
952
953 </td>
954
955
956 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
957
958 &lt;optional><br>
959
960
961
962
963
964 </td>
965
966
967
968
969 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The callback function that will be called once the final battery object (real or fake one) is gotten (passed as the first and unique parameter). Highly recommended since it is the unique way to always get the final battery object (due the fact that some clients will execute the function asynchronously).</p></td>
970 </tr>
971
972
973
974 <tr>
975
976 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>chargingOnFail</code></td>
977
978
979 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
980
981
982<span class="param-type">boolean</span>
983
984
985
986
987 </td>
988
989
990 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
991
992 &lt;optional><br>
993
994
995
996
997
998 </td>
999
1000
1001
1002
1003 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value for the &quot;charging&quot; property of the fake battery object when neither the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) nor <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a> are available. It should follow the same rules as the real property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1004 </tr>
1005
1006
1007
1008 <tr>
1009
1010 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>levelOnFail</code></td>
1011
1012
1013 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1014
1015
1016<span class="param-type">float</span>
1017
1018
1019
1020
1021 </td>
1022
1023
1024 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1025
1026 &lt;optional><br>
1027
1028
1029
1030
1031
1032 </td>
1033
1034
1035
1036
1037 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value for the &quot;level&quot; property of the fake battery object when neither the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) nor <a href="https://github.com/apache/cordova-plugin-battery-status">Apache Cordova's Battery Status plugin</a> are available. It should follow the same rules as the real property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1038 </tr>
1039
1040
1041
1042 <tr>
1043
1044 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>chargingTimeOnFail</code></td>
1045
1046
1047 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1048
1049
1050<span class="param-type">integer</span>
1051
1052
1053
1054
1055 </td>
1056
1057
1058 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1059
1060 &lt;optional><br>
1061
1062
1063
1064
1065
1066 </td>
1067
1068
1069
1070
1071 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value for the &quot;chargingTime&quot; property of the fake battery object when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. It should follow the same rules as the real property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1072 </tr>
1073
1074
1075
1076 <tr>
1077
1078 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>dischargingTimeOnFail</code></td>
1079
1080
1081 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1082
1083
1084<span class="param-type">integer</span>
1085
1086
1087
1088
1089 </td>
1090
1091
1092 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1093
1094 &lt;optional><br>
1095
1096
1097
1098
1099
1100 </td>
1101
1102
1103
1104
1105 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value for the &quot;dischargingTime&quot; property of the fake battery object when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. It should follow the same rules as the real property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1106 </tr>
1107
1108
1109 </tbody>
1110</table>
1111
1112
1113
1114
1115<dl class="details">
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1146 <dd class="tag-source">
1147 <ul class="dummy">
1148 <li>
1149 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1150 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-785">line 785</a>
1151 </li>
1152 </ul>
1153 </dd>
1154
1155
1156
1157
1158
1159
1160
1161</dl>
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175 <h5>Returns:</h5>
1176
1177
1178<div class="param-desc">
1179 <p>Returns the battery object (fake or real) synchronously only when the native <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is not available. Otherwise it returns a <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> (the result of calling <a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery">navigator.getBattery()</a>.then(callbackOk)). It is highly recommended to ignore this returned value.</p>
1180</div>
1181
1182
1183
1184<dl>
1185 <dt>
1186 Type
1187 </dt>
1188 <dd>
1189
1190<span class="param-type">Object</span>
1191|
1192
1193<span class="param-type">Promise</span>
1194
1195
1196
1197 </dd>
1198</dl>
1199
1200
1201
1202
1203
1204</dd>
1205
1206
1207
1208<hr>
1209<dt>
1210 <h4 class="name" id=".getChargingTime"><span class="type-signature">&lt;static> </span>getChargingTime<span class="signature">( [callbackOk] [, valueOnFail])</span><span class="type-signature"> &rarr; {integer|Promise}</span></h4>
1211
1212
1213</dt>
1214<dd>
1215
1216
1217 <div class="description">
1218 <p>Returns the time (in seconds) that the battery needs to be completely charged. Using the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function internally. It could be synchronous or asynchronous depending on the client.<br> <br /><br> The return will be synchronous only sometimes (when it is asynchronous it will just return a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>), following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally. The best practice is to ignore the immediate return value and just trust the first parameter passed to the &quot;callbackOk&quot; function once it is called, since this one will be the final value that we want to get (real or fake).</p>
1219 </div>
1220
1221
1222
1223
1224
1225
1226
1227
1228 <h5>Parameters:</h5>
1229
1230
1231<table class="params table table-striped">
1232 <thead>
1233 <tr>
1234
1235 <th style="width:12%; min-width:110px;">Name</th>
1236
1237
1238 <th style="width:12%; min-width:110px;">Type</th>
1239
1240
1241 <th style="width:12%; min-width:110px;">Argument</th>
1242
1243
1244
1245
1246 <th class="last" style="min-width:310px;">Description</th>
1247 </tr>
1248 </thead>
1249
1250 <tbody>
1251
1252
1253 <tr>
1254
1255 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>callbackOk</code></td>
1256
1257
1258 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1259
1260
1261<span class="param-type">function</span>
1262
1263
1264
1265
1266 </td>
1267
1268
1269 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1270
1271 &lt;optional><br>
1272
1273
1274
1275
1276
1277 </td>
1278
1279
1280
1281
1282 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The callback function that will be called once the final value (real or fake one) is gotten (passed as the first and unique parameter). Highly recommended since it is the unique way to always get the final value (due the fact that some clients will execute the function asynchronously).</p></td>
1283 </tr>
1284
1285
1286
1287 <tr>
1288
1289 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>valueOnFail</code></td>
1290
1291
1292 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1293
1294
1295<span class="param-type">integer</span>
1296
1297
1298
1299
1300 </td>
1301
1302
1303 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1304
1305 &lt;optional><br>
1306
1307
1308
1309
1310
1311 </td>
1312
1313
1314
1315
1316 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value to use when it fails getting the real one. It should follow the same rules as the real &quot;chargingTime&quot; property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1317 </tr>
1318
1319
1320 </tbody>
1321</table>
1322
1323
1324
1325
1326<dl class="details">
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1357 <dd class="tag-source">
1358 <ul class="dummy">
1359 <li>
1360 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1361 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-858">line 858</a>
1362 </li>
1363 </ul>
1364 </dd>
1365
1366
1367
1368
1369
1370
1371
1372</dl>
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386 <h5>Returns:</h5>
1387
1388
1389<div class="param-desc">
1390 <p>Returns the desired value only when the function is executed synchronously (following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally). It is highly recommended to ignore this returned value.</p>
1391</div>
1392
1393
1394
1395<dl>
1396 <dt>
1397 Type
1398 </dt>
1399 <dd>
1400
1401<span class="param-type">integer</span>
1402|
1403
1404<span class="param-type">Promise</span>
1405
1406
1407
1408 </dd>
1409</dl>
1410
1411
1412
1413
1414
1415</dd>
1416
1417
1418
1419<hr>
1420<dt>
1421 <h4 class="name" id=".getDischargingTime"><span class="type-signature">&lt;static> </span>getDischargingTime<span class="signature">( [callbackOk] [, valueOnFail])</span><span class="type-signature"> &rarr; {integer|Promise}</span></h4>
1422
1423
1424</dt>
1425<dd>
1426
1427
1428 <div class="description">
1429 <p>Returns the time (in seconds) that the battery needs to be completely discharged (or when the device will shutdown, depending on the client). Using the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function internally. It could be synchronous or asynchronous depending on the client.<br> <br /><br> The return will be synchronous only sometimes (when it is asynchronous it will just return a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>), following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally. The best practice is to ignore the immediate return value and just trust the first parameter passed to the &quot;callbackOk&quot; function once it is called, since this one will be the final value that we want to get (real or fake).</p>
1430 </div>
1431
1432
1433
1434
1435
1436
1437
1438
1439 <h5>Parameters:</h5>
1440
1441
1442<table class="params table table-striped">
1443 <thead>
1444 <tr>
1445
1446 <th style="width:12%; min-width:110px;">Name</th>
1447
1448
1449 <th style="width:12%; min-width:110px;">Type</th>
1450
1451
1452 <th style="width:12%; min-width:110px;">Argument</th>
1453
1454
1455
1456
1457 <th class="last" style="min-width:310px;">Description</th>
1458 </tr>
1459 </thead>
1460
1461 <tbody>
1462
1463
1464 <tr>
1465
1466 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>callbackOk</code></td>
1467
1468
1469 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1470
1471
1472<span class="param-type">function</span>
1473
1474
1475
1476
1477 </td>
1478
1479
1480 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1481
1482 &lt;optional><br>
1483
1484
1485
1486
1487
1488 </td>
1489
1490
1491
1492
1493 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The callback function that will be called once the final value (real or fake one) is gotten (passed as the first and unique parameter). Highly recommended since it is the unique way to always get the final value (due the fact that some clients will execute the function asynchronously).</p></td>
1494 </tr>
1495
1496
1497
1498 <tr>
1499
1500 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>valueOnFail</code></td>
1501
1502
1503 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1504
1505
1506<span class="param-type">integer</span>
1507
1508
1509
1510
1511 </td>
1512
1513
1514 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1515
1516 &lt;optional><br>
1517
1518
1519
1520
1521
1522 </td>
1523
1524
1525
1526
1527 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value to use when it fails getting the real one. It should follow the same rules as the real &quot;dischargingTime&quot; property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1528 </tr>
1529
1530
1531 </tbody>
1532</table>
1533
1534
1535
1536
1537<dl class="details">
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1568 <dd class="tag-source">
1569 <ul class="dummy">
1570 <li>
1571 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1572 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-875">line 875</a>
1573 </li>
1574 </ul>
1575 </dd>
1576
1577
1578
1579
1580
1581
1582
1583</dl>
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597 <h5>Returns:</h5>
1598
1599
1600<div class="param-desc">
1601 <p>Returns the desired value only when the function is executed synchronously (following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally). It is highly recommended to ignore this returned value.</p>
1602</div>
1603
1604
1605
1606<dl>
1607 <dt>
1608 Type
1609 </dt>
1610 <dd>
1611
1612<span class="param-type">integer</span>
1613|
1614
1615<span class="param-type">Promise</span>
1616
1617
1618
1619 </dd>
1620</dl>
1621
1622
1623
1624
1625
1626</dd>
1627
1628
1629
1630<hr>
1631<dt>
1632 <h4 class="name" id=".getLevel"><span class="type-signature">&lt;static> </span>getLevel<span class="signature">( [callbackOk] [, valueOnFail])</span><span class="type-signature"> &rarr; {float|Promise}</span></h4>
1633
1634
1635</dt>
1636<dd>
1637
1638
1639 <div class="description">
1640 <p>Returns tha current charging level of the battery. Using the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function internally. It could be synchronous or asynchronous depending on the client.<br> <br /><br> The return will be synchronous only sometimes (when it is asynchronous it will just return a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>), following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally. The best practice is to ignore the immediate return value and just trust the first parameter passed to the &quot;callbackOk&quot; function once it is called, since this one will be the final value that we want to get (real or fake).</p>
1641 </div>
1642
1643
1644
1645
1646
1647
1648
1649
1650 <h5>Parameters:</h5>
1651
1652
1653<table class="params table table-striped">
1654 <thead>
1655 <tr>
1656
1657 <th style="width:12%; min-width:110px;">Name</th>
1658
1659
1660 <th style="width:12%; min-width:110px;">Type</th>
1661
1662
1663 <th style="width:12%; min-width:110px;">Argument</th>
1664
1665
1666
1667
1668 <th class="last" style="min-width:310px;">Description</th>
1669 </tr>
1670 </thead>
1671
1672 <tbody>
1673
1674
1675 <tr>
1676
1677 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>callbackOk</code></td>
1678
1679
1680 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1681
1682
1683<span class="param-type">function</span>
1684
1685
1686
1687
1688 </td>
1689
1690
1691 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1692
1693 &lt;optional><br>
1694
1695
1696
1697
1698
1699 </td>
1700
1701
1702
1703
1704 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The callback function that will be called once the final value (real or fake one) is gotten (passed as the first and unique parameter). Highly recommended since it is the unique way to always get the final value (due the fact that some clients will execute the function asynchronously).</p></td>
1705 </tr>
1706
1707
1708
1709 <tr>
1710
1711 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>valueOnFail</code></td>
1712
1713
1714 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1715
1716
1717<span class="param-type">float</span>
1718
1719
1720
1721
1722 </td>
1723
1724
1725 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1726
1727 &lt;optional><br>
1728
1729
1730
1731
1732
1733 </td>
1734
1735
1736
1737
1738 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value to use when it fails getting the real one. It should follow the same rules as the real &quot;level&quot; property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1739 </tr>
1740
1741
1742 </tbody>
1743</table>
1744
1745
1746
1747
1748<dl class="details">
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1779 <dd class="tag-source">
1780 <ul class="dummy">
1781 <li>
1782 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1783 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-841">line 841</a>
1784 </li>
1785 </ul>
1786 </dd>
1787
1788
1789
1790
1791
1792
1793
1794</dl>
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808 <h5>Returns:</h5>
1809
1810
1811<div class="param-desc">
1812 <p>Returns the desired value only when the function is executed synchronously (following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally). It is highly recommended to ignore this returned value.</p>
1813</div>
1814
1815
1816
1817<dl>
1818 <dt>
1819 Type
1820 </dt>
1821 <dd>
1822
1823<span class="param-type">float</span>
1824|
1825
1826<span class="param-type">Promise</span>
1827
1828
1829
1830 </dd>
1831</dl>
1832
1833
1834
1835
1836
1837</dd>
1838
1839
1840
1841<hr>
1842<dt>
1843 <h4 class="name" id=".isCharging"><span class="type-signature">&lt;static> </span>isCharging<span class="signature">( [callbackOk] [, valueOnFail])</span><span class="type-signature"> &rarr; {boolean|Promise}</span></h4>
1844
1845
1846</dt>
1847<dd>
1848
1849
1850 <div class="description">
1851 <p>Returns whether the battery is charging or not. Using the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function internally. It could be synchronous or asynchronous depending on the client.<br> <br /><br> The return will be synchronous only sometimes (when it is asynchronous it will just return a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>), following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally. The best practice is to ignore the immediate return value and just trust the first parameter passed to the &quot;callbackOk&quot; function once it is called, since this one will be the final value that we want to get (real or fake).</p>
1852 </div>
1853
1854
1855
1856
1857
1858
1859
1860
1861 <h5>Parameters:</h5>
1862
1863
1864<table class="params table table-striped">
1865 <thead>
1866 <tr>
1867
1868 <th style="width:12%; min-width:110px;">Name</th>
1869
1870
1871 <th style="width:12%; min-width:110px;">Type</th>
1872
1873
1874 <th style="width:12%; min-width:110px;">Argument</th>
1875
1876
1877
1878
1879 <th class="last" style="min-width:310px;">Description</th>
1880 </tr>
1881 </thead>
1882
1883 <tbody>
1884
1885
1886 <tr>
1887
1888 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>callbackOk</code></td>
1889
1890
1891 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1892
1893
1894<span class="param-type">function</span>
1895
1896
1897
1898
1899 </td>
1900
1901
1902 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1903
1904 &lt;optional><br>
1905
1906
1907
1908
1909
1910 </td>
1911
1912
1913
1914
1915 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The callback function that will be called once the final value (real or fake one) is gotten (passed as the first and unique parameter). Highly recommended since it is the unique way to always get the final value (due the fact that some clients will execute the function asynchronously).</p></td>
1916 </tr>
1917
1918
1919
1920 <tr>
1921
1922 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>valueOnFail</code></td>
1923
1924
1925 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1926
1927
1928<span class="param-type">boolean</span>
1929
1930
1931
1932
1933 </td>
1934
1935
1936 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
1937
1938 &lt;optional><br>
1939
1940
1941
1942
1943
1944 </td>
1945
1946
1947
1948
1949 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Desired value to use when it fails getting the real one. It should follow the same rules as the real &quot;charging&quot; property of the <a href="https://developer.mozilla.org/docs/Web/API/BatteryManager">BatteryManager</a> object.</p></td>
1950 </tr>
1951
1952
1953 </tbody>
1954</table>
1955
1956
1957
1958
1959<dl class="details">
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1990 <dd class="tag-source">
1991 <ul class="dummy">
1992 <li>
1993 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1994 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-824">line 824</a>
1995 </li>
1996 </ul>
1997 </dd>
1998
1999
2000
2001
2002
2003
2004
2005</dl>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019 <h5>Returns:</h5>
2020
2021
2022<div class="param-desc">
2023 <p>Returns the desired value only when the function is executed synchronously (following the same rules as the <a href="CB_Device.Battery.html#.get"><code>CB_Device.Battery.get</code></a> function which is called internally). It is highly recommended to ignore this returned value.</p>
2024</div>
2025
2026
2027
2028<dl>
2029 <dt>
2030 Type
2031 </dt>
2032 <dd>
2033
2034<span class="param-type">boolean</span>
2035|
2036
2037<span class="param-type">Promise</span>
2038
2039
2040
2041 </dd>
2042</dl>
2043
2044
2045
2046
2047
2048</dd>
2049
2050
2051
2052<hr>
2053<dt>
2054 <h4 class="name" id=".isSupported"><span class="type-signature">&lt;static> </span>isSupported<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
2055
2056
2057</dt>
2058<dd>
2059
2060
2061 <div class="description">
2062 <p>Tells whether the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is available or not.</p>
2063 </div>
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074<dl class="details">
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
2105 <dd class="tag-source">
2106 <ul class="dummy">
2107 <li>
2108 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
2109 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-765">line 765</a>
2110 </li>
2111 </ul>
2112 </dd>
2113
2114
2115
2116
2117
2118
2119
2120</dl>
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134 <h5>Returns:</h5>
2135
2136
2137
2138
2139<dl>
2140 <dt>
2141 Type
2142 </dt>
2143 <dd>
2144
2145<span class="param-type">boolean</span>
2146
2147
2148
2149 </dd>
2150</dl>
2151
2152
2153
2154
2155
2156</dd>
2157
2158
2159
2160<hr>
2161<dt>
2162 <h4 class="name" id=".onChargingChange"><span class="type-signature">&lt;static> </span>onChargingChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false|Promise}</span></h4>
2163
2164
2165</dt>
2166<dd>
2167
2168
2169 <div class="description">
2170 <p>Sets a function to execute when the &quot;onchargingchange&quot; event of the battery is fired or removes it. This should happen whenever the charging status changes (is charging now but before it was not or vice versa). Using the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one).</p>
2171 </div>
2172
2173
2174
2175
2176
2177
2178
2179
2180 <h5>Parameters:</h5>
2181
2182
2183<table class="params table table-striped">
2184 <thead>
2185 <tr>
2186
2187 <th style="width:12%; min-width:110px;">Name</th>
2188
2189
2190 <th style="width:12%; min-width:110px;">Type</th>
2191
2192
2193 <th style="width:12%; min-width:110px;">Argument</th>
2194
2195
2196
2197 <th style="width:12%; min-width:110px;">Default</th>
2198
2199
2200 <th class="last" style="min-width:310px;">Description</th>
2201 </tr>
2202 </thead>
2203
2204 <tbody>
2205
2206
2207 <tr>
2208
2209 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
2210
2211
2212 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2213
2214
2215<span class="param-type">function</span>
2216|
2217
2218<span class="param-type">null</span>
2219
2220
2221
2222
2223 </td>
2224
2225
2226 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2227
2228
2229
2230
2231
2232 </td>
2233
2234
2235
2236 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2237
2238 </td>
2239
2240
2241 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://developer.mozilla.org/docs/Web/Events/chargingchange">https://developer.mozilla.org/docs/Web/Events/chargingchange</a>. If a null value is used, the event will be removed.</p></td>
2242 </tr>
2243
2244
2245
2246 <tr>
2247
2248 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
2249
2250
2251 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2252
2253
2254<span class="param-type">boolean</span>
2255
2256
2257
2258
2259 </td>
2260
2261
2262 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2263
2264 &lt;optional><br>
2265
2266
2267
2268
2269
2270 </td>
2271
2272
2273
2274 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2275
2276 true
2277
2278 </td>
2279
2280
2281 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
2282 </tr>
2283
2284
2285
2286 <tr>
2287
2288 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
2289
2290
2291 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2292
2293
2294<span class="param-type">float</span>
2295
2296
2297
2298
2299 </td>
2300
2301
2302 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2303
2304 &lt;optional><br>
2305
2306
2307
2308
2309
2310 </td>
2311
2312
2313
2314 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2315
2316 false
2317
2318 </td>
2319
2320
2321 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
2322 </tr>
2323
2324
2325 </tbody>
2326</table>
2327
2328
2329
2330
2331<dl class="details">
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
2362 <dd class="tag-source">
2363 <ul class="dummy">
2364 <li>
2365 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
2366 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-891">line 891</a>
2367 </li>
2368 </ul>
2369 </dd>
2370
2371
2372
2373
2374
2375
2376
2377</dl>
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391 <h5>Returns:</h5>
2392
2393
2394<div class="param-desc">
2395 <p>Returns false when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. Returns a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> when the native <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is available. Otherwise, it returns undefined.</p>
2396</div>
2397
2398
2399
2400<dl>
2401 <dt>
2402 Type
2403 </dt>
2404 <dd>
2405
2406<span class="param-type">undefined</span>
2407|
2408
2409<span class="param-type">false</span>
2410|
2411
2412<span class="param-type">Promise</span>
2413
2414
2415
2416 </dd>
2417</dl>
2418
2419
2420
2421
2422
2423</dd>
2424
2425
2426
2427<hr>
2428<dt>
2429 <h4 class="name" id=".onChargingTimeChange"><span class="type-signature">&lt;static> </span>onChargingTimeChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false|Promise}</span></h4>
2430
2431
2432</dt>
2433<dd>
2434
2435
2436 <div class="description">
2437 <p>Sets a function to execute when the &quot;onchargingtimechage&quot; event of the battery is fired or removes it. This should happen whenever the charging time changes. Using the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one).</p>
2438 </div>
2439
2440
2441
2442
2443
2444
2445
2446
2447 <h5>Parameters:</h5>
2448
2449
2450<table class="params table table-striped">
2451 <thead>
2452 <tr>
2453
2454 <th style="width:12%; min-width:110px;">Name</th>
2455
2456
2457 <th style="width:12%; min-width:110px;">Type</th>
2458
2459
2460 <th style="width:12%; min-width:110px;">Argument</th>
2461
2462
2463
2464 <th style="width:12%; min-width:110px;">Default</th>
2465
2466
2467 <th class="last" style="min-width:310px;">Description</th>
2468 </tr>
2469 </thead>
2470
2471 <tbody>
2472
2473
2474 <tr>
2475
2476 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
2477
2478
2479 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2480
2481
2482<span class="param-type">function</span>
2483|
2484
2485<span class="param-type">null</span>
2486
2487
2488
2489
2490 </td>
2491
2492
2493 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2494
2495
2496
2497
2498
2499 </td>
2500
2501
2502
2503 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2504
2505 </td>
2506
2507
2508 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://developer.mozilla.org/docs/Web/Events/chargingtimechange">https://developer.mozilla.org/docs/Web/Events/chargingtimechange</a>. If a null value is used, the event will be removed.</p></td>
2509 </tr>
2510
2511
2512
2513 <tr>
2514
2515 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
2516
2517
2518 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2519
2520
2521<span class="param-type">boolean</span>
2522
2523
2524
2525
2526 </td>
2527
2528
2529 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2530
2531 &lt;optional><br>
2532
2533
2534
2535
2536
2537 </td>
2538
2539
2540
2541 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2542
2543 true
2544
2545 </td>
2546
2547
2548 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
2549 </tr>
2550
2551
2552
2553 <tr>
2554
2555 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
2556
2557
2558 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2559
2560
2561<span class="param-type">float</span>
2562
2563
2564
2565
2566 </td>
2567
2568
2569 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2570
2571 &lt;optional><br>
2572
2573
2574
2575
2576
2577 </td>
2578
2579
2580
2581 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2582
2583 false
2584
2585 </td>
2586
2587
2588 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
2589 </tr>
2590
2591
2592 </tbody>
2593</table>
2594
2595
2596
2597
2598<dl class="details">
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
2629 <dd class="tag-source">
2630 <ul class="dummy">
2631 <li>
2632 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
2633 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-905">line 905</a>
2634 </li>
2635 </ul>
2636 </dd>
2637
2638
2639
2640
2641
2642
2643
2644</dl>
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658 <h5>Returns:</h5>
2659
2660
2661<div class="param-desc">
2662 <p>Returns false when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. Returns a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> when the native <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is available. Otherwise, it returns undefined.</p>
2663</div>
2664
2665
2666
2667<dl>
2668 <dt>
2669 Type
2670 </dt>
2671 <dd>
2672
2673<span class="param-type">undefined</span>
2674|
2675
2676<span class="param-type">false</span>
2677|
2678
2679<span class="param-type">Promise</span>
2680
2681
2682
2683 </dd>
2684</dl>
2685
2686
2687
2688
2689
2690</dd>
2691
2692
2693
2694<hr>
2695<dt>
2696 <h4 class="name" id=".onDischargingTimeChange"><span class="type-signature">&lt;static> </span>onDischargingTimeChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false|Promise}</span></h4>
2697
2698
2699</dt>
2700<dd>
2701
2702
2703 <div class="description">
2704 <p>Sets a function to execute when the &quot;ondischargingtimechange&quot; event of the battery is fired or removes it. This should happen whenever the discharging time changes. Using the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one).</p>
2705 </div>
2706
2707
2708
2709
2710
2711
2712
2713
2714 <h5>Parameters:</h5>
2715
2716
2717<table class="params table table-striped">
2718 <thead>
2719 <tr>
2720
2721 <th style="width:12%; min-width:110px;">Name</th>
2722
2723
2724 <th style="width:12%; min-width:110px;">Type</th>
2725
2726
2727 <th style="width:12%; min-width:110px;">Argument</th>
2728
2729
2730
2731 <th style="width:12%; min-width:110px;">Default</th>
2732
2733
2734 <th class="last" style="min-width:310px;">Description</th>
2735 </tr>
2736 </thead>
2737
2738 <tbody>
2739
2740
2741 <tr>
2742
2743 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
2744
2745
2746 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2747
2748
2749<span class="param-type">function</span>
2750|
2751
2752<span class="param-type">null</span>
2753
2754
2755
2756
2757 </td>
2758
2759
2760 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2761
2762
2763
2764
2765
2766 </td>
2767
2768
2769
2770 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2771
2772 </td>
2773
2774
2775 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://developer.mozilla.org/docs/Web/Events/dischargingtimechange">https://developer.mozilla.org/docs/Web/Events/dischargingtimechange</a>. If a null value is used, the event will be removed.</p></td>
2776 </tr>
2777
2778
2779
2780 <tr>
2781
2782 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
2783
2784
2785 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2786
2787
2788<span class="param-type">boolean</span>
2789
2790
2791
2792
2793 </td>
2794
2795
2796 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2797
2798 &lt;optional><br>
2799
2800
2801
2802
2803
2804 </td>
2805
2806
2807
2808 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2809
2810 true
2811
2812 </td>
2813
2814
2815 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
2816 </tr>
2817
2818
2819
2820 <tr>
2821
2822 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
2823
2824
2825 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2826
2827
2828<span class="param-type">float</span>
2829
2830
2831
2832
2833 </td>
2834
2835
2836 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2837
2838 &lt;optional><br>
2839
2840
2841
2842
2843
2844 </td>
2845
2846
2847
2848 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
2849
2850 false
2851
2852 </td>
2853
2854
2855 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
2856 </tr>
2857
2858
2859 </tbody>
2860</table>
2861
2862
2863
2864
2865<dl class="details">
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
2896 <dd class="tag-source">
2897 <ul class="dummy">
2898 <li>
2899 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
2900 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-919">line 919</a>
2901 </li>
2902 </ul>
2903 </dd>
2904
2905
2906
2907
2908
2909
2910
2911</dl>
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925 <h5>Returns:</h5>
2926
2927
2928<div class="param-desc">
2929 <p>Returns false when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. Returns a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> when the native <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is available. Otherwise, it returns undefined.</p>
2930</div>
2931
2932
2933
2934<dl>
2935 <dt>
2936 Type
2937 </dt>
2938 <dd>
2939
2940<span class="param-type">undefined</span>
2941|
2942
2943<span class="param-type">false</span>
2944|
2945
2946<span class="param-type">Promise</span>
2947
2948
2949
2950 </dd>
2951</dl>
2952
2953
2954
2955
2956
2957</dd>
2958
2959
2960
2961<hr>
2962<dt>
2963 <h4 class="name" id=".onLevelChange"><span class="type-signature">&lt;static> </span>onLevelChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false|Promise}</span></h4>
2964
2965
2966</dt>
2967<dd>
2968
2969
2970 <div class="description">
2971 <p>Sets a function to execute when the &quot;onlevelchange&quot; event of the battery is fired or removes it. This should happen when the battery level changes. Using the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one).</p>
2972 </div>
2973
2974
2975
2976
2977
2978
2979
2980
2981 <h5>Parameters:</h5>
2982
2983
2984<table class="params table table-striped">
2985 <thead>
2986 <tr>
2987
2988 <th style="width:12%; min-width:110px;">Name</th>
2989
2990
2991 <th style="width:12%; min-width:110px;">Type</th>
2992
2993
2994 <th style="width:12%; min-width:110px;">Argument</th>
2995
2996
2997
2998 <th style="width:12%; min-width:110px;">Default</th>
2999
3000
3001 <th class="last" style="min-width:310px;">Description</th>
3002 </tr>
3003 </thead>
3004
3005 <tbody>
3006
3007
3008 <tr>
3009
3010 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>eventFunction</code></td>
3011
3012
3013 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3014
3015
3016<span class="param-type">function</span>
3017|
3018
3019<span class="param-type">null</span>
3020
3021
3022
3023
3024 </td>
3025
3026
3027 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3028
3029
3030
3031
3032
3033 </td>
3034
3035
3036
3037 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3038
3039 </td>
3040
3041
3042 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>The function that will be called when the event is fired. Following the same rules as in <a href="https://developer.mozilla.org/docs/Web/Events/levelchange">https://developer.mozilla.org/docs/Web/Events/levelchange</a>. If a null value is used, the event will be removed.</p></td>
3043 </tr>
3044
3045
3046
3047 <tr>
3048
3049 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>keepOldFunction</code></td>
3050
3051
3052 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3053
3054
3055<span class="param-type">boolean</span>
3056
3057
3058
3059
3060 </td>
3061
3062
3063 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3064
3065 &lt;optional><br>
3066
3067
3068
3069
3070
3071 </td>
3072
3073
3074
3075 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3076
3077 true
3078
3079 </td>
3080
3081
3082 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether we want to keep any possible previous event listener or not.</p></td>
3083 </tr>
3084
3085
3086
3087 <tr>
3088
3089 <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>useCapture</code></td>
3090
3091
3092 <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3093
3094
3095<span class="param-type">float</span>
3096
3097
3098
3099
3100 </td>
3101
3102
3103 <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3104
3105 &lt;optional><br>
3106
3107
3108
3109
3110
3111 </td>
3112
3113
3114
3115 <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;">
3116
3117 false
3118
3119 </td>
3120
3121
3122 <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Defines whether the event we want to add will use capture or not. This parameter will be effective only if the current client supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener</a> method and will be used as its third parameter.</p></td>
3123 </tr>
3124
3125
3126 </tbody>
3127</table>
3128
3129
3130
3131
3132<dl class="details">
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
3163 <dd class="tag-source">
3164 <ul class="dummy">
3165 <li>
3166 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
3167 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-933">line 933</a>
3168 </li>
3169 </ul>
3170 </dd>
3171
3172
3173
3174
3175
3176
3177
3178</dl>
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192 <h5>Returns:</h5>
3193
3194
3195<div class="param-desc">
3196 <p>Returns false when the <a href="https://developer.mozilla.org/docs/Web/API/Battery_Status_API">Battery Status API</a> (or compatible one) is not available. Returns a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> when the native <a href="https://developer.mozilla.org/docs/Web/API/Navigator/getBattery">getBattery</a> function is available. Otherwise, it returns undefined.</p>
3197</div>
3198
3199
3200
3201<dl>
3202 <dt>
3203 Type
3204 </dt>
3205 <dd>
3206
3207<span class="param-type">undefined</span>
3208|
3209
3210<span class="param-type">false</span>
3211|
3212
3213<span class="param-type">Promise</span>
3214
3215
3216
3217 </dd>
3218</dl>
3219
3220
3221
3222
3223
3224</dd>
3225
3226 </dl>
3227
3228
3229
3230
3231
3232</article>
3233
3234</section>
3235
3236
3237
3238
3239 </div>
3240 </div>
3241
3242 <div class="clearfix"></div>
3243
3244
3245 <div class="col-md-3">
3246 <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
3247 </div>
3248
3249
3250</div>
3251</div>
3252
3253
3254 <div class="modal fade" id="searchResults">
3255 <div class="modal-dialog">
3256 <div class="modal-content">
3257 <div class="modal-header">
3258 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
3259 <h4 class="modal-title">Search results</h4>
3260 </div>
3261 <div class="modal-body"></div>
3262 <div class="modal-footer">
3263 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
3264 </div>
3265 </div><!-- /.modal-content -->
3266 </div><!-- /.modal-dialog -->
3267 </div>
3268
3269
3270<footer>
3271
3272
3273 <span class="copyright">
3274 <a href="printable/" target="_blank">See a more printer-friendly version</a><hr /><span style="color:#000000">© <address style="display:inline; font-style:normal;"><a href="https://crossbrowdy.com/" target="_blank">CrossBrowdy</a> API documentation</address> by <a href="https://joanalbamaldonado.com/" target="_blank">Joan Alba Maldonado</a> - <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International</a><br />DocStrap Copyright © 2012-2015 The contributors to the JSDoc3 and DocStrap projects.</span>
3275 </span>
3276
3277<span class="jsdoc-message">
3278 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
3279
3280 on Mon Feb 3rd 2020
3281
3282 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
3283</span>
3284</footer>
3285
3286<script src="scripts/docstrap.lib.js"></script>
3287<script src="scripts/toc.js"></script>
3288
3289 <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
3290
3291
3292<script>
3293$( function () {
3294 $( "[id*='$']" ).each( function () {
3295 var $this = $( this );
3296
3297 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
3298 } );
3299
3300 $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
3301 var $this = $( this );
3302
3303 var example = $this.find( "code" );
3304 exampleText = example.html();
3305 var lang = /{@lang (.*?)}/.exec( exampleText );
3306 if ( lang && lang[1] ) {
3307 exampleText = exampleText.replace( lang[0], "" );
3308 example.html( exampleText );
3309 lang = lang[1];
3310 } else {
3311 var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
3312 lang = langClassMatch ? langClassMatch[1] : "javascript";
3313 }
3314
3315 if ( lang ) {
3316
3317 $this
3318 .addClass( "sunlight-highlight-" + lang )
3319 .addClass( "linenums" )
3320 .html( example.html() );
3321
3322 }
3323 } );
3324
3325 Sunlight.highlightAll( {
3326 lineNumbers : true,
3327 showMenu : true,
3328 enableDoclinks : true
3329 } );
3330
3331 $.catchAnchorLinks( {
3332 navbarOffset: 10
3333 } );
3334 $( "#toc" ).toc( {
3335 anchorName : function ( i, heading, prefix ) {
3336 return $( heading ).attr( "id" ) || ( prefix + i );
3337 },
3338 selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
3339 showAndHide : false,
3340 smoothScrolling: true
3341 } );
3342
3343 $( "#main span[id^='toc']" ).addClass( "toc-shim" );
3344 $( '.dropdown-toggle' ).dropdown();
3345
3346 $( "table" ).each( function () {
3347 var $this = $( this );
3348 $this.addClass('table');
3349 } );
3350
3351} );
3352</script>
3353
3354
3355
3356<!--Navigation and Symbol Display-->
3357
3358<script>
3359 $( function () {
3360 $( '#main' ).localScroll( {
3361 offset : { top : 60 } //offset by the height of your header (give or take a few px, see what works for you)
3362 } );
3363 $( "dt.name" ).each( function () {
3364 var $this = $( this ).find("h4");
3365 var icon = $( "<i/>" ).addClass( "icon-plus-sign" ).addClass( "pull-right" ).addClass( "icon-white" );
3366 var dt = $(this);
3367 var children = dt.next( "dd" );
3368
3369 dt.prepend( icon ).css( {cursor : "pointer"} );
3370 dt.addClass( "member-collapsed" ).addClass( "member" );
3371
3372
3373 children.hide();
3374
3375 dt.children().on( "click", function () {
3376 children = dt.next( "dd" );
3377 children.slideToggle( "fast", function () {
3378
3379 if ( children.is( ":visible" ) ) {
3380 icon.addClass( "icon-minus-sign" ).removeClass( "icon-plus-sign" ).removeClass( "icon-white" );
3381 dt.addClass( "member-open" ).animate( "member-collapsed" );
3382 } else {
3383 icon.addClass( "icon-plus-sign" ).removeClass( "icon-minus-sign" ).addClass( "icon-white" );
3384 dt.addClass( "member-collapsed" ).removeClass( "member-open" );
3385 }
3386 } );
3387 } );
3388
3389 } );
3390 } );
3391</script>
3392
3393
3394<!--Google Analytics-->
3395
3396
3397
3398 <script type="text/javascript">
3399 $(document).ready(function() {
3400 SearcherDisplay.init();
3401 });
3402 </script>
3403
3404
3405</body>
3406</html>
\No newline at end of file