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-debug.js 125KB

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