From afb1c3017b7dc0e5ba420d59beadebeef61b035f Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Sun, 22 May 2011 14:07:26 -0700 Subject: [PATCH 01/78] build loader files + build widget-modality --- build/loader/loader-debug.js | 15 +- build/loader/loader-min.js | 4 +- build/loader/loader-yui3-debug.js | 16 +- build/loader/loader-yui3-min.js | 4 +- build/loader/loader-yui3.js | 16 +- build/loader/loader.js | 15 +- build/widget/widget-modality-debug.js | 222 ++++++++++++++++++++++++++ build/widget/widget-modality-min.js | 3 + build/widget/widget-modality.js | 222 ++++++++++++++++++++++++++ 9 files changed, 495 insertions(+), 22 deletions(-) create mode 100644 build/widget/widget-modality-debug.js create mode 100644 build/widget/widget-modality-min.js create mode 100644 build/widget/widget-modality.js diff --git a/build/loader/loader-debug.js b/build/loader/loader-debug.js index f903a892092..d957dbe897c 100644 --- a/build/loader/loader-debug.js +++ b/build/loader/loader-debug.js @@ -3373,8 +3373,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -3486,7 +3486,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -3956,6 +3956,13 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "base-build" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", @@ -4004,7 +4011,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'cd090fd665cf316d1592e62ffff68d9a'; +YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-min.js b/build/loader/loader-min.js index 811c3621004..70b481c6183 100644 --- a/build/loader/loader-min.js +++ b/build/loader/loader-min.js @@ -1,5 +1,5 @@ YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.04.13-22-38",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=(d.UA.ie)?2048:8192,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};d.Env.meta=t;d.Loader=function(y){var x=t.modules,w=this;l=t.md5;w.context=d;w.base=d.Env.meta.base;w.comboBase=d.Env.meta.comboBase;w.combine=y.base&&(y.base.indexOf(w.comboBase.substr(0,20))>-1);w.maxURLLength=m;w.root=d.Env.meta.root;w.timeout=0;w.forceMap={};w.allowRollup=true;w.filters={};w.required={};w.patterns={};w.moduleInfo={};w.groups=d.merge(d.Env.meta.groups);w.skin=d.merge(d.Env.meta.skin);w.conditions={};w.config=y;w._internal=true;o=a._renderedMods;if(o){r(o,function(A,z){w.moduleInfo[z]=d.merge(A);});o=a._conditions;r(o,function(A,z){w.conditions[z]=d.merge(A);});}else{r(x,w.addModule,w);}if(!a._renderedMods){a._renderedMods=d.merge(w.moduleInfo);a._conditions=d.merge(w.conditions);}w._inspectPage();w._internal=false;w._config(y);w.sorted=[];w.loaded=p[s];w.dirty=true;w.inserted={};w.skipped={};w.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y-1){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x0){h.running=true; h.next()();}},insert:function(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;UJ.maxURLLength)){Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+="&";}F.push(M.name);}}if(F.length&&(z!=N)){Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}}},"app":{"optional":["history"],"requires":["base-base"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}}},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":"autocomplete-sources","lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}}},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}}},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}}},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}}},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}}},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}}},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"requires":["yui-base"],"supersedes":["datatype-date-format"]},"datatype-number":{"requires":["yui-base"]},"datatype-xml":{"requires":["yui-base"]}}},"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; -YUI.Env[a.version].md5="cd090fd665cf316d1592e62ffff68d9a";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file +},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; +YUI.Env[a.version].md5="f8e9a80d9f21afabe3fa79a7e9ac2816";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3-debug.js b/build/loader/loader-yui3-debug.js index d7d5d215311..74aeb20451e 100644 --- a/build/loader/loader-yui3-debug.js +++ b/build/loader/loader-yui3-debug.js @@ -1073,8 +1073,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -1186,7 +1186,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -1656,6 +1656,13 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "base-build" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", @@ -1704,8 +1711,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'cd090fd665cf316d1592e62ffff68d9a'; - +YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-yui3-min.js b/build/loader/loader-yui3-min.js index 1fcfd784b7c..1e5f65ccc7d 100644 --- a/build/loader/loader-yui3-min.js +++ b/build/loader/loader-yui3-min.js @@ -1,3 +1,3 @@ YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}}},"app":{"optional":["history"],"requires":["base-base"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}}},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":"autocomplete-sources","lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}}},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}}},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}}},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}}},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}}},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}}},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"requires":["yui-base"],"supersedes":["datatype-date-format"]},"datatype-number":{"requires":["yui-base"]},"datatype-xml":{"requires":["yui-base"]}}},"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; -YUI.Env[a.version].md5="cd090fd665cf316d1592e62ffff68d9a";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file +},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; +YUI.Env[a.version].md5="f8e9a80d9f21afabe3fa79a7e9ac2816";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3.js b/build/loader/loader-yui3.js index d7d5d215311..74aeb20451e 100644 --- a/build/loader/loader-yui3.js +++ b/build/loader/loader-yui3.js @@ -1073,8 +1073,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -1186,7 +1186,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -1656,6 +1656,13 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "base-build" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", @@ -1704,8 +1711,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'cd090fd665cf316d1592e62ffff68d9a'; - +YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader.js b/build/loader/loader.js index 7a397e7cfaf..37b668450ab 100644 --- a/build/loader/loader.js +++ b/build/loader/loader.js @@ -3334,8 +3334,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -3447,7 +3447,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -3917,6 +3917,13 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "base-build" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", @@ -3965,7 +3972,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'cd090fd665cf316d1592e62ffff68d9a'; +YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/widget/widget-modality-debug.js b/build/widget/widget-modality-debug.js new file mode 100644 index 00000000000..6e6718ac311 --- /dev/null +++ b/build/widget/widget-modality-debug.js @@ -0,0 +1,222 @@ +YUI.add('widget-modality', function(Y) { + +var WIDGET = 'widget', + HOST = 'host', + RENDER_UI = 'renderUI', + BIND_UI = 'bindUI', + SYNC_UI = 'syncUI', + RENDERED = 'rendered', + BOUNDING_BOX = 'boundingBox', + VISIBLE = 'visible', + Z_INDEX = 'zIndex', + ALIGN = 'align', + + CHANGE = 'Change', + + isBoolean = Y.Lang.isBoolean, + getCN = Y.ClassNameManager.getClassName, + + supportsPosFixed = (function(){ + + /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ + + var isSupported = null, + el, root; + + if (document.createElement) { + el = document.createElement('div'); + if (el && el.style) { + el.style.position = 'fixed'; + el.style.top = '10px'; + root = document.body; + if (root && root.appendChild && root.removeChild) { + root.appendChild(el); + isSupported = (el.offsetTop === 10); + root.removeChild(el); + } + } + } + + return isSupported; + }()), + + WidgetModal; + +(function(){ + + var WIDGET_MODAL = 'widgetModal', + MODAL = 'modal', + MASK = 'mask', + MODAL_CLASSES = { + modal : getCN(WIDGET, MODAL), + mask : getCN(WIDGET, MASK) + }; + + WidgetModal = Y.Base.create(WIDGET_MODAL, Y.Plugin.Base, [], { + + // *** Instance Members *** // + + _maskNode : null, + _uiHandles : null, + + // *** Lifecycle Methods *** // + + initializer : function (config) { + + this.afterHostMethod(RENDER_UI, this.renderUI); + this.afterHostMethod(BIND_UI, this.bindUI); + this.afterHostMethod(SYNC_UI, this.syncUI); + + if (this.get(HOST).get(RENDERED)) { + this.renderUI(); + this.bindUI(); + this.syncUI(); + } + }, + + destructor : function () { + + if (this._maskNode) { + this._maskNode.remove(true); + } + + this._detachUIHandles(); + this.get(HOST).get(BOUNDING_BOX).removeClass(MODAL_CLASSES.modal); + }, + + renderUI : function () { + + var bb = this.get(HOST).get(BOUNDING_BOX), + bbParent = bb.get('parentNode') || Y.one('body'); + + this._maskNode = Y.Node.create('
'); + this._maskNode.addClass(MODAL_CLASSES.mask); + this._maskNode.setStyles({ + position : supportsPosFixed ? 'fixed' : 'absolute', + width : '100%', + height : '100%', + top : '0', + left : '0', + display : 'none' + }); + + bbParent.insert(this._maskNode, bbParent.get('firstChild')); + bb.addClass(MODAL_CLASSES.modal); + }, + + bindUI : function () { + + this.afterHostEvent(VISIBLE+CHANGE, this._afterHostVisibleChange); + this.afterHostEvent(Z_INDEX+CHANGE, this._afterHostZIndexChange); + }, + + syncUI : function () { + + var host = this.get(HOST); + + this._uiSetHostVisible(host.get(VISIBLE)); + this._uiSetHostZIndex(host.get(Z_INDEX)); + }, + + // *** Private Methods *** // + + _focus : function () { + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX), + oldTI = bb.get('tabIndex'); + + bb.set('tabIndex', oldTI >= 0 ? oldTI : 0); + host.focus(); + bb.set('tabIndex', oldTI); + }, + + _blur : function () { + + this.get(HOST).blur(); + }, + + _getMaskNode : function () { + + return this._maskNode; + }, + + _uiSetHostVisible : function (visible) { + + if (visible) { + Y.later(1, this, '_attachUIHandles'); + this._maskNode.setStyle('display', 'block'); + this._focus(); + } else { + this._detachUIHandles(); + this._maskNode.setStyle('display', 'none'); + this._blur(); + } + }, + + _uiSetHostZIndex : function (zIndex) { + + this._maskNode.setStyle(Z_INDEX, zIndex || 0); + }, + + _attachUIHandles : function (modal) { + + if (this._uiHandles) { return; } + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX); + + this._uiHandles = [ + //bb.on('clickoutside', Y.bind(this._focus, this)), + bb.on('focusoutside', Y.bind(this._focus, this)) + ]; + + if ( ! supportsPosFixed) { + this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ + var maskNode = this._maskNode; + maskNode.setStyle('top', maskNode.get('docScrollY')); + }, this))); + } + }, + + _detachUIHandles : function () { + + Y.each(this._uiHandles, function(h){ + h.detach(); + }); + this._uiHandles = null; + }, + + _afterHostVisibleChange : function (e) { + + this._uiSetHostVisible(e.newVal); + }, + + _afterHostZIndexChange : function (e) { + + this._uiSetHostZIndex(e.newVal); + } + + }, { + + // *** Static *** // + + NS : MODAL, + + ATTRS : { + + maskNode : { + getter : '_getMaskNode', + readOnly : true + } + + }, + + CLASSES : MODAL_CLASSES + + }); + +}()); + + +}, '@VERSION@' ,{requires:['base-build', 'widget']}); diff --git a/build/widget/widget-modality-min.js b/build/widget/widget-modality-min.js new file mode 100644 index 00000000000..b2e080d7433 --- /dev/null +++ b/build/widget/widget-modality-min.js @@ -0,0 +1,3 @@ +YUI.add("widget-modality",function(b){var i="widget",o="host",n="renderUI",j="bindUI",p="syncUI",l="rendered",m="boundingBox",k="visible",f="zIndex",g="align",h="Change",c=b.Lang.isBoolean,e=b.ClassNameManager.getClassName,a=(function(){ +/*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ +var r=null,s,q;if(document.createElement){s=document.createElement("div");if(s&&s.style){s.style.position="fixed";s.style.top="10px";q=document.body;if(q&&q.appendChild&&q.removeChild){q.appendChild(s);r=(s.offsetTop===10);q.removeChild(s);}}}return r;}()),d;(function(){var t="widgetModal",s="modal",r="mask",q={modal:e(i,s),mask:e(i,r)};d=b.Base.create(t,b.Plugin.Base,[],{_maskNode:null,_uiHandles:null,initializer:function(u){this.afterHostMethod(n,this.renderUI);this.afterHostMethod(j,this.bindUI);this.afterHostMethod(p,this.syncUI);if(this.get(o).get(l)){this.renderUI();this.bindUI();this.syncUI();}},destructor:function(){if(this._maskNode){this._maskNode.remove(true);}this._detachUIHandles();this.get(o).get(m).removeClass(q.modal);},renderUI:function(){var v=this.get(o).get(m),u=v.get("parentNode")||b.one("body");this._maskNode=b.Node.create("
");this._maskNode.addClass(q.mask);this._maskNode.setStyles({position:a?"fixed":"absolute",width:"100%",height:"100%",top:"0",left:"0",display:"none"});u.insert(this._maskNode,u.get("firstChild"));v.addClass(q.modal);},bindUI:function(){this.afterHostEvent(k+h,this._afterHostVisibleChange);this.afterHostEvent(f+h,this._afterHostZIndexChange);},syncUI:function(){var u=this.get(o);this._uiSetHostVisible(u.get(k));this._uiSetHostZIndex(u.get(f));},_focus:function(){var v=this.get(o),w=v.get(m),u=w.get("tabIndex");w.set("tabIndex",u>=0?u:0);v.focus();w.set("tabIndex",u);},_blur:function(){this.get(o).blur();},_getMaskNode:function(){return this._maskNode;},_uiSetHostVisible:function(u){if(u){b.later(1,this,"_attachUIHandles");this._maskNode.setStyle("display","block");this._focus();}else{this._detachUIHandles();this._maskNode.setStyle("display","none");this._blur();}},_uiSetHostZIndex:function(u){this._maskNode.setStyle(f,u||0);},_attachUIHandles:function(v){if(this._uiHandles){return;}var u=this.get(o),w=u.get(m);this._uiHandles=[w.on("focusoutside",b.bind(this._focus,this))];if(!a){this._uiHandles.push(b.one("win").on("scroll",b.bind(function(y){var x=this._maskNode;x.setStyle("top",x.get("docScrollY"));},this)));}},_detachUIHandles:function(){b.each(this._uiHandles,function(u){u.detach();});this._uiHandles=null;},_afterHostVisibleChange:function(u){this._uiSetHostVisible(u.newVal);},_afterHostZIndexChange:function(u){this._uiSetHostZIndex(u.newVal);}},{NS:s,ATTRS:{maskNode:{getter:"_getMaskNode",readOnly:true}},CLASSES:q});}());},"@VERSION@",{requires:["base-build","widget"]}); \ No newline at end of file diff --git a/build/widget/widget-modality.js b/build/widget/widget-modality.js new file mode 100644 index 00000000000..6e6718ac311 --- /dev/null +++ b/build/widget/widget-modality.js @@ -0,0 +1,222 @@ +YUI.add('widget-modality', function(Y) { + +var WIDGET = 'widget', + HOST = 'host', + RENDER_UI = 'renderUI', + BIND_UI = 'bindUI', + SYNC_UI = 'syncUI', + RENDERED = 'rendered', + BOUNDING_BOX = 'boundingBox', + VISIBLE = 'visible', + Z_INDEX = 'zIndex', + ALIGN = 'align', + + CHANGE = 'Change', + + isBoolean = Y.Lang.isBoolean, + getCN = Y.ClassNameManager.getClassName, + + supportsPosFixed = (function(){ + + /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ + + var isSupported = null, + el, root; + + if (document.createElement) { + el = document.createElement('div'); + if (el && el.style) { + el.style.position = 'fixed'; + el.style.top = '10px'; + root = document.body; + if (root && root.appendChild && root.removeChild) { + root.appendChild(el); + isSupported = (el.offsetTop === 10); + root.removeChild(el); + } + } + } + + return isSupported; + }()), + + WidgetModal; + +(function(){ + + var WIDGET_MODAL = 'widgetModal', + MODAL = 'modal', + MASK = 'mask', + MODAL_CLASSES = { + modal : getCN(WIDGET, MODAL), + mask : getCN(WIDGET, MASK) + }; + + WidgetModal = Y.Base.create(WIDGET_MODAL, Y.Plugin.Base, [], { + + // *** Instance Members *** // + + _maskNode : null, + _uiHandles : null, + + // *** Lifecycle Methods *** // + + initializer : function (config) { + + this.afterHostMethod(RENDER_UI, this.renderUI); + this.afterHostMethod(BIND_UI, this.bindUI); + this.afterHostMethod(SYNC_UI, this.syncUI); + + if (this.get(HOST).get(RENDERED)) { + this.renderUI(); + this.bindUI(); + this.syncUI(); + } + }, + + destructor : function () { + + if (this._maskNode) { + this._maskNode.remove(true); + } + + this._detachUIHandles(); + this.get(HOST).get(BOUNDING_BOX).removeClass(MODAL_CLASSES.modal); + }, + + renderUI : function () { + + var bb = this.get(HOST).get(BOUNDING_BOX), + bbParent = bb.get('parentNode') || Y.one('body'); + + this._maskNode = Y.Node.create('
'); + this._maskNode.addClass(MODAL_CLASSES.mask); + this._maskNode.setStyles({ + position : supportsPosFixed ? 'fixed' : 'absolute', + width : '100%', + height : '100%', + top : '0', + left : '0', + display : 'none' + }); + + bbParent.insert(this._maskNode, bbParent.get('firstChild')); + bb.addClass(MODAL_CLASSES.modal); + }, + + bindUI : function () { + + this.afterHostEvent(VISIBLE+CHANGE, this._afterHostVisibleChange); + this.afterHostEvent(Z_INDEX+CHANGE, this._afterHostZIndexChange); + }, + + syncUI : function () { + + var host = this.get(HOST); + + this._uiSetHostVisible(host.get(VISIBLE)); + this._uiSetHostZIndex(host.get(Z_INDEX)); + }, + + // *** Private Methods *** // + + _focus : function () { + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX), + oldTI = bb.get('tabIndex'); + + bb.set('tabIndex', oldTI >= 0 ? oldTI : 0); + host.focus(); + bb.set('tabIndex', oldTI); + }, + + _blur : function () { + + this.get(HOST).blur(); + }, + + _getMaskNode : function () { + + return this._maskNode; + }, + + _uiSetHostVisible : function (visible) { + + if (visible) { + Y.later(1, this, '_attachUIHandles'); + this._maskNode.setStyle('display', 'block'); + this._focus(); + } else { + this._detachUIHandles(); + this._maskNode.setStyle('display', 'none'); + this._blur(); + } + }, + + _uiSetHostZIndex : function (zIndex) { + + this._maskNode.setStyle(Z_INDEX, zIndex || 0); + }, + + _attachUIHandles : function (modal) { + + if (this._uiHandles) { return; } + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX); + + this._uiHandles = [ + //bb.on('clickoutside', Y.bind(this._focus, this)), + bb.on('focusoutside', Y.bind(this._focus, this)) + ]; + + if ( ! supportsPosFixed) { + this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ + var maskNode = this._maskNode; + maskNode.setStyle('top', maskNode.get('docScrollY')); + }, this))); + } + }, + + _detachUIHandles : function () { + + Y.each(this._uiHandles, function(h){ + h.detach(); + }); + this._uiHandles = null; + }, + + _afterHostVisibleChange : function (e) { + + this._uiSetHostVisible(e.newVal); + }, + + _afterHostZIndexChange : function (e) { + + this._uiSetHostZIndex(e.newVal); + } + + }, { + + // *** Static *** // + + NS : MODAL, + + ATTRS : { + + maskNode : { + getter : '_getMaskNode', + readOnly : true + } + + }, + + CLASSES : MODAL_CLASSES + + }); + +}()); + + +}, '@VERSION@' ,{requires:['base-build', 'widget']}); From d0546aecb66110c4b0bc1d8336b7621ed3dd9993 Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Mon, 23 May 2011 17:11:31 -0700 Subject: [PATCH 02/78] updated builds for widget-modality --- build/loader/loader-debug.js | 5 +- build/loader/loader-min.js | 4 +- build/loader/loader-yui3-debug.js | 5 +- build/loader/loader-yui3-min.js | 4 +- build/loader/loader-yui3.js | 5 +- build/loader/loader.js | 5 +- .../widget-modality/widget-modality-debug.js | 267 ++++++++++++++++++ build/widget-modality/widget-modality-min.js | 3 + build/widget-modality/widget-modality.js | 267 ++++++++++++++++++ src/loader/js/yui3.js | 16 +- src/loader/js/yui3.json | 14 +- src/widget-modality/README | 42 +++ src/widget-modality/build.properties | 18 ++ src/widget-modality/build.xml | 6 + src/widget-modality/js/Widget-Modality.js | 262 +++++++++++++++++ src/widget-modality/meta/widget-modality.json | 10 + src/widget-modality/tests/modality.html | 84 ++++++ 17 files changed, 998 insertions(+), 19 deletions(-) create mode 100644 build/widget-modality/widget-modality-debug.js create mode 100644 build/widget-modality/widget-modality-min.js create mode 100644 build/widget-modality/widget-modality.js create mode 100644 src/widget-modality/README create mode 100644 src/widget-modality/build.properties create mode 100644 src/widget-modality/build.xml create mode 100644 src/widget-modality/js/Widget-Modality.js create mode 100644 src/widget-modality/meta/widget-modality.json create mode 100644 src/widget-modality/tests/modality.html diff --git a/build/loader/loader-debug.js b/build/loader/loader-debug.js index d957dbe897c..5aa9388c149 100644 --- a/build/loader/loader-debug.js +++ b/build/loader/loader-debug.js @@ -3959,7 +3959,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-modality": { "requires": [ "widget", - "base-build" + "plugin", + "gallery-outside-events" ], "skinnable": false }, @@ -4011,7 +4012,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; +YUI.Env[Y.version].md5 = 'f1814c92a861621291f61370754f0551'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-min.js b/build/loader/loader-min.js index 70b481c6183..6cf345502a0 100644 --- a/build/loader/loader-min.js +++ b/build/loader/loader-min.js @@ -1,5 +1,5 @@ YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.04.13-22-38",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=(d.UA.ie)?2048:8192,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};d.Env.meta=t;d.Loader=function(y){var x=t.modules,w=this;l=t.md5;w.context=d;w.base=d.Env.meta.base;w.comboBase=d.Env.meta.comboBase;w.combine=y.base&&(y.base.indexOf(w.comboBase.substr(0,20))>-1);w.maxURLLength=m;w.root=d.Env.meta.root;w.timeout=0;w.forceMap={};w.allowRollup=true;w.filters={};w.required={};w.patterns={};w.moduleInfo={};w.groups=d.merge(d.Env.meta.groups);w.skin=d.merge(d.Env.meta.skin);w.conditions={};w.config=y;w._internal=true;o=a._renderedMods;if(o){r(o,function(A,z){w.moduleInfo[z]=d.merge(A);});o=a._conditions;r(o,function(A,z){w.conditions[z]=d.merge(A);});}else{r(x,w.addModule,w);}if(!a._renderedMods){a._renderedMods=d.merge(w.moduleInfo);a._conditions=d.merge(w.conditions);}w._inspectPage();w._internal=false;w._config(y);w.sorted=[];w.loaded=p[s];w.dirty=true;w.inserted={};w.skipped={};w.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y-1){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x0){h.running=true; h.next()();}},insert:function(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;UJ.maxURLLength)){Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+="&";}F.push(M.name);}}if(F.length&&(z!=N)){Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}}},"app":{"optional":["history"],"requires":["base-base"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}}},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":"autocomplete-sources","lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}}},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}}},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}}},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}}},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}}},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}}},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"requires":["yui-base"],"supersedes":["datatype-date-format"]},"datatype-number":{"requires":["yui-base"]},"datatype-xml":{"requires":["yui-base"]}}},"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; -YUI.Env[a.version].md5="f8e9a80d9f21afabe3fa79a7e9ac2816";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file +},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; +YUI.Env[a.version].md5="f1814c92a861621291f61370754f0551";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3-debug.js b/build/loader/loader-yui3-debug.js index 74aeb20451e..c853d46a6bf 100644 --- a/build/loader/loader-yui3-debug.js +++ b/build/loader/loader-yui3-debug.js @@ -1659,7 +1659,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-modality": { "requires": [ "widget", - "base-build" + "plugin", + "gallery-outside-events" ], "skinnable": false }, @@ -1711,7 +1712,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; +YUI.Env[Y.version].md5 = 'f1814c92a861621291f61370754f0551'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-yui3-min.js b/build/loader/loader-yui3-min.js index 1e5f65ccc7d..e64b8758e04 100644 --- a/build/loader/loader-yui3-min.js +++ b/build/loader/loader-yui3-min.js @@ -1,3 +1,3 @@ YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}}},"app":{"optional":["history"],"requires":["base-base"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}}},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":"autocomplete-sources","lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}}},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}}},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}}},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}}},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}}},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}}},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"requires":["yui-base"],"supersedes":["datatype-date-format"]},"datatype-number":{"requires":["yui-base"]},"datatype-xml":{"requires":["yui-base"]}}},"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; -YUI.Env[a.version].md5="f8e9a80d9f21afabe3fa79a7e9ac2816";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file +},"trigger":"dd-drag"},"requires":["dd-drag","event-move"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}}},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"requires":["oop"],"submodules":{"dom-base":{"requires":["oop","features"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-base"]}}},"dump":{"requires":["yui-base"]},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["node"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["node"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute"]},"selection":{"requires":["node"]}}},"escape":{},"event":{"after":"node-base","plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":"node-base","requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["event-synthetic"]},"event-resize":{"requires":["event-synthetic"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}}},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}}},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}}},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}}},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"after":["history-deprecated"],"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}}},"history-deprecated":{"requires":["node"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base","node-style"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}}},"json":{"submodules":{"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]}}},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}}},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}}},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}}},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}}},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"queue-run":{"path":"async-queue/async-queue-min.js","requires":["event-custom"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}}},"resize":{"submodules":{"resize-base":{"requires":["widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}}},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}}},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["substitute","node","json","event-simulate"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}}},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}}},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-throttle":{"requires":["yui-base"]}}}}; +YUI.Env[a.version].md5="f1814c92a861621291f61370754f0551";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3.js b/build/loader/loader-yui3.js index 74aeb20451e..c853d46a6bf 100644 --- a/build/loader/loader-yui3.js +++ b/build/loader/loader-yui3.js @@ -1659,7 +1659,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-modality": { "requires": [ "widget", - "base-build" + "plugin", + "gallery-outside-events" ], "skinnable": false }, @@ -1711,7 +1712,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; +YUI.Env[Y.version].md5 = 'f1814c92a861621291f61370754f0551'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader.js b/build/loader/loader.js index 37b668450ab..0f7613e9cae 100644 --- a/build/loader/loader.js +++ b/build/loader/loader.js @@ -3920,7 +3920,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-modality": { "requires": [ "widget", - "base-build" + "plugin", + "gallery-outside-events" ], "skinnable": false }, @@ -3972,7 +3973,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'f8e9a80d9f21afabe3fa79a7e9ac2816'; +YUI.Env[Y.version].md5 = 'f1814c92a861621291f61370754f0551'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/widget-modality/widget-modality-debug.js b/build/widget-modality/widget-modality-debug.js new file mode 100644 index 00000000000..8ecefc0178c --- /dev/null +++ b/build/widget-modality/widget-modality-debug.js @@ -0,0 +1,267 @@ +YUI.add('widget-modality', function(Y) { + +var WIDGET = 'widget', + HOST = 'host', + RENDER_UI = 'renderUI', + BIND_UI = 'bindUI', + SYNC_UI = 'syncUI', + RENDERED = 'rendered', + BOUNDING_BOX = 'boundingBox', + VISIBLE = 'visible', + Z_INDEX = 'zIndex', + ALIGN = 'align', + + CHANGE = 'Change', + + isBoolean = Y.Lang.isBoolean, + getCN = Y.ClassNameManager.getClassName, + + supportsPosFixed = (function(){ + + /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ + + var isSupported = null, + el, root; + + if (document.createElement) { + el = document.createElement('div'); + if (el && el.style) { + el.style.position = 'fixed'; + el.style.top = '10px'; + root = document.body; + if (root && root.appendChild && root.removeChild) { + root.appendChild(el); + isSupported = (el.offsetTop === 10); + root.removeChild(el); + } + } + } + + return isSupported; + }()), + + WidgetModal; + +(function(){ + + var WIDGET_MODAL = 'widgetModal', + MODAL = 'modal', + MASK = 'mask', + MODAL_CLASSES = { + modal : getCN(WIDGET, MODAL), + mask : getCN(WIDGET, MASK) + }; + + WidgetModal = Y.Base.create(WIDGET_MODAL, Y.Plugin.Base, [], { + + // *** Instance Members *** // + + _maskNode : null, + _uiHandles : null, + + // *** Lifecycle Methods *** // + + initializer : function (config) { + + this.afterHostMethod(RENDER_UI, this.renderUI); + this.afterHostMethod(BIND_UI, this.bindUI); + this.afterHostMethod(SYNC_UI, this.syncUI); + + if (this.get(HOST).get(RENDERED)) { + this.renderUI(); + this.bindUI(); + this.syncUI(); + } + + this.get(HOST).on('visibleChange', this._increaseZIndex); + }, + + destructor : function () { + + if (this._maskNode) { + this._maskNode.remove(true); + } + + this._detachUIHandles(); + this.get(HOST).get(BOUNDING_BOX).removeClass(MODAL_CLASSES.modal); + }, + + renderUI : function () { + + var bb = this.get(HOST).get(BOUNDING_BOX), + bbParent = bb.get('parentNode') || Y.one('body'); + + //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); + + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : '100%', + // height : '100%', + // top : '0', + // left : '0', + // display : 'none' + // }); + + // bbParent.insert(this._maskNode, bbParent.get('firstChild')); + // bb.addClass(MODAL_CLASSES.modal); + + var area = Y.one(this.get('node')); + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : area.get('offsetWidth'), + // height : area.get('offsetHeight'), + // top : area.get('top'), + // left : area.get('left'), + // display : 'none' + // }); + + //bbParent.insert(this._maskNode, bbParent.get('firstChild')); + area.addClass(MODAL_CLASSES.mask); + bb.setStyle('zIndex', area.get('zIndex')+1); + + // this.get(HOST).on('visibleChange', function(e) { + // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); + // }); + + + }, + + bindUI : function () { + + this.afterHostEvent(VISIBLE+CHANGE, this._afterHostVisibleChange); + this.afterHostEvent(Z_INDEX+CHANGE, this._afterHostZIndexChange); + }, + + syncUI : function () { + + var host = this.get(HOST); + + this._uiSetHostVisible(host.get(VISIBLE)); + this._uiSetHostZIndex(host.get(Z_INDEX)); + }, + + // *** Private Methods *** // + + + + _allowFocus: function() { + var a = ['#special']; + + for (var i = 0; i < a.length; i++){ + console.log(Y.one(a[i])); + Y.one(a[i]).setStyle('zIndex', 5000); + } + }, + + _focus : function (e) { + + if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX), + oldTI = bb.get('tabIndex'); + + bb.set('tabIndex', oldTI >= 0 ? oldTI : 0); + + host.focus(); + bb.set('tabIndex', oldTI); + }, + + _blur : function () { + + this.get(HOST).blur(); + }, + + _getMaskNode : function () { + + return this._maskNode; + }, + + _uiSetHostVisible : function (visible) { + + if (visible) { + Y.later(1, this, '_attachUIHandles'); + //this._maskNode.setStyle('display', 'block'); + this._focus(); + } else { + this._detachUIHandles(); + //this._maskNode.setStyle('display', 'none'); + this._blur(); + } + }, + + _uiSetHostZIndex : function (zIndex) { + + //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + }, + + _attachUIHandles : function (modal) { + + if (this._uiHandles) { return; } + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX); + + this._uiHandles = [ + bb.on('clickoutside', Y.bind(this._focus, this)), + bb.on('focusoutside', Y.bind(this._focus, this)), + bb.on('selectoutside', Y.bind(this._focus, this)) + ]; + + if ( ! supportsPosFixed) { + this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ + var maskNode = this._maskNode; + //maskNode.setStyle('top', maskNode.get('docScrollY')); + }, this))); + } + }, + + _detachUIHandles : function () { + + Y.each(this._uiHandles, function(h){ + h.detach(); + }); + this._uiHandles = null; + }, + + _afterHostVisibleChange : function (e) { + + this._uiSetHostVisible(e.newVal); + }, + + _afterHostZIndexChange : function (e) { + + this._uiSetHostZIndex(e.newVal); + } + + }, { + + // *** Static *** // + + NS : MODAL, + + ATTRS : { + + maskNode : { + getter : '_getMaskNode', + readOnly : true + }, + + node: { + value: undefined + } + + }, + + CLASSES : MODAL_CLASSES + + }); + Y.namespace("Plugin").Modal = WidgetModal; + +}()); + + +}, '@VERSION@' ,{requires:['widget','plugin','gallery-outside-events']}); diff --git a/build/widget-modality/widget-modality-min.js b/build/widget-modality/widget-modality-min.js new file mode 100644 index 00000000000..479c2e2e2fe --- /dev/null +++ b/build/widget-modality/widget-modality-min.js @@ -0,0 +1,3 @@ +YUI.add("widget-modality",function(b){var i="widget",o="host",n="renderUI",j="bindUI",p="syncUI",l="rendered",m="boundingBox",k="visible",f="zIndex",g="align",h="Change",c=b.Lang.isBoolean,e=b.ClassNameManager.getClassName,a=(function(){ +/*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ +var r=null,s,q;if(document.createElement){s=document.createElement("div");if(s&&s.style){s.style.position="fixed";s.style.top="10px";q=document.body;if(q&&q.appendChild&&q.removeChild){q.appendChild(s);r=(s.offsetTop===10);q.removeChild(s);}}}return r;}()),d;(function(){var t="widgetModal",s="modal",r="mask",q={modal:e(i,s),mask:e(i,r)};d=b.Base.create(t,b.Plugin.Base,[],{_maskNode:null,_uiHandles:null,initializer:function(u){this.afterHostMethod(n,this.renderUI);this.afterHostMethod(j,this.bindUI);this.afterHostMethod(p,this.syncUI);if(this.get(o).get(l)){this.renderUI();this.bindUI();this.syncUI();}this.get(o).on("visibleChange",this._increaseZIndex);},destructor:function(){if(this._maskNode){this._maskNode.remove(true);}this._detachUIHandles();this.get(o).get(m).removeClass(q.modal);},renderUI:function(){var w=this.get(o).get(m),u=w.get("parentNode")||b.one("body");var v=b.one(this.get("node"));v.addClass(q.mask);w.setStyle("zIndex",v.get("zIndex")+1);},bindUI:function(){this.afterHostEvent(k+h,this._afterHostVisibleChange);this.afterHostEvent(f+h,this._afterHostZIndexChange);},syncUI:function(){var u=this.get(o);this._uiSetHostVisible(u.get(k));this._uiSetHostZIndex(u.get(f));},_allowFocus:function(){var u=["#special"];for(var v=0;v=0?u:0);v.focus();x.set("tabIndex",u);},_blur:function(){this.get(o).blur();},_getMaskNode:function(){return this._maskNode;},_uiSetHostVisible:function(u){if(u){b.later(1,this,"_attachUIHandles");this._focus();}else{this._detachUIHandles();this._blur();}},_uiSetHostZIndex:function(u){},_attachUIHandles:function(v){if(this._uiHandles){return;}var u=this.get(o),w=u.get(m);this._uiHandles=[w.on("clickoutside",b.bind(this._focus,this)),w.on("focusoutside",b.bind(this._focus,this)),w.on("selectoutside",b.bind(this._focus,this))];if(!a){this._uiHandles.push(b.one("win").on("scroll",b.bind(function(y){var x=this._maskNode;},this)));}},_detachUIHandles:function(){b.each(this._uiHandles,function(u){u.detach();});this._uiHandles=null;},_afterHostVisibleChange:function(u){this._uiSetHostVisible(u.newVal);},_afterHostZIndexChange:function(u){this._uiSetHostZIndex(u.newVal);}},{NS:s,ATTRS:{maskNode:{getter:"_getMaskNode",readOnly:true},node:{value:undefined}},CLASSES:q});b.namespace("Plugin").Modal=d;}());},"@VERSION@",{requires:["widget","plugin","gallery-outside-events"]}); \ No newline at end of file diff --git a/build/widget-modality/widget-modality.js b/build/widget-modality/widget-modality.js new file mode 100644 index 00000000000..8ecefc0178c --- /dev/null +++ b/build/widget-modality/widget-modality.js @@ -0,0 +1,267 @@ +YUI.add('widget-modality', function(Y) { + +var WIDGET = 'widget', + HOST = 'host', + RENDER_UI = 'renderUI', + BIND_UI = 'bindUI', + SYNC_UI = 'syncUI', + RENDERED = 'rendered', + BOUNDING_BOX = 'boundingBox', + VISIBLE = 'visible', + Z_INDEX = 'zIndex', + ALIGN = 'align', + + CHANGE = 'Change', + + isBoolean = Y.Lang.isBoolean, + getCN = Y.ClassNameManager.getClassName, + + supportsPosFixed = (function(){ + + /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ + + var isSupported = null, + el, root; + + if (document.createElement) { + el = document.createElement('div'); + if (el && el.style) { + el.style.position = 'fixed'; + el.style.top = '10px'; + root = document.body; + if (root && root.appendChild && root.removeChild) { + root.appendChild(el); + isSupported = (el.offsetTop === 10); + root.removeChild(el); + } + } + } + + return isSupported; + }()), + + WidgetModal; + +(function(){ + + var WIDGET_MODAL = 'widgetModal', + MODAL = 'modal', + MASK = 'mask', + MODAL_CLASSES = { + modal : getCN(WIDGET, MODAL), + mask : getCN(WIDGET, MASK) + }; + + WidgetModal = Y.Base.create(WIDGET_MODAL, Y.Plugin.Base, [], { + + // *** Instance Members *** // + + _maskNode : null, + _uiHandles : null, + + // *** Lifecycle Methods *** // + + initializer : function (config) { + + this.afterHostMethod(RENDER_UI, this.renderUI); + this.afterHostMethod(BIND_UI, this.bindUI); + this.afterHostMethod(SYNC_UI, this.syncUI); + + if (this.get(HOST).get(RENDERED)) { + this.renderUI(); + this.bindUI(); + this.syncUI(); + } + + this.get(HOST).on('visibleChange', this._increaseZIndex); + }, + + destructor : function () { + + if (this._maskNode) { + this._maskNode.remove(true); + } + + this._detachUIHandles(); + this.get(HOST).get(BOUNDING_BOX).removeClass(MODAL_CLASSES.modal); + }, + + renderUI : function () { + + var bb = this.get(HOST).get(BOUNDING_BOX), + bbParent = bb.get('parentNode') || Y.one('body'); + + //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); + + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : '100%', + // height : '100%', + // top : '0', + // left : '0', + // display : 'none' + // }); + + // bbParent.insert(this._maskNode, bbParent.get('firstChild')); + // bb.addClass(MODAL_CLASSES.modal); + + var area = Y.one(this.get('node')); + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : area.get('offsetWidth'), + // height : area.get('offsetHeight'), + // top : area.get('top'), + // left : area.get('left'), + // display : 'none' + // }); + + //bbParent.insert(this._maskNode, bbParent.get('firstChild')); + area.addClass(MODAL_CLASSES.mask); + bb.setStyle('zIndex', area.get('zIndex')+1); + + // this.get(HOST).on('visibleChange', function(e) { + // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); + // }); + + + }, + + bindUI : function () { + + this.afterHostEvent(VISIBLE+CHANGE, this._afterHostVisibleChange); + this.afterHostEvent(Z_INDEX+CHANGE, this._afterHostZIndexChange); + }, + + syncUI : function () { + + var host = this.get(HOST); + + this._uiSetHostVisible(host.get(VISIBLE)); + this._uiSetHostZIndex(host.get(Z_INDEX)); + }, + + // *** Private Methods *** // + + + + _allowFocus: function() { + var a = ['#special']; + + for (var i = 0; i < a.length; i++){ + console.log(Y.one(a[i])); + Y.one(a[i]).setStyle('zIndex', 5000); + } + }, + + _focus : function (e) { + + if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX), + oldTI = bb.get('tabIndex'); + + bb.set('tabIndex', oldTI >= 0 ? oldTI : 0); + + host.focus(); + bb.set('tabIndex', oldTI); + }, + + _blur : function () { + + this.get(HOST).blur(); + }, + + _getMaskNode : function () { + + return this._maskNode; + }, + + _uiSetHostVisible : function (visible) { + + if (visible) { + Y.later(1, this, '_attachUIHandles'); + //this._maskNode.setStyle('display', 'block'); + this._focus(); + } else { + this._detachUIHandles(); + //this._maskNode.setStyle('display', 'none'); + this._blur(); + } + }, + + _uiSetHostZIndex : function (zIndex) { + + //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + }, + + _attachUIHandles : function (modal) { + + if (this._uiHandles) { return; } + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX); + + this._uiHandles = [ + bb.on('clickoutside', Y.bind(this._focus, this)), + bb.on('focusoutside', Y.bind(this._focus, this)), + bb.on('selectoutside', Y.bind(this._focus, this)) + ]; + + if ( ! supportsPosFixed) { + this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ + var maskNode = this._maskNode; + //maskNode.setStyle('top', maskNode.get('docScrollY')); + }, this))); + } + }, + + _detachUIHandles : function () { + + Y.each(this._uiHandles, function(h){ + h.detach(); + }); + this._uiHandles = null; + }, + + _afterHostVisibleChange : function (e) { + + this._uiSetHostVisible(e.newVal); + }, + + _afterHostZIndexChange : function (e) { + + this._uiSetHostZIndex(e.newVal); + } + + }, { + + // *** Static *** // + + NS : MODAL, + + ATTRS : { + + maskNode : { + getter : '_getMaskNode', + readOnly : true + }, + + node: { + value: undefined + } + + }, + + CLASSES : MODAL_CLASSES + + }); + Y.namespace("Plugin").Modal = WidgetModal; + +}()); + + +}, '@VERSION@' ,{requires:['widget','plugin','gallery-outside-events']}); diff --git a/src/loader/js/yui3.js b/src/loader/js/yui3.js index 6233f0897cb..8d7b824080f 100644 --- a/src/loader/js/yui3.js +++ b/src/loader/js/yui3.js @@ -1071,8 +1071,8 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -1184,7 +1184,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -1654,6 +1654,14 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "plugin", + "gallery-outside-events" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", @@ -1702,4 +1710,4 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { } } }; -YUI.Env[Y.version].md5 = 'cd090fd665cf316d1592e62ffff68d9a'; +YUI.Env[Y.version].md5 = 'f1814c92a861621291f61370754f0551'; diff --git a/src/loader/js/yui3.json b/src/loader/js/yui3.json index 0ebcede1c48..97a228cc423 100644 --- a/src/loader/js/yui3.json +++ b/src/loader/js/yui3.json @@ -1011,8 +1011,8 @@ "submodules": { "io-base": { "requires": [ - "event-custom-base", - "querystring-stringify-simple" + "event-custom-base", + "querystring-stringify-simple" ] }, "io-form": { @@ -1124,7 +1124,7 @@ "node-base": { "requires": [ "dom-base", - "selector", + "selector-css2", "event-base" ] }, @@ -1594,6 +1594,14 @@ "widget-base" ] }, + "widget-modality": { + "requires": [ + "widget", + "plugin", + "gallery-outside-events" + ], + "skinnable": false + }, "yql": { "requires": [ "jsonp", diff --git a/src/widget-modality/README b/src/widget-modality/README new file mode 100644 index 00000000000..bc18f1c63d1 --- /dev/null +++ b/src/widget-modality/README @@ -0,0 +1,42 @@ +Widget-Parent is an extension designed to be used with Base.build, to create +widget classes which can manage nested child widgets. + +For example, it could be used to create Menu widgets, which contain MenuItem +widgets, or Tree widgets, which contain TreeNode widgets. + +3.3.0 + +* Changed instanceof to Y.instanceOf, to prevent leaks in IE7 +* Renamed "type" in child configuration, to "childType", so that + children can have a "type" attribute for it's own context + (A FormElement widget for examplei, with a "type"). + + "type" is still supported but deprecated for backward compatibility, + so it's only used to define a child widget type if "childType" is not + provided. +* Fixed remove(), to actually remove child from DOM also. + +3.2.0 + +* No changes + +3.1.1 + +* No changes + +3.1.0 + +* "childAdded" event renamed to "addChild" +* "childRemoved" event renamed to "removeChild" +* Now augmented with Y.ArrayList +* "selection" attribute now returns an Y.ArrayList or Widget +* Removed "children" attribute since that functionality is provided + by Y.ArrayList + - Can retrieve # of child via the size() method + - Can iterate children via this.each() + - Can retrieve a individual child via the item() method +* add method will always return a Y.ArrayList instance for easy chaining +* removeAll method will always return a Y.ArrayList instance for easy chaining +* added selectAll() and deselectAll() methods +* widget UI will render children added/inserted children after widget is rendered +* widget UI will update when a child is removed diff --git a/src/widget-modality/build.properties b/src/widget-modality/build.properties new file mode 100644 index 00000000000..46c3683b0f4 --- /dev/null +++ b/src/widget-modality/build.properties @@ -0,0 +1,18 @@ +########################################################################## +# Common Build Properties +# +# This file contains the most common set of properties which you probably need to configure to get a build up and going +# Use it along with build.common.xml as a starting point to customize your build process. +# +# See build.example.properties and build.example.xml for the complete list of configurable variables +# +########################################################################## +builddir=../../../builder/componentbuild + +srcdir=../.. + +global.build.component=${srcdir}/build/widget-modality + +component=widget-modality +component.jsfiles=Widget-Modality.js +component.requires=widget,plugin,gallery-outside-events \ No newline at end of file diff --git a/src/widget-modality/build.xml b/src/widget-modality/build.xml new file mode 100644 index 00000000000..3050ab18d68 --- /dev/null +++ b/src/widget-modality/build.xml @@ -0,0 +1,6 @@ + + + Component Build File + + + diff --git a/src/widget-modality/js/Widget-Modality.js b/src/widget-modality/js/Widget-Modality.js new file mode 100644 index 00000000000..d683e38f6ba --- /dev/null +++ b/src/widget-modality/js/Widget-Modality.js @@ -0,0 +1,262 @@ +var WIDGET = 'widget', + HOST = 'host', + RENDER_UI = 'renderUI', + BIND_UI = 'bindUI', + SYNC_UI = 'syncUI', + RENDERED = 'rendered', + BOUNDING_BOX = 'boundingBox', + VISIBLE = 'visible', + Z_INDEX = 'zIndex', + ALIGN = 'align', + + CHANGE = 'Change', + + isBoolean = Y.Lang.isBoolean, + getCN = Y.ClassNameManager.getClassName, + + supportsPosFixed = (function(){ + + /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ + + var isSupported = null, + el, root; + + if (document.createElement) { + el = document.createElement('div'); + if (el && el.style) { + el.style.position = 'fixed'; + el.style.top = '10px'; + root = document.body; + if (root && root.appendChild && root.removeChild) { + root.appendChild(el); + isSupported = (el.offsetTop === 10); + root.removeChild(el); + } + } + } + + return isSupported; + }()), + + WidgetModal; + +(function(){ + + var WIDGET_MODAL = 'widgetModal', + MODAL = 'modal', + MASK = 'mask', + MODAL_CLASSES = { + modal : getCN(WIDGET, MODAL), + mask : getCN(WIDGET, MASK) + }; + + WidgetModal = Y.Base.create(WIDGET_MODAL, Y.Plugin.Base, [], { + + // *** Instance Members *** // + + _maskNode : null, + _uiHandles : null, + + // *** Lifecycle Methods *** // + + initializer : function (config) { + + this.afterHostMethod(RENDER_UI, this.renderUI); + this.afterHostMethod(BIND_UI, this.bindUI); + this.afterHostMethod(SYNC_UI, this.syncUI); + + if (this.get(HOST).get(RENDERED)) { + this.renderUI(); + this.bindUI(); + this.syncUI(); + } + + this.get(HOST).on('visibleChange', this._increaseZIndex); + }, + + destructor : function () { + + if (this._maskNode) { + this._maskNode.remove(true); + } + + this._detachUIHandles(); + this.get(HOST).get(BOUNDING_BOX).removeClass(MODAL_CLASSES.modal); + }, + + renderUI : function () { + + var bb = this.get(HOST).get(BOUNDING_BOX), + bbParent = bb.get('parentNode') || Y.one('body'); + + //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); + + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : '100%', + // height : '100%', + // top : '0', + // left : '0', + // display : 'none' + // }); + + // bbParent.insert(this._maskNode, bbParent.get('firstChild')); + // bb.addClass(MODAL_CLASSES.modal); + + var area = Y.one(this.get('node')); + // this._maskNode = Y.Node.create('
'); + // this._maskNode.addClass(MODAL_CLASSES.mask); + // this._maskNode.setStyles({ + // position : supportsPosFixed ? 'fixed' : 'absolute', + // width : area.get('offsetWidth'), + // height : area.get('offsetHeight'), + // top : area.get('top'), + // left : area.get('left'), + // display : 'none' + // }); + + //bbParent.insert(this._maskNode, bbParent.get('firstChild')); + area.addClass(MODAL_CLASSES.mask); + bb.setStyle('zIndex', area.get('zIndex')+1); + + // this.get(HOST).on('visibleChange', function(e) { + // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); + // }); + + + }, + + bindUI : function () { + + this.afterHostEvent(VISIBLE+CHANGE, this._afterHostVisibleChange); + this.afterHostEvent(Z_INDEX+CHANGE, this._afterHostZIndexChange); + }, + + syncUI : function () { + + var host = this.get(HOST); + + this._uiSetHostVisible(host.get(VISIBLE)); + this._uiSetHostZIndex(host.get(Z_INDEX)); + }, + + // *** Private Methods *** // + + + + _allowFocus: function() { + var a = ['#special']; + + for (var i = 0; i < a.length; i++){ + console.log(Y.one(a[i])); + Y.one(a[i]).setStyle('zIndex', 5000); + } + }, + + _focus : function (e) { + + if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX), + oldTI = bb.get('tabIndex'); + + bb.set('tabIndex', oldTI >= 0 ? oldTI : 0); + + host.focus(); + bb.set('tabIndex', oldTI); + }, + + _blur : function () { + + this.get(HOST).blur(); + }, + + _getMaskNode : function () { + + return this._maskNode; + }, + + _uiSetHostVisible : function (visible) { + + if (visible) { + Y.later(1, this, '_attachUIHandles'); + //this._maskNode.setStyle('display', 'block'); + this._focus(); + } else { + this._detachUIHandles(); + //this._maskNode.setStyle('display', 'none'); + this._blur(); + } + }, + + _uiSetHostZIndex : function (zIndex) { + + //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + }, + + _attachUIHandles : function (modal) { + + if (this._uiHandles) { return; } + + var host = this.get(HOST), + bb = host.get(BOUNDING_BOX); + + this._uiHandles = [ + bb.on('clickoutside', Y.bind(this._focus, this)), + bb.on('focusoutside', Y.bind(this._focus, this)), + bb.on('selectoutside', Y.bind(this._focus, this)) + ]; + + if ( ! supportsPosFixed) { + this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ + var maskNode = this._maskNode; + //maskNode.setStyle('top', maskNode.get('docScrollY')); + }, this))); + } + }, + + _detachUIHandles : function () { + + Y.each(this._uiHandles, function(h){ + h.detach(); + }); + this._uiHandles = null; + }, + + _afterHostVisibleChange : function (e) { + + this._uiSetHostVisible(e.newVal); + }, + + _afterHostZIndexChange : function (e) { + + this._uiSetHostZIndex(e.newVal); + } + + }, { + + // *** Static *** // + + NS : MODAL, + + ATTRS : { + + maskNode : { + getter : '_getMaskNode', + readOnly : true + }, + + node: { + value: undefined + } + + }, + + CLASSES : MODAL_CLASSES + + }); + Y.namespace("Plugin").Modal = WidgetModal; + +}()); \ No newline at end of file diff --git a/src/widget-modality/meta/widget-modality.json b/src/widget-modality/meta/widget-modality.json new file mode 100644 index 00000000000..0ba398e5359 --- /dev/null +++ b/src/widget-modality/meta/widget-modality.json @@ -0,0 +1,10 @@ +{ + "widget-modality": { + "requires": [ + "widget", + "plugin", + "gallery-outside-events" + ], + "skinnable": false + } +} diff --git a/src/widget-modality/tests/modality.html b/src/widget-modality/tests/modality.html new file mode 100644 index 00000000000..ddae0ed2a39 --- /dev/null +++ b/src/widget-modality/tests/modality.html @@ -0,0 +1,84 @@ + + + + + + + + + + + +
+ Here's some content that should go into a modal overlay. Let's see if it works... +

+
+ + + +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elit mi, tempus in tincidunt non, imperdiet sed augue. Nullam turpis magna, gravida vel venenatis at, dignissim non augue. Phasellus posuere erat nec ligula consectetur nec facilisis purus consectetur. Integer ipsum nisi, aliquam at ultrices quis, dictum a mauris. Ut posuere ultrices justo non convallis. Nunc a diam et est pretium fermentum. Nunc eget nunc non odio vestibulum vehicula et faucibus neque. Praesent turpis ligula, pharetra id vehicula a, sollicitudin sit amet lectus. Pellentesque pellentesque ante sed leo congue ullamcorper. Praesent at metus nisl. Vivamus at tortor sed sapien aliquet volutpat. Suspendisse vehicula, dolor ac vestibulum dapibus, nisi nulla ultrices odio, ac fermentum dolor risus congue tortor. Sed vel ligula in justo lacinia condimentum vel id est. Suspendisse interdum ligula quis odio congue consequat. Suspendisse potenti. Cras id accumsan eros. Duis gravida metus ac diam volutpat et dignissim justo pulvinar. Duis semper ornare dui, non condimentum nibh pretium id. Aenean dapibus purus eu nisl hendrerit a malesuada dolor vehicula.

+
+

Nullam et enim id lectus rhoncus convallis. Vivamus molestie diam sed est hendrerit condimentum. Phasellus fringilla libero a ligula aliquet placerat. Aliquam consectetur dignissim purus non scelerisque. Integer vel sem eu lacus tincidunt auctor. Vivamus vitae lobortis urna. Suspendisse potenti. Donec hendrerit viverra felis, in faucibus odio scelerisque eu. Vestibulum sem velit, posuere at pulvinar semper, ornare ut felis. Etiam at consectetur mi. Sed id nisi est, ac feugiat eros. Nulla facilisi. Ut porttitor tellus sit amet diam consequat ac sagittis lacus porta. Suspendisse nibh justo, fringilla a congue id, faucibus sed nibh. Sed vitae lorem mattis lectus ultrices suscipit eu ac mauris.

+ + Random Link 1 + Random Link 2 + Random Link 3 + Random Link 4 + + + + + \ No newline at end of file From 63a47ff5ac5d4231f3090a83ea11139f74df5f42 Mon Sep 17 00:00:00 2001 From: Tilo Mitra Date: Fri, 27 May 2011 12:17:22 -0700 Subject: [PATCH 03/78] initial commit - works with widgets, but has a hardcoded zIndex = 1 on contentBox --- .../widget-modality/widget-modality-debug.js | 84 +++++++---------- build/widget-modality/widget-modality-min.js | 4 +- build/widget-modality/widget-modality.js | 84 +++++++---------- src/widget-modality/js/Widget-Modality.js | 84 +++++++---------- src/widget-modality/tests/modality.html | 89 ++++++++++++++++++- 5 files changed, 183 insertions(+), 162 deletions(-) diff --git a/build/widget-modality/widget-modality-debug.js b/build/widget-modality/widget-modality-debug.js index 8ecefc0178c..5cf0dacf51c 100644 --- a/build/widget-modality/widget-modality-debug.js +++ b/build/widget-modality/widget-modality-debug.js @@ -7,6 +7,7 @@ var WIDGET = 'widget', SYNC_UI = 'syncUI', RENDERED = 'rendered', BOUNDING_BOX = 'boundingBox', + CONTENT_BOX = 'contentBox', VISIBLE = 'visible', Z_INDEX = 'zIndex', ALIGN = 'align', @@ -73,13 +74,13 @@ var WIDGET = 'widget', this.syncUI(); } - this.get(HOST).on('visibleChange', this._increaseZIndex); + //this.get(HOST).on('visibleChange', this._increaseZIndex); }, destructor : function () { if (this._maskNode) { - this._maskNode.remove(true); + //this._maskNode.remove(true); } this._detachUIHandles(); @@ -89,43 +90,33 @@ var WIDGET = 'widget', renderUI : function () { var bb = this.get(HOST).get(BOUNDING_BOX), + cb = this.get(HOST).get(CONTENT_BOX), bbParent = bb.get('parentNode') || Y.one('body'); - //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); - - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : '100%', - // height : '100%', - // top : '0', - // left : '0', - // display : 'none' - // }); - - // bbParent.insert(this._maskNode, bbParent.get('firstChild')); - // bb.addClass(MODAL_CLASSES.modal); - - var area = Y.one(this.get('node')); - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : area.get('offsetWidth'), - // height : area.get('offsetHeight'), - // top : area.get('top'), - // left : area.get('left'), - // display : 'none' - // }); - - //bbParent.insert(this._maskNode, bbParent.get('firstChild')); - area.addClass(MODAL_CLASSES.mask); - bb.setStyle('zIndex', area.get('zIndex')+1); - - // this.get(HOST).on('visibleChange', function(e) { - // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); - // }); + this._maskNode = Y.Node.create('
'); + this._maskNode.addClass(MODAL_CLASSES.mask); + this._maskNode.setStyles({ + position : supportsPosFixed ? 'fixed' : 'absolute', + width : '100%', + height : '100%', + top : '0', + left : '0', + display : 'block' + }); + + cb.setStyles({ + zIndex: 1, + position: "relative" + }); + + bbParent.insert(this._maskNode, bbParent.get('firstChild')); + //bb.appendChild(this._maskNode); + bb.addClass(MODAL_CLASSES.modal); + + //area.addClass(MODAL_CLASSES.mask); + //bb.setStyle('zIndex', area.get('zIndex')+1); + + }, @@ -146,17 +137,6 @@ var WIDGET = 'widget', // *** Private Methods *** // - - - _allowFocus: function() { - var a = ['#special']; - - for (var i = 0; i < a.length; i++){ - console.log(Y.one(a[i])); - Y.one(a[i]).setStyle('zIndex', 5000); - } - }, - _focus : function (e) { if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } @@ -184,18 +164,18 @@ var WIDGET = 'widget', if (visible) { Y.later(1, this, '_attachUIHandles'); - //this._maskNode.setStyle('display', 'block'); + this._maskNode.setStyle('display', 'block'); this._focus(); } else { this._detachUIHandles(); - //this._maskNode.setStyle('display', 'none'); + this._maskNode.setStyle('display', 'none'); this._blur(); } }, _uiSetHostZIndex : function (zIndex) { - //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + this._maskNode.setStyle(Z_INDEX, zIndex || 0); }, _attachUIHandles : function (modal) { @@ -214,7 +194,7 @@ var WIDGET = 'widget', if ( ! supportsPosFixed) { this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ var maskNode = this._maskNode; - //maskNode.setStyle('top', maskNode.get('docScrollY')); + maskNode.setStyle('top', maskNode.get('docScrollY')); }, this))); } }, diff --git a/build/widget-modality/widget-modality-min.js b/build/widget-modality/widget-modality-min.js index 479c2e2e2fe..af666862a30 100644 --- a/build/widget-modality/widget-modality-min.js +++ b/build/widget-modality/widget-modality-min.js @@ -1,3 +1,3 @@ -YUI.add("widget-modality",function(b){var i="widget",o="host",n="renderUI",j="bindUI",p="syncUI",l="rendered",m="boundingBox",k="visible",f="zIndex",g="align",h="Change",c=b.Lang.isBoolean,e=b.ClassNameManager.getClassName,a=(function(){ +YUI.add("widget-modality",function(b){var i="widget",p="host",o="renderUI",j="bindUI",q="syncUI",l="rendered",m="boundingBox",n="contentBox",k="visible",f="zIndex",g="align",h="Change",c=b.Lang.isBoolean,e=b.ClassNameManager.getClassName,a=(function(){ /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */ -var r=null,s,q;if(document.createElement){s=document.createElement("div");if(s&&s.style){s.style.position="fixed";s.style.top="10px";q=document.body;if(q&&q.appendChild&&q.removeChild){q.appendChild(s);r=(s.offsetTop===10);q.removeChild(s);}}}return r;}()),d;(function(){var t="widgetModal",s="modal",r="mask",q={modal:e(i,s),mask:e(i,r)};d=b.Base.create(t,b.Plugin.Base,[],{_maskNode:null,_uiHandles:null,initializer:function(u){this.afterHostMethod(n,this.renderUI);this.afterHostMethod(j,this.bindUI);this.afterHostMethod(p,this.syncUI);if(this.get(o).get(l)){this.renderUI();this.bindUI();this.syncUI();}this.get(o).on("visibleChange",this._increaseZIndex);},destructor:function(){if(this._maskNode){this._maskNode.remove(true);}this._detachUIHandles();this.get(o).get(m).removeClass(q.modal);},renderUI:function(){var w=this.get(o).get(m),u=w.get("parentNode")||b.one("body");var v=b.one(this.get("node"));v.addClass(q.mask);w.setStyle("zIndex",v.get("zIndex")+1);},bindUI:function(){this.afterHostEvent(k+h,this._afterHostVisibleChange);this.afterHostEvent(f+h,this._afterHostZIndexChange);},syncUI:function(){var u=this.get(o);this._uiSetHostVisible(u.get(k));this._uiSetHostZIndex(u.get(f));},_allowFocus:function(){var u=["#special"];for(var v=0;v=0?u:0);v.focus();x.set("tabIndex",u);},_blur:function(){this.get(o).blur();},_getMaskNode:function(){return this._maskNode;},_uiSetHostVisible:function(u){if(u){b.later(1,this,"_attachUIHandles");this._focus();}else{this._detachUIHandles();this._blur();}},_uiSetHostZIndex:function(u){},_attachUIHandles:function(v){if(this._uiHandles){return;}var u=this.get(o),w=u.get(m);this._uiHandles=[w.on("clickoutside",b.bind(this._focus,this)),w.on("focusoutside",b.bind(this._focus,this)),w.on("selectoutside",b.bind(this._focus,this))];if(!a){this._uiHandles.push(b.one("win").on("scroll",b.bind(function(y){var x=this._maskNode;},this)));}},_detachUIHandles:function(){b.each(this._uiHandles,function(u){u.detach();});this._uiHandles=null;},_afterHostVisibleChange:function(u){this._uiSetHostVisible(u.newVal);},_afterHostZIndexChange:function(u){this._uiSetHostZIndex(u.newVal);}},{NS:s,ATTRS:{maskNode:{getter:"_getMaskNode",readOnly:true},node:{value:undefined}},CLASSES:q});b.namespace("Plugin").Modal=d;}());},"@VERSION@",{requires:["widget","plugin","gallery-outside-events"]}); \ No newline at end of file +var s=null,t,r;if(document.createElement){t=document.createElement("div");if(t&&t.style){t.style.position="fixed";t.style.top="10px";r=document.body;if(r&&r.appendChild&&r.removeChild){r.appendChild(t);s=(t.offsetTop===10);r.removeChild(t);}}}return s;}()),d;(function(){var u="widgetModal",t="modal",s="mask",r={modal:e(i,t),mask:e(i,s)};d=b.Base.create(u,b.Plugin.Base,[],{_maskNode:null,_uiHandles:null,initializer:function(v){this.afterHostMethod(o,this.renderUI);this.afterHostMethod(j,this.bindUI);this.afterHostMethod(q,this.syncUI);if(this.get(p).get(l)){this.renderUI();this.bindUI();this.syncUI();}},destructor:function(){if(this._maskNode){}this._detachUIHandles();this.get(p).get(m).removeClass(r.modal);},renderUI:function(){var x=this.get(p).get(m),v=this.get(p).get(n),w=x.get("parentNode")||b.one("body");this._maskNode=b.Node.create("
");this._maskNode.addClass(r.mask);this._maskNode.setStyles({position:a?"fixed":"absolute",width:"100%",height:"100%",top:"0",left:"0",display:"block"});v.setStyles({zIndex:1,position:"relative"});w.insert(this._maskNode,w.get("firstChild"));x.addClass(r.modal);},bindUI:function(){this.afterHostEvent(k+h,this._afterHostVisibleChange);this.afterHostEvent(f+h,this._afterHostZIndexChange);},syncUI:function(){var v=this.get(p);this._uiSetHostVisible(v.get(k));this._uiSetHostZIndex(v.get(f));},_focus:function(x){if(x){console.log(x.currentTarget.getDOMNode().activeElement);}var w=this.get(p),y=w.get(m),v=y.get("tabIndex");y.set("tabIndex",v>=0?v:0);w.focus();y.set("tabIndex",v);},_blur:function(){this.get(p).blur();},_getMaskNode:function(){return this._maskNode;},_uiSetHostVisible:function(v){if(v){b.later(1,this,"_attachUIHandles");this._maskNode.setStyle("display","block");this._focus();}else{this._detachUIHandles();this._maskNode.setStyle("display","none");this._blur();}},_uiSetHostZIndex:function(v){this._maskNode.setStyle(f,v||0);},_attachUIHandles:function(w){if(this._uiHandles){return;}var v=this.get(p),x=v.get(m);this._uiHandles=[x.on("clickoutside",b.bind(this._focus,this)),x.on("focusoutside",b.bind(this._focus,this)),x.on("selectoutside",b.bind(this._focus,this))];if(!a){this._uiHandles.push(b.one("win").on("scroll",b.bind(function(z){var y=this._maskNode;y.setStyle("top",y.get("docScrollY"));},this)));}},_detachUIHandles:function(){b.each(this._uiHandles,function(v){v.detach();});this._uiHandles=null;},_afterHostVisibleChange:function(v){this._uiSetHostVisible(v.newVal);},_afterHostZIndexChange:function(v){this._uiSetHostZIndex(v.newVal);}},{NS:t,ATTRS:{maskNode:{getter:"_getMaskNode",readOnly:true},node:{value:undefined}},CLASSES:r});b.namespace("Plugin").Modal=d;}());},"@VERSION@",{requires:["widget","plugin","gallery-outside-events"]}); \ No newline at end of file diff --git a/build/widget-modality/widget-modality.js b/build/widget-modality/widget-modality.js index 8ecefc0178c..5cf0dacf51c 100644 --- a/build/widget-modality/widget-modality.js +++ b/build/widget-modality/widget-modality.js @@ -7,6 +7,7 @@ var WIDGET = 'widget', SYNC_UI = 'syncUI', RENDERED = 'rendered', BOUNDING_BOX = 'boundingBox', + CONTENT_BOX = 'contentBox', VISIBLE = 'visible', Z_INDEX = 'zIndex', ALIGN = 'align', @@ -73,13 +74,13 @@ var WIDGET = 'widget', this.syncUI(); } - this.get(HOST).on('visibleChange', this._increaseZIndex); + //this.get(HOST).on('visibleChange', this._increaseZIndex); }, destructor : function () { if (this._maskNode) { - this._maskNode.remove(true); + //this._maskNode.remove(true); } this._detachUIHandles(); @@ -89,43 +90,33 @@ var WIDGET = 'widget', renderUI : function () { var bb = this.get(HOST).get(BOUNDING_BOX), + cb = this.get(HOST).get(CONTENT_BOX), bbParent = bb.get('parentNode') || Y.one('body'); - //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); - - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : '100%', - // height : '100%', - // top : '0', - // left : '0', - // display : 'none' - // }); - - // bbParent.insert(this._maskNode, bbParent.get('firstChild')); - // bb.addClass(MODAL_CLASSES.modal); - - var area = Y.one(this.get('node')); - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : area.get('offsetWidth'), - // height : area.get('offsetHeight'), - // top : area.get('top'), - // left : area.get('left'), - // display : 'none' - // }); - - //bbParent.insert(this._maskNode, bbParent.get('firstChild')); - area.addClass(MODAL_CLASSES.mask); - bb.setStyle('zIndex', area.get('zIndex')+1); - - // this.get(HOST).on('visibleChange', function(e) { - // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); - // }); + this._maskNode = Y.Node.create('
'); + this._maskNode.addClass(MODAL_CLASSES.mask); + this._maskNode.setStyles({ + position : supportsPosFixed ? 'fixed' : 'absolute', + width : '100%', + height : '100%', + top : '0', + left : '0', + display : 'block' + }); + + cb.setStyles({ + zIndex: 1, + position: "relative" + }); + + bbParent.insert(this._maskNode, bbParent.get('firstChild')); + //bb.appendChild(this._maskNode); + bb.addClass(MODAL_CLASSES.modal); + + //area.addClass(MODAL_CLASSES.mask); + //bb.setStyle('zIndex', area.get('zIndex')+1); + + }, @@ -146,17 +137,6 @@ var WIDGET = 'widget', // *** Private Methods *** // - - - _allowFocus: function() { - var a = ['#special']; - - for (var i = 0; i < a.length; i++){ - console.log(Y.one(a[i])); - Y.one(a[i]).setStyle('zIndex', 5000); - } - }, - _focus : function (e) { if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } @@ -184,18 +164,18 @@ var WIDGET = 'widget', if (visible) { Y.later(1, this, '_attachUIHandles'); - //this._maskNode.setStyle('display', 'block'); + this._maskNode.setStyle('display', 'block'); this._focus(); } else { this._detachUIHandles(); - //this._maskNode.setStyle('display', 'none'); + this._maskNode.setStyle('display', 'none'); this._blur(); } }, _uiSetHostZIndex : function (zIndex) { - //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + this._maskNode.setStyle(Z_INDEX, zIndex || 0); }, _attachUIHandles : function (modal) { @@ -214,7 +194,7 @@ var WIDGET = 'widget', if ( ! supportsPosFixed) { this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ var maskNode = this._maskNode; - //maskNode.setStyle('top', maskNode.get('docScrollY')); + maskNode.setStyle('top', maskNode.get('docScrollY')); }, this))); } }, diff --git a/src/widget-modality/js/Widget-Modality.js b/src/widget-modality/js/Widget-Modality.js index d683e38f6ba..eb3ba4ea930 100644 --- a/src/widget-modality/js/Widget-Modality.js +++ b/src/widget-modality/js/Widget-Modality.js @@ -5,6 +5,7 @@ var WIDGET = 'widget', SYNC_UI = 'syncUI', RENDERED = 'rendered', BOUNDING_BOX = 'boundingBox', + CONTENT_BOX = 'contentBox', VISIBLE = 'visible', Z_INDEX = 'zIndex', ALIGN = 'align', @@ -71,13 +72,13 @@ var WIDGET = 'widget', this.syncUI(); } - this.get(HOST).on('visibleChange', this._increaseZIndex); + //this.get(HOST).on('visibleChange', this._increaseZIndex); }, destructor : function () { if (this._maskNode) { - this._maskNode.remove(true); + //this._maskNode.remove(true); } this._detachUIHandles(); @@ -87,43 +88,33 @@ var WIDGET = 'widget', renderUI : function () { var bb = this.get(HOST).get(BOUNDING_BOX), + cb = this.get(HOST).get(CONTENT_BOX), bbParent = bb.get('parentNode') || Y.one('body'); - //Y.one('body').setStyle('background', 'rgba(0,0,0,0.5)'); - - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : '100%', - // height : '100%', - // top : '0', - // left : '0', - // display : 'none' - // }); - - // bbParent.insert(this._maskNode, bbParent.get('firstChild')); - // bb.addClass(MODAL_CLASSES.modal); - - var area = Y.one(this.get('node')); - // this._maskNode = Y.Node.create('
'); - // this._maskNode.addClass(MODAL_CLASSES.mask); - // this._maskNode.setStyles({ - // position : supportsPosFixed ? 'fixed' : 'absolute', - // width : area.get('offsetWidth'), - // height : area.get('offsetHeight'), - // top : area.get('top'), - // left : area.get('left'), - // display : 'none' - // }); - - //bbParent.insert(this._maskNode, bbParent.get('firstChild')); - area.addClass(MODAL_CLASSES.mask); - bb.setStyle('zIndex', area.get('zIndex')+1); - - // this.get(HOST).on('visibleChange', function(e) { - // Y.one('#important').setStyle('background', 'rgba(255,255,255,1)'); - // }); + this._maskNode = Y.Node.create('
'); + this._maskNode.addClass(MODAL_CLASSES.mask); + this._maskNode.setStyles({ + position : supportsPosFixed ? 'fixed' : 'absolute', + width : '100%', + height : '100%', + top : '0', + left : '0', + display : 'block' + }); + + cb.setStyles({ + zIndex: 1, + position: "relative" + }); + + bbParent.insert(this._maskNode, bbParent.get('firstChild')); + //bb.appendChild(this._maskNode); + bb.addClass(MODAL_CLASSES.modal); + + //area.addClass(MODAL_CLASSES.mask); + //bb.setStyle('zIndex', area.get('zIndex')+1); + + }, @@ -144,17 +135,6 @@ var WIDGET = 'widget', // *** Private Methods *** // - - - _allowFocus: function() { - var a = ['#special']; - - for (var i = 0; i < a.length; i++){ - console.log(Y.one(a[i])); - Y.one(a[i]).setStyle('zIndex', 5000); - } - }, - _focus : function (e) { if (e) { console.log(e.currentTarget.getDOMNode().activeElement); } @@ -182,18 +162,18 @@ var WIDGET = 'widget', if (visible) { Y.later(1, this, '_attachUIHandles'); - //this._maskNode.setStyle('display', 'block'); + this._maskNode.setStyle('display', 'block'); this._focus(); } else { this._detachUIHandles(); - //this._maskNode.setStyle('display', 'none'); + this._maskNode.setStyle('display', 'none'); this._blur(); } }, _uiSetHostZIndex : function (zIndex) { - //this._maskNode.setStyle(Z_INDEX, zIndex || 0); + this._maskNode.setStyle(Z_INDEX, zIndex || 0); }, _attachUIHandles : function (modal) { @@ -212,7 +192,7 @@ var WIDGET = 'widget', if ( ! supportsPosFixed) { this._uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){ var maskNode = this._maskNode; - //maskNode.setStyle('top', maskNode.get('docScrollY')); + maskNode.setStyle('top', maskNode.get('docScrollY')); }, this))); } }, diff --git a/src/widget-modality/tests/modality.html b/src/widget-modality/tests/modality.html index ddae0ed2a39..5ec783639e0 100644 --- a/src/widget-modality/tests/modality.html +++ b/src/widget-modality/tests/modality.html @@ -10,8 +10,11 @@ line-height:18px; } .yui3-widget-mask { - background:white; - opacity:0.8; + background:rgba(0,0,0,0.6); + } + + .yui3-widget { + outline:none; } #important { @@ -25,17 +28,33 @@ /* outline:none;*/ } + #chart { + margin:10px 10px 10px 10px; + width:90%; + max-width: 800px; + height:200px; + } + +
+
+ +
+ +
+
Here's some content that should go into a modal overlay. Let's see if it works...

+ +
@@ -49,7 +68,61 @@ Random Link 4 + + + +
+
+ + + \ No newline at end of file From f2a8495d95fb3a18b61cfdd9d24ddbd878eb6773 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Thu, 9 Jun 2011 16:43:34 -0700 Subject: [PATCH 14/78] Don't dispatch on init by default. I've added a `dispatchOnInit` config property and a `ready` event that fires once the controller is ready to dispatch routes ("ready" means that we've waited long enough to know whether or not the browser has fired a history change event). Setting `dispatchOnInit` to true will cause the controller to dispatch to handle the current route at initialization time if no history change event has occurred by the time the `ready` event fires. This is useful for apps that are rendered entirely client-side, with no server-side route handling. --- src/app/js/controller.js | 105 +++++++++++++++++++++++--- src/app/tests/app-test.js | 109 ++++++++++++++++++++++----- src/app/tests/manual/controller.html | 50 ++++++++++++ src/app/tests/manual/controller.js | 12 +++ 4 files changed, 246 insertions(+), 30 deletions(-) create mode 100644 src/app/tests/manual/controller.html create mode 100644 src/app/tests/manual/controller.js diff --git a/src/app/js/controller.js b/src/app/js/controller.js index 06bd67d7c27..6687cc7560e 100644 --- a/src/app/js/controller.js +++ b/src/app/js/controller.js @@ -28,7 +28,22 @@ var YArray = Y.Array, // // See http://code.google.com/p/android/issues/detail?id=17471 html5 = Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3), - location = Y.config.win.location; + location = Y.config.win.location, + + /** + Fired when the controller is ready to begin dispatching to route handlers. + + You shouldn't need to wait for this event unless you plan to implement some + kind of custom dispatching logic. It's used internally in order to avoid + dispatching to an initial route if a browser history change occurs first. + + @event ready + @param {Boolean} dispatched `true` if routes have already been dispatched + (most likely due to a history change). + @fireOnce + @preventable _defReadyFn + **/ + EVT_READY = 'ready'; function Controller() { Controller.superclass.constructor.apply(this, arguments); @@ -56,6 +71,22 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ base: '', + /** + If `true`, the controller will dispatch to the first route handler that + matches the current URL immediately after the controller is initialized, + even if there was no browser history change to trigger a dispatch. + + If you're rendering the initial pageview on the server, then you'll probably + want this to be `false`, but if you're doing all your rendering and route + handling entirely on the client, then setting this to `true` will allow your + client-side routes to handle the initial request of all pageviews without + depending on any server-side handling. + + @property dispatchOnInit + @type Boolean + @default false + **/ + /** Array of route objects specifying routes to be created at instantiation time. @@ -83,6 +114,19 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Protected Properties ------------------------------------------------- + /** + Whether or not `_dispatch()` has been called since this controller was + instantiated. + + This is used to ensure that we don't dispatch twice when `dispatchOnInit` is + `true` and the browser also fires a `popstate` event right away. + + @property _dispatched + @type Boolean + @default undefined + @protected + **/ + /** Regex used to match parameter placeholders in route paths. @@ -111,23 +155,43 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Lifecycle Methods ---------------------------------------------------- initializer: function (config) { + var self = this; + config || (config = {}); - this._routes = []; + self._routes = []; - config.base && (this.base = config.base); - config.routes && (this.routes = config.routes); + config.base && (self.base = config.base); + config.routes && (self.routes = config.routes); - YArray.each(this.routes, function (route) { - this.route(route.path, route.callback, true); - }, this); + if (Y.Lang.isValue(config.dispatchOnInit)) { + self.dispatchOnInit = config.dispatchOnInit; + } + + YArray.each(self.routes, function (route) { + self.route(route.path, route.callback, true); + }); // Set up a history instance. - this._history = html5 ? new Y.HistoryHTML5({force: true}) : new Y.HistoryHash(); - this._history.after('change', this._afterHistoryChange, this); + self._history = html5 ? + new Y.HistoryHTML5({force: true}) : + new Y.HistoryHash(); + + self._history.after('change', self._afterHistoryChange, self); + + // Fire a 'ready' event once we're ready to route. We wait first for all + // subclass initializers to finish, and then an additional 20ms to allow + // the browser to fire an initial `popstate` event if it wants to. + self.publish(EVT_READY, { + defaultFn: self._defReadyFn, + fireOnce : true + }); - // Handle the initial route. - this._dispatch(this._getPath(), this._getState()); + self.once('initializedChange', function () { + setTimeout(function () { + self.fire(EVT_READY, {dispatched: !!self._dispatched}); + }, 20); + }); }, destructor: function () { @@ -338,6 +402,8 @@ Y.Controller = Y.extend(Controller, Y.Base, { var routes = this.match(path), req, route, self; + this._dispatched = true; + if (!routes || !routes.length) { return; } @@ -560,10 +626,25 @@ Y.Controller = Y.extend(Controller, Y.Base, { var self = this; // We need to yield control to the UI thread to allow the browser to - // update document.location before we dispatch. + // update window.location before we dispatch. setTimeout(function () { self._dispatch(self._getPath(), self._getState()); }, 1); + }, + + // -- Default Event Handlers ----------------------------------------------- + + /** + Default handler for the `ready` event. + + @method _defReadyFn + @param {EventFacade} e + @protected + **/ + _defReadyFn: function (e) { + if (this.dispatchOnInit && !e.dispatched) { + this._dispatch(this._getPath(), this._getState()); + } } }, { NAME: 'controller' diff --git a/src/app/tests/app-test.js b/src/app/tests/app-test.js index 1bc67423af1..c243afc300c 100644 --- a/src/app/tests/app-test.js +++ b/src/app/tests/app-test.js @@ -12,15 +12,29 @@ var ArrayAssert = Y.ArrayAssert, suite, viewSuite; -if (!html5) { - Y.config.win.location.hash = ''; -} - // -- Global Suite ------------------------------------------------------------- suite = new Y.Test.Suite('App Framework'); // -- Controller Suite --------------------------------------------------------- -controllerSuite = new Y.Test.Suite('Controller'); +controllerSuite = new Y.Test.Suite({ + name: 'Controller', + + setUp: function () { + this.oldPath = Y.config.win.location.pathname; + + if (!html5) { + Y.config.win.location.hash = ''; + } + }, + + tearDown: function () { + if (html5) { + Y.config.win.history.replaceState(null, null, this.oldPath); + } else { + Y.config.win.location.hash = ''; + } + } +}); // -- Controller: Lifecycle ---------------------------------------------------- controllerSuite.add(new Y.Test.Case({ @@ -55,10 +69,20 @@ controllerSuite.add(new Y.Test.Case({ Assert.areSame(controller.routes[1].callback, controller._routes[1].callback); }, - 'initializer should dispatch to the current route': function () { + 'initializer should dispatch to the current route if `dispatchOnInit` is true': function () { var calls = 0, - controller = new Y.Controller({ + controllerOne = new Y.Controller({ + dispatchOnInit: true, + routes: [{ + path: Y.config.win.location.pathname, + callback: function (req) { + calls += 1; + } + }] + }), + + controllerTwo = new Y.Controller({ routes: [{ path: Y.config.win.location.pathname, callback: function (req) { @@ -67,7 +91,50 @@ controllerSuite.add(new Y.Test.Case({ }] }); - Assert.areSame(1, calls); + this.wait(function () { + Assert.areSame(1, calls); + }, 60); + } +})); + +// -- Controller: Events ------------------------------------------------------- +controllerSuite.add(new Y.Test.Case({ + name: 'Events', + + '`ready` event should fire when the controller is ready to dispatch': function () { + var test = this, + + controller = new Y.Controller({ + on: { + ready: function (e) { + test.resume(function () { + Assert.isFalse(e.dispatched); + }); + } + } + }); + + this.wait(30); + }, + + '`ready` event should set e.dispatch to true if called after dispatch': function () { + var test = this, + + controller = new Y.Controller({ + on: { + initializedChange: function () { + this._dispatch('/fake', {}); + }, + + ready: function (e) { + test.resume(function () { + Assert.isTrue(e.dispatched); + }); + } + } + }); + + this.wait(30); } })); @@ -80,6 +147,11 @@ controllerSuite.add(new Y.Test.Case({ Assert.areSame('', controller.base); }, + '`dispatchOnInit` property should be undefined be default': function () { + var controller = new Y.Controller(); + Assert.isUndefined(controller.dispatchOnInit); + }, + '`routes` property should have a default value': function () { var controller = new Y.Controller(); @@ -131,8 +203,7 @@ controllerSuite.add(new Y.Test.Case({ 'replace() should replace the current history entry': function () { var calls = 0, - controller = new Y.Controller(), - oldPath = Y.config.win.location.pathname; + controller = new Y.Controller(); controller.route('/foo', function (req) { calls += 1; @@ -142,12 +213,14 @@ controllerSuite.add(new Y.Test.Case({ }); controller.replace('/foo', {foo: 'foo'}); - controller.replace('/foo', {foo: 'foo'}); + + if (html5) { + controller.replace('/foo', {foo: 'foo'}); + } this.wait(function () { - controller.replace(oldPath); - Assert.areSame(2, calls); - }, 5); + Assert.areSame(html5 ? 2 : 1, calls); + }, 100); }, 'save() should create a new history entry': function () { @@ -155,23 +228,23 @@ controllerSuite.add(new Y.Test.Case({ controller = new Y.Controller(), oldPath = Y.config.win.location.pathname; - controller.route('/foo', function (req) { + controller.route('/bar', function (req) { calls += 1; Assert.isObject(req.state); Assert.isString(req.state.foo); Assert.areSame('foo', req.state.foo); }); - controller.save('/foo', {foo: 'foo'}); + controller.save('/bar', {foo: 'foo'}); this.wait(function () { - history.back(); Assert.areSame(1, calls); + history.back(); this.wait(function () { Assert.areSame(oldPath, Y.config.win.location.pathname); }, 150); - }, 5); + }, 100); } })); diff --git a/src/app/tests/manual/controller.html b/src/app/tests/manual/controller.html new file mode 100644 index 00000000000..4e5670feb4a --- /dev/null +++ b/src/app/tests/manual/controller.html @@ -0,0 +1,50 @@ + + + + + Controller Test + + + + + + +

+ +Yahoo! +

+ + + + + + diff --git a/src/app/tests/manual/controller.js b/src/app/tests/manual/controller.js new file mode 100644 index 00000000000..6f50c247eb6 --- /dev/null +++ b/src/app/tests/manual/controller.js @@ -0,0 +1,12 @@ +var express = require('express'), + app = express.createServer(); + +app.configure(function(){ + app.use(express.static(__dirname)); +}); + +app.get('*', function(req, res){ + res.sendfile('controller.html'); +}); + +app.listen(3001); \ No newline at end of file From 8ba7213dc06d69d71f865636f8fe105ad8869095 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Thu, 9 Jun 2011 16:44:23 -0700 Subject: [PATCH 15/78] Build app. --- build/app/app-debug.js | 105 ++++++++++++++++++++++++++++++---- build/app/app-min.js | 4 +- build/app/app.js | 105 ++++++++++++++++++++++++++++++---- build/app/controller-debug.js | 105 ++++++++++++++++++++++++++++++---- build/app/controller-min.js | 2 +- build/app/controller.js | 105 ++++++++++++++++++++++++++++++---- 6 files changed, 375 insertions(+), 51 deletions(-) diff --git a/build/app/app-debug.js b/build/app/app-debug.js index cc8f2602d00..271b828538d 100644 --- a/build/app/app-debug.js +++ b/build/app/app-debug.js @@ -30,7 +30,22 @@ var YArray = Y.Array, // // See http://code.google.com/p/android/issues/detail?id=17471 html5 = Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3), - location = Y.config.win.location; + location = Y.config.win.location, + + /** + Fired when the controller is ready to begin dispatching to route handlers. + + You shouldn't need to wait for this event unless you plan to implement some + kind of custom dispatching logic. It's used internally in order to avoid + dispatching to an initial route if a browser history change occurs first. + + @event ready + @param {Boolean} dispatched `true` if routes have already been dispatched + (most likely due to a history change). + @fireOnce + @preventable _defReadyFn + **/ + EVT_READY = 'ready'; function Controller() { Controller.superclass.constructor.apply(this, arguments); @@ -58,6 +73,22 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ base: '', + /** + If `true`, the controller will dispatch to the first route handler that + matches the current URL immediately after the controller is initialized, + even if there was no browser history change to trigger a dispatch. + + If you're rendering the initial pageview on the server, then you'll probably + want this to be `false`, but if you're doing all your rendering and route + handling entirely on the client, then setting this to `true` will allow your + client-side routes to handle the initial request of all pageviews without + depending on any server-side handling. + + @property dispatchOnInit + @type Boolean + @default false + **/ + /** Array of route objects specifying routes to be created at instantiation time. @@ -85,6 +116,19 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Protected Properties ------------------------------------------------- + /** + Whether or not `_dispatch()` has been called since this controller was + instantiated. + + This is used to ensure that we don't dispatch twice when `dispatchOnInit` is + `true` and the browser also fires a `popstate` event right away. + + @property _dispatched + @type Boolean + @default undefined + @protected + **/ + /** Regex used to match parameter placeholders in route paths. @@ -113,23 +157,43 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Lifecycle Methods ---------------------------------------------------- initializer: function (config) { + var self = this; + config || (config = {}); - this._routes = []; + self._routes = []; - config.base && (this.base = config.base); - config.routes && (this.routes = config.routes); + config.base && (self.base = config.base); + config.routes && (self.routes = config.routes); - YArray.each(this.routes, function (route) { - this.route(route.path, route.callback, true); - }, this); + if (Y.Lang.isValue(config.dispatchOnInit)) { + self.dispatchOnInit = config.dispatchOnInit; + } + + YArray.each(self.routes, function (route) { + self.route(route.path, route.callback, true); + }); // Set up a history instance. - this._history = html5 ? new Y.HistoryHTML5({force: true}) : new Y.HistoryHash(); - this._history.after('change', this._afterHistoryChange, this); + self._history = html5 ? + new Y.HistoryHTML5({force: true}) : + new Y.HistoryHash(); + + self._history.after('change', self._afterHistoryChange, self); + + // Fire a 'ready' event once we're ready to route. We wait first for all + // subclass initializers to finish, and then an additional 20ms to allow + // the browser to fire an initial `popstate` event if it wants to. + self.publish(EVT_READY, { + defaultFn: self._defReadyFn, + fireOnce : true + }); - // Handle the initial route. - this._dispatch(this._getPath(), this._getState()); + self.once('initializedChange', function () { + setTimeout(function () { + self.fire(EVT_READY, {dispatched: !!self._dispatched}); + }, 20); + }); }, destructor: function () { @@ -340,6 +404,8 @@ Y.Controller = Y.extend(Controller, Y.Base, { var routes = this.match(path), req, route, self; + this._dispatched = true; + if (!routes || !routes.length) { return; } @@ -562,10 +628,25 @@ Y.Controller = Y.extend(Controller, Y.Base, { var self = this; // We need to yield control to the UI thread to allow the browser to - // update document.location before we dispatch. + // update window.location before we dispatch. setTimeout(function () { self._dispatch(self._getPath(), self._getState()); }, 1); + }, + + // -- Default Event Handlers ----------------------------------------------- + + /** + Default handler for the `ready` event. + + @method _defReadyFn + @param {EventFacade} e + @protected + **/ + _defReadyFn: function (e) { + if (this.dispatchOnInit && !e.dispatched) { + this._dispatch(this._getPath(), this._getState()); + } } }, { NAME: 'controller' diff --git a/build/app/app-min.js b/build/app/app-min.js index de68930ece9..06442c7cb16 100644 --- a/build/app/app-min.js +++ b/build/app/app-min.js @@ -1,2 +1,2 @@ -YUI.add("controller",function(f){var d=f.Array,b=f.QueryString,c=f.HistoryBase.html5&&(!f.UA.android||f.UA.android>=3),a=f.config.win.location;function e(){e.superclass.constructor.apply(this,arguments);}f.Controller=f.extend(e,f.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(g){g||(g={});this._routes=[];g.base&&(this.base=g.base);g.routes&&(this.routes=g.routes);d.each(this.routes,function(h){this.route(h.path,h.callback,true);},this);this._history=c?new f.HistoryHTML5({force:true}):new f.HistoryHash();this._history.after("change",this._afterHistoryChange,this);this._dispatch(this._getPath(),this._getState());},destructor:function(){this._history.detachAll();},match:function(g){return d.filter(this._routes,function(h){return g.search(h.regex)>-1;});},replace:function(g,h,i){return this._save(g,h,i,true);},route:function(h,i){var g=[];this._routes.push({callback:i,keys:g,path:h,regex:this._getRegex(h,g)});return this;},save:function(g,h,i){return this._save(g,h,i);},_decode:function(g){return decodeURIComponent(g.replace(/\+/g," "));},_dispatch:function(m,l){var g=this.match(m),k,i,h;if(!g||!g.length){return;}k=this._getRequest(m,l);h=this;function j(n){var p,o;if(n){f.error(n);}else{if((i=g.shift())){o=i.regex.exec(m);p=typeof i.callback==="string"?h[i.callback]:i.callback;if(o.length===i.keys.length+1){k.params=d.hash(i.keys,o.slice(1));}else{k.params={};d.each(o,function(r,q){k.params[q]=r;});}p.call(h,k,j);}}}j();},_getPath:(function(){var g=this;function h(j){var i=g.base;if(i&&j.indexOf(i)===0){j=j.substring(i.length);}return j;}return c?function(){return h(a.pathname);}:function(){return this._history.get("path")||h(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(h,g){if(h instanceof RegExp){return h;}h=h.replace(this._regexPathParam,function(j,i,k){g.push(k);return i==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+h+"$");},_getRequest:function(h,g){return{path:h,query:this._parseQuery(this._getQuery()),state:g};},_getState:c?function(){return this._history.get();}:function(){var g=this._history.get("state");return g?f.JSON.parse(g):{};},_parseQuery:b&&b.parse?b.parse:function(k){var l=this._decode,n=k.split("&"),j=0,h=n.length,g={},m;for(;jn?1:0);});j=g.merge(i,{models:k,src:"sort"});i.silent?this._defRefreshFn(j):this.fire(f,j);return this;},sync:function(){var h=d(arguments,0,true).pop();if(typeof h==="function"){h();}},toArray:function(){return this._items.concat();},toJSON:function(){return this.map(function(h){return h.toJSON();});},_add:function(i,h){var j;h||(h={});if(!(i instanceof g.Model)){i=new this.model(i);}if(this._clientIdMap[i.get("clientId")]){g.error("Model already in list.");return;}j=g.merge(h,{index:this._findIndex(i),model:i});h.silent?this._defAddFn(j):this.fire(c,j);return i;},_attachList:function(h){h.lists.push(this);h.addTarget(this);},_clear:function(){d.each(this._items,this._detachList,this);this._clientIdMap={};this._idMap={};this._items=[];},_detachList:function(i){var h=d.indexOf(i.lists,this);if(h>-1){i.lists.splice(h,1);i.removeTarget(this);}},_findIndex:function(l){var i=this.comparator,j=this._items,h=j.length-1,m=0,n,k,o;if(!i||!j.length){return j.length;}o=i(l);while(m",events:{},template:"",initializer:function(c){c||(c={});this.container=this.create(c.container||this.container);c.model&&(this.model=c.model);c.template&&(this.template=c.template);this.events=c.events?b.merge(this.events,c.events):this.events;this.attachEvents(this.events);},destructor:function(){this.container&&this.container.remove(true);},attachEvents:function(g){var d=this.container,i=b.Object.owns,h,e,f,c;for(c in g){if(!i(g,c)){continue;}e=g[c];for(f in e){if(!i(e,f)){continue;}h=e[f];if(typeof h==="string"){h=this[h];}d.delegate(f,h,c,this);}}},create:function(c){return typeof c==="string"?b.Node.create(c):b.one(c);},remove:function(){this.container&&this.container.remove();return this;},render:function(){return this;}},{NAME:"view"});},"@VERSION@",{requires:["base-build","node-event-delegate"]});YUI.add("app",function(a){},"@VERSION@",{use:["controller","model","model-list","view"]}); \ No newline at end of file +YUI.add("controller",function(g){var e=g.Array,b=g.QueryString,c=g.HistoryBase.html5&&(!g.UA.android||g.UA.android>=3),a=g.config.win.location,d="ready";function f(){f.superclass.constructor.apply(this,arguments);}g.Controller=g.extend(f,g.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(i){var h=this;i||(i={});h._routes=[];i.base&&(h.base=i.base);i.routes&&(h.routes=i.routes);if(g.Lang.isValue(i.dispatchOnInit)){h.dispatchOnInit=i.dispatchOnInit;}e.each(h.routes,function(j){h.route(j.path,j.callback,true);});h._history=c?new g.HistoryHTML5({force:true}):new g.HistoryHash();h._history.after("change",h._afterHistoryChange,h);h.publish(d,{defaultFn:h._defReadyFn,fireOnce:true});h.once("initializedChange",function(){setTimeout(function(){h.fire(d,{dispatched:!!h._dispatched});},20);});},destructor:function(){this._history.detachAll();},match:function(h){return e.filter(this._routes,function(i){return h.search(i.regex)>-1;});},replace:function(h,i,j){return this._save(h,i,j,true);},route:function(i,j){var h=[];this._routes.push({callback:j,keys:h,path:i,regex:this._getRegex(i,h)});return this;},save:function(h,i,j){return this._save(h,i,j);},_decode:function(h){return decodeURIComponent(h.replace(/\+/g," "));},_dispatch:function(n,m){var h=this.match(n),l,j,i;this._dispatched=true;if(!h||!h.length){return;}l=this._getRequest(n,m);i=this;function k(o){var q,p;if(o){g.error(o);}else{if((j=h.shift())){p=j.regex.exec(n);q=typeof j.callback==="string"?i[j.callback]:j.callback;if(p.length===j.keys.length+1){l.params=e.hash(j.keys,p.slice(1));}else{l.params={};e.each(p,function(s,r){l.params[r]=s;});}q.call(i,l,k);}}}k();},_getPath:(function(){var h=this;function i(k){var j=h.base;if(j&&k.indexOf(j)===0){k=k.substring(j.length);}return k;}return c?function(){return i(a.pathname);}:function(){return this._history.get("path")||i(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(i,h){if(i instanceof RegExp){return i;}i=i.replace(this._regexPathParam,function(k,j,l){h.push(l);return j==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+i+"$");},_getRequest:function(i,h){return{path:i,query:this._parseQuery(this._getQuery()),state:h};},_getState:c?function(){return this._history.get();}:function(){var h=this._history.get("state");return h?g.JSON.parse(h):{};},_parseQuery:b&&b.parse?b.parse:function(l){var m=this._decode,o=l.split("&"),k=0,j=o.length,h={},n;for(;kn?1:0);});j=g.merge(i,{models:k,src:"sort"});i.silent?this._defRefreshFn(j):this.fire(f,j);return this;},sync:function(){var h=d(arguments,0,true).pop();if(typeof h==="function"){h();}},toArray:function(){return this._items.concat();},toJSON:function(){return this.map(function(h){return h.toJSON();});},_add:function(i,h){var j;h||(h={});if(!(i instanceof g.Model)){i=new this.model(i);}if(this._clientIdMap[i.get("clientId")]){g.error("Model already in list.");return;}j=g.merge(h,{index:this._findIndex(i),model:i});h.silent?this._defAddFn(j):this.fire(c,j);return i;},_attachList:function(h){h.lists.push(this);h.addTarget(this);},_clear:function(){d.each(this._items,this._detachList,this);this._clientIdMap={};this._idMap={};this._items=[];},_detachList:function(i){var h=d.indexOf(i.lists,this);if(h>-1){i.lists.splice(h,1);i.removeTarget(this);}},_findIndex:function(l){var i=this.comparator,j=this._items,h=j.length-1,m=0,n,k,o;if(!i||!j.length){return j.length;}o=i(l);while(m",events:{},template:"",initializer:function(c){c||(c={});this.container=this.create(c.container||this.container);c.model&&(this.model=c.model);c.template&&(this.template=c.template);this.events=c.events?b.merge(this.events,c.events):this.events;this.attachEvents(this.events);},destructor:function(){this.container&&this.container.remove(true);},attachEvents:function(g){var d=this.container,i=b.Object.owns,h,e,f,c;for(c in g){if(!i(g,c)){continue;}e=g[c];for(f in e){if(!i(e,f)){continue;}h=e[f];if(typeof h==="string"){h=this[h];}d.delegate(f,h,c,this);}}},create:function(c){return typeof c==="string"?b.Node.create(c):b.one(c);},remove:function(){this.container&&this.container.remove();return this;},render:function(){return this;}},{NAME:"view"});},"@VERSION@",{requires:["base-build","node-event-delegate"]});YUI.add("app",function(a){},"@VERSION@",{use:["controller","model","model-list","view"]}); \ No newline at end of file diff --git a/build/app/app.js b/build/app/app.js index 9c60220e227..4891ee1251f 100644 --- a/build/app/app.js +++ b/build/app/app.js @@ -30,7 +30,22 @@ var YArray = Y.Array, // // See http://code.google.com/p/android/issues/detail?id=17471 html5 = Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3), - location = Y.config.win.location; + location = Y.config.win.location, + + /** + Fired when the controller is ready to begin dispatching to route handlers. + + You shouldn't need to wait for this event unless you plan to implement some + kind of custom dispatching logic. It's used internally in order to avoid + dispatching to an initial route if a browser history change occurs first. + + @event ready + @param {Boolean} dispatched `true` if routes have already been dispatched + (most likely due to a history change). + @fireOnce + @preventable _defReadyFn + **/ + EVT_READY = 'ready'; function Controller() { Controller.superclass.constructor.apply(this, arguments); @@ -58,6 +73,22 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ base: '', + /** + If `true`, the controller will dispatch to the first route handler that + matches the current URL immediately after the controller is initialized, + even if there was no browser history change to trigger a dispatch. + + If you're rendering the initial pageview on the server, then you'll probably + want this to be `false`, but if you're doing all your rendering and route + handling entirely on the client, then setting this to `true` will allow your + client-side routes to handle the initial request of all pageviews without + depending on any server-side handling. + + @property dispatchOnInit + @type Boolean + @default false + **/ + /** Array of route objects specifying routes to be created at instantiation time. @@ -85,6 +116,19 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Protected Properties ------------------------------------------------- + /** + Whether or not `_dispatch()` has been called since this controller was + instantiated. + + This is used to ensure that we don't dispatch twice when `dispatchOnInit` is + `true` and the browser also fires a `popstate` event right away. + + @property _dispatched + @type Boolean + @default undefined + @protected + **/ + /** Regex used to match parameter placeholders in route paths. @@ -113,23 +157,43 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Lifecycle Methods ---------------------------------------------------- initializer: function (config) { + var self = this; + config || (config = {}); - this._routes = []; + self._routes = []; - config.base && (this.base = config.base); - config.routes && (this.routes = config.routes); + config.base && (self.base = config.base); + config.routes && (self.routes = config.routes); - YArray.each(this.routes, function (route) { - this.route(route.path, route.callback, true); - }, this); + if (Y.Lang.isValue(config.dispatchOnInit)) { + self.dispatchOnInit = config.dispatchOnInit; + } + + YArray.each(self.routes, function (route) { + self.route(route.path, route.callback, true); + }); // Set up a history instance. - this._history = html5 ? new Y.HistoryHTML5({force: true}) : new Y.HistoryHash(); - this._history.after('change', this._afterHistoryChange, this); + self._history = html5 ? + new Y.HistoryHTML5({force: true}) : + new Y.HistoryHash(); + + self._history.after('change', self._afterHistoryChange, self); + + // Fire a 'ready' event once we're ready to route. We wait first for all + // subclass initializers to finish, and then an additional 20ms to allow + // the browser to fire an initial `popstate` event if it wants to. + self.publish(EVT_READY, { + defaultFn: self._defReadyFn, + fireOnce : true + }); - // Handle the initial route. - this._dispatch(this._getPath(), this._getState()); + self.once('initializedChange', function () { + setTimeout(function () { + self.fire(EVT_READY, {dispatched: !!self._dispatched}); + }, 20); + }); }, destructor: function () { @@ -338,6 +402,8 @@ Y.Controller = Y.extend(Controller, Y.Base, { var routes = this.match(path), req, route, self; + this._dispatched = true; + if (!routes || !routes.length) { return; } @@ -560,10 +626,25 @@ Y.Controller = Y.extend(Controller, Y.Base, { var self = this; // We need to yield control to the UI thread to allow the browser to - // update document.location before we dispatch. + // update window.location before we dispatch. setTimeout(function () { self._dispatch(self._getPath(), self._getState()); }, 1); + }, + + // -- Default Event Handlers ----------------------------------------------- + + /** + Default handler for the `ready` event. + + @method _defReadyFn + @param {EventFacade} e + @protected + **/ + _defReadyFn: function (e) { + if (this.dispatchOnInit && !e.dispatched) { + this._dispatch(this._getPath(), this._getState()); + } } }, { NAME: 'controller' diff --git a/build/app/controller-debug.js b/build/app/controller-debug.js index 6f25e40d7bb..abdfecc1547 100644 --- a/build/app/controller-debug.js +++ b/build/app/controller-debug.js @@ -30,7 +30,22 @@ var YArray = Y.Array, // // See http://code.google.com/p/android/issues/detail?id=17471 html5 = Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3), - location = Y.config.win.location; + location = Y.config.win.location, + + /** + Fired when the controller is ready to begin dispatching to route handlers. + + You shouldn't need to wait for this event unless you plan to implement some + kind of custom dispatching logic. It's used internally in order to avoid + dispatching to an initial route if a browser history change occurs first. + + @event ready + @param {Boolean} dispatched `true` if routes have already been dispatched + (most likely due to a history change). + @fireOnce + @preventable _defReadyFn + **/ + EVT_READY = 'ready'; function Controller() { Controller.superclass.constructor.apply(this, arguments); @@ -58,6 +73,22 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ base: '', + /** + If `true`, the controller will dispatch to the first route handler that + matches the current URL immediately after the controller is initialized, + even if there was no browser history change to trigger a dispatch. + + If you're rendering the initial pageview on the server, then you'll probably + want this to be `false`, but if you're doing all your rendering and route + handling entirely on the client, then setting this to `true` will allow your + client-side routes to handle the initial request of all pageviews without + depending on any server-side handling. + + @property dispatchOnInit + @type Boolean + @default false + **/ + /** Array of route objects specifying routes to be created at instantiation time. @@ -85,6 +116,19 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Protected Properties ------------------------------------------------- + /** + Whether or not `_dispatch()` has been called since this controller was + instantiated. + + This is used to ensure that we don't dispatch twice when `dispatchOnInit` is + `true` and the browser also fires a `popstate` event right away. + + @property _dispatched + @type Boolean + @default undefined + @protected + **/ + /** Regex used to match parameter placeholders in route paths. @@ -113,23 +157,43 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Lifecycle Methods ---------------------------------------------------- initializer: function (config) { + var self = this; + config || (config = {}); - this._routes = []; + self._routes = []; - config.base && (this.base = config.base); - config.routes && (this.routes = config.routes); + config.base && (self.base = config.base); + config.routes && (self.routes = config.routes); - YArray.each(this.routes, function (route) { - this.route(route.path, route.callback, true); - }, this); + if (Y.Lang.isValue(config.dispatchOnInit)) { + self.dispatchOnInit = config.dispatchOnInit; + } + + YArray.each(self.routes, function (route) { + self.route(route.path, route.callback, true); + }); // Set up a history instance. - this._history = html5 ? new Y.HistoryHTML5({force: true}) : new Y.HistoryHash(); - this._history.after('change', this._afterHistoryChange, this); + self._history = html5 ? + new Y.HistoryHTML5({force: true}) : + new Y.HistoryHash(); + + self._history.after('change', self._afterHistoryChange, self); + + // Fire a 'ready' event once we're ready to route. We wait first for all + // subclass initializers to finish, and then an additional 20ms to allow + // the browser to fire an initial `popstate` event if it wants to. + self.publish(EVT_READY, { + defaultFn: self._defReadyFn, + fireOnce : true + }); - // Handle the initial route. - this._dispatch(this._getPath(), this._getState()); + self.once('initializedChange', function () { + setTimeout(function () { + self.fire(EVT_READY, {dispatched: !!self._dispatched}); + }, 20); + }); }, destructor: function () { @@ -340,6 +404,8 @@ Y.Controller = Y.extend(Controller, Y.Base, { var routes = this.match(path), req, route, self; + this._dispatched = true; + if (!routes || !routes.length) { return; } @@ -562,10 +628,25 @@ Y.Controller = Y.extend(Controller, Y.Base, { var self = this; // We need to yield control to the UI thread to allow the browser to - // update document.location before we dispatch. + // update window.location before we dispatch. setTimeout(function () { self._dispatch(self._getPath(), self._getState()); }, 1); + }, + + // -- Default Event Handlers ----------------------------------------------- + + /** + Default handler for the `ready` event. + + @method _defReadyFn + @param {EventFacade} e + @protected + **/ + _defReadyFn: function (e) { + if (this.dispatchOnInit && !e.dispatched) { + this._dispatch(this._getPath(), this._getState()); + } } }, { NAME: 'controller' diff --git a/build/app/controller-min.js b/build/app/controller-min.js index 3e25570384f..66bdb2df9ad 100644 --- a/build/app/controller-min.js +++ b/build/app/controller-min.js @@ -1 +1 @@ -YUI.add("controller",function(f){var d=f.Array,b=f.QueryString,c=f.HistoryBase.html5&&(!f.UA.android||f.UA.android>=3),a=f.config.win.location;function e(){e.superclass.constructor.apply(this,arguments);}f.Controller=f.extend(e,f.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(g){g||(g={});this._routes=[];g.base&&(this.base=g.base);g.routes&&(this.routes=g.routes);d.each(this.routes,function(h){this.route(h.path,h.callback,true);},this);this._history=c?new f.HistoryHTML5({force:true}):new f.HistoryHash();this._history.after("change",this._afterHistoryChange,this);this._dispatch(this._getPath(),this._getState());},destructor:function(){this._history.detachAll();},match:function(g){return d.filter(this._routes,function(h){return g.search(h.regex)>-1;});},replace:function(g,h,i){return this._save(g,h,i,true);},route:function(h,i){var g=[];this._routes.push({callback:i,keys:g,path:h,regex:this._getRegex(h,g)});return this;},save:function(g,h,i){return this._save(g,h,i);},_decode:function(g){return decodeURIComponent(g.replace(/\+/g," "));},_dispatch:function(m,l){var g=this.match(m),k,i,h;if(!g||!g.length){return;}k=this._getRequest(m,l);h=this;function j(n){var p,o;if(n){f.error(n);}else{if((i=g.shift())){o=i.regex.exec(m);p=typeof i.callback==="string"?h[i.callback]:i.callback;if(o.length===i.keys.length+1){k.params=d.hash(i.keys,o.slice(1));}else{k.params={};d.each(o,function(r,q){k.params[q]=r;});}p.call(h,k,j);}}}j();},_getPath:(function(){var g=this;function h(j){var i=g.base;if(i&&j.indexOf(i)===0){j=j.substring(i.length);}return j;}return c?function(){return h(a.pathname);}:function(){return this._history.get("path")||h(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(h,g){if(h instanceof RegExp){return h;}h=h.replace(this._regexPathParam,function(j,i,k){g.push(k);return i==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+h+"$");},_getRequest:function(h,g){return{path:h,query:this._parseQuery(this._getQuery()),state:g};},_getState:c?function(){return this._history.get();}:function(){var g=this._history.get("state");return g?f.JSON.parse(g):{};},_parseQuery:b&&b.parse?b.parse:function(k){var l=this._decode,n=k.split("&"),j=0,h=n.length,g={},m;for(;j=3),a=g.config.win.location,d="ready";function f(){f.superclass.constructor.apply(this,arguments);}g.Controller=g.extend(f,g.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(i){var h=this;i||(i={});h._routes=[];i.base&&(h.base=i.base);i.routes&&(h.routes=i.routes);if(g.Lang.isValue(i.dispatchOnInit)){h.dispatchOnInit=i.dispatchOnInit;}e.each(h.routes,function(j){h.route(j.path,j.callback,true);});h._history=c?new g.HistoryHTML5({force:true}):new g.HistoryHash();h._history.after("change",h._afterHistoryChange,h);h.publish(d,{defaultFn:h._defReadyFn,fireOnce:true});h.once("initializedChange",function(){setTimeout(function(){h.fire(d,{dispatched:!!h._dispatched});},20);});},destructor:function(){this._history.detachAll();},match:function(h){return e.filter(this._routes,function(i){return h.search(i.regex)>-1;});},replace:function(h,i,j){return this._save(h,i,j,true);},route:function(i,j){var h=[];this._routes.push({callback:j,keys:h,path:i,regex:this._getRegex(i,h)});return this;},save:function(h,i,j){return this._save(h,i,j);},_decode:function(h){return decodeURIComponent(h.replace(/\+/g," "));},_dispatch:function(n,m){var h=this.match(n),l,j,i;this._dispatched=true;if(!h||!h.length){return;}l=this._getRequest(n,m);i=this;function k(o){var q,p;if(o){g.error(o);}else{if((j=h.shift())){p=j.regex.exec(n);q=typeof j.callback==="string"?i[j.callback]:j.callback;if(p.length===j.keys.length+1){l.params=e.hash(j.keys,p.slice(1));}else{l.params={};e.each(p,function(s,r){l.params[r]=s;});}q.call(i,l,k);}}}k();},_getPath:(function(){var h=this;function i(k){var j=h.base;if(j&&k.indexOf(j)===0){k=k.substring(j.length);}return k;}return c?function(){return i(a.pathname);}:function(){return this._history.get("path")||i(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(i,h){if(i instanceof RegExp){return i;}i=i.replace(this._regexPathParam,function(k,j,l){h.push(l);return j==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+i+"$");},_getRequest:function(i,h){return{path:i,query:this._parseQuery(this._getQuery()),state:h};},_getState:c?function(){return this._history.get();}:function(){var h=this._history.get("state");return h?g.JSON.parse(h):{};},_parseQuery:b&&b.parse?b.parse:function(l){var m=this._decode,o=l.split("&"),k=0,j=o.length,h={},n;for(;k= 3), - location = Y.config.win.location; + location = Y.config.win.location, + + /** + Fired when the controller is ready to begin dispatching to route handlers. + + You shouldn't need to wait for this event unless you plan to implement some + kind of custom dispatching logic. It's used internally in order to avoid + dispatching to an initial route if a browser history change occurs first. + + @event ready + @param {Boolean} dispatched `true` if routes have already been dispatched + (most likely due to a history change). + @fireOnce + @preventable _defReadyFn + **/ + EVT_READY = 'ready'; function Controller() { Controller.superclass.constructor.apply(this, arguments); @@ -58,6 +73,22 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ base: '', + /** + If `true`, the controller will dispatch to the first route handler that + matches the current URL immediately after the controller is initialized, + even if there was no browser history change to trigger a dispatch. + + If you're rendering the initial pageview on the server, then you'll probably + want this to be `false`, but if you're doing all your rendering and route + handling entirely on the client, then setting this to `true` will allow your + client-side routes to handle the initial request of all pageviews without + depending on any server-side handling. + + @property dispatchOnInit + @type Boolean + @default false + **/ + /** Array of route objects specifying routes to be created at instantiation time. @@ -85,6 +116,19 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Protected Properties ------------------------------------------------- + /** + Whether or not `_dispatch()` has been called since this controller was + instantiated. + + This is used to ensure that we don't dispatch twice when `dispatchOnInit` is + `true` and the browser also fires a `popstate` event right away. + + @property _dispatched + @type Boolean + @default undefined + @protected + **/ + /** Regex used to match parameter placeholders in route paths. @@ -113,23 +157,43 @@ Y.Controller = Y.extend(Controller, Y.Base, { // -- Lifecycle Methods ---------------------------------------------------- initializer: function (config) { + var self = this; + config || (config = {}); - this._routes = []; + self._routes = []; - config.base && (this.base = config.base); - config.routes && (this.routes = config.routes); + config.base && (self.base = config.base); + config.routes && (self.routes = config.routes); - YArray.each(this.routes, function (route) { - this.route(route.path, route.callback, true); - }, this); + if (Y.Lang.isValue(config.dispatchOnInit)) { + self.dispatchOnInit = config.dispatchOnInit; + } + + YArray.each(self.routes, function (route) { + self.route(route.path, route.callback, true); + }); // Set up a history instance. - this._history = html5 ? new Y.HistoryHTML5({force: true}) : new Y.HistoryHash(); - this._history.after('change', this._afterHistoryChange, this); + self._history = html5 ? + new Y.HistoryHTML5({force: true}) : + new Y.HistoryHash(); + + self._history.after('change', self._afterHistoryChange, self); + + // Fire a 'ready' event once we're ready to route. We wait first for all + // subclass initializers to finish, and then an additional 20ms to allow + // the browser to fire an initial `popstate` event if it wants to. + self.publish(EVT_READY, { + defaultFn: self._defReadyFn, + fireOnce : true + }); - // Handle the initial route. - this._dispatch(this._getPath(), this._getState()); + self.once('initializedChange', function () { + setTimeout(function () { + self.fire(EVT_READY, {dispatched: !!self._dispatched}); + }, 20); + }); }, destructor: function () { @@ -338,6 +402,8 @@ Y.Controller = Y.extend(Controller, Y.Base, { var routes = this.match(path), req, route, self; + this._dispatched = true; + if (!routes || !routes.length) { return; } @@ -560,10 +626,25 @@ Y.Controller = Y.extend(Controller, Y.Base, { var self = this; // We need to yield control to the UI thread to allow the browser to - // update document.location before we dispatch. + // update window.location before we dispatch. setTimeout(function () { self._dispatch(self._getPath(), self._getState()); }, 1); + }, + + // -- Default Event Handlers ----------------------------------------------- + + /** + Default handler for the `ready` event. + + @method _defReadyFn + @param {EventFacade} e + @protected + **/ + _defReadyFn: function (e) { + if (this.dispatchOnInit && !e.dispatched) { + this._dispatch(this._getPath(), this._getState()); + } } }, { NAME: 'controller' From 7772dbd9b1bfbf90c02ec94edcfe9298d60fdfed Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Thu, 9 Jun 2011 16:46:42 -0700 Subject: [PATCH 16/78] Add node_modules/ to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e28257efcb6..f11cac6c27f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ build_tmp*/ build_rollup_tmp*/ +node_modules/ tmp/ CVS/ .DS_Store From f69fca304432a2f92a02d9f518913e5c76cb5cf5 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Thu, 9 Jun 2011 21:51:30 -0700 Subject: [PATCH 17/78] Make hash URLs pretty, and never store state along with history changes. Storing history state doesn't make much sense for URL-based routing, since that state isn't actually stored in the URL and will never be available if someone navigates directly to a URL. Instead of relying on history state, implementers should use query parameters and path parameters to store state information in the URL when necessary. --- src/app/js/controller.js | 156 +++++++++++++++----------------------- src/app/tests/app-test.js | 91 ++++++++++------------ 2 files changed, 101 insertions(+), 146 deletions(-) diff --git a/src/app/js/controller.js b/src/app/js/controller.js index 6687cc7560e..038a6674b58 100644 --- a/src/app/js/controller.js +++ b/src/app/js/controller.js @@ -19,8 +19,9 @@ URLs. @uses Base **/ -var YArray = Y.Array, - QS = Y.QueryString, +var HistoryHash = Y.HistoryHash, + QS = Y.QueryString, + YArray = Y.Array, // Android versions lower than 3.0 are buggy and don't update // window.location after a pushState() call, so we fall back to hash-based @@ -173,11 +174,12 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); // Set up a history instance. - self._history = html5 ? - new Y.HistoryHTML5({force: true}) : - new Y.HistoryHash(); - - self._history.after('change', self._afterHistoryChange, self); + if (html5) { + self._history = new Y.HistoryHTML5({force: true}); + self._history.after('change', self._afterHistoryChange, self); + } else { + Y.on('hashchange', self._afterHistoryChange, Y.config.win, self); + } // Fire a 'ready' event once we're ready to route. We wait first for all // subclass initializers to finish, and then an additional 20ms to allow @@ -195,7 +197,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { }, destructor: function () { - this._history.detachAll(); + if (html5) { + this._history.detachAll(); + } else { + Y.detach('hashchange', this._afterHistoryChange, this); + } }, // -- Public Methods ------------------------------------------------------- @@ -239,7 +245,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -247,23 +253,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.replace('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.replace('/path/'); + // New URL: http://example.com/path/ + + controller.replace('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.replace('/'); // New URL: http://example.com/ @method replace - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see save() **/ - replace: function (url, state, title) { - return this._save(url, state, title, true); + replace: function (url) { + return this._save(url, true); }, /** @@ -318,8 +325,6 @@ Y.Controller = Y.extend(Controller, Y.Base, { @param {Object} callback.req.query Query hash representing the URL query string, if any. Parameter names are keys, and are mapped to parameter values. - @param {Object} callback.req.state State object associated with this - URL, if any. @param {Function} callback.next Callback to pass control to the next matching route. If you don't call this function, then no further route handlers will be executed, even if there are more that match. If you do @@ -348,7 +353,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL and create a history entry. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -356,23 +361,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.save('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.save('/path/'); + // New URL: http://example.com/path/ + + controller.save('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.save('/'); // New URL: http://example.com/ @method save - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see replace() **/ - save: function (url, state, title) { - return this._save(url, state, title); + save: function (url) { + return this._save(url); }, // -- Protected Methods ---------------------------------------------------- @@ -395,12 +401,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _dispatch @param {String} path URL path. - @param {Object} state State to pass to route handlers. @protected **/ - _dispatch: function (path, state) { + _dispatch: function (path) { var routes = this.match(path), - req, route, self; + req, self; this._dispatched = true; @@ -408,11 +413,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { return; } - req = this._getRequest(path, state); + req = this._getRequest(path); self = this; function next(err) { - var callback, matches; + var callback, matches, route; if (err) { Y.error(err); @@ -463,7 +468,10 @@ Y.Controller = Y.extend(Controller, Y.Base, { return html5 ? function () { return removeBase(location.pathname); } : function () { - return this._history.get('path') || removeBase(location.pathname); + var hash = HistoryHash.getHash(); + + return hash ? hash.replace(this._regexUrlQuery, '') : + removeBase(location.pathname); }; }()), @@ -477,12 +485,15 @@ Y.Controller = Y.extend(Controller, Y.Base, { _getQuery: html5 ? function () { return location.search.substring(1); } : function () { - return this._history.get('query') || location.search.substring(1); + var hash = HistoryHash.getHash(), + matches = hash.match(this._regexUrlQuery); + + return hash && matches ? matches[1] : location.search.substring(1); }, /** - Creates a regular expression from the specified route specification. If - _path_ is already a regex, it will be returned unmodified. + Creates a regular expression from the given route specification. If _path_ + is already a regex, it will be returned unmodified. @method _getRegex @param {String|RegExp} path Route path specification. @@ -509,32 +520,16 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _getRequest @param {String} path Current path being dispatched. - @param {Object} state Current state. @return {Object} Request object. @protected **/ - _getRequest: function (path, state) { + _getRequest: function (path) { return { path : path, - query: this._parseQuery(this._getQuery()), - state: state + query: this._parseQuery(this._getQuery()) }; }, - /** - Gets the current state, if any. - - @method _getState - @return {Object} Current state. - @protected - **/ - _getState: html5 ? function () { - return this._history.get(); - } : function () { - var jsonState = this._history.get('state'); - return jsonState ? Y.JSON.parse(jsonState) : {}; - }, - /** Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is available, this method will be an alias to that. @@ -568,55 +563,26 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _save @param {String} [url] URL for the history entry. - @param {Object} [state] State object associated with the history entry. - @param {String} [title] Page title associated with the history entry. This - is currently undocumented in the public `replace` and `save` methods, - since browsers don't currently do anything with it. @param {Boolean} [replace=false] If `true`, the current history entry will be replaced instead of a new one being added. @chainable @protected **/ - _save: function (url, state, title, replace) { - var jsonState, query; - - if (html5) { - if (typeof url === 'string') { - url = this.base + url; - } - } else { - // If we're not using HTML5 history, take over the history state for - // our own purposes and shove the implementer's state inside it as a - // JSON string. - jsonState = state && Y.JSON.stringify(state); - - // Extract a query string from the URL if there is one, then remove - // both the query and the hash portions of the URL so we can store - // just the path. - url = url.replace(this._regexUrlQuery, function (match, params) { - query = params; - return ''; - }); - - state = {path: url || this._getPath()}; - - query && (state.query = query); - jsonState && (state.state = jsonState); - } - - this._history[replace ? 'replace' : 'add'](state || {}, { - merge: false, - title: title, - url : url + _save: html5 ? function (url, replace) { + this._history[replace ? 'replace' : 'add'](null, { + url: typeof url === 'string' ? this.base + url : url }); + return this; + } : function (url, replace) { + HistoryHash[replace ? 'replaceHash' : 'setHash'](url); return this; }, // -- Protected Event Handlers --------------------------------------------- /** - Handles `history:change` events. + Handles `history:change` and `hashchange` events. @method _afterHistoryChange @param {EventFacade} e @@ -628,7 +594,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { // We need to yield control to the UI thread to allow the browser to // update window.location before we dispatch. setTimeout(function () { - self._dispatch(self._getPath(), self._getState()); + self._dispatch(self._getPath()); }, 1); }, @@ -643,7 +609,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ _defReadyFn: function (e) { if (this.dispatchOnInit && !e.dispatched) { - this._dispatch(this._getPath(), this._getState()); + this._dispatch(this._getPath()); } } }, { diff --git a/src/app/tests/app-test.js b/src/app/tests/app-test.js index c243afc300c..6c5e6058440 100644 --- a/src/app/tests/app-test.js +++ b/src/app/tests/app-test.js @@ -30,8 +30,6 @@ controllerSuite = new Y.Test.Suite({ tearDown: function () { if (html5) { Y.config.win.history.replaceState(null, null, this.oldPath); - } else { - Y.config.win.location.hash = ''; } } }); @@ -70,29 +68,35 @@ controllerSuite.add(new Y.Test.Case({ }, 'initializer should dispatch to the current route if `dispatchOnInit` is true': function () { - var calls = 0, + var test = this; + + new Y.Controller({ + dispatchOnInit: true, + routes: [{ + path: Y.config.win.location.pathname, + callback: function (req) { + test.resume(); + } + }] + }); - controllerOne = new Y.Controller({ - dispatchOnInit: true, - routes: [{ - path: Y.config.win.location.pathname, - callback: function (req) { - calls += 1; - } - }] - }), + this.wait(60); + }, - controllerTwo = new Y.Controller({ - routes: [{ - path: Y.config.win.location.pathname, - callback: function (req) { - calls += 1; - } - }] - }); + 'initializer should not dispatch to the current route if `dispatchOnInit` is not true': function () { + var calls = 0; + + new Y.Controller({ + routes: [{ + path: Y.config.win.location.pathname, + callback: function (req) { + calls += 1; + } + }] + }); this.wait(function () { - Assert.areSame(1, calls); + Assert.areSame(0, calls); }, 60); } })); @@ -202,49 +206,35 @@ controllerSuite.add(new Y.Test.Case({ }, 'replace() should replace the current history entry': function () { - var calls = 0, + var test = this, controller = new Y.Controller(); controller.route('/foo', function (req) { - calls += 1; - Assert.isObject(req.state); - Assert.isString(req.state.foo); - Assert.areSame('foo', req.state.foo); + test.resume(function () { + Assert.areSame('/foo', req.path); + Assert.isObject(req.query); + }); }); - controller.replace('/foo', {foo: 'foo'}); + controller.replace('/foo'); - if (html5) { - controller.replace('/foo', {foo: 'foo'}); - } - - this.wait(function () { - Assert.areSame(html5 ? 2 : 1, calls); - }, 100); + this.wait(100); }, 'save() should create a new history entry': function () { - var calls = 0, - controller = new Y.Controller(), - oldPath = Y.config.win.location.pathname; + var test = this, + controller = new Y.Controller(); controller.route('/bar', function (req) { - calls += 1; - Assert.isObject(req.state); - Assert.isString(req.state.foo); - Assert.areSame('foo', req.state.foo); + test.resume(function () { + Assert.areSame('/bar', req.path); + Assert.isObject(req.query); + }); }); - controller.save('/bar', {foo: 'foo'}); - - this.wait(function () { - Assert.areSame(1, calls); - history.back(); + controller.save('/bar'); - this.wait(function () { - Assert.areSame(oldPath, Y.config.win.location.pathname); - }, 150); - }, 100); + this.wait(100); } })); @@ -284,7 +274,6 @@ controllerSuite.add(new Y.Test.Case({ Assert.isTrue(Y.Object.isEmpty(req.params)); Assert.areSame('/foo', req.path); ObjectAssert.areEqual({bar: 'baz quux', moo: ''}, req.query); - Assert.areSame('foo', req.state.foo); }); // Duckpunching _getQuery so we can test req.query. From 1ccb5f37fb79072bad4361a749c09acf79f7bf95 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Thu, 9 Jun 2011 21:51:43 -0700 Subject: [PATCH 18/78] Build app. --- build/app/app-debug.js | 158 +++++++++++++--------------------- build/app/app-min.js | 4 +- build/app/app.js | 158 +++++++++++++--------------------- build/app/controller-debug.js | 158 +++++++++++++--------------------- build/app/controller-min.js | 2 +- build/app/controller.js | 158 +++++++++++++--------------------- 6 files changed, 251 insertions(+), 387 deletions(-) diff --git a/build/app/app-debug.js b/build/app/app-debug.js index 271b828538d..2fffd17108e 100644 --- a/build/app/app-debug.js +++ b/build/app/app-debug.js @@ -21,8 +21,9 @@ URLs. @uses Base **/ -var YArray = Y.Array, - QS = Y.QueryString, +var HistoryHash = Y.HistoryHash, + QS = Y.QueryString, + YArray = Y.Array, // Android versions lower than 3.0 are buggy and don't update // window.location after a pushState() call, so we fall back to hash-based @@ -175,11 +176,12 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); // Set up a history instance. - self._history = html5 ? - new Y.HistoryHTML5({force: true}) : - new Y.HistoryHash(); - - self._history.after('change', self._afterHistoryChange, self); + if (html5) { + self._history = new Y.HistoryHTML5({force: true}); + self._history.after('change', self._afterHistoryChange, self); + } else { + Y.on('hashchange', self._afterHistoryChange, Y.config.win, self); + } // Fire a 'ready' event once we're ready to route. We wait first for all // subclass initializers to finish, and then an additional 20ms to allow @@ -197,7 +199,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { }, destructor: function () { - this._history.detachAll(); + if (html5) { + this._history.detachAll(); + } else { + Y.detach('hashchange', this._afterHistoryChange, this); + } }, // -- Public Methods ------------------------------------------------------- @@ -241,7 +247,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -249,23 +255,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.replace('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.replace('/path/'); + // New URL: http://example.com/path/ + + controller.replace('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.replace('/'); // New URL: http://example.com/ @method replace - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see save() **/ - replace: function (url, state, title) { - return this._save(url, state, title, true); + replace: function (url) { + return this._save(url, true); }, /** @@ -320,8 +327,6 @@ Y.Controller = Y.extend(Controller, Y.Base, { @param {Object} callback.req.query Query hash representing the URL query string, if any. Parameter names are keys, and are mapped to parameter values. - @param {Object} callback.req.state State object associated with this - URL, if any. @param {Function} callback.next Callback to pass control to the next matching route. If you don't call this function, then no further route handlers will be executed, even if there are more that match. If you do @@ -350,7 +355,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL and create a history entry. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -358,23 +363,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.save('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.save('/path/'); + // New URL: http://example.com/path/ + + controller.save('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.save('/'); // New URL: http://example.com/ @method save - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see replace() **/ - save: function (url, state, title) { - return this._save(url, state, title); + save: function (url) { + return this._save(url); }, // -- Protected Methods ---------------------------------------------------- @@ -397,12 +403,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _dispatch @param {String} path URL path. - @param {Object} state State to pass to route handlers. @protected **/ - _dispatch: function (path, state) { + _dispatch: function (path) { var routes = this.match(path), - req, route, self; + req, self; this._dispatched = true; @@ -410,11 +415,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { return; } - req = this._getRequest(path, state); + req = this._getRequest(path); self = this; function next(err) { - var callback, matches; + var callback, matches, route; if (err) { Y.error(err); @@ -465,7 +470,10 @@ Y.Controller = Y.extend(Controller, Y.Base, { return html5 ? function () { return removeBase(location.pathname); } : function () { - return this._history.get('path') || removeBase(location.pathname); + var hash = HistoryHash.getHash(); + + return hash ? hash.replace(this._regexUrlQuery, '') : + removeBase(location.pathname); }; }()), @@ -479,12 +487,15 @@ Y.Controller = Y.extend(Controller, Y.Base, { _getQuery: html5 ? function () { return location.search.substring(1); } : function () { - return this._history.get('query') || location.search.substring(1); + var hash = HistoryHash.getHash(), + matches = hash.match(this._regexUrlQuery); + + return hash && matches ? matches[1] : location.search.substring(1); }, /** - Creates a regular expression from the specified route specification. If - _path_ is already a regex, it will be returned unmodified. + Creates a regular expression from the given route specification. If _path_ + is already a regex, it will be returned unmodified. @method _getRegex @param {String|RegExp} path Route path specification. @@ -511,32 +522,16 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _getRequest @param {String} path Current path being dispatched. - @param {Object} state Current state. @return {Object} Request object. @protected **/ - _getRequest: function (path, state) { + _getRequest: function (path) { return { path : path, - query: this._parseQuery(this._getQuery()), - state: state + query: this._parseQuery(this._getQuery()) }; }, - /** - Gets the current state, if any. - - @method _getState - @return {Object} Current state. - @protected - **/ - _getState: html5 ? function () { - return this._history.get(); - } : function () { - var jsonState = this._history.get('state'); - return jsonState ? Y.JSON.parse(jsonState) : {}; - }, - /** Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is available, this method will be an alias to that. @@ -570,55 +565,26 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _save @param {String} [url] URL for the history entry. - @param {Object} [state] State object associated with the history entry. - @param {String} [title] Page title associated with the history entry. This - is currently undocumented in the public `replace` and `save` methods, - since browsers don't currently do anything with it. @param {Boolean} [replace=false] If `true`, the current history entry will be replaced instead of a new one being added. @chainable @protected **/ - _save: function (url, state, title, replace) { - var jsonState, query; - - if (html5) { - if (typeof url === 'string') { - url = this.base + url; - } - } else { - // If we're not using HTML5 history, take over the history state for - // our own purposes and shove the implementer's state inside it as a - // JSON string. - jsonState = state && Y.JSON.stringify(state); - - // Extract a query string from the URL if there is one, then remove - // both the query and the hash portions of the URL so we can store - // just the path. - url = url.replace(this._regexUrlQuery, function (match, params) { - query = params; - return ''; - }); - - state = {path: url || this._getPath()}; - - query && (state.query = query); - jsonState && (state.state = jsonState); - } - - this._history[replace ? 'replace' : 'add'](state || {}, { - merge: false, - title: title, - url : url + _save: html5 ? function (url, replace) { + this._history[replace ? 'replace' : 'add'](null, { + url: typeof url === 'string' ? this.base + url : url }); + return this; + } : function (url, replace) { + HistoryHash[replace ? 'replaceHash' : 'setHash'](url); return this; }, // -- Protected Event Handlers --------------------------------------------- /** - Handles `history:change` events. + Handles `history:change` and `hashchange` events. @method _afterHistoryChange @param {EventFacade} e @@ -630,7 +596,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { // We need to yield control to the UI thread to allow the browser to // update window.location before we dispatch. setTimeout(function () { - self._dispatch(self._getPath(), self._getState()); + self._dispatch(self._getPath()); }, 1); }, @@ -645,7 +611,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ _defReadyFn: function (e) { if (this.dispatchOnInit && !e.dispatched) { - this._dispatch(this._getPath(), this._getState()); + this._dispatch(this._getPath()); } } }, { @@ -653,7 +619,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); -}, '@VERSION@' ,{optional:['querystring-parse'], requires:['array-extras', 'base-build', 'history', 'json']}); +}, '@VERSION@' ,{requires:['array-extras', 'base-build', 'history', 'json'], optional:['querystring-parse']}); YUI.add('model', function(Y) { /** diff --git a/build/app/app-min.js b/build/app/app-min.js index 06442c7cb16..17d43bea511 100644 --- a/build/app/app-min.js +++ b/build/app/app-min.js @@ -1,2 +1,2 @@ -YUI.add("controller",function(g){var e=g.Array,b=g.QueryString,c=g.HistoryBase.html5&&(!g.UA.android||g.UA.android>=3),a=g.config.win.location,d="ready";function f(){f.superclass.constructor.apply(this,arguments);}g.Controller=g.extend(f,g.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(i){var h=this;i||(i={});h._routes=[];i.base&&(h.base=i.base);i.routes&&(h.routes=i.routes);if(g.Lang.isValue(i.dispatchOnInit)){h.dispatchOnInit=i.dispatchOnInit;}e.each(h.routes,function(j){h.route(j.path,j.callback,true);});h._history=c?new g.HistoryHTML5({force:true}):new g.HistoryHash();h._history.after("change",h._afterHistoryChange,h);h.publish(d,{defaultFn:h._defReadyFn,fireOnce:true});h.once("initializedChange",function(){setTimeout(function(){h.fire(d,{dispatched:!!h._dispatched});},20);});},destructor:function(){this._history.detachAll();},match:function(h){return e.filter(this._routes,function(i){return h.search(i.regex)>-1;});},replace:function(h,i,j){return this._save(h,i,j,true);},route:function(i,j){var h=[];this._routes.push({callback:j,keys:h,path:i,regex:this._getRegex(i,h)});return this;},save:function(h,i,j){return this._save(h,i,j);},_decode:function(h){return decodeURIComponent(h.replace(/\+/g," "));},_dispatch:function(n,m){var h=this.match(n),l,j,i;this._dispatched=true;if(!h||!h.length){return;}l=this._getRequest(n,m);i=this;function k(o){var q,p;if(o){g.error(o);}else{if((j=h.shift())){p=j.regex.exec(n);q=typeof j.callback==="string"?i[j.callback]:j.callback;if(p.length===j.keys.length+1){l.params=e.hash(j.keys,p.slice(1));}else{l.params={};e.each(p,function(s,r){l.params[r]=s;});}q.call(i,l,k);}}}k();},_getPath:(function(){var h=this;function i(k){var j=h.base;if(j&&k.indexOf(j)===0){k=k.substring(j.length);}return k;}return c?function(){return i(a.pathname);}:function(){return this._history.get("path")||i(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(i,h){if(i instanceof RegExp){return i;}i=i.replace(this._regexPathParam,function(k,j,l){h.push(l);return j==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+i+"$");},_getRequest:function(i,h){return{path:i,query:this._parseQuery(this._getQuery()),state:h};},_getState:c?function(){return this._history.get();}:function(){var h=this._history.get("state");return h?g.JSON.parse(h):{};},_parseQuery:b&&b.parse?b.parse:function(l){var m=this._decode,o=l.split("&"),k=0,j=o.length,h={},n;for(;kn?1:0);});j=g.merge(i,{models:k,src:"sort"});i.silent?this._defRefreshFn(j):this.fire(f,j);return this;},sync:function(){var h=d(arguments,0,true).pop();if(typeof h==="function"){h();}},toArray:function(){return this._items.concat();},toJSON:function(){return this.map(function(h){return h.toJSON();});},_add:function(i,h){var j;h||(h={});if(!(i instanceof g.Model)){i=new this.model(i);}if(this._clientIdMap[i.get("clientId")]){g.error("Model already in list.");return;}j=g.merge(h,{index:this._findIndex(i),model:i});h.silent?this._defAddFn(j):this.fire(c,j);return i;},_attachList:function(h){h.lists.push(this);h.addTarget(this);},_clear:function(){d.each(this._items,this._detachList,this);this._clientIdMap={};this._idMap={};this._items=[];},_detachList:function(i){var h=d.indexOf(i.lists,this);if(h>-1){i.lists.splice(h,1);i.removeTarget(this);}},_findIndex:function(l){var i=this.comparator,j=this._items,h=j.length-1,m=0,n,k,o;if(!i||!j.length){return j.length;}o=i(l);while(m",events:{},template:"",initializer:function(c){c||(c={});this.container=this.create(c.container||this.container);c.model&&(this.model=c.model);c.template&&(this.template=c.template);this.events=c.events?b.merge(this.events,c.events):this.events;this.attachEvents(this.events);},destructor:function(){this.container&&this.container.remove(true);},attachEvents:function(g){var d=this.container,i=b.Object.owns,h,e,f,c;for(c in g){if(!i(g,c)){continue;}e=g[c];for(f in e){if(!i(e,f)){continue;}h=e[f];if(typeof h==="string"){h=this[h];}d.delegate(f,h,c,this);}}},create:function(c){return typeof c==="string"?b.Node.create(c):b.one(c);},remove:function(){this.container&&this.container.remove();return this;},render:function(){return this;}},{NAME:"view"});},"@VERSION@",{requires:["base-build","node-event-delegate"]});YUI.add("app",function(a){},"@VERSION@",{use:["controller","model","model-list","view"]}); \ No newline at end of file +YUI.add("controller",function(h){var d=h.HistoryHash,b=h.QueryString,f=h.Array,c=h.HistoryBase.html5&&(!h.UA.android||h.UA.android>=3),a=h.config.win.location,e="ready";function g(){g.superclass.constructor.apply(this,arguments);}h.Controller=h.extend(g,h.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(j){var i=this;j||(j={});i._routes=[];j.base&&(i.base=j.base);j.routes&&(i.routes=j.routes);if(h.Lang.isValue(j.dispatchOnInit)){i.dispatchOnInit=j.dispatchOnInit;}f.each(i.routes,function(k){i.route(k.path,k.callback,true);});if(c){i._history=new h.HistoryHTML5({force:true});i._history.after("change",i._afterHistoryChange,i);}else{h.on("hashchange",i._afterHistoryChange,h.config.win,i);}i.publish(e,{defaultFn:i._defReadyFn,fireOnce:true});i.once("initializedChange",function(){setTimeout(function(){i.fire(e,{dispatched:!!i._dispatched});},20);});},destructor:function(){if(c){this._history.detachAll();}else{h.detach("hashchange",this._afterHistoryChange,this);}},match:function(i){return f.filter(this._routes,function(j){return i.search(j.regex)>-1;});},replace:function(i){return this._save(i,true);},route:function(j,k){var i=[];this._routes.push({callback:k,keys:i,path:j,regex:this._getRegex(j,i)});return this;},save:function(i){return this._save(i);},_decode:function(i){return decodeURIComponent(i.replace(/\+/g," "));},_dispatch:function(m){var i=this.match(m),l,j;this._dispatched=true;if(!i||!i.length){return;}l=this._getRequest(m);j=this;function k(o){var q,p,n;if(o){h.error(o);}else{if((n=i.shift())){p=n.regex.exec(m);q=typeof n.callback==="string"?j[n.callback]:n.callback;if(p.length===n.keys.length+1){l.params=f.hash(n.keys,p.slice(1));}else{l.params={};f.each(p,function(s,r){l.params[r]=s;});}q.call(j,l,k);}}}k();},_getPath:(function(){var i=this;function j(l){var k=i.base;if(k&&l.indexOf(k)===0){l=l.substring(k.length);}return l;}return c?function(){return j(a.pathname);}:function(){var k=d.getHash();return k?k.replace(this._regexUrlQuery,""):j(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){var j=d.getHash(),i=j.match(this._regexUrlQuery);return j&&i?i[1]:a.search.substring(1);},_getRegex:function(j,i){if(j instanceof RegExp){return j;}j=j.replace(this._regexPathParam,function(l,k,m){i.push(m);return k==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+j+"$");},_getRequest:function(i){return{path:i,query:this._parseQuery(this._getQuery())};},_parseQuery:b&&b.parse?b.parse:function(m){var n=this._decode,p=m.split("&"),l=0,k=p.length,j={},o;for(;ln?1:0);});j=g.merge(i,{models:k,src:"sort"});i.silent?this._defRefreshFn(j):this.fire(f,j);return this;},sync:function(){var h=d(arguments,0,true).pop();if(typeof h==="function"){h();}},toArray:function(){return this._items.concat();},toJSON:function(){return this.map(function(h){return h.toJSON();});},_add:function(i,h){var j;h||(h={});if(!(i instanceof g.Model)){i=new this.model(i);}if(this._clientIdMap[i.get("clientId")]){g.error("Model already in list.");return;}j=g.merge(h,{index:this._findIndex(i),model:i});h.silent?this._defAddFn(j):this.fire(c,j);return i;},_attachList:function(h){h.lists.push(this);h.addTarget(this);},_clear:function(){d.each(this._items,this._detachList,this);this._clientIdMap={};this._idMap={};this._items=[];},_detachList:function(i){var h=d.indexOf(i.lists,this);if(h>-1){i.lists.splice(h,1);i.removeTarget(this);}},_findIndex:function(l){var i=this.comparator,j=this._items,h=j.length-1,m=0,n,k,o;if(!i||!j.length){return j.length;}o=i(l);while(m",events:{},template:"",initializer:function(c){c||(c={});this.container=this.create(c.container||this.container);c.model&&(this.model=c.model);c.template&&(this.template=c.template);this.events=c.events?b.merge(this.events,c.events):this.events;this.attachEvents(this.events);},destructor:function(){this.container&&this.container.remove(true);},attachEvents:function(g){var d=this.container,i=b.Object.owns,h,e,f,c;for(c in g){if(!i(g,c)){continue;}e=g[c];for(f in e){if(!i(e,f)){continue;}h=e[f];if(typeof h==="string"){h=this[h];}d.delegate(f,h,c,this);}}},create:function(c){return typeof c==="string"?b.Node.create(c):b.one(c);},remove:function(){this.container&&this.container.remove();return this;},render:function(){return this;}},{NAME:"view"});},"@VERSION@",{requires:["base-build","node-event-delegate"]});YUI.add("app",function(a){},"@VERSION@",{use:["controller","model","model-list","view"]}); \ No newline at end of file diff --git a/build/app/app.js b/build/app/app.js index 4891ee1251f..bd07aabc540 100644 --- a/build/app/app.js +++ b/build/app/app.js @@ -21,8 +21,9 @@ URLs. @uses Base **/ -var YArray = Y.Array, - QS = Y.QueryString, +var HistoryHash = Y.HistoryHash, + QS = Y.QueryString, + YArray = Y.Array, // Android versions lower than 3.0 are buggy and don't update // window.location after a pushState() call, so we fall back to hash-based @@ -175,11 +176,12 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); // Set up a history instance. - self._history = html5 ? - new Y.HistoryHTML5({force: true}) : - new Y.HistoryHash(); - - self._history.after('change', self._afterHistoryChange, self); + if (html5) { + self._history = new Y.HistoryHTML5({force: true}); + self._history.after('change', self._afterHistoryChange, self); + } else { + Y.on('hashchange', self._afterHistoryChange, Y.config.win, self); + } // Fire a 'ready' event once we're ready to route. We wait first for all // subclass initializers to finish, and then an additional 20ms to allow @@ -197,7 +199,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { }, destructor: function () { - this._history.detachAll(); + if (html5) { + this._history.detachAll(); + } else { + Y.detach('hashchange', this._afterHistoryChange, this); + } }, // -- Public Methods ------------------------------------------------------- @@ -241,7 +247,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -249,23 +255,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.replace('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.replace('/path/'); + // New URL: http://example.com/path/ + + controller.replace('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.replace('/'); // New URL: http://example.com/ @method replace - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see save() **/ - replace: function (url, state, title) { - return this._save(url, state, title, true); + replace: function (url) { + return this._save(url, true); }, /** @@ -318,8 +325,6 @@ Y.Controller = Y.extend(Controller, Y.Base, { @param {Object} callback.req.query Query hash representing the URL query string, if any. Parameter names are keys, and are mapped to parameter values. - @param {Object} callback.req.state State object associated with this - URL, if any. @param {Function} callback.next Callback to pass control to the next matching route. If you don't call this function, then no further route handlers will be executed, even if there are more that match. If you do @@ -348,7 +353,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL and create a history entry. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -356,23 +361,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.save('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.save('/path/'); + // New URL: http://example.com/path/ + + controller.save('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.save('/'); // New URL: http://example.com/ @method save - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see replace() **/ - save: function (url, state, title) { - return this._save(url, state, title); + save: function (url) { + return this._save(url); }, // -- Protected Methods ---------------------------------------------------- @@ -395,12 +401,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _dispatch @param {String} path URL path. - @param {Object} state State to pass to route handlers. @protected **/ - _dispatch: function (path, state) { + _dispatch: function (path) { var routes = this.match(path), - req, route, self; + req, self; this._dispatched = true; @@ -408,11 +413,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { return; } - req = this._getRequest(path, state); + req = this._getRequest(path); self = this; function next(err) { - var callback, matches; + var callback, matches, route; if (err) { Y.error(err); @@ -463,7 +468,10 @@ Y.Controller = Y.extend(Controller, Y.Base, { return html5 ? function () { return removeBase(location.pathname); } : function () { - return this._history.get('path') || removeBase(location.pathname); + var hash = HistoryHash.getHash(); + + return hash ? hash.replace(this._regexUrlQuery, '') : + removeBase(location.pathname); }; }()), @@ -477,12 +485,15 @@ Y.Controller = Y.extend(Controller, Y.Base, { _getQuery: html5 ? function () { return location.search.substring(1); } : function () { - return this._history.get('query') || location.search.substring(1); + var hash = HistoryHash.getHash(), + matches = hash.match(this._regexUrlQuery); + + return hash && matches ? matches[1] : location.search.substring(1); }, /** - Creates a regular expression from the specified route specification. If - _path_ is already a regex, it will be returned unmodified. + Creates a regular expression from the given route specification. If _path_ + is already a regex, it will be returned unmodified. @method _getRegex @param {String|RegExp} path Route path specification. @@ -509,32 +520,16 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _getRequest @param {String} path Current path being dispatched. - @param {Object} state Current state. @return {Object} Request object. @protected **/ - _getRequest: function (path, state) { + _getRequest: function (path) { return { path : path, - query: this._parseQuery(this._getQuery()), - state: state + query: this._parseQuery(this._getQuery()) }; }, - /** - Gets the current state, if any. - - @method _getState - @return {Object} Current state. - @protected - **/ - _getState: html5 ? function () { - return this._history.get(); - } : function () { - var jsonState = this._history.get('state'); - return jsonState ? Y.JSON.parse(jsonState) : {}; - }, - /** Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is available, this method will be an alias to that. @@ -568,55 +563,26 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _save @param {String} [url] URL for the history entry. - @param {Object} [state] State object associated with the history entry. - @param {String} [title] Page title associated with the history entry. This - is currently undocumented in the public `replace` and `save` methods, - since browsers don't currently do anything with it. @param {Boolean} [replace=false] If `true`, the current history entry will be replaced instead of a new one being added. @chainable @protected **/ - _save: function (url, state, title, replace) { - var jsonState, query; - - if (html5) { - if (typeof url === 'string') { - url = this.base + url; - } - } else { - // If we're not using HTML5 history, take over the history state for - // our own purposes and shove the implementer's state inside it as a - // JSON string. - jsonState = state && Y.JSON.stringify(state); - - // Extract a query string from the URL if there is one, then remove - // both the query and the hash portions of the URL so we can store - // just the path. - url = url.replace(this._regexUrlQuery, function (match, params) { - query = params; - return ''; - }); - - state = {path: url || this._getPath()}; - - query && (state.query = query); - jsonState && (state.state = jsonState); - } - - this._history[replace ? 'replace' : 'add'](state || {}, { - merge: false, - title: title, - url : url + _save: html5 ? function (url, replace) { + this._history[replace ? 'replace' : 'add'](null, { + url: typeof url === 'string' ? this.base + url : url }); + return this; + } : function (url, replace) { + HistoryHash[replace ? 'replaceHash' : 'setHash'](url); return this; }, // -- Protected Event Handlers --------------------------------------------- /** - Handles `history:change` events. + Handles `history:change` and `hashchange` events. @method _afterHistoryChange @param {EventFacade} e @@ -628,7 +594,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { // We need to yield control to the UI thread to allow the browser to // update window.location before we dispatch. setTimeout(function () { - self._dispatch(self._getPath(), self._getState()); + self._dispatch(self._getPath()); }, 1); }, @@ -643,7 +609,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ _defReadyFn: function (e) { if (this.dispatchOnInit && !e.dispatched) { - this._dispatch(this._getPath(), this._getState()); + this._dispatch(this._getPath()); } } }, { @@ -651,7 +617,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); -}, '@VERSION@' ,{optional:['querystring-parse'], requires:['array-extras', 'base-build', 'history', 'json']}); +}, '@VERSION@' ,{requires:['array-extras', 'base-build', 'history', 'json'], optional:['querystring-parse']}); YUI.add('model', function(Y) { /** diff --git a/build/app/controller-debug.js b/build/app/controller-debug.js index abdfecc1547..27190e4c7c4 100644 --- a/build/app/controller-debug.js +++ b/build/app/controller-debug.js @@ -21,8 +21,9 @@ URLs. @uses Base **/ -var YArray = Y.Array, - QS = Y.QueryString, +var HistoryHash = Y.HistoryHash, + QS = Y.QueryString, + YArray = Y.Array, // Android versions lower than 3.0 are buggy and don't update // window.location after a pushState() call, so we fall back to hash-based @@ -175,11 +176,12 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); // Set up a history instance. - self._history = html5 ? - new Y.HistoryHTML5({force: true}) : - new Y.HistoryHash(); - - self._history.after('change', self._afterHistoryChange, self); + if (html5) { + self._history = new Y.HistoryHTML5({force: true}); + self._history.after('change', self._afterHistoryChange, self); + } else { + Y.on('hashchange', self._afterHistoryChange, Y.config.win, self); + } // Fire a 'ready' event once we're ready to route. We wait first for all // subclass initializers to finish, and then an additional 20ms to allow @@ -197,7 +199,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { }, destructor: function () { - this._history.detachAll(); + if (html5) { + this._history.detachAll(); + } else { + Y.detach('hashchange', this._afterHistoryChange, this); + } }, // -- Public Methods ------------------------------------------------------- @@ -241,7 +247,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -249,23 +255,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.replace('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.replace('/path/'); + // New URL: http://example.com/path/ + + controller.replace('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.replace('/'); // New URL: http://example.com/ @method replace - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see save() **/ - replace: function (url, state, title) { - return this._save(url, state, title, true); + replace: function (url) { + return this._save(url, true); }, /** @@ -320,8 +327,6 @@ Y.Controller = Y.extend(Controller, Y.Base, { @param {Object} callback.req.query Query hash representing the URL query string, if any. Parameter names are keys, and are mapped to parameter values. - @param {Object} callback.req.state State object associated with this - URL, if any. @param {Function} callback.next Callback to pass control to the next matching route. If you don't call this function, then no further route handlers will be executed, even if there are more that match. If you do @@ -350,7 +355,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { Behind the scenes, this method uses HTML5 `pushState()` in browsers that support it (or the location hash in older browsers and IE) to change the - URL and create a history entry for the given state. + URL and create a history entry. The specified URL must share the same origin (i.e., protocol, host, and port) as the current page, or an error will occur. @@ -358,23 +363,24 @@ Y.Controller = Y.extend(Controller, Y.Base, { @example // Starting URL: http://example.com/ - controller.save('/bar/', {bar: true}); - // New URL: http://example.com/bar/ + controller.save('/path/'); + // New URL: http://example.com/path/ + + controller.save('/path?foo=bar'); + // New URL: http://example.com/path?foo=bar controller.save('/'); // New URL: http://example.com/ @method save - @param {String} [url] URL to set. May be relative or absolute, but if a - `base` property is specified, this URL must be relative to that property. - If not specified, the page's current URL will be used. - @param {Object} [state] State object to associate with this history entry. - May be any object that can be serialized to JSON. + @param {String} [url] URL to set. Should be a relative URL. If this + controller's `base` property is set, this URL must be relative to the + base URL. If no URL is specified, the page's current URL will be used. @chainable @see replace() **/ - save: function (url, state, title) { - return this._save(url, state, title); + save: function (url) { + return this._save(url); }, // -- Protected Methods ---------------------------------------------------- @@ -397,12 +403,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _dispatch @param {String} path URL path. - @param {Object} state State to pass to route handlers. @protected **/ - _dispatch: function (path, state) { + _dispatch: function (path) { var routes = this.match(path), - req, route, self; + req, self; this._dispatched = true; @@ -410,11 +415,11 @@ Y.Controller = Y.extend(Controller, Y.Base, { return; } - req = this._getRequest(path, state); + req = this._getRequest(path); self = this; function next(err) { - var callback, matches; + var callback, matches, route; if (err) { Y.error(err); @@ -465,7 +470,10 @@ Y.Controller = Y.extend(Controller, Y.Base, { return html5 ? function () { return removeBase(location.pathname); } : function () { - return this._history.get('path') || removeBase(location.pathname); + var hash = HistoryHash.getHash(); + + return hash ? hash.replace(this._regexUrlQuery, '') : + removeBase(location.pathname); }; }()), @@ -479,12 +487,15 @@ Y.Controller = Y.extend(Controller, Y.Base, { _getQuery: html5 ? function () { return location.search.substring(1); } : function () { - return this._history.get('query') || location.search.substring(1); + var hash = HistoryHash.getHash(), + matches = hash.match(this._regexUrlQuery); + + return hash && matches ? matches[1] : location.search.substring(1); }, /** - Creates a regular expression from the specified route specification. If - _path_ is already a regex, it will be returned unmodified. + Creates a regular expression from the given route specification. If _path_ + is already a regex, it will be returned unmodified. @method _getRegex @param {String|RegExp} path Route path specification. @@ -511,32 +522,16 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _getRequest @param {String} path Current path being dispatched. - @param {Object} state Current state. @return {Object} Request object. @protected **/ - _getRequest: function (path, state) { + _getRequest: function (path) { return { path : path, - query: this._parseQuery(this._getQuery()), - state: state + query: this._parseQuery(this._getQuery()) }; }, - /** - Gets the current state, if any. - - @method _getState - @return {Object} Current state. - @protected - **/ - _getState: html5 ? function () { - return this._history.get(); - } : function () { - var jsonState = this._history.get('state'); - return jsonState ? Y.JSON.parse(jsonState) : {}; - }, - /** Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is available, this method will be an alias to that. @@ -570,55 +565,26 @@ Y.Controller = Y.extend(Controller, Y.Base, { @method _save @param {String} [url] URL for the history entry. - @param {Object} [state] State object associated with the history entry. - @param {String} [title] Page title associated with the history entry. This - is currently undocumented in the public `replace` and `save` methods, - since browsers don't currently do anything with it. @param {Boolean} [replace=false] If `true`, the current history entry will be replaced instead of a new one being added. @chainable @protected **/ - _save: function (url, state, title, replace) { - var jsonState, query; - - if (html5) { - if (typeof url === 'string') { - url = this.base + url; - } - } else { - // If we're not using HTML5 history, take over the history state for - // our own purposes and shove the implementer's state inside it as a - // JSON string. - jsonState = state && Y.JSON.stringify(state); - - // Extract a query string from the URL if there is one, then remove - // both the query and the hash portions of the URL so we can store - // just the path. - url = url.replace(this._regexUrlQuery, function (match, params) { - query = params; - return ''; - }); - - state = {path: url || this._getPath()}; - - query && (state.query = query); - jsonState && (state.state = jsonState); - } - - this._history[replace ? 'replace' : 'add'](state || {}, { - merge: false, - title: title, - url : url + _save: html5 ? function (url, replace) { + this._history[replace ? 'replace' : 'add'](null, { + url: typeof url === 'string' ? this.base + url : url }); + return this; + } : function (url, replace) { + HistoryHash[replace ? 'replaceHash' : 'setHash'](url); return this; }, // -- Protected Event Handlers --------------------------------------------- /** - Handles `history:change` events. + Handles `history:change` and `hashchange` events. @method _afterHistoryChange @param {EventFacade} e @@ -630,7 +596,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { // We need to yield control to the UI thread to allow the browser to // update window.location before we dispatch. setTimeout(function () { - self._dispatch(self._getPath(), self._getState()); + self._dispatch(self._getPath()); }, 1); }, @@ -645,7 +611,7 @@ Y.Controller = Y.extend(Controller, Y.Base, { **/ _defReadyFn: function (e) { if (this.dispatchOnInit && !e.dispatched) { - this._dispatch(this._getPath(), this._getState()); + this._dispatch(this._getPath()); } } }, { @@ -653,4 +619,4 @@ Y.Controller = Y.extend(Controller, Y.Base, { }); -}, '@VERSION@' ,{optional:['querystring-parse'], requires:['array-extras', 'base-build', 'history', 'json']}); +}, '@VERSION@' ,{requires:['array-extras', 'base-build', 'history', 'json'], optional:['querystring-parse']}); diff --git a/build/app/controller-min.js b/build/app/controller-min.js index 66bdb2df9ad..903f4868e83 100644 --- a/build/app/controller-min.js +++ b/build/app/controller-min.js @@ -1 +1 @@ -YUI.add("controller",function(g){var e=g.Array,b=g.QueryString,c=g.HistoryBase.html5&&(!g.UA.android||g.UA.android>=3),a=g.config.win.location,d="ready";function f(){f.superclass.constructor.apply(this,arguments);}g.Controller=g.extend(f,g.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(i){var h=this;i||(i={});h._routes=[];i.base&&(h.base=i.base);i.routes&&(h.routes=i.routes);if(g.Lang.isValue(i.dispatchOnInit)){h.dispatchOnInit=i.dispatchOnInit;}e.each(h.routes,function(j){h.route(j.path,j.callback,true);});h._history=c?new g.HistoryHTML5({force:true}):new g.HistoryHash();h._history.after("change",h._afterHistoryChange,h);h.publish(d,{defaultFn:h._defReadyFn,fireOnce:true});h.once("initializedChange",function(){setTimeout(function(){h.fire(d,{dispatched:!!h._dispatched});},20);});},destructor:function(){this._history.detachAll();},match:function(h){return e.filter(this._routes,function(i){return h.search(i.regex)>-1;});},replace:function(h,i,j){return this._save(h,i,j,true);},route:function(i,j){var h=[];this._routes.push({callback:j,keys:h,path:i,regex:this._getRegex(i,h)});return this;},save:function(h,i,j){return this._save(h,i,j);},_decode:function(h){return decodeURIComponent(h.replace(/\+/g," "));},_dispatch:function(n,m){var h=this.match(n),l,j,i;this._dispatched=true;if(!h||!h.length){return;}l=this._getRequest(n,m);i=this;function k(o){var q,p;if(o){g.error(o);}else{if((j=h.shift())){p=j.regex.exec(n);q=typeof j.callback==="string"?i[j.callback]:j.callback;if(p.length===j.keys.length+1){l.params=e.hash(j.keys,p.slice(1));}else{l.params={};e.each(p,function(s,r){l.params[r]=s;});}q.call(i,l,k);}}}k();},_getPath:(function(){var h=this;function i(k){var j=h.base;if(j&&k.indexOf(j)===0){k=k.substring(j.length);}return k;}return c?function(){return i(a.pathname);}:function(){return this._history.get("path")||i(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){return this._history.get("query")||a.search.substring(1);},_getRegex:function(i,h){if(i instanceof RegExp){return i;}i=i.replace(this._regexPathParam,function(k,j,l){h.push(l);return j==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+i+"$");},_getRequest:function(i,h){return{path:i,query:this._parseQuery(this._getQuery()),state:h};},_getState:c?function(){return this._history.get();}:function(){var h=this._history.get("state");return h?g.JSON.parse(h):{};},_parseQuery:b&&b.parse?b.parse:function(l){var m=this._decode,o=l.split("&"),k=0,j=o.length,h={},n;for(;k=3),a=h.config.win.location,e="ready";function g(){g.superclass.constructor.apply(this,arguments);}h.Controller=h.extend(g,h.Base,{base:"",routes:[],_regexPathParam:/([:*])([\w\d-]+)/g,_regexUrlQuery:/\?([^#]*).*$/,initializer:function(j){var i=this;j||(j={});i._routes=[];j.base&&(i.base=j.base);j.routes&&(i.routes=j.routes);if(h.Lang.isValue(j.dispatchOnInit)){i.dispatchOnInit=j.dispatchOnInit;}f.each(i.routes,function(k){i.route(k.path,k.callback,true);});if(c){i._history=new h.HistoryHTML5({force:true});i._history.after("change",i._afterHistoryChange,i);}else{h.on("hashchange",i._afterHistoryChange,h.config.win,i);}i.publish(e,{defaultFn:i._defReadyFn,fireOnce:true});i.once("initializedChange",function(){setTimeout(function(){i.fire(e,{dispatched:!!i._dispatched});},20);});},destructor:function(){if(c){this._history.detachAll();}else{h.detach("hashchange",this._afterHistoryChange,this);}},match:function(i){return f.filter(this._routes,function(j){return i.search(j.regex)>-1;});},replace:function(i){return this._save(i,true);},route:function(j,k){var i=[];this._routes.push({callback:k,keys:i,path:j,regex:this._getRegex(j,i)});return this;},save:function(i){return this._save(i);},_decode:function(i){return decodeURIComponent(i.replace(/\+/g," "));},_dispatch:function(m){var i=this.match(m),l,j;this._dispatched=true;if(!i||!i.length){return;}l=this._getRequest(m);j=this;function k(o){var q,p,n;if(o){h.error(o);}else{if((n=i.shift())){p=n.regex.exec(m);q=typeof n.callback==="string"?j[n.callback]:n.callback;if(p.length===n.keys.length+1){l.params=f.hash(n.keys,p.slice(1));}else{l.params={};f.each(p,function(s,r){l.params[r]=s;});}q.call(j,l,k);}}}k();},_getPath:(function(){var i=this;function j(l){var k=i.base;if(k&&l.indexOf(k)===0){l=l.substring(k.length);}return l;}return c?function(){return j(a.pathname);}:function(){var k=d.getHash();return k?k.replace(this._regexUrlQuery,""):j(a.pathname);};}()),_getQuery:c?function(){return a.search.substring(1);}:function(){var j=d.getHash(),i=j.match(this._regexUrlQuery);return j&&i?i[1]:a.search.substring(1);},_getRegex:function(j,i){if(j instanceof RegExp){return j;}j=j.replace(this._regexPathParam,function(l,k,m){i.push(m);return k==="*"?"(.*?)":"([^/]*)";});return new RegExp("^"+j+"$");},_getRequest:function(i){return{path:i,query:this._parseQuery(this._getQuery())};},_parseQuery:b&&b.parse?b.parse:function(m){var n=this._decode,p=m.split("&"),l=0,k=p.length,j={},o;for(;l Date: Fri, 10 Jun 2011 10:14:53 -0700 Subject: [PATCH 19/78] Remove Controller's json dependency. --- src/app/app-controller.properties | 2 +- src/app/meta/app.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/app-controller.properties b/src/app/app-controller.properties index 63988b05bb7..5c8e23ca41a 100644 --- a/src/app/app-controller.properties +++ b/src/app/app-controller.properties @@ -6,4 +6,4 @@ global.build.component=${srcdir}/build/app component=controller component.jsfiles=controller.js component.optional=querystring-parse -component.requires=array-extras, base-build, history, json +component.requires=array-extras, base-build, history diff --git a/src/app/meta/app.json b/src/app/meta/app.json index e5f5b3fdf97..7f2b6efc3b0 100644 --- a/src/app/meta/app.json +++ b/src/app/meta/app.json @@ -5,7 +5,7 @@ "submodules": { "controller": { "optional": ["querystring-parse"], - "requires": ["array-extras", "base-build", "history", "json"] + "requires": ["array-extras", "base-build", "history"] }, "model": { From 4f3d595b5be429e660aff77c04f66411e896eef7 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Fri, 10 Jun 2011 14:59:02 -0700 Subject: [PATCH 20/78] Fix IE6/7 bug in which replacing the hash would add a new history entry. [Fixes #2530301] --- src/history/js/history-hash-ie.js | 7 +++-- src/history/js/history-hash.js | 26 ++++++++++--------- src/history/tests/manual/history-hash-ie.html | 15 ++++++++--- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/history/js/history-hash-ie.js b/src/history/js/history-hash-ie.js index f2f0877c543..93295c61d8e 100644 --- a/src/history/js/history-hash-ie.js +++ b/src/history/js/history-hash-ie.js @@ -59,18 +59,17 @@ if (Y.UA.ie && !Y.HistoryBase.nativeHashChange) { return; } - Y.log('updating history iframe: ' + hash, 'info', 'history'); - - iframeDoc.open().close(); + Y.log('updating history iframe: ' + hash + ', replace: ' + !!replace, 'info', 'history'); if (replace) { iframeLocation.replace(hash.charAt(0) === '#' ? hash : '#' + hash); } else { + iframeDoc.open().close(); iframeLocation.hash = hash; } }; - Do.after(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); + Do.before(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); if (!iframe) { Y.on('domready', function () { diff --git a/src/history/js/history-hash.js b/src/history/js/history-hash.js index 1451439a1c3..5a1e93626bc 100644 --- a/src/history/js/history-hash.js +++ b/src/history/js/history-hash.js @@ -217,7 +217,7 @@ Y.extend(HistoryHash, HistoryBase, { return prefix && hash.indexOf(prefix) === 0 ? hash.replace(prefix, '') : hash; } : function () { - var hash = location.hash.substr(1), + var hash = location.hash.substring(1), prefix = HistoryHash.hashPrefix; // Slight code duplication here, but execution speed is of the essence @@ -291,7 +291,7 @@ Y.extend(HistoryHash, HistoryBase, { */ replaceHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.replace('#' + (HistoryHash.hashPrefix || '') + hash); @@ -307,7 +307,7 @@ Y.extend(HistoryHash, HistoryBase, { */ setHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.hash = (HistoryHash.hashPrefix || '') + hash; @@ -444,22 +444,24 @@ if (HistoryBase.nativeHashChange) { GlobalEnv._hashPoll = Y.later(50, null, function () { var newHash = HistoryHash.getHash(), - newUrl; + facade, newUrl; if (oldHash !== newHash) { newUrl = HistoryHash.getUrl(); - YArray.each(hashNotifiers.concat(), function (notifier) { - notifier.fire({ - oldHash: oldHash, - oldUrl : oldUrl, - newHash: newHash, - newUrl : newUrl - }); - }); + facade = { + oldHash: oldHash, + oldUrl : oldUrl, + newHash: newHash, + newUrl : newUrl + }; oldHash = newHash; oldUrl = newUrl; + + YArray.each(hashNotifiers.concat(), function (notifier) { + notifier.fire(facade); + }); } }, null, true); } diff --git a/src/history/tests/manual/history-hash-ie.html b/src/history/tests/manual/history-hash-ie.html index bfc4655bd60..b30ce45f242 100644 --- a/src/history/tests/manual/history-hash-ie.html +++ b/src/history/tests/manual/history-hash-ie.html @@ -34,6 +34,11 @@

history-hash-ie test

  • + +

    + + +

    @@ -48,7 +53,8 @@

    history-hash-ie test

    var Y = YUI({ filter: 'raw', filters: { - history: 'debug' + history: 'debug', + 'history-hash-ie': 'debug' }, useBrowserConsole: false }).use('console', 'event-delegate', 'history-hash-ie', 'json-stringify', function (Y) { @@ -88,8 +94,11 @@

    history-hash-ie test

    }); menuNode.delegate('click', function (e) { - var node = e.currentTarget; - history.addValue(node.get('id'), node.get('checked') ? '1' : null); + var node = e.currentTarget, + add = Y.one('#add'); + + history[add.get('checked') ? 'addValue' : 'replaceValue']( + node.get('id'), node.get('checked') ? '1' : null); }, 'input'); if (!Y.UA.ie || Y.UA.ie > 7) { From d5168ea7da2c09fc29d278d53f0a0c69c38be6c4 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Fri, 10 Jun 2011 14:59:23 -0700 Subject: [PATCH 21/78] Build history. --- build/history/history-debug.js | 33 +++++++++++++------------- build/history/history-hash-debug.js | 26 ++++++++++---------- build/history/history-hash-ie-debug.js | 7 +++--- build/history/history-hash-ie-min.js | 2 +- build/history/history-hash-ie.js | 5 ++-- build/history/history-hash-min.js | 2 +- build/history/history-hash.js | 26 ++++++++++---------- build/history/history-min.js | 2 +- build/history/history.js | 31 ++++++++++++------------ 9 files changed, 69 insertions(+), 65 deletions(-) diff --git a/build/history/history-debug.js b/build/history/history-debug.js index 7e81bfb31cf..0a1e43e0b46 100644 --- a/build/history/history-debug.js +++ b/build/history/history-debug.js @@ -851,7 +851,7 @@ Y.extend(HistoryHash, HistoryBase, { return prefix && hash.indexOf(prefix) === 0 ? hash.replace(prefix, '') : hash; } : function () { - var hash = location.hash.substr(1), + var hash = location.hash.substring(1), prefix = HistoryHash.hashPrefix; // Slight code duplication here, but execution speed is of the essence @@ -925,7 +925,7 @@ Y.extend(HistoryHash, HistoryBase, { */ replaceHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.replace('#' + (HistoryHash.hashPrefix || '') + hash); @@ -941,7 +941,7 @@ Y.extend(HistoryHash, HistoryBase, { */ setHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.hash = (HistoryHash.hashPrefix || '') + hash; @@ -1078,22 +1078,24 @@ if (HistoryBase.nativeHashChange) { GlobalEnv._hashPoll = Y.later(50, null, function () { var newHash = HistoryHash.getHash(), - newUrl; + facade, newUrl; if (oldHash !== newHash) { newUrl = HistoryHash.getUrl(); - YArray.each(hashNotifiers.concat(), function (notifier) { - notifier.fire({ - oldHash: oldHash, - oldUrl : oldUrl, - newHash: newHash, - newUrl : newUrl - }); - }); + facade = { + oldHash: oldHash, + oldUrl : oldUrl, + newHash: newHash, + newUrl : newUrl + }; oldHash = newHash; oldUrl = newUrl; + + YArray.each(hashNotifiers.concat(), function (notifier) { + notifier.fire(facade); + }); } }, null, true); } @@ -1172,18 +1174,17 @@ if (Y.UA.ie && !Y.HistoryBase.nativeHashChange) { return; } - Y.log('updating history iframe: ' + hash, 'info', 'history'); - - iframeDoc.open().close(); + Y.log('updating history iframe: ' + hash + ', replace: ' + !!replace, 'info', 'history'); if (replace) { iframeLocation.replace(hash.charAt(0) === '#' ? hash : '#' + hash); } else { + iframeDoc.open().close(); iframeLocation.hash = hash; } }; - Do.after(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); + Do.before(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); if (!iframe) { Y.on('domready', function () { diff --git a/build/history/history-hash-debug.js b/build/history/history-hash-debug.js index f09b57b1c20..8e11e4401d0 100644 --- a/build/history/history-hash-debug.js +++ b/build/history/history-hash-debug.js @@ -219,7 +219,7 @@ Y.extend(HistoryHash, HistoryBase, { return prefix && hash.indexOf(prefix) === 0 ? hash.replace(prefix, '') : hash; } : function () { - var hash = location.hash.substr(1), + var hash = location.hash.substring(1), prefix = HistoryHash.hashPrefix; // Slight code duplication here, but execution speed is of the essence @@ -293,7 +293,7 @@ Y.extend(HistoryHash, HistoryBase, { */ replaceHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.replace('#' + (HistoryHash.hashPrefix || '') + hash); @@ -309,7 +309,7 @@ Y.extend(HistoryHash, HistoryBase, { */ setHash: function (hash) { if (hash.charAt(0) === '#') { - hash = hash.substr(1); + hash = hash.substring(1); } location.hash = (HistoryHash.hashPrefix || '') + hash; @@ -446,22 +446,24 @@ if (HistoryBase.nativeHashChange) { GlobalEnv._hashPoll = Y.later(50, null, function () { var newHash = HistoryHash.getHash(), - newUrl; + facade, newUrl; if (oldHash !== newHash) { newUrl = HistoryHash.getUrl(); - YArray.each(hashNotifiers.concat(), function (notifier) { - notifier.fire({ - oldHash: oldHash, - oldUrl : oldUrl, - newHash: newHash, - newUrl : newUrl - }); - }); + facade = { + oldHash: oldHash, + oldUrl : oldUrl, + newHash: newHash, + newUrl : newUrl + }; oldHash = newHash; oldUrl = newUrl; + + YArray.each(hashNotifiers.concat(), function (notifier) { + notifier.fire(facade); + }); } }, null, true); } diff --git a/build/history/history-hash-ie-debug.js b/build/history/history-hash-ie-debug.js index 425f5fbce7f..1e2e9a0969f 100644 --- a/build/history/history-hash-ie-debug.js +++ b/build/history/history-hash-ie-debug.js @@ -61,18 +61,17 @@ if (Y.UA.ie && !Y.HistoryBase.nativeHashChange) { return; } - Y.log('updating history iframe: ' + hash, 'info', 'history'); - - iframeDoc.open().close(); + Y.log('updating history iframe: ' + hash + ', replace: ' + !!replace, 'info', 'history'); if (replace) { iframeLocation.replace(hash.charAt(0) === '#' ? hash : '#' + hash); } else { + iframeDoc.open().close(); iframeLocation.hash = hash; } }; - Do.after(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); + Do.before(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true); if (!iframe) { Y.on('domready', function () { diff --git a/build/history/history-hash-ie-min.js b/build/history/history-hash-ie-min.js index af7996d9fd6..0e4cf68ccb8 100644 --- a/build/history/history-hash-ie-min.js +++ b/build/history/history-hash-ie-min.js @@ -1 +1 @@ -YUI.add("history-hash-ie",function(g){if(g.UA.ie&&!g.HistoryBase.nativeHashChange){var c=g.Do,d=YUI.namespace("Env.HistoryHash"),b=g.HistoryHash,e=d._iframe,f=g.config.win,a=f.location;b.getIframeHash=function(){if(!e||!e.contentWindow){return"";}var h=b.hashPrefix,i=e.contentWindow.location.hash.substr(1);return h&&i.indexOf(h)===0?i.replace(h,""):i;};b._updateIframe=function(i,h){var j=e&&e.contentWindow&&e.contentWindow.document,k=j&&j.location;if(!j||!k){return;}j.open().close();if(h){k.replace(i.charAt(0)==="#"?i:"#"+i);}else{k.hash=i;}};c.after(b._updateIframe,b,"replaceHash",b,true);if(!e){g.on("domready",function(){var h=b.getHash();e=d._iframe=g.Node.getDOMNode(g.Node.create(' - - - -
    - -

    Using the shim

    -

    Full source code for this example.

    - -
    YUI().use('dd-ddm', 'dd-drag', 'dd-proxy', function(Y) {
    -        //Toggling the buttons
    -        Y.one('#shim').on('click', function(e) {
    -            var value = e.target.get('value');
    -            if (value == 'off' || value == 'Shim Off') {
    -                dd.set('useShim', true);
    -                e.target.set('value', 'on');
    -                e.target.set('innerHTML', 'Shim On');
    -                Y.one('#debugShim').set('disabled', false);
    -            } else {
    -                dd.set('useShim', false);
    -                e.target.set('value', 'off');
    -                e.target.set('innerHTML', 'Shim Off');
    -                Y.one('#debugShim').set('disabled', true);
    -            }
    -        });
    -        
    -        Y.one('#debugShim').on('click', function(e) {
    -            var value = e.target.get('value');
    -            if (value == 'off' || value == 'Debug Off') {
    -                Y.DD.DDM._debugShim = true;
    -                e.target.set('value', 'on');
    -                e.target.set('innerHTML', 'Debug On');
    -            } else {
    -                Y.DD.DDM._debugShim = false;
    -                e.target.set('value', 'off');
    -                e.target.set('innerHTML', 'Debug Off');
    -            }
    -        });
    -        
    -        var dd = new Y.DD.Drag({
    -            //Selector of the node to make draggable
    -            node: '#demo',
    -            useShim: false
    -        }).plug(Y.Plugin.DDProxy, {
    -            offsetNode: false,
    -            resizeFrame: false
    -        });
    -        dd.on('drag:start', function() {
    -            this.get('dragNode').setStyles({
    -                height: '20px',
    -                width: '100px',
    -                backgroundColor: 'blue',
    -                color: '#fff'
    -            });
    -            this.get('dragNode').set('innerHTML', 'Custom Proxy');
    -            this.deltaXY = [this.deltaXY[0] - 20, this.deltaXY[1] - 20];
    -        });
    -});
    - - - - - - - - - - - - - diff --git a/docs/dd/simple-drag.html b/docs/dd/simple-drag.html deleted file mode 100644 index ddf81d6445b..00000000000 --- a/docs/dd/simple-drag.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - Example: Simple Drag - - - - - - - -
    -

    Example: Simple Drag

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows a simple drag interaction that doesn't require a drop interaction.

    -
    - -
    - - -
    Drag Me
    - - - - -
    - -

    Setting up the Node

    -

    First we need to create an HTML Node to make draggable.

    -
    <div id="demo">Drag Me</div>
    - - -

    Now we give that Node some CSS to make it visible.

    - -
    #demo {
    -    height: 100px;
    -    width: 100px;
    -    border: 1px solid black;
    -    background-color: #8DD5E7;
    -    cursor: move;
    -}
    - - -

    Setting up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the dd-drag module.

    - -
    YUI().use('dd-drag');
    - - - -

    Making the Node draggable

    -

    Now that we have a YUI instance with the dd-drag module, we need to instantiate the Drag instance on this Node.

    - -
    YUI().use('dd-drag', function(Y) {
    -    //Selector of the node to make draggable
    -    var dd = new Y.DD.Drag({
    -        node: '#demo'
    -    });   
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dd/winscroll.html b/docs/dd/winscroll.html deleted file mode 100644 index 93ac4e1444b..00000000000 --- a/docs/dd/winscroll.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - Example: Window Scrolling - - - - - - - -
    -

    Example: Window Scrolling

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how you can use the DD Scroll plugin to scroll the browser window as you drag.

    -
    - -
    - - -

    x

    Drag Me
    - - - - - -
    - -

    Setting up the Node

    -

    First we need to create an HTML Node to make draggable.

    - -
    <div id="demo"><h2>x</h2>Drag Me</div>
    - - -

    Now we give that Node some CSS to make it visible.

    - -
    #demo {
    -    height: 100px;
    -    width: 100px;
    -    border: 1px solid black;
    -    background-color: #8DD5E7;
    -    padding: 7px;
    -    position: relative;
    -}
    -#demo h2 {
    -    padding: 0;
    -    margin: 0;
    -    position: absolute;
    -    top: 5px;
    -    right: 5px;
    -    font-size: 110%;
    -    color: black;
    -    font-weight: bold;
    -    cursor: move;
    -}
    - - -

    Setting up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the dd-drag and dd-scroll modules.

    - -
    YUI().use('dd-drag', 'dd-scroll');
    - - -

    Making the Node draggable with DD

    -

    Now that we have a YUI instance with the dd-drag and dd-scroll modules, we need to instantiate a DD instance from this Node.

    - -
    var dd = new Y.DD.Drag({
    -    node: '#demo'
    -}).addHandle('h2');
    - - -

    Making the Window Scroll

    -

    Now that we have a draggable Node, we need to plug the Plugin.DDWinScroll plugin onto the Drag instance.

    - -
    var dd = new Y.DD.Drag({
    -    node: '#demo'
    -}).addHandle('h2').plug(Y.Plugin.DDWinScroll);
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/dial-basic.html b/docs/dial/dial-basic.html deleted file mode 100644 index cb9e5ed3b11..00000000000 --- a/docs/dial/dial-basic.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - Example: Basic Dial - - - - - - - -
    -

    Example: Basic Dial

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how to create a Dial widget from existing HTML on the page.

    - -

    Drag the handle to set the value. When the handle has the focus, the following keys update its value: arrow keys, page up/down, home, and end. The action of these keys can be controlled via Dial's configuration attributes.

    -
    - -
    - -
    - - -
    - -

    Creating a Dial

    -

    A Dial can be created easily and rendered into existing markup.

    - -

    The Markup

    -

    The only markup requirement is an HTML element to contain the Dial.

    - -
    <div id="demo"></div>
    - -

    The JavaScript

    -

    Dial extends the Widget class, following the same pattern -as any widget constructor. As a result, it accepts a configuration object to -set the initial configuration for the widget.

    - -

    After creating and configuring the new Dial, -call the render method on the Dial object, passing it -the selector for a container element. -This renders it into the container and makes it usable.

    - -

    Some commonly used configuration attributes are shown below.

    - -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min:-220,
    -		max:220,
    -		stepsPerRevolution:100,
    -		value: 30
    -	});
    -	dial.render("#demo");
    -	
    -});
    - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/dial-image-background.html b/docs/dial/dial-image-background.html deleted file mode 100644 index c87a0bfd46b..00000000000 --- a/docs/dial/dial-image-background.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Example: Dial With Image Background - - - - - - - -
    -

    Example: Dial With Image Background

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how to create a Dial widget using background images for the ring and the handle.

    -
    - -
    - -
    - - - -
    - -

    Creating a Dial With Images as Backgrounds

    - -

    A Dial can be created that has its presentation determined by background images. -This can be done with CSS, providing the images can be contained within the dimensions of the Dial elements. -

    - -

    The Markup

    - -

    The only markup requirement is an element to contain the Dial

    - -
    <div id="demo"></div>
    - - -

    The JavaScript

    - -

    The same JavaScript can be used as in the basic Dial example.

    -

    Dial extends the Widget class, following the same pattern -as any widget constructor, accepting a configuration object to -set the initial configuration for the widget.

    - -

    After creating and configuring the new Dial, -call the render method on your Dial object passing it -the selector of a container object. -This renders it in the container and makes it usable.

    - -

    Some commonly used configuration attributes are shown below. -

    - -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min:-220,
    -		max:220,
    -		stepsPerRevolution:100,
    -		value: 30
    -	});
    -    dial.render("#demo");
    -	
    -});
    - -

    The CSS

    - -

    -In this example we add an image of a ball bearing to the dial handle object's background, this is the class yui3-dial-handle.

    - -

    We'll also add an image of a circle of radial lines to the background ring object. -To make these changes, we only need to do two things.

    - -
      -
    1. Remove some of the CSS styling on the elements we want to display as images.
    2. -
    3. Add the background URL to the image rule of the selectors of those objects as shown below.
    4. -
    - -
    .yui3-skin-sam .yui3-dial-content .yui3-dial-handle{
    -	background:url(../assets/dial/images/ball_bearing.png) no-repeat;
    -	opacity:1; /* Normally the handle is not full opacity */
    -}
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-ring{
    -	box-shadow: none;
    -	-moz-border-radius: none;
    -	-webkit-border-radius: none;
    -	-moz-box-shadow: none;
    -	background:url(../assets/dial/images/bkg_ring_of_lines.png) no-repeat scroll 0px 0px;
    -}
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-center-button {
    -	box-shadow: none;
    -	-moz-border-radius: none;
    -	-webkit-border-radius: none;
    -	-moz-box-shadow: none;
    -	background:none;
    -	opacity:1;
    -	/* Normally the center button is not full opacity. 
    -	In this case it doesn't matter since we are removing the 
    -	styles and not adding a bitmap */ 
    -}
    -/* Hide all the VML ovals in IE. */
    -.yui3-skin-sam .yui3-dial-ring-vml v\:oval {
    -	visibility:hidden;
    -}
    -/* Show the marker VML oval */
    -.yui3-skin-sam .yui3-dial-ring-vml .yui3-dial-marker-vml v\:oval {
    -	visibility:visible;
    -}
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-ring-vml{
    -	background:url(../assets/dial/images/bkg_ring_of_lines.png) no-repeat scroll 0px 0px;
    -}
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-handle-vml{
    -	background:url(../assets/dial/images/ball_bearing_8.png) no-repeat scroll 0px 0px;
    -	opacity:1; 
    -}
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-center-button-vml {
    -	background:url(../assets/dial/images/empty.png);
    -}
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/dial-image-surrounding.html b/docs/dial/dial-image-surrounding.html deleted file mode 100644 index c1697cfa5e0..00000000000 --- a/docs/dial/dial-image-surrounding.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - Example: Dial With a Surrounding Image - - - - - - - -
    -

    Example: Dial With a Surrounding Image

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how to create a Dial widget using an image -that surrounds (or is larger than) the Dial.

    -
    - -
    - - -
    - - -
    - -

    Creating a Dial and Surrounding It With a Larger Image

    - -

    Some cases may require a Dial that has an image surrounding it such as tick marks, units, or other -visual enhancements. These images can be larger than the ring of the dial and therefore may not fit as a background image. -To provide for this use case, an extra image object will need to be added to the DOM.

    - -

    -In this example we'll simulate the climate control on an car dashboard. -The image we'll add contains two curved wedges of color, blue and red, that wrap around the dial, -signifying the temperature of air conditioning or heat. -

    - -

    The Markup

    - -

    The only markup requirement is a div to contain the Dial.

    - -
    <div id="demo"></div>
    - - -

    The JavaScript

    - -

    The same JavaScript can be used as in the basic Dial example, with a bit of -extra code to add the image object.

    - -

    Some commonly used configuration attributes are shown below. -This example also shows how to modify the visible UI strings before the Dial renders.

    -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min: -90,
    -		max: 90,
    -		stepsPerRevolution: 200,
    -		value: 0,
    -		diameter: 100
    -	});
    -	//Setting visible HTML strings before Dial renders.
    -	dial.set('strings',{'label':'Climate:', 'resetStr':'Off', 'tooltipHandle':'Drag for cool or heat.'});
    -	dial.render("#demo");
    -
    -});
    - - - -

    Inserting the Image

    -

    After rendering the Dial, we create and insert the image object.

    -
    //Create an image node.
    -var im = Y.Node.create('<img src="../assets/dial/images/cold_hot.png"/>');
    -	
    -//Position it absolutely to the correct spot depending on it's size.
    -im.setStyles({'position':'absolute', 'top':'-3px', 'left':'-9px'});
    -	
    -//Insert it in the DOM.
    -//The north-mark is the first object inside the ring.
    -//depending on the image, you may need to insert it before the yui3-dial-label 
    -Y.one('.yui3-dial-north-mark').insert(im, 'before');
    - - -

    The CSS

    - -

    -Here, we are just cleaning out the visible styles of the ring and the center button. -This is optional. -

    -
    /* Adding some margin for the image */
    -.yui3-dial{
    -	margin:0 0 20px 20px;
    -}
    -/* Remove visible styles of the ring */
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-ring{
    -	box-shadow: none;
    -	-moz-border-radius: none;
    -	-webkit-border-radius: none;
    -	-moz-box-shadow: none;
    -	background:none;
    -}
    -/* Remove visible style of the center button */
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-center-button {
    -	box-shadow: none;
    -	-moz-border-radius: none;
    -	-webkit-border-radius: none;
    -	-moz-box-shadow: none;
    -	background:none;
    -}
    -/* Hide all VML ovals in IE. */
    -.yui3-skin-sam .yui3-dial-ring-vml v\:oval {
    -	visibility:hidden;
    -}
    -/* Show the marker and the handle ovals */
    -.yui3-skin-sam .yui3-dial-ring-vml .yui3-dial-marker-vml v\:oval,
    -.yui3-skin-sam .yui3-dial-ring-vml .yui3-dial-handle-vml v\:oval {
    -	visibility:visible;
    -}
    -/* Fill center button and ring so their backgrounds accept events in IE */
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-center-button-vml,
    -.yui3-skin-sam .yui3-dial-content .yui3-dial-ring-vml{
    -	background:url(../assets/dial/images/empty.png);
    -}
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/dial-interactive.html b/docs/dial/dial-interactive.html deleted file mode 100644 index b3f05907021..00000000000 --- a/docs/dial/dial-interactive.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - Example: Dial With Interactive UI - - - - - - - -
    -

    Example: Dial With Interactive UI

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This Dial widget example shows the following:

    - -
      -
    1. A demonstration of a large value range combined with fine increment control.
    2. -
    3. Setting UI strings before rendering
    4. -
    5. Setting configuration attributes
    6. -
    7. Construction-time event subscription allowing Dial to control an interactive UI
    8. -
    9. Calling one of Dial's value change methods from the click of a link. <a>Hubble</a>
    10. -
    -

    Notice the Dial can traverse the entire 6,000+ pixels of the scene height, but by pulling the handle -farther away from the Dial's center while rotating, the user can get 1 pixel movements, without strain. -After the dial has focus, the following keys also opperate the Dial, arrow up/down/left/right, page up/down, home, end. The action of these keys can be controlled via Dial's configuration attributes.

    -
    - -
    - - -
    -
    -
    -
    - - -
    hubble
    -
    thermosphere
    -
    mesosphere
    -
    stratosphere
    -
    troposphere
    -
    ozone
    -
    crust
    -
    mantle
    -
    -
    -
    -
    From Earth to Hubble
    -
    -
    -
    -
    - - - -
    - -

    Making a Dial Drive an Interactive UI

    - -

    The valueChange event of a Dial can be the means of controlling other UI displayed on a page.

    - -

    The Markup

    - -

    The only markup requirement for the Dial itself is an element to contain the Dial. -The rest of the markup and CSS in this example is just for the Hubble telescope visualization. -

    - -
    <div id="demo"></div>
    - - -

    The JavaScript

    - -

    This example builds on previous examples by showing how to modify the visible UI strings before the dial renders.

    - -

    During instatiation of a Dial, several configuration attributes can be set (see the code-block below); note the construction-time event subscription:

    - -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -			// The units in this example are Altitude in Kilometers...
    -			min:-35, 		// min altitude -35 Kilometers (below earth's surface)
    -			max:559, 		// max altitude = Hubble's orbit
    -			stepsPerRevolution:30, 	// One revolution of the Dial's handle will change the altitude this many units
    -			value: 0,		// starting altitude of sea level
    -			diameter: 100,		// diameter of the ring of the dial control in pixels
    -			minorStep: 1,		// keyboard (arrow key) changes this many units
    -			majorStep: 10,		// keyboard pg up/down changes this many units
    -			decimalPlaces: 2,	// display this many digits to the right of the decimal point
    -			
    -			// an object literal containing key-value pairs of the visible HTML strings in the Dial UI
    -			strings:{label:'Altitude in Kilometers:', resetStr: 'Reset', tooltipHandle: 'Drag to set'},
    -			
    -			// construction-time event subscription.
    -			// Whenever the value of this dial object changes, the event handler function (setSceneY) fires
    -            after : {
    -                valueChange: Y.bind( setSceneY, dial )
    -            }
    -	});
    -	dial.render("#demo");
    -	
    -});
    - - - -
    The Event Handler
    - -

    -Preceding the code that instantiates the Dial widget, declare the event handler. -We can use the value of the Dial to do whatever we want, but -in this example the event handler updates the CSS top property of the pictorial scene &lt;div id="scene"&gt; of Hubble's relationship to Earth. -This scene is moved up or down inside a framing element &lt;div class="viewframe"&gt; that has CSS overflow:hidden;. -The reason e.newVal is multiplied by 10 is so that the scene moves 10px for every 1 kilometer of the Dial's value. -

    - - - -
    /**
    -* The Dial's valueChange event is passed to this.
    -* sets the CSS top value of the pictoral scene of the earth to the hubble.
    -* This scene is an absolute positioned div inside another div with
    -* overflow set to hidden.
    -*/
    -setSceneY = function(e) {
    -	Y.one('#scene').setStyle('top', (originY + (e.newVal * 10)) + 'px');
    -}
    - - - -

    Full Code Listing

    - -

    The Markup

    -
    <div id="example_container">
    -<div id="view_frame">
    -	<div id="scene">
    -		<div id="stars"></div>
    -		<img id="hubble" src="../assets/dial/images/hubble.png"/>
    -		<img id="earth" src="../assets/dial/images/mountain_earth.png"/>
    -		<div class="label hubble">hubble</div>		
    -		<div class="label thermosphere">thermosphere</div>		
    -		<div class="label mesosphere">mesosphere</div>		
    -		<div class="label stratosphere">stratosphere</div>		
    -		<div class="label troposphere">troposphere</div>		
    -		<div class="label ozone">ozone</div>		
    -		<div class="label crust">crust</div>		
    -		<div class="label mantle">mantle</div>		
    -	</div>
    -</div>
    -<div class="controls">
    -	<div class="intro-sentence">From Earth to <a id="a-hubble">Hubble</a></div>
    -	<div id="altitude_mark"></div>
    -	<div id="demo"></div>
    -</div>
    -</div>
    - - - -

    The JavaScript

    -
    YUI().use('dial', function(Y) {
    -
    -var sceneH = Y.one('#scene').get('region').height,
    -subSea = 450,
    -viewFrameH = Y.one('#view_frame').get('region').height -2,
    -zeroPt = 100,
    -originY = -sceneH + subSea + viewFrameH - zeroPt;
    -Y.one('#scene').setStyle('top', originY + 'px');
    -setSceneY = function(e) {
    -	Y.one('#scene').setStyle('top', (originY + (e.newVal * 10)) + 'px');
    -    }
    -var dial = new Y.Dial({
    -		min:-35,
    -		max:559,
    -		stepsPerRevolution:30,
    -		value: 0,
    -		diameter: 100,
    -		minorStep: 1,
    -		majorStep: 10,
    -		decimalPlaces: 2, 
    -		strings:{label:'Altitude in Kilometers:', resetStr: 'Reset', tooltipHandle: 'Drag to set'},
    -		// construction-time event subscription
    -            after : {
    -                valueChange: Y.bind( setSceneY, dial )
    -            }
    -});
    -dial.render('#demo');
    -
    -// Function that calls a method in Dial that sets its value to the value of the max config attribute 
    -// Other methods available include,
    -// _setToMin(), _resetDial(), _incrMinor(), _decrMinor(), _incrMajor(), _decrMajor(),  
    -var setDialToMax = function(){
    -	this._setToMax();
    -}
    -
    -// Subscribe to the click of the "Hubble" anchor, passing the dial as the 'this'
    -Y.on('click', setDialToMax, '#a-hubble', dial);	
    -
    -});
    - - - -

    The CSS

    -
    #example_container {
    -	position:relative;
    -}
    -#demo{
    -	margin:0;
    -	position:absolute;
    -	top:321px;
    -	left:0;
    -}
    -.controls {
    -	position:absolute;
    -	top:0;
    -	left:328px;
    -	margin:0 0 0 0;
    -	color:#808080;
    -	width:300px;
    -}
    -.controls a {
    -	color:#4B78D9 !important; 
    -	cursor:pointer;
    -}
    -.intro-sentence{
    -	font-size: 183%;
    -	left: 0;
    -	line-height: 0.9em;
    -	position: absolute;
    -	top: 273px;
    -	width: 6em;
    -}
    -#view_frame{ 
    -	position:relative;
    -	height:500px;
    -	width:300px;
    -	border:solid 1px #cccccc;
    -	overflow:hidden;
    -}
    -#scene{position:absolute;
    -	left:0;
    -	top:-6440px;
    -	height:6440px;
    -	width:100%;
    -	background:url(../assets/dial/images/earth_to_hubble_bkg.png) repeat;
    -}
    -#altitude_mark {
    -	border-top:solid 1px #CCCCCC;
    -	left:-33px;
    -	position:absolute;
    -	top:403px;
    -	width:30px;
    -}
    -#earth{
    -	position:absolute;
    -	left:0;
    -	top:5834px;
    -	height:214px;
    -	width:300px;
    -}
    -#hubble{
    -	position:absolute;
    -	left:5px;
    -	top:7px;
    -	height:393px;
    -	width:300px;
    -}
    -#stars{
    -	position:absolute;
    -	left:0;
    -	top:0;
    -	background:url(../assets/dial/images/stars.png) repeat;
    -	height:5000px;
    -	width:300px;
    -}
    -.label{
    -	text-transform:uppercase;
    -	width:100%;
    -	letter-spacing:5px;
    -	font-family:Verdana;
    -	font-size:85%;
    -	position:absolute;
    -	left:0;
    -	text-align:center;
    -}
    -.hubble{
    -	bottom:6023px;
    -	color:#612C88;
    -}
    -.thermosphere{
    -	bottom:1290px;
    -	color:#5A009D;
    -}
    -.mesosphere{
    -	bottom:840px;
    -	color:#570BFF;
    -}
    -.stratosphere{
    -	bottom:540px;
    -	color:#006999;
    -}
    -.troposphere{
    -	bottom:477px;
    -	color:#036585;
    -}
    -.ozone{
    -	bottom:692px;
    -	color:#005AAE;
    -}
    -.crust{
    -	bottom:270px;
    -	color:#4F2D00;
    -}
    -.mantle{
    -	bottom:42px;
    -	color:#897701;
    -}
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/dial-text-input.html b/docs/dial/dial-text-input.html deleted file mode 100644 index cf9e619faea..00000000000 --- a/docs/dial/dial-text-input.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - Example: Dial Linked With Text Input - - - - - - - -
    -

    Example: Dial Linked With Text Input

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how to create a Dial widget and link it to a text input.

    -

    Drag the handle to set the value. When the handle has the focus, the following keys update its value: arrow keys, page up/down, home, and end. The action of these keys can be controlled via Dial's configuration attributes.

    -

    Typing valid values into the text input updates the dial.

    -
    - -
    - - -
    - - - - -
    - -

    Creating the Dial and a Text Input

    - -

    A Dial can be created easily and rendered into existing markup.

    - -

    The Markup

    - -

    This example includes an element to contain the Dial and a text input field.

    - -
    <div id="demo"></div>
    -<input id="myTextInput" value=""/>
    - - -

    The JavaScript

    - -

    Dial extends the Widget class, following the same pattern -as any widget constructor, accepting a configuration object to -set the initial configuration for the widget.

    - -

    After creating and configuring the new Dial, -call the render method on your Dial object passing it -the selector of a container element. -This renders it in the container and makes it usable.

    - -

    Some commonly used configuration attributes are shown below. -

    - -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min:-220,
    -		max:220,
    -		stepsPerRevolution:100,
    -		value: 30
    -	});
    -	dial.render("#demo");
    -	
    -});
    - - - -

    Linking the Dial to the Text Input

    - -

    To keep the Dial's value and a text input value in sync, we need to subscribe to events on both the text input and the Dial.

    -

    For sending Dial values to the input, the relevant Dial event is valueChange.

    -
    // Function to update the text input value from the Dial value
    -function updateInput( e ){
    -	var val = e.newVal;
    -	if ( isNaN( val ) ) {
    -		// Not a valid number.
    -		return;
    -	}
    -	this.set( "value", val );
    -}
    -
    -var theInput = Y.one( "#myTextInput" );
    -// Subscribe to the Dial's valueChange event, passing the input as the 'this'
    -dial.on( "valueChange", updateInput, theInput );
    - - - -

    Linking the Text Input to the Dial

    - -

    To send changes from the text input back to the Dial, we'll listen to the keyup event on theInput.

    -
    // Function to pass input value back to the Dial
    -function updateDial( e ){
    -	dial.set( "value" , e.target.get( "value" ) - 0);
    -}
    -theInput.on( "keyup", updateDial );
    - - - -

    Full Code Listing

    -

    The Markup

    - -
    <div id="demo"></div>
    -<input id="myTextInput" value=""/>
    - - -

    The JavaScript

    -
    YUI().use('dial', function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min:-220,
    -		max:220,
    -		stepsPerRevolution:100,
    -		value: 30
    -	});
    -	dial.render('#demo');
    -
    -
    -	// Function to update the text input value from the Dial value
    -	function updateInput( e ){
    -		var val = e.newVal;
    -		if ( isNaN( val ) ) {
    -			// Not a valid number.
    -			return;
    -		}
    -		this.set( "value", val );
    -	}
    -
    -	var theInput = Y.one( "#myTextInput" );
    -	// Subscribe to the Dial's valueChange event, passing the input as the 'this'
    -	dial.on( "valueChange", updateInput, theInput );
    -	
    -	// Function to pass input value back to the Slider
    -	function updateDial( e ){
    -		dial.set( "value" , e.target.get( "value" ) - 0);
    -	}
    -	theInput.on( "keyup", updateDial );
    -	
    -	// Initialize the input
    -	theInput.set('value', dial.get('value'));
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/dial/index.html b/docs/dial/index.html deleted file mode 100644 index 3c2cef2c74b..00000000000 --- a/docs/dial/index.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - Dial - - - - - - - -
    -

    Dial

    - - - Jump to Table of Contents - - -
    -
    -
    -

    - Screenshot of the Dial widget - The Dial widget is a circular value input control. It's like a real-world, analog volume control dial, but with much finer UI control. - Have you ever needed a slider with a 2000 unit range, wanted 1 unit accuracy, but didn't have 2000 pixels of real estate for a slider? - The Dial widget is made for cases like this. -

    -
    - -

    Getting Started

    - -

    -To include the source files for Dial and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('dial', function (Y) {
    -  // Dial is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    Using the Dial Widget

    -

    Anatomy of a Dial

    - -

    Dom Structure

    -

    - The major parts of a Dial are a ring, a marker, a user-draggable handle, and a reset button. - The ring is the background element and container of the other elements. - The marker is always displayed at a fixed but configurable distance from the dial center. - Its position around the dial indicates the current angle as the user drags the handle to adjust the value. - When not being dragged, the handle occupies the same space as the marker, and the marker is not displayed. - When the keyboard is used for input, the marker is not displayed. - The reset button restores the dial to the initial configuration value. -

    -

    A label string and a value string are dislayed above the dial. -

    -

    Like other form controls, Dials are inline elements.

    - illustration of the parts of a Dial - -

    Markup Structure

    -

    The final rendered Dial has the markup structure shown below:

    - -
    <div id="demo">
    -	<div class="yui3-widget yui3-dial">
    -		<div class="yui3-dial-content">
    -			<div class="yui3-dial-label" id="[custom YUI gen id for screen reader]">
    -				<span class="yui3-dial-label-string">My label</span>
    -				<span class="yui3-dial-value-string">30</span>
    -			</div>
    -			<div class="yui3-dial-ring">
    -				<div class="yui3-dial-north-mark"></div>
    -				<div class="yui3-dial-marker yui3-dial-marker-hidden"></div>
    -				<div class="yui3-dial-center-button">
    -					<div class="yui3-dial-reset-str"></div>
    -				</div>
    -				<div class="yui3-dial-handle yui3-dd-draggable" title="Drag to set value" tabindex="0" role="slider" aria-valuenow="30" aria-valuemin="-220" aria-valuemax="220" aria-valuetext="30" aria-labelledby="[custom YUI gen id for screen reader]"</div>
    -			</div>
    -		</div>
    -	</div>
    -</div>
    - -

    Instantiating the Dial

    -

    - The only markup required to instantiate a Dial is an HTML tag into which the widget will be rendered. -

    -
    <div id="demo"></div>
    - -

    Dial extends the Widget class, following the same pattern - as any widget constructor, accepting a configuration object to - set the initial configuration for the widget.

    - -

    Some commonly used configuration attributes are shown below.

    -
    YUI({...}).use('dial', function(Y) {
    -	var dial = new Y.Dial({
    -		min:-220,
    -		max:220,
    -		stepsPerRevolution:100,
    -		value: 30,
    -	});
    -});
    - -

    After creating and configuring the new Dial, - Call the render method on your Dial object, passing it - the selector of a container object. - This renders it in the container and makes it usable.

    -
    var dial = new Y.Dial({ ... });
    -dial.render("#demo");
    - - -

    Attributes

    -

    The following configuration properties are provided to define default values for each Dial widget:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    minMinimum input value allowed-220
    maxMaximum input value allowed220
    diameterDiameter of the dial control in pixels100
    centerButtonDiameterThe diameter of the center button. This value is a percentage of the diameter of the Dial widget.0.5
    markerDiameterThe diameter of the marker that follows the angle of the handle as it is dragged. This value is a diameter of the radius of the Dial widget.0.1
    handleDiameterThe diameter of the handle that sets the Dial value. This value is a percentage of the diameter of the Dial widget.0.2
    valueThe initial value which will set the UI display0
    minorStepValue is incremented/decremented by this value on arrow key press.1
    majorStepValue is incremented/decremented by this value on page up/down key press.10
    stepsPerRevolutionOne revolution of the dial add/subtracts this many value units.100
    decimalPlacesNumber of digits to the right of decimal point to keep in value.0
    stringsDisplay text strings are isolated in object literals and are handled through YUI's Internationalization utility. - See the examples for ways to replace these strings. - {label:'My label', resetStr:'Reset', tooltipHandle:'Drag to set value'}
    handleDistanceThis the distance from the center of the dial to the center of the marker and handle when at rest. This value is a percentage of the radius of the Dial widget.0.75
    -

    Setting and Constraining the Dial Value

    - -
    Setting and Getting Dial Values
    - -

    Like any input element, the most important thing about a Dial is its value. -value is managed as an attribute.

    - -
    // Specify value at construction
    -var dial = new Y.Dial({
    -    value  : 50
    -});
    -
    -// Get and set the value as an attribute
    -var val = dial.get('value');
    -
    -dial.set('value',val + 10);
    - -
    Constraining Dial Values
    -

    A Dial's value is constrained between the configured min and max attribute values. -Values outside this range are treated as the closer of min or max.

    - - -

    Configuring values for max and min that are respectively larger or smaller than the configured -stepsPerRevolution or -stepsPerRevolution can be used to configure a Dial to allow the user to drag the handle more than 360°. -By this means, a Dial can be configured to "go around and around," allowing a very large range of values.

    - -
    YUI({...}).use("dial", function(Y) {
    -
    -	var dial = new Y.Dial({
    -		min:-520,
    -		max:720,
    -		stepsPerRevolution:100,
    -		value: 30,
    -	});
    -    dial.render("#demo");
    -
    -});
    - - -
    Sync the UI If the Dial Was Rendered off the DOM
    -

    If a Dial is rendered off the DOM, you must call the Dial's syncUI() method after attaching it to the DOM - in order for the handle to be placed correctly. - When off DOM, the dimensional information necessary to place the handle is unavailable.

    - - -

    CSS

    - -

    The core structural CSS for the Dial is shown below. Widths and heights are in %. - These respond to the "diameter" configuration property

    - -
    /* VML implementation for IE */
    -v\:oval,
    -v\:shadow,
    -v\:fill {
    -    behavior: url(#default#VML);
    -    display: inline-block;
    -    zoom: 1; *display: inline; /* IE < 8: fake inline-block */
    -}
    -.yui3-dial{
    -	position:relative;
    -	display:-moz-inline-stack;
    -	display:inline-block;
    -	zoom:1;
    -	*display:inline;
    -}
    -.yui3-dial-content,
    -.yui3-dial-ring{
    -	position:relative;
    -}
    -.yui3-dial-handle,
    -.yui3-dial-marker,
    -.yui3-dial-center-button,
    -.yui3-dial-reset-string,
    -.yui3-dial-handle-vml,
    -.yui3-dial-marker-vml,
    -.yui3-dial-center-button-vml,
    -.yui3-dial-ring-vml v\:oval,
    -.yui3-dial-center-button-vml v\:oval
    -{
    -	position:absolute;
    -}
    -.yui3-dial-center-button-vml v\:oval {
    -	font-size:1px;
    -	top:0;
    -	left:0;
    -}
    -.yui3-skin-sam .yui3-dial-hidden {
    -	display:none;
    -}
    - - - - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/editor/editor-events.html b/docs/editor/editor-events.html deleted file mode 100644 index 8ca27537db8..00000000000 --- a/docs/editor/editor-events.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - Example: Editor Events - - - - - - - -
    -

    Example: Editor Events

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Use the Editor's Events

    -
    - -
    - - -
    -
    -

    Interact with the Editor instance below (click, type) and watch the console.

    -
    -
    -
    -
    - - - - - - -
    - -

    Working with EditorBase

    -

    EditorBase is not a fully functional Editor, it is simply the base utility that will be used under the hood to create an Editor.

    - -

    Creating the Editor

    -

    In this step we are going to do the initial render of the Editor, set its content and focus it when it's ready.

    - -
    YUI().use('editor', function(Y) {
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    //Rendering the Editor
    -    editor.render('#editor');
    -
    -});
    - - - -

    Full Example Source

    - -

    HTML

    -
    <div id="demo_holder" class="yui3-skin-sam">
    -    <div id="editor_cont">
    -        <p>Interact with the Editor instance below (click, type) and watch the console.</p>
    -        <div id="editor"></div>
    -    </div>
    -    <div id="console"></div>
    -</div>
    - - -

    CSS

    -
    #demo_holder {
    -    position: relative;
    -}
    -#editor_cont {
    -    width: 300px;
    -    border: 1px solid #999;
    -    margin: 2em;
    -    background-color: #f2f2f2;
    -}
    -#editor_cont p {
    -    margin: .5em;
    -}
    -#editor {
    -    height: 350px;
    -    background-color: #fff;
    -}
    -#example-canvas .yui3-console .yui3-console-title {
    -    border: 0 none;
    -    color: #000;
    -    font-size: 13px;
    -    font-weight: bold;
    -    margin: 0;
    -    text-transform: none;
    -}
    -#example-canvas .yui3-console .yui3-console-entry-meta {
    -    margin: 0;
    -}
    - - - -

    Javascript

    -
    YUI().use('editor', 'console', function(Y) {
    -
    -    (new Y.Console().render( "#console" ));
    -    
    -    Y.log('Interact with the Editor.');
    -
    -    var logFn = function(e) {
    -        var tag = e.frameTarget.get('tagName').toLowerCase();
    -        Y.log('Event: ' + e.type + ' on element (' + tag + ')');
    -    };
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    //Attaching a simple event to all DOM events
    -    Y.each(Y.Frame.DOM_EVENTS, function(v, k) {
    -        editor.on('dom:' + k, logFn);
    -    });
    -
    -    //Rendering the Editor
    -    editor.render('#editor');
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/editor/editor-exec.html b/docs/editor/editor-exec.html deleted file mode 100644 index f0187b8e1ee..00000000000 --- a/docs/editor/editor-exec.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - Example: ExecCommands - - - - - - - -
    -

    Example: ExecCommands

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Creating and using custom ExecCommands.

    -
    - -
    - - -

    Clicking on one of the buttons below will execute a custom execCommand on the Editor.

    - -
    -
    - - - -
    -
    -
     
    -
    - - - - - -
    - -

    Working with EditorBase

    -

    EditorBase is not a fully functional Editor, it is simply the base utility that will be used under the hood to create an Editor.

    - -

    Creating the Editor

    -

    In this step we are going to do the initial render of the Editor, set its content, and focus it when it's ready.

    - -
    YUI().use('editor', function(Y) {
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -});
    - - -

    Registering a new execCommand

    - -

    ExecCommand overrides are stored on the execCommand plugin. This way, you can write a plugin for Editor and have it available -to all Editor instances in your sandbox.

    - -

    To create a new execCommand, we simply add an object literal to the Y.Plugin.ExecCommand.COMMANDS static object like this:

    - -
    Y.mix(Y.Plugin.ExecCommand.COMMANDS, {
    -    foo: function(cmd, val) {
    -        logFn('You clicked on Foo');
    -        var inst = this.getInstance();
    -        inst.one('body').setStyle('backgroundColor', 'yellow');
    -    }
    -});
    - - -

    Now we can use this new command like:

    - -
    editor.execCommand('foo');
    - - - -

    Full Example Source

    - -

    HTML

    -
    <p>Clicking on one of the buttons below will execute a custom <code>execCommand</code> on the Editor.</p>
    -
    -<div id="editor_cont">
    -    <div id="buttons">
    -        <button id="foo">Foo Command</button>
    -        <button id="bar">Bar Command</button>
    -        <button id="baz">Baz Command</button>
    -    </div>
    -    <div id="editor"></div>
    -    <div id="out">&nbsp;</div>    
    -</div>
    - - -

    CSS

    -
    #editor_cont {
    -    width: 600px;
    -    border: 1px solid #999;
    -    margin: 2em;
    -    background-color: #f2f2f2;
    -}
    -#editor {
    -    height: 265px;
    -    background-color: #fff;
    -}
    -#buttons, #out {
    -    padding: 10px;
    -}
    -#buttons {
    -    border-bottom: 1px solid #999;
    -}
    -#out {
    -    font-weight: bold;
    -    border-top: 1px solid #999;
    -}
    - - - -

    Javascript

    -
    YUI().use('editor', function(Y) {
    -
    -    var logFn = function(str) {
    -        Y.one('#out').set('innerHTML', str);
    -    };
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -
    -    //Mixin the new commands
    -    Y.mix(Y.Plugin.ExecCommand.COMMANDS, {
    -        foo: function(cmd, val) {
    -            logFn('You clicked on Foo');
    -            var inst = this.getInstance();
    -            inst.one('body').setStyle('backgroundColor', 'yellow');
    -        },
    -        bar: function(cmd, val) {
    -            logFn('You clicked on Bar');
    -            var inst = this.getInstance();
    -            inst.one('body').setStyle('backgroundColor', 'green');
    -        },
    -        baz: function(cmd, val) {
    -            logFn('You clicked on Baz');
    -            var inst = this.getInstance();
    -            inst.one('body').setStyle('backgroundColor', 'blue');
    -        }
    -    });
    -    
    -    
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -    Y.delegate('click', function(e) {
    -        editor.execCommand(e.target.get('id'));
    -    }, '#buttons', 'button');
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/editor/editor-instance.html b/docs/editor/editor-instance.html deleted file mode 100644 index eab2c45004e..00000000000 --- a/docs/editor/editor-instance.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - Example: Using the Editor's instance - - - - - - - -
    -

    Example: Using the Editor's instance

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Use the Editor's instance to query the iframe

    -
    - -
    - - -

    Click the buttons below to query the Editor for its contents. You can even modify the contents and click them again to see the difference.

    - -
    -
    - - - -
    -
    -
     
    -
    - - - - - - -
    - -

    Working with EditorBase

    -

    EditorBase is not a fully functional Editor, it is simply the base utility that will be used under the hood to create an Editor.

    - -

    When the Editor is created, it creates a YUI instance inside itself and attaches that instance to the editable iframe. -This means that you now have the full power of YUI 3 inside the Editor iframe. You can use Event, Stylesheet, Node and even DD -inside the iframe, without having to load all the JavaScript inside the document. In this example we will show how to use the -internal YUI instance to get Node instances from the Editor.

    - -

    Getting access to this instance is simple. Just use the getInstance method on the Editor instance.

    - - -

    Creating the Editor

    -

    In this step we are going to do the initial render of the Editor, set its content, and focus it when it's ready.

    - -
    YUI().use('editor', function(Y) {
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    //Rendering the Editor
    -    editor.render('#editor');
    -
    -});
    - - -

    Full Example Source

    - -

    HTML

    -
    <div id="editor_cont">
    -    <div id="buttons">
    -        <button id="btags"># B tags?</button>
    -        <button id="itags"># I tags?</button>
    -        <button id="ctags"># with class foo?</button>
    -    </div>
    -    <div id="editor"></div>
    -    <div id="out">&nbsp;</div>
    -</div>
    - - -

    CSS

    -
    #editor_cont {
    -    width: 600px;
    -    border: 1px solid #999;
    -    margin: 2em;
    -    background-color: #f2f2f2;
    -}
    -#editor {
    -    height: 265px;
    -    background-color: #fff;
    -}
    -#buttons, #out {
    -    padding: 10px;
    -}
    -#buttons {
    -    border-bottom: 1px solid #999;
    -}
    -#out {
    -    font-weight: bold;
    -    border-top: 1px solid #999;
    -}
    - - - -

    Javascript

    -
    YUI().use('editor', function(Y) {
    -
    -    var log = function(str) {
    -        Y.one('#out').set('innerHTML', str);
    -    };
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    //Rendering the Editor
    -    editor.render('#editor');
    -
    -    Y.on('click', function(e) {
    -        var inst = editor.getInstance(),
    -            bs = inst.all('b');
    -        
    -        log('There are (' + bs.size() + ') B tags in the iframe.');
    -    }, '#btags');
    -
    -    Y.on('click', function(e) {
    -        var inst = editor.getInstance(),
    -            bs = inst.all('i');
    -        
    -        log('There are (' + bs.size() + ') I tags in the iframe.');
    -    }, '#itags');
    -
    -    Y.on('click', function(e) {
    -        var inst = editor.getInstance(),
    -            bs = inst.all('.foo');
    -        
    -        log('There are (' + bs.size() + ') items with class foo in the iframe.');
    -    }, '#ctags');
    -
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/editor/editor-nodechange.html b/docs/editor/editor-nodechange.html deleted file mode 100644 index 25abad912d7..00000000000 --- a/docs/editor/editor-nodechange.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - Example: NodeChange Event - - - - - - - -
    -

    Example: NodeChange Event

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Use the Editor's NodeChange Event

    -
    - -
    - - -
    -
    -

    Interact with the Editor instance below (click, type) and watch the console.

    -

    Use some special keys too. Enter, tab, arrows... Notice the event names.

    -
    -
    -
    -
    - - - - - - -
    - -

    Working with EditorBase

    -

    EditorBase is not a fully functional Editor, it is simply the base utility that will be used under the hood to create an Editor.

    - -

    Creating the Editor

    -

    In this step we are going to do the initial render of the Editor, set its content, and focus it when it's ready.

    - -
    YUI().use('editor', function(Y) {
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -});
    - - -

    The Node Change Event

    - -

    The nodeChange event is a special event that Editor emmits so that you can react to certain important moments that occured.

    -

    The most common use for the nodeChange event is to update the state of a Toolbar.

    - -

    nodeChange event properties

    -

    This list contains the properties that are added to the Event object when the nodeChange event is fired.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Event PropertyDescription
    changedEventThe event that caused the nodeChange
    changedNodeThe node that was interacted with
    changedTypeThe type of change: mousedown, mouseup, right, left, backspace, tab, enter, etc.
    commandsThe list of execCommands that belongs to this change and the dompath that's associated with the changedNode
    classNamesAn array of classNames that is applied to the changedNode and all of its parents
    dompathA sorted array of node instances that make up the DOM path from the changedNode to body.
    backgroundColorThe cascaded backgroundColor of the changedNode
    fontColorThe cascaded fontColor of the changedNode
    fontFamilyThe cascaded fontFamily of the changedNode
    fontSizeThe cascaded fontSize of the changedNode
    - -
    //Attaching a nodeChange event
    -editor.on('nodeChange', function(e) {
    -    //Here e contains the values above..
    -});
    - - - -

    Full Example Source

    - -

    HTML

    -
    <div id="demo_holder" class="yui3-skin-sam">
    -    <div id="editor_cont">
    -        <p>Interact with the Editor instance below (click, type) and watch the console.</p>
    -        <p>Use some special keys too. Enter, tab, arrows... Notice the event names.</p>
    -        <div id="editor"></div>
    -    </div>
    -    <div id="console"></div>
    -</div>
    - - -

    CSS

    -
    #demo_holder {
    -    position: relative;
    -}
    -#editor_cont {
    -    width: 300px;
    -    border: 1px solid #999;
    -    margin: 2em;
    -    background-color: #f2f2f2;
    -}
    -#editor_cont p {
    -    margin: .5em;
    -}
    -#editor {
    -    height: 350px;
    -    background-color: #fff;
    -}
    -#example-canvas .yui3-console .yui3-console-title {
    -    border: 0 none;
    -    color: #000;
    -    font-size: 13px;
    -    font-weight: bold;
    -    margin: 0;
    -    text-transform: none;
    -}
    -#example-canvas .yui3-console .yui3-console-entry-meta {
    -    margin: 0;
    -}
    - - - -

    Javascript

    -
    YUI().use('editor', 'console', function(Y) {
    -
    -    (new Y.Console().render( "#console" ));
    -    
    -    Y.log('Interact with the Editor.');
    -
    -    var logFn = function(e) {
    -        var tag = e.changedNode.get('tagName').toLowerCase();
    -        Y.log('nodeChange Event: ' + e.changedType + ' on (' + tag + ')');
    -    };
    -
    -    //Create the Base Editor
    -    var editor = new Y.EditorBase({
    -        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
    -        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    -    });
    -    
    -    editor.on('nodeChange', logFn);
    -
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/editor/index.html b/docs/editor/index.html deleted file mode 100644 index 520301e24c3..00000000000 --- a/docs/editor/index.html +++ /dev/null @@ -1,338 +0,0 @@ - - - - - Rich Text Editor - - - - - - - -
    -

    Rich Text Editor

    - - - Jump to Table of Contents - - -
    -
    -
    -

    The Rich Text Editor is a UI control that allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text.

    -

    The current release of the Rich Text Editor for YUI 3 is the base utility layers that provide a foundation on which you can create an Editor. This version of Editor does not contain a GUI of any kind.

    -
    - -

    Getting Started

    - -

    -To include the source files for Rich Text Editor and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('editor', function (Y) {
    -  // Rich Text Editor is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    Creating an Editor

    -

    This simple example will create an Editable area inside of another Node. It will not contain a GUI, only the iframe. You can use various Editor events to wire up your own toolbar.

    - -
    YUI().use('editor-base', function(Y) {
    -
    -    var editor = new Y.EditorBase({
    -        content: '<strong>This is <em>a test</em></strong> <strong>This is <em>a test</em></strong> '
    -    });
    -
    -    //Add the BiDi plugin
    -    editor.plug(Y.Plugin.EditorBidi);
    -
    -    //Focusing the Editor when the frame is ready..
    -    editor.on('frame:ready', function() {
    -        this.focus();
    -    });
    -
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -});
    - - -

    Frame Instance

    -

    When the Editor is created, it creates a YUI instance inside itself and attaches that instance to the editable iframe. -This means that you now have the full power of YUI 3 inside the Editor iframe. You can use Event, Stylesheet, Node and even DD -inside the iframe, without having to load all the JavaScript inside the document.

    - -

    Getting access to this instance is simple. Just use the getInstance method on the Editor instance, like this:

    - -
    YUI().use('editor-base', function(Y) {
    -
    -    var editor = new Y.EditorBase({
    -        content: '<strong>This is <em>a test</em></strong> <strong>This is <em>a test</em></strong> '
    -    });
    -
    -    //Add the BiDi plugin
    -    editor.plug(Y.Plugin.EditorBidi);
    -
    -    //Focusing the Editor when the frame is ready..
    -    editor.on('frame:ready', function() {
    -        this.focus();
    -
    -        var inst = this.getInstance();
    -        //inst is now an instance of YUI that is bound to the iframe.
    -
    -        var body = inst.one('body');
    -        //body is a Node instance of the BODY element "inside" the iframe.
    -
    -
    -        var strongs = inst.all('strong');
    -        //strongs is a NodeList instance of all the STRONG elements "inside" the iframe.
    -    });
    -
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -});
    - - -

    Events

    - -

    By default, the frame instance under the hood of Editor attaches a listener for all known DOM events. The example -below shows how you can listen and interact with them.

    - -
    YUI().use('editor-base', function(Y) {
    -
    -    var editor = new Y.EditorBase({
    -        content: '<strong>This is <em>a test</em></strong> <strong>This is <em>a test</em></strong> '
    -    });
    -
    -    //Add the BiDi plugin
    -    editor.plug(Y.Plugin.EditorBidi);
    -
    -    editor.on('frame:keydown', function(e) {
    -        //Listen for the keydown event inside the Editor.
    -        /*
    -            This event object contains 3 new properties:
    -                frameEvent
    -                frameTarget
    -                frameCurrentTarget
    -
    -            These properties are the original properties before
    -            the Event was fired, so you can use them like:
    -
    -                e.frameEvent.halt();
    -        */
    -    });
    -
    -    editor.on('frame:mouseup', function(e) {
    -        //Listen for the mouseup event inside the Editor.
    -    });
    -
    -    //Rendering the Editor.
    -    editor.render('#editor');
    -
    -});
    - - -

    Node Change Event

    - -

    The nodeChange event is a special event that Editor emits so that you can react to certain important moments that occured.

    -

    The most common use for the nodeChange event is to update the state of a Toolbar.

    - -
    nodeChange event properties
    -

    This list contains the properties that are added to the Event object when the nodeChange event is fired.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Event PropertyDescription
    changedEventThe event that caused the nodeChange
    changedNodeThe node that was interacted with
    changedTypeThe type of change: mousedown, mouseup, right, left, backspace, tab, enter, etc..
    commandsThe list of execCommands that belong to this change and the dompath that's associated with the changedNode
    classNamesAn array of classNames that are applied to the changedNode and all of its parents
    dompathA sorted array of node instances that make up the DOM path from the changedNode to body.
    backgroundColorThe cascaded backgroundColor of the changedNode
    fontColorThe cascaded fontColor of the changedNode
    fontFamilyThe cascaded fontFamily of the changedNode
    fontSizeThe cascaded fontSize of the changedNode
    - - -

    Module Descriptions

    - -

    Using YUI 3's plugin architecture, this version of the Rich Text Editor is even more modular and extensible than the previous version. -Almost every part of the Editor infrastructure is a plugin or extension. Below you will find the current list of plugins shipped with Editor.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Module NameDescription
    frameControls the creation and set up of the editable area
    selectionCross-browser selection normalization
    exec-commandPlugs into frame to extend document.execCommand support.
    editor-listsAdds support for list manipulation, including keyboard modification.
    editor-tabOverrides the default tab key handler and indents/outdents the current block level element.
    editor-bidiParagraph/Bi-Directional support (recommended to be used at all times.)
    createlink-baseSimple prompt based link creation.
    editor-baseRollup of the above modules
    editorRollup of the above modules
    -
    -
    - - -
    -
    - - - - - - diff --git a/docs/history/history-tabview.html b/docs/history/history-tabview.html deleted file mode 100644 index 79b035698aa..00000000000 --- a/docs/history/history-tabview.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - Example: History + TabView - - - - - - - -
    -

    Example: History + TabView

    - - - -
    -
    -
    -

    -This example demonstrates how to add browser history support to a TabView widget -using the History Utility. -

    - -

    -Select a new tab in the TabView below, then use your browser's back button -to return to the previously selected tab. Next, click on one of the images to -visit the Flickr photo page for that image, then use your browser's back button -to return to the current page with the same tab selected. -

    -
    - -
    - - -
    - -
    -
    - - Asparagus - -
    -
    - - Bird - -
    -
    - - Coffee - -
    -
    -
    - - - -
    - -

    HTML

    - -

    -First, create the markup for a simple TabView widget with three tabs. -

    - -
    <div id="demo" class="yui3-skin-sam">
    -  <ul>
    -    <li><a href="#asparagus">Asparagus</a></li>
    -    <li><a href="#bird">Bird</a></li>
    -    <li><a href="#coffee">Coffee</a></li>
    -  </ul>
    -  <div>
    -    <div id="asparagus">
    -      <a href="http://www.flickr.com/photos/allenr/4686935131/">
    -        <img src="http://farm5.static.flickr.com/4005/4686935131_253e921bf7_m.jpg" alt="Asparagus">
    -      </a>
    -    </div>
    -    <div id="bird">
    -      <a href="http://www.flickr.com/photos/allenr/66307916/">
    -        <img src="http://farm1.static.flickr.com/26/66307916_811efccdfc_m.jpg" alt="Bird">
    -      </a>
    -    </div>
    -    <div id="coffee">
    -      <a href="http://www.flickr.com/photos/allenr/4638474362/">
    -        <img src="http://farm4.static.flickr.com/3336/4638474362_093edb7565_m.jpg" alt="Coffee">
    -      </a>
    -    </div>
    -  </div>
    -</div>
    - - -

    JavaScript

    - -

    Load history and tabview

    - -

    -Load the history and tabview modules. -

    - -
    YUI().use('history', 'tabview', function (Y) {
    -  // ...implementation code...
    -});
    - - -

    Initialize History and TabView

    - -

    -Create an instance of the TabView widget and a history adapter, and restore the -bookmarked tab selection, if any. -

    - -

    -This example uses the Y.HistoryHash adapter, which stores history state in the -hash fragment of the URL. Another option would be to use the Y.HistoryHTML5 -adapter, but this would require additional logic in order to create bookmarkable -URLs. -

    - -

    -Add this code inside the YUI().use() callback from the previous step. -

    - -
    var history = new Y.HistoryHash(),
    -    tabview = new Y.TabView({srcNode: '#demo'});
    -
    -// Render the TabView widget to turn the static markup into an
    -// interactive TabView.
    -tabview.render();
    -
    -// Set the selected tab to the bookmarked history state, or to
    -// the first tab if there's no bookmarked state.
    -tabview.selectChild(history.get('tab') || 0);
    - - -

    Add a history entry when the selected tab changes

    - -

    -When the user selects a new tab, create a new browser history entry with a -state value named tab that contains the index of the selected tab. -If the first tab is selected, then set the tab state value to -null to remove it from the state, because the first tab is the -default tab. -

    - -
    // Store a new history state when the user selects a tab.
    -tabview.after('selectionChange', function (e) {
    -  // If the new tab index is greater than 0, set the "tab"
    -  // state value to the index. Otherwise, remove the "tab"
    -  // state value by setting it to null (this reverts to the
    -  // default state of selecting the first tab).
    -  history.addValue('tab', e.newVal.get('index') || null);
    -});
    - - -

    Listen for history events to capture back/forward navigation

    - -

    -Finally, listen for history change events, which indicate that the user clicked -the back/forward button or manually changed the URL. -

    - -

    -When a history:change event occurs, it could come from the call to -the addValue() method above or it could come from a change to the -URL hash. We only care about changes that come from the URL hash, since that -indicates a navigation event. -

    - -
    // Listen for history changes from back/forward navigation or
    -// URL changes, and update the tab selection when necessary.
    -Y.on('history:change', function (e) {
    -  // Ignore changes we make ourselves, since we don't need
    -  // to update the selection state for those. We're only
    -  // interested in outside changes, such as the ones generated
    -  // when the user clicks the browser's back or forward buttons.
    -  if (e.src === Y.HistoryHash.SRC_HASH) {
    -
    -    if (e.changed.tab) {
    -      // The new state contains a different tab selection, so
    -      // change the selected tab.
    -      tabview.selectChild(e.changed.tab.newVal);
    -    } else if (e.removed.tab) {
    -      // The tab selection was removed in the new state, so
    -      // select the first tab by default.
    -      tabview.selectChild(0);
    -    }
    -
    -  }
    -});
    - - -

    Complete example source code

    - -

    -Here's the complete source code for the example: -

    - -
    <div id="demo" class="yui3-skin-sam">
    -  <ul>
    -    <li><a href="#asparagus">Asparagus</a></li>
    -    <li><a href="#bird">Bird</a></li>
    -    <li><a href="#coffee">Coffee</a></li>
    -  </ul>
    -  <div>
    -    <div id="asparagus">
    -      <a href="http://www.flickr.com/photos/allenr/4686935131/">
    -        <img src="http://farm5.static.flickr.com/4005/4686935131_253e921bf7_m.jpg" alt="Asparagus">
    -      </a>
    -    </div>
    -    <div id="bird">
    -      <a href="http://www.flickr.com/photos/allenr/66307916/">
    -        <img src="http://farm1.static.flickr.com/26/66307916_811efccdfc_m.jpg" alt="Bird">
    -      </a>
    -    </div>
    -    <div id="coffee">
    -      <a href="http://www.flickr.com/photos/allenr/4638474362/">
    -        <img src="http://farm4.static.flickr.com/3336/4638474362_093edb7565_m.jpg" alt="Coffee">
    -      </a>
    -    </div>
    -  </div>
    -</div>
    -
    -<script>
    -YUI().use('history', 'tabview', function (Y) {
    -  var history = new Y.HistoryHash(),
    -      tabview = new Y.TabView({srcNode: '#demo'});
    -
    -  // Render the TabView widget to turn the static markup into an
    -  // interactive TabView.
    -  tabview.render();
    -
    -  // Set the selected tab to the bookmarked history state, or to
    -  // the first tab if there's no bookmarked state.
    -  tabview.selectChild(history.get('tab') || 0);
    -
    -  // Store a new history state when the user selects a tab.
    -  tabview.after('selectionChange', function (e) {
    -    // If the new tab index is greater than 0, set the "tab"
    -    // state value to the index. Otherwise, remove the "tab"
    -    // state value by setting it to null (this reverts to the
    -    // default state of selecting the first tab).
    -    history.addValue('tab', e.newVal.get('index') || null);
    -  });
    -
    -  // Listen for history changes from back/forward navigation or
    -  // URL changes, and update the tab selection when necessary.
    -  Y.on('history:change', function (e) {
    -    // Ignore changes we make ourselves, since we don't need
    -    // to update the selection state for those. We're only
    -    // interested in outside changes, such as the ones generated
    -    // when the user clicks the browser's back or forward buttons.
    -    if (e.src === Y.HistoryHash.SRC_HASH) {
    -
    -      if (e.changed.tab) {
    -        // The new state contains a different tab selection, so
    -        // change the selected tab.
    -        tabview.selectChild(e.changed.tab.newVal);
    -      } else if (e.removed.tab) {
    -        // The tab selection was removed in the new state, so
    -        // select the first tab by default.
    -        tabview.selectChild(0);
    -      }
    -
    -    }
    -  });
    -});
    -</script>
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/history/index.html b/docs/history/index.html deleted file mode 100644 index c183e19cabf..00000000000 --- a/docs/history/index.html +++ /dev/null @@ -1,705 +0,0 @@ - - - - - History - - - - - - - -
    -

    History

    - - - Jump to Table of Contents - - -
    -
    -
    -

    -JavaScript applications often involve client-side interactions that change the contents or state of the page without performing a full page refresh. Browsers don't record new history events for this kind of interaction, which means that the back and forward buttons can't be used to navigate between these states. -

    - -

    -The YUI History Utility provides an API that JavaScript applications can use to programmatically add state information to the browser history, and to provide bookmarkable and shareable URLs that can be used to restore that state at a later time. -

    - -

    -Note: Releases of YUI prior to 3.2.0 included the Browser History Manager, which is now deprecated. For information on the differences between the Browser History Manager and the new History Utility, and on how to migrate your code, see the Migrating from the Browser History Manager section below. -

    -
    - -

    Getting Started

    - -

    -To include the source files for History and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('history', function (Y) {
    -  // History is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    How Browser History Works

    - -

    -Browsers keep track of the web pages a user visits and allow the user to easily jump back and forth between those pages using "back" and "forward" buttons or shortcuts. -

    - -

    -Each time a new URL is loaded, the browser adds an entry to the browser history pointing to that URL. When the user clicks "back", the previous entry is loaded (if there is one). When they click "forward", the next entry is loaded. Any change to the URL, whether the user edits it manually in the address bar or just clicks a link, results in a new history entry being added. -

    - -

    -The YUI History Utility provides the ability to create browser history entries without navigating to a new page, and to associate a "state" with each history entry. The state is an object of key/value string pairs that can contain data necessary to restore the client-side state of the page at the time the history entry was added, such as information about an XHR request or about which tab was selected in a JavaScript TabView widget. -

    - -

    -Since this state information can be stored in the URL as well, the user can bookmark the URL or send it to a friend, and it will work exactly as they expect it to. This results in rich client-side interactions that feel like a seamless, natural part of the overall browsing experience. -

    - -

    History Adapters

    - -

    -Browsers have varying levels of support for history manipulation, so the History Utility provides several different adapters that provide specialized implementations and share a common API. -

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    AdapterDescription
    Y.History -

    - An alias that, by default, will automatically point to the best available history adapter that the current browser supports. If the browser supports the HTML5 History interface, then Y.History will be an alias for Y.HistoryHTML5. Otherwise Y.History will be an alias for Y.HistoryHash. -

    -
    Y.HistoryHash -

    - Creates history entries and stores state by modifying the hash fragment portion of the URL. The hash fragment is the part of the URL that begins with a # character, as in http://example.com/path#foo=bar. -

    - -

    - This method of history manipulation is supported by most browsers, but is also the most limited. The state must be an object of key/value string pairs, and there are several other caveats described in the Known Limitations section below. -

    -
    Y.HistoryHTML5 -

    - Uses the new HTML5 History interface, which is currently supported by Firefox 4, Safari 5+, and Google Chrome 5+. -

    - -

    - Unlike hash-based history, HTML5 history supports non-string state values such as arrays and objects, and allows custom URLs to be associated with history entries and displayed in the browser's address bar without refreshing the page. -

    -
    - -

    Using the History Utility

    -

    History Basics

    -

    Instantiating History

    - -

    -Create a new instance of the best available history adapter that's supported by the current browser: -

    - -
    var history = new Y.History();
    - - -

    -Alternatively, instantiate a specific adapter if you'd rather not rely on History to select one automatically: -

    - -
    // Always use the HistoryHash adapter, no matter what.
    -var history = new Y.HistoryHash();
    -
    -// Or, always use the HistoryHTML5 adapter, no matter what.
    -var history = new Y.HistoryHTML5();
    - - -

    Specifying an Initial State

    - -

    -To specify an initial or default state, pass a configuration object containing an initialState property to the history adapter's constructor. -

    - -
    var history = new Y.History({
    -  initialState: {
    -    kittens: 'fuzzy',
    -    puppies: 'cute'
    -  }
    -});
    - - -

    -By default, the initial state for the HistoryHash adapter will be determined from the current URL, while the initial state for the HistoryHTML5 adapter will be empty. -

    - -

    -If both the current URL and the initialState config property contain state information, then HistoryHash will give priority to the information in the URL, falling back to initialState for any items that aren't in the URL. -

    - -

    Adding, Replacing, and Getting State Values

    - -

    -Use the add() or addValue() methods to change the state and create a new browser history entry for the new state. The user can then navigate back to the previous state using the browser's back button, and forward again to the new state using the browser's forward button. -

    - -

    -The add() method changes several state values at once. By default, the new state is merged into the existing state: new values will override any existing values with the same names, while unchanged values will remain the same. -

    - -
    // Current state:
    -// {kittens: 'fuzzy', puppies: 'cute'}
    -
    -history.add({
    -  kittens: 'cute',
    -  ferrets: 'sneaky'
    -});
    -
    -// New state:
    -// {kittens: 'cute', puppies: 'cute', ferrets: 'sneaky'}
    - - -

    -The addValue() method changes a single state value. -

    - -
    // Current state:
    -// {kittens: 'cute', puppies: 'cute', ferrets: 'sneaky'}
    -
    -history.addValue('kittens', 'soft');
    -
    -// New state:
    -// {kittens: 'soft', puppies: 'cute', ferrets: 'sneaky'}
    - - -

    -To override the default merge behavior and discard the previous state entirely when setting a new state, pass an options object to add() or addValue() and set the merge property to false. -

    - -
    // Current state:
    -// {kittens: 'soft', puppies: 'cute', ferrets: 'sneaky'}
    -
    -history.addValue('sloths', 'slow', {merge: false});
    -
    -// New state:
    -// {sloths: 'slow'}
    - - -

    -The replace() and replaceValue() methods work just like add() and addValue(), except that they replace the current browser history entry instead of adding a new entry. -

    - -
    // Current state:
    -// {sloths: 'slow'}
    -
    -history.replace({
    -  turtles: 'slower',
    -  snails : 'slowest'
    -});
    -
    -// Current (not new) state:
    -// {sloths: 'slow', turtles: 'slower', snails: 'slowest'}
    - - -

    -Use the get() method to get the current state, or the value of a single item in the current state. -

    - -
    history.get();          // => {sloths: 'slow', turtles: 'slower', snails: 'slowest'}
    -history.get('sloths');  // => 'slow'
    -history.get('monkeys'); // => undefined
    - - -

    Removing State Values

    - -

    -While it's not possible to remove an entry from the browser history, it is possible to create a new entry (or replace the current entry) and remove one or more state values that were previously set. To do this, add or replace one or more values with null or undefined. -

    - -
    // Current state:
    -// {sloths: 'slow', turtles: 'slower', snails: 'slowest'}
    -
    -history.add({
    -  sloths: null,
    -  snails: null
    -});
    -
    -// New state:
    -// {turtles: 'slower'}
    - - -

    History Events

    - -

    -The History Utility fires events when the history state changes. Changes can be triggered either by the History Utility's add/replace methods or by a browser navigation action, such as clicking the back or forward button. Subscribe to change events to be notified when the state of your application needs to be updated. -

    - -

    history:change Event

    - -

    -There are several ways to subscribe to History events. The most common is to subscribe to the global history:change event. This event fires whenever the history state changes for any reason, regardless of the source of the change, even if it came from a different History or YUI instance. -

    - -
    Y.on('history:change', function (e) {
    -  var changed = e.changed,
    -      removed = e.removed;
    -
    -  if (changed.kittens) {
    -    // The "kittens" key was added or changed.
    -    console.log('kittens were ' + changed.kittens.prevVal);
    -    console.log('kittens are now ' + changed.kittens.newVal);
    -  } else if (removed.kittens) {
    -    // The "kittens" key previously existed, but was removed.
    -    console.log('kittens were ' + removed.kittens);
    -    console.log('kittens have escaped!');
    -  }
    -});
    - - -

    -If you're only interested in changes that are made by one specific History instance and don't want to be notified about changes made by other instances, subscribe to the local change event on the instance. -

    - -
    history.on('change', function (e) {
    -  // ... handle only local changes ...
    -});
    - - -

    Property-specific Events

    - -

    -To be notified when a specific state property is added or changed, subscribe to the instance-level [key]Change event, where [key] is the name of the property. To be notified when a state property is removed, subscribe to [key]Remove. -

    - -
    history.on('kittensChange', function (e) {
    -  // The "kittens" key was added or changed.
    -  console.log('kittens were ' + e.prevVal);
    -  console.log('kittens are now ' + e.newVal);
    -});
    -
    -history.on('kittensRemove', function (e) {
    -  // The "kittens" key previously existed, but was removed.
    -  console.log('kittens were ' + e.prevVal);
    -  console.log('kittens have escaped!');
    -});
    - - -

    -See the API docs for more details. -

    - -

    Filtering by Event Source

    - -

    -All History event facades include a src property that indicates the source of the event. You can filter on this property to ignore events triggered by sources you don't care about, or to avoid handling duplicate events. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SourceDescription
    Y.HistoryBase.SRC_ADD - Event was triggered by a call to add() or addValue() on a history adapter. -
    Y.HistoryBase.SRC_REPLACE - Event was triggered by a call to replace() or replaceValue() on a history adapter. -
    Y.HistoryHash.SRC_HASH - Event was triggered by a change to the URL hash fragment. -
    Y.HistoryHTML5.SRC_POPSTATE - Event was triggered by the HTML5 popstate event. -
    - -

    -The following example demonstrates how to handle only events that were triggered by a change to the URL hash, while ignoring events from other sources: -

    - -
    Y.on('history:change', function (e) {
    -  if (e.src === Y.HistoryHash.SRC_HASH) {
    -    // ...
    -  }
    -});
    - - -

    Extra Functionality Provided by HistoryHTML5

    - -

    -In browsers that support the new HTML5 History Interface, the Y.HistoryHTML5 adapter provides additional functionality beyond what Y.HistoryHash offers. -

    - -

    -When adding or replacing a history entry, you may also provide an options object as the second argument to add() and replace(), or as the third argument to addValue() and replaceValue(). It may contain zero or more of the following properties: -

    - - - - - - - - - - - - - - - - - - - - -
    PropertyDescription
    title - User-visible title associated with the history entry. Browsers will typically display this title in a detailed history view or a dropdown menu attached to the back/forward buttons. -
    url - URL associated with the history entry. This will be displayed to the user in the browser's address bar, and will replace the current URL without causing a page refresh. If an absolute URL is specified, the protocol, hostname, and port of the new URL must be the same as the current URL or the browser will raise a security exception (the "same origin" policy applies here just as it does to Ajax requests). -
    - -

    -This example demonstrates how to associate a custom title and URL with a history entry: -

    - -
    // Current URL: http://example.com/photos/
    -
    -history.addValue('kittens', 'cute', {
    -  title: 'Photos of cute kittens',
    -  url  : '/photos/kittens?type=cute'
    -});
    -
    -// New URL: http://example.com/photos/kittens?type=cute
    - - -

    -Custom URLs can be used to allow server-side handling of history states when the user returns to a page, without requiring a page refresh when the history state is created. The HistoryHTML5 adapter doesn't provide any out-of-the-box URL parsing functionality, so additional server-side or client-side code may be necessary to handle custom URLs. -

    - -

    Supporting Google's Ajax Crawling Scheme

    - -

    -One problem with using the URL hash fragment to store history state, as the Y.HistoryHash adapter does, is that search engines typically don't distinguish between a URL with a hash fragment and one without. If your website displays different content depending on a hash-based history state, that content won't be indexed by search engines. -

    - -

    -Google's Ajax Crawling Scheme specifies a way to make your hash-based history states crawlable by the GoogleBot with a bit of extra work, and the History Utility can help. Note that the technique described here applies only to the Y.HistoryHash adapter; if you're using Y.HistoryHTML5, you can use custom URLs to achieve the same thing more elegantly. -

    - -

    -To indicate to Google's crawlers that your hash URLs are crawlable, the hash must be prefixed by #! instead of the usual #. The History Utility will take care of this automatically if you set the static Y.HistoryHash.hashPrefix property to "!", as in this example: -

    - -
    Y.HistoryHash.hashPrefix = '!';
    -
    -var history = new Y.HistoryHash();
    -history.addValue('key', 'value');
    -
    -// URL is now http://example.com/#!key=value
    - - -

    -Next, read Google's -getting started guide for a description of how the Ajax crawling scheme works and the additional changes you'll need to make to your application. Most of the work will need to happen on the server, which is out of YUI's hands. -

    - -

    Migrating from the Browser History Manager

    - -

    -Versions of YUI 3 prior to 3.2.0 included the Browser History Manager. In YUI 3.2.0, the Browser History Manager was deprecated and replaced with the new History Utility, which has a new API and differs in several important ways. -

    - -

    Key Differences

    - -
      -
    • - The Browser History Manager (BHM) requires both an iframe and a hidden form field to exist in the static page markup. The new History Utility doesn't have any markup requirements. The History Utility still uses an iframe for IE6 and IE7 support, but the iframe is created automatically as needed, and does not result in an extra HTTP request. -
    • - -
    • - The BHM required history parameters (which it called "modules") to be registered before they could be used, and new modules could not be registered once the BHM was initialized. The new History Utility does not require parameters to be registered. -
    • - -
    • - The BHM differentiated between "bookmarked" states (the state of a parameter in the URL hash at the beginning of the pageview) and "current" states (the state of a parameter now). The History Utility does not make this distinction, since the current state is what matters. -
    • -
    - -

    API Equivalency: Methods

    - -

    -The table below provides a quick reference to help you translate API methods from the deprecated Browser History Manager to the new History Utility. See the API documentation for details on the new API. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Browser History Manager (deprecated)History Utility (new)
    multiNavigate()add()
    navigate()addValue()
    getBookmarkedState() or getCurrentState()get()
    not supportedreplace()
    not supportedreplaceValue()
    - -

    API Equivalency: Events

    - -

    -The table below provides a quick reference to help you translate API events from the deprecated Browser History Manager to the new History Utility. See the API documentation for details on the new API. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Browser History Manager (deprecated)History Utility (new)
    history:globalStateChangehistory:change
    history:moduleStateChange[key]Change
    history:moduleStateChange[key]Remove
    history:readyn/a
    - -

    Known Limitations

    - -
      -
    • - The HistoryHash adapter uses the hash fragment portion of the URL to store state information. Consequently, there is a limit to how much information can be stored, and this limit is browser-specific. For example, Internet Explorer limits URLs to 2,083 characters including the hash fragment. -
    • - -
    • - The HistoryHash adapter can only store key/value string pairs. It can't store non-string values unless those values are first converted to a string format such as JSON. The HistoryHTML5 adapter does not have this limitation. -
    • - -
    • - Web browsers never send the hash fragment portion of the URL to the server. As a result, when using HistoryHash some client-side processing is required in order to restore the initial state of a bookmarked URL. It's important to keep this amount of processing to a minimum in order to avoid degrading the user experience. The HistoryHTML5 adapter does not share this limitation, since it can construct full, server-visible URLs that will allow you to restore state on the server. -
    • - -
    • - HistoryHash state names and values are case-sensitive in all browsers except Internet Explorer 8 and 9. In most browsers, changing a state item's name or value from "foo" to "Foo" will trigger a change event. However, in IE8 and IE9, this will not trigger a change event because IE ignores the case of the URL hash. -
    • - -
    • - Internet Explorer 6 and 7 only retain the most recent history state from a previous pageview after navigating to another page and returning. However, history entries created within a single pageview will persist for the duration of that pageview, and bookmarked URLs will still work in all cases. -
    • - -
    • - In Internet Explorer 6 and 7, the page titles displayed for history entries in the browser's history dropdown menu are not correct. Instead of showing the title of each document, it shows part of the URL of each page. -
    • -
    -
    -
    - - -
    -
    - - - - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 625fad78fb9..00000000000 --- a/docs/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - YUI 3 - - - - - - - -
    -

    YUI 3

    - - - Jump to Table of Contents - - -
    -
    -

    Welcome to YUI 3

    - -

    -Nothing to see here (yet). -

    -
    -
    - - -
    -
    - - - - - - diff --git a/docs/infrastructure.html b/docs/infrastructure.html deleted file mode 100644 index 2f57d917dcb..00000000000 --- a/docs/infrastructure.html +++ /dev/null @@ -1,11 +0,0 @@ -

    Overview

    - -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sapien arcu, ornare vitae luctus eget, tempus id felis. Donec et sapien lectus. Nam leo neque, sodales et tincidunt id, mollis vel tellus. Aliquam nec velit est. Nunc ante lectus, tristique quis feugiat non, suscipit a sem. Cras ligula lectus, accumsan in congue et, porta nec enim. Aenean interdum mollis arcu, ut laoreet ante pharetra tincidunt. Sed at justo dapibus quam feugiat rutrum et ac turpis. Vivamus sit amet nibh eros, at vehicula mi. Aliquam hendrerit cursus lacus ut euismod.

    - -

    Aenean sapien turpis, tristique quis sodales quis, tempor sit amet tellus. Nunc consequat nisi vitae purus lacinia elementum. Curabitur luctus purus id lorem elementum vel auctor urna dignissim. Praesent non lacinia tellus. Fusce tristique dolor sed odio lobortis lobortis. Fusce non elit lorem, et euismod massa. Donec purus ipsum, varius ut sollicitudin laoreet, cursus vitae justo. Proin sollicitudin justo vel arcu fermentum semper ut et sem. Cras ut scelerisque elit. Quisque pellentesque nisl in ipsum lobortis lacinia. Quisque viverra scelerisque elementum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis in massa enim, eget euismod eros. Proin viverra arcu quis sem tincidunt sit amet pulvinar urna ultrices. Integer ac diam sapien, at tincidunt sapien. Ut a justo sit amet risus sollicitudin iaculis. Donec ut felis sit amet urna convallis venenatis non auctor diam. Phasellus posuere pharetra enim sed placerat. Pellentesque libero ipsum, vestibulum id congue semper, sagittis vitae neque. Curabitur mauris tellus, pretium a iaculis eget, elementum ac libero.

    - -

    Aliquam erat volutpat. Donec lectus lectus, vehicula sit amet eleifend eget, cursus malesuada orci. In lectus mauris, volutpat non ultricies a, sollicitudin sit amet mauris. Sed vel orci orci. Mauris vel nisi purus. Donec condimentum rhoncus sem, eu luctus orci malesuada eu. Phasellus cursus sem magna. Etiam tristique orci quis nisi condimentum nec rhoncus purus suscipit. Mauris congue metus urna. Proin in orci non sem tincidunt malesuada. Praesent non leo eget augue tincidunt condimentum ut sed leo. Ut scelerisque nibh et tellus bibendum non gravida nisl luctus. Phasellus bibendum vestibulum tellus, id elementum ante condimentum eget. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent adipiscing, leo et malesuada sagittis, odio ligula suscipit dolor, sed vehicula massa enim nec mauris. Donec in sagittis purus.

    - -

    Donec faucibus ultricies commodo. Donec vehicula lorem rutrum ligula fringilla non rhoncus justo pretium. Cras nec diam arcu. Donec ornare commodo metus ac condimentum. Donec consequat aliquam libero in congue. Suspendisse iaculis pharetra lorem ac feugiat. Phasellus elementum lectus nec nisi pulvinar mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In dui nisl, sagittis quis tincidunt ac, commodo eget erat. Vestibulum nisi nisi, cursus eu egestas nec, hendrerit eget purus. Donec quis lectus nisi. Suspendisse aliquet, sem in volutpat feugiat, felis diam condimentum risus, a rutrum nunc urna in sapien. Pellentesque vitae dolor ut arcu congue egestas. In sagittis eleifend orci, vitae dignissim nunc volutpat ut. Donec condimentum, felis vitae volutpat tempus, nulla diam mattis ante, eget ultricies tellus arcu ut magna.

    - -

    Pellentesque rhoncus, risus sed tincidunt elementum, magna nibh eleifend dui, ut vehicula mi elit at sapien. Fusce suscipit urna nec nulla suscipit fringilla. Praesent enim lacus, fermentum vel gravida nec, scelerisque quis lorem. Nam euismod risus quis lacus eleifend imperdiet. Sed ligula ligula, rutrum nec hendrerit in, semper eu nisi. Phasellus ultricies velit vel libero tempus euismod. Curabitur non quam ipsum. Fusce adipiscing arcu eu diam dignissim rutrum. Ut pulvinar posuere libero. Donec sed tristique mauris. Morbi vitae ipsum ligula. Proin lectus velit, tincidunt eget molestie sed, molestie ac mi. Maecenas libero lorem, consectetur ut dignissim quis, fermentum eu velit.

    diff --git a/docs/node-menunav/index.html b/docs/node-menunav/index.html deleted file mode 100644 index 30fbcae5e0c..00000000000 --- a/docs/node-menunav/index.html +++ /dev/null @@ -1,860 +0,0 @@ - - - - - MenuNav Node Plugin - - - - - - - -
    -

    MenuNav Node Plugin

    - - - Jump to Table of Contents - - -
    -
    -
    - -
    -

    - The MenuNav Node Plugin makes it easy to transform existing list-based - markup into traditional, drop down navigational menus that are both - accessible and easy to customize, and only require a small set of - dependencies. The MenuNav Node Plugin features: -

    - -
    -
    Progressive Enhancement
    -
    - The MenuNav Node Plugin is designed to support - Progressive Enhancement, - making it easy to transform simple, semantic markup into dynamic - drop-down menus with just a few lines of JavaScript. -
    - -
    Small footprint
    -
    - The MenuNav Node Plugin has a small footprint of ~5 KB (GZIP'd) and - requires a minimal set of dependencies (YUI, - Event, - DOM, - Node, - OOP, - ClassNameManager, - and the Focus Manager Node Plugin). -
    - -
    Accessibility & Usability Minded
    -
    - The MenuNav Node Plugin was built with both accessibility and usability - in mind. The MenuNav Node Plugin implements established mouse and - keyboard interaction patterns to deliver a user experience that is both - familiar and easy to use. To that foundation the MenuNav Node plugin - adds support for screen readers through the use of the - WAI-ARIA Roles and States. - Watch this video - for a quick a demo of a menu created using the MenuNav Node Plugin - using the WAI-ARIA Roles and States running in Firefox 3 using the - Window-Eyes screen reader. -
    - -
    Easy to style and configure
    -
    - The MenuNav Node Plugin is easy to configure. The visual presentation - of menus is controlled completely via CSS. A handful of - straightforward configuration attributes can be used to make - common modifications to a menu's behavior. -
    - -
    <iframe> Shim for IE 6
    -
    - No menuing system would be complete without an - <iframe> to prevent <select> elements from poking through menus - in IE 6. -
    -
    -
    - -

    Getting Started

    - -

    -To include the source files for MenuNav Node Plugin and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('node-menunav', function (Y) {
    -  // MenuNav Node Plugin is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    -Next, apply the yui3-skin-sam class name to an element that is a -parent of the element in which the menu lives. You can usually accomplish this -simply by putting the class on the <body> tag: -

    - -
    <body class="yui3-skin-sam">
    - - -

    -For more information on skinning YUI components and making use of default -skins, see our -Understanding YUI Skins -article. -

    - -

    Basic Setup

    - -

    -To create a menu using the MenuNav Node Plugin, start by including the required markup. The markup -for menus created using the MenuNav Node Plugin follows the same pattern established for Widgets, -with each menu's content box containing one or more <ul> elements: -

    - - - -
    <div id="menu-1" class="yui3-menu"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <!-- Menu items -->
    -        </ul>
    -    </div>
    -</div>
    - - -

    -Menu items also follow the Widget markup pattern, with the root node defined using an -<li> element: -

    - - - -
    <li class="yui3-menuitem"><!-- Bounding box -->
    -    <a class="yui3-menuitem-content" href="http://www.yahoo.com"><!-- Content box -->
    -    Yahoo!
    -    </a>
    -</li>
    - - -

    -Submenus are defined by wrapping the the menu markup in an <li> element. Each -submenu must have have a label. The label should preceed the menu markup, and the label's -href attribute should be set to the point to the id of its corresponding submenu. -

    - - - -
    <li>
    -    <a class="yui3-menu-label" href="#submenu-1">Submenu Label</a><!-- Menu label -->
    -    <div id="submenu-1" class="yui3-menu"><!-- Bounding box -->
    -        <div class="yui3-menu-content"><!-- Content box -->
    -            <ul>
    -                <!-- Menu items -->
    -            </ul>
    -        </div>
    -    </div>
    -</li>
    - - -

    -Following the patterns illustrated above, the markup for a menu created using the MenuNav Node -Plugin comes together as follows: -

    - -
    <div id="menu-1" class="yui3-menu"><!-- Root menu bounding box -->
    -    <div class="yui3-menu-content"><!-- Root menu content box -->
    -        <ul>
    -            <li class="yui3-menuitem"><!-- Menuitem bounding box -->
    -                <a class="yui3-menuitem-content" href="http://www.yahoo.com"><!-- Menuitem content box -->
    -                Yahoo!
    -                </a>
    -            </li>
    -            <li>
    -                <a class="yui3-menu-label" href="#pim">PIM</a><!-- Submenu label -->
    -                <div id="pim" class="yui3-menu"><!-- Submenu bounding box -->
    -                    <div class="yui3-menu-content"><!-- Submenu content box -->
    -                        <ul>
    -                            <li class="yui3-menuitem">
    -                                <a class="yui3-menuitem-content" href="http://mail.yahoo.com">Yahoo! Mail</a>
    -                            </li>
    -                            <li class="yui3-menuitem">
    -                                <a class="yui3-menuitem-content" href="http://addressbook.yahoo.com">Yahoo! Address Book</a>
    -                            </li>
    -                            <li class="yui3-menuitem">
    -                                <a class="yui3-menuitem-content" href="http://calendar.yahoo.com">Yahoo! Calendar</a>
    -                            </li>
    -                            <li class="yui3-menuitem">
    -                                <a class="yui3-menuitem-content" href="http://notepad.yahoo.com">Yahoo! Notepad</a>
    -                            </li>
    -                        </ul>            
    -                    </div>    
    -                </div> 
    -            </li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    -With the markup for the menu in place, simply get a Node reference for the root menu and then call -the plug method, passing in a reference to the MenuNav Node Plugin. -

    - -
    //    Call the "use" method, passing in "node-menunav".  This will load the 
    -//    script and CSS for the MenuNav Node Plugin and all of the required 
    -//    dependencies.
    -
    -YUI().use("node-menunav", function(Y) {
    -
    -    //    Use the "contentready" event to initialize the menu when the subtree of 
    -    //    element representing the root menu (<div id="menu-1">) is ready to 
    -    //    be scripted.
    -
    -    Y.on("contentready", function () {
    -
    -        //    The scope of the callback will be a Node instance representing 
    -        //    the root menu (<div id="menu-1">).  Therefore, since "this"
    -        //    represents a Node instance, it is possible to just call "this.plug"
    -        //    passing in a reference to the MenuNav Node Plugin.
    -
    -        this.plug(Y.Plugin.NodeMenuNav);
    -
    -    }, "#menu-1");
    -
    -});
    - - -

    Using the MenuNav Node Plugin

    - -

    Orientation, Style and Behavior

    - -

    Configuring Orientation

    - -

    -The root menu of menus built using the MenuNav Node Plugin can have a verical or horizontal -orientation. The default orientation for menus is vertical, but can be easily switched to -horizontal by applying a class of yui3-menu-horizontal to the node representing the -root menu's bounding box, as illustrated in the following example: -

    - -
    <div id="menu-1" class="yui3-menu yui3-menu-horizontal"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <!-- Menu items -->
    -        </ul>
    -    </div>
    -</div>
    - - -

    -Once the yui3-menu-horizontal class name is applied to the node representing the -root menu's bounding box, the menu's keyboard interaction is automatically adjusted for a -horizontal orientation. The default "Sam" skin provides the following default visualization for -horizontal menus, as illustrated in the follow screen capture of a horizontal menu example: -

    - -
    Screen capture of a horizontal menu rendered with the default Sam Skin
    - -

    Configuring Style & Behavior

    - -

    -The default "Sam" skin provides two additional visualizations for horizontal menus, each of which -can be applied by both changes to the menu label markup and through the application of a class to -the node representing the root menu's bounding box. -

    - - - -

    -The first of the two optional horizontal menu visualizations available with the "Sam" skin renders -each menu label as a menu button; each menu label is rendered with an arrow to the right -of its text label, providing a visual cue that there is a corresponding submenu. -

    - -
    Screen capture of a horizontal menu with each menu label in the root menu rendered as menu buttons.
    - -

    -To apply this style to a horizontal menu, start by adding the class yui3-menubuttonnav -to the node representing the root menu's bounding box, as illustrated in the following example: -

    - -
    <div id="menu-1" class="yui3-menu yui3-menu-horizontal yui3-menubuttonnav"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <!-- Menu items -->
    -        </ul>
    -    </div>
    -</div>
    - - -

    Next, wrap the text node of each menu label in an <em> element:

    - -
    <div id="menu-1" class="yui3-menu yui3-menu-horizontal yui3-menubuttonnav"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -        
    -            <li>
    -                <a class="yui3-menu-label" href="#submenu-1"><em>Submenu Label</em></a>
    -                <div id="submenu-1" class="yui3-menu">
    -                    <div class="yui3-menu-content">
    -                    
    -                        <!-- submenu content -->
    -                    
    -                    </div>
    -                </div>        
    -            </li>
    -
    -        </ul>
    -    </div>
    -</div>
    - - -

    -As a final, optional step, use the -autoSubmenuDisplay -and mouseOutHideDelay -configuration attributes to configure the menu labels to behave like menu buttons. Set the -autoSubmenuDisplay to false, so that each menu label's submenu isn't -made visible until the label is clicked. Set the mouseOutHideDelay to -0 so that a label's submenu is only hidden when the user mouses down on an area -outside of the submenu. -

    - -
    //    Call the "use" method, passing in "node-menunav".  This will load the 
    -//    script and CSS for the MenuNav Node Plugin and all of the required 
    -//    dependencies.
    -
    -YUI().use("node-menunav", function(Y) {
    -
    -    //    Use the "contentready" event to initialize the menu when the subtree of 
    -    //    element representing the root menu (<div id="menu-1">) is ready to 
    -    //    be scripted.
    -
    -    Y.on("contentready", function () {
    -
    -        //    The scope of the callback will be a Node instance representing 
    -        //    the root menu (<div id="menu-1">).  Therefore, since "this"
    -        //    represents a Node instance, it is possible to just call "this.plug"
    -        //    passing in a reference to the MenuNav Node Plugin.
    -
    -        this.plug(Y.Plugin.NodeMenuNav, { autoSubmenuDisplay: false, mouseOutHideDelay: 0 });
    -
    -    }, "#menu-1");
    -
    -});
    - - -
    Split Button Visualization
    - -

    -The other optional horizontal menu visualization available with the "Sam" skin renders each menu -label as a split button. -

    - -
    Screen capture of a horizontal menu with each menu label in the root menu rendered as split buttons.
    - -

    To apply this style to a horizontal menu, start by adding the class -yui3-splitbuttonnav to the node representing the root menu's bounding box, as -illustrated in the following example: -

    - -
    <div id="menu-1" class="yui3-menu yui3-menu-horizontal yui3-splitbuttonnav"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <!-- Menu items -->
    -        </ul>
    -    </div>
    -</div>
    - - -

    -Next, define the markup for each menu label. Start with a <span> with a class -of yui3-menu-label applied. Inside the <span>, place two -<a> elements — one for each of the label's two clickable regions. -Each <a> has separate, but related responsibilities: The first -<a> represents the label's default action. The second <a> -toggles the display of a submenu whose content contains other options related to, or in the same -category as the default action. Therefore to configure the first <a>, -simply set its href attribute to any URL. For the second <a>, -apply a class name of yui3-menu-toggle, and set the value of the href -attribute to the id of the label's corresponding submenu. Lastly, the text node of the second -<a> should label the contents of its corresponding submenu. -

    - -
    <div id="menu-1" class="yui3-menu yui3-menu-horizontal yui3-splitbuttonnav"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <li>
    -
    -                <span class="yui3-menu-label"><!-- menu label root node -->
    -                    <a href="http://answers.yahoo.com">Answers</a><!-- menu label default action -->
    -                    <a href="#answers-options" class="yui3-menu-toggle">Answers Options</a><!-- menu label submenu toggle -->
    -                </span>                                            
    -
    -                <div id="answers-options" class="yui3-menu">
    -                    <div class="yui3-menu-content">
    -                        <ul>
    -                            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://answers.yahoo.com/dir/">Answer</a></li>
    -                            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://answersonthestreet.yahoo.com/">Answers on the Street</a></li>
    -                            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://answers.yahoo.com/question/;_ylt=Av3Nt22Mr7YNs651NWFv8YUPzKIX;_ylv=3?link=ask">Ask</a></li>
    -                            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://answers.yahoo.com/dir/;_ylt=Aqp_jJlsYDP7urcq2WGC6HBJxQt.;_ylv=3?link=over&amp;amp;more=y">Discover</a></li>
    -                        </ul>
    -                    </div>
    -                </div>                
    -                
    -            </li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    -Use the autoSubmenuDisplay -and mouseOutHideDelay -configuration attributes to configure the menu labels to behave like split buttons. Set the -autoSubmenuDisplay to false, so that each menu label's submenu isn't -made visible until the menu trigger is clicked. Set the mouseOutHideDelay to -0 so that a label's submenu is only hidden when the user mouses down on an area -outside of the submenu. -

    - -
    //    Call the "use" method, passing in "node-menunav".  This will load the 
    -//    script and CSS for the MenuNav Node Plugin and all of the required 
    -//    dependencies.
    -
    -YUI().use("node-menunav", function(Y) {
    -
    -    //    Use the "contentready" event to initialize the menu when the subtree of 
    -    //    element representing the root menu (<div id="menu-1">) is ready to 
    -    //    be scripted.
    -
    -    Y.on("contentready", function () {
    -
    -        //    The scope of the callback will be a Node instance representing 
    -        //    the root menu (<div id="menu-1">).  Therefore, since "this"
    -        //    represents a Node instance, it is possible to just call "this.plug"
    -        //    passing in a reference to the MenuNav Node Plugin.
    -
    -        this.plug(Y.Plugin.NodeMenuNav, { autoSubmenuDisplay: false, mouseOutHideDelay: 0 });
    -
    -    }, "#menu-1");
    -
    -});
    - - - - -

    -The MenuNav Node Plugin makes it easy to create separators between items in a menu. -To separate items in a menu, simply place items in their own -<ul> elements inside their parent menu's content box, and -apply a class name of first-of-type to the first -<ul>. The following code will render separators between -the "Zimbra" and "Address Book" items, and the "Notepad" and "Messenger" items. -

    - -
    <div id="pim" class="yui3-menu">
    -    <div class="yui3-menu-content">    
    -
    -        <ul class="first-of-type">
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://mail.yahoo.com">Mail</a></li>
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://www.zimbra.com">Zimbra</a></li>
    -        </ul>
    -
    -        <ul>
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://addressbook.yahoo.com">Address Book</a></li>
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://calendar.yahoo.com">Calendar</a></li>
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://notepad.yahoo.com">Notepad</a></li>
    -        </ul>
    -        
    -        <ul>
    -            <li class="yui3-menuitem"><a class="yui3-menuitem-content" href="http://messenger.yahoo.com">Messenger</a></li>
    -        </ul>
    -        
    -    </div>    
    -</div>
    - - -

    -With the separator markup in place, the default "Sam" skin will render a top border between each -<ul> element, as illustrated in the following screen capture of one of the -MenuNav Node Plugin examples: -

    - -
    Screen capture of a horizontal menu
    - -

    Styling State

    - -

    -The MenuNav Node Plugin manages the state of a menu's descendants through the application and -removal of class names. Class names representing state are constructed using the descendent's -name followed by a suffix representing the state. For example, hidden submenus have a class of -yui3-menu-hidden. Class names used to represent state are always applied to the -descendant's root node. See the CSS reference for the complete list of state class -names. -

    - -

    Active vs. Inactive

    - -

    -Menuitems and menu labels have a default (inactive) state and an active state. Menuitems and -menu labels are considered active when the user is interacting with them via the keyboard or the -mouse. The active class name applied to menuitems and menu labels has two benefits: It provides -a single entry point for styling state that would otherwise require the use of multiple CSS -pseudo classes (:hover and :focus). The second benefit to the use of -the active class name is that it provides consistent styling of state across all types of elements in -all A-Grade browsers. -(IE 6 only supports the :hover and :focus pseudo classes on -<a> elements. And while IE 7 supports :hover on all elements, it -only supports :focus pseudo class on <a> elements.) -

    - -

    Visible vs. Hidden

    - -

    -By default all submenus are hidden and that state is reflected by the application of the -yui3-menu-hidden class name. If the yui3-menu-hidden class name is not -applied to the bounding box node of all submenus, it will automatically be applied by the MenuNav's -constructor. When a submenu is visible, the yui3-menu-hidden class name is removed -and a class yui3-menu-label-menuvisible is applied to the submenu's corresponding label. -

    - -

    Configuration Attributes

    - -

    -The MenuNav Node Plugin has several configuration attributes that can be set via an object literal -that is passed as a second argument to a Node instance's -plug method. (Note: These -attributes are case sensitive.) In the following example, the value of the -mouseOutHideDelay attribute is set to 1000. -

    - -
    var oMenuNav = Y.one("#productsandservices");
    -oMenuNav.plug(Y.Plugin.NodeMenuNav, { mouseOutHideDelay: 1000 });
    - - -

    The complete list of the MenuNav Node Plugin configuration attributes are:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameDefault ValueDescription
    useARIATrueBoolean indicating if use of the WAI-ARIA Roles and States should be enabled for the MenuNav. Set to true by default for Firefox 3 and Internet Explorer 8 as currently only these browsers have support for ARIA, and are supported by several screen readers for Windows that also offer support for ARIA.
    autoSubmenuDisplayTrueBoolean indicating if submenus are automatically made visible when the user mouses over the menu's items.
    mouseOutHideDelay750Number indicating the time (in milliseconds) that should expire before a submenu is hidden when the user mouses out of it.
    - -

    Handling Events

    - -

    -The MenuNav Node Plugin publishes no custom events of its own. To listen for any DOM-related -events for a menu built using the MenuNav Node Plugin, use the on method of the -plugin's host Node instance. The following example illustrates how to listen for the -click event of menu a built using the MenuNav Node Plugin: -

    - -
    // Get a Node instance for HTML element 
    -var oMenuNode = Y.one("#menu-nav-1");
    -
    -// Apply the MenuNav Node Plugin to the Node instance
    -oMenuNode.plug(Y.Plugin.NodeMenuNav);
    -
    -// Register a "click" event listener to the Node instance using the "on" method 
    -oMenuNode.on("click", function () {
    -
    -    alert("here");
    -
    -});
    - - -

    For additional information on listening for DOM-related events, see the -DOM Events section of the -Node landing page. -

    - -

    <iframe> Shim

    - -

    -The MenuNav Node Plugin uses an <iframe> shim to prevent -<select> elements from poking through submenus in IE 6. The -<iframe> shim is only used for IE 6, and for performance its creation is -deferred until the first time a submenu is made visible. -

    - -

    -Once created, the -<iframe> shim is appended to the node representing a submenu's bounding box, -and is therefore a sibling of the the a submenu's content box. All styling of the -<iframe> is handled by the core CSS file for the MenuNav Node Plugin, so -authors of custom skins won't have to worry about it. The markup template used to create each -<iframe> is accessible via the -SHIM_TEMPLATE property. -

    - -

    -To help users of screen readers to avoid mistakenly interacting with the -<iframe> shim, its tabindex attribute is set to "-1" and its -title attribute is set to "Menu Stacking Shim". The value of the <iframe>'s -title attribute is available via the -SHIM_TEMPLATE_TITLE -property for easy localization. Lastly, the src attribute of the -<iframe> is set to "javascript:false;" so that it won't load a -page inside it, preventing the secure/nonsecure warning in IE when using the MenuNav Node Plugin -with HTTPS. -

    - -

    CSS reference

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Class NameDescription
    yui3-menuApplied to the element representing a menu's bounding box.
    yui3-menu-contentApplied to the element representing a menu's content box.
    yui3-menu-hiddenApplied to a menu's bounding box when hidden.
    yui3-shimApplied to the element serving as a menu's shim.
    yui3-menu-horizontalRenders a menu horizontally. Applied to a menu's bounding box element.
    yui3-menu-labelApplied to the element representing a menu's label.
    yui3-menu-label-activeApplied to a menu's label when it is a MenuNav's active descendent.
    yui3-menu-label-menuvisibleApplied to a menu's label when its corresponding menu is visible.
    yui3-menuitemApplied to the element representing a menuitem's bounding box.
    yui3-menuitem-contentApplied to the element representing a menuitem's content box.
    yui3-menuitem-activeApplied to a menuitem when it is a MenuNav's active descendent.
    first-of-type - Applied to the first <ul> element inside each menu's - content box. -
    - -

    Known Issues

    - -
      -
    • Open <select>-based menus poke through submenus of a menu - created using the MenuNav Node Plugin - -

      - Screen capture of an open HTML select-based menu poking through the submenu of a menu created using the MenuNav Node Plugin - In Safari 3 and IE 6 the <select> element's - popup menu is modal—making it impossible to interact with any - of the other elements on the page, and therefore impossible to both - trigger the display of a DHTML menu and impossible for the - <select> element's popup menu to potentially - poke through a DHTML menu. -

      -

      - In all other browsers, a <select> element's - popup menu is both not modal and has a zindex higher than - any other element. The established best practice of using an - <iframe> element has a shim does not fix the - problem. Currently there is no fix for this issue. -

      -
    • -
    -
    -
    - - -
    -
    - - - - - - diff --git a/docs/node-menunav/menunav-leftnav-example.html b/docs/node-menunav/menunav-leftnav-example.html deleted file mode 100644 index 616a17a5c9d..00000000000 --- a/docs/node-menunav/menunav-leftnav-example.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - MenuNav: Basic Left Nav Example - - - - - - -

    Header

    -
    -
    -
    -
    - -
    -
    -
    -
    - -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    - -
    -
    - - - - - - - - diff --git a/docs/node-menunav/menunav-leftnav.html b/docs/node-menunav/menunav-leftnav.html deleted file mode 100644 index 54a552caaef..00000000000 --- a/docs/node-menunav/menunav-leftnav.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Example: Basic Left Nav - - - - - - - -
    -

    Example: Basic Left Nav

    - - - -
    -
    -
    -

    -This example demonstrates how to create a traditional, two-column page layout -(using Grids) with a set of fly-out menu navigation -in the left column. -

    -
    - - - -

    Setting Up the HTML

    - -

    -Begin by including the CSS Grids dependencies and grid -markup (this example uses a 2 column version of the -Fluid Page Template with a 160px left column). -Add the markup for the menu to the left column of the grid, and the class yui3-skin-sam -to the <body>. -

    - -

    -The root menu of menus built using the MenuNav Node Plugin can have a verical or horizontal -orientation. The default orientation for menus is vertical, but can be easily switched to -horizontal by applying a class of yui3-menu-horizontal to the node representing the -root menu's bounding box, as illustrated below: -

    - -
    <div id="productsandservices" class="yui3-menu yui3-menu-horizontal"><!-- Bounding box -->
    -    <div class="yui3-menu-content"><!-- Content box -->
    -        <ul>
    -            <!-- Menu items -->
    -        </ul>
    -    </div>
    -</div>
    - - -

    Initializing the Menu

    - -

    -With the menu markup in place, retrieve the Node instance representing the root -menu (<div id="productsandservices">) and call the -plug -passing in a reference to the MenuNav Node Plugin. -

    - -
    //  Call the "use" method, passing in "node-menunav".  This will load the
    -//  script and CSS for the MenuNav Node Plugin and all of the required
    -//  dependencies.
    -
    -YUI().use('node-menunav', function(Y) {
    -
    -    //  Retrieve the Node instance representing the root menu
    -    //  (<div id="productsandservices">) and call the "plug" method
    -    //  passing in a reference to the MenuNav Node Plugin.
    -
    -    var menu = Y.one("#productsandservices");
    -
    -    menu.plug(Y.Plugin.NodeMenuNav);
    -
    -});
    - - -

    -Note: In keeping with the -Exceptional Performance -team's recommendation, the script block used to instantiate the menu will be -placed at the bottom of the page. -This not only improves performance, it helps ensure that the DOM subtree of the -element representing the root menu -(<div id="productsandservices">) is ready to be scripted. -

    -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/constrain-resize-plugin.html b/docs/resize/constrain-resize-plugin.html deleted file mode 100644 index 4a3415fa4d6..00000000000 --- a/docs/resize/constrain-resize-plugin.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - Example: Widget with Resize Plugin under constraints - - - - - - - -
    -

    Example: Widget with Resize Plugin under constraints

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows a weather widget that loads information from YQL, and implements a constrained resize-plugin. The end result is a widget that's draggable and resizable between mini and detail view.

    -
    - -
    - - - -
    -
    Sunnyvale Conditions
    -
    -
    - -

    What's the weather like?

    -

    This little widget shows the weather forecast in Sunnyvale. It's resizable, draggable, and implements the ResizeConstrained plugin. You can resize it between a simple and detailed view.

    - -

    - -

    - - - - -
    - -

    Setting up the HTML

    -

    First we create the HTML for the page. This consists of a weatherWidget div with header and body wrappers, along with some other content on the page.

    - -
    <div id="weatherWidget">
    -    <div class="yui3-widget-hd">Sunnyvale Conditions</div>
    -    <div class="yui3-widget-bd" id="weatherWidgetContent"></div>
    -</div>
    -
    -<h2>What's the weather like?</h2>
    -<p>This little widget shows the weather forecast in Sunnyvale. It's resizable, draggable, and implements the <code>ResizeConstrained</code> plugin. You can resize it between a simple and detailed view.</p>
    -
    -<p>
    -    <input type='button' class=".exampleBtn" id='launchOverlay' value="Loading Components..." disabled>
    -</p>
    - - -

    Next, we add CSS, including CSS3 gradients to spruce up the widget.

    - -
    .example {
    -    font-family: sans-serif;
    -    font-size:13px;
    -    color: #333;
    -    line-height:18px;
    -    width:600px;
    -    margin:0 auto;
    -    margin-bottom:20px;
    -}
    -
    -.yui3-overlay h1, .yui3-overlay h2, .yui3-overlay h3, .yui3-overlay h4, .yui3-overlay h5 {
    -  color:white;
    -  border-bottom:none; 
    -  font-weight:lighter;
    -}
    -.example .yui3-overlay {
    -    background:#161e31;
    -    color:white;
    -    -moz-border-radius:3px;
    -    -webkit-border-radius:3px;
    -    border-radius:3px;
    -    -webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.8);
    -    -moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.8);
    -}
    -
    -.example .yui3-overlay .yui3-widget-hd {
    -  background: #6b7180; /* Old browsers */
    -  background: -moz-linear-gradient(top, #6b7180 1%, #4b5365 2%, #273142 50%, #0a0e0a 51%, #0a0809 100%); /* FF3.6+ */
    -  background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#6b7180), color-stop(2%,#4b5365), color-stop(50%,#273142), color-stop(51%,#0a0e0a), color-stop(100%,#0a0809)); /* Chrome,Safari4+ */
    -  background: -webkit-linear-gradient(top, #6b7180 1%,#4b5365 2%,#273142 50%,#0a0e0a 51%,#0a0809 100%); /* Chrome10+,Safari5.1+ */
    -  background: -o-linear-gradient(top, #6b7180 1%,#4b5365 2%,#273142 50%,#0a0e0a 51%,#0a0809 100%); /* Opera11.10+ */
    -  background: -ms-linear-gradient(top, #6b7180 1%,#4b5365 2%,#273142 50%,#0a0e0a 51%,#0a0809 100%); /* IE10+ */
    -  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6B7180', endColorstr='#0a0809',GradientType=0 ); /* IE6-9 */
    -  background: linear-gradient(top, #6b7180 1%,#4b5365 2%,#273142 50%,#0a0e0a 51%,#0a0809 100%); /* W3C */
    -  color:white;
    -  font-weight:bold;
    -  height:30px;
    -  font-size:16px;
    -  text-align:center;
    -  padding-top:10px;
    -  border-radius:3px;
    -}
    -.example .yui3-overlay #weatherWidgetContent {
    -  overflow:hidden;
    -}
    -.example .yui3-overlay #weatherWidgetContent #mainContainer, .example .yui3-overlay #weatherWidgetContent #futureDays  {
    -  background: #162749; /* Old browsers */
    -  background: -moz-linear-gradient(top, #010306 0%, #162749 100%); /* FF3.6+ */
    -  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#010306), color-stop(100%,#162749)); /* Chrome,Safari4+ */
    -  background: -webkit-linear-gradient(top, #010306 0%,#162749 100%); /* Chrome10+,Safari5.1+ */
    -  background: -o-linear-gradient(top, #010306 0%,#162749 100%); /* Opera11.10+ */
    -  background: -ms-linear-gradient(top, #010306 0%,#162749 100%); /* IE10+ */
    -  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#010306', endColorstr='#162749',GradientType=0 ); /* IE6-9 */
    -  background: linear-gradient(top, #010306 0%,#162749 100%); /* W3C */
    -  color:white;
    -
    -}
    -
    -#mainContainer {
    -    padding:10px;
    -    padding-left:55px;
    -    height:100px;
    -
    -}
    -#mainContainer p {
    -  margin:0; padding:0;
    -}
    -
    -#mainContainer #mainImage img {
    -  float:left;
    -  border-left:1px solid #5881df;
    -}
    -
    -#mainContainer #temp {
    -  font-size:32px;
    -  float:left;
    -  margin: 0 auto auto 10px;
    -}
    -#mainContainer #temp p {
    -  font-size:12px;
    -  color: #5ea3d3;
    -  margin:0;
    -  padding:0;
    -  font-weight:bold;
    -}
    -#mainContainer #otherInfo {
    -  font-weight:bold;
    -  font-size:12px;
    -  margin-top:15px;
    -}
    -
    -#futureDays .day {
    -  float:left;
    -  padding:10px;
    -  border:1px solid #202739;
    -}
    -#futureDays h3, #futureDays h4 {
    -  margin:5px 0;
    -  text-align:center;
    -}
    -#futureDays h3 {
    -  color: #5ea3d3;
    -}
    -#mainContainer .clearfix {
    -  clear:both;
    -}
    - -

    The Use Statement

    -

    The use statement consists of various modules that we'll need to construct this widget.

    - -
    YUI().use('overlay', 'resize-plugin', 'resize-constrain', 'dd-plugin', 'yql', function(Y) {
    - - -

    resize-plugin allows our overlay to be resizable. We also need to pull down the resize-constrain submodule to allow for constraining. The dd-plugin enables draggability on a widget, while the yql module allows us to send requests to YQL

    - -

    Enabling Constrained Resizing on the Widget

    -

    Constrained resizing can be done by plugging in Y.Plugin.Resize and then plugging in Y.Plugin.ResizeConstrained under the resize namespace.

    - -
    weatherWidget = new Y.Overlay({
    -   width: "250px",
    -   height:"300px",
    -   srcNode: "#weatherWidget",
    -   visible: false,
    -   align: {node:"#example", points:["tc", "bc"]}
    -});
    -
    -//allow resizability and draggability
    -weatherWidget.plug([Y.Plugin.Resize, Y.Plugin.Drag]);
    -
    -//we can plug in the resizeConstrained plugin on the 'resize' namespace
    -weatherWidget.resize.plug(Y.Plugin.ResizeConstrained, {
    -  minWidth: 250,
    -  minHeight: 170,
    -  maxWidth: 250,
    -  maxHeight: 300,
    -  preserveRatio: false
    -});
    -
    -weatherWidget.render();
    - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/constrain-resize.html b/docs/resize/constrain-resize.html deleted file mode 100644 index f7cee79b5f8..00000000000 --- a/docs/resize/constrain-resize.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Example: Constrain a Resize - - - - - - - -
    -

    Example: Constrain a Resize

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows how to create a resizable element where the resize operation is constrained to a specific aspect ratio.

    -
    - -
    - - -
    Resize Me
    - - - - - - -
    -

    Setting up the Node

    -

    First we need to create an HTML element to make resizable.

    - -
    <div id="demo">Resize Me</div>
    - - -

    Next, we'll give that element some CSS to make it visible.

    - -
    #demo {
    -    height: 100px;
    -    width: 100px;
    -    border: 1px solid black;
    -    background-color: #8DD5E7;
    -    position: relative;
    -    padding: 1em;
    -    margin: 2em;
    -}
    - - -

    Setting up the YUI Instance

    - -

    Now we need to create our YUI instance and tell it to load the resize module. This module is a rollup that includes the resize-constrain submodule; that means we have access to the ResizeConstrained plugin.

    - -
    YUI().use('resize');
    - - - -

    Making the Node resizable

    -

    Now that we have a YUI instance with the resize module, we need to instantiate the Resize instance on this Node.

    - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });   
    -});
    - - -

    Adding the Constrained Plugin

    - -

    Now we will plug ResizeConstrained into our Resize instance. This plugin will allow you to limit the resize dimensions in special ways.

    - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });
    -    resize.plug(Y.Plugin.ResizeConstrained, {
    -        minWidth: 50,
    -        minHeight: 50,
    -        maxWidth: 300,
    -        maxHeight: 300,
    -        preserveRatio: true
    -    });    
    -});
    - - -

    In this case, we've used the constraint feature to specify minimum height and width for the element while setting preserveRatio to true, locking in the original aspect ratio for the element.

    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/image-resize.html b/docs/resize/image-resize.html deleted file mode 100644 index e8af4af2ced..00000000000 --- a/docs/resize/image-resize.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - Example: 8-way Image Resize - - - - - - - -
    -

    Example: 8-way Image Resize

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows a simple 8-way image resize and provides the required CSS elements required for the most common image-resize visual treatment.

    -
    - -
    - - -
    - Eduardo Lundgren, Nate Cavanaugh and the YUI Team at Yahoo -
    - - - - - - - -
    - - -

    Setting up the Node

    -

    First we need to create an image to resize; we wrap the image in another element to provide some CSS hooks.

    - -
    <div id="demoContainer" class="yui3-resize-knob">
    -	<img id="demo" src="..&#x2F;assets&#x2F;resize/team.jpg" alt="Eduardo Lundgren, Nate Cavanaugh and the YUI Team at Yahoo">
    -</div>
    - - -

    Setting up the YUI Instance

    -

    Next, we need to create our YUI instance and tell it to load the resize module.

    - -
    YUI().use('resize');
    - - -

    Making the Node Resizable

    -

    Now that we have a YUI instance with the resize module, we need to instantiate the Resize instance on this element.

    - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });   
    -});
    - - - -

    Adding the Constrained Plugin

    -

    Now we add the ResizeConstrained plugin. This plugin will allow you to limit the resize dimensions in special ways.

    - - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });   
    -	resize.plug(Y.Plugin.ResizeConstrained, {
    -		constrain: '#demoContainer',
    -		minHeight: 50,
    -		minWidth: 50
    -	});
    -});
    - - -

    Adding CSS>

    - -

    Image resize operations typically have their own visual treatment and therefore require slightly different drag handles in order to be discoverable and intuitive. Here is CSS that provides a common image-resize visual treatment:

    - -
    #demo {
    -	height: 121px;
    -	width: 182px;
    -	position: absolute;
    -	top: 100px;
    -	left: 100px;
    -}
    -
    -#demoContainer {
    -	position: relative;
    -	height: 333px;
    -	width: 500px;
    -    border: 1px solid black;
    -}
    -
    -/* knob handles demo */
    -
    -.yui3-resize-knob .yui3-resize-handle-tr,
    -.yui3-resize-knob .yui3-resize-handle-br,
    -.yui3-resize-knob .yui3-resize-handle-tl,
    -.yui3-resize-knob .yui3-resize-handle-bl,
    -.yui3-resize-knob .yui3-resize-handle-b,
    -.yui3-resize-knob .yui3-resize-handle-t,
    -.yui3-resize-knob .yui3-resize-handle-l,
    -.yui3-resize-knob .yui3-resize-handle-r {
    -	border: 1px solid #808080;
    -	background-color: #F2F2F2;
    -	height: 6px;
    -	width: 6px;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-b,
    -.yui3-resize-knob .yui3-resize-handle-t {
    -	left: 45%;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-l,
    -.yui3-resize-knob .yui3-resize-handle-r {
    -	top: 45%;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-t,
    -.yui3-resize-knob .yui3-resize-handle-tr,
    -.yui3-resize-knob .yui3-resize-handle-tl {
    -	top: -4px;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-b,
    -.yui3-resize-knob .yui3-resize-handle-br,
    -.yui3-resize-knob .yui3-resize-handle-bl {
    -	bottom: -4px;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-l,
    -.yui3-resize-knob .yui3-resize-handle-bl,
    -.yui3-resize-knob .yui3-resize-handle-tl {
    -	left: -4px;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-r,
    -.yui3-resize-knob .yui3-resize-handle-br,
    -.yui3-resize-knob .yui3-resize-handle-tr {
    -	right: -4px;
    -}
    -
    -.yui3-resize-knob .yui3-resize-handle-inner {
    -	background: none;
    -	height: 6px;
    -	width: 6px;
    -}
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/index.html b/docs/resize/index.html deleted file mode 100644 index b326053a2a2..00000000000 --- a/docs/resize/index.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - Resize - - - - - - - -
    -

    Resize

    - - - Jump to Table of Contents - - -
    -
    -
    -

    The Resize Utility allows you to make an HTML element resizable.

    -
    - -

    Getting Started

    - -

    -To include the source files for Resize and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('resize', 'resize-plugin', function (Y) {
    -  // Resize is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - - - -

    Simple Resize

    -

    You can create a simple Resize instance by including the resize module or base-resize submodule and using the following code:

    - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });   
    -});
    - - -

    Events

    - -

    Resize provides useful events to allow the implementer to control the end-user experience.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventPreventableStoppableBubblesDescription
    resize:startyesyesyesHandles the resize start event. Fired when the user begins dragging a handle.
    resize:resizeyesyesyesHandles the resize event. Fired with every native mousemove event when the handle is being dragged; this could be as often as once for every pixel of movement.
    resize:alignyesyesyesHandles the resize align event.
    resize:endyesyesyesHandles the resize end event. Fired when the user releases the handle from the drag operation.
    resize:mouseUpyesyesyesHandles the resize mouseup event. Fired when a mouseup event happens on a handle.
    - -

    Module Descriptions

    - -

    Resize for YUI 3 has been broken up into several modules to allow you, as the implementer, to target the specific functionality you want — and omit the functionality you're not using.

    - - - - - - - - - - - - - - - - - - - - - -
    Module NameDescription
    resize-baseThis is the base Resize class; use this submodule for your simplest use case, where constraints, ratios, and proxies are not required.
    resize-constrainAdds constraining & ratio support.
    resize-proxyAdds proxy support, via dd-proxy.
    - -

    Resize Plugin for Widgets

    - -

    Along with the standalone utility, a Resize plugin is available and can be plugged into Y.Node or Y.Widget instances. The plugin can be created by adding resize-plugin in your use statement, and then plugging in Y.Plugin.Resize.

    - -
    YUI().use('overlay', 'resize-plugin', function(Y) {
    -    var overlay = new Y.Overlay({
    -       width: "200px",
    -       height: "300px",
    -       srcNode: "#overlay",
    -       visible: "true",
    -       centered: "true" 
    -    });
    -    //Plug in the resizability plugin
    -    overlay.plug(Y.Plugin.Resize);
    -    overlay.render();
    -});
    - -
    Listening to events on a widget
    -

    With the resize plugin being plugged into a Y.Widget instance, resize events can be listened to under the resize namespace. The resize plugin will automatically change width and height attributes on the widget (and the x , y attributes if your widget uses Y.WidgetPosition).

    - -
    YUI().use('overlay', 'resize-plugin', function(Y) {
    -    overlay.plug(Y.Plugin.Resize);
    -    overlay.render();
    -
    -    overlay.resize.on('resize:resize', function(event) {
    -       //this function will be called on resize. 
    -    });
    -});
    - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/simple-resize-plugin.html b/docs/resize/simple-resize-plugin.html deleted file mode 100644 index a2ff67df5b7..00000000000 --- a/docs/resize/simple-resize-plugin.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - Example: Widget with simple Resize Plugin - - - - - - - -
    -

    Example: Widget with simple Resize Plugin

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows the simple use case where we make an overlay resizable.

    -
    - -
    - - - -
    -

    Did you know that the YUI Team tweets regularly under the handle @yuilibrary?

    - -

    You can also follow some team members directly: @allenr, @ls_n, @yaypie, @tilomitra, @reid and @davglass.

    -
    - -

    YUI 3 is Yahoo!'s next-generation JavaScript and CSS library. It powers the new Yahoo! homepage, Yahoo! Mail, and many other Yahoo! sites. The YUI 3 Library has been redesigned and rewritten from the ground up incorporating what we've learned in five years of dedicated library development. The library includes the core components, a full suite of utilities, the Widget Infrastructure, a growing collection of widgets, CSS resources, and tools.

    - -

    - - - -

    - - - - -
    - -

    Setting up the Node

    -

    First we create the HTML for an overlay along with the other content ont he page

    - -
    <div id="overlay">
    -    <p>Did you know that the YUI Team tweets regularly under the handle <a href="http://www.twitter.com/yuilibrary" alt="yuilibrary">@yuilibrary</a>?</p>
    -
    -    <p>You can also follow some team members directly: <a href="http://www.twitter.com/allenr" alt="Allen R.">@allenr</a>, <a href="http://www.twitter.com/ls_n" alt="Luke S.">@ls_n</a>, <a href="http://www.twitter.com/yaypie" alt="Ryan G.">@yaypie</a>, <a href="http://www.twitter.com/tilomitra" alt="Tilo M.">@tilomitra</a>, <a href="http://www.twitter.com/reid" alt="Reid B.">@reid</a> and <a href="http://www.twitter.com/davglass" alt="Dav G.">@davglass</a>.</p>
    -</div>
    -
    -<p><strong>YUI 3 is Yahoo!'s next-generation JavaScript and CSS library.</strong> It powers the new Yahoo! homepage, Yahoo! Mail, and many other Yahoo! sites. The YUI 3 Library has been redesigned and rewritten from the ground up incorporating what we've learned in five years of dedicated library development. The library includes the core components, a full suite of utilities, the Widget Infrastructure, a growing collection of widgets, CSS resources, and tools. </p>
    -
    -<p>
    -    <input type='button' class=".exampleBtn" id='launchOverlay' value="Show Overlay">
    -    <input type='button' class=".exampleBtn" id='resizeOverlay' value='Allow Resizing' disabled>
    -    <input type='button' class=".exampleBtn" id='dragOverlay' value='Allow Dragging' disabled>
    -</p>
    - - -

    Next, we give that element some CSS to make it visible.

    - -
    .example {
    -    font-family: sans-serif;
    -    font-size:13px;
    -    color: #333;
    -    line-height:18px;
    -    width:600px;
    -    margin:0 auto;
    -    margin-top:60px;
    -    margin-bottom:20px;
    -}
    -.example .yui3-overlay {
    -    background:#161e31;
    -    color:white;
    -    padding:10px;
    -    border-radius:3px;
    -    box-shadow: 0px 0px 5px rgba(0,0,0,0.8);
    -    overflow:hidden;
    -}
    -.example .yui3-overlay a {
    -    text-decoration:none;
    -    color: #30bef2;
    -}
    -.example .yui3-overlay a:hover {
    -    color: #8cd7f2;
    -}
    - - -

    Setting up the YUI Instance

    -

    We need to create our YUI instance and tell it to load the resize-plugin module, along with the 'overlay' module; If we wanted the resize to be constrained, we would also need to include the 'resize-constrain' plugin.

    - -
    YUI().use('resize-plugin');
    - - -

    Making the Widget Resizable

    - -

    When the resizable button is pressed, we plug the Y.Overlay instance with Y.Plugin.Resize.

    - -
    overlay.plug(Y.Plugin.Resize);
    - - -

    Upon instantiation, the widget's drag handles will appear and the element is resizable via drag-and-drop. The widget will be notified of x, y, width and height changes.

    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/resize/simple-resize.html b/docs/resize/simple-resize.html deleted file mode 100644 index d3dc717caf4..00000000000 --- a/docs/resize/simple-resize.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - Example: Simple Resize - - - - - - - -
    -

    Example: Simple Resize

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows the simple use case where we make an HTML element resizable.

    -
    - -
    - - -
    Resize Me
    - - - - - - -
    - -

    Setting up the Node

    -

    First we need to create an HTML element to make resizable.

    - -
    <div id="demo">Resize Me</div>
    - - -

    Next, we give that element some CSS to make it visible.

    - -
    #demo {
    -    height: 100px;
    -    width: 100px;
    -    border: 1px solid black;
    -    background-color: #8DD5E7;
    -    position: relative;
    -    padding: 1em;
    -    margin: 2em;
    -}
    - - -

    Setting up the YUI Instance

    -

    We need to create our YUI instance and tell it to load the resize module; for this simple use case, we could also use the base-resize submodule.

    - -
    YUI().use('resize');
    - - -

    Making the Node Resizable

    - -

    Now that we have a YUI instance with the resize module, we need to instantiate the Resize instance on this Node.

    - -
    YUI().use('resize', function(Y) {
    -    var resize = new Y.Resize({
    -        //Selector of the node to resize
    -        node: '#demo'
    -    });   
    -});
    - - -

    Upon instantiation, the element's drag handles will appear and the element is resizable via drag-and-drop.

    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/index.html b/docs/sortable/index.html deleted file mode 100644 index 087845c7301..00000000000 --- a/docs/sortable/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - Sortable - - - - - - - -
    -

    Sortable

    - - - Jump to Table of Contents - - -
    -
    -
    -

    The Sortable Utility allows you to create a sortable list from a container and a group of children. It also allows you to join lists together in various ways.

    -
    - -

    Getting Started

    - -

    -To include the source files for Sortable and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('sortable', function (Y) {
    -  // Sortable is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - - -

    A Basic Sortable List

    -

    The most common use case of a sortable list is an Unordered List.

    -

    Below is the sample markup used to create a container and a list.

    - -
    <div id="demo">
    -    <ul>
    -        <li>Item #1</li>
    -        <li>Item #2</li>
    -        <li>Item #3</li>
    -        <li>Item #4</li>
    -        <li>Item #5</li>
    -        <li>Item #6</li>
    -        <li>Item #7</li>
    -        <li>Item #8</li>
    -        <li>Item #9</li>
    -        <li>Item #10</li>
    -    </ul>
    -</div>
    - - -

    To turn this into a sortable list, you just need to create the Sortable object and tell it the container and the nodes.

    -

    The nodes can be any selector string that matches a child of the container. For performance reasons you will want to make the container an element that is as close to the nodes as possible. The farther away in the DOM the container is from the nodes the worse the performance will be.

    - -
    YUI().use('sortable', function(Y) {
    -    var sortable = new Y.Sortable({
    -        container: '#demo',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -});
    - - -

    Events

    - -

    Sortable uses DD.Delegate under the hood to handle the Drag and Drop operations. It sets itself as the bubbleTarget of the Delegate instance, so all DD-related events are bubbled to it.

    -

    For more information on DD related events, see the events section on the Drag and Drop page.

    - - -

    Joining Lists

    - -

    By default, a Sortable list can only interact with itself; you can't drag from one Sortable list to another. But a Sortable instance can be configured to be joined with another Sortable instance.

    -

    There are four ways a Sortable list can be joined: inner, outer, full and none (none is the default).

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Join TypeDescription
    innerItems in the joined list can be moved into the main list but items in the main list can not be moved to the joined list.
    outerItems in the main list can be moved into the joined list but items in the joined list can not be moved to the main list.
    fullAll items in both lists can be moved into and out of any other joined list.
    noneThe default join type. No interaction with other lists.
    - -
    YUI().use('sortable', function(Y) {
    -    var sortable1 = new Y.Sortable({
    -        container: '#demo1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var sortable2 = new Y.Sortable({
    -        container: '#demo2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    sortable1.join(sortable2, 'full');
    -});
    - - -

    You can also join multiple lists in multiple ways to get the experience you are looking for.

    - -
    YUI().use('sortable', function(Y) {
    -    var sortable1 = new Y.Sortable({
    -        container: '#demo1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var sortable2 = new Y.Sortable({
    -        container: '#demo2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var sortable3 = new Y.Sortable({
    -        container: '#demo3',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    sortable1.join(sortable2, 'inner');
    -    sortable2.join(sortable3, 'outer');
    -
    -    sortable3.join(sortable1, 'full');
    -    sortable3.join(sortable2, 'full');
    -});
    - - -

    Using DD Plugins

    -

    The DD.Delegate object bound to a Sortable instance is exposed to allow you to easily attach plugins to a Sortable instance.

    -

    The Sortable instance has a delegate namespace, which is a reference to the internal DD.Delegate instance.

    - -
    var sortable = new Y.Sortable({
    -    container: '#demo',
    -    nodes: 'li'
    -});
    -
    -sortable.delegate.dd.plug(SomeDDPlugin);
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/simple-sortable.html b/docs/sortable/simple-sortable.html deleted file mode 100644 index 2173a2d4089..00000000000 --- a/docs/sortable/simple-sortable.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - Example: Simple Sortable List - - - - - - - -
    -

    Example: Simple Sortable List

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Making a simple sortable list.

    -
    - -
    - - -
    -
      -
    • Item #1
    • -
    • Item #2
    • -
    • Item #3
    • -
    • Item #4
    • -
    • Item #5
    • -
    • Item #6
    • -
    • Item #7
    • -
    • Item #8
    • -
    • Item #9
    • -
    • Item #10
    • -
    -
    - - - - - -
    - - -

    Setting Up the List

    -

    First we need to create the HTML structure for the list. Since Sortable uses Y.DD.Delegate, we need to set up a delegation container (#demo) and the list items (li).

    - -
    <div id="demo">
    -    <ul>
    -        <li>Item #1</li>
    -        <li>Item #2</li>
    -        <li>Item #3</li>
    -        <li>Item #4</li>
    -        <li>Item #5</li>
    -        <li>Item #6</li>
    -        <li>Item #7</li>
    -        <li>Item #8</li>
    -        <li>Item #9</li>
    -        <li>Item #10</li>
    -    </ul>
    -</div>
    - - -

    Now we give the list some CSS to make it visible.

    - -
    #demo li {
    -    list-style-type: none;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    background-color: #8DD5E7;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    - -
    YUI().use('sortable'
    - - - -

    Making the List Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate the Sortable instance on the list.

    - -
    YUI().use('sortable', function(Y) {
    -    var sortable = new Y.Sortable({
    -        container: '#demo',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/sortable-float.html b/docs/sortable/sortable-float.html deleted file mode 100644 index bdf02136b05..00000000000 --- a/docs/sortable/sortable-float.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Example: Floated List - - - - - - - -
    -

    Example: Floated List

    - - - Jump to Table of Contents - - -
    -
    -
    -

    Making a simple sortable list with floated nodes.

    -
    - -
    - - -
    - Item #1 - Item #2 - Item #3 - Item #4 - Item #5 - Item #6 - Item #7 - Item #8 - Item #9 - Item #10 -
    - - - - -
    - -

    Setting Up the List

    -

    First we need to create the HTML structure for the list. Since Sortable uses Y.DD.Delegate, we need to set up a delegation container (#demo) and the list items (em).

    - -
    <div id="demo">
    -    <em>Item #1</em>
    -    <em>Item #2</em>
    -    <em>Item #3</em>
    -    <em>Item #4</em>
    -    <em>Item #5</em>
    -    <em>Item #6</em>
    -    <em>Item #7</em>
    -    <em>Item #8</em>
    -    <em>Item #9</em>
    -    <em>Item #10</em>
    -</div>
    - - -

    Now we give the list some CSS to make it visible.

    - -
    #demo {
    -    border: 1px solid black;
    -    height: 200px;
    -}
    -#demo em {
    -    display: block;
    -    float: left;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    background-color: #8DD5E7;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    - -
    YUI().use('sortable'
    - - -

    Making the List Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate the Sortable instance on the list.

    - -
    YUI().use('sortable', function(Y) {
    -    var sortable = new Y.Sortable({
    -        container: '#demo',
    -        nodes: 'em',
    -        opacity: '.1'
    -    });
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/sortable-multi-full.html b/docs/sortable/sortable-multi-full.html deleted file mode 100644 index 2ad72cb8356..00000000000 --- a/docs/sortable/sortable-multi-full.html +++ /dev/null @@ -1,403 +0,0 @@ - - - - - Example: Multiple Lists - Full Join - - - - - - - -
    -

    Example: Multiple Lists - Full Join

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example makes multiple sortable lists that are fully joined together.

    -
    - -
    - - -
    -
    -

    List 1

    -
      -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • 6
    • -
    • 7
    • -
    • 8
    • -
    • 9
    • -
    • 10
    • -
    -
    -
    -

    List 2

    -
      -
    • A
    • -
    • B
    • -
    • C
    • -
    • D
    • -
    • E
    • -
    • F
    • -
    • G
    • -
    • H
    • -
    • I
    • -
    • J
    • -
    -
    -
    - -
    - - - - - -
    - -

    Setting Up the List

    -

    First we need to create the HTML structure for the lists. Since Sortable uses Y.DD.Delegate, we need to set up the delegation containers (#list1, #lists2) and the list items (li).

    - -
    <div id="demo" class="yui3-g">
    -    <div class="yui3-u-1-2">
    -        <h4>List 1</h4>
    -        <ul id="list1">
    -            <li class="one">1</li>
    -            <li class="one">2</li>
    -            <li class="one">3</li>
    -            <li class="one">4</li>
    -            <li class="one">5</li>
    -            <li class="one">6</li>
    -            <li class="one">7</li>
    -            <li class="one">8</li>
    -            <li class="one">9</li>
    -            <li class="one">10</li>
    -        </ul>
    -	</div>
    -    <div class="yui3-u-1-2">
    -        <h4>List 2</h4>
    -        <ul id="list2">
    -            <li class="two">A</li>
    -            <li class="two">B</li>
    -            <li class="two">C</li>
    -            <li class="two">D</li>
    -            <li class="two">E</li>
    -            <li class="two">F</li>
    -            <li class="two">G</li>
    -            <li class="two">H</li>
    -            <li class="two">I</li>
    -            <li class="two">J</li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    Now we give the lists some CSS to make them visible.

    - -
    #demo h4 {
    -    margin: 10px auto;
    -    width: 165px;
    -    text-align: center;
    -}
    -
    -#demo ul {
    -    margin: 0 auto;
    -    width: 165px;
    -    padding: 0;
    -}
    -#demo li {
    -    list-style-type: none;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    font-weight: bold;
    -}
    -#demo li.one {
    -    background-color: #8DD5E7;
    -}
    -#demo li.two {
    -    background-color: #EDFF9F;
    -    text-align: center;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    -

    In this example we are also going to attach a DD plugin to the Sortable instances.

    - -
    YUI().use('dd-constrain', 'sortable'
    - - -

    Making the Lists Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate a Sortable instance on each of the lists.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -});
    - - -

    Applying a DD Plugin

    -

    Since Sortable uses DD.Delegate, there is a dd instance available after instantiation.

    -

    The DD.Delegate reference is found on the .delegate property of the Sortable. -This DD.Delegate instance has a DD.Drag instance bound to the dd property on the DD.Delegate -

    - -
    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    -list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    - -

    Applying the Plugin.DDConstrained to the Sortable instance.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -    list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -
    -});
    - - - -

    Joining the Lists

    -

    Joining the lists is as simple as calling the join method on one list passing in another list. By default, we use a full join which joins both lists both ways.

    -

    You can optionally specify the join type: inner or outer. The moveType can also be specified on the list: swap, move or copy. swap is the default, as seen in this example.

    - -
    list1.join(list2);              //Full join <-- both ways -->
    -list1.join(list2, 'outer');     //Outer join --> one way -->
    -list1.join(list2, 'inner');     //Inner join <-- one way <--
    - - - -

    Putting it together

    -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.join(list2);
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/sortable-multi-in.html b/docs/sortable/sortable-multi-in.html deleted file mode 100644 index 4f3750ace30..00000000000 --- a/docs/sortable/sortable-multi-in.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - - Example: Multiple Lists - Inner Join - - - - - - - -
    -

    Example: Multiple Lists - Inner Join

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example makes multiple sortable lists that are inner joined together. In the example below you will see 2 lists. Both lists are sortable, but List #2 can move its items into List #1 and they become sortable. However, List #1 can not move its items into List #2.

    -
    - -
    - - -
    -
    -

    List 1

    -
      -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • 6
    • -
    • 7
    • -
    • 8
    • -
    • 9
    • -
    • 10
    • -
    -
    -
    -

    List 2

    -
      -
    • A
    • -
    • B
    • -
    • C
    • -
    • D
    • -
    • E
    • -
    • F
    • -
    • G
    • -
    • H
    • -
    • I
    • -
    • J
    • -
    -
    -
    - -
    - - - - - -
    - -

    Note: When using an outer or inner joined list, you must pick a moveType of 'move' or 'copy', the default 'swap' won't give you the results you expect.

    -

    This example assumes that you have seen the Multiple Sortable Lists - Full Join example and continues from there.

    - -

    Setting Up the List

    -

    First we need to create the HTML structure for the lists. Since Sortable uses Y.DD.Delegate, we need to set up the delegation containers (#list1, #lists2) and the list items (li).

    - -
    <div id="demo" class="yui3-g">
    -    <div class="yui3-u-1-2">
    -        <h4>List 1</h4>
    -        <ul id="list1">
    -            <li class="one">1</li>
    -            <li class="one">2</li>
    -            <li class="one">3</li>
    -            <li class="one">4</li>
    -            <li class="one">5</li>
    -            <li class="one">6</li>
    -            <li class="one">7</li>
    -            <li class="one">8</li>
    -            <li class="one">9</li>
    -            <li class="one">10</li>
    -        </ul>
    -	</div>
    -    <div class="yui3-u-1-2">
    -        <h4>List 2</h4>
    -        <ul id="list2">
    -            <li class="two">A</li>
    -            <li class="two">B</li>
    -            <li class="two">C</li>
    -            <li class="two">D</li>
    -            <li class="two">E</li>
    -            <li class="two">F</li>
    -            <li class="two">G</li>
    -            <li class="two">H</li>
    -            <li class="two">I</li>
    -            <li class="two">J</li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    Now we give the lists some CSS to make them visible.

    - -
    #demo h4 {
    -    margin: 10px auto;
    -    width: 165px;
    -    text-align: center;
    -}
    -
    -#demo ul {
    -    margin: 0 auto;
    -    width: 165px;
    -    padding: 0;
    -}
    -#demo li {
    -    list-style-type: none;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    font-weight: bold;
    -}
    -#demo li.one {
    -    background-color: #8DD5E7;
    -}
    -#demo li.two {
    -    background-color: #EDFF9F;
    -    text-align: center;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    -

    In this example we are also going to attach a DD plugin to the Sortable instances.

    - -
    YUI().use('dd-constrain', 'sortable'
    - - -

    Making the Lists Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate a Sortable instance on each of the lists.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -});
    - - -

    Applying a DD Plugin

    -

    Since Sortable uses DD.Delegate, there is a dd instance available after instantiation.

    -

    The DD.Delegate reference is found on the .delegate property of the Sortable. -This DD.Delegate instance has a DD.Drag instance bound to the dd property on the DD.Delegate -

    - -
    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    -list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    - -

    Applying the Plugin.DDConstrained to the Sortable instance.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -    list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -
    -});
    - - - -

    Joining the Lists

    -

    Joining the lists is as simple as calling the join method on one list passing in another list. By default, we use a full join which joins both lists both ways.

    -

    You can optionally specify the join type: inner or outer. The moveType can also be specified on the list: swap, move or copy. swap is the default, as seen in this example.

    - -
    list1.join(list2);              //Full join <-- both ways -->
    -list1.join(list2, 'outer');     //Outer join --> one way -->
    -list1.join(list2, 'inner');     //Inner join <-- one way <--
    - - - -

    Putting it together

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.join(list2, 'inner');
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/sortable-multi-out.html b/docs/sortable/sortable-multi-out.html deleted file mode 100644 index 38c5370debc..00000000000 --- a/docs/sortable/sortable-multi-out.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - - Example: Multiple Lists - Outer Join - - - - - - - -
    -

    Example: Multiple Lists - Outer Join

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example makes multiple sortable lists that are outer joined together. In the example below you will see 2 lists. -Both lists are sortable, but List #1 can move its items into List #2 and they become sortable. However, List #2 can not move its items into List #1.

    -
    - -
    - - -
    -
    -

    List 1

    -
      -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • 6
    • -
    • 7
    • -
    • 8
    • -
    • 9
    • -
    • 10
    • -
    -
    -
    -

    List 2

    -
      -
    • A
    • -
    • B
    • -
    • C
    • -
    • D
    • -
    • E
    • -
    • F
    • -
    • G
    • -
    • H
    • -
    • I
    • -
    • J
    • -
    -
    -
    - -
    - - - - - -
    - -

    Note: When using an outer or inner joined list, you must pick a moveType of 'move' or 'copy', the default 'swap' won't give you the results you expect.

    -

    This example assumes that you have seen the Multiple Sortable Lists - Full Join example and continues from there.

    - -

    Setting Up the List

    -

    First we need to create the HTML structure for the lists. Since Sortable uses Y.DD.Delegate, we need to set up the delegation containers (#list1, #lists2) and the list items (li).

    - -
    <div id="demo" class="yui3-g">
    -    <div class="yui3-u-1-2">
    -        <h4>List 1</h4>
    -        <ul id="list1">
    -            <li class="one">1</li>
    -            <li class="one">2</li>
    -            <li class="one">3</li>
    -            <li class="one">4</li>
    -            <li class="one">5</li>
    -            <li class="one">6</li>
    -            <li class="one">7</li>
    -            <li class="one">8</li>
    -            <li class="one">9</li>
    -            <li class="one">10</li>
    -        </ul>
    -	</div>
    -    <div class="yui3-u-1-2">
    -        <h4>List 2</h4>
    -        <ul id="list2">
    -            <li class="two">A</li>
    -            <li class="two">B</li>
    -            <li class="two">C</li>
    -            <li class="two">D</li>
    -            <li class="two">E</li>
    -            <li class="two">F</li>
    -            <li class="two">G</li>
    -            <li class="two">H</li>
    -            <li class="two">I</li>
    -            <li class="two">J</li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    Now we give the lists some CSS to make them visible.

    - -
    #demo h4 {
    -    margin: 10px auto;
    -    width: 165px;
    -    text-align: center;
    -}
    -
    -#demo ul {
    -    margin: 0 auto;
    -    width: 165px;
    -    padding: 0;
    -}
    -#demo li {
    -    list-style-type: none;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    font-weight: bold;
    -}
    -#demo li.one {
    -    background-color: #8DD5E7;
    -}
    -#demo li.two {
    -    background-color: #EDFF9F;
    -    text-align: center;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    -

    In this example we are also going to attach a DD plugin to the Sortable instances.

    - -
    YUI().use('dd-constrain', 'sortable'
    - - -

    Making the Lists Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate a Sortable instance on each of the lists.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -});
    - - -

    Applying a DD Plugin

    -

    Since Sortable uses DD.Delegate, there is a dd instance available after instantiation.

    -

    The DD.Delegate reference is found on the .delegate property of the Sortable. -This DD.Delegate instance has a DD.Drag instance bound to the dd property on the DD.Delegate -

    - -
    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    -list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    - -

    Applying the Plugin.DDConstrained to the Sortable instance.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -    list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -
    -});
    - - - -

    Joining the Lists

    -

    Joining the lists is as simple as calling the join method on one list passing in another list. By default, we use a full join which joins both lists both ways.

    -

    You can optionally specify the join type: inner or outer. The moveType can also be specified on the list: swap, move or copy. swap is the default, as seen in this example.

    - -
    list1.join(list2);              //Full join <-- both ways -->
    -list1.join(list2, 'outer');     //Outer join --> one way -->
    -list1.join(list2, 'inner');     //Inner join <-- one way <--
    - - - -

    Putting it together

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.join(list2, 'outer');
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/sortable/sortable-multi.html b/docs/sortable/sortable-multi.html deleted file mode 100644 index 8be068836e3..00000000000 --- a/docs/sortable/sortable-multi.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - Example: Multiple Lists - - - - - - - -
    -

    Example: Multiple Lists

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example makes multiple sortable lists that are separate from one another and do not interact with each other.

    -
    - -
    - - -
    -
    -

    List 1

    -
      -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    • 4
    • -
    • 5
    • -
    • 6
    • -
    • 7
    • -
    • 8
    • -
    • 9
    • -
    • 10
    • -
    -
    -
    -

    List 2

    -
      -
    • A
    • -
    • B
    • -
    • C
    • -
    • D
    • -
    • E
    • -
    • F
    • -
    • G
    • -
    • H
    • -
    • I
    • -
    • J
    • -
    -
    -
    - - - - - -
    - -

    Setting Up the List

    -

    First we need to create the HTML structure for the lists. Since Sortable uses Y.DD.Delegate, we need to set up the delegation containers (#list1, #lists2) and the list items (li).

    - -
    <div id="demo" class="yui3-g">
    -    <div class="yui3-u-1-2">
    -        <h4>List 1</h4>
    -        <ul id="list1">
    -            <li class="one">1</li>
    -            <li class="one">2</li>
    -            <li class="one">3</li>
    -            <li class="one">4</li>
    -            <li class="one">5</li>
    -            <li class="one">6</li>
    -            <li class="one">7</li>
    -            <li class="one">8</li>
    -            <li class="one">9</li>
    -            <li class="one">10</li>
    -        </ul>
    -	</div>
    -    <div class="yui3-u-1-2">
    -        <h4>List 2</h4>
    -        <ul id="list2">
    -            <li class="two">A</li>
    -            <li class="two">B</li>
    -            <li class="two">C</li>
    -            <li class="two">D</li>
    -            <li class="two">E</li>
    -            <li class="two">F</li>
    -            <li class="two">G</li>
    -            <li class="two">H</li>
    -            <li class="two">I</li>
    -            <li class="two">J</li>
    -        </ul>
    -    </div>
    -</div>
    - - -

    Now we give the lists some CSS to make them visible.

    - -
    #demo h4 {
    -    margin: 10px auto;
    -    width: 165px;
    -    text-align: center;
    -}
    -
    -#demo ul {
    -    margin: 0 auto;
    -    width: 165px;
    -    padding: 0;
    -}
    -#demo li {
    -    list-style-type: none;
    -    padding: 3px;
    -    width: 150px;
    -    border: 1px solid black;
    -    margin: 3px;
    -    font-weight: bold;
    -}
    -#demo li.one {
    -    background-color: #8DD5E7;
    -}
    -#demo li.two {
    -    background-color: #EDFF9F;
    -    text-align: center;
    -}
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the sortable module.

    -

    In this example we are also going to attach a DD plugin to the Sortable instances.

    - -
    YUI().use('dd-constrain', 'sortable'
    - - -

    Making the Lists Draggable

    -

    Now that we have a YUI instance with the sortable module, we need to instantiate a Sortable instance on each of the lists.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -});
    - - -

    Applying a DD Plugin

    -

    Since Sortable uses DD.Delegate, there is a dd instance available after instantiation.

    -

    The DD.Delegate reference is found on the .delegate property of the Sortable. -This DD.Delegate instance has a DD.Drag instance bound to the dd property on the DD.Delegate -

    - -
    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    -list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -    constrain2node: '#demo'
    -});
    - -

    Applying the Plugin.DDConstrained to the Sortable instance.

    - -
    YUI().use('dd-constrain', 'sortable', function(Y) {
    -    var list1 = new Y.Sortable({
    -        container: '#list1',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    var list2 = new Y.Sortable({
    -        container: '#list2',
    -        nodes: 'li',
    -        opacity: '.1'
    -    });
    -
    -    list1.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -    list2.delegate.dd.plug(Y.Plugin.DDConstrained, {
    -        constrain2node: '#demo'
    -    });
    -
    -});
    - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/uploader/index.html b/docs/uploader/index.html deleted file mode 100644 index 5ca29b5e379..00000000000 --- a/docs/uploader/index.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - Uploader - - - - - - - -
    -

    Uploader

    - - - Jump to Table of Contents - - -
    -
    -
    -

    The YUI Uploader leverages Flash to provide file upload functionality beyond the native browser-based methods. Specifically, the Uploader allows for: -

      -
    1. Multiple file selection in a single "Open File" dialog.
    2. -
    3. File extension filters to facilitate the user's selection.
    4. -
    5. Progress tracking for file uploads.
    6. -
    7. A range of available file metadata: filename, size, date created, date modified, and author.
    8. -
    9. A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, data return, and upload errors.
    10. -
    11. Inclusion of additional data in the file upload POST request.
    12. -
    13. Faster file upload on broadband connections (due to the modified SEND buffer size).
    14. -
    - -

    Important usage notes:

      - -
    • Because of security requirements of the Flash Player, the Uploader has to receive a direct user input in order to initiate file browsing.
    • -
    • Because of limitations of the Flash Player, the Uploader does not transmit session data in the header of the POST requests it sends to the server. In order to transmit the session data, the developer will need to programmatically extract it from the DOM and send as part of the body of the POST request.
    • -
    • The Uploader SWF should always be served from an HTTP server due to Flash Player's restricted local security model.
    • -
    • The Uploader SWF should not be placed in a container with visibility set to hidden, or display set to none, whether at initialization of the page, or at any subsequent time. Because of how Flash Player is instantiated, setting these properties to these values will result in the loss of communication between the Flash player and the DOM. If it's necessary to hide the instance of the Uploader on the page, its size should be set to 0x0
    • -
    • The Uploader requires Flash Player 9.0.45 or higher, with Flash Player 10.1 preferred. The latest version of Flash Player is available at the Adobe Flash Player Download Center.
    • -
    - -

    - -
    - -

    Getting Started

    - -

    -To include the source files for Uploader and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('uploader', function (Y) {
    -  // Uploader is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    Using the Uploader

    - -

    This section describes how to use the Uploader in further detail. It contains these subsections:

    - - -

    Anatomy of the Uploader

    - -

    Hybrid structure

    - -

    The Uploader uses the native functionality of the widely adopted Adobe Flash player to provide methods for sending - multiple files to the server and tracking the progress of the uploads. In order to control the Flash player, - the Uploader uses the Flash player's built-in ExternalInterface class for communicating with JavaScript. - ExternalInterface allows JavaScript to call exposed methods on an instance of a Flash player, and allows - the instance of the Flash player to call arbitrary global methods in the global JavaScript space. -

    -

    - In order to properly instantiate the Flash player and communicate with it, the Uploader uses YUI SWF utility. The SWF utility - encapsulates the instance of the Flash player and standardizes communication with it (e.g., all Flash player method calls are - wrapped in SWF's callSWF function; correspondingly, all method calls from the Flash player are exposed as SWF's events.) -

    -

    Presence in the DOM

    -

    - Because of security restrictions of the Flash player, browsing for files cannot be initialized via a method call or a simulated - event. Such initialization must come from a hardware device controlled by the user (mouse or keyboard). As a consequence, the instance - of the Flash player tied to a specific instance of the Uploader must be present on the page that uses it and must be clickable. Clicking - this instance of the Flash player always triggers the standard OS "Browse" dialog (unless the Uploader has been specifically disable()ed.)

    -

    The Uploader provides two methods for displaying its instance of the Flash Player: either as a Flash-based "button" with a developer-provided - skin Sprite, or as a fully transparent overlay that can be placed above another UI element to mimic native behavior. When the user interacts with - the Uploader Flash Player instance, all mouse events are bubbled up to JavaScript and are dispatched by the instance of the Uploader.

    - -

    Instantiating and Configuring the Uploader

    - -

    To put the Uploader on the page, simply create a new instance of Y.Uploader and provide it with the reference to the container in which it should be placed:

    - -
    YUI({...}).use('uploader',function (Y) {
    -
    -    // Default everything
    -    var uploader = new Y.Uploader({boundingBox:"#uploaderContainerID"});
    -
    -    // Use a custom button skin:
    -    var uploader = new Y.Uploader({
    -	    boundingBox:'#uploaderContainerID',
    -        buttonSkin : 'assets/buttonSkin.jpg'
    -    });
    -
    -    // Use a custom SWF URL:
    -    var uploader = new Y.Uploader({
    -	    boundingBox:'#uploaderContainerID',
    -        swfURL : 'assets/uploader.swf'
    -    });
    -
    -});
    - -

    The only required configuration attribute for the Uploader is the boundingBox property, which specifies the container where the Uploader will be rendered. By default, the Uploader is assigned the same dimensions as its container, is transparent, and allows the user to select a single file with any extension. Below are the three other configuration attributes available for Slider:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionDefault
    buttonSkinSpecifies an image Sprite to use as the skin for the Uploader.N/A
    swfURLAn alternative path to the Flash SWF file used by the uploaderYUI CDN location
    transparentWhether to render the Uploader SWF as transparent or opaque (useful if keyboard access is needed)true
    -

    Because the Flash player runs in a thread separate from JavaScript, the Uploader methods and properties will not set correctly until the initialization event is fired. Make sure to subscribe to that event and perform subsequent method calls inside its handler:

    - - -
    uploader.on("uploaderReady", setupUploader);
    -
    -var setupUploader = function (event) {
    -	// Uploader method calls / property setting here.
    -}
    - -

    File extension filtering and multiple file selection

    -

    While the browse dialog in the Uploader is standard for the user's specific operating system, there are two parameters that you can modify to control the user's experience. The first parameter is fileFilters, which allows you to specify file extensions that can be selected. The second parameter is a Boolean multiFiles, which specifies whether the user can select many files, or just one. These parameters are set as follows:

    - -
    uploader.set("multiFiles", true);
    -
    -var fileFilters = [{description:"Images", extensions:"*.jpg;*.png;*.gif"},
    -                   {description:"Videos", extensions:"*.avi;*.mov;*.mpg"}]; 
    -
    -    newuploader.set("fileFilters", fileFilters);
    - -

    Note that even though file extensions are filtered, the user can circumvent this filter by entering "*.*" in the text field of the "Browse" dialog. Therefore, it is up to the developer to check that the files that were selected do, in fact, have correct extensions

    - -

    The upload process

    -

    After the user has selected a file (or files) to be uploaded, the selected file list is returned as an array in the fileSelect event. At that point, you can either have the user initialize the actual upload process, or initialize it automatically, without any additional user action.

    -

    Each selected file is uploaded in its own POST request. You can either upload each file individually, and manage the queue using your own code, or use the Uploader's built-in queue management. To upload a single file, the following method call is made:

    - -
    uploader.upload("file0", "upload.php");
    - -

    To upload all files using the built-in queue manager, you can call the uploadAll() method:

    -
    uploader.uploadAll("upload.php");
    - -

    You can also upload a subset of the provided files, using an overloaded call to upload():

    -
    uploader.upload(['file0', 'file1'], "upload.php");
    - -

    To monitor the upload progress, you can subscribe to the uploadprogress event, which reports the number of bytes uploaded, and the number of total bytes that needs to be uploaded:

    - -
    uploader.on(uploadprogress, reportProgress);
    -
    -function reportProgress (event) {
    -	Y.log("Percent of " + event.id + " uploaded: " + Math.round((100 * event.bytesLoaded / event.bytesTotal)) + "%");
    -}
    - -

    Uploader events

    -

    Uploader fires the following events during operation:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventWhenPayload
    uploaderReadyUploader ready to accept method callsNone
    fileselectThe user has selected some files to upload{ fileList : {fileID: {id:String, name:String, size:Number, date:Number}, ...} }
    uploadstartA specific file's upload has started.{id : String}
    uploadprogressTCP socket reports how many bytes of a specific file have been uploaded{id:String, bytesLoaded:Number, bytesTotal:Number}
    uploadcompleteA specific file has been uploaded to the server.{id:String}
    uploadcompletedataThe server has returned data in response to the upload POST request.{id:String, data:String}
    - -

    This is not an exhaustive list. See the API docs for a complete listing.

    - -
    -
    -
    - - -
    - - - - - - - diff --git a/docs/utility.html b/docs/utility.html deleted file mode 100644 index 2f57d917dcb..00000000000 --- a/docs/utility.html +++ /dev/null @@ -1,11 +0,0 @@ -

    Overview

    - -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sapien arcu, ornare vitae luctus eget, tempus id felis. Donec et sapien lectus. Nam leo neque, sodales et tincidunt id, mollis vel tellus. Aliquam nec velit est. Nunc ante lectus, tristique quis feugiat non, suscipit a sem. Cras ligula lectus, accumsan in congue et, porta nec enim. Aenean interdum mollis arcu, ut laoreet ante pharetra tincidunt. Sed at justo dapibus quam feugiat rutrum et ac turpis. Vivamus sit amet nibh eros, at vehicula mi. Aliquam hendrerit cursus lacus ut euismod.

    - -

    Aenean sapien turpis, tristique quis sodales quis, tempor sit amet tellus. Nunc consequat nisi vitae purus lacinia elementum. Curabitur luctus purus id lorem elementum vel auctor urna dignissim. Praesent non lacinia tellus. Fusce tristique dolor sed odio lobortis lobortis. Fusce non elit lorem, et euismod massa. Donec purus ipsum, varius ut sollicitudin laoreet, cursus vitae justo. Proin sollicitudin justo vel arcu fermentum semper ut et sem. Cras ut scelerisque elit. Quisque pellentesque nisl in ipsum lobortis lacinia. Quisque viverra scelerisque elementum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis in massa enim, eget euismod eros. Proin viverra arcu quis sem tincidunt sit amet pulvinar urna ultrices. Integer ac diam sapien, at tincidunt sapien. Ut a justo sit amet risus sollicitudin iaculis. Donec ut felis sit amet urna convallis venenatis non auctor diam. Phasellus posuere pharetra enim sed placerat. Pellentesque libero ipsum, vestibulum id congue semper, sagittis vitae neque. Curabitur mauris tellus, pretium a iaculis eget, elementum ac libero.

    - -

    Aliquam erat volutpat. Donec lectus lectus, vehicula sit amet eleifend eget, cursus malesuada orci. In lectus mauris, volutpat non ultricies a, sollicitudin sit amet mauris. Sed vel orci orci. Mauris vel nisi purus. Donec condimentum rhoncus sem, eu luctus orci malesuada eu. Phasellus cursus sem magna. Etiam tristique orci quis nisi condimentum nec rhoncus purus suscipit. Mauris congue metus urna. Proin in orci non sem tincidunt malesuada. Praesent non leo eget augue tincidunt condimentum ut sed leo. Ut scelerisque nibh et tellus bibendum non gravida nisl luctus. Phasellus bibendum vestibulum tellus, id elementum ante condimentum eget. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent adipiscing, leo et malesuada sagittis, odio ligula suscipit dolor, sed vehicula massa enim nec mauris. Donec in sagittis purus.

    - -

    Donec faucibus ultricies commodo. Donec vehicula lorem rutrum ligula fringilla non rhoncus justo pretium. Cras nec diam arcu. Donec ornare commodo metus ac condimentum. Donec consequat aliquam libero in congue. Suspendisse iaculis pharetra lorem ac feugiat. Phasellus elementum lectus nec nisi pulvinar mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In dui nisl, sagittis quis tincidunt ac, commodo eget erat. Vestibulum nisi nisi, cursus eu egestas nec, hendrerit eget purus. Donec quis lectus nisi. Suspendisse aliquet, sem in volutpat feugiat, felis diam condimentum risus, a rutrum nunc urna in sapien. Pellentesque vitae dolor ut arcu congue egestas. In sagittis eleifend orci, vitae dignissim nunc volutpat ut. Donec condimentum, felis vitae volutpat tempus, nulla diam mattis ante, eget ultricies tellus arcu ut magna.

    - -

    Pellentesque rhoncus, risus sed tincidunt elementum, magna nibh eleifend dui, ut vehicula mi elit at sapien. Fusce suscipit urna nec nulla suscipit fringilla. Praesent enim lacus, fermentum vel gravida nec, scelerisque quis lorem. Nam euismod risus quis lacus eleifend imperdiet. Sed ligula ligula, rutrum nec hendrerit in, semper eu nisi. Phasellus ultricies velit vel libero tempus euismod. Curabitur non quam ipsum. Fusce adipiscing arcu eu diam dignissim rutrum. Ut pulvinar posuere libero. Donec sed tristique mauris. Morbi vitae ipsum ligula. Proin lectus velit, tincidunt eget molestie sed, molestie ac mi. Maecenas libero lorem, consectetur ut dignissim quis, fermentum eu velit.

    diff --git a/docs/widget-modality/index.html b/docs/widget-modality/index.html deleted file mode 100644 index 187e3ff6a6b..00000000000 --- a/docs/widget-modality/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Modal Plugin - - - - - - - -
    -

    Modal Plugin

    - - - Jump to Table of Contents - - -
    -
    -
    -

    The Modal plugin is a widget-level plugin that allows widgets to render modally. The modal widget recieves mouse and tab focus until it is closed.

    -
    - -

    Getting Started

    - -

    -To include the source files for Modal Plugin and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('widget-modality', function (Y) {
    -  // Modal Plugin is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - - -

    Making a modal overlay

    -

    A modal overlay can be created by plugging in the Y.Plugin.Modal plugin to the overlay instance, or passing it in via the config object:

    - -
    YUI().use('overlay', 'widget-modality', function(Y) {
    -    var overlay = new Y.Overlay({
    -        width:400,
    -        bodyContent: 'A Modal Overlay',
    -        visible:true
    -    });
    -
    -    overlay.plug(Y.Plugin.Modal);
    -    overlay.render('#overlayContainer');
    -});
    - - -

    Making widgets modal

    -

    Since Y.Plugin.Modal is a plugin at the widget level, all standard widgets built using YUI3 can be used as a host. Here, we make a modal YUI3 chart:

    - -
    YUI().use('chart', 'widget-modality', function(Y) {
    -    var myDataValues = [ 
    -         {category:"5/1/2010", values:2000}, 
    -         {category:"5/2/2010", values:50}, 
    -         {category:"5/3/2010", values:400}, 
    -         {category:"5/4/2010", values:200}, 
    -         {category:"5/5/2010", values:5000}
    -     ];
    -
    -     var mychart = new Y.Chart({dataProvider:myDataValues, plugins: [Y.Plugin.Modal]});
    -     mychart.render('#container');
    -});
    - - -

    Nested Modality

    -

    The modality plugin supports nested modality. For instance, you can launch a modal overlay, that launches another modal overlay within it. The plugin will adjust focus and move the modal mask around the DOM as required.

    - - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/widget-modality/overlay-modality.html b/docs/widget-modality/overlay-modality.html deleted file mode 100644 index ef2767fa239..00000000000 --- a/docs/widget-modality/overlay-modality.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - Example: Creating a modal overlay - - - - - - - -
    -

    Example: Creating a modal overlay

    - - - Jump to Table of Contents - - -
    -
    -
    -

    This example shows the simple use case where we make a YUI3 overlay modal.

    -
    - -
    - - - - - -
    - YUI3 widgets can be made modal really easily now! Just plug in Y.Plugin.Modal, add "widget-modality" to your use statement and watch your widget receive all the attention that it deserves! - - -
    - - -
    - -

    Setting up

    -

    First we create some HTML that will go inside the overlay.

    - -
    <input type="button" value="Open a modal overlay" id="openOverlayBtn">
    -
    -<div id="overlayContainer">
    -    	YUI3 widgets can be made modal really easily now! Just plug in <code>Y.Plugin.Modal</code>, add "<code>widget-modality</code>" to your use statement and watch your widget receive all the attention that it deserves!
    -
    -    	<input type="button" value="Close" id="closeOverlayBtn">
    -</div>
    - - -

    Next, we style the overlay and the modal mask using some CSS.

    - -
    .yui3-widget-mask {
    -	background: rgba(0,0,0,0.5);
    -}
    -
    -.yui3-overlay {
    -	background:white;
    -	padding:10px;
    -}
    - - -

    Setting up the YUI Instance

    -

    We need to create our YUI instance and tell it to load the widget-modality plugin and the overlay module.

    - -
    YUI().use('widget-modality', 'overlay');
    - - -

    Instantiating a modal overlay

    - -

    Now that we have a YUI instance with the overlay module, we can instantiate the Y.Overlay instance. We plug the modality plugin through the plugins attribute in the config object.

    - -
    YUI().use('widget-modality', 'overlay', function(Y) {
    -	var overlay = new Y.Overlay({
    -		width : 250,
    -		centered : true,
    -		visible : false
    -	});
    -	overlay.plug(Y.Plugin.Modal);
    -	overlay.render('#overlayContainer');
    -
    -	Y.one("#openOverlayBtn").on('click', function(e) {
    -		overlay.show();
    -	});
    -	Y.one("#closeOverlayBtn").on('click', function(e) {
    -		overlay.hide();
    -	});
    -});
    - - -

    On render, the overlay will be modal and tab/mouse focus will be restricted to it.

    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/widget.html b/docs/widget.html deleted file mode 100644 index 2f57d917dcb..00000000000 --- a/docs/widget.html +++ /dev/null @@ -1,11 +0,0 @@ -

    Overview

    - -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sapien arcu, ornare vitae luctus eget, tempus id felis. Donec et sapien lectus. Nam leo neque, sodales et tincidunt id, mollis vel tellus. Aliquam nec velit est. Nunc ante lectus, tristique quis feugiat non, suscipit a sem. Cras ligula lectus, accumsan in congue et, porta nec enim. Aenean interdum mollis arcu, ut laoreet ante pharetra tincidunt. Sed at justo dapibus quam feugiat rutrum et ac turpis. Vivamus sit amet nibh eros, at vehicula mi. Aliquam hendrerit cursus lacus ut euismod.

    - -

    Aenean sapien turpis, tristique quis sodales quis, tempor sit amet tellus. Nunc consequat nisi vitae purus lacinia elementum. Curabitur luctus purus id lorem elementum vel auctor urna dignissim. Praesent non lacinia tellus. Fusce tristique dolor sed odio lobortis lobortis. Fusce non elit lorem, et euismod massa. Donec purus ipsum, varius ut sollicitudin laoreet, cursus vitae justo. Proin sollicitudin justo vel arcu fermentum semper ut et sem. Cras ut scelerisque elit. Quisque pellentesque nisl in ipsum lobortis lacinia. Quisque viverra scelerisque elementum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis in massa enim, eget euismod eros. Proin viverra arcu quis sem tincidunt sit amet pulvinar urna ultrices. Integer ac diam sapien, at tincidunt sapien. Ut a justo sit amet risus sollicitudin iaculis. Donec ut felis sit amet urna convallis venenatis non auctor diam. Phasellus posuere pharetra enim sed placerat. Pellentesque libero ipsum, vestibulum id congue semper, sagittis vitae neque. Curabitur mauris tellus, pretium a iaculis eget, elementum ac libero.

    - -

    Aliquam erat volutpat. Donec lectus lectus, vehicula sit amet eleifend eget, cursus malesuada orci. In lectus mauris, volutpat non ultricies a, sollicitudin sit amet mauris. Sed vel orci orci. Mauris vel nisi purus. Donec condimentum rhoncus sem, eu luctus orci malesuada eu. Phasellus cursus sem magna. Etiam tristique orci quis nisi condimentum nec rhoncus purus suscipit. Mauris congue metus urna. Proin in orci non sem tincidunt malesuada. Praesent non leo eget augue tincidunt condimentum ut sed leo. Ut scelerisque nibh et tellus bibendum non gravida nisl luctus. Phasellus bibendum vestibulum tellus, id elementum ante condimentum eget. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent adipiscing, leo et malesuada sagittis, odio ligula suscipit dolor, sed vehicula massa enim nec mauris. Donec in sagittis purus.

    - -

    Donec faucibus ultricies commodo. Donec vehicula lorem rutrum ligula fringilla non rhoncus justo pretium. Cras nec diam arcu. Donec ornare commodo metus ac condimentum. Donec consequat aliquam libero in congue. Suspendisse iaculis pharetra lorem ac feugiat. Phasellus elementum lectus nec nisi pulvinar mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In dui nisl, sagittis quis tincidunt ac, commodo eget erat. Vestibulum nisi nisi, cursus eu egestas nec, hendrerit eget purus. Donec quis lectus nisi. Suspendisse aliquet, sem in volutpat feugiat, felis diam condimentum risus, a rutrum nunc urna in sapien. Pellentesque vitae dolor ut arcu congue egestas. In sagittis eleifend orci, vitae dignissim nunc volutpat ut. Donec condimentum, felis vitae volutpat tempus, nulla diam mattis ante, eget ultricies tellus arcu ut magna.

    - -

    Pellentesque rhoncus, risus sed tincidunt elementum, magna nibh eleifend dui, ut vehicula mi elit at sapien. Fusce suscipit urna nec nulla suscipit fringilla. Praesent enim lacus, fermentum vel gravida nec, scelerisque quis lorem. Nam euismod risus quis lacus eleifend imperdiet. Sed ligula ligula, rutrum nec hendrerit in, semper eu nisi. Phasellus ultricies velit vel libero tempus euismod. Curabitur non quam ipsum. Fusce adipiscing arcu eu diam dignissim rutrum. Ut pulvinar posuere libero. Donec sed tristique mauris. Morbi vitae ipsum ligula. Proin lectus velit, tincidunt eget molestie sed, molestie ac mi. Maecenas libero lorem, consectetur ut dignissim quis, fermentum eu velit.

    diff --git a/docs/yql/index.html b/docs/yql/index.html deleted file mode 100644 index 8f90af2d234..00000000000 --- a/docs/yql/index.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - YQL Query - - - - - - - -
    -

    YQL Query

    - - - Jump to Table of Contents - - -
    -
    -
    - - -

    The Yahoo! Query Language (YQL) is an expressive SQL-like -language that lets you query, filter, and join data across -Web services. With YQL, apps run faster with fewer lines -of code and a smaller network footprint.

    - -

    Yahoo! and other websites across the Internet make much -of their structured data available to developers, primarily -through Web services. To access and query these services, -developers traditionally endure the pain of locating the -right URLs and documentation to access and query each Web -service.

    - -

    With YQL, developers can access and shape data across -the Internet through one simple language, eliminating the -need to learn how to call different APIs.

    -
    - -

    Getting Started

    - -

    -To include the source files for YQL Query and its dependencies, first load -the YUI seed file if you haven't already loaded it. -

    - -
    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    - - -

    -Next, create a new YUI instance for your application and populate it with the -modules you need by specifying them as arguments to the YUI().use() method. -YUI will automatically load any dependencies required by the modules you -specify. -

    - -
    // Create a new YUI instance and populate it with the required modules.
    -YUI().use('yql', function (Y) {
    -  // YQL Query is available and ready for use. Add implementation
    -  // code here.
    -});
    - - -

    -For more information on creating YUI instances and on the -use() -method, see the documentation for the -YUI Global object. -

    - - -

    Making a Query

    -

    After you find the query you want to run in the Developer Console, just plug it in:

    -

    The YQL Developer Console is a nice place to start playing with YQL queries. You can test and inspect queries before you actually use them.

    - -
    YUI().use('yql', function(Y) {
    -
    -    Y.YQL('select * from weather.forecast where location=90210', function(r) {
    -        //r now contains the result of the YQL Query
    -		//use the YQL Developer console to learn
    -		//what data is coming back in this object
    -		//and how that data is structured.
    -    });
    -
    -});
    - - - -

    Re-Using A Query

    -

    Modifying the example above to make it reusable is simple, just save the result of the query and call send on it to query for the results again.

    - -
    YUI().use('yql', function(Y) {
    -
    -    var q = Y.YQL('select * from weather.forecast where location=90210', function(r) {
    -        //r now contains the result of the YQL Query
    -    });
    -
    -    //Sometime later
    -
    -    q.send();
    -
    -});
    - - - -

    Changing A Re-Used Query

    -

    Changing a query without creating a new instance can be beneficial for queries that involve the same request but different parameters (like an AutoComplete query).

    -

    To do this, we need to modify the private param q on the YQL instance.

    - -
    YUI().use('yql', function(Y) {
    -
    -    var q = Y.YQL('select * from weather.forecast where location=90210', function(r) {
    -        //r now contains the result of the YQL Query
    -    });
    -
    -    //Sometime later
    -    q._params.q = 'select * from weather.forecast where location=62959';
    -    q.send();
    -
    -});
    - - -

    Open Data Tables

    -

    Open Data Tables enable developers to add tables for any data on the Web to YQL's stable of API-specific tables. Using Open Data Tables, anyone can make their data YQL-accessible. If you would like to create an Open Data Table, visit the community page at http://datatables.org.

    -

    By default, the YQL module will include the environment file needed to use all of the publicly available Open Data Tables.

    - -

    Advanced Options

    -

    The default configuration for the YQL module is designed for the most basic use cases. However, the YQLRequest class is designed to give the developer more control over the query, parameters and options used to make the YQL Request.

    - -
    YUI().use('yql', function(Y) {
    -
    -    var q = new Y.YQLRequest('select * from weather.forecast where location=90210', function(r) {
    -        //r now contains the result of the YQL Query
    -    }, {
    -        //Optional URL Parameters to add to the request
    -        foo: 'bar',
    -        another: 'option'
    -    }, {
    -        //Options
    -        base: '://query.yahooapis.com/v1/yql?', //Different base URL for private data
    -        proto: 'https' //Connect using SSL
    -    });
    -    q.send();
    -
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/yql/simple-yql.html b/docs/yql/simple-yql.html deleted file mode 100644 index e5a4aed5e95..00000000000 --- a/docs/yql/simple-yql.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - Example: Simple YQL Query - - - - - - - -
    -

    Example: Simple YQL Query

    - - - Jump to Table of Contents - - -
    -
    -
    -

    In this example, we make a simple YQL Query to retrieve data from the Yahoo! Weather YQL table.

    -
    - -
    - - - -
    Querying YQL..
    - - - - - -
    - -

    The easiest way to build a YQL query is by visiting the YQL Console. In this example we will be using the weather.forecast table. The YQL statement that we are using looks like this:

    - -
    select * from weather.forecast where location=90210
    - - -

    You can preview this query in the YQL Console to get a sense of the data it returns.

    - -

    Setting Up the YUI Instance

    - -

    Now we need to create our YUI instance and tell it to load the yql and node modules.

    - -
    YUI().use('node', 'yql');
    - - -

    Making the Query

    - -

    We now have a YUI instance with the yql module (and its dependencies) attached, so we can proceed to make a query.

    - -
    YUI().use('node', 'yql', function(Y) {
    -    
    -    var res = Y.one('#res'),
    -        zip = '90210';
    -    
    -    Y.YQL('select * from weather.forecast where location=' + zip, function(r) {
    -        var el = Y.Node.create('<div class="mod"></div>');
    -
    -        el.set('innerHTML', '<h2>Weather for ' + zip + '</h2>' + r.query.results.channel.item.description);
    -
    -        res.setContent(el);
    -    
    -    });
    -});
    - -
    -
    - - -
    -
    - - - - - - diff --git a/docs/yql/yql-requery.html b/docs/yql/yql-requery.html deleted file mode 100644 index cf56c29c947..00000000000 --- a/docs/yql/yql-requery.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - Example: Reusing a YQL query - - - - - - - -
    -

    Example: Reusing a YQL query

    - - - Jump to Table of Contents - - -
    -
    -
    -

    In this example, the Flickr Recent Photos YQL table is used to pull in a small set of recent Flickr images every 8 seconds.

    -
    - -
    - - -
    - - - - -
    -

    Setting Up the Query

    -

    The easiest way to build a YQL query is by visiting the YQL Console. In this example we will be using the flickr.photos.recent table. The YQL statement that we are using looks like this:

    - -
    select * from flickr.photos.recent
    - - -

    Setting Up the YUI Instance

    -

    Now we need to create our YUI instance and tell it to load the yql and node modules.

    - -
    YUI().use('node', 'yql');
    - - -

    Making the Query

    -

    Now that we have a YUI instance with the yql module, we can now make a query.

    - -
    YUI().use('node', 'yql', function(Y) {
    -    
    -    var res = Y.one('#res'), count = 0,
    -        url = '<a href="http://flickr.com/photos/{owner}/{id}"><img src="http://static.flickr.com/{server}/{id}_{secret}_t.jpg"></a>';
    -    
    -    var q = Y.YQL('select * from flickr.photos.recent', {
    -        //Tell JSONP to not cache this request so we get new images on each request
    -        allowCache: false,
    -        on: {
    -            success: function(r) {
    -                count++;
    -                res.setContent('<h2>Recent Flickr Photos <em>(query #' + count + ')</em></h2>');
    -                Y.each(r.query.results.photo, function(v) {
    -                    res.append(Y.Lang.sub(url, v));
    -                });
    -            }
    -        }
    -    });
    -    Y.later(8000, q, q.send, null, true);
    -});
    - -
    -
    - - -
    -
    - - - - - - From 103118af8787d63f003cbb7d1a9b896a5c57515e Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 11:13:10 -0700 Subject: [PATCH 66/78] More Get test updates. Tested tests/get.html and tests/get.html?delay=true on FF4, Chrome 12, Safari 4, IE8, IE7 with the get.js I'm about to checkin next --- src/yui/tests/get-tests.js | 124 +++++++++++++++++++------------- src/yui/tests/getfiles/delay.js | 2 +- 2 files changed, 75 insertions(+), 51 deletions(-) diff --git a/src/yui/tests/get-tests.js b/src/yui/tests/get-tests.js index 0c98e473474..eb97ac71e69 100644 --- a/src/yui/tests/get-tests.js +++ b/src/yui/tests/get-tests.js @@ -3,7 +3,7 @@ YUI.add('get-tests', function(Y) { Y.GetTests = new Y.Test.Suite("Get Suite"); Y.GetTests.TEST_FILES_BASE = "getfiles/"; - FILENAME = /[abc]\.js/; + var FILENAME = /[abc]\.js/; // TODO: Should get.js stick this somewhere public? Y.GetTests.ONLOAD_SUPPORTED = { @@ -39,19 +39,24 @@ YUI.add('get-tests', function(Y) { setUp: function() { G_SCRIPTS = []; + }, + createInsertBeforeNode: function() { this.ib = Y.Node.create('
    '); Y.Node.one("body").appendChild(this.ib); }, + removeInsertBeforeNode: function() { + if (this.ib) { + this.ib.remove(true); + } + }, + tearDown: function() { if (this.o) { this.o.purge(); } - - if (this.ib) { - this.ib.remove(true); - } + this.removeInsertBeforeNode(); }, 'test: single script, success': function() { @@ -67,7 +72,7 @@ YUI.add('get-tests', function(Y) { data: {a:1, b:2, c:3}, context: {bar:"foo"}, - + onProgress: function(o) { var file = o.url.match(FILENAME); progress.push(file[0]); @@ -693,11 +698,12 @@ YUI.add('get-tests', function(Y) { this.wait(); }, - 'test: insertBefore, single' : function() { var test = this; + test.createInsertBeforeNode(); + var trans = Y.Get.script(path("a.js"), { insertBefore: "insertBeforeMe", @@ -729,6 +735,8 @@ YUI.add('get-tests', function(Y) { var test = this; + test.createInsertBeforeNode(); + var trans = Y.Get.script(path(["a.js", "b.js"]), { insertBefore: "insertBeforeMe", @@ -763,6 +771,8 @@ YUI.add('get-tests', function(Y) { var test = this; + test.createInsertBeforeNode(); + var trans = Y.Get.script(path(["a.js", "b.js"]), { insertBefore: "insertBeforeMe", @@ -1073,7 +1083,7 @@ YUI.add('get-tests', function(Y) { var node = Y.Node.one(nodes[i]); Y.Assert.isTrue(node.inDoc(), "Scripts should still be in the document"); - // Convert to id, for final doc check + // Convert to id, for final doc check, because purge destroys parentNode nodeIds[i] = node.get("id"); } @@ -1122,20 +1132,26 @@ YUI.add('get-tests', function(Y) { b.append(this.nc); this.onload = Y.GetTests.ONLOAD_SUPPORTED['css']; - - this.ib = Y.Node.create(''); + }, + + createInsertBeforeNode: function() { + this.ib = Y.Node.create(''); Y.Node.one("head").appendChild(this.ib); }, + removeInsertBeforeNode: function() { + if (this.ib) { + this.ib.remove(true); + } + }, + tearDown: function() { this.na.remove(true); this.nb.remove(true); this.nc.remove(true); - this.o && this.o.purge(); - if (this.ib) { - this.ib.remove(true); - } + this.o && this.o.purge(); + this.removeInsertBeforeNode(); }, 'test: single css, success': function() { @@ -1149,7 +1165,7 @@ YUI.add('get-tests', function(Y) { // In IE/Opera we don't need to artifical timeout, since we're notified // onload. For the others, onSuccess is called synchronously. - var trans = Y.Get.css(path("a.css?delay=100"), { + var trans = Y.Get.css(path("a.css?delay=50"), { data: {a:1, b:2, c:3}, context: {bar:"foo"}, @@ -1178,7 +1194,7 @@ YUI.add('get-tests', function(Y) { test.o = o; }); - }, test.onload ? 0 : 400); // need arbit delay to make sure CSS is applied + }, test.onload ? 0 : 200); // need arbit delay to make sure CSS is applied if (!test.onload) { test.wait(); @@ -1204,7 +1220,7 @@ YUI.add('get-tests', function(Y) { failure:0 }; - var trans = Y.Get.css(path(["a.css?delay=100", "b.css?delay=200", "c.css?delay=50"]), { + var trans = Y.Get.css(path(["a.css?delay=50", "b.css?delay=100", "c.css?delay=75"]), { data: {a:1, b:2, c:3}, context: {bar:"foo"}, @@ -1238,14 +1254,14 @@ YUI.add('get-tests', function(Y) { test.o = o; }); - }, test.onload ? 0 : 800); + }, test.onload ? 0 : 400); if (!test.onload) { test.wait(); } } }); - + if (test.onload) { test.wait(); } @@ -1259,7 +1275,7 @@ YUI.add('get-tests', function(Y) { failure:0 }; - var trans = Y.Get.css(path(["a.css?delay=200", "b.css?delay=100", "c.css?delay=50"]), { + var trans = Y.Get.css(path(["a.css?delay=100", "b.css?delay=75", "c.css?delay=50"]), { data: {a:1, b:2, c:3}, context: {bar:"foo"}, @@ -1291,7 +1307,7 @@ YUI.add('get-tests', function(Y) { test.o = o; }); - }, test.onload ? 0 : 800); + }, test.onload ? 0 : 400); if (!test.onload) { test.wait(); @@ -1309,8 +1325,10 @@ YUI.add('get-tests', function(Y) { var test = this; - var trans = Y.Get.css(path("a.css?delay=10"), { - + test.createInsertBeforeNode(); + + var trans = Y.Get.css(path("a.css?delay=30"), { + insertBefore: "insertBeforeMe", onSuccess: function(o) { @@ -1324,19 +1342,20 @@ YUI.add('get-tests', function(Y) { Y.Assert.isTrue(n.compareTo(insertBefore.previous()), "Not inserted before insertBeforeMe"); - /* TODO: These don't work as expected on IE. Commenting for now */ - /* - Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); - */ + /* TODO: These don't work as expected on IE (even though insertBefore worked). Better cross-browser assertion? */ + if (!Y.UA.ie) { + Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); + } test.o = o; + }); - }, test.onload ? 0 : 200); + }, test.onload ? 0 : 100); if (!test.onload) { test.wait(); } - } + } }); if (test.onload) { @@ -1348,7 +1367,9 @@ YUI.add('get-tests', function(Y) { var test = this; - var trans = Y.Get.css(path(["a.css?delay=10", "b.css?delay=50", "c.css?delay=20"]), { + test.createInsertBeforeNode(); + + var trans = Y.Get.css(path(["a.css?delay=20", "b.css?delay=75", "c.css?delay=10"]), { insertBefore: "insertBeforeMe", @@ -1363,16 +1384,16 @@ YUI.add('get-tests', function(Y) { insertBefore = n; } - /* TODO: These don't work as expected on IE. Commenting for now */ - /* - Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); - Y.Assert.areEqual("9992", this.nb.getComputedStyle("zIndex"), "b.css does not seem to be inserted before ib.css"); - Y.Assert.areEqual("9993", this.nc.getComputedStyle("zIndex"), "c.css does not seem to be inserted before ib.css"); - */ + /* TODO: These don't work as expected on IE (even though insertBefore worked). Better cross-browser assertion? */ + if (!Y.UA.ie) { + Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); + Y.Assert.areEqual("9992", this.nb.getComputedStyle("zIndex"), "b.css does not seem to be inserted before ib.css"); + Y.Assert.areEqual("9993", this.nc.getComputedStyle("zIndex"), "c.css does not seem to be inserted before ib.css"); + } test.o = o; }); - }, test.onload ? 0 : 400); + }, test.onload ? 0 : 200); if (!test.onload) { test.wait(); @@ -1389,7 +1410,9 @@ YUI.add('get-tests', function(Y) { var test = this; - var trans = Y.Get.css(path(["a.css?delay=10", "b.css?delay=50", "c.css?delay=20"]), { + test.createInsertBeforeNode(); + + var trans = Y.Get.css(path(["a.css?delay=30", "b.css?delay=10", "c.css?delay=50"]), { insertBefore: "insertBeforeMe", @@ -1405,17 +1428,18 @@ YUI.add('get-tests', function(Y) { insertBefore = n; } - /* TODO: These don't work as expected on IE. Commenting for now */ - /* - Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); - Y.Assert.areEqual("9992", this.nb.getComputedStyle("zIndex"), "b.css does not seem to be inserted before ib.css"); - Y.Assert.areEqual("9993", this.nc.getComputedStyle("zIndex"), "c.css does not seem to be inserted before ib.css"); - */ + /* TODO: These don't work as expected on IE (even though insertBefore worked). Better cross-browser assertion? */ + if (!Y.UA.ie) { + Y.Assert.areEqual("9991", this.na.getComputedStyle("zIndex"), "a.css does not seem to be inserted before ib.css"); + Y.Assert.areEqual("9992", this.nb.getComputedStyle("zIndex"), "b.css does not seem to be inserted before ib.css"); + Y.Assert.areEqual("9993", this.nc.getComputedStyle("zIndex"), "c.css does not seem to be inserted before ib.css"); + } test.o = o; + }); - }, test.onload ? 0 : 400); + }, test.onload ? 0 : 200); if (!test.onload) { test.wait(); @@ -1434,7 +1458,7 @@ YUI.add('get-tests', function(Y) { var test = this; - var trans = Y.Get.css(path("a.css?delay=10"), { + var trans = Y.Get.css(path("a.css?delay=20"), { charset: "ISO-8859-1", @@ -1450,7 +1474,7 @@ YUI.add('get-tests', function(Y) { test.o = o; }); - }, test.onload ? 0 : 200); + }, test.onload ? 0 : 100); if (!test.onload) { test.wait(); @@ -1505,7 +1529,7 @@ YUI.add('get-tests', function(Y) { var test = this; - var trans = Y.Get.css(path(["a.css?delay=10", "b.css?delay=50", "c.css?delay=20"]), { + var trans = Y.Get.css(path(["a.css?delay=30", "b.css?delay=10", "c.css?delay=20"]), { charset: "ISO-8859-1", @@ -1548,7 +1572,7 @@ YUI.add('get-tests', function(Y) { var trans = Y.Get.css(path("a.css?delay=10"), { attributes: { - "charset": "ISO-8859-1", + "charset": "ISO-8859-1", "title": "myscripts" }, @@ -1567,7 +1591,7 @@ YUI.add('get-tests', function(Y) { test.o = o; }); - }, test.onload ? 0 : 200); + }, test.onload ? 0 : 100); if (!test.onload) { test.wait(); diff --git a/src/yui/tests/getfiles/delay.js b/src/yui/tests/getfiles/delay.js index d02cef5666c..2ab226b7ff9 100644 --- a/src/yui/tests/getfiles/delay.js +++ b/src/yui/tests/getfiles/delay.js @@ -57,7 +57,7 @@ http.createServer(function (req, res) { res.writeHead(404); res.end(""); } else { - var delay = parts.query.delay || rand(100, 3000); + var delay = parts.query.delay || rand(100, 2000); console.log("delay:" + delay); From 7d66978f904841c6c781da0cac1db932674fb51d Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 11:17:54 -0700 Subject: [PATCH 67/78] Async Get support, with onProgress callback --- src/yui/README.md | 8 +- src/yui/js/get.js | 1134 ++++++++++++++++++++++++--------------------- 2 files changed, 625 insertions(+), 517 deletions(-) diff --git a/src/yui/README.md b/src/yui/README.md index 20ea1985008..44aa56508c0 100644 --- a/src/yui/README.md +++ b/src/yui/README.md @@ -41,7 +41,13 @@ Change History * Sparse arrays are now handled correctly in the non-native fallback implementations of `Y.Array.each`, `Y.Array.hash`, and `Y.Array.some`. [Ticket #2530376] - +* Added async:true support to Get, to dispatch scripts/link nodes in parallel. + NOTE: Order of execution is not guaranteed (it's not required for the YUI + Module use case, for which this feature was introduced - to improve performance). + onSuccess is called once, after all files are loaded. +* Added onProgress callback support to Get, which is useful when dispatching + multiple scripts using the [] syntax. onProgress is called when each script + is done loading. ### 3.3.0 diff --git a/src/yui/js/get.js b/src/yui/js/get.js index 5af6c5e50f8..9dc3338a7b7 100644 --- a/src/yui/js/get.js +++ b/src/yui/js/get.js @@ -1,4 +1,3 @@ - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -6,26 +5,41 @@ * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -45,22 +59,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -81,16 +114,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -104,18 +133,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -129,16 +151,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -150,14 +173,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -168,49 +194,144 @@ Y.Get = function() { _fail = function(id, msg) { Y.log('get failure: ' + msg, 'warn', 'get'); - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - // Y.log("Finishing transaction " + id, "info", "get"); - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + Y.log("Finishing transaction " + id, "info", "get"); + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, + + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); + } + + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } + + parent.removeChild(node); + } } - _end(id, msg, 'OK'); + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -221,120 +342,185 @@ Y.Get = function() { */ _timeout = function(id) { Y.log('Timeout ' + id, 'info', 'get'); - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { -// Y.log("_next: " + id + ", loaded: " + (loaded || "nothing"), "info", "get"); - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; - - if (q.timer) { - // Y.log('cancel timer'); - // q.timer.cancel(); - clearTimeout(q.timer); - } + _loaded = function(id, url) { - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + var q = queues[id], + sync = !q.async; + + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - if (q.url.length === 0) { - _finish(id); - return; - } + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - url = q.url[0]; + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - Y.log('skipping empty url'); - return _next(id); - } + if (ua.ie) { - Y.log('attempting to load ' + url, 'info', 'get'); + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + // Y.log(id + " onreadstatechange " + url, "info", "get"); + n.onreadystatechange = null; + _loaded(id, url); + } + }; - if (q.timeout) { - // Y.log('create timer'); - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + } else if (ua.webkit) { + + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + n.onload = function() { + // Y.log(id + " onload " + url, "info", "get"); + _loaded(id, url); + }; - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, + + _insertInDoc = function(node, id, win) { + + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { + sibling = _getNodeRef(insertBefore, id); + if (sibling) { Y.log('inserting before: ' + insertBefore, 'info', 'get'); - s.parentNode.insertBefore(n, s); + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); - // Y.log("Appending node: " + url, "info", "get"); + Y.log('attempting to load ' + url, 'info', 'get'); - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } + + // add the node to the queue so we can return it in the callback + q.nodes.push(node); + + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -375,31 +561,47 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + Y.log('skipping empty url'); + } + + q.remaining = q.url.length; _next(id); @@ -408,361 +610,261 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - // Y.log(id + " onreadstatechange " + url, "info", "get"); - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - // Y.log(id + " DOM2 onload " + url, "info", "get"); - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - // Y.log(id + " onload " + url, "info", "get"); - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + Y.log('Aborting ' + id, 'info', 'get'); + q.aborted = true; } - q.nodes = []; - }; + }, - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - Y.log(id + ' finalized ', 'info', 'get'); - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - Y.log('Aborting ' + id, 'info', 'get'); - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *       Y.log(o.data); // foo
    -         *       Y.log(o.nodes.length === 2) // true
    -         *       // o.purge(); // optionally remove the script nodes
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *       Y.log("transaction failed");
    -         *     },
    -         *     onTimeout: function(o) {
    -         *       Y.log("transaction timed out");
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, - - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *    "http://localhost/css/logger.css"], {
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *       Y.log(o.data); // foo
    +     *       Y.log(o.nodes.length === 2) // true
    +     *       // o.purge(); // optionally remove the script nodes
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *       Y.log("transaction failed");
    +     *     },
    +     *     onTimeout: function(o) {
    +     *       Y.log("transaction timed out");
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *    "http://localhost/css/logger.css"], {
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; From 078c2ceeccd78c5eca41cf3e06efd5226045da16 Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 11:19:37 -0700 Subject: [PATCH 68/78] Get build (only - no yui yet) --- build/yui/get-debug.js | 1134 ++++++++++++++++++++++------------------ build/yui/get-min.js | 2 +- build/yui/get.js | 1102 ++++++++++++++++++++------------------ 3 files changed, 1224 insertions(+), 1014 deletions(-) diff --git a/build/yui/get-debug.js b/build/yui/get-debug.js index c14fad6955d..9c93f50a1bd 100644 --- a/build/yui/get-debug.js +++ b/build/yui/get-debug.js @@ -1,6 +1,5 @@ YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -8,26 +7,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -47,22 +61,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -83,16 +116,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -106,18 +135,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -131,16 +153,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -152,14 +175,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -170,49 +196,144 @@ Y.Get = function() { _fail = function(id, msg) { Y.log('get failure: ' + msg, 'warn', 'get'); - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - // Y.log("Finishing transaction " + id, "info", "get"); - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + Y.log("Finishing transaction " + id, "info", "get"); + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, + + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); + } + + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } + + parent.removeChild(node); + } } - _end(id, msg, 'OK'); + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -223,120 +344,185 @@ Y.Get = function() { */ _timeout = function(id) { Y.log('Timeout ' + id, 'info', 'get'); - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { -// Y.log("_next: " + id + ", loaded: " + (loaded || "nothing"), "info", "get"); - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; - - if (q.timer) { - // Y.log('cancel timer'); - // q.timer.cancel(); - clearTimeout(q.timer); - } + _loaded = function(id, url) { - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + var q = queues[id], + sync = !q.async; + + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - if (q.url.length === 0) { - _finish(id); - return; - } + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - url = q.url[0]; + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - Y.log('skipping empty url'); - return _next(id); - } + if (ua.ie) { - Y.log('attempting to load ' + url, 'info', 'get'); + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + // Y.log(id + " onreadstatechange " + url, "info", "get"); + n.onreadystatechange = null; + _loaded(id, url); + } + }; - if (q.timeout) { - // Y.log('create timer'); - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + } else if (ua.webkit) { + + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + n.onload = function() { + // Y.log(id + " onload " + url, "info", "get"); + _loaded(id, url); + }; - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, + + _insertInDoc = function(node, id, win) { + + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { + sibling = _getNodeRef(insertBefore, id); + if (sibling) { Y.log('inserting before: ' + insertBefore, 'info', 'get'); - s.parentNode.insertBefore(n, s); + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); - // Y.log("Appending node: " + url, "info", "get"); + Y.log('attempting to load ' + url, 'info', 'get'); - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } + + // add the node to the queue so we can return it in the callback + q.nodes.push(node); + + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -377,31 +563,47 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + Y.log('skipping empty url'); + } + + q.remaining = q.url.length; _next(id); @@ -410,364 +612,264 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - // Y.log(id + " onreadstatechange " + url, "info", "get"); - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - // Y.log(id + " DOM2 onload " + url, "info", "get"); - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - // Y.log(id + " onload " + url, "info", "get"); - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + Y.log('Aborting ' + id, 'info', 'get'); + q.aborted = true; } - q.nodes = []; - }; + }, - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - Y.log(id + ' finalized ', 'info', 'get'); - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - Y.log('Aborting ' + id, 'info', 'get'); - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *       Y.log(o.data); // foo
    -         *       Y.log(o.nodes.length === 2) // true
    -         *       // o.purge(); // optionally remove the script nodes
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *       Y.log("transaction failed");
    -         *     },
    -         *     onTimeout: function(o) {
    -         *       Y.log("transaction timed out");
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, - - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *    "http://localhost/css/logger.css"], {
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *       Y.log(o.data); // foo
    +     *       Y.log(o.nodes.length === 2) // true
    +     *       // o.purge(); // optionally remove the script nodes
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *       Y.log("transaction failed");
    +     *     },
    +     *     onTimeout: function(o) {
    +     *       Y.log("transaction timed out");
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *    "http://localhost/css/logger.css"], {
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); diff --git a/build/yui/get-min.js b/build/yui/get-min.js index 2374f8f10c7..cea319ba41f 100644 --- a/build/yui/get-min.js +++ b/build/yui/get-min.js @@ -1 +1 @@ -YUI.add("get",function(f){var b=f.UA,a=f.Lang,d="text/javascript",e="text/css",c="stylesheet";f.Get=function(){var m,n,j,l={},k=0,u,w=function(A,x,B){var y=B||f.config.win,C=y.document,D=C.createElement(A),z;for(z in x){if(x[z]&&x.hasOwnProperty(z)){D.setAttribute(z,x[z]);}}return D;},t=function(y,z,x){var A={id:f.guid(),type:e,rel:c,href:y};if(x){f.mix(A,x);}return w("link",A,z);},s=function(y,z,x){var A={id:f.guid(),type:d};if(x){f.mix(A,x);}A.src=y;return w("script",A,z);},p=function(y,z,x){return{tId:y.tId,win:y.win,data:y.data,nodes:y.nodes,msg:z,statusText:x,purge:function(){n(this.tId);}};},o=function(B,A,x){var y=l[B],z;if(y&&y.onEnd){z=y.context||y;y.onEnd.call(z,p(y,A,x));}},v=function(A,z){var x=l[A],y;if(x.timer){clearTimeout(x.timer);}if(x.onFailure){y=x.context||x;x.onFailure.call(y,p(x,z));}o(A,z,"failure");},i=function(A){var x=l[A],z,y;if(x.timer){clearTimeout(x.timer);}x.finished=true;if(x.aborted){z="transaction "+A+" was aborted";v(A,z);return;}if(x.onSuccess){y=x.context||x;x.onSuccess.call(y,p(x));}o(A,z,"OK");},q=function(z){var x=l[z],y;if(x.onTimeout){y=x.context||x;x.onTimeout.call(y,p(x));}o(z,"timeout","timeout");},h=function(z,C){var y=l[z],B,G,F,D,A,x,H,E;if(y.timer){clearTimeout(y.timer);}if(y.aborted){B="transaction "+z+" was aborted";v(z,B);return;}if(C){y.url.shift();if(y.varName){y.varName.shift();}}else{y.url=(a.isString(y.url))?[y.url]:y.url;if(y.varName){y.varName=(a.isString(y.varName))?[y.varName]:y.varName;}}G=y.win;F=G.document;D=F.getElementsByTagName("head")[0];if(y.url.length===0){i(z);return;}x=y.url[0];if(!x){y.url.shift();return h(z);}if(y.timeout){y.timer=setTimeout(function(){q(z);},y.timeout);}if(y.type==="script"){A=s(x,G,y.attributes);}else{A=t(x,G,y.attributes);}j(y.type,A,z,x,G,y.url.length);y.nodes.push(A);E=y.insertBefore||F.getElementsByTagName("base")[0];if(E){H=m(E,z);if(H){H.parentNode.insertBefore(A,H);}}else{D.appendChild(A);}if((b.webkit||b.gecko)&&y.type==="css"){h(z,x);}},g=function(){if(u){return;}u=true;var x,y;for(x in l){if(l.hasOwnProperty(x)){y=l[x];if(y.autopurge&&y.finished){n(y.tId);delete l[x];}}}u=false;},r=function(y,x,z){z=z||{};var C="q"+(k++),A,B=z.purgethreshold||f.Get.PURGE_THRESH;if(k%B===0){g();}l[C]=f.merge(z,{tId:C,type:y,url:x,finished:false,nodes:[]});A=l[C];A.win=A.win||f.config.win;A.context=A.context||A;A.autopurge=("autopurge" in A)?A.autopurge:(y==="script")?true:false;A.attributes=A.attributes||{};A.attributes.charset=z.charset||A.attributes.charset||"utf-8";h(C);return{tId:C};};j=function(z,E,D,y,C,B,x){var A=x||h;if(b.ie){E.onreadystatechange=function(){var F=this.readyState;if("loaded"===F||"complete"===F){E.onreadystatechange=null;A(D,y);}};}else{if(b.webkit){if(z==="script"){E.addEventListener("load",function(){A(D,y);},false);}}else{E.onload=function(){A(D,y);};E.onerror=function(F){v(D,F+": "+y);};}}};m=function(x,A){var y=l[A],z=(a.isString(x))?y.win.document.getElementById(x):x;if(!z){v(A,"target node not found: "+x);}return z;};n=function(C){var y,A,G,D,H,B,z,F,E,x=l[C];if(x){y=x.nodes;A=y.length;G=x.win.document;D=G.getElementsByTagName("head")[0];E=x.insertBefore||G.getElementsByTagName("base")[0];if(E){H=m(E,C);if(H){D=H.parentNode;}}for(B=0;B0){J=O.url.shift();if(N&&!O.timer){O.timer=setTimeout(function(){D(Q);},N);}if(L===s){M=E(J,P,K);}else{M=k(J,P,K);}O.nodes.push(M);c(L,M,Q,J);G(M,Q,P);if(!l[L]){f(Q,J);}if(O.async){i(Q);}}},n=function(){if(g){return;}g=true;var J,K;for(J in z){if(z.hasOwnProperty(J)){K=z[J];if(K.autopurge&&K.finished){d(K.tId);delete z[J];}}}g=false;},j=function(K,J,L){L=L||{};var O="q"+(r++),N=L.purgethreshold||e.Get.PURGE_THRESH,M;if(r%N===0){n();}M=z[O]=e.merge(L);M.tId=O;M.type=K;M.url=J;M.finished=false;M.nodes=[];M.win=M.win||e.config.win;M.context=M.context||M;M.autopurge=(q in M)?M.autopurge:(K===s)?true:false;M.attributes=M.attributes||{};M.attributes.charset=L.charset||M.attributes.charset||A;if(C in M&&K===s){M.attributes.async=M.async;}M.url=(p.isString(M.url))?[M.url]:M.url;if(!M.url[0]){M.url.shift();}M.remaining=M.url.length;i(O);return{tId:O};};e.Get={PURGE_THRESH:20,abort:function(K){var L=(p.isString(K))?K:K.tId,J=z[L];if(J){J.aborted=true;}},script:function(J,K){return j(s,J,K);},css:function(J,K){return j("css",J,K);}};},"@VERSION@",{requires:["yui-base"]}); \ No newline at end of file diff --git a/build/yui/get.js b/build/yui/get.js index 0bce5470756..33eca5cb117 100644 --- a/build/yui/get.js +++ b/build/yui/get.js @@ -1,6 +1,5 @@ YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -8,26 +7,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -47,22 +61,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -83,16 +116,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -106,18 +135,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -131,16 +153,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -152,14 +175,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -169,48 +195,143 @@ Y.Get = function() { */ _fail = function(id, msg) { - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, + + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); + } + + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; + + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + parent.removeChild(node); + } } - _end(id, msg, 'OK'); + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -220,113 +341,181 @@ Y.Get = function() { * @private */ _timeout = function(id) { - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; + _loaded = function(id, url) { - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + sync = !q.async; - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - if (q.url.length === 0) { - _finish(id); - return; - } + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - url = q.url[0]; + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - return _next(id); - } + if (ua.ie) { + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + n.onreadystatechange = null; + _loaded(id, url); + } + }; - if (q.timeout) { - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + } else if (ua.webkit) { + + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. + + n.onload = function() { + _loaded(id, url); + }; + + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + _insertInDoc = function(node, id, win) { - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { - s.parentNode.insertBefore(n, s); + sibling = _getNodeRef(insertBefore, id); + if (sibling) { + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + url = q.url.shift(); - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } + + // add the node to the queue so we can return it in the callback + q.nodes.push(node); + + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -367,31 +556,46 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + } + + q.remaining = q.url.length; _next(id); @@ -400,353 +604,257 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + q.aborted = true; } - q.nodes = []; - }; + }, - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *     },
    -         *     onTimeout: function(o) {
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, - - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *     },
    +     *     onTimeout: function(o) {
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); From c0b806731603823dd1e81f2faae31fdbc0721ac8 Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 12:32:55 -0700 Subject: [PATCH 69/78] Loader meta-data changes from building yui (to roll in new get). Meta-data for base/widget is modified. Not sure why (no widget.json/base.json changes). Dav will look into as part of his meta-data flattening effort. --- src/loader/js/yui3.js | 17 +++-------------- src/loader/js/yui3.json | 15 ++------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/loader/js/yui3.js b/src/loader/js/yui3.js index bfdc1e4257e..8a7969af601 100644 --- a/src/loader/js/yui3.js +++ b/src/loader/js/yui3.js @@ -265,12 +265,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -1915,13 +1910,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -2015,4 +2004,4 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; diff --git a/src/loader/js/yui3.json b/src/loader/js/yui3.json index c3d933020a9..35979fe7f2a 100644 --- a/src/loader/js/yui3.json +++ b/src/loader/js/yui3.json @@ -245,12 +245,7 @@ "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -1855,13 +1850,7 @@ "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ From 474bd5c07a5215a44625cfb20a75595562c9c814 Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 12:34:19 -0700 Subject: [PATCH 70/78] Build yui (to roll in new Get). Loader came along for the ride. Meta-data for widget, base changed (even though widget.json, base.json and properties files are unchanged) Dav will look into and clean up as part of meta-data flattening effort if required (widget and base unit tests and manual tests still pass) --- build/loader/loader-debug.js | 17 +- build/loader/loader-min.js | 6 +- build/loader/loader-yui3-debug.js | 17 +- build/loader/loader-yui3-min.js | 6 +- build/loader/loader-yui3.js | 17 +- build/loader/loader.js | 17 +- build/yui/yui-debug.js | 1149 ++++++++++++++++------------- build/yui/yui-min.js | 14 +- build/yui/yui-rls-debug.js | 1134 +++++++++++++++------------- build/yui/yui-rls-min.js | 6 +- build/yui/yui-rls.js | 1102 ++++++++++++++------------- build/yui/yui.js | 1119 +++++++++++++++------------- 12 files changed, 2479 insertions(+), 2125 deletions(-) diff --git a/build/loader/loader-debug.js b/build/loader/loader-debug.js index d58884602b5..01abf7b0b0a 100644 --- a/build/loader/loader-debug.js +++ b/build/loader/loader-debug.js @@ -2618,12 +2618,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -4268,13 +4263,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -4368,7 +4357,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-min.js b/build/loader/loader-min.js index 7fa7a470125..c183a55577d 100644 --- a/build/loader/loader-min.js +++ b/build/loader/loader-min.js @@ -1,6 +1,6 @@ YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var J=d.version,F="/build/",G=J+F,E=d.Env.base,B="gallery-2011.06.08-20-04",D="2in3",C="4",A="2.9.0",H=E+"combo?",I={version:J,root:G,base:d.Env.base,comboBase:H,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},z=I.groups,y=function(L,M){var K=D+"."+(L||C)+"/"+(M||A)+F;z.yui2.base=E+K;z.yui2.root=K;},x=function(K){var L=(K||B)+F;z.gallery.base=E+L;z.gallery.root=L;};z[J]={};z.gallery={ext:false,combine:true,comboBase:H,update:x,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};z.yui2={combine:true,ext:false,comboBase:H,update:y,patterns:{"yui2-":{configFn:function(K){if(/-skin|reset|fonts|grids|base/.test(K.name)){K.type="css";K.path=K.path.replace(/\.js/,".css");K.path=K.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};x();y();YUI.Env[J]=I;}());}var f={},c=[],n=(d.UA.ie)?2048:8192,a=YUI.Env,q=a._loaded,r="css",k="js",w="intl",t=d.version,v="",e=d.Object,s=e.each,j=d.Array,h=a._loaderQueue,u=a[t],b="skin-",i=d.Lang,o=a.mods,l,p,g=function(y,z,A,x){var B=y+"/"+z;if(!x){B+="-min";}B+="."+(A||r);return B;};d.Env.meta=u;d.Loader=function(B){var A=u.modules,y=this;l=u.md5;y.context=d;y.base=d.Env.meta.base;y.comboBase=d.Env.meta.comboBase;y.combine=B.base&&(B.base.indexOf(y.comboBase.substr(0,20))>-1);y.maxURLLength=n;y.root=d.Env.meta.root;y.timeout=0;y.forceMap={};y.allowRollup=false;y.filters={};y.required={};y.patterns={};y.moduleInfo={};y.groups=d.merge(d.Env.meta.groups);y.skin=d.merge(d.Env.meta.skin);y.conditions={};y.config=B;y._internal=true;p=a._renderedMods;if(p){s(p,function z(D,C){y.moduleInfo[C]=D;});p=a._conditions;s(p,function x(D,C){y.conditions[C]=D;});}else{s(A,y.addModule,y);}if(!a._renderedMods){a._renderedMods=y.moduleInfo;a._conditions=y.conditions;}y._inspectPage();y._internal=false;y._config(B);y.testresults=null;if(d.config.tests){y.testresults=d.config.tests;}y.sorted=[];y.loaded=q[t];y.dirty=true;y.inserted={};y.skipped={};y.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){s(o,function(z,y){if(z.details){var x=this.moduleInfo[y],B=z.details.requires,A=x&&x.requires;if(x){if(!x._inspected&&B&&A.length!=B.length){delete x.expanded;}}else{x=this.addModule(z.details,y);}x._inspected=true;}},this);},_requires:function(D,C){var z,B,E,F,x=this.moduleInfo,y=x[D],A=x[C];if(!y||!A){return false;}B=y.expanded_map;E=y.after_map;if(E&&(C in E)){return true;}E=A.after_map;if(E&&(D in E)){return false;}F=x[C]&&x[C].supersedes;if(F){for(z=0;z-1){A=B;break;}}}if(A){if(B.action){B.action.call(this,C,y);}else{x=this.addModule(d.merge(A),C);x.temp=true;}}}return x;},_rollup:function(){},_reduce:function(C){C=C||this.required;var z,y,B,x,A=this.loadType;for(z in C){if(C.hasOwnProperty(z)){x=this.getModule(z);if(((this.loaded[z]||o[z])&&!this.forceMap[z]&&!this.ignoreRegistered)||(A&&x&&x.type!=A)){delete C[z];}B=x&&x.supersedes;if(B){for(y=0;y0){h.running=true;h.next()();}},insert:function(A,y,z){var x=this,B=d.merge(this);delete B.require;delete B.dirty;h.add(function(){x._insert(B,A,y,z);});this._continue();},loadNext:function(B){if(!this._loading){return;}var I,Q,P,N,A,F,C,M,E,H,O,x,D,L,z,G,R,S,K=this,y=K.loadType,T=function(U){K.loadNext(U.data);},J=function(W){K._combineComplete[y]=true;var V,U=G.length;for(V=0;VK.maxURLLength)){R.push(K._filter(A));A=O;}A+=x;if(P<(Q-1)){A+="&";}G.push(N.name);}}if(G.length&&(A!=O)){R.push(K._filter(A));}}}if(G.length){if(y===r){F=d.Get.css;M=K.cssAttributes;}else{F=d.Get.script;M=K.jsAttributes;}F(R,{data:K._loading,onSuccess:J,onFailure:K._onFailure,onTimeout:K._onTimeout,insertBefore:K.insertBefore,charset:K.charset,attributes:M,timeout:K.timeout,autopurge:false,context:K});return;}else{K._combineComplete[y]=true;}}if(B){if(B!==K._loading){return;}K.inserted[B]=true;if(K.onProgress){K.onProgress.call(K.context,{name:B,data:K.data});}}I=K.sorted;Q=I.length;for(P=0;P=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}},"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"app":{"submodules":{"controller":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","json-parse","model"]},"view":{"requires":["base-build","node-event-delegate"]}},"use":["controller","model","model-list","view"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}},"use":["attribute-base","attribute-complex"]},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android); -},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}},"use":["base-base","base-pluginhost","base-build"]},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}},"use":["widget-base","widget-htmlparser","widget-uievents","widget-skin"]},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; -YUI.Env[a.version].md5="3d2e8dc698d320d37e410b30e4cc20b2";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file +},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); +},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; +YUI.Env[a.version].md5="579ebc3776a181516fa397fd1980052c";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3-debug.js b/build/loader/loader-yui3-debug.js index b176c6426ac..4fae91bd662 100644 --- a/build/loader/loader-yui3-debug.js +++ b/build/loader/loader-yui3-debug.js @@ -267,12 +267,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -1917,13 +1912,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -2017,7 +2006,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader-yui3-min.js b/build/loader/loader-yui3-min.js index f1f987ffd4e..b91a8e55ab3 100644 --- a/build/loader/loader-yui3-min.js +++ b/build/loader/loader-yui3-min.js @@ -1,3 +1,3 @@ -YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}},"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"app":{"submodules":{"controller":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","json-parse","model"]},"view":{"requires":["base-build","node-event-delegate"]}},"use":["controller","model","model-list","view"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}},"use":["attribute-base","attribute-complex"]},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}},"use":["base-base","base-pluginhost","base-build"]},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}},"use":["widget-base","widget-htmlparser","widget-uievents","widget-skin"]},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; -YUI.Env[a.version].md5="3d2e8dc698d320d37e410b30e4cc20b2";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file +YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}},"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"app":{"submodules":{"controller":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","json-parse","model"]},"view":{"requires":["base-build","node-event-delegate"]}},"use":["controller","model","model-list","view"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}},"use":["attribute-base","attribute-complex"]},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); +},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; +YUI.Env[a.version].md5="579ebc3776a181516fa397fd1980052c";},"@VERSION@",{requires:["loader-base"]}); \ No newline at end of file diff --git a/build/loader/loader-yui3.js b/build/loader/loader-yui3.js index b176c6426ac..4fae91bd662 100644 --- a/build/loader/loader-yui3.js +++ b/build/loader/loader-yui3.js @@ -267,12 +267,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -1917,13 +1912,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -2017,7 +2006,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/loader/loader.js b/build/loader/loader.js index 2a6c39458d8..265316ad9b5 100644 --- a/build/loader/loader.js +++ b/build/loader/loader.js @@ -2579,12 +2579,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -4229,13 +4224,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -4329,7 +4318,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/yui/yui-debug.js b/build/yui/yui-debug.js index f973699d0f4..65aff9e0df0 100644 --- a/build/yui/yui-debug.js +++ b/build/yui/yui-debug.js @@ -3238,7 +3238,6 @@ Y.UA = YUI.Env.UA || YUI.Env.parseUA(); }, '@VERSION@' ); YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -3246,26 +3245,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -3285,22 +3299,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -3321,16 +3354,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -3344,18 +3373,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -3369,16 +3391,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -3390,14 +3413,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -3408,49 +3434,144 @@ Y.Get = function() { _fail = function(id, msg) { Y.log('get failure: ' + msg, 'warn', 'get'); - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - // Y.log("Finishing transaction " + id, "info", "get"); - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + Y.log("Finishing transaction " + id, "info", "get"); + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); } - _end(id, msg, 'OK'); + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; + + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } + + parent.removeChild(node); + } + } + + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -3461,120 +3582,185 @@ Y.Get = function() { */ _timeout = function(id) { Y.log('Timeout ' + id, 'info', 'get'); - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { -// Y.log("_next: " + id + ", loaded: " + (loaded || "nothing"), "info", "get"); - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; + _loaded = function(id, url) { - if (q.timer) { - // Y.log('cancel timer'); - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + sync = !q.async; - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - if (q.url.length === 0) { - _finish(id); - return; - } + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - url = q.url[0]; + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - Y.log('skipping empty url'); - return _next(id); - } + if (ua.ie) { - Y.log('attempting to load ' + url, 'info', 'get'); + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + // Y.log(id + " onreadstatechange " + url, "info", "get"); + n.onreadystatechange = null; + _loaded(id, url); + } + }; - if (q.timeout) { - // Y.log('create timer'); - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + } else if (ua.webkit) { + + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + n.onload = function() { + // Y.log(id + " onload " + url, "info", "get"); + _loaded(id, url); + }; - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, + + _insertInDoc = function(node, id, win) { + + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { + sibling = _getNodeRef(insertBefore, id); + if (sibling) { Y.log('inserting before: ' + insertBefore, 'info', 'get'); - s.parentNode.insertBefore(n, s); + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, - // Y.log("Appending node: " + url, "info", "get"); + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); + + Y.log('attempting to load ' + url, 'info', 'get'); + + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + // add the node to the queue so we can return it in the callback + q.nodes.push(node); + + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -3615,31 +3801,47 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + Y.log('skipping empty url'); + } + + q.remaining = q.url.length; _next(id); @@ -3648,364 +3850,264 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - // Y.log(id + " onreadstatechange " + url, "info", "get"); - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - // Y.log(id + " DOM2 onload " + url, "info", "get"); - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - // Y.log(id + " onload " + url, "info", "get"); - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + Y.log('Aborting ' + id, 'info', 'get'); + q.aborted = true; } - q.nodes = []; - }; - - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - Y.log(id + ' finalized ', 'info', 'get'); - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - Y.log('Aborting ' + id, 'info', 'get'); - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *       Y.log(o.data); // foo
    -         *       Y.log(o.nodes.length === 2) // true
    -         *       // o.purge(); // optionally remove the script nodes
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *       Y.log("transaction failed");
    -         *     },
    -         *     onTimeout: function(o) {
    -         *       Y.log("transaction timed out");
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, + }, - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *    "http://localhost/css/logger.css"], {
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *       Y.log(o.data); // foo
    +     *       Y.log(o.nodes.length === 2) // true
    +     *       // o.purge(); // optionally remove the script nodes
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *       Y.log("transaction failed");
    +     *     },
    +     *     onTimeout: function(o) {
    +     *       Y.log("transaction timed out");
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *    "http://localhost/css/logger.css"], {
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); @@ -7054,12 +7156,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -8704,13 +8801,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -8804,7 +8895,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); diff --git a/build/yui/yui-min.js b/build/yui/yui-min.js index ca40859778a..8bb75bc87b5 100644 --- a/build/yui/yui-min.js +++ b/build/yui/yui-min.js @@ -1,9 +1,9 @@ if(typeof YUI!="undefined"){YUI._YUI=YUI;}var YUI=function(){var c=0,f=this,b=arguments,a=b.length,e=function(h,g){return(h&&h.hasOwnProperty&&(h instanceof g));},d=(typeof YUI_config!=="undefined")&&YUI_config;if(!(e(f,YUI))){f=new YUI();}else{f._init();if(YUI.GlobalConfig){f.applyConfig(YUI.GlobalConfig);}if(d){f.applyConfig(d);}if(!a){f._setup();}}if(a){for(;c-1){r="3.3.0";}q={applyConfig:function(E){E=E||l;var z,B,A=this.config,C=A.modules,y=A.groups,D=A.rls,x=this.Env._loader;for(B in E){if(E.hasOwnProperty(B)){z=E[B];if(C&&B=="modules"){p(C,z);}else{if(y&&B=="groups"){p(y,z);}else{if(D&&B=="rls"){p(D,z);}else{if(B=="win"){A[B]=z.contentWindow||z;A.doc=A[B].document;}else{if(B=="_yuid"){}else{A[B]=z;}}}}}}}if(x){x._config(E);}},_config:function(x){this.applyConfig(x);},_init:function(){var z,A=this,x=YUI.Env,y=A.Env,B;A.version=r;if(!y){A.Env={mods:{},versions:{},base:o,cdn:o+r+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},getBase:x&&x.getBase||function(H,G){var C,D,F,I,E;D=(w&&w.getElementsByTagName("script"))||[];for(F=0;F-1){z=z.substr(0,E);}}E=I.match(G);if(E&&E[3]){C=E[1]+E[3];}break;}}}return C||y.cdn;}};y=A.Env;y._loaded[r]={};if(x&&A!==YUI){y._yidx=++x._yidx;y._guidp=("yui_"+r+"_"+y._yidx+"_"+i).replace(/\./g,"_");}else{if(YUI._YUI){x=YUI._YUI.Env;y._yidx+=x._yidx;y._uidx+=x._uidx;for(B in x){if(!(B in y)){y[B]=x[B];}}delete YUI._YUI;}}A.id=A.stamp(A);c[A.id]=A;}A.constructor=YUI;A.config=A.config||{win:e,doc:w,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,cacheUse:true,fetchCSS:true,use_rls:false};A.config.base=YUI.config.base||A.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/,/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);if(!z||(!("-min.-debug.").indexOf(z))){z="-min.";}A.config.loaderPath=YUI.config.loaderPath||"loader/loader"+(z||"-min.")+"js";},_setup:function(C){var y,B=this,x=[],A=YUI.Env.mods,z=B.config.core||["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"];for(y=0;yy&&y in x?x[y]:true;}}return A;};j.indexOf=r.indexOf?function(x,w){return r.indexOf.call(x,w);}:function(z,y){for(var x=0,w=z.length;x1?Array.prototype.join.call(arguments,n):z.toString(); -if(!(A in w)||(x&&w[A]==x)){w[A]=y.apply(y,arguments);}return w[A];};};b.merge=function(){var y=arguments,z=0,x=y.length,w={};for(;z-1;};g.each=function(z,x,A,y){var w;for(w in z){if(y||h(z,w)){x.call(A||b,z[w],w,z);}}return b;};g.some=function(z,x,A,y){var w;for(w in z){if(y||h(z,w)){if(x.call(A||b,z[w],w,z)){return true;}}}return false;};g.getValue=function(A,z){if(!b.Lang.isObject(A)){return v;}var x,y=b.Array(z),w=y.length;for(x=0;A!==v&&x=0){for(w=0;x!==v&&w0){c=d(j);if(c){return c;}else{e=j.lastIndexOf("-");if(e>=0){j=j.substring(0,e);if(e>=2&&j.charAt(e-2)==="-"){j=j.substring(0,e-2);}}else{break;}}}}return"";}});},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-later",function(b){var a=[];b.later=function(c,g,d,f,e){c=c||0;f=(!b.Lang.isUndefined(f))?b.Array(f):f;var j=(g&&b.Lang.isString(d))?g[d]:d,i=function(){if(!j.apply){j(f[0],f[1],f[2],f[3]);}else{j.apply(g,f||a);}},h=(e)?setInterval(i,c):setTimeout(i,c);return{id:h,interval:e,cancel:function(){if(this.interval){clearInterval(h);}else{clearTimeout(h);}}};};b.Lang.later=b.later;},"@VERSION@",{requires:["yui-base"]});YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var J=d.version,F="/build/",G=J+F,E=d.Env.base,B="gallery-2011.06.08-20-04",D="2in3",C="4",A="2.9.0",H=E+"combo?",I={version:J,root:G,base:d.Env.base,comboBase:H,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},z=I.groups,y=function(L,M){var K=D+"."+(L||C)+"/"+(M||A)+F;z.yui2.base=E+K;z.yui2.root=K;},x=function(K){var L=(K||B)+F;z.gallery.base=E+L;z.gallery.root=L;};z[J]={};z.gallery={ext:false,combine:true,comboBase:H,update:x,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};z.yui2={combine:true,ext:false,comboBase:H,update:y,patterns:{"yui2-":{configFn:function(K){if(/-skin|reset|fonts|grids|base/.test(K.name)){K.type="css"; -K.path=K.path.replace(/\.js/,".css");K.path=K.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};x();y();YUI.Env[J]=I;}());}var f={},c=[],n=(d.UA.ie)?2048:8192,a=YUI.Env,q=a._loaded,r="css",k="js",w="intl",t=d.version,v="",e=d.Object,s=e.each,j=d.Array,h=a._loaderQueue,u=a[t],b="skin-",i=d.Lang,o=a.mods,l,p,g=function(y,z,A,x){var B=y+"/"+z;if(!x){B+="-min";}B+="."+(A||r);return B;};d.Env.meta=u;d.Loader=function(B){var A=u.modules,y=this;l=u.md5;y.context=d;y.base=d.Env.meta.base;y.comboBase=d.Env.meta.comboBase;y.combine=B.base&&(B.base.indexOf(y.comboBase.substr(0,20))>-1);y.maxURLLength=n;y.root=d.Env.meta.root;y.timeout=0;y.forceMap={};y.allowRollup=false;y.filters={};y.required={};y.patterns={};y.moduleInfo={};y.groups=d.merge(d.Env.meta.groups);y.skin=d.merge(d.Env.meta.skin);y.conditions={};y.config=B;y._internal=true;p=a._renderedMods;if(p){s(p,function z(D,C){y.moduleInfo[C]=D;});p=a._conditions;s(p,function x(D,C){y.conditions[C]=D;});}else{s(A,y.addModule,y);}if(!a._renderedMods){a._renderedMods=y.moduleInfo;a._conditions=y.conditions;}y._inspectPage();y._internal=false;y._config(B);y.testresults=null;if(d.config.tests){y.testresults=d.config.tests;}y.sorted=[];y.loaded=q[t];y.dirty=true;y.inserted={};y.skipped={};y.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){s(o,function(z,y){if(z.details){var x=this.moduleInfo[y],B=z.details.requires,A=x&&x.requires;if(x){if(!x._inspected&&B&&A.length!=B.length){delete x.expanded;}}else{x=this.addModule(z.details,y);}x._inspected=true;}},this);},_requires:function(D,C){var z,B,E,F,x=this.moduleInfo,y=x[D],A=x[C];if(!y||!A){return false;}B=y.expanded_map;E=y.after_map;if(E&&(C in E)){return true;}E=A.after_map;if(E&&(D in E)){return false;}F=x[C]&&x[C].supersedes;if(F){for(z=0;z-1){A=B;break;}}}if(A){if(B.action){B.action.call(this,C,y);}else{x=this.addModule(d.merge(A),C);x.temp=true;}}}return x;},_rollup:function(){},_reduce:function(C){C=C||this.required;var z,y,B,x,A=this.loadType;for(z in C){if(C.hasOwnProperty(z)){x=this.getModule(z);if(((this.loaded[z]||o[z])&&!this.forceMap[z]&&!this.ignoreRegistered)||(A&&x&&x.type!=A)){delete C[z];}B=x&&x.supersedes;if(B){for(y=0;y0){h.running=true;h.next()();}},insert:function(A,y,z){var x=this,B=d.merge(this);delete B.require;delete B.dirty;h.add(function(){x._insert(B,A,y,z);});this._continue();},loadNext:function(B){if(!this._loading){return;}var I,Q,P,N,A,F,C,M,E,H,O,x,D,L,z,G,R,S,K=this,y=K.loadType,T=function(U){K.loadNext(U.data);},J=function(W){K._combineComplete[y]=true;var V,U=G.length; -for(V=0;VK.maxURLLength)){R.push(K._filter(A));A=O;}A+=x;if(P<(Q-1)){A+="&";}G.push(N.name);}}if(G.length&&(A!=O)){R.push(K._filter(A));}}}if(G.length){if(y===r){F=d.Get.css;M=K.cssAttributes;}else{F=d.Get.script;M=K.jsAttributes;}F(R,{data:K._loading,onSuccess:J,onFailure:K._onFailure,onTimeout:K._onTimeout,insertBefore:K.insertBefore,charset:K.charset,attributes:M,timeout:K.timeout,autopurge:false,context:K});return;}else{K._combineComplete[y]=true;}}if(B){if(B!==K._loading){return;}K.inserted[B]=true;if(K.onProgress){K.onProgress.call(K.context,{name:B,data:K.data});}}I=K.sorted;Q=I.length;for(P=0;P=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}},"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"app":{"submodules":{"controller":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","json-parse","model"]},"view":{"requires":["base-build","node-event-delegate"]}},"use":["controller","model","model-list","view"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}},"use":["attribute-base","attribute-complex"]},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}},"use":["base-base","base-pluginhost","base-build"]},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); -},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}},"use":["widget-base","widget-htmlparser","widget-uievents","widget-skin"]},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; -YUI.Env[a.version].md5="3d2e8dc698d320d37e410b30e4cc20b2";},"@VERSION@",{requires:["loader-base"]});YUI.add("yui",function(a){},"@VERSION@",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file +if(!(A in w)||(x&&w[A]==x)){w[A]=y.apply(y,arguments);}return w[A];};};b.merge=function(){var y=arguments,z=0,x=y.length,w={};for(;z-1;};g.each=function(z,x,A,y){var w;for(w in z){if(y||h(z,w)){x.call(A||b,z[w],w,z);}}return b;};g.some=function(z,x,A,y){var w;for(w in z){if(y||h(z,w)){if(x.call(A||b,z[w],w,z)){return true;}}}return false;};g.getValue=function(A,z){if(!b.Lang.isObject(A)){return v;}var x,y=b.Array(z),w=y.length;for(x=0;A!==v&&x=0){for(w=0;x!==v&&w0){K=P.url.shift();if(O&&!P.timer){P.timer=setTimeout(function(){E(R);},O);}if(M===t){N=F(K,Q,L);}else{N=k(K,Q,L);}P.nodes.push(N);c(M,N,R,K);H(N,R,Q);if(!l[M]){f(R,K);}if(P.async){i(R);}}},o=function(){if(g){return;}g=true;var K,L;for(K in A){if(A.hasOwnProperty(K)){L=A[K];if(L.autopurge&&L.finished){d(L.tId);delete A[K];}}}g=false;},j=function(L,K,M){M=M||{};var P="q"+(s++),O=M.purgethreshold||e.Get.PURGE_THRESH,N;if(s%O===0){o();}N=A[P]=e.merge(M);N.tId=P;N.type=L;N.url=K;N.finished=false;N.nodes=[];N.win=N.win||e.config.win;N.context=N.context||N;N.autopurge=(r in N)?N.autopurge:(L===t)?true:false;N.attributes=N.attributes||{};N.attributes.charset=M.charset||N.attributes.charset||B;if(D in N&&L===t){N.attributes.async=N.async;}N.url=(q.isString(N.url))?[N.url]:N.url;if(!N.url[0]){N.url.shift();}N.remaining=N.url.length;i(P);return{tId:P};};e.Get={PURGE_THRESH:20,abort:function(L){var M=(q.isString(L))?L:L.tId,K=A[M];if(K){K.aborted=true;}},script:function(K,L){return j(t,K,L);},css:function(K,L){return j("css",K,L);}};},"@VERSION@",{requires:["yui-base"]});YUI.add("features",function(b){var c={};b.mix(b.namespace("Features"),{tests:c,add:function(d,e,f){c[d]=c[d]||{};c[d][e]=f;},all:function(e,f){var g=c[e],d=[];if(g){b.Object.each(g,function(i,h){d.push(h+":"+(b.Features.test(e,h,f)?1:0));});}return(d.length)?d.join(";"):"";},test:function(e,g,f){f=f||[];var d,i,k,j=c[e],h=j&&j[g];if(!h){}else{d=h.result;if(b.Lang.isUndefined(d)){i=h.ua;if(i){d=(b.UA[i]);}k=h.test;if(k&&((!i)||d)){d=k.apply(b,f);}h.result=d;}}return d;}});var a=b.Features.add;a("load","0",{"name":"event-base-ie","test":function(e){var d=e.config.doc&&e.config.doc.implementation;return(d&&(!d.hasFeature("Events","2.0")));},"trigger":"node-base"});a("load","1",{"name":"dom-style-ie","test":function(j){var h=j.Features.test,i=j.Features.add,f=j.config.win,g=j.config.doc,d="documentElement",e=false;i("style","computedStyle",{test:function(){return f&&"getComputedStyle" in f;}});i("style","opacity",{test:function(){return g&&"opacity" in g[d].style;}});e=(!h("style","opacity")&&!h("style","computedStyle"));return e;},"trigger":"dom-style"});a("load","2",{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"});a("load","3",{"name":"autocomplete-list-keys","test":function(d){return !(d.UA.ios||d.UA.android);},"trigger":"autocomplete-list"});a("load","4",{"name":"dd-gestures","test":function(d){return(d.config.win&&("ontouchstart" in d.config.win&&!d.UA.chrome));},"trigger":"dd-drag"});a("load","5",{"name":"selector-css2","test":function(f){var e=f.config.doc,d=e&&!("querySelectorAll" in e);return d;},"trigger":"selector"});a("load","6",{"name":"history-hash-ie","test":function(e){var d=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange" in e.config.win)||!d||d<8);},"trigger":"history-hash"});},"@VERSION@",{requires:["yui-base"]});YUI.add("intl-base",function(b){var a=/[, ]/;b.mix(b.namespace("Intl"),{lookupBestLang:function(g,h){var f,j,c,e;function d(l){var k;for(k=0;k0){c=d(j);if(c){return c;}else{e=j.lastIndexOf("-");if(e>=0){j=j.substring(0,e);if(e>=2&&j.charAt(e-2)==="-"){j=j.substring(0,e-2);}}else{break;}}}}return"";}});},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-later",function(b){var a=[];b.later=function(c,g,d,f,e){c=c||0;f=(!b.Lang.isUndefined(f))?b.Array(f):f;var j=(g&&b.Lang.isString(d))?g[d]:d,i=function(){if(!j.apply){j(f[0],f[1],f[2],f[3]);}else{j.apply(g,f||a);}},h=(e)?setInterval(i,c):setTimeout(i,c);return{id:h,interval:e,cancel:function(){if(this.interval){clearInterval(h);}else{clearTimeout(h);}}};};b.Lang.later=b.later;},"@VERSION@",{requires:["yui-base"]});YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var J=d.version,F="/build/",G=J+F,E=d.Env.base,B="gallery-2011.06.08-20-04",D="2in3",C="4",A="2.9.0",H=E+"combo?",I={version:J,root:G,base:d.Env.base,comboBase:H,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},z=I.groups,y=function(L,M){var K=D+"."+(L||C)+"/"+(M||A)+F;z.yui2.base=E+K;z.yui2.root=K;},x=function(K){var L=(K||B)+F;z.gallery.base=E+L;z.gallery.root=L;};z[J]={};z.gallery={ext:false,combine:true,comboBase:H,update:x,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};z.yui2={combine:true,ext:false,comboBase:H,update:y,patterns:{"yui2-":{configFn:function(K){if(/-skin|reset|fonts|grids|base/.test(K.name)){K.type="css";K.path=K.path.replace(/\.js/,".css");K.path=K.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};x();y();YUI.Env[J]=I;}());}var f={},c=[],n=(d.UA.ie)?2048:8192,a=YUI.Env,q=a._loaded,r="css",k="js",w="intl",t=d.version,v="",e=d.Object,s=e.each,j=d.Array,h=a._loaderQueue,u=a[t],b="skin-",i=d.Lang,o=a.mods,l,p,g=function(y,z,A,x){var B=y+"/"+z; +if(!x){B+="-min";}B+="."+(A||r);return B;};d.Env.meta=u;d.Loader=function(B){var A=u.modules,y=this;l=u.md5;y.context=d;y.base=d.Env.meta.base;y.comboBase=d.Env.meta.comboBase;y.combine=B.base&&(B.base.indexOf(y.comboBase.substr(0,20))>-1);y.maxURLLength=n;y.root=d.Env.meta.root;y.timeout=0;y.forceMap={};y.allowRollup=false;y.filters={};y.required={};y.patterns={};y.moduleInfo={};y.groups=d.merge(d.Env.meta.groups);y.skin=d.merge(d.Env.meta.skin);y.conditions={};y.config=B;y._internal=true;p=a._renderedMods;if(p){s(p,function z(D,C){y.moduleInfo[C]=D;});p=a._conditions;s(p,function x(D,C){y.conditions[C]=D;});}else{s(A,y.addModule,y);}if(!a._renderedMods){a._renderedMods=y.moduleInfo;a._conditions=y.conditions;}y._inspectPage();y._internal=false;y._config(B);y.testresults=null;if(d.config.tests){y.testresults=d.config.tests;}y.sorted=[];y.loaded=q[t];y.dirty=true;y.inserted={};y.skipped={};y.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){s(o,function(z,y){if(z.details){var x=this.moduleInfo[y],B=z.details.requires,A=x&&x.requires;if(x){if(!x._inspected&&B&&A.length!=B.length){delete x.expanded;}}else{x=this.addModule(z.details,y);}x._inspected=true;}},this);},_requires:function(D,C){var z,B,E,F,x=this.moduleInfo,y=x[D],A=x[C];if(!y||!A){return false;}B=y.expanded_map;E=y.after_map;if(E&&(C in E)){return true;}E=A.after_map;if(E&&(D in E)){return false;}F=x[C]&&x[C].supersedes;if(F){for(z=0;z-1){A=B;break;}}}if(A){if(B.action){B.action.call(this,C,y);}else{x=this.addModule(d.merge(A),C);x.temp=true;}}}return x;},_rollup:function(){},_reduce:function(C){C=C||this.required;var z,y,B,x,A=this.loadType;for(z in C){if(C.hasOwnProperty(z)){x=this.getModule(z);if(((this.loaded[z]||o[z])&&!this.forceMap[z]&&!this.ignoreRegistered)||(A&&x&&x.type!=A)){delete C[z];}B=x&&x.supersedes;if(B){for(y=0;y0){h.running=true;h.next()();}},insert:function(A,y,z){var x=this,B=d.merge(this);delete B.require;delete B.dirty;h.add(function(){x._insert(B,A,y,z);});this._continue();},loadNext:function(B){if(!this._loading){return;}var I,Q,P,N,A,F,C,M,E,H,O,x,D,L,z,G,R,S,K=this,y=K.loadType,T=function(U){K.loadNext(U.data);},J=function(W){K._combineComplete[y]=true;var V,U=G.length;for(V=0;VK.maxURLLength)){R.push(K._filter(A));A=O;}A+=x;if(P<(Q-1)){A+="&";}G.push(N.name);}}if(G.length&&(A!=O)){R.push(K._filter(A));}}}if(G.length){if(y===r){F=d.Get.css;M=K.cssAttributes;}else{F=d.Get.script;M=K.jsAttributes;}F(R,{data:K._loading,onSuccess:J,onFailure:K._onFailure,onTimeout:K._onTimeout,insertBefore:K.insertBefore,charset:K.charset,attributes:M,timeout:K.timeout,autopurge:false,context:K});return;}else{K._combineComplete[y]=true;}}if(B){if(B!==K._loading){return;}K.inserted[B]=true;if(K.onProgress){K.onProgress.call(K.context,{name:B,data:K.data});}}I=K.sorted;Q=I.length;for(P=0;P=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"anim":{"submodules":{"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]}},"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"app":{"submodules":{"controller":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","json-parse","model"]},"view":{"requires":["base-build","node-event-delegate"]}},"use":["controller","model","model-list","view"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"submodules":{"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]}},"use":["attribute-base","attribute-complex"]},"autocomplete":{"submodules":{"autocomplete-base":{"optional":["autocomplete-sources"],"plugins":{"autocomplete-filters":{"path":"autocomplete/autocomplete-filters-min.js","requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"path":"autocomplete/autocomplete-filters-accentfold-min.js","requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"path":"autocomplete/autocomplete-highlighters-min.js","requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"path":"autocomplete/autocomplete-highlighters-accentfold-min.js","requires":["array-extras","highlight-accentfold"]}},"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"plugins":{"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"path":"autocomplete/autocomplete-list-keys-min.js","requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"path":"autocomplete/autocomplete-plugin-min.js","requires":["autocomplete-list","node-pluginhost"]}},"requires":["autocomplete-base","event-resize","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]}},"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"base":{"submodules":{"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]}}},"cache":{"submodules":{"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]}},"use":["cache-base","cache-offline","cache-plugin"]},"charts":{"requires":["dom","datatype","event-custom","event-mouseenter","widget","widget-position","widget-stack"]},"classnamemanager":{"requires":["yui-base"]},"collection":{"submodules":{"array-extras":{},"array-invoke":{},"arraylist":{},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]}},"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"compat":{"requires":["event-base","dom","dump","substitute"]},"console":{"lang":["en","es"],"plugins":{"console-filters":{"requires":["plugin","console"],"skinnable":true}},"requires":["yui-log","widget","substitute"],"skinnable":true},"cookie":{"requires":["yui-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-min.css","type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"path":"cssbase/base-context-min.css","type":"css"},"cssfonts":{"path":"cssfonts/fonts-min.css","type":"css"},"cssfonts-context":{"path":"cssfonts/fonts-context-min.css","type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"path":"cssgrids/grids-min.css","type":"css"},"cssgrids-context-deprecated":{"optional":["cssreset-context"],"path":"cssgrids-deprecated/grids-context-min.css","requires":["cssfonts-context"],"type":"css"},"cssgrids-deprecated":{"optional":["cssreset"],"path":"cssgrids-deprecated/grids-min.css","requires":["cssfonts"],"type":"css"},"cssreset":{"path":"cssreset/reset-min.css","type":"css"},"cssreset-context":{"path":"cssreset/reset-context-min.css","type":"css"},"dataschema":{"submodules":{"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]}},"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"datasource":{"submodules":{"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]}},"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datatable":{"submodules":{"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin","stylesheet"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]}},"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatype":{"submodules":{"datatype-date":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"],"submodules":{"datatype-date-format":{"path":"datatype/datatype-date-format-min.js"},"datatype-date-parse":{"path":"datatype/datatype-date-parse-min.js"}},"supersedes":["datatype-date-format"],"use2":["datatype-date-parse","datatype-date-format"]},"datatype-number":{"submodules":{"datatype-number-format":{"path":"datatype/datatype-number-format-min.js"},"datatype-number-parse":{"path":"datatype/datatype-number-parse-min.js"}},"use":["datatype-number-parse","datatype-number-format"]},"datatype-xml":{"submodules":{"datatype-xml-format":{"path":"datatype/datatype-xml-format-min.js"},"datatype-xml-parse":{"path":"datatype/datatype-xml-parse-min.js"}},"use":["datatype-xml-parse","datatype-xml-format"]}},"use":["datatype-number","datatype-date","datatype-xml"]},"dd":{"plugins":{"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome)); +},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]}},"submodules":{"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]}},"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","transition","intl"],"skinnable":true},"dom":{"plugins":{"dom-deprecated":{"requires":["dom-core"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]}},"submodules":{"dom-attrs":{"requires":["dom-core"]},"dom-base":{"requires":["dom-core","dom-attrs","dom-create","dom-class","dom-size"]},"dom-class":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-create":{"requires":["dom-core"]},"dom-screen":{"requires":["dom-core","dom-style"]},"dom-size":{"requires":["dom-core"]},"dom-style":{"requires":["dom-core"]},"selector":{"requires":["selector-native"]},"selector-native":{"requires":["dom-core"]}},"use":["dom-core","dom-base","dom-attrs","dom-create","dom-class","dom-size","dom-screen","dom-style","selector-native","selector"]},"dump":{},"editor":{"submodules":{"createlink-base":{"requires":["editor-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"exec-command":{"requires":["frame"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"selection":{"requires":["node"]}},"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"escape":{},"event":{"after":["node-base"],"plugins":{"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-touch":{"requires":["node-base"]}},"submodules":{"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-focus":{"requires":["event-synthetic"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-resize":{"requires":["node-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]}},"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover"]},"event-custom":{"submodules":{"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]}},"use":["event-custom-base","event-custom-complex"]},"event-gestures":{"submodules":{"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]}},"use":["event-flick","event-move"]},"event-simulate":{"requires":["event-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"highlight":{"submodules":{"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","escape","text-wordbreak"]}},"use":["highlight-base","highlight-accentfold"]},"history":{"plugins":{"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]}},"submodules":{"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]}},"use":["history-base","history-hash","history-hash-ie","history-html5"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"io":{"submodules":{"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml"]}},"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"json":{"submodules":{"json-parse":{},"json-stringify":{}},"use":["json-parse","json-stringify"]},"jsonp":{"plugins":{"jsonp-url":{"requires":["jsonp"]}},"requires":["get","oop"]},"loader":{"submodules":{"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]}},"use":["loader-base","loader-rollup","loader-yui3"]},"node":{"plugins":{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"node-deprecated":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-load":{"requires":["node-base","io-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]}},"submodules":{"node-base":{"requires":["dom-base","selector-css2","event-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]}},"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"plugin":{"plugins":{"pluginattr":{"path":"plugin/pluginattr-min.js","requires":["plugin"]}},"requires":["base-base"]},"pluginhost":{"submodules":{"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]}},"use":["pluginhost-base","pluginhost-config"]},"profiler":{"requires":["yui-base"]},"querystring":{"submodules":{"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-stringify":{"requires":["yui-base"]}},"use":["querystring-parse","querystring-stringify"]},"querystring-parse-simple":{"path":"querystring/querystring-parse-simple-min.js","requires":["yui-base"]},"querystring-stringify-simple":{"path":"querystring/querystring-stringify-simple-min.js","requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"recordset":{"submodules":{"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]}},"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"resize":{"plugins":{"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]}},"submodules":{"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-proxy":{"requires":["plugin","resize-base"]}},"use":["resize-base","resize-proxy","resize-constrain"]},"scrollview":{"plugins":{"scrollview-base":{"path":"scrollview/scrollview-base-min.js","requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-paginator":{"path":"scrollview/scrollview-paginator-min.js","requires":["plugin"]},"scrollview-scrollbars":{"path":"scrollview/scrollview-scrollbars-min.js","requires":["plugin"],"skinnable":true}},"requires":["scrollview-base","scrollview-scrollbars"]},"slider":{"submodules":{"clickable-rail":{"requires":["slider-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]}},"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"sortable":{"plugins":{"sortable-scroll":{"requires":["dd-scroll","sortable"]}},"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"stylesheet":{},"substitute":{"optional":["dump"]},"swf":{"requires":["event-custom","node","swfdetect"]},"swfdetect":{},"tabview":{"plugins":{"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]}},"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"text":{"submodules":{"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{},"text-data-wordbreak":{},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]}},"use":["text-accentfold","text-wordbreak"]},"transition":{"submodules":{"transition-native":{"requires":["node-base"]},"transition-timer":{"requires":["transition-native","node-style"]}},"use":["transition-native","transition-timer"]},"uploader":{"requires":["event-custom","node","base","swf"]},"widget":{"plugins":{"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-child":{"requires":["base-build","widget"]},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]}},"skinnable":true,"submodules":{"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-skin":{"requires":["widget-base"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]}}},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-locale":{"path":"widget/widget-locale-min.js","requires":["widget-base"]},"widget-modality":{"requires":["widget","plugin","gallery-outside-events","base-build"],"skinnable":false},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{"submodules":{"features":{"requires":["yui-base"]},"get":{"requires":["yui-base"]},"intl-base":{"requires":["yui-base"]},"rls":{"requires":["get","features"]},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{"use":["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}},"use":["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]},"yui-throttle":{"requires":["yui-base"]}}; +YUI.Env[a.version].md5="579ebc3776a181516fa397fd1980052c";},"@VERSION@",{requires:["loader-base"]});YUI.add("yui",function(a){},"@VERSION@",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}); \ No newline at end of file diff --git a/build/yui/yui-rls-debug.js b/build/yui/yui-rls-debug.js index cc057cae60a..96cda54f9f3 100644 --- a/build/yui/yui-rls-debug.js +++ b/build/yui/yui-rls-debug.js @@ -3238,7 +3238,6 @@ Y.UA = YUI.Env.UA || YUI.Env.parseUA(); }, '@VERSION@' ); YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -3246,26 +3245,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -3285,22 +3299,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -3321,16 +3354,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -3344,18 +3373,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -3369,16 +3391,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -3390,14 +3413,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -3408,49 +3434,144 @@ Y.Get = function() { _fail = function(id, msg) { Y.log('get failure: ' + msg, 'warn', 'get'); - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + _clearTimeout(q); + + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - // Y.log("Finishing transaction " + id, "info", "get"); - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + Y.log("Finishing transaction " + id, "info", "get"); + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); } - _end(id, msg, 'OK'); + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; + + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } + + parent.removeChild(node); + } + } + + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -3461,120 +3582,185 @@ Y.Get = function() { */ _timeout = function(id) { Y.log('Timeout ' + id, 'info', 'get'); - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { -// Y.log("_next: " + id + ", loaded: " + (loaded || "nothing"), "info", "get"); - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; - - if (q.timer) { - // Y.log('cancel timer'); - // q.timer.cancel(); - clearTimeout(q.timer); - } + _loaded = function(id, url) { - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + var q = queues[id], + sync = !q.async; + + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, + + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - if (q.url.length === 0) { - _finish(id); - return; - } + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - url = q.url[0]; + if (ua.ie) { - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - Y.log('skipping empty url'); - return _next(id); - } + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + // Y.log(id + " onreadstatechange " + url, "info", "get"); + n.onreadystatechange = null; + _loaded(id, url); + } + }; - Y.log('attempting to load ' + url, 'info', 'get'); + } else if (ua.webkit) { - if (q.timeout) { - // Y.log('create timer'); - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. + + n.onload = function() { + // Y.log(id + " onload " + url, "info", "get"); + _loaded(id, url); + }; + + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + _insertInDoc = function(node, id, win) { - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { + sibling = _getNodeRef(insertBefore, id); + if (sibling) { Y.log('inserting before: ' + insertBefore, 'info', 'get'); - s.parentNode.insertBefore(n, s); + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); + + Y.log('attempting to load ' + url, 'info', 'get'); + + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } - // Y.log("Appending node: " + url, "info", "get"); + // add the node to the queue so we can return it in the callback + q.nodes.push(node); - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -3615,31 +3801,47 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + Y.log('skipping empty url'); + } + + q.remaining = q.url.length; _next(id); @@ -3648,364 +3850,264 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - // Y.log(id + " onreadstatechange " + url, "info", "get"); - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - // Y.log(id + " DOM2 onload " + url, "info", "get"); - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - // Y.log(id + " onload " + url, "info", "get"); - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + Y.log('Aborting ' + id, 'info', 'get'); + q.aborted = true; } - q.nodes = []; - }; - - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - Y.log(id + ' finalized ', 'info', 'get'); - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - Y.log('Aborting ' + id, 'info', 'get'); - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *       Y.log(o.data); // foo
    -         *       Y.log(o.nodes.length === 2) // true
    -         *       // o.purge(); // optionally remove the script nodes
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *       Y.log("transaction failed");
    -         *     },
    -         *     onTimeout: function(o) {
    -         *       Y.log("transaction timed out");
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, + }, - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *    "http://localhost/css/logger.css"], {
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *       Y.log(o.data); // foo
    +     *       Y.log(o.nodes.length === 2) // true
    +     *       // o.purge(); // optionally remove the script nodes
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *       Y.log("transaction failed");
    +     *     },
    +     *     onTimeout: function(o) {
    +     *       Y.log("transaction timed out");
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *    "http://localhost/css/logger.css"], {
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); diff --git a/build/yui/yui-rls-min.js b/build/yui/yui-rls-min.js index cedc645658a..95af0624126 100644 --- a/build/yui/yui-rls-min.js +++ b/build/yui/yui-rls-min.js @@ -1,5 +1,5 @@ if(typeof YUI!="undefined"){YUI._YUI=YUI;}var YUI=function(){var c=0,f=this,b=arguments,a=b.length,e=function(h,g){return(h&&h.hasOwnProperty&&(h instanceof g));},d=(typeof YUI_config!=="undefined")&&YUI_config;if(!(e(f,YUI))){f=new YUI();}else{f._init();if(YUI.GlobalConfig){f.applyConfig(YUI.GlobalConfig);}if(d){f.applyConfig(d);}if(!a){f._setup();}}if(a){for(;c-1){q="3.3.0";}p={applyConfig:function(D){D=D||l;var y,A,z=this.config,B=z.modules,x=z.groups,C=z.rls,w=this.Env._loader;for(A in D){if(D.hasOwnProperty(A)){y=D[A];if(B&&A=="modules"){o(B,y);}else{if(x&&A=="groups"){o(x,y);}else{if(C&&A=="rls"){o(C,y);}else{if(A=="win"){z[A]=y.contentWindow||y;z.doc=z[A].document;}else{if(A=="_yuid"){}else{z[A]=y;}}}}}}}if(w){w._config(D);}},_config:function(w){this.applyConfig(w);},_init:function(){var y,z=this,w=YUI.Env,x=z.Env,A;z.version=q;if(!x){z.Env={mods:{},versions:{},base:n,cdn:n+q+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},getBase:w&&w.getBase||function(G,F){var B,C,E,H,D;C=(v&&v.getElementsByTagName("script"))||[];for(E=0;E-1){y=y.substr(0,D);}}D=H.match(F);if(D&&D[3]){B=D[1]+D[3];}break;}}}return B||x.cdn;}};x=z.Env;x._loaded[q]={};if(w&&z!==YUI){x._yidx=++w._yidx;x._guidp=("yui_"+q+"_"+x._yidx+"_"+i).replace(/\./g,"_");}else{if(YUI._YUI){w=YUI._YUI.Env;x._yidx+=w._yidx;x._uidx+=w._uidx;for(A in w){if(!(A in x)){x[A]=w[A];}}delete YUI._YUI;}}z.id=z.stamp(z);c[z.id]=z;}z.constructor=YUI;z.config=z.config||{win:e,doc:v,debug:true,useBrowserConsole:true,throwFail:true,bootstrap:true,cacheUse:true,fetchCSS:true,use_rls:true};z.config.base=YUI.config.base||z.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/,/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);if(!y||(!("-min.-debug.").indexOf(y))){y="-min.";}z.config.loaderPath=YUI.config.loaderPath||"loader/loader"+(y||"-min.")+"js";},_setup:function(B){var x,A=this,w=[],z=YUI.Env.mods,y=A.config.core||["get","features","intl-base","rls","yui-log","yui-later"];for(x=0;xx&&x in w?w[x]:true;}}return z;};j.indexOf=q.indexOf?function(w,v){return q.indexOf.call(w,v);}:function(y,x){for(var w=0,v=y.length;w1?Array.prototype.join.call(arguments,m):y.toString(); -if(!(z in v)||(w&&v[z]==w)){v[z]=x.apply(x,arguments);}return v[z];};};b.merge=function(){var x=arguments,y=0,w=x.length,v={};for(;y-1;};g.each=function(y,w,z,x){var v;for(v in y){if(x||h(y,v)){w.call(z||b,y[v],v,y);}}return b;};g.some=function(y,w,z,x){var v;for(v in y){if(x||h(y,v)){if(w.call(z||b,y[v],v,y)){return true;}}}return false;};g.getValue=function(z,y){if(!b.Lang.isObject(z)){return u;}var w,x=b.Array(y),v=x.length;for(w=0;z!==u&&w=0){for(v=0;w!==u&&v0){c=d(j);if(c){return c;}else{e=j.lastIndexOf("-");if(e>=0){j=j.substring(0,e);if(e>=2&&j.charAt(e-2)==="-"){j=j.substring(0,e-2);}}else{break;}}}}return"";}});},"@VERSION@",{requires:["yui-base"]});YUI.add("rls",function(a){a.rls_locals=function(c,i,b){if(c.config.modules){var g=[],j=a.Array.hash(i),d="fullpath",h,e=c.config.modules;for(h in e){if(e[h][d]){if(j[h]){g.push(e[h][d]);if(e[h].requires){a.Array.each(e[h].requires,function(k){if(!YUI.Env.mods[k]){if(e[k]){if(e[k][d]){g.push(e[k][d]);i.push(k);}}}});}}}}if(g.length){a.Get.script(g,{onEnd:function(f){b(c,i);},data:i});}else{b(c,i);}}else{b(c,i);}};a.rls_needs=function(e,b){var c=b||this,d=c.config;if(!YUI.Env.mods[e]&&!(d.modules&&d.modules[e])){return true;}return false;};a._rls=function(t){t.push("intl");var v=a.config,f=v.modules,h=a.Array,c=a.Object,g=v.rls||{m:1,v:a.version,gv:v.gallery,env:1,lang:v.lang,"2in3v":v["2in3"],"2v":v.yui2,filt:v.filter,filts:v.filters,tests:1},l=v.rls_base||"http://l.yimg.com/py/load?httpcache=rls-seed&gzip=1&",n=v.rls_tmpl||function(){var d=[],i;for(i in g){if(i in g&&g[i]){d.push(i+"={"+i+"}");}}return d.join("&");}(),q=[],j={},p,u,x,k=[],b=[],r,s=t.length,e;for(r=0;r-1){YUI._rls_skins.push(g);}});e._attach([].concat(d.modules,f.attach));if(f.gallery.length&&e.Loader){var b=new e.Loader(f.inst.config);b.onEnd=e.rls_done;b.context=e;b.data=f.gallery;b.ignoreRegistered=false;b.require(f.gallery);b.insert(null,(e.config.fetchCSS)?null:"js");}else{e.rls_done({data:f.asked});}}}};}},"@VERSION@",{requires:["get","features"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-later",function(b){var a=[];b.later=function(c,g,d,f,e){c=c||0;f=(!b.Lang.isUndefined(f))?b.Array(f):f;var j=(g&&b.Lang.isString(d))?g[d]:d,i=function(){if(!j.apply){j(f[0],f[1],f[2],f[3]);}else{j.apply(g,f||a);}},h=(e)?setInterval(i,c):setTimeout(i,c);return{id:h,interval:e,cancel:function(){if(this.interval){clearInterval(h);}else{clearTimeout(h);}}};};b.Lang.later=b.later;},"@VERSION@",{requires:["yui-base"]});YUI.add("yui",function(a){},"@VERSION@",{use:["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}); \ No newline at end of file +if(!(z in v)||(w&&v[z]==w)){v[z]=x.apply(x,arguments);}return v[z];};};b.merge=function(){var x=arguments,y=0,w=x.length,v={};for(;y-1;};g.each=function(y,w,z,x){var v;for(v in y){if(x||h(y,v)){w.call(z||b,y[v],v,y);}}return b;};g.some=function(y,w,z,x){var v;for(v in y){if(x||h(y,v)){if(w.call(z||b,y[v],v,y)){return true;}}}return false;};g.getValue=function(z,y){if(!b.Lang.isObject(z)){return u;}var w,x=b.Array(y),v=x.length;for(w=0;z!==u&&w=0){for(v=0;w!==u&&v0){J=O.url.shift();if(N&&!O.timer){O.timer=setTimeout(function(){D(Q);},N);}if(L===s){M=E(J,P,K);}else{M=k(J,P,K);}O.nodes.push(M);c(L,M,Q,J);G(M,Q,P);if(!l[L]){f(Q,J);}if(O.async){i(Q);}}},n=function(){if(g){return;}g=true;var J,K;for(J in z){if(z.hasOwnProperty(J)){K=z[J];if(K.autopurge&&K.finished){d(K.tId);delete z[J];}}}g=false;},j=function(K,J,L){L=L||{};var O="q"+(r++),N=L.purgethreshold||e.Get.PURGE_THRESH,M;if(r%N===0){n();}M=z[O]=e.merge(L);M.tId=O;M.type=K;M.url=J;M.finished=false;M.nodes=[];M.win=M.win||e.config.win;M.context=M.context||M;M.autopurge=(q in M)?M.autopurge:(K===s)?true:false;M.attributes=M.attributes||{};M.attributes.charset=L.charset||M.attributes.charset||A;if(C in M&&K===s){M.attributes.async=M.async;}M.url=(p.isString(M.url))?[M.url]:M.url;if(!M.url[0]){M.url.shift();}M.remaining=M.url.length;i(O);return{tId:O};};e.Get={PURGE_THRESH:20,abort:function(K){var L=(p.isString(K))?K:K.tId,J=z[L];if(J){J.aborted=true;}},script:function(J,K){return j(s,J,K);},css:function(J,K){return j("css",J,K);}};},"@VERSION@",{requires:["yui-base"]});YUI.add("features",function(b){var c={};b.mix(b.namespace("Features"),{tests:c,add:function(d,e,f){c[d]=c[d]||{};c[d][e]=f;},all:function(e,f){var g=c[e],d=[];if(g){b.Object.each(g,function(i,h){d.push(h+":"+(b.Features.test(e,h,f)?1:0));});}return(d.length)?d.join(";"):"";},test:function(e,g,f){f=f||[];var d,i,k,j=c[e],h=j&&j[g];if(!h){}else{d=h.result;if(b.Lang.isUndefined(d)){i=h.ua;if(i){d=(b.UA[i]);}k=h.test;if(k&&((!i)||d)){d=k.apply(b,f);}h.result=d;}}return d;}});var a=b.Features.add;a("load","0",{"name":"event-base-ie","test":function(e){var d=e.config.doc&&e.config.doc.implementation;return(d&&(!d.hasFeature("Events","2.0")));},"trigger":"node-base"});a("load","1",{"name":"dom-style-ie","test":function(j){var h=j.Features.test,i=j.Features.add,f=j.config.win,g=j.config.doc,d="documentElement",e=false;i("style","computedStyle",{test:function(){return f&&"getComputedStyle" in f;}});i("style","opacity",{test:function(){return g&&"opacity" in g[d].style;}});e=(!h("style","opacity")&&!h("style","computedStyle"));return e;},"trigger":"dom-style"});a("load","2",{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"});a("load","3",{"name":"autocomplete-list-keys","test":function(d){return !(d.UA.ios||d.UA.android);},"trigger":"autocomplete-list"});a("load","4",{"name":"dd-gestures","test":function(d){return(d.config.win&&("ontouchstart" in d.config.win&&!d.UA.chrome));},"trigger":"dd-drag"});a("load","5",{"name":"selector-css2","test":function(f){var e=f.config.doc,d=e&&!("querySelectorAll" in e);return d;},"trigger":"selector"});a("load","6",{"name":"history-hash-ie","test":function(e){var d=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange" in e.config.win)||!d||d<8);},"trigger":"history-hash"});},"@VERSION@",{requires:["yui-base"]});YUI.add("intl-base",function(b){var a=/[, ]/;b.mix(b.namespace("Intl"),{lookupBestLang:function(g,h){var f,j,c,e;function d(l){var k;for(k=0;k0){c=d(j);if(c){return c;}else{e=j.lastIndexOf("-");if(e>=0){j=j.substring(0,e);if(e>=2&&j.charAt(e-2)==="-"){j=j.substring(0,e-2);}}else{break;}}}}return"";}});},"@VERSION@",{requires:["yui-base"]});YUI.add("rls",function(a){a.rls_locals=function(c,i,b){if(c.config.modules){var g=[],j=a.Array.hash(i),d="fullpath",h,e=c.config.modules;for(h in e){if(e[h][d]){if(j[h]){g.push(e[h][d]);if(e[h].requires){a.Array.each(e[h].requires,function(k){if(!YUI.Env.mods[k]){if(e[k]){if(e[k][d]){g.push(e[k][d]);i.push(k);}}}});}}}}if(g.length){a.Get.script(g,{onEnd:function(f){b(c,i);},data:i});}else{b(c,i);}}else{b(c,i);}};a.rls_needs=function(e,b){var c=b||this,d=c.config;if(!YUI.Env.mods[e]&&!(d.modules&&d.modules[e])){return true;}return false;};a._rls=function(t){t.push("intl");var v=a.config,f=v.modules,h=a.Array,c=a.Object,g=v.rls||{m:1,v:a.version,gv:v.gallery,env:1,lang:v.lang,"2in3v":v["2in3"],"2v":v.yui2,filt:v.filter,filts:v.filters,tests:1},l=v.rls_base||"http://l.yimg.com/py/load?httpcache=rls-seed&gzip=1&",n=v.rls_tmpl||function(){var d=[],i;for(i in g){if(i in g&&g[i]){d.push(i+"={"+i+"}");}}return d.join("&");}(),q=[],j={},p,u,x,k=[],b=[],r,s=t.length,e;for(r=0;r-1){YUI._rls_skins.push(g);}});e._attach([].concat(d.modules,f.attach));if(f.gallery.length&&e.Loader){var b=new e.Loader(f.inst.config);b.onEnd=e.rls_done;b.context=e;b.data=f.gallery;b.ignoreRegistered=false;b.require(f.gallery);b.insert(null,(e.config.fetchCSS)?null:"js");}else{e.rls_done({data:f.asked});}}}};}},"@VERSION@",{requires:["get","features"]});YUI.add("yui-log",function(d){var c=d,e="yui:log",a="undefined",b={debug:1,info:1,warn:1,error:1};c.log=function(j,s,g,q){var l,p,n,k,o,i=c,r=i.config,h=(i.fire)?i:YUI.Env.globalEvents;if(r.debug){if(g){p=r.logExclude;n=r.logInclude;if(n&&!(g in n)){l=1;}else{if(n&&(g in n)){l=!n[g];}else{if(p&&(g in p)){l=p[g];}}}}if(!l){if(r.useBrowserConsole){k=(g)?g+": "+j:j;if(i.Lang.isFunction(r.logFn)){r.logFn.call(i,j,s,g);}else{if(typeof console!=a&&console.log){o=(s&&console[s]&&(s in b))?s:"log";console[o](k);}else{if(typeof opera!=a){opera.postError(k);}}}}if(h&&!q){if(h==i&&(!h.getEvent(e))){h.publish(e,{broadcast:2});}h.fire(e,{msg:j,cat:s,src:g});}}}return i;};c.message=function(){return c.log.apply(c,arguments);};},"@VERSION@",{requires:["yui-base"]});YUI.add("yui-later",function(b){var a=[];b.later=function(c,g,d,f,e){c=c||0;f=(!b.Lang.isUndefined(f))?b.Array(f):f;var j=(g&&b.Lang.isString(d))?g[d]:d,i=function(){if(!j.apply){j(f[0],f[1],f[2],f[3]);}else{j.apply(g,f||a);}},h=(e)?setInterval(i,c):setTimeout(i,c);return{id:h,interval:e,cancel:function(){if(this.interval){clearInterval(h);}else{clearTimeout(h);}}};};b.Lang.later=b.later;},"@VERSION@",{requires:["yui-base"]});YUI.add("yui",function(a){},"@VERSION@",{use:["yui-base","get","features","intl-base","rls","yui-log","yui-later"]}); \ No newline at end of file diff --git a/build/yui/yui-rls.js b/build/yui/yui-rls.js index 08c730b6611..624dd0fbf2e 100644 --- a/build/yui/yui-rls.js +++ b/build/yui/yui-rls.js @@ -3221,7 +3221,6 @@ Y.UA = YUI.Env.UA || YUI.Env.parseUA(); }, '@VERSION@' ); YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -3229,26 +3228,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -3268,22 +3282,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -3304,16 +3337,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -3327,18 +3356,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -3352,16 +3374,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -3373,14 +3396,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -3390,48 +3416,143 @@ Y.Get = function() { */ _fail = function(id, msg) { - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, + + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); + } + + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; + + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + parent.removeChild(node); + } } - _end(id, msg, 'OK'); + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -3441,113 +3562,181 @@ Y.Get = function() { * @private */ _timeout = function(id) { - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; + _loaded = function(id, url) { - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + sync = !q.async; - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - if (q.url.length === 0) { - _finish(id); - return; - } + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - url = q.url[0]; + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - return _next(id); - } + if (ua.ie) { + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + n.onreadystatechange = null; + _loaded(id, url); + } + }; - if (q.timeout) { - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + } else if (ua.webkit) { + + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + n.onload = function() { + _loaded(id, url); + }; - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, + + _insertInDoc = function(node, id, win) { + + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { - s.parentNode.insertBefore(n, s); + sibling = _getNodeRef(insertBefore, id); + if (sibling) { + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); + + + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } + // add the node to the queue so we can return it in the callback + q.nodes.push(node); - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -3588,31 +3777,46 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + } + + q.remaining = q.url.length; _next(id); @@ -3621,353 +3825,257 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + q.aborted = true; } - q.nodes = []; - }; - - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *     },
    -         *     onTimeout: function(o) {
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, + }, - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *     },
    +     *     onTimeout: function(o) {
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); diff --git a/build/yui/yui.js b/build/yui/yui.js index 8fb29303954..f4d663cd566 100644 --- a/build/yui/yui.js +++ b/build/yui/yui.js @@ -3221,7 +3221,6 @@ Y.UA = YUI.Env.UA || YUI.Env.parseUA(); }, '@VERSION@' ); YUI.add('get', function(Y) { - /** * Provides a mechanism to fetch remote resources and * insert them into a document. @@ -3229,26 +3228,41 @@ YUI.add('get', function(Y) { * @submodule get */ -var ua = Y.UA, - L = Y.Lang, - TYPE_JS = 'text/javascript', - TYPE_CSS = 'text/css', - STYLESHEET = 'stylesheet'; - /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ -Y.Get = function() { + +var ua = Y.UA, + L = Y.Lang, + TYPE_JS = 'text/javascript', + TYPE_CSS = 'text/css', + STYLESHEET = 'stylesheet', + SCRIPT = 'script', + AUTOPURGE = 'autopurge', + UTF8 = 'utf-8', + LINK = 'link', + ASYNC = 'async', + ALL = true, + + // FireFox does not support the onload event for link nodes, so + // there is no way to make the css requests synchronous. This means + // that the css rules in multiple files could be applied out of order + // in this browser if a later request returns before an earlier one. + + // Safari too. + + ONLOAD_SUPPORTED = { + script: ALL, + css: !(ua.webkit || ua.gecko) + }, /** * hash of queues to manage multiple requests * @property queues * @private */ - var _get, _purge, _track, - queues = {}, /** @@ -3268,22 +3282,41 @@ Y.Get = function() { */ purging, + /** + * Clear timeout state + * + * @method _clearTimeout + * @param {Object} q Queue data + * @private + */ + _clearTimeout = function(q) { + var timer = q.timer; + if (timer) { + clearTimeout(timer); + q.timer = null; + } + }, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. - * @param {string} attr the attributes. + * @param {Object} attr the fixed set of attribute for the type. + * @param {Object} custAttrs optional Any custom attributes provided by the user. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ - _node = function(type, attr, win) { + _node = function(type, attr, custAttrs, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; + if (custAttrs) { + Y.mix(attr, custAttrs); + } + for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); @@ -3304,16 +3337,12 @@ Y.Get = function() { * @private */ _linkNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_CSS, - rel: STYLESHEET, - href: url - }; - if (attributes) { - Y.mix(o, attributes); - } - return _node('link', o, win); + return _node(LINK, { + id: Y.guid(), + type: TYPE_CSS, + rel: STYLESHEET, + href: url + }, attributes, win); }, /** @@ -3327,18 +3356,11 @@ Y.Get = function() { * @private */ _scriptNode = function(url, win, attributes) { - var o = { - id: Y.guid(), - type: TYPE_JS - }; - - if (attributes) { - Y.mix(o, attributes); - } - - o.src = url; - - return _node('script', o, win); + return _node(SCRIPT, { + id: Y.guid(), + type: TYPE_JS, + src: url + }, attributes, win); }, /** @@ -3352,16 +3374,17 @@ Y.Get = function() { */ _returnData = function(q, msg, result) { return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - statusText: result, - purge: function() { - _purge(this.tId); - } - }; + tId: q.tId, + win: q.win, + data: q.data, + nodes: q.nodes, + msg: msg, + statusText: result, + + purge: function() { + _purge(this.tId); + } + }; }, /** @@ -3373,14 +3396,17 @@ Y.Get = function() { * @private */ _end = function(id, msg, result) { - var q = queues[id], sc; - if (q && q.onEnd) { - sc = q.context || q; - q.onEnd.call(sc, _returnData(q, msg, result)); + var q = queues[id], + onEnd = q && q.onEnd; + + q.finished = true; + + if (onEnd) { + onEnd.call(q.context, _returnData(q, msg, result)); } }, - /* + /** * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions @@ -3390,48 +3416,143 @@ Y.Get = function() { */ _fail = function(id, msg) { - var q = queues[id], sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + onFailure = q.onFailure; + + _clearTimeout(q); - // execute failure callback - if (q.onFailure) { - sc = q.context || q; - q.onFailure.call(sc, _returnData(q, msg)); + if (onFailure) { + onFailure.call(q.context, _returnData(q, msg)); } _end(id, msg, 'failure'); }, + + /** + * Abort the transaction + * + * @method _abort + * @param {Object} id + * @private + */ + _abort = function(id) { + _fail(id, 'transaction ' + id + ' was aborted'); + }, + /** * The request is complete, so executing the requester's callback - * @method _finish + * @method _complete * @param {string} id the id of the request. * @private */ - _finish = function(id) { - var q = queues[id], msg, sc; - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } - q.finished = true; + _complete = function(id) { + + var q = queues[id], + onSuccess = q.onSuccess; + + _clearTimeout(q); if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + _abort(id); + } else { + + if (onSuccess) { + onSuccess.call(q.context, _returnData(q)); + } + + // 3.3.0 had undefined msg for this path. + _end(id, undefined, 'OK'); } + }, + + /** + * Get node reference, from string + * + * @method _getNodeRef + * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned. + * @param {String} tId Queue id, used to determine document for queue + * @private + */ + _getNodeRef = function(nId, tId) { + var q = queues[tId], + n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; + if (!n) { + _fail(tId, 'target node not found: ' + nId); + } + + return n; + }, + + /** + * Removes the nodes for the specified queue + * @method _purge + * @param {string} tId the transaction id. + * @private + */ + _purge = function(tId) { + var nodes, doc, parent, sibling, node, attr, insertBefore, + i, l, + q = queues[tId]; + + if (q) { + nodes = q.nodes; + l = nodes.length; + + // TODO: Why is node.parentNode undefined? Which forces us to do this... + /* + doc = q.win.document; + parent = doc.getElementsByTagName('head')[0]; + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0]; + + if (insertBefore) { + sibling = _getNodeRef(insertBefore, tId); + if (sibling) { + parent = sibling.parentNode; + } + } + */ + + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parentNode; - // execute success callback - if (q.onSuccess) { - sc = q.context || q; - q.onSuccess.call(sc, _returnData(q)); + if (node.clearAttributes) { + node.clearAttributes(); + } else { + // This destroys parentNode ref, so we hold onto it above first. + for (attr in node) { + if (node.hasOwnProperty(attr)) { + delete node[attr]; + } + } + } + + parent.removeChild(node); + } } - _end(id, msg, 'OK'); + q.nodes = []; + }, + + /** + * Progress callback + * + * @method _progress + * @param {string} id The id of the request. + * @param {string} The url which just completed. + * @private + */ + _progress = function(id, url) { + var q = queues[id], + onProgress = q.onProgress, + o; + + if (onProgress) { + o = _returnData(q); + o.url = url; + onProgress.call(q.context, o); + } }, /** @@ -3441,113 +3562,181 @@ Y.Get = function() { * @private */ _timeout = function(id) { - var q = queues[id], sc; - if (q.onTimeout) { - sc = q.context || q; - q.onTimeout.call(sc, _returnData(q)); + + var q = queues[id], + onTimeout = q.onTimeout; + + if (onTimeout) { + onTimeout.call(q.context, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, - /** - * Loads the next item for a given request - * @method _next + * onload callback + * @method _loaded * @param {string} id the id of the request. - * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ - _next = function(id, loaded) { - var q = queues[id], msg, w, d, h, n, url, s, - insertBefore; + _loaded = function(id, url) { - if (q.timer) { - // q.timer.cancel(); - clearTimeout(q.timer); - } + var q = queues[id], + sync = !q.async; - if (q.aborted) { - msg = 'transaction ' + id + ' was aborted'; - _fail(id, msg); - return; + if (sync) { + _clearTimeout(q); } - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (L.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; + _progress(id, url); + + // TODO: Cleaning up flow to have a consistent end point + + // !q.finished check is for the async case, + // where scripts may still be loading when we've + // already aborted. Ideally there should be a single path + // for this. + + if (!q.finished) { + if (q.aborted) { + _abort(id); + } else { + if ((--q.remaining) === 0) { + _complete(id); + } else if (sync) { + _next(id); + } } } + }, + + /** + * Detects when a node has been loaded. In the case of + * script nodes, this does not guarantee that contained + * script is ready to use. + * @method _trackLoad + * @param {string} type the type of node to track. + * @param {HTMLElement} n the node to track. + * @param {string} id the id of the request. + * @param {string} url the url that is being loaded. + * @private + */ + _trackLoad = function(type, n, id, url) { - w = q.win; - d = w.document; - h = d.getElementsByTagName('head')[0]; + // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]? - if (q.url.length === 0) { - _finish(id); - return; - } + // IE supports the readystatechange event for script and css nodes + // Opera only for script nodes. Opera support onload for script + // nodes, but this doesn't fire when there is a load failure. + // The onreadystatechange appears to be a better way to respond + // to both success and failure. - url = q.url[0]; + if (ua.ie) { - // if the url is undefined, this is probably a trailing comma - // problem in IE. - if (!url) { - q.url.shift(); - return _next(id); - } + n.onreadystatechange = function() { + var rs = this.readyState; + if ('loaded' === rs || 'complete' === rs) { + n.onreadystatechange = null; + _loaded(id, url); + } + }; + } else if (ua.webkit) { - if (q.timeout) { - // q.timer = L.later(q.timeout, q, _timeout, id); - q.timer = setTimeout(function() { - _timeout(id); - }, q.timeout); - } + // webkit prior to 3.x is no longer supported + if (type === SCRIPT) { + // Safari 3.x supports the load event for script nodes (DOM2) + n.addEventListener('load', function() { + _loaded(id, url); + }, false); + } - if (q.type === 'script') { - n = _scriptNode(url, w, q.attributes); } else { - n = _linkNode(url, w, q.attributes); - } - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); + // FireFox and Opera support onload (but not DOM2 in FF) handlers for + // script nodes. Opera, but not FF, supports the onload event for link nodes. - // add the node to the queue so we can return it to the user supplied - // callback - q.nodes.push(n); + n.onload = function() { + _loaded(id, url); + }; - // add it to the head or insert it before 'insertBefore'. Work around - // IE bug if there is a base tag. - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; + n.onerror = function(e) { + _fail(id, e + ': ' + url); + }; + } + }, + + _insertInDoc = function(node, id, win) { + + // Add it to the head or insert it before 'insertBefore'. + // Work around IE bug if there is a base tag. + var q = queues[id], + doc = win.document, + insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0], + sibling; if (insertBefore) { - s = _get(insertBefore, id); - if (s) { - s.parentNode.insertBefore(n, s); + sibling = _getNodeRef(insertBefore, id); + if (sibling) { + sibling.parentNode.insertBefore(node, sibling); } } else { - h.appendChild(n); + // 3.3.0 assumed head is always around. + doc.getElementsByTagName('head')[0].appendChild(node); } + }, + /** + * Loads the next item for a given request + * @method _next + * @param {string} id the id of the request. + * @return {string} the result. + * @private + */ + _next = function(id) { + + // Assigning out here for readability + var q = queues[id], + type = q.type, + attrs = q.attributes, + win = q.win, + timeout = q.timeout, + node, + url; + + if (q.url.length > 0) { + + url = q.url.shift(); + + + // !q.timer ensures that this only happens once for async + if (timeout && !q.timer) { + q.timer = setTimeout(function() { + _timeout(id); + }, timeout); + } + + if (type === SCRIPT) { + node = _scriptNode(url, win, attrs); + } else { + node = _linkNode(url, win, attrs); + } - // FireFox does not support the onload event for link nodes, so - // there is no way to make the css requests synchronous. This means - // that the css rules in multiple files could be applied out of order - // in this browser if a later request returns before an earlier one. - // Safari too. - if ((ua.webkit || ua.gecko) && q.type === 'css') { - _next(id, url); + // add the node to the queue so we can return it in the callback + q.nodes.push(node); + + _trackLoad(type, node, id, url); + _insertInDoc(node, id, win); + + if (!ONLOAD_SUPPORTED[type]) { + _loaded(id, url); + } + + if (q.async) { + // For sync, the _next call is chained in _loaded + _next(id); + } } }, @@ -3588,31 +3777,46 @@ Y.Get = function() { * @private */ _queue = function(type, url, opts) { + opts = opts || {}; - var id = 'q' + (qidx++), q, - thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; + var id = 'q' + (qidx++), + thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, + q; if (qidx % thresh === 0) { _autoPurge(); } - queues[id] = Y.merge(opts, { - tId: id, - type: type, - url: url, - finished: false, - nodes: [] - }); + // Merge to protect opts (grandfathered in). + q = queues[id] = Y.merge(opts); + + // Avoid mix, merge overhead. Known set of props. + q.tId = id; + q.type = type; + q.url = url; + q.finished = false; + q.nodes = []; - q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; - q.autopurge = ('autopurge' in q) ? q.autopurge : - (type === 'script') ? true : false; - + q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false; q.attributes = q.attributes || {}; - q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; + q.attributes.charset = opts.charset || q.attributes.charset || UTF8; + + if (ASYNC in q && type === SCRIPT) { + q.attributes.async = q.async; + } + + q.url = (L.isString(q.url)) ? [q.url] : q.url; + + // TODO: Do we really need to account for this developer error? + // If the url is undefined, this is probably a trailing comma problem in IE. + if (!q.url[0]) { + q.url.shift(); + } + + q.remaining = q.url.length; _next(id); @@ -3621,353 +3825,257 @@ Y.Get = function() { }; }; + +Y.Get = { + /** - * Detects when a node has been loaded. In the case of - * script nodes, this does not guarantee that contained - * script is ready to use. - * @method _track - * @param {string} type the type of node to track. - * @param {HTMLElement} n the node to track. - * @param {string} id the id of the request. - * @param {string} url the url that is being loaded. - * @param {Window} win the targeted window. - * @param {int} qlength the number of remaining items in the queue, - * including this one. - * @param {Function} trackfn function to execute when finished - * the default is _next. + * The number of request required before an automatic purge. + * Can be configured via the 'purgethreshold' config + * property PURGE_THRESH + * @static + * @type int + * @default 20 * @private */ - _track = function(type, n, id, url, win, qlength, trackfn) { - var f = trackfn || _next; - - // IE supports the readystatechange event for script and css nodes - // Opera only for script nodes. Opera support onload for script - // nodes, but this doesn't fire when there is a load failure. - // The onreadystatechange appears to be a better way to respond - // to both success and failure. - if (ua.ie) { - n.onreadystatechange = function() { - var rs = this.readyState; - if ('loaded' === rs || 'complete' === rs) { - n.onreadystatechange = null; - f(id, url); - } - }; - - // webkit prior to 3.x is no longer supported - } else if (ua.webkit) { - if (type === 'script') { - // Safari 3.x supports the load event for script nodes (DOM2) - n.addEventListener('load', function() { - f(id, url); - }, false); - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - f(id, url); - }; - - n.onerror = function(e) { - _fail(id, e + ': ' + url); - }; - } - }; - - _get = function(nId, tId) { - var q = queues[tId], - n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, 'target node not found: ' + nId); - } - - return n; - }; + PURGE_THRESH: 20, /** - * Removes the nodes for the specified queue - * @method _purge - * @param {string} tId the transaction id. - * @private + * Abort a transaction + * @method abort + * @static + * @param {string|object} o Either the tId or the object returned from + * script() or css(). */ - _purge = function(tId) { - var n, l, d, h, s, i, node, attr, insertBefore, - q = queues[tId]; + abort : function(o) { + var id = (L.isString(o)) ? o : o.tId, + q = queues[id]; if (q) { - n = q.nodes; - l = n.length; - d = q.win.document; - h = d.getElementsByTagName('head')[0]; - - insertBefore = q.insertBefore || - d.getElementsByTagName('base')[0]; - - if (insertBefore) { - s = _get(insertBefore, tId); - if (s) { - h = s.parentNode; - } - } - - for (i = 0; i < l; i = i + 1) { - node = n[i]; - if (node.clearAttributes) { - node.clearAttributes(); - } else { - for (attr in node) { - if (node.hasOwnProperty(attr)) { - delete node[attr]; - } - } - } - - h.removeChild(node); - } + q.aborted = true; } - q.nodes = []; - }; - - return { - - /** - * The number of request required before an automatic purge. - * Can be configured via the 'purgethreshold' config - * property PURGE_THRESH - * @static - * @type int - * @default 20 - * @private - */ - PURGE_THRESH: 20, - - /** - * Called by the the helper for detecting script load in Safari - * @method _finalize - * @static - * @param {string} id the transaction id. - * @private - */ - _finalize: function(id) { - setTimeout(function() { - _finish(id); - }, 0); - }, - - /** - * Abort a transaction - * @method abort - * @static - * @param {string|object} o Either the tId or the object returned from - * script() or css(). - */ - abort: function(o) { - var id = (L.isString(o)) ? o : o.tId, - q = queues[id]; - if (q) { - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param {string|string[]} url the url or urls to the script(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onTimeout
    - *
    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - *
    - *
    onEnd
    - *
    a function that executes when the transaction finishes, - * regardless of the exit path
    - *
    onFailure
    - *
    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
    - *
    win
    - *
    the window the script(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted successfully
    - *
    purge
    - *
    A function that, when executed, will remove any nodes - * that were inserted
    - *
    - *
    - *
    - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    autopurge
    - *
    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
    - *
    purgethreshold
    - *
    - * The number of transaction before autopurge should be initiated - *
    - *
    data
    - *
    - * data that is supplied to the callback when the script(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling. - * If this is not specified, nodes will be inserted before a base - * tag should it exist. Otherwise, the nodes will be appended to the - * end of the document head.
    - *
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - *
    timeout
    - *
    Number of milliseconds to wait before aborting and firing - * the timeout event
    - *
    -         *   Y.Get.script(
    -         *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    -         *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    -         *   {
    -         *     onSuccess: function(o) {
    -         *       this.log("won't cause error because Y is the context");
    -         *                     // immediately
    -         *     },
    -         *     onFailure: function(o) {
    -         *     },
    -         *     onTimeout: function(o) {
    -         *     },
    -         *     data: "foo",
    -         *     timeout: 10000, // 10 second timeout
    -         *     context: Y, // make the YUI instance
    -         *     // win: otherframe // target another window/frame
    -         *     autopurge: true // allow the utility to choose when to
    -         *                     // remove the nodes
    -         *     purgetheshold: 1 // purge previous transaction before
    -         *                      // next transaction
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - script: function(url, opts) { - return _queue('script', url, opts); - }, + }, - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param {string} url the url or urls to the css file(s). - * @param {object} opts Options: - *
    - *
    onSuccess
    - *
    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
    win
    - *
    the window the link nodes(s) were inserted into
    - *
    data
    - *
    the data object passed in when the request was made
    - *
    nodes
    - *
    An array containing references to the nodes that were - * inserted
    - *
    purge
    - *
    A function that, when executed, will remove the nodes - * that were inserted
    - *
    - *
    - * - *
    context
    - *
    the execution context for the callbacks
    - *
    win
    - *
    a window other than the one the utility occupies
    - *
    data
    - *
    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
    - *
    insertBefore
    - *
    node or node id that will become the new node's nextSibling
    - *
    charset
    - *
    Node charset, default utf-8 (deprecated, use the attributes - * config)
    - *
    attributes
    - *
    An object literal containing additional attributes to add to - * the link tags
    - * - *
    -         * Y.Get.css("http://localhost/css/menu.css");
    -         * 
    - *
    -         *   Y.Get.css(
    -         *   ["http://localhost/css/menu.css",
    -         *     insertBefore: 'custom-styles' // nodes will be inserted
    -         *                                   // before the specified node
    -         *   });.
    -         * 
    - * @return {tId: string} an object containing info about the - * transaction. - */ - css: function(url, opts) { - return _queue('css', url, opts); - } - }; -}(); + /** + * Fetches and inserts one or more script nodes into the head + * of the current document or the document in a specified window. + * + * @method script + * @static + * @param {string|string[]} url the url or urls to the script(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the script(s) are finished loading + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onTimeout
    + *
    + * callback to execute when a timeout occurs. + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + *
    + *
    onEnd
    + *
    a function that executes when the transaction finishes, + * regardless of the exit path
    + *
    onFailure
    + *
    + * callback to execute when the script load operation fails + * The callback receives an object back with the following + * data: + *
    + *
    win
    + *
    the window the script(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted successfully
    + *
    purge
    + *
    A function that, when executed, will remove any nodes + * that were inserted
    + *
    + *
    + *
    + *
    onProgress
    + *
    callback to execute when each individual file is done loading + * (useful when passing in an array of js files). Receives the same + * payload as onSuccess, with the addition of a url + * property, which identifies the file which was loaded.
    + *
    async
    + *
    + *

    When passing in an array of JS files, setting this flag to true + * will insert them into the document in parallel, as opposed to the + * default behavior, which is to chain load them serially. It will also + * set the async attribute on the script node to true.

    + *

    Setting async:true + * will lead to optimal file download performance allowing the browser to + * download multiple scripts in parallel, and execute them as soon as they + * are available.

    + *

    Note that async:true does not guarantee execution order of the + * scripts being downloaded. They are executed in whichever order they + * are received.

    + *
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    autopurge
    + *
    + * setting to true will let the utilities cleanup routine purge + * the script once loaded + *
    + *
    purgethreshold
    + *
    + * The number of transaction before autopurge should be initiated + *
    + *
    data
    + *
    + * data that is supplied to the callback when the script(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling. + * If this is not specified, nodes will be inserted before a base + * tag should it exist. Otherwise, the nodes will be appended to the + * end of the document head.
    + *
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + *
    timeout
    + *
    Number of milliseconds to wait before aborting and firing + * the timeout event
    + *
    +     *   Y.Get.script(
    +     *   ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
    +     *    "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
    +     *   {
    +     *     onSuccess: function(o) {
    +     *       this.log("won't cause error because Y is the context");
    +     *                     // immediately
    +     *     },
    +     *     onFailure: function(o) {
    +     *     },
    +     *     onTimeout: function(o) {
    +     *     },
    +     *     data: "foo",
    +     *     timeout: 10000, // 10 second timeout
    +     *     context: Y, // make the YUI instance
    +     *     // win: otherframe // target another window/frame
    +     *     autopurge: true // allow the utility to choose when to
    +     *                     // remove the nodes
    +     *     purgetheshold: 1 // purge previous transaction before
    +     *                      // next transaction
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + script: function(url, opts) { + return _queue(SCRIPT, url, opts); + }, + /** + * Fetches and inserts one or more css link nodes into the + * head of the current document or the document in a specified + * window. + * @method css + * @static + * @param {string} url the url or urls to the css file(s). + * @param {object} opts Options: + *
    + *
    onSuccess
    + *
    + * callback to execute when the css file(s) are finished loading + * The callback receives an object back with the following + * data: + *
    win
    + *
    the window the link nodes(s) were inserted into
    + *
    data
    + *
    the data object passed in when the request was made
    + *
    nodes
    + *
    An array containing references to the nodes that were + * inserted
    + *
    purge
    + *
    A function that, when executed, will remove the nodes + * that were inserted
    + *
    + *
    + * + *
    onProgress
    + *
    callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same + * payload as onSuccess, with the addition of a url property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers, + * where onload for css is detected accurately.
    + *
    async
    + *
    When passing in an array of css files, setting this flag to true will insert them + * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). + * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.
    + *
    context
    + *
    the execution context for the callbacks
    + *
    win
    + *
    a window other than the one the utility occupies
    + *
    data
    + *
    + * data that is supplied to the callbacks when the nodes(s) are + * loaded. + *
    + *
    insertBefore
    + *
    node or node id that will become the new node's nextSibling
    + *
    charset
    + *
    Node charset, default utf-8 (deprecated, use the attributes + * config)
    + *
    attributes
    + *
    An object literal containing additional attributes to add to + * the link tags
    + * + *
    +     * Y.Get.css("http://localhost/css/menu.css");
    +     * 
    + *
    +     *   Y.Get.css(
    +     *   ["http://localhost/css/menu.css",
    +     *     insertBefore: 'custom-styles' // nodes will be inserted
    +     *                                   // before the specified node
    +     *   });.
    +     * 
    + * @return {tId: string} an object containing info about the + * transaction. + */ + css: function(url, opts) { + return _queue('css', url, opts); + } +}; }, '@VERSION@' ,{requires:['yui-base']}); @@ -6976,12 +7084,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "pluginhost" ] } - }, - "use": [ - "base-base", - "base-pluginhost", - "base-build" - ] + } }, "cache": { "submodules": { @@ -8626,13 +8729,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { "node-event-delegate" ] } - }, - "use": [ - "widget-base", - "widget-htmlparser", - "widget-uievents", - "widget-skin" - ] + } }, "widget-anim": { "requires": [ @@ -8726,7 +8823,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || { ] } }; -YUI.Env[Y.version].md5 = '3d2e8dc698d320d37e410b30e4cc20b2'; +YUI.Env[Y.version].md5 = '579ebc3776a181516fa397fd1980052c'; }, '@VERSION@' ,{requires:['loader-base']}); From f4093bcb1f821feadeb7273f3c33d1089f162b81 Mon Sep 17 00:00:00 2001 From: Satyen Desai Date: Tue, 14 Jun 2011 12:50:41 -0700 Subject: [PATCH 71/78] Added Get unit tests to smoketests --- src/common/tests/smoketests.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/tests/smoketests.xml b/src/common/tests/smoketests.xml index 6d1832904f0..a632a6a9a46 100644 --- a/src/common/tests/smoketests.xml +++ b/src/common/tests/smoketests.xml @@ -45,6 +45,7 @@ event/tests/delegate.html event/tests/event-synthetic.html event/tests/focusblur.html + yui/tests/get.html highlight/tests/functional/highlight.html history/tests/functional/history-base.html