Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Gallery Build Tag: gallery-2011.02.09-21-32

  • Loading branch information...
commit 2c4131e6928a6f8695d408e46f2e4fc558fb42e5 1 parent 6e13901
YUI Builder authored
Showing with 3,501 additions and 1,182 deletions.
  1. +3 −1 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert-debug.js
  2. +2 −2 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert-min.js
  3. +3 −1 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert.js
  4. +112 −0 build/gallery-animloop/gallery-animloop-debug.js
  5. +1 −0  build/gallery-animloop/gallery-animloop-min.js
  6. +104 −0 build/gallery-animloop/gallery-animloop.js
  7. +1 −1  build/gallery-aui-autocomplete/assets/skins/sam/gallery-aui-autocomplete.css
  8. +14 −1 build/gallery-aui-autocomplete/gallery-aui-autocomplete-debug.js
  9. +3 −3 build/gallery-aui-autocomplete/gallery-aui-autocomplete-min.js
  10. +14 −1 build/gallery-aui-autocomplete/gallery-aui-autocomplete.js
  11. +359 −128 build/gallery-aui-base/gallery-aui-base-debug.js
  12. +1 −1  build/gallery-aui-base/gallery-aui-base-min.js
  13. +359 −128 build/gallery-aui-base/gallery-aui-base.js
  14. +7 −7 build/gallery-aui-chart/gallery-aui-chart-debug.js
  15. +3 −3 build/gallery-aui-chart/gallery-aui-chart-min.js
  16. +7 −7 build/gallery-aui-chart/gallery-aui-chart.js
  17. +1 −1  build/gallery-aui-color-picker-base/assets/skins/sam/gallery-aui-color-picker-base.css
  18. +16 −14 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base-debug.js
  19. +2 −2 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base-min.js
  20. +16 −14 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base.js
  21. +1 −1  build/gallery-aui-color-picker/assets/skins/sam/gallery-aui-color-picker.css
  22. +1 −1  build/gallery-aui-color-picker/gallery-aui-color-picker-debug.js
  23. +1 −1  build/gallery-aui-color-picker/gallery-aui-color-picker-min.js
  24. +1 −1  build/gallery-aui-color-picker/gallery-aui-color-picker.js
  25. +108 −11 build/gallery-aui-component/gallery-aui-component-debug.js
  26. +1 −1  build/gallery-aui-component/gallery-aui-component-min.js
  27. +108 −11 build/gallery-aui-component/gallery-aui-component.js
  28. +1 −1  build/gallery-aui-dialog/assets/skins/sam/gallery-aui-dialog.css
  29. +6 −1 build/gallery-aui-dialog/gallery-aui-dialog-debug.js
  30. +1 −1  build/gallery-aui-dialog/gallery-aui-dialog-min.js
  31. +6 −1 build/gallery-aui-dialog/gallery-aui-dialog.js
  32. +1 −1  build/gallery-aui-editable/assets/skins/sam/gallery-aui-editable.css
  33. +3 −8 build/gallery-aui-editable/gallery-aui-editable-debug.js
  34. +1 −1  build/gallery-aui-editable/gallery-aui-editable-min.js
  35. +3 −8 build/gallery-aui-editable/gallery-aui-editable.js
  36. +61 −5 build/gallery-aui-io-plugin/gallery-aui-io-plugin-debug.js
  37. +1 −1  build/gallery-aui-io-plugin/gallery-aui-io-plugin-min.js
  38. +61 −5 build/gallery-aui-io-plugin/gallery-aui-io-plugin.js
  39. +34 −5 build/gallery-aui-io-request/gallery-aui-io-request-debug.js
  40. +1 −1  build/gallery-aui-io-request/gallery-aui-io-request-min.js
  41. +34 −5 build/gallery-aui-io-request/gallery-aui-io-request.js
  42. +1 −1  build/gallery-aui-io/gallery-aui-io-debug.js
  43. +1 −1  build/gallery-aui-io/gallery-aui-io-min.js
  44. +1 −1  build/gallery-aui-io/gallery-aui-io.js
  45. +7 −3 build/gallery-aui-live-search/gallery-aui-live-search-debug.js
  46. +1 −1  build/gallery-aui-live-search/gallery-aui-live-search-min.js
  47. +7 −3 build/gallery-aui-live-search/gallery-aui-live-search.js
  48. +178 −164 build/gallery-aui-node-base/gallery-aui-node-base-debug.js
  49. +2 −2 build/gallery-aui-node-base/gallery-aui-node-base-min.js
  50. +178 −164 build/gallery-aui-node-base/gallery-aui-node-base.js
  51. +1 −1  build/gallery-aui-node-html5/gallery-aui-node-html5-debug.js
  52. +1 −1  build/gallery-aui-node-html5/gallery-aui-node-html5-min.js
  53. +1 −1  build/gallery-aui-node-html5/gallery-aui-node-html5.js
  54. +1 −1  build/gallery-aui-overlay-context-panel/assets/gallery-aui-overlay-context-panel-core.css
  55. +2 −2 build/gallery-aui-overlay-context-panel/assets/skins/sam/gallery-aui-overlay-context-panel.css
  56. +4 −5 build/gallery-aui-overlay-context-panel/gallery-aui-overlay-context-panel-debug.js
  57. +1 −1  build/gallery-aui-overlay-context-panel/gallery-aui-overlay-context-panel-min.js
  58. +4 −5 build/gallery-aui-overlay-context-panel/gallery-aui-overlay-context-panel.js
  59. +1 −1  build/gallery-aui-overlay-mask/assets/skins/sam/gallery-aui-overlay-mask.css
  60. +35 −11 build/gallery-aui-overlay-mask/gallery-aui-overlay-mask-debug.js
  61. +1 −1  build/gallery-aui-overlay-mask/gallery-aui-overlay-mask-min.js
  62. +35 −11 build/gallery-aui-overlay-mask/gallery-aui-overlay-mask.js
  63. +1 −1  build/gallery-aui-paginator/assets/skins/sam/gallery-aui-paginator.css
  64. +34 −26 build/gallery-aui-paginator/gallery-aui-paginator-debug.js
  65. +2 −2 build/gallery-aui-paginator/gallery-aui-paginator-min.js
  66. +34 −26 build/gallery-aui-paginator/gallery-aui-paginator.js
  67. +3 −4 build/gallery-aui-parse-content/gallery-aui-parse-content-debug.js
  68. +1 −1  build/gallery-aui-parse-content/gallery-aui-parse-content-min.js
  69. +3 −4 build/gallery-aui-parse-content/gallery-aui-parse-content.js
  70. +1 −1  build/gallery-aui-progressbar/assets/skins/sam/gallery-aui-progressbar.css
  71. +2 −2 build/gallery-aui-progressbar/gallery-aui-progressbar-debug.js
  72. +1 −1  build/gallery-aui-progressbar/gallery-aui-progressbar-min.js
  73. +2 −2 build/gallery-aui-progressbar/gallery-aui-progressbar.js
  74. +1 −1  build/gallery-aui-rating/assets/skins/sam/gallery-aui-rating.css
  75. +34 −27 build/gallery-aui-rating/gallery-aui-rating-debug.js
  76. +1 −1  build/gallery-aui-rating/gallery-aui-rating-min.js
  77. +34 −27 build/gallery-aui-rating/gallery-aui-rating.js
  78. +21 −2 build/gallery-aui-swf/gallery-aui-swf-debug.js
  79. +1 −1  build/gallery-aui-swf/gallery-aui-swf-min.js
  80. +21 −2 build/gallery-aui-swf/gallery-aui-swf.js
  81. +10 −0 build/gallery-aui-toolbar/assets/gallery-aui-toolbar-core.css
  82. +1 −1  build/gallery-aui-toolbar/assets/skins/sam/gallery-aui-toolbar.css
  83. +61 −5 build/gallery-aui-toolbar/gallery-aui-toolbar-debug.js
  84. +1 −1  build/gallery-aui-toolbar/gallery-aui-toolbar-min.js
  85. +61 −5 build/gallery-aui-toolbar/gallery-aui-toolbar.js
  86. +16 −1 build/gallery-aui-tree-data/gallery-aui-tree-data-debug.js
  87. +1 −1  build/gallery-aui-tree-data/gallery-aui-tree-data-min.js
  88. +16 −1 build/gallery-aui-tree-data/gallery-aui-tree-data.js
  89. +1 −1  build/gallery-aui-tree-node/gallery-aui-tree-node-debug.js
  90. +2 −2 build/gallery-aui-tree-node/gallery-aui-tree-node-min.js
  91. +1 −1  build/gallery-aui-tree-node/gallery-aui-tree-node.js
  92. +1 −1  build/gallery-aui-tree-view/assets/skins/sam/gallery-aui-tree-view.css
  93. +85 −39 build/gallery-aui-tree-view/gallery-aui-tree-view-debug.js
  94. +2 −2 build/gallery-aui-tree-view/gallery-aui-tree-view-min.js
  95. +85 −39 build/gallery-aui-tree-view/gallery-aui-tree-view.js
  96. +1 −1  build/gallery-aui-tree/gallery-aui-tree-debug.js
  97. +1 −1  build/gallery-aui-tree/gallery-aui-tree-min.js
  98. +1 −1  build/gallery-aui-tree/gallery-aui-tree.js
  99. +179 −70 build/gallery-checkboxgroups/gallery-checkboxgroups-debug.js
  100. +1 −1  build/gallery-checkboxgroups/gallery-checkboxgroups-min.js
  101. +179 −70 build/gallery-checkboxgroups/gallery-checkboxgroups.js
  102. +3 −3 build/gallery-jsonrpc/gallery-jsonrpc-debug.js
  103. +1 −1  build/gallery-jsonrpc/gallery-jsonrpc-min.js
  104. +3 −3 build/gallery-jsonrpc/gallery-jsonrpc.js
  105. +43 −4 build/gallery-node-extras/gallery-node-extras-debug.js
  106. +1 −1  build/gallery-node-extras/gallery-node-extras-min.js
  107. +43 −4 build/gallery-node-extras/gallery-node-extras.js
  108. BIN  build/gallery-paginator/assets/skins/sam/error.png
  109. +13 −0 build/gallery-paginator/assets/skins/sam/gallery-paginator-skin.css
  110. +1 −1  build/gallery-paginator/assets/skins/sam/gallery-paginator.css
  111. BIN  build/gallery-paginator/assets/skins/sam/warn.png
  112. +75 −1 build/gallery-paginator/gallery-paginator-debug.js
  113. +5 −4 build/gallery-paginator/gallery-paginator-min.js
  114. +75 −1 build/gallery-paginator/gallery-paginator.js
  115. +166 −0 build/gallery-patch-330-event-preventedfn/gallery-patch-330-event-preventedfn-debug.js
  116. +1 −0  build/gallery-patch-330-event-preventedfn/gallery-patch-330-event-preventedfn-min.js
  117. +166 −0 build/gallery-patch-330-event-preventedfn/gallery-patch-330-event-preventedfn.js
  118. +2 −2 build/gallery-progress-bar/gallery-progress-bar-debug.js
  119. +1 −1  build/gallery-progress-bar/gallery-progress-bar-min.js
  120. +2 −2 build/gallery-progress-bar/gallery-progress-bar.js
  121. +0 −5 build/gallery-querybuilder/assets/skins/sam/gallery-querybuilder-skin.css
  122. +1 −1  build/gallery-querybuilder/assets/skins/sam/gallery-querybuilder.css
  123. +34 −2 build/gallery-querybuilder/gallery-querybuilder-debug.js
  124. +2 −2 build/gallery-querybuilder/gallery-querybuilder-min.js
  125. +34 −2 build/gallery-querybuilder/gallery-querybuilder.js
View
4 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert-debug.js
@@ -335,6 +335,8 @@ Y.extend(Accordion, Y.Widget,
{
this.section_list = [];
+ this.get('allowAllClosed'); // force init of this.allow_all_closed
+
if (this.get('horizontal'))
{
this.slide_style_name = 'width';
@@ -1080,4 +1082,4 @@ Y.extend(Accordion, Y.Widget,
Y.Accordion = Accordion;
-}, 'gallery-2010.06.02-18-59' ,{optional:['anim-base'], requires:['widget','selector-css3']});
+}, 'gallery-2011.02.09-21-32' ,{optional:['anim-base'], requires:['widget','selector-css3']});
View
4 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert-min.js
@@ -1,2 +1,2 @@
-YUI.add("gallery-accordion-horiz-vert",function(B){var F=(0<B.UA.ie&&B.UA.ie<8),H=!(0<B.UA.ie&&B.UA.ie<8),J=(F?1:0);function G(K){if(arguments.length===0){return;}K=K||{};if(B.Lang.isUndefined(K.tabIndex)){K.tabIndex=null;}if(B.Lang.isUndefined(K.horizontal)){K.horizontal=false;}G.superclass.constructor.call(this,K);}function D(){return !B.Lang.isUndefined(B.Anim);}function E(K){return(K&&H&&!B.Lang.isUndefined(B.Anim));}G.NAME="accordion";G.ATTRS={horizontal:{value:false,writeOnce:true},titles:{writeOnce:true},replaceTitleContainer:{value:true,validator:B.Lang.isBoolean},sections:{writeOnce:true},replaceSectionContainer:{value:true,validator:B.Lang.isBoolean},allowAllClosed:{value:false,validator:B.Lang.isBoolean,setter:function(K){this.allow_all_closed=K;return K;}},allowMultipleOpen:{value:false,validator:B.Lang.isBoolean},animateRender:{value:false,writeOnce:true,validator:B.Lang.isBoolean,setter:E},animateInsertRemove:{valueFn:D,validator:B.Lang.isBoolean,setter:E},animateOpenClose:{valueFn:D,validator:B.Lang.isBoolean,setter:E},animateDuration:{value:null,validator:function(K){return(K===null||B.Lang.isNumber(K));}},animateEasing:{value:null,validator:function(K){return(K===null||B.Lang.isFunction(K));}}};G.HTML_PARSER={titles:function(K){return K.all("li div:nth-child(1)");},sections:function(K){return K.all("li div:nth-child(2)");}};var A=B.ClassNameManager.getClassName(G.NAME,"open");var C=B.ClassNameManager.getClassName(G.NAME,"closed");function I(K){B.Event.purgeElement(K,true);while(K.hasChildNodes()){K.removeChild(K.lastChild);}}B.extend(G,B.Widget,{initializer:function(K){this.section_list=[];if(this.get("horizontal")){this.slide_style_name="width";this.slide_size_name="offsetWidth";this.fixed_style_name="height";this.fixed_size_name="offsetHeight";}else{this.slide_style_name="height";this.slide_size_name="offsetHeight";this.fixed_style_name="width";this.fixed_size_name="offsetWidth";}this.after("allowMultipleOpenChange",function(L){if(this.section_list&&this.section_list.length>0&&!L.newVal){this.closeAllSections();}});this.after("allowAllClosedChange",function(L){if(this.section_list&&this.section_list.length>0&&!L.newVal&&this.allSectionsClosed()){this.toggleSection(0);}});},renderUI:function(){this.get("boundingBox").addClass(this.getClassName(this.get("horizontal")?"horiz":"vert"));var N=this.get("titles");if(B.Lang.isString(N)){N=B.all(N);}var O=this.get("sections");if(B.Lang.isString(O)){O=B.all(O);}if(N instanceof B.NodeList&&O instanceof B.NodeList&&N.size()==O.size()){var L=this.get("animateInsertRemove");this.set("animateInsertRemove",this.get("animateRender"));var M=N.size();for(var K=0;K<M;K++){this.appendSection(N.item(K),O.item(K));}this.set("animateInsertRemove",L);}else{if(N instanceof Array&&O instanceof Array&&N.length==O.length){var L=this.get("animateInsertRemove");this.set("animateInsertRemove",this.get("animateRender"));var M=N.length;for(var K=0;K<M;K++){this.appendSection(N[K],O[K]);}this.set("animateInsertRemove",L);}else{}}},getSectionCount:function(){return this.section_list.length;},getTitle:function(K){return this.section_list[K].title;},setTitle:function(K,O){var L=this.section_list[K].title;I(L);var M;if(B.Lang.isString(O)){var M=B.one(O);if(!M){L.set("innerHTML",O);}}else{M=O;}if(M&&this.get("replaceTitleContainer")){var N=L.get("parentNode");N.removeChild(L);N.appendChild(M);this.section_list[K].title=M;M.addClass(this.getClassName("title"));M.addClass(this.section_list[K].open?A:C);}else{if(M){L.appendChild(M);}}if(F){L.setStyle("display",L.get("innerHTML")?"":"none");}},getSection:function(K){return this.section_list[K].content;},setSection:function(K,M){var P=this.section_list[K].content;I(P);var L;if(B.Lang.isString(M)){var L=B.one(M);if(!L){P.set("innerHTML",M);}}else{L=M;}if(L&&this.get("replaceSectionContainer")){var O=P.getStyle("display");var N=P.get("parentNode");N.removeChild(P);N.appendChild(L);this.section_list[K].content=L;L.addClass(this.getClassName("section"));L.addClass(this.section_list[K].open?A:C);L.setStyle("display",O);}else{if(L){P.appendChild(L);}}},_getClip:function(K){return this.section_list[K].clip;},prependSection:function(L,K){return this.insertSection(0,L,K);},appendSection:function(L,K){return this.insertSection(this.section_list.length,L,K);},insertSection:function(M,Q,N){this.fire("beforeInsert",M);var R=B.Node.create("<div/>");R.addClass(this.getClassName("title"));R.addClass(C);var P=B.Node.create("<div/>");P.addClass(this.getClassName("section-clip"));P.setStyle(this.slide_style_name,J+"px");if(this.get("animateOpenClose")){P.setStyle("opacity",0);}var O=B.Node.create("<div/>");O.addClass(this.getClassName("section"));O.addClass(C);O.setStyle("display","none");P.appendChild(O);this.section_list.splice(M,0,{title:R,clip:P,content:O,open:false,anim:null});if(M<this.section_list.length-1){this.get("contentBox").insertBefore(R,this.section_list[M+1].title);}else{this.get("contentBox").appendChild(R);}this.setTitle(M,Q);R=this.section_list[M].title;var S=R.get(this.slide_size_name);if(this.get("animateInsertRemove")){R.setStyle(this.slide_style_name,J+"px");var L={node:R,from:{opacity:0},to:{opacity:1}};L.to[this.slide_style_name]=S;var K=this._createAnimator(L);K.on("end",function(U,T){this.section_list[T].title.setStyle(this.slide_style_name,"auto");},this,M);K.run();}if(N){this.setSection(M,N);O=this.section_list[M].content;}if(M<this.section_list.length-1){this.get("contentBox").insertBefore(P,this.section_list[M+1].title);}else{this.get("contentBox").appendChild(P);}this.fire("insert",M,S);if(!this.allow_all_closed&&this.allSectionsClosed()){this.toggleSection(0);}return{title:R,content:O};},removeSection:function(M){this.fire("beforeRemove",M);function K(Q,P){P[0].removeChild(P[1]);P[0].removeChild(P[2]);}var L=[this.get("contentBox"),this.section_list[M].title,this.section_list[M].clip];if(this.get("animateInsertRemove")){var O={node:this.section_list[M].clip,from:{opacity:1},to:{opacity:0}};O.to[this.slide_style_name]=J;
-if(this.section_list[M].open){this._startAnimator(M,O);}O.node=this.section_list[M].title;var N=this._createAnimator(O);N.on("end",K,null,L);N.run();}else{K(null,L);}this.section_list.splice(M,1);if(!this.allow_all_closed&&this.allSectionsClosed()){this.toggleSection(0);}this.fire("remove",M);},findSection:function(L){L=B.Node.getDOMNode(B.one(L));var N=this.section_list.length;for(var K=0;K<N;K++){var O=B.Node.getDOMNode(this.section_list[K].title);var M=B.Node.getDOMNode(this.section_list[K].content);if(L==O||B.DOM.contains(O,L)||L==M||B.DOM.contains(M,L)){return K;}}return false;},isSectionOpen:function(K){return this.section_list[K].open;},openSection:function(K){if(!this.section_list[K].open){this.toggleSection(K);}},closeSection:function(K){if(this.section_list[K].open){this.toggleSection(K);}},allSectionsOpen:function(){var L=this.section_list.length;for(var K=0;K<L;K++){if(!this.section_list[K].open){return false;}}return true;},allSectionsClosed:function(){var L=this.section_list.length;for(var K=0;K<L;K++){if(this.section_list[K].open){return false;}}return true;},toggleSection:function(K){if(!this.section_list[K].open&&!this.get("allowMultipleOpen")){var N=this.allow_all_closed;this.allow_all_closed=true;this.closeAllSections();this.allow_all_closed=N;}else{if(this.section_list[K].open&&!this.allow_all_closed){this.section_list[K].open=false;if(this.allSectionsClosed()){this.section_list[K].open=true;return;}this.section_list[K].open=true;}}function P(T,S){this.section_list[S].clip.setStyle(this.slide_style_name,"auto");this.fire("open",S);}function R(T,S){this.section_list[S].content.setStyle("display","none");this.fire("close",S);}if(!this.section_list[K].open){this.section_list[K].content.setStyle("display","block");this.fire("beforeOpen",K);this.section_list[K].open=true;this.section_list[K].title.replaceClass(C,A);this.section_list[K].content.replaceClass(C,A);var L=this.section_list[K].content.get(this.slide_size_name);if(this.get("animateOpenClose")){var Q={node:this.section_list[K].clip,from:{opacity:0},to:{opacity:1}};Q.to[this.slide_style_name]=L;var O=this._startAnimator(K,Q);O.on("end",P,this,K);}else{var M=this.section_list[K].clip;if(M.getStyle("opacity")=="0"){M.setStyle("opacity",1);}P.call(this,null,K);}}else{this.fire("beforeClose",K);this.section_list[K].open=false;this.section_list[K].title.replaceClass(A,C);this.section_list[K].content.replaceClass(A,C);if(this.get("animateOpenClose")){var Q={node:this.section_list[K].clip,from:{opacity:1},to:{opacity:0}};Q.to[this.slide_style_name]=J;var O=this._startAnimator(K,Q);O.on("end",R,this,K);}else{this.section_list[K].clip.setStyle(this.slide_style_name,J+"px");R.call(this,null,K);}}},openAllSections:function(){if(this.get("allowMultipleOpen")){var L=this.section_list.length;for(var K=0;K<L;K++){if(!this.section_list[K].open){this.toggleSection(K);}}}},closeAllSections:function(){var L=this.section_list.length;var M=true;for(var K=0;K<L;K++){if(this.section_list[K].open){if(!this.allow_all_closed&&M){M=false;}else{this.toggleSection(K);}}}if(!this.allow_all_closed&&M){this.toggleSection(0);}},_createAnimator:function(L){var K=this.get("animateDuration");if(K!==null){L.duration=K;}var M=this.get("animateEasing");if(M!==null){L.easing=M;}return new B.Anim(L);},_startAnimator:function(K,M){var L=this.section_list[K].anim;if(L){L.stop(true);}this.section_list[K].anim=L=this._createAnimator(M);L.on("end",function(O,N,P){if(N<this.section_list.length&&this.section_list[N].anim==P){this.section_list[N].anim=null;}},this,K,L);L.run();return L;}});B.Accordion=G;},"gallery-2010.06.02-18-59",{optional:["anim-base"],requires:["widget","selector-css3"]});
+YUI.add("gallery-accordion-horiz-vert",function(b){var f=(0<b.UA.ie&&b.UA.ie<8),h=!(0<b.UA.ie&&b.UA.ie<8),j=(f?1:0);function g(k){if(arguments.length===0){return;}k=k||{};if(b.Lang.isUndefined(k.tabIndex)){k.tabIndex=null;}if(b.Lang.isUndefined(k.horizontal)){k.horizontal=false;}g.superclass.constructor.call(this,k);}function d(){return !b.Lang.isUndefined(b.Anim);}function e(k){return(k&&h&&!b.Lang.isUndefined(b.Anim));}g.NAME="accordion";g.ATTRS={horizontal:{value:false,writeOnce:true},titles:{writeOnce:true},replaceTitleContainer:{value:true,validator:b.Lang.isBoolean},sections:{writeOnce:true},replaceSectionContainer:{value:true,validator:b.Lang.isBoolean},allowAllClosed:{value:false,validator:b.Lang.isBoolean,setter:function(k){this.allow_all_closed=k;return k;}},allowMultipleOpen:{value:false,validator:b.Lang.isBoolean},animateRender:{value:false,writeOnce:true,validator:b.Lang.isBoolean,setter:e},animateInsertRemove:{valueFn:d,validator:b.Lang.isBoolean,setter:e},animateOpenClose:{valueFn:d,validator:b.Lang.isBoolean,setter:e},animateDuration:{value:null,validator:function(k){return(k===null||b.Lang.isNumber(k));}},animateEasing:{value:null,validator:function(k){return(k===null||b.Lang.isFunction(k));}}};g.HTML_PARSER={titles:function(k){return k.all("li div:nth-child(1)");},sections:function(k){return k.all("li div:nth-child(2)");}};var a=b.ClassNameManager.getClassName(g.NAME,"open");var c=b.ClassNameManager.getClassName(g.NAME,"closed");function i(k){b.Event.purgeElement(k,true);while(k.hasChildNodes()){k.removeChild(k.lastChild);}}b.extend(g,b.Widget,{initializer:function(k){this.section_list=[];this.get("allowAllClosed");if(this.get("horizontal")){this.slide_style_name="width";this.slide_size_name="offsetWidth";this.fixed_style_name="height";this.fixed_size_name="offsetHeight";}else{this.slide_style_name="height";this.slide_size_name="offsetHeight";this.fixed_style_name="width";this.fixed_size_name="offsetWidth";}this.after("allowMultipleOpenChange",function(l){if(this.section_list&&this.section_list.length>0&&!l.newVal){this.closeAllSections();}});this.after("allowAllClosedChange",function(l){if(this.section_list&&this.section_list.length>0&&!l.newVal&&this.allSectionsClosed()){this.toggleSection(0);}});},renderUI:function(){this.get("boundingBox").addClass(this.getClassName(this.get("horizontal")?"horiz":"vert"));var n=this.get("titles");if(b.Lang.isString(n)){n=b.all(n);}var o=this.get("sections");if(b.Lang.isString(o)){o=b.all(o);}if(n instanceof b.NodeList&&o instanceof b.NodeList&&n.size()==o.size()){var l=this.get("animateInsertRemove");this.set("animateInsertRemove",this.get("animateRender"));var m=n.size();for(var k=0;k<m;k++){this.appendSection(n.item(k),o.item(k));}this.set("animateInsertRemove",l);}else{if(n instanceof Array&&o instanceof Array&&n.length==o.length){var l=this.get("animateInsertRemove");this.set("animateInsertRemove",this.get("animateRender"));var m=n.length;for(var k=0;k<m;k++){this.appendSection(n[k],o[k]);}this.set("animateInsertRemove",l);}else{}}},getSectionCount:function(){return this.section_list.length;},getTitle:function(k){return this.section_list[k].title;},setTitle:function(k,o){var l=this.section_list[k].title;i(l);var m;if(b.Lang.isString(o)){var m=b.one(o);if(!m){l.set("innerHTML",o);}}else{m=o;}if(m&&this.get("replaceTitleContainer")){var n=l.get("parentNode");n.removeChild(l);n.appendChild(m);this.section_list[k].title=m;m.addClass(this.getClassName("title"));m.addClass(this.section_list[k].open?a:c);}else{if(m){l.appendChild(m);}}if(f){l.setStyle("display",l.get("innerHTML")?"":"none");}},getSection:function(k){return this.section_list[k].content;},setSection:function(k,m){var q=this.section_list[k].content;i(q);var l;if(b.Lang.isString(m)){var l=b.one(m);if(!l){q.set("innerHTML",m);}}else{l=m;}if(l&&this.get("replaceSectionContainer")){var o=q.getStyle("display");var n=q.get("parentNode");n.removeChild(q);n.appendChild(l);this.section_list[k].content=l;l.addClass(this.getClassName("section"));l.addClass(this.section_list[k].open?a:c);l.setStyle("display",o);}else{if(l){q.appendChild(l);}}},_getClip:function(k){return this.section_list[k].clip;},prependSection:function(l,k){return this.insertSection(0,l,k);},appendSection:function(l,k){return this.insertSection(this.section_list.length,l,k);},insertSection:function(m,q,n){this.fire("beforeInsert",m);var r=b.Node.create("<div/>");r.addClass(this.getClassName("title"));r.addClass(c);var p=b.Node.create("<div/>");p.addClass(this.getClassName("section-clip"));p.setStyle(this.slide_style_name,j+"px");if(this.get("animateOpenClose")){p.setStyle("opacity",0);}var o=b.Node.create("<div/>");o.addClass(this.getClassName("section"));o.addClass(c);o.setStyle("display","none");p.appendChild(o);this.section_list.splice(m,0,{title:r,clip:p,content:o,open:false,anim:null});if(m<this.section_list.length-1){this.get("contentBox").insertBefore(r,this.section_list[m+1].title);}else{this.get("contentBox").appendChild(r);}this.setTitle(m,q);r=this.section_list[m].title;var s=r.get(this.slide_size_name);if(this.get("animateInsertRemove")){r.setStyle(this.slide_style_name,j+"px");var l={node:r,from:{opacity:0},to:{opacity:1}};l.to[this.slide_style_name]=s;var k=this._createAnimator(l);k.on("end",function(u,t){this.section_list[t].title.setStyle(this.slide_style_name,"auto");},this,m);k.run();}if(n){this.setSection(m,n);o=this.section_list[m].content;}if(m<this.section_list.length-1){this.get("contentBox").insertBefore(p,this.section_list[m+1].title);}else{this.get("contentBox").appendChild(p);}this.fire("insert",m,s);if(!this.allow_all_closed&&this.allSectionsClosed()){this.toggleSection(0);}return{title:r,content:o};},removeSection:function(m){this.fire("beforeRemove",m);function k(q,p){p[0].removeChild(p[1]);p[0].removeChild(p[2]);}var l=[this.get("contentBox"),this.section_list[m].title,this.section_list[m].clip];if(this.get("animateInsertRemove")){var o={node:this.section_list[m].clip,from:{opacity:1},to:{opacity:0}};
+o.to[this.slide_style_name]=j;if(this.section_list[m].open){this._startAnimator(m,o);}o.node=this.section_list[m].title;var n=this._createAnimator(o);n.on("end",k,null,l);n.run();}else{k(null,l);}this.section_list.splice(m,1);if(!this.allow_all_closed&&this.allSectionsClosed()){this.toggleSection(0);}this.fire("remove",m);},findSection:function(l){l=b.Node.getDOMNode(b.one(l));var n=this.section_list.length;for(var k=0;k<n;k++){var o=b.Node.getDOMNode(this.section_list[k].title);var m=b.Node.getDOMNode(this.section_list[k].content);if(l==o||b.DOM.contains(o,l)||l==m||b.DOM.contains(m,l)){return k;}}return false;},isSectionOpen:function(k){return this.section_list[k].open;},openSection:function(k){if(!this.section_list[k].open){this.toggleSection(k);}},closeSection:function(k){if(this.section_list[k].open){this.toggleSection(k);}},allSectionsOpen:function(){var l=this.section_list.length;for(var k=0;k<l;k++){if(!this.section_list[k].open){return false;}}return true;},allSectionsClosed:function(){var l=this.section_list.length;for(var k=0;k<l;k++){if(this.section_list[k].open){return false;}}return true;},toggleSection:function(k){if(!this.section_list[k].open&&!this.get("allowMultipleOpen")){var n=this.allow_all_closed;this.allow_all_closed=true;this.closeAllSections();this.allow_all_closed=n;}else{if(this.section_list[k].open&&!this.allow_all_closed){this.section_list[k].open=false;if(this.allSectionsClosed()){this.section_list[k].open=true;return;}this.section_list[k].open=true;}}function p(t,s){this.section_list[s].clip.setStyle(this.slide_style_name,"auto");this.fire("open",s);}function r(t,s){this.section_list[s].content.setStyle("display","none");this.fire("close",s);}if(!this.section_list[k].open){this.section_list[k].content.setStyle("display","block");this.fire("beforeOpen",k);this.section_list[k].open=true;this.section_list[k].title.replaceClass(c,a);this.section_list[k].content.replaceClass(c,a);var l=this.section_list[k].content.get(this.slide_size_name);if(this.get("animateOpenClose")){var q={node:this.section_list[k].clip,from:{opacity:0},to:{opacity:1}};q.to[this.slide_style_name]=l;var o=this._startAnimator(k,q);o.on("end",p,this,k);}else{var m=this.section_list[k].clip;if(m.getStyle("opacity")=="0"){m.setStyle("opacity",1);}p.call(this,null,k);}}else{this.fire("beforeClose",k);this.section_list[k].open=false;this.section_list[k].title.replaceClass(a,c);this.section_list[k].content.replaceClass(a,c);if(this.get("animateOpenClose")){var q={node:this.section_list[k].clip,from:{opacity:1},to:{opacity:0}};q.to[this.slide_style_name]=j;var o=this._startAnimator(k,q);o.on("end",r,this,k);}else{this.section_list[k].clip.setStyle(this.slide_style_name,j+"px");r.call(this,null,k);}}},openAllSections:function(){if(this.get("allowMultipleOpen")){var l=this.section_list.length;for(var k=0;k<l;k++){if(!this.section_list[k].open){this.toggleSection(k);}}}},closeAllSections:function(){var l=this.section_list.length;var m=true;for(var k=0;k<l;k++){if(this.section_list[k].open){if(!this.allow_all_closed&&m){m=false;}else{this.toggleSection(k);}}}if(!this.allow_all_closed&&m){this.toggleSection(0);}},_createAnimator:function(l){var k=this.get("animateDuration");if(k!==null){l.duration=k;}var m=this.get("animateEasing");if(m!==null){l.easing=m;}return new b.Anim(l);},_startAnimator:function(k,m){var l=this.section_list[k].anim;if(l){l.stop(true);}this.section_list[k].anim=l=this._createAnimator(m);l.on("end",function(o,n,p){if(n<this.section_list.length&&this.section_list[n].anim==p){this.section_list[n].anim=null;}},this,k,l);l.run();return l;}});b.Accordion=g;},"gallery-2011.02.09-21-32",{optional:["anim-base"],requires:["widget","selector-css3"]});
View
4 build/gallery-accordion-horiz-vert/gallery-accordion-horiz-vert.js
@@ -335,6 +335,8 @@ Y.extend(Accordion, Y.Widget,
{
this.section_list = [];
+ this.get('allowAllClosed'); // force init of this.allow_all_closed
+
if (this.get('horizontal'))
{
this.slide_style_name = 'width';
@@ -1079,4 +1081,4 @@ Y.extend(Accordion, Y.Widget,
Y.Accordion = Accordion;
-}, 'gallery-2010.06.02-18-59' ,{optional:['anim-base'], requires:['widget','selector-css3']});
+}, 'gallery-2011.02.09-21-32' ,{optional:['anim-base'], requires:['widget','selector-css3']});
View
112 build/gallery-animloop/gallery-animloop-debug.js
@@ -0,0 +1,112 @@
+YUI.add('gallery-animloop', function(Y) {
+
+/*
+ * Copyright (c) 2011 Nicholas C. Zakas. All rights reserved.
+ * http://www.nczonline.net/
+ */
+
+/**
+ * Animation loop for optimizing game animation control. Based on
+ * technique described at http://nokarma.org/2010/02/02/javascript-game-development-the-game-loop/.
+ * @module gallery-animloop
+ */
+/*global YUI*/
+
+//-----------------------------------------------------------------------------
+// Local Variables
+//-----------------------------------------------------------------------------
+
+var run = false, //determines if the loop should be executed
+ runLoop, //method that starts the loop
+ event = {type:"beforedraw"}, //event that fires before it's time to draw
+ AnimLoop; //main object
+
+//-----------------------------------------------------------------------------
+// Main Object
+//-----------------------------------------------------------------------------
+
+/**
+ * Represents an animation loop, set for optimal frames-per-second rates
+ * using either setInterval() or available requestAnimationFrame methods.
+ * In order to use, assign an event handler to the "beforedraw" event,
+ * this is where you should do any calculations for animation.
+ * @class AnimLoop
+ * @static
+ */
+AnimLoop = {
+
+ /**
+ * Starts the animation loop.
+ * @method start
+ * @return {void}
+ */
+ start: function(){
+ if (!run){
+ Y.log("Request to start animation loop.", "info", "AnimLoop");
+ run = true;
+ runLoop();
+ }
+ },
+
+ /**
+ * Stops the animation loop by setting the run variable to false.
+ * The next time a draw happens, this flag is checked and the
+ * animation loop will be aborted.
+ * @method stop
+ * @return {void}
+ */
+ stop: function(){
+ Y.log("Request to stop animation loop.", "info", "AnimLoop");
+ run = false;
+ }
+};
+
+//inherit custom events
+Y.augment(AnimLoop, Y.Event.Target);
+
+//determine the best function to use for drawing
+runLoop = (function(){
+ var innerFunction,
+ intervalId;
+ if (window.mozRequestAnimationFrame){
+ innerFunction = function() {
+ if (run){
+ Y.log("Running using mozRequestAnimationFrame.", "info", "AnimLoop");
+
+ AnimLoop.fire(event);
+ window.mozRequestAnimationFrame(innerFunction);
+ }
+ Y.log("Stopping animation loop.", "info", "AnimLoop");
+ };
+ } else if (window.webkitRequestAnimationFrame){
+ innerFunction = function() {
+ if (run){
+ Y.log("Running using webkitRequestAnimationFrame.", "info", "AnimLoop");
+ AnimLoop.fire(event);
+ window.webkitRequestAnimationFrame(innerFunction);
+ }
+ };
+ Y.log("Stopping animation loop.", "info", "AnimLoop");
+ } else {
+ innerFunction = function(){
+ intervalId = setInterval(function(){
+ if (run){
+ Y.log("Running using setInterval.", "info", "AnimLoop");
+ AnimLoop.fire(event);
+ } else {
+ Y.log("Stopping animation loop.", "info", "AnimLoop");
+ clearInterval(intervalId);
+ }
+ }, 1000 / 60);
+
+ }
+ }
+
+ return innerFunction;
+})();
+
+//export
+Y.AnimLoop = AnimLoop;
+
+
+}, 'gallery-2011.02.09-21-32' ,{requires:['event-base','event-custom-base']});
View
1  build/gallery-animloop/gallery-animloop-min.js
@@ -0,0 +1 @@
+YUI.add("gallery-animloop",function(d){var c=false,b,a={type:"beforedraw"},e;e={start:function(){if(!c){c=true;b();}},stop:function(){c=false;}};d.augment(e,d.Event.Target);b=(function(){var f,g;if(window.mozRequestAnimationFrame){f=function(){if(c){e.fire(a);window.mozRequestAnimationFrame(f);}};}else{if(window.webkitRequestAnimationFrame){f=function(){if(c){e.fire(a);window.webkitRequestAnimationFrame(f);}};}else{f=function(){g=setInterval(function(){if(c){e.fire(a);}else{clearInterval(g);}},1000/60);};}}return f;})();d.AnimLoop=e;},"gallery-2011.02.09-21-32",{requires:["event-base","event-custom-base"]});
View
104 build/gallery-animloop/gallery-animloop.js
@@ -0,0 +1,104 @@
+YUI.add('gallery-animloop', function(Y) {
+
+/*
+ * Copyright (c) 2011 Nicholas C. Zakas. All rights reserved.
+ * http://www.nczonline.net/
+ */
+
+/**
+ * Animation loop for optimizing game animation control. Based on
+ * technique described at http://nokarma.org/2010/02/02/javascript-game-development-the-game-loop/.
+ * @module gallery-animloop
+ */
+/*global YUI*/
+
+//-----------------------------------------------------------------------------
+// Local Variables
+//-----------------------------------------------------------------------------
+
+var run = false, //determines if the loop should be executed
+ runLoop, //method that starts the loop
+ event = {type:"beforedraw"}, //event that fires before it's time to draw
+ AnimLoop; //main object
+
+//-----------------------------------------------------------------------------
+// Main Object
+//-----------------------------------------------------------------------------
+
+/**
+ * Represents an animation loop, set for optimal frames-per-second rates
+ * using either setInterval() or available requestAnimationFrame methods.
+ * In order to use, assign an event handler to the "beforedraw" event,
+ * this is where you should do any calculations for animation.
+ * @class AnimLoop
+ * @static
+ */
+AnimLoop = {
+
+ /**
+ * Starts the animation loop.
+ * @method start
+ * @return {void}
+ */
+ start: function(){
+ if (!run){
+ run = true;
+ runLoop();
+ }
+ },
+
+ /**
+ * Stops the animation loop by setting the run variable to false.
+ * The next time a draw happens, this flag is checked and the
+ * animation loop will be aborted.
+ * @method stop
+ * @return {void}
+ */
+ stop: function(){
+ run = false;
+ }
+};
+
+//inherit custom events
+Y.augment(AnimLoop, Y.Event.Target);
+
+//determine the best function to use for drawing
+runLoop = (function(){
+ var innerFunction,
+ intervalId;
+ if (window.mozRequestAnimationFrame){
+ innerFunction = function() {
+ if (run){
+
+ AnimLoop.fire(event);
+ window.mozRequestAnimationFrame(innerFunction);
+ }
+ };
+ } else if (window.webkitRequestAnimationFrame){
+ innerFunction = function() {
+ if (run){
+ AnimLoop.fire(event);
+ window.webkitRequestAnimationFrame(innerFunction);
+ }
+ };
+ } else {
+ innerFunction = function(){
+ intervalId = setInterval(function(){
+ if (run){
+ AnimLoop.fire(event);
+ } else {
+ clearInterval(intervalId);
+ }
+ }, 1000 / 60);
+
+ }
+ }
+
+ return innerFunction;
+})();
+
+//export
+Y.AnimLoop = AnimLoop;
+
+
+}, 'gallery-2011.02.09-21-32' ,{requires:['event-base','event-custom-base']});
View
2  build/gallery-aui-autocomplete/assets/skins/sam/gallery-aui-autocomplete.css
@@ -1 +1 @@
-.yui3-autocomplete-trigger{cursor:pointer;display:inline-block;float:none;}.yui3-autocomplete-list-item{border:1px solid #fff;list-style:none;margin:0;padding:0 3px;}.yui3-autocomplete-results-content{border:1px solid #98c0f4;height:100%;overflow-y:auto;}.yui3-autocomplete-selected{background:#dfe8f6;border-color:#a3bae9;}
+.yui3-autocomplete-trigger{cursor:pointer;display:inline-block;float:none}.yui3-autocomplete-list-item{border:1px solid #fff;list-style:none;margin:0;padding:0 3px}.yui3-autocomplete-results-content{border:1px solid #98c0f4;height:100%;overflow-y:auto}.yui3-autocomplete-selected{background:#dfe8f6;border-color:#a3bae9}
View
15 build/gallery-aui-autocomplete/gallery-aui-autocomplete-debug.js
@@ -640,6 +640,19 @@ var AutoComplete = A.Component.create(
},
/**
+ * Descructor lifecycle implementation for the Autocomplete class.
+ * Purges events attached to the node (and all child nodes).
+ *
+ * @method destructor
+ * @protected
+ */
+ destructor: function() {
+ var instance = this;
+
+ instance.overlay.destroy();
+ },
+
+ /**
* An overridable method that is executed before the result container is shown.
* The method can return false to prevent the container from being shown.
*
@@ -2093,4 +2106,4 @@ var AutoComplete = A.Component.create(
A.AutoComplete = AutoComplete;
-}, 'gallery-2010.08.18-17-12' ,{skinnable:true, requires:['gallery-aui-base','gallery-aui-overlay-base','datasource','dataschema','gallery-aui-form-combobox']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['gallery-aui-base','gallery-aui-overlay-base','datasource','dataschema','gallery-aui-form-combobox'], skinnable:true});
View
6 build/gallery-aui-autocomplete/gallery-aui-autocomplete-min.js
@@ -1,3 +1,3 @@
-YUI.add("gallery-aui-autocomplete",function(M){var y=M.Lang,V=y.isArray,J=y.isString,n=y.isNull,O=y.isFunction,x=M.ClassNameManager.getClassName,j="alert",h="content",p="helper",q="hidden",c="icon",v="item",k="list",R="loading",f="autocomplete",r="reset",t="results",a="selected",S="circle-triangle-b",i=j,D=R,C=x(f,a),s=x(p,q),H=x(f,k,v),o=x(p,r),B=x(f,t),U=x(f,t,h),Q=8,m=9,d=13,K=16,E=17,F=18,P=20,e=27,I=33,L=35,Y=36,l=38,X=40,W=39,T=37,g=44,w=44,G=229,Z={node:null,points:["tl","bl"]},u="boundingBox",b="contentBox";var N=M.Component.create({NAME:f,ATTRS:{alwaysShowContainer:{value:false},autoHighlight:{value:true},applyLocalFilter:{value:null},button:{value:true},dataSource:{value:null},dataSourceType:{value:null},delimChar:{value:null,setter:function(A){if(J(A)&&(A.length>0)){A=[A];}else{if(!V(A)){A=M.Attribute.INVALID_VALUE;}}return A;}},forceSelection:{value:false},input:{value:null},matchKey:{value:0},maxResultsDisplayed:{value:10},minQueryLength:{value:1},queryDelay:{value:0.2,getter:function(A){return A*1000;}},queryInterval:{value:0.5,getter:function(A){return A*1000;}},queryMatchCase:{value:false},queryMatchContains:{value:false},queryQuestionMark:{value:true},schema:{value:null},schemaType:{value:"",validator:J},suppressInputUpdate:{value:false},typeAhead:{value:false},typeAheadDelay:{value:0.2,getter:function(A){return A*1000;}},uniqueName:{value:null}},prototype:{initializer:function(z){var A=this;A._overlayAlign=M.mix({},Z);A._createDataSource();},renderUI:function(){var A=this;A._renderInput();A._renderOverlay();},bindUI:function(){var A=this;var z=A.button;var AA=A.inputNode;A.dataSource.on("request",M.bind(z.set,z,c,D));AA.on("blur",A._onTextboxBlur,A);AA.on("focus",A._onTextboxFocus,A);AA.on("keydown",A._onTextboxKeyDown,A);AA.on("keypress",A._onTextboxKeyPress,A);AA.on("keyup",A._onTextboxKeyUp,A);var AB=A.overlay.get(u);AB.on("click",A._onContainerClick,A);AB.on("mouseout",A._onContainerMouseout,A);AB.on("mouseover",A._onContainerMouseover,A);AB.on("scroll",A._onContainerScroll,A);A.publish("containerCollapse");A.publish("containerExpand");A.publish("containerPopulate");A.publish("dataError");A.publish("dataRequest");A.publish("dataReturn");A.publish("itemArrowFrom");A.publish("itemArrowTo");A.publish("itemMouseOut");A.publish("itemMouseOver");A.publish("itemSelect");A.publish("selectionEnforce");A.publish("textboxBlur");A.publish("textboxChange");A.publish("textboxFocus");A.publish("textboxKey");A.publish("typeAhead");A.publish("unmatchedItemSelect");A.overlay.after("visibleChange",A._realignContainer,A);},syncUI:function(){var A=this;A.inputNode.setAttribute("autocomplete","off");},doBeforeExpandContainer:function(){return true;},doBeforeLoadData:function(A){return true;},filterResults:function(AJ){var AP=this;var AA=AJ.callback;var AB=AJ.request;var z=AJ.response;if(AA&&AA.argument&&AA.argument.query){AB=AA.argument.query;}if(AB){var AO=AP.dataSource;var AL=z.results;var A=[];var AD=false;var AC=AP.get("matchKey");var AM=AP.get("queryMatchCase");var AH=AP.get("queryMatchContains");var AG=(AB=="*");var AI=AP.get("schema.resultFields");for(var AK=AL.length-1;AK>=0;AK--){var AF=AL[AK];var AN=null;if(J(AF)){AN=AF;}else{if(V(AF)){AN=AF[0];}else{if(AI){AN=AF[AC||AI[0]];}}}if(J(AN)){var AE=-1;if(AM){AE=AN.indexOf(decodeURIComponent(AB));}else{AE=AN.toLowerCase().indexOf(decodeURIComponent(AB).toLowerCase());}if((AG)||(!AH&&(AE===0))||(AH&&(AE>-1))){A.unshift(AF);}}}z.results=A;}return z;},formatResult:function(z,AA,A){return A||"";},generateRequest:function(A){return{request:A};},handleResponse:function(AA){var z=this;z._populateList(AA);var A=S;if(AA.error){A=i;}z.button.set(c,A);},sendQuery:function(z){var A=this;A.set("focused",null);var AA=z;if(A.get("delimChar")){z=A.inputNode.get("value")+z;}A._sendQuery(AA);},_clearInterval:function(){var A=this;if(A._queryIntervalId){clearInterval(A._queryIntervalId);A._queryIntervalId=null;}},_clearSelection:function(){var z=this;var AA=z.get("delimChar");var A={previous:"",query:z.inputNode.get("value")};if(AA){A=z._extractQuery(z.inputNode.get("value"));}z.fire("selectionEnforce",A.query);},_createDataSource:function(){var A=this;A._queryTask=new M.DelayedTask(A.sendQuery,A);var AE=A.get("dataSource");var AC=AE;var AD=A.get("dataSourceType");if(!(AE instanceof M.DataSource.Local)){if(!AD){AD="Local";if(O(AC)){AD="Function";}else{if(J(AC)){AD="IO";}}}AE=new M.DataSource[AD]({source:AC});}AE.on("error",A.handleResponse,A);AE.after("response",A.handleResponse,A);AD=AE.name;if(AD=="dataSourceLocal"){A.set("applyLocalFilter",true);}A.set("dataSource",AE);A.set("dataSource",AD);A.dataSource=AE;var AB=A.get("schema");if(AB){if(AB.fn){A.dataSource.plug(AB);}else{var z=A.get("schemaType");var AA={array:M.Plugin.DataSourceArraySchema,json:M.Plugin.DataSourceJSONSchema,text:M.Plugin.DataSourceTextSchema,xml:M.Plugin.DataSourceXMLSchema};z=z.toLowerCase()||"array";A.dataSource.plug({fn:AA[z],cfg:{schema:AB}});}}A.set("schema",AB);},_enableIntervalDetection:function(){var A=this;var z=A.get("queryInterval");if(!A._queryIntervalId&&z){A._queryInterval=setInterval(M.bind(A._onInterval,A),z);}},_extractQuery:function(AC){var AG=this;var AE=AG.get("delimChar");var A=-1;var AA=AE.length-1;var AF,AD,AB;for(;AA>=0;AA--){AF=AC.lastIndexOf(AE[AA]);if(AF>A){A=AF;}}if(AE[AA]==" "){for(var z=AE.length-1;z>=0;z--){if(AC[A-1]==AE[z]){A--;break;}}}if(A>-1){AD=A+1;while(AC.charAt(AD)==" "){AD+=1;}AB=AC.substring(0,AD);AC=AC.substring(AD);}else{AB="";}return{previous:AB,query:AC};},_focus:function(){var A=this;setTimeout(function(){A.inputNode.focus();},0);},_isIgnoreKey:function(z){var A=this;if((z==m)||(z==d)||(z==K)||(z==E)||(z>=F&&z<=P)||(z==e)||(z>=I&&z<=L)||(z>=Y&&z<=X)||(z>=g&&z<=w)||(z==G)){return true;}return false;},_jumpSelection:function(){var A=this;if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}},_moveSelection:function(AL){var AI=this;if(AI.overlay.get("visible")){var AM=AI._elCurListItem;var z=-1;if(AM){z=Number(AM.getAttribute("data-listItemIndex"));
-}var AA=z-1;if(AL==X){AA=z+1;}if(AA==-1){AA=AI._displayedItems-1;}if(AA>=AI._displayedItems){AA=0;}if(AA<-2){return;}if(AM){AI._toggleHighlight(AM,"from");AI.fire("itemArrowFrom",AM);}if(AA==-1){if(AI.get("delimChar")){AI.inputNode.set("value",AI._pastSelections+AI._currentQuery);}else{AI.inputNode.set("value",AI._currentQuery);}return;}if(AA==-2){AI._toggleContainer(false);return;}var AE=AI.resultList.get("childNodes").item(AA);var AC=AI.overlay.get(b);var AG=AC.getStyle("overflow");var AJ=AC.getStyle("overflowY");var AB=(AG=="auto")||(AG=="scroll")||(AJ=="auto")||(AJ=="scroll");if(AB&&(AA>-1)&&(AA<AI._displayedItems)){var A=-1;var AN=AE.get("offsetTop");var AD=AN+AE.get("offsetHeight");var AH=AC.get("offsetHeight");var AF=AC.get("scrollTop");var AK=AH+AF;if(AL==X){if(AD>AK){A=(AD-AH);}else{if(AD<AF){A=AN;}}}else{if(AN<AH){A=AN;}else{if(AN>AK){A=(AD-AH);}}}if(A>-1){AC.set("scrollTop",A);}}AI._toggleHighlight(AE,"to");AI.fire("itemArrowTo",AE);if(AI.get("typeAhead")){AI._updateValue(AE);}}},_onButtonMouseDown:function(z){var A=this;z.halt();A._focus();A._sendQuery(A.inputNode.get("value")+"*");},_onContainerClick:function(AA){var A=this;var AB=AA.target;var z=AB.get("nodeName").toLowerCase();AA.halt();while(AB&&(z!="table")){switch(z){case"body":return;case"li":A._toggleHighlight(AB,"to");A._selectItem(AB);return;default:break;}AB=AB.get("parentNode");if(AB){z.get("nodeName").toLowerCase();}}},_onContainerMouseout:function(AA){var A=this;var AB=AA.target;var z=AB.get("nodeName").toLowerCase();while(AB&&(z!="table")){switch(z){case"body":return;case"li":A._toggleHighlight(AB,"from");A.fire("itemMouseOut",AB);break;case"ul":A._toggleHighlight(A._elCurListItem,"to");break;case"div":if(AB.hasClass(B)){A._overContainer=false;return;}break;default:break;}AB=AB.get("parentNode");if(AB){z=AB.get("nodeName").toLowerCase();}}},_onContainerMouseover:function(AA){var A=this;var AB=AA.target;var z=AB.get("nodeName").toLowerCase();while(AB&&(z!="table")){switch(z){case"body":return;case"li":A._toggleHighlight(AB,"to");A.fire("itemMouseOut",AB);break;case"div":if(AB.hasClass(B)){A._overContainer=true;return;}break;default:break;}AB=AB.get("parentNode");if(AB){z=AB.get("nodeName").toLowerCase();}}},_onContainerScroll:function(z){var A=this;A._focus();},_onInterval:function(){var A=this;var AA=A.inputNode.get("value");var z=A._lastValue;if(AA!=z){A._lastValue=AA;A._sendQuery(AA);}},_onTextboxBlur:function(AB){var A=this;if(!A._overContainer||(A._keyCode==m)){if(!A._itemSelected){var AA=A._textMatchesOption();var z=A.overlay.get("visible");if(!z||(z&&n(AA))){if(A.get("forceSelection")){A._clearSelection();}else{A.fire("unmatchedItemSelect",A._currentQuery);}}else{if(A.get("forceSelection")){A._selectItem(AA);}}}A._clearInterval();A.blur();if(A._initInputValue!==A.inputNode.get("value")){A.fire("textboxChange");}A.fire("textboxBlur");A._toggleContainer(false);}else{A._focus();}},_onTextboxFocus:function(z){var A=this;if(!A.get("focused")){A.inputNode.setAttribute("autocomplete","off");A.focus();A._initInputValue=A.inputNode.get("value");A.fire("textboxFocus");}},_onTextboxKeyDown:function(z){var A=this;var AA=z.keyCode;if(A._typeAheadDelayId!=-1){clearTimeout(A._typeAheadDelayId);}switch(AA){case m:if(A._elCurListItem){if(A.get("delimChar")&&A._keyCode!=AA){if(A.overlay.get("visible")){z.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}break;case d:if(A._elCurListItem){if(A._keyCode!=AA){if(A.overlay.get("visible")){z.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}break;case e:A._toggleContainer(false);return;case l:if(A.overlay.get("visible")){z.halt();A._moveSelection(AA);}break;case W:A._jumpSelection();break;case X:if(A.overlay.get("visible")){z.halt();A._moveSelection(AA);}break;default:A._itemSelected=false;A._toggleHighlight(A._elCurListItem,"from");A.fire("textboxKey",AA);break;}if(AA==F){A._enableIntervalDetection();}A._keyCode=AA;},_onTextboxKeyPress:function(z){var A=this;var AA=z.keyCode;switch(AA){case m:if(A.overlay.get("visible")){if(A.get("delimChar")){z.halt();}if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}break;case 13:if(A.overlay.get("visible")){z.halt();if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}break;default:break;}if(AA==G){A._enableIntervalDetection();}},_onTextboxKeyUp:function(AA){var A=this;var z=A.inputNode;var AB=z.get("value");var AC=AA.keyCode;if(A._isIgnoreKey(AC)){return;}A._queryTask.delay(A.get("queryDelay"),null,null,[AB]);},_populateList:function(A){var AJ=this;if(AJ._typeAheadDelayId!=-1){clearTimeout(AJ._typeAheadDelayId);}var AE=A.request;var AC=A.response;var AM=A.callback;var AB=(AE=="*");if(AM&&AM.argument&&AM.argument.query){A.request=AE=AM.argument.query;}var AH=AJ.doBeforeLoadData(A);if(AH&&!A.error){AJ.fire("dataReturn",A);var AG=AJ.get("focused");if(AB||AG||AG===null){var AF=decodeURIComponent(AE);AJ._currentQuery=AF;AJ._itemSelected=false;var AA=A.response.results;var AL=Math.min(AA.length,AJ.get("maxResultsDisplayed"));var AD=AJ.get("schema.resultFields");var AK=AJ.get("matchKey");if(!AK&&AD){AK=AD[0];}else{AK=AK||0;}if(AL>0){var AI=AJ.resultList.get("childNodes");AI.each(function(AR,AQ,AP){if(AQ<AL){var AO=AA[AQ];var AN="";if(J(AO)){AN=AO;}else{if(V(AO)){AN=AO[0];}else{AN=AO[AK];}}AR._resultMatch=AN;AR._resultData=AO;AR.html(AJ.formatResult(AO,AF,AN));AR.removeClass(s);}else{AR.addClass(s);}});AJ._displayedItems=AL;AJ.fire("containerPopulate",AE,AA);if(AE!="*"&&AJ.get("autoHighlight")){var z=AJ.resultList.get("firstChild");AJ._toggleHighlight(z,"to");AJ.fire("itemArrowTo",z);AJ._typeAhead(z,AE);}else{AJ._toggleHighlight(AJ._elCurListItem,"from");}AH=AJ.doBeforeExpandContainer(AE,AA);AJ._toggleContainer(AH);}else{AJ._toggleContainer(false);}return;}}else{AJ.fire("dataError",AE);}},_realignContainer:function(z){var A=this;var AA=A._overlayAlign;if(z.newVal){A.overlay._uiSetAlign(AA.node,AA.points);}},_renderInput:function(){var z=this;
-var AA=z.get(b);var AB=z.get("input");var AD={field:{labelText:false},icons:[{icon:"circle-triangle-b",id:"trigger",handler:{fn:z._onButtonMouseDown,context:z}}]};var AC=null;var A=null;if(AB){AB=M.one(AB);AD.field.node=AB;AC=AB.next();A=AB.get("parentNode");}var AE=new M.Combobox(AD).render(AA);if(A){var AF=AE.get("boundingBox");A.insertBefore(AF,AC);}z.inputNode=AE.get("node");z.button=AE.icons.item("trigger");z.set("uniqueName",M.stamp(z.inputNode));},_renderListElements:function(){var A=this;var AB=A.get("maxResultsDisplayed");var z=A.resultList;var AA=[];while(AB--){AA[AB]='<li class="'+s+" "+H+'" data-listItemIndex="'+AB+'"></li>';}z.html(AA.join(""));},_renderOverlay:function(){var A=this;var AB=A._overlayAlign;AB.node=A.inputNode;var AA=new M.OverlayBase({align:AB,bodyContent:"<ul></ul>",visible:false,width:A.inputNode.get("offsetWidth")});var z=AA.get(b);AA.get(u).addClass(B);z.addClass(U);AA.render(document.body);AA.addTarget(A);A.overlay=AA;A.resultList=z.one("ul");A.resultList.addClass(o);A._renderListElements();},_selectItem:function(z){var A=this;A._itemSelected=true;A._updateValue(z);A._pastSelections=A.inputNode.get("value");A._clearInterval();A.fire("itemSelect",z,z._resultData);A._toggleContainer(false);},_sendQuery:function(AD){var z=this;if(z.get("disabled")){z._toggleContainer(false);return;}var AB=z.get("delimChar");var AA=z.get("minQueryLength");if(AB){var A=z._extractQuery(AD);AD=A.query;z._pastSelections=A.previous;}if((AD&&(AD.length<AA))||(!AD&&AA>0)){z._queryTask.cancel();z._toggleContainer(false);return;}AD=encodeURIComponent(AD);if(z.get("applyLocalFilter")){z.dataSource.on("response",z.filterResults,z);}var AC=z.generateRequest(AD);z.fire("dataRequest",AD,AC);z.dataSource.sendRequest(AC);},_textMatchesOption:function(){var A=this;var z=null;var AD=A._displayedItems;var AE=A.resultList.get("childNodes");for(var AB=0;AB<AD.length;AB++){var AC=AE.item(AB);var AA=(""+AC._resultMatch).toLowerCase();if(AA==A._currentQuery.toLowerCase()){z=AC;break;}}return z;},_toggleContainer:function(z){var A=this;var AA=A.overlay;if(A.get("alwaysShowContainer")&&AA.get("visible")){return;}if(!z){A._toggleHighlight(A._elCurListItem,"from");A._displayedItems=0;A._currentQuery=null;}if(z){AA.show();A.fire("containerExpand");}else{AA.hide();A.fire("containerCollapse");}},_toggleHighlight:function(z,AA){var A=this;if(z){if(A._elCurListItem){A._elCurListItem.removeClass(C);A._elCurListItem=null;}if(AA=="to"){z.addClass(C);A._elCurListItem=z;}}},_typeAhead:function(z,AA){var A=this;if(!A.get("typeAhead")||A._keyCode==Q){return;}var AB=M.Node.getDOMNode(A.inputNode);if(AB.setSelectionRange||AB.createTextRange){A._typeAheadDelayId=setTimeout(function(){var AE=AB.value;var AF=AE.length;A._updateValue(z);var AC=AB.value.length;A.inputNode.selectText(AF,AC);var AD=AB.value.substr(AF,AC);A.fire("typeAhead",AA,AD);},A.get("typeAheadDelay"));}},_updateValue:function(AD){var z=this;if(!z.get("suppressInputUpdate")){var AC=z.inputNode;var A=AD._resultMatch;var AB=z.get("delimChar");AB=(AB&&AB[0])||AB;var AE="";if(AB){AE=z._pastSelections;AE+=A+AB;if(AB!=" "){AE+=" ";}}else{AE=A;}AC.set("value",AE);if(AC.get("type")=="textarea"){AC.set("scrollTop",AC.get("scrollHeight"));}var AA=AE.length;AC.selectText(AA,AA);z._elCurListItem=AD;}},_currentQuery:null,_displayedItems:0,_elCurListItem:null,_initInputValue:null,_itemSelected:false,_keyCode:null,_lastValue:null,_overContainer:false,_pastSelections:"",_typeAheadDelayId:-1}});M.AutoComplete=N;},"gallery-2010.08.18-17-12",{skinnable:true,requires:["gallery-aui-base","gallery-aui-overlay-base","datasource","dataschema","gallery-aui-form-combobox"]});
+YUI.add("gallery-aui-autocomplete",function(l){var Y=l.Lang,u=Y.isArray,i=Y.isString,N=Y.isNull,n=Y.isFunction,X=l.ClassNameManager.getClassName,J="alert",H="content",P="helper",Q="hidden",C="icon",V="item",K="list",q="loading",F="autocomplete",R="reset",T="results",z="selected",r="circle-triangle-b",I=J,c=q,b=X(F,z),S=X(P,Q),g=X(F,K,V),O=X(P,R),a=X(F,T),t=X(F,T,H),p=8,M=9,D=13,j=16,d=17,e=18,o=20,E=27,h=33,k=35,x=36,L=38,w=40,v=39,s=37,G=44,W=44,f=229,y={node:null,points:["tl","bl"]},U="boundingBox",B="contentBox";var m=l.Component.create({NAME:F,ATTRS:{alwaysShowContainer:{value:false},autoHighlight:{value:true},applyLocalFilter:{value:null},button:{value:true},dataSource:{value:null},dataSourceType:{value:null},delimChar:{value:null,setter:function(A){if(i(A)&&(A.length>0)){A=[A];}else{if(!u(A)){A=l.Attribute.INVALID_VALUE;}}return A;}},forceSelection:{value:false},input:{value:null},matchKey:{value:0},maxResultsDisplayed:{value:10},minQueryLength:{value:1},queryDelay:{value:0.2,getter:function(A){return A*1000;}},queryInterval:{value:0.5,getter:function(A){return A*1000;}},queryMatchCase:{value:false},queryMatchContains:{value:false},queryQuestionMark:{value:true},schema:{value:null},schemaType:{value:"",validator:i},suppressInputUpdate:{value:false},typeAhead:{value:false},typeAheadDelay:{value:0.2,getter:function(A){return A*1000;}},uniqueName:{value:null}},prototype:{initializer:function(Z){var A=this;A._overlayAlign=l.mix({},y);A._createDataSource();},renderUI:function(){var A=this;A._renderInput();A._renderOverlay();},bindUI:function(){var A=this;var Z=A.button;var aa=A.inputNode;A.dataSource.on("request",l.bind(Z.set,Z,C,c));aa.on("blur",A._onTextboxBlur,A);aa.on("focus",A._onTextboxFocus,A);aa.on("keydown",A._onTextboxKeyDown,A);aa.on("keypress",A._onTextboxKeyPress,A);aa.on("keyup",A._onTextboxKeyUp,A);var ab=A.overlay.get(U);ab.on("click",A._onContainerClick,A);ab.on("mouseout",A._onContainerMouseout,A);ab.on("mouseover",A._onContainerMouseover,A);ab.on("scroll",A._onContainerScroll,A);A.publish("containerCollapse");A.publish("containerExpand");A.publish("containerPopulate");A.publish("dataError");A.publish("dataRequest");A.publish("dataReturn");A.publish("itemArrowFrom");A.publish("itemArrowTo");A.publish("itemMouseOut");A.publish("itemMouseOver");A.publish("itemSelect");A.publish("selectionEnforce");A.publish("textboxBlur");A.publish("textboxChange");A.publish("textboxFocus");A.publish("textboxKey");A.publish("typeAhead");A.publish("unmatchedItemSelect");A.overlay.after("visibleChange",A._realignContainer,A);},syncUI:function(){var A=this;A.inputNode.setAttribute("autocomplete","off");},destructor:function(){var A=this;A.overlay.destroy();},doBeforeExpandContainer:function(){return true;},doBeforeLoadData:function(A){return true;},filterResults:function(aj){var ap=this;var aa=aj.callback;var ab=aj.request;var Z=aj.response;if(aa&&aa.argument&&aa.argument.query){ab=aa.argument.query;}if(ab){var ao=ap.dataSource;var al=Z.results;var A=[];var ad=false;var ac=ap.get("matchKey");var am=ap.get("queryMatchCase");var ah=ap.get("queryMatchContains");var ag=(ab=="*");var ai=ap.get("schema.resultFields");for(var ak=al.length-1;ak>=0;ak--){var af=al[ak];var an=null;if(i(af)){an=af;}else{if(u(af)){an=af[0];}else{if(ai){an=af[ac||ai[0]];}}}if(i(an)){var ae=-1;if(am){ae=an.indexOf(decodeURIComponent(ab));}else{ae=an.toLowerCase().indexOf(decodeURIComponent(ab).toLowerCase());}if((ag)||(!ah&&(ae===0))||(ah&&(ae>-1))){A.unshift(af);}}}Z.results=A;}return Z;},formatResult:function(Z,aa,A){return A||"";},generateRequest:function(A){return{request:A};},handleResponse:function(aa){var Z=this;Z._populateList(aa);var A=r;if(aa.error){A=I;}Z.button.set(C,A);},sendQuery:function(Z){var A=this;A.set("focused",null);var aa=Z;if(A.get("delimChar")){Z=A.inputNode.get("value")+Z;}A._sendQuery(aa);},_clearInterval:function(){var A=this;if(A._queryIntervalId){clearInterval(A._queryIntervalId);A._queryIntervalId=null;}},_clearSelection:function(){var Z=this;var aa=Z.get("delimChar");var A={previous:"",query:Z.inputNode.get("value")};if(aa){A=Z._extractQuery(Z.inputNode.get("value"));}Z.fire("selectionEnforce",A.query);},_createDataSource:function(){var A=this;A._queryTask=new l.DelayedTask(A.sendQuery,A);var ae=A.get("dataSource");var ac=ae;var ad=A.get("dataSourceType");if(!(ae instanceof l.DataSource.Local)){if(!ad){ad="Local";if(n(ac)){ad="Function";}else{if(i(ac)){ad="IO";}}}ae=new l.DataSource[ad]({source:ac});}ae.on("error",A.handleResponse,A);ae.after("response",A.handleResponse,A);ad=ae.name;if(ad=="dataSourceLocal"){A.set("applyLocalFilter",true);}A.set("dataSource",ae);A.set("dataSource",ad);A.dataSource=ae;var ab=A.get("schema");if(ab){if(ab.fn){A.dataSource.plug(ab);}else{var Z=A.get("schemaType");var aa={array:l.Plugin.DataSourceArraySchema,json:l.Plugin.DataSourceJSONSchema,text:l.Plugin.DataSourceTextSchema,xml:l.Plugin.DataSourceXMLSchema};Z=Z.toLowerCase()||"array";A.dataSource.plug({fn:aa[Z],cfg:{schema:ab}});}}A.set("schema",ab);},_enableIntervalDetection:function(){var A=this;var Z=A.get("queryInterval");if(!A._queryIntervalId&&Z){A._queryInterval=setInterval(l.bind(A._onInterval,A),Z);}},_extractQuery:function(ac){var ag=this;var ae=ag.get("delimChar");var A=-1;var aa=ae.length-1;var af,ad,ab;for(;aa>=0;aa--){af=ac.lastIndexOf(ae[aa]);if(af>A){A=af;}}if(ae[aa]==" "){for(var Z=ae.length-1;Z>=0;Z--){if(ac[A-1]==ae[Z]){A--;break;}}}if(A>-1){ad=A+1;while(ac.charAt(ad)==" "){ad+=1;}ab=ac.substring(0,ad);ac=ac.substring(ad);}else{ab="";}return{previous:ab,query:ac};},_focus:function(){var A=this;setTimeout(function(){A.inputNode.focus();},0);},_isIgnoreKey:function(Z){var A=this;if((Z==M)||(Z==D)||(Z==j)||(Z==d)||(Z>=e&&Z<=o)||(Z==E)||(Z>=h&&Z<=k)||(Z>=x&&Z<=w)||(Z>=G&&Z<=W)||(Z==f)){return true;}return false;},_jumpSelection:function(){var A=this;if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}},_moveSelection:function(al){var ai=this;if(ai.overlay.get("visible")){var am=ai._elCurListItem;
+var Z=-1;if(am){Z=Number(am.getAttribute("data-listItemIndex"));}var aa=Z-1;if(al==w){aa=Z+1;}if(aa==-1){aa=ai._displayedItems-1;}if(aa>=ai._displayedItems){aa=0;}if(aa<-2){return;}if(am){ai._toggleHighlight(am,"from");ai.fire("itemArrowFrom",am);}if(aa==-1){if(ai.get("delimChar")){ai.inputNode.set("value",ai._pastSelections+ai._currentQuery);}else{ai.inputNode.set("value",ai._currentQuery);}return;}if(aa==-2){ai._toggleContainer(false);return;}var ae=ai.resultList.get("childNodes").item(aa);var ac=ai.overlay.get(B);var ag=ac.getStyle("overflow");var aj=ac.getStyle("overflowY");var ab=(ag=="auto")||(ag=="scroll")||(aj=="auto")||(aj=="scroll");if(ab&&(aa>-1)&&(aa<ai._displayedItems)){var A=-1;var an=ae.get("offsetTop");var ad=an+ae.get("offsetHeight");var ah=ac.get("offsetHeight");var af=ac.get("scrollTop");var ak=ah+af;if(al==w){if(ad>ak){A=(ad-ah);}else{if(ad<af){A=an;}}}else{if(an<ah){A=an;}else{if(an>ak){A=(ad-ah);}}}if(A>-1){ac.set("scrollTop",A);}}ai._toggleHighlight(ae,"to");ai.fire("itemArrowTo",ae);if(ai.get("typeAhead")){ai._updateValue(ae);}}},_onButtonMouseDown:function(Z){var A=this;Z.halt();A._focus();A._sendQuery(A.inputNode.get("value")+"*");},_onContainerClick:function(aa){var A=this;var ab=aa.target;var Z=ab.get("nodeName").toLowerCase();aa.halt();while(ab&&(Z!="table")){switch(Z){case"body":return;case"li":A._toggleHighlight(ab,"to");A._selectItem(ab);return;default:break;}ab=ab.get("parentNode");if(ab){Z.get("nodeName").toLowerCase();}}},_onContainerMouseout:function(aa){var A=this;var ab=aa.target;var Z=ab.get("nodeName").toLowerCase();while(ab&&(Z!="table")){switch(Z){case"body":return;case"li":A._toggleHighlight(ab,"from");A.fire("itemMouseOut",ab);break;case"ul":A._toggleHighlight(A._elCurListItem,"to");break;case"div":if(ab.hasClass(a)){A._overContainer=false;return;}break;default:break;}ab=ab.get("parentNode");if(ab){Z=ab.get("nodeName").toLowerCase();}}},_onContainerMouseover:function(aa){var A=this;var ab=aa.target;var Z=ab.get("nodeName").toLowerCase();while(ab&&(Z!="table")){switch(Z){case"body":return;case"li":A._toggleHighlight(ab,"to");A.fire("itemMouseOut",ab);break;case"div":if(ab.hasClass(a)){A._overContainer=true;return;}break;default:break;}ab=ab.get("parentNode");if(ab){Z=ab.get("nodeName").toLowerCase();}}},_onContainerScroll:function(Z){var A=this;A._focus();},_onInterval:function(){var A=this;var aa=A.inputNode.get("value");var Z=A._lastValue;if(aa!=Z){A._lastValue=aa;A._sendQuery(aa);}},_onTextboxBlur:function(ab){var A=this;if(!A._overContainer||(A._keyCode==M)){if(!A._itemSelected){var aa=A._textMatchesOption();var Z=A.overlay.get("visible");if(!Z||(Z&&N(aa))){if(A.get("forceSelection")){A._clearSelection();}else{A.fire("unmatchedItemSelect",A._currentQuery);}}else{if(A.get("forceSelection")){A._selectItem(aa);}}}A._clearInterval();A.blur();if(A._initInputValue!==A.inputNode.get("value")){A.fire("textboxChange");}A.fire("textboxBlur");A._toggleContainer(false);}else{A._focus();}},_onTextboxFocus:function(Z){var A=this;if(!A.get("focused")){A.inputNode.setAttribute("autocomplete","off");A.focus();A._initInputValue=A.inputNode.get("value");A.fire("textboxFocus");}},_onTextboxKeyDown:function(Z){var A=this;var aa=Z.keyCode;if(A._typeAheadDelayId!=-1){clearTimeout(A._typeAheadDelayId);}switch(aa){case M:if(A._elCurListItem){if(A.get("delimChar")&&A._keyCode!=aa){if(A.overlay.get("visible")){Z.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}break;case D:if(A._elCurListItem){if(A._keyCode!=aa){if(A.overlay.get("visible")){Z.halt();}}A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}break;case E:A._toggleContainer(false);return;case L:if(A.overlay.get("visible")){Z.halt();A._moveSelection(aa);}break;case v:A._jumpSelection();break;case w:if(A.overlay.get("visible")){Z.halt();A._moveSelection(aa);}break;default:A._itemSelected=false;A._toggleHighlight(A._elCurListItem,"from");A.fire("textboxKey",aa);break;}if(aa==e){A._enableIntervalDetection();}A._keyCode=aa;},_onTextboxKeyPress:function(Z){var A=this;var aa=Z.keyCode;switch(aa){case M:if(A.overlay.get("visible")){if(A.get("delimChar")){Z.halt();}if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}break;case 13:if(A.overlay.get("visible")){Z.halt();if(A._elCurListItem){A._selectItem(A._elCurListItem);}else{A._toggleContainer(false);}}break;default:break;}if(aa==f){A._enableIntervalDetection();}},_onTextboxKeyUp:function(aa){var A=this;var Z=A.inputNode;var ab=Z.get("value");var ac=aa.keyCode;if(A._isIgnoreKey(ac)){return;}A._queryTask.delay(A.get("queryDelay"),null,null,[ab]);},_populateList:function(A){var aj=this;if(aj._typeAheadDelayId!=-1){clearTimeout(aj._typeAheadDelayId);}var ae=A.request;var ac=A.response;var am=A.callback;var ab=(ae=="*");if(am&&am.argument&&am.argument.query){A.request=ae=am.argument.query;}var ah=aj.doBeforeLoadData(A);if(ah&&!A.error){aj.fire("dataReturn",A);var ag=aj.get("focused");if(ab||ag||ag===null){var af=decodeURIComponent(ae);aj._currentQuery=af;aj._itemSelected=false;var aa=A.response.results;var al=Math.min(aa.length,aj.get("maxResultsDisplayed"));var ad=aj.get("schema.resultFields");var ak=aj.get("matchKey");if(!ak&&ad){ak=ad[0];}else{ak=ak||0;}if(al>0){var ai=aj.resultList.get("childNodes");ai.each(function(ar,aq,ap){if(aq<al){var ao=aa[aq];var an="";if(i(ao)){an=ao;}else{if(u(ao)){an=ao[0];}else{an=ao[ak];}}ar._resultMatch=an;ar._resultData=ao;ar.html(aj.formatResult(ao,af,an));ar.removeClass(S);}else{ar.addClass(S);}});aj._displayedItems=al;aj.fire("containerPopulate",ae,aa);if(ae!="*"&&aj.get("autoHighlight")){var Z=aj.resultList.get("firstChild");aj._toggleHighlight(Z,"to");aj.fire("itemArrowTo",Z);aj._typeAhead(Z,ae);}else{aj._toggleHighlight(aj._elCurListItem,"from");}ah=aj.doBeforeExpandContainer(ae,aa);aj._toggleContainer(ah);}else{aj._toggleContainer(false);}return;}}else{aj.fire("dataError",ae);}},_realignContainer:function(Z){var A=this;var aa=A._overlayAlign;if(Z.newVal){A.overlay._uiSetAlign(aa.node,aa.points);
+}},_renderInput:function(){var Z=this;var aa=Z.get(B);var ab=Z.get("input");var ad={field:{labelText:false},icons:[{icon:"circle-triangle-b",id:"trigger",handler:{fn:Z._onButtonMouseDown,context:Z}}]};var ac=null;var A=null;if(ab){ab=l.one(ab);ad.field.node=ab;ac=ab.next();A=ab.get("parentNode");}var ae=new l.Combobox(ad).render(aa);if(A){var af=ae.get("boundingBox");A.insertBefore(af,ac);}Z.inputNode=ae.get("node");Z.button=ae.icons.item("trigger");Z.set("uniqueName",l.stamp(Z.inputNode));},_renderListElements:function(){var A=this;var ab=A.get("maxResultsDisplayed");var Z=A.resultList;var aa=[];while(ab--){aa[ab]='<li class="'+S+" "+g+'" data-listItemIndex="'+ab+'"></li>';}Z.html(aa.join(""));},_renderOverlay:function(){var A=this;var ab=A._overlayAlign;ab.node=A.inputNode;var aa=new l.OverlayBase({align:ab,bodyContent:"<ul></ul>",visible:false,width:A.inputNode.get("offsetWidth")});var Z=aa.get(B);aa.get(U).addClass(a);Z.addClass(t);aa.render(document.body);aa.addTarget(A);A.overlay=aa;A.resultList=Z.one("ul");A.resultList.addClass(O);A._renderListElements();},_selectItem:function(Z){var A=this;A._itemSelected=true;A._updateValue(Z);A._pastSelections=A.inputNode.get("value");A._clearInterval();A.fire("itemSelect",Z,Z._resultData);A._toggleContainer(false);},_sendQuery:function(ad){var Z=this;if(Z.get("disabled")){Z._toggleContainer(false);return;}var ab=Z.get("delimChar");var aa=Z.get("minQueryLength");if(ab){var A=Z._extractQuery(ad);ad=A.query;Z._pastSelections=A.previous;}if((ad&&(ad.length<aa))||(!ad&&aa>0)){Z._queryTask.cancel();Z._toggleContainer(false);return;}ad=encodeURIComponent(ad);if(Z.get("applyLocalFilter")){Z.dataSource.on("response",Z.filterResults,Z);}var ac=Z.generateRequest(ad);Z.fire("dataRequest",ad,ac);Z.dataSource.sendRequest(ac);},_textMatchesOption:function(){var A=this;var Z=null;var ad=A._displayedItems;var ae=A.resultList.get("childNodes");for(var ab=0;ab<ad.length;ab++){var ac=ae.item(ab);var aa=(""+ac._resultMatch).toLowerCase();if(aa==A._currentQuery.toLowerCase()){Z=ac;break;}}return Z;},_toggleContainer:function(Z){var A=this;var aa=A.overlay;if(A.get("alwaysShowContainer")&&aa.get("visible")){return;}if(!Z){A._toggleHighlight(A._elCurListItem,"from");A._displayedItems=0;A._currentQuery=null;}if(Z){aa.show();A.fire("containerExpand");}else{aa.hide();A.fire("containerCollapse");}},_toggleHighlight:function(Z,aa){var A=this;if(Z){if(A._elCurListItem){A._elCurListItem.removeClass(b);A._elCurListItem=null;}if(aa=="to"){Z.addClass(b);A._elCurListItem=Z;}}},_typeAhead:function(Z,aa){var A=this;if(!A.get("typeAhead")||A._keyCode==p){return;}var ab=l.Node.getDOMNode(A.inputNode);if(ab.setSelectionRange||ab.createTextRange){A._typeAheadDelayId=setTimeout(function(){var ae=ab.value;var af=ae.length;A._updateValue(Z);var ac=ab.value.length;A.inputNode.selectText(af,ac);var ad=ab.value.substr(af,ac);A.fire("typeAhead",aa,ad);},A.get("typeAheadDelay"));}},_updateValue:function(ad){var Z=this;if(!Z.get("suppressInputUpdate")){var ac=Z.inputNode;var A=ad._resultMatch;var ab=Z.get("delimChar");ab=(ab&&ab[0])||ab;var ae="";if(ab){ae=Z._pastSelections;ae+=A+ab;if(ab!=" "){ae+=" ";}}else{ae=A;}ac.set("value",ae);if(ac.get("type")=="textarea"){ac.set("scrollTop",ac.get("scrollHeight"));}var aa=ae.length;ac.selectText(aa,aa);Z._elCurListItem=ad;}},_currentQuery:null,_displayedItems:0,_elCurListItem:null,_initInputValue:null,_itemSelected:false,_keyCode:null,_lastValue:null,_overContainer:false,_pastSelections:"",_typeAheadDelayId:-1}});l.AutoComplete=m;},"gallery-2011.02.09-21-32",{requires:["gallery-aui-base","gallery-aui-overlay-base","datasource","dataschema","gallery-aui-form-combobox"],skinnable:true});
View
15 build/gallery-aui-autocomplete/gallery-aui-autocomplete.js
@@ -640,6 +640,19 @@ var AutoComplete = A.Component.create(
},
/**
+ * Descructor lifecycle implementation for the Autocomplete class.
+ * Purges events attached to the node (and all child nodes).
+ *
+ * @method destructor
+ * @protected
+ */
+ destructor: function() {
+ var instance = this;
+
+ instance.overlay.destroy();
+ },
+
+ /**
* An overridable method that is executed before the result container is shown.
* The method can return false to prevent the container from being shown.
*
@@ -2093,4 +2106,4 @@ var AutoComplete = A.Component.create(
A.AutoComplete = AutoComplete;
-}, 'gallery-2010.08.18-17-12' ,{skinnable:true, requires:['gallery-aui-base','gallery-aui-overlay-base','datasource','dataschema','gallery-aui-form-combobox']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['gallery-aui-base','gallery-aui-overlay-base','datasource','dataschema','gallery-aui-form-combobox'], skinnable:true});
View
487 build/gallery-aui-base/gallery-aui-base-debug.js
@@ -1,41 +1,162 @@
YUI.add('gallery-aui-base', function(A) {
-A.mix(A.Array, {
- remove: function(a, from, to) {
- var rest = a.slice((to || from) + 1 || a.length);
- a.length = (from < 0) ? (a.length + from) : from;
+var Lang = A.Lang,
+ isArray = Lang.isArray,
+ isFunction = Lang.isFunction,
+ isString = Lang.isString,
- return a.push.apply(a, rest);
- },
+ AArray = A.Array,
+ LString = A.namespace('Lang.String'),
+ arrayIndexOf = AArray.indexOf,
- removeItem: function(a, item) {
- var index = A.Array.indexOf(a, item);
+ EMPTY_STR = '',
- return A.Array.remove(a, index);
+ DOC = A.config.doc,
+ FIRST_CHILD = 'firstChild',
+ INNER_HTML = 'innerHTML',
+ NODE_VALUE = 'nodeValue',
+ NORMALIZE = 'normalize';
+
+A.mix(
+ LString,
+ {
+ contains: function(s, ss) {
+ return s.indexOf(ss) != -1;
+ },
+
+ endsWith: function(str, suffix) {
+ var length = (str.length - suffix.length);
+
+ return ((length >= 0) && (str.indexOf(suffix, length) == length));
+ },
+
+ // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
+ escapeRegEx: function(str) {
+ return str.replace(/([.*+?^$(){}|[\]\/\\])/g, '\\$1');
+ },
+
+ repeat: function(string, length) {
+ return new Array(length + 1).join(string);
+ },
+
+ padNumber: function(num, length, precision) {
+ var str = precision ? Number(num).toFixed(precision) : String(num);
+ var index = str.indexOf('.');
+
+ if (index == -1) {
+ index = str.length;
+ }
+
+ return LString.repeat('0', Math.max(0, length - index)) + str;
+ },
+
+ remove: function(s, substitute, all) {
+ var re = new RegExp(LString.escapeRegEx(substitute), all ? 'g' : '');
+
+ return s.replace(re, '');
+ },
+
+ removeAll: function(s, substitute) {
+ return LString.remove(s, substitute, true);
+ },
+
+ startsWith: function(str, prefix) {
+ return (str.lastIndexOf(prefix, 0) == 0);
+ },
+
+ trim: Lang.trim,
+
+ // inspired from Google unescape entities
+ unescapeEntities: function(str) {
+ if (LString.contains(str, '&')) {
+ if (DOC && !LString.contains(str, '<')) {
+ str = LString._unescapeEntitiesUsingDom(str);
+ }
+ else {
+ // Fall back on pure XML entities
+ str = LString._unescapeXmlEntities(str);
+ }
+ }
+
+ return str;
+ },
+
+ _unescapeEntitiesUsingDom: function(str) {
+ var el = LString._unescapeNode;
+
+ el[INNER_HTML] = str;
+
+ if (el[NORMALIZE]) {
+ el[NORMALIZE]();
+ }
+
+ str = el.firstChild.nodeValue;
+
+ el[INNER_HTML] = EMPTY_STR;
+
+ return str;
+ },
+
+ _unescapeXmlEntities: function(str) {
+ return str.replace(/&([^;]+);/g, function(s, entity) {
+ switch (entity) {
+ case 'amp':
+ return '&';
+ case 'lt':
+ return '<';
+ case 'gt':
+ return '>';
+ case 'quot':
+ return '"';
+ default:
+ if (entity.charAt(0) == '#') {
+ var n = Number('0' + entity.substr(1));
+
+ if (!isNaN(n)) {
+ return String.fromCharCode(n);
+ }
+ }
+
+ return s;
+ }
+ });
+ },
+
+ _unescapeNode: DOC.createElement('a')
}
-});
+);
-var Lang = A.Lang;
-var isArray = Lang.isArray;
-var isFunction = Lang.isFunction;
-var isString = Lang.isString;
+A.mix(
+ AArray,
+ {
+ remove: function(a, from, to) {
+ var rest = a.slice((to || from) + 1 || a.length);
+ a.length = (from < 0) ? (a.length + from) : from;
+
+ return a.push.apply(a, rest);
+ },
+
+ removeItem: function(a, item) {
+ var index = arrayIndexOf(a, item);
+
+ return AArray.remove(a, index);
+ }
+ }
+);
A.mix(
Lang,
{
emptyFn: function() {},
+
emptyFnFalse: function() {
return false;
},
+
emptyFnTrue: function() {
return true;
},
- // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
- escapeRegEx: function(str) {
- return str.replace(/([.*+?^$(){}|[\]\/\\])/g, '\\$1');
- },
-
isGuid: function(id) {
var instance = this;
@@ -89,7 +210,7 @@ A.mix(
);
;(function() {
/*
- * Alloy JavaScript Library vgallery-2010.08.18-17-12
+ * Alloy JavaScript Library vgallery-2011.02.09-21-32
* http://alloy.liferay.com/
*
* Copyright (c) 2010 Liferay Inc.
@@ -139,15 +260,15 @@ A.mix(
var ALLOY;
- try {
+ if (typeof A != 'undefined') {
ALLOY = A;
}
- catch (e) {
+ else {
ALLOY = YUI(defaults);
}
var guidExtensions = function(A) {
- A.Env._guidp = ['aui', A.version, A.Env._yidx].join('-').replace(/\./g, '-');
+ A.Env._guidp = ['aui', A.version, A.Env._yidx].join('_').replace(/\./g, '_');
};
guidExtensions(ALLOY);
@@ -229,128 +350,238 @@ A.mix(
UA extensions
*/
- AUI._uaExtensions = function(A) {
- var p = navigator.platform;
- var u = navigator.userAgent;
- var b = /(Firefox|Opera|Chrome|Safari|KDE|iCab|Flock|IE)/.exec(u);
- var os = /(Win|Mac|Linux|iPhone|iPad|Sun|Solaris)/.exec(p);
- var versionDefaults = [0,0];
-
- b = (!b || !b.length) ? (/(Mozilla)/.exec(u) || ['']) : b;
- os = (!os || !os.length) ? [''] : os;
-
- UA = A.merge(
- UA,
- {
- gecko: /Gecko/.test(u) && !/like Gecko/.test(u),
- webkit: /WebKit/.test(u),
-
- aol: /America Online Browser/.test(u),
- camino: /Camino/.test(u),
- firefox: /Firefox/.test(u),
- flock: /Flock/.test(u),
- icab: /iCab/.test(u),
- konqueror: /KDE/.test(u),
- mozilla: /mozilla/.test(u),
- ie: /MSIE/.test(u),
- netscape: /Netscape/.test(u),
- opera: /Opera/.test(u),
- chrome: /Chrome/.test(u),
- safari: /Safari/.test(u) && !(/Chrome/.test(u)),
- browser: b[0].toLowerCase(),
-
- win: /Win/.test(p),
- mac: /Mac/.test(p),
- linux: /Linux/.test(p),
- iphone: (p == 'iPhone'),
- ipad: (p == 'iPad'),
- sun: /Solaris|SunOS/.test(p),
- os: os[0].toLowerCase(),
-
- platform: p,
- agent: u
- }
- );
+ (function() {
+ var REGEX_VERSION_DOT = /\./g;
+
+ var parseVersionNumber = function(str) {
+ var count = 0;
- UA.version = {
- string: ''
+ return parseFloat(
+ str.replace(
+ REGEX_VERSION_DOT,
+ function() {
+ return (count++ == 1) ? '' : '.';
+ }
+ )
+ );
};
- if (UA.ie) {
- UA.version.string = (/MSIE ([^;]+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.firefox) {
- UA.version.string = (/Firefox\/(.+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.safari) {
- UA.version.string = (/Version\/([^\s]+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.opera) {
- UA.version.string = (/Opera\/([^\s]+)/.exec(u) || versionDefaults)[1];
- }
+ var DEFAULTS_VERSION = ['0','0'];
- UA.version.number = parseFloat(UA.version.string) || versionDefaults[0];
- UA.version.major = (/([^\.]+)/.exec(UA.version.string) || versionDefaults)[1];
+ var getVersion = function(regex, userAgent) {
+ var version = (userAgent.match(regex) || DEFAULTS_VERSION)[1];
- UA[UA.browser + UA.version.major] = true;
+ return parseVersionNumber(version);
+ };
- UA.renderer = '';
+ var MAP_OS_SELECTORS = {
+ windows: 'win',
+ macintosh: 'mac'
+ };
- var documentElement = document.documentElement;
+ var BROWSERS = [
+ 'ie',
+ 'opera',
+ 'chrome',
+ 'aol',
+ 'camino',
+ 'firefox',
+ 'flock',
+ 'mozilla',
+ 'netscape',
+ 'icab',
+ 'konqueror',
+ 'safari'
+ ];
- UA.dir = documentElement.getAttribute('dir') || 'ltr';
+ AUI._uaExtensions = function(A) {
+ var nav = navigator;
- if (UA.ie) {
- UA.renderer = 'trident';
- }
- else if (UA.gecko) {
- UA.renderer = 'gecko';
- }
- else if (UA.webkit) {
- UA.renderer = 'webkit';
- }
- else if (UA.opera) {
- UA.renderer = 'presto';
- }
+ var userAgent = nav.userAgent;
- A.UA = UA;
+ var UA = A.UA;
+ var OS = UA.os;
- /*
- * Browser selectors
- */
+ var UAX = {
+ aol: 0,
- var selectors = [
- UA.renderer,
- UA.browser,
- UA.browser + UA.version.major,
- UA.os,
- UA.dir,
- 'js'
- ];
+ camino: 0,
+ firefox: 0,
+ flock: 0,
+ mozilla: 0,
+ netscape: 0,
- if (UA.os == 'macintosh') {
- selectors.push('mac');
- }
- else if (UA.os == 'windows') {
- selectors.push('win');
- }
+ icab: 0,
+ konqueror: 0,
- if (UA.mobile) {
- selectors.push('mobile');
- }
+ safari: 0,
- if (UA.secure) {
- selectors.push('secure');
- }
+ browser: 0,
- UA.selectors = selectors.join(' ');
+ win: OS == 'windows',
+ mac: OS == 'macintosh',
+ rhino: OS == 'rhino',
- if (!documentElement._yuid) {
- documentElement.className += ' ' + UA.selectors;
+ agent: userAgent
+ };
- A.stamp(documentElement);
- }
- };
+ if (UA.ie) {
+ UAX.aol = getVersion(/America Online Browser ([^\s]*);/, userAgent);
+ }
+ else if (UA.gecko) {
+ UAX.netscape = getVersion(/(Netscape|Navigator)\/([^\s]*)/, userAgent);
+ UAX.flock = getVersion(/Flock\/([^\s]*)/, userAgent);
+ UAX.camino = getVersion(/Camino\/([^\s]*)/, userAgent);
+ UAX.firefox = getVersion(/Firefox\/([^\s]*)/, userAgent);
+ }
+ else if (UA.webkit) {
+ UAX.safari = getVersion(/Version\/([^\s]*) Safari/, userAgent);
+ }
+ else {
+ UAX.icab = getVersion(/iCab(?:\/|\s)?([^\s]*)/, userAgent);
+ UAX.konqueror = getVersion(/Konqueror\/([^\s]*)/, userAgent);
+ }
+
+ if (!UAX.win && !UAX.mac) {
+ var linux = /Linux/.test(userAgent);
+ var sun = /Solaris|SunOS/.test(userAgent);
+
+ if (linux) {
+ UA.os = 'linux';
+ UAX.linux = linux;
+ }
+ else if (sun) {
+ UA.os = 'sun';
+ UAX.sun = sun;
+ }
+ }
+
+ A.mix(UA, UAX);
+
+ var browserList = [];
+ var versionMajor = 0;
+
+ var browser;
+ var version;
+ var uaVersionMajor;
+ var uaVersionMinor;
+
+ var versionObj = {
+ string: '',
+ major: versionMajor
+ };
+
+ var i = BROWSERS.length;
+
+ while (i--) {
+ browser = BROWSERS[i];
+ version = UA[browser];
+
+ if (version > 0) {
+ versionMajor = parseInt(version, 10);
+ uaVersionMajor = browser + versionMajor;
+
+ uaVersionMinor = (browser + version);
+
+ if (String(version).indexOf('.') > -1) {
+ uaVersionMinor = uaVersionMinor.replace(/\.(\d).*/, '-$1');
+ }
+ else {
+ uaVersionMinor += '-0';
+ }
+
+ browserList.push(browser, uaVersionMajor, uaVersionMinor);
+
+ versionObj.string = browser + '';
+ versionObj.major = versionMajor;
+ }
+ }
+
+ UA.version = versionObj;
+
+ UA.renderer = '';
+
+ var documentElement = A.config.doc.documentElement;
+
+ UA.dir = documentElement.getAttribute('dir') || 'ltr';
+
+ if (UA.ie) {
+ UA.renderer = 'trident';
+ }
+ else if (UA.gecko) {
+ UA.renderer = 'gecko';
+ }
+ else if (UA.webkit) {
+ UA.renderer = 'webkit';
+ }
+ else if (UA.opera) {
+ UA.renderer = 'presto';
+ }
+
+ A.UA = UA;
+
+ /*
+ * Browser selectors
+ */
+
+ var selectors = [
+ UA.renderer,
+ UA.dir,
+ 'js'
+ ].concat(browserList);
+
+ var osSelector = MAP_OS_SELECTORS[UA.os] || UA.os;
+
+ selectors.push(osSelector);
+
+ if (UA.mobile) {
+ selectors.push('mobile');
+ }
+
+ if (UA.secure) {
+ selectors.push('secure');
+ }
+
+ UA.selectors = selectors.join(' ');
+
+ // The methods in this if block only run once across all instances
+ if (!documentElement._yuid) {
+ documentElement.className += ' ' + UA.selectors;
+
+ var CONFIG = A.config,
+ DOC = CONFIG.doc,
+ vml,
+ svg;
+
+ vml = !(svg = !!(CONFIG.win.SVGAngle || DOC.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')));
+
+ if (vml) {
+ var div = DOC.createElement('div');
+ var behaviorObj;
+
+ div.innerHTML = '<v:shape adj="1"/>';
+
+ behaviorObj = div.firstChild;
+
+ behaviorObj.style.behavior = 'url(#default#VML)';
+
+ if (!(behaviorObj && typeof behaviorObj.adj == 'object')) {
+ vml = false;
+ }
+
+ div = null;
+ }
+
+ AUI._VML = vml;
+ AUI._SVG = svg;
+
+ A.stamp(documentElement);
+ }
+
+ UA.vml = AUI._VML;
+ UA.svg = AUI._SVG;
+ };
+ })();
AUI._uaExtensions(ALLOY);
@@ -368,4 +599,4 @@ A.mix(
})();
-}, 'gallery-2010.08.18-17-12' ,{skinnable:false, requires:['gallery-aui-node-base','gallery-aui-component','gallery-aui-delayed-task','gallery-aui-selector','event','oop']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['gallery-aui-node-base','gallery-aui-component','gallery-aui-delayed-task','gallery-aui-selector','event','oop'], skinnable:false});
View
2  build/gallery-aui-base/gallery-aui-base-min.js
@@ -1 +1 @@
-YUI.add("gallery-aui-base",function(C){C.mix(C.Array,{remove:function(A,I,H){var G=A.slice((H||I)+1||A.length);A.length=(I<0)?(A.length+I):I;return A.push.apply(A,G);},removeItem:function(A,H){var G=C.Array.indexOf(A,H);return C.Array.remove(A,G);}});var E=C.Lang;var D=E.isArray;var F=E.isFunction;var B=E.isString;C.mix(E,{emptyFn:function(){},emptyFnFalse:function(){return false;},emptyFnTrue:function(){return true;},escapeRegEx:function(A){return A.replace(/([.*+?^$(){}|[\]\/\\])/g,"\\$1");},isGuid:function(G){var A=this;return String(G).indexOf(C.Env._guidp)===0;},toQueryString:function(I){var M=this;var L=I;if(!B(I)){var H=[];var N;var K;var A=M._addToQueryString;for(var J in I){N=I[J];if(D(N)){for(var G=0;G<N.length;G++){A(J,N[G],H);}}else{K=N;if(F(N)){K=N();}A(J,K,H);}}L=H.join("&").replace(/%20/g,"+");}return L;},_addToQueryString:function(H,I,G){var A=this;G.push(encodeURIComponent(H)+"="+encodeURIComponent(I));}});(function(){YUI.AUI_config=YUI.AUI_config||{};var K=YUI.AUI_config;YUI.prototype.ready=function(){var M=this;var R=Array.prototype.slice;var P=R.call(arguments,0),O=P.length-1;var Q=P[O];var N=R.call(arguments,0,O);N.push("event");N.push(function(S){var T=arguments;S.on("domready",function(){Q.apply(this,T);});});M.use.apply(M,N);};var G;try{G=C;}catch(J){G=YUI(K);}var I=function(M){M.Env._guidp=["aui",M.version,M.Env._yidx].join("-").replace(/\./g,"-");};I(G);var L=G.config;G.config=G.merge(L,YUI.AUI_config);YUI.AUI=function(P){var M=this;if(P||M instanceof A){var N=G.Array(arguments);N.unshift(G.config);var O=YUI.apply(G.config.win,N);A._uaExtensions(O);A._guidExtensions(O);return O;}return G;};var A=YUI.AUI;A._guidExtensions=I;var H=G.UA;G.mix(A,YUI,true,null,2);G.mix(A,{__version:"@VERSION",defaults:K,html5shiv:function(Q){var M=this;var P=Q||document;if(H.ie&&P&&P.createElement){var O=A.HTML5_ELEMENTS,N=O.length;while(N--){P.createElement(O[N]);}}return Q;},setDefaults:function(N){var M=this;G.mix(A.defaults,N,true,null,0,true);G.mix(G.config,N,true,null,0,true);},HTML5_ELEMENTS:"abbr,article,aside,audio,canvas,command,datalist,details,figure,figcaption,footer,header,hgroup,keygen,mark,meter,nav,output,progress,section,source,summary,time,video".split(",")},true);A.html5shiv();A._uaExtensions=function(N){var S=navigator.platform;var O=navigator.userAgent;var M=/(Firefox|Opera|Chrome|Safari|KDE|iCab|Flock|IE)/.exec(O);var R=/(Win|Mac|Linux|iPhone|iPad|Sun|Solaris)/.exec(S);var T=[0,0];M=(!M||!M.length)?(/(Mozilla)/.exec(O)||[""]):M;R=(!R||!R.length)?[""]:R;H=N.merge(H,{gecko:/Gecko/.test(O)&&!/like Gecko/.test(O),webkit:/WebKit/.test(O),aol:/America Online Browser/.test(O),camino:/Camino/.test(O),firefox:/Firefox/.test(O),flock:/Flock/.test(O),icab:/iCab/.test(O),konqueror:/KDE/.test(O),mozilla:/mozilla/.test(O),ie:/MSIE/.test(O),netscape:/Netscape/.test(O),opera:/Opera/.test(O),chrome:/Chrome/.test(O),safari:/Safari/.test(O)&&!(/Chrome/.test(O)),browser:M[0].toLowerCase(),win:/Win/.test(S),mac:/Mac/.test(S),linux:/Linux/.test(S),iphone:(S=="iPhone"),ipad:(S=="iPad"),sun:/Solaris|SunOS/.test(S),os:R[0].toLowerCase(),platform:S,agent:O});H.version={string:""};if(H.ie){H.version.string=(/MSIE ([^;]+)/.exec(O)||T)[1];}else{if(H.firefox){H.version.string=(/Firefox\/(.+)/.exec(O)||T)[1];}else{if(H.safari){H.version.string=(/Version\/([^\s]+)/.exec(O)||T)[1];}else{if(H.opera){H.version.string=(/Opera\/([^\s]+)/.exec(O)||T)[1];}}}}H.version.number=parseFloat(H.version.string)||T[0];H.version.major=(/([^\.]+)/.exec(H.version.string)||T)[1];H[H.browser+H.version.major]=true;H.renderer="";var Q=document.documentElement;H.dir=Q.getAttribute("dir")||"ltr";if(H.ie){H.renderer="trident";}else{if(H.gecko){H.renderer="gecko";}else{if(H.webkit){H.renderer="webkit";}else{if(H.opera){H.renderer="presto";}}}}N.UA=H;var P=[H.renderer,H.browser,H.browser+H.version.major,H.os,H.dir,"js"];if(H.os=="macintosh"){P.push("mac");}else{if(H.os=="windows"){P.push("win");}}if(H.mobile){P.push("mobile");}if(H.secure){P.push("secure");}H.selectors=P.join(" ");if(!Q._yuid){Q.className+=" "+H.selectors;N.stamp(Q);}};A._uaExtensions(G);if(H.ie&&H.version.major<=6){try{document.execCommand("BackgroundImageCache",false,true);}catch(J){}}})();},"gallery-2010.08.18-17-12",{skinnable:false,requires:["gallery-aui-node-base","gallery-aui-component","gallery-aui-delayed-task","gallery-aui-selector","event","oop"]});
+YUI.add("gallery-aui-base",function(e){var h=e.Lang,i=h.isArray,c=h.isFunction,b=h.isString,d=e.Array,n=e.namespace("Lang.String"),j=d.indexOf,l="",g=e.config.doc,m="firstChild",f="innerHTML",a="nodeValue",k="normalize";e.mix(n,{contains:function(p,o){return p.indexOf(o)!=-1;},endsWith:function(q,p){var o=(q.length-p.length);return((o>=0)&&(q.indexOf(p,o)==o));},escapeRegEx:function(o){return o.replace(/([.*+?^$(){}|[\]\/\\])/g,"\\$1");},repeat:function(o,p){return new Array(p+1).join(o);},padNumber:function(q,r,o){var s=o?Number(q).toFixed(o):String(q);var p=s.indexOf(".");if(p==-1){p=s.length;}return n.repeat("0",Math.max(0,r-p))+s;},remove:function(r,o,q){var p=new RegExp(n.escapeRegEx(o),q?"g":"");return r.replace(p,"");},removeAll:function(p,o){return n.remove(p,o,true);},startsWith:function(p,o){return(p.lastIndexOf(o,0)==0);},trim:h.trim,unescapeEntities:function(o){if(n.contains(o,"&")){if(g&&!n.contains(o,"<")){o=n._unescapeEntitiesUsingDom(o);}else{o=n._unescapeXmlEntities(o);}}return o;},_unescapeEntitiesUsingDom:function(p){var o=n._unescapeNode;o[f]=p;if(o[k]){o[k]();}p=o.firstChild.nodeValue;o[f]=l;return p;},_unescapeXmlEntities:function(o){return o.replace(/&([^;]+);/g,function(q,p){switch(p){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:if(p.charAt(0)=="#"){var r=Number("0"+p.substr(1));if(!isNaN(r)){return String.fromCharCode(r);}}return q;}});},_unescapeNode:g.createElement("a")});e.mix(d,{remove:function(o,r,q){var p=o.slice((q||r)+1||o.length);o.length=(r<0)?(o.length+r):r;return o.push.apply(o,p);},removeItem:function(o,q){var p=j(o,q);return d.remove(o,p);}});e.mix(h,{emptyFn:function(){},emptyFnFalse:function(){return false;},emptyFnTrue:function(){return true;},isGuid:function(p){var o=this;return String(p).indexOf(e.Env._guidp)===0;},toQueryString:function(r){var v=this;var u=r;if(!b(r)){var q=[];var w;var t;var o=v._addToQueryString;for(var s in r){w=r[s];if(i(w)){for(var p=0;p<w.length;p++){o(s,w[p],q);}}else{t=w;if(c(w)){t=w();}o(s,t,q);}}u=q.join("&").replace(/%20/g,"+");}return u;},_addToQueryString:function(q,r,p){var o=this;p.push(encodeURIComponent(q)+"="+encodeURIComponent(r));}});(function(){YUI.AUI_config=YUI.AUI_config||{};var t=YUI.AUI_config;YUI.prototype.ready=function(){var v=this;var A=Array.prototype.slice;var y=A.call(arguments,0),x=y.length-1;var z=y[x];var w=A.call(arguments,0,x);w.push("event");w.push(function(B){var C=arguments;B.on("domready",function(){z.apply(this,C);});});v.use.apply(v,w);};var p;if(typeof e!="undefined"){p=e;}else{p=YUI(t);}var s=function(v){v.Env._guidp=["aui",v.version,v.Env._yidx].join("_").replace(/\./g,"_");};s(p);var u=p.config;p.config=p.merge(u,YUI.AUI_config);YUI.AUI=function(y){var v=this;if(y||v instanceof o){var w=p.Array(arguments);w.unshift(p.config);var x=YUI.apply(p.config.win,w);o._uaExtensions(x);o._guidExtensions(x);return x;}return p;};var o=YUI.AUI;o._guidExtensions=s;var q=p.UA;p.mix(o,YUI,true,null,2);p.mix(o,{__version:"@VERSION",defaults:t,html5shiv:function(z){var v=this;var y=z||document;if(q.ie&&y&&y.createElement){var x=o.HTML5_ELEMENTS,w=x.length;while(w--){y.createElement(x[w]);}}return z;},setDefaults:function(w){var v=this;p.mix(o.defaults,w,true,null,0,true);p.mix(p.config,w,true,null,0,true);},HTML5_ELEMENTS:"abbr,article,aside,audio,canvas,command,datalist,details,figure,figcaption,footer,header,hgroup,keygen,mark,meter,nav,output,progress,section,source,summary,time,video".split(",")},true);o.html5shiv();(function(){var y=/\./g;var v=function(C){var B=0;return parseFloat(C.replace(y,function(){return(B++==1)?"":".";}));};var x=["0","0"];var w=function(C,D){var B=(D.match(C)||x)[1];return v(B);};var A={windows:"win",macintosh:"mac"};var z=["ie","opera","chrome","aol","camino","firefox","flock","mozilla","netscape","icab","konqueror","safari"];o._uaExtensions=function(S){var L=navigator;var Y=L.userAgent;var Q=S.UA;var E=Q.os;var I={aol:0,camino:0,firefox:0,flock:0,mozilla:0,netscape:0,icab:0,konqueror:0,safari:0,browser:0,win:E=="windows",mac:E=="macintosh",rhino:E=="rhino",agent:Y};if(Q.ie){I.aol=w(/America Online Browser ([^\s]*);/,Y);}else{if(Q.gecko){I.netscape=w(/(Netscape|Navigator)\/([^\s]*)/,Y);I.flock=w(/Flock\/([^\s]*)/,Y);I.camino=w(/Camino\/([^\s]*)/,Y);I.firefox=w(/Firefox\/([^\s]*)/,Y);}else{if(Q.webkit){I.safari=w(/Version\/([^\s]*) Safari/,Y);}else{I.icab=w(/iCab(?:\/|\s)?([^\s]*)/,Y);I.konqueror=w(/Konqueror\/([^\s]*)/,Y);}}}if(!I.win&&!I.mac){var N=/Linux/.test(Y);var D=/Solaris|SunOS/.test(Y);if(N){Q.os="linux";I.linux=N;}else{if(D){Q.os="sun";I.sun=D;}}}S.mix(Q,I);var T=[];var K=0;var X;var G;var V;var J;var M={string:"",major:K};var U=z.length;while(U--){X=z[U];G=Q[X];if(G>0){K=parseInt(G,10);V=X+K;J=(X+G);if(String(G).indexOf(".")>-1){J=J.replace(/\.(\d).*/,"-$1");}else{J+="-0";}T.push(X,V,J);M.string=X+"";M.major=K;}}Q.version=M;Q.renderer="";var W=S.config.doc.documentElement;Q.dir=W.getAttribute("dir")||"ltr";if(Q.ie){Q.renderer="trident";}else{if(Q.gecko){Q.renderer="gecko";}else{if(Q.webkit){Q.renderer="webkit";}else{if(Q.opera){Q.renderer="presto";}}}}S.UA=Q;var H=[Q.renderer,Q.dir,"js"].concat(T);var O=A[Q.os]||Q.os;H.push(O);if(Q.mobile){H.push("mobile");}if(Q.secure){H.push("secure");}Q.selectors=H.join(" ");if(!W._yuid){W.className+=" "+Q.selectors;var Z=S.config,C=Z.doc,B,R;B=!(R=!!(Z.win.SVGAngle||C.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")));if(B){var P=C.createElement("div");var F;P.innerHTML='<v:shape adj="1"/>';F=P.firstChild;F.style.behavior="url(#default#VML)";if(!(F&&typeof F.adj=="object")){B=false;}P=null;}o._VML=B;o._SVG=R;S.stamp(W);}Q.vml=o._VML;Q.svg=o._SVG;};})();o._uaExtensions(p);if(q.ie&&q.version.major<=6){try{document.execCommand("BackgroundImageCache",false,true);}catch(r){}}})();},"gallery-2011.02.09-21-32",{requires:["gallery-aui-node-base","gallery-aui-component","gallery-aui-delayed-task","gallery-aui-selector","event","oop"],skinnable:false});
View
487 build/gallery-aui-base/gallery-aui-base.js
@@ -1,41 +1,162 @@
YUI.add('gallery-aui-base', function(A) {
-A.mix(A.Array, {
- remove: function(a, from, to) {
- var rest = a.slice((to || from) + 1 || a.length);
- a.length = (from < 0) ? (a.length + from) : from;
+var Lang = A.Lang,
+ isArray = Lang.isArray,
+ isFunction = Lang.isFunction,
+ isString = Lang.isString,
- return a.push.apply(a, rest);
- },
+ AArray = A.Array,
+ LString = A.namespace('Lang.String'),
+ arrayIndexOf = AArray.indexOf,
- removeItem: function(a, item) {
- var index = A.Array.indexOf(a, item);
+ EMPTY_STR = '',
- return A.Array.remove(a, index);
+ DOC = A.config.doc,
+ FIRST_CHILD = 'firstChild',
+ INNER_HTML = 'innerHTML',
+ NODE_VALUE = 'nodeValue',
+ NORMALIZE = 'normalize';
+
+A.mix(
+ LString,
+ {
+ contains: function(s, ss) {
+ return s.indexOf(ss) != -1;
+ },
+
+ endsWith: function(str, suffix) {
+ var length = (str.length - suffix.length);
+
+ return ((length >= 0) && (str.indexOf(suffix, length) == length));
+ },
+
+ // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
+ escapeRegEx: function(str) {
+ return str.replace(/([.*+?^$(){}|[\]\/\\])/g, '\\$1');
+ },
+
+ repeat: function(string, length) {
+ return new Array(length + 1).join(string);
+ },
+
+ padNumber: function(num, length, precision) {
+ var str = precision ? Number(num).toFixed(precision) : String(num);
+ var index = str.indexOf('.');
+
+ if (index == -1) {
+ index = str.length;
+ }
+
+ return LString.repeat('0', Math.max(0, length - index)) + str;
+ },
+
+ remove: function(s, substitute, all) {
+ var re = new RegExp(LString.escapeRegEx(substitute), all ? 'g' : '');
+
+ return s.replace(re, '');
+ },
+
+ removeAll: function(s, substitute) {
+ return LString.remove(s, substitute, true);
+ },
+
+ startsWith: function(str, prefix) {
+ return (str.lastIndexOf(prefix, 0) == 0);
+ },
+
+ trim: Lang.trim,
+
+ // inspired from Google unescape entities
+ unescapeEntities: function(str) {
+ if (LString.contains(str, '&')) {
+ if (DOC && !LString.contains(str, '<')) {
+ str = LString._unescapeEntitiesUsingDom(str);
+ }
+ else {
+ // Fall back on pure XML entities
+ str = LString._unescapeXmlEntities(str);
+ }
+ }
+
+ return str;
+ },
+
+ _unescapeEntitiesUsingDom: function(str) {
+ var el = LString._unescapeNode;
+
+ el[INNER_HTML] = str;
+
+ if (el[NORMALIZE]) {
+ el[NORMALIZE]();
+ }
+
+ str = el.firstChild.nodeValue;
+
+ el[INNER_HTML] = EMPTY_STR;
+
+ return str;
+ },
+
+ _unescapeXmlEntities: function(str) {
+ return str.replace(/&([^;]+);/g, function(s, entity) {
+ switch (entity) {
+ case 'amp':
+ return '&';
+ case 'lt':
+ return '<';
+ case 'gt':
+ return '>';
+ case 'quot':
+ return '"';
+ default:
+ if (entity.charAt(0) == '#') {
+ var n = Number('0' + entity.substr(1));
+
+ if (!isNaN(n)) {
+ return String.fromCharCode(n);
+ }
+ }
+
+ return s;
+ }
+ });
+ },
+
+ _unescapeNode: DOC.createElement('a')
}
-});
+);
-var Lang = A.Lang;
-var isArray = Lang.isArray;
-var isFunction = Lang.isFunction;
-var isString = Lang.isString;
+A.mix(
+ AArray,
+ {
+ remove: function(a, from, to) {
+ var rest = a.slice((to || from) + 1 || a.length);
+ a.length = (from < 0) ? (a.length + from) : from;
+
+ return a.push.apply(a, rest);
+ },
+
+ removeItem: function(a, item) {
+ var index = arrayIndexOf(a, item);
+
+ return AArray.remove(a, index);
+ }
+ }
+);
A.mix(
Lang,
{
emptyFn: function() {},
+
emptyFnFalse: function() {
return false;
},
+
emptyFnTrue: function() {
return true;
},
- // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
- escapeRegEx: function(str) {
- return str.replace(/([.*+?^$(){}|[\]\/\\])/g, '\\$1');
- },
-
isGuid: function(id) {
var instance = this;
@@ -89,7 +210,7 @@ A.mix(
);
;(function() {
/*
- * Alloy JavaScript Library vgallery-2010.08.18-17-12
+ * Alloy JavaScript Library vgallery-2011.02.09-21-32
* http://alloy.liferay.com/
*
* Copyright (c) 2010 Liferay Inc.
@@ -139,15 +260,15 @@ A.mix(
var ALLOY;
- try {
+ if (typeof A != 'undefined') {
ALLOY = A;
}
- catch (e) {
+ else {
ALLOY = YUI(defaults);
}
var guidExtensions = function(A) {
- A.Env._guidp = ['aui', A.version, A.Env._yidx].join('-').replace(/\./g, '-');
+ A.Env._guidp = ['aui', A.version, A.Env._yidx].join('_').replace(/\./g, '_');
};
guidExtensions(ALLOY);
@@ -229,128 +350,238 @@ A.mix(
UA extensions
*/
- AUI._uaExtensions = function(A) {
- var p = navigator.platform;
- var u = navigator.userAgent;
- var b = /(Firefox|Opera|Chrome|Safari|KDE|iCab|Flock|IE)/.exec(u);
- var os = /(Win|Mac|Linux|iPhone|iPad|Sun|Solaris)/.exec(p);
- var versionDefaults = [0,0];
-
- b = (!b || !b.length) ? (/(Mozilla)/.exec(u) || ['']) : b;
- os = (!os || !os.length) ? [''] : os;
-
- UA = A.merge(
- UA,
- {
- gecko: /Gecko/.test(u) && !/like Gecko/.test(u),
- webkit: /WebKit/.test(u),
-
- aol: /America Online Browser/.test(u),
- camino: /Camino/.test(u),
- firefox: /Firefox/.test(u),
- flock: /Flock/.test(u),
- icab: /iCab/.test(u),
- konqueror: /KDE/.test(u),
- mozilla: /mozilla/.test(u),
- ie: /MSIE/.test(u),
- netscape: /Netscape/.test(u),
- opera: /Opera/.test(u),
- chrome: /Chrome/.test(u),
- safari: /Safari/.test(u) && !(/Chrome/.test(u)),
- browser: b[0].toLowerCase(),
-
- win: /Win/.test(p),
- mac: /Mac/.test(p),
- linux: /Linux/.test(p),
- iphone: (p == 'iPhone'),
- ipad: (p == 'iPad'),
- sun: /Solaris|SunOS/.test(p),
- os: os[0].toLowerCase(),
-
- platform: p,
- agent: u
- }
- );
+ (function() {
+ var REGEX_VERSION_DOT = /\./g;
+
+ var parseVersionNumber = function(str) {
+ var count = 0;
- UA.version = {
- string: ''
+ return parseFloat(
+ str.replace(
+ REGEX_VERSION_DOT,
+ function() {
+ return (count++ == 1) ? '' : '.';
+ }
+ )
+ );
};
- if (UA.ie) {
- UA.version.string = (/MSIE ([^;]+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.firefox) {
- UA.version.string = (/Firefox\/(.+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.safari) {
- UA.version.string = (/Version\/([^\s]+)/.exec(u) || versionDefaults)[1];
- }
- else if (UA.opera) {
- UA.version.string = (/Opera\/([^\s]+)/.exec(u) || versionDefaults)[1];
- }
+ var DEFAULTS_VERSION = ['0','0'];
- UA.version.number = parseFloat(UA.version.string) || versionDefaults[0];
- UA.version.major = (/([^\.]+)/.exec(UA.version.string) || versionDefaults)[1];
+ var getVersion = function(regex, userAgent) {
+ var version = (userAgent.match(regex) || DEFAULTS_VERSION)[1];
- UA[UA.browser + UA.version.major] = true;
+ return parseVersionNumber(version);
+ };
- UA.renderer = '';
+ var MAP_OS_SELECTORS = {
+ windows: 'win',
+ macintosh: 'mac'
+ };
- var documentElement = document.documentElement;
+ var BROWSERS = [
+ 'ie',
+ 'opera',
+ 'chrome',
+ 'aol',
+ 'camino',
+ 'firefox',
+ 'flock',
+ 'mozilla',
+ 'netscape',
+ 'icab',
+ 'konqueror',
+ 'safari'
+ ];
- UA.dir = documentElement.getAttribute('dir') || 'ltr';
+ AUI._uaExtensions = function(A) {
+ var nav = navigator;
- if (UA.ie) {
- UA.renderer = 'trident';
- }
- else if (UA.gecko) {
- UA.renderer = 'gecko';
- }
- else if (UA.webkit) {
- UA.renderer = 'webkit';
- }
- else if (UA.opera) {
- UA.renderer = 'presto';
- }
+ var userAgent = nav.userAgent;
- A.UA = UA;
+ var UA = A.UA;
+ var OS = UA.os;
- /*
- * Browser selectors
- */
+ var UAX = {
+ aol: 0,
- var selectors = [
- UA.renderer,
- UA.browser,
- UA.browser + UA.version.major,
- UA.os,
- UA.dir,
- 'js'
- ];
+ camino: 0,
+ firefox: 0,
+ flock: 0,
+ mozilla: 0,
+ netscape: 0,
- if (UA.os == 'macintosh') {
- selectors.push('mac');
- }
- else if (UA.os == 'windows') {
- selectors.push('win');
- }
+ icab: 0,
+ konqueror: 0,
- if (UA.mobile) {
- selectors.push('mobile');
- }
+ safari: 0,
- if (UA.secure) {
- selectors.push('secure');
- }
+ browser: 0,
- UA.selectors = selectors.join(' ');
+ win: OS == 'windows',
+ mac: OS == 'macintosh',
+ rhino: OS == 'rhino',
- if (!documentElement._yuid) {
- documentElement.className += ' ' + UA.selectors;
+ agent: userAgent
+ };
- A.stamp(documentElement);
- }
- };
+ if (UA.ie) {
+ UAX.aol = getVersion(/America Online Browser ([^\s]*);/, userAgent);
+ }
+ else if (UA.gecko) {
+ UAX.netscape = getVersion(/(Netscape|Navigator)\/([^\s]*)/, userAgent);
+ UAX.flock = getVersion(/Flock\/([^\s]*)/, userAgent);
+ UAX.camino = getVersion(/Camino\/([^\s]*)/, userAgent);
+ UAX.firefox = getVersion(/Firefox\/([^\s]*)/, userAgent);
+ }
+ else if (UA.webkit) {
+ UAX.safari = getVersion(/Version\/([^\s]*) Safari/, userAgent);
+ }
+ else {
+ UAX.icab = getVersion(/iCab(?:\/|\s)?([^\s]*)/, userAgent);
+ UAX.konqueror = getVersion(/Konqueror\/([^\s]*)/, userAgent);
+ }
+
+ if (!UAX.win && !UAX.mac) {
+ var linux = /Linux/.test(userAgent);
+ var sun = /Solaris|SunOS/.test(userAgent);
+
+ if (linux) {
+ UA.os = 'linux';
+ UAX.linux = linux;
+ }
+ else if (sun) {
+ UA.os = 'sun';
+ UAX.sun = sun;
+ }
+ }
+
+ A.mix(UA, UAX);
+
+ var browserList = [];
+ var versionMajor = 0;
+
+ var browser;
+ var version;
+ var uaVersionMajor;
+ var uaVersionMinor;
+
+ var versionObj = {
+ string: '',
+ major: versionMajor
+ };
+
+ var i = BROWSERS.length;
+
+ while (i--) {
+ browser = BROWSERS[i];
+ version = UA[browser];
+
+ if (version > 0) {
+ versionMajor = parseInt(version, 10);
+ uaVersionMajor = browser + versionMajor;
+
+ uaVersionMinor = (browser + version);
+
+ if (String(version).indexOf('.') > -1) {
+ uaVersionMinor = uaVersionMinor.replace(/\.(\d).*/, '-$1');
+ }
+ else {
+ uaVersionMinor += '-0';
+ }
+
+ browserList.push(browser, uaVersionMajor, uaVersionMinor);
+
+ versionObj.string = browser + '';
+ versionObj.major = versionMajor;
+ }
+ }
+
+ UA.version = versionObj;
+
+ UA.renderer = '';
+
+ var documentElement = A.config.doc.documentElement;
+
+ UA.dir = documentElement.getAttribute('dir') || 'ltr';
+
+ if (UA.ie) {
+ UA.renderer = 'trident';
+ }
+ else if (UA.gecko) {
+ UA.renderer = 'gecko';
+ }
+ else if (UA.webkit) {
+ UA.renderer = 'webkit';
+ }
+ else if (UA.opera) {
+ UA.renderer = 'presto';
+ }
+
+ A.UA = UA;
+
+ /*
+ * Browser selectors
+ */
+
+ var selectors = [
+ UA.renderer,
+ UA.dir,
+ 'js'
+ ].concat(browserList);
+
+ var osSelector = MAP_OS_SELECTORS[UA.os] || UA.os;
+
+ selectors.push(osSelector);
+
+ if (UA.mobile) {
+ selectors.push('mobile');
+ }
+
+ if (UA.secure) {
+ selectors.push('secure');
+ }
+
+ UA.selectors = selectors.join(' ');
+
+ // The methods in this if block only run once across all instances
+ if (!documentElement._yuid) {
+ documentElement.className += ' ' + UA.selectors;
+
+ var CONFIG = A.config,
+ DOC = CONFIG.doc,
+ vml,
+ svg;
+
+ vml = !(svg = !!(CONFIG.win.SVGAngle || DOC.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1')));
+
+ if (vml) {
+ var div = DOC.createElement('div');
+ var behaviorObj;
+
+ div.innerHTML = '<v:shape adj="1"/>';
+
+ behaviorObj = div.firstChild;
+
+ behaviorObj.style.behavior = 'url(#default#VML)';
+
+ if (!(behaviorObj && typeof behaviorObj.adj == 'object')) {
+ vml = false;
+ }
+
+ div = null;
+ }
+
+ AUI._VML = vml;
+ AUI._SVG = svg;
+
+ A.stamp(documentElement);
+ }
+
+ UA.vml = AUI._VML;
+ UA.svg = AUI._SVG;
+ };
+ })();
AUI._uaExtensions(ALLOY);
@@ -368,4 +599,4 @@ A.mix(
})();
-}, 'gallery-2010.08.18-17-12' ,{skinnable:false, requires:['gallery-aui-node-base','gallery-aui-component','gallery-aui-delayed-task','gallery-aui-selector','event','oop']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['gallery-aui-node-base','gallery-aui-component','gallery-aui-delayed-task','gallery-aui-selector','event','oop'], skinnable:false});
View
14 build/gallery-aui-chart/gallery-aui-chart-debug.js
@@ -39,9 +39,6 @@ var Chart = A.Component.create(
request: {
value: '*'
},
- dataSource: {
- value: null
- },
series: {
value: null
},
@@ -175,11 +172,14 @@ var Chart = A.Component.create(
instance._swfWidget = new A.SWF(params);
instance._swfNode = instance._swfWidget._swf;
- instance._swf = instance._swfNode.getDOM();
- instance._swfWidget.on('swfReady', instance._eventHandler, instance);
+ if (instance._swfNode) {
+ instance._swf = instance._swfNode.getDOM();
+
+ instance._swfWidget.on('swfReady', instance._eventHandler, instance);
- instance.set('swfCfg', params);
+ instance.set('swfCfg', params);
+ }
},
bindUI: function() {
@@ -1120,4 +1120,4 @@ A.extend(
A.Chart.StackedColumnSeries = StackedColumnSeries;
-}, 'gallery-2010.08.18-17-12' ,{skinnable:false, requires:['datasource','gallery-aui-swf','json']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['datasource','gallery-aui-swf','json'], skinnable:false});
View
6 build/gallery-aui-chart/gallery-aui-chart-min.js
@@ -1,3 +1,3 @@
-YUI.add("gallery-aui-chart",function(Y){var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="chart",X=S(L),G=Y.config.base+"gallery-aui-chart/assets/chart.swf";YUI.AUI.namespace("_CHART");YUI.AUI.namespace("defaults.chart");var d=Y.Component.create({NAME:L,ATTRS:{type:{value:"pie"},dataSource:{value:null},altText:{getter:"_getAltText",setter:"_setAltText"},swfURL:{valueFn:function(){return YUI.AUI.defaults.chart.swfURL||G;}},swfCfg:{value:{}},request:{value:"*"},dataSource:{value:null},series:{value:null},categoryNames:{getter:"_getCategoryNames",setter:"_setCategoryNames"},dataTipFunction:{setter:"_setDataTipFunction"},legendLabelFunction:{setter:"_setLegendLabelFunction"},style:{value:null},pollingInterval:{value:0}},proxyFunctionCount:0,createProxyFunction:function(i,h){var A=d.proxyFunctionCount;var j="proxyFunction"+A;YUI.AUI._CHART[j]=Y.bind(i,h);d.proxyFunctionCount++;return"YUI.AUI._CHART."+j;},getFunctionReference:function(i){var A=this;if(H.isFunction(i)){i=d.createProxyFunction(i);}else{if(i.fn&&H.isFunction(i.fn)){var h=[i.fn];if(i.context&&H.isObject(context)){h.push(i.context);}i=d.createProxyFunction(A,h);}}return i;},removeProxyFunction:function(A){if(A&&A.indexOf("YUI.AUI._CHART.proxyFunction")>-1){A=A.substr(12);YUI.AUI._CHART[A]=null;}},prototype:{renderUI:function(){var o=this;var A={align:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",menu:"",name:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};var n=o.get("contentBox");var j={boundingBox:n,fixedAttributes:{allowScriptAccess:"always"},flashVars:{allowedDomain:document.location.hostname},backgroundColor:n.getStyle("backgroundColor"),url:o.get("swfURL"),height:o.get("height"),width:o.get("width"),version:9.045};var p=o.get("swfCfg");for(var l in p){if(A.hasOwnProperty(l)){j.fixedAttributes[l]=p[l];}else{j[l]=p[l];}}var m=j.version;if(m&&H.isValue(m)&&m!="undefined"){var k=(/\w*.\w*/.exec(((m).toString()).replace(/.0./g,"."))).toString();var h=k.split(".");m=h[0]+".";switch((h[1].toString()).length){case 1:m+="00";break;case 2:m+="0";break;}m+=h[1];j.version=parseFloat(m);}o._swfWidget=new Y.SWF(j);o._swfNode=o._swfWidget._swf;o._swf=o._swfNode.getDOM();o._swfWidget.on("swfReady",o._eventHandler,o);o.set("swfCfg",j);},bindUI:function(){var A=this;A.publish("itemMouseOver");A.publish("itemMouseOut");A.publish("itemClick");A.publish("itemDblClick");A.publish("itemDragStart");A.publish("itemDragEnd");A.publish("itemDrag");A.after("seriesChange",A.refreshData);A.after("dataSourceChange",A.refreshData);A.after("pollingIntervalChange",A.refreshData);var h=A.get("dataSource");h.after("response",A._loadDataHandler,A);},setStyle:function(h,i){var A=this;i=Y.JSON.stringify(i);A._swf.setStyle(h,i);},setStyles:function(h){var A=this;h=Y.JSON.stringify(h);A._swf.setStyles(h);},setSeriesStyles:function(j){var A=this;for(var h=0;h<j.length;h++){j[h]=Y.JSON.stringify(j[h]);}A._swf.setSeriesStyles(j);},_eventHandler:function(h){var A=this;if(h.type=="swfReady"){A._swfNode=A._swfWidget._swf;A._swf=A._swfNode.getDOM();A._loadHandler();A.fire("contentReady");}},_loadHandler:function(){var A=this;if(A._swf&&A._swf.setType){A._swf.setType(A.get("type"));var h=A.get("style");if(h){A.setStyles(h);}A._syncChartAttrs();A._initialized=true;A.refreshData();}},_syncChartAttrs:function(){var A=this;var h=A._originalConfig;if(h.categoryNames){A.set("categoryNames",h.categoryNames);}if(h.dataTipFunction){A.set("dataTipFunction",h.dataTipFunction);}if(h.legendLabelFunction){A.set("legendLabelFunction",h.legendLabelFunction);}if(h.series){A.set("series",h.series);}},refreshData:function(){var A=this;if(A._initialized){var k=A.get("dataSource");if(k){var h=A._pollingID;if(h!==null){k.clearInterval(h);A._pollingID=null;}var j=A.get("pollingInterval");var i=A.get("request");if(j>0){A._pollingID=k.setInterval(j,i);}k.sendRequest(i);}}},_loadDataHandler:function(h){var t=this;if(t._swf&&!h.error){var r=t._seriesFunctions;if(r){for(var o=0;o<r.length;o++){d.removeProxyFunction(r[o]);}t._seriesFunctions=null;}t._seriesFunctions=[];var l=[];var k=0;var u=null;var A=t.get("series");if(A!==null){k=A.length;for(var o=0;o<k;o++){u=A[o];var j={};for(var s in u){if(s=="style"){if(u.style!==null){j.style=Y.JSON.stringify(u.style);}}else{if(s=="labelFunction"){if(u.labelFunction!==null){j.labelFunction=d.getFunctionReference(u.labelFunction);t._seriesFunctions.push(j.labelFunction);}}else{if(s=="dataTipFunction"){if(u.dataTipFunction!==null){j.dataTipFunction=d.getFunctionReference(u.dataTipFunction);t._seriesFunctions.push(j.dataTipFunction);}}else{if(s=="legendLabelFunction"){if(u.legendLabelFunction!==null){j.legendLabelFunction=d.getFunctionReference(u.legendLabelFunction);t._seriesFunctions.push(j.legendLabelFunction);}}else{j[s]=u[s];}}}}}l.push(j);}}var q=t.get("type");var n=h.response.results;if(k>0){for(var o=0;o<k;o++){u=l[o];if(!u.type){u.type=q;}u.dataProvider=n;}}else{var m={type:q,dataProvider:n};l.push(m);}try{if(t._swf.setDataProvider){t._swf.setDataProvider(l);}}catch(p){t._swf.setDataProvider(l);}}},_getCategoryNames:function(){var A=this;return A._swf.getCategoryNames();},_setCategoryNames:function(h){var A=this;A._swf.setCategoryNames(h);return h;},_setDataTipFunction:function(h){var A=this;if(A._dataTipFunction){d.removeProxyFunction(A._dataTipFunction);}if(h){A._dataTipFunction=h=d.getFunctionReference(h);}A._swf.setDataTipFunction(h);return h;},_setLegendLabelFunction:function(h){var A=this;if(A._legendLabelFunction){d.removeProxyFunction(A._legendLabelFunction);}if(h){A._legendLabelFunction=h=d.getFunctionReference(h);}A._swf.setLegendLabelFunction(h);return h;},_getAltText:function(){var A=this;return A._swf.getAltText();},_setAltText:function(){var A=this;A._swf.setAltText(value);return value;},_pollingID:null}});Y.Chart=d;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="piechart";var Q=Y.Component.create({NAME:L,ATTRS:{dataField:{getter:"_getDataField",setter:"_setDataField",validator:H.isString},categoryField:{getter:"_getCategoryField",setter:"_setCategoryField",validator:H.isString}},EXTENDS:Y.Chart,prototype:{_syncChartAttrs:function(){var A=this;
-Q.superclass._syncChartAttrs.apply(A,arguments);var h=A._originalConfig;if(h.dataField){A.set("dataField",h.dataField);}if(h.categoryField){A.set("categoryField",h.categoryField);}},_getDataField:function(){var A=this;return A._swf.getDataField();},_setDataField:function(h){var A=this;A._swf.setDataField(h);return h;},_getCategoryField:function(){var A=this;return A._swf.getCategoryField();},_setCategoryField:function(h){var A=this;A._swf.setCategoryField(h);return h;}}});Y.PieChart=Q;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="cartesianchart",K=S(L);var E=Y.Component.create({NAME:L,ATTRS:{xField:{getter:"_getXField",setter:"_setXField",validator:H.isString},yField:{getter:"_getYField",setter:"_setYField",validator:H.isString},xAxis:{setter:"_setXAxis"},xAxes:{setter:"_setXAxes"},yAxis:{setter:"_setYAxis"},yAxes:{setter:"_setYAxes"},constrain2view:{setter:"_setConstrain2view"}},EXTENDS:Y.Chart,prototype:{initializer:function(){var A=this;A._xAxisLabelFunctions=[];A._yAxisLabelFunctions=[];},destructor:function(){var A=this;A._removeAxisFunctions(A._xAxisLabelFunctions);A._removeAxisFunctions(A._yAxisLabelFunctions);},_syncChartAttrs:function(){var A=this;E.superclass._syncChartAttrs.apply(A,arguments);var h=A._originalConfig;if(h.xField){A.set("xField",h.xField);}if(h.yField){A.set("yField",h.yField);}if(h.xAxis){A.set("xAxis",h.xAxis);}if(h.yAxis){A.set("yAxis",h.yAxis);}if(h.xAxes){A.set("xAxes",h.xAxes);}if(h.yAxes){A.set("yAxes",h.yAxes);}if(h.constrain2view){A.set("constrain2view",h.constrain2view);}},_getXField:function(){var A=this;return A._swf.getHorizontalField();},_setXField:function(h){var A=this;A._swf.setHorizontalField(h);return h;},_getYField:function(){var A=this;return A._swf.getVerticalField();},_setYField:function(h){var A=this;A._swf.setVerticalField(h);return h;},_getClonedAxis:function(j){var A=this;var k={};for(var h in j){if(h=="labelFunction"){if(j.labelFunction&&j.labelFunction!==null){k.labelFunction=d.getFunctionReference(j.labelFunction);}}else{k[h]=j[h];}}return k;},_setXAxis:function(h){var A=this;if(h.position!="bottom"&&h.position!="top"){h.position="bottom";}A._removeAxisFunctions(A._xAxisLabelFunctions);h=A._getClonedAxis(h);A._xAxisLabelFunctions.push(h.labelFunction);A._swf.setHorizontalAxis(h);return h;},_setXAxes:function(j){var A=this;A._removeAxisFunctions(A._xAxisLabelFunctions);for(var h=0;h<j.length;h++){var k=j[h];if(k.position=="left"){k.position="bottom";}j[h]=A._getClonedAxis(k);k=j[h];if(k.labelFunction){A._xAxisLabelFunctions.push(k.labelFunction);}A._swf.setHorizontalAxis(k);}},_setYAxis:function(h){var A=this;A._removeAxisFunctions(A._yAxisLabelFunctions);h=A._getClonedAxis(h);A._yAxisLabelFunctions.push(h.labelFunction);A._swf.setVerticalAxis(h);},_setYAxes:function(j){var A=this;A._removeAxisFunctions(A._yAxisLabelFunctions);for(var h=0;h<j.length;h++){j[h]=A._getClonedAxis(j[h]);var k=j[h];if(k.labelFunction){A._yAxisLabelFunctions.push(k.labelFunction);}A._swf.setVerticalAxis(k);}},_setConstrain2view:function(h){var A=this;A._swf.setConstrainViewport(h);},setSeriesStylesByIndex:function(h,i){var A=this;if(A._swf&&A._swf.setSeriesStylesByIndex){i=Y.JSON.stringify(i);A._swf.setSeriesStylesByIndex(h,i);}},_removeAxisFunctions:function(k){var h=this;if(k&&k.length){for(var j=0;j<k.length;j++){var A=k[j];if(A){Y.Chart.removeProxyFunction(A);}}k=[];}}}});Y.CartesianChart=E;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="linechart",Z=S(L);var B=Y.Component.create({NAME:L,ATTRS:{type:{value:"line"}},EXTENDS:Y.CartesianChart});Y.LineChart=B;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="columnchart",N=S(L);var c=Y.Component.create({NAME:L,ATTRS:{type:{value:"column"}},EXTENDS:Y.CartesianChart});Y.ColumnChart=c;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="barchart",R=S(L);var V=Y.Component.create({NAME:L,ATTRS:{type:{value:"bar"}},EXTENDS:Y.CartesianChart});Y.BarChart=V;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="stackedcolumnchart",g=S(L);var f=Y.Component.create({NAME:L,ATTRS:{type:{value:"stackcolumn"}},EXTENDS:Y.CartesianChart});Y.StackedColumnChart=f;var H=Y.Lang,S=Y.ClassNameManager.getClassName,L="stackedbarchart",J=S(L);var M=Y.Component.create({NAME:L,ATTRS:{type:{value:"stackbar"}},EXTENDS:Y.CartesianChart});Y.StackedBarChart=M;var P=function(){};P.prototype={type:null,reverse:false,labelFunction:null,labelSpacing:2,title:null};Y.Chart.Axis=P;var U=function(){U.superclass.constructor.apply(this,arguments);};Y.extend(U,P,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,stackingEnabled:false,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});Y.Chart.NumericAxis=U;var D=function(){D.superclass.constructor.apply(this,arguments);};Y.extend(D,P,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});Y.Chart.TimeAxis=D;var F=function(){F.superclass.constructor.apply(this,arguments);};Y.extend(F,P,{type:"category",categoryNames:null,calculateCategoryCount:false});Y.Chart.CategoryAxis=F;var O=function(){};O.prototype={type:null,displayName:null};Y.Chart.Series=O;var e=function(){e.superclass.constructor.apply(this,arguments);};Y.extend(e,O,{xField:null,yField:null,axis:"primary",showInLegend:true});Y.Chart.CartesianSeries=e;var C=function(){C.superclass.constructor.apply(this,arguments);};Y.extend(C,e,{type:"column"});Y.Chart.ColumnSeries=C;var T=function(){T.superclass.constructor.apply(this,arguments);};Y.extend(T,e,{type:"line"});Y.Chart.LineSeries=T;var a=function(){a.superclass.constructor.apply(this,arguments);};Y.extend(a,e,{type:"bar"});Y.Chart.BarSeries=a;var b=function(){b.superclass.constructor.apply(this,arguments);};Y.extend(b,O,{type:"pie",dataField:null,categoryField:null,labelFunction:null});Y.Chart.PieSeries=b;var I=function(){I.superclass.constructor.apply(this,arguments);
-};Y.extend(I,e,{type:"stackbar"});Y.Chart.StackedBarSeries=I;var W=function(){W.superclass.constructor.apply(this,arguments);};Y.extend(W,e,{type:"stackcolumn"});Y.Chart.StackedColumnSeries=W;},"gallery-2010.08.18-17-12",{skinnable:false,requires:["datasource","gallery-aui-swf","json"]});
+YUI.add("gallery-aui-chart",function(x){var g=x.Lang,r=x.ClassNameManager.getClassName,k="chart",w=r(k),f=x.config.base+"gallery-aui-chart/assets/chart.swf";YUI.AUI.namespace("_CHART");YUI.AUI.namespace("defaults.chart");var D=x.Component.create({NAME:k,ATTRS:{type:{value:"pie"},dataSource:{value:null},altText:{getter:"_getAltText",setter:"_setAltText"},swfURL:{valueFn:function(){return YUI.AUI.defaults.chart.swfURL||f;}},swfCfg:{value:{}},request:{value:"*"},series:{value:null},categoryNames:{getter:"_getCategoryNames",setter:"_setCategoryNames"},dataTipFunction:{setter:"_setDataTipFunction"},legendLabelFunction:{setter:"_setLegendLabelFunction"},style:{value:null},pollingInterval:{value:0}},proxyFunctionCount:0,createProxyFunction:function(I,H){var A=D.proxyFunctionCount;var J="proxyFunction"+A;YUI.AUI._CHART[J]=x.bind(I,H);D.proxyFunctionCount++;return"YUI.AUI._CHART."+J;},getFunctionReference:function(I){var A=this;if(g.isFunction(I)){I=D.createProxyFunction(I);}else{if(I.fn&&g.isFunction(I.fn)){var H=[I.fn];if(I.context&&g.isObject(context)){H.push(I.context);}I=D.createProxyFunction(A,H);}}return I;},removeProxyFunction:function(A){if(A&&A.indexOf("YUI.AUI._CHART.proxyFunction")>-1){A=A.substr(12);YUI.AUI._CHART[A]=null;}},prototype:{renderUI:function(){var N=this;var A={align:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",menu:"",name:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};var M=N.get("contentBox");var I={boundingBox:M,fixedAttributes:{allowScriptAccess:"always"},flashVars:{allowedDomain:document.location.hostname},backgroundColor:M.getStyle("backgroundColor"),url:N.get("swfURL"),height:N.get("height"),width:N.get("width"),version:9.045};var O=N.get("swfCfg");for(var K in O){if(A.hasOwnProperty(K)){I.fixedAttributes[K]=O[K];}else{I[K]=O[K];}}var L=I.version;if(L&&g.isValue(L)&&L!="undefined"){var J=(/\w*.\w*/.exec(((L).toString()).replace(/.0./g,"."))).toString();var H=J.split(".");L=H[0]+".";switch((H[1].toString()).length){case 1:L+="00";break;case 2:L+="0";break;}L+=H[1];I.version=parseFloat(L);}N._swfWidget=new x.SWF(I);N._swfNode=N._swfWidget._swf;if(N._swfNode){N._swf=N._swfNode.getDOM();N._swfWidget.on("swfReady",N._eventHandler,N);N.set("swfCfg",I);}},bindUI:function(){var A=this;A.publish("itemMouseOver");A.publish("itemMouseOut");A.publish("itemClick");A.publish("itemDblClick");A.publish("itemDragStart");A.publish("itemDragEnd");A.publish("itemDrag");A.after("seriesChange",A.refreshData);A.after("dataSourceChange",A.refreshData);A.after("pollingIntervalChange",A.refreshData);var H=A.get("dataSource");H.after("response",A._loadDataHandler,A);},setStyle:function(H,I){var A=this;I=x.JSON.stringify(I);A._swf.setStyle(H,I);},setStyles:function(H){var A=this;H=x.JSON.stringify(H);A._swf.setStyles(H);},setSeriesStyles:function(I){var A=this;for(var H=0;H<I.length;H++){I[H]=x.JSON.stringify(I[H]);}A._swf.setSeriesStyles(I);},_eventHandler:function(H){var A=this;if(H.type=="swfReady"){A._swfNode=A._swfWidget._swf;A._swf=A._swfNode.getDOM();A._loadHandler();A.fire("contentReady");}},_loadHandler:function(){var A=this;if(A._swf&&A._swf.setType){A._swf.setType(A.get("type"));var H=A.get("style");if(H){A.setStyles(H);}A._syncChartAttrs();A._initialized=true;A.refreshData();}},_syncChartAttrs:function(){var A=this;var H=A._originalConfig;if(H.categoryNames){A.set("categoryNames",H.categoryNames);}if(H.dataTipFunction){A.set("dataTipFunction",H.dataTipFunction);}if(H.legendLabelFunction){A.set("legendLabelFunction",H.legendLabelFunction);}if(H.series){A.set("series",H.series);}},refreshData:function(){var A=this;if(A._initialized){var K=A.get("dataSource");if(K){var H=A._pollingID;if(H!==null){K.clearInterval(H);A._pollingID=null;}var J=A.get("pollingInterval");var I=A.get("request");if(J>0){A._pollingID=K.setInterval(J,I);}K.sendRequest(I);}}},_loadDataHandler:function(H){var S=this;if(S._swf&&!H.error){var Q=S._seriesFunctions;if(Q){for(var N=0;N<Q.length;N++){D.removeProxyFunction(Q[N]);}S._seriesFunctions=null;}S._seriesFunctions=[];var K=[];var J=0;var T=null;var A=S.get("series");if(A!==null){J=A.length;for(var N=0;N<J;N++){T=A[N];var I={};for(var R in T){if(R=="style"){if(T.style!==null){I.style=x.JSON.stringify(T.style);}}else{if(R=="labelFunction"){if(T.labelFunction!==null){I.labelFunction=D.getFunctionReference(T.labelFunction);S._seriesFunctions.push(I.labelFunction);}}else{if(R=="dataTipFunction"){if(T.dataTipFunction!==null){I.dataTipFunction=D.getFunctionReference(T.dataTipFunction);S._seriesFunctions.push(I.dataTipFunction);}}else{if(R=="legendLabelFunction"){if(T.legendLabelFunction!==null){I.legendLabelFunction=D.getFunctionReference(T.legendLabelFunction);S._seriesFunctions.push(I.legendLabelFunction);}}else{I[R]=T[R];}}}}}K.push(I);}}var P=S.get("type");var M=H.response.results;if(J>0){for(var N=0;N<J;N++){T=K[N];if(!T.type){T.type=P;}T.dataProvider=M;}}else{var L={type:P,dataProvider:M};K.push(L);}try{if(S._swf.setDataProvider){S._swf.setDataProvider(K);}}catch(O){S._swf.setDataProvider(K);}}},_getCategoryNames:function(){var A=this;return A._swf.getCategoryNames();},_setCategoryNames:function(H){var A=this;A._swf.setCategoryNames(H);return H;},_setDataTipFunction:function(H){var A=this;if(A._dataTipFunction){D.removeProxyFunction(A._dataTipFunction);}if(H){A._dataTipFunction=H=D.getFunctionReference(H);}A._swf.setDataTipFunction(H);return H;},_setLegendLabelFunction:function(H){var A=this;if(A._legendLabelFunction){D.removeProxyFunction(A._legendLabelFunction);}if(H){A._legendLabelFunction=H=D.getFunctionReference(H);}A._swf.setLegendLabelFunction(H);return H;},_getAltText:function(){var A=this;return A._swf.getAltText();},_setAltText:function(){var A=this;A._swf.setAltText(value);return value;},_pollingID:null}});x.Chart=D;var g=x.Lang,r=x.ClassNameManager.getClassName,k="piechart";var p=x.Component.create({NAME:k,ATTRS:{dataField:{getter:"_getDataField",setter:"_setDataField",validator:g.isString},categoryField:{getter:"_getCategoryField",setter:"_setCategoryField",validator:g.isString}},EXTENDS:x.Chart,prototype:{_syncChartAttrs:function(){var A=this;
+p.superclass._syncChartAttrs.apply(A,arguments);var H=A._originalConfig;if(H.dataField){A.set("dataField",H.dataField);}if(H.categoryField){A.set("categoryField",H.categoryField);}},_getDataField:function(){var A=this;return A._swf.getDataField();},_setDataField:function(H){var A=this;A._swf.setDataField(H);return H;},_getCategoryField:function(){var A=this;return A._swf.getCategoryField();},_setCategoryField:function(H){var A=this;A._swf.setCategoryField(H);return H;}}});x.PieChart=p;var g=x.Lang,r=x.ClassNameManager.getClassName,k="cartesianchart",j=r(k);var d=x.Component.create({NAME:k,ATTRS:{xField:{getter:"_getXField",setter:"_setXField",validator:g.isString},yField:{getter:"_getYField",setter:"_setYField",validator:g.isString},xAxis:{setter:"_setXAxis"},xAxes:{setter:"_setXAxes"},yAxis:{setter:"_setYAxis"},yAxes:{setter:"_setYAxes"},constrain2view:{setter:"_setConstrain2view"}},EXTENDS:x.Chart,prototype:{initializer:function(){var A=this;A._xAxisLabelFunctions=[];A._yAxisLabelFunctions=[];},destructor:function(){var A=this;A._removeAxisFunctions(A._xAxisLabelFunctions);A._removeAxisFunctions(A._yAxisLabelFunctions);},_syncChartAttrs:function(){var A=this;d.superclass._syncChartAttrs.apply(A,arguments);var H=A._originalConfig;if(H.xField){A.set("xField",H.xField);}if(H.yField){A.set("yField",H.yField);}if(H.xAxis){A.set("xAxis",H.xAxis);}if(H.yAxis){A.set("yAxis",H.yAxis);}if(H.xAxes){A.set("xAxes",H.xAxes);}if(H.yAxes){A.set("yAxes",H.yAxes);}if(H.constrain2view){A.set("constrain2view",H.constrain2view);}},_getXField:function(){var A=this;return A._swf.getHorizontalField();},_setXField:function(H){var A=this;A._swf.setHorizontalField(H);return H;},_getYField:function(){var A=this;return A._swf.getVerticalField();},_setYField:function(H){var A=this;A._swf.setVerticalField(H);return H;},_getClonedAxis:function(I){var A=this;var J={};for(var H in I){if(H=="labelFunction"){if(I.labelFunction&&I.labelFunction!==null){J.labelFunction=D.getFunctionReference(I.labelFunction);}}else{J[H]=I[H];}}return J;},_setXAxis:function(H){var A=this;if(H.position!="bottom"&&H.position!="top"){H.position="bottom";}A._removeAxisFunctions(A._xAxisLabelFunctions);H=A._getClonedAxis(H);A._xAxisLabelFunctions.push(H.labelFunction);A._swf.setHorizontalAxis(H);return H;},_setXAxes:function(I){var A=this;A._removeAxisFunctions(A._xAxisLabelFunctions);for(var H=0;H<I.length;H++){var J=I[H];if(J.position=="left"){J.position="bottom";}I[H]=A._getClonedAxis(J);J=I[H];if(J.labelFunction){A._xAxisLabelFunctions.push(J.labelFunction);}A._swf.setHorizontalAxis(J);}},_setYAxis:function(H){var A=this;A._removeAxisFunctions(A._yAxisLabelFunctions);H=A._getClonedAxis(H);A._yAxisLabelFunctions.push(H.labelFunction);A._swf.setVerticalAxis(H);},_setYAxes:function(I){var A=this;A._removeAxisFunctions(A._yAxisLabelFunctions);for(var H=0;H<I.length;H++){I[H]=A._getClonedAxis(I[H]);var J=I[H];if(J.labelFunction){A._yAxisLabelFunctions.push(J.labelFunction);}A._swf.setVerticalAxis(J);}},_setConstrain2view:function(H){var A=this;A._swf.setConstrainViewport(H);},setSeriesStylesByIndex:function(H,I){var A=this;if(A._swf&&A._swf.setSeriesStylesByIndex){I=x.JSON.stringify(I);A._swf.setSeriesStylesByIndex(H,I);}},_removeAxisFunctions:function(J){var H=this;if(J&&J.length){for(var I=0;I<J.length;I++){var A=J[I];if(A){x.Chart.removeProxyFunction(A);}}J=[];}}}});x.CartesianChart=d;var g=x.Lang,r=x.ClassNameManager.getClassName,k="linechart",y=r(k);var a=x.Component.create({NAME:k,ATTRS:{type:{value:"line"}},EXTENDS:x.CartesianChart});x.LineChart=a;var g=x.Lang,r=x.ClassNameManager.getClassName,k="columnchart",m=r(k);var C=x.Component.create({NAME:k,ATTRS:{type:{value:"column"}},EXTENDS:x.CartesianChart});x.ColumnChart=C;var g=x.Lang,r=x.ClassNameManager.getClassName,k="barchart",q=r(k);var u=x.Component.create({NAME:k,ATTRS:{type:{value:"bar"}},EXTENDS:x.CartesianChart});x.BarChart=u;var g=x.Lang,r=x.ClassNameManager.getClassName,k="stackedcolumnchart",G=r(k);var F=x.Component.create({NAME:k,ATTRS:{type:{value:"stackcolumn"}},EXTENDS:x.CartesianChart});x.StackedColumnChart=F;var g=x.Lang,r=x.ClassNameManager.getClassName,k="stackedbarchart",i=r(k);var l=x.Component.create({NAME:k,ATTRS:{type:{value:"stackbar"}},EXTENDS:x.CartesianChart});x.StackedBarChart=l;var o=function(){};o.prototype={type:null,reverse:false,labelFunction:null,labelSpacing:2,title:null};x.Chart.Axis=o;var t=function(){t.superclass.constructor.apply(this,arguments);};x.extend(t,o,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,stackingEnabled:false,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left",adjustMaximumByMajorUnit:true,adjustMinimumByMajorUnit:true});x.Chart.NumericAxis=t;var c=function(){c.superclass.constructor.apply(this,arguments);};x.extend(c,o,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});x.Chart.TimeAxis=c;var e=function(){e.superclass.constructor.apply(this,arguments);};x.extend(e,o,{type:"category",categoryNames:null,calculateCategoryCount:false});x.Chart.CategoryAxis=e;var n=function(){};n.prototype={type:null,displayName:null};x.Chart.Series=n;var E=function(){E.superclass.constructor.apply(this,arguments);};x.extend(E,n,{xField:null,yField:null,axis:"primary",showInLegend:true});x.Chart.CartesianSeries=E;var b=function(){b.superclass.constructor.apply(this,arguments);};x.extend(b,E,{type:"column"});x.Chart.ColumnSeries=b;var s=function(){s.superclass.constructor.apply(this,arguments);};x.extend(s,E,{type:"line"});x.Chart.LineSeries=s;var z=function(){z.superclass.constructor.apply(this,arguments);};x.extend(z,E,{type:"bar"});x.Chart.BarSeries=z;var B=function(){B.superclass.constructor.apply(this,arguments);};x.extend(B,n,{type:"pie",dataField:null,categoryField:null,labelFunction:null});x.Chart.PieSeries=B;var h=function(){h.superclass.constructor.apply(this,arguments);
+};x.extend(h,E,{type:"stackbar"});x.Chart.StackedBarSeries=h;var v=function(){v.superclass.constructor.apply(this,arguments);};x.extend(v,E,{type:"stackcolumn"});x.Chart.StackedColumnSeries=v;},"gallery-2011.02.09-21-32",{requires:["datasource","gallery-aui-swf","json"],skinnable:false});
View
14 build/gallery-aui-chart/gallery-aui-chart.js
@@ -39,9 +39,6 @@ var Chart = A.Component.create(
request: {
value: '*'
},
- dataSource: {
- value: null
- },
series: {
value: null
},
@@ -175,11 +172,14 @@ var Chart = A.Component.create(
instance._swfWidget = new A.SWF(params);
instance._swfNode = instance._swfWidget._swf;
- instance._swf = instance._swfNode.getDOM();
- instance._swfWidget.on('swfReady', instance._eventHandler, instance);
+ if (instance._swfNode) {
+ instance._swf = instance._swfNode.getDOM();
+
+ instance._swfWidget.on('swfReady', instance._eventHandler, instance);
- instance.set('swfCfg', params);
+ instance.set('swfCfg', params);
+ }
},
bindUI: function() {
@@ -1120,4 +1120,4 @@ A.extend(
A.Chart.StackedColumnSeries = StackedColumnSeries;
-}, 'gallery-2010.08.18-17-12' ,{skinnable:false, requires:['datasource','gallery-aui-swf','json']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['datasource','gallery-aui-swf','json'], skinnable:false});
View
2  build/gallery-aui-color-picker-base/assets/skins/sam/gallery-aui-color-picker-base.css
@@ -1 +1 @@
-.yui3-colorpicker{width:315px;}.yui3-colorpicker-container{height:192px;position:relative;}.yui3-colorpicker-canvas{background:#f00 url(picker_bg.png);background-color:#f00;height:184px;left:5px;outline:0 none;position:absolute;top:5px;width:184px;}.yui3-colorpicker-controls{height:115px;left:226px;position:absolute;top:75px;width:80px;}.yui3-colorpicker-controls .yui3-field-content .yui3-field-label{margin-top:0;width:20%;}.yui3-colorpicker-controls .yui3-field-content .yui3-field-input-text{width:60%;}.yui3-colorpicker-controls .yui3-field-content{clear:both;padding:3px 0;}.yui3-colorpicker-hue-thumb{cursor:default;height:7px;position:absolute;width:18px;}.yui3-colorpicker-hue-thumb-image{background:url(color_indic.png) no-repeat 0 0;display:block;height:7px;margin-left:-2px;margin-top:-2px;width:18px;}.yui3-colorpicker-hue-canvas{background:url(hue.png) no-repeat -2px -2px;height:186px;left:200px;outline:0 none;position:absolute;top:5px;width:14px;}.yui3-colorpicker-mask{left:0;position:absolute;top:0;}.yui3-colorpicker-swatch{border:2px solid #727C81;height:60px;left:226px;position:absolute;top:5px;width:60px;}.yui3-colorpicker-swatch-current,.yui3-colorpicker-swatch-original{background:#fff;height:30px;left:0;position:absolute;top:0;width:100%;}.yui3-colorpicker-swatch-original{top:auto;bottom:0;cursor:pointer;}.yui3-colorpicker-thumb{cursor:default;position:absolute;}.yui3-colorpicker-thumb-image{background:url(select.png) no-repeat 0 0;display:block;height:11px;width:11px;}.yui3-colorpicker-hue-slider-content{display:inline;position:static;}
+.yui3-colorpicker{width:315px}.yui3-colorpicker-container{height:192px;position:relative}.yui3-colorpicker-canvas{background:#f00 url(picker_bg.png);background-color:#f00;height:184px;left:5px;outline:0 none;position:absolute;top:5px;width:184px}.yui3-colorpicker-controls{height:115px;left:226px;position:absolute;top:75px;width:80px}.yui3-colorpicker-controls .yui3-field-content .yui3-field-label{margin-top:0;width:20%}.yui3-colorpicker-controls .yui3-field-content .yui3-field-input-text{width:60%}.yui3-colorpicker-controls .yui3-field-content{clear:both;padding:3px 0}.yui3-colorpicker-hue-thumb{cursor:default;height:7px;position:absolute;width:18px}.yui3-colorpicker-hue-thumb-image{background:url(color_indic.png) no-repeat 0 0;display:block;height:7px;margin-left:-2px;margin-top:-2px;width:18px}.yui3-colorpicker-hue-canvas{background:url(hue.png) no-repeat -2px -2px;height:186px;left:200px;outline:0 none;position:absolute;top:5px;width:14px}.yui3-colorpicker-mask{left:0;position:absolute;top:0}.yui3-colorpicker-swatch{border:2px solid #727c81;height:60px;left:226px;position:absolute;top:5px;width:60px}.yui3-colorpicker-swatch-current,.yui3-colorpicker-swatch-original{background:#fff;height:30px;left:0;position:absolute;top:0;width:100%}.yui3-colorpicker-swatch-original{top:auto;bottom:0;cursor:pointer}.yui3-colorpicker-thumb{cursor:default;position:absolute}.yui3-colorpicker-thumb-image{background:url(select.png) no-repeat 0 0;display:block;height:11px;width:11px}.yui3-colorpicker-hue-slider-content{display:inline;position:static}
View
30 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base-debug.js
@@ -10,7 +10,7 @@ var Lang = A.Lang,
isArray = Lang.isArray,
isObject = Lang.isObject,
- Color = A.Color,
+ ColorUtil = A.ColorUtil,
NAME = 'colorpicker',
@@ -108,7 +108,7 @@ var ColorPicker = A.Component.create(
hex = hex.split('#').join('')
}
else {
- hex = Color.rgb2hex(rgb);
+ hex = ColorUtil.rgb2hex(rgb);
}
return hex;
@@ -117,7 +117,7 @@ var ColorPicker = A.Component.create(
var instance = this;
if (value) {
- var rgb = Color.getRGB('#' + value);
+ var rgb = ColorUtil.getRGB('#' + value);
value = rgb.hex.split('#').join('');
@@ -141,7 +141,7 @@ var ColorPicker = A.Component.create(
var rgb = instance.get('rgb');
- return Color.rgb2hsv(rgb);
+ return ColorUtil.rgb2hsv(rgb);
},
setter: function(value) {
var instance = this;
@@ -149,7 +149,7 @@ var ColorPicker = A.Component.create(
if (isArray(value)) {
var current = instance.get('hsv');
- var rgb = Color.hsv2rgb(value);
+ var rgb = ColorUtil.hsv2rgb(value);
instance.set('rgb', rgb);
@@ -181,7 +181,7 @@ var ColorPicker = A.Component.create(
},
rgb: {
- value: new Color.RGB(255, 255, 255),
+ value: new ColorUtil.RGB(255, 255, 255),
setter: function(value) {
var instance = this;
@@ -209,11 +209,11 @@ var ColorPicker = A.Component.create(
}
if (set) {
- r = Color.constrainTo(r, 0, 255, 255);
- g = Color.constrainTo(g, 0, 255, 255);
- b = Color.constrainTo(b, 0, 255, 255);
+ r = ColorUtil.constrainTo(r, 0, 255, 255);
+ g = ColorUtil.constrainTo(g, 0, 255, 255);
+ b = ColorUtil.constrainTo(b, 0, 255, 255);
- value = new Color.RGB(r, g, b);
+ value = new ColorUtil.RGB(r, g, b);
}
return value;
@@ -253,6 +253,8 @@ var ColorPicker = A.Component.create(
value = instance._buttonTrigger.get('boundingBox');
+ value = new A.NodeList(value);
+
instance.set('trigger', value);
}
@@ -426,7 +428,7 @@ var ColorPicker = A.Component.create(
var size = instance.get('pickersize');
var hue = (size - instance._hueSlider.get('value')) / size;
- hue = Color.constrainTo(hue, 0, 1, 0);
+ hue = ColorUtil.constrainTo(hue, 0, 1, 0);
return (hue === 1) ? 0 : hue;
},
@@ -506,7 +508,7 @@ var ColorPicker = A.Component.create(
var saturation = instance._getSaturationPicker();
var value = instance._getValuePicker();
- var rgb = Color.hsv2rgb(hue, saturation, value);
+ var rgb = ColorUtil.hsv2rgb(hue, saturation, value);
if (event.src != 'controls') {
instance.set('rgb', rgb);
@@ -522,7 +524,7 @@ var ColorPicker = A.Component.create(
hue = instance._getHuePicker();
}
- var canvasRGB = Color.hsv2rgb(hue, 1, 1);
+ var canvasRGB = ColorUtil.hsv2rgb(hue, 1, 1);
instance._updateCanvas(canvasRGB);
}
@@ -843,4 +845,4 @@ var ColorPicker = A.Component.create(
A.ColorPicker = ColorPicker;
-}, 'gallery-2010.10.06-18-55' ,{skinnable:true, requires:['gallery-aui-overlay-context','dd-drag','slider','substitute','gallery-aui-button-item','gallery-aui-color','gallery-aui-form-base','gallery-aui-panel']});
+}, 'gallery-2011.02.09-21-32' ,{requires:['gallery-aui-overlay-context','dd-drag','slider','substitute','gallery-aui-button-item','gallery-aui-color-util','gallery-aui-form-base','gallery-aui-panel'], skinnable:true});
View
4 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base-min.js
@@ -1,2 +1,2 @@
-YUI.add("gallery-aui-color-picker-base",function(S){var G=S.Lang,N=G.isArray,L=G.isObject,e=S.Color,H="colorpicker",J=S.ClassNameManager.getClassName,c=S.WidgetStdMod,I=J(H,"canvas"),d=J(H,"hue-canvas"),Q=J(H,"container"),T=J(H,"controls"),M=J(H,"panel"),R=J(H,"swatch"),D=J(H,"swatch-current"),Y=J(H,"swatch-original"),U=J(H,"thumb"),O=J(H,"thumb-image"),K=J(H,"hue-thumb"),E=J(H,"hue-thumb-image"),Z=J(H,"hue","slider"),X=J(H,"hue","slider","content"),F=J(H,"trigger"),a='<div class="'+I+'"></div>',W='<span class="'+d+'"></span>',P='<div class="'+R+'"></div>',f='<div class="'+D+'"></div>',C='<div class="'+Y+'"></div>',V='<div class="'+U+'"><div class="'+O+'"></div></div>',b='<span class="'+K+'"><span class="'+E+'"></span></span>';var B=S.Component.create({NAME:H,ATTRS:{colors:{value:{},getter:function(){var A=this;var h=A.get("rgb");var i=A.get("hex");var g={};S.mix(g,h);g.hex=i;return g;}},hex:{value:"FFFFFF",getter:function(){var A=this;var g=A.get("rgb");var h=g.hex;if(h){h=h.split("#").join("");}else{h=e.rgb2hex(g);}return h;},setter:function(h){var A=this;if(h){var g=e.getRGB("#"+h);h=g.hex.split("#").join("");A.set("rgb",g);}else{h=S.Attribute.INVALID_VALUE;}return h;}},hideOn:{value:"click"},hsv:{getter:function(h){var A=this;var g=A.get("rgb");return e.rgb2hsv(g);},setter:function(h){var A=this;if(N(h)){var i=A.get("hsv");var g=e.hsv2rgb(h);A.set("rgb",g);i={hue:h[0],saturation:h[1],value:[2]};}else{if(!L(h)){h=S.Attribute.INVALID_VALUE;}}return h;},value:{h:0,s:0,v:0}},showOn:{value:"click"},pickersize:{value:180},rgb:{value:new e.RGB(255,255,255),setter:function(k){var h=this;var j;var i;var A;var l=true;if(N(k)){j=k[0];i=k[0];A=k[0];}else{if(L){j=k.r;i=k.g;A=k.b;}else{k=S.Attribute.INVALID_VALUE;l=false;}}if(l){j=e.constrainTo(j,0,255,255);i=e.constrainTo(i,0,255,255);A=e.constrainTo(A,0,255,255);k=new e.RGB(j,i,A);}return k;}},strings:{value:{R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"}},triggerParent:{value:null},trigger:{lazyAdd:true,getter:function(g){var A=this;if(!g){A._buttonTrigger=new S.ButtonItem({cssClass:F,icon:"pencil"});g=A._buttonTrigger.get("boundingBox");A.set("trigger",g);}return g;}}},EXTENDS:S.OverlayContext,prototype:{renderUI:function(){var A=this;var h=A._buttonTrigger;if(h&&!h.get("rendered")){var g=A.get("triggerParent");if(!g){g=A.get("boundingBox").get("parentNode");}h.render(g);}A._renderContainer();A._renderSliders();A._renderControls();},bindUI:function(){var A=this;B.superclass.bindUI.apply(this,arguments);A._createEvents();A._colorCanvas.on("mousedown",A._onCanvasMouseDown,A);A._colorPicker.on("drag:start",A._onThumbDragStart,A);A._colorPicker.after("drag:drag",A._afterThumbDrag,A);A._hueSlider.after("valueChange",A._afterValueChange,A);var g=A._colorForm.get("contentBox");g.delegate("change",S.bind(A._onFormChange,A),"input");A.after("hexChange",A._updateRGB);A.after("rgbChange",A._updateRGB);A._colorSwatchOriginal.on("click",A._restoreRGB,A);A.after("visibleChange",A._afterVisibleChangeCP);},syncUI:function(){var A=this;A._updatePickerOffset();var g=A.get("rgb");A._updateControls();A._updateOriginalRGB();},_afterThumbDrag:function(g){var A=this;var h=A._translateOffset(g.pageX,g.pageY);if(!A._preventDragEvent){A.fire("colorChange",{ddEvent:g});}A._canvasThumbXY=h;},_afterValueChange:function(g){var A=this;if(g.src!="controls"){A.fire("colorChange",{slideEvent:g});}},_afterVisibleChangeCP:function(g){var A=this;if(g.newVal){A.refreshAlign();A._hueSlider.syncUI();}A._updateOriginalRGB();},_convertOffsetToValue:function(g,i){var A=this;if(N(g)){return A._convertOffsetToValue.apply(A,g);}var h=A.get("pickersize");g=Math.round(((g*h/100)));i=Math.round((h-(i*h/100)));return[g,i];},_convertValueToOffset:function(g,h){var A=this;if(N(g)){return A._convertValueToOffset.apply(A,g);}g=Math.round(g+A._offsetXY[0]);h=Math.round(h+A._offsetXY[1]);return[g,h];},_createEvents:function(){var A=this;A.publish("colorChange",{defaultFn:A._onColorChange});},_getHuePicker:function(){var A=this;var h=A.get("pickersize");var g=(h-A._hueSlider.get("value"))/h;g=e.constrainTo(g,0,1,0);return(g===1)?0:g;},_getPickerSize:function(){var A=this;if(!A._pickerSize){var g=A._colorCanvas;var h=g.get("offsetWidth");if(!h){h=g.getComputedStyle("width");}h=parseInt(h,10);var i=A._pickerThumb.get("offsetWidth");h-=i;A._pickerSize=h;}return A._pickerSize;},_getSaturationPicker:function(){var A=this;return A._canvasThumbXY[0]/A._getPickerSize();},_getThumbOffset:function(){var g=this;if(!g._thumbOffset){var h=g._pickerThumb;var A=h.get("offsetHeight");var i=h.get("offsetWidth");g._thumbOffset=[Math.floor(i/2),Math.floor(A/2)];}return g._thumbOffset;},_getValuePicker:function(){var A=this;var g=A._getPickerSize();return((g-A._canvasThumbXY[1]))/g;},_onCanvasMouseDown:function(g){var A=this;A._setDragStart(g.pageX,g.pageY);g.halt();A.fire("colorChange",{ddEvent:g});},_onColorChange:function(j){var A=this;var g=A._getHuePicker();var i=A._getSaturationPicker();var k=A._getValuePicker();var h=e.hsv2rgb(g,i,k);if(j.src!="controls"){A.set("rgb",h);}A._updateControls();if(!j.ddEvent){if(!j.slideEvent){A._updateHue();A._updatePickerThumb();g=A._getHuePicker();}var l=e.hsv2rgb(g,1,1);A._updateCanvas(l);}A._updateColorSwatch();},_onFormChange:function(h){var A=this;var g=h.currentTarget;var i=g.get("id");if(i!="hex"){i="rgb."+i;}A.set(i,g.val());},_onThumbDragStart:function(g){var A=this;A._updatePickerOffset();},_renderContainer:function(){var A=this;if(!A._pickerContainer){var g=new S.Panel({cssClass:M,icons:[{icon:"close",id:"close",handler:{fn:A.hide,context:A}}]}).render(A.get("contentBox"));var h=g.bodyNode;h.addClass(Q);A._pickerContainer=h;}},_renderControls:function(){var g=this;g._colorSwatch=S.Node.create(P);g._colorSwatchCurrent=S.Node.create(f);g._colorSwatchOriginal=S.Node.create(C);g._colorSwatch.appendChild(g._colorSwatchCurrent);g._colorSwatch.appendChild(g._colorSwatchOriginal);g._pickerContainer.appendChild(g._colorSwatch);var A=g.get("strings");var h=new S.Form({labelAlign:"left"}).render(g._pickerContainer);
-h.add([{id:"r",labelText:A.R,size:3},{id:"g",labelText:A.G,size:3},{id:"b",labelText:A.B,size:3},{id:"hex",labelText:A.HEX,size:6}],true);h.get("boundingBox").addClass(T);g._colorForm=h;},_renderSliders:function(){var A=this;A._colorCanvas=S.Node.create(a);A._pickerThumb=S.Node.create(V);A._colorCanvas.appendChild(A._pickerThumb);A._pickerContainer.appendChild(A._colorCanvas);var g=A.get("pickersize");A._colorPicker=new S.DD.Drag({node:A._pickerThumb}).plug(S.Plugin.DDConstrained,{constrain2node:A._colorCanvas});var h=new S.Slider({axis:"y",min:0,max:g,length:A._colorCanvas.get("offsetHeight")});h.RAIL_TEMPLATE=W;h.THUMB_TEMPLATE=b;h.get("boundingBox").addClass(Z);h.get("contentBox").addClass(X);h.render(A._pickerContainer);A._hueSlider=h;},_restoreRGB:function(g){var A=this;A.set("rgb",A._oldRGB);A._updateHue();A._updatePickerThumb();A._updateColorSwatch();A.fire("colorChange");},_setDragStart:function(h,k){var g=this;if(N(h)){return g._setDragStart.apply(g,h);}var A=g._colorPicker;A._dragThreshMet=true;A._fixIEMouseDown();S.DD.DDM.activeDrag=A;var j=A.get("dragNode").getXY();var i=g._getThumbOffset();j[0]+=i[0];j[1]+=i[1];A._setStartPosition(j);A.set("activeHandle",A.get("dragNode"));A.start();A._alignNode([h,k]);},_translateOffset:function(g,j){var A=this;var h=A._offsetXY;var i=[];i[0]=Math.round(g-h[0]);i[1]=Math.round(j-h[1]);return i;},_updateCanvas:function(g){var A=this;g=g||A.get("rgb");A._colorCanvas.setStyle("backgroundColor","rgb("+[g.r,g.g,g.b].join(",")+")");},_updateColorSwatch:function(g){var A=this;g=g||A.get("rgb");A._colorSwatchCurrent.setStyle("backgroundColor","rgb("+[g.r,g.g,g.b].join(",")+")");},_updateControls:function(){var A=this;var g=A.get("colors");A._colorForm.set("values",g);},_updateHue:function(){var A=this;var h=A.get("pickersize");var g=A.get("hsv.h");g=h-Math.round(g*h);if(g===h){g=0;}A._hueSlider.set("value",g,{src:"controls"});},_updateOriginalColorSwatch:function(g){var A=this;g=g||A.get("rgb");A._colorSwatchOriginal.setStyle("backgroundColor","rgb("+[g.r,g.g,g.b].join(",")+")");},_updateOriginalRGB:function(){var A=this;A._oldRGB=A.get("rgb");A._updateOriginalColorSwatch(A._oldRGB);},_updatePickerOffset:function(){var A=this;A._offsetXY=A._colorCanvas.getXY();},_updatePickerThumb:function(){var g=this;g._updatePickerOffset();var h=g.get("hsv");var i=g.get("pickersize");h.s=Math.round(h.s*100);var j=h.s;h.v=Math.round(h.v*100);var k=h.v;var l=g._convertOffsetToValue(j,k);l=g._convertValueToOffset(l);g._canvasThumbXY=l;var A=g._colorPicker;g._preventDragEvent=true;A._setStartPosition(A.get("dragNode").getXY());A._alignNode(l,true);g._preventDragEvent=false;},_updateRGB:function(g){var A=this;if(g.subAttrName||g.attrName=="hex"){A.fire("colorChange",{src:"controls"});}},_canvasThumbXY:[0,0],_offsetXY:[0,0]}});S.ColorPicker=B;},"gallery-2010.10.06-18-55",{skinnable:true,requires:["gallery-aui-overlay-context","dd-drag","slider","substitute","gallery-aui-button-item","gallery-aui-color","gallery-aui-form-base","gallery-aui-panel"]});
+YUI.add("gallery-aui-color-picker-base",function(r){var f=r.Lang,m=f.isArray,k=f.isObject,D=r.ColorUtil,g="colorpicker",i=r.ClassNameManager.getClassName,C=r.WidgetStdMod,h=i(g,"canvas"),E=i(g,"hue-canvas"),p=i(g,"container"),s=i(g,"controls"),l=i(g,"panel"),q=i(g,"swatch"),c=i(g,"swatch-current"),x=i(g,"swatch-original"),t=i(g,"thumb"),n=i(g,"thumb-image"),j=i(g,"hue-thumb"),d=i(g,"hue-thumb-image"),y=i(g,"hue","slider"),w=i(g,"hue","slider","content"),e=i(g,"trigger"),z='<div class="'+h+'"></div>',v='<span class="'+E+'"></span>',o='<div class="'+q+'"></div>',F='<div class="'+c+'"></div>',b='<div class="'+x+'"></div>',u='<div class="'+t+'"><div class="'+n+'"></div></div>',B='<span class="'+j+'"><span class="'+d+'"></span></span>';var a=r.Component.create({NAME:g,ATTRS:{colors:{value:{},getter:function(){var A=this;var H=A.get("rgb");var I=A.get("hex");var G={};r.mix(G,H);G.hex=I;return G;}},hex:{value:"FFFFFF",getter:function(){var A=this;var G=A.get("rgb");var H=G.hex;if(H){H=H.split("#").join("");}else{H=D.rgb2hex(G);}return H;},setter:function(H){var A=this;if(H){var G=D.getRGB("#"+H);H=G.hex.split("#").join("");A.set("rgb",G);}else{H=r.Attribute.INVALID_VALUE;}return H;}},hideOn:{value:"click"},hsv:{getter:function(H){var A=this;var G=A.get("rgb");return D.rgb2hsv(G);},setter:function(H){var A=this;if(m(H)){var I=A.get("hsv");var G=D.hsv2rgb(H);A.set("rgb",G);I={hue:H[0],saturation:H[1],value:[2]};}else{if(!k(H)){H=r.Attribute.INVALID_VALUE;}}return H;},value:{h:0,s:0,v:0}},showOn:{value:"click"},pickersize:{value:180},rgb:{value:new D.RGB(255,255,255),setter:function(J){var G=this;var I;var H;var A;var K=true;if(m(J)){I=J[0];H=J[0];A=J[0];}else{if(k){I=J.r;H=J.g;A=J.b;}else{J=r.Attribute.INVALID_VALUE;K=false;}}if(K){I=D.constrainTo(I,0,255,255);H=D.constrainTo(H,0,255,255);A=D.constrainTo(A,0,255,255);J=new D.RGB(I,H,A);}return J;}},strings:{value:{R:"R",G:"G",B:"B",H:"H",S:"S",V:"V",HEX:"#",DEG:"\u00B0",PERCENT:"%"}},triggerParent:{value:null},trigger:{lazyAdd:true,getter:function(G){var A=this;if(!G){A._buttonTrigger=new r.ButtonItem({cssClass:e,icon:"pencil"});G=A._buttonTrigger.get("boundingBox");G=new r.NodeList(G);A.set("trigger",G);}return G;}}},EXTENDS:r.OverlayContext,prototype:{renderUI:function(){var A=this;var H=A._buttonTrigger;if(H&&!H.get("rendered")){var G=A.get("triggerParent");if(!G){G=A.get("boundingBox").get("parentNode");}H.render(G);}A._renderContainer();A._renderSliders();A._renderControls();},bindUI:function(){var A=this;a.superclass.bindUI.apply(this,arguments);A._createEvents();A._colorCanvas.on("mousedown",A._onCanvasMouseDown,A);A._colorPicker.on("drag:start",A._onThumbDragStart,A);A._colorPicker.after("drag:drag",A._afterThumbDrag,A);A._hueSlider.after("valueChange",A._afterValueChange,A);var G=A._colorForm.get("contentBox");G.delegate("change",r.bind(A._onFormChange,A),"input");A.after("hexChange",A._updateRGB);A.after("rgbChange",A._updateRGB);A._colorSwatchOriginal.on("click",A._restoreRGB,A);A.after("visibleChange",A._afterVisibleChangeCP);},syncUI:function(){var A=this;A._updatePickerOffset();var G=A.get("rgb");A._updateControls();A._updateOriginalRGB();},_afterThumbDrag:function(G){var A=this;var H=A._translateOffset(G.pageX,G.pageY);if(!A._preventDragEvent){A.fire("colorChange",{ddEvent:G});}A._canvasThumbXY=H;},_afterValueChange:function(G){var A=this;if(G.src!="controls"){A.fire("colorChange",{slideEvent:G});}},_afterVisibleChangeCP:function(G){var A=this;if(G.newVal){A.refreshAlign();A._hueSlider.syncUI();}A._updateOriginalRGB();},_convertOffsetToValue:function(G,I){var A=this;if(m(G)){return A._convertOffsetToValue.apply(A,G);}var H=A.get("pickersize");G=Math.round(((G*H/100)));I=Math.round((H-(I*H/100)));return[G,I];},_convertValueToOffset:function(G,H){var A=this;if(m(G)){return A._convertValueToOffset.apply(A,G);}G=Math.round(G+A._offsetXY[0]);H=Math.round(H+A._offsetXY[1]);return[G,H];},_createEvents:function(){var A=this;A.publish("colorChange",{defaultFn:A._onColorChange});},_getHuePicker:function(){var A=this;var H=A.get("pickersize");var G=(H-A._hueSlider.get("value"))/H;G=D.constrainTo(G,0,1,0);return(G===1)?0:G;},_getPickerSize:function(){var A=this;if(!A._pickerSize){var G=A._colorCanvas;var H=G.get("offsetWidth");if(!H){H=G.getComputedStyle("width");}H=parseInt(H,10);var I=A._pickerThumb.get("offsetWidth");H-=I;A._pickerSize=H;}return A._pickerSize;},_getSaturationPicker:function(){var A=this;return A._canvasThumbXY[0]/A._getPickerSize();},_getThumbOffset:function(){var G=this;if(!G._thumbOffset){var H=G._pickerThumb;var A=H.get("offsetHeight");var I=H.get("offsetWidth");G._thumbOffset=[Math.floor(I/2),Math.floor(A/2)];}return G._thumbOffset;},_getValuePicker:function(){var A=this;var G=A._getPickerSize();return((G-A._canvasThumbXY[1]))/G;},_onCanvasMouseDown:function(G){var A=this;A._setDragStart(G.pageX,G.pageY);G.halt();A.fire("colorChange",{ddEvent:G});},_onColorChange:function(J){var A=this;var G=A._getHuePicker();var I=A._getSaturationPicker();var K=A._getValuePicker();var H=D.hsv2rgb(G,I,K);if(J.src!="controls"){A.set("rgb",H);}A._updateControls();if(!J.ddEvent){if(!J.slideEvent){A._updateHue();A._updatePickerThumb();G=A._getHuePicker();}var L=D.hsv2rgb(G,1,1);A._updateCanvas(L);}A._updateColorSwatch();},_onFormChange:function(H){var A=this;var G=H.currentTarget;var I=G.get("id");if(I!="hex"){I="rgb."+I;}A.set(I,G.val());},_onThumbDragStart:function(G){var A=this;A._updatePickerOffset();},_renderContainer:function(){var A=this;if(!A._pickerContainer){var G=new r.Panel({cssClass:l,icons:[{icon:"close",id:"close",handler:{fn:A.hide,context:A}}]}).render(A.get("contentBox"));var H=G.bodyNode;H.addClass(p);A._pickerContainer=H;}},_renderControls:function(){var G=this;G._colorSwatch=r.Node.create(o);G._colorSwatchCurrent=r.Node.create(F);G._colorSwatchOriginal=r.Node.create(b);G._colorSwatch.appendChild(G._colorSwatchCurrent);G._colorSwatch.appendChild(G._colorSwatchOriginal);G._pickerContainer.appendChild(G._colorSwatch);var A=G.get("strings");
+var H=new r.Form({labelAlign:"left"}).render(G._pickerContainer);H.add([{id:"r",labelText:A.R,size:3},{id:"g",labelText:A.G,size:3},{id:"b",labelText:A.B,size:3},{id:"hex",labelText:A.HEX,size:6}],true);H.get("boundingBox").addClass(s);G._colorForm=H;},_renderSliders:function(){var A=this;A._colorCanvas=r.Node.create(z);A._pickerThumb=r.Node.create(u);A._colorCanvas.appendChild(A._pickerThumb);A._pickerContainer.appendChild(A._colorCanvas);var G=A.get("pickersize");A._colorPicker=new r.DD.Drag({node:A._pickerThumb}).plug(r.Plugin.DDConstrained,{constrain2node:A._colorCanvas});var H=new r.Slider({axis:"y",min:0,max:G,length:A._colorCanvas.get("offsetHeight")});H.RAIL_TEMPLATE=v;H.THUMB_TEMPLATE=B;H.get("boundingBox").addClass(y);H.get("contentBox").addClass(w);H.render(A._pickerContainer);A._hueSlider=H;},_restoreRGB:function(G){var A=this;A.set("rgb",A._oldRGB);A._updateHue();A._updatePickerThumb();A._updateColorSwatch();A.fire("colorChange");},_setDragStart:function(H,K){var G=this;if(m(H)){return G._setDragStart.apply(G,H);}var A=G._colorPicker;A._dragThreshMet=true;A._fixIEMouseDown();r.DD.DDM.activeDrag=A;var J=A.get("dragNode").getXY();var I=G._getThumbOffset();J[0]+=I[0];J[1]+=I[1];A._setStartPosition(J);A.set("activeHandle",A.get("dragNode"));A.start();A._alignNode([H,K]);},_translateOffset:function(G,J){var A=this;var H=A._offsetXY;var I=[];I[0]=Math.round(G-H[0]);I[1]=Math.round(J-H[1]);return I;},_updateCanvas:function(G){var A=this;G=G||A.get("rgb");A._colorCanvas.setStyle("backgroundColor","rgb("+[G.r,G.g,G.b].join(",")+")");},_updateColorSwatch:function(G){var A=this;G=G||A.get("rgb");A._colorSwatchCurrent.setStyle("backgroundColor","rgb("+[G.r,G.g,G.b].join(",")+")");},_updateControls:function(){var A=this;var G=A.get("colors");A._colorForm.set("values",G);},_updateHue:function(){var A=this;var H=A.get("pickersize");var G=A.get("hsv.h");G=H-Math.round(G*H);if(G===H){G=0;}A._hueSlider.set("value",G,{src:"controls"});},_updateOriginalColorSwatch:function(G){var A=this;G=G||A.get("rgb");A._colorSwatchOriginal.setStyle("backgroundColor","rgb("+[G.r,G.g,G.b].join(",")+")");},_updateOriginalRGB:function(){var A=this;A._oldRGB=A.get("rgb");A._updateOriginalColorSwatch(A._oldRGB);},_updatePickerOffset:function(){var A=this;A._offsetXY=A._colorCanvas.getXY();},_updatePickerThumb:function(){var G=this;G._updatePickerOffset();var H=G.get("hsv");var I=G.get("pickersize");H.s=Math.round(H.s*100);var J=H.s;H.v=Math.round(H.v*100);var K=H.v;var L=G._convertOffsetToValue(J,K);L=G._convertValueToOffset(L);G._canvasThumbXY=L;var A=G._colorPicker;G._preventDragEvent=true;A._setStartPosition(A.get("dragNode").getXY());A._alignNode(L,true);G._preventDragEvent=false;},_updateRGB:function(G){var A=this;if(G.subAttrName||G.attrName=="hex"){A.fire("colorChange",{src:"controls"});}},_canvasThumbXY:[0,0],_offsetXY:[0,0]}});r.ColorPicker=a;},"gallery-2011.02.09-21-32",{requires:["gallery-aui-overlay-context","dd-drag","slider","substitute","gallery-aui-button-item","gallery-aui-color-util","gallery-aui-form-base","gallery-aui-panel"],skinnable:true});
View
30 build/gallery-aui-color-picker-base/gallery-aui-color-picker-base.js
@@ -10,7 +10,7 @@ var Lang = A.Lang,
isArray = Lang.isArray,
isObject = Lang.isObject,
- Color = A.Color,
+ ColorUtil = A.ColorUtil,
NAME = 'colorpicker',
@@ -108,7 +108,7 @@ var ColorPicker = A.Component.create(
hex = hex.split('#').join('')
}
else {
- hex = Color.rgb2hex(rgb);
+ hex = ColorUtil.rgb2hex(rgb);
}
return hex;
@@ -117,7 +117,7 @@ var ColorPicker = A.Component.create(
var instance = this;
if (value) {
- var rgb = Color.getRGB('#' + value);
+ var rgb = ColorUtil.getRGB('#' + value);
value = rgb.hex.split('#').join('');
@@ -141,7 +141,7 @@ var ColorPicker = A.Component.create(
var rgb = instance.get('rgb');
- return Color.rgb2hsv(rgb);
+ return ColorUtil.rgb2hsv(rgb);
},
setter: function(value) {
var instance = this;
@@ -149,7 +149,7 @@ var ColorPicker = A.Component.create(
if (isArray(value)) {
var current = instance.get('hsv');
- var rgb = Color.hsv2rgb(value);
+ var rgb = ColorUtil.hsv2rgb(value);
instance.set('rgb', rgb);
@@ -181,7 +181,7 @@ var ColorPicker = A.Component.create(
},
rgb: {
- value: new Color.RGB(255, 255, 255),
+ value: new ColorUtil.RGB(255, 255, 255),
setter: function(value) {
var instance = this;
@@ -209,11 +209,11 @@ var ColorPicker = A.Component.create(
}
if (set) {
- r = Color.constrainTo(r, 0, 255, 255);
- g = Color.constrainTo(g, 0, 255, 255);
- b = Color.constrainTo(b, 0, 255, 255);
+ r = ColorUtil.constrainTo(r, 0, 255, 255);
+ g = ColorUtil.constrainTo(g, 0, 255, 255);
+ b = ColorUtil.constrainTo(b, 0, 255, 255);