Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

loader.js 122KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618
  1. /*
  2. Copyright (c) 2010, Yahoo! Inc. All rights reserved.
  3. Code licensed under the BSD License:
  4. http://developer.yahoo.com/yui/license.html
  5. version: 3.4.0
  6. build: nightly
  7. */
  8. YUI.add('loader-base', function(Y) {
  9. /**
  10. * The YUI loader core
  11. * @module loader
  12. * @submodule loader-base
  13. */
  14. if (!YUI.Env[Y.version]) {
  15. (function() {
  16. var VERSION = Y.version,
  17. BUILD = '/build/',
  18. ROOT = VERSION + BUILD,
  19. CDN_BASE = Y.Env.base,
  20. GALLERY_VERSION = 'gallery-2011.09.14-20-40',
  21. TNT = '2in3',
  22. TNT_VERSION = '4',
  23. YUI2_VERSION = '2.9.0',
  24. COMBO_BASE = CDN_BASE + 'combo?',
  25. META = { version: VERSION,
  26. root: ROOT,
  27. base: Y.Env.base,
  28. comboBase: COMBO_BASE,
  29. skin: { defaultSkin: 'sam',
  30. base: 'assets/skins/',
  31. path: 'skin.css',
  32. after: ['cssreset',
  33. 'cssfonts',
  34. 'cssgrids',
  35. 'cssbase',
  36. 'cssreset-context',
  37. 'cssfonts-context']},
  38. groups: {},
  39. patterns: {} },
  40. groups = META.groups,
  41. yui2Update = function(tnt, yui2) {
  42. var root = TNT + '.' +
  43. (tnt || TNT_VERSION) + '/' +
  44. (yui2 || YUI2_VERSION) + BUILD;
  45. groups.yui2.base = CDN_BASE + root;
  46. groups.yui2.root = root;
  47. },
  48. galleryUpdate = function(tag) {
  49. var root = (tag || GALLERY_VERSION) + BUILD;
  50. groups.gallery.base = CDN_BASE + root;
  51. groups.gallery.root = root;
  52. };
  53. groups[VERSION] = {};
  54. groups.gallery = {
  55. ext: false,
  56. combine: true,
  57. comboBase: COMBO_BASE,
  58. update: galleryUpdate,
  59. patterns: { 'gallery-': { },
  60. 'lang/gallery-': {},
  61. 'gallerycss-': { type: 'css' } }
  62. };
  63. groups.yui2 = {
  64. combine: true,
  65. ext: false,
  66. comboBase: COMBO_BASE,
  67. update: yui2Update,
  68. patterns: {
  69. 'yui2-': {
  70. configFn: function(me) {
  71. if (/-skin|reset|fonts|grids|base/.test(me.name)) {
  72. me.type = 'css';
  73. me.path = me.path.replace(/\.js/, '.css');
  74. // this makes skins in builds earlier than
  75. // 2.6.0 work as long as combine is false
  76. me.path = me.path.replace(/\/yui2-skin/,
  77. '/assets/skins/sam/yui2-skin');
  78. }
  79. }
  80. }
  81. }
  82. };
  83. galleryUpdate();
  84. yui2Update();
  85. YUI.Env[VERSION] = META;
  86. }());
  87. }
  88. /**
  89. * Loader dynamically loads script and css files. It includes the dependency
  90. * info for the version of the library in use, and will automatically pull in
  91. * dependencies for the modules requested. It supports rollup files and will
  92. * automatically use these when appropriate in order to minimize the number of
  93. * http connections required to load all of the dependencies. It can load the
  94. * files from the Yahoo! CDN, and it can utilize the combo service provided on
  95. * this network to reduce the number of http connections required To Download
  96. * YUI files.
  97. *
  98. * @module loader
  99. * @main loader
  100. * @submodule loader-base
  101. */
  102. var NOT_FOUND = {},
  103. NO_REQUIREMENTS = [],
  104. MAX_URL_LENGTH = 2048,
  105. GLOBAL_ENV = YUI.Env,
  106. GLOBAL_LOADED = GLOBAL_ENV._loaded,
  107. CSS = 'css',
  108. JS = 'js',
  109. INTL = 'intl',
  110. VERSION = Y.version,
  111. ROOT_LANG = '',
  112. YObject = Y.Object,
  113. oeach = YObject.each,
  114. YArray = Y.Array,
  115. _queue = GLOBAL_ENV._loaderQueue,
  116. META = GLOBAL_ENV[VERSION],
  117. SKIN_PREFIX = 'skin-',
  118. L = Y.Lang,
  119. ON_PAGE = GLOBAL_ENV.mods,
  120. modulekey,
  121. cache,
  122. _path = function(dir, file, type, nomin) {
  123. var path = dir + '/' + file;
  124. if (!nomin) {
  125. path += '-min';
  126. }
  127. path += '.' + (type || CSS);
  128. return path;
  129. };
  130. if (YUI.Env.aliases) {
  131. YUI.Env.aliases = {}; //Don't need aliases if Loader is present
  132. }
  133. /**
  134. * The component metadata is stored in Y.Env.meta.
  135. * Part of the loader module.
  136. * @property meta
  137. * @for YUI
  138. */
  139. Y.Env.meta = META;
  140. /**
  141. * Loader dynamically loads script and css files. It includes the dependency
  142. * info for the version of the library in use, and will automatically pull in
  143. * dependencies for the modules requested. It supports rollup files and will
  144. * automatically use these when appropriate in order to minimize the number of
  145. * http connections required to load all of the dependencies. It can load the
  146. * files from the Yahoo! CDN, and it can utilize the combo service provided on
  147. * this network to reduce the number of http connections required To Download
  148. * YUI files.
  149. *
  150. * While the loader can be instantiated by the end user, it normally is not.
  151. * @see YUI.use for the normal use case. The use function automatically will
  152. * pull in missing dependencies.
  153. *
  154. * @constructor
  155. * @class Loader
  156. * @param {object} o an optional set of configuration options. Valid options:
  157. * <ul>
  158. * <li>base:
  159. * The base dir</li>
  160. * <li>comboBase:
  161. * The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
  162. * <li>root:
  163. * The root path to prepend to module names for the combo service.
  164. * Ex: 2.5.2/build/</li>
  165. * <li>filter:.
  166. *
  167. * A filter to apply to result urls. This filter will modify the default
  168. * path for all modules. The default path for the YUI library is the
  169. * minified version of the files (e.g., event-min.js). The filter property
  170. * can be a predefined filter or a custom filter. The valid predefined
  171. * filters are:
  172. * <dl>
  173. * <dt>DEBUG</dt>
  174. * <dd>Selects the debug versions of the library (e.g., event-debug.js).
  175. * This option will automatically include the Logger widget</dd>
  176. * <dt>RAW</dt>
  177. * <dd>Selects the non-minified version of the library (e.g., event.js).
  178. * </dd>
  179. * </dl>
  180. * You can also define a custom filter, which must be an object literal
  181. * containing a search expression and a replace string:
  182. * <pre>
  183. * myFilter: &#123;
  184. * 'searchExp': "-min\\.js",
  185. * 'replaceStr': "-debug.js"
  186. * &#125;
  187. * </pre>
  188. *
  189. * </li>
  190. * <li>filters: per-component filter specification. If specified
  191. * for a given component, this overrides the filter config. _Note:_ This does not work on combo urls, use the filter property instead.</li>
  192. * <li>combine:
  193. * Use the YUI combo service to reduce the number of http connections
  194. * required to load your dependencies</li>
  195. * <li>ignore:
  196. * A list of modules that should never be dynamically loaded</li>
  197. * <li>force:
  198. * A list of modules that should always be loaded when required, even if
  199. * already present on the page</li>
  200. * <li>insertBefore:
  201. * Node or id for a node that should be used as the insertion point for
  202. * new nodes</li>
  203. * <li>charset:
  204. * charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
  205. * </li>
  206. * <li>jsAttributes: object literal containing attributes to add to script
  207. * nodes</li>
  208. * <li>cssAttributes: object literal containing attributes to add to link
  209. * nodes</li>
  210. * <li>timeout:
  211. * The number of milliseconds before a timeout occurs when dynamically
  212. * loading nodes. If not set, there is no timeout</li>
  213. * <li>context:
  214. * execution context for all callbacks</li>
  215. * <li>onSuccess:
  216. * callback for the 'success' event</li>
  217. * <li>onFailure: callback for the 'failure' event</li>
  218. * <li>onCSS: callback for the 'CSSComplete' event. When loading YUI
  219. * components with CSS the CSS is loaded first, then the script. This
  220. * provides a moment you can tie into to improve
  221. * the presentation of the page while the script is loading.</li>
  222. * <li>onTimeout:
  223. * callback for the 'timeout' event</li>
  224. * <li>onProgress:
  225. * callback executed each time a script or css file is loaded</li>
  226. * <li>modules:
  227. * A list of module definitions. See Loader.addModule for the supported
  228. * module metadata</li>
  229. * <li>groups:
  230. * A list of group definitions. Each group can contain specific definitions
  231. * for base, comboBase, combine, and accepts a list of modules. See above
  232. * for the description of these properties.</li>
  233. * <li>2in3: the version of the YUI 2 in 3 wrapper to use. The intrinsic
  234. * support for YUI 2 modules in YUI 3 relies on versions of the YUI 2
  235. * components inside YUI 3 module wrappers. These wrappers
  236. * change over time to accomodate the issues that arise from running YUI 2
  237. * in a YUI 3 sandbox.</li>
  238. * <li>yui2: when using the 2in3 project, you can select the version of
  239. * YUI 2 to use. Valid values * are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0,
  240. * 2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2
  241. * going forward.</li>
  242. * </ul>
  243. */
  244. Y.Loader = function(o) {
  245. var defaults = META.modules,
  246. self = this;
  247. modulekey = META.md5;
  248. /**
  249. * Internal callback to handle multiple internal insert() calls
  250. * so that css is inserted prior to js
  251. * @property _internalCallback
  252. * @private
  253. */
  254. // self._internalCallback = null;
  255. /**
  256. * Callback that will be executed when the loader is finished
  257. * with an insert
  258. * @method onSuccess
  259. * @type function
  260. */
  261. // self.onSuccess = null;
  262. /**
  263. * Callback that will be executed if there is a failure
  264. * @method onFailure
  265. * @type function
  266. */
  267. // self.onFailure = null;
  268. /**
  269. * Callback for the 'CSSComplete' event. When loading YUI components
  270. * with CSS the CSS is loaded first, then the script. This provides
  271. * a moment you can tie into to improve the presentation of the page
  272. * while the script is loading.
  273. * @method onCSS
  274. * @type function
  275. */
  276. // self.onCSS = null;
  277. /**
  278. * Callback executed each time a script or css file is loaded
  279. * @method onProgress
  280. * @type function
  281. */
  282. // self.onProgress = null;
  283. /**
  284. * Callback that will be executed if a timeout occurs
  285. * @method onTimeout
  286. * @type function
  287. */
  288. // self.onTimeout = null;
  289. /**
  290. * The execution context for all callbacks
  291. * @property context
  292. * @default {YUI} the YUI instance
  293. */
  294. self.context = Y;
  295. /**
  296. * Data that is passed to all callbacks
  297. * @property data
  298. */
  299. // self.data = null;
  300. /**
  301. * Node reference or id where new nodes should be inserted before
  302. * @property insertBefore
  303. * @type string|HTMLElement
  304. */
  305. // self.insertBefore = null;
  306. /**
  307. * The charset attribute for inserted nodes
  308. * @property charset
  309. * @type string
  310. * @deprecated , use cssAttributes or jsAttributes.
  311. */
  312. // self.charset = null;
  313. /**
  314. * An object literal containing attributes to add to link nodes
  315. * @property cssAttributes
  316. * @type object
  317. */
  318. // self.cssAttributes = null;
  319. /**
  320. * An object literal containing attributes to add to script nodes
  321. * @property jsAttributes
  322. * @type object
  323. */
  324. // self.jsAttributes = null;
  325. /**
  326. * The base directory.
  327. * @property base
  328. * @type string
  329. * @default http://yui.yahooapis.com/[YUI VERSION]/build/
  330. */
  331. self.base = Y.Env.meta.base + Y.Env.meta.root;
  332. /**
  333. * Base path for the combo service
  334. * @property comboBase
  335. * @type string
  336. * @default http://yui.yahooapis.com/combo?
  337. */
  338. self.comboBase = Y.Env.meta.comboBase;
  339. /*
  340. * Base path for language packs.
  341. */
  342. // self.langBase = Y.Env.meta.langBase;
  343. // self.lang = "";
  344. /**
  345. * If configured, the loader will attempt to use the combo
  346. * service for YUI resources and configured external resources.
  347. * @property combine
  348. * @type boolean
  349. * @default true if a base dir isn't in the config
  350. */
  351. self.combine = o.base &&
  352. (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
  353. /**
  354. * The default seperator to use between files in a combo URL
  355. * @property comboSep
  356. * @type {String}
  357. * @default Ampersand
  358. */
  359. self.comboSep = '&';
  360. /**
  361. * Max url length for combo urls. The default is 2048. This is the URL
  362. * limit for the Yahoo! hosted combo servers. If consuming
  363. * a different combo service that has a different URL limit
  364. * it is possible to override this default by supplying
  365. * the maxURLLength config option. The config option will
  366. * only take effect if lower than the default.
  367. *
  368. * @property maxURLLength
  369. * @type int
  370. */
  371. self.maxURLLength = MAX_URL_LENGTH;
  372. /**
  373. * Ignore modules registered on the YUI global
  374. * @property ignoreRegistered
  375. * @default false
  376. */
  377. // self.ignoreRegistered = false;
  378. /**
  379. * Root path to prepend to module path for the combo
  380. * service
  381. * @property root
  382. * @type string
  383. * @default [YUI VERSION]/build/
  384. */
  385. self.root = Y.Env.meta.root;
  386. /**
  387. * Timeout value in milliseconds. If set, self value will be used by
  388. * the get utility. the timeout event will fire if
  389. * a timeout occurs.
  390. * @property timeout
  391. * @type int
  392. */
  393. self.timeout = 0;
  394. /**
  395. * A list of modules that should not be loaded, even if
  396. * they turn up in the dependency tree
  397. * @property ignore
  398. * @type string[]
  399. */
  400. // self.ignore = null;
  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. self.forceMap = {};
  409. /**
  410. * Should we allow rollups
  411. * @property allowRollup
  412. * @type boolean
  413. * @default false
  414. */
  415. self.allowRollup = false;
  416. /**
  417. * A filter to apply to result urls. This filter will modify the default
  418. * path for all modules. The default path for the YUI library is the
  419. * minified version of the files (e.g., event-min.js). The filter property
  420. * can be a predefined filter or a custom filter. The valid predefined
  421. * filters are:
  422. * <dl>
  423. * <dt>DEBUG</dt>
  424. * <dd>Selects the debug versions of the library (e.g., event-debug.js).
  425. * This option will automatically include the Logger widget</dd>
  426. * <dt>RAW</dt>
  427. * <dd>Selects the non-minified version of the library (e.g., event.js).
  428. * </dd>
  429. * </dl>
  430. * You can also define a custom filter, which must be an object literal
  431. * containing a search expression and a replace string:
  432. * <pre>
  433. * myFilter: &#123;
  434. * 'searchExp': "-min\\.js",
  435. * 'replaceStr': "-debug.js"
  436. * &#125;
  437. * </pre>
  438. * @property filter
  439. * @type string| {searchExp: string, replaceStr: string}
  440. */
  441. // self.filter = null;
  442. /**
  443. * per-component filter specification. If specified for a given
  444. * component, this overrides the filter config.
  445. * @property filters
  446. * @type object
  447. */
  448. self.filters = {};
  449. /**
  450. * The list of requested modules
  451. * @property required
  452. * @type {string: boolean}
  453. */
  454. self.required = {};
  455. /**
  456. * If a module name is predefined when requested, it is checked againsts
  457. * the patterns provided in this property. If there is a match, the
  458. * module is added with the default configuration.
  459. *
  460. * At the moment only supporting module prefixes, but anticipate
  461. * supporting at least regular expressions.
  462. * @property patterns
  463. * @type Object
  464. */
  465. // self.patterns = Y.merge(Y.Env.meta.patterns);
  466. self.patterns = {};
  467. /**
  468. * The library metadata
  469. * @property moduleInfo
  470. */
  471. // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
  472. self.moduleInfo = {};
  473. self.groups = Y.merge(Y.Env.meta.groups);
  474. /**
  475. * Provides the information used to skin the skinnable components.
  476. * The following skin definition would result in 'skin1' and 'skin2'
  477. * being loaded for calendar (if calendar was requested), and
  478. * 'sam' for all other skinnable components:
  479. *
  480. * <code>
  481. * skin: {
  482. *
  483. * // The default skin, which is automatically applied if not
  484. * // overriden by a component-specific skin definition.
  485. * // Change this in to apply a different skin globally
  486. * defaultSkin: 'sam',
  487. *
  488. * // This is combined with the loader base property to get
  489. * // the default root directory for a skin. ex:
  490. * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
  491. * base: 'assets/skins/',
  492. *
  493. * // Any component-specific overrides can be specified here,
  494. * // making it possible to load different skins for different
  495. * // components. It is possible to load more than one skin
  496. * // for a given component as well.
  497. * overrides: {
  498. * calendar: ['skin1', 'skin2']
  499. * }
  500. * }
  501. * </code>
  502. * @property skin
  503. */
  504. self.skin = Y.merge(Y.Env.meta.skin);
  505. /*
  506. * Map of conditional modules
  507. * @since 3.2.0
  508. */
  509. self.conditions = {};
  510. // map of modules with a hash of modules that meet the requirement
  511. // self.provides = {};
  512. self.config = o;
  513. self._internal = true;
  514. cache = GLOBAL_ENV._renderedMods;
  515. if (cache) {
  516. oeach(cache, function modCache(v, k) {
  517. //self.moduleInfo[k] = Y.merge(v);
  518. self.moduleInfo[k] = v;
  519. });
  520. cache = GLOBAL_ENV._conditions;
  521. oeach(cache, function condCache(v, k) {
  522. //self.conditions[k] = Y.merge(v);
  523. self.conditions[k] = v;
  524. });
  525. } else {
  526. oeach(defaults, self.addModule, self);
  527. }
  528. if (!GLOBAL_ENV._renderedMods) {
  529. //GLOBAL_ENV._renderedMods = Y.merge(self.moduleInfo);
  530. //GLOBAL_ENV._conditions = Y.merge(self.conditions);
  531. GLOBAL_ENV._renderedMods = self.moduleInfo;
  532. GLOBAL_ENV._conditions = self.conditions;
  533. }
  534. self._inspectPage();
  535. self._internal = false;
  536. self._config(o);
  537. self.testresults = null;
  538. if (Y.config.tests) {
  539. self.testresults = Y.config.tests;
  540. }
  541. /**
  542. * List of rollup files found in the library metadata
  543. * @property rollups
  544. */
  545. // self.rollups = null;
  546. /**
  547. * Whether or not to load optional dependencies for
  548. * the requested modules
  549. * @property loadOptional
  550. * @type boolean
  551. * @default false
  552. */
  553. // self.loadOptional = false;
  554. /**
  555. * All of the derived dependencies in sorted order, which
  556. * will be populated when either calculate() or insert()
  557. * is called
  558. * @property sorted
  559. * @type string[]
  560. */
  561. self.sorted = [];
  562. /**
  563. * Set when beginning to compute the dependency tree.
  564. * Composed of what YUI reports to be loaded combined
  565. * with what has been loaded by any instance on the page
  566. * with the version number specified in the metadata.
  567. * @property loaded
  568. * @type {string: boolean}
  569. */
  570. self.loaded = GLOBAL_LOADED[VERSION];
  571. /*
  572. * A list of modules to attach to the YUI instance when complete.
  573. * If not supplied, the sorted list of dependencies are applied.
  574. * @property attaching
  575. */
  576. // self.attaching = null;
  577. /**
  578. * Flag to indicate the dependency tree needs to be recomputed
  579. * if insert is called again.
  580. * @property dirty
  581. * @type boolean
  582. * @default true
  583. */
  584. self.dirty = true;
  585. /**
  586. * List of modules inserted by the utility
  587. * @property inserted
  588. * @type {string: boolean}
  589. */
  590. self.inserted = {};
  591. /**
  592. * List of skipped modules during insert() because the module
  593. * was not defined
  594. * @property skipped
  595. */
  596. self.skipped = {};
  597. // Y.on('yui:load', self.loadNext, self);
  598. self.tested = {};
  599. /*
  600. * Cached sorted calculate results
  601. * @property results
  602. * @since 3.2.0
  603. */
  604. //self.results = {};
  605. };
  606. Y.Loader.prototype = {
  607. FILTER_DEFS: {
  608. RAW: {
  609. 'searchExp': '-min\\.js',
  610. 'replaceStr': '.js'
  611. },
  612. DEBUG: {
  613. 'searchExp': '-min\\.js',
  614. 'replaceStr': '-debug.js'
  615. }
  616. },
  617. /*
  618. * Check the pages meta-data and cache the result.
  619. * @method _inspectPage
  620. * @private
  621. */
  622. _inspectPage: function() {
  623. oeach(ON_PAGE, function(v, k) {
  624. if (v.details) {
  625. var m = this.moduleInfo[k],
  626. req = v.details.requires,
  627. mr = m && m.requires;
  628. if (m) {
  629. if (!m._inspected && req && mr.length != req.length) {
  630. // console.log('deleting ' + m.name);
  631. // m.requres = YObject.keys(Y.merge(YArray.hash(req), YArray.hash(mr)));
  632. delete m.expanded;
  633. // delete m.expanded_map;
  634. }
  635. } else {
  636. m = this.addModule(v.details, k);
  637. }
  638. m._inspected = true;
  639. }
  640. }, this);
  641. },
  642. /*
  643. * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
  644. * @private
  645. * @method _requires
  646. * @param {String} mod1 The first module to compare
  647. * @param {String} mod2 The second module to compare
  648. */
  649. _requires: function(mod1, mod2) {
  650. var i, rm, after_map, s,
  651. info = this.moduleInfo,
  652. m = info[mod1],
  653. other = info[mod2];
  654. if (!m || !other) {
  655. return false;
  656. }
  657. rm = m.expanded_map;
  658. after_map = m.after_map;
  659. // check if this module should be sorted after the other
  660. // do this first to short circut circular deps
  661. if (after_map && (mod2 in after_map)) {
  662. return true;
  663. }
  664. after_map = other.after_map;
  665. // and vis-versa
  666. if (after_map && (mod1 in after_map)) {
  667. return false;
  668. }
  669. // check if this module requires one the other supersedes
  670. s = info[mod2] && info[mod2].supersedes;
  671. if (s) {
  672. for (i = 0; i < s.length; i++) {
  673. if (this._requires(mod1, s[i])) {
  674. return true;
  675. }
  676. }
  677. }
  678. s = info[mod1] && info[mod1].supersedes;
  679. if (s) {
  680. for (i = 0; i < s.length; i++) {
  681. if (this._requires(mod2, s[i])) {
  682. return false;
  683. }
  684. }
  685. }
  686. // check if this module requires the other directly
  687. // if (r && YArray.indexOf(r, mod2) > -1) {
  688. if (rm && (mod2 in rm)) {
  689. return true;
  690. }
  691. // external css files should be sorted below yui css
  692. if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
  693. return true;
  694. }
  695. return false;
  696. },
  697. /**
  698. * Apply a new config to the Loader instance
  699. * @method _config
  700. * @param {Object} o The new configuration
  701. */
  702. _config: function(o) {
  703. var i, j, val, f, group, groupName, self = this;
  704. // apply config values
  705. if (o) {
  706. for (i in o) {
  707. if (o.hasOwnProperty(i)) {
  708. val = o[i];
  709. if (i == 'require') {
  710. self.require(val);
  711. } else if (i == 'skin') {
  712. Y.mix(self.skin, o[i], true);
  713. } else if (i == 'groups') {
  714. for (j in val) {
  715. if (val.hasOwnProperty(j)) {
  716. groupName = j;
  717. group = val[j];
  718. self.addGroup(group, groupName);
  719. }
  720. }
  721. } else if (i == 'modules') {
  722. // add a hash of module definitions
  723. oeach(val, self.addModule, self);
  724. } else if (i == 'gallery') {
  725. this.groups.gallery.update(val);
  726. } else if (i == 'yui2' || i == '2in3') {
  727. this.groups.yui2.update(o['2in3'], o.yui2);
  728. } else if (i == 'maxURLLength') {
  729. self[i] = Math.min(MAX_URL_LENGTH, val);
  730. } else {
  731. self[i] = val;
  732. }
  733. }
  734. }
  735. }
  736. // fix filter
  737. f = self.filter;
  738. if (L.isString(f)) {
  739. f = f.toUpperCase();
  740. self.filterName = f;
  741. self.filter = self.FILTER_DEFS[f];
  742. if (f == 'DEBUG') {
  743. self.require('yui-log', 'dump');
  744. }
  745. }
  746. if (self.lang) {
  747. self.require('intl-base', 'intl');
  748. }
  749. },
  750. /**
  751. * Returns the skin module name for the specified skin name. If a
  752. * module name is supplied, the returned skin module name is
  753. * specific to the module passed in.
  754. * @method formatSkin
  755. * @param {string} skin the name of the skin.
  756. * @param {string} mod optional: the name of a module to skin.
  757. * @return {string} the full skin module name.
  758. */
  759. formatSkin: function(skin, mod) {
  760. var s = SKIN_PREFIX + skin;
  761. if (mod) {
  762. s = s + '-' + mod;
  763. }
  764. return s;
  765. },
  766. /**
  767. * Adds the skin def to the module info
  768. * @method _addSkin
  769. * @param {string} skin the name of the skin.
  770. * @param {string} mod the name of the module.
  771. * @param {string} parent parent module if this is a skin of a
  772. * submodule or plugin.
  773. * @return {string} the module name for the skin.
  774. * @private
  775. */
  776. _addSkin: function(skin, mod, parent) {
  777. var mdef, pkg, name, nmod,
  778. info = this.moduleInfo,
  779. sinf = this.skin,
  780. ext = info[mod] && info[mod].ext;
  781. // Add a module definition for the module-specific skin css
  782. if (mod) {
  783. name = this.formatSkin(skin, mod);
  784. if (!info[name]) {
  785. mdef = info[mod];
  786. pkg = mdef.pkg || mod;
  787. nmod = {
  788. name: name,
  789. group: mdef.group,
  790. type: 'css',
  791. after: sinf.after,
  792. path: (parent || pkg) + '/' + sinf.base + skin +
  793. '/' + mod + '.css',
  794. ext: ext
  795. };
  796. if (mdef.base) {
  797. nmod.base = mdef.base;
  798. }
  799. if (mdef.configFn) {
  800. nmod.configFn = mdef.configFn;
  801. }
  802. this.addModule(nmod, name);
  803. }
  804. }
  805. return name;
  806. },
  807. /**
  808. * Add a new module group
  809. * <dl>
  810. * <dt>name:</dt> <dd>required, the group name</dd>
  811. * <dt>base:</dt> <dd>The base dir for this module group</dd>
  812. * <dt>root:</dt> <dd>The root path to add to each combo
  813. * resource path</dd>
  814. * <dt>combine:</dt> <dd>combo handle</dd>
  815. * <dt>comboBase:</dt> <dd>combo service base path</dd>
  816. * <dt>modules:</dt> <dd>the group of modules</dd>
  817. * </dl>
  818. * @method addGroup
  819. * @param {object} o An object containing the module data.
  820. * @param {string} name the group name.
  821. */
  822. addGroup: function(o, name) {
  823. var mods = o.modules,
  824. self = this;
  825. name = name || o.name;
  826. o.name = name;
  827. self.groups[name] = o;
  828. if (o.patterns) {
  829. oeach(o.patterns, function(v, k) {
  830. v.group = name;
  831. self.patterns[k] = v;
  832. });
  833. }
  834. if (mods) {
  835. oeach(mods, function(v, k) {
  836. v.group = name;
  837. self.addModule(v, k);
  838. }, self);
  839. }
  840. },
  841. /**
  842. * Add a new module to the component metadata.
  843. * <dl>
  844. * <dt>name:</dt> <dd>required, the component name</dd>
  845. * <dt>type:</dt> <dd>required, the component type (js or css)
  846. * </dd>
  847. * <dt>path:</dt> <dd>required, the path to the script from
  848. * "base"</dd>
  849. * <dt>requires:</dt> <dd>array of modules required by this
  850. * component</dd>
  851. * <dt>optional:</dt> <dd>array of optional modules for this
  852. * component</dd>
  853. * <dt>supersedes:</dt> <dd>array of the modules this component
  854. * replaces</dd>
  855. * <dt>after:</dt> <dd>array of modules the components which, if
  856. * present, should be sorted above this one</dd>
  857. * <dt>after_map:</dt> <dd>faster alternative to 'after' -- supply
  858. * a hash instead of an array</dd>
  859. * <dt>rollup:</dt> <dd>the number of superseded modules required
  860. * for automatic rollup</dd>
  861. * <dt>fullpath:</dt> <dd>If fullpath is specified, this is used
  862. * instead of the configured base + path</dd>
  863. * <dt>skinnable:</dt> <dd>flag to determine if skin assets should
  864. * automatically be pulled in</dd>
  865. * <dt>submodules:</dt> <dd>a hash of submodules</dd>
  866. * <dt>group:</dt> <dd>The group the module belongs to -- this
  867. * is set automatically when it is added as part of a group
  868. * configuration.</dd>
  869. * <dt>lang:</dt>
  870. * <dd>array of BCP 47 language tags of languages for which this
  871. * module has localized resource bundles,
  872. * e.g., ["en-GB","zh-Hans-CN"]</dd>
  873. * <dt>condition:</dt>
  874. * <dd>Specifies that the module should be loaded automatically if
  875. * a condition is met. This is an object with up to three fields:
  876. * [trigger] - the name of a module that can trigger the auto-load
  877. * [test] - a function that returns true when the module is to be
  878. * loaded.
  879. * [when] - specifies the load order of the conditional module
  880. * with regard to the position of the trigger module.
  881. * This should be one of three values: 'before', 'after', or
  882. * 'instead'. The default is 'after'.
  883. * </dd>
  884. * <dt>testresults:</dt><dd>a hash of test results from Y.Features.all()</dd>
  885. * </dl>
  886. * @method addModule
  887. * @param {object} o An object containing the module data.
  888. * @param {string} name the module name (optional), required if not
  889. * in the module data.
  890. * @return {object} the module definition or null if
  891. * the object passed in did not provide all required attributes.
  892. */
  893. addModule: function(o, name) {
  894. name = name || o.name;
  895. //Only merge this data if the temp flag is set
  896. //from an earlier pass from a pattern or else
  897. //an override module (YUI_config) can not be used to
  898. //replace a default module.
  899. if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
  900. //This catches temp modules loaded via a pattern
  901. // The module will be added twice, once from the pattern and
  902. // Once from the actual add call, this ensures that properties
  903. // that were added to the module the first time around (group: gallery)
  904. // are also added the second time around too.
  905. o = Y.merge(this.moduleInfo[name], o);
  906. }
  907. o.name = name;
  908. if (!o || !o.name) {
  909. return null;
  910. }
  911. if (!o.type) {
  912. o.type = JS;
  913. }
  914. if (!o.path && !o.fullpath) {
  915. o.path = _path(name, name, o.type);
  916. }
  917. o.supersedes = o.supersedes || o.use;
  918. o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
  919. o.requires = this.filterRequires(o.requires) || [];
  920. // Handle submodule logic
  921. var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
  922. j, langs, packName, supName, flatSup, flatLang, lang, ret,
  923. overrides, skinname, when,
  924. conditions = this.conditions, trigger;
  925. // , existing = this.moduleInfo[name], newr;
  926. this.moduleInfo[name] = o;
  927. if (!o.langPack && o.lang) {
  928. langs = YArray(o.lang);
  929. for (j = 0; j < langs.length; j++) {
  930. lang = langs[j];
  931. packName = this.getLangPackName(lang, name);
  932. smod = this.moduleInfo[packName];
  933. if (!smod) {
  934. smod = this._addLangPack(lang, o, packName);
  935. }
  936. }
  937. }
  938. if (subs) {
  939. sup = o.supersedes || [];
  940. l = 0;
  941. for (i in subs) {
  942. if (subs.hasOwnProperty(i)) {
  943. s = subs[i];
  944. s.path = s.path || _path(name, i, o.type);
  945. s.pkg = name;
  946. s.group = o.group;
  947. if (s.supersedes) {
  948. sup = sup.concat(s.supersedes);
  949. }
  950. smod = this.addModule(s, i);
  951. sup.push(i);
  952. if (smod.skinnable) {
  953. o.skinnable = true;
  954. overrides = this.skin.overrides;
  955. if (overrides && overrides[i]) {
  956. for (j = 0; j < overrides[i].length; j++) {
  957. skinname = this._addSkin(overrides[i][j],
  958. i, name);
  959. sup.push(skinname);
  960. }
  961. }
  962. skinname = this._addSkin(this.skin.defaultSkin,
  963. i, name);
  964. sup.push(skinname);
  965. }
  966. // looks like we are expected to work out the metadata
  967. // for the parent module language packs from what is
  968. // specified in the child modules.
  969. if (s.lang && s.lang.length) {
  970. langs = YArray(s.lang);
  971. for (j = 0; j < langs.length; j++) {
  972. lang = langs[j];
  973. packName = this.getLangPackName(lang, name);
  974. supName = this.getLangPackName(lang, i);
  975. smod = this.moduleInfo[packName];
  976. if (!smod) {
  977. smod = this._addLangPack(lang, o, packName);
  978. }
  979. flatSup = flatSup || YArray.hash(smod.supersedes);
  980. if (!(supName in flatSup)) {
  981. smod.supersedes.push(supName);
  982. }
  983. o.lang = o.lang || [];
  984. flatLang = flatLang || YArray.hash(o.lang);
  985. if (!(lang in flatLang)) {
  986. o.lang.push(lang);
  987. }
  988. // Add rollup file, need to add to supersedes list too
  989. // default packages
  990. packName = this.getLangPackName(ROOT_LANG, name);
  991. supName = this.getLangPackName(ROOT_LANG, i);
  992. smod = this.moduleInfo[packName];
  993. if (!smod) {
  994. smod = this._addLangPack(lang, o, packName);
  995. }
  996. if (!(supName in flatSup)) {
  997. smod.supersedes.push(supName);
  998. }
  999. // Add rollup file, need to add to supersedes list too
  1000. }
  1001. }
  1002. l++;
  1003. }
  1004. }
  1005. //o.supersedes = YObject.keys(YArray.hash(sup));
  1006. o.supersedes = YArray.dedupe(sup);
  1007. if (this.allowRollup) {
  1008. o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
  1009. }
  1010. }
  1011. plugins = o.plugins;
  1012. if (plugins) {
  1013. for (i in plugins) {
  1014. if (plugins.hasOwnProperty(i)) {
  1015. plug = plugins[i];
  1016. plug.pkg = name;
  1017. plug.path = plug.path || _path(name, i, o.type);
  1018. plug.requires = plug.requires || [];
  1019. plug.group = o.group;
  1020. this.addModule(plug, i);
  1021. if (o.skinnable) {
  1022. this._addSkin(this.skin.defaultSkin, i, name);
  1023. }
  1024. }
  1025. }
  1026. }
  1027. if (o.condition) {
  1028. t = o.condition.trigger;
  1029. if (YUI.Env.aliases[t]) {
  1030. t = YUI.Env.aliases[t];
  1031. }
  1032. if (!Y.Lang.isArray(t)) {
  1033. t = [t];
  1034. }
  1035. for (i = 0; i < t.length; i++) {
  1036. trigger = t[i];
  1037. when = o.condition.when;
  1038. conditions[trigger] = conditions[trigger] || {};
  1039. conditions[trigger][name] = o.condition;
  1040. // the 'when' attribute can be 'before', 'after', or 'instead'
  1041. // the default is after.
  1042. if (when && when != 'after') {
  1043. if (when == 'instead') { // replace the trigger
  1044. o.supersedes = o.supersedes || [];
  1045. o.supersedes.push(trigger);
  1046. } else { // before the trigger
  1047. // the trigger requires the conditional mod,
  1048. // so it should appear before the conditional
  1049. // mod if we do not intersede.
  1050. }
  1051. } else { // after the trigger
  1052. o.after = o.after || [];
  1053. o.after.push(trigger);
  1054. }
  1055. }
  1056. }
  1057. if (o.after) {
  1058. o.after_map = YArray.hash(o.after);
  1059. }
  1060. // this.dirty = true;
  1061. if (o.configFn) {
  1062. ret = o.configFn(o);
  1063. if (ret === false) {
  1064. delete this.moduleInfo[name];
  1065. o = null;
  1066. }
  1067. }
  1068. return o;
  1069. },
  1070. /**
  1071. * Add a requirement for one or more module
  1072. * @method require
  1073. * @param {string[] | string*} what the modules to load.
  1074. */
  1075. require: function(what) {
  1076. var a = (typeof what === 'string') ? YArray(arguments) : what;
  1077. this.dirty = true;
  1078. this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
  1079. this._explodeRollups();
  1080. },
  1081. /**
  1082. * Grab all the items that were asked for, check to see if the Loader
  1083. * meta-data contains a "use" array. If it doesm remove the asked item and replace it with
  1084. * the content of the "use".
  1085. * This will make asking for: "dd"
  1086. * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
  1087. * @private
  1088. * @method _explodeRollups
  1089. */
  1090. _explodeRollups: function() {
  1091. var self = this, m,
  1092. r = self.required;
  1093. if (!self.allowRollup) {
  1094. oeach(r, function(v, name) {
  1095. m = self.getModule(name);
  1096. if (m && m.use) {
  1097. //delete r[name];
  1098. YArray.each(m.use, function(v) {
  1099. m = self.getModule(v);
  1100. if (m && m.use) {
  1101. //delete r[v];
  1102. YArray.each(m.use, function(v) {
  1103. r[v] = true;
  1104. });
  1105. } else {
  1106. r[v] = true;
  1107. }
  1108. });
  1109. }
  1110. });
  1111. self.required = r;
  1112. }
  1113. },
  1114. /**
  1115. * Explodes the required array to remove aliases and replace them with real modules
  1116. * @method filterRequires
  1117. * @param {Array} r The original requires array
  1118. * @return {Array} The new array of exploded requirements
  1119. */
  1120. filterRequires: function(r) {
  1121. if (r) {
  1122. if (!Y.Lang.isArray(r)) {
  1123. r = [r];
  1124. }
  1125. r = Y.Array(r);
  1126. var c = [], i, mod, o, m;
  1127. for (i = 0; i < r.length; i++) {
  1128. mod = this.getModule(r[i]);
  1129. if (mod && mod.use) {
  1130. for (o = 0; o < mod.use.length; o++) {
  1131. //Must walk the other modules in case a module is a rollup of rollups (datatype)
  1132. m = this.getModule(mod.use[o]);
  1133. if (m && m.use) {
  1134. c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
  1135. } else {
  1136. c.push(mod.use[o]);
  1137. }
  1138. }
  1139. } else {
  1140. c.push(r[i]);
  1141. }
  1142. }
  1143. r = c;
  1144. }
  1145. return r;
  1146. },
  1147. /**
  1148. * Returns an object containing properties for all modules required
  1149. * in order to load the requested module
  1150. * @method getRequires
  1151. * @param {object} mod The module definition from moduleInfo.
  1152. * @return {array} the expanded requirement list.
  1153. */
  1154. getRequires: function(mod) {
  1155. if (!mod || mod._parsed) {
  1156. return NO_REQUIREMENTS;
  1157. }
  1158. var i, m, j, add, packName, lang, testresults = this.testresults,
  1159. name = mod.name, cond, go,
  1160. adddef = ON_PAGE[name] && ON_PAGE[name].details,
  1161. d, k, m1,
  1162. r, old_mod,
  1163. o, skinmod, skindef, skinpar, skinname,
  1164. intl = mod.lang || mod.intl,
  1165. info = this.moduleInfo,
  1166. ftests = Y.Features && Y.Features.tests.load,
  1167. hash;
  1168. // console.log(name);
  1169. // pattern match leaves module stub that needs to be filled out
  1170. if (mod.temp && adddef) {
  1171. old_mod = mod;
  1172. mod = this.addModule(adddef, name);
  1173. mod.group = old_mod.group;
  1174. mod.pkg = old_mod.pkg;
  1175. delete mod.expanded;
  1176. }
  1177. // console.log('cache: ' + mod.langCache + ' == ' + this.lang);
  1178. // if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
  1179. if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
  1180. return mod.expanded;
  1181. }
  1182. d = [];
  1183. hash = {};
  1184. r = this.filterRequires(mod.requires);
  1185. if (mod.lang) {
  1186. //If a module has a lang attribute, auto add the intl requirement.
  1187. d.unshift('intl');
  1188. r.unshift('intl');
  1189. intl = true;
  1190. }
  1191. o = this.filterRequires(mod.optional);
  1192. mod._parsed = true;
  1193. mod.langCache = this.lang;
  1194. for (i = 0; i < r.length; i++) {
  1195. if (!hash[r[i]]) {
  1196. d.push(r[i]);
  1197. hash[r[i]] = true;
  1198. m = this.getModule(r[i]);
  1199. if (m) {
  1200. add = this.getRequires(m);
  1201. intl = intl || (m.expanded_map &&
  1202. (INTL in m.expanded_map));
  1203. for (j = 0; j < add.length; j++) {
  1204. d.push(add[j]);
  1205. }
  1206. }
  1207. }
  1208. }
  1209. // get the requirements from superseded modules, if any
  1210. r = this.filterRequires(mod.supersedes);
  1211. if (r) {
  1212. for (i = 0; i < r.length; i++) {
  1213. if (!hash[r[i]]) {
  1214. // if this module has submodules, the requirements list is
  1215. // expanded to include the submodules. This is so we can
  1216. // prevent dups when a submodule is already loaded and the
  1217. // parent is requested.
  1218. if (mod.submodules) {
  1219. d.push(r[i]);
  1220. }
  1221. hash[r[i]] = true;
  1222. m = this.getModule(r[i]);
  1223. if (m) {
  1224. add = this.getRequires(m);
  1225. intl = intl || (m.expanded_map &&
  1226. (INTL in m.expanded_map));
  1227. for (j = 0; j < add.length; j++) {
  1228. d.push(add[j]);
  1229. }
  1230. }
  1231. }
  1232. }
  1233. }
  1234. if (o && this.loadOptional) {
  1235. for (i = 0; i < o.length; i++) {
  1236. if (!hash[o[i]]) {
  1237. d.push(o[i]);
  1238. hash[o[i]] = true;
  1239. m = info[o[i]];
  1240. if (m) {
  1241. add = this.getRequires(m);
  1242. intl = intl || (m.expanded_map &&
  1243. (INTL in m.expanded_map));
  1244. for (j = 0; j < add.length; j++) {
  1245. d.push(add[j]);
  1246. }
  1247. }
  1248. }
  1249. }
  1250. }
  1251. cond = this.conditions[name];
  1252. if (cond) {
  1253. if (testresults && ftests) {
  1254. oeach(testresults, function(result, id) {
  1255. var condmod = ftests[id].name;
  1256. if (!hash[condmod] && ftests[id].trigger == name) {
  1257. if (result && ftests[id]) {
  1258. hash[condmod] = true;
  1259. d.push(condmod);
  1260. }
  1261. }
  1262. });
  1263. } else {
  1264. oeach(cond, function(def, condmod) {
  1265. if (!hash[condmod]) {
  1266. go = def && ((def.ua && Y.UA[def.ua]) ||
  1267. (def.test && def.test(Y, r)));
  1268. if (go) {
  1269. hash[condmod] = true;
  1270. d.push(condmod);
  1271. m = this.getModule(condmod);
  1272. if (m) {
  1273. add = this.getRequires(m);
  1274. for (j = 0; j < add.length; j++) {
  1275. d.push(add[j]);
  1276. }
  1277. }
  1278. }
  1279. }
  1280. }, this);
  1281. }
  1282. }
  1283. // Create skin modules
  1284. if (mod.skinnable) {
  1285. skindef = this.skin.overrides;
  1286. oeach(YUI.Env.aliases, function(o, n) {
  1287. if (Y.Array.indexOf(o, name) > -1) {
  1288. skinpar = n;
  1289. }
  1290. });
  1291. if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
  1292. skinname = name;
  1293. if (skindef[skinpar]) {
  1294. skinname = skinpar;
  1295. }
  1296. for (i = 0; i < skindef[skinname].length; i++) {
  1297. skinmod = this._addSkin(skindef[skinname][i], name);
  1298. d.push(skinmod);
  1299. }
  1300. } else {
  1301. skinmod = this._addSkin(this.skin.defaultSkin, name);
  1302. d.push(skinmod);
  1303. }
  1304. }
  1305. mod._parsed = false;
  1306. if (intl) {
  1307. if (mod.lang && !mod.langPack && Y.Intl) {
  1308. lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
  1309. packName = this.getLangPackName(lang, name);
  1310. if (packName) {
  1311. d.unshift(packName);
  1312. }
  1313. }
  1314. d.unshift(INTL);
  1315. }
  1316. mod.expanded_map = YArray.hash(d);
  1317. mod.expanded = YObject.keys(mod.expanded_map);
  1318. return mod.expanded;
  1319. },
  1320. /**
  1321. * Returns a hash of module names the supplied module satisfies.
  1322. * @method getProvides
  1323. * @param {string} name The name of the module.
  1324. * @return {object} what this module provides.
  1325. */
  1326. getProvides: function(name) {
  1327. var m = this.getModule(name), o, s;
  1328. // supmap = this.provides;
  1329. if (!m) {
  1330. return NOT_FOUND;
  1331. }
  1332. if (m && !m.provides) {
  1333. o = {};
  1334. s = m.supersedes;
  1335. if (s) {
  1336. YArray.each(s, function(v) {
  1337. Y.mix(o, this.getProvides(v));
  1338. }, this);
  1339. }
  1340. o[name] = true;
  1341. m.provides = o;
  1342. }
  1343. return m.provides;
  1344. },
  1345. /**
  1346. * Calculates the dependency tree, the result is stored in the sorted
  1347. * property.
  1348. * @method calculate
  1349. * @param {object} o optional options object.
  1350. * @param {string} type optional argument to prune modules.
  1351. */
  1352. calculate: function(o, type) {
  1353. if (o || type || this.dirty) {
  1354. if (o) {
  1355. this._config(o);
  1356. }
  1357. if (!this._init) {
  1358. this._setup();
  1359. }
  1360. this._explode();
  1361. if (this.allowRollup) {
  1362. this._rollup();
  1363. } else {
  1364. this._explodeRollups();
  1365. }
  1366. this._reduce();
  1367. this._sort();
  1368. }
  1369. },
  1370. /**
  1371. * Creates a "psuedo" package for languages provided in the lang array
  1372. * @method _addLangPack
  1373. * @param {String} lang The language to create
  1374. * @param {Object} m The module definition to create the language pack around
  1375. * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
  1376. * @return {Object} The module definition
  1377. */
  1378. _addLangPack: function(lang, m, packName) {
  1379. var name = m.name,
  1380. packPath,
  1381. existing = this.moduleInfo[packName];
  1382. if (!existing) {
  1383. packPath = _path((m.pkg || name), packName, JS, true);
  1384. this.addModule({ path: packPath,
  1385. intl: true,
  1386. langPack: true,
  1387. ext: m.ext,
  1388. group: m.group,
  1389. supersedes: [] }, packName);
  1390. if (lang) {
  1391. Y.Env.lang = Y.Env.lang || {};
  1392. Y.Env.lang[lang] = Y.Env.lang[lang] || {};
  1393. Y.Env.lang[lang][name] = true;
  1394. }
  1395. }
  1396. return this.moduleInfo[packName];
  1397. },
  1398. /**
  1399. * Investigates the current YUI configuration on the page. By default,
  1400. * modules already detected will not be loaded again unless a force
  1401. * option is encountered. Called by calculate()
  1402. * @method _setup
  1403. * @private
  1404. */
  1405. _setup: function() {
  1406. var info = this.moduleInfo, name, i, j, m, l,
  1407. packName;
  1408. for (name in info) {
  1409. if (info.hasOwnProperty(name)) {
  1410. m = info[name];
  1411. if (m) {
  1412. // remove dups
  1413. //m.requires = YObject.keys(YArray.hash(m.requires));
  1414. m.requires = YArray.dedupe(m.requires);
  1415. // Create lang pack modules
  1416. if (m.lang && m.lang.length) {
  1417. // Setup root package if the module has lang defined,
  1418. // it needs to provide a root language pack
  1419. packName = this.getLangPackName(ROOT_LANG, name);
  1420. this._addLangPack(null, m, packName);
  1421. }
  1422. }
  1423. }
  1424. }
  1425. //l = Y.merge(this.inserted);
  1426. l = {};
  1427. // available modules
  1428. if (!this.ignoreRegistered) {
  1429. Y.mix(l, GLOBAL_ENV.mods);
  1430. }
  1431. // add the ignore list to the list of loaded packages
  1432. if (this.ignore) {
  1433. Y.mix(l, YArray.hash(this.ignore));
  1434. }
  1435. // expand the list to include superseded modules
  1436. for (j in l) {
  1437. if (l.hasOwnProperty(j)) {
  1438. Y.mix(l, this.getProvides(j));
  1439. }
  1440. }
  1441. // remove modules on the force list from the loaded list
  1442. if (this.force) {
  1443. for (i = 0; i < this.force.length; i++) {
  1444. if (this.force[i] in l) {
  1445. delete l[this.force[i]];
  1446. }
  1447. }
  1448. }
  1449. Y.mix(this.loaded, l);
  1450. this._init = true;
  1451. },
  1452. /**
  1453. * Builds a module name for a language pack
  1454. * @method getLangPackName
  1455. * @param {string} lang the language code.
  1456. * @param {string} mname the module to build it for.
  1457. * @return {string} the language pack module name.
  1458. */
  1459. getLangPackName: function(lang, mname) {
  1460. return ('lang/' + mname + ((lang) ? '_' + lang : ''));
  1461. },
  1462. /**
  1463. * Inspects the required modules list looking for additional
  1464. * dependencies. Expands the required list to include all
  1465. * required modules. Called by calculate()
  1466. * @method _explode
  1467. * @private
  1468. */
  1469. _explode: function() {
  1470. var r = this.required, m, reqs, done = {},
  1471. self = this;
  1472. // the setup phase is over, all modules have been created
  1473. self.dirty = false;
  1474. self._explodeRollups();
  1475. r = self.required;
  1476. oeach(r, function(v, name) {
  1477. if (!done[name]) {
  1478. done[name] = true;
  1479. m = self.getModule(name);
  1480. if (m) {
  1481. var expound = m.expound;
  1482. if (expound) {
  1483. r[expound] = self.getModule(expound);
  1484. reqs = self.getRequires(r[expound]);
  1485. Y.mix(r, YArray.hash(reqs));
  1486. }
  1487. reqs = self.getRequires(m);
  1488. Y.mix(r, YArray.hash(reqs));
  1489. }
  1490. }
  1491. });
  1492. },
  1493. /**
  1494. * Get's the loader meta data for the requested module
  1495. * @method getModule
  1496. * @param {String} mname The module name to get
  1497. * @return {Object} The module metadata
  1498. */
  1499. getModule: function(mname) {
  1500. //TODO: Remove name check - it's a quick hack to fix pattern WIP
  1501. if (!mname) {
  1502. return null;
  1503. }
  1504. var p, found, pname,
  1505. m = this.moduleInfo[mname],
  1506. patterns = this.patterns;
  1507. // check the patterns library to see if we should automatically add
  1508. // the module with defaults
  1509. if (!m) {
  1510. for (pname in patterns) {
  1511. if (patterns.hasOwnProperty(pname)) {
  1512. p = patterns[pname];
  1513. // use the metadata supplied for the pattern
  1514. // as the module definition.
  1515. if (mname.indexOf(pname) > -1) {
  1516. found = p;
  1517. break;
  1518. }
  1519. }
  1520. }
  1521. if (found) {
  1522. if (p.action) {
  1523. p.action.call(this, mname, pname);
  1524. } else {
  1525. // ext true or false?
  1526. m = this.addModule(Y.merge(found), mname);
  1527. m.temp = true;
  1528. }
  1529. }
  1530. }
  1531. return m;
  1532. },
  1533. // impl in rollup submodule
  1534. _rollup: function() { },
  1535. /**
  1536. * Remove superceded modules and loaded modules. Called by
  1537. * calculate() after we have the mega list of all dependencies
  1538. * @method _reduce
  1539. * @return {object} the reduced dependency hash.
  1540. * @private
  1541. */
  1542. _reduce: function(r) {
  1543. r = r || this.required;
  1544. var i, j, s, m, type = this.loadType,
  1545. ignore = this.ignore ? YArray.hash(this.ignore) : false;
  1546. for (i in r) {
  1547. if (r.hasOwnProperty(i)) {
  1548. m = this.getModule(i);
  1549. // remove if already loaded
  1550. if (((this.loaded[i] || ON_PAGE[i]) &&
  1551. !this.forceMap[i] && !this.ignoreRegistered) ||
  1552. (type && m && m.type != type)) {
  1553. delete r[i];
  1554. }
  1555. if (ignore && ignore[i]) {
  1556. delete r[i];
  1557. }
  1558. // remove anything this module supersedes
  1559. s = m && m.supersedes;
  1560. if (s) {
  1561. for (j = 0; j < s.length; j++) {
  1562. if (s[j] in r) {
  1563. delete r[s[j]];
  1564. }
  1565. }
  1566. }
  1567. }
  1568. }
  1569. return r;
  1570. },
  1571. /**
  1572. * Handles the queue when a module has been loaded for all cases
  1573. * @method _finish
  1574. * @private
  1575. * @param {String} msg The message from Loader
  1576. * @param {Boolean} success A boolean denoting success or failure
  1577. */
  1578. _finish: function(msg, success) {
  1579. _queue.running = false;
  1580. var onEnd = this.onEnd;
  1581. if (onEnd) {
  1582. onEnd.call(this.context, {
  1583. msg: msg,
  1584. data: this.data,
  1585. success: success
  1586. });
  1587. }
  1588. this._continue();
  1589. },
  1590. /**
  1591. * The default Loader onSuccess handler, calls this.onSuccess with a payload
  1592. * @method _onSuccess
  1593. * @private
  1594. */
  1595. _onSuccess: function() {
  1596. var self = this, skipped = Y.merge(self.skipped), fn,
  1597. failed = [], rreg = self.requireRegistration,
  1598. success, msg;
  1599. oeach(skipped, function(k) {
  1600. delete self.inserted[k];
  1601. });
  1602. self.skipped = {};
  1603. oeach(self.inserted, function(v, k) {
  1604. var mod = self.getModule(k);
  1605. if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
  1606. failed.push(k);
  1607. } else {
  1608. Y.mix(self.loaded, self.getProvides(k));
  1609. }
  1610. });
  1611. fn = self.onSuccess;
  1612. msg = (failed.length) ? 'notregistered' : 'success';
  1613. success = !(failed.length);
  1614. if (fn) {
  1615. fn.call(self.context, {
  1616. msg: msg,
  1617. data: self.data,
  1618. success: success,
  1619. failed: failed,
  1620. skipped: skipped
  1621. });
  1622. }
  1623. self._finish(msg, success);
  1624. },
  1625. /**
  1626. * The default Loader onFailure handler, calls this.onFailure with a payload
  1627. * @method _onFailure
  1628. * @private
  1629. */
  1630. _onFailure: function(o) {
  1631. var f = this.onFailure, msg = 'failure: ' + o.msg;
  1632. if (f) {
  1633. f.call(this.context, {
  1634. msg: msg,
  1635. data: this.data,
  1636. success: false
  1637. });
  1638. }
  1639. this._finish(msg, false);
  1640. },
  1641. /**
  1642. * The default Loader onTimeout handler, calls this.onTimeout with a payload
  1643. * @method _onTimeout
  1644. * @private
  1645. */
  1646. _onTimeout: function() {
  1647. var f = this.onTimeout;
  1648. if (f) {
  1649. f.call(this.context, {
  1650. msg: 'timeout',
  1651. data: this.data,
  1652. success: false
  1653. });
  1654. }
  1655. this._finish('timeout', false);
  1656. },
  1657. /**
  1658. * Sorts the dependency tree. The last step of calculate()
  1659. * @method _sort
  1660. * @private
  1661. */
  1662. _sort: function() {
  1663. // create an indexed list
  1664. var s = YObject.keys(this.required),
  1665. // loaded = this.loaded,
  1666. done = {},
  1667. p = 0, l, a, b, j, k, moved, doneKey;
  1668. // keep going until we make a pass without moving anything
  1669. for (;;) {
  1670. l = s.length;
  1671. moved = false;
  1672. // start the loop after items that are already sorted
  1673. for (j = p; j < l; j++) {
  1674. // check the next module on the list to see if its
  1675. // dependencies have been met
  1676. a = s[j];
  1677. // check everything below current item and move if we
  1678. // find a requirement for the current item
  1679. for (k = j + 1; k < l; k++) {
  1680. doneKey = a + s[k];
  1681. if (!done[doneKey] && this._requires(a, s[k])) {
  1682. // extract the dependency so we can move it up
  1683. b = s.splice(k, 1);
  1684. // insert the dependency above the item that
  1685. // requires it
  1686. s.splice(j, 0, b[0]);
  1687. // only swap two dependencies once to short circut
  1688. // circular dependencies
  1689. done[doneKey] = true;
  1690. // keep working
  1691. moved = true;
  1692. break;
  1693. }
  1694. }
  1695. // jump out of loop if we moved something
  1696. if (moved) {
  1697. break;
  1698. // this item is sorted, move our pointer and keep going
  1699. } else {
  1700. p++;
  1701. }
  1702. }
  1703. // when we make it here and moved is false, we are
  1704. // finished sorting
  1705. if (!moved) {
  1706. break;
  1707. }
  1708. }
  1709. this.sorted = s;
  1710. },
  1711. /**
  1712. * (Unimplemented)
  1713. * @method partial
  1714. * @unimplemented
  1715. */
  1716. partial: function(partial, o, type) {
  1717. this.sorted = partial;
  1718. this.insert(o, type, true);
  1719. },
  1720. /**
  1721. * Handles the actual insertion of script/link tags
  1722. * @method _insert
  1723. * @param {Object} source The YUI instance the request came from
  1724. * @param {Object} o The metadata to include
  1725. * @param {String} type JS or CSS
  1726. * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
  1727. */
  1728. _insert: function(source, o, type, skipcalc) {
  1729. // restore the state at the time of the request
  1730. if (source) {
  1731. this._config(source);
  1732. }
  1733. // build the dependency list
  1734. // don't include type so we can process CSS and script in
  1735. // one pass when the type is not specified.
  1736. if (!skipcalc) {
  1737. this.calculate(o);
  1738. }
  1739. this.loadType = type;
  1740. if (!type) {
  1741. var self = this;
  1742. this._internalCallback = function() {
  1743. var f = self.onCSS, n, p, sib;
  1744. // IE hack for style overrides that are not being applied
  1745. if (this.insertBefore && Y.UA.ie) {
  1746. n = Y.config.doc.getElementById(this.insertBefore);
  1747. p = n.parentNode;
  1748. sib = n.nextSibling;
  1749. p.removeChild(n);
  1750. if (sib) {
  1751. p.insertBefore(n, sib);
  1752. } else {
  1753. p.appendChild(n);
  1754. }
  1755. }
  1756. if (f) {
  1757. f.call(self.context, Y);
  1758. }
  1759. self._internalCallback = null;
  1760. self._insert(null, null, JS);
  1761. };
  1762. this._insert(null, null, CSS);
  1763. return;
  1764. }
  1765. // set a flag to indicate the load has started
  1766. this._loading = true;
  1767. // flag to indicate we are done with the combo service
  1768. // and any additional files will need to be loaded
  1769. // individually
  1770. this._combineComplete = {};
  1771. // start the load
  1772. this.loadNext();
  1773. },
  1774. /**
  1775. * Once a loader operation is completely finished, process any additional queued items.
  1776. * @method _continue
  1777. * @private
  1778. */
  1779. _continue: function() {
  1780. if (!(_queue.running) && _queue.size() > 0) {
  1781. _queue.running = true;
  1782. _queue.next()();
  1783. }
  1784. },
  1785. /**
  1786. * inserts the requested modules and their dependencies.
  1787. * <code>type</code> can be "js" or "css". Both script and
  1788. * css are inserted if type is not provided.
  1789. * @method insert
  1790. * @param {object} o optional options object.
  1791. * @param {string} type the type of dependency to insert.
  1792. */
  1793. insert: function(o, type, skipsort) {
  1794. var self = this, copy = Y.merge(this);
  1795. delete copy.require;
  1796. delete copy.dirty;
  1797. _queue.add(function() {
  1798. self._insert(copy, o, type, skipsort);
  1799. });
  1800. this._continue();
  1801. },
  1802. /**
  1803. * Executed every time a module is loaded, and if we are in a load
  1804. * cycle, we attempt to load the next script. Public so that it
  1805. * is possible to call this if using a method other than
  1806. * Y.register to determine when scripts are fully loaded
  1807. * @method loadNext
  1808. * @param {string} mname optional the name of the module that has
  1809. * been loaded (which is usually why it is time to load the next
  1810. * one).
  1811. */
  1812. loadNext: function(mname) {
  1813. // It is possible that this function is executed due to something
  1814. // else on the page loading a YUI module. Only react when we
  1815. // are actively loading something
  1816. if (!this._loading) {
  1817. return;
  1818. }
  1819. var s, len, i, m, url, fn, msg, attr, group, groupName, j, frag,
  1820. comboSource, comboSources, mods, combining, urls, comboBase,
  1821. self = this,
  1822. type = self.loadType,
  1823. handleSuccess = function(o) {
  1824. self.loadNext(o.data);
  1825. },
  1826. handleCombo = function(o) {
  1827. self._combineComplete[type] = true;
  1828. var i, len = combining.length;
  1829. for (i = 0; i < len; i++) {
  1830. self.inserted[combining[i]] = true;
  1831. }
  1832. handleSuccess(o);
  1833. };
  1834. if (self.combine && (!self._combineComplete[type])) {
  1835. combining = [];
  1836. self._combining = combining;
  1837. s = self.sorted;
  1838. len = s.length;
  1839. // the default combo base
  1840. comboBase = self.comboBase;
  1841. url = comboBase;
  1842. urls = [];
  1843. comboSources = {};
  1844. for (i = 0; i < len; i++) {
  1845. comboSource = comboBase;
  1846. m = self.getModule(s[i]);
  1847. groupName = m && m.group;
  1848. if (groupName) {
  1849. group = self.groups[groupName];
  1850. if (!group.combine) {
  1851. m.combine = false;
  1852. continue;
  1853. }
  1854. m.combine = true;
  1855. if (group.comboBase) {
  1856. comboSource = group.comboBase;
  1857. }
  1858. if ("root" in group && L.isValue(group.root)) {
  1859. m.root = group.root;
  1860. }
  1861. }
  1862. comboSources[comboSource] = comboSources[comboSource] || [];
  1863. comboSources[comboSource].push(m);
  1864. }
  1865. for (j in comboSources) {
  1866. if (comboSources.hasOwnProperty(j)) {
  1867. url = j;
  1868. mods = comboSources[j];
  1869. len = mods.length;
  1870. for (i = 0; i < len; i++) {
  1871. // m = self.getModule(s[i]);
  1872. m = mods[i];
  1873. // Do not try to combine non-yui JS unless combo def
  1874. // is found
  1875. if (m && (m.type === type) && (m.combine || !m.ext)) {
  1876. frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
  1877. frag = self._filter(frag, m.name);
  1878. if ((url !== j) && (i <= (len - 1)) &&
  1879. ((frag.length + url.length) > self.maxURLLength)) {
  1880. //Hack until this is rewritten to use an array and not string concat:
  1881. if (url.substr(url.length - 1, 1) === self.comboSep) {
  1882. url = url.substr(0, (url.length - 1));
  1883. }
  1884. urls.push(self._filter(url));
  1885. url = j;
  1886. }
  1887. url += frag;
  1888. if (i < (len - 1)) {
  1889. url += self.comboSep;
  1890. }
  1891. combining.push(m.name);
  1892. }
  1893. }
  1894. if (combining.length && (url != j)) {
  1895. //Hack until this is rewritten to use an array and not string concat:
  1896. if (url.substr(url.length - 1, 1) === self.comboSep) {
  1897. url = url.substr(0, (url.length - 1));
  1898. }
  1899. urls.push(self._filter(url));
  1900. }
  1901. }
  1902. }
  1903. if (combining.length) {
  1904. // if (m.type === CSS) {
  1905. if (type === CSS) {
  1906. fn = Y.Get.css;
  1907. attr = self.cssAttributes;
  1908. } else {
  1909. fn = Y.Get.script;
  1910. attr = self.jsAttributes;
  1911. }
  1912. fn(urls, {
  1913. data: self._loading,
  1914. onSuccess: handleCombo,
  1915. onFailure: self._onFailure,
  1916. onTimeout: self._onTimeout,
  1917. insertBefore: self.insertBefore,
  1918. charset: self.charset,
  1919. attributes: attr,
  1920. timeout: self.timeout,
  1921. autopurge: false,
  1922. context: self
  1923. });
  1924. return;
  1925. } else {
  1926. self._combineComplete[type] = true;
  1927. }
  1928. }
  1929. if (mname) {
  1930. // if the module that was just loaded isn't what we were expecting,
  1931. // continue to wait
  1932. if (mname !== self._loading) {
  1933. return;
  1934. }
  1935. // The global handler that is called when each module is loaded
  1936. // will pass that module name to this function. Storing this
  1937. // data to avoid loading the same module multiple times
  1938. // centralize this in the callback
  1939. self.inserted[mname] = true;
  1940. // self.loaded[mname] = true;
  1941. // provided = self.getProvides(mname);
  1942. // Y.mix(self.loaded, provided);
  1943. // Y.mix(self.inserted, provided);
  1944. if (self.onProgress) {
  1945. self.onProgress.call(self.context, {
  1946. name: mname,
  1947. data: self.data
  1948. });
  1949. }
  1950. }
  1951. s = self.sorted;
  1952. len = s.length;
  1953. for (i = 0; i < len; i = i + 1) {
  1954. // this.inserted keeps track of what the loader has loaded.
  1955. // move on if this item is done.
  1956. if (s[i] in self.inserted) {
  1957. continue;
  1958. }
  1959. // Because rollups will cause multiple load notifications
  1960. // from Y, loadNext may be called multiple times for
  1961. // the same module when loading a rollup. We can safely
  1962. // skip the subsequent requests
  1963. if (s[i] === self._loading) {
  1964. return;
  1965. }
  1966. // log("inserting " + s[i]);
  1967. m = self.getModule(s[i]);
  1968. if (!m) {
  1969. if (!self.skipped[s[i]]) {
  1970. msg = 'Undefined module ' + s[i] + ' skipped';
  1971. // self.inserted[s[i]] = true;
  1972. self.skipped[s[i]] = true;
  1973. }
  1974. continue;
  1975. }
  1976. group = (m.group && self.groups[m.group]) || NOT_FOUND;
  1977. // The load type is stored to offer the possibility to load
  1978. // the css separately from the script.
  1979. if (!type || type === m.type) {
  1980. self._loading = s[i];
  1981. if (m.type === CSS) {
  1982. fn = Y.Get.css;
  1983. attr = self.cssAttributes;
  1984. } else {
  1985. fn = Y.Get.script;
  1986. attr = self.jsAttributes;
  1987. }
  1988. url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
  1989. self._url(m.path, s[i], group.base || m.base);
  1990. fn(url, {
  1991. data: s[i],
  1992. onSuccess: handleSuccess,
  1993. insertBefore: self.insertBefore,
  1994. charset: self.charset,
  1995. attributes: attr,
  1996. onFailure: self._onFailure,
  1997. onTimeout: self._onTimeout,
  1998. timeout: self.timeout,
  1999. autopurge: false,
  2000. context: self
  2001. });
  2002. return;
  2003. }
  2004. }
  2005. // we are finished
  2006. self._loading = null;
  2007. fn = self._internalCallback;
  2008. // internal callback for loading css first
  2009. if (fn) {
  2010. self._internalCallback = null;
  2011. fn.call(self);
  2012. } else {
  2013. self._onSuccess();
  2014. }
  2015. },
  2016. /**
  2017. * Apply filter defined for this instance to a url/path
  2018. * @method _filter
  2019. * @param {string} u the string to filter.
  2020. * @param {string} name the name of the module, if we are processing
  2021. * a single module as opposed to a combined url.
  2022. * @return {string} the filtered string.
  2023. * @private
  2024. */
  2025. _filter: function(u, name) {
  2026. var f = this.filter,
  2027. hasFilter = name && (name in this.filters),
  2028. modFilter = hasFilter && this.filters[name],
  2029. groupName = this.moduleInfo[name] ? this.moduleInfo[name].group:null;
  2030. if (groupName && this.groups[groupName] && this.groups[groupName].filter) {
  2031. modFilter = this.groups[groupName].filter;
  2032. hasFilter = true;
  2033. };
  2034. if (u) {
  2035. if (hasFilter) {
  2036. f = (L.isString(modFilter)) ?
  2037. this.FILTER_DEFS[modFilter.toUpperCase()] || null :
  2038. modFilter;
  2039. }
  2040. if (f) {
  2041. u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
  2042. }
  2043. }
  2044. return u;
  2045. },
  2046. /**
  2047. * Generates the full url for a module
  2048. * @method _url
  2049. * @param {string} path the path fragment.
  2050. * @param {String} name The name of the module
  2051. * @pamra {String} [base=self.base] The base url to use
  2052. * @return {string} the full url.
  2053. * @private
  2054. */
  2055. _url: function(path, name, base) {
  2056. return this._filter((base || this.base || '') + path, name);
  2057. },
  2058. /**
  2059. * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
  2060. * @method resolve
  2061. * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
  2062. * @param {Array} [s=loader.sorted] An override for the loader.sorted array
  2063. * @return {Object} Object hash (js and css) of two arrays of file lists
  2064. * @example This method can be used as an off-line dep calculator
  2065. *
  2066. * var Y = YUI();
  2067. * var loader = new Y.Loader({
  2068. * filter: 'debug',
  2069. * base: '../../',
  2070. * root: 'build/',
  2071. * combine: true,
  2072. * require: ['node', 'dd', 'console']
  2073. * });
  2074. * var out = loader.resolve(true);
  2075. *
  2076. */
  2077. resolve: function(calc, s) {
  2078. var self = this, i, m, url, out = { js: [], css: [] };
  2079. if (calc) {
  2080. self.calculate();
  2081. }
  2082. s = s || self.sorted;
  2083. for (i = 0; i < s.length; i++) {
  2084. m = self.getModule(s[i]);
  2085. if (m) {
  2086. if (self.combine) {
  2087. url = self._filter((self.root + m.path), m.name, self.root);
  2088. } else {
  2089. url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
  2090. }
  2091. out[m.type].push(url);
  2092. }
  2093. }
  2094. if (self.combine) {
  2095. out.js = [self.comboBase + out.js.join(self.comboSep)];
  2096. out.css = [self.comboBase + out.css.join(self.comboSep)];
  2097. }
  2098. return out;
  2099. },
  2100. /**
  2101. * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
  2102. * @method hash
  2103. * @private
  2104. * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
  2105. * @param {Array} [s=loader.sorted] An override for the loader.sorted array
  2106. * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
  2107. * @example This method can be used as an off-line dep calculator
  2108. *
  2109. * var Y = YUI();
  2110. * var loader = new Y.Loader({
  2111. * filter: 'debug',
  2112. * base: '../../',
  2113. * root: 'build/',
  2114. * combine: true,
  2115. * require: ['node', 'dd', 'console']
  2116. * });
  2117. * var out = loader.hash(true);
  2118. *
  2119. */
  2120. hash: function(calc, s) {
  2121. var self = this, i, m, url, out = { js: {}, css: {} };
  2122. if (calc) {
  2123. self.calculate();
  2124. }
  2125. s = s || self.sorted;
  2126. for (i = 0; i < s.length; i++) {
  2127. m = self.getModule(s[i]);
  2128. if (m) {
  2129. url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
  2130. out[m.type][m.name] = url;
  2131. }
  2132. }
  2133. return out;
  2134. }
  2135. };
  2136. }, '3.4.0' ,{requires:['get']});
  2137. YUI.add('loader-rollup', function(Y) {
  2138. /**
  2139. * Optional automatic rollup logic for reducing http connections
  2140. * when not using a combo service.
  2141. * @module loader
  2142. * @submodule rollup
  2143. */
  2144. /**
  2145. * Look for rollup packages to determine if all of the modules a
  2146. * rollup supersedes are required. If so, include the rollup to
  2147. * help reduce the total number of connections required. Called
  2148. * by calculate(). This is an optional feature, and requires the
  2149. * appropriate submodule to function.
  2150. * @method _rollup
  2151. * @for Loader
  2152. * @private
  2153. */
  2154. Y.Loader.prototype._rollup = function() {
  2155. var i, j, m, s, r = this.required, roll,
  2156. info = this.moduleInfo, rolled, c, smod;
  2157. // find and cache rollup modules
  2158. if (this.dirty || !this.rollups) {
  2159. this.rollups = {};
  2160. for (i in info) {
  2161. if (info.hasOwnProperty(i)) {
  2162. m = this.getModule(i);
  2163. // if (m && m.rollup && m.supersedes) {
  2164. if (m && m.rollup) {
  2165. this.rollups[i] = m;
  2166. }
  2167. }
  2168. }
  2169. this.forceMap = (this.force) ? Y.Array.hash(this.force) : {};
  2170. }
  2171. // make as many passes as needed to pick up rollup rollups
  2172. for (;;) {
  2173. rolled = false;
  2174. // go through the rollup candidates
  2175. for (i in this.rollups) {
  2176. if (this.rollups.hasOwnProperty(i)) {
  2177. // there can be only one, unless forced
  2178. if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
  2179. m = this.getModule(i);
  2180. s = m.supersedes || [];
  2181. roll = false;
  2182. // @TODO remove continue
  2183. if (!m.rollup) {
  2184. continue;
  2185. }
  2186. c = 0;
  2187. // check the threshold
  2188. for (j = 0; j < s.length; j++) {
  2189. smod = info[s[j]];
  2190. // if the superseded module is loaded, we can't
  2191. // load the rollup unless it has been forced.
  2192. if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
  2193. roll = false;
  2194. break;
  2195. // increment the counter if this module is required.
  2196. // if we are beyond the rollup threshold, we will
  2197. // use the rollup module
  2198. } else if (r[s[j]] && m.type == smod.type) {
  2199. c++;
  2200. roll = (c >= m.rollup);
  2201. if (roll) {
  2202. break;
  2203. }
  2204. }
  2205. }
  2206. if (roll) {
  2207. // add the rollup
  2208. r[i] = true;
  2209. rolled = true;
  2210. // expand the rollup's dependencies
  2211. this.getRequires(m);
  2212. }
  2213. }
  2214. }
  2215. }
  2216. // if we made it here w/o rolling up something, we are done
  2217. if (!rolled) {
  2218. break;
  2219. }
  2220. }
  2221. };
  2222. }, '3.4.0' ,{requires:['loader-base']});
  2223. YUI.add('loader-yui3', function(Y) {
  2224. /* This file is auto-generated by src/loader/scripts/meta_join.py */
  2225. /**
  2226. * YUI 3 module metadata
  2227. * @module loader
  2228. * @submodule yui3
  2229. */
  2230. YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
  2231. "align-plugin": {
  2232. "requires": [
  2233. "node-screen",
  2234. "node-pluginhost"
  2235. ]
  2236. },
  2237. "anim": {
  2238. "use": [
  2239. "anim-base",
  2240. "anim-color",
  2241. "anim-curve",
  2242. "anim-easing",
  2243. "anim-node-plugin",
  2244. "anim-scroll",
  2245. "anim-xy"
  2246. ]
  2247. },
  2248. "anim-base": {
  2249. "requires": [
  2250. "base-base",
  2251. "node-style"
  2252. ]
  2253. },
  2254. "anim-color": {
  2255. "requires": [
  2256. "anim-base"
  2257. ]
  2258. },
  2259. "anim-curve": {
  2260. "requires": [
  2261. "anim-xy"
  2262. ]
  2263. },
  2264. "anim-easing": {
  2265. "requires": [
  2266. "anim-base"
  2267. ]
  2268. },
  2269. "anim-node-plugin": {
  2270. "requires": [
  2271. "node-pluginhost",
  2272. "anim-base"
  2273. ]
  2274. },
  2275. "anim-scroll": {
  2276. "requires": [
  2277. "anim-base"
  2278. ]
  2279. },
  2280. "anim-xy": {
  2281. "requires": [
  2282. "anim-base",
  2283. "node-screen"
  2284. ]
  2285. },
  2286. "app": {
  2287. "use": [
  2288. "controller",
  2289. "model",
  2290. "model-list",
  2291. "view"
  2292. ]
  2293. },
  2294. "array-extras": {
  2295. "requires": [
  2296. "yui-base"
  2297. ]
  2298. },
  2299. "array-invoke": {
  2300. "requires": [
  2301. "yui-base"
  2302. ]
  2303. },
  2304. "arraylist": {
  2305. "requires": [
  2306. "yui-base"
  2307. ]
  2308. },
  2309. "arraylist-add": {
  2310. "requires": [
  2311. "arraylist"
  2312. ]
  2313. },
  2314. "arraylist-filter": {
  2315. "requires": [
  2316. "arraylist"
  2317. ]
  2318. },
  2319. "arraysort": {
  2320. "requires": [
  2321. "yui-base"
  2322. ]
  2323. },
  2324. "async-queue": {
  2325. "requires": [
  2326. "event-custom"
  2327. ]
  2328. },
  2329. "attribute": {
  2330. "use": [
  2331. "attribute-base",
  2332. "attribute-complex"
  2333. ]
  2334. },
  2335. "attribute-base": {
  2336. "requires": [
  2337. "event-custom"
  2338. ]
  2339. },
  2340. "attribute-complex": {
  2341. "requires": [
  2342. "attribute-base"
  2343. ]
  2344. },
  2345. "autocomplete": {
  2346. "use": [
  2347. "autocomplete-base",
  2348. "autocomplete-sources",
  2349. "autocomplete-list",
  2350. "autocomplete-plugin"
  2351. ]
  2352. },
  2353. "autocomplete-base": {
  2354. "optional": [
  2355. "autocomplete-sources"
  2356. ],
  2357. "requires": [
  2358. "array-extras",
  2359. "base-build",
  2360. "escape",
  2361. "event-valuechange",
  2362. "node-base"
  2363. ]
  2364. },
  2365. "autocomplete-filters": {
  2366. "requires": [
  2367. "array-extras",
  2368. "text-wordbreak"
  2369. ]
  2370. },
  2371. "autocomplete-filters-accentfold": {
  2372. "requires": [
  2373. "array-extras",
  2374. "text-accentfold",
  2375. "text-wordbreak"
  2376. ]
  2377. },
  2378. "autocomplete-highlighters": {
  2379. "requires": [
  2380. "array-extras",
  2381. "highlight-base"
  2382. ]
  2383. },
  2384. "autocomplete-highlighters-accentfold": {
  2385. "requires": [
  2386. "array-extras",
  2387. "highlight-accentfold"
  2388. ]
  2389. },
  2390. "autocomplete-list": {
  2391. "after": [
  2392. "autocomplete-sources"
  2393. ],
  2394. "lang": [
  2395. "en"
  2396. ],
  2397. "requires": [
  2398. "autocomplete-base",
  2399. "event-resize",
  2400. "node-screen",
  2401. "selector-css3",
  2402. "shim-plugin",
  2403. "widget",
  2404. "widget-position",
  2405. "widget-position-align"
  2406. ],
  2407. "skinnable": true
  2408. },
  2409. "autocomplete-list-keys": {
  2410. "condition": {
  2411. "name": "autocomplete-list-keys",
  2412. "test": function (Y) {
  2413. // Only add keyboard support to autocomplete-list if this doesn't appear to
  2414. // be an iOS or Android-based mobile device.
  2415. //
  2416. // There's currently no feasible way to actually detect whether a device has
  2417. // a hardware keyboard, so this sniff will have To Do. It can easily be
  2418. // overridden by manually loading the autocomplete-list-keys module.
  2419. //
  2420. // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
  2421. // doesn't fire the keyboard events used by AutoCompleteList, so there's
  2422. // no point loading the -keys module even when a bluetooth keyboard may be
  2423. // available.
  2424. return !(Y.UA.ios || Y.UA.android);
  2425. },
  2426. "trigger": "autocomplete-list"
  2427. },
  2428. "requires": [
  2429. "autocomplete-list",
  2430. "base-build"
  2431. ]
  2432. },
  2433. "autocomplete-plugin": {
  2434. "requires": [
  2435. "autocomplete-list",
  2436. "node-pluginhost"
  2437. ]
  2438. },
  2439. "autocomplete-sources": {
  2440. "optional": [
  2441. "io-base",
  2442. "json-parse",
  2443. "jsonp",
  2444. "yql"
  2445. ],
  2446. "requires": [
  2447. "autocomplete-base"
  2448. ]
  2449. },
  2450. "base": {
  2451. "use": [
  2452. "base-base",
  2453. "base-pluginhost",
  2454. "base-build"
  2455. ]
  2456. },
  2457. "base-base": {
  2458. "after": [
  2459. "attribute-complex"
  2460. ],
  2461. "requires": [
  2462. "attribute-base"
  2463. ]
  2464. },
  2465. "base-build": {
  2466. "requires": [
  2467. "base-base"
  2468. ]
  2469. },
  2470. "base-pluginhost": {
  2471. "requires": [
  2472. "base-base",
  2473. "pluginhost"
  2474. ]
  2475. },
  2476. "cache": {
  2477. "use": [
  2478. "cache-base",
  2479. "cache-offline",
  2480. "cache-plugin"
  2481. ]
  2482. },
  2483. "cache-base": {
  2484. "requires": [
  2485. "base"
  2486. ]
  2487. },
  2488. "cache-offline": {
  2489. "requires": [
  2490. "cache-base",
  2491. "json"
  2492. ]
  2493. },
  2494. "cache-plugin": {
  2495. "requires": [
  2496. "plugin",
  2497. "cache-base"
  2498. ]
  2499. },
  2500. "calendar": {
  2501. "lang": [
  2502. "en",
  2503. "ja",
  2504. "ru"
  2505. ],
  2506. "requires": [
  2507. "calendar-base",
  2508. "calendarnavigator"
  2509. ],
  2510. "skinnable": true
  2511. },
  2512. "calendar-base": {
  2513. "lang": [
  2514. "en",
  2515. "ja",
  2516. "ru"
  2517. ],
  2518. "requires": [
  2519. "widget",
  2520. "substitute",
  2521. "datatype-date",
  2522. "datatype-date-math",
  2523. "cssgrids"
  2524. ],
  2525. "skinnable": true
  2526. },
  2527. "calendarnavigator": {
  2528. "requires": [
  2529. "plugin",
  2530. "classnamemanager",
  2531. "datatype-date",
  2532. "node",
  2533. "substitute"
  2534. ],
  2535. "skinnable": true
  2536. },
  2537. "charts": {
  2538. "requires": [
  2539. "dom",
  2540. "datatype-number",
  2541. "datatype-date",
  2542. "event-custom",
  2543. "event-mouseenter",
  2544. "widget",
  2545. "widget-position",
  2546. "widget-stack",
  2547. "graphics"
  2548. ]
  2549. },
  2550. "classnamemanager": {
  2551. "requires": [
  2552. "yui-base"
  2553. ]
  2554. },
  2555. "clickable-rail": {
  2556. "requires": [
  2557. "slider-base"
  2558. ]
  2559. },
  2560. "collection": {
  2561. "use": [
  2562. "array-extras",
  2563. "arraylist",
  2564. "arraylist-add",
  2565. "arraylist-filter",
  2566. "array-invoke"
  2567. ]
  2568. },
  2569. "console": {
  2570. "lang": [
  2571. "en",
  2572. "es",
  2573. "ja"
  2574. ],
  2575. "requires": [
  2576. "yui-log",
  2577. "widget",
  2578. "substitute"
  2579. ],
  2580. "skinnable": true
  2581. },
  2582. "console-filters": {
  2583. "requires": [
  2584. "plugin",
  2585. "console"
  2586. ],
  2587. "skinnable": true
  2588. },
  2589. "controller": {
  2590. "optional": [
  2591. "querystring-parse"
  2592. ],
  2593. "requires": [
  2594. "array-extras",
  2595. "base-build",
  2596. "history"
  2597. ]
  2598. },
  2599. "cookie": {
  2600. "requires": [
  2601. "yui-base"
  2602. ]
  2603. },
  2604. "createlink-base": {
  2605. "requires": [
  2606. "editor-base"
  2607. ]
  2608. },
  2609. "cssbase": {
  2610. "after": [
  2611. "cssreset",
  2612. "cssfonts",
  2613. "cssgrids",
  2614. "cssreset-context",
  2615. "cssfonts-context",
  2616. "cssgrids-context"
  2617. ],
  2618. "type": "css"
  2619. },
  2620. "cssbase-context": {
  2621. "after": [
  2622. "cssreset",
  2623. "cssfonts",
  2624. "cssgrids",
  2625. "cssreset-context",
  2626. "cssfonts-context",
  2627. "cssgrids-context"
  2628. ],
  2629. "type": "css"
  2630. },
  2631. "cssfonts": {
  2632. "type": "css"
  2633. },
  2634. "cssfonts-context": {
  2635. "type": "css"
  2636. },
  2637. "cssgrids": {
  2638. "optional": [
  2639. "cssreset",
  2640. "cssfonts"
  2641. ],
  2642. "type": "css"
  2643. },
  2644. "cssreset": {
  2645. "type": "css"
  2646. },
  2647. "cssreset-context": {
  2648. "type": "css"
  2649. },
  2650. "dataschema": {
  2651. "use": [
  2652. "dataschema-base",
  2653. "dataschema-json",
  2654. "dataschema-xml",
  2655. "dataschema-array",
  2656. "dataschema-text"
  2657. ]
  2658. },
  2659. "dataschema-array": {
  2660. "requires": [
  2661. "dataschema-base"
  2662. ]
  2663. },
  2664. "dataschema-base": {
  2665. "requires": [
  2666. "base"
  2667. ]
  2668. },
  2669. "dataschema-json": {
  2670. "requires": [
  2671. "dataschema-base",
  2672. "json"
  2673. ]
  2674. },
  2675. "dataschema-text": {
  2676. "requires": [
  2677. "dataschema-base"
  2678. ]
  2679. },
  2680. "dataschema-xml": {
  2681. "requires": [
  2682. "dataschema-base"
  2683. ]
  2684. },
  2685. "datasource": {
  2686. "use": [
  2687. "datasource-local",
  2688. "datasource-io",
  2689. "datasource-get",
  2690. "datasource-function",
  2691. "datasource-cache",
  2692. "datasource-jsonschema",
  2693. "datasource-xmlschema",
  2694. "datasource-arrayschema",
  2695. "datasource-textschema",
  2696. "datasource-polling"
  2697. ]
  2698. },
  2699. "datasource-arrayschema": {
  2700. "requires": [
  2701. "datasource-local",
  2702. "plugin",
  2703. "dataschema-array"
  2704. ]
  2705. },
  2706. "datasource-cache": {
  2707. "requires": [
  2708. "datasource-local",
  2709. "plugin",
  2710. "cache-base"
  2711. ]
  2712. },
  2713. "datasource-function": {
  2714. "requires": [
  2715. "datasource-local"
  2716. ]
  2717. },
  2718. "datasource-get": {
  2719. "requires": [
  2720. "datasource-local",
  2721. "get"
  2722. ]
  2723. },
  2724. "datasource-io": {
  2725. "requires": [
  2726. "datasource-local",
  2727. "io-base"
  2728. ]
  2729. },
  2730. "datasource-jsonschema": {
  2731. "requires": [
  2732. "datasource-local",
  2733. "plugin",
  2734. "dataschema-json"
  2735. ]
  2736. },
  2737. "datasource-local": {
  2738. "requires": [
  2739. "base"
  2740. ]
  2741. },
  2742. "datasource-polling": {
  2743. "requires": [
  2744. "datasource-local"
  2745. ]
  2746. },
  2747. "datasource-textschema": {
  2748. "requires": [
  2749. "datasource-local",
  2750. "plugin",
  2751. "dataschema-text"
  2752. ]
  2753. },
  2754. "datasource-xmlschema": {
  2755. "requires": [
  2756. "datasource-local",
  2757. "plugin",
  2758. "dataschema-xml"
  2759. ]
  2760. },
  2761. "datatable": {
  2762. "use": [
  2763. "datatable-base",
  2764. "datatable-datasource",
  2765. "datatable-sort",
  2766. "datatable-scroll"
  2767. ]
  2768. },
  2769. "datatable-base": {
  2770. "requires": [
  2771. "recordset-base",
  2772. "widget",
  2773. "substitute",
  2774. "event-mouseenter"
  2775. ],
  2776. "skinnable": true
  2777. },
  2778. "datatable-datasource": {
  2779. "requires": [
  2780. "datatable-base",
  2781. "plugin",
  2782. "datasource-local"
  2783. ]
  2784. },
  2785. "datatable-scroll": {
  2786. "requires": [
  2787. "datatable-base",
  2788. "plugin"
  2789. ]
  2790. },
  2791. "datatable-sort": {
  2792. "lang": [
  2793. "en"
  2794. ],
  2795. "requires": [
  2796. "datatable-base",
  2797. "plugin",
  2798. "recordset-sort"
  2799. ]
  2800. },
  2801. "datatype": {
  2802. "use": [
  2803. "datatype-number",
  2804. "datatype-date",
  2805. "datatype-xml"
  2806. ]
  2807. },
  2808. "datatype-date": {
  2809. "supersedes": [
  2810. "datatype-date-format"
  2811. ],
  2812. "use": [
  2813. "datatype-date-parse",
  2814. "datatype-date-format"
  2815. ]
  2816. },
  2817. "datatype-date-format": {
  2818. "lang": [
  2819. "ar",
  2820. "ar-JO",
  2821. "ca",
  2822. "ca-ES",
  2823. "da",
  2824. "da-DK",
  2825. "de",
  2826. "de-AT",
  2827. "de-DE",
  2828. "el",
  2829. "el-GR",
  2830. "en",
  2831. "en-AU",
  2832. "en-CA",
  2833. "en-GB",
  2834. "en-IE",
  2835. "en-IN",
  2836. "en-JO",
  2837. "en-MY",
  2838. "en-NZ",
  2839. "en-PH",
  2840. "en-SG",
  2841. "en-US",
  2842. "es",
  2843. "es-AR",
  2844. "es-BO",
  2845. "es-CL",
  2846. "es-CO",
  2847. "es-EC",
  2848. "es-ES",
  2849. "es-MX",
  2850. "es-PE",
  2851. "es-PY",
  2852. "es-US",
  2853. "es-UY",
  2854. "es-VE",
  2855. "fi",
  2856. "fi-FI",
  2857. "fr",
  2858. "fr-BE",
  2859. "fr-CA",
  2860. "fr-FR",
  2861. "hi",
  2862. "hi-IN",
  2863. "id",
  2864. "id-ID",
  2865. "it",
  2866. "it-IT",
  2867. "ja",
  2868. "ja-JP",
  2869. "ko",
  2870. "ko-KR",
  2871. "ms",
  2872. "ms-MY",
  2873. "nb",
  2874. "nb-NO",
  2875. "nl",
  2876. "nl-BE",
  2877. "nl-NL",
  2878. "pl",
  2879. "pl-PL",
  2880. "pt",
  2881. "pt-BR",
  2882. "ro",
  2883. "ro-RO",
  2884. "ru",
  2885. "ru-RU",
  2886. "sv",
  2887. "sv-SE",
  2888. "th",
  2889. "th-TH",
  2890. "tr",
  2891. "tr-TR",
  2892. "vi",
  2893. "vi-VN",
  2894. "zh-Hans",
  2895. "zh-Hans-CN",
  2896. "zh-Hant",
  2897. "zh-Hant-HK",
  2898. "zh-Hant-TW"
  2899. ]
  2900. },
  2901. "datatype-date-math": {
  2902. "requires": [
  2903. "yui-base"
  2904. ]
  2905. },
  2906. "datatype-date-parse": {},
  2907. "datatype-number": {
  2908. "use": [
  2909. "datatype-number-parse",
  2910. "datatype-number-format"
  2911. ]
  2912. },
  2913. "datatype-number-format": {},
  2914. "datatype-number-parse": {},
  2915. "datatype-xml": {
  2916. "use": [
  2917. "datatype-xml-parse",
  2918. "datatype-xml-format"
  2919. ]
  2920. },
  2921. "datatype-xml-format": {},
  2922. "datatype-xml-parse": {},
  2923. "dd": {
  2924. "use": [
  2925. "dd-ddm-base",
  2926. "dd-ddm",
  2927. "dd-ddm-drop",
  2928. "dd-drag",
  2929. "dd-proxy",
  2930. "dd-constrain",
  2931. "dd-drop",
  2932. "dd-scroll",
  2933. "dd-delegate"
  2934. ]
  2935. },
  2936. "dd-constrain": {
  2937. "requires": [
  2938. "dd-drag"
  2939. ]
  2940. },
  2941. "dd-ddm": {
  2942. "requires": [
  2943. "dd-ddm-base",
  2944. "event-resize"
  2945. ]
  2946. },
  2947. "dd-ddm-base": {
  2948. "requires": [
  2949. "node",
  2950. "base",
  2951. "yui-throttle",
  2952. "classnamemanager"
  2953. ]
  2954. },
  2955. "dd-ddm-drop": {
  2956. "requires": [
  2957. "dd-ddm"
  2958. ]
  2959. },
  2960. "dd-delegate": {
  2961. "requires": [
  2962. "dd-drag",
  2963. "dd-drop-plugin",
  2964. "event-mouseenter"
  2965. ]
  2966. },
  2967. "dd-drag": {
  2968. "requires": [
  2969. "dd-ddm-base"
  2970. ]
  2971. },
  2972. "dd-drop": {
  2973. "requires": [
  2974. "dd-drag",
  2975. "dd-ddm-drop"
  2976. ]
  2977. },
  2978. "dd-drop-plugin": {
  2979. "requires": [
  2980. "dd-drop"
  2981. ]
  2982. },
  2983. "dd-gestures": {
  2984. "condition": {
  2985. "name": "dd-gestures",
  2986. "test": function(Y) {
  2987. var UA = Y.UA;
  2988. return ((UA.mobile || UA.android || UA.ios) && UA.touch);
  2989. },
  2990. "trigger": "dd-drag"
  2991. },
  2992. "requires": [
  2993. "dd-drag",
  2994. "event-synthetic",
  2995. "event-gestures"
  2996. ]
  2997. },
  2998. "dd-plugin": {
  2999. "optional": [
  3000. "dd-constrain",
  3001. "dd-proxy"
  3002. ],
  3003. "requires": [
  3004. "dd-drag"
  3005. ]
  3006. },
  3007. "dd-proxy": {
  3008. "requires": [
  3009. "dd-drag"
  3010. ]
  3011. },
  3012. "dd-scroll": {
  3013. "requires": [
  3014. "dd-drag"
  3015. ]
  3016. },
  3017. "dial": {
  3018. "lang": [
  3019. "en",
  3020. "es"
  3021. ],
  3022. "requires": [
  3023. "widget",
  3024. "dd-drag",
  3025. "substitute",
  3026. "event-mouseenter",
  3027. "event-move",
  3028. "event-key",
  3029. "transition",
  3030. "intl"
  3031. ],
  3032. "skinnable": true
  3033. },
  3034. "dom": {
  3035. "use": [
  3036. "dom-base",
  3037. "dom-screen",
  3038. "dom-style",
  3039. "selector-native",
  3040. "selector"
  3041. ]
  3042. },
  3043. "dom-base": {
  3044. "requires": [
  3045. "dom-core"
  3046. ]
  3047. },
  3048. "dom-core": {
  3049. "requires": [
  3050. "oop",
  3051. "features"
  3052. ]
  3053. },
  3054. "dom-deprecated": {
  3055. "requires": [
  3056. "dom-base"
  3057. ]
  3058. },
  3059. "dom-screen": {
  3060. "requires": [
  3061. "dom-base",
  3062. "dom-style"
  3063. ]
  3064. },
  3065. "dom-style": {
  3066. "requires": [
  3067. "dom-base"
  3068. ]
  3069. },
  3070. "dom-style-ie": {
  3071. "condition": {
  3072. "name": "dom-style-ie",
  3073. "test": function (Y) {
  3074. var testFeature = Y.Features.test,
  3075. addFeature = Y.Features.add,
  3076. WINDOW = Y.config.win,
  3077. DOCUMENT = Y.config.doc,
  3078. DOCUMENT_ELEMENT = 'documentElement',
  3079. ret = false;
  3080. addFeature('style', 'computedStyle', {
  3081. test: function() {
  3082. return WINDOW && 'getComputedStyle' in WINDOW;
  3083. }
  3084. });
  3085. addFeature('style', 'opacity', {
  3086. test: function() {
  3087. return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
  3088. }
  3089. });
  3090. ret = (!testFeature('style', 'opacity') &&
  3091. !testFeature('style', 'computedStyle'));
  3092. return ret;
  3093. },
  3094. "trigger": "dom-style"
  3095. },
  3096. "requires": [
  3097. "dom-style"
  3098. ]
  3099. },
  3100. "dump": {
  3101. "requires": [
  3102. "yui-base"
  3103. ]
  3104. },
  3105. "editor": {
  3106. "use": [
  3107. "frame",
  3108. "selection",
  3109. "exec-command",
  3110. "editor-base",
  3111. "editor-para",
  3112. "editor-br",
  3113. "editor-bidi",
  3114. "editor-tab",
  3115. "createlink-base"
  3116. ]
  3117. },
  3118. "editor-base": {
  3119. "requires": [
  3120. "base",
  3121. "frame",
  3122. "node",
  3123. "exec-command",
  3124. "selection"
  3125. ]
  3126. },
  3127. "editor-bidi": {
  3128. "requires": [
  3129. "editor-base"
  3130. ]
  3131. },
  3132. "editor-br": {
  3133. "requires": [
  3134. "editor-base"
  3135. ]
  3136. },
  3137. "editor-lists": {
  3138. "requires": [
  3139. "editor-base"
  3140. ]
  3141. },
  3142. "editor-para": {
  3143. "requires": [
  3144. "editor-base"
  3145. ]
  3146. },
  3147. "editor-tab": {
  3148. "requires": [
  3149. "editor-base"
  3150. ]
  3151. },
  3152. "escape": {
  3153. "requires": [
  3154. "yui-base"
  3155. ]
  3156. },
  3157. "event": {
  3158. "after": [
  3159. "node-base"
  3160. ],
  3161. "use": [
  3162. "event-base",
  3163. "event-delegate",
  3164. "event-synthetic",
  3165. "event-mousewheel",
  3166. "event-mouseenter",
  3167. "event-key",
  3168. "event-focus",
  3169. "event-resize",
  3170. "event-hover",
  3171. "event-outside"
  3172. ]
  3173. },
  3174. "event-base": {
  3175. "after": [
  3176. "node-base"
  3177. ],
  3178. "requires": [
  3179. "event-custom-base"
  3180. ]
  3181. },
  3182. "event-base-ie": {
  3183. "after": [
  3184. "event-base"
  3185. ],
  3186. "condition": {
  3187. "name": "event-base-ie",
  3188. "test": function(Y) {
  3189. var imp = Y.config.doc && Y.config.doc.implementation;
  3190. return (imp && (!imp.hasFeature('Events', '2.0')));
  3191. },
  3192. "trigger": "node-base"
  3193. },
  3194. "requires": [
  3195. "node-base"
  3196. ]
  3197. },
  3198. "event-custom": {
  3199. "use": [
  3200. "event-custom-base",
  3201. "event-custom-complex"
  3202. ]
  3203. },
  3204. "event-custom-base": {
  3205. "requires": [
  3206. "oop"
  3207. ]
  3208. },
  3209. "event-custom-complex": {
  3210. "requires": [
  3211. "event-custom-base"
  3212. ]
  3213. },
  3214. "event-delegate": {
  3215. "requires": [
  3216. "node-base"
  3217. ]
  3218. },
  3219. "event-flick": {
  3220. "requires": [
  3221. "node-base",
  3222. "event-touch",
  3223. "event-synthetic"
  3224. ]
  3225. },
  3226. "event-focus": {
  3227. "requires": [
  3228. "event-synthetic"
  3229. ]
  3230. },
  3231. "event-gestures": {
  3232. "use": [
  3233. "event-flick",
  3234. "event-move"
  3235. ]
  3236. },
  3237. "event-hover": {
  3238. "requires": [
  3239. "event-mouseenter"
  3240. ]
  3241. },
  3242. "event-key": {
  3243. "requires": [
  3244. "event-synthetic"
  3245. ]
  3246. },
  3247. "event-mouseenter": {
  3248. "requires": [
  3249. "event-synthetic"
  3250. ]
  3251. },
  3252. "event-mousewheel": {
  3253. "requires": [
  3254. "node-base"
  3255. ]
  3256. },
  3257. "event-move": {
  3258. "requires": [
  3259. "node-base",
  3260. "event-touch",
  3261. "event-synthetic"
  3262. ]
  3263. },
  3264. "event-outside": {
  3265. "requires": [
  3266. "event-synthetic"
  3267. ]
  3268. },
  3269. "event-resize": {
  3270. "requires": [
  3271. "node-base",
  3272. "event-synthetic"
  3273. ]
  3274. },
  3275. "event-simulate": {
  3276. "requires": [
  3277. "event-base"
  3278. ]
  3279. },
  3280. "event-synthetic": {
  3281. "requires": [
  3282. "node-base",
  3283. "event-custom-complex"
  3284. ]
  3285. },
  3286. "event-touch": {
  3287. "requires": [
  3288. "node-base"
  3289. ]
  3290. },
  3291. "event-valuechange": {
  3292. "requires": [
  3293. "event-focus",
  3294. "event-synthetic"
  3295. ]
  3296. },
  3297. "exec-command": {
  3298. "requires": [
  3299. "frame"
  3300. ]
  3301. },
  3302. "features": {
  3303. "requires": [
  3304. "yui-base"
  3305. ]
  3306. },
  3307. "frame": {
  3308. "requires": [
  3309. "base",
  3310. "node",
  3311. "selector-css3",
  3312. "substitute",
  3313. "yui-throttle"
  3314. ]
  3315. },
  3316. "get": {
  3317. "requires": [
  3318. "yui-base"
  3319. ]
  3320. },
  3321. "graphics": {
  3322. "requires": [
  3323. "node",
  3324. "event-custom",
  3325. "pluginhost"
  3326. ]
  3327. },
  3328. "graphics-canvas": {
  3329. "condition": {
  3330. "name": "graphics-canvas",
  3331. "test": function(Y) {
  3332. var DOCUMENT = Y.config.doc,
  3333. canvas = DOCUMENT && DOCUMENT.createElement("canvas");
  3334. return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
  3335. },
  3336. "trigger": "graphics"
  3337. },
  3338. "requires": [
  3339. "graphics"
  3340. ]
  3341. },
  3342. "graphics-canvas-default": {
  3343. "condition": {
  3344. "name": "graphics-canvas-default",
  3345. "test": function(Y) {
  3346. var DOCUMENT = Y.config.doc,
  3347. canvas = DOCUMENT && DOCUMENT.createElement("canvas");
  3348. return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
  3349. },
  3350. "trigger": "graphics"
  3351. }
  3352. },
  3353. "graphics-svg": {
  3354. "condition": {
  3355. "name": "graphics-svg",
  3356. "test": function(Y) {
  3357. var DOCUMENT = Y.config.doc;
  3358. return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
  3359. },
  3360. "trigger": "graphics"
  3361. },
  3362. "requires": [
  3363. "graphics"
  3364. ]
  3365. },
  3366. "graphics-svg-default": {
  3367. "condition": {
  3368. "name": "graphics-svg-default",
  3369. "test": function(Y) {
  3370. var DOCUMENT = Y.config.doc;
  3371. return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
  3372. },
  3373. "trigger": "graphics"
  3374. }
  3375. },
  3376. "graphics-vml": {
  3377. "condition": {
  3378. "name": "graphics-vml",
  3379. "test": function(Y) {
  3380. var DOCUMENT = Y.config.doc,
  3381. canvas = DOCUMENT && DOCUMENT.createElement("canvas");
  3382. return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
  3383. },
  3384. "trigger": "graphics"
  3385. },
  3386. "requires": [
  3387. "graphics"
  3388. ]
  3389. },
  3390. "graphics-vml-default": {
  3391. "condition": {
  3392. "name": "graphics-vml-default",
  3393. "test": function(Y) {
  3394. var DOCUMENT = Y.config.doc,
  3395. canvas = DOCUMENT && DOCUMENT.createElement("canvas");
  3396. return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
  3397. },
  3398. "trigger": "graphics"
  3399. }
  3400. },
  3401. "highlight": {
  3402. "use": [
  3403. "highlight-base",
  3404. "highlight-accentfold"
  3405. ]
  3406. },
  3407. "highlight-accentfold": {
  3408. "requires": [
  3409. "highlight-base",
  3410. "text-accentfold"
  3411. ]
  3412. },
  3413. "highlight-base": {
  3414. "requires": [
  3415. "array-extras",
  3416. "classnamemanager",
  3417. "escape",
  3418. "text-wordbreak"
  3419. ]
  3420. },
  3421. "history": {
  3422. "use": [
  3423. "history-base",
  3424. "history-hash",
  3425. "history-hash-ie",
  3426. "history-html5"
  3427. ]
  3428. },
  3429. "history-base": {
  3430. "requires": [
  3431. "event-custom-complex"
  3432. ]
  3433. },
  3434. "history-hash": {
  3435. "after": [
  3436. "history-html5"
  3437. ],
  3438. "requires": [
  3439. "event-synthetic",
  3440. "history-base",
  3441. "yui-later"
  3442. ]
  3443. },
  3444. "history-hash-ie": {
  3445. "condition": {
  3446. "name": "history-hash-ie",
  3447. "test": function (Y) {
  3448. var docMode = Y.config.doc && Y.config.doc.documentMode;
  3449. return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
  3450. !docMode || docMode < 8);
  3451. },
  3452. "trigger": "history-hash"
  3453. },
  3454. "requires": [
  3455. "history-hash",
  3456. "node-base"
  3457. ]
  3458. },
  3459. "history-html5": {
  3460. "optional": [
  3461. "json"
  3462. ],
  3463. "requires": [
  3464. "event-base",
  3465. "history-base",
  3466. "node-base"
  3467. ]
  3468. },
  3469. "imageloader": {
  3470. "requires": [
  3471. "base-base",
  3472. "node-style",
  3473. "node-screen"
  3474. ]
  3475. },
  3476. "intl": {
  3477. "requires": [
  3478. "intl-base",
  3479. "event-custom"
  3480. ]
  3481. },
  3482. "intl-base": {
  3483. "requires": [
  3484. "yui-base"
  3485. ]
  3486. },
  3487. "io": {
  3488. "use": [
  3489. "io-base",
  3490. "io-xdr",
  3491. "io-form",
  3492. "io-upload-iframe",
  3493. "io-queue"
  3494. ]
  3495. },
  3496. "io-base": {
  3497. "requires": [
  3498. "event-custom-base",
  3499. "querystring-stringify-simple"
  3500. ]
  3501. },
  3502. "io-form": {
  3503. "requires": [
  3504. "io-base",
  3505. "node-base"
  3506. ]
  3507. },
  3508. "io-queue": {
  3509. "requires": [
  3510. "io-base",
  3511. "queue-promote"
  3512. ]
  3513. },
  3514. "io-upload-iframe": {
  3515. "requires": [
  3516. "io-base",
  3517. "node-base"
  3518. ]
  3519. },
  3520. "io-xdr": {
  3521. "requires": [
  3522. "io-base",
  3523. "datatype-xml-parse"
  3524. ]
  3525. },
  3526. "json": {
  3527. "use": [
  3528. "json-parse",
  3529. "json-stringify"
  3530. ]
  3531. },
  3532. "json-parse": {
  3533. "requires": [
  3534. "yui-base"
  3535. ]
  3536. },
  3537. "json-stringify": {
  3538. "requires": [
  3539. "yui-base"
  3540. ]
  3541. },
  3542. "jsonp": {
  3543. "requires": [
  3544. "get",
  3545. "oop"
  3546. ]
  3547. },
  3548. "jsonp-url": {
  3549. "requires": [
  3550. "jsonp"
  3551. ]
  3552. },
  3553. "loader": {
  3554. "use": [
  3555. "loader-base",
  3556. "loader-rollup",
  3557. "loader-yui3"
  3558. ]
  3559. },
  3560. "loader-base": {
  3561. "requires": [
  3562. "get"
  3563. ]
  3564. },
  3565. "loader-rollup": {
  3566. "requires": [
  3567. "loader-base"
  3568. ]
  3569. },
  3570. "loader-yui3": {
  3571. "requires": [
  3572. "loader-base"
  3573. ]
  3574. },
  3575. "model": {
  3576. "requires": [
  3577. "base-build",
  3578. "escape",
  3579. "json-parse"
  3580. ]
  3581. },
  3582. "model-list": {
  3583. "requires": [
  3584. "array-extras",
  3585. "array-invoke",
  3586. "arraylist",
  3587. "base-build",
  3588. "escape",
  3589. "json-parse",
  3590. "model"
  3591. ]
  3592. },
  3593. "node": {
  3594. "use": [
  3595. "node-base",
  3596. "node-event-delegate",
  3597. "node-pluginhost",
  3598. "node-screen",
  3599. "node-style"
  3600. ]
  3601. },
  3602. "node-base": {
  3603. "requires": [
  3604. "event-base",
  3605. "node-core",
  3606. "dom-base"
  3607. ]
  3608. },
  3609. "node-core": {
  3610. "requires": [
  3611. "dom-core",
  3612. "selector"
  3613. ]
  3614. },
  3615. "node-deprecated": {
  3616. "requires": [
  3617. "node-base"
  3618. ]
  3619. },
  3620. "node-event-delegate": {
  3621. "requires": [
  3622. "node-base",
  3623. "event-delegate"
  3624. ]
  3625. },
  3626. "node-event-html5": {
  3627. "requires": [
  3628. "node-base"
  3629. ]
  3630. },
  3631. "node-event-simulate": {
  3632. "requires": [
  3633. "node-base",
  3634. "event-simulate"
  3635. ]
  3636. },
  3637. "node-flick": {
  3638. "requires": [
  3639. "classnamemanager",
  3640. "transition",
  3641. "event-flick",
  3642. "plugin"
  3643. ],
  3644. "skinnable": true
  3645. },
  3646. "node-focusmanager": {
  3647. "requires": [
  3648. "attribute",
  3649. "node",
  3650. "plugin",
  3651. "node-event-simulate",
  3652. "event-key",
  3653. "event-focus"
  3654. ]
  3655. },
  3656. "node-load": {
  3657. "requires": [
  3658. "node-base",
  3659. "io-base"
  3660. ]
  3661. },
  3662. "node-menunav": {
  3663. "requires": [
  3664. "node",
  3665. "classnamemanager",
  3666. "plugin",
  3667. "node-focusmanager"
  3668. ],
  3669. "skinnable": true
  3670. },
  3671. "node-pluginhost": {
  3672. "requires": [
  3673. "node-base",
  3674. "pluginhost"
  3675. ]
  3676. },
  3677. "node-screen": {
  3678. "requires": [
  3679. "dom-screen",
  3680. "node-base"
  3681. ]
  3682. },
  3683. "node-style": {
  3684. "requires": [
  3685. "dom-style",
  3686. "node-base"
  3687. ]
  3688. },
  3689. "oop": {
  3690. "requires": [
  3691. "yui-base"
  3692. ]
  3693. },
  3694. "overlay": {
  3695. "requires": [
  3696. "widget",
  3697. "widget-stdmod",
  3698. "widget-position",
  3699. "widget-position-align",
  3700. "widget-stack",
  3701. "widget-position-constrain"
  3702. ],
  3703. "skinnable": true
  3704. },
  3705. "panel": {
  3706. "requires": [
  3707. "widget",
  3708. "widget-stdmod",
  3709. "widget-position",
  3710. "widget-position-align",
  3711. "widget-stack",
  3712. "widget-position-constrain",
  3713. "widget-modality",
  3714. "widget-autohide",
  3715. "widget-buttons"
  3716. ],
  3717. "skinnable": true
  3718. },
  3719. "plugin": {
  3720. "requires": [
  3721. "base-base"
  3722. ]
  3723. },
  3724. "pluginhost": {
  3725. "use": [
  3726. "pluginhost-base",
  3727. "pluginhost-config"
  3728. ]
  3729. },
  3730. "pluginhost-base": {
  3731. "requires": [
  3732. "yui-base"
  3733. ]
  3734. },
  3735. "pluginhost-config": {
  3736. "requires": [
  3737. "pluginhost-base"
  3738. ]
  3739. },
  3740. "profiler": {
  3741. "requires": [
  3742. "yui-base"
  3743. ]
  3744. },
  3745. "querystring": {
  3746. "use": [
  3747. "querystring-parse",
  3748. "querystring-stringify"
  3749. ]
  3750. },
  3751. "querystring-parse": {
  3752. "requires": [
  3753. "yui-base",
  3754. "array-extras"
  3755. ]
  3756. },
  3757. "querystring-parse-simple": {
  3758. "requires": [
  3759. "yui-base"
  3760. ]
  3761. },
  3762. "querystring-stringify": {
  3763. "requires": [
  3764. "yui-base"
  3765. ]
  3766. },
  3767. "querystring-stringify-simple": {
  3768. "requires": [
  3769. "yui-base"
  3770. ]
  3771. },
  3772. "queue-promote": {
  3773. "requires": [
  3774. "yui-base"
  3775. ]
  3776. },
  3777. "range-slider": {
  3778. "requires": [
  3779. "slider-base",
  3780. "slider-value-range",
  3781. "clickable-rail"
  3782. ]
  3783. },
  3784. "recordset": {
  3785. "use": [
  3786. "recordset-base",
  3787. "recordset-sort",
  3788. "recordset-filter",
  3789. "recordset-indexer"
  3790. ]
  3791. },
  3792. "recordset-base": {
  3793. "requires": [
  3794. "base",
  3795. "arraylist"
  3796. ]
  3797. },
  3798. "recordset-filter": {
  3799. "requires": [
  3800. "recordset-base",
  3801. "array-extras",
  3802. "plugin"
  3803. ]
  3804. },
  3805. "recordset-indexer": {
  3806. "requires": [
  3807. "recordset-base",
  3808. "plugin"
  3809. ]
  3810. },
  3811. "recordset-sort": {
  3812. "requires": [
  3813. "arraysort",
  3814. "recordset-base",
  3815. "plugin"
  3816. ]
  3817. },
  3818. "resize": {
  3819. "use": [
  3820. "resize-base",
  3821. "resize-proxy",
  3822. "resize-constrain"
  3823. ]
  3824. },
  3825. "resize-base": {
  3826. "requires": [
  3827. "base",
  3828. "widget",
  3829. "substitute",
  3830. "event",
  3831. "oop",
  3832. "dd-drag",
  3833. "dd-delegate",
  3834. "dd-drop"
  3835. ],
  3836. "skinnable": true
  3837. },
  3838. "resize-constrain": {
  3839. "requires": [
  3840. "plugin",
  3841. "resize-base"
  3842. ]
  3843. },
  3844. "resize-plugin": {
  3845. "optional": [
  3846. "resize-constrain"
  3847. ],
  3848. "requires": [
  3849. "resize-base",
  3850. "plugin"
  3851. ]
  3852. },
  3853. "resize-proxy": {
  3854. "requires": [
  3855. "plugin",
  3856. "resize-base"
  3857. ]
  3858. },
  3859. "rls": {
  3860. "requires": [
  3861. "get",
  3862. "features"
  3863. ]
  3864. },
  3865. "scrollview": {
  3866. "requires": [
  3867. "scrollview-base",
  3868. "scrollview-scrollbars"
  3869. ]
  3870. },
  3871. "scrollview-base": {
  3872. "requires": [
  3873. "widget",
  3874. "event-gestures",
  3875. "transition"
  3876. ],
  3877. "skinnable": true
  3878. },
  3879. "scrollview-base-ie": {
  3880. "condition": {
  3881. "name": "scrollview-base-ie",
  3882. "trigger": "scrollview-base",
  3883. "ua": "ie"
  3884. },
  3885. "requires": [
  3886. "scrollview-base"
  3887. ]
  3888. },
  3889. "scrollview-list": {
  3890. "requires": [
  3891. "plugin",
  3892. "classnamemanager"
  3893. ],
  3894. "skinnable": true
  3895. },
  3896. "scrollview-paginator": {
  3897. "requires": [
  3898. "plugin"
  3899. ]
  3900. },
  3901. "scrollview-scrollbars": {
  3902. "requires": [
  3903. "classnamemanager",
  3904. "transition",
  3905. "plugin"
  3906. ],
  3907. "skinnable": true
  3908. },
  3909. "selection": {
  3910. "requires": [
  3911. "node"
  3912. ]
  3913. },
  3914. "selector": {
  3915. "requires": [
  3916. "selector-native"
  3917. ]
  3918. },
  3919. "selector-css2": {
  3920. "condition": {
  3921. "name": "selector-css2",
  3922. "test": function (Y) {
  3923. var DOCUMENT = Y.config.doc,
  3924. ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
  3925. return ret;
  3926. },
  3927. "trigger": "selector"
  3928. },
  3929. "requires": [
  3930. "selector-native"
  3931. ]
  3932. },
  3933. "selector-css3": {
  3934. "requires": [
  3935. "selector-native",
  3936. "selector-css2"
  3937. ]
  3938. },
  3939. "selector-native": {
  3940. "requires": [
  3941. "dom-base"
  3942. ]
  3943. },
  3944. "shim-plugin": {
  3945. "requires": [
  3946. "node-style",
  3947. "node-pluginhost"
  3948. ]
  3949. },
  3950. "slider": {
  3951. "use": [
  3952. "slider-base",
  3953. "slider-value-range",
  3954. "clickable-rail",
  3955. "range-slider"
  3956. ]
  3957. },
  3958. "slider-base": {
  3959. "requires": [
  3960. "widget",
  3961. "dd-constrain",
  3962. "substitute"
  3963. ],
  3964. "skinnable": true
  3965. },
  3966. "slider-value-range": {
  3967. "requires": [
  3968. "slider-base"
  3969. ]
  3970. },
  3971. "sortable": {
  3972. "requires": [
  3973. "dd-delegate",
  3974. "dd-drop-plugin",
  3975. "dd-proxy"
  3976. ]
  3977. },
  3978. "sortable-scroll": {
  3979. "requires": [
  3980. "dd-scroll",
  3981. "sortable"
  3982. ]
  3983. },
  3984. "stylesheet": {
  3985. "requires": [
  3986. "yui-base"
  3987. ]
  3988. },
  3989. "substitute": {
  3990. "optional": [
  3991. "dump"
  3992. ],
  3993. "requires": [
  3994. "yui-base"
  3995. ]
  3996. },
  3997. "swf": {
  3998. "requires": [
  3999. "event-custom",
  4000. "node",
  4001. "swfdetect",
  4002. "escape"
  4003. ]
  4004. },
  4005. "swfdetect": {
  4006. "requires": [
  4007. "yui-base"
  4008. ]
  4009. },
  4010. "tabview": {
  4011. "requires": [
  4012. "widget",
  4013. "widget-parent",
  4014. "widget-child",
  4015. "tabview-base",
  4016. "node-pluginhost",
  4017. "node-focusmanager"
  4018. ],
  4019. "skinnable": true
  4020. },
  4021. "tabview-base": {
  4022. "requires": [
  4023. "node-event-delegate",
  4024. "classnamemanager",
  4025. "skin-sam-tabview"
  4026. ]
  4027. },
  4028. "tabview-plugin": {
  4029. "requires": [
  4030. "tabview-base"
  4031. ]
  4032. },
  4033. "test": {
  4034. "requires": [
  4035. "event-simulate",
  4036. "event-custom",
  4037. "substitute",
  4038. "json-stringify"
  4039. ],
  4040. "skinnable": true
  4041. },
  4042. "text": {
  4043. "use": [
  4044. "text-accentfold",
  4045. "text-wordbreak"
  4046. ]
  4047. },
  4048. "text-accentfold": {
  4049. "requires": [
  4050. "array-extras",
  4051. "text-data-accentfold"
  4052. ]
  4053. },
  4054. "text-data-accentfold": {
  4055. "requires": [
  4056. "yui-base"
  4057. ]
  4058. },
  4059. "text-data-wordbreak": {
  4060. "requires": [
  4061. "yui-base"
  4062. ]
  4063. },
  4064. "text-wordbreak": {
  4065. "requires": [
  4066. "array-extras",
  4067. "text-data-wordbreak"
  4068. ]
  4069. },
  4070. "transition": {
  4071. "requires": [
  4072. "node-style"
  4073. ]
  4074. },
  4075. "transition-timer": {
  4076. "condition": {
  4077. "name": "transition-timer",
  4078. "test": function (Y) {
  4079. var DOCUMENT = Y.config.doc,
  4080. node = (DOCUMENT) ? DOCUMENT.documentElement: null,
  4081. ret = true;
  4082. if (node && node.style) {
  4083. ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
  4084. }
  4085. return ret;
  4086. },
  4087. "trigger": "transition"
  4088. },
  4089. "requires": [
  4090. "transition"
  4091. ]
  4092. },
  4093. "uploader": {
  4094. "requires": [
  4095. "event-custom",
  4096. "node",
  4097. "base",
  4098. "swf"
  4099. ]
  4100. },
  4101. "view": {
  4102. "requires": [
  4103. "base-build",
  4104. "node-event-delegate"
  4105. ]
  4106. },
  4107. "widget": {
  4108. "use": [
  4109. "widget-base",
  4110. "widget-htmlparser",
  4111. "widget-uievents",
  4112. "widget-skin"
  4113. ]
  4114. },
  4115. "widget-anim": {
  4116. "requires": [
  4117. "plugin",
  4118. "anim-base",
  4119. "widget"
  4120. ]
  4121. },
  4122. "widget-autohide": {
  4123. "requires": [
  4124. "widget",
  4125. "event-outside",
  4126. "base-build",
  4127. "event-key"
  4128. ],
  4129. "skinnable": false
  4130. },
  4131. "widget-base": {
  4132. "requires": [
  4133. "attribute",
  4134. "event-focus",
  4135. "base-base",
  4136. "base-pluginhost",
  4137. "node-base",
  4138. "node-style",
  4139. "classnamemanager"
  4140. ],
  4141. "skinnable": true
  4142. },
  4143. "widget-base-ie": {
  4144. "condition": {
  4145. "name": "widget-base-ie",
  4146. "trigger": "widget-base",
  4147. "ua": "ie"
  4148. },
  4149. "requires": [
  4150. "widget-base"
  4151. ]
  4152. },
  4153. "widget-buttons": {
  4154. "requires": [
  4155. "widget",
  4156. "base-build",
  4157. "widget-stdmod"
  4158. ],
  4159. "skinnable": true
  4160. },
  4161. "widget-child": {
  4162. "requires": [
  4163. "base-build",
  4164. "widget"
  4165. ]
  4166. },
  4167. "widget-htmlparser": {
  4168. "requires": [
  4169. "widget-base"
  4170. ]
  4171. },
  4172. "widget-locale": {
  4173. "requires": [
  4174. "widget-base"
  4175. ]
  4176. },
  4177. "widget-modality": {
  4178. "requires": [
  4179. "widget",
  4180. "event-outside",
  4181. "base-build"
  4182. ],
  4183. "skinnable": false
  4184. },
  4185. "widget-parent": {
  4186. "requires": [
  4187. "base-build",
  4188. "arraylist",
  4189. "widget"
  4190. ]
  4191. },
  4192. "widget-position": {
  4193. "requires": [
  4194. "base-build",
  4195. "node-screen",
  4196. "widget"
  4197. ]
  4198. },
  4199. "widget-position-align": {
  4200. "requires": [
  4201. "widget-position"
  4202. ]
  4203. },
  4204. "widget-position-constrain": {
  4205. "requires": [
  4206. "widget-position"
  4207. ]
  4208. },
  4209. "widget-skin": {
  4210. "requires": [
  4211. "widget-base"
  4212. ]
  4213. },
  4214. "widget-stack": {
  4215. "requires": [
  4216. "base-build",
  4217. "widget"
  4218. ],
  4219. "skinnable": true
  4220. },
  4221. "widget-stdmod": {
  4222. "requires": [
  4223. "base-build",
  4224. "widget"
  4225. ]
  4226. },
  4227. "widget-uievents": {
  4228. "requires": [
  4229. "widget-base",
  4230. "node-event-delegate"
  4231. ]
  4232. },
  4233. "yql": {
  4234. "requires": [
  4235. "jsonp",
  4236. "jsonp-url"
  4237. ]
  4238. },
  4239. "yui": {},
  4240. "yui-base": {},
  4241. "yui-later": {
  4242. "requires": [
  4243. "yui-base"
  4244. ]
  4245. },
  4246. "yui-log": {
  4247. "requires": [
  4248. "yui-base"
  4249. ]
  4250. },
  4251. "yui-rls": {},
  4252. "yui-throttle": {
  4253. "requires": [
  4254. "yui-base"
  4255. ]
  4256. }
  4257. };
  4258. YUI.Env[Y.version].md5 = '105ebffae27a0e3d7331f8cf5c0bb282';
  4259. }, '3.4.0' ,{requires:['loader-base']});
  4260. YUI.add('loader', function(Y){}, '3.4.0' ,{use:['loader-base', 'loader-rollup', 'loader-yui3' ]});