|
1 YUI.add('loader-base', function (Y, NAME) { |
|
2 |
|
3 /** |
|
4 * The YUI loader core |
|
5 * @module loader |
|
6 * @submodule loader-base |
|
7 */ |
|
8 |
|
9 (function() { |
|
10 var VERSION = Y.version, |
|
11 BUILD = '/build/', |
|
12 ROOT = VERSION + '/', |
|
13 CDN_BASE = Y.Env.base, |
|
14 GALLERY_VERSION = 'gallery-2014.02.20-23-55', |
|
15 TNT = '2in3', |
|
16 TNT_VERSION = '4', |
|
17 YUI2_VERSION = '2.9.0', |
|
18 COMBO_BASE = CDN_BASE + 'combo?', |
|
19 META = { |
|
20 version: VERSION, |
|
21 root: ROOT, |
|
22 base: Y.Env.base, |
|
23 comboBase: COMBO_BASE, |
|
24 skin: { |
|
25 defaultSkin: 'sam', |
|
26 base: 'assets/skins/', |
|
27 path: 'skin.css', |
|
28 after: [ |
|
29 'cssreset', |
|
30 'cssfonts', |
|
31 'cssgrids', |
|
32 'cssbase', |
|
33 'cssreset-context', |
|
34 'cssfonts-context' |
|
35 ] |
|
36 }, |
|
37 groups: {}, |
|
38 patterns: {} |
|
39 }, |
|
40 groups = META.groups, |
|
41 yui2Update = function(tnt, yui2, config) { |
|
42 var root = TNT + '.' + |
|
43 (tnt || TNT_VERSION) + '/' + |
|
44 (yui2 || YUI2_VERSION) + BUILD, |
|
45 base = (config && config.base) ? config.base : CDN_BASE, |
|
46 combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE; |
|
47 |
|
48 groups.yui2.base = base + root; |
|
49 groups.yui2.root = root; |
|
50 groups.yui2.comboBase = combo; |
|
51 }, |
|
52 galleryUpdate = function(tag, config) { |
|
53 var root = (tag || GALLERY_VERSION) + BUILD, |
|
54 base = (config && config.base) ? config.base : CDN_BASE, |
|
55 combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE; |
|
56 |
|
57 groups.gallery.base = base + root; |
|
58 groups.gallery.root = root; |
|
59 groups.gallery.comboBase = combo; |
|
60 }; |
|
61 |
|
62 |
|
63 groups[VERSION] = {}; |
|
64 |
|
65 groups.gallery = { |
|
66 ext: false, |
|
67 combine: true, |
|
68 comboBase: COMBO_BASE, |
|
69 update: galleryUpdate, |
|
70 patterns: { |
|
71 'gallery-': {}, |
|
72 'lang/gallery-': {}, |
|
73 'gallerycss-': { |
|
74 type: 'css' |
|
75 } |
|
76 } |
|
77 }; |
|
78 |
|
79 groups.yui2 = { |
|
80 combine: true, |
|
81 ext: false, |
|
82 comboBase: COMBO_BASE, |
|
83 update: yui2Update, |
|
84 patterns: { |
|
85 'yui2-': { |
|
86 configFn: function(me) { |
|
87 if (/-skin|reset|fonts|grids|base/.test(me.name)) { |
|
88 me.type = 'css'; |
|
89 me.path = me.path.replace(/\.js/, '.css'); |
|
90 // this makes skins in builds earlier than |
|
91 // 2.6.0 work as long as combine is false |
|
92 me.path = me.path.replace(/\/yui2-skin/, |
|
93 '/assets/skins/sam/yui2-skin'); |
|
94 } |
|
95 } |
|
96 } |
|
97 } |
|
98 }; |
|
99 |
|
100 galleryUpdate(); |
|
101 yui2Update(); |
|
102 |
|
103 if (YUI.Env[VERSION]) { |
|
104 Y.mix(META, YUI.Env[VERSION], false, [ |
|
105 'modules', |
|
106 'groups', |
|
107 'skin' |
|
108 ], 0, true); |
|
109 } |
|
110 |
|
111 YUI.Env[VERSION] = META; |
|
112 }()); |
|
113 /*jslint forin: true, maxlen: 350 */ |
|
114 |
|
115 /** |
|
116 * Loader dynamically loads script and css files. It includes the dependency |
|
117 * information for the version of the library in use, and will automatically pull in |
|
118 * dependencies for the modules requested. It can also load the |
|
119 * files from the Yahoo! CDN, and it can utilize the combo service provided on |
|
120 * this network to reduce the number of http connections required to download |
|
121 * YUI files. |
|
122 * |
|
123 * @module loader |
|
124 * @main loader |
|
125 * @submodule loader-base |
|
126 */ |
|
127 |
|
128 var NOT_FOUND = {}, |
|
129 NO_REQUIREMENTS = [], |
|
130 MAX_URL_LENGTH = 1024, |
|
131 GLOBAL_ENV = YUI.Env, |
|
132 GLOBAL_LOADED = GLOBAL_ENV._loaded, |
|
133 CSS = 'css', |
|
134 JS = 'js', |
|
135 INTL = 'intl', |
|
136 DEFAULT_SKIN = 'sam', |
|
137 VERSION = Y.version, |
|
138 ROOT_LANG = '', |
|
139 YObject = Y.Object, |
|
140 oeach = YObject.each, |
|
141 yArray = Y.Array, |
|
142 _queue = GLOBAL_ENV._loaderQueue, |
|
143 META = GLOBAL_ENV[VERSION], |
|
144 SKIN_PREFIX = 'skin-', |
|
145 L = Y.Lang, |
|
146 ON_PAGE = GLOBAL_ENV.mods, |
|
147 modulekey, |
|
148 _path = function(dir, file, type, nomin) { |
|
149 var path = dir + '/' + file; |
|
150 if (!nomin) { |
|
151 path += '-min'; |
|
152 } |
|
153 path += '.' + (type || CSS); |
|
154 |
|
155 return path; |
|
156 }; |
|
157 |
|
158 |
|
159 if (!YUI.Env._cssLoaded) { |
|
160 YUI.Env._cssLoaded = {}; |
|
161 } |
|
162 |
|
163 |
|
164 /** |
|
165 * The component metadata is stored in Y.Env.meta. |
|
166 * Part of the loader module. |
|
167 * @property meta |
|
168 * @for YUI |
|
169 */ |
|
170 Y.Env.meta = META; |
|
171 |
|
172 /** |
|
173 * Loader dynamically loads script and css files. It includes the dependency |
|
174 * info for the version of the library in use, and will automatically pull in |
|
175 * dependencies for the modules requested. It can load the |
|
176 * files from the Yahoo! CDN, and it can utilize the combo service provided on |
|
177 * this network to reduce the number of http connections required to download |
|
178 * YUI files. You can also specify an external, custom combo service to host |
|
179 * your modules as well. |
|
180 |
|
181 var Y = YUI(); |
|
182 var loader = new Y.Loader({ |
|
183 filter: 'debug', |
|
184 base: '../../', |
|
185 root: 'build/', |
|
186 combine: true, |
|
187 require: ['node', 'dd', 'console'] |
|
188 }); |
|
189 var out = loader.resolve(true); |
|
190 |
|
191 * @constructor |
|
192 * @class Loader |
|
193 * @param {Object} config an optional set of configuration options. |
|
194 * @param {String} config.base The base dir which to fetch this module from |
|
195 * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?` |
|
196 * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/` |
|
197 * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a> |
|
198 * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config. |
|
199 * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies |
|
200 * @param {Boolean} [config.async=true] Fetch files in async |
|
201 * @param {Array} config.ignore: A list of modules that should never be dynamically loaded |
|
202 * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page |
|
203 * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes |
|
204 * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes |
|
205 * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes |
|
206 * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout |
|
207 * @param {Object} config.context Execution context for all callbacks |
|
208 * @param {Function} config.onSuccess Callback for the 'success' event |
|
209 * @param {Function} config.onFailure Callback for the 'failure' event |
|
210 * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading. |
|
211 * @param {Function} config.onTimeout Callback for the 'timeout' event |
|
212 * @param {Function} config.onProgress Callback executed each time a script or css file is loaded |
|
213 * @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata |
|
214 * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`. |
|
215 * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox. |
|
216 * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward. |
|
217 */ |
|
218 Y.Loader = function(o) { |
|
219 |
|
220 var self = this; |
|
221 |
|
222 //Catch no config passed. |
|
223 o = o || {}; |
|
224 |
|
225 modulekey = META.md5; |
|
226 |
|
227 /** |
|
228 * Internal callback to handle multiple internal insert() calls |
|
229 * so that css is inserted prior to js |
|
230 * @property _internalCallback |
|
231 * @private |
|
232 */ |
|
233 // self._internalCallback = null; |
|
234 |
|
235 /** |
|
236 * Callback that will be executed when the loader is finished |
|
237 * with an insert |
|
238 * @method onSuccess |
|
239 * @type function |
|
240 */ |
|
241 // self.onSuccess = null; |
|
242 |
|
243 /** |
|
244 * Callback that will be executed if there is a failure |
|
245 * @method onFailure |
|
246 * @type function |
|
247 */ |
|
248 // self.onFailure = null; |
|
249 |
|
250 /** |
|
251 * Callback for the 'CSSComplete' event. When loading YUI components |
|
252 * with CSS the CSS is loaded first, then the script. This provides |
|
253 * a moment you can tie into to improve the presentation of the page |
|
254 * while the script is loading. |
|
255 * @method onCSS |
|
256 * @type function |
|
257 */ |
|
258 // self.onCSS = null; |
|
259 |
|
260 /** |
|
261 * Callback executed each time a script or css file is loaded |
|
262 * @method onProgress |
|
263 * @type function |
|
264 */ |
|
265 // self.onProgress = null; |
|
266 |
|
267 /** |
|
268 * Callback that will be executed if a timeout occurs |
|
269 * @method onTimeout |
|
270 * @type function |
|
271 */ |
|
272 // self.onTimeout = null; |
|
273 |
|
274 /** |
|
275 * The execution context for all callbacks |
|
276 * @property context |
|
277 * @default {YUI} the YUI instance |
|
278 */ |
|
279 self.context = Y; |
|
280 |
|
281 /** |
|
282 * Data that is passed to all callbacks |
|
283 * @property data |
|
284 */ |
|
285 // self.data = null; |
|
286 |
|
287 /** |
|
288 * Node reference or id where new nodes should be inserted before |
|
289 * @property insertBefore |
|
290 * @type string|HTMLElement |
|
291 */ |
|
292 // self.insertBefore = null; |
|
293 |
|
294 /** |
|
295 * The charset attribute for inserted nodes |
|
296 * @property charset |
|
297 * @type string |
|
298 * @deprecated , use cssAttributes or jsAttributes. |
|
299 */ |
|
300 // self.charset = null; |
|
301 |
|
302 /** |
|
303 * An object literal containing attributes to add to link nodes |
|
304 * @property cssAttributes |
|
305 * @type object |
|
306 */ |
|
307 // self.cssAttributes = null; |
|
308 |
|
309 /** |
|
310 * An object literal containing attributes to add to script nodes |
|
311 * @property jsAttributes |
|
312 * @type object |
|
313 */ |
|
314 // self.jsAttributes = null; |
|
315 |
|
316 /** |
|
317 * The base directory. |
|
318 * @property base |
|
319 * @type string |
|
320 * @default http://yui.yahooapis.com/[YUI VERSION]/build/ |
|
321 */ |
|
322 self.base = Y.Env.meta.base + Y.Env.meta.root; |
|
323 |
|
324 /** |
|
325 * Base path for the combo service |
|
326 * @property comboBase |
|
327 * @type string |
|
328 * @default http://yui.yahooapis.com/combo? |
|
329 */ |
|
330 self.comboBase = Y.Env.meta.comboBase; |
|
331 |
|
332 /* |
|
333 * Base path for language packs. |
|
334 */ |
|
335 // self.langBase = Y.Env.meta.langBase; |
|
336 // self.lang = ""; |
|
337 |
|
338 /** |
|
339 * If configured, the loader will attempt to use the combo |
|
340 * service for YUI resources and configured external resources. |
|
341 * @property combine |
|
342 * @type boolean |
|
343 * @default true if a base dir isn't in the config |
|
344 */ |
|
345 self.combine = o.base && |
|
346 (o.base.indexOf(self.comboBase.substr(0, 20)) > -1); |
|
347 |
|
348 /** |
|
349 * The default seperator to use between files in a combo URL |
|
350 * @property comboSep |
|
351 * @type {String} |
|
352 * @default Ampersand |
|
353 */ |
|
354 self.comboSep = '&'; |
|
355 /** |
|
356 * Max url length for combo urls. The default is 1024. This is the URL |
|
357 * limit for the Yahoo! hosted combo servers. If consuming |
|
358 * a different combo service that has a different URL limit |
|
359 * it is possible to override this default by supplying |
|
360 * the maxURLLength config option. The config option will |
|
361 * only take effect if lower than the default. |
|
362 * |
|
363 * @property maxURLLength |
|
364 * @type int |
|
365 */ |
|
366 self.maxURLLength = MAX_URL_LENGTH; |
|
367 |
|
368 /** |
|
369 * Ignore modules registered on the YUI global |
|
370 * @property ignoreRegistered |
|
371 * @default false |
|
372 */ |
|
373 self.ignoreRegistered = o.ignoreRegistered; |
|
374 |
|
375 /** |
|
376 * Root path to prepend to module path for the combo |
|
377 * service |
|
378 * @property root |
|
379 * @type string |
|
380 * @default [YUI VERSION]/build/ |
|
381 */ |
|
382 self.root = Y.Env.meta.root; |
|
383 |
|
384 /** |
|
385 * Timeout value in milliseconds. If set, self value will be used by |
|
386 * the get utility. the timeout event will fire if |
|
387 * a timeout occurs. |
|
388 * @property timeout |
|
389 * @type int |
|
390 */ |
|
391 self.timeout = 0; |
|
392 |
|
393 /** |
|
394 * A list of modules that should not be loaded, even if |
|
395 * they turn up in the dependency tree |
|
396 * @property ignore |
|
397 * @type string[] |
|
398 */ |
|
399 // self.ignore = null; |
|
400 |
|
401 /** |
|
402 * A list of modules that should always be loaded, even |
|
403 * if they have already been inserted into the page. |
|
404 * @property force |
|
405 * @type string[] |
|
406 */ |
|
407 // self.force = null; |
|
408 |
|
409 self.forceMap = {}; |
|
410 |
|
411 /** |
|
412 * Should we allow rollups |
|
413 * @property allowRollup |
|
414 * @type boolean |
|
415 * @default false |
|
416 */ |
|
417 self.allowRollup = false; |
|
418 |
|
419 /** |
|
420 * A filter to apply to result urls. This filter will modify the default |
|
421 * path for all modules. The default path for the YUI library is the |
|
422 * minified version of the files (e.g., event-min.js). The filter property |
|
423 * can be a predefined filter or a custom filter. The valid predefined |
|
424 * filters are: |
|
425 * <dl> |
|
426 * <dt>DEBUG</dt> |
|
427 * <dd>Selects the debug versions of the library (e.g., event-debug.js). |
|
428 * This option will automatically include the Logger widget</dd> |
|
429 * <dt>RAW</dt> |
|
430 * <dd>Selects the non-minified version of the library (e.g., event.js). |
|
431 * </dd> |
|
432 * </dl> |
|
433 * You can also define a custom filter, which must be an object literal |
|
434 * containing a search expression and a replace string: |
|
435 * |
|
436 * myFilter: { |
|
437 * 'searchExp': "-min\\.js", |
|
438 * 'replaceStr': "-debug.js" |
|
439 * } |
|
440 * |
|
441 * @property filter |
|
442 * @type string| {searchExp: string, replaceStr: string} |
|
443 */ |
|
444 // self.filter = null; |
|
445 |
|
446 /** |
|
447 * per-component filter specification. If specified for a given |
|
448 * component, this overrides the filter config. |
|
449 * @property filters |
|
450 * @type object |
|
451 */ |
|
452 self.filters = {}; |
|
453 |
|
454 /** |
|
455 * The list of requested modules |
|
456 * @property required |
|
457 * @type {string: boolean} |
|
458 */ |
|
459 self.required = {}; |
|
460 |
|
461 /** |
|
462 * If a module name is predefined when requested, it is checked againsts |
|
463 * the patterns provided in this property. If there is a match, the |
|
464 * module is added with the default configuration. |
|
465 * |
|
466 * At the moment only supporting module prefixes, but anticipate |
|
467 * supporting at least regular expressions. |
|
468 * @property patterns |
|
469 * @type Object |
|
470 */ |
|
471 // self.patterns = Y.merge(Y.Env.meta.patterns); |
|
472 self.patterns = {}; |
|
473 |
|
474 /** |
|
475 * The library metadata |
|
476 * @property moduleInfo |
|
477 */ |
|
478 // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo); |
|
479 self.moduleInfo = {}; |
|
480 |
|
481 self.groups = Y.merge(Y.Env.meta.groups); |
|
482 |
|
483 /** |
|
484 * Provides the information used to skin the skinnable components. |
|
485 * The following skin definition would result in 'skin1' and 'skin2' |
|
486 * being loaded for calendar (if calendar was requested), and |
|
487 * 'sam' for all other skinnable components: |
|
488 * |
|
489 * skin: { |
|
490 * // The default skin, which is automatically applied if not |
|
491 * // overriden by a component-specific skin definition. |
|
492 * // Change this in to apply a different skin globally |
|
493 * defaultSkin: 'sam', |
|
494 * |
|
495 * // This is combined with the loader base property to get |
|
496 * // the default root directory for a skin. ex: |
|
497 * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ |
|
498 * base: 'assets/skins/', |
|
499 * |
|
500 * // Any component-specific overrides can be specified here, |
|
501 * // making it possible to load different skins for different |
|
502 * // components. It is possible to load more than one skin |
|
503 * // for a given component as well. |
|
504 * overrides: { |
|
505 * calendar: ['skin1', 'skin2'] |
|
506 * } |
|
507 * } |
|
508 * @property skin |
|
509 * @type {Object} |
|
510 */ |
|
511 self.skin = Y.merge(Y.Env.meta.skin); |
|
512 |
|
513 /* |
|
514 * Map of conditional modules |
|
515 * @since 3.2.0 |
|
516 */ |
|
517 self.conditions = {}; |
|
518 |
|
519 // map of modules with a hash of modules that meet the requirement |
|
520 // self.provides = {}; |
|
521 |
|
522 self.config = o; |
|
523 self._internal = true; |
|
524 |
|
525 self._populateCache(); |
|
526 |
|
527 /** |
|
528 * Set when beginning to compute the dependency tree. |
|
529 * Composed of what YUI reports to be loaded combined |
|
530 * with what has been loaded by any instance on the page |
|
531 * with the version number specified in the metadata. |
|
532 * @property loaded |
|
533 * @type {string: boolean} |
|
534 */ |
|
535 self.loaded = GLOBAL_LOADED[VERSION]; |
|
536 |
|
537 |
|
538 /** |
|
539 * Should Loader fetch scripts in `async`, defaults to `true` |
|
540 * @property async |
|
541 */ |
|
542 |
|
543 self.async = true; |
|
544 |
|
545 self._inspectPage(); |
|
546 |
|
547 self._internal = false; |
|
548 |
|
549 self._config(o); |
|
550 |
|
551 self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; |
|
552 |
|
553 self.testresults = null; |
|
554 |
|
555 if (Y.config.tests) { |
|
556 self.testresults = Y.config.tests; |
|
557 } |
|
558 |
|
559 /** |
|
560 * List of rollup files found in the library metadata |
|
561 * @property rollups |
|
562 */ |
|
563 // self.rollups = null; |
|
564 |
|
565 /** |
|
566 * Whether or not to load optional dependencies for |
|
567 * the requested modules |
|
568 * @property loadOptional |
|
569 * @type boolean |
|
570 * @default false |
|
571 */ |
|
572 // self.loadOptional = false; |
|
573 |
|
574 /** |
|
575 * All of the derived dependencies in sorted order, which |
|
576 * will be populated when either calculate() or insert() |
|
577 * is called |
|
578 * @property sorted |
|
579 * @type string[] |
|
580 */ |
|
581 self.sorted = []; |
|
582 |
|
583 /* |
|
584 * A list of modules to attach to the YUI instance when complete. |
|
585 * If not supplied, the sorted list of dependencies are applied. |
|
586 * @property attaching |
|
587 */ |
|
588 // self.attaching = null; |
|
589 |
|
590 /** |
|
591 * Flag to indicate the dependency tree needs to be recomputed |
|
592 * if insert is called again. |
|
593 * @property dirty |
|
594 * @type boolean |
|
595 * @default true |
|
596 */ |
|
597 self.dirty = true; |
|
598 |
|
599 /** |
|
600 * List of modules inserted by the utility |
|
601 * @property inserted |
|
602 * @type {string: boolean} |
|
603 */ |
|
604 self.inserted = {}; |
|
605 |
|
606 /** |
|
607 * List of skipped modules during insert() because the module |
|
608 * was not defined |
|
609 * @property skipped |
|
610 */ |
|
611 self.skipped = {}; |
|
612 |
|
613 // Y.on('yui:load', self.loadNext, self); |
|
614 |
|
615 self.tested = {}; |
|
616 |
|
617 /* |
|
618 * Cached sorted calculate results |
|
619 * @property results |
|
620 * @since 3.2.0 |
|
621 */ |
|
622 //self.results = {}; |
|
623 |
|
624 if (self.ignoreRegistered) { |
|
625 //Clear inpage already processed modules. |
|
626 self._resetModules(); |
|
627 } |
|
628 |
|
629 }; |
|
630 |
|
631 Y.Loader.prototype = { |
|
632 /** |
|
633 * Checks the cache for modules and conditions, if they do not exist |
|
634 * process the default metadata and populate the local moduleInfo hash. |
|
635 * @method _populateCache |
|
636 * @private |
|
637 */ |
|
638 _populateCache: function() { |
|
639 var self = this, |
|
640 defaults = META.modules, |
|
641 cache = GLOBAL_ENV._renderedMods, |
|
642 i; |
|
643 |
|
644 if (cache && !self.ignoreRegistered) { |
|
645 for (i in cache) { |
|
646 if (cache.hasOwnProperty(i)) { |
|
647 self.moduleInfo[i] = Y.merge(cache[i]); |
|
648 } |
|
649 } |
|
650 |
|
651 cache = GLOBAL_ENV._conditions; |
|
652 for (i in cache) { |
|
653 if (cache.hasOwnProperty(i)) { |
|
654 self.conditions[i] = Y.merge(cache[i]); |
|
655 } |
|
656 } |
|
657 |
|
658 } else { |
|
659 for (i in defaults) { |
|
660 if (defaults.hasOwnProperty(i)) { |
|
661 self.addModule(defaults[i], i); |
|
662 } |
|
663 } |
|
664 } |
|
665 |
|
666 }, |
|
667 /** |
|
668 * Reset modules in the module cache to a pre-processed state so additional |
|
669 * computations with a different skin or language will work as expected. |
|
670 * @method _resetModules |
|
671 * @private |
|
672 */ |
|
673 _resetModules: function() { |
|
674 var self = this, i, o, |
|
675 mod, name, details; |
|
676 for (i in self.moduleInfo) { |
|
677 if (self.moduleInfo.hasOwnProperty(i)) { |
|
678 mod = self.moduleInfo[i]; |
|
679 name = mod.name; |
|
680 details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); |
|
681 |
|
682 if (details) { |
|
683 self.moduleInfo[name]._reset = true; |
|
684 self.moduleInfo[name].requires = details.requires || []; |
|
685 self.moduleInfo[name].optional = details.optional || []; |
|
686 self.moduleInfo[name].supersedes = details.supercedes || []; |
|
687 } |
|
688 |
|
689 if (mod.defaults) { |
|
690 for (o in mod.defaults) { |
|
691 if (mod.defaults.hasOwnProperty(o)) { |
|
692 if (mod[o]) { |
|
693 mod[o] = mod.defaults[o]; |
|
694 } |
|
695 } |
|
696 } |
|
697 } |
|
698 delete mod.langCache; |
|
699 delete mod.skinCache; |
|
700 if (mod.skinnable) { |
|
701 self._addSkin(self.skin.defaultSkin, mod.name); |
|
702 } |
|
703 } |
|
704 } |
|
705 }, |
|
706 /** |
|
707 Regex that matches a CSS URL. Used to guess the file type when it's not |
|
708 specified. |
|
709 |
|
710 @property REGEX_CSS |
|
711 @type RegExp |
|
712 @final |
|
713 @protected |
|
714 @since 3.5.0 |
|
715 **/ |
|
716 REGEX_CSS: /\.css(?:[?;].*)?$/i, |
|
717 |
|
718 /** |
|
719 * Default filters for raw and debug |
|
720 * @property FILTER_DEFS |
|
721 * @type Object |
|
722 * @final |
|
723 * @protected |
|
724 */ |
|
725 FILTER_DEFS: { |
|
726 RAW: { |
|
727 'searchExp': '-min\\.js', |
|
728 'replaceStr': '.js' |
|
729 }, |
|
730 DEBUG: { |
|
731 'searchExp': '-min\\.js', |
|
732 'replaceStr': '-debug.js' |
|
733 }, |
|
734 COVERAGE: { |
|
735 'searchExp': '-min\\.js', |
|
736 'replaceStr': '-coverage.js' |
|
737 } |
|
738 }, |
|
739 /* |
|
740 * Check the pages meta-data and cache the result. |
|
741 * @method _inspectPage |
|
742 * @private |
|
743 */ |
|
744 _inspectPage: function() { |
|
745 var self = this, v, m, req, mr, i; |
|
746 |
|
747 //Inspect the page for CSS only modules and mark them as loaded. |
|
748 for (i in self.moduleInfo) { |
|
749 if (self.moduleInfo.hasOwnProperty(i)) { |
|
750 v = self.moduleInfo[i]; |
|
751 if (v.type && v.type === CSS) { |
|
752 if (self.isCSSLoaded(v.name)) { |
|
753 Y.log('Found CSS module on page: ' + v.name, 'info', 'loader'); |
|
754 self.loaded[i] = true; |
|
755 } |
|
756 } |
|
757 } |
|
758 } |
|
759 for (i in ON_PAGE) { |
|
760 if (ON_PAGE.hasOwnProperty(i)) { |
|
761 v = ON_PAGE[i]; |
|
762 if (v.details) { |
|
763 m = self.moduleInfo[v.name]; |
|
764 req = v.details.requires; |
|
765 mr = m && m.requires; |
|
766 |
|
767 if (m) { |
|
768 if (!m._inspected && req && mr.length !== req.length) { |
|
769 // console.log('deleting ' + m.name); |
|
770 delete m.expanded; |
|
771 } |
|
772 } else { |
|
773 m = self.addModule(v.details, i); |
|
774 } |
|
775 m._inspected = true; |
|
776 } |
|
777 } |
|
778 } |
|
779 }, |
|
780 /* |
|
781 * returns true if b is not loaded, and is required directly or by means of modules it supersedes. |
|
782 * @private |
|
783 * @method _requires |
|
784 * @param {String} mod1 The first module to compare |
|
785 * @param {String} mod2 The second module to compare |
|
786 */ |
|
787 _requires: function(mod1, mod2) { |
|
788 |
|
789 var i, rm, after_map, s, |
|
790 info = this.moduleInfo, |
|
791 m = info[mod1], |
|
792 other = info[mod2]; |
|
793 |
|
794 if (!m || !other) { |
|
795 return false; |
|
796 } |
|
797 |
|
798 rm = m.expanded_map; |
|
799 after_map = m.after_map; |
|
800 |
|
801 // check if this module should be sorted after the other |
|
802 // do this first to short circut circular deps |
|
803 if (after_map && (mod2 in after_map)) { |
|
804 return true; |
|
805 } |
|
806 |
|
807 after_map = other.after_map; |
|
808 |
|
809 // and vis-versa |
|
810 if (after_map && (mod1 in after_map)) { |
|
811 return false; |
|
812 } |
|
813 |
|
814 // check if this module requires one the other supersedes |
|
815 s = info[mod2] && info[mod2].supersedes; |
|
816 if (s) { |
|
817 for (i = 0; i < s.length; i++) { |
|
818 if (this._requires(mod1, s[i])) { |
|
819 return true; |
|
820 } |
|
821 } |
|
822 } |
|
823 |
|
824 s = info[mod1] && info[mod1].supersedes; |
|
825 if (s) { |
|
826 for (i = 0; i < s.length; i++) { |
|
827 if (this._requires(mod2, s[i])) { |
|
828 return false; |
|
829 } |
|
830 } |
|
831 } |
|
832 |
|
833 // check if this module requires the other directly |
|
834 // if (r && yArray.indexOf(r, mod2) > -1) { |
|
835 if (rm && (mod2 in rm)) { |
|
836 return true; |
|
837 } |
|
838 |
|
839 // external css files should be sorted below yui css |
|
840 if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { |
|
841 return true; |
|
842 } |
|
843 |
|
844 return false; |
|
845 }, |
|
846 /** |
|
847 * Apply a new config to the Loader instance |
|
848 * @method _config |
|
849 * @private |
|
850 * @param {Object} o The new configuration |
|
851 */ |
|
852 _config: function(o) { |
|
853 var i, j, val, a, f, group, groupName, self = this, |
|
854 mods = [], mod; |
|
855 // apply config values |
|
856 if (o) { |
|
857 for (i in o) { |
|
858 if (o.hasOwnProperty(i)) { |
|
859 val = o[i]; |
|
860 //TODO This should be a case |
|
861 if (i === 'require') { |
|
862 self.require(val); |
|
863 } else if (i === 'skin') { |
|
864 //If the config.skin is a string, format to the expected object |
|
865 if (typeof val === 'string') { |
|
866 self.skin.defaultSkin = o.skin; |
|
867 val = { |
|
868 defaultSkin: val |
|
869 }; |
|
870 } |
|
871 |
|
872 Y.mix(self.skin, val, true); |
|
873 } else if (i === 'groups') { |
|
874 for (j in val) { |
|
875 if (val.hasOwnProperty(j)) { |
|
876 // Y.log('group: ' + j); |
|
877 groupName = j; |
|
878 group = val[j]; |
|
879 self.addGroup(group, groupName); |
|
880 if (group.aliases) { |
|
881 for (a in group.aliases) { |
|
882 if (group.aliases.hasOwnProperty(a)) { |
|
883 self.addAlias(group.aliases[a], a); |
|
884 } |
|
885 } |
|
886 } |
|
887 } |
|
888 } |
|
889 |
|
890 } else if (i === 'modules') { |
|
891 // add a hash of module definitions |
|
892 for (j in val) { |
|
893 if (val.hasOwnProperty(j)) { |
|
894 self.addModule(val[j], j); |
|
895 } |
|
896 } |
|
897 } else if (i === 'aliases') { |
|
898 for (j in val) { |
|
899 if (val.hasOwnProperty(j)) { |
|
900 self.addAlias(val[j], j); |
|
901 } |
|
902 } |
|
903 } else if (i === 'gallery') { |
|
904 if (this.groups.gallery.update) { |
|
905 this.groups.gallery.update(val, o); |
|
906 } |
|
907 } else if (i === 'yui2' || i === '2in3') { |
|
908 if (this.groups.yui2.update) { |
|
909 this.groups.yui2.update(o['2in3'], o.yui2, o); |
|
910 } |
|
911 } else { |
|
912 self[i] = val; |
|
913 } |
|
914 } |
|
915 } |
|
916 } |
|
917 |
|
918 // fix filter |
|
919 f = self.filter; |
|
920 |
|
921 if (L.isString(f)) { |
|
922 f = f.toUpperCase(); |
|
923 self.filterName = f; |
|
924 self.filter = self.FILTER_DEFS[f]; |
|
925 if (f === 'DEBUG') { |
|
926 self.require('yui-log', 'dump'); |
|
927 } |
|
928 } |
|
929 |
|
930 if (self.filterName && self.coverage) { |
|
931 if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { |
|
932 for (i = 0; i < self.coverage.length; i++) { |
|
933 mod = self.coverage[i]; |
|
934 if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { |
|
935 mods = [].concat(mods, self.moduleInfo[mod].use); |
|
936 } else { |
|
937 mods.push(mod); |
|
938 } |
|
939 } |
|
940 self.filters = self.filters || {}; |
|
941 Y.Array.each(mods, function(mod) { |
|
942 self.filters[mod] = self.FILTER_DEFS.COVERAGE; |
|
943 }); |
|
944 self.filterName = 'RAW'; |
|
945 self.filter = self.FILTER_DEFS[self.filterName]; |
|
946 } |
|
947 } |
|
948 |
|
949 }, |
|
950 |
|
951 /** |
|
952 * Returns the skin module name for the specified skin name. If a |
|
953 * module name is supplied, the returned skin module name is |
|
954 * specific to the module passed in. |
|
955 * @method formatSkin |
|
956 * @param {string} skin the name of the skin. |
|
957 * @param {string} mod optional: the name of a module to skin. |
|
958 * @return {string} the full skin module name. |
|
959 */ |
|
960 formatSkin: function(skin, mod) { |
|
961 var s = SKIN_PREFIX + skin; |
|
962 if (mod) { |
|
963 s = s + '-' + mod; |
|
964 } |
|
965 |
|
966 return s; |
|
967 }, |
|
968 |
|
969 /** |
|
970 * Adds the skin def to the module info |
|
971 * @method _addSkin |
|
972 * @param {string} skin the name of the skin. |
|
973 * @param {string} mod the name of the module. |
|
974 * @param {string} parent parent module if this is a skin of a |
|
975 * submodule or plugin. |
|
976 * @return {string} the module name for the skin. |
|
977 * @private |
|
978 */ |
|
979 _addSkin: function(skin, mod, parent) { |
|
980 var mdef, pkg, name, nmod, |
|
981 info = this.moduleInfo, |
|
982 sinf = this.skin, |
|
983 ext = info[mod] && info[mod].ext; |
|
984 |
|
985 // Add a module definition for the module-specific skin css |
|
986 if (mod) { |
|
987 name = this.formatSkin(skin, mod); |
|
988 if (!info[name]) { |
|
989 mdef = info[mod]; |
|
990 pkg = mdef.pkg || mod; |
|
991 nmod = { |
|
992 skin: true, |
|
993 name: name, |
|
994 group: mdef.group, |
|
995 type: 'css', |
|
996 after: sinf.after, |
|
997 path: (parent || pkg) + '/' + sinf.base + skin + |
|
998 '/' + mod + '.css', |
|
999 ext: ext |
|
1000 }; |
|
1001 if (mdef.base) { |
|
1002 nmod.base = mdef.base; |
|
1003 } |
|
1004 if (mdef.configFn) { |
|
1005 nmod.configFn = mdef.configFn; |
|
1006 } |
|
1007 this.addModule(nmod, name); |
|
1008 |
|
1009 Y.log('Adding skin (' + name + '), ' + parent + ', ' + pkg + ', ' + info[name].path, 'info', 'loader'); |
|
1010 } |
|
1011 } |
|
1012 |
|
1013 return name; |
|
1014 }, |
|
1015 /** |
|
1016 * Adds an alias module to the system |
|
1017 * @method addAlias |
|
1018 * @param {Array} use An array of modules that makes up this alias |
|
1019 * @param {String} name The name of the alias |
|
1020 * @example |
|
1021 * var loader = new Y.Loader({}); |
|
1022 * loader.addAlias([ 'node', 'yql' ], 'davglass'); |
|
1023 * loader.require(['davglass']); |
|
1024 * var out = loader.resolve(true); |
|
1025 * |
|
1026 * //out.js will contain Node and YQL modules |
|
1027 */ |
|
1028 addAlias: function(use, name) { |
|
1029 YUI.Env.aliases[name] = use; |
|
1030 this.addModule({ |
|
1031 name: name, |
|
1032 use: use |
|
1033 }); |
|
1034 }, |
|
1035 /** |
|
1036 * Add a new module group |
|
1037 * @method addGroup |
|
1038 * @param {Object} config An object containing the group configuration data |
|
1039 * @param {String} config.name required, the group name |
|
1040 * @param {String} config.base The base directory for this module group |
|
1041 * @param {String} config.root The root path to add to each combo resource path |
|
1042 * @param {Boolean} config.combine Should the request be combined |
|
1043 * @param {String} config.comboBase Combo service base path |
|
1044 * @param {Object} config.modules The group of modules |
|
1045 * @param {String} name the group name. |
|
1046 * @example |
|
1047 * var loader = new Y.Loader({}); |
|
1048 * loader.addGroup({ |
|
1049 * name: 'davglass', |
|
1050 * combine: true, |
|
1051 * comboBase: '/combo?', |
|
1052 * root: '', |
|
1053 * modules: { |
|
1054 * //Module List here |
|
1055 * } |
|
1056 * }, 'davglass'); |
|
1057 */ |
|
1058 addGroup: function(o, name) { |
|
1059 var mods = o.modules, |
|
1060 self = this, i, v; |
|
1061 |
|
1062 name = name || o.name; |
|
1063 o.name = name; |
|
1064 self.groups[name] = o; |
|
1065 |
|
1066 if (o.patterns) { |
|
1067 for (i in o.patterns) { |
|
1068 if (o.patterns.hasOwnProperty(i)) { |
|
1069 o.patterns[i].group = name; |
|
1070 self.patterns[i] = o.patterns[i]; |
|
1071 } |
|
1072 } |
|
1073 } |
|
1074 |
|
1075 if (mods) { |
|
1076 for (i in mods) { |
|
1077 if (mods.hasOwnProperty(i)) { |
|
1078 v = mods[i]; |
|
1079 if (typeof v === 'string') { |
|
1080 v = { name: i, fullpath: v }; |
|
1081 } |
|
1082 v.group = name; |
|
1083 self.addModule(v, i); |
|
1084 } |
|
1085 } |
|
1086 } |
|
1087 }, |
|
1088 |
|
1089 /** |
|
1090 * Add a new module to the component metadata. |
|
1091 * @method addModule |
|
1092 * @param {Object} config An object containing the module data. |
|
1093 * @param {String} config.name Required, the component name |
|
1094 * @param {String} config.type Required, the component type (js or css) |
|
1095 * @param {String} config.path Required, the path to the script from `base` |
|
1096 * @param {Array} config.requires Array of modules required by this component |
|
1097 * @param {Array} [config.optional] Array of optional modules for this component |
|
1098 * @param {Array} [config.supersedes] Array of the modules this component replaces |
|
1099 * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one |
|
1100 * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array |
|
1101 * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup |
|
1102 * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path` |
|
1103 * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in |
|
1104 * @param {Object} [config.submodules] Hash of submodules |
|
1105 * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration. |
|
1106 * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]` |
|
1107 * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to four fields: |
|
1108 * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load |
|
1109 * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded. |
|
1110 * @param {String} [config.condition.ua] The UA name of <a href="UA.html">Y.UA</a> object that returns true when the module is to be loaded. e.g., `"ie"`, `"nodejs"`. |
|
1111 * @param {String} [config.condition.when] Specifies the load order of the conditional module |
|
1112 * with regard to the position of the trigger module. |
|
1113 * This should be one of three values: `before`, `after`, or `instead`. The default is `after`. |
|
1114 * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()` |
|
1115 * @param {Function} [config.configFn] A function to exectute when configuring this module |
|
1116 * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config. |
|
1117 * @param {String} [name] The module name, required if not in the module data. |
|
1118 * @return {Object} the module definition or null if the object passed in did not provide all required attributes. |
|
1119 */ |
|
1120 addModule: function(o, name) { |
|
1121 name = name || o.name; |
|
1122 |
|
1123 if (typeof o === 'string') { |
|
1124 o = { name: name, fullpath: o }; |
|
1125 } |
|
1126 |
|
1127 |
|
1128 var subs, i, l, t, sup, s, smod, plugins, plug, |
|
1129 j, langs, packName, supName, flatSup, flatLang, lang, ret, |
|
1130 overrides, skinname, when, g, p, |
|
1131 conditions = this.conditions, trigger; |
|
1132 |
|
1133 //Only merge this data if the temp flag is set |
|
1134 //from an earlier pass from a pattern or else |
|
1135 //an override module (YUI_config) can not be used to |
|
1136 //replace a default module. |
|
1137 if (this.moduleInfo[name] && this.moduleInfo[name].temp) { |
|
1138 //This catches temp modules loaded via a pattern |
|
1139 // The module will be added twice, once from the pattern and |
|
1140 // Once from the actual add call, this ensures that properties |
|
1141 // that were added to the module the first time around (group: gallery) |
|
1142 // are also added the second time around too. |
|
1143 o = Y.merge(this.moduleInfo[name], o); |
|
1144 } |
|
1145 |
|
1146 o.name = name; |
|
1147 |
|
1148 if (!o || !o.name) { |
|
1149 return null; |
|
1150 } |
|
1151 |
|
1152 if (!o.type) { |
|
1153 //Always assume it's javascript unless the CSS pattern is matched. |
|
1154 o.type = JS; |
|
1155 p = o.path || o.fullpath; |
|
1156 if (p && this.REGEX_CSS.test(p)) { |
|
1157 Y.log('Auto determined module type as CSS', 'warn', 'loader'); |
|
1158 o.type = CSS; |
|
1159 } |
|
1160 } |
|
1161 |
|
1162 if (!o.path && !o.fullpath) { |
|
1163 o.path = _path(name, name, o.type); |
|
1164 } |
|
1165 o.supersedes = o.supersedes || o.use; |
|
1166 |
|
1167 o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; |
|
1168 |
|
1169 // Handle submodule logic |
|
1170 subs = o.submodules; |
|
1171 |
|
1172 this.moduleInfo[name] = o; |
|
1173 |
|
1174 o.requires = o.requires || []; |
|
1175 |
|
1176 /* |
|
1177 Only allowing the cascade of requires information, since |
|
1178 optional and supersedes are far more fine grained than |
|
1179 a blanket requires is. |
|
1180 */ |
|
1181 if (this.requires) { |
|
1182 for (i = 0; i < this.requires.length; i++) { |
|
1183 o.requires.push(this.requires[i]); |
|
1184 } |
|
1185 } |
|
1186 if (o.group && this.groups && this.groups[o.group]) { |
|
1187 g = this.groups[o.group]; |
|
1188 if (g.requires) { |
|
1189 for (i = 0; i < g.requires.length; i++) { |
|
1190 o.requires.push(g.requires[i]); |
|
1191 } |
|
1192 } |
|
1193 } |
|
1194 |
|
1195 |
|
1196 if (!o.defaults) { |
|
1197 o.defaults = { |
|
1198 requires: o.requires ? [].concat(o.requires) : null, |
|
1199 supersedes: o.supersedes ? [].concat(o.supersedes) : null, |
|
1200 optional: o.optional ? [].concat(o.optional) : null |
|
1201 }; |
|
1202 } |
|
1203 |
|
1204 if (o.skinnable && o.ext && o.temp) { |
|
1205 skinname = this._addSkin(this.skin.defaultSkin, name); |
|
1206 o.requires.unshift(skinname); |
|
1207 } |
|
1208 |
|
1209 if (o.requires.length) { |
|
1210 o.requires = this.filterRequires(o.requires) || []; |
|
1211 } |
|
1212 |
|
1213 if (!o.langPack && o.lang) { |
|
1214 langs = yArray(o.lang); |
|
1215 for (j = 0; j < langs.length; j++) { |
|
1216 lang = langs[j]; |
|
1217 packName = this.getLangPackName(lang, name); |
|
1218 smod = this.moduleInfo[packName]; |
|
1219 if (!smod) { |
|
1220 smod = this._addLangPack(lang, o, packName); |
|
1221 } |
|
1222 } |
|
1223 } |
|
1224 |
|
1225 |
|
1226 if (subs) { |
|
1227 sup = o.supersedes || []; |
|
1228 l = 0; |
|
1229 |
|
1230 for (i in subs) { |
|
1231 if (subs.hasOwnProperty(i)) { |
|
1232 s = subs[i]; |
|
1233 |
|
1234 s.path = s.path || _path(name, i, o.type); |
|
1235 s.pkg = name; |
|
1236 s.group = o.group; |
|
1237 |
|
1238 if (s.supersedes) { |
|
1239 sup = sup.concat(s.supersedes); |
|
1240 } |
|
1241 |
|
1242 smod = this.addModule(s, i); |
|
1243 sup.push(i); |
|
1244 |
|
1245 if (smod.skinnable) { |
|
1246 o.skinnable = true; |
|
1247 overrides = this.skin.overrides; |
|
1248 if (overrides && overrides[i]) { |
|
1249 for (j = 0; j < overrides[i].length; j++) { |
|
1250 skinname = this._addSkin(overrides[i][j], |
|
1251 i, name); |
|
1252 sup.push(skinname); |
|
1253 } |
|
1254 } |
|
1255 skinname = this._addSkin(this.skin.defaultSkin, |
|
1256 i, name); |
|
1257 sup.push(skinname); |
|
1258 } |
|
1259 |
|
1260 // looks like we are expected to work out the metadata |
|
1261 // for the parent module language packs from what is |
|
1262 // specified in the child modules. |
|
1263 if (s.lang && s.lang.length) { |
|
1264 |
|
1265 langs = yArray(s.lang); |
|
1266 for (j = 0; j < langs.length; j++) { |
|
1267 lang = langs[j]; |
|
1268 packName = this.getLangPackName(lang, name); |
|
1269 supName = this.getLangPackName(lang, i); |
|
1270 smod = this.moduleInfo[packName]; |
|
1271 |
|
1272 if (!smod) { |
|
1273 smod = this._addLangPack(lang, o, packName); |
|
1274 } |
|
1275 |
|
1276 flatSup = flatSup || yArray.hash(smod.supersedes); |
|
1277 |
|
1278 if (!(supName in flatSup)) { |
|
1279 smod.supersedes.push(supName); |
|
1280 } |
|
1281 |
|
1282 o.lang = o.lang || []; |
|
1283 |
|
1284 flatLang = flatLang || yArray.hash(o.lang); |
|
1285 |
|
1286 if (!(lang in flatLang)) { |
|
1287 o.lang.push(lang); |
|
1288 } |
|
1289 |
|
1290 // Y.log('pack ' + packName + ' should supersede ' + supName); |
|
1291 // Add rollup file, need to add to supersedes list too |
|
1292 |
|
1293 // default packages |
|
1294 packName = this.getLangPackName(ROOT_LANG, name); |
|
1295 supName = this.getLangPackName(ROOT_LANG, i); |
|
1296 |
|
1297 smod = this.moduleInfo[packName]; |
|
1298 |
|
1299 if (!smod) { |
|
1300 smod = this._addLangPack(lang, o, packName); |
|
1301 } |
|
1302 |
|
1303 if (!(supName in flatSup)) { |
|
1304 smod.supersedes.push(supName); |
|
1305 } |
|
1306 |
|
1307 // Y.log('pack ' + packName + ' should supersede ' + supName); |
|
1308 // Add rollup file, need to add to supersedes list too |
|
1309 |
|
1310 } |
|
1311 } |
|
1312 |
|
1313 l++; |
|
1314 } |
|
1315 } |
|
1316 //o.supersedes = YObject.keys(yArray.hash(sup)); |
|
1317 o.supersedes = yArray.dedupe(sup); |
|
1318 if (this.allowRollup) { |
|
1319 o.rollup = (l < 4) ? l : Math.min(l - 1, 4); |
|
1320 } |
|
1321 } |
|
1322 |
|
1323 plugins = o.plugins; |
|
1324 if (plugins) { |
|
1325 for (i in plugins) { |
|
1326 if (plugins.hasOwnProperty(i)) { |
|
1327 plug = plugins[i]; |
|
1328 plug.pkg = name; |
|
1329 plug.path = plug.path || _path(name, i, o.type); |
|
1330 plug.requires = plug.requires || []; |
|
1331 plug.group = o.group; |
|
1332 this.addModule(plug, i); |
|
1333 if (o.skinnable) { |
|
1334 this._addSkin(this.skin.defaultSkin, i, name); |
|
1335 } |
|
1336 |
|
1337 } |
|
1338 } |
|
1339 } |
|
1340 |
|
1341 if (o.condition) { |
|
1342 t = o.condition.trigger; |
|
1343 if (YUI.Env.aliases[t]) { |
|
1344 t = YUI.Env.aliases[t]; |
|
1345 } |
|
1346 if (!Y.Lang.isArray(t)) { |
|
1347 t = [t]; |
|
1348 } |
|
1349 |
|
1350 for (i = 0; i < t.length; i++) { |
|
1351 trigger = t[i]; |
|
1352 when = o.condition.when; |
|
1353 conditions[trigger] = conditions[trigger] || {}; |
|
1354 conditions[trigger][name] = o.condition; |
|
1355 // the 'when' attribute can be 'before', 'after', or 'instead' |
|
1356 // the default is after. |
|
1357 if (when && when !== 'after') { |
|
1358 if (when === 'instead') { // replace the trigger |
|
1359 o.supersedes = o.supersedes || []; |
|
1360 o.supersedes.push(trigger); |
|
1361 } |
|
1362 // before the trigger |
|
1363 // the trigger requires the conditional mod, |
|
1364 // so it should appear before the conditional |
|
1365 // mod if we do not intersede. |
|
1366 } else { // after the trigger |
|
1367 o.after = o.after || []; |
|
1368 o.after.push(trigger); |
|
1369 } |
|
1370 } |
|
1371 } |
|
1372 |
|
1373 if (o.supersedes) { |
|
1374 o.supersedes = this.filterRequires(o.supersedes); |
|
1375 } |
|
1376 |
|
1377 if (o.after) { |
|
1378 o.after = this.filterRequires(o.after); |
|
1379 o.after_map = yArray.hash(o.after); |
|
1380 } |
|
1381 |
|
1382 // this.dirty = true; |
|
1383 |
|
1384 if (o.configFn) { |
|
1385 ret = o.configFn(o); |
|
1386 if (ret === false) { |
|
1387 Y.log('Config function returned false for ' + name + ', skipping.', 'info', 'loader'); |
|
1388 delete this.moduleInfo[name]; |
|
1389 delete GLOBAL_ENV._renderedMods[name]; |
|
1390 o = null; |
|
1391 } |
|
1392 } |
|
1393 //Add to global cache |
|
1394 if (o) { |
|
1395 if (!GLOBAL_ENV._renderedMods) { |
|
1396 GLOBAL_ENV._renderedMods = {}; |
|
1397 } |
|
1398 GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o); |
|
1399 GLOBAL_ENV._conditions = conditions; |
|
1400 } |
|
1401 |
|
1402 return o; |
|
1403 }, |
|
1404 |
|
1405 /** |
|
1406 * Add a requirement for one or more module |
|
1407 * @method require |
|
1408 * @param {string[] | string*} what the modules to load. |
|
1409 */ |
|
1410 require: function(what) { |
|
1411 var a = (typeof what === 'string') ? yArray(arguments) : what; |
|
1412 this.dirty = true; |
|
1413 this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); |
|
1414 |
|
1415 this._explodeRollups(); |
|
1416 }, |
|
1417 /** |
|
1418 * Grab all the items that were asked for, check to see if the Loader |
|
1419 * meta-data contains a "use" array. If it doesm remove the asked item and replace it with |
|
1420 * the content of the "use". |
|
1421 * This will make asking for: "dd" |
|
1422 * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin" |
|
1423 * @private |
|
1424 * @method _explodeRollups |
|
1425 */ |
|
1426 _explodeRollups: function() { |
|
1427 var self = this, m, m2, i, a, v, len, len2, |
|
1428 r = self.required; |
|
1429 |
|
1430 if (!self.allowRollup) { |
|
1431 for (i in r) { |
|
1432 if (r.hasOwnProperty(i)) { |
|
1433 m = self.getModule(i); |
|
1434 if (m && m.use) { |
|
1435 len = m.use.length; |
|
1436 for (a = 0; a < len; a++) { |
|
1437 m2 = self.getModule(m.use[a]); |
|
1438 if (m2 && m2.use) { |
|
1439 len2 = m2.use.length; |
|
1440 for (v = 0; v < len2; v++) { |
|
1441 r[m2.use[v]] = true; |
|
1442 } |
|
1443 } else { |
|
1444 r[m.use[a]] = true; |
|
1445 } |
|
1446 } |
|
1447 } |
|
1448 } |
|
1449 } |
|
1450 self.required = r; |
|
1451 } |
|
1452 |
|
1453 }, |
|
1454 /** |
|
1455 * Explodes the required array to remove aliases and replace them with real modules |
|
1456 * @method filterRequires |
|
1457 * @param {Array} r The original requires array |
|
1458 * @return {Array} The new array of exploded requirements |
|
1459 */ |
|
1460 filterRequires: function(r) { |
|
1461 if (r) { |
|
1462 if (!Y.Lang.isArray(r)) { |
|
1463 r = [r]; |
|
1464 } |
|
1465 r = Y.Array(r); |
|
1466 var c = [], i, mod, o, m; |
|
1467 |
|
1468 for (i = 0; i < r.length; i++) { |
|
1469 mod = this.getModule(r[i]); |
|
1470 if (mod && mod.use) { |
|
1471 for (o = 0; o < mod.use.length; o++) { |
|
1472 //Must walk the other modules in case a module is a rollup of rollups (datatype) |
|
1473 m = this.getModule(mod.use[o]); |
|
1474 if (m && m.use && (m.name !== mod.name)) { |
|
1475 c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use))); |
|
1476 } else { |
|
1477 c.push(mod.use[o]); |
|
1478 } |
|
1479 } |
|
1480 } else { |
|
1481 c.push(r[i]); |
|
1482 } |
|
1483 } |
|
1484 r = c; |
|
1485 } |
|
1486 return r; |
|
1487 }, |
|
1488 /** |
|
1489 * Returns an object containing properties for all modules required |
|
1490 * in order to load the requested module |
|
1491 * @method getRequires |
|
1492 * @param {object} mod The module definition from moduleInfo. |
|
1493 * @return {array} the expanded requirement list. |
|
1494 */ |
|
1495 getRequires: function(mod) { |
|
1496 |
|
1497 if (!mod) { |
|
1498 //console.log('returning no reqs for ' + mod.name); |
|
1499 return NO_REQUIREMENTS; |
|
1500 } |
|
1501 |
|
1502 if (mod._parsed) { |
|
1503 //console.log('returning requires for ' + mod.name, mod.requires); |
|
1504 return mod.expanded || NO_REQUIREMENTS; |
|
1505 } |
|
1506 |
|
1507 //TODO add modue cache here out of scope.. |
|
1508 |
|
1509 var i, m, j, add, packName, lang, testresults = this.testresults, |
|
1510 name = mod.name, cond, |
|
1511 adddef = ON_PAGE[name] && ON_PAGE[name].details, |
|
1512 d, go, def, |
|
1513 r, old_mod, |
|
1514 o, skinmod, skindef, skinpar, skinname, |
|
1515 intl = mod.lang || mod.intl, |
|
1516 info = this.moduleInfo, |
|
1517 ftests = Y.Features && Y.Features.tests.load, |
|
1518 hash, reparse; |
|
1519 |
|
1520 // console.log(name); |
|
1521 |
|
1522 // pattern match leaves module stub that needs to be filled out |
|
1523 if (mod.temp && adddef) { |
|
1524 old_mod = mod; |
|
1525 mod = this.addModule(adddef, name); |
|
1526 mod.group = old_mod.group; |
|
1527 mod.pkg = old_mod.pkg; |
|
1528 delete mod.expanded; |
|
1529 } |
|
1530 |
|
1531 // console.log('cache: ' + mod.langCache + ' == ' + this.lang); |
|
1532 |
|
1533 //If a skin or a lang is different, reparse.. |
|
1534 reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); |
|
1535 |
|
1536 if (mod.expanded && !reparse) { |
|
1537 //Y.log('Already expanded ' + name + ', ' + mod.expanded); |
|
1538 return mod.expanded; |
|
1539 } |
|
1540 |
|
1541 |
|
1542 d = []; |
|
1543 hash = {}; |
|
1544 r = this.filterRequires(mod.requires); |
|
1545 if (mod.lang) { |
|
1546 //If a module has a lang attribute, auto add the intl requirement. |
|
1547 d.unshift('intl'); |
|
1548 r.unshift('intl'); |
|
1549 intl = true; |
|
1550 } |
|
1551 o = this.filterRequires(mod.optional); |
|
1552 |
|
1553 // Y.log("getRequires: " + name + " (dirty:" + this.dirty + |
|
1554 // ", expanded:" + mod.expanded + ")"); |
|
1555 |
|
1556 mod._parsed = true; |
|
1557 mod.langCache = this.lang; |
|
1558 mod.skinCache = this.skin.defaultSkin; |
|
1559 |
|
1560 for (i = 0; i < r.length; i++) { |
|
1561 //Y.log(name + ' requiring ' + r[i], 'info', 'loader'); |
|
1562 if (!hash[r[i]]) { |
|
1563 d.push(r[i]); |
|
1564 hash[r[i]] = true; |
|
1565 m = this.getModule(r[i]); |
|
1566 if (m) { |
|
1567 add = this.getRequires(m); |
|
1568 intl = intl || (m.expanded_map && |
|
1569 (INTL in m.expanded_map)); |
|
1570 for (j = 0; j < add.length; j++) { |
|
1571 d.push(add[j]); |
|
1572 } |
|
1573 } |
|
1574 } |
|
1575 } |
|
1576 |
|
1577 // get the requirements from superseded modules, if any |
|
1578 r = this.filterRequires(mod.supersedes); |
|
1579 if (r) { |
|
1580 for (i = 0; i < r.length; i++) { |
|
1581 if (!hash[r[i]]) { |
|
1582 // if this module has submodules, the requirements list is |
|
1583 // expanded to include the submodules. This is so we can |
|
1584 // prevent dups when a submodule is already loaded and the |
|
1585 // parent is requested. |
|
1586 if (mod.submodules) { |
|
1587 d.push(r[i]); |
|
1588 } |
|
1589 |
|
1590 hash[r[i]] = true; |
|
1591 m = this.getModule(r[i]); |
|
1592 |
|
1593 if (m) { |
|
1594 add = this.getRequires(m); |
|
1595 intl = intl || (m.expanded_map && |
|
1596 (INTL in m.expanded_map)); |
|
1597 for (j = 0; j < add.length; j++) { |
|
1598 d.push(add[j]); |
|
1599 } |
|
1600 } |
|
1601 } |
|
1602 } |
|
1603 } |
|
1604 |
|
1605 if (o && this.loadOptional) { |
|
1606 for (i = 0; i < o.length; i++) { |
|
1607 if (!hash[o[i]]) { |
|
1608 d.push(o[i]); |
|
1609 hash[o[i]] = true; |
|
1610 m = info[o[i]]; |
|
1611 if (m) { |
|
1612 add = this.getRequires(m); |
|
1613 intl = intl || (m.expanded_map && |
|
1614 (INTL in m.expanded_map)); |
|
1615 for (j = 0; j < add.length; j++) { |
|
1616 d.push(add[j]); |
|
1617 } |
|
1618 } |
|
1619 } |
|
1620 } |
|
1621 } |
|
1622 |
|
1623 cond = this.conditions[name]; |
|
1624 |
|
1625 if (cond) { |
|
1626 //Set the module to not parsed since we have conditionals and this could change the dependency tree. |
|
1627 mod._parsed = false; |
|
1628 if (testresults && ftests) { |
|
1629 oeach(testresults, function(result, id) { |
|
1630 var condmod = ftests[id].name; |
|
1631 if (!hash[condmod] && ftests[id].trigger === name) { |
|
1632 if (result && ftests[id]) { |
|
1633 hash[condmod] = true; |
|
1634 d.push(condmod); |
|
1635 } |
|
1636 } |
|
1637 }); |
|
1638 } else { |
|
1639 for (i in cond) { |
|
1640 if (cond.hasOwnProperty(i)) { |
|
1641 if (!hash[i]) { |
|
1642 def = cond[i]; |
|
1643 //first see if they've specfied a ua check |
|
1644 //then see if they've got a test fn & if it returns true |
|
1645 //otherwise just having a condition block is enough |
|
1646 go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) || |
|
1647 (def.test && def.test(Y, r))); |
|
1648 |
|
1649 if (go) { |
|
1650 hash[i] = true; |
|
1651 d.push(i); |
|
1652 m = this.getModule(i); |
|
1653 if (m) { |
|
1654 add = this.getRequires(m); |
|
1655 for (j = 0; j < add.length; j++) { |
|
1656 d.push(add[j]); |
|
1657 } |
|
1658 |
|
1659 } |
|
1660 } |
|
1661 } |
|
1662 } |
|
1663 } |
|
1664 } |
|
1665 } |
|
1666 |
|
1667 // Create skin modules |
|
1668 if (mod.skinnable) { |
|
1669 skindef = this.skin.overrides; |
|
1670 for (i in YUI.Env.aliases) { |
|
1671 if (YUI.Env.aliases.hasOwnProperty(i)) { |
|
1672 if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) { |
|
1673 skinpar = i; |
|
1674 } |
|
1675 } |
|
1676 } |
|
1677 if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) { |
|
1678 skinname = name; |
|
1679 if (skindef[skinpar]) { |
|
1680 skinname = skinpar; |
|
1681 } |
|
1682 for (i = 0; i < skindef[skinname].length; i++) { |
|
1683 skinmod = this._addSkin(skindef[skinname][i], name); |
|
1684 if (!this.isCSSLoaded(skinmod, this._boot)) { |
|
1685 d.push(skinmod); |
|
1686 } |
|
1687 } |
|
1688 } else { |
|
1689 skinmod = this._addSkin(this.skin.defaultSkin, name); |
|
1690 if (!this.isCSSLoaded(skinmod, this._boot)) { |
|
1691 d.push(skinmod); |
|
1692 } |
|
1693 } |
|
1694 } |
|
1695 |
|
1696 mod._parsed = false; |
|
1697 |
|
1698 if (intl) { |
|
1699 |
|
1700 if (mod.lang && !mod.langPack && Y.Intl) { |
|
1701 lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang); |
|
1702 //Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang); |
|
1703 packName = this.getLangPackName(lang, name); |
|
1704 if (packName) { |
|
1705 d.unshift(packName); |
|
1706 } |
|
1707 } |
|
1708 d.unshift(INTL); |
|
1709 } |
|
1710 |
|
1711 mod.expanded_map = yArray.hash(d); |
|
1712 |
|
1713 mod.expanded = YObject.keys(mod.expanded_map); |
|
1714 |
|
1715 return mod.expanded; |
|
1716 }, |
|
1717 /** |
|
1718 * Check to see if named css module is already loaded on the page |
|
1719 * @method isCSSLoaded |
|
1720 * @param {String} name The name of the css file |
|
1721 * @return Boolean |
|
1722 */ |
|
1723 isCSSLoaded: function(name, skip) { |
|
1724 //TODO - Make this call a batching call with name being an array |
|
1725 if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) { |
|
1726 Y.log('isCSSLoaded was skipped for ' + name, 'warn', 'loader'); |
|
1727 return false; |
|
1728 } |
|
1729 var el = YUI.Env.cssStampEl, |
|
1730 ret = false, |
|
1731 mod = YUI.Env._cssLoaded[name], |
|
1732 style = el.currentStyle; //IE |
|
1733 |
|
1734 |
|
1735 if (mod !== undefined) { |
|
1736 //Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader'); |
|
1737 return mod; |
|
1738 } |
|
1739 |
|
1740 //Add the classname to the element |
|
1741 el.className = name; |
|
1742 |
|
1743 if (!style) { |
|
1744 style = Y.config.doc.defaultView.getComputedStyle(el, null); |
|
1745 } |
|
1746 |
|
1747 if (style && style.display === 'none') { |
|
1748 ret = true; |
|
1749 } |
|
1750 |
|
1751 Y.log('Has Skin? ' + name + ' : ' + ret, 'info', 'loader'); |
|
1752 |
|
1753 el.className = ''; //Reset the classname to '' |
|
1754 |
|
1755 YUI.Env._cssLoaded[name] = ret; |
|
1756 |
|
1757 return ret; |
|
1758 }, |
|
1759 |
|
1760 /** |
|
1761 * Returns a hash of module names the supplied module satisfies. |
|
1762 * @method getProvides |
|
1763 * @param {string} name The name of the module. |
|
1764 * @return {object} what this module provides. |
|
1765 */ |
|
1766 getProvides: function(name) { |
|
1767 var m = this.getModule(name), o, s; |
|
1768 // supmap = this.provides; |
|
1769 |
|
1770 if (!m) { |
|
1771 return NOT_FOUND; |
|
1772 } |
|
1773 |
|
1774 if (m && !m.provides) { |
|
1775 o = {}; |
|
1776 s = m.supersedes; |
|
1777 |
|
1778 if (s) { |
|
1779 yArray.each(s, function(v) { |
|
1780 Y.mix(o, this.getProvides(v)); |
|
1781 }, this); |
|
1782 } |
|
1783 |
|
1784 o[name] = true; |
|
1785 m.provides = o; |
|
1786 |
|
1787 } |
|
1788 |
|
1789 return m.provides; |
|
1790 }, |
|
1791 |
|
1792 /** |
|
1793 * Calculates the dependency tree, the result is stored in the sorted |
|
1794 * property. |
|
1795 * @method calculate |
|
1796 * @param {object} o optional options object. |
|
1797 * @param {string} type optional argument to prune modules. |
|
1798 */ |
|
1799 calculate: function(o, type) { |
|
1800 if (o || type || this.dirty) { |
|
1801 |
|
1802 if (o) { |
|
1803 this._config(o); |
|
1804 } |
|
1805 |
|
1806 if (!this._init) { |
|
1807 this._setup(); |
|
1808 } |
|
1809 |
|
1810 this._explode(); |
|
1811 |
|
1812 if (this.allowRollup) { |
|
1813 this._rollup(); |
|
1814 } else { |
|
1815 this._explodeRollups(); |
|
1816 } |
|
1817 this._reduce(); |
|
1818 this._sort(); |
|
1819 } |
|
1820 }, |
|
1821 /** |
|
1822 * Creates a "psuedo" package for languages provided in the lang array |
|
1823 * @method _addLangPack |
|
1824 * @private |
|
1825 * @param {String} lang The language to create |
|
1826 * @param {Object} m The module definition to create the language pack around |
|
1827 * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US) |
|
1828 * @return {Object} The module definition |
|
1829 */ |
|
1830 _addLangPack: function(lang, m, packName) { |
|
1831 var name = m.name, |
|
1832 packPath, conf, |
|
1833 existing = this.moduleInfo[packName]; |
|
1834 |
|
1835 if (!existing) { |
|
1836 |
|
1837 packPath = _path((m.pkg || name), packName, JS, true); |
|
1838 |
|
1839 conf = { |
|
1840 path: packPath, |
|
1841 intl: true, |
|
1842 langPack: true, |
|
1843 ext: m.ext, |
|
1844 group: m.group, |
|
1845 supersedes: [] |
|
1846 }; |
|
1847 if (m.root) { |
|
1848 conf.root = m.root; |
|
1849 } |
|
1850 if (m.base) { |
|
1851 conf.base = m.base; |
|
1852 } |
|
1853 |
|
1854 if (m.configFn) { |
|
1855 conf.configFn = m.configFn; |
|
1856 } |
|
1857 |
|
1858 this.addModule(conf, packName); |
|
1859 |
|
1860 if (lang) { |
|
1861 Y.Env.lang = Y.Env.lang || {}; |
|
1862 Y.Env.lang[lang] = Y.Env.lang[lang] || {}; |
|
1863 Y.Env.lang[lang][name] = true; |
|
1864 } |
|
1865 } |
|
1866 |
|
1867 return this.moduleInfo[packName]; |
|
1868 }, |
|
1869 |
|
1870 /** |
|
1871 * Investigates the current YUI configuration on the page. By default, |
|
1872 * modules already detected will not be loaded again unless a force |
|
1873 * option is encountered. Called by calculate() |
|
1874 * @method _setup |
|
1875 * @private |
|
1876 */ |
|
1877 _setup: function() { |
|
1878 var info = this.moduleInfo, name, i, j, m, l, |
|
1879 packName; |
|
1880 |
|
1881 for (name in info) { |
|
1882 if (info.hasOwnProperty(name)) { |
|
1883 m = info[name]; |
|
1884 if (m) { |
|
1885 |
|
1886 // remove dups |
|
1887 //m.requires = YObject.keys(yArray.hash(m.requires)); |
|
1888 m.requires = yArray.dedupe(m.requires); |
|
1889 |
|
1890 // Create lang pack modules |
|
1891 //if (m.lang && m.lang.length) { |
|
1892 if (m.lang) { |
|
1893 // Setup root package if the module has lang defined, |
|
1894 // it needs to provide a root language pack |
|
1895 packName = this.getLangPackName(ROOT_LANG, name); |
|
1896 this._addLangPack(null, m, packName); |
|
1897 } |
|
1898 |
|
1899 } |
|
1900 } |
|
1901 } |
|
1902 |
|
1903 |
|
1904 //l = Y.merge(this.inserted); |
|
1905 l = {}; |
|
1906 |
|
1907 // available modules |
|
1908 if (!this.ignoreRegistered) { |
|
1909 Y.mix(l, GLOBAL_ENV.mods); |
|
1910 } |
|
1911 |
|
1912 // add the ignore list to the list of loaded packages |
|
1913 if (this.ignore) { |
|
1914 Y.mix(l, yArray.hash(this.ignore)); |
|
1915 } |
|
1916 |
|
1917 // expand the list to include superseded modules |
|
1918 for (j in l) { |
|
1919 if (l.hasOwnProperty(j)) { |
|
1920 Y.mix(l, this.getProvides(j)); |
|
1921 } |
|
1922 } |
|
1923 |
|
1924 // remove modules on the force list from the loaded list |
|
1925 if (this.force) { |
|
1926 for (i = 0; i < this.force.length; i++) { |
|
1927 if (this.force[i] in l) { |
|
1928 delete l[this.force[i]]; |
|
1929 } |
|
1930 } |
|
1931 } |
|
1932 |
|
1933 Y.mix(this.loaded, l); |
|
1934 |
|
1935 this._init = true; |
|
1936 }, |
|
1937 |
|
1938 /** |
|
1939 * Builds a module name for a language pack |
|
1940 * @method getLangPackName |
|
1941 * @param {string} lang the language code. |
|
1942 * @param {string} mname the module to build it for. |
|
1943 * @return {string} the language pack module name. |
|
1944 */ |
|
1945 getLangPackName: function(lang, mname) { |
|
1946 return ('lang/' + mname + ((lang) ? '_' + lang : '')); |
|
1947 }, |
|
1948 /** |
|
1949 * Inspects the required modules list looking for additional |
|
1950 * dependencies. Expands the required list to include all |
|
1951 * required modules. Called by calculate() |
|
1952 * @method _explode |
|
1953 * @private |
|
1954 */ |
|
1955 _explode: function() { |
|
1956 //TODO Move done out of scope |
|
1957 var r = this.required, m, reqs, done = {}, |
|
1958 self = this, name, expound; |
|
1959 |
|
1960 // the setup phase is over, all modules have been created |
|
1961 self.dirty = false; |
|
1962 |
|
1963 self._explodeRollups(); |
|
1964 r = self.required; |
|
1965 |
|
1966 for (name in r) { |
|
1967 if (r.hasOwnProperty(name)) { |
|
1968 if (!done[name]) { |
|
1969 done[name] = true; |
|
1970 m = self.getModule(name); |
|
1971 if (m) { |
|
1972 expound = m.expound; |
|
1973 |
|
1974 if (expound) { |
|
1975 r[expound] = self.getModule(expound); |
|
1976 reqs = self.getRequires(r[expound]); |
|
1977 Y.mix(r, yArray.hash(reqs)); |
|
1978 } |
|
1979 |
|
1980 reqs = self.getRequires(m); |
|
1981 Y.mix(r, yArray.hash(reqs)); |
|
1982 } |
|
1983 } |
|
1984 } |
|
1985 } |
|
1986 |
|
1987 // Y.log('After explode: ' + YObject.keys(r)); |
|
1988 }, |
|
1989 /** |
|
1990 * The default method used to test a module against a pattern |
|
1991 * @method _patternTest |
|
1992 * @private |
|
1993 * @param {String} mname The module being tested |
|
1994 * @param {String} pname The pattern to match |
|
1995 */ |
|
1996 _patternTest: function(mname, pname) { |
|
1997 return (mname.indexOf(pname) > -1); |
|
1998 }, |
|
1999 /** |
|
2000 * Get's the loader meta data for the requested module |
|
2001 * @method getModule |
|
2002 * @param {String} mname The module name to get |
|
2003 * @return {Object} The module metadata |
|
2004 */ |
|
2005 getModule: function(mname) { |
|
2006 //TODO: Remove name check - it's a quick hack to fix pattern WIP |
|
2007 if (!mname) { |
|
2008 return null; |
|
2009 } |
|
2010 |
|
2011 var p, found, pname, |
|
2012 m = this.moduleInfo[mname], |
|
2013 patterns = this.patterns; |
|
2014 |
|
2015 // check the patterns library to see if we should automatically add |
|
2016 // the module with defaults |
|
2017 if (!m || (m && m.ext)) { |
|
2018 // Y.log('testing patterns ' + YObject.keys(patterns)); |
|
2019 for (pname in patterns) { |
|
2020 if (patterns.hasOwnProperty(pname)) { |
|
2021 // Y.log('testing pattern ' + i); |
|
2022 p = patterns[pname]; |
|
2023 |
|
2024 //There is no test method, create a default one that tests |
|
2025 // the pattern against the mod name |
|
2026 if (!p.test) { |
|
2027 p.test = this._patternTest; |
|
2028 } |
|
2029 |
|
2030 if (p.test(mname, pname)) { |
|
2031 // use the metadata supplied for the pattern |
|
2032 // as the module definition. |
|
2033 found = p; |
|
2034 break; |
|
2035 } |
|
2036 } |
|
2037 } |
|
2038 } |
|
2039 |
|
2040 if (!m) { |
|
2041 if (found) { |
|
2042 if (p.action) { |
|
2043 // Y.log('executing pattern action: ' + pname); |
|
2044 p.action.call(this, mname, pname); |
|
2045 } else { |
|
2046 Y.log('Undefined module: ' + mname + ', matched a pattern: ' + |
|
2047 pname, 'info', 'loader'); |
|
2048 // ext true or false? |
|
2049 m = this.addModule(Y.merge(found), mname); |
|
2050 if (found.configFn) { |
|
2051 m.configFn = found.configFn; |
|
2052 } |
|
2053 m.temp = true; |
|
2054 } |
|
2055 } |
|
2056 } else { |
|
2057 if (found && m && found.configFn && !m.configFn) { |
|
2058 m.configFn = found.configFn; |
|
2059 m.configFn(m); |
|
2060 } |
|
2061 } |
|
2062 |
|
2063 return m; |
|
2064 }, |
|
2065 |
|
2066 // impl in rollup submodule |
|
2067 _rollup: function() { }, |
|
2068 |
|
2069 /** |
|
2070 * Remove superceded modules and loaded modules. Called by |
|
2071 * calculate() after we have the mega list of all dependencies |
|
2072 * @method _reduce |
|
2073 * @return {object} the reduced dependency hash. |
|
2074 * @private |
|
2075 */ |
|
2076 _reduce: function(r) { |
|
2077 |
|
2078 r = r || this.required; |
|
2079 |
|
2080 var i, j, s, m, type = this.loadType, |
|
2081 ignore = this.ignore ? yArray.hash(this.ignore) : false; |
|
2082 |
|
2083 for (i in r) { |
|
2084 if (r.hasOwnProperty(i)) { |
|
2085 m = this.getModule(i); |
|
2086 // remove if already loaded |
|
2087 if (((this.loaded[i] || ON_PAGE[i]) && |
|
2088 !this.forceMap[i] && !this.ignoreRegistered) || |
|
2089 (type && m && m.type !== type)) { |
|
2090 delete r[i]; |
|
2091 } |
|
2092 if (ignore && ignore[i]) { |
|
2093 delete r[i]; |
|
2094 } |
|
2095 // remove anything this module supersedes |
|
2096 s = m && m.supersedes; |
|
2097 if (s) { |
|
2098 for (j = 0; j < s.length; j++) { |
|
2099 if (s[j] in r) { |
|
2100 delete r[s[j]]; |
|
2101 } |
|
2102 } |
|
2103 } |
|
2104 } |
|
2105 } |
|
2106 |
|
2107 return r; |
|
2108 }, |
|
2109 /** |
|
2110 * Handles the queue when a module has been loaded for all cases |
|
2111 * @method _finish |
|
2112 * @private |
|
2113 * @param {String} msg The message from Loader |
|
2114 * @param {Boolean} success A boolean denoting success or failure |
|
2115 */ |
|
2116 _finish: function(msg, success) { |
|
2117 Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' + |
|
2118 this.data, 'info', 'loader'); |
|
2119 |
|
2120 _queue.running = false; |
|
2121 |
|
2122 var onEnd = this.onEnd; |
|
2123 if (onEnd) { |
|
2124 onEnd.call(this.context, { |
|
2125 msg: msg, |
|
2126 data: this.data, |
|
2127 success: success |
|
2128 }); |
|
2129 } |
|
2130 this._continue(); |
|
2131 }, |
|
2132 /** |
|
2133 * The default Loader onSuccess handler, calls this.onSuccess with a payload |
|
2134 * @method _onSuccess |
|
2135 * @private |
|
2136 */ |
|
2137 _onSuccess: function() { |
|
2138 var self = this, skipped = Y.merge(self.skipped), fn, |
|
2139 failed = [], rreg = self.requireRegistration, |
|
2140 success, msg, i, mod; |
|
2141 |
|
2142 for (i in skipped) { |
|
2143 if (skipped.hasOwnProperty(i)) { |
|
2144 delete self.inserted[i]; |
|
2145 } |
|
2146 } |
|
2147 |
|
2148 self.skipped = {}; |
|
2149 |
|
2150 for (i in self.inserted) { |
|
2151 if (self.inserted.hasOwnProperty(i)) { |
|
2152 mod = self.getModule(i); |
|
2153 if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { |
|
2154 failed.push(i); |
|
2155 } else { |
|
2156 Y.mix(self.loaded, self.getProvides(i)); |
|
2157 } |
|
2158 } |
|
2159 } |
|
2160 |
|
2161 fn = self.onSuccess; |
|
2162 msg = (failed.length) ? 'notregistered' : 'success'; |
|
2163 success = !(failed.length); |
|
2164 if (fn) { |
|
2165 fn.call(self.context, { |
|
2166 msg: msg, |
|
2167 data: self.data, |
|
2168 success: success, |
|
2169 failed: failed, |
|
2170 skipped: skipped |
|
2171 }); |
|
2172 } |
|
2173 self._finish(msg, success); |
|
2174 }, |
|
2175 /** |
|
2176 * The default Loader onProgress handler, calls this.onProgress with a payload |
|
2177 * @method _onProgress |
|
2178 * @private |
|
2179 */ |
|
2180 _onProgress: function(e) { |
|
2181 var self = this, i; |
|
2182 //set the internal cache to what just came in. |
|
2183 if (e.data && e.data.length) { |
|
2184 for (i = 0; i < e.data.length; i++) { |
|
2185 e.data[i] = self.getModule(e.data[i].name); |
|
2186 } |
|
2187 } |
|
2188 if (self.onProgress) { |
|
2189 self.onProgress.call(self.context, { |
|
2190 name: e.url, |
|
2191 data: e.data |
|
2192 }); |
|
2193 } |
|
2194 }, |
|
2195 /** |
|
2196 * The default Loader onFailure handler, calls this.onFailure with a payload |
|
2197 * @method _onFailure |
|
2198 * @private |
|
2199 */ |
|
2200 _onFailure: function(o) { |
|
2201 var f = this.onFailure, msg = [], i = 0, len = o.errors.length; |
|
2202 |
|
2203 for (i; i < len; i++) { |
|
2204 msg.push(o.errors[i].error); |
|
2205 } |
|
2206 |
|
2207 msg = msg.join(','); |
|
2208 |
|
2209 Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader'); |
|
2210 |
|
2211 if (f) { |
|
2212 f.call(this.context, { |
|
2213 msg: msg, |
|
2214 data: this.data, |
|
2215 success: false |
|
2216 }); |
|
2217 } |
|
2218 |
|
2219 this._finish(msg, false); |
|
2220 |
|
2221 }, |
|
2222 |
|
2223 /** |
|
2224 * The default Loader onTimeout handler, calls this.onTimeout with a payload |
|
2225 * @method _onTimeout |
|
2226 * @param {Get.Transaction} transaction The Transaction object from `Y.Get` |
|
2227 * @private |
|
2228 */ |
|
2229 _onTimeout: function(transaction) { |
|
2230 Y.log('loader timeout: ' + Y.id, 'error', 'loader'); |
|
2231 var f = this.onTimeout; |
|
2232 if (f) { |
|
2233 f.call(this.context, { |
|
2234 msg: 'timeout', |
|
2235 data: this.data, |
|
2236 success: false, |
|
2237 transaction: transaction |
|
2238 }); |
|
2239 } |
|
2240 }, |
|
2241 |
|
2242 /** |
|
2243 * Sorts the dependency tree. The last step of calculate() |
|
2244 * @method _sort |
|
2245 * @private |
|
2246 */ |
|
2247 _sort: function() { |
|
2248 var name, |
|
2249 |
|
2250 // Object containing module names. |
|
2251 required = this.required, |
|
2252 |
|
2253 // Keep track of whether we've visited a module. |
|
2254 visited = {}; |
|
2255 |
|
2256 // Will contain modules names, in the correct order, |
|
2257 // according to dependencies. |
|
2258 this.sorted = []; |
|
2259 |
|
2260 for (name in required) { |
|
2261 if (!visited[name] && required.hasOwnProperty(name)) { |
|
2262 this._visit(name, visited); |
|
2263 } |
|
2264 } |
|
2265 }, |
|
2266 |
|
2267 /** |
|
2268 * Recursively visits the dependencies of the module name |
|
2269 * passed in, and appends each module name to the `sorted` property. |
|
2270 * @param {String} name The name of a module. |
|
2271 * @param {Object} visited Keeps track of whether a module was visited. |
|
2272 * @method _visit |
|
2273 * @private |
|
2274 */ |
|
2275 _visit: function (name, visited) { |
|
2276 var required, moduleInfo, dependency, dependencies, i, l; |
|
2277 |
|
2278 visited[name] = true; |
|
2279 required = this.required; |
|
2280 moduleInfo = this.moduleInfo[name]; |
|
2281 |
|
2282 if (moduleInfo) { |
|
2283 // Recurse on each dependency of this module, |
|
2284 // figuring out its dependencies, and so on. |
|
2285 dependencies = moduleInfo.requires; |
|
2286 for (i = 0, l = dependencies.length; i < l; ++i) { |
|
2287 dependency = dependencies[i]; |
|
2288 |
|
2289 // Is this module name in the required list of modules, |
|
2290 // and have we not already visited it? |
|
2291 if (required[dependency] && !visited[dependency]) { |
|
2292 this._visit(dependency, visited); |
|
2293 } |
|
2294 } |
|
2295 } |
|
2296 |
|
2297 this.sorted.push(name); |
|
2298 }, |
|
2299 |
|
2300 /** |
|
2301 * Handles the actual insertion of script/link tags |
|
2302 * @method _insert |
|
2303 * @private |
|
2304 * @param {Object} source The YUI instance the request came from |
|
2305 * @param {Object} o The metadata to include |
|
2306 * @param {String} type JS or CSS |
|
2307 * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta |
|
2308 */ |
|
2309 _insert: function(source, o, type, skipcalc) { |
|
2310 |
|
2311 Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader"); |
|
2312 |
|
2313 // restore the state at the time of the request |
|
2314 if (source) { |
|
2315 this._config(source); |
|
2316 } |
|
2317 |
|
2318 // build the dependency list |
|
2319 // don't include type so we can process CSS and script in |
|
2320 // one pass when the type is not specified. |
|
2321 |
|
2322 var modules = this.resolve(!skipcalc), |
|
2323 self = this, comp = 0, actions = 0, |
|
2324 mods = {}, deps, complete; |
|
2325 |
|
2326 self._refetch = []; |
|
2327 |
|
2328 if (type) { |
|
2329 //Filter out the opposite type and reset the array so the checks later work |
|
2330 modules[((type === JS) ? CSS : JS)] = []; |
|
2331 } |
|
2332 if (!self.fetchCSS) { |
|
2333 modules.css = []; |
|
2334 } |
|
2335 if (modules.js.length) { |
|
2336 comp++; |
|
2337 } |
|
2338 if (modules.css.length) { |
|
2339 comp++; |
|
2340 } |
|
2341 |
|
2342 //console.log('Resolved Modules: ', modules); |
|
2343 |
|
2344 complete = function(d) { |
|
2345 actions++; |
|
2346 var errs = {}, i = 0, o = 0, u = '', fn, |
|
2347 modName, resMods; |
|
2348 |
|
2349 if (d && d.errors) { |
|
2350 for (i = 0; i < d.errors.length; i++) { |
|
2351 if (d.errors[i].request) { |
|
2352 u = d.errors[i].request.url; |
|
2353 } else { |
|
2354 u = d.errors[i]; |
|
2355 } |
|
2356 errs[u] = u; |
|
2357 } |
|
2358 } |
|
2359 |
|
2360 if (d && d.data && d.data.length && (d.type === 'success')) { |
|
2361 for (i = 0; i < d.data.length; i++) { |
|
2362 self.inserted[d.data[i].name] = true; |
|
2363 //If the external module has a skin or a lang, reprocess it |
|
2364 if (d.data[i].lang || d.data[i].skinnable) { |
|
2365 delete self.inserted[d.data[i].name]; |
|
2366 self._refetch.push(d.data[i].name); |
|
2367 } |
|
2368 } |
|
2369 } |
|
2370 |
|
2371 if (actions === comp) { |
|
2372 self._loading = null; |
|
2373 Y.log('Loader actions complete!', 'info', 'loader'); |
|
2374 if (self._refetch.length) { |
|
2375 //Get the deps for the new meta-data and reprocess |
|
2376 Y.log('Found potential modules to refetch', 'info', 'loader'); |
|
2377 for (i = 0; i < self._refetch.length; i++) { |
|
2378 deps = self.getRequires(self.getModule(self._refetch[i])); |
|
2379 for (o = 0; o < deps.length; o++) { |
|
2380 if (!self.inserted[deps[o]]) { |
|
2381 //We wouldn't be to this point without the module being here |
|
2382 mods[deps[o]] = deps[o]; |
|
2383 } |
|
2384 } |
|
2385 } |
|
2386 mods = Y.Object.keys(mods); |
|
2387 if (mods.length) { |
|
2388 Y.log('Refetching modules with new meta-data', 'info', 'loader'); |
|
2389 self.require(mods); |
|
2390 resMods = self.resolve(true); |
|
2391 if (resMods.cssMods.length) { |
|
2392 for (i=0; i < resMods.cssMods.length; i++) { |
|
2393 modName = resMods.cssMods[i].name; |
|
2394 delete YUI.Env._cssLoaded[modName]; |
|
2395 if (self.isCSSLoaded(modName)) { |
|
2396 self.inserted[modName] = true; |
|
2397 delete self.required[modName]; |
|
2398 } |
|
2399 } |
|
2400 self.sorted = []; |
|
2401 self._sort(); |
|
2402 } |
|
2403 d = null; //bail |
|
2404 self._insert(); //insert the new deps |
|
2405 } |
|
2406 } |
|
2407 if (d && d.fn) { |
|
2408 Y.log('Firing final Loader callback!', 'info', 'loader'); |
|
2409 fn = d.fn; |
|
2410 delete d.fn; |
|
2411 fn.call(self, d); |
|
2412 } |
|
2413 } |
|
2414 }; |
|
2415 |
|
2416 this._loading = true; |
|
2417 |
|
2418 if (!modules.js.length && !modules.css.length) { |
|
2419 Y.log('No modules resolved..', 'warn', 'loader'); |
|
2420 actions = -1; |
|
2421 complete({ |
|
2422 fn: self._onSuccess |
|
2423 }); |
|
2424 return; |
|
2425 } |
|
2426 |
|
2427 |
|
2428 if (modules.css.length) { //Load CSS first |
|
2429 Y.log('Loading CSS modules', 'info', 'loader'); |
|
2430 Y.Get.css(modules.css, { |
|
2431 data: modules.cssMods, |
|
2432 attributes: self.cssAttributes, |
|
2433 insertBefore: self.insertBefore, |
|
2434 charset: self.charset, |
|
2435 timeout: self.timeout, |
|
2436 context: self, |
|
2437 onProgress: function(e) { |
|
2438 self._onProgress.call(self, e); |
|
2439 }, |
|
2440 onTimeout: function(d) { |
|
2441 self._onTimeout.call(self, d); |
|
2442 }, |
|
2443 onSuccess: function(d) { |
|
2444 d.type = 'success'; |
|
2445 d.fn = self._onSuccess; |
|
2446 complete.call(self, d); |
|
2447 }, |
|
2448 onFailure: function(d) { |
|
2449 d.type = 'failure'; |
|
2450 d.fn = self._onFailure; |
|
2451 complete.call(self, d); |
|
2452 } |
|
2453 }); |
|
2454 } |
|
2455 |
|
2456 if (modules.js.length) { |
|
2457 Y.log('Loading JS modules', 'info', 'loader'); |
|
2458 Y.Get.js(modules.js, { |
|
2459 data: modules.jsMods, |
|
2460 insertBefore: self.insertBefore, |
|
2461 attributes: self.jsAttributes, |
|
2462 charset: self.charset, |
|
2463 timeout: self.timeout, |
|
2464 autopurge: false, |
|
2465 context: self, |
|
2466 async: self.async, |
|
2467 onProgress: function(e) { |
|
2468 self._onProgress.call(self, e); |
|
2469 }, |
|
2470 onTimeout: function(d) { |
|
2471 self._onTimeout.call(self, d); |
|
2472 }, |
|
2473 onSuccess: function(d) { |
|
2474 d.type = 'success'; |
|
2475 d.fn = self._onSuccess; |
|
2476 complete.call(self, d); |
|
2477 }, |
|
2478 onFailure: function(d) { |
|
2479 d.type = 'failure'; |
|
2480 d.fn = self._onFailure; |
|
2481 complete.call(self, d); |
|
2482 } |
|
2483 }); |
|
2484 } |
|
2485 }, |
|
2486 /** |
|
2487 * Once a loader operation is completely finished, process any additional queued items. |
|
2488 * @method _continue |
|
2489 * @private |
|
2490 */ |
|
2491 _continue: function() { |
|
2492 if (!(_queue.running) && _queue.size() > 0) { |
|
2493 _queue.running = true; |
|
2494 _queue.next()(); |
|
2495 } |
|
2496 }, |
|
2497 |
|
2498 /** |
|
2499 * inserts the requested modules and their dependencies. |
|
2500 * <code>type</code> can be "js" or "css". Both script and |
|
2501 * css are inserted if type is not provided. |
|
2502 * @method insert |
|
2503 * @param {object} o optional options object. |
|
2504 * @param {string} type the type of dependency to insert. |
|
2505 */ |
|
2506 insert: function(o, type, skipsort) { |
|
2507 Y.log('public insert() ' + (type || '') + ', ' + |
|
2508 Y.Object.keys(this.required), "info", "loader"); |
|
2509 var self = this, copy = Y.merge(this); |
|
2510 delete copy.require; |
|
2511 delete copy.dirty; |
|
2512 _queue.add(function() { |
|
2513 self._insert(copy, o, type, skipsort); |
|
2514 }); |
|
2515 this._continue(); |
|
2516 }, |
|
2517 |
|
2518 /** |
|
2519 * Executed every time a module is loaded, and if we are in a load |
|
2520 * cycle, we attempt to load the next script. Public so that it |
|
2521 * is possible to call this if using a method other than |
|
2522 * Y.register to determine when scripts are fully loaded |
|
2523 * @method loadNext |
|
2524 * @deprecated |
|
2525 * @param {string} mname optional the name of the module that has |
|
2526 * been loaded (which is usually why it is time to load the next |
|
2527 * one). |
|
2528 */ |
|
2529 loadNext: function() { |
|
2530 Y.log('loadNext was called..', 'error', 'loader'); |
|
2531 return; |
|
2532 }, |
|
2533 |
|
2534 /** |
|
2535 * Apply filter defined for this instance to a url/path |
|
2536 * @method _filter |
|
2537 * @param {string} u the string to filter. |
|
2538 * @param {string} name the name of the module, if we are processing |
|
2539 * a single module as opposed to a combined url. |
|
2540 * @return {string} the filtered string. |
|
2541 * @private |
|
2542 */ |
|
2543 _filter: function(u, name, group) { |
|
2544 var f = this.filter, |
|
2545 hasFilter = name && (name in this.filters), |
|
2546 modFilter = hasFilter && this.filters[name], |
|
2547 groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null); |
|
2548 |
|
2549 if (groupName && this.groups[groupName] && this.groups[groupName].filter) { |
|
2550 modFilter = this.groups[groupName].filter; |
|
2551 hasFilter = true; |
|
2552 } |
|
2553 |
|
2554 if (u) { |
|
2555 if (hasFilter) { |
|
2556 f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter; |
|
2557 } |
|
2558 if (f) { |
|
2559 u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr); |
|
2560 } |
|
2561 } |
|
2562 return u; |
|
2563 }, |
|
2564 |
|
2565 /** |
|
2566 * Generates the full url for a module |
|
2567 * @method _url |
|
2568 * @param {string} path the path fragment. |
|
2569 * @param {String} name The name of the module |
|
2570 * @param {String} [base] The base url to use. Defaults to self.base |
|
2571 * @return {string} the full url. |
|
2572 * @private |
|
2573 */ |
|
2574 _url: function(path, name, base) { |
|
2575 return this._filter((base || this.base || '') + path, name); |
|
2576 }, |
|
2577 /** |
|
2578 * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules. |
|
2579 * @method resolve |
|
2580 * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else |
|
2581 * @param {Array} [s] An override for the loader.sorted array. Defaults to |
|
2582 * `loader.sorted`. |
|
2583 * @return {Object} Object hash (js and css) of two arrays of file lists |
|
2584 * @example This method can be used as an off-line dep calculator |
|
2585 * |
|
2586 * var Y = YUI(); |
|
2587 * var loader = new Y.Loader({ |
|
2588 * filter: 'debug', |
|
2589 * base: '../../', |
|
2590 * root: 'build/', |
|
2591 * combine: true, |
|
2592 * require: ['node', 'dd', 'console'] |
|
2593 * }); |
|
2594 * var out = loader.resolve(true); |
|
2595 * |
|
2596 */ |
|
2597 resolve: function(calc, s) { |
|
2598 |
|
2599 var len, i, m, url, group, groupName, j, frag, |
|
2600 comboSource, comboSources, mods, comboBase, |
|
2601 base, urls, u = [], tmpBase, baseLen, resCombos = {}, |
|
2602 self = this, comboSep, maxURLLength, |
|
2603 inserted = (self.ignoreRegistered) ? {} : self.inserted, |
|
2604 resolved = { js: [], jsMods: [], css: [], cssMods: [] }, |
|
2605 type = self.loadType || 'js', addSingle; |
|
2606 |
|
2607 if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { |
|
2608 self._resetModules(); |
|
2609 } |
|
2610 |
|
2611 if (calc) { |
|
2612 self.calculate(); |
|
2613 } |
|
2614 s = s || self.sorted; |
|
2615 |
|
2616 addSingle = function(m) { |
|
2617 |
|
2618 if (m) { |
|
2619 group = (m.group && self.groups[m.group]) || NOT_FOUND; |
|
2620 |
|
2621 //Always assume it's async |
|
2622 if (group.async === false) { |
|
2623 m.async = group.async; |
|
2624 } |
|
2625 |
|
2626 url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : |
|
2627 self._url(m.path, s[i], group.base || m.base); |
|
2628 |
|
2629 if (m.attributes || m.async === false) { |
|
2630 url = { |
|
2631 url: url, |
|
2632 async: m.async |
|
2633 }; |
|
2634 if (m.attributes) { |
|
2635 url.attributes = m.attributes; |
|
2636 } |
|
2637 } |
|
2638 resolved[m.type].push(url); |
|
2639 resolved[m.type + 'Mods'].push(m); |
|
2640 } else { |
|
2641 Y.log('Undefined Module', 'warn', 'loader'); |
|
2642 } |
|
2643 |
|
2644 }; |
|
2645 |
|
2646 len = s.length; |
|
2647 |
|
2648 // the default combo base |
|
2649 comboBase = self.comboBase; |
|
2650 |
|
2651 url = comboBase; |
|
2652 |
|
2653 comboSources = {}; |
|
2654 |
|
2655 for (i = 0; i < len; i++) { |
|
2656 comboSource = comboBase; |
|
2657 m = self.getModule(s[i]); |
|
2658 groupName = m && m.group; |
|
2659 group = self.groups[groupName]; |
|
2660 if (groupName && group) { |
|
2661 |
|
2662 if (!group.combine || m.fullpath) { |
|
2663 //This is not a combo module, skip it and load it singly later. |
|
2664 addSingle(m); |
|
2665 continue; |
|
2666 } |
|
2667 m.combine = true; |
|
2668 if (group.comboBase) { |
|
2669 comboSource = group.comboBase; |
|
2670 } |
|
2671 |
|
2672 if ("root" in group && L.isValue(group.root)) { |
|
2673 m.root = group.root; |
|
2674 } |
|
2675 m.comboSep = group.comboSep || self.comboSep; |
|
2676 m.maxURLLength = group.maxURLLength || self.maxURLLength; |
|
2677 } else { |
|
2678 if (!self.combine) { |
|
2679 //This is not a combo module, skip it and load it singly later. |
|
2680 addSingle(m); |
|
2681 continue; |
|
2682 } |
|
2683 } |
|
2684 |
|
2685 comboSources[comboSource] = comboSources[comboSource] || []; |
|
2686 comboSources[comboSource].push(m); |
|
2687 } |
|
2688 |
|
2689 for (j in comboSources) { |
|
2690 if (comboSources.hasOwnProperty(j)) { |
|
2691 resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] }; |
|
2692 url = j; |
|
2693 mods = comboSources[j]; |
|
2694 len = mods.length; |
|
2695 |
|
2696 if (len) { |
|
2697 for (i = 0; i < len; i++) { |
|
2698 if (inserted[mods[i]]) { |
|
2699 continue; |
|
2700 } |
|
2701 m = mods[i]; |
|
2702 // Do not try to combine non-yui JS unless combo def |
|
2703 // is found |
|
2704 if (m && (m.combine || !m.ext)) { |
|
2705 resCombos[j].comboSep = m.comboSep; |
|
2706 resCombos[j].group = m.group; |
|
2707 resCombos[j].maxURLLength = m.maxURLLength; |
|
2708 frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath); |
|
2709 frag = self._filter(frag, m.name); |
|
2710 resCombos[j][m.type].push(frag); |
|
2711 resCombos[j][m.type + 'Mods'].push(m); |
|
2712 } else { |
|
2713 //Add them to the next process.. |
|
2714 if (mods[i]) { |
|
2715 addSingle(mods[i]); |
|
2716 } |
|
2717 } |
|
2718 |
|
2719 } |
|
2720 } |
|
2721 } |
|
2722 } |
|
2723 |
|
2724 |
|
2725 for (j in resCombos) { |
|
2726 if (resCombos.hasOwnProperty(j)) { |
|
2727 base = j; |
|
2728 comboSep = resCombos[base].comboSep || self.comboSep; |
|
2729 maxURLLength = resCombos[base].maxURLLength || self.maxURLLength; |
|
2730 Y.log('Using maxURLLength of ' + maxURLLength, 'info', 'loader'); |
|
2731 for (type in resCombos[base]) { |
|
2732 if (type === JS || type === CSS) { |
|
2733 urls = resCombos[base][type]; |
|
2734 mods = resCombos[base][type + 'Mods']; |
|
2735 len = urls.length; |
|
2736 tmpBase = base + urls.join(comboSep); |
|
2737 baseLen = tmpBase.length; |
|
2738 if (maxURLLength <= base.length) { |
|
2739 Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader'); |
|
2740 maxURLLength = MAX_URL_LENGTH; |
|
2741 } |
|
2742 |
|
2743 if (len) { |
|
2744 if (baseLen > maxURLLength) { |
|
2745 Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader'); |
|
2746 u = []; |
|
2747 for (s = 0; s < len; s++) { |
|
2748 u.push(urls[s]); |
|
2749 tmpBase = base + u.join(comboSep); |
|
2750 |
|
2751 if (tmpBase.length > maxURLLength) { |
|
2752 m = u.pop(); |
|
2753 tmpBase = base + u.join(comboSep); |
|
2754 resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); |
|
2755 u = []; |
|
2756 if (m) { |
|
2757 u.push(m); |
|
2758 } |
|
2759 } |
|
2760 } |
|
2761 if (u.length) { |
|
2762 tmpBase = base + u.join(comboSep); |
|
2763 resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); |
|
2764 } |
|
2765 } else { |
|
2766 resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); |
|
2767 } |
|
2768 } |
|
2769 resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods); |
|
2770 } |
|
2771 } |
|
2772 } |
|
2773 } |
|
2774 |
|
2775 resCombos = null; |
|
2776 |
|
2777 return resolved; |
|
2778 }, |
|
2779 /** |
|
2780 Shortcut to calculate, resolve and load all modules. |
|
2781 |
|
2782 var loader = new Y.Loader({ |
|
2783 ignoreRegistered: true, |
|
2784 modules: { |
|
2785 mod: { |
|
2786 path: 'mod.js' |
|
2787 } |
|
2788 }, |
|
2789 requires: [ 'mod' ] |
|
2790 }); |
|
2791 loader.load(function() { |
|
2792 console.log('All modules have loaded..'); |
|
2793 }); |
|
2794 |
|
2795 |
|
2796 @method load |
|
2797 @param {Function} cb Executed after all load operations are complete |
|
2798 */ |
|
2799 load: function(cb) { |
|
2800 if (!cb) { |
|
2801 Y.log('No callback supplied to load()', 'error', 'loader'); |
|
2802 return; |
|
2803 } |
|
2804 var self = this, |
|
2805 out = self.resolve(true); |
|
2806 |
|
2807 self.data = out; |
|
2808 |
|
2809 self.onEnd = function() { |
|
2810 cb.apply(self.context || self, arguments); |
|
2811 }; |
|
2812 |
|
2813 self.insert(); |
|
2814 } |
|
2815 }; |
|
2816 |
|
2817 |
|
2818 |
|
2819 }, '@VERSION@', {"requires": ["get", "features"]}); |
|
2820 YUI.add('loader-rollup', function (Y, NAME) { |
|
2821 |
|
2822 /** |
|
2823 * Optional automatic rollup logic for reducing http connections |
|
2824 * when not using a combo service. |
|
2825 * @module loader |
|
2826 * @submodule rollup |
|
2827 */ |
|
2828 |
|
2829 /** |
|
2830 * Look for rollup packages to determine if all of the modules a |
|
2831 * rollup supersedes are required. If so, include the rollup to |
|
2832 * help reduce the total number of connections required. Called |
|
2833 * by calculate(). This is an optional feature, and requires the |
|
2834 * appropriate submodule to function. |
|
2835 * @method _rollup |
|
2836 * @for Loader |
|
2837 * @private |
|
2838 */ |
|
2839 Y.Loader.prototype._rollup = function() { |
|
2840 var i, j, m, s, r = this.required, roll, |
|
2841 info = this.moduleInfo, rolled, c, smod; |
|
2842 |
|
2843 // find and cache rollup modules |
|
2844 if (this.dirty || !this.rollups) { |
|
2845 this.rollups = {}; |
|
2846 for (i in info) { |
|
2847 if (info.hasOwnProperty(i)) { |
|
2848 m = this.getModule(i); |
|
2849 // if (m && m.rollup && m.supersedes) { |
|
2850 if (m && m.rollup) { |
|
2851 this.rollups[i] = m; |
|
2852 } |
|
2853 } |
|
2854 } |
|
2855 } |
|
2856 |
|
2857 // make as many passes as needed to pick up rollup rollups |
|
2858 for (;;) { |
|
2859 rolled = false; |
|
2860 |
|
2861 // go through the rollup candidates |
|
2862 for (i in this.rollups) { |
|
2863 if (this.rollups.hasOwnProperty(i)) { |
|
2864 // there can be only one, unless forced |
|
2865 if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) { |
|
2866 m = this.getModule(i); |
|
2867 s = m.supersedes || []; |
|
2868 roll = false; |
|
2869 |
|
2870 // @TODO remove continue |
|
2871 if (!m.rollup) { |
|
2872 continue; |
|
2873 } |
|
2874 |
|
2875 c = 0; |
|
2876 |
|
2877 // check the threshold |
|
2878 for (j = 0; j < s.length; j++) { |
|
2879 smod = info[s[j]]; |
|
2880 |
|
2881 // if the superseded module is loaded, we can't |
|
2882 // load the rollup unless it has been forced. |
|
2883 if (this.loaded[s[j]] && !this.forceMap[s[j]]) { |
|
2884 roll = false; |
|
2885 break; |
|
2886 // increment the counter if this module is required. |
|
2887 // if we are beyond the rollup threshold, we will |
|
2888 // use the rollup module |
|
2889 } else if (r[s[j]] && m.type === smod.type) { |
|
2890 c++; |
|
2891 // Y.log("adding to thresh: " + c + ", " + s[j]); |
|
2892 roll = (c >= m.rollup); |
|
2893 if (roll) { |
|
2894 // Y.log("over thresh " + c + ", " + s[j]); |
|
2895 break; |
|
2896 } |
|
2897 } |
|
2898 } |
|
2899 |
|
2900 if (roll) { |
|
2901 // Y.log("adding rollup: " + i); |
|
2902 // add the rollup |
|
2903 r[i] = true; |
|
2904 rolled = true; |
|
2905 |
|
2906 // expand the rollup's dependencies |
|
2907 this.getRequires(m); |
|
2908 } |
|
2909 } |
|
2910 } |
|
2911 } |
|
2912 |
|
2913 // if we made it here w/o rolling up something, we are done |
|
2914 if (!rolled) { |
|
2915 break; |
|
2916 } |
|
2917 } |
|
2918 }; |
|
2919 |
|
2920 |
|
2921 }, '@VERSION@', {"requires": ["loader-base"]}); |
|
2922 YUI.add('loader-yui3', function (Y, NAME) { |
|
2923 |
|
2924 /* This file is auto-generated by (yogi loader --yes --mix --start ../) */ |
|
2925 |
|
2926 /*jshint maxlen:900, eqeqeq: false */ |
|
2927 |
|
2928 /** |
|
2929 * YUI 3 module metadata |
|
2930 * @module loader |
|
2931 * @submodule loader-yui3 |
|
2932 */ |
|
2933 YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {}; |
|
2934 Y.mix(YUI.Env[Y.version].modules, { |
|
2935 "align-plugin": { |
|
2936 "requires": [ |
|
2937 "node-screen", |
|
2938 "node-pluginhost" |
|
2939 ] |
|
2940 }, |
|
2941 "anim": { |
|
2942 "use": [ |
|
2943 "anim-base", |
|
2944 "anim-color", |
|
2945 "anim-curve", |
|
2946 "anim-easing", |
|
2947 "anim-node-plugin", |
|
2948 "anim-scroll", |
|
2949 "anim-xy" |
|
2950 ] |
|
2951 }, |
|
2952 "anim-base": { |
|
2953 "requires": [ |
|
2954 "base-base", |
|
2955 "node-style" |
|
2956 ] |
|
2957 }, |
|
2958 "anim-color": { |
|
2959 "requires": [ |
|
2960 "anim-base" |
|
2961 ] |
|
2962 }, |
|
2963 "anim-curve": { |
|
2964 "requires": [ |
|
2965 "anim-xy" |
|
2966 ] |
|
2967 }, |
|
2968 "anim-easing": { |
|
2969 "requires": [ |
|
2970 "anim-base" |
|
2971 ] |
|
2972 }, |
|
2973 "anim-node-plugin": { |
|
2974 "requires": [ |
|
2975 "node-pluginhost", |
|
2976 "anim-base" |
|
2977 ] |
|
2978 }, |
|
2979 "anim-scroll": { |
|
2980 "requires": [ |
|
2981 "anim-base" |
|
2982 ] |
|
2983 }, |
|
2984 "anim-shape": { |
|
2985 "requires": [ |
|
2986 "anim-base", |
|
2987 "anim-easing", |
|
2988 "anim-color", |
|
2989 "matrix" |
|
2990 ] |
|
2991 }, |
|
2992 "anim-shape-transform": { |
|
2993 "use": [ |
|
2994 "anim-shape" |
|
2995 ] |
|
2996 }, |
|
2997 "anim-xy": { |
|
2998 "requires": [ |
|
2999 "anim-base", |
|
3000 "node-screen" |
|
3001 ] |
|
3002 }, |
|
3003 "app": { |
|
3004 "use": [ |
|
3005 "app-base", |
|
3006 "app-content", |
|
3007 "app-transitions", |
|
3008 "lazy-model-list", |
|
3009 "model", |
|
3010 "model-list", |
|
3011 "model-sync-rest", |
|
3012 "model-sync-local", |
|
3013 "router", |
|
3014 "view", |
|
3015 "view-node-map" |
|
3016 ] |
|
3017 }, |
|
3018 "app-base": { |
|
3019 "requires": [ |
|
3020 "classnamemanager", |
|
3021 "pjax-base", |
|
3022 "router", |
|
3023 "view" |
|
3024 ] |
|
3025 }, |
|
3026 "app-content": { |
|
3027 "requires": [ |
|
3028 "app-base", |
|
3029 "pjax-content" |
|
3030 ] |
|
3031 }, |
|
3032 "app-transitions": { |
|
3033 "requires": [ |
|
3034 "app-base" |
|
3035 ] |
|
3036 }, |
|
3037 "app-transitions-css": { |
|
3038 "type": "css" |
|
3039 }, |
|
3040 "app-transitions-native": { |
|
3041 "condition": { |
|
3042 "name": "app-transitions-native", |
|
3043 "test": function (Y) { |
|
3044 var doc = Y.config.doc, |
|
3045 node = doc ? doc.documentElement : null; |
|
3046 |
|
3047 if (node && node.style) { |
|
3048 return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); |
|
3049 } |
|
3050 |
|
3051 return false; |
|
3052 }, |
|
3053 "trigger": "app-transitions" |
|
3054 }, |
|
3055 "requires": [ |
|
3056 "app-transitions", |
|
3057 "app-transitions-css", |
|
3058 "parallel", |
|
3059 "transition" |
|
3060 ] |
|
3061 }, |
|
3062 "array-extras": { |
|
3063 "requires": [ |
|
3064 "yui-base" |
|
3065 ] |
|
3066 }, |
|
3067 "array-invoke": { |
|
3068 "requires": [ |
|
3069 "yui-base" |
|
3070 ] |
|
3071 }, |
|
3072 "arraylist": { |
|
3073 "requires": [ |
|
3074 "yui-base" |
|
3075 ] |
|
3076 }, |
|
3077 "arraylist-add": { |
|
3078 "requires": [ |
|
3079 "arraylist" |
|
3080 ] |
|
3081 }, |
|
3082 "arraylist-filter": { |
|
3083 "requires": [ |
|
3084 "arraylist" |
|
3085 ] |
|
3086 }, |
|
3087 "arraysort": { |
|
3088 "requires": [ |
|
3089 "yui-base" |
|
3090 ] |
|
3091 }, |
|
3092 "async-queue": { |
|
3093 "requires": [ |
|
3094 "event-custom" |
|
3095 ] |
|
3096 }, |
|
3097 "attribute": { |
|
3098 "use": [ |
|
3099 "attribute-base", |
|
3100 "attribute-complex" |
|
3101 ] |
|
3102 }, |
|
3103 "attribute-base": { |
|
3104 "requires": [ |
|
3105 "attribute-core", |
|
3106 "attribute-observable", |
|
3107 "attribute-extras" |
|
3108 ] |
|
3109 }, |
|
3110 "attribute-complex": { |
|
3111 "requires": [ |
|
3112 "attribute-base" |
|
3113 ] |
|
3114 }, |
|
3115 "attribute-core": { |
|
3116 "requires": [ |
|
3117 "oop" |
|
3118 ] |
|
3119 }, |
|
3120 "attribute-events": { |
|
3121 "use": [ |
|
3122 "attribute-observable" |
|
3123 ] |
|
3124 }, |
|
3125 "attribute-extras": { |
|
3126 "requires": [ |
|
3127 "oop" |
|
3128 ] |
|
3129 }, |
|
3130 "attribute-observable": { |
|
3131 "requires": [ |
|
3132 "event-custom" |
|
3133 ] |
|
3134 }, |
|
3135 "autocomplete": { |
|
3136 "use": [ |
|
3137 "autocomplete-base", |
|
3138 "autocomplete-sources", |
|
3139 "autocomplete-list", |
|
3140 "autocomplete-plugin" |
|
3141 ] |
|
3142 }, |
|
3143 "autocomplete-base": { |
|
3144 "optional": [ |
|
3145 "autocomplete-sources" |
|
3146 ], |
|
3147 "requires": [ |
|
3148 "array-extras", |
|
3149 "base-build", |
|
3150 "escape", |
|
3151 "event-valuechange", |
|
3152 "node-base" |
|
3153 ] |
|
3154 }, |
|
3155 "autocomplete-filters": { |
|
3156 "requires": [ |
|
3157 "array-extras", |
|
3158 "text-wordbreak" |
|
3159 ] |
|
3160 }, |
|
3161 "autocomplete-filters-accentfold": { |
|
3162 "requires": [ |
|
3163 "array-extras", |
|
3164 "text-accentfold", |
|
3165 "text-wordbreak" |
|
3166 ] |
|
3167 }, |
|
3168 "autocomplete-highlighters": { |
|
3169 "requires": [ |
|
3170 "array-extras", |
|
3171 "highlight-base" |
|
3172 ] |
|
3173 }, |
|
3174 "autocomplete-highlighters-accentfold": { |
|
3175 "requires": [ |
|
3176 "array-extras", |
|
3177 "highlight-accentfold" |
|
3178 ] |
|
3179 }, |
|
3180 "autocomplete-list": { |
|
3181 "after": [ |
|
3182 "autocomplete-sources" |
|
3183 ], |
|
3184 "lang": [ |
|
3185 "en", |
|
3186 "es", |
|
3187 "hu", |
|
3188 "it" |
|
3189 ], |
|
3190 "requires": [ |
|
3191 "autocomplete-base", |
|
3192 "event-resize", |
|
3193 "node-screen", |
|
3194 "selector-css3", |
|
3195 "shim-plugin", |
|
3196 "widget", |
|
3197 "widget-position", |
|
3198 "widget-position-align" |
|
3199 ], |
|
3200 "skinnable": true |
|
3201 }, |
|
3202 "autocomplete-list-keys": { |
|
3203 "condition": { |
|
3204 "name": "autocomplete-list-keys", |
|
3205 "test": function (Y) { |
|
3206 // Only add keyboard support to autocomplete-list if this doesn't appear to |
|
3207 // be an iOS or Android-based mobile device. |
|
3208 // |
|
3209 // There's currently no feasible way to actually detect whether a device has |
|
3210 // a hardware keyboard, so this sniff will have to do. It can easily be |
|
3211 // overridden by manually loading the autocomplete-list-keys module. |
|
3212 // |
|
3213 // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari |
|
3214 // doesn't fire the keyboard events used by AutoCompleteList, so there's |
|
3215 // no point loading the -keys module even when a bluetooth keyboard may be |
|
3216 // available. |
|
3217 return !(Y.UA.ios || Y.UA.android); |
|
3218 }, |
|
3219 "trigger": "autocomplete-list" |
|
3220 }, |
|
3221 "requires": [ |
|
3222 "autocomplete-list", |
|
3223 "base-build" |
|
3224 ] |
|
3225 }, |
|
3226 "autocomplete-plugin": { |
|
3227 "requires": [ |
|
3228 "autocomplete-list", |
|
3229 "node-pluginhost" |
|
3230 ] |
|
3231 }, |
|
3232 "autocomplete-sources": { |
|
3233 "optional": [ |
|
3234 "io-base", |
|
3235 "json-parse", |
|
3236 "jsonp", |
|
3237 "yql" |
|
3238 ], |
|
3239 "requires": [ |
|
3240 "autocomplete-base" |
|
3241 ] |
|
3242 }, |
|
3243 "axes": { |
|
3244 "use": [ |
|
3245 "axis-numeric", |
|
3246 "axis-category", |
|
3247 "axis-time", |
|
3248 "axis-stacked" |
|
3249 ] |
|
3250 }, |
|
3251 "axes-base": { |
|
3252 "use": [ |
|
3253 "axis-numeric-base", |
|
3254 "axis-category-base", |
|
3255 "axis-time-base", |
|
3256 "axis-stacked-base" |
|
3257 ] |
|
3258 }, |
|
3259 "axis": { |
|
3260 "requires": [ |
|
3261 "dom", |
|
3262 "widget", |
|
3263 "widget-position", |
|
3264 "widget-stack", |
|
3265 "graphics", |
|
3266 "axis-base" |
|
3267 ] |
|
3268 }, |
|
3269 "axis-base": { |
|
3270 "requires": [ |
|
3271 "classnamemanager", |
|
3272 "datatype-number", |
|
3273 "datatype-date", |
|
3274 "base", |
|
3275 "event-custom" |
|
3276 ] |
|
3277 }, |
|
3278 "axis-category": { |
|
3279 "requires": [ |
|
3280 "axis", |
|
3281 "axis-category-base" |
|
3282 ] |
|
3283 }, |
|
3284 "axis-category-base": { |
|
3285 "requires": [ |
|
3286 "axis-base" |
|
3287 ] |
|
3288 }, |
|
3289 "axis-numeric": { |
|
3290 "requires": [ |
|
3291 "axis", |
|
3292 "axis-numeric-base" |
|
3293 ] |
|
3294 }, |
|
3295 "axis-numeric-base": { |
|
3296 "requires": [ |
|
3297 "axis-base" |
|
3298 ] |
|
3299 }, |
|
3300 "axis-stacked": { |
|
3301 "requires": [ |
|
3302 "axis-numeric", |
|
3303 "axis-stacked-base" |
|
3304 ] |
|
3305 }, |
|
3306 "axis-stacked-base": { |
|
3307 "requires": [ |
|
3308 "axis-numeric-base" |
|
3309 ] |
|
3310 }, |
|
3311 "axis-time": { |
|
3312 "requires": [ |
|
3313 "axis", |
|
3314 "axis-time-base" |
|
3315 ] |
|
3316 }, |
|
3317 "axis-time-base": { |
|
3318 "requires": [ |
|
3319 "axis-base" |
|
3320 ] |
|
3321 }, |
|
3322 "base": { |
|
3323 "use": [ |
|
3324 "base-base", |
|
3325 "base-pluginhost", |
|
3326 "base-build" |
|
3327 ] |
|
3328 }, |
|
3329 "base-base": { |
|
3330 "requires": [ |
|
3331 "attribute-base", |
|
3332 "base-core", |
|
3333 "base-observable" |
|
3334 ] |
|
3335 }, |
|
3336 "base-build": { |
|
3337 "requires": [ |
|
3338 "base-base" |
|
3339 ] |
|
3340 }, |
|
3341 "base-core": { |
|
3342 "requires": [ |
|
3343 "attribute-core" |
|
3344 ] |
|
3345 }, |
|
3346 "base-observable": { |
|
3347 "requires": [ |
|
3348 "attribute-observable", |
|
3349 "base-core" |
|
3350 ] |
|
3351 }, |
|
3352 "base-pluginhost": { |
|
3353 "requires": [ |
|
3354 "base-base", |
|
3355 "pluginhost" |
|
3356 ] |
|
3357 }, |
|
3358 "button": { |
|
3359 "requires": [ |
|
3360 "button-core", |
|
3361 "cssbutton", |
|
3362 "widget" |
|
3363 ] |
|
3364 }, |
|
3365 "button-core": { |
|
3366 "requires": [ |
|
3367 "attribute-core", |
|
3368 "classnamemanager", |
|
3369 "node-base", |
|
3370 "escape" |
|
3371 ] |
|
3372 }, |
|
3373 "button-group": { |
|
3374 "requires": [ |
|
3375 "button-plugin", |
|
3376 "cssbutton", |
|
3377 "widget" |
|
3378 ] |
|
3379 }, |
|
3380 "button-plugin": { |
|
3381 "requires": [ |
|
3382 "button-core", |
|
3383 "cssbutton", |
|
3384 "node-pluginhost" |
|
3385 ] |
|
3386 }, |
|
3387 "cache": { |
|
3388 "use": [ |
|
3389 "cache-base", |
|
3390 "cache-offline", |
|
3391 "cache-plugin" |
|
3392 ] |
|
3393 }, |
|
3394 "cache-base": { |
|
3395 "requires": [ |
|
3396 "base" |
|
3397 ] |
|
3398 }, |
|
3399 "cache-offline": { |
|
3400 "requires": [ |
|
3401 "cache-base", |
|
3402 "json" |
|
3403 ] |
|
3404 }, |
|
3405 "cache-plugin": { |
|
3406 "requires": [ |
|
3407 "plugin", |
|
3408 "cache-base" |
|
3409 ] |
|
3410 }, |
|
3411 "calendar": { |
|
3412 "requires": [ |
|
3413 "calendar-base", |
|
3414 "calendarnavigator" |
|
3415 ], |
|
3416 "skinnable": true |
|
3417 }, |
|
3418 "calendar-base": { |
|
3419 "lang": [ |
|
3420 "de", |
|
3421 "en", |
|
3422 "es", |
|
3423 "es-AR", |
|
3424 "fr", |
|
3425 "hu", |
|
3426 "it", |
|
3427 "ja", |
|
3428 "nb-NO", |
|
3429 "nl", |
|
3430 "pt-BR", |
|
3431 "ru", |
|
3432 "zh-Hans", |
|
3433 "zh-Hans-CN", |
|
3434 "zh-Hant", |
|
3435 "zh-Hant-HK", |
|
3436 "zh-HANT-TW" |
|
3437 ], |
|
3438 "requires": [ |
|
3439 "widget", |
|
3440 "datatype-date", |
|
3441 "datatype-date-math", |
|
3442 "cssgrids" |
|
3443 ], |
|
3444 "skinnable": true |
|
3445 }, |
|
3446 "calendarnavigator": { |
|
3447 "requires": [ |
|
3448 "plugin", |
|
3449 "classnamemanager", |
|
3450 "datatype-date", |
|
3451 "node" |
|
3452 ], |
|
3453 "skinnable": true |
|
3454 }, |
|
3455 "charts": { |
|
3456 "use": [ |
|
3457 "charts-base" |
|
3458 ] |
|
3459 }, |
|
3460 "charts-base": { |
|
3461 "requires": [ |
|
3462 "dom", |
|
3463 "event-mouseenter", |
|
3464 "event-touch", |
|
3465 "graphics-group", |
|
3466 "axes", |
|
3467 "series-pie", |
|
3468 "series-line", |
|
3469 "series-marker", |
|
3470 "series-area", |
|
3471 "series-spline", |
|
3472 "series-column", |
|
3473 "series-bar", |
|
3474 "series-areaspline", |
|
3475 "series-combo", |
|
3476 "series-combospline", |
|
3477 "series-line-stacked", |
|
3478 "series-marker-stacked", |
|
3479 "series-area-stacked", |
|
3480 "series-spline-stacked", |
|
3481 "series-column-stacked", |
|
3482 "series-bar-stacked", |
|
3483 "series-areaspline-stacked", |
|
3484 "series-combo-stacked", |
|
3485 "series-combospline-stacked" |
|
3486 ] |
|
3487 }, |
|
3488 "charts-legend": { |
|
3489 "requires": [ |
|
3490 "charts-base" |
|
3491 ] |
|
3492 }, |
|
3493 "classnamemanager": { |
|
3494 "requires": [ |
|
3495 "yui-base" |
|
3496 ] |
|
3497 }, |
|
3498 "clickable-rail": { |
|
3499 "requires": [ |
|
3500 "slider-base" |
|
3501 ] |
|
3502 }, |
|
3503 "collection": { |
|
3504 "use": [ |
|
3505 "array-extras", |
|
3506 "arraylist", |
|
3507 "arraylist-add", |
|
3508 "arraylist-filter", |
|
3509 "array-invoke" |
|
3510 ] |
|
3511 }, |
|
3512 "color": { |
|
3513 "use": [ |
|
3514 "color-base", |
|
3515 "color-hsl", |
|
3516 "color-harmony" |
|
3517 ] |
|
3518 }, |
|
3519 "color-base": { |
|
3520 "requires": [ |
|
3521 "yui-base" |
|
3522 ] |
|
3523 }, |
|
3524 "color-harmony": { |
|
3525 "requires": [ |
|
3526 "color-hsl" |
|
3527 ] |
|
3528 }, |
|
3529 "color-hsl": { |
|
3530 "requires": [ |
|
3531 "color-base" |
|
3532 ] |
|
3533 }, |
|
3534 "color-hsv": { |
|
3535 "requires": [ |
|
3536 "color-base" |
|
3537 ] |
|
3538 }, |
|
3539 "console": { |
|
3540 "lang": [ |
|
3541 "en", |
|
3542 "es", |
|
3543 "hu", |
|
3544 "it", |
|
3545 "ja" |
|
3546 ], |
|
3547 "requires": [ |
|
3548 "yui-log", |
|
3549 "widget" |
|
3550 ], |
|
3551 "skinnable": true |
|
3552 }, |
|
3553 "console-filters": { |
|
3554 "requires": [ |
|
3555 "plugin", |
|
3556 "console" |
|
3557 ], |
|
3558 "skinnable": true |
|
3559 }, |
|
3560 "content-editable": { |
|
3561 "requires": [ |
|
3562 "node-base", |
|
3563 "editor-selection", |
|
3564 "stylesheet", |
|
3565 "plugin" |
|
3566 ] |
|
3567 }, |
|
3568 "controller": { |
|
3569 "use": [ |
|
3570 "router" |
|
3571 ] |
|
3572 }, |
|
3573 "cookie": { |
|
3574 "requires": [ |
|
3575 "yui-base" |
|
3576 ] |
|
3577 }, |
|
3578 "createlink-base": { |
|
3579 "requires": [ |
|
3580 "editor-base" |
|
3581 ] |
|
3582 }, |
|
3583 "cssbase": { |
|
3584 "after": [ |
|
3585 "cssreset", |
|
3586 "cssfonts", |
|
3587 "cssgrids", |
|
3588 "cssreset-context", |
|
3589 "cssfonts-context", |
|
3590 "cssgrids-context" |
|
3591 ], |
|
3592 "type": "css" |
|
3593 }, |
|
3594 "cssbase-context": { |
|
3595 "after": [ |
|
3596 "cssreset", |
|
3597 "cssfonts", |
|
3598 "cssgrids", |
|
3599 "cssreset-context", |
|
3600 "cssfonts-context", |
|
3601 "cssgrids-context" |
|
3602 ], |
|
3603 "type": "css" |
|
3604 }, |
|
3605 "cssbutton": { |
|
3606 "type": "css" |
|
3607 }, |
|
3608 "cssfonts": { |
|
3609 "type": "css" |
|
3610 }, |
|
3611 "cssfonts-context": { |
|
3612 "type": "css" |
|
3613 }, |
|
3614 "cssgrids": { |
|
3615 "optional": [ |
|
3616 "cssnormalize" |
|
3617 ], |
|
3618 "type": "css" |
|
3619 }, |
|
3620 "cssgrids-base": { |
|
3621 "optional": [ |
|
3622 "cssnormalize" |
|
3623 ], |
|
3624 "type": "css" |
|
3625 }, |
|
3626 "cssgrids-responsive": { |
|
3627 "optional": [ |
|
3628 "cssnormalize" |
|
3629 ], |
|
3630 "requires": [ |
|
3631 "cssgrids", |
|
3632 "cssgrids-responsive-base" |
|
3633 ], |
|
3634 "type": "css" |
|
3635 }, |
|
3636 "cssgrids-units": { |
|
3637 "optional": [ |
|
3638 "cssnormalize" |
|
3639 ], |
|
3640 "requires": [ |
|
3641 "cssgrids-base" |
|
3642 ], |
|
3643 "type": "css" |
|
3644 }, |
|
3645 "cssnormalize": { |
|
3646 "type": "css" |
|
3647 }, |
|
3648 "cssnormalize-context": { |
|
3649 "type": "css" |
|
3650 }, |
|
3651 "cssreset": { |
|
3652 "type": "css" |
|
3653 }, |
|
3654 "cssreset-context": { |
|
3655 "type": "css" |
|
3656 }, |
|
3657 "dataschema": { |
|
3658 "use": [ |
|
3659 "dataschema-base", |
|
3660 "dataschema-json", |
|
3661 "dataschema-xml", |
|
3662 "dataschema-array", |
|
3663 "dataschema-text" |
|
3664 ] |
|
3665 }, |
|
3666 "dataschema-array": { |
|
3667 "requires": [ |
|
3668 "dataschema-base" |
|
3669 ] |
|
3670 }, |
|
3671 "dataschema-base": { |
|
3672 "requires": [ |
|
3673 "base" |
|
3674 ] |
|
3675 }, |
|
3676 "dataschema-json": { |
|
3677 "requires": [ |
|
3678 "dataschema-base", |
|
3679 "json" |
|
3680 ] |
|
3681 }, |
|
3682 "dataschema-text": { |
|
3683 "requires": [ |
|
3684 "dataschema-base" |
|
3685 ] |
|
3686 }, |
|
3687 "dataschema-xml": { |
|
3688 "requires": [ |
|
3689 "dataschema-base" |
|
3690 ] |
|
3691 }, |
|
3692 "datasource": { |
|
3693 "use": [ |
|
3694 "datasource-local", |
|
3695 "datasource-io", |
|
3696 "datasource-get", |
|
3697 "datasource-function", |
|
3698 "datasource-cache", |
|
3699 "datasource-jsonschema", |
|
3700 "datasource-xmlschema", |
|
3701 "datasource-arrayschema", |
|
3702 "datasource-textschema", |
|
3703 "datasource-polling" |
|
3704 ] |
|
3705 }, |
|
3706 "datasource-arrayschema": { |
|
3707 "requires": [ |
|
3708 "datasource-local", |
|
3709 "plugin", |
|
3710 "dataschema-array" |
|
3711 ] |
|
3712 }, |
|
3713 "datasource-cache": { |
|
3714 "requires": [ |
|
3715 "datasource-local", |
|
3716 "plugin", |
|
3717 "cache-base" |
|
3718 ] |
|
3719 }, |
|
3720 "datasource-function": { |
|
3721 "requires": [ |
|
3722 "datasource-local" |
|
3723 ] |
|
3724 }, |
|
3725 "datasource-get": { |
|
3726 "requires": [ |
|
3727 "datasource-local", |
|
3728 "get" |
|
3729 ] |
|
3730 }, |
|
3731 "datasource-io": { |
|
3732 "requires": [ |
|
3733 "datasource-local", |
|
3734 "io-base" |
|
3735 ] |
|
3736 }, |
|
3737 "datasource-jsonschema": { |
|
3738 "requires": [ |
|
3739 "datasource-local", |
|
3740 "plugin", |
|
3741 "dataschema-json" |
|
3742 ] |
|
3743 }, |
|
3744 "datasource-local": { |
|
3745 "requires": [ |
|
3746 "base" |
|
3747 ] |
|
3748 }, |
|
3749 "datasource-polling": { |
|
3750 "requires": [ |
|
3751 "datasource-local" |
|
3752 ] |
|
3753 }, |
|
3754 "datasource-textschema": { |
|
3755 "requires": [ |
|
3756 "datasource-local", |
|
3757 "plugin", |
|
3758 "dataschema-text" |
|
3759 ] |
|
3760 }, |
|
3761 "datasource-xmlschema": { |
|
3762 "requires": [ |
|
3763 "datasource-local", |
|
3764 "plugin", |
|
3765 "datatype-xml", |
|
3766 "dataschema-xml" |
|
3767 ] |
|
3768 }, |
|
3769 "datatable": { |
|
3770 "use": [ |
|
3771 "datatable-core", |
|
3772 "datatable-table", |
|
3773 "datatable-head", |
|
3774 "datatable-body", |
|
3775 "datatable-base", |
|
3776 "datatable-column-widths", |
|
3777 "datatable-message", |
|
3778 "datatable-mutable", |
|
3779 "datatable-sort", |
|
3780 "datatable-datasource" |
|
3781 ] |
|
3782 }, |
|
3783 "datatable-base": { |
|
3784 "requires": [ |
|
3785 "datatable-core", |
|
3786 "datatable-table", |
|
3787 "datatable-head", |
|
3788 "datatable-body", |
|
3789 "base-build", |
|
3790 "widget" |
|
3791 ], |
|
3792 "skinnable": true |
|
3793 }, |
|
3794 "datatable-body": { |
|
3795 "requires": [ |
|
3796 "datatable-core", |
|
3797 "view", |
|
3798 "classnamemanager" |
|
3799 ] |
|
3800 }, |
|
3801 "datatable-column-widths": { |
|
3802 "requires": [ |
|
3803 "datatable-base" |
|
3804 ] |
|
3805 }, |
|
3806 "datatable-core": { |
|
3807 "requires": [ |
|
3808 "escape", |
|
3809 "model-list", |
|
3810 "node-event-delegate" |
|
3811 ] |
|
3812 }, |
|
3813 "datatable-datasource": { |
|
3814 "requires": [ |
|
3815 "datatable-base", |
|
3816 "plugin", |
|
3817 "datasource-local" |
|
3818 ] |
|
3819 }, |
|
3820 "datatable-foot": { |
|
3821 "requires": [ |
|
3822 "datatable-core", |
|
3823 "view" |
|
3824 ] |
|
3825 }, |
|
3826 "datatable-formatters": { |
|
3827 "requires": [ |
|
3828 "datatable-body", |
|
3829 "datatype-number-format", |
|
3830 "datatype-date-format", |
|
3831 "escape" |
|
3832 ] |
|
3833 }, |
|
3834 "datatable-head": { |
|
3835 "requires": [ |
|
3836 "datatable-core", |
|
3837 "view", |
|
3838 "classnamemanager" |
|
3839 ] |
|
3840 }, |
|
3841 "datatable-highlight": { |
|
3842 "requires": [ |
|
3843 "datatable-base", |
|
3844 "event-hover" |
|
3845 ], |
|
3846 "skinnable": true |
|
3847 }, |
|
3848 "datatable-keynav": { |
|
3849 "requires": [ |
|
3850 "datatable-base" |
|
3851 ] |
|
3852 }, |
|
3853 "datatable-message": { |
|
3854 "lang": [ |
|
3855 "en", |
|
3856 "fr", |
|
3857 "es", |
|
3858 "hu", |
|
3859 "it" |
|
3860 ], |
|
3861 "requires": [ |
|
3862 "datatable-base" |
|
3863 ], |
|
3864 "skinnable": true |
|
3865 }, |
|
3866 "datatable-mutable": { |
|
3867 "requires": [ |
|
3868 "datatable-base" |
|
3869 ] |
|
3870 }, |
|
3871 "datatable-paginator": { |
|
3872 "lang": [ |
|
3873 "en", |
|
3874 "fr" |
|
3875 ], |
|
3876 "requires": [ |
|
3877 "model", |
|
3878 "view", |
|
3879 "paginator-core", |
|
3880 "datatable-foot", |
|
3881 "datatable-paginator-templates" |
|
3882 ], |
|
3883 "skinnable": true |
|
3884 }, |
|
3885 "datatable-paginator-templates": { |
|
3886 "requires": [ |
|
3887 "template" |
|
3888 ] |
|
3889 }, |
|
3890 "datatable-scroll": { |
|
3891 "requires": [ |
|
3892 "datatable-base", |
|
3893 "datatable-column-widths", |
|
3894 "dom-screen" |
|
3895 ], |
|
3896 "skinnable": true |
|
3897 }, |
|
3898 "datatable-sort": { |
|
3899 "lang": [ |
|
3900 "en", |
|
3901 "fr", |
|
3902 "es", |
|
3903 "hu" |
|
3904 ], |
|
3905 "requires": [ |
|
3906 "datatable-base" |
|
3907 ], |
|
3908 "skinnable": true |
|
3909 }, |
|
3910 "datatable-table": { |
|
3911 "requires": [ |
|
3912 "datatable-core", |
|
3913 "datatable-head", |
|
3914 "datatable-body", |
|
3915 "view", |
|
3916 "classnamemanager" |
|
3917 ] |
|
3918 }, |
|
3919 "datatype": { |
|
3920 "use": [ |
|
3921 "datatype-date", |
|
3922 "datatype-number", |
|
3923 "datatype-xml" |
|
3924 ] |
|
3925 }, |
|
3926 "datatype-date": { |
|
3927 "use": [ |
|
3928 "datatype-date-parse", |
|
3929 "datatype-date-format", |
|
3930 "datatype-date-math" |
|
3931 ] |
|
3932 }, |
|
3933 "datatype-date-format": { |
|
3934 "lang": [ |
|
3935 "ar", |
|
3936 "ar-JO", |
|
3937 "ca", |
|
3938 "ca-ES", |
|
3939 "da", |
|
3940 "da-DK", |
|
3941 "de", |
|
3942 "de-AT", |
|
3943 "de-DE", |
|
3944 "el", |
|
3945 "el-GR", |
|
3946 "en", |
|
3947 "en-AU", |
|
3948 "en-CA", |
|
3949 "en-GB", |
|
3950 "en-IE", |
|
3951 "en-IN", |
|
3952 "en-JO", |
|
3953 "en-MY", |
|
3954 "en-NZ", |
|
3955 "en-PH", |
|
3956 "en-SG", |
|
3957 "en-US", |
|
3958 "es", |
|
3959 "es-AR", |
|
3960 "es-BO", |
|
3961 "es-CL", |
|
3962 "es-CO", |
|
3963 "es-EC", |
|
3964 "es-ES", |
|
3965 "es-MX", |
|
3966 "es-PE", |
|
3967 "es-PY", |
|
3968 "es-US", |
|
3969 "es-UY", |
|
3970 "es-VE", |
|
3971 "fi", |
|
3972 "fi-FI", |
|
3973 "fr", |
|
3974 "fr-BE", |
|
3975 "fr-CA", |
|
3976 "fr-FR", |
|
3977 "hi", |
|
3978 "hi-IN", |
|
3979 "hu", |
|
3980 "id", |
|
3981 "id-ID", |
|
3982 "it", |
|
3983 "it-IT", |
|
3984 "ja", |
|
3985 "ja-JP", |
|
3986 "ko", |
|
3987 "ko-KR", |
|
3988 "ms", |
|
3989 "ms-MY", |
|
3990 "nb", |
|
3991 "nb-NO", |
|
3992 "nl", |
|
3993 "nl-BE", |
|
3994 "nl-NL", |
|
3995 "pl", |
|
3996 "pl-PL", |
|
3997 "pt", |
|
3998 "pt-BR", |
|
3999 "ro", |
|
4000 "ro-RO", |
|
4001 "ru", |
|
4002 "ru-RU", |
|
4003 "sv", |
|
4004 "sv-SE", |
|
4005 "th", |
|
4006 "th-TH", |
|
4007 "tr", |
|
4008 "tr-TR", |
|
4009 "vi", |
|
4010 "vi-VN", |
|
4011 "zh-Hans", |
|
4012 "zh-Hans-CN", |
|
4013 "zh-Hant", |
|
4014 "zh-Hant-HK", |
|
4015 "zh-Hant-TW" |
|
4016 ] |
|
4017 }, |
|
4018 "datatype-date-math": { |
|
4019 "requires": [ |
|
4020 "yui-base" |
|
4021 ] |
|
4022 }, |
|
4023 "datatype-date-parse": {}, |
|
4024 "datatype-number": { |
|
4025 "use": [ |
|
4026 "datatype-number-parse", |
|
4027 "datatype-number-format" |
|
4028 ] |
|
4029 }, |
|
4030 "datatype-number-format": {}, |
|
4031 "datatype-number-parse": { |
|
4032 "requires": [ |
|
4033 "escape" |
|
4034 ] |
|
4035 }, |
|
4036 "datatype-xml": { |
|
4037 "use": [ |
|
4038 "datatype-xml-parse", |
|
4039 "datatype-xml-format" |
|
4040 ] |
|
4041 }, |
|
4042 "datatype-xml-format": {}, |
|
4043 "datatype-xml-parse": {}, |
|
4044 "dd": { |
|
4045 "use": [ |
|
4046 "dd-ddm-base", |
|
4047 "dd-ddm", |
|
4048 "dd-ddm-drop", |
|
4049 "dd-drag", |
|
4050 "dd-proxy", |
|
4051 "dd-constrain", |
|
4052 "dd-drop", |
|
4053 "dd-scroll", |
|
4054 "dd-delegate" |
|
4055 ] |
|
4056 }, |
|
4057 "dd-constrain": { |
|
4058 "requires": [ |
|
4059 "dd-drag" |
|
4060 ] |
|
4061 }, |
|
4062 "dd-ddm": { |
|
4063 "requires": [ |
|
4064 "dd-ddm-base", |
|
4065 "event-resize" |
|
4066 ] |
|
4067 }, |
|
4068 "dd-ddm-base": { |
|
4069 "requires": [ |
|
4070 "node", |
|
4071 "base", |
|
4072 "yui-throttle", |
|
4073 "classnamemanager" |
|
4074 ] |
|
4075 }, |
|
4076 "dd-ddm-drop": { |
|
4077 "requires": [ |
|
4078 "dd-ddm" |
|
4079 ] |
|
4080 }, |
|
4081 "dd-delegate": { |
|
4082 "requires": [ |
|
4083 "dd-drag", |
|
4084 "dd-drop-plugin", |
|
4085 "event-mouseenter" |
|
4086 ] |
|
4087 }, |
|
4088 "dd-drag": { |
|
4089 "requires": [ |
|
4090 "dd-ddm-base" |
|
4091 ] |
|
4092 }, |
|
4093 "dd-drop": { |
|
4094 "requires": [ |
|
4095 "dd-drag", |
|
4096 "dd-ddm-drop" |
|
4097 ] |
|
4098 }, |
|
4099 "dd-drop-plugin": { |
|
4100 "requires": [ |
|
4101 "dd-drop" |
|
4102 ] |
|
4103 }, |
|
4104 "dd-gestures": { |
|
4105 "condition": { |
|
4106 "name": "dd-gestures", |
|
4107 "trigger": "dd-drag", |
|
4108 "ua": "touchEnabled" |
|
4109 }, |
|
4110 "requires": [ |
|
4111 "dd-drag", |
|
4112 "event-synthetic", |
|
4113 "event-gestures" |
|
4114 ] |
|
4115 }, |
|
4116 "dd-plugin": { |
|
4117 "optional": [ |
|
4118 "dd-constrain", |
|
4119 "dd-proxy" |
|
4120 ], |
|
4121 "requires": [ |
|
4122 "dd-drag" |
|
4123 ] |
|
4124 }, |
|
4125 "dd-proxy": { |
|
4126 "requires": [ |
|
4127 "dd-drag" |
|
4128 ] |
|
4129 }, |
|
4130 "dd-scroll": { |
|
4131 "requires": [ |
|
4132 "dd-drag" |
|
4133 ] |
|
4134 }, |
|
4135 "dial": { |
|
4136 "lang": [ |
|
4137 "en", |
|
4138 "es", |
|
4139 "hu" |
|
4140 ], |
|
4141 "requires": [ |
|
4142 "widget", |
|
4143 "dd-drag", |
|
4144 "event-mouseenter", |
|
4145 "event-move", |
|
4146 "event-key", |
|
4147 "transition", |
|
4148 "intl" |
|
4149 ], |
|
4150 "skinnable": true |
|
4151 }, |
|
4152 "dom": { |
|
4153 "use": [ |
|
4154 "dom-base", |
|
4155 "dom-screen", |
|
4156 "dom-style", |
|
4157 "selector-native", |
|
4158 "selector" |
|
4159 ] |
|
4160 }, |
|
4161 "dom-base": { |
|
4162 "requires": [ |
|
4163 "dom-core" |
|
4164 ] |
|
4165 }, |
|
4166 "dom-core": { |
|
4167 "requires": [ |
|
4168 "oop", |
|
4169 "features" |
|
4170 ] |
|
4171 }, |
|
4172 "dom-screen": { |
|
4173 "requires": [ |
|
4174 "dom-base", |
|
4175 "dom-style" |
|
4176 ] |
|
4177 }, |
|
4178 "dom-style": { |
|
4179 "requires": [ |
|
4180 "dom-base", |
|
4181 "color-base" |
|
4182 ] |
|
4183 }, |
|
4184 "dom-style-ie": { |
|
4185 "condition": { |
|
4186 "name": "dom-style-ie", |
|
4187 "test": function (Y) { |
|
4188 |
|
4189 var testFeature = Y.Features.test, |
|
4190 addFeature = Y.Features.add, |
|
4191 WINDOW = Y.config.win, |
|
4192 DOCUMENT = Y.config.doc, |
|
4193 DOCUMENT_ELEMENT = 'documentElement', |
|
4194 ret = false; |
|
4195 |
|
4196 addFeature('style', 'computedStyle', { |
|
4197 test: function() { |
|
4198 return WINDOW && 'getComputedStyle' in WINDOW; |
|
4199 } |
|
4200 }); |
|
4201 |
|
4202 addFeature('style', 'opacity', { |
|
4203 test: function() { |
|
4204 return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; |
|
4205 } |
|
4206 }); |
|
4207 |
|
4208 ret = (!testFeature('style', 'opacity') && |
|
4209 !testFeature('style', 'computedStyle')); |
|
4210 |
|
4211 return ret; |
|
4212 }, |
|
4213 "trigger": "dom-style" |
|
4214 }, |
|
4215 "requires": [ |
|
4216 "dom-style" |
|
4217 ] |
|
4218 }, |
|
4219 "dump": { |
|
4220 "requires": [ |
|
4221 "yui-base" |
|
4222 ] |
|
4223 }, |
|
4224 "editor": { |
|
4225 "use": [ |
|
4226 "frame", |
|
4227 "editor-selection", |
|
4228 "exec-command", |
|
4229 "editor-base", |
|
4230 "editor-para", |
|
4231 "editor-br", |
|
4232 "editor-bidi", |
|
4233 "editor-tab", |
|
4234 "createlink-base" |
|
4235 ] |
|
4236 }, |
|
4237 "editor-base": { |
|
4238 "requires": [ |
|
4239 "base", |
|
4240 "frame", |
|
4241 "node", |
|
4242 "exec-command", |
|
4243 "editor-selection" |
|
4244 ] |
|
4245 }, |
|
4246 "editor-bidi": { |
|
4247 "requires": [ |
|
4248 "editor-base" |
|
4249 ] |
|
4250 }, |
|
4251 "editor-br": { |
|
4252 "requires": [ |
|
4253 "editor-base" |
|
4254 ] |
|
4255 }, |
|
4256 "editor-inline": { |
|
4257 "requires": [ |
|
4258 "editor-base", |
|
4259 "content-editable" |
|
4260 ] |
|
4261 }, |
|
4262 "editor-lists": { |
|
4263 "requires": [ |
|
4264 "editor-base" |
|
4265 ] |
|
4266 }, |
|
4267 "editor-para": { |
|
4268 "requires": [ |
|
4269 "editor-para-base" |
|
4270 ] |
|
4271 }, |
|
4272 "editor-para-base": { |
|
4273 "requires": [ |
|
4274 "editor-base" |
|
4275 ] |
|
4276 }, |
|
4277 "editor-para-ie": { |
|
4278 "condition": { |
|
4279 "name": "editor-para-ie", |
|
4280 "trigger": "editor-para", |
|
4281 "ua": "ie", |
|
4282 "when": "instead" |
|
4283 }, |
|
4284 "requires": [ |
|
4285 "editor-para-base" |
|
4286 ] |
|
4287 }, |
|
4288 "editor-selection": { |
|
4289 "requires": [ |
|
4290 "node" |
|
4291 ] |
|
4292 }, |
|
4293 "editor-tab": { |
|
4294 "requires": [ |
|
4295 "editor-base" |
|
4296 ] |
|
4297 }, |
|
4298 "escape": { |
|
4299 "requires": [ |
|
4300 "yui-base" |
|
4301 ] |
|
4302 }, |
|
4303 "event": { |
|
4304 "after": [ |
|
4305 "node-base" |
|
4306 ], |
|
4307 "use": [ |
|
4308 "event-base", |
|
4309 "event-delegate", |
|
4310 "event-synthetic", |
|
4311 "event-mousewheel", |
|
4312 "event-mouseenter", |
|
4313 "event-key", |
|
4314 "event-focus", |
|
4315 "event-resize", |
|
4316 "event-hover", |
|
4317 "event-outside", |
|
4318 "event-touch", |
|
4319 "event-move", |
|
4320 "event-flick", |
|
4321 "event-valuechange", |
|
4322 "event-tap" |
|
4323 ] |
|
4324 }, |
|
4325 "event-base": { |
|
4326 "after": [ |
|
4327 "node-base" |
|
4328 ], |
|
4329 "requires": [ |
|
4330 "event-custom-base" |
|
4331 ] |
|
4332 }, |
|
4333 "event-base-ie": { |
|
4334 "after": [ |
|
4335 "event-base" |
|
4336 ], |
|
4337 "condition": { |
|
4338 "name": "event-base-ie", |
|
4339 "test": function(Y) { |
|
4340 var imp = Y.config.doc && Y.config.doc.implementation; |
|
4341 return (imp && (!imp.hasFeature('Events', '2.0'))); |
|
4342 }, |
|
4343 "trigger": "node-base" |
|
4344 }, |
|
4345 "requires": [ |
|
4346 "node-base" |
|
4347 ] |
|
4348 }, |
|
4349 "event-contextmenu": { |
|
4350 "requires": [ |
|
4351 "event-synthetic", |
|
4352 "dom-screen" |
|
4353 ] |
|
4354 }, |
|
4355 "event-custom": { |
|
4356 "use": [ |
|
4357 "event-custom-base", |
|
4358 "event-custom-complex" |
|
4359 ] |
|
4360 }, |
|
4361 "event-custom-base": { |
|
4362 "requires": [ |
|
4363 "oop" |
|
4364 ] |
|
4365 }, |
|
4366 "event-custom-complex": { |
|
4367 "requires": [ |
|
4368 "event-custom-base" |
|
4369 ] |
|
4370 }, |
|
4371 "event-delegate": { |
|
4372 "requires": [ |
|
4373 "node-base" |
|
4374 ] |
|
4375 }, |
|
4376 "event-flick": { |
|
4377 "requires": [ |
|
4378 "node-base", |
|
4379 "event-touch", |
|
4380 "event-synthetic" |
|
4381 ] |
|
4382 }, |
|
4383 "event-focus": { |
|
4384 "requires": [ |
|
4385 "event-synthetic" |
|
4386 ] |
|
4387 }, |
|
4388 "event-gestures": { |
|
4389 "use": [ |
|
4390 "event-flick", |
|
4391 "event-move" |
|
4392 ] |
|
4393 }, |
|
4394 "event-hover": { |
|
4395 "requires": [ |
|
4396 "event-mouseenter" |
|
4397 ] |
|
4398 }, |
|
4399 "event-key": { |
|
4400 "requires": [ |
|
4401 "event-synthetic" |
|
4402 ] |
|
4403 }, |
|
4404 "event-mouseenter": { |
|
4405 "requires": [ |
|
4406 "event-synthetic" |
|
4407 ] |
|
4408 }, |
|
4409 "event-mousewheel": { |
|
4410 "requires": [ |
|
4411 "node-base" |
|
4412 ] |
|
4413 }, |
|
4414 "event-move": { |
|
4415 "requires": [ |
|
4416 "node-base", |
|
4417 "event-touch", |
|
4418 "event-synthetic" |
|
4419 ] |
|
4420 }, |
|
4421 "event-outside": { |
|
4422 "requires": [ |
|
4423 "event-synthetic" |
|
4424 ] |
|
4425 }, |
|
4426 "event-resize": { |
|
4427 "requires": [ |
|
4428 "node-base", |
|
4429 "event-synthetic" |
|
4430 ] |
|
4431 }, |
|
4432 "event-simulate": { |
|
4433 "requires": [ |
|
4434 "event-base" |
|
4435 ] |
|
4436 }, |
|
4437 "event-synthetic": { |
|
4438 "requires": [ |
|
4439 "node-base", |
|
4440 "event-custom-complex" |
|
4441 ] |
|
4442 }, |
|
4443 "event-tap": { |
|
4444 "requires": [ |
|
4445 "node-base", |
|
4446 "event-base", |
|
4447 "event-touch", |
|
4448 "event-synthetic" |
|
4449 ] |
|
4450 }, |
|
4451 "event-touch": { |
|
4452 "requires": [ |
|
4453 "node-base" |
|
4454 ] |
|
4455 }, |
|
4456 "event-valuechange": { |
|
4457 "requires": [ |
|
4458 "event-focus", |
|
4459 "event-synthetic" |
|
4460 ] |
|
4461 }, |
|
4462 "exec-command": { |
|
4463 "requires": [ |
|
4464 "frame" |
|
4465 ] |
|
4466 }, |
|
4467 "features": { |
|
4468 "requires": [ |
|
4469 "yui-base" |
|
4470 ] |
|
4471 }, |
|
4472 "file": { |
|
4473 "requires": [ |
|
4474 "file-flash", |
|
4475 "file-html5" |
|
4476 ] |
|
4477 }, |
|
4478 "file-flash": { |
|
4479 "requires": [ |
|
4480 "base" |
|
4481 ] |
|
4482 }, |
|
4483 "file-html5": { |
|
4484 "requires": [ |
|
4485 "base" |
|
4486 ] |
|
4487 }, |
|
4488 "frame": { |
|
4489 "requires": [ |
|
4490 "base", |
|
4491 "node", |
|
4492 "plugin", |
|
4493 "selector-css3", |
|
4494 "yui-throttle" |
|
4495 ] |
|
4496 }, |
|
4497 "gesture-simulate": { |
|
4498 "requires": [ |
|
4499 "async-queue", |
|
4500 "event-simulate", |
|
4501 "node-screen" |
|
4502 ] |
|
4503 }, |
|
4504 "get": { |
|
4505 "requires": [ |
|
4506 "yui-base" |
|
4507 ] |
|
4508 }, |
|
4509 "graphics": { |
|
4510 "requires": [ |
|
4511 "node", |
|
4512 "event-custom", |
|
4513 "pluginhost", |
|
4514 "matrix", |
|
4515 "classnamemanager" |
|
4516 ] |
|
4517 }, |
|
4518 "graphics-canvas": { |
|
4519 "condition": { |
|
4520 "name": "graphics-canvas", |
|
4521 "test": function(Y) { |
|
4522 var DOCUMENT = Y.config.doc, |
|
4523 useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", |
|
4524 canvas = DOCUMENT && DOCUMENT.createElement("canvas"), |
|
4525 svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); |
|
4526 return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); |
|
4527 }, |
|
4528 "trigger": "graphics" |
|
4529 }, |
|
4530 "requires": [ |
|
4531 "graphics" |
|
4532 ] |
|
4533 }, |
|
4534 "graphics-canvas-default": { |
|
4535 "condition": { |
|
4536 "name": "graphics-canvas-default", |
|
4537 "test": function(Y) { |
|
4538 var DOCUMENT = Y.config.doc, |
|
4539 useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", |
|
4540 canvas = DOCUMENT && DOCUMENT.createElement("canvas"), |
|
4541 svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); |
|
4542 return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); |
|
4543 }, |
|
4544 "trigger": "graphics" |
|
4545 } |
|
4546 }, |
|
4547 "graphics-group": { |
|
4548 "requires": [ |
|
4549 "graphics" |
|
4550 ] |
|
4551 }, |
|
4552 "graphics-svg": { |
|
4553 "condition": { |
|
4554 "name": "graphics-svg", |
|
4555 "test": function(Y) { |
|
4556 var DOCUMENT = Y.config.doc, |
|
4557 useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", |
|
4558 canvas = DOCUMENT && DOCUMENT.createElement("canvas"), |
|
4559 svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); |
|
4560 |
|
4561 return svg && (useSVG || !canvas); |
|
4562 }, |
|
4563 "trigger": "graphics" |
|
4564 }, |
|
4565 "requires": [ |
|
4566 "graphics" |
|
4567 ] |
|
4568 }, |
|
4569 "graphics-svg-default": { |
|
4570 "condition": { |
|
4571 "name": "graphics-svg-default", |
|
4572 "test": function(Y) { |
|
4573 var DOCUMENT = Y.config.doc, |
|
4574 useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", |
|
4575 canvas = DOCUMENT && DOCUMENT.createElement("canvas"), |
|
4576 svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); |
|
4577 |
|
4578 return svg && (useSVG || !canvas); |
|
4579 }, |
|
4580 "trigger": "graphics" |
|
4581 } |
|
4582 }, |
|
4583 "graphics-vml": { |
|
4584 "condition": { |
|
4585 "name": "graphics-vml", |
|
4586 "test": function(Y) { |
|
4587 var DOCUMENT = Y.config.doc, |
|
4588 canvas = DOCUMENT && DOCUMENT.createElement("canvas"); |
|
4589 return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); |
|
4590 }, |
|
4591 "trigger": "graphics" |
|
4592 }, |
|
4593 "requires": [ |
|
4594 "graphics" |
|
4595 ] |
|
4596 }, |
|
4597 "graphics-vml-default": { |
|
4598 "condition": { |
|
4599 "name": "graphics-vml-default", |
|
4600 "test": function(Y) { |
|
4601 var DOCUMENT = Y.config.doc, |
|
4602 canvas = DOCUMENT && DOCUMENT.createElement("canvas"); |
|
4603 return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); |
|
4604 }, |
|
4605 "trigger": "graphics" |
|
4606 } |
|
4607 }, |
|
4608 "handlebars": { |
|
4609 "use": [ |
|
4610 "handlebars-compiler" |
|
4611 ] |
|
4612 }, |
|
4613 "handlebars-base": { |
|
4614 "requires": [] |
|
4615 }, |
|
4616 "handlebars-compiler": { |
|
4617 "requires": [ |
|
4618 "handlebars-base" |
|
4619 ] |
|
4620 }, |
|
4621 "highlight": { |
|
4622 "use": [ |
|
4623 "highlight-base", |
|
4624 "highlight-accentfold" |
|
4625 ] |
|
4626 }, |
|
4627 "highlight-accentfold": { |
|
4628 "requires": [ |
|
4629 "highlight-base", |
|
4630 "text-accentfold" |
|
4631 ] |
|
4632 }, |
|
4633 "highlight-base": { |
|
4634 "requires": [ |
|
4635 "array-extras", |
|
4636 "classnamemanager", |
|
4637 "escape", |
|
4638 "text-wordbreak" |
|
4639 ] |
|
4640 }, |
|
4641 "history": { |
|
4642 "use": [ |
|
4643 "history-base", |
|
4644 "history-hash", |
|
4645 "history-html5" |
|
4646 ] |
|
4647 }, |
|
4648 "history-base": { |
|
4649 "requires": [ |
|
4650 "event-custom-complex" |
|
4651 ] |
|
4652 }, |
|
4653 "history-hash": { |
|
4654 "after": [ |
|
4655 "history-html5" |
|
4656 ], |
|
4657 "requires": [ |
|
4658 "event-synthetic", |
|
4659 "history-base", |
|
4660 "yui-later" |
|
4661 ] |
|
4662 }, |
|
4663 "history-hash-ie": { |
|
4664 "condition": { |
|
4665 "name": "history-hash-ie", |
|
4666 "test": function (Y) { |
|
4667 var docMode = Y.config.doc && Y.config.doc.documentMode; |
|
4668 |
|
4669 return Y.UA.ie && (!('onhashchange' in Y.config.win) || |
|
4670 !docMode || docMode < 8); |
|
4671 }, |
|
4672 "trigger": "history-hash" |
|
4673 }, |
|
4674 "requires": [ |
|
4675 "history-hash", |
|
4676 "node-base" |
|
4677 ] |
|
4678 }, |
|
4679 "history-html5": { |
|
4680 "optional": [ |
|
4681 "json" |
|
4682 ], |
|
4683 "requires": [ |
|
4684 "event-base", |
|
4685 "history-base", |
|
4686 "node-base" |
|
4687 ] |
|
4688 }, |
|
4689 "imageloader": { |
|
4690 "requires": [ |
|
4691 "base-base", |
|
4692 "node-style", |
|
4693 "node-screen" |
|
4694 ] |
|
4695 }, |
|
4696 "intl": { |
|
4697 "requires": [ |
|
4698 "intl-base", |
|
4699 "event-custom" |
|
4700 ] |
|
4701 }, |
|
4702 "intl-base": { |
|
4703 "requires": [ |
|
4704 "yui-base" |
|
4705 ] |
|
4706 }, |
|
4707 "io": { |
|
4708 "use": [ |
|
4709 "io-base", |
|
4710 "io-xdr", |
|
4711 "io-form", |
|
4712 "io-upload-iframe", |
|
4713 "io-queue" |
|
4714 ] |
|
4715 }, |
|
4716 "io-base": { |
|
4717 "requires": [ |
|
4718 "event-custom-base", |
|
4719 "querystring-stringify-simple" |
|
4720 ] |
|
4721 }, |
|
4722 "io-form": { |
|
4723 "requires": [ |
|
4724 "io-base", |
|
4725 "node-base" |
|
4726 ] |
|
4727 }, |
|
4728 "io-nodejs": { |
|
4729 "condition": { |
|
4730 "name": "io-nodejs", |
|
4731 "trigger": "io-base", |
|
4732 "ua": "nodejs" |
|
4733 }, |
|
4734 "requires": [ |
|
4735 "io-base" |
|
4736 ] |
|
4737 }, |
|
4738 "io-queue": { |
|
4739 "requires": [ |
|
4740 "io-base", |
|
4741 "queue-promote" |
|
4742 ] |
|
4743 }, |
|
4744 "io-upload-iframe": { |
|
4745 "requires": [ |
|
4746 "io-base", |
|
4747 "node-base" |
|
4748 ] |
|
4749 }, |
|
4750 "io-xdr": { |
|
4751 "requires": [ |
|
4752 "io-base", |
|
4753 "datatype-xml-parse" |
|
4754 ] |
|
4755 }, |
|
4756 "json": { |
|
4757 "use": [ |
|
4758 "json-parse", |
|
4759 "json-stringify" |
|
4760 ] |
|
4761 }, |
|
4762 "json-parse": { |
|
4763 "requires": [ |
|
4764 "yui-base" |
|
4765 ] |
|
4766 }, |
|
4767 "json-parse-shim": { |
|
4768 "condition": { |
|
4769 "name": "json-parse-shim", |
|
4770 "test": function (Y) { |
|
4771 var _JSON = Y.config.global.JSON, |
|
4772 Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, |
|
4773 nativeSupport = Y.config.useNativeJSONParse !== false && !!Native; |
|
4774 |
|
4775 function workingNative( k, v ) { |
|
4776 return k === "ok" ? true : v; |
|
4777 } |
|
4778 |
|
4779 // Double check basic functionality. This is mainly to catch early broken |
|
4780 // implementations of the JSON API in Firefox 3.1 beta1 and beta2 |
|
4781 if ( nativeSupport ) { |
|
4782 try { |
|
4783 nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok; |
|
4784 } |
|
4785 catch ( e ) { |
|
4786 nativeSupport = false; |
|
4787 } |
|
4788 } |
|
4789 |
|
4790 return !nativeSupport; |
|
4791 }, |
|
4792 "trigger": "json-parse" |
|
4793 }, |
|
4794 "requires": [ |
|
4795 "json-parse" |
|
4796 ] |
|
4797 }, |
|
4798 "json-stringify": { |
|
4799 "requires": [ |
|
4800 "yui-base" |
|
4801 ] |
|
4802 }, |
|
4803 "json-stringify-shim": { |
|
4804 "condition": { |
|
4805 "name": "json-stringify-shim", |
|
4806 "test": function (Y) { |
|
4807 var _JSON = Y.config.global.JSON, |
|
4808 Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, |
|
4809 nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native; |
|
4810 |
|
4811 // Double check basic native functionality. This is primarily to catch broken |
|
4812 // early JSON API implementations in Firefox 3.1 beta1 and beta2. |
|
4813 if ( nativeSupport ) { |
|
4814 try { |
|
4815 nativeSupport = ( '0' === Native.stringify(0) ); |
|
4816 } catch ( e ) { |
|
4817 nativeSupport = false; |
|
4818 } |
|
4819 } |
|
4820 |
|
4821 |
|
4822 return !nativeSupport; |
|
4823 }, |
|
4824 "trigger": "json-stringify" |
|
4825 }, |
|
4826 "requires": [ |
|
4827 "json-stringify" |
|
4828 ] |
|
4829 }, |
|
4830 "jsonp": { |
|
4831 "requires": [ |
|
4832 "get", |
|
4833 "oop" |
|
4834 ] |
|
4835 }, |
|
4836 "jsonp-url": { |
|
4837 "requires": [ |
|
4838 "jsonp" |
|
4839 ] |
|
4840 }, |
|
4841 "lazy-model-list": { |
|
4842 "requires": [ |
|
4843 "model-list" |
|
4844 ] |
|
4845 }, |
|
4846 "loader": { |
|
4847 "use": [ |
|
4848 "loader-base", |
|
4849 "loader-rollup", |
|
4850 "loader-yui3" |
|
4851 ] |
|
4852 }, |
|
4853 "loader-base": { |
|
4854 "requires": [ |
|
4855 "get", |
|
4856 "features" |
|
4857 ] |
|
4858 }, |
|
4859 "loader-rollup": { |
|
4860 "requires": [ |
|
4861 "loader-base" |
|
4862 ] |
|
4863 }, |
|
4864 "loader-yui3": { |
|
4865 "requires": [ |
|
4866 "loader-base" |
|
4867 ] |
|
4868 }, |
|
4869 "matrix": { |
|
4870 "requires": [ |
|
4871 "yui-base" |
|
4872 ] |
|
4873 }, |
|
4874 "model": { |
|
4875 "requires": [ |
|
4876 "base-build", |
|
4877 "escape", |
|
4878 "json-parse" |
|
4879 ] |
|
4880 }, |
|
4881 "model-list": { |
|
4882 "requires": [ |
|
4883 "array-extras", |
|
4884 "array-invoke", |
|
4885 "arraylist", |
|
4886 "base-build", |
|
4887 "escape", |
|
4888 "json-parse", |
|
4889 "model" |
|
4890 ] |
|
4891 }, |
|
4892 "model-sync-local": { |
|
4893 "requires": [ |
|
4894 "model", |
|
4895 "json-stringify" |
|
4896 ] |
|
4897 }, |
|
4898 "model-sync-rest": { |
|
4899 "requires": [ |
|
4900 "model", |
|
4901 "io-base", |
|
4902 "json-stringify" |
|
4903 ] |
|
4904 }, |
|
4905 "node": { |
|
4906 "use": [ |
|
4907 "node-base", |
|
4908 "node-event-delegate", |
|
4909 "node-pluginhost", |
|
4910 "node-screen", |
|
4911 "node-style" |
|
4912 ] |
|
4913 }, |
|
4914 "node-base": { |
|
4915 "requires": [ |
|
4916 "event-base", |
|
4917 "node-core", |
|
4918 "dom-base", |
|
4919 "dom-style" |
|
4920 ] |
|
4921 }, |
|
4922 "node-core": { |
|
4923 "requires": [ |
|
4924 "dom-core", |
|
4925 "selector" |
|
4926 ] |
|
4927 }, |
|
4928 "node-event-delegate": { |
|
4929 "requires": [ |
|
4930 "node-base", |
|
4931 "event-delegate" |
|
4932 ] |
|
4933 }, |
|
4934 "node-event-html5": { |
|
4935 "requires": [ |
|
4936 "node-base" |
|
4937 ] |
|
4938 }, |
|
4939 "node-event-simulate": { |
|
4940 "requires": [ |
|
4941 "node-base", |
|
4942 "event-simulate", |
|
4943 "gesture-simulate" |
|
4944 ] |
|
4945 }, |
|
4946 "node-flick": { |
|
4947 "requires": [ |
|
4948 "classnamemanager", |
|
4949 "transition", |
|
4950 "event-flick", |
|
4951 "plugin" |
|
4952 ], |
|
4953 "skinnable": true |
|
4954 }, |
|
4955 "node-focusmanager": { |
|
4956 "requires": [ |
|
4957 "attribute", |
|
4958 "node", |
|
4959 "plugin", |
|
4960 "node-event-simulate", |
|
4961 "event-key", |
|
4962 "event-focus" |
|
4963 ] |
|
4964 }, |
|
4965 "node-load": { |
|
4966 "requires": [ |
|
4967 "node-base", |
|
4968 "io-base" |
|
4969 ] |
|
4970 }, |
|
4971 "node-menunav": { |
|
4972 "requires": [ |
|
4973 "node", |
|
4974 "classnamemanager", |
|
4975 "plugin", |
|
4976 "node-focusmanager" |
|
4977 ], |
|
4978 "skinnable": true |
|
4979 }, |
|
4980 "node-pluginhost": { |
|
4981 "requires": [ |
|
4982 "node-base", |
|
4983 "pluginhost" |
|
4984 ] |
|
4985 }, |
|
4986 "node-screen": { |
|
4987 "requires": [ |
|
4988 "dom-screen", |
|
4989 "node-base" |
|
4990 ] |
|
4991 }, |
|
4992 "node-scroll-info": { |
|
4993 "requires": [ |
|
4994 "array-extras", |
|
4995 "base-build", |
|
4996 "event-resize", |
|
4997 "node-pluginhost", |
|
4998 "plugin", |
|
4999 "selector" |
|
5000 ] |
|
5001 }, |
|
5002 "node-style": { |
|
5003 "requires": [ |
|
5004 "dom-style", |
|
5005 "node-base" |
|
5006 ] |
|
5007 }, |
|
5008 "oop": { |
|
5009 "requires": [ |
|
5010 "yui-base" |
|
5011 ] |
|
5012 }, |
|
5013 "overlay": { |
|
5014 "requires": [ |
|
5015 "widget", |
|
5016 "widget-stdmod", |
|
5017 "widget-position", |
|
5018 "widget-position-align", |
|
5019 "widget-stack", |
|
5020 "widget-position-constrain" |
|
5021 ], |
|
5022 "skinnable": true |
|
5023 }, |
|
5024 "paginator": { |
|
5025 "requires": [ |
|
5026 "paginator-core" |
|
5027 ] |
|
5028 }, |
|
5029 "paginator-core": { |
|
5030 "requires": [ |
|
5031 "base" |
|
5032 ] |
|
5033 }, |
|
5034 "paginator-url": { |
|
5035 "requires": [ |
|
5036 "paginator" |
|
5037 ] |
|
5038 }, |
|
5039 "panel": { |
|
5040 "requires": [ |
|
5041 "widget", |
|
5042 "widget-autohide", |
|
5043 "widget-buttons", |
|
5044 "widget-modality", |
|
5045 "widget-position", |
|
5046 "widget-position-align", |
|
5047 "widget-position-constrain", |
|
5048 "widget-stack", |
|
5049 "widget-stdmod" |
|
5050 ], |
|
5051 "skinnable": true |
|
5052 }, |
|
5053 "parallel": { |
|
5054 "requires": [ |
|
5055 "yui-base" |
|
5056 ] |
|
5057 }, |
|
5058 "pjax": { |
|
5059 "requires": [ |
|
5060 "pjax-base", |
|
5061 "pjax-content" |
|
5062 ] |
|
5063 }, |
|
5064 "pjax-base": { |
|
5065 "requires": [ |
|
5066 "classnamemanager", |
|
5067 "node-event-delegate", |
|
5068 "router" |
|
5069 ] |
|
5070 }, |
|
5071 "pjax-content": { |
|
5072 "requires": [ |
|
5073 "io-base", |
|
5074 "node-base", |
|
5075 "router" |
|
5076 ] |
|
5077 }, |
|
5078 "pjax-plugin": { |
|
5079 "requires": [ |
|
5080 "node-pluginhost", |
|
5081 "pjax", |
|
5082 "plugin" |
|
5083 ] |
|
5084 }, |
|
5085 "plugin": { |
|
5086 "requires": [ |
|
5087 "base-base" |
|
5088 ] |
|
5089 }, |
|
5090 "pluginhost": { |
|
5091 "use": [ |
|
5092 "pluginhost-base", |
|
5093 "pluginhost-config" |
|
5094 ] |
|
5095 }, |
|
5096 "pluginhost-base": { |
|
5097 "requires": [ |
|
5098 "yui-base" |
|
5099 ] |
|
5100 }, |
|
5101 "pluginhost-config": { |
|
5102 "requires": [ |
|
5103 "pluginhost-base" |
|
5104 ] |
|
5105 }, |
|
5106 "promise": { |
|
5107 "requires": [ |
|
5108 "timers" |
|
5109 ] |
|
5110 }, |
|
5111 "querystring": { |
|
5112 "use": [ |
|
5113 "querystring-parse", |
|
5114 "querystring-stringify" |
|
5115 ] |
|
5116 }, |
|
5117 "querystring-parse": { |
|
5118 "requires": [ |
|
5119 "yui-base", |
|
5120 "array-extras" |
|
5121 ] |
|
5122 }, |
|
5123 "querystring-parse-simple": { |
|
5124 "requires": [ |
|
5125 "yui-base" |
|
5126 ] |
|
5127 }, |
|
5128 "querystring-stringify": { |
|
5129 "requires": [ |
|
5130 "yui-base" |
|
5131 ] |
|
5132 }, |
|
5133 "querystring-stringify-simple": { |
|
5134 "requires": [ |
|
5135 "yui-base" |
|
5136 ] |
|
5137 }, |
|
5138 "queue-promote": { |
|
5139 "requires": [ |
|
5140 "yui-base" |
|
5141 ] |
|
5142 }, |
|
5143 "range-slider": { |
|
5144 "requires": [ |
|
5145 "slider-base", |
|
5146 "slider-value-range", |
|
5147 "clickable-rail" |
|
5148 ] |
|
5149 }, |
|
5150 "recordset": { |
|
5151 "use": [ |
|
5152 "recordset-base", |
|
5153 "recordset-sort", |
|
5154 "recordset-filter", |
|
5155 "recordset-indexer" |
|
5156 ] |
|
5157 }, |
|
5158 "recordset-base": { |
|
5159 "requires": [ |
|
5160 "base", |
|
5161 "arraylist" |
|
5162 ] |
|
5163 }, |
|
5164 "recordset-filter": { |
|
5165 "requires": [ |
|
5166 "recordset-base", |
|
5167 "array-extras", |
|
5168 "plugin" |
|
5169 ] |
|
5170 }, |
|
5171 "recordset-indexer": { |
|
5172 "requires": [ |
|
5173 "recordset-base", |
|
5174 "plugin" |
|
5175 ] |
|
5176 }, |
|
5177 "recordset-sort": { |
|
5178 "requires": [ |
|
5179 "arraysort", |
|
5180 "recordset-base", |
|
5181 "plugin" |
|
5182 ] |
|
5183 }, |
|
5184 "resize": { |
|
5185 "use": [ |
|
5186 "resize-base", |
|
5187 "resize-proxy", |
|
5188 "resize-constrain" |
|
5189 ] |
|
5190 }, |
|
5191 "resize-base": { |
|
5192 "requires": [ |
|
5193 "base", |
|
5194 "widget", |
|
5195 "event", |
|
5196 "oop", |
|
5197 "dd-drag", |
|
5198 "dd-delegate", |
|
5199 "dd-drop" |
|
5200 ], |
|
5201 "skinnable": true |
|
5202 }, |
|
5203 "resize-constrain": { |
|
5204 "requires": [ |
|
5205 "plugin", |
|
5206 "resize-base" |
|
5207 ] |
|
5208 }, |
|
5209 "resize-plugin": { |
|
5210 "optional": [ |
|
5211 "resize-constrain" |
|
5212 ], |
|
5213 "requires": [ |
|
5214 "resize-base", |
|
5215 "plugin" |
|
5216 ] |
|
5217 }, |
|
5218 "resize-proxy": { |
|
5219 "requires": [ |
|
5220 "plugin", |
|
5221 "resize-base" |
|
5222 ] |
|
5223 }, |
|
5224 "router": { |
|
5225 "optional": [ |
|
5226 "querystring-parse" |
|
5227 ], |
|
5228 "requires": [ |
|
5229 "array-extras", |
|
5230 "base-build", |
|
5231 "history" |
|
5232 ] |
|
5233 }, |
|
5234 "scrollview": { |
|
5235 "requires": [ |
|
5236 "scrollview-base", |
|
5237 "scrollview-scrollbars" |
|
5238 ] |
|
5239 }, |
|
5240 "scrollview-base": { |
|
5241 "requires": [ |
|
5242 "widget", |
|
5243 "event-gestures", |
|
5244 "event-mousewheel", |
|
5245 "transition" |
|
5246 ], |
|
5247 "skinnable": true |
|
5248 }, |
|
5249 "scrollview-base-ie": { |
|
5250 "condition": { |
|
5251 "name": "scrollview-base-ie", |
|
5252 "trigger": "scrollview-base", |
|
5253 "ua": "ie" |
|
5254 }, |
|
5255 "requires": [ |
|
5256 "scrollview-base" |
|
5257 ] |
|
5258 }, |
|
5259 "scrollview-list": { |
|
5260 "requires": [ |
|
5261 "plugin", |
|
5262 "classnamemanager" |
|
5263 ], |
|
5264 "skinnable": true |
|
5265 }, |
|
5266 "scrollview-paginator": { |
|
5267 "requires": [ |
|
5268 "plugin", |
|
5269 "classnamemanager" |
|
5270 ] |
|
5271 }, |
|
5272 "scrollview-scrollbars": { |
|
5273 "requires": [ |
|
5274 "classnamemanager", |
|
5275 "transition", |
|
5276 "plugin" |
|
5277 ], |
|
5278 "skinnable": true |
|
5279 }, |
|
5280 "selector": { |
|
5281 "requires": [ |
|
5282 "selector-native" |
|
5283 ] |
|
5284 }, |
|
5285 "selector-css2": { |
|
5286 "condition": { |
|
5287 "name": "selector-css2", |
|
5288 "test": function (Y) { |
|
5289 var DOCUMENT = Y.config.doc, |
|
5290 ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); |
|
5291 |
|
5292 return ret; |
|
5293 }, |
|
5294 "trigger": "selector" |
|
5295 }, |
|
5296 "requires": [ |
|
5297 "selector-native" |
|
5298 ] |
|
5299 }, |
|
5300 "selector-css3": { |
|
5301 "requires": [ |
|
5302 "selector-native", |
|
5303 "selector-css2" |
|
5304 ] |
|
5305 }, |
|
5306 "selector-native": { |
|
5307 "requires": [ |
|
5308 "dom-base" |
|
5309 ] |
|
5310 }, |
|
5311 "series-area": { |
|
5312 "requires": [ |
|
5313 "series-cartesian", |
|
5314 "series-fill-util" |
|
5315 ] |
|
5316 }, |
|
5317 "series-area-stacked": { |
|
5318 "requires": [ |
|
5319 "series-stacked", |
|
5320 "series-area" |
|
5321 ] |
|
5322 }, |
|
5323 "series-areaspline": { |
|
5324 "requires": [ |
|
5325 "series-area", |
|
5326 "series-curve-util" |
|
5327 ] |
|
5328 }, |
|
5329 "series-areaspline-stacked": { |
|
5330 "requires": [ |
|
5331 "series-stacked", |
|
5332 "series-areaspline" |
|
5333 ] |
|
5334 }, |
|
5335 "series-bar": { |
|
5336 "requires": [ |
|
5337 "series-marker", |
|
5338 "series-histogram-base" |
|
5339 ] |
|
5340 }, |
|
5341 "series-bar-stacked": { |
|
5342 "requires": [ |
|
5343 "series-stacked", |
|
5344 "series-bar" |
|
5345 ] |
|
5346 }, |
|
5347 "series-base": { |
|
5348 "requires": [ |
|
5349 "graphics", |
|
5350 "axis-base" |
|
5351 ] |
|
5352 }, |
|
5353 "series-candlestick": { |
|
5354 "requires": [ |
|
5355 "series-range" |
|
5356 ] |
|
5357 }, |
|
5358 "series-cartesian": { |
|
5359 "requires": [ |
|
5360 "series-base" |
|
5361 ] |
|
5362 }, |
|
5363 "series-column": { |
|
5364 "requires": [ |
|
5365 "series-marker", |
|
5366 "series-histogram-base" |
|
5367 ] |
|
5368 }, |
|
5369 "series-column-stacked": { |
|
5370 "requires": [ |
|
5371 "series-stacked", |
|
5372 "series-column" |
|
5373 ] |
|
5374 }, |
|
5375 "series-combo": { |
|
5376 "requires": [ |
|
5377 "series-cartesian", |
|
5378 "series-line-util", |
|
5379 "series-plot-util", |
|
5380 "series-fill-util" |
|
5381 ] |
|
5382 }, |
|
5383 "series-combo-stacked": { |
|
5384 "requires": [ |
|
5385 "series-stacked", |
|
5386 "series-combo" |
|
5387 ] |
|
5388 }, |
|
5389 "series-combospline": { |
|
5390 "requires": [ |
|
5391 "series-combo", |
|
5392 "series-curve-util" |
|
5393 ] |
|
5394 }, |
|
5395 "series-combospline-stacked": { |
|
5396 "requires": [ |
|
5397 "series-combo-stacked", |
|
5398 "series-curve-util" |
|
5399 ] |
|
5400 }, |
|
5401 "series-curve-util": {}, |
|
5402 "series-fill-util": {}, |
|
5403 "series-histogram-base": { |
|
5404 "requires": [ |
|
5405 "series-cartesian", |
|
5406 "series-plot-util" |
|
5407 ] |
|
5408 }, |
|
5409 "series-line": { |
|
5410 "requires": [ |
|
5411 "series-cartesian", |
|
5412 "series-line-util" |
|
5413 ] |
|
5414 }, |
|
5415 "series-line-stacked": { |
|
5416 "requires": [ |
|
5417 "series-stacked", |
|
5418 "series-line" |
|
5419 ] |
|
5420 }, |
|
5421 "series-line-util": {}, |
|
5422 "series-marker": { |
|
5423 "requires": [ |
|
5424 "series-cartesian", |
|
5425 "series-plot-util" |
|
5426 ] |
|
5427 }, |
|
5428 "series-marker-stacked": { |
|
5429 "requires": [ |
|
5430 "series-stacked", |
|
5431 "series-marker" |
|
5432 ] |
|
5433 }, |
|
5434 "series-ohlc": { |
|
5435 "requires": [ |
|
5436 "series-range" |
|
5437 ] |
|
5438 }, |
|
5439 "series-pie": { |
|
5440 "requires": [ |
|
5441 "series-base", |
|
5442 "series-plot-util" |
|
5443 ] |
|
5444 }, |
|
5445 "series-plot-util": {}, |
|
5446 "series-range": { |
|
5447 "requires": [ |
|
5448 "series-cartesian" |
|
5449 ] |
|
5450 }, |
|
5451 "series-spline": { |
|
5452 "requires": [ |
|
5453 "series-line", |
|
5454 "series-curve-util" |
|
5455 ] |
|
5456 }, |
|
5457 "series-spline-stacked": { |
|
5458 "requires": [ |
|
5459 "series-stacked", |
|
5460 "series-spline" |
|
5461 ] |
|
5462 }, |
|
5463 "series-stacked": { |
|
5464 "requires": [ |
|
5465 "axis-stacked" |
|
5466 ] |
|
5467 }, |
|
5468 "shim-plugin": { |
|
5469 "requires": [ |
|
5470 "node-style", |
|
5471 "node-pluginhost" |
|
5472 ] |
|
5473 }, |
|
5474 "slider": { |
|
5475 "use": [ |
|
5476 "slider-base", |
|
5477 "slider-value-range", |
|
5478 "clickable-rail", |
|
5479 "range-slider" |
|
5480 ] |
|
5481 }, |
|
5482 "slider-base": { |
|
5483 "requires": [ |
|
5484 "widget", |
|
5485 "dd-constrain", |
|
5486 "event-key" |
|
5487 ], |
|
5488 "skinnable": true |
|
5489 }, |
|
5490 "slider-value-range": { |
|
5491 "requires": [ |
|
5492 "slider-base" |
|
5493 ] |
|
5494 }, |
|
5495 "sortable": { |
|
5496 "requires": [ |
|
5497 "dd-delegate", |
|
5498 "dd-drop-plugin", |
|
5499 "dd-proxy" |
|
5500 ] |
|
5501 }, |
|
5502 "sortable-scroll": { |
|
5503 "requires": [ |
|
5504 "dd-scroll", |
|
5505 "sortable" |
|
5506 ] |
|
5507 }, |
|
5508 "stylesheet": { |
|
5509 "requires": [ |
|
5510 "yui-base" |
|
5511 ] |
|
5512 }, |
|
5513 "substitute": { |
|
5514 "optional": [ |
|
5515 "dump" |
|
5516 ], |
|
5517 "requires": [ |
|
5518 "yui-base" |
|
5519 ] |
|
5520 }, |
|
5521 "swf": { |
|
5522 "requires": [ |
|
5523 "event-custom", |
|
5524 "node", |
|
5525 "swfdetect", |
|
5526 "escape" |
|
5527 ] |
|
5528 }, |
|
5529 "swfdetect": { |
|
5530 "requires": [ |
|
5531 "yui-base" |
|
5532 ] |
|
5533 }, |
|
5534 "tabview": { |
|
5535 "requires": [ |
|
5536 "widget", |
|
5537 "widget-parent", |
|
5538 "widget-child", |
|
5539 "tabview-base", |
|
5540 "node-pluginhost", |
|
5541 "node-focusmanager" |
|
5542 ], |
|
5543 "skinnable": true |
|
5544 }, |
|
5545 "tabview-base": { |
|
5546 "requires": [ |
|
5547 "node-event-delegate", |
|
5548 "classnamemanager" |
|
5549 ] |
|
5550 }, |
|
5551 "tabview-plugin": { |
|
5552 "requires": [ |
|
5553 "tabview-base" |
|
5554 ] |
|
5555 }, |
|
5556 "template": { |
|
5557 "use": [ |
|
5558 "template-base", |
|
5559 "template-micro" |
|
5560 ] |
|
5561 }, |
|
5562 "template-base": { |
|
5563 "requires": [ |
|
5564 "yui-base" |
|
5565 ] |
|
5566 }, |
|
5567 "template-micro": { |
|
5568 "requires": [ |
|
5569 "escape" |
|
5570 ] |
|
5571 }, |
|
5572 "test": { |
|
5573 "requires": [ |
|
5574 "event-simulate", |
|
5575 "event-custom", |
|
5576 "json-stringify" |
|
5577 ] |
|
5578 }, |
|
5579 "test-console": { |
|
5580 "requires": [ |
|
5581 "console-filters", |
|
5582 "test", |
|
5583 "array-extras" |
|
5584 ], |
|
5585 "skinnable": true |
|
5586 }, |
|
5587 "text": { |
|
5588 "use": [ |
|
5589 "text-accentfold", |
|
5590 "text-wordbreak" |
|
5591 ] |
|
5592 }, |
|
5593 "text-accentfold": { |
|
5594 "requires": [ |
|
5595 "array-extras", |
|
5596 "text-data-accentfold" |
|
5597 ] |
|
5598 }, |
|
5599 "text-data-accentfold": { |
|
5600 "requires": [ |
|
5601 "yui-base" |
|
5602 ] |
|
5603 }, |
|
5604 "text-data-wordbreak": { |
|
5605 "requires": [ |
|
5606 "yui-base" |
|
5607 ] |
|
5608 }, |
|
5609 "text-wordbreak": { |
|
5610 "requires": [ |
|
5611 "array-extras", |
|
5612 "text-data-wordbreak" |
|
5613 ] |
|
5614 }, |
|
5615 "timers": { |
|
5616 "requires": [ |
|
5617 "yui-base" |
|
5618 ] |
|
5619 }, |
|
5620 "transition": { |
|
5621 "requires": [ |
|
5622 "node-style" |
|
5623 ] |
|
5624 }, |
|
5625 "transition-timer": { |
|
5626 "condition": { |
|
5627 "name": "transition-timer", |
|
5628 "test": function (Y) { |
|
5629 var DOCUMENT = Y.config.doc, |
|
5630 node = (DOCUMENT) ? DOCUMENT.documentElement: null, |
|
5631 ret = true; |
|
5632 |
|
5633 if (node && node.style) { |
|
5634 ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); |
|
5635 } |
|
5636 |
|
5637 return ret; |
|
5638 }, |
|
5639 "trigger": "transition" |
|
5640 }, |
|
5641 "requires": [ |
|
5642 "transition" |
|
5643 ] |
|
5644 }, |
|
5645 "tree": { |
|
5646 "requires": [ |
|
5647 "base-build", |
|
5648 "tree-node" |
|
5649 ] |
|
5650 }, |
|
5651 "tree-labelable": { |
|
5652 "requires": [ |
|
5653 "tree" |
|
5654 ] |
|
5655 }, |
|
5656 "tree-lazy": { |
|
5657 "requires": [ |
|
5658 "base-pluginhost", |
|
5659 "plugin", |
|
5660 "tree" |
|
5661 ] |
|
5662 }, |
|
5663 "tree-node": {}, |
|
5664 "tree-openable": { |
|
5665 "requires": [ |
|
5666 "tree" |
|
5667 ] |
|
5668 }, |
|
5669 "tree-selectable": { |
|
5670 "requires": [ |
|
5671 "tree" |
|
5672 ] |
|
5673 }, |
|
5674 "tree-sortable": { |
|
5675 "requires": [ |
|
5676 "tree" |
|
5677 ] |
|
5678 }, |
|
5679 "uploader": { |
|
5680 "requires": [ |
|
5681 "uploader-html5", |
|
5682 "uploader-flash" |
|
5683 ] |
|
5684 }, |
|
5685 "uploader-flash": { |
|
5686 "requires": [ |
|
5687 "swfdetect", |
|
5688 "escape", |
|
5689 "widget", |
|
5690 "base", |
|
5691 "cssbutton", |
|
5692 "node", |
|
5693 "event-custom", |
|
5694 "uploader-queue" |
|
5695 ] |
|
5696 }, |
|
5697 "uploader-html5": { |
|
5698 "requires": [ |
|
5699 "widget", |
|
5700 "node-event-simulate", |
|
5701 "file-html5", |
|
5702 "uploader-queue" |
|
5703 ] |
|
5704 }, |
|
5705 "uploader-queue": { |
|
5706 "requires": [ |
|
5707 "base" |
|
5708 ] |
|
5709 }, |
|
5710 "view": { |
|
5711 "requires": [ |
|
5712 "base-build", |
|
5713 "node-event-delegate" |
|
5714 ] |
|
5715 }, |
|
5716 "view-node-map": { |
|
5717 "requires": [ |
|
5718 "view" |
|
5719 ] |
|
5720 }, |
|
5721 "widget": { |
|
5722 "use": [ |
|
5723 "widget-base", |
|
5724 "widget-htmlparser", |
|
5725 "widget-skin", |
|
5726 "widget-uievents" |
|
5727 ] |
|
5728 }, |
|
5729 "widget-anim": { |
|
5730 "requires": [ |
|
5731 "anim-base", |
|
5732 "plugin", |
|
5733 "widget" |
|
5734 ] |
|
5735 }, |
|
5736 "widget-autohide": { |
|
5737 "requires": [ |
|
5738 "base-build", |
|
5739 "event-key", |
|
5740 "event-outside", |
|
5741 "widget" |
|
5742 ] |
|
5743 }, |
|
5744 "widget-base": { |
|
5745 "requires": [ |
|
5746 "attribute", |
|
5747 "base-base", |
|
5748 "base-pluginhost", |
|
5749 "classnamemanager", |
|
5750 "event-focus", |
|
5751 "node-base", |
|
5752 "node-style" |
|
5753 ], |
|
5754 "skinnable": true |
|
5755 }, |
|
5756 "widget-base-ie": { |
|
5757 "condition": { |
|
5758 "name": "widget-base-ie", |
|
5759 "trigger": "widget-base", |
|
5760 "ua": "ie" |
|
5761 }, |
|
5762 "requires": [ |
|
5763 "widget-base" |
|
5764 ] |
|
5765 }, |
|
5766 "widget-buttons": { |
|
5767 "requires": [ |
|
5768 "button-plugin", |
|
5769 "cssbutton", |
|
5770 "widget-stdmod" |
|
5771 ] |
|
5772 }, |
|
5773 "widget-child": { |
|
5774 "requires": [ |
|
5775 "base-build", |
|
5776 "widget" |
|
5777 ] |
|
5778 }, |
|
5779 "widget-htmlparser": { |
|
5780 "requires": [ |
|
5781 "widget-base" |
|
5782 ] |
|
5783 }, |
|
5784 "widget-modality": { |
|
5785 "requires": [ |
|
5786 "base-build", |
|
5787 "event-outside", |
|
5788 "widget" |
|
5789 ], |
|
5790 "skinnable": true |
|
5791 }, |
|
5792 "widget-parent": { |
|
5793 "requires": [ |
|
5794 "arraylist", |
|
5795 "base-build", |
|
5796 "widget" |
|
5797 ] |
|
5798 }, |
|
5799 "widget-position": { |
|
5800 "requires": [ |
|
5801 "base-build", |
|
5802 "node-screen", |
|
5803 "widget" |
|
5804 ] |
|
5805 }, |
|
5806 "widget-position-align": { |
|
5807 "requires": [ |
|
5808 "widget-position" |
|
5809 ] |
|
5810 }, |
|
5811 "widget-position-constrain": { |
|
5812 "requires": [ |
|
5813 "widget-position" |
|
5814 ] |
|
5815 }, |
|
5816 "widget-skin": { |
|
5817 "requires": [ |
|
5818 "widget-base" |
|
5819 ] |
|
5820 }, |
|
5821 "widget-stack": { |
|
5822 "requires": [ |
|
5823 "base-build", |
|
5824 "widget" |
|
5825 ], |
|
5826 "skinnable": true |
|
5827 }, |
|
5828 "widget-stdmod": { |
|
5829 "requires": [ |
|
5830 "base-build", |
|
5831 "widget" |
|
5832 ] |
|
5833 }, |
|
5834 "widget-uievents": { |
|
5835 "requires": [ |
|
5836 "node-event-delegate", |
|
5837 "widget-base" |
|
5838 ] |
|
5839 }, |
|
5840 "yql": { |
|
5841 "requires": [ |
|
5842 "oop" |
|
5843 ] |
|
5844 }, |
|
5845 "yql-jsonp": { |
|
5846 "condition": { |
|
5847 "name": "yql-jsonp", |
|
5848 "test": function (Y) { |
|
5849 /* Only load the JSONP module when not in nodejs or winjs |
|
5850 TODO Make the winjs module a CORS module |
|
5851 */ |
|
5852 return (!Y.UA.nodejs && !Y.UA.winjs); |
|
5853 }, |
|
5854 "trigger": "yql", |
|
5855 "when": "after" |
|
5856 }, |
|
5857 "requires": [ |
|
5858 "jsonp", |
|
5859 "jsonp-url" |
|
5860 ] |
|
5861 }, |
|
5862 "yql-nodejs": { |
|
5863 "condition": { |
|
5864 "name": "yql-nodejs", |
|
5865 "trigger": "yql", |
|
5866 "ua": "nodejs", |
|
5867 "when": "after" |
|
5868 } |
|
5869 }, |
|
5870 "yql-winjs": { |
|
5871 "condition": { |
|
5872 "name": "yql-winjs", |
|
5873 "trigger": "yql", |
|
5874 "ua": "winjs", |
|
5875 "when": "after" |
|
5876 } |
|
5877 }, |
|
5878 "yui": {}, |
|
5879 "yui-base": {}, |
|
5880 "yui-later": { |
|
5881 "requires": [ |
|
5882 "yui-base" |
|
5883 ] |
|
5884 }, |
|
5885 "yui-log": { |
|
5886 "requires": [ |
|
5887 "yui-base" |
|
5888 ] |
|
5889 }, |
|
5890 "yui-throttle": { |
|
5891 "requires": [ |
|
5892 "yui-base" |
|
5893 ] |
|
5894 } |
|
5895 }); |
|
5896 YUI.Env[Y.version].md5 = '8e471689779fc84718f6dad481790b59'; |
|
5897 |
|
5898 |
|
5899 }, '@VERSION@', {"requires": ["loader-base"]}); |
|
5900 YUI.add('loader', function (Y, NAME) {}, '@VERSION@', {"use": ["loader-base", "loader-rollup", "loader-yui3"]}); |