UNPKG

59.6 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: Orientation</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_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><li><a href="CB_baseSymbols.html">CB_baseSymbols</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_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_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_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_BASE_NAME">CB_BASE_NAME</a></li><li><a href="global.html#CB_CREDITS_DEFAULT">CB_CREDITS_DEFAULT</a></li><li><a href="global.html#CB_NAME">CB_NAME</a></li><li><a href="global.html#CB_OPTIONS">CB_OPTIONS</a></li><li><a href="global.html#CB_VERSION">CB_VERSION</a></li><li><a href="global.html#CB_addCredits">CB_addCredits</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_forEach">CB_forEach</a></li><li><a href="global.html#CB_forceString">CB_forceString</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_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_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>
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: Orientation</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 Orientation
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 orientation. 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-394">line 394</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 <h3 class="subsection-title">Members</h3>
179
180 <dl>
181
182<hr>
183<dt class="name" id=".cordova_getCompassConstantly_lastId">
184 <h4 id=".cordova_getCompassConstantly_lastId"><span class="type-signature">&lt;static, readonly> </span>cordova_getCompassConstantly_lastId<span class="type-signature"> :integer|null</span></h4>
185
186
187</dt>
188<dd>
189
190 <div class="description">
191 <p>Keeps the last watch ID that gets the compass heading constantly using the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a>. Used by the <a href="CB_Device.Orientation.html#.cordova_getCompassConstantly"><code>CB_Device.Orientation.cordova_getCompassConstantly</code></a> function.</p>
192 </div>
193
194
195
196 <h5>Type:</h5>
197 <ul>
198 <li>
199
200<span class="param-type">integer</span>
201|
202
203<span class="param-type">null</span>
204
205
206
207 </li>
208 </ul>
209
210
211
212<dl class="details">
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
243 <dd class="tag-source">
244 <ul class="dummy">
245 <li>
246 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
247 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-403">line 403</a>
248 </li>
249 </ul>
250 </dd>
251
252
253
254
255
256
257
258</dl>
259
260
261
262</dd>
263
264 </dl>
265
266
267
268 <h3 class="subsection-title">Methods</h3>
269
270 <dl>
271
272<hr>
273<dt>
274 <h4 class="name" id=".cordova_getCompass"><span class="type-signature">&lt;static> </span>cordova_getCompass<span class="signature">(callbackOk, callbackError)</span><span class="type-signature"> &rarr; {undefined|false}</span></h4>
275
276
277</dt>
278<dd>
279
280
281 <div class="description">
282 <p>Gets the compass heading using the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a>. Uses &quot;navigator.compass.getCurrentHeading&quot; internally.</p>
283 </div>
284
285
286
287
288
289
290
291
292 <h5>Parameters:</h5>
293
294
295<table class="params table table-striped">
296 <thead>
297 <tr>
298
299 <th style="width:12%; min-width:110px;">Name</th>
300
301
302 <th style="width:12%; min-width:110px;">Type</th>
303
304
305
306
307
308 <th class="last" style="min-width:310px;">Description</th>
309 </tr>
310 </thead>
311
312 <tbody>
313
314
315 <tr>
316
317 <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>
318
319
320 <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;">
321
322
323<span class="param-type">function</span>
324
325
326
327
328 </td>
329
330
331
332
333
334 <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 it succeeds getting the compass heading. Following the same rules as in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a> (&quot;navigator.compass.getCurrentHeading&quot; function).</p></td>
335 </tr>
336
337
338
339 <tr>
340
341 <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>callbackError</code></td>
342
343
344 <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;">
345
346
347<span class="param-type">function</span>
348
349
350
351
352 </td>
353
354
355
356
357
358 <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 if there is any error getting the compass heading. Following the same rules as in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a> (&quot;navigator.compass.getCurrentHeading&quot; function).</p></td>
359 </tr>
360
361
362 </tbody>
363</table>
364
365
366
367
368<dl class="details">
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
399 <dd class="tag-source">
400 <ul class="dummy">
401 <li>
402 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
403 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-545">line 545</a>
404 </li>
405 </ul>
406 </dd>
407
408
409
410
411
412
413
414 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
415 <dd class="tag-todo">
416 <ul>
417 <li>Add a function to normalize the event and call it automatically.</li>
418 </ul>
419 </dd>
420
421</dl>
422
423
424
425
426
427
428
429
430
431
432
433
434
435 <h5>Returns:</h5>
436
437
438<div class="param-desc">
439 <p>Returns false in the case that the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> is not supported or undefined otherwise.</p>
440</div>
441
442
443
444<dl>
445 <dt>
446 Type
447 </dt>
448 <dd>
449
450<span class="param-type">undefined</span>
451|
452
453<span class="param-type">false</span>
454
455
456
457 </dd>
458</dl>
459
460
461
462
463
464</dd>
465
466
467
468<hr>
469<dt>
470 <h4 class="name" id=".cordova_getCompassConstantly"><span class="type-signature">&lt;static> </span>cordova_getCompassConstantly<span class="signature">( [callbackOkOrId] [, callbackError] [, options])</span><span class="type-signature"> &rarr; {integer|undefined|false}</span></h4>
471
472
473</dt>
474<dd>
475
476
477 <div class="description">
478 <p>Starts or stops getting the compass heading constantly at a regular interval. Uses the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> (&quot;navigator.compass.watchHeading&quot; and &quot;navigator.compass.clearWatch&quot; functions).</p>
479 </div>
480
481
482
483
484
485
486
487
488 <h5>Parameters:</h5>
489
490
491<table class="params table table-striped">
492 <thead>
493 <tr>
494
495 <th style="width:12%; min-width:110px;">Name</th>
496
497
498 <th style="width:12%; min-width:110px;">Type</th>
499
500
501 <th style="width:12%; min-width:110px;">Argument</th>
502
503
504
505 <th style="width:12%; min-width:110px;">Default</th>
506
507
508 <th class="last" style="min-width:310px;">Description</th>
509 </tr>
510 </thead>
511
512 <tbody>
513
514
515 <tr>
516
517 <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>callbackOkOrId</code></td>
518
519
520 <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;">
521
522
523<span class="param-type">function</span>
524|
525
526<span class="param-type">integer</span>
527
528
529
530
531 </td>
532
533
534 <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;">
535
536 &lt;optional><br>
537
538
539
540
541
542 </td>
543
544
545
546 <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;">
547
548 <a href="CB_Device.Orientation.html#.cordova_getCompassConstantly_lastId"><code>CB_Device.Orientation.cordova_getCompassConstantly_lastId</code></a>
549
550 </td>
551
552
553 <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>In the case that we want to start getting the compass heading, use a function callback that will be called regularly when the compass heading is gotten successfully (using the &quot;navigator.compass.watchHeading&quot; function). To stop getting the compass heading, use the watch ID that we want to stop (using the &quot;navigator.compass.clearWatch&quot; function). Following the same rules as the first parameter of the &quot;navigator.compass.watchHeading&quot; function (when we want to start watching) or the first parameter of &quot;navigator.compass.clearWatch&quot; function (when we want to stop watching) described in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a>.</p></td>
554 </tr>
555
556
557
558 <tr>
559
560 <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>callbackError</code></td>
561
562
563 <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;">
564
565
566<span class="param-type">function</span>
567
568
569
570
571 </td>
572
573
574 <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;">
575
576 &lt;optional><br>
577
578
579
580
581
582 </td>
583
584
585
586 <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;">
587
588 </td>
589
590
591 <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>Callback that will be called if there is any error getting the compass heading. Only used when we want to start getting the compass heading (&quot;callbackOkOrId&quot; is a function). Following the same rules as the second parameter of the &quot;navigator.compass.watchHeading&quot; function described in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a>.</p></td>
592 </tr>
593
594
595
596 <tr>
597
598 <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>options</code></td>
599
600
601 <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;">
602
603
604<span class="param-type">Object</span>
605
606
607
608
609 </td>
610
611
612 <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;">
613
614 &lt;optional><br>
615
616
617
618
619
620 </td>
621
622
623
624 <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;">
625
626 </td>
627
628
629 <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>Object that represents the desired options. Only used when we want to start getting the compass heading (&quot;callbackOkOrId&quot; is a function). Following the same rules as the third parameter of the &quot;navigator.compass.watchHeading&quot; function described in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a>.</p></td>
630 </tr>
631
632
633 </tbody>
634</table>
635
636
637
638
639<dl class="details">
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
670 <dd class="tag-source">
671 <ul class="dummy">
672 <li>
673 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
674 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-562">line 562</a>
675 </li>
676 </ul>
677 </dd>
678
679
680
681
682
683
684
685 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
686 <dd class="tag-todo">
687 <ul>
688 <li>Add a function to normalize the event and call it automatically.</li>
689
690 <li>Add parameters to keep old callbacks and options.</li>
691 </ul>
692 </dd>
693
694</dl>
695
696
697
698
699
700
701
702
703
704
705
706
707
708 <h5>Returns:</h5>
709
710
711<div class="param-desc">
712 <p>Returns false in the case that <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> is not supported. In the case that we want to start getting the compass heading (&quot;callbackOkOrId&quot; is a function), it will return the watch ID that has been created. In the case that we want to stop getting the compass heading (&quot;callbackOkOrId&quot; is a watch ID), it will return undefined.</p>
713</div>
714
715
716
717<dl>
718 <dt>
719 Type
720 </dt>
721 <dd>
722
723<span class="param-type">integer</span>
724|
725
726<span class="param-type">undefined</span>
727|
728
729<span class="param-type">false</span>
730
731
732
733 </dd>
734</dl>
735
736
737
738
739
740</dd>
741
742
743
744<hr>
745<dt>
746 <h4 class="name" id=".cordova_getCompassConstantlyDisable"><span class="type-signature">&lt;static> </span>cordova_getCompassConstantlyDisable<span class="signature">( [id])</span><span class="type-signature"> &rarr; {undefined|false}</span></h4>
747
748
749</dt>
750<dd>
751
752
753 <div class="description">
754 <p>Stops getting the compass heading constantly at a regular interval. Uses the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> (&quot;navigator.compass.clearWatch&quot; function).</p>
755 </div>
756
757
758
759
760
761
762
763
764 <h5>Parameters:</h5>
765
766
767<table class="params table table-striped">
768 <thead>
769 <tr>
770
771 <th style="width:12%; min-width:110px;">Name</th>
772
773
774 <th style="width:12%; min-width:110px;">Type</th>
775
776
777 <th style="width:12%; min-width:110px;">Argument</th>
778
779
780
781 <th style="width:12%; min-width:110px;">Default</th>
782
783
784 <th class="last" style="min-width:310px;">Description</th>
785 </tr>
786 </thead>
787
788 <tbody>
789
790
791 <tr>
792
793 <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>id</code></td>
794
795
796 <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;">
797
798
799<span class="param-type">integer</span>
800
801
802
803
804 </td>
805
806
807 <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;">
808
809 &lt;optional><br>
810
811
812
813
814
815 </td>
816
817
818
819 <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;">
820
821 <a href="CB_Device.Orientation.html#.cordova_getCompassConstantly_lastId"><code>CB_Device.Orientation.cordova_getCompassConstantly_lastId</code></a>
822
823 </td>
824
825
826 <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 watch ID that we want to stop. Following the same rules as the first parameter of the &quot;navigator.compass.clearWatch&quot; function described in <a href="https://github.com/apache/cordova-plugin-device-orientation">https://github.com/apache/cordova-plugin-device-orientation</a>.</p></td>
827 </tr>
828
829
830 </tbody>
831</table>
832
833
834
835
836<dl class="details">
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
867 <dd class="tag-source">
868 <ul class="dummy">
869 <li>
870 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
871 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-591">line 591</a>
872 </li>
873 </ul>
874 </dd>
875
876
877
878
879
880
881
882 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
883 <dd class="tag-todo">
884 <ul>
885 <li>Add parameters to keep old callbacks and options.</li>
886 </ul>
887 </dd>
888
889</dl>
890
891
892
893
894
895
896
897
898
899
900
901
902
903 <h5>Returns:</h5>
904
905
906<div class="param-desc">
907 <p>Returns false in the case that <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> is not supported or undefined otherwise.</p>
908</div>
909
910
911
912<dl>
913 <dt>
914 Type
915 </dt>
916 <dd>
917
918<span class="param-type">undefined</span>
919|
920
921<span class="param-type">false</span>
922
923
924
925 </dd>
926</dl>
927
928
929
930
931
932</dd>
933
934
935
936<hr>
937<dt>
938 <h4 class="name" id=".cordova_isCompassSupported"><span class="type-signature">&lt;static> </span>cordova_isCompassSupported<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
939
940
941</dt>
942<dd>
943
944
945 <div class="description">
946 <p>Tells whether the <a href="https://github.com/apache/cordova-plugin-device-orientation">Apache Cordova's Device Orientation plugin</a> is available or not.</p>
947 </div>
948
949
950
951
952
953
954
955
956
957
958<dl class="details">
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
989 <dd class="tag-source">
990 <ul class="dummy">
991 <li>
992 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
993 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-531">line 531</a>
994 </li>
995 </ul>
996 </dd>
997
998
999
1000
1001
1002
1003
1004</dl>
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018 <h5>Returns:</h5>
1019
1020
1021
1022
1023<dl>
1024 <dt>
1025 Type
1026 </dt>
1027 <dd>
1028
1029<span class="param-type">boolean</span>
1030
1031
1032
1033 </dd>
1034</dl>
1035
1036
1037
1038
1039
1040</dd>
1041
1042
1043
1044<hr>
1045<dt>
1046 <h4 class="name" id=".isCompassNeedsCalibrationSupported"><span class="type-signature">&lt;static> </span>isCompassNeedsCalibrationSupported<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1047
1048
1049</dt>
1050<dd>
1051
1052
1053 <div class="description">
1054 <p>Tells whether the <a href="https://w3c.github.io/deviceorientation/spec-source-orientation.html#compassneedscalibration">Compass Needs Calibration Event</a> (used by the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> or compatible one) is supported or not.</p>
1055 </div>
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066<dl class="details">
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1097 <dd class="tag-source">
1098 <ul class="dummy">
1099 <li>
1100 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1101 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-505">line 505</a>
1102 </li>
1103 </ul>
1104 </dd>
1105
1106
1107
1108
1109
1110
1111
1112</dl>
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126 <h5>Returns:</h5>
1127
1128
1129
1130
1131<dl>
1132 <dt>
1133 Type
1134 </dt>
1135 <dd>
1136
1137<span class="param-type">boolean</span>
1138
1139
1140
1141 </dd>
1142</dl>
1143
1144
1145
1146
1147
1148</dd>
1149
1150
1151
1152<hr>
1153<dt>
1154 <h4 class="name" id=".isMozOrientationSupported"><span class="type-signature">&lt;static> </span>isMozOrientationSupported<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1155
1156
1157</dt>
1158<dd>
1159
1160
1161 <div class="description">
1162 <p>Tells whether the <a href="https://developer.mozilla.org/docs/Web/Events/MozOrientation">MozOrientation API</a> is supported or not.</p>
1163 </div>
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174<dl class="details">
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1205 <dd class="tag-source">
1206 <ul class="dummy">
1207 <li>
1208 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1209 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-423">line 423</a>
1210 </li>
1211 </ul>
1212 </dd>
1213
1214
1215
1216
1217
1218
1219
1220</dl>
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234 <h5>Returns:</h5>
1235
1236
1237
1238
1239<dl>
1240 <dt>
1241 Type
1242 </dt>
1243 <dd>
1244
1245<span class="param-type">boolean</span>
1246
1247
1248
1249 </dd>
1250</dl>
1251
1252
1253
1254
1255
1256</dd>
1257
1258
1259
1260<hr>
1261<dt>
1262 <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>
1263
1264
1265</dt>
1266<dd>
1267
1268
1269 <div class="description">
1270 <p>Tells whether the <a href="https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent">Device Orientation Event</a> (used by the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> or compatible one) is supported or not.</p>
1271 </div>
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282<dl class="details">
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1313 <dd class="tag-source">
1314 <ul class="dummy">
1315 <li>
1316 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1317 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-412">line 412</a>
1318 </li>
1319 </ul>
1320 </dd>
1321
1322
1323
1324
1325
1326
1327
1328 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
1329 <dd class="tag-todo">
1330 <ul>
1331 <li>Think about using the "ondeviceorientationabsolute" event.</li>
1332 </ul>
1333 </dd>
1334
1335</dl>
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349 <h5>Returns:</h5>
1350
1351
1352
1353
1354<dl>
1355 <dt>
1356 Type
1357 </dt>
1358 <dd>
1359
1360<span class="param-type">boolean</span>
1361
1362
1363
1364 </dd>
1365</dl>
1366
1367
1368
1369
1370
1371</dd>
1372
1373
1374
1375<hr>
1376<dt>
1377 <h4 class="name" id=".normalizeEvent"><span class="type-signature">&lt;static> </span>normalizeEvent<span class="signature">(e, eventName)</span><span class="type-signature"> &rarr; {Event}</span></h4>
1378
1379
1380</dt>
1381<dd>
1382
1383
1384 <div class="description">
1385 <p>Normalizes the data gotten from the <a href="https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent">Device Orientation Event</a> produced by different clients to try to match the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> and follow always the same rules as much as possible.</p>
1386 </div>
1387
1388
1389
1390
1391
1392
1393
1394
1395 <h5>Parameters:</h5>
1396
1397
1398<table class="params table table-striped">
1399 <thead>
1400 <tr>
1401
1402 <th style="width:12%; min-width:110px;">Name</th>
1403
1404
1405 <th style="width:12%; min-width:110px;">Type</th>
1406
1407
1408
1409
1410
1411 <th class="last" style="min-width:310px;">Description</th>
1412 </tr>
1413 </thead>
1414
1415 <tbody>
1416
1417
1418 <tr>
1419
1420 <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>e</code></td>
1421
1422
1423 <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;">
1424
1425
1426<span class="param-type">Event</span>
1427
1428
1429
1430
1431 </td>
1432
1433
1434
1435
1436
1437 <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 event object that we want to normalize.</p></td>
1438 </tr>
1439
1440
1441
1442 <tr>
1443
1444 <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>eventName</code></td>
1445
1446
1447 <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;">
1448
1449
1450<span class="param-type">'deviceorientation'</span>
1451|
1452
1453<span class="param-type">'MozOrientation'</span>
1454
1455
1456
1457
1458 </td>
1459
1460
1461
1462
1463
1464 <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 name of the event that we want to normalize. Case sensitive.</p></td>
1465 </tr>
1466
1467
1468 </tbody>
1469</table>
1470
1471
1472
1473
1474<dl class="details">
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1505 <dd class="tag-source">
1506 <ul class="dummy">
1507 <li>
1508 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1509 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-477">line 477</a>
1510 </li>
1511 </ul>
1512 </dd>
1513
1514
1515
1516
1517
1518
1519
1520 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
1521 <dd class="tag-todo">
1522 <ul>
1523 <li>Think about using the "deviceorientationabsolute" event.</li>
1524
1525 <li>Normalize more differences between web clients.</li>
1526 </ul>
1527 </dd>
1528
1529</dl>
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543 <h5>Returns:</h5>
1544
1545
1546<div class="param-desc">
1547 <p>Returns the given event object again but normalized (if possible).</p>
1548</div>
1549
1550
1551
1552<dl>
1553 <dt>
1554 Type
1555 </dt>
1556 <dd>
1557
1558<span class="param-type">Event</span>
1559
1560
1561
1562 </dd>
1563</dl>
1564
1565
1566
1567
1568
1569</dd>
1570
1571
1572
1573<hr>
1574<dt>
1575 <h4 class="name" id=".onChange"><span class="type-signature">&lt;static> </span>onChange<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false}</span></h4>
1576
1577
1578</dt>
1579<dd>
1580
1581
1582 <div class="description">
1583 <p>Sets a function to execute for the <a href="https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent">Device Orientation Event</a> (used by the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> or compatible one) or removes it. Falls back to the <a href="https://developer.mozilla.org/docs/Web/Events/MozOrientation">MozOrientation API</a> if possible.</p>
1584 </div>
1585
1586
1587
1588
1589
1590
1591
1592
1593 <h5>Parameters:</h5>
1594
1595
1596<table class="params table table-striped">
1597 <thead>
1598 <tr>
1599
1600 <th style="width:12%; min-width:110px;">Name</th>
1601
1602
1603 <th style="width:12%; min-width:110px;">Type</th>
1604
1605
1606 <th style="width:12%; min-width:110px;">Argument</th>
1607
1608
1609
1610 <th style="width:12%; min-width:110px;">Default</th>
1611
1612
1613 <th class="last" style="min-width:310px;">Description</th>
1614 </tr>
1615 </thead>
1616
1617 <tbody>
1618
1619
1620 <tr>
1621
1622 <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>
1623
1624
1625 <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;">
1626
1627
1628<span class="param-type">function</span>
1629|
1630
1631<span class="param-type">null</span>
1632
1633
1634
1635
1636 </td>
1637
1638
1639 <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;">
1640
1641
1642
1643
1644
1645 </td>
1646
1647
1648
1649 <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;">
1650
1651 </td>
1652
1653
1654 <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. The event object received will already be normalized by the <a href="CB_Device.Orientation.html#.normalizeEvent"><code>CB_Device.Orientation.normalizeEvent</code></a> function automatically. Following the same rules as in <a href="https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent">https://developer.mozilla.org/docs/Web/API/DeviceOrientationEvent</a>. If a null value is used, the event will be removed.</p></td>
1655 </tr>
1656
1657
1658
1659 <tr>
1660
1661 <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>
1662
1663
1664 <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;">
1665
1666
1667<span class="param-type">boolean</span>
1668
1669
1670
1671
1672 </td>
1673
1674
1675 <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;">
1676
1677 &lt;optional><br>
1678
1679
1680
1681
1682
1683 </td>
1684
1685
1686
1687 <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;">
1688
1689 true
1690
1691 </td>
1692
1693
1694 <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>
1695 </tr>
1696
1697
1698
1699 <tr>
1700
1701 <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>
1702
1703
1704 <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;">
1705
1706
1707<span class="param-type">float</span>
1708
1709
1710
1711
1712 </td>
1713
1714
1715 <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;">
1716
1717 &lt;optional><br>
1718
1719
1720
1721
1722
1723 </td>
1724
1725
1726
1727 <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;">
1728
1729 false
1730
1731 </td>
1732
1733
1734 <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>
1735 </tr>
1736
1737
1738 </tbody>
1739</table>
1740
1741
1742
1743
1744<dl class="details">
1745
1746
1747
1748
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 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
1775 <dd class="tag-source">
1776 <ul class="dummy">
1777 <li>
1778 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
1779 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-438">line 438</a>
1780 </li>
1781 </ul>
1782 </dd>
1783
1784
1785
1786
1787
1788
1789
1790 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
1791 <dd class="tag-todo">
1792 <ul>
1793 <li>Think about using the "deviceorientationabsolute" event.</li>
1794 </ul>
1795 </dd>
1796
1797</dl>
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811 <h5>Returns:</h5>
1812
1813
1814<div class="param-desc">
1815 <p>Returns false in the case that neither the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> (or compatible one) nor the <a href="https://developer.mozilla.org/docs/Web/Events/MozOrientation">MozOrientation API</a> are supported or undefined otherwise.</p>
1816</div>
1817
1818
1819
1820<dl>
1821 <dt>
1822 Type
1823 </dt>
1824 <dd>
1825
1826<span class="param-type">undefined</span>
1827|
1828
1829<span class="param-type">false</span>
1830
1831
1832
1833 </dd>
1834</dl>
1835
1836
1837
1838
1839
1840</dd>
1841
1842
1843
1844<hr>
1845<dt>
1846 <h4 class="name" id=".onCompassNeedsCalibration"><span class="type-signature">&lt;static> </span>onCompassNeedsCalibration<span class="signature">(eventFunction [, keepOldFunction] [, useCapture])</span><span class="type-signature"> &rarr; {undefined|false}</span></h4>
1847
1848
1849</dt>
1850<dd>
1851
1852
1853 <div class="description">
1854 <p>Sets a function to execute for the <a href="https://w3c.github.io/deviceorientation/spec-source-orientation.html#compassneedscalibration">Compass Needs Calibration Event</a> (used by the <a href="https://developer.mozilla.org/docs/Web/API/Detecting_device_orientation">Device Orientation API</a> or compatible one) or removes it.</p>
1855 </div>
1856
1857
1858
1859
1860
1861
1862
1863
1864 <h5>Parameters:</h5>
1865
1866
1867<table class="params table table-striped">
1868 <thead>
1869 <tr>
1870
1871 <th style="width:12%; min-width:110px;">Name</th>
1872
1873
1874 <th style="width:12%; min-width:110px;">Type</th>
1875
1876
1877 <th style="width:12%; min-width:110px;">Argument</th>
1878
1879
1880
1881 <th style="width:12%; min-width:110px;">Default</th>
1882
1883
1884 <th class="last" style="min-width:310px;">Description</th>
1885 </tr>
1886 </thead>
1887
1888 <tbody>
1889
1890
1891 <tr>
1892
1893 <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>
1894
1895
1896 <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;">
1897
1898
1899<span class="param-type">function</span>
1900|
1901
1902<span class="param-type">null</span>
1903
1904
1905
1906
1907 </td>
1908
1909
1910 <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;">
1911
1912
1913
1914
1915
1916 </td>
1917
1918
1919
1920 <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;">
1921
1922 </td>
1923
1924
1925 <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://w3c.github.io/deviceorientation/spec-source-orientation.html#compassneedscalibration">https://w3c.github.io/deviceorientation/spec-source-orientation.html#compassneedscalibration</a>. If a null value is used, the event will be removed.</p></td>
1926 </tr>
1927
1928
1929
1930 <tr>
1931
1932 <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>
1933
1934
1935 <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;">
1936
1937
1938<span class="param-type">boolean</span>
1939
1940
1941
1942
1943 </td>
1944
1945
1946 <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;">
1947
1948 &lt;optional><br>
1949
1950
1951
1952
1953
1954 </td>
1955
1956
1957
1958 <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;">
1959
1960 true
1961
1962 </td>
1963
1964
1965 <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>
1966 </tr>
1967
1968
1969
1970 <tr>
1971
1972 <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>
1973
1974
1975 <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;">
1976
1977
1978<span class="param-type">float</span>
1979
1980
1981
1982
1983 </td>
1984
1985
1986 <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;">
1987
1988 &lt;optional><br>
1989
1990
1991
1992
1993
1994 </td>
1995
1996
1997
1998 <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;">
1999
2000 false
2001
2002 </td>
2003
2004
2005 <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>
2006 </tr>
2007
2008
2009 </tbody>
2010</table>
2011
2012
2013
2014
2015<dl class="details">
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
2046 <dd class="tag-source">
2047 <ul class="dummy">
2048 <li>
2049 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
2050 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-519">line 519</a>
2051 </li>
2052 </ul>
2053 </dd>
2054
2055
2056
2057
2058
2059
2060
2061</dl>
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075 <h5>Returns:</h5>
2076
2077
2078<div class="param-desc">
2079 <p>Returns false in the case that the <a href="https://w3c.github.io/deviceorientation/spec-source-orientation.html#compassneedscalibration">Compass Needs Calibration Event</a> is not supported or undefined otherwise.</p>
2080</div>
2081
2082
2083
2084<dl>
2085 <dt>
2086 Type
2087 </dt>
2088 <dd>
2089
2090<span class="param-type">undefined</span>
2091|
2092
2093<span class="param-type">false</span>
2094
2095
2096
2097 </dd>
2098</dl>
2099
2100
2101
2102
2103
2104</dd>
2105
2106 </dl>
2107
2108
2109
2110
2111
2112</article>
2113
2114</section>
2115
2116
2117
2118
2119 </div>
2120 </div>
2121
2122 <div class="clearfix"></div>
2123
2124
2125 <div class="col-md-3">
2126 <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
2127 </div>
2128
2129
2130</div>
2131</div>
2132
2133
2134 <div class="modal fade" id="searchResults">
2135 <div class="modal-dialog">
2136 <div class="modal-content">
2137 <div class="modal-header">
2138 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
2139 <h4 class="modal-title">Search results</h4>
2140 </div>
2141 <div class="modal-body"></div>
2142 <div class="modal-footer">
2143 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
2144 </div>
2145 </div><!-- /.modal-content -->
2146 </div><!-- /.modal-dialog -->
2147 </div>
2148
2149
2150<footer>
2151
2152
2153 <span class="copyright">
2154 <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>
2155 </span>
2156
2157<span class="jsdoc-message">
2158 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a>
2159
2160 on Wed Mar 22nd 2023
2161
2162 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
2163</span>
2164</footer>
2165
2166<script src="scripts/docstrap.lib.js"></script>
2167<script src="scripts/toc.js"></script>
2168
2169 <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
2170
2171
2172<script>
2173$( function () {
2174 $( "[id*='$']" ).each( function () {
2175 var $this = $( this );
2176
2177 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
2178 } );
2179
2180 $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
2181 var $this = $( this );
2182
2183 var example = $this.find( "code" );
2184 exampleText = example.html();
2185 var lang = /{@lang (.*?)}/.exec( exampleText );
2186 if ( lang && lang[1] ) {
2187 exampleText = exampleText.replace( lang[0], "" );
2188 example.html( exampleText );
2189 lang = lang[1];
2190 } else {
2191 var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
2192 lang = langClassMatch ? langClassMatch[1] : "javascript";
2193 }
2194
2195 if ( lang ) {
2196
2197 $this
2198 .addClass( "sunlight-highlight-" + lang )
2199 .addClass( "linenums" )
2200 .html( example.html() );
2201
2202 }
2203 } );
2204
2205 Sunlight.highlightAll( {
2206 lineNumbers : true,
2207 showMenu : true,
2208 enableDoclinks : true
2209 } );
2210
2211 $.catchAnchorLinks( {
2212 navbarOffset: 10
2213 } );
2214 $( "#toc" ).toc( {
2215 anchorName : function ( i, heading, prefix ) {
2216 return $( heading ).attr( "id" ) || ( prefix + i );
2217 },
2218 selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
2219 showAndHide : false,
2220 smoothScrolling: true
2221 } );
2222
2223 $( "#main span[id^='toc']" ).addClass( "toc-shim" );
2224 $( '.dropdown-toggle' ).dropdown();
2225
2226 $( "table" ).each( function () {
2227 var $this = $( this );
2228 $this.addClass('table');
2229 } );
2230
2231} );
2232</script>
2233
2234
2235
2236<!--Navigation and Symbol Display-->
2237
2238<script>
2239 $( function () {
2240 $( '#main' ).localScroll( {
2241 offset : { top : 60 } //offset by the height of your header (give or take a few px, see what works for you)
2242 } );
2243 $( "dt.name" ).each( function () {
2244 var $this = $( this ).find("h4");
2245 var icon = $( "<i/>" ).addClass( "icon-plus-sign" ).addClass( "pull-right" ).addClass( "icon-white" );
2246 var dt = $(this);
2247 var children = dt.next( "dd" );
2248
2249 dt.prepend( icon ).css( {cursor : "pointer"} );
2250 dt.addClass( "member-collapsed" ).addClass( "member" );
2251
2252
2253 children.hide();
2254
2255 dt.children().on( "click", function () {
2256 children = dt.next( "dd" );
2257 children.slideToggle( "fast", function () {
2258
2259 if ( children.is( ":visible" ) ) {
2260 icon.addClass( "icon-minus-sign" ).removeClass( "icon-plus-sign" ).removeClass( "icon-white" );
2261 dt.addClass( "member-open" ).animate( "member-collapsed" );
2262 } else {
2263 icon.addClass( "icon-plus-sign" ).removeClass( "icon-minus-sign" ).addClass( "icon-white" );
2264 dt.addClass( "member-collapsed" ).removeClass( "member-open" );
2265 }
2266 } );
2267 } );
2268
2269 } );
2270 } );
2271</script>
2272
2273
2274<!--Google Analytics-->
2275
2276
2277
2278 <script type="text/javascript">
2279 $(document).ready(function() {
2280 SearcherDisplay.init();
2281 });
2282 </script>
2283
2284
2285</body>
2286</html>
\No newline at end of file