UNPKG

117 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 [printable] Source: CrossBase/CrossBase.js</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.yeti.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 [printable]</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-12">
78
79 <div id="main">
80
81
82 <h1 class="page-title">Source: CrossBase/CrossBase.js</h1>
83
84<section>
85 <article>
86 <pre
87 class="sunlight-highlight-javascript linenums">/**
88 * @file Main CrossBase module file.
89 * @author Joan Alba Maldonado &lt;workindalian@gmail.com>
90 * @license Creative Commons Attribution 4.0 International. See more at {@link https://crossbrowdy.com/about#what_is_the_crossbrowdy_copyright_and_license}.
91 */
92
93
94//Credits of the module:
95var CB_CrossBaseCredits =
96 "[CB] - CrossBase module by Joan Alba Maldonado&lt;br />" +
97 "[CB] -- Array.* polyfills by Mozilla Foundation (MDN)&lt;br />" +
98 "[CB] -- JSON 3 by Kit Cambridge&lt;br />" +
99 "[CB] -- bluebird by Petka Antonov&lt;br />" +
100 "[CB] -- BrowserDetect by Peter-Paul Koch&lt;br />" +
101 "[CB] -- performance.now polyfill by Paul Irish, Aaron Levine and Joan Alba Maldonado&lt;br />" +
102 "[CB] -- requestAnimationFrame polyfill by Erik Moller (fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavic, Darius Bacon, Tim Hall and Joan Alba Maldonado)&lt;br />" +
103 "[CB] -- typedarray.js polyfill by Linden Research, Inc. and Joshua Bell&lt;br />" +
104 "[CB] -- Base64Binary by Daniel Guerrero&lt;br />" +
105 "[CB] -- localStorage polyfill by Morten Houmøller Nygaard&lt;br />" +
106 "[CB] -- lz-string (including base64-string) by pieroxy&lt;br />" +
107 "[CB] -- Canbox by Robert Inglin&lt;br />" +
108 "[CB] -- ExplorerCanvas by Google Inc.&lt;br />" +
109 "[CB] -- SLCanvas by David Anson and Jon Davis&lt;br />" +
110 "[CB] -- FlashCanvas by Tim Cameron Ryan and Shinya Muramatsu&lt;br />" +
111 "[CB] -- canvas-text by Fabien Ménager&lt;br />" +
112 "[CB] -- Detect-zoom by yonran (maintained by tombigel)&lt;br />" +
113 "[CB] -- AudioContext-MonkeyPatch by Chris Wilson&lt;br />" +
114 "[CB] -- WAAPISim by g200kg&lt;br />" +
115 "[CB] -- timbre.js and subcollider.js by mohayonao&lt;br />" +
116 "[CB] -- Band.js by Cody Lundquist and various contributors&lt;br />" +
117 "[CB] -- jsfx by Egon Elbre&lt;br />" +
118 "[CB] -- SoundManager 2 by Scott Schiller&lt;br />" +
119 "[CB] -- fetch-ie8 by Cam Song&lt;br />" +
120 "[CB] -- SockJS-client by Marek, Bryce Kahle, Michael Bridgen, Luigi Pinca and others&lt;br />" +
121 "[CB] -- Pressure.js by Stuart Yamartino&lt;br />" +
122 "[CB] -- Hammer.js by Jorik Tangelder&lt;br />" +
123 "[CB] -- Hammer Time by Alexander Schmitz and other contributors&lt;br />" +
124 "[CB] -- wii-js by Ryan McGrath&lt;br />" +
125 "[CB] -- gamepad-plus by Chris Van Wiemeersch (MozVR)&lt;br />" +
126 "[CB] -- NoSleep.js by Rich Tibbett&lt;br />";
127
128
129//CrossBase constants and variables:
130/**
131 * Keeps the name of the CrossBase module.
132 * @constant
133 * @type {string}
134 * @default
135 */
136var CB_BASE_NAME = "CrossBase";
137
138
139/**
140 Property that contains an object with the options for the main script.
141 * @namespace CB_Configuration.CrossBase
142 */
143CB_Configuration[CB_BASE_NAME] =
144{
145 /**
146 * Path to the CrossBase module, relative to the CrossBrowdy folder.
147 * @memberof CB_Configuration.CrossBase
148 * @constant
149 * @type {string}
150 * @default {@link CB_BASE_NAME} + "/"
151 */
152 SCRIPT_PATH: CB_BASE_NAME + "/",
153
154
155 /**
156 * Defines whether to have in mind possible [iframes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe} that could contain the script or not. Used by some functions of {@link CB_Client}, {@link CB_Events}, etc.
157 * @memberof CB_Configuration.CrossBase
158 * @constant
159 * @type {boolean}
160 * @default
161 */
162 MIND_IFRAMES: true,
163
164
165 /**
166 * Defines whether to allow to extend the DOM if needed or not. If set to true and some methods (as for example [Array.indexOf]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf}, [Array.lastIndexOf]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf}, [Array.isArray]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray}, [Array.forEach]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach}, [NodeList.forEach]{@link https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach}, [HTMLCollection.forEach]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach}, etc.) are not supported natively, they will be added.
167 * @memberof CB_Configuration.CrossBase
168 * @constant
169 * @type {boolean}
170 * @default
171 */
172 EXTEND_DOM: false,
173
174
175 /**
176 * Defines whether to use high precision in the CB_Device.getTime (returning '[window.performance.timing.navigationStart]{@link https://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming/navigationStart} + [window.performance.now]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance/now}()', where '[window.performance.now]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance/now}' could be polyfilled) or not (returning '[Date.now]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now}()', where '[Date.now]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now}' could be polyfilled).
177 * @memberof CB_Configuration.CrossBase
178 * @constant
179 * @type {string}
180 * @default
181 */
182 CB_Device_getTime_HIGH_PRECISION: true,
183
184
185 /**
186 * Defines whether to use cache for the function {@link CB_Elements.id} by default.
187 * @memberof CB_Configuration.CrossBase
188 * @constant
189 * @type {boolean}
190 * @default
191 */
192 CB_Elements_id_USE_CACHE: true,
193
194
195 /**
196 * Defines whether to use cache for the {@link CB_Elements.tag} function by default.
197 * @memberof CB_Configuration.CrossBase
198 * @constant
199 * @type {boolean}
200 * @default
201 */
202 CB_Elements_tag_USE_CACHE: true,
203
204
205 /**
206 * Defines whether to use cache for the function {@link CB_Elements.classes} by default.
207 * @memberof CB_Configuration.CrossBase
208 * @constant
209 * @type {boolean}
210 * @default
211 */
212 CB_Elements_classes_USE_CACHE: true,
213
214
215 /**
216 * Default language to use for {@link CB_Client} when no language can be detected (very strange case!).
217 * @memberof CB_Configuration.CrossBase
218 * @constant
219 * @type {string}
220 * @default
221 */
222 CB_Client_language_DEFAULT: "en",
223
224
225 /**
226 * Default value for the "allowNavigatorLanguages" parameter for {@link CB_Client.getLanguage} and {@link CB_Client.getLanguages} functions.
227 * @memberof CB_Configuration.CrossBase
228 * @constant
229 * @type {boolean}
230 * @default
231 */
232 CB_Client_allowNavigatorLanguages_DEFAULT: false,
233
234
235 /**
236 * Tells whether the {@link CB_Client.getLanguage} and {@link CB_Client.getLanguages} functions will use the accepted languages detected by PHP (if any) as the first option by default or not.
237 * @memberof CB_Configuration.CrossBase
238 * @constant
239 * @type {boolean}
240 * @default
241 */
242 CB_Client_PHPAcceptedLanguagesFirst_DEFAULT: true,
243
244
245 /**
246 * Defines whether the URL for the proxy (defined in {@link CB_Configuration.CrossBase.CB_Net_XHR_PROXY_URL}) is relative to the main script folder or not. If it is relative, the "onCall" event of the CrossBase module will append the value of the "scriptPathGiven" parameter at the beginning.
247 * @memberof CB_Configuration.CrossBase
248 * @constant
249 * @type {boolean}
250 * @default
251 */
252 CB_Net_XHR_PROXY_URL_RELATIVE: true,
253
254
255 /**
256 * Defines whether we want to prevent the Firefox bug that affects [SockJS library]{@link https://github.com/sockjs/sockjs-client/} (see {@link https://github.com/sockjs/sockjs-client/issues/18}) or not. Used by {@link CB_Keyboard}.
257 * @memberof CB_Configuration.CrossBase
258 * @constant
259 * @type {boolean}
260 * @default
261 */
262 CB_Net_Sockets_PREVENT_FIREFOX_ESC_BUG: true,
263
264
265 /**
266 * Defines whether to allow Nintendo Wii codes (from the Wiimote) set in the {@link CB_Keyboard.extended.WII} object to be defined in the key aliases even if they use codes which belong to other keys. Used by {@link CB_Keyboard}.
267 * @memberof CB_Configuration.CrossBase
268 * @constant
269 * @type {boolean}
270 * @default
271 */
272 CB_Keyboard_extended_WII_allowDuplicateKeyAliases: true,
273
274
275 /**
276 * Defines whether to allow Sony Playstation 4 codes set in the {@link CB_Keyboard.extended.PS4CB_Keyboard.extended.PS4} object to be defined in the key aliases even if they use codes which belong to other keys. Used by {@link CB_Keyboard}.
277 * @memberof CB_Configuration.CrossBase
278 * @constant
279 * @type {boolean}
280 * @default
281 */
282 CB_Keyboard_extended_PS4_allowDuplicateKeyAliases: false,
283
284
285 /**
286 * Defines whether to allow Smart TV codes (from the remote control) and virtual key codes set in the {@link CB_Keyboard.extended.VK} object to be defined in the key aliases even if they use codes which belong to other keys. Used by {@link CB_Keyboard}.
287 * @memberof CB_Configuration.CrossBase
288 * @constant
289 * @type {boolean}
290 * @default
291 */
292 CB_Keyboard_extended_VK_allowDuplicateKeyAliases: true,
293
294
295 /**
296 * Defines whether to allow Samsung TV key codes (from the remote control) set in the {@link CB_Keyboard.extended.SAMSUNG_TV} object to be defined in the key aliases even if they use codes which belong to other keys. Used by {@link CB_Keyboard}.
297 * @memberof CB_Configuration.CrossBase
298 * @constant
299 * @type {boolean}
300 * @default
301 */
302 CB_Keyboard_extended_SAMSUNG_TV_allowDuplicateKeyAliases: false,
303
304
305 /**
306 * Default value for the "avoidProprietary" proprietary when calling different functions of the {@link CB_Controllers} static class, as the {@link CB_Controllers.getButtonsDown}, the {@link CB_Controllers.isButtonDown} and the {@link CB_Controllers.getGamePads} functions, etc.
307 * @memberof CB_Configuration.CrossBase
308 * @constant
309 * @type {boolean}
310 * @default
311 */
312 CB_Controllers_avoidProprietary_DEFAULT: false,
313
314
315 /**
316 * Allowed width margin of the total screen available to consider whether it is in full screen or not. Needed by old web clients without Fullscreen API support, mainly. Used by the {@link CB_Screen.isFullScreen} function.
317 * @memberof CB_Configuration.CrossBase
318 * @constant
319 * @type {float}
320 * @default
321 */
322 CB_Screen_isFullScreen_ALLOWED_WIDTH_MARGIN_PERCENTAGE: 3.9,
323
324
325 /**
326 * Allowed height margin of the total screen available to consider whether it is in full screen or not. Needed by old web clients without Fullscreen API support, mainly. Used by the {@link CB_Screen.isFullScreen} function.
327 * @memberof CB_Configuration.CrossBase
328 * @constant
329 * @type {float}
330 * @default
331 */
332 CB_Screen_isFullScreen_ALLOWED_HEIGHT_MARGIN_PERCENTAGE: 3.5,
333
334
335 /**
336 * Defines whether to allow using "WAAPI" ([HTML5 Web Audio API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API}) emulation (it will use [WAAPISim]{@link https://github.com/g200kg/WAAPISim} if needed) or not.
337 * @memberof CB_Configuration.CrossBase
338 * @constant
339 * @type {boolean}
340 * @default
341 */
342 WAAPI_EMULATION_ALLOWED: true,
343
344
345 /**
346 * Default volume for CB_Speaker (from 0 to 100).
347 * @memberof CB_Configuration.CrossBase
348 * @constant
349 * @type {integer}
350 * @default
351 */
352 CB_Speaker_DEFAULT_VOLUME: 100,
353
354
355 /**
356 * Milliseconds that a file is played (with volume set to 0) automatically when an audio file is loaded. Needed for some web clients which cannot find out the duration otherwise. Used by {@link CB_AudioFile}.
357 * @memberof CB_Configuration.CrossBase
358 * @constant
359 * @type {integer}
360 * @default
361 */
362 CB_AudioFile_AUTOPLAY_SILENTLY_ON_LOAD_MS: 500,
363
364
365 /**
366 * Milliseconds to wait before declaring a sound as failed if it cannot be loaded before. Used by {@link CB_AudioFile_API.SM2}.
367 * @memberof CB_Configuration.CrossBase
368 * @constant
369 * @type {integer}
370 * @default
371 */
372 CB_AudioFile_ONLOAD_TIMEOUT_MS: 15000,
373
374
375 /**
376 * Tells whether CB_AudioFile["AAPI"] uses [setTimeout]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout} (instead of [timeupdate]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event} event) to detect when the given "stopAt" is reached.
377 * @memberof CB_Configuration.CrossBase
378 * @constant
379 * @type {boolean}
380 * @default
381 */
382 CB_AudioFile_AAPI_USE_TIMEOUT_TO_DETECT_STOPAT: true,
383
384
385 /**
386 * Default value for maximum delay (in milliseconds) to wait for a sound to start playing or start next loop (if the time expires, the sound will never be played).
387 Used by {@link CB_AudioFile_API.WAAPI}, {@link CB_AudioFile_API.AAPI}, {@link CB_AudioFile_API.SM2}, {@link CB_AudioFile_API.ACMP} and {@link CB_AudioFileCache}.
388 * @memberof CB_Configuration.CrossBase
389 * @constant
390 * @type {integer}
391 * @default
392 */
393 CB_AudioFile_AudioFileCache_ALLOWED_RECURSIVE_DELAY_DEFAULT: 150,
394
395
396 /**
397 * Tells whether to mute or not the audio files when they load or are checking. Note: Audio cache does not work properly on BlackBerry PlayBook's default browser if the sounds are muted when load or are checking.
398 Used by {@link CB_AudioFile}, {@link CB_AudioFile_API.WAAPI}, {@link CB_AudioFile_API.AAPI}, {@link CB_AudioFile_API.SM2}, {@link CB_AudioFile_API.ACMP} and {@link CB_AudioFileCache}.
399 * @memberof CB_Configuration.CrossBase
400 * @constant
401 * @type {boolean}
402 * @default !(navigator.userAgent.indexOf("PlayBook") !== -1 &amp;&amp; navigator.userAgent.indexOf("Tablet OS") !== -1)
403 */
404 CB_AudioFile_AudioFileCache_MUTE_ON_LOAD_AND_CHECKING: !(navigator.userAgent.indexOf("PlayBook") !== -1 &amp;&amp; navigator.userAgent.indexOf("Tablet OS") !== -1), //Audio cache does not work properly on BlackBerry PlayBook's default browser if the sounds are muted when load or are checking.
405
406
407 /**
408 * Defines whether to use {@link CB_Speaker._volume} as default volume. Used by {@link CB_AudioFile}, {@link CB_AudioFile_API.WAAPI}, {@link CB_AudioFile_API.AAPI}, {@link CB_AudioFile_API.SM2}, {@link CB_AudioFile_API.ACMP} and {@link CB_AudioFileCache}.
409 * @memberof CB_Configuration.CrossBase
410 * @constant
411 * @type {boolean}
412 * @default
413 */
414 CB_AudioFile_AudioFileCache_USE_SPEAKER_VOLUME_AS_DEFAULT: true,
415
416
417 /**
418 * Defines whether to use {@link CB_Speaker._volume} as maximum volume. Used by {@link CB_AudioFile}, {@link CB_AudioFile_API.WAAPI}, {@link CB_AudioFile_API.AAPI}, {@link CB_AudioFile_API.SM2} and {@link CB_AudioFile_API.ACMP}.
419 * @memberof CB_Configuration.CrossBase
420 * @constant
421 * @type {boolean}
422 * @default
423 */
424 CB_AudioFile_AudioFileCache_USE_SPEAKER_VOLUME_AS_MAXIMUM: false,
425
426
427 /**
428 * Array with the default desired canvas emulation methods by order of preference. Used by {@link CB_Canvas}.
429 * @memberof CB_Configuration.CrossBase
430 * @constant
431 * @type {array}
432 * @default
433 */
434 CB_Canvas_PREFERRED_EMULATION_METHODS:
435 [
436 "FLASH", //FlashCanvas.
437 "VML", //ExplorerCanvas.
438 "DHTML", //Canbox.
439 "SILVERLIGHT" //SLCanvas.
440 ],
441
442
443 /**
444 * Value by default when the "allowEmulation" parameter is not provided in the {@link CB_AudioDetector.getPreferredAPI}, the {@link CB_AudioDetector.getSupportedAPIs} or the {@link CB_AudioDetector.isAPISupported} function.
445 * @memberof CB_Configuration.CrossBase
446 * @constant
447 * @type {boolean}
448 * @default
449 */
450 CB_AudioDetector_allowEmulation_DEFAULT: false,
451
452
453 /**
454 * Array with the default preferred audio APIs by order of preference. Used by {@link CB_AudioFileCache} and {@link CB_AudioDetector}.
455 Possible audio APIs are "WAAPI" ([HTML5 Web Audio API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API}), "SM2" ([SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}), "ACMP" ([Apache Cordova Media Plugin]{@link https://github.com/apache/cordova-plugin-media}) or "AAPI" ([HTML5 Audio API]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio}).
456 Note: since Internet Explorer 9 works better with SM2 than with AAPI, if it is detected then the default value will be: [ "WAAPI", "SM2", "ACMP", "AAPI" ]
457 * @memberof CB_Configuration.CrossBase
458 * @constant
459 * @type {array}
460 * @default ["WAAPI", "AAPI", "ACMP", "SM2"]
461 */
462 CB_AudioFileCache_PREFERRED_AUDIO_APIS:
463 navigator.appVersion.indexOf("MSIE 9") === -1 ?
464 [
465 "WAAPI", //HTML5 Web Audio API.
466 "AAPI", //HTML5 Audio API.
467 "ACMP", //Apache Cordova Media Plugin.
468 "SM2" //SoundManager 2.
469 ]
470 :
471 [ "WAAPI", "SM2", "ACMP", "AAPI" ], //IE9 have works better with SM2 than with AAPI.
472
473
474 /**
475 * Array with the default preferred audio formats by order of preference. Used by {@link CB_AudioFileCache} and {@link CB_AudioDetector}.
476 NOTE: some web clients do not support to specify codecs so it is better to also provide strings without codecs.
477 * @memberof CB_Configuration.CrossBase
478 * @constant
479 * @type {array}
480 * @default
481 */
482 CB_AudioFileCache_PREFERRED_AUDIO_FORMATS:
483 [
484 'audio/ogg; codecs="vorbis"', //audio/ogg with Vorbis codec.
485 'audio/ogg; codecs="speex"', //audio/ogg with Speex codec.
486 'audio/ogg; codecs="flac"', //audio/ogg with FLAC codec.
487 'audio/ogg', //audio/ogg is for .oga, .ogg.
488
489 'audio/mpeg; codecs="mp3"', //audio/mpeg with MP3 codec (?).
490 'audio/mpeg', //audio/mpeg is for .mp1, .mp2, .mp3, .mpg, .mpeg.
491
492 'audio/mp4; codecs="mp4a.40.5"', //audio/mp4 with mp4a.40.5 codec.
493 'audio/mp4; codecs="mp4a.40.2"', //audio/mp4 with mp4a.40.2 codec.
494 'audio/mp4; codecs="mp4a.40.05"', //audio/mp4 with mp4a.40.05 codec.
495 'audio/mp4; codecs="mp4a.40.02"', //audio/mp4 with mp4a.40.02 codec.
496 'audio/mp4; codecs="mp4a.69"', //audio/mp4 with mp4a.69 codec.
497 'audio/mp4; codecs="mp4a.6B"', //audio/mp4 with mp4a.6B codec.
498 'audio/mp4; codecs="mp4a.67"', //audio/mp4 with mp4a.67 codec.
499 'audio/mp4; codecs="mp4a.a6"', //audio/mp4 with mp4a.a6 codec.
500 'audio/mp4; codecs="mp4a.a5"', //audio/mp4 with mp4a.a5 codec.
501 'audio/mp4; codecs="aac51"', //audio/mp4 with aac51 codec.
502 'audio/mp4; codecs="ac-3"', //audio/mp4 with ac-3 codec.
503 'audio/mp4; codecs="ec-3"', //audio/mp4 with ec-3 codec.
504 'audio/mp4', //audio/mp4 is for .mp4, .m4a.
505
506 'audio/aac; codecs="aac"', //audio.aac with AAC codec (?).
507 'audio/aac; codecs="mp4a.40.5"', //audio/aac with mp4a.40.5 codec (?).
508 'audio/aac; codecs="vorbis"', //audio.aac with Vorbis codec (?).
509 'audio/aac', //audio/acc is for .aac.
510
511 'audio/x-aac; codecs="aac"',
512 'audio/x-aac',
513
514 'audio/x-m4b; codecs="aac"',
515 'audio/x-m4b',
516
517 'audio/x-m4p; codecs="aac"',
518 'audio/x-m4p',
519
520 'audio/webm; codecs="vorbis"', //audio/webm with Vorbis codec.
521 'audio/webm', //audio/webm is for .webm.
522
523 'audio/3gpp; codecs="samr"', //audio/3gpp with SAMR codec.
524 'audio/3gpp', //audio/3gpp is for .3gpp.
525
526 'audio/wav; codecs="1"', //audio/wav with 1 codec (?).
527 'audio/wav', //audio/wav is for .wav.
528
529 'audio/x-wav; codecs="1"', //audio/x-wav with 1 codec (?).
530 'audio/x-wav', //audio/x-wav is for .wav.
531
532 'audio/x-pn-wav; codecs="1"', //audio/x-pn-wav with 1 codec (?).
533 'audio/x-pn-wav', //audio/x-pn-wav is for .wav
534
535 'audio/wave; codecs="1"', //audio/wave with 1 codec (?).
536 'audio/wave', //audio/wave is for .wav.
537
538 'audio/x-wave; codecs="1"', //audio/x-wave with 1 codec (?).
539 'audio/x-wave' //audio/x-wave is for .wav.
540 ]
541};
542
543
544/**
545 * URL for the proxy to prevent cross-domain issues through AJAX, used by {@link CB_Net.XHR.callProxy} function. Can be relative to the main script folder or not, depending on {@link CB_Configuration.CrossBase.CB_Net_XHR_PROXY_URL_RELATIVE}.
546 &lt;br />
547 NOTE: Edit the "CB_proxy.config.php" file to configure the default proxy. Apart from configuring it, adding some security measures is highly recommended.
548 Have in mind that, for safety reasons, the default proxy only allows to request the URLs defined in the "$allowedURLs" array in the "CB_proxy.config.php" file. Just edit it to allow other URLs.
549 * @memberof CB_Configuration.CrossBase
550 * @name CB_Net_XHR_PROXY_URL
551 * @constant
552 * @type {string}
553 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "net/proxy/CB_proxy.php"
554 */
555CB_Configuration[CB_BASE_NAME].CB_Net_XHR_PROXY_URL = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "net/proxy/CB_proxy.php";
556
557
558
559CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn = null; //Cache to return always the same result.
560/**
561 * Detects whether the web client needs [WAAPISim]{@link https://github.com/g200kg/WAAPISim} or not.
562 * @memberof CB_Configuration.CrossBase
563 * @name needsWAAPISim
564 * @function
565 * @returns {boolean}
566 */
567CB_Configuration[CB_BASE_NAME].needsWAAPISim = function()
568{
569 //If the last result is in the cache, we return again the same result:
570 if (typeof(CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn; }
571 //...otherwise (it is the first time), we calculate if we need it or not:
572 else
573 {
574 var waapisimForceSim = window.waapisimForceSim || undefined;
575 CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn = //Note: copied from waapisim.js
576 //TODO: see what IE versions are compatible.
577 (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 9") === -1)
578 &amp;&amp;
579 (
580 typeof(waapisimForceSim) !== "undefined" &amp;&amp; waapisimForceSim
581 ||
582 (
583 typeof(window.AudioContext) !== "undefined"
584 &amp;&amp; typeof(window.AudioContext.prototype.createOscillator) === "undefined" //Be careful! Pale Moon browser does not have createOscillator method.
585 &amp;&amp; (typeof(waapisimForceSimWhenLackOsc) === "undefined" || (typeof(waapisimForceSimWhenLackOsc) !== "undefined" &amp;&amp; waapisimForceSimWhenLackOsc))
586 )
587 ||
588 (
589 typeof(window.webkitAudioContext) !== "undefined"
590 &amp;&amp; typeof(window.webkitAudioContext.prototype.createOscillator) === "undefined" //Be careful! Pale Moon browser does not have createOscillator method.
591 &amp;&amp; (typeof(waapisimForceSimWhenLackOsc) === "undefined" || (typeof(waapisimForceSimWhenLackOsc) !== "undefined" &amp;&amp; waapisimForceSimWhenLackOsc))
592 )
593 || typeof(window.AudioContext) === "undefined" &amp;&amp; typeof(window.webkitAudioContext) === "undefined"
594 );
595 return CB_Configuration[CB_BASE_NAME].needsWAAPISimLastReturn;
596 }
597}
598
599
600CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn = null; //Cache to return always the same result.
601CB_Configuration[CB_BASE_NAME]._supportsCanvasElement = null;
602CB_Configuration[CB_BASE_NAME]._supportsCanvas = function()
603{
604 //If the last result is in the cache, we return again the same result:
605 if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn !== null) { return CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn; }
606 //...otherwise (it is the first time), we calculate if we need it or not:
607 else
608 {
609 CB_Configuration[CB_BASE_NAME]._supportsCanvasElement = CB_Configuration[CB_BASE_NAME]._supportsCanvasElement || document.createElement("canvas");
610
611 //If canvas is supported:
612 if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement !== null)
613 {
614 if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext !== null)
615 {
616 try //Uses try-catch to avoid some problems with some web clients (as BeZilla / Bon Echo 2.0.0.22Pre on Haiku OS):
617 {
618 //If fillText exists:
619 if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext("2d")) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext("2d") !== null)
620 {
621 CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn = true; //Canvas is supported.
622 return CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn;
623 }
624 } catch(E) { CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn = false; return CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn; }
625 }
626 }
627 CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn = false; //If we arrived here, canvas is not supported.
628 return CB_Configuration[CB_BASE_NAME]._supportsCanvasLastReturn;
629 }
630}
631
632
633CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn = null; //Cache to return always the same result.
634/**
635 * Detects whether the web client needs [Canbox]{@link https://github.com/robertinglin/CanBox} or not.
636 * @memberof CB_Configuration.CrossBase
637 * @name needsCanbox
638 * @function
639 * @returns {boolean}
640 */
641CB_Configuration[CB_BASE_NAME].needsCanbox = function()
642{
643 //If the last result is in the cache, we return again the same result:
644 if (typeof(CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn; }
645 //...otherwise (it is the first time), we calculate if we need it or not:
646 else
647 {
648 //We need it only if canvas is not already supported by the web client (and it is not IE5/5.5 since it doesn't support Canbox):
649 //CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn = (typeof(document.createElement("canvas").getContext) === "undefined" &amp;&amp; navigator.appVersion.indexOf("MSIE 5") === -1);
650 CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn = (!CB_Configuration[CB_BASE_NAME]._supportsCanvas() &amp;&amp; navigator.appVersion.indexOf("MSIE 5") === -1);
651 return CB_Configuration[CB_BASE_NAME].needsCanboxLastReturn;
652 }
653}
654
655
656CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn = null; //Cache to return always the same result.
657/**
658 * Detects whether the web client needs [ExplorerCanvas]{@link https://github.com/arv/explorercanvas} or not.
659 * @memberof CB_Configuration.CrossBase
660 * @name needsExplorerCanvas
661 * @function
662 * @returns {boolean}
663 */
664CB_Configuration[CB_BASE_NAME].needsExplorerCanvas = function()
665{
666 //If the last result is in the cache, we return again the same result:
667 if (typeof(CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn; }
668 //...otherwise (it is the first time), we calculate if we need it or not:
669 else
670 {
671 //We need it only if canvas is not already supported by the web client and the web client is IE 6, 7, 8 or 9 (IE9 doesn't support canvas in quirks mode and IE5/5.5 doesn't support ExplorerCanvas):
672 //CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn = (typeof(document.createElement("canvas").getContext) === "undefined" &amp;&amp; navigator.userAgent.indexOf('MSIE') !== -1 &amp;&amp; (navigator.appVersion.indexOf("MSIE 6") !== -1 || navigator.appVersion.indexOf("MSIE 7") !== -1 || navigator.appVersion.indexOf("MSIE 8") !== -1 || navigator.appVersion.indexOf("MSIE 9") !== -1));
673 CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn = (!CB_Configuration[CB_BASE_NAME]._supportsCanvas() &amp;&amp; navigator.userAgent.indexOf('MSIE') !== -1 &amp;&amp; (navigator.appVersion.indexOf("MSIE 6") !== -1 || navigator.appVersion.indexOf("MSIE 7") !== -1 || navigator.appVersion.indexOf("MSIE 8") !== -1 || navigator.appVersion.indexOf("MSIE 9") !== -1));
674 return CB_Configuration[CB_BASE_NAME].needsExplorerCanvasLastReturn;
675 }
676}
677
678
679//CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn = null; //Cache to return always the same result.
680/**
681 * Detects whether the web client needs [SLCanvas]{@link https://slcanvas.codeplex.com/} or not.
682 * @memberof CB_Configuration.CrossBase
683 * @name needsSLCanvas
684 * @function
685 * @returns {boolean}
686 */
687CB_Configuration[CB_BASE_NAME].needsSLCanvas = function()
688{
689 return !CB_Configuration[CB_BASE_NAME]._supportsCanvas();
690 /*
691 //If the last result is in the cache, we return again the same result:
692 if (typeof(CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn; }
693 //...otherwise (it is the first time), we calculate if we need it or not:
694 else
695 {
696 //We need it only if canvas is not already supported by the web client:
697 //CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn = (typeof(document.createElement("canvas").getContext) === "undefined");// &amp;&amp; navigator.appVersion.indexOf("MSIE 5") === -1);
698 CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn = !CB_Configuration[CB_BASE_NAME]._supportsCanvas();// &amp;&amp; navigator.appVersion.indexOf("MSIE 5") === -1);
699 return CB_Configuration[CB_BASE_NAME].needsSLCanvasLastReturn;
700 }
701 */
702}
703
704
705CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn = null; //Cache to return always the same result.
706/**
707 * Detects whether the web client needs [FlashCanvas]{@link https://github.com/everlaat/flashcanvas} or not.
708 * @memberof CB_Configuration.CrossBase
709 * @name needsFlashCanvas
710 * @function
711 * @returns {boolean}
712 */
713CB_Configuration[CB_BASE_NAME].needsFlashCanvas = function()
714{
715 //If the last result is in the cache, we return again the same result:
716 if (typeof(CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn; }
717 //...otherwise (it is the first time), we calculate if we need it or not:
718 else
719 {
720 //We need it only if ActiveXObject is available (it has to be IE) and it is not compatible with canvas:
721 CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn = (typeof(window.ActiveXObject) !== "undefined" &amp;&amp; typeof(window.CanvasRenderingContext2D) === "undefined");
722 return CB_Configuration[CB_BASE_NAME].needsFlashCanvasLastReturn;
723 }
724}
725
726
727CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn = null; //Cache to return always the same result.
728/**
729 * Detects whether the web client needs [canvas-text]{@link https://github.com/PhenX/canvas-text} or not.
730 * @memberof CB_Configuration.CrossBase
731 * @name needsCanvasText
732 * @function
733 * @returns {boolean}
734 */
735CB_Configuration[CB_BASE_NAME].needsCanvasText = function()
736{
737 //If the last result is in the cache, we return again the same result:
738 if (typeof(CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn !== null) { return CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn; }
739 //...otherwise (it is the first time), we calculate if we need it or not:
740 else
741 {
742 //CB_Configuration[CB_BASE_NAME]._supportsCanvasElement = CB_Configuration[CB_BASE_NAME]._supportsCanvasElement || document.createElement("canvas");
743
744 //If canvas is supported:
745 //if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement !== null)
746 //{
747 //if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext !== null)
748 //{
749 if (CB_Configuration[CB_BASE_NAME]._supportsCanvas())
750 {
751 try //Uses try-catch to avoid some problems with some web clients (as BeZilla / Bon Echo 2.0.0.22Pre on Haiku OS).
752 {
753 //If fillText exists:
754 if (typeof(CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext("2d").fillText) !== "undefined" &amp;&amp; CB_Configuration[CB_BASE_NAME]._supportsCanvasElement.getContext("2d").fillText !== null)
755 {
756 CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn = false; //We don't need canvas-text.
757 return CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn;
758 }
759 else { CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn = true; return CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn; }
760 } catch(E) { CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn = true; return CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn; }
761 }
762 //}
763 //}
764 CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn = false;
765 return CB_Configuration[CB_BASE_NAME].needsCanvasTextLastReturn;
766 }
767}
768
769
770/**
771 * Detects whether the web client needs [timbre.js]{@link https://mohayonao.github.io/timbre.js/} (including [subcollider.js]{@link https://github.com/mohayonao/subcollider}) or not.
772 * @function
773 * @memberof CB_Configuration.CrossBase
774 * @name needsTimbreJS
775 * @returns {boolean}
776 */
777CB_Configuration[CB_BASE_NAME].needsTimbreJS = function()
778{
779 //TODO: see what IE versions are compatible.
780 return (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 9") === -1);
781}
782
783
784/**
785 * Detects whether the web client needs [jsfx]{@link https://github.com/loov/jsfx} or not.
786 * @memberof CB_Configuration.CrossBase
787 * @name needsJsfx
788 * @function
789 * @returns {boolean}
790 */
791CB_Configuration[CB_BASE_NAME].needsJsfx = function()
792{
793 //TODO: see what IE versions are compatible.
794 return (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 9") === -1);
795}
796
797
798/**
799 * Detects whether the web client needs [Pressure.js]{@link https://pressurejs.com/} or not.
800 * @memberof CB_Configuration.CrossBase
801 * @name needsPressureJS
802 * @function
803 * @returns {boolean}
804 */
805CB_Configuration[CB_BASE_NAME].needsPressureJS= function()
806{
807 //TODO: see what IE versions are compatible.
808 return (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 9") === -1);
809}
810
811
812/**
813 * Detects whether the web client needs [Hammer.js]{@link http://hammerjs.github.io/} or not.
814 * @memberof CB_Configuration.CrossBase
815 * @name needsHammerJS
816 * @function
817 * @returns {boolean}
818 */
819CB_Configuration[CB_BASE_NAME].needsHammerJS = function()
820{
821 //TODO: see what IE versions are compatible.
822 return (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 9") === -1);
823}
824
825
826/**
827 * Detects whether the web client needs [gamepad-plus]{@link https://github.com/MozVR/gamepad-plus} or not.
828 * @memberof CB_Configuration.CrossBase
829 * @name needsGamepadPlus
830 * @function
831 * @returns {boolean}
832 * @todo Find a better way for this as old Firefox versions can only detect GamePad API support when the events are fired, so we cannot relay on navigator.getGamepads/navigator.webkitGetGamepads/navigator.webkitGamepads.
833 */
834CB_Configuration[CB_BASE_NAME].needsGamepadPlus = function()
835{
836 //TODO: Find a better way for this as old Firefox versions can only detect GamePad API support when the events are fired, so we cannot relay on navigator.getGamepads/navigator.webkitGetGamepads/navigator.webkitGamepads.
837 return !!(typeof(navigator) === "object" &amp;&amp; navigator !== null &amp;&amp; (navigator.getGamepads || navigator.webkitGetGamepads || navigator.webkitGamepads));
838}
839
840
841/**
842 * Detects whether the web client needs [NoSleep.js]{@link https://github.com/richtr/NoSleep.js} or not.
843 * @function
844 * @memberof CB_Configuration.CrossBase
845 * @name needsSleepJS
846 * @returns {boolean}
847 */
848CB_Configuration[CB_BASE_NAME].needsSleepJS = function()
849{
850 return (navigator.appVersion.indexOf("MSIE 5") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 6") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 7") === -1 &amp;&amp; navigator.appVersion.indexOf("MSIE 8") === -1);
851}
852
853
854
855//SockJS parameters:
856/**
857 * Directory that contains the [SockJS library]{@link https://github.com/sockjs/sockjs-client/} files.
858 * @memberof CB_Configuration.CrossBase
859 * @name SOCKJS_PATH
860 * @constant
861 * @type {string}
862 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "net/sockets/SockJS/"
863 */
864CB_Configuration[CB_BASE_NAME].SOCKJS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "net/sockets/SockJS/";
865
866
867/**
868 * The script file path for the [SockJS library]{@link https://github.com/sockjs/sockjs-client/}. As the newer [SockJS library]{@link https://github.com/sockjs/sockjs-client/} versions do not work in old Internet Explorer versions (6, 7 or 8), if they are detected it will use the [SockJS library]{@link https://github.com/sockjs/sockjs-client/} 0.3.4 version instead.
869 * @memberof CB_Configuration.CrossBase
870 * @name SOCKJS_PATH_SCRIPT_FILE
871 * @constant
872 * @type {string}
873 * @default {@link CB_Configuration[CB_BASE_NAME].SOCKJS_PATH} + SOCKJS_SCRIPT_FILE, where "SOCKJS_SCRIPT_FILE" is sockjs-0.3.4.min.js (SockJS 0.3.4), sockjs-1.1.1.min.js (SockJS 1.1.1) or sockjs.min.js (last version) depending on the client detected.
874 */
875CB_Configuration[CB_BASE_NAME].SOCKJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].SOCKJS_PATH;
876if (navigator.appVersion.indexOf("MSIE 5") !== -1 || navigator.appVersion.indexOf("MSIE 6") !== -1 || navigator.appVersion.indexOf("MSIE 7") !== -1 || navigator.appVersion.indexOf("MSIE 8") !== -1) { CB_Configuration[CB_BASE_NAME].SOCKJS_PATH_SCRIPT_FILE += "sockjs-0.3.4.min.js"; }
877else if (navigator.appVersion.indexOf("MSIE 9") !== -1) { CB_Configuration[CB_BASE_NAME].SOCKJS_PATH_SCRIPT_FILE += "sockjs-1.1.1.min.js"; }
878else { CB_Configuration[CB_BASE_NAME].SOCKJS_PATH_SCRIPT_FILE += "sockjs.min.js"; }
879
880
881//Intel XDK parameters:
882/**
883 * Defines whether to load or not intelxdk.js (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
884 * @memberof CB_Configuration.CrossBase
885 * @name INTELXDKJS_LOAD
886 * @constant
887 * @type {boolean}
888 * @default
889 */
890CB_Configuration[CB_BASE_NAME].INTELXDKJS_LOAD = false; //CB_Configuration[CB_BASE_NAME].needsIntelXDKJS();
891
892/**
893 * Directory that contains the "intelxdk.js" file (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
894 * @memberof CB_Configuration.CrossBase
895 * @name INTELXDKJS_PATH
896 * @constant
897 * @type {string}
898 * @default
899 */
900CB_Configuration[CB_BASE_NAME].INTELXDKJS_PATH = "../";
901
902/**
903 * The script file path for intelxdk.js (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
904 * @memberof CB_Configuration.CrossBase
905 * @name INTELXDKJS_PATH_SCRIPT_FILE
906 * @constant
907 * @type {string}
908 * @default {@link CB_Configuration.CrossBase.INTELXDKJS_PATH} + "intelxdk.js"
909 */
910CB_Configuration[CB_BASE_NAME].INTELXDKJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].INTELXDKJS_PATH + "intelxdk.js";
911
912/**
913 * Defines whether the path defined in {@link CB_Configuration.CrossBase.INTELXDKJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
914 * @memberof CB_Configuration.CrossBase
915 * @name INTELXDKJS_PATH_ABSOLUTE
916 * @constant
917 * @type {boolean}
918 * @default
919 */
920CB_Configuration[CB_BASE_NAME].INTELXDKJS_PATH_ABSOLUTE = false;
921
922/**
923 * Defines whether to try to load or not init-dev.js (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
924 If set to true, the checker defined at {@link CB_Configuration.CrossBase.INTELXDK_INITDEVJS_LOAD_CHECKER} will finally decide whether to load it or not.
925 * @memberof CB_Configuration.CrossBase
926 * @name INTELXDK_INITDEVJS_LOAD
927 * @constant
928 * @type {boolean}
929 * @default
930 */
931CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_LOAD = false; //CB_Configuration[CB_BASE_NAME].needsIntelXDKJS();
932
933/**
934 * Callback checker to determine whether init-dev.js (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}) is needed or not. Requires {@link CB_Configuration.CrossBase.INTELXDK_INITDEVJS_LOAD} set to true.
935 * @memberof CB_Configuration.CrossBase
936 * @name INTELXDK_INITDEVJS_LOAD_CHECKER
937 * @constant
938 * @type {CB_Modules.neededFile_LOAD_CHECKER}
939 * @default false
940 */
941CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_LOAD_CHECKER = false; //function(currentPath, info) { return (typeof(dev) === "undefined" || dev === null || typeof(dev.initDeviceReady) !== "function"); };
942
943/**
944 * Directory that contains the "init-dev.js" (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
945 * @memberof CB_Configuration.CrossBase
946 * @name INTELXDK_INITDEVJS_PATH
947 * @constant
948 * @type {string}
949 * @default
950 */
951CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_PATH = "../xdk/";
952
953/**
954 * The script file path for init-dev.js file (used by [Intel XDK]{@link https://en.wikipedia.org/wiki/Intel_XDK}).
955 * @memberof CB_Configuration.CrossBase
956 * @name INTELXDK_INITDEVJS_PATH_SCRIPT_FILE
957 * @constant
958 * @type {string}
959 * @default {@link CB_Configuration.CrossBase.INTELXDK_INITDEVJS_PATH} + "init-dev.js"
960 */
961CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_PATH + "init-dev.js";
962
963/**
964 * Defines whether the path defined in {@link CB_Configuration.CrossBase.INTELXDK_INITDEVJS_PATH} is either absolute or relative to the CrossBrowdy script path.
965 * @memberof CB_Configuration.CrossBase
966 * @name INTELXDK_INITDEVJS_PATH_ABSOLUTE
967 * @constant
968 * @type {boolean}
969 * @default
970 */
971CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_PATH_ABSOLUTE = false;
972
973
974//PhoneGap parameters:
975/**
976 * Defines whether to load or not phonegap.js (used by [Adobe PhoneGap]{@link https://phonegap.com/}).
977 * @memberof CB_Configuration.CrossBase
978 * @name PHONEGAPJS_LOAD
979 * @constant
980 * @type {boolean}
981 * @default
982 */
983CB_Configuration[CB_BASE_NAME].PHONEGAPJS_LOAD = false; //CB_Configuration[CB_BASE_NAME].needsPhoneGapJS();
984
985/**
986 * Directory that contains the "phonegap.js" (used by [Adobe PhoneGap]{@link https://phonegap.com/}) file.
987 * @memberof CB_Configuration.CrossBase
988 * @name PHONEGAPJS_PATH
989 * @constant
990 * @type {string}
991 * @default
992 */
993CB_Configuration[CB_BASE_NAME].PHONEGAPJS_PATH = "../";
994
995/**
996 * The script file path for phonegap.js (used by [Adobe PhoneGap]{@link https://phonegap.com/}).
997 * @memberof CB_Configuration.CrossBase
998 * @name PHONEGAPJS_PATH_SCRIPT_FILE
999 * @constant
1000 * @type {string}
1001 * @default {@link CB_Configuration.CrossBase.PHONEGAPJS_PATH} + "phonegap.js"
1002 */
1003CB_Configuration[CB_BASE_NAME].PHONEGAPJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].PHONEGAPJS_PATH + "phonegap.js";
1004
1005/**
1006 * Defines whether the path defined in {@link CB_Configuration.CrossBase.PHONEGAPJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1007 * @memberof CB_Configuration.CrossBase
1008 * @name PHONEGAPJS_PATH_ABSOLUTE
1009 * @constant
1010 * @type {boolean}
1011 * @default
1012 */
1013CB_Configuration[CB_BASE_NAME].PHONEGAPJS_PATH_ABSOLUTE = false;
1014
1015
1016//Apache Cordova parameters:
1017/**
1018 * Defines whether to try to load or not cordova.js (used by [Apache Cordova]{@link https://cordova.apache.org/}). It should not be loaded together with phonegap.js, normally.
1019 If set to true, the checker defined at {@link CB_Configuration.CrossBase.CORDOVAJS_LOAD_CHECKER} will finally decide whether to load it or not.
1020 * @memberof CB_Configuration.CrossBase
1021 * @name CORDOVAJS_LOAD
1022 * @constant
1023 * @type {boolean}
1024 * @default !{@link CB_Configuration.CrossBase.PHONEGAPJS_LOAD}
1025 */
1026CB_Configuration[CB_BASE_NAME].CORDOVAJS_LOAD =
1027 !CB_Configuration[CB_BASE_NAME].PHONEGAPJS_LOAD &amp;&amp; window.location &amp;&amp; window.location.protocol !== "http:" &amp;&amp; window.location.protocol !== "https:" &amp;&amp; navigator.userAgent.indexOf("Electron") === -1 &amp;&amp;
1028 (
1029 typeof(require) !== "function" || (typeof(nw) === "undefined" &amp;&amp; (nw === null || !nw.App) &amp;&amp; typeof(require("nw.gui")) === "undefined")
1030 ); //CB_Configuration[CB_BASE_NAME].needsCordovaJS();
1031
1032/**
1033 * Callback checker to determine whether cordova.js (used by [Apache Cordova]{@link https://cordova.apache.org/}) is needed or not. Requires {@link CB_Configuration.CrossBase.CORDOVAJS_LOAD} set to true.
1034 * @memberof CB_Configuration.CrossBase
1035 * @name CORDOVAJS_LOAD_CHECKER
1036 * @constant
1037 * @type {CB_Modules.neededFile_LOAD_CHECKER}
1038 * @default function(currentPath, info) { return (typeof(window.cordova) === "undefined"); }
1039 */
1040CB_Configuration[CB_BASE_NAME].CORDOVAJS_LOAD_CHECKER = function(currentPath, info) { return (typeof(window.cordova) === "undefined"); };
1041
1042/**
1043 * Directory that contains the "cordova.js" file (used by [Apache Cordova]{@link https://cordova.apache.org/}).
1044 * @memberof CB_Configuration.CrossBase
1045 * @name CORDOVAJS_PATH
1046 * @constant
1047 * @type {string}
1048 * @default
1049 */
1050CB_Configuration[CB_BASE_NAME].CORDOVAJS_PATH = "../";
1051
1052/**
1053 * The script file path for the cordova.js file (used by [Apache Cordova]{@link https://cordova.apache.org/}).
1054 * @memberof CB_Configuration.CrossBase
1055 * @name CORDOVAJS_PATH_SCRIPT_FILE
1056 * @constant
1057 * @type {string}
1058 * @default {@link CB_Configuration.CrossBase.CORDOVAJS_PATH} + "cordova.js"
1059 */
1060CB_Configuration[CB_BASE_NAME].CORDOVAJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].CORDOVAJS_PATH + "cordova.js";
1061
1062/**
1063 * Defines whether the path defined in {@link CB_Configuration.CrossBase.CORDOVAJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1064 * @memberof CB_Configuration.CrossBase
1065 * @name CORDOVAJS_PATH_ABSOLUTE
1066 * @constant
1067 * @type {boolean}
1068 * @default
1069 */
1070CB_Configuration[CB_BASE_NAME].CORDOVAJS_PATH_ABSOLUTE = false;
1071
1072
1073//localStorage polyfill parameters:
1074/**
1075 * Defines whether to load or not [localStorage polyfill]{@link https://github.com/mortzdk/localStorage}.
1076 * @memberof CB_Configuration.CrossBase
1077 * @name LOCALSTORAGE_POLYFILL_LOAD
1078 * @constant
1079 * @type {boolean}
1080 * @default
1081 */
1082CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_LOAD = true;
1083
1084/**
1085 * Directory that contains the [localStorage polyfill]{@link https://github.com/mortzdk/localStorage} files.
1086 * @memberof CB_Configuration.CrossBase
1087 * @name LOCALSTORAGE_POLYFILL_PATH
1088 * @constant
1089 * @type {string}
1090 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "general/localStorage/"
1091 */
1092CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "general/localStorage/";
1093
1094/**
1095 * Directory that contains the SWF for [localStorage polyfill]{@link https://github.com/mortzdk/localStorage}. The value of the "scriptPathGiven" parameter will be attached at the beginning automatically. Belongs to the "swfURL" parameter (URL "GET" parameter) of the library when the localStorage script file is attached.
1096 * @memberof CB_Configuration.CrossBase
1097 * @name LOCALSTORAGE_POLYFILL_PATH_SWF
1098 * @constant
1099 * @type {string}
1100 * @default {@link CB_Configuration.CrossBase.LOCALSTORAGE_POLYFILL_PATH} + "localStorage.swf"
1101 */
1102CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_SWF_FILE = CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH + "localStorage.swf";
1103//CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_SWF_FILE = "localStorage.swf";
1104
1105/**
1106 * The script file path for [localStorage polyfill]{@link https://github.com/mortzdk/localStorage}.
1107 * @memberof CB_Configuration.CrossBase
1108 * @name LOCALSTORAGE_POLYFILL_PATH_SCRIPT_FILE
1109 * @constant
1110 * @type {string}
1111 * @default {@link CB_Configuration.CrossBase.LOCALSTORAGE_POLYFILL_PATH} + "localStorage.min.js?swfURL=" + CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_SWF_FILE
1112 */
1113CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH + "localStorage.min.js?swfURL=" + CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_SWF_FILE;
1114
1115/**
1116 * Defines whether the path defined in {@link CB_Configuration.CrossBase.LOCALSTORAGE_POLYFILL_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1117 * @memberof CB_Configuration.CrossBase
1118 * @name LOCALSTORAGE_POLYFILL_PATH_ABSOLUTE
1119 * @constant
1120 * @type {boolean}
1121 * @default
1122 */
1123CB_Configuration[CB_BASE_NAME].LOCALSTORAGE_POLYFILL_PATH_ABSOLUTE = false;
1124
1125
1126//WAAPISim parameters:
1127/**
1128 * Defines whether to load or not [WAAPISim]{@link https://github.com/g200kg/WAAPISim}.
1129 * @memberof CB_Configuration.CrossBase
1130 * @name WAAPISIM_LOAD
1131 * @constant
1132 * @type {boolean}
1133 * @default {@link CB_Configuration.CrossBase.WAAPI_EMULATION_ALLOWED} &amp;&amp; {@link CB_Configuration.CrossBase.needsWAAPISim}()
1134 */
1135CB_Configuration[CB_BASE_NAME].WAAPISIM_LOAD = CB_Configuration[CB_BASE_NAME].WAAPI_EMULATION_ALLOWED &amp;&amp; CB_Configuration[CB_BASE_NAME].needsWAAPISim();
1136
1137
1138/**
1139 * Directory that contains the [WAAPISim]{@link https://github.com/g200kg/WAAPISim} files (script and SWF).
1140 * @memberof CB_Configuration.CrossBase
1141 * @name WAAPISIM_PATH
1142 * @constant
1143 * @type {string}
1144 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/audio/WAAPISim/"
1145 */
1146CB_Configuration[CB_BASE_NAME].WAAPISIM_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/audio/WAAPISim/";
1147
1148/**
1149 * The script file path for the [WAAPISim]{@link https://github.com/g200kg/WAAPISim} script file.
1150 * @memberof CB_Configuration.CrossBase
1151 * @name WAAPISIM_PATH_SCRIPT_FILE
1152 * @constant
1153 * @type {string}
1154 * @default {@link CB_Configuration.CrossBase.WAAPISIM_PATH} + "waapisim.min.js"
1155 */
1156CB_Configuration[CB_BASE_NAME].WAAPISIM_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].WAAPISIM_PATH + "waapisim.min.js";
1157
1158/**
1159 * Defines whether the path defined in {@link CB_Configuration.CrossBase.WAAPISIM_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1160 * @memberof CB_Configuration.CrossBase
1161 * @name WAAPISIM_PATH_ABSOLUTE
1162 * @constant
1163 * @type {boolean}
1164 * @default
1165 */
1166CB_Configuration[CB_BASE_NAME].WAAPISIM_PATH_ABSOLUTE = false;
1167
1168
1169//timbre.js (including subcollider.js) parameters:
1170/**
1171 * Defines whether to load or not [timbre.js]{@link https://mohayonao.github.io/timbre.js/}.
1172 * @memberof CB_Configuration.CrossBase
1173 * @name TIMBREJS_LOAD
1174 * @constant
1175 * @type {boolean}
1176 * @default {@link CB_Configuration.CrossBase.needsTimbreJS}()
1177 */
1178CB_Configuration[CB_BASE_NAME].TIMBREJS_LOAD = CB_Configuration[CB_BASE_NAME].needsTimbreJS();
1179
1180/**
1181 * Directory that contains the [timbre.js]{@link https://mohayonao.github.io/timbre.js/} files (script and SWF).
1182 * @memberof CB_Configuration.CrossBase
1183 * @name TIMBREJS_PATH
1184 * @constant
1185 * @type {string}
1186 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/audio/timbre.js/"
1187 */
1188CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/audio/timbre.js/";
1189
1190/**
1191 * The script file path for [timbre.js]{@link https://mohayonao.github.io/timbre.js/}.
1192 * @memberof CB_Configuration.CrossBase
1193 * @name TIMBREJS_PATH_SCRIPT_FILE
1194 * @constant
1195 * @type {string}
1196 * @default {@link CB_Configuration.CrossBase.TIMBREJS_PATH} + "timbre.js"
1197 */
1198CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH + "timbre.js";
1199
1200/**
1201 * Defines whether the path defined in {@link CB_Configuration.CrossBase.TIMBREJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1202 * @memberof CB_Configuration.CrossBase
1203 * @name TIMBREJS_PATH_ABSOLUTE
1204 * @constant
1205 * @type {boolean}
1206 * @default
1207 */
1208CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH_ABSOLUTE = false;
1209
1210/**
1211 * Defines whether to load or not [subcollider.js]{@link https://github.com/mohayonao/subcollider}.
1212 * @memberof CB_Configuration.CrossBase
1213 * @name SUBCOLLIDERJS_LOAD
1214 * @constant
1215 * @type {boolean}
1216 * @default {@link CB_Configuration.CrossBase.TIMBREJS_LOAD}
1217 */
1218CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_LOAD = CB_Configuration[CB_BASE_NAME].TIMBREJS_LOAD;
1219
1220/**
1221 * Directory that contains the [subcollider.js]{@link https://github.com/mohayonao/subcollider} script.
1222 * @memberof CB_Configuration.CrossBase
1223 * @name SUBCOLLIDERJS_PATH
1224 * @constant
1225 * @type {string}
1226 * @default {@link CB_Configuration.CrossBase.TIMBREJS_PATH} + "subcollider/"
1227 */
1228CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_PATH = CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH + "subcollider/";
1229
1230/**
1231 * The script file path for [subcollider.js]{@link https://github.com/mohayonao/subcollider}.
1232 * @memberof CB_Configuration.CrossBase
1233 * @name SUBCOLLIDERJS_PATH_SCRIPT_FILE
1234 * @constant
1235 * @type {string}
1236 * @default {@link CB_Configuration.CrossBase.SUBCOLLIDERJS_PATH} + "subcollider.js"
1237 */
1238CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_PATH + "subcollider.js";
1239
1240/**
1241 * Defines whether the path defined in {@link CB_Configuration.CrossBase.SUBCOLLIDERJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1242 * @memberof CB_Configuration.CrossBase
1243 * @name SUBCOLLIDERJS_PATH_ABSOLUTE
1244 * @constant
1245 * @type {boolean}
1246 * @default
1247 */
1248CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_PATH_ABSOLUTE = false;
1249
1250
1251//Band.js parameters:
1252/**
1253 * Defines whether to load or not [Band.js]{@link https://github.com/meenie/band.js/}.
1254 * @memberof CB_Configuration.CrossBase
1255 * @name BANDJS_LOAD
1256 * @constant
1257 * @type {boolean}
1258 * @default typeof(window.AudioContext) !== "undefined" || typeof(window.webkitAudioContext) !== "undefined"
1259 */
1260CB_Configuration[CB_BASE_NAME].BANDJS_LOAD = typeof(window.AudioContext) !== "undefined" || typeof(window.webkitAudioContext) !== "undefined";
1261
1262/**
1263 * Directory that contains the [Band.js]{@link https://github.com/meenie/band.js/} files.
1264 * @memberof CB_Configuration.CrossBase
1265 * @name BANDJS_PATH
1266 * @constant
1267 * @type {string}
1268 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/audio/band.js/"
1269 */
1270CB_Configuration[CB_BASE_NAME].BANDJS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/audio/band.js/";
1271
1272/**
1273 * The script file path for [Band.js]{@link https://github.com/meenie/band.js/}.
1274 * @memberof CB_Configuration.CrossBase
1275 * @name BANDJS_PATH_SCRIPT_FILE
1276 * @constant
1277 * @type {string}
1278 * @default {@link CB_Configuration.CrossBase.BANDJS_PATH} + "band.min.js"
1279 */
1280CB_Configuration[CB_BASE_NAME].BANDJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].BANDJS_PATH + "band.min.js";
1281
1282/**
1283 * Defines whether the path defined in {@link CB_Configuration.CrossBase.BANDJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1284 * @memberof CB_Configuration.CrossBase
1285 * @name BANDJS_PATH_ABSOLUTE
1286 * @constant
1287 * @type {boolean}
1288 * @default
1289 */
1290CB_Configuration[CB_BASE_NAME].BANDJS_PATH_ABSOLUTE = false;
1291
1292
1293//SoundManager 2 parameters:
1294/**
1295 * Defines whether to load or not [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}.
1296 * @memberof CB_Configuration.CrossBase
1297 * @name SM2_LOAD
1298 * @constant
1299 * @type {boolean}
1300 * @default
1301 */
1302CB_Configuration[CB_BASE_NAME].SM2_LOAD = true;
1303
1304/**
1305 * Directory that contains the [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/} files.
1306 * @memberof CB_Configuration.CrossBase
1307 * @name SM2_PATH
1308 * @constant
1309 * @type {string}
1310 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/audio/soundmanager2/"
1311 */
1312CB_Configuration[CB_BASE_NAME].SM2_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/audio/soundmanager2/";
1313
1314/**
1315 * The script file path for [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}.
1316 * @memberof CB_Configuration.CrossBase
1317 * @name SM2_PATH_SCRIPT_FILE
1318 * @constant
1319 * @type {string}
1320 * @default {@link CB_Configuration.CrossBase.SM2_PATH} + "script/soundmanager2-nodebug-jsmin.js"
1321 */
1322CB_Configuration[CB_BASE_NAME].SM2_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].SM2_PATH + "script/soundmanager2-nodebug-jsmin.js";
1323
1324/**
1325 * Directory that contains the SWF's for [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}. The value of the "scriptPathGiven" parameter will be attached at the beginning automatically. Belongs to the "url" parameter of the library when [soundManager.setup]{@link http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-setup} function is called. More information: http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-url
1326 * @memberof CB_Configuration.CrossBase
1327 * @name SM2_PATH_SWF
1328 * @constant
1329 * @type {string}
1330 * @default {@link CB_Configuration.CrossBase.SM2_PATH} + "swf/"
1331 */
1332CB_Configuration[CB_BASE_NAME].SM2_PATH_SWF = CB_Configuration[CB_BASE_NAME].SM2_PATH + "swf/";
1333
1334/**
1335 * Defines whether the path defined in {@link CB_Configuration.CrossBase.SM2_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1336 * @memberof CB_Configuration.CrossBase
1337 * @name SM2_PATH_ABSOLUTE
1338 * @constant
1339 * @type {boolean}
1340 * @default
1341 */
1342CB_Configuration[CB_BASE_NAME].SM2_PATH_ABSOLUTE = false;
1343
1344/**
1345 * Object with the required formats for [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}. If the format is required and the web client doesn't support it, [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/} will use [Flash]{@link https://en.wikipedia.org/wiki/Adobe_Flash_Player}. More information: http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-audioformats
1346 * @memberof CB_Configuration.CrossBase
1347 * @name SM2_AUDIO_FORMATS_REQUIRED
1348 * @constant
1349 * @type {Object}
1350 * @property {boolean} mp3=false - Defines MP3 format as required.
1351 * @property {boolean} mp4=false - Defines MP4 format as required.
1352 * @property {boolean} ogg=false - Defines OGG format as required.
1353 * @property {boolean} opus=false - Defines OPUS format as required.
1354 * @property {boolean} wav=false - Defines WAV format as required.
1355 * @default
1356 */
1357CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED = { "mp3" : false, "mp4" : false, "ogg" : false, "opus" : false, "wav" : false };
1358
1359/**
1360 * Defines whether to use or not high performance mode in [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/} (may cause a flash object to be visible). Belongs to the "useHighPerformance" parameter of the library when [soundManager.setup]{@link http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-setup} function is called. More information: http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-highperformance
1361 * @memberof CB_Configuration.CrossBase
1362 * @name SM2_USE_HIGH_PERFORMANCE
1363 * @constant
1364 * @type {boolean}
1365 * @default
1366 */
1367CB_Configuration[CB_BASE_NAME].SM2_USE_HIGH_PERFORMANCE = true;
1368
1369/**
1370 * Milliseconds to wait after loading [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/} to define it as not supported if there is no response. Belongs to the "flashLoadTimeout" parameter of the library when [soundManager.setup]{@link http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-setup} function is called. More information: http://www.schillmania.com/projects/soundmanager2/doc/#soundmanager-flashloadtimeout
1371 * @memberof CB_Configuration.CrossBase
1372 * @name SM2_TIMEOUT_MS
1373 * @constant
1374 * @type {integer}
1375 * @default
1376 */
1377CB_Configuration[CB_BASE_NAME].SM2_TIMEOUT_MS = 6000;
1378
1379//CB_Configuration[CB_BASE_NAME].SM2_USE_FAST_POLLING = true; //Defines whether to use fast polling (useFastPolling) in [SoundManager 2]{@link http://schillmania.com/projects/soundmanager2/}.
1380
1381
1382//jsfx parameters:
1383/**
1384 * Defines whether to load or not [jsfx]{@link https://github.com/loov/jsfx}.
1385 * @memberof CB_Configuration.CrossBase
1386 * @name JSFX_LOAD
1387 * @constant
1388 * @type {boolean}
1389 * @default {@link CB_Configuration.CrossBase.needsJsfx}()
1390 */
1391CB_Configuration[CB_BASE_NAME].JSFX_LOAD = CB_Configuration[CB_BASE_NAME].needsJsfx();
1392
1393/**
1394 * Directory that contains the [jsfx]{@link https://github.com/loov/jsfx} files.
1395 * @memberof CB_Configuration.CrossBase
1396 * @name JSFX_PATH
1397 * @constant
1398 * @type {string}
1399 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/audio/jsfx/"
1400 */
1401CB_Configuration[CB_BASE_NAME].JSFX_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/audio/jsfx/";
1402
1403/**
1404 * The script file path for [jsfx]{@link https://github.com/loov/jsfx}.
1405 * @memberof CB_Configuration.CrossBase
1406 * @name JSFX_PATH_SCRIPT_FILE
1407 * @constant
1408 * @type {string}
1409 * @default {@link CB_Configuration.CrossBase.JSFX_PATH} + "jsfx.js"
1410 */
1411CB_Configuration[CB_BASE_NAME].JSFX_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].JSFX_PATH + "jsfx.js";
1412
1413/**
1414 * Defines whether the path defined in {@link CB_Configuration.CrossBase.JSFX_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1415 * @memberof CB_Configuration.CrossBase
1416 * @name JSFX_PATH_ABSOLUTE
1417 * @constant
1418 * @type {boolean}
1419 * @default
1420 */
1421CB_Configuration[CB_BASE_NAME].JSFX_PATH_ABSOLUTE = false;
1422
1423
1424//NoSleep.js parameters:
1425/**
1426 * Defines whether to load or not [NoSleep.js]{@link https://github.com/richtr/NoSleep.js}.
1427 * @memberof CB_Configuration.CrossBase
1428 * @name NOSLEEP_LOAD
1429 * @constant
1430 * @type {boolean}
1431 * @default {@link CB_Configuration.CrossBase.needsSleepJS}()
1432 */
1433CB_Configuration[CB_BASE_NAME].NOSLEEP_LOAD = CB_Configuration[CB_BASE_NAME].needsSleepJS();
1434
1435/**
1436 * Directory that contains the [NoSleep.js]{@link https://github.com/richtr/NoSleep.js} files.
1437 * @memberof CB_Configuration.CrossBase
1438 * @name NOSLEEP_PATH
1439 * @constant
1440 * @type {string}
1441 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/NoSleep/"
1442 */
1443CB_Configuration[CB_BASE_NAME].NOSLEEP_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/NoSleep/";
1444
1445/**
1446 * The script file path for [NoSleep.js]{@link https://github.com/richtr/NoSleep.js}.
1447 * @memberof CB_Configuration.CrossBase
1448 * @name NOSLEEP_PATH_SCRIPT_FILE
1449 * @constant
1450 * @type {string}
1451 * @default {@link CB_Configuration.CrossBase.NOSLEEP_PATH} + "NoSleep.min.js"
1452 */
1453CB_Configuration[CB_BASE_NAME].NOSLEEP_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].NOSLEEP_PATH + "NoSleep.min.js";
1454
1455/**
1456 * Defines whether the path defined in {@link CB_Configuration.CrossBase.NOSLEEP_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1457 * @memberof CB_Configuration.CrossBase
1458 * @name NOSLEEP_PATH_ABSOLUTE
1459 * @constant
1460 * @type {boolean}
1461 * @default
1462 */
1463CB_Configuration[CB_BASE_NAME].NOSLEEP_PATH_ABSOLUTE = false;
1464
1465
1466//Pressure.js parameters:
1467/**
1468 * Defines whether to load or not [Pressure.js]{@link https://pressurejs.com/}.
1469 * @memberof CB_Configuration.CrossBase
1470 * @name PRESSUREJS_LOAD
1471 * @constant
1472 * @type {boolean}
1473 * @default {@link CB_Configuration.CrossBase.needsPressureJS}()
1474 */
1475CB_Configuration[CB_BASE_NAME].PRESSUREJS_LOAD = CB_Configuration[CB_BASE_NAME].needsPressureJS();
1476
1477/**
1478 * Directory that contains the [Pressure.js]{@link https://pressurejs.com/} files.
1479 * @memberof CB_Configuration.CrossBase
1480 * @name PRESSUREJS_PATH
1481 * @constant
1482 * @type {string}
1483 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "input/pressure.js/"
1484 */
1485CB_Configuration[CB_BASE_NAME].PRESSUREJS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "input/pressure.js/";
1486
1487/**
1488 * The script file path for [Pressure.js]{@link https://pressurejs.com/}.
1489 * @memberof CB_Configuration.CrossBase
1490 * @name PRESSUREJS_PATH_SCRIPT_FILE
1491 * @constant
1492 * @type {string}
1493 * @default {@link CB_Configuration.CrossBase.PRESSUREJS_PATH} + "pressure.min.js"
1494 */
1495CB_Configuration[CB_BASE_NAME].PRESSUREJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].PRESSUREJS_PATH + "pressure.min.js";
1496
1497/**
1498 * Defines whether the path defined in {@link CB_Configuration.CrossBase.PRESSUREJS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1499 * @memberof CB_Configuration.CrossBase
1500 * @name PRESSUREJS_PATH_ABSOLUTE
1501 * @constant
1502 * @type {boolean}
1503 * @default
1504 */
1505CB_Configuration[CB_BASE_NAME].PRESSUREJS_PATH_ABSOLUTE = false;
1506
1507
1508//Hammer.js and Hammer Time parameters:
1509/**
1510 * Defines whether to load or not [Hammer.js]{@link http://hammerjs.github.io/} and [Hammer Time]{@link https://github.com/hammerjs/hammer-time}.
1511 * @memberof CB_Configuration.CrossBase
1512 * @name HAMMERJS_LOAD
1513 * @constant
1514 * @type {boolean}
1515 * @default {@link CB_Configuration.CrossBase.needsHammerJS}()
1516 */
1517CB_Configuration[CB_BASE_NAME].HAMMERJS_LOAD = CB_Configuration[CB_BASE_NAME].needsHammerJS();
1518
1519/**
1520 * Directory that contains the [Hammer.js]{@link http://hammerjs.github.io/} and [Hammer Time]{@link https://github.com/hammerjs/hammer-time} files.
1521 * @memberof CB_Configuration.CrossBase
1522 * @name HAMMERJS_PATH
1523 * @constant
1524 * @type {string}
1525 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "input/hammer.js/"
1526 */
1527CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "input/hammer.js/";
1528
1529/**
1530 * The script file path for [Hammer.js]{@link http://hammerjs.github.io/}.
1531 * @memberof CB_Configuration.CrossBase
1532 * @name HAMMERJS_PATH_SCRIPT_FILE
1533 * @constant
1534 * @type {string}
1535 * @default {@link CB_Configuration.CrossBase.HAMMERJS_PATH} + "hammer.min.js"
1536 */
1537CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH + "hammer.min.js";
1538
1539/**
1540 * The script file path for [Hammer Time]{@link https://github.com/hammerjs/hammer-time}.
1541 * @memberof CB_Configuration.CrossBase
1542 * @name HAMMERJS_HAMMER_TIME_PATH_SCRIPT_FILE
1543 * @constant
1544 * @type {string}
1545 * @default {@link CB_Configuration.CrossBase.HAMMERJS_PATH} + "hammer-time/hammer-time.min.js"
1546 */
1547CB_Configuration[CB_BASE_NAME].HAMMERJS_HAMMER_TIME_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH + "hammer-time/hammer-time.min.js";
1548
1549/**
1550 * Defines whether the paths defined in {@link CB_Configuration.CrossBase.HAMMERJS_PATH_SCRIPT_FILE} and {@link CB_Configuration.CrossBase.HAMMERJS_HAMMER_TIME_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1551 * @memberof CB_Configuration.CrossBase
1552 * @name HAMMERJS_PATH_ABSOLUTE
1553 * @constant
1554 * @type {boolean}
1555 * @default
1556 */
1557CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH_ABSOLUTE = false;
1558
1559
1560//wii-js parameters:
1561/**
1562 * Defines whether to load or not [wii-js]{@link https://github.com/ryanmcgrath/wii-js}.
1563 * @memberof CB_Configuration.CrossBase
1564 * @name WII_JS_LOAD
1565 * @constant
1566 * @type {boolean}
1567 * @default
1568 */
1569CB_Configuration[CB_BASE_NAME].WII_JS_LOAD = true;
1570
1571/**
1572 * Directory that contains the [wii-js]{@link https://github.com/ryanmcgrath/wii-js} script.
1573 * @memberof CB_Configuration.CrossBase
1574 * @name WII_JS_PATH
1575 * @constant
1576 * @type {string}
1577 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "input/controllers/wii-js/"
1578 */
1579CB_Configuration[CB_BASE_NAME].WII_JS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "input/controllers/wii-js/";
1580
1581/**
1582 * The script file path for [wii-js]{@link https://github.com/ryanmcgrath/wii-js}.
1583 * @memberof CB_Configuration.CrossBase
1584 * @name WII_JS_PATH_SCRIPT_FILE
1585 * @constant
1586 * @type {string}
1587 * @default {@link CB_Configuration.CrossBase.WII_JS_PATH} + "wii.min.js"
1588 */
1589CB_Configuration[CB_BASE_NAME].WII_JS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].WII_JS_PATH + "wii.min.js";
1590
1591/**
1592 * Defines whether the path defined in {@link CB_Configuration.CrossBase.WII_JS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1593 * @memberof CB_Configuration.CrossBase
1594 * @name WII_JS_PATH_ABSOLUTE
1595 * @constant
1596 * @type {boolean}
1597 * @default
1598 */
1599CB_Configuration[CB_BASE_NAME].WII_JS_PATH_ABSOLUTE = false;
1600
1601
1602//gamepad-plus parameters:
1603/**
1604 * Defines whether to load or not [gamepad-plus]{@link https://github.com/MozVR/gamepad-plus}.
1605 * @memberof CB_Configuration.CrossBase
1606 * @name GAMEPAD_PLUS_LOAD
1607 * @constant
1608 * @type {boolean}
1609 * @default {@link CB_Configuration.CrossBase.needsGamepadPlus}()
1610 */
1611CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_LOAD = CB_Configuration[CB_BASE_NAME].needsGamepadPlus();
1612
1613/**
1614 * Directory that contains the [gamepad-plus]{@link https://github.com/MozVR/gamepad-plus} files.
1615 * @memberof CB_Configuration.CrossBase
1616 * @name GAMEPAD_PLUS_PATH
1617 * @constant
1618 * @type {string}
1619 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "input/controllers/gamepad-plus/"
1620 */
1621CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "input/controllers/gamepad-plus/";
1622
1623/**
1624 * The script file path for [gamepad-plus]{@link https://github.com/MozVR/gamepad-plus}.
1625 * @memberof CB_Configuration.CrossBase
1626 * @name GAMEPAD_PLUS_PATH_SCRIPT_FILE
1627 * @constant
1628 * @type {string}
1629 * @default {@link CB_Configuration.CrossBase.GAMEPAD_PLUS_PATH} + "gamepads.js"
1630 */
1631CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_PATH + "gamepads.js";
1632
1633/**
1634 * Defines whether the path defined in {@link CB_Configuration.CrossBase.GAMEPAD_PLUS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1635 * @memberof CB_Configuration.CrossBase
1636 * @name GAMEPAD_PLUS_PATH_ABSOLUTE
1637 * @constant
1638 * @type {boolean}
1639 * @default
1640 */
1641CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_PATH_ABSOLUTE = false;
1642
1643
1644//Canbox parameters:
1645/**
1646 * Defines whether to load or not [Canbox]{@link https://github.com/robertinglin/CanBox}.
1647 * @memberof CB_Configuration.CrossBase
1648 * @name CANBOX_LOAD
1649 * @constant
1650 * @type {boolean}
1651 * @default {@link CB_Configuration.CrossBase.needsCanbox}()
1652 */
1653CB_Configuration[CB_BASE_NAME].CANBOX_LOAD = CB_Configuration[CB_BASE_NAME].needsCanbox();
1654
1655/**
1656 * Directory that contains the [Canbox]{@link https://github.com/robertinglin/CanBox} files.
1657 * @memberof CB_Configuration.CrossBase
1658 * @name CANBOX_PATH
1659 * @constant
1660 * @type {string}
1661 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/canvas/canbox/"
1662 */
1663CB_Configuration[CB_BASE_NAME].CANBOX_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/canvas/canbox/";
1664
1665/**
1666 * The script file path for [Canbox]{@link https://github.com/robertinglin/CanBox}.
1667 * @memberof CB_Configuration.CrossBase
1668 * @name CANBOX_PATH_SCRIPT_FILE
1669 * @constant
1670 * @type {string}
1671 * @default {@link CB_Configuration.CrossBase.CANBOX_PATH} + "canbox.0.2.1.js"
1672 */
1673CB_Configuration[CB_BASE_NAME].CANBOX_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].CANBOX_PATH + "canbox.0.2.1.js";
1674
1675/**
1676 * Defines whether the path defined in {@link CB_Configuration.CrossBase.CANBOX_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1677 * @memberof CB_Configuration.CrossBase
1678 * @name CANBOX_PATH_ABSOLUTE
1679 * @constant
1680 * @type {boolean}
1681 * @default
1682 */
1683CB_Configuration[CB_BASE_NAME].CANBOX_PATH_ABSOLUTE = false;
1684
1685
1686//FlashCanvas parameters:
1687/**
1688 * Defines whether to load or not [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}.
1689 * @memberof CB_Configuration.CrossBase
1690 * @name FLASHCANVAS_LOAD
1691 * @constant
1692 * @type {boolean}
1693 * @default {@link CB_Configuration.CrossBase.needsFlashCanvas}()
1694 */
1695CB_Configuration[CB_BASE_NAME].FLASHCANVAS_LOAD = CB_Configuration[CB_BASE_NAME].needsFlashCanvas();
1696
1697/**
1698 * Defines whether to allow to run [FlashCanvas]{@link https://github.com/everlaat/flashcanvas} locally or not (because the ".swf" file folder needs to be added to 'trusted files' in Flash global configuration to work locally in some operating systems).
1699 * @memberof CB_Configuration.CrossBase
1700 * @name FLASHCANVAS_ALLOW_RUN_LOCALLY_DEFAULT
1701 * @constant
1702 * @type {boolean}
1703 * @default
1704 */
1705CB_Configuration[CB_BASE_NAME].FLASHCANVAS_ALLOW_RUN_LOCALLY_DEFAULT = false;
1706
1707/**
1708 * Directory that contains the [FlashCanvas]{@link https://github.com/everlaat/flashcanvas} files.
1709 * @memberof CB_Configuration.CrossBase
1710 * @name FLASHCANVAS_PATH
1711 * @constant
1712 * @type {string}
1713 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/canvas/FlashCanvas/pro/"
1714 */
1715CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/canvas/FlashCanvas/pro/";
1716
1717/**
1718 * The script file path for [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}.
1719 * @memberof CB_Configuration.CrossBase
1720 * @name FLASHCANVAS_PATH_SCRIPT_FILE
1721 * @constant
1722 * @type {string}
1723 * @default {@link CB_Configuration.CrossBase.FLASHCANVAS_PATH} + "bin/flashcanvas.js"
1724 */
1725CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH + "bin/flashcanvas.js";
1726
1727/**
1728 * Directory that contains the SWF's for [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}. The value of the "scriptPathGiven" parameter will be attached at the beginning automatically. Belongs to the "swfPath" parameter of the library set on the "window.FlashCanvasOptions" object. More information: https://web.archive.org/web/20180604011002/http://flashcanvas.net/docs/config
1729 * @memberof CB_Configuration.CrossBase
1730 * @name FLASHCANVAS_PATH_SWF
1731 * @constant
1732 * @type {string}
1733 * @default {@link CB_Configuration.CrossBase.FLASHCANVAS_PATH} + "bin/"
1734 */
1735CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_SWF = CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH + "bin/";
1736
1737/**
1738 * Defines whether the path defined in {@link CB_Configuration.CrossBase.FLASHCANVAS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1739 * @memberof CB_Configuration.CrossBase
1740 * @name FLASHCANVAS_PATH_ABSOLUTE
1741 * @constant
1742 * @type {boolean}
1743 * @default
1744 */
1745CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_ABSOLUTE = false;
1746
1747/**
1748 * Disables the context menu when the right mouse button is clicked on any canvas using [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}' SWF. Belongs to the "disableContextMenu" parameter of the library set on the "window.FlashCanvasOptions" object. More information: https://web.archive.org/web/20180604011002/http://flashcanvas.net/docs/config
1749 * @memberof CB_Configuration.CrossBase
1750 * @name FLASHCANVAS_DISABLE_CONTEXT_MENU
1751 * @constant
1752 * @type {boolean}
1753 * @default
1754 */
1755CB_Configuration[CB_BASE_NAME].FLASHCANVAS_DISABLE_CONTEXT_MENU = false;
1756
1757/**
1758 * Uses turbo mode to speed up [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}. Belongs to the "turbo" parameter of the library set on the "window.FlashCanvasOptions" object. More information: https://web.archive.org/web/20180604011002/http://flashcanvas.net/docs/config
1759 * @memberof CB_Configuration.CrossBase
1760 * @name FLASHCANVAS_TURBO_MODE
1761 * @constant
1762 * @type {boolean}
1763 * @default
1764 */
1765CB_Configuration[CB_BASE_NAME].FLASHCANVAS_TURBO_MODE = true;
1766
1767/**
1768 * Maximum size for the image cache used by [FlashCanvas]{@link https://github.com/everlaat/flashcanvas}. Belongs to the "imageCacheSize" parameter of the library set on the "window.FlashCanvasOptions" object. More information: https://web.archive.org/web/20180604011002/http://flashcanvas.net/docs/config
1769 * @memberof CB_Configuration.CrossBase
1770 * @name FLASHCANVAS_IMAGE_CACHE_SIZE
1771 * @constant
1772 * @type {integer}
1773 * @default
1774 */
1775CB_Configuration[CB_BASE_NAME].FLASHCANVAS_IMAGE_CACHE_SIZE = 100;
1776
1777
1778//SLCanvas parameters:
1779/**
1780 * Defines whether to load or not [SLCanvas]{@link https://slcanvas.codeplex.com/}.
1781 * @memberof CB_Configuration.CrossBase
1782 * @name SLCANVAS_LOAD
1783 * @constant
1784 * @type {boolean}
1785 * @default {@link CB_Configuration.CrossBase.needsSLCanvas}()
1786 */
1787CB_Configuration[CB_BASE_NAME].SLCANVAS_LOAD = CB_Configuration[CB_BASE_NAME].needsSLCanvas();
1788
1789/**
1790 * Directory that contains the [SLCanvas]{@link https://slcanvas.codeplex.com/} files.
1791 * @memberof CB_Configuration.CrossBase
1792 * @name SLCANVAS_PATH
1793 * @constant
1794 * @type {string}
1795 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/canvas/slcanvas/"
1796 */
1797CB_Configuration[CB_BASE_NAME].SLCANVAS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/canvas/slcanvas/";
1798
1799/**
1800 * The script file path for [SLCanvas]{@link https://slcanvas.codeplex.com/}.
1801 * @memberof CB_Configuration.CrossBase
1802 * @name SLCANVAS_PATH_SCRIPT_FILE
1803 * @constant
1804 * @type {string}
1805 * @default {@link CB_Configuration.CrossBase.SLCANVAS_PATH} + "slcanvas.js"
1806 */
1807CB_Configuration[CB_BASE_NAME].SLCANVAS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].SLCANVAS_PATH + "slcanvas.js";
1808
1809/**
1810 * Defines whether the path defined in {@link CB_Configuration.CrossBase.SLCANVAS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1811 * @memberof CB_Configuration.CrossBase
1812 * @name SLCANVAS_PATH_ABSOLUTE
1813 * @constant
1814 * @type {boolean}
1815 * @default
1816 */
1817CB_Configuration[CB_BASE_NAME].SLCANVAS_PATH_ABSOLUTE = false;
1818
1819
1820//ExplorerCanvas parameters:
1821/**
1822 * Defines whether to load or not [ExplorerCanvas]{@link https://github.com/arv/explorercanvas}.
1823 * @memberof CB_Configuration.CrossBase
1824 * @name EXCANVAS_LOAD
1825 * @constant
1826 * @type {boolean}
1827 * @default {@link CB_Configuration.CrossBase.needsExplorerCanvas}()
1828 */
1829CB_Configuration[CB_BASE_NAME].EXCANVAS_LOAD = CB_Configuration[CB_BASE_NAME].needsExplorerCanvas();
1830
1831/**
1832 * Directory that contains the [ExplorerCanvas]{@link https://github.com/arv/explorercanvas} files.
1833 * @memberof CB_Configuration.CrossBase
1834 * @name EXCANVAS_PATH
1835 * @constant
1836 * @type {string}
1837 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/canvas/excanvas_with_canvas_text/"
1838 */
1839CB_Configuration[CB_BASE_NAME].EXCANVAS_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/canvas/excanvas_with_canvas_text/";
1840
1841/**
1842 * The script file path for [ExplorerCanvas]{@link https://github.com/arv/explorercanvas}.
1843 * @memberof CB_Configuration.CrossBase
1844 * @name EXCANVAS_PATH_SCRIPT_FILE
1845 * @constant
1846 * @type {string}
1847 * @default {@link CB_Configuration.CrossBase.EXCANVAS_PATH} + "excanvas.js"
1848 */
1849CB_Configuration[CB_BASE_NAME].EXCANVAS_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].EXCANVAS_PATH + "excanvas.js";
1850
1851/**
1852 * Defines whether the path defined in {@link CB_Configuration.CrossBase.EXCANVAS_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1853 * @memberof CB_Configuration.CrossBase
1854 * @name EXCANVAS_PATH_ABSOLUTE
1855 * @constant
1856 * @type {boolean}
1857 * @default
1858 */
1859CB_Configuration[CB_BASE_NAME].EXCANVAS_PATH_ABSOLUTE = false;
1860
1861
1862//canvas-text parameters:
1863/**
1864 * Defines whether to load or not [canvas-text]{@link https://github.com/PhenX/canvas-text}.
1865 * @memberof CB_Configuration.CrossBase
1866 * @name CANVAS_TEXT_LOAD
1867 * @constant
1868 * @type {boolean}
1869 * @default {@link CB_Configuration.CrossBase.needsCanvasText}()
1870 */
1871CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_LOAD = CB_Configuration[CB_BASE_NAME].needsCanvasText();
1872
1873/**
1874 * Directory that contains the [canvas-text]{@link https://github.com/PhenX/canvas-text} files.
1875 * @memberof CB_Configuration.CrossBase
1876 * @name CANVAS_TEXT_PATH
1877 * @constant
1878 * @type {string}
1879 * @default {@link CB_Configuration.CrossBase.SCRIPT_PATH} + "audiovisual/image/canvas/excanvas_with_canvas_text/"
1880 */
1881CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH = CB_Configuration[CB_BASE_NAME].SCRIPT_PATH + "audiovisual/image/canvas/excanvas_with_canvas_text/";
1882
1883/**
1884 * The script file path for [canvas-text]{@link https://github.com/PhenX/canvas-text}.
1885 * @memberof CB_Configuration.CrossBase
1886 * @name CANVAS_TEXT_PATH_SCRIPT_FILE
1887 * @constant
1888 * @type {string}
1889 * @default {@link CB_Configuration.CrossBase.CANVAS_TEXT_PATH} + "canvas.text.js"
1890 */
1891CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH_SCRIPT_FILE = CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH + "canvas.text.js";
1892
1893/**
1894 * Defines whether the path defined in {@link CB_Configuration.CrossBase.CANVAS_TEXT_PATH_SCRIPT_FILE} is either absolute or relative to the CrossBrowdy script path.
1895 * @memberof CB_Configuration.CrossBase
1896 * @name CANVAS_TEXT_PATH_ABSOLUTE
1897 * @constant
1898 * @type {boolean}
1899 * @default
1900 */
1901CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH_ABSOLUTE = false;
1902
1903
1904//Applies the options set by the user (if any):
1905CB_applyOptions(CB_BASE_NAME, this);
1906
1907
1908//Module basic configuration:
1909CB_Modules.modules[CB_BASE_NAME] =
1910{
1911 //Name of the module:
1912 "name" : CB_BASE_NAME,
1913 //Status (UNKNOWN, UNLOADED, LOADING, LOADED, READY or FAILED):
1914 "status" : CB_Modules.STATUSES.UNLOADED,
1915 //Function to call as soon as the module is called (before loading its scripts):
1916 "onCall" :
1917 function(scriptPathGiven)
1918 {
1919 if (CB_Configuration[CB_BASE_NAME].CB_Net_XHR_PROXY_URL_RELATIVE) { CB_Configuration[CB_BASE_NAME].CB_Net_XHR_PROXY_URL = scriptPathGiven + CB_Configuration[CB_BASE_NAME].CB_Net_XHR_PROXY_URL; }
1920 if (CB_Configuration[CB_BASE_NAME].FLASHCANVAS_LOAD) { CB_prepareFlashCanvas(scriptPathGiven); }
1921 CB_Modules.setStatus("CrossBase", CB_Modules.STATUSES.LOADED);
1922 },
1923 //Callback function to call when the module has been loaded successfully:
1924 "onLoad" :
1925 function(scriptPathGiven)
1926 {
1927 var checkReadyFunction =
1928 function()
1929 {
1930 var loopAgain = true;
1931 if (CB_Configuration[CB_BASE_NAME].SM2_LOAD &amp;&amp; !CB_startSoundManager2Called) { CB_startSoundManager2(scriptPathGiven); }
1932 if (typeof(detectZoom) !== "undefined" &amp;&amp; detectZoom !== null &amp;&amp; detectZoom &amp;&amp; typeof(detectZoom.device) !== "undefined" &amp;&amp; detectZoom.device !== null &amp;&amp; detectZoom.device &amp;&amp; typeof(detectZoom.device) === "function")
1933 {
1934 if (typeof(BrowserDetect) !== "undefined" &amp;&amp; BrowserDetect !== null &amp;&amp; typeof(BrowserDetect.browser) !== "undefined" &amp;&amp; BrowserDetect.browser !== null)
1935 {
1936 if (CB_soundManager2Loaded || !CB_Configuration[CB_BASE_NAME].SM2_LOAD) //If SM2 has been loaded or we don't need it:
1937 {
1938 if (window.localStorage) //Needed for safe use of localStorage polyfill.
1939 {
1940 if (CB_initializeStaticObjects()) //Initializes all static objects (returns false until it loads totally).
1941 {
1942 CB_Modules.setStatus("CrossBase", CB_Modules.STATUSES.READY);
1943 loopAgain = false;
1944 }
1945 }
1946 }
1947 }
1948 }
1949 if (loopAgain) { setTimeout(checkReadyFunction, 1); }
1950 };
1951 checkReadyFunction();
1952 },
1953 //Callback function to call when the module is ready:
1954 "onReady" : null,
1955 //Callback function to call when module has not been loaded successfully:
1956 //"onFail" => null,
1957 //Needed files:
1958 //Following files doesn't support IE5.0:
1959 // detect_zoom.js, CB_others.js, CB_events.js, CB_Screen.js, CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_SCRIPT_FILE,
1960 // CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH_SCRIPT_FILE, CB_Configuration[CB_BASE_NAME].SM2_PATH_SCRIPT_FILE
1961 "neededFiles" :
1962 { //Format: "needed_file" : { load: needs_to_be_loaded, [mandatory: needed_to_begin_CrossBrowdy], [absolutePath: relative_to_CrossBrowdy_path_or_absolute], [loadChecker: function that will be called and return true if the file needs to be loaded], [id: file_identifier_string], [requires: array_with_required_ids_of_files_required] }
1963 //Mandatory files:
1964 "CrossBase/general/others/BrowserDetect.js" : { load: true, mandatory: true }, //BrowserDetect by Peter-Paul Koch.
1965 "CrossBase/general/others/performanceAndrequestAnimationFrame.js" : { load: true, mandatory: true, id: "performanceAndrequestAnimationFrame" }, //performance.now polyfill by Paul Irish, Aaron Levine and Joan Alba Maldonado, requestAnimationFrame polyfill by Erik Moller (fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavic, Darius Bacon, Tim Hall and Joan Alba Maldonado).
1966 "CrossBase/general/others/typedarray.js" : { load: true, mandatory: true, id: "typedarray" }, //typedarray.js polyfill by Linden Research, Inc. and Joshua Bell and Joshua Bell.
1967 "CrossBase/general/others/base64-binary.js" : { load: true, mandatory: true }, //Base64Binary by Daniel Guerrero.
1968 "CrossBase/general/lz-string/lz-string.min.js" : { load: true, mandatory: true }, //lz-string (including base64-string) by pieroxy.
1969 "CrossBase/general/lz-string/base64-string.js" : { load: true, mandatory: true }, //lz-string (including base64-string) by pieroxy.
1970 "CrossBase/general/bluebird/bluebird.min.js" : { load: typeof(window.Promise) === "undefined", mandatory: true }, //bluebird by Petka Antonov.
1971 "CrossBase/general/JSON3/json3.min.js" : { load: true, mandatory: true, id: "json3" }, //JSON3 by Kit Cambridge.
1972 "CrossBase/audiovisual/image/detect_zoom/detect_zoom.js" : { load: true, mandatory: true }, //Detect-zoom by yonran (maintained by tombigel).
1973 "CrossBase/audiovisual/audio/AudioContextMonkeyPatch/AudioContextMonkeyPatch.js" : { load: true, mandatory: true }, //AudioContext-MonkeyPatch by Chris Wilson.
1974 "CrossBase/general/CB_others.js" : { load: true, mandatory: true }, //Other functions (such as trim(), etc).
1975 "CrossBase/general/CB_Arrays.js" : { load: true, mandatory: true }, //Arrays functions.
1976 "CrossBase/general/CB_Client.js" : { load: true, mandatory: true }, //Functions related with the client (browser, WebView, etc.).
1977 "CrossBase/general/CB_data.js" : { load: true, mandatory: true }, //Functions related with data (cookies, URL parameters, etc.).
1978 "CrossBase/general/CB_Elements.js" : { load: true, mandatory: true }, //Elements functions.
1979 "CrossBase/general/CB_Events.js" : { load: true, mandatory: true }, //Event functions.
1980 "CrossBase/general/CB_Collisions.js" : { load: true, mandatory: true }, //Collisions detection.
1981 "CrossBase/device/CB_Device.js" : { load: true, mandatory: true }, //CB_Device static class.
1982 "CrossBase/audiovisual/image/CB_Screen.js" : { load: true, mandatory: true }, //CB_Screen static class.
1983 "CrossBase/audiovisual/image/CB_GraphicSprites.js" : { load: true, mandatory: true }, //CB_GraphicSprites class.
1984 "CrossBase/audiovisual/image/CB_GraphicSpritesScene.js" : { load: true, mandatory: true }, //CB_GraphicSpritesScene class.
1985 "CrossBase/audiovisual/image/canvas/CB_Canvas.js" : { load: true, mandatory: true }, //CB_Canvas class.
1986 "CrossBase/input/CB_Keyboard.js" : { load: true, mandatory: true }, //CB_Keyboard static class.
1987 "CrossBase/input/CB_Mouse.js" : { load: true, mandatory: true }, //CB_Mouse static class.
1988 "CrossBase/input/CB_Touch.js" : { load: true, mandatory: true }, //CB_Touch static class.
1989 "CrossBase/input/CB_Pointer.js" : { load: true, mandatory: true }, //CB_Pointer static class.
1990 "CrossBase/input/controllers/CB_Controllers_Proprietary_WII.js" : { load: true, mandatory: true, requires: ["performanceAndrequestAnimationFrame"] }, //CB_Controllers_Proprietary_WII.js static class.
1991 "CrossBase/input/controllers/CB_Controllers_Proprietary_WII_U.js" : { load: true, mandatory: true, requires: ["performanceAndrequestAnimationFrame"] }, //CB_Controllers_Proprietary_WII_U.js static class.
1992 "CrossBase/input/controllers/CB_Controllers.js" : { load: true, mandatory: true }, //CB_Controllers static class.
1993 "CrossBase/net/fetch/fetch-ie8/fetch.js" : { load: typeof(window.fetch) === "undefined", mandatory: true }, //fetch-ie8 by Cam Song.
1994 "CrossBase/net/CB_Net.js" : { load: true, mandatory: true }, //CB_Net.
1995 "CrossBase/net/fetch/CB_Net_Fetch.js" : { load: true, mandatory: true }, //CB_Net.Fetch static class.
1996 "CrossBase/net/XHR/CB_Net_XHR.js" : { load: true, mandatory: true }, //CB_Net.XHR static class (AJAX).
1997 "CrossBase/net/sockets/CB_Net_Sockets.js" : { load: true, mandatory: true }, //CB_Net.Sockets static class.
1998 "CrossBase/net/REST/CB_Net_REST.js" : { load: true, mandatory: true }, //CB_Net.REST static class.
1999 "CrossBase/audiovisual/audio/CB_AudioDetector.js" : { load: true, mandatory: true }, //CB_AudioDetector static class.
2000 "CrossBase/audiovisual/audio/CB_AudioFile.js" : { load: true, mandatory: true }, //CB_AudioFile class.
2001 "CrossBase/audiovisual/audio/CB_AudioFile_API_WAAPI.js" : { load: true, mandatory: true }, //CB_AudioFile_API["WAAPI"] class.
2002 "CrossBase/audiovisual/audio/CB_AudioFile_API_AAPI.js" : { load: true, mandatory: true }, //CB_AudioFile_API["AAPI"] class.
2003 "CrossBase/audiovisual/audio/CB_AudioFile_API_SM2.js" : { load: CB_Configuration[CB_BASE_NAME].SM2_LOAD, mandatory: true }, //CB_AudioFile_API["SM2"] class.
2004 //"CrossBase/audiovisual/audio/CB_AudioFile_API_IXDKPP.js" : { load: true, mandatory: true }, //CB_AudioFile_API["IXDKPP"] class.
2005 "CrossBase/audiovisual/audio/CB_AudioFile_API_ACMP.js" : { load: true, mandatory: true }, //CB_AudioFile_API["ACMP"] class.
2006 "CrossBase/audiovisual/audio/CB_AudioFileCache.js" : { load: true, mandatory: true }, //CB_AudioFileCache class.
2007 "CrossBase/audiovisual/audio/CB_AudioFileSprites.js" : { load: true, mandatory: true }, //CB_AudioFileSprites class.
2008 "CrossBase/audiovisual/audio/CB_AudioFileSpritesPool.js" : { load: true, mandatory: true }, //CB_AudioFileSpritesPool class.
2009 "CrossBase/audiovisual/audio/CB_Speaker.js" : { load: true, mandatory: true }, //CB_Speaker static class.
2010 "CrossBase/general/PHP/PHP_detector.php" : { load: true, mandatory: false },
2011
2012 //Dynamic filepath:
2013 "VALUEOF_CB_Configuration.CrossBase.LOCALSTORAGE_POLYFILL_PATH_SCRIPT_FILE" : { load: true, mandatory: true }, //localStorage polyfill by Morten Houmøller Nygaard.
2014 "VALUEOF_CB_Configuration.CrossBase.SOCKJS_PATH_SCRIPT_FILE" : { load: true, mandatory: true, requires: ["json3"] }, //SockJS-client by Marek, Bryce Kahle, Michael Bridgen, Luigi Pinca and others.
2015
2016 //Optional files:
2017 "VALUEOF_CB_Configuration.CrossBase.CANBOX_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].CANBOX_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].CANBOX_PATH_ABSOLUTE }, //Canbox by Robert Inglin.
2018 "VALUEOF_CB_Configuration.CrossBase.SLCANVAS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].SLCANVAS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].SLCANVAS_PATH_ABSOLUTE }, //SLCanvas by David Anson and Jon Davis.
2019 "VALUEOF_CB_Configuration.CrossBase.FLASHCANVAS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].FLASHCANVAS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_ABSOLUTE }, //FlashCanvas by Tim Cameron Ryan and Shinya Muramatsu.
2020 "VALUEOF_CB_Configuration.CrossBase.EXCANVAS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].EXCANVAS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].EXCANVAS_PATH_ABSOLUTE }, //ExplorerCanvas by Google Inc.
2021 "VALUEOF_CB_Configuration.CrossBase.CANVAS_TEXT_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].CANVAS_TEXT_PATH_ABSOLUTE }, //canvas-text by Fabien Menager.
2022 "VALUEOF_CB_Configuration.CrossBase.SM2_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].SM2_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].SM2_PATH_ABSOLUTE }, //SoundManager 2 by Scott Schiller.
2023 "VALUEOF_CB_Configuration.CrossBase.NOSLEEP_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].NOSLEEP_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].NOSLEEP_PATH_ABSOLUTE }, //NoSleep.js by Rich Tibbett.
2024 "VALUEOF_CB_Configuration.CrossBase.PHONEGAPJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].PHONEGAPJS_LOAD, mandatory: false, absolutePath: CB_Configuration[CB_BASE_NAME].PHONEGAPJS_PATH_ABSOLUTE }, //Script necessary for PhoneGap.
2025 "VALUEOF_CB_Configuration.CrossBase.CORDOVAJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].CORDOVAJS_LOAD, loadChecker: CB_Configuration[CB_BASE_NAME].CORDOVAJS_LOAD_CHECKER, mandatory: false, absolutePath: CB_Configuration[CB_BASE_NAME].CORDOVAJS_PATH_ABSOLUTE }, //Script necessary for Apache Cordova.
2026 "VALUEOF_CB_Configuration.CrossBase.INTELXDKJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].INTELXDKJS_LOAD, mandatory: false, absolutePath: CB_Configuration[CB_BASE_NAME].INTELXDKJS_PATH_ABSOLUTE }, //Script necessary for Intel XDK.
2027 "VALUEOF_CB_Configuration.CrossBase.INTELXDK_INITDEVJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_LOAD, loadChecker: CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_LOAD_CHECKER, mandatory: false, absolutePath: CB_Configuration[CB_BASE_NAME].INTELXDK_INITDEVJS_PATH_ABSOLUTE }, //Script necessary for Intel XDK.
2028 "VALUEOF_CB_Configuration.CrossBase.TIMBREJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].TIMBREJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].TIMBREJS_PATH_ABSOLUTE, id: "timbrejs", requires: ["typedarray"] }, //timbre.js by mohayonao.
2029 "VALUEOF_CB_Configuration.CrossBase.SUBCOLLIDERJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].SUBCOLLIDERJS_PATH_ABSOLUTE, requires: ["timbrejs"] }, //subcollider.js by mohayonao.
2030 "VALUEOF_CB_Configuration.CrossBase.WAAPISIM_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].WAAPISIM_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].WAAPISIM_PATH_ABSOLUTE }, //WAAPISim by g200kg.
2031 "VALUEOF_CB_Configuration.CrossBase.BANDJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].BANDJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].BANDJS_PATH_ABSOLUTE }, //Band.js by Cody Lundquist and various contributors.
2032 "VALUEOF_CB_Configuration.CrossBase.JSFX_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].JSFX_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].JSFX_PATH_ABSOLUTE }, //jsfx by Egon Elbre.
2033 "VALUEOF_CB_Configuration.CrossBase.PRESSUREJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].PRESSUREJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].PRESSUREJS_PATH_ABSOLUTE }, //Pressure.js by Stuart Yamartino.
2034 "VALUEOF_CB_Configuration.CrossBase.HAMMERJS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].HAMMERJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH_ABSOLUTE }, //Hammer.js by Jorik Tangelder.
2035 "VALUEOF_CB_Configuration.CrossBase.HAMMERJS_HAMMER_TIME_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].HAMMERJS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].HAMMERJS_PATH_ABSOLUTE }, //Hammer Time by Alexander Schmitz and other contributors.
2036 "VALUEOF_CB_Configuration.CrossBase.WII_JS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].WII_JS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].WII_JS_PATH_ABSOLUTE }, //wii-js by Ryan McGrath.
2037 "VALUEOF_CB_Configuration.CrossBase.GAMEPAD_PLUS_PATH_SCRIPT_FILE" : { load: CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_LOAD, mandatory: true, absolutePath: CB_Configuration[CB_BASE_NAME].GAMEPAD_PLUS_PATH_ABSOLUTE, requires: ["performanceAndrequestAnimationFrame"] } //gamepad-plus by Chris Van Wiemeersch (MozVR).
2038
2039 //TODO: think about requiring xhr.js
2040 },
2041 //Needed modules:
2042 "neededModules" : null,
2043 //Credits:
2044 "credits" : CB_CrossBaseCredits
2045};
2046
2047
2048//Adds the credits to the default ones:
2049CB_addCredits(CB_Modules.modules["CrossBase"]["credits"]);
2050
2051
2052//Function that initializes (builds) all static objects required (returns true when finishes totally):
2053var CB_initializeStaticObjects_LOADED =
2054{
2055 "CB_Arrays" : false, //CB_Arrays static class.
2056 "CB_Elements" : false, //CB_Elements static class.
2057 "CB_Events" : false, //CB_Events static class.
2058 "CB_Client" : false, //CB_Client static class.
2059 "CB_Device" : false, //CB_Device static class.
2060 "CB_Net" : false, //CB_Net static class.
2061 "CB_Net.Fetch" : false, //CB_Net.Fetch static class.
2062 "CB_Net.XHR" : false, //CB_Net.XHR static class.
2063 "CB_Net.REST" : false, //CB_Net.REST static class.
2064 "CB_Net.Sockets" : false, //CB_Net.Sockets static class.
2065 "CB_Screen" : false, //CB_Screen static class.
2066 "CB_Collisions" : false, //CB_Collisions static class.
2067 "CB_Keyboard" : false, //CB_Keyboard static class.
2068 "CB_Mouse" : false, //CB_Mouse static class.
2069 "CB_Touch" : false, //CB_Touch static class.
2070 "CB_Pointer" : false, //CB_Pointer static class.
2071 "CB_Controllers" : false, //CB_Controllers static class.
2072 "CB_Speaker" : false, //CB_Speaker static class.
2073 "CB_AudioDetector" : false //CB_AudioDetector static class.
2074};
2075function CB_initializeStaticObjects(containerObject)
2076{
2077 if (typeof(containerObject) === "undefined" || containerObject === null) { containerObject = CB_this || window; }
2078
2079 var allIndexes = null;
2080 var allIndexesLength = null;
2081 var currentObject = null;
2082
2083 for (var staticObject in CB_initializeStaticObjects_LOADED)
2084 {
2085 if (!CB_initializeStaticObjects_LOADED[staticObject])
2086 {
2087 allIndexes = staticObject.split(".");
2088 allIndexesLength = allIndexes.length;
2089 currentObject = containerObject[allIndexes[0]];
2090 for (var x = 1; x &lt; allIndexesLength; x++)
2091 {
2092 if (typeof(currentObject[allIndexes[x]]) !== "undefined" &amp;&amp; currentObject[allIndexes[x]] !== null)
2093 {
2094 currentObject = currentObject[allIndexes[x]];
2095 }
2096 else { return false; }
2097 }
2098
2099 if (currentObject &amp;&amp; typeof(currentObject.init) === "function")
2100 {
2101 currentObject.init();
2102 CB_initializeStaticObjects_LOADED[staticObject] = true;
2103 }
2104 else { return false; }
2105 }
2106 }
2107
2108 return true;
2109}
2110
2111
2112//Function that prepares FlashCanvas options (it needs to be done before loading the FlashCanvas script):
2113function CB_prepareFlashCanvas(scriptPathGiven)
2114{
2115 document.createElement("canvas"); //According to FlashCanvas web site: ensure that document.createElement("canvas") is executed before any canvas element appears.
2116 window.FlashCanvasOptions =
2117 {
2118 swfPath: scriptPathGiven + CB_Configuration[CB_BASE_NAME].FLASHCANVAS_PATH_SWF,
2119 disableContextMenu: CB_Configuration[CB_BASE_NAME].FLASHCANVAS_DISABLE_CONTEXT_MENU,
2120 turbo: CB_Configuration[CB_BASE_NAME].FLASHCANVAS_TURBO_MODE,
2121 imageCacheSize: CB_Configuration[CB_BASE_NAME].FLASHCANVAS_IMAGE_CACHE_SIZE
2122 };
2123}
2124
2125
2126//Function that starts SoundManager 2:
2127var CB_startSoundManager2Called = false; //Defines whether CB_startSoundManager2 function has been called or not.
2128var CB_soundManager2Loaded = false; //Defines whether SoundManager 2 has been loaded successfully or not.
2129var CB_soundManager2Supported = false; //Defines whether SoundManager 2 is supported or not.
2130function CB_startSoundManager2(scriptPathGiven)
2131{
2132 CB_startSoundManager2Called = true;
2133
2134 var CB_soundManager2TimeoutFunction =
2135 function()
2136 {
2137 CB_soundManager2Loaded = true; //SoundManager 2 has been loaded succesfully (but is not supported).
2138 CB_soundManager2Supported = false; //SoundManager 2 is not supported.
2139 };
2140
2141
2142 var CB_startSoundManager2Function =
2143 function()
2144 {
2145 if (typeof(soundManager) !== "undefined" &amp;&amp; soundManager !== null)
2146 {
2147 //If the browser can't play the formats required using HTML5, it will force to load Flash:
2148 soundManager.audioFormats =
2149 {
2150 'mp3':
2151 {
2152 'type': ['audio/mpeg; codecs="mp3"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],
2153 'required': CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED["mp3"]
2154 },
2155
2156 'mp4':
2157 {
2158 'related': ['aac', 'm4a'],
2159 'type': ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],
2160 'required': CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED["mp4"]
2161 },
2162
2163 'ogg':
2164 {
2165 'type': ['audio/ogg; codecs=vorbis'],
2166 'required': CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED["ogg"]
2167 },
2168
2169 'opus':
2170 {
2171 'type': ['audio/ogg; codecs=opus', 'audio/opus'],
2172 'required': CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED["opus"]
2173 },
2174
2175 'wav':
2176 {
2177 'type': ['audio/wav; codecs="1"', 'audio/wav', 'audio/wave', 'audio/x-wav'],
2178 'required': CB_Configuration[CB_BASE_NAME].SM2_AUDIO_FORMATS_REQUIRED["wav"]
2179 }
2180 };
2181
2182 soundManager.setup(
2183 {
2184 debugMode: false,
2185 flashLoadTimeout: CB_Configuration[CB_BASE_NAME].SM2_TIMEOUT_MS,
2186 useHighPerformance: CB_Configuration[CB_BASE_NAME].SM2_USE_HIGH_PERFORMANCE,
2187 //useFastPolling: CB_Configuration[CB_BASE_NAME].SM2_USE_FAST_POLLING,
2188 url: scriptPathGiven + CB_Configuration[CB_BASE_NAME].SM2_PATH_SWF,
2189 onready: function()
2190 {
2191 clearTimeout(CB_soundManager2Timeout);
2192 CB_soundManager2Loaded = true; //SoundManager 2 has been loaded succesfully (and is supported).
2193 CB_soundManager2Supported = true; //SoundManager 2 is supported.
2194 },
2195 ontimeout: CB_soundManager2TimeoutFunction
2196 });
2197
2198 //Ensure start-up in case document.readyState and/or DOMContentLoaded are unavailable:
2199 soundManager.beginDelayedInit();
2200 }
2201 else if (!CB_soundManager2Loaded) { setTimeout(CB_startSoundManager2Function, 1); }
2202 };
2203
2204 CB_startSoundManager2Function();
2205
2206 //Since ontimeout event of SoundManager 2 seems not working on some platforms using Intel XDK (and maybe other Cordova-based engines), we have our own onntimeout:
2207 var CB_soundManager2Timeout = setTimeout(CB_soundManager2TimeoutFunction, CB_Configuration[CB_BASE_NAME].SM2_TIMEOUT_MS);
2208}</pre>
2209 </article>
2210</section>
2211
2212
2213
2214
2215
2216 </div>
2217 </div>
2218
2219 <div class="clearfix"></div>
2220
2221
2222
2223</div>
2224</div>
2225
2226
2227 <div class="modal fade" id="searchResults">
2228 <div class="modal-dialog">
2229 <div class="modal-content">
2230 <div class="modal-header">
2231 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
2232 <h4 class="modal-title">Search results</h4>
2233 </div>
2234 <div class="modal-body"></div>
2235 <div class="modal-footer">
2236 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
2237 </div>
2238 </div><!-- /.modal-content -->
2239 </div><!-- /.modal-dialog -->
2240 </div>
2241
2242
2243<footer>
2244
2245
2246 <span class="copyright">
2247 <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>
2248 </span>
2249
2250<span class="jsdoc-message">
2251 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a>
2252
2253 on Wed Mar 22nd 2023
2254
2255 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
2256</span>
2257</footer>
2258
2259<script src="scripts/docstrap.lib.js"></script>
2260<script src="scripts/toc.js"></script>
2261
2262 <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
2263
2264
2265<script>
2266$( function () {
2267 $( "[id*='$']" ).each( function () {
2268 var $this = $( this );
2269
2270 $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
2271 } );
2272
2273 $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
2274 var $this = $( this );
2275
2276 var example = $this.find( "code" );
2277 exampleText = example.html();
2278 var lang = /{@lang (.*?)}/.exec( exampleText );
2279 if ( lang && lang[1] ) {
2280 exampleText = exampleText.replace( lang[0], "" );
2281 example.html( exampleText );
2282 lang = lang[1];
2283 } else {
2284 var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
2285 lang = langClassMatch ? langClassMatch[1] : "javascript";
2286 }
2287
2288 if ( lang ) {
2289
2290 $this
2291 .addClass( "sunlight-highlight-" + lang )
2292 .addClass( "linenums" )
2293 .html( example.html() );
2294
2295 }
2296 } );
2297
2298 Sunlight.highlightAll( {
2299 lineNumbers : true,
2300 showMenu : true,
2301 enableDoclinks : true
2302 } );
2303
2304 $.catchAnchorLinks( {
2305 navbarOffset: 10
2306 } );
2307 $( "#toc" ).toc( {
2308 anchorName : function ( i, heading, prefix ) {
2309 return $( heading ).attr( "id" ) || ( prefix + i );
2310 },
2311 selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
2312 showAndHide : false,
2313 smoothScrolling: true
2314 } );
2315
2316 $( "#main span[id^='toc']" ).addClass( "toc-shim" );
2317 $( '.dropdown-toggle' ).dropdown();
2318
2319 $( "table" ).each( function () {
2320 var $this = $( this );
2321 $this.addClass('table');
2322 } );
2323
2324} );
2325</script>
2326
2327
2328
2329<!--Navigation and Symbol Display-->
2330
2331
2332<!--Google Analytics-->
2333
2334
2335
2336 <script type="text/javascript">
2337 $(document).ready(function() {
2338 SearcherDisplay.init();
2339 });
2340 </script>
2341
2342
2343</body>
2344</html>