UNPKG

35.7 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: Proximity</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: Proximity</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 Proximity
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 proximity sensor. 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-1181">line 1181</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=".isSupported"><span class="type-signature">&lt;static> </span>isSupported<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
187
188
189</dt>
190<dd>
191
192
193 <div class="description">
194 <p>Tells whether the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> or the Proximity Sensor Events as <a href="https://developer.mozilla.org/en-US/docs/Web/API/Ambient_Light_Events">&quot;ondeviceproximity&quot;</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/UserProximityEvent">&quot;onuserproximity&quot;</a> are supported or not.</p>
195 </div>
196
197
198
199
200
201
202
203
204
205
206<dl class="details">
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
237 <dd class="tag-source">
238 <ul class="dummy">
239 <li>
240 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
241 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-1188">line 1188</a>
242 </li>
243 </ul>
244 </dd>
245
246
247
248
249
250
251
252</dl>
253
254
255
256
257
258
259
260
261
262
263
264
265
266 <h5>Returns:</h5>
267
268
269
270
271<dl>
272 <dt>
273 Type
274 </dt>
275 <dd>
276
277<span class="param-type">boolean</span>
278
279
280
281 </dd>
282</dl>
283
284
285
286
287
288</dd>
289
290
291
292<hr>
293<dt>
294 <h4 class="name" id=".normalizeEvent"><span class="type-signature">&lt;static> </span>normalizeEvent<span class="signature">(e, eventName [, sensor])</span><span class="type-signature"> &rarr; {Event}</span></h4>
295
296
297</dt>
298<dd>
299
300
301 <div class="description">
302 <p>Normalizes the data gotten from the the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> or the Proximity Sensor Events as <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity">&quot;ondeviceproximity&quot;</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/UserProximityEvent">&quot;onuserproximity&quot;</a> to try to match the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> and follow always the same rules as much as possible.</p>
303 </div>
304
305
306
307
308
309
310
311
312 <h5>Parameters:</h5>
313
314
315<table class="params table table-striped">
316 <thead>
317 <tr>
318
319 <th style="width:12%; min-width:110px;">Name</th>
320
321
322 <th style="width:12%; min-width:110px;">Type</th>
323
324
325 <th style="width:12%; min-width:110px;">Argument</th>
326
327
328
329
330 <th class="last" style="min-width:310px;">Description</th>
331 </tr>
332 </thead>
333
334 <tbody>
335
336
337 <tr>
338
339 <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>
340
341
342 <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;">
343
344
345<span class="param-type">Event</span>
346
347
348
349
350 </td>
351
352
353 <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;">
354
355
356
357
358
359 </td>
360
361
362
363
364 <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>
365 </tr>
366
367
368
369 <tr>
370
371 <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>
372
373
374 <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;">
375
376
377<span class="param-type">'change'</span>
378|
379
380<span class="param-type">'reading'</span>
381|
382
383<span class="param-type">'deviceproximity'</span>
384|
385
386<span class="param-type">'userproximity'</span>
387
388
389
390
391 </td>
392
393
394 <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;">
395
396
397
398
399
400 </td>
401
402
403
404
405 <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>
406 </tr>
407
408
409
410 <tr>
411
412 <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>sensor</code></td>
413
414
415 <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;">
416
417
418<span class="param-type">ProximitySensor</span>
419
420
421
422
423 </td>
424
425
426 <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;">
427
428 &lt;optional><br>
429
430
431
432
433
434 </td>
435
436
437
438
439 <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><a href="https://w3.org/TR/proximity/#proximity-sensor-interface">ProximitySensor</a> object used by the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a>.</p></td>
440 </tr>
441
442
443 </tbody>
444</table>
445
446
447
448
449<dl class="details">
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
480 <dd class="tag-source">
481 <ul class="dummy">
482 <li>
483 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
484 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-1269">line 1269</a>
485 </li>
486 </ul>
487 </dd>
488
489
490
491
492
493
494
495 <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt>
496 <dd class="tag-todo">
497 <ul>
498 <li>Normalize more differences between web clients.</li>
499 </ul>
500 </dd>
501
502</dl>
503
504
505
506
507
508
509
510
511
512
513
514
515
516 <h5>Returns:</h5>
517
518
519<div class="param-desc">
520 <p>Returns the given event object again but normalized (if possible).</p>
521</div>
522
523
524
525<dl>
526 <dt>
527 Type
528 </dt>
529 <dd>
530
531<span class="param-type">Event</span>
532
533
534
535 </dd>
536</dl>
537
538
539
540
541
542</dd>
543
544
545
546<hr>
547<dt>
548 <h4 class="name" id=".onChange"><span class="type-signature">&lt;static> </span>onChange<span class="signature">(eventFunction [, detectNear] [, keepOldFunction] [, useCapture] [, callbackError])</span><span class="type-signature"> &rarr; {undefined|false}</span></h4>
549
550
551</dt>
552<dd>
553
554
555 <div class="description">
556 <p>Sets the event to get the proximity or removes it. Uses the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> or the Proximity Sensor Events as <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity">&quot;ondeviceproximity&quot;</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/UserProximityEvent">&quot;onuserproximity&quot;</a>.<br>
557<br/><br>
558The given &quot;eventFunction&quot; will receive the event object as the first parameter but this event object will vary depending on the way to get the proximity which is supported by the client (if any) and the &quot;detectNear&quot; parameter. It will use the following logic order:<br>
559<br /><br>
560If &quot;detectNear&quot; is not set to true, <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> is used as the first option (if available) and &quot;event.value&quot; will contain the units in centimeters (depending on the implementation, &quot;event.near&quot; will also be present, containing a boolean depending on whether an object is near or not).<br>
561<br /><br>
562If &quot;detectNear&quot; is not set to true, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity">Proximity Sensor Events (&quot;ondeviceproximity&quot;)</a> is used as the second option (if available) and &quot;event.value&quot; will contain the units in centimeters.<br>
563<br /><br>
564If &quot;detectNear&quot; is set to true, <a href="https://developer.mozilla.org/en-US/docs/Web/API/UserProximityEvent">&quot;onuserproximity&quot; event</a> is the unique option used (if available) and &quot;event.near&quot; will be a boolean which tell us whether something is near or not.</p>
565 </div>
566
567
568
569
570
571
572
573
574 <h5>Parameters:</h5>
575
576
577<table class="params table table-striped">
578 <thead>
579 <tr>
580
581 <th style="width:12%; min-width:110px;">Name</th>
582
583
584 <th style="width:12%; min-width:110px;">Type</th>
585
586
587 <th style="width:12%; min-width:110px;">Argument</th>
588
589
590
591 <th style="width:12%; min-width:110px;">Default</th>
592
593
594 <th class="last" style="min-width:310px;">Description</th>
595 </tr>
596 </thead>
597
598 <tbody>
599
600
601 <tr>
602
603 <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>
604
605
606 <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;">
607
608
609<span class="param-type">function</span>
610|
611
612<span class="param-type">null</span>
613
614
615
616
617 </td>
618
619
620 <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;">
621
622
623
624
625
626 </td>
627
628
629
630 <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;">
631
632 </td>
633
634
635 <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.Proximity.html#.normalizeEvent"><code>CB_Device.Proximity.normalizeEvent</code></a> function automatically. Despite of this, due to the big differences between different clients, the event object received as the first parameter will vary depending on the way to get the proximity which is supported by the client (if any). If a null value is used, the event will be removed.</p></td>
636 </tr>
637
638
639
640 <tr>
641
642 <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>detectNear</code></td>
643
644
645 <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;">
646
647
648<span class="param-type">boolean</span>
649
650
651
652
653 </td>
654
655
656 <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;">
657
658 &lt;optional><br>
659
660
661
662
663
664 </td>
665
666
667
668 <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;">
669
670 false
671
672 </td>
673
674
675 <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 detect when a physical object is nearby. If it is set to true, it will use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/UserProximityEvent">&quot;onuserproximity&quot; event</a>.</p></td>
676 </tr>
677
678
679
680 <tr>
681
682 <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>
683
684
685 <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;">
686
687
688<span class="param-type">boolean</span>
689
690
691
692
693 </td>
694
695
696 <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;">
697
698 &lt;optional><br>
699
700
701
702
703
704 </td>
705
706
707
708 <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;">
709
710 true
711
712 </td>
713
714
715 <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>
716 </tr>
717
718
719
720 <tr>
721
722 <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>
723
724
725 <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;">
726
727
728<span class="param-type">float</span>
729
730
731
732
733 </td>
734
735
736 <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;">
737
738 &lt;optional><br>
739
740
741
742
743
744 </td>
745
746
747
748 <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;">
749
750 false
751
752 </td>
753
754
755 <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>
756 </tr>
757
758
759
760 <tr>
761
762 <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>
763
764
765 <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;">
766
767
768<span class="param-type">function</span>
769
770
771
772
773 </td>
774
775
776 <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;">
777
778 &lt;optional><br>
779
780
781
782
783
784 </td>
785
786
787
788 <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;">
789
790 </td>
791
792
793 <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 proximity. Only used by the <a href="https://w3.org/TR/proximity/">Proximity Sensor API</a> (if available).</p></td>
794 </tr>
795
796
797 </tbody>
798</table>
799
800
801
802
803<dl class="details">
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833 <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
834 <dd class="tag-source">
835 <ul class="dummy">
836 <li>
837 <a href="CrossBase_device_CB_Device.js.html">CrossBase/device/CB_Device.js</a>,
838 <a href="CrossBase_device_CB_Device.js.html#sunlight-1-line-1212">line 1212</a>
839 </li>
840 </ul>
841 </dd>
842
843
844
845
846
847
848
849</dl>
850
851
852
853
854
855
856
857
858
859
860
861
862
863 <h5>Returns:</h5>
864
865
866<div class="param-desc">
867 <p>Returns false in the case that no way to get the proximity is available or undefined otherwise.</p>
868</div>
869
870
871
872<dl>
873 <dt>
874 Type
875 </dt>
876 <dd>
877
878<span class="param-type">undefined</span>
879|
880
881<span class="param-type">false</span>
882
883
884
885 </dd>
886</dl>
887
888
889
890
891
892</dd>
893
894 </dl>
895
896
897
898
899
900</article>
901
902</section>
903
904
905
906
907 </div>
908 </div>
909
910 <div class="clearfix"></div>
911
912
913 <div class="col-md-3">
914 <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
915 </div>
916
917
918</div>
919</div>
920
921
922 <div class="modal fade" id="searchResults">
923 <div class="modal-dialog">
924 <div class="modal-content">
925 <div class="modal-header">
926 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
927 <h4 class="modal-title">Search results</h4>
928 </div>
929 <div class="modal-body"></div>
930 <div class="modal-footer">
931 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
932 </div>
933 </div><!-- /.modal-content -->
934 </div><!-- /.modal-dialog -->
935 </div>
936
937
938<footer>
939
940
941 <span class="copyright">
942 <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>
943 </span>
944
945<span class="jsdoc-message">
946 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a>
947
948 on Wed Mar 22nd 2023
949
950 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
951</span>
952</footer>
953
954<script src="scripts/docstrap.lib.js"></script>
955<script src="scripts/toc.js"></script>
956
957 <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
958
959
960<script>
961$( function () {
962 $( "[id*='$']" ).each( function () {
963 var $this = $( this );
964
965 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
966 } );
967
968 $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
969 var $this = $( this );
970
971 var example = $this.find( "code" );
972 exampleText = example.html();
973 var lang = /{@lang (.*?)}/.exec( exampleText );
974 if ( lang && lang[1] ) {
975 exampleText = exampleText.replace( lang[0], "" );
976 example.html( exampleText );
977 lang = lang[1];
978 } else {
979 var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
980 lang = langClassMatch ? langClassMatch[1] : "javascript";
981 }
982
983 if ( lang ) {
984
985 $this
986 .addClass( "sunlight-highlight-" + lang )
987 .addClass( "linenums" )
988 .html( example.html() );
989
990 }
991 } );
992
993 Sunlight.highlightAll( {
994 lineNumbers : true,
995 showMenu : true,
996 enableDoclinks : true
997 } );
998
999 $.catchAnchorLinks( {
1000 navbarOffset: 10
1001 } );
1002 $( "#toc" ).toc( {
1003 anchorName : function ( i, heading, prefix ) {
1004 return $( heading ).attr( "id" ) || ( prefix + i );
1005 },
1006 selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
1007 showAndHide : false,
1008 smoothScrolling: true
1009 } );
1010
1011 $( "#main span[id^='toc']" ).addClass( "toc-shim" );
1012 $( '.dropdown-toggle' ).dropdown();
1013
1014 $( "table" ).each( function () {
1015 var $this = $( this );
1016 $this.addClass('table');
1017 } );
1018
1019} );
1020</script>
1021
1022
1023
1024<!--Navigation and Symbol Display-->
1025
1026<script>
1027 $( function () {
1028 $( '#main' ).localScroll( {
1029 offset : { top : 60 } //offset by the height of your header (give or take a few px, see what works for you)
1030 } );
1031 $( "dt.name" ).each( function () {
1032 var $this = $( this ).find("h4");
1033 var icon = $( "<i/>" ).addClass( "icon-plus-sign" ).addClass( "pull-right" ).addClass( "icon-white" );
1034 var dt = $(this);
1035 var children = dt.next( "dd" );
1036
1037 dt.prepend( icon ).css( {cursor : "pointer"} );
1038 dt.addClass( "member-collapsed" ).addClass( "member" );
1039
1040
1041 children.hide();
1042
1043 dt.children().on( "click", function () {
1044 children = dt.next( "dd" );
1045 children.slideToggle( "fast", function () {
1046
1047 if ( children.is( ":visible" ) ) {
1048 icon.addClass( "icon-minus-sign" ).removeClass( "icon-plus-sign" ).removeClass( "icon-white" );
1049 dt.addClass( "member-open" ).animate( "member-collapsed" );
1050 } else {
1051 icon.addClass( "icon-plus-sign" ).removeClass( "icon-minus-sign" ).addClass( "icon-white" );
1052 dt.addClass( "member-collapsed" ).removeClass( "member-open" );
1053 }
1054 } );
1055 } );
1056
1057 } );
1058 } );
1059</script>
1060
1061
1062<!--Google Analytics-->
1063
1064
1065
1066 <script type="text/javascript">
1067 $(document).ready(function() {
1068 SearcherDisplay.init();
1069 });
1070 </script>
1071
1072
1073</body>
1074</html>
\No newline at end of file