Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Gallery Build Tag: gallery-2011.05.04-20-03

  • Loading branch information...
commit 1e696a3c3387433ce2e1e548fd2f9ed1be54fa76 1 parent 1969293
YUI Builder authored
Showing with 3,366 additions and 313 deletions.
  1. +13 −2 build/gallery-base-componentmgr/gallery-base-componentmgr-debug.js
  2. +1 −1  build/gallery-base-componentmgr/gallery-base-componentmgr-min.js
  3. +13 −2 build/gallery-base-componentmgr/gallery-base-componentmgr.js
  4. +2 −1  build/gallery-carousel-anim/gallery-carousel-anim-debug.js
  5. +1 −1  build/gallery-carousel-anim/gallery-carousel-anim-min.js
  6. +2 −1  build/gallery-carousel-anim/gallery-carousel-anim.js
  7. +51 −38 build/gallery-carousel/gallery-carousel-debug.js
  8. +2 −2 build/gallery-carousel/gallery-carousel-min.js
  9. +51 −38 build/gallery-carousel/gallery-carousel.js
  10. +20 −19 build/gallery-geo/gallery-geo-debug.js
  11. +1 −1  build/gallery-geo/gallery-geo-min.js
  12. +20 −19 build/gallery-geo/gallery-geo.js
  13. +42 −0 build/gallery-get-selection/gallery-get-selection-debug.js
  14. +1 −0  build/gallery-get-selection/gallery-get-selection-min.js
  15. +42 −0 build/gallery-get-selection/gallery-get-selection.js
  16. +64 −0 build/gallery-inspector/assets/gallery-inspector-core.css
  17. +85 −0 build/gallery-inspector/assets/skins/sam/gallery-inspector-skin.css
  18. +1 −0  build/gallery-inspector/assets/skins/sam/gallery-inspector.css
  19. +1,019 −0 build/gallery-inspector/gallery-inspector-debug.js
  20. +2 −0  build/gallery-inspector/gallery-inspector-min.js
  21. +42 −0 build/gallery-inspector/gallery-inspector-plugin-debug.js
  22. +1 −0  build/gallery-inspector/gallery-inspector-plugin-min.js
  23. +42 −0 build/gallery-inspector/gallery-inspector-plugin.js
  24. +1,019 −0 build/gallery-inspector/gallery-inspector.js
  25. +1 −0  build/gallery-inspector/lang/gallery-inspector.js
  26. +1 −0  build/gallery-inspector/lang/gallery-inspector_en.js
  27. +39 −0 build/gallery-lazyloadimages/gallery-lazyloadimages-debug.js
  28. +1 −0  build/gallery-lazyloadimages/gallery-lazyloadimages-min.js
  29. +39 −0 build/gallery-lazyloadimages/gallery-lazyloadimages.js
  30. +5 −3 build/gallery-overlay-extras/gallery-overlay-extras-debug.js
  31. +1 −1  build/gallery-overlay-extras/gallery-overlay-extras-min.js
  32. +5 −3 build/gallery-overlay-extras/gallery-overlay-extras.js
  33. +11 −32 build/gallery-resource/gallery-resource-debug.js
  34. +1 −1  build/gallery-resource/gallery-resource-min.js
  35. +11 −32 build/gallery-resource/gallery-resource.js
  36. +4 −0 build/gallery-split-desktop/assets/gallery-split-desktop-core.css
  37. +222 −58 build/gallery-split-desktop/gallery-split-desktop-debug.js
  38. +2 −1  build/gallery-split-desktop/gallery-split-desktop-min.js
  39. +218 −57 build/gallery-split-desktop/gallery-split-desktop.js
  40. +51 −0 build/gallery-spotlight/assets/gallery-spotlight.css
  41. +108 −0 build/gallery-spotlight/gallery-spotlight-debug.js
  42. +1 −0  build/gallery-spotlight/gallery-spotlight-min.js
  43. +108 −0 build/gallery-spotlight/gallery-spotlight.js
View
15 build/gallery-base-componentmgr/gallery-base-componentmgr-debug.js
@@ -97,7 +97,8 @@ YUI.add('gallery-base-componentmgr', function(Y) {
});
}
- Y.before(this._destroyComponents, this.constructor.prototype, 'destructor', this);
+// this.after('destroy', this._destroyComponents);
+ Y.before(this._destroyComponents, this, '_destroyHierarchy', this);
},
// *** Public Methods *** //
@@ -337,7 +338,17 @@ YUI.add('gallery-base-componentmgr', function(Y) {
};
+ /**
+ * Alias for useComponent
+ *
+ * @method use
+ * @alias useComponent
+ */
+ ComponentMgr.prototype.use = ComponentMgr.prototype.useComponent;
+
+ // *** Namespace *** //
+
Y.BaseComponentMgr = ComponentMgr;
-}, 'gallery-2011.01.26-20-33' ,{requires:['base-base', 'collection']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['base-base', 'collection']});
View
2  build/gallery-base-componentmgr/gallery-base-componentmgr-min.js
@@ -6,4 +6,4 @@ YUI.add("gallery-base-componentmgr",function(b){
* Copyright (c) 2010-2011 Eric Ferraiuolo - http://eric.ferraiuolo.name
* YUI BSD License - http://developer.yahoo.com/yui/license.html
*/
-var e,g="requires",f="initializer",l="destructor",o="instance",i="initComponent",k="initComponents",d="destroyComponent",j=b.Lang,h=j.isArray,a=j.isString,n=j.isObject,c=j.isFunction,m=function(){};e=function(){this._initComponentMgr.apply(this,arguments);};e._COMPONENT_CFG=[g,f,l,o];e.prototype={_components:null,_initComponentMgr:function(){this._components=new b.State();this._initComponentHierarchy();this.publish(k,{defaultFn:this._defInitComponentsFn,fireOnce:true});this.publish(i,{defaultFn:this._defInitComponentFn});this.publish(d,{defaultFn:this._defDestoryComponentFn});if(this.get("initialized")){this.fire(k,{componentsToInit:[]});}else{this.after("initializedChange",function(p){this.fire(k,{componentsToInit:[]});});}b.before(this._destroyComponents,this.constructor.prototype,"destructor",this);},addComponent:function(s,r){if(!a(s)){return;}if(!n(r)){return;}var v=this._components,t=r.requires,u=r.initializer,q=r.destructor,p=r.instance;u=c(u)?u:a(u)&&c(this[u])?this[u]:null;q=c(q)?q:a(q)&&c(this[q])?this[q]:null;v.add(s,g,t);v.add(s,f,u);v.add(s,l,q);v.add(s,o,p);},getComponent:function(p){return this._components.get(p,o);},destroyComponent:function(){var p=b.Array(arguments,0,true),q=h(p[0])?p[0]:p;b.Array.each(q,function(r){if(this._components.get(r,o)){this._destroyComponent(r);}},this);},useComponent:function(){var p=b.Array(arguments,0,true),t=c(p[p.length-1])?p[p.length-1]:m,q=t===m?p:p.slice(0,-1),r=[],s;if(q.length<1){t.call(this);return;}s=b.Array.partition(q,function(v){var u=this.getComponent(v);r.push(u);return u;},this);if(s.rejects.length>0){b.use.apply(b,this._getRequires(s.rejects).concat(b.bind(function(v){var u=[];v.Array.each(s.rejects,this._initComponent,this);v.Array.each(q,function(w){u.push(this.getComponent(w));},this);t.apply(this,u);},this)));}else{t.apply(this,r);}},_initComponentHierarchy:function(){var r=this._getClasses(),s={},p=e._COMPONENT_CFG,q,t;t=function(v,u){if(!s[u]){s[u]=b.mix({},v,true,p);}else{b.mix(s[u],v,true,p);}};for(q=r.length-1;q>=0;q--){b.Object.each(r[q].COMPONENTS,t);}b.Object.each(s,function(v,u){this.addComponent(u,v);},this);},_getRequires:function(q){q=h(q)?q:[q];var p=[];b.Array.each(q,function(r){p=p.concat(this._components.get(r,g)||[]);},this);return b.Array.unique(p);},_initComponent:function(p){this.fire(i,{componentToInit:p});},_destroyComponent:function(p){this.fire(d,{component:p});},_destroyComponents:function(){var p=this._components.data[o];b.each(p,function(q,r){if(q){this._destroyComponent(r);}},this);},_defInitComponentsFn:function(r){var q=r.componentsToInit,p=this._getRequires(q);b.use.apply(b,p.concat(b.bind(function(s){s.Array.each(q,this._initComponent,this);},this)));},_defInitComponentFn:function(t){var s=this._components,q=t.componentToInit,r=s.get(q,f),p=s.get(q,o);if(!p&&c(r)){p=r.call(this);if(p._yuievt&&c(p.addTarget)){p.addTarget(this);}s.add(q,o,p);}t.component=p;},_defDestoryComponentFn:function(t){var s=this._components,r=t.component,q=s.get(r,l),p=s.get(r,o);if(!p){return;}if(p._yuievt&&c(p.removeTarget)){p.removeTarget(this);}if(c(q)){q.call(this,p);}else{if(c(p.destroy)){p.destroy();}}s.remove(r,o);}};b.BaseComponentMgr=e;},"gallery-2011.01.26-20-33",{requires:["base-base","collection"]});
+var e,g="requires",f="initializer",l="destructor",o="instance",i="initComponent",k="initComponents",d="destroyComponent",j=b.Lang,h=j.isArray,a=j.isString,n=j.isObject,c=j.isFunction,m=function(){};e=function(){this._initComponentMgr.apply(this,arguments);};e._COMPONENT_CFG=[g,f,l,o];e.prototype={_components:null,_initComponentMgr:function(){this._components=new b.State();this._initComponentHierarchy();this.publish(k,{defaultFn:this._defInitComponentsFn,fireOnce:true});this.publish(i,{defaultFn:this._defInitComponentFn});this.publish(d,{defaultFn:this._defDestoryComponentFn});if(this.get("initialized")){this.fire(k,{componentsToInit:[]});}else{this.after("initializedChange",function(p){this.fire(k,{componentsToInit:[]});});}b.before(this._destroyComponents,this,"_destroyHierarchy",this);},addComponent:function(s,r){if(!a(s)){return;}if(!n(r)){return;}var v=this._components,t=r.requires,u=r.initializer,q=r.destructor,p=r.instance;u=c(u)?u:a(u)&&c(this[u])?this[u]:null;q=c(q)?q:a(q)&&c(this[q])?this[q]:null;v.add(s,g,t);v.add(s,f,u);v.add(s,l,q);v.add(s,o,p);},getComponent:function(p){return this._components.get(p,o);},destroyComponent:function(){var p=b.Array(arguments,0,true),q=h(p[0])?p[0]:p;b.Array.each(q,function(r){if(this._components.get(r,o)){this._destroyComponent(r);}},this);},useComponent:function(){var p=b.Array(arguments,0,true),t=c(p[p.length-1])?p[p.length-1]:m,q=t===m?p:p.slice(0,-1),r=[],s;if(q.length<1){t.call(this);return;}s=b.Array.partition(q,function(v){var u=this.getComponent(v);r.push(u);return u;},this);if(s.rejects.length>0){b.use.apply(b,this._getRequires(s.rejects).concat(b.bind(function(v){var u=[];v.Array.each(s.rejects,this._initComponent,this);v.Array.each(q,function(w){u.push(this.getComponent(w));},this);t.apply(this,u);},this)));}else{t.apply(this,r);}},_initComponentHierarchy:function(){var r=this._getClasses(),s={},p=e._COMPONENT_CFG,q,t;t=function(v,u){if(!s[u]){s[u]=b.mix({},v,true,p);}else{b.mix(s[u],v,true,p);}};for(q=r.length-1;q>=0;q--){b.Object.each(r[q].COMPONENTS,t);}b.Object.each(s,function(v,u){this.addComponent(u,v);},this);},_getRequires:function(q){q=h(q)?q:[q];var p=[];b.Array.each(q,function(r){p=p.concat(this._components.get(r,g)||[]);},this);return b.Array.unique(p);},_initComponent:function(p){this.fire(i,{componentToInit:p});},_destroyComponent:function(p){this.fire(d,{component:p});},_destroyComponents:function(){var p=this._components.data[o];b.each(p,function(q,r){if(q){this._destroyComponent(r);}},this);},_defInitComponentsFn:function(r){var q=r.componentsToInit,p=this._getRequires(q);b.use.apply(b,p.concat(b.bind(function(s){s.Array.each(q,this._initComponent,this);},this)));},_defInitComponentFn:function(t){var s=this._components,q=t.componentToInit,r=s.get(q,f),p=s.get(q,o);if(!p&&c(r)){p=r.call(this);if(p._yuievt&&c(p.addTarget)){p.addTarget(this);}s.add(q,o,p);}t.component=p;},_defDestoryComponentFn:function(t){var s=this._components,r=t.component,q=s.get(r,l),p=s.get(r,o);if(!p){return;}if(p._yuievt&&c(p.removeTarget)){p.removeTarget(this);}if(c(q)){q.call(this,p);}else{if(c(p.destroy)){p.destroy();}}s.remove(r,o);}};e.prototype.use=e.prototype.useComponent;b.BaseComponentMgr=e;},"gallery-2011.05.04-20-03",{requires:["base-base","collection"]});
View
15 build/gallery-base-componentmgr/gallery-base-componentmgr.js
@@ -96,7 +96,8 @@ YUI.add('gallery-base-componentmgr', function(Y) {
});
}
- Y.before(this._destroyComponents, this.constructor.prototype, 'destructor', this);
+// this.after('destroy', this._destroyComponents);
+ Y.before(this._destroyComponents, this, '_destroyHierarchy', this);
},
// *** Public Methods *** //
@@ -330,7 +331,17 @@ YUI.add('gallery-base-componentmgr', function(Y) {
};
+ /**
+ * Alias for useComponent
+ *
+ * @method use
+ * @alias useComponent
+ */
+ ComponentMgr.prototype.use = ComponentMgr.prototype.useComponent;
+
+ // *** Namespace *** //
+
Y.BaseComponentMgr = ComponentMgr;
-}, 'gallery-2011.01.26-20-33' ,{requires:['base-base', 'collection']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['base-base', 'collection']});
View
3  build/gallery-carousel-anim/gallery-carousel-anim-debug.js
@@ -117,6 +117,7 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
CarouselAnimPlugin.NAME);
animation = self.get("animation");
if (carousel && animation.speed > 0) {
+ index = carousel._getCorrectedIndex(index); // sanitize the value
cb = carousel.get("contentBox");
isVertical = carousel.get("isVertical");
if (isVertical) {
@@ -190,4 +191,4 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
});
-}, 'gallery-2010.10.13-20-59' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
View
2  build/gallery-carousel-anim/gallery-carousel-anim-min.js
@@ -1 +1 @@
-YUI.add("gallery-carousel-anim",function(E){function A(){A.superclass.constructor.apply(this,arguments);}var D=E.Lang,C="afterScroll",B="beforeScroll";A.NAME="carouselAnimPlugin";A.NS="anim";A.ATTRS={animation:{validator:"_validateAnimation",value:{speed:0,effect:E.Easing.easeOut}}};E.CarouselAnimPlugin=E.extend(A,E.Plugin.Base,{initializer:function(F){this.beforeHostMethod("scrollTo",this.animateAndScrollTo);},animateAndScrollTo:function(J){var O=this,N=O.get("host"),G,H,F,I,M,K,L;if(N.get("rendered")){H=O.get("animation");if(N&&H.speed>0){F=N.get("contentBox");K=N.get("isVertical");if(K){M={top:N.get("top")};L={top:N._getOffsetForIndex(J)};}else{M={left:N.get("left")};L={left:N._getOffsetForIndex(J)};}I=N.getFirstVisible();O.fire(B,{first:I,last:I+N.get("numVisible")});G=new E.Anim({node:F,from:M,to:L,duration:H.speed,easing:H.effect});G.on("end",E.bind(O._afterAnimEnd,O,J));G.run();return new E.Do.Prevent();}}return false;},_afterAnimEnd:function(H){var F=this,G=F.get("host");G.set("selectedItem",H);},_validateAnimation:function(F){var G=false;if(D.isObject(F)){if(D.isNumber(F.speed)){G=true;}if(!D.isUndefined(F.effect)&&!D.isFunction(F.effect)){G=false;}}return G;},_animObj:null});},"gallery-2010.10.13-20-59",{requires:["gallery-carousel","anim","plugin","pluginhost"]});
+YUI.add("gallery-carousel-anim",function(e){function a(){a.superclass.constructor.apply(this,arguments);}var d=e.Lang,c="afterScroll",b="beforeScroll";a.NAME="carouselAnimPlugin";a.NS="anim";a.ATTRS={animation:{validator:"_validateAnimation",value:{speed:0,effect:e.Easing.easeOut}}};e.CarouselAnimPlugin=e.extend(a,e.Plugin.Base,{initializer:function(f){this.beforeHostMethod("scrollTo",this.animateAndScrollTo);},animateAndScrollTo:function(j){var o=this,n=o.get("host"),g,h,f,i,m,k,l;if(n.get("rendered")){h=o.get("animation");if(n&&h.speed>0){j=n._getCorrectedIndex(j);f=n.get("contentBox");k=n.get("isVertical");if(k){m={top:n.get("top")};l={top:n._getOffsetForIndex(j)};}else{m={left:n.get("left")};l={left:n._getOffsetForIndex(j)};}i=n.getFirstVisible();o.fire(b,{first:i,last:i+n.get("numVisible")});g=new e.Anim({node:f,from:m,to:l,duration:h.speed,easing:h.effect});g.on("end",e.bind(o._afterAnimEnd,o,j));g.run();return new e.Do.Prevent();}}return false;},_afterAnimEnd:function(h){var f=this,g=f.get("host");g.set("selectedItem",h);},_validateAnimation:function(f){var g=false;if(d.isObject(f)){if(d.isNumber(f.speed)){g=true;}if(!d.isUndefined(f.effect)&&!d.isFunction(f.effect)){g=false;}}return g;},_animObj:null});},"gallery-2011.05.04-20-03",{requires:["gallery-carousel","anim","plugin","pluginhost"]});
View
3  build/gallery-carousel-anim/gallery-carousel-anim.js
@@ -115,6 +115,7 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
if (carousel.get("rendered")) {
animation = self.get("animation");
if (carousel && animation.speed > 0) {
+ index = carousel._getCorrectedIndex(index); // sanitize the value
cb = carousel.get("contentBox");
isVertical = carousel.get("isVertical");
if (isVertical) {
@@ -186,4 +187,4 @@ Y.CarouselAnimPlugin = Y.extend(CarouselAnimPlugin, Y.Plugin.Base, {
});
-}, 'gallery-2010.10.13-20-59' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-carousel', 'anim', 'plugin', 'pluginhost']});
View
89 build/gallery-carousel/gallery-carousel-debug.js
@@ -560,11 +560,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollBackward: function () {
- var self = this,
- scrollIncrement = self.get("scrollIncrement"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem - scrollIncrement);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() - self.get("scrollIncrement"));
},
/**
@@ -574,11 +571,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollForward: function () {
- var self = this,
- scrollIncrement = self.get("scrollIncrement"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem + scrollIncrement);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() + self.get("scrollIncrement"));
},
/**
@@ -588,11 +582,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollPageBackward: function () {
- var self = this,
- numVisible = self.get("numVisible"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem - numVisible);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() - self.get("numVisible"));
},
/**
@@ -602,11 +593,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollPageForward: function () {
- var self = this,
- numVisible = self.get("numVisible"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem + numVisible);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() + self.get("numVisible"));
},
/**
@@ -620,33 +608,20 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
var self = this,
isCircular = self.get("isCircular"),
numItems = self.get("numItems"),
+ numVisible = self.get("numVisible"),
attr, cb, first, offset;
- /* Attempt to fix an "out of bounds" index if possible. */
- if (index < 0) {
- if (isCircular) {
- index += numItems;
- } else {
- index = 0;
- }
- } else if (index > numItems - 1) {
- if (isCircular) {
- index = numItems - index;
- } else {
- index = numItems - 1;
- }
- }
-
+ index = self._getCorrectedIndex(index); // sanitize the value
offset = self._getOffsetForIndex(index);
cb = self.get("contentBox");
attr = self.get("isVertical") ? "top" : "left";
first = self.getFirstVisible();
self.fire(BEFORESCROLL_EVENT, { first: first,
- last: first+self.get("numVisible") });
+ last: first + numVisible });
cb.setStyle(attr, offset);
first = self.getFirstVisible(); // ask for the "new" first visible
self.fire(AFTERSCROLL_EVENT, { first: first,
- last: first+self.get("numVisible") });
+ last: first + numVisible });
self.set("selectedItem", index); // assume this is what the user want
},
@@ -809,6 +784,44 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
},
/**
+ * Return the correct index for the current configuration.
+ *
+ * @method _getCorrectedIndex
+ * @param {Number} index The index of the item to be scrolled to
+ * @return The corrected index after sanitizing for out of bounds error
+ * @protected
+ */
+ _getCorrectedIndex: function (index) {
+ var self = this,
+ isCircular = self.get("isCircular"),
+ numItems = self.get("numItems"),
+ numVisible = self.get("numVisible"),
+ sentinel = numItems - 1,
+ firstOfLastPage;
+
+ // Fix for Issues #2 and #11 - thanks <http://github.com/amasad>
+ if (isCircular) {
+ firstOfLastPage = self.getPageForItem(sentinel) * numVisible;
+ }
+
+ if (index < 0) {
+ if (isCircular) {
+ index = firstOfLastPage;
+ } else {
+ index = 0;
+ }
+ } else if (index > sentinel) {
+ if (isCircular) {
+ index = 0;
+ } else {
+ index = firstOfLastPage;
+ }
+ }
+
+ return index;
+ },
+
+ /**
* Return the first visible item given the selected item and the number of
* visible items in the view port.
*
@@ -1451,4 +1464,4 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
});
-}, 'gallery-2011.04.27-18-16' ,{skinnable:true, requires:['widget']});
+}, 'gallery-2011.05.04-20-03' ,{skinnable:true, requires:['widget']});
View
4 build/gallery-carousel/gallery-carousel-min.js
@@ -1,2 +1,2 @@
-YUI.add("gallery-carousel",function(a){function m(){m.superclass.constructor.apply(this,arguments);}var s=a.ClassNameManager.getClassName,f=a.Lang,r=a.Node,i=false,p=true,j="button",e="button-disabled",o="content",d="item",g="nav",l="nav-item",b="afterScroll",h="beforeScroll",q="itemAdded",c="itemRemoved",k="itemSelected",n="navStateChanged";m.NAME="carousel";m.ATTRS={autoPlayInterval:{validator:f.isNumber,value:0},carouselItemEl:{validator:f.isString,value:"li"},hidePagination:{validator:f.isBoolean,value:false},isCircular:{validator:f.isBoolean,value:false},isVertical:{setter:"_setVertical",validator:f.isBoolean,value:false},useMenuForNav:{validator:f.isBoolean,value:false},numItems:{value:0},numVisible:{validator:"_validateNumVisible",value:3},revealAmount:{validator:"_validateRevealAmount",value:0},scrollIncrement:{validator:f.isNumber,value:1},selectedItem:{validator:f.isNumber,value:0},strings:{value:{GOTO_PAGE:"Go to page {page}",NEXT_PAGE:"Next Page",PREV_PAGE:"Previous Page"}}};a.Carousel=a.extend(m,a.Widget,{addItem:function(x,y){var t=this,w,u,v;if(f.isString(x)){v=r.create(a.substitute(t.ITEM_TEMPLATE,{content:x}));}else{if(f.isObject(x)&&x.constructor.NAME==="node"){v=x;}else{return false;}}if(!t._vtbl.item.content){t._vtbl.item.content=v;}if(f.isUndefined(y)){t._vtbl.items.push(v);u=t._vtbl.items.length-1;}else{if(!t._vtbl.items[y]){t._vtbl.items[y]=undefined;}t._vtbl.items.splice(y,0,v);u=y;}w=this.get("numItems");t.set("numItems",w+1);t.fire(q,{item:v,pos:u});return true;},addItems:function(u){var t=this,y=false,w,v,x;if(!f.isArray(u)){return false;}y=true;for(v=0,x=u.length;v<x;++v){w=u[v].content;if(!t.addItem(w,u[v].pos)){y=false;}}return y;},clearItems:function(){var t=this,u=t._vtbl.items;while(u.length>0){t.removeItem(0);}},getElementForItem:function(t){return this.getItem(t);},getElementForItems:function(t){return this.getItems(t);},getFirstVisible:function(){var t=this,v=t.get("numVisible"),u=t.get("selectedItem");return t._getFirstVisible(u,v);},getFirstVisibleOnPage:function(t){return(t-1)*this.get("numVisible");},getItem:function(u){var t=this;if(u<0||u>t._vtbl.items.length-1){return null;}return f.isUndefined(t._vtbl.items[u])?null:t._vtbl.items[u];},getItems:function(x){var u=this,t=[],v,w;if(f.isUndefined(x)){for(v=0,w=u._vtbl.items.length;v<w;++v){t[v]=u.getItem(v);}}else{for(v=0,w=x.length;v<w;++v){t[x[v]]=u.getItem(x[v]);}}return t;},getPageForItem:function(t){return Math.floor(t/this.get("numVisible"));},getVisibleItems:function(){var t=this,v=t.get("numVisible"),y=t.getFirstVisible(),x=[],u,w;for(u=y,w=y+v;u<w;++u){x.push(t._vtbl.items[u]);}return x;},removeItem:function(u){var t=this,w,v;if(u<0||u>t._vtbl.items.length-1){return false;}w=t._vtbl.items.splice(u,1);w=f.isUndefined(w[0])?false:w[0];if(!w){return false;}v=t.get("numItems");--v;t.set("numItems",v);this.fire(c,{item:w,pos:u});return true;},scrollBackward:function(){var u=this,t=u.get("scrollIncrement"),v=u.get("selectedItem");u.scrollTo(v-t);},scrollForward:function(){var u=this,t=u.get("scrollIncrement"),v=u.get("selectedItem");u.scrollTo(v+t);},scrollPageBackward:function(){var t=this,v=t.get("numVisible"),u=t.get("selectedItem");t.scrollTo(u-v);},scrollPageForward:function(){var t=this,v=t.get("numVisible"),u=t.get("selectedItem");t.scrollTo(u+v);},scrollTo:function(x){var w=this,v=w.get("isCircular"),y=w.get("numItems"),u,t,A,z;if(x<0){if(v){x+=y;}else{x=0;}}else{if(x>y-1){if(v){x=y-x;}else{x=y-1;}}}z=w._getOffsetForIndex(x);t=w.get("contentBox");u=w.get("isVertical")?"top":"left";A=w.getFirstVisible();w.fire(h,{first:A,last:A+w.get("numVisible")});t.setStyle(u,z);A=w.getFirstVisible();w.fire(b,{first:A,last:A+w.get("numVisible")});w.set("selectedItem",x);},scrollToPage:function(u){var t=this;t.scrollTo(u*t.get("numVisible"));},bindUI:function(){var t=this,u=t.get("boundingBox");t.after("selectedItemChange",t._afterSelectedItemChange);t.on(q,t._addItemToDom);t.on(c,t._removeItemFromDom);if(!t.get("hidePagination")){u.delegate("click",a.bind(t._onNavItemClick,t),"."+s(m.NAME,l)+" > a");u.delegate("click",a.bind(t._onNavButtonClick,t),"."+s(m.NAME,j));}u.delegate("click",a.bind(t._onItemClick,t),"."+s(m.NAME,d));},initializer:function(){var t=this;t._vtbl={items:[],item:{content:null,hsz:0,vsz:0}};t.get("boundingBox").addClass(s(m.NAME,"loading"));t._parseItems();},renderUI:function(){var t=this;if(t.get("numItems")<1){t.get("boundingBox").addClass(s(m.NAME,"hidden"));return;}if(t._vtbl.item.hsz===0){t._vtbl.item.hsz=t._getNodeSize(t._vtbl.item.content,"width");}if(t._vtbl.item.vsz===0){t._vtbl.item.vsz=t._getNodeSize(t._vtbl.item.content,"height");}t._renderItems();if(!t.get("hidePagination")){t._renderNavigation();}t._renderContainer();},syncUI:function(){var t=this,u=t.get("selectedItem");t._uiSetSelectedItem(u,true);if(!t.get("hidePagination")){t._updateNavigation(u);}},_addItemToDom:function(u){var v=this,t=v.get("contentBox"),y,x,w,z;y=u.item;z=u.pos+1;if(y&&!t.contains(y)){x=v._vtbl.items[z];if(x){t.insertBefore(y,x);}else{t.append(y);}if(v.get("selectedItem")==z){w=v.get("numItems");++z;z=z>w-1?w-1:z;v.set("selectedItem",z);}v._redrawUi();}},_afterSelectedItemChange:function(u){var t=this;t._uiSetSelectedItem(u.prevVal,false);t._uiSetSelectedItem(u.newVal,true);t.fire(k,{pos:u.newVal});if(!t.get("hidePagination")){t._updateNavigation(u.newVal);}},_getFirstVisible:function(u,t){return u-(u%t);},_getOffsetForIndex:function(u){var t=this,v=t._vtbl.item,w;w=t.get("isVertical")?v.vsz:v.hsz;return -w*u;},_getNodeSize:function(t,v){var u=0;if(t&&t.constructor.NAME==="node"){if(v==="height"){u=parseInt(t.getComputedStyle("marginTop"),10)+parseInt(t.getComputedStyle("paddingTop"),10)+parseInt(t.getComputedStyle("borderTopWidth"),10)+parseInt(t.getComputedStyle("height"),10)+parseInt(t.getComputedStyle("borderBottomWidth"),10)+parseInt(t.getComputedStyle("paddingBottom"),10)+parseInt(t.getComputedStyle("marginBottom"),10);}else{if(v=="width"){u=parseInt(t.getComputedStyle("marginLeft"),10)+parseInt(t.getComputedStyle("paddingLeft"),10)+parseInt(t.getComputedStyle("borderLeftWidth"),10)+parseInt(t.getComputedStyle("width"),10)+parseInt(t.getComputedStyle("borderRightWidth"),10)+parseInt(t.getComputedStyle("paddingRight"),10)+parseInt(t.getComputedStyle("marginRight"),10);
-}}}return u;},_onItemClick:function(A){var C=this,z=C.get("boundingBox"),t,u,x,v,B,y,w;x=A&&A.target?A.target:null;if(!x){return;}A.preventDefault();t=z.one("."+s(m.NAME,o));u=x;B=s(m.NAME,d);while(u&&u!=t){if(u.hasClass(B)){break;}u=u.get("parentNode");}if(u){y=C._vtbl.items;for(v=0,w=y.length;v<w;++v){if(u==y[v]){C.set("selectedItem",v);break;}}}},_onNavButtonClick:function(u){var t=this,v;u.preventDefault();v=u&&u.target?u.target:null;if(!v){return;}if(!v.test(".yui3-carousel-button")){v=v.ancestor();}if(v.hasClass("yui3-carousel-first-button")){if(i){t.scrollPageBackward();}}else{if(v.hasClass("yui3-carousel-next-button")){if(p){t.scrollPageForward();}}}},_onNavItemClick:function(v){var t=this,u,w;w=v&&v.target?v.target:null;if(!w){return;}v.preventDefault();u=w.get("href");if(u){u=parseInt(u.replace(/.*#(.*)$/,"$1"),10);if(f.isNumber(u)){t.scrollToPage(u-1);}}},_parseItems:function(){var v=this,t,u;t=v.get("contentBox");u=t.all(v.get("carouselItemEl"));u.each(function(x,w){if(!v.addItem(x)){}},v);},_redrawUi:function(){var u=this,t="left";u._renderItems();u._updateNavigation();if(u.get("isVertical")){u._renderContainer();t="top";}u.scrollTo(u.get("selectedItem"));},_removeItemFromDom:function(u){var v=this,t=v.get("contentBox"),w,x;w=u.item;x=u.pos;if(w&&t.contains(w)){w.remove(true);if(v.get("selectedItem")==x){--x;x=x<0?0:x;v.set("selectedItem",x);}v._redrawUi();}},_renderContainer:function(){var t=this,A=t.get("boundingBox"),w=t.get("hidePagination"),x=t.get("numVisible"),u=t.get("revealAmount"),v=0,z,y;if(!w){z=A.one("."+s(m.NAME,g));v=t._getNodeSize(z,"height");}if(this.get("isVertical")){y=t._vtbl.item.vsz*x;if(u>0){y+=(y*u/100);}t._uiSetHeight(y+v);t._uiSetWidth(t._vtbl.item.vsz);t._uiSetWidthCB(t._vtbl.item.vsz);}else{y=t._vtbl.item.hsz*x;if(u>0){y+=(y*u/100);}t._uiSetWidth(y);t._uiSetHeight(t._vtbl.item.hsz+v);t._uiSetHeightCB(t._vtbl.item.hsz);}},_renderItems:function(){var v=this,u=v.get("contentBox"),t,x,z,A,y,w;if(v.get("isVertical")){t="top";w=v._vtbl.item.vsz;}else{t="left";w=v._vtbl.item.hsz;}z=s(m.NAME,d);for(x=0,A=v._vtbl.items.length;x<A;++x){y=v._vtbl.items[x];if(y){if(!y.inDoc()){if(x===0){u.appendChild(y);}else{u.insertBefore(y,v._vtbl.items[x-1]);}}y.setStyle(t,w*x);y.addClass(z);}}},_renderNavigation:function(){var B=this,y=B.get("boundingBox"),w=B.get("contentBox"),z=[],x,u,v,C,A;v=Math.ceil(B.get("numItems")/B.get("numVisible"));if(v<1){B.set("hidePagination",true);return;}C=B.get("strings.GOTO_PAGE");for(x=1;x<=v;++x){A=a.substitute(C,{page:x});z.push(a.substitute(B.DEF_NAV_ITEM_TEMPLATE,{pagenum:x,label:A}));}B._navBtns={prev:a.guid(),next:a.guid()};u=r.create(a.substitute(B.DEF_NAV_TEMPLATE,{nav_items:z.join(""),nav_prev_btn_id:B.prev,nav_prev_btn_text:B.get("strings.PREV_PAGE"),nav_next_btn_id:B.next,nav_next_btn_text:B.get("strings.NEXT_PAGE")}));y.insertBefore(u,w);},_setVertical:function(t,u){this._uiSetVertical(t);},_uiSetHeight:function(u){var t=this;if(u){t.get("boundingBox").setStyle("height",u);}},_uiSetHeightCB:function(u){var t=this;if(u){t.get("contentBox").setStyle("height",u);}},_uiSetNavItem:function(v){var t=this,w,u;if(!v){return;}w=t.get("boundingBox");u=s(m.NAME,"nav-item-selected");w.all("."+s(m.NAME,l)).removeClass(u);v.addClass(u);},_uiSetSelectedItem:function(v,t){var u=this,x=u._vtbl.items[v],w=s(m.NAME,"selected");if(x){if(t){x.addClass(w);}else{x.removeClass(w);}}},_uiSetVertical:function(u){var t=this.get("boundingBox");if(u){t.addClass(s(m.NAME,"vertical"));}else{t.addClass(s(m.NAME,"horizontal"));}},_uiSetWidth:function(u){var t=this;if(u){t.get("boundingBox").setStyle("width",u);}},_uiSetWidthCB:function(u){var t=this;if(u){t.get("contentBox").setStyle("width",u);}},_updateNavigation:function(y){var F=this,C=F.get("boundingBox"),z=F.get("isCircular"),u,D,A,B,x,w,v,G,E;y=y||F.get("selectedItem");F._uiSetSelectedItem(y,true);v=C.all("."+s(m.NAME,l));x=Math.ceil(F.get("numItems")/F.get("numVisible"));v.remove();w=C.one(".yui3-carousel-nav > ul");G=F.get("strings.GOTO_PAGE");for(A=1;A<=x;++A){E=a.substitute(G,{page:A});w.append(a.substitute(F.DEF_NAV_ITEM_TEMPLATE,{pagenum:A,label:E}));}v=C.all("."+s(m.NAME,l));D=F.getPageForItem(y);F._uiSetNavItem(v.item(D));B=F.getPageForItem(F.get("numItems")-1);if(B<0){u=C.one("."+s(m.NAME,"first",j));if(u){u.addClass(s(m.NAME,"first",e));i=false;}u=C.one("."+s(m.NAME,"next",j));if(u){u.addClass(s(m.NAME,e));p=false;}}else{if(D===0&&D!=B){u=C.one("."+s(m.NAME,"next",j));if(u){u.removeClass(s(m.NAME,e));p=true;}if(!z){u=C.one("."+s(m.NAME,"first",j));if(u){u.addClass(s(m.NAME,"first",e));i=false;}}}else{if(D!==0&&D==B){u=C.one("."+s(m.NAME,"first",j));if(u){u.removeClass(s(m.NAME,"first",e));i=true;}if(!z){u=C.one("."+s(m.NAME,"next",j));if(u){u.addClass(s(m.NAME,e));p=false;}}}else{if(B>0){u=C.one("."+s(m.NAME,"first",j));if(u){u.removeClass(s(m.NAME,"first",e));i=true;}u=C.one("."+s(m.NAME,"next",j));if(u){u.removeClass(s(m.NAME,e));p=true;}}}}}},_validateNumVisible:function(t,u){return t>0;},_validateRevealAmount:function(t,u){return t>=0&&t<=100;},ITEM_TEMPLATE:'<li class="yui3-carousel-item">{content}</li>',DEF_NAV_TEMPLATE:'<div class="yui3-carousel-nav">'+"<ul>{nav_items}</ul>"+'<span class="yui3-carousel-button yui3-carousel-first-button">'+'<button type="button">'+"{nav_prev_btn_text}</button>"+"</span>"+'<span class="yui3-carousel-button yui3-carousel-next-button">'+'<button type="button">'+"{nav_next_btn_text}</button>"+"</span>"+"</div>",DEF_NAV_ITEM_TEMPLATE:'<li class="yui3-carousel-nav-item">'+'<a class="yui3-carousel-pager-item" '+'href="#{pagenum}"><em>{label}</em></a></li>',_navBtns:null,_vtbl:null});},"gallery-2011.04.27-18-16",{skinnable:true,requires:["widget"]});
+YUI.add("gallery-carousel",function(a){function m(){m.superclass.constructor.apply(this,arguments);}var s=a.ClassNameManager.getClassName,f=a.Lang,r=a.Node,i=false,p=true,j="button",e="button-disabled",o="content",d="item",g="nav",l="nav-item",b="afterScroll",h="beforeScroll",q="itemAdded",c="itemRemoved",k="itemSelected",n="navStateChanged";m.NAME="carousel";m.ATTRS={autoPlayInterval:{validator:f.isNumber,value:0},carouselItemEl:{validator:f.isString,value:"li"},hidePagination:{validator:f.isBoolean,value:false},isCircular:{validator:f.isBoolean,value:false},isVertical:{setter:"_setVertical",validator:f.isBoolean,value:false},useMenuForNav:{validator:f.isBoolean,value:false},numItems:{value:0},numVisible:{validator:"_validateNumVisible",value:3},revealAmount:{validator:"_validateRevealAmount",value:0},scrollIncrement:{validator:f.isNumber,value:1},selectedItem:{validator:f.isNumber,value:0},strings:{value:{GOTO_PAGE:"Go to page {page}",NEXT_PAGE:"Next Page",PREV_PAGE:"Previous Page"}}};a.Carousel=a.extend(m,a.Widget,{addItem:function(x,y){var t=this,w,u,v;if(f.isString(x)){v=r.create(a.substitute(t.ITEM_TEMPLATE,{content:x}));}else{if(f.isObject(x)&&x.constructor.NAME==="node"){v=x;}else{return false;}}if(!t._vtbl.item.content){t._vtbl.item.content=v;}if(f.isUndefined(y)){t._vtbl.items.push(v);u=t._vtbl.items.length-1;}else{if(!t._vtbl.items[y]){t._vtbl.items[y]=undefined;}t._vtbl.items.splice(y,0,v);u=y;}w=this.get("numItems");t.set("numItems",w+1);t.fire(q,{item:v,pos:u});return true;},addItems:function(u){var t=this,y=false,w,v,x;if(!f.isArray(u)){return false;}y=true;for(v=0,x=u.length;v<x;++v){w=u[v].content;if(!t.addItem(w,u[v].pos)){y=false;}}return y;},clearItems:function(){var t=this,u=t._vtbl.items;while(u.length>0){t.removeItem(0);}},getElementForItem:function(t){return this.getItem(t);},getElementForItems:function(t){return this.getItems(t);},getFirstVisible:function(){var t=this,v=t.get("numVisible"),u=t.get("selectedItem");return t._getFirstVisible(u,v);},getFirstVisibleOnPage:function(t){return(t-1)*this.get("numVisible");},getItem:function(u){var t=this;if(u<0||u>t._vtbl.items.length-1){return null;}return f.isUndefined(t._vtbl.items[u])?null:t._vtbl.items[u];},getItems:function(x){var u=this,t=[],v,w;if(f.isUndefined(x)){for(v=0,w=u._vtbl.items.length;v<w;++v){t[v]=u.getItem(v);}}else{for(v=0,w=x.length;v<w;++v){t[x[v]]=u.getItem(x[v]);}}return t;},getPageForItem:function(t){return Math.floor(t/this.get("numVisible"));},getVisibleItems:function(){var t=this,v=t.get("numVisible"),y=t.getFirstVisible(),x=[],u,w;for(u=y,w=y+v;u<w;++u){x.push(t._vtbl.items[u]);}return x;},removeItem:function(u){var t=this,w,v;if(u<0||u>t._vtbl.items.length-1){return false;}w=t._vtbl.items.splice(u,1);w=f.isUndefined(w[0])?false:w[0];if(!w){return false;}v=t.get("numItems");--v;t.set("numItems",v);this.fire(c,{item:w,pos:u});return true;},scrollBackward:function(){var t=this;t.scrollTo(t.getFirstVisible()-t.get("scrollIncrement"));},scrollForward:function(){var t=this;t.scrollTo(t.getFirstVisible()+t.get("scrollIncrement"));},scrollPageBackward:function(){var t=this;t.scrollTo(t.getFirstVisible()-t.get("numVisible"));},scrollPageForward:function(){var t=this;t.scrollTo(t.getFirstVisible()+t.get("numVisible"));},scrollTo:function(x){var B=this,u=B.get("isCircular"),z=B.get("numItems"),A=B.get("numVisible"),y,t,w,v;x=B._getCorrectedIndex(x);v=B._getOffsetForIndex(x);t=B.get("contentBox");y=B.get("isVertical")?"top":"left";w=B.getFirstVisible();B.fire(h,{first:w,last:w+A});t.setStyle(y,v);w=B.getFirstVisible();B.fire(b,{first:w,last:w+A});B.set("selectedItem",x);},scrollToPage:function(u){var t=this;t.scrollTo(u*t.get("numVisible"));},bindUI:function(){var t=this,u=t.get("boundingBox");t.after("selectedItemChange",t._afterSelectedItemChange);t.on(q,t._addItemToDom);t.on(c,t._removeItemFromDom);if(!t.get("hidePagination")){u.delegate("click",a.bind(t._onNavItemClick,t),"."+s(m.NAME,l)+" > a");u.delegate("click",a.bind(t._onNavButtonClick,t),"."+s(m.NAME,j));}u.delegate("click",a.bind(t._onItemClick,t),"."+s(m.NAME,d));},initializer:function(){var t=this;t._vtbl={items:[],item:{content:null,hsz:0,vsz:0}};t.get("boundingBox").addClass(s(m.NAME,"loading"));t._parseItems();},renderUI:function(){var t=this;if(t.get("numItems")<1){t.get("boundingBox").addClass(s(m.NAME,"hidden"));return;}if(t._vtbl.item.hsz===0){t._vtbl.item.hsz=t._getNodeSize(t._vtbl.item.content,"width");}if(t._vtbl.item.vsz===0){t._vtbl.item.vsz=t._getNodeSize(t._vtbl.item.content,"height");}t._renderItems();if(!t.get("hidePagination")){t._renderNavigation();}t._renderContainer();},syncUI:function(){var t=this,u=t.get("selectedItem");t._uiSetSelectedItem(u,true);if(!t.get("hidePagination")){t._updateNavigation(u);}},_addItemToDom:function(u){var v=this,t=v.get("contentBox"),y,x,w,z;y=u.item;z=u.pos+1;if(y&&!t.contains(y)){x=v._vtbl.items[z];if(x){t.insertBefore(y,x);}else{t.append(y);}if(v.get("selectedItem")==z){w=v.get("numItems");++z;z=z>w-1?w-1:z;v.set("selectedItem",z);}v._redrawUi();}},_afterSelectedItemChange:function(u){var t=this;t._uiSetSelectedItem(u.prevVal,false);t._uiSetSelectedItem(u.newVal,true);t.fire(k,{pos:u.newVal});if(!t.get("hidePagination")){t._updateNavigation(u.newVal);}},_getCorrectedIndex:function(x){var u=this,t=u.get("isCircular"),y=u.get("numItems"),z=u.get("numVisible"),w=y-1,v;if(t){v=u.getPageForItem(w)*z;}if(x<0){if(t){x=v;}else{x=0;}}else{if(x>w){if(t){x=0;}else{x=v;}}}return x;},_getFirstVisible:function(u,t){return u-(u%t);},_getOffsetForIndex:function(u){var t=this,v=t._vtbl.item,w;w=t.get("isVertical")?v.vsz:v.hsz;return -w*u;},_getNodeSize:function(t,v){var u=0;if(t&&t.constructor.NAME==="node"){if(v==="height"){u=parseInt(t.getComputedStyle("marginTop"),10)+parseInt(t.getComputedStyle("paddingTop"),10)+parseInt(t.getComputedStyle("borderTopWidth"),10)+parseInt(t.getComputedStyle("height"),10)+parseInt(t.getComputedStyle("borderBottomWidth"),10)+parseInt(t.getComputedStyle("paddingBottom"),10)+parseInt(t.getComputedStyle("marginBottom"),10);
+}else{if(v=="width"){u=parseInt(t.getComputedStyle("marginLeft"),10)+parseInt(t.getComputedStyle("paddingLeft"),10)+parseInt(t.getComputedStyle("borderLeftWidth"),10)+parseInt(t.getComputedStyle("width"),10)+parseInt(t.getComputedStyle("borderRightWidth"),10)+parseInt(t.getComputedStyle("paddingRight"),10)+parseInt(t.getComputedStyle("marginRight"),10);}}}return u;},_onItemClick:function(A){var C=this,z=C.get("boundingBox"),t,u,x,v,B,y,w;x=A&&A.target?A.target:null;if(!x){return;}A.preventDefault();t=z.one("."+s(m.NAME,o));u=x;B=s(m.NAME,d);while(u&&u!=t){if(u.hasClass(B)){break;}u=u.get("parentNode");}if(u){y=C._vtbl.items;for(v=0,w=y.length;v<w;++v){if(u==y[v]){C.set("selectedItem",v);break;}}}},_onNavButtonClick:function(u){var t=this,v;u.preventDefault();v=u&&u.target?u.target:null;if(!v){return;}if(!v.test(".yui3-carousel-button")){v=v.ancestor();}if(v.hasClass("yui3-carousel-first-button")){if(i){t.scrollPageBackward();}}else{if(v.hasClass("yui3-carousel-next-button")){if(p){t.scrollPageForward();}}}},_onNavItemClick:function(v){var t=this,u,w;w=v&&v.target?v.target:null;if(!w){return;}v.preventDefault();u=w.get("href");if(u){u=parseInt(u.replace(/.*#(.*)$/,"$1"),10);if(f.isNumber(u)){t.scrollToPage(u-1);}}},_parseItems:function(){var v=this,t,u;t=v.get("contentBox");u=t.all(v.get("carouselItemEl"));u.each(function(x,w){if(!v.addItem(x)){}},v);},_redrawUi:function(){var u=this,t="left";u._renderItems();u._updateNavigation();if(u.get("isVertical")){u._renderContainer();t="top";}u.scrollTo(u.get("selectedItem"));},_removeItemFromDom:function(u){var v=this,t=v.get("contentBox"),w,x;w=u.item;x=u.pos;if(w&&t.contains(w)){w.remove(true);if(v.get("selectedItem")==x){--x;x=x<0?0:x;v.set("selectedItem",x);}v._redrawUi();}},_renderContainer:function(){var t=this,A=t.get("boundingBox"),w=t.get("hidePagination"),x=t.get("numVisible"),u=t.get("revealAmount"),v=0,z,y;if(!w){z=A.one("."+s(m.NAME,g));v=t._getNodeSize(z,"height");}if(this.get("isVertical")){y=t._vtbl.item.vsz*x;if(u>0){y+=(y*u/100);}t._uiSetHeight(y+v);t._uiSetWidth(t._vtbl.item.vsz);t._uiSetWidthCB(t._vtbl.item.vsz);}else{y=t._vtbl.item.hsz*x;if(u>0){y+=(y*u/100);}t._uiSetWidth(y);t._uiSetHeight(t._vtbl.item.hsz+v);t._uiSetHeightCB(t._vtbl.item.hsz);}},_renderItems:function(){var v=this,u=v.get("contentBox"),t,x,z,A,y,w;if(v.get("isVertical")){t="top";w=v._vtbl.item.vsz;}else{t="left";w=v._vtbl.item.hsz;}z=s(m.NAME,d);for(x=0,A=v._vtbl.items.length;x<A;++x){y=v._vtbl.items[x];if(y){if(!y.inDoc()){if(x===0){u.appendChild(y);}else{u.insertBefore(y,v._vtbl.items[x-1]);}}y.setStyle(t,w*x);y.addClass(z);}}},_renderNavigation:function(){var B=this,y=B.get("boundingBox"),w=B.get("contentBox"),z=[],x,u,v,C,A;v=Math.ceil(B.get("numItems")/B.get("numVisible"));if(v<1){B.set("hidePagination",true);return;}C=B.get("strings.GOTO_PAGE");for(x=1;x<=v;++x){A=a.substitute(C,{page:x});z.push(a.substitute(B.DEF_NAV_ITEM_TEMPLATE,{pagenum:x,label:A}));}B._navBtns={prev:a.guid(),next:a.guid()};u=r.create(a.substitute(B.DEF_NAV_TEMPLATE,{nav_items:z.join(""),nav_prev_btn_id:B.prev,nav_prev_btn_text:B.get("strings.PREV_PAGE"),nav_next_btn_id:B.next,nav_next_btn_text:B.get("strings.NEXT_PAGE")}));y.insertBefore(u,w);},_setVertical:function(t,u){this._uiSetVertical(t);},_uiSetHeight:function(u){var t=this;if(u){t.get("boundingBox").setStyle("height",u);}},_uiSetHeightCB:function(u){var t=this;if(u){t.get("contentBox").setStyle("height",u);}},_uiSetNavItem:function(v){var t=this,w,u;if(!v){return;}w=t.get("boundingBox");u=s(m.NAME,"nav-item-selected");w.all("."+s(m.NAME,l)).removeClass(u);v.addClass(u);},_uiSetSelectedItem:function(v,t){var u=this,x=u._vtbl.items[v],w=s(m.NAME,"selected");if(x){if(t){x.addClass(w);}else{x.removeClass(w);}}},_uiSetVertical:function(u){var t=this.get("boundingBox");if(u){t.addClass(s(m.NAME,"vertical"));}else{t.addClass(s(m.NAME,"horizontal"));}},_uiSetWidth:function(u){var t=this;if(u){t.get("boundingBox").setStyle("width",u);}},_uiSetWidthCB:function(u){var t=this;if(u){t.get("contentBox").setStyle("width",u);}},_updateNavigation:function(y){var F=this,C=F.get("boundingBox"),z=F.get("isCircular"),u,D,A,B,x,w,v,G,E;y=y||F.get("selectedItem");F._uiSetSelectedItem(y,true);v=C.all("."+s(m.NAME,l));x=Math.ceil(F.get("numItems")/F.get("numVisible"));v.remove();w=C.one(".yui3-carousel-nav > ul");G=F.get("strings.GOTO_PAGE");for(A=1;A<=x;++A){E=a.substitute(G,{page:A});w.append(a.substitute(F.DEF_NAV_ITEM_TEMPLATE,{pagenum:A,label:E}));}v=C.all("."+s(m.NAME,l));D=F.getPageForItem(y);F._uiSetNavItem(v.item(D));B=F.getPageForItem(F.get("numItems")-1);if(B<0){u=C.one("."+s(m.NAME,"first",j));if(u){u.addClass(s(m.NAME,"first",e));i=false;}u=C.one("."+s(m.NAME,"next",j));if(u){u.addClass(s(m.NAME,e));p=false;}}else{if(D===0&&D!=B){u=C.one("."+s(m.NAME,"next",j));if(u){u.removeClass(s(m.NAME,e));p=true;}if(!z){u=C.one("."+s(m.NAME,"first",j));if(u){u.addClass(s(m.NAME,"first",e));i=false;}}}else{if(D!==0&&D==B){u=C.one("."+s(m.NAME,"first",j));if(u){u.removeClass(s(m.NAME,"first",e));i=true;}if(!z){u=C.one("."+s(m.NAME,"next",j));if(u){u.addClass(s(m.NAME,e));p=false;}}}else{if(B>0){u=C.one("."+s(m.NAME,"first",j));if(u){u.removeClass(s(m.NAME,"first",e));i=true;}u=C.one("."+s(m.NAME,"next",j));if(u){u.removeClass(s(m.NAME,e));p=true;}}}}}},_validateNumVisible:function(t,u){return t>0;},_validateRevealAmount:function(t,u){return t>=0&&t<=100;},ITEM_TEMPLATE:'<li class="yui3-carousel-item">{content}</li>',DEF_NAV_TEMPLATE:'<div class="yui3-carousel-nav">'+"<ul>{nav_items}</ul>"+'<span class="yui3-carousel-button yui3-carousel-first-button">'+'<button type="button">'+"{nav_prev_btn_text}</button>"+"</span>"+'<span class="yui3-carousel-button yui3-carousel-next-button">'+'<button type="button">'+"{nav_next_btn_text}</button>"+"</span>"+"</div>",DEF_NAV_ITEM_TEMPLATE:'<li class="yui3-carousel-nav-item">'+'<a class="yui3-carousel-pager-item" '+'href="#{pagenum}"><em>{label}</em></a></li>',_navBtns:null,_vtbl:null});},"gallery-2011.05.04-20-03",{skinnable:true,requires:["widget"]});
View
89 build/gallery-carousel/gallery-carousel.js
@@ -553,11 +553,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollBackward: function () {
- var self = this,
- scrollIncrement = self.get("scrollIncrement"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem - scrollIncrement);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() - self.get("scrollIncrement"));
},
/**
@@ -567,11 +564,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollForward: function () {
- var self = this,
- scrollIncrement = self.get("scrollIncrement"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem + scrollIncrement);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() + self.get("scrollIncrement"));
},
/**
@@ -581,11 +575,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollPageBackward: function () {
- var self = this,
- numVisible = self.get("numVisible"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem - numVisible);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() - self.get("numVisible"));
},
/**
@@ -595,11 +586,8 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
* @public
*/
scrollPageForward: function () {
- var self = this,
- numVisible = self.get("numVisible"),
- selectedItem = self.get("selectedItem");
-
- self.scrollTo(selectedItem + numVisible);
+ var self = this;
+ self.scrollTo(self.getFirstVisible() + self.get("numVisible"));
},
/**
@@ -613,33 +601,20 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
var self = this,
isCircular = self.get("isCircular"),
numItems = self.get("numItems"),
+ numVisible = self.get("numVisible"),
attr, cb, first, offset;
- /* Attempt to fix an "out of bounds" index if possible. */
- if (index < 0) {
- if (isCircular) {
- index += numItems;
- } else {
- index = 0;
- }
- } else if (index > numItems - 1) {
- if (isCircular) {
- index = numItems - index;
- } else {
- index = numItems - 1;
- }
- }
-
+ index = self._getCorrectedIndex(index); // sanitize the value
offset = self._getOffsetForIndex(index);
cb = self.get("contentBox");
attr = self.get("isVertical") ? "top" : "left";
first = self.getFirstVisible();
self.fire(BEFORESCROLL_EVENT, { first: first,
- last: first+self.get("numVisible") });
+ last: first + numVisible });
cb.setStyle(attr, offset);
first = self.getFirstVisible(); // ask for the "new" first visible
self.fire(AFTERSCROLL_EVENT, { first: first,
- last: first+self.get("numVisible") });
+ last: first + numVisible });
self.set("selectedItem", index); // assume this is what the user want
},
@@ -799,6 +774,44 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
},
/**
+ * Return the correct index for the current configuration.
+ *
+ * @method _getCorrectedIndex
+ * @param {Number} index The index of the item to be scrolled to
+ * @return The corrected index after sanitizing for out of bounds error
+ * @protected
+ */
+ _getCorrectedIndex: function (index) {
+ var self = this,
+ isCircular = self.get("isCircular"),
+ numItems = self.get("numItems"),
+ numVisible = self.get("numVisible"),
+ sentinel = numItems - 1,
+ firstOfLastPage;
+
+ // Fix for Issues #2 and #11 - thanks <http://github.com/amasad>
+ if (isCircular) {
+ firstOfLastPage = self.getPageForItem(sentinel) * numVisible;
+ }
+
+ if (index < 0) {
+ if (isCircular) {
+ index = firstOfLastPage;
+ } else {
+ index = 0;
+ }
+ } else if (index > sentinel) {
+ if (isCircular) {
+ index = 0;
+ } else {
+ index = firstOfLastPage;
+ }
+ }
+
+ return index;
+ },
+
+ /**
* Return the first visible item given the selected item and the number of
* visible items in the view port.
*
@@ -1428,4 +1441,4 @@ Y.Carousel = Y.extend(Carousel, Y.Widget, {
});
-}, 'gallery-2011.04.27-18-16' ,{skinnable:true, requires:['widget']});
+}, 'gallery-2011.05.04-20-03' ,{skinnable:true, requires:['widget']});
View
39 build/gallery-geo/gallery-geo-debug.js
@@ -1,13 +1,11 @@
YUI.add('gallery-geo', function(Y) {
/*global YUI*/
-//select * from geo.places where woeid in (select place.woeid from flickr.places where (lat,lon) in(select latitude,longitude from ip.location where ip="209.131.62.113"))
+
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* Written by Nicholas C. Zakas, nczonline.net
*/
-
-var IP_URL = "http://www.geoplugin.net/json.gp?jsoncallback=";
/**
* Geolocation API
@@ -63,23 +61,26 @@ function getCurrentPositionByAPI(callback, scope){
*/
function getCurrentPositionByGeoIP(callback, scope){
- //Try to get by IP address
- Y.jsonp(IP_URL, {
- format: function(url, proxy){
- return url + proxy;
- },
+ Y.YQL("select * from pidgets.geoip", {
on: {
success: function(response){
- callback.call(scope, {
- success: true,
- coords: {
- latitude: parseFloat(response.geoplugin_latitude),
- longitude: parseFloat(response.geoplugin_longitude),
- accuracy: Infinity //TODO: Figure out better value
- },
- timestamp: +new Date(),
- source: "geoplugin"
- });
+ var results;
+
+ if (response.error){
+ callback.call(scope, { success: false });
+ } else {
+ results = response.query.results.Result;
+ callback.call(scope, {
+ success: true,
+ coords: {
+ latitude: parseFloat(results.latitude),
+ longitude: parseFloat(results.longitude),
+ accuracy: Infinity //TODO: Figure out better value
+ },
+ timestamp: +new Date(),
+ source: "pidgets.geoip"
+ });
+ }
},
failure: function(){
callback.call(scope, { success: false });
@@ -113,4 +114,4 @@ Y.Geo = {
};
-}, 'gallery-2011.04.27-17-14' ,{requires:['jsonp']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['yql']});
View
2  build/gallery-geo/gallery-geo-min.js
@@ -1 +1 @@
-YUI.add("gallery-geo",function(d){var b="http://www.geoplugin.net/json.gp?jsoncallback=";function a(f,e){navigator.geolocation.getCurrentPosition(function(g){f.call(e,{success:true,coords:{latitude:g.coords.latitude,longitude:g.coords.longitude,accuracy:g.coords.accuracy,altitude:g.coords.altitude,altitudeAccuracy:g.coords.altitudeAccuracy,heading:g.coords.heading,speed:g.coords.speed},timestamp:g.timestamp,source:"native"});},function(g){if(g.code==1){f.call(e,{success:false,denied:true});}else{getCurrentPositionByGeoIp(f,e);}});}function c(f,e){d.jsonp(b,{format:function(g,h){return g+h;},on:{success:function(g){f.call(e,{success:true,coords:{latitude:parseFloat(g.geoplugin_latitude),longitude:parseFloat(g.geoplugin_longitude),accuracy:Infinity},timestamp:+new Date(),source:"geoplugin"});},failure:function(){f.call(e,{success:false});}}});}d.Geo={getCurrentPosition:navigator.geolocation?a:c};},"gallery-2011.04.27-17-14",{requires:["jsonp"]});
+YUI.add("gallery-geo",function(c){function a(e,d){navigator.geolocation.getCurrentPosition(function(f){e.call(d,{success:true,coords:{latitude:f.coords.latitude,longitude:f.coords.longitude,accuracy:f.coords.accuracy,altitude:f.coords.altitude,altitudeAccuracy:f.coords.altitudeAccuracy,heading:f.coords.heading,speed:f.coords.speed},timestamp:f.timestamp,source:"native"});},function(f){if(f.code==1){e.call(d,{success:false,denied:true});}else{getCurrentPositionByGeoIp(e,d);}});}function b(e,d){c.YQL("select * from pidgets.geoip",{on:{success:function(f){var g;if(f.error){e.call(d,{success:false});}else{g=f.query.results.Result;e.call(d,{success:true,coords:{latitude:parseFloat(g.latitude),longitude:parseFloat(g.longitude),accuracy:Infinity},timestamp:+new Date(),source:"pidgets.geoip"});}},failure:function(){e.call(d,{success:false});}}});}c.Geo={getCurrentPosition:navigator.geolocation?a:b};},"gallery-2011.05.04-20-03",{requires:["yql"]});
View
39 build/gallery-geo/gallery-geo.js
@@ -1,13 +1,11 @@
YUI.add('gallery-geo', function(Y) {
/*global YUI*/
-//select * from geo.places where woeid in (select place.woeid from flickr.places where (lat,lon) in(select latitude,longitude from ip.location where ip="209.131.62.113"))
+
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
* Written by Nicholas C. Zakas, nczonline.net
*/
-
-var IP_URL = "http://www.geoplugin.net/json.gp?jsoncallback=";
/**
* Geolocation API
@@ -63,23 +61,26 @@ function getCurrentPositionByAPI(callback, scope){
*/
function getCurrentPositionByGeoIP(callback, scope){
- //Try to get by IP address
- Y.jsonp(IP_URL, {
- format: function(url, proxy){
- return url + proxy;
- },
+ Y.YQL("select * from pidgets.geoip", {
on: {
success: function(response){
- callback.call(scope, {
- success: true,
- coords: {
- latitude: parseFloat(response.geoplugin_latitude),
- longitude: parseFloat(response.geoplugin_longitude),
- accuracy: Infinity //TODO: Figure out better value
- },
- timestamp: +new Date(),
- source: "geoplugin"
- });
+ var results;
+
+ if (response.error){
+ callback.call(scope, { success: false });
+ } else {
+ results = response.query.results.Result;
+ callback.call(scope, {
+ success: true,
+ coords: {
+ latitude: parseFloat(results.latitude),
+ longitude: parseFloat(results.longitude),
+ accuracy: Infinity //TODO: Figure out better value
+ },
+ timestamp: +new Date(),
+ source: "pidgets.geoip"
+ });
+ }
},
failure: function(){
callback.call(scope, { success: false });
@@ -113,4 +114,4 @@ Y.Geo = {
};
-}, 'gallery-2011.04.27-17-14' ,{requires:['jsonp']});
+}, 'gallery-2011.05.04-20-03' ,{requires:['yql']});
View
42 build/gallery-get-selection/gallery-get-selection-debug.js
@@ -0,0 +1,42 @@
+YUI.add('gallery-get-selection', function(Y) {
+
+/**
+ * Getting a DOM fragment with the dom structure selected by the user.
+ * @module gallery-get-selection
+ * @requires node
+ */
+
+/**
+ * Return a DOM Fragment with the dom structure selected by the user to
+ * facilitate the analysis of that fragment.
+ * E.g., Y.getSelection().all('p').size() will give you the number of paragraphs
+ * selected by the user.
+ * @class getSelection
+ * @static
+ */
+
+/*
+ * All the credit for Dav Glass (@davglass), since he has provided the whole chunk of code,
+ * I just did the monkey work.
+ */
+Y.getSelection = function() {
+ var sel,
+ frag;
+
+ if (Y.config.win.getSelection) {
+ sel = Y.config.win.getSelection().getRangeAt(0);
+ } else if (Y.config.doc.selection) {
+ sel = Y.config.doc.selection.createRange();
+ }
+
+ if (sel.cloneContents) {
+ frag = sel.cloneContents();
+ } else if (sel.htmlText) {
+ frag = Y.Node.create(sel.htmlText);
+ }
+
+ return Y.Node.create('<div></div>').append(frag);
+};
+
+
+}, 'gallery-2011.05.04-20-03' ,{requires:['node']});
View
1  build/gallery-get-selection/gallery-get-selection-min.js
@@ -0,0 +1 @@
+YUI.add("gallery-get-selection",function(a){a.getSelection=function(){var b,c;if(a.config.win.getSelection){b=a.config.win.getSelection().getRangeAt(0);}else{if(a.config.doc.selection){b=a.config.doc.selection.createRange();}}if(b.cloneContents){c=b.cloneContents();}else{if(b.htmlText){c=a.Node.create(b.htmlText);}}return a.Node.create("<div></div>").append(c);};},"gallery-2011.05.04-20-03",{requires:["node"]});
View
42 build/gallery-get-selection/gallery-get-selection.js
@@ -0,0 +1,42 @@
+YUI.add('gallery-get-selection', function(Y) {
+
+/**
+ * Getting a DOM fragment with the dom structure selected by the user.
+ * @module gallery-get-selection
+ * @requires node
+ */
+
+/**
+ * Return a DOM Fragment with the dom structure selected by the user to
+ * facilitate the analysis of that fragment.
+ * E.g., Y.getSelection().all('p').size() will give you the number of paragraphs
+ * selected by the user.
+ * @class getSelection
+ * @static
+ */
+
+/*
+ * All the credit for Dav Glass (@davglass), since he has provided the whole chunk of code,
+ * I just did the monkey work.
+ */
+Y.getSelection = function() {
+ var sel,
+ frag;
+
+ if (Y.config.win.getSelection) {
+ sel = Y.config.win.getSelection().getRangeAt(0);
+ } else if (Y.config.doc.selection) {
+ sel = Y.config.doc.selection.createRange();
+ }
+
+ if (sel.cloneContents) {
+ frag = sel.cloneContents();
+ } else if (sel.htmlText) {
+ frag = Y.Node.create(sel.htmlText);
+ }
+
+ return Y.Node.create('<div></div>').append(frag);
+};
+
+
+}, 'gallery-2011.05.04-20-03' ,{requires:['node']});
View
64 build/gallery-inspector/assets/gallery-inspector-core.css
@@ -0,0 +1,64 @@
+.yui3-skin-sam .yui3-inspector {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.yui3-skin-sam .yui3-inspector-hidden { display: none; }
+
+.yui3-skin-sam .yui3-inspector-hd {
+ padding: 6px 10px;
+ position: relative;
+ text-align: right;
+}
+
+.yui3-skin-sam .yui3-inspector-title {
+ margin: 0;
+ float: left;
+ line-height: 1.7;
+}
+
+.yui3-skin-sam .yui3-inspector-bd {
+ position: relative;
+ overflow: auto;
+ overflow-x: auto;
+ overflow-y: scroll;
+}
+
+.yui3-skin-sam .yui3-inspector-ft {
+ font-size: 12px;
+ padding: 4px 6px 3px;
+ position: relative;
+}
+
+.yui3-skin-sam .yui3-inspector-filter {
+ float: right;
+ height: 1.1em;
+ margin: -1px 5px 0 0;
+ width: 50%;
+}
+
+.yui3-skin-sam .yui3-inspector table {
+ width: 100%;
+ border-collapse: collapse;
+ table-layout: fixed;
+ padding: 0;
+}
+
+.yui3-skin-sam .yui3-inspector-value-cell {
+ font: normal 12px/1.3 Monaco, Consolas, monospace;
+}
+
+.yui3-skin-sam .yui3-inspector th,
+.yui3-skin-sam .yui3-inspector td {
+ padding: 4px 6px;
+ word-wrap: break-word;
+ text-align: left;
+ vertical-align: top;
+}
+
+.yui3-skin-sam .yui3-dd-draggable .yui3-inspector-hd { cursor: move; }
+.yui3-skin-sam .yui3-dd-locked .yui3-inspector-hd { cursor: default; }
+
+.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-bd,
+.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-ft { display: none; }
View
85 build/gallery-inspector/assets/skins/sam/gallery-inspector-skin.css
@@ -0,0 +1,85 @@
+.yui3-skin-sam .yui3-inspectorplugin-content,
+.yui3-skin-sam .yui3-inspector-content {
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ -moz-box-shadow: 0 0 3px #888;
+ -webkit-box-shadow: 0 0 3px #888;
+ background: #ddd;
+ border: 1px solid #888;
+ border-radius: 7px;
+ box-shadow: 0 0 3px #888;
+ font: normal 13px/1.3 Arial, sans-serif;
+}
+
+.yui3-skin-sam .yui3-inspector-hd {
+ -moz-border-radius-topright: 7px;
+ -moz-border-radius-topleft: 7px;
+ -webkit-border-top-right-radius: 7px;
+ -webkit-border-top-left-radius: 7px;
+ border-bottom: 1px solid #888;
+ border-top-right-radius: 7px;
+ border-top-left-radius: 7px;
+}
+
+.yui3-skin-sam .yui3-inspector-destroyed {
+ color: #800;
+ text-decoration: line-through;
+}
+
+.yui3-skin-sam .yui3-inspector-bd { background: #f3f3f3; }
+
+.yui3-skin-sam .yui3-inspector-ft { border-top: 1px solid #888; }
+
+.yui3-skin-sam .yui3-inspector-hd,
+.yui3-skin-sam .yui3-inspector-ft {
+ background: #e3e3e3;
+ background: -moz-linear-gradient(top, #fff, #bbb);
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#bbb));
+}
+
+.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-hd,
+.yui3-skin-sam .yui3-inspector-ft {
+ -moz-border-radius-bottomright: 7px;
+ -moz-border-radius-bottomleft: 7px;
+ -webkit-border-bottom-right-radius: 7px;
+ -webkit-border-bottom-left-radius: 7px;
+ border-bottom-right-radius: 7px;
+ border-bottom-left-radius: 7px;
+}
+
+.yui3-skin-sam .yui3-inspector table { border-bottom: 1px solid #ccc; }
+
+.yui3-skin-sam .yui3-inspector th { border-right: 1px solid #ccc; }
+
+.yui3-skin-sam .yui3-inspector thead th {
+ background: #e6e6e6;
+ background: -moz-linear-gradient(top, #fff, #ccc);
+ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ccc));
+ border-bottom: 1px solid #bbb;
+}
+
+.yui3-skin-sam .yui3-inspector thead th:first-child {
+ border-right: 1px solid #bbb;
+}
+
+.yui3-skin-sam .yui3-inspector-even { background: #efeff6 }
+.yui3-skin-sam .yui3-inspector-odd { background: #fff }
+
+.yui3-skin-sam .yui3-inspector-type-array,
+.yui3-skin-sam .yui3-inspector-type-object { color: #333; }
+
+.yui3-skin-sam .yui3-inspector-type-error { color: #f00; }
+
+.yui3-skin-sam .yui3-inspector-type-boolean,
+.yui3-skin-sam .yui3-inspector-type-number { color: #008; }
+
+.yui3-skin-sam .yui3-inspector-type-regexp,
+.yui3-skin-sam .yui3-inspector-type-string { color: #800; }
+
+.yui3-skin-sam .yui3-inspector-type-node { color: #060; }
+
+.yui3-skin-sam .yui3-inspector-type-null,
+.yui3-skin-sam .yui3-inspector-type-undefined {
+ color: #555;
+ font-style: italic;
+}
View
1  build/gallery-inspector/assets/skins/sam/gallery-inspector.css
@@ -0,0 +1 @@
+.yui3-skin-sam .yui3-inspector{position:absolute;right:0;top:0}.yui3-skin-sam .yui3-inspector-hidden{display:none}.yui3-skin-sam .yui3-inspector-hd{padding:6px 10px;position:relative;text-align:right}.yui3-skin-sam .yui3-inspector-title{margin:0;float:left;line-height:1.7}.yui3-skin-sam .yui3-inspector-bd{position:relative;overflow:auto;overflow-x:auto;overflow-y:scroll}.yui3-skin-sam .yui3-inspector-ft{font-size:12px;padding:4px 6px 3px;position:relative}.yui3-skin-sam .yui3-inspector-filter{float:right;height:1.1em;margin:-1px 5px 0 0;width:50%}.yui3-skin-sam .yui3-inspector table{width:100%;border-collapse:collapse;table-layout:fixed;padding:0}.yui3-skin-sam .yui3-inspector-value-cell{font:normal 12px/1.3 Monaco,Consolas,monospace}.yui3-skin-sam .yui3-inspector th,.yui3-skin-sam .yui3-inspector td{padding:4px 6px;word-wrap:break-word;text-align:left;vertical-align:top}.yui3-skin-sam .yui3-dd-draggable .yui3-inspector-hd{cursor:move}.yui3-skin-sam .yui3-dd-locked .yui3-inspector-hd{cursor:default}.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-bd,.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-ft{display:none}.yui3-skin-sam .yui3-inspectorplugin-content,.yui3-skin-sam .yui3-inspector-content{-moz-border-radius:7px;-webkit-border-radius:7px;-moz-box-shadow:0 0 3px #888;-webkit-box-shadow:0 0 3px #888;background:#ddd;border:1px solid #888;border-radius:7px;box-shadow:0 0 3px #888;font:normal 13px/1.3 Arial,sans-serif}.yui3-skin-sam .yui3-inspector-hd{-moz-border-radius-topright:7px;-moz-border-radius-topleft:7px;-webkit-border-top-right-radius:7px;-webkit-border-top-left-radius:7px;border-bottom:1px solid #888;border-top-right-radius:7px;border-top-left-radius:7px}.yui3-skin-sam .yui3-inspector-destroyed{color:#800;text-decoration:line-through}.yui3-skin-sam .yui3-inspector-bd{background:#f3f3f3}.yui3-skin-sam .yui3-inspector-ft{border-top:1px solid #888}.yui3-skin-sam .yui3-inspector-hd,.yui3-skin-sam .yui3-inspector-ft{background:#e3e3e3;background:-moz-linear-gradient(top,#fff,#bbb);background:-webkit-gradient(linear,0% 0,0% 100%,from(#fff),to(#bbb))}.yui3-skin-sam .yui3-inspector-collapsed .yui3-inspector-hd,.yui3-skin-sam .yui3-inspector-ft{-moz-border-radius-bottomright:7px;-moz-border-radius-bottomleft:7px;-webkit-border-bottom-right-radius:7px;-webkit-border-bottom-left-radius:7px;border-bottom-right-radius:7px;border-bottom-left-radius:7px}.yui3-skin-sam .yui3-inspector table{border-bottom:1px solid #ccc}.yui3-skin-sam .yui3-inspector th{border-right:1px solid #ccc}.yui3-skin-sam .yui3-inspector thead th{background:#e6e6e6;background:-moz-linear-gradient(top,#fff,#ccc);background:-webkit-gradient(linear,0% 0,0% 100%,from(#fff),to(#ccc));border-bottom:1px solid #bbb}.yui3-skin-sam .yui3-inspector thead th:first-child{border-right:1px solid #bbb}.yui3-skin-sam .yui3-inspector-even{background:#efeff6}.yui3-skin-sam .yui3-inspector-odd{background:#fff}.yui3-skin-sam .yui3-inspector-type-array,.yui3-skin-sam .yui3-inspector-type-object{color:#333}.yui3-skin-sam .yui3-inspector-type-error{color:#f00}.yui3-skin-sam .yui3-inspector-type-boolean,.yui3-skin-sam .yui3-inspector-type-number{color:#008}.yui3-skin-sam .yui3-inspector-type-regexp,.yui3-skin-sam .yui3-inspector-type-string{color:#800}.yui3-skin-sam .yui3-inspector-type-node{color:#060}.yui3-skin-sam .yui3-inspector-type-null,.yui3-skin-sam .yui3-inspector-type-undefined{color:#555;font-style:italic}
View
1,019 build/gallery-inspector/gallery-inspector-debug.js
@@ -0,0 +1,1019 @@
+YUI.add('gallery-inspector', function(Y) {
+
+/**
+ * Real-time attribute inspector widget.
+ *
+ * @module gallery-inspector
+ * @class Inspector
+ * @extends Widget
+ * @uses WidgetStack
+ * @constructor
+ * @param {Object} config Configuration object.
+ */
+
+var Lang = Y.Lang,
+ Node = Y.Node,
+ Widget = Y.Widget,
+ YArray = Y.Array,
+ YObject = Y.Object,
+
+ // Lots of shorthands.
+ BOUNDING_BOX = 'boundingBox',
+ CHECKED = 'checked',
+ COLLAPSED = 'collapsed',
+ CONTENT_BOX = 'contentBox',
+ DISPLAY = 'display',
+ EMPTY_STRING = '',
+ EXCLUDE = 'exclude',
+ FILTER = 'filter',
+ HEIGHT = 'height',
+ INCLUDE = 'include',
+ HOST = 'host',
+ HOST_ATTRS = 'hostAttrs',
+ NAME = 'name',
+ NONE = 'none',
+ OFFSET_HEIGHT = 'offsetHeight',
+ PAUSED = 'paused',
+ STRINGS = 'strings',
+ TEXT_CONTENT = 'textContent',
+ VALUE = 'value',
+
+ TYPE_ARRAY = 'array',
+ TYPE_BOOLEAN = 'boolean',
+ TYPE_DATE = 'date',
+ TYPE_ERROR = 'error',
+ TYPE_FUNCTION = 'function',
+ TYPE_NULL = 'null',
+ TYPE_NUMBER = 'number',
+ TYPE_OBJECT = 'object',
+ TYPE_REGEXP = 'regexp',
+ TYPE_STRING = 'string',
+ TYPE_UNDEFINED = 'undefined',
+
+ TYPE_DEFAULT = 'default',
+ TYPE_YNODE = 'node',
+
+ _CLASS_COLLAPSED = '_CLASS_COLLAPSED',
+ _CLASS_EVEN = '_CLASS_EVEN',
+ _CLASS_FILTER = '_CLASS_FILTER',
+ _CLASS_NAME_CELL = '_CLASS_NAME_CELL',
+ _CLASS_ODD = '_CLASS_ODD',
+ _CLASS_VALUE = '_CLASS_VALUE',
+ _CLASS_VALUE_CELL = '_CLASS_VALUE_CELL',
+ _SELECTOR_COLLAPSE = '_SELECTOR_COLLAPSE',
+ _SELECTOR_FILTER = '_SELECTOR_FILTER',
+ _SELECTOR_NAME_CELL = '_SELECTOR_NAME_CELL',
+ _SELECTOR_PAUSE = '_SELECTOR_PAUSE',
+ _SELECTOR_VALUE_CELL = '_SELECTOR_VALUE_CELL',
+
+ // For stacking multiple Inspector instances upon intitial render.
+ INSTANCE_COUNT = 0,
+
+ UI_SRC = Widget.UI_SRC,
+
+ substitute = Y.substitute,
+
+Inspector = Y.Base.create('inspector', Widget, [Y.WidgetStack], {
+
+ // -- Public Lifecycle Methods ---------------------------------------------
+
+ initializer: function (config) {
+ INSTANCE_COUNT += 1;
+
+ this._events = [];
+ this._hostEvents = [];
+ this._attrNodes = {};
+
+ this[_CLASS_COLLAPSED] = this.getClassName(COLLAPSED);
+ this[_CLASS_EVEN] = this.getClassName('even');
+ this[_CLASS_FILTER] = this.getClassName(FILTER);
+ this[_CLASS_NAME_CELL] = this.getClassName('name-cell');
+ this[_CLASS_ODD] = this.getClassName('odd');
+ this[_CLASS_VALUE] = this.getClassName(VALUE);
+ this[_CLASS_VALUE_CELL] = this.getClassName('value-cell');
+ this[_SELECTOR_COLLAPSE] = '.' + this.getClassName('collapse');
+ this[_SELECTOR_FILTER] = '.' + this[_CLASS_FILTER];
+ this[_SELECTOR_NAME_CELL] = '.' + this[_CLASS_NAME_CELL];
+ this[_SELECTOR_PAUSE] = '.' + this.getClassName('pause');
+ this[_SELECTOR_VALUE_CELL] = '.' + this[_CLASS_VALUE_CELL];
+ },
+
+ destructor: function () {
+ INSTANCE_COUNT -= 1;
+
+ this._purgeEvents(this._events.concat(this._hostEvents));
+
+ if (this._dd) {
+ this._dd.destroy();
+ }
+ },
+
+ renderUI: function () {
+ this._renderHead();
+ this._renderBody();
+ this._renderFoot();
+ },
+
+ bindUI: function () {
+ var contentBox = this.get(CONTENT_BOX),
+ filterNode = contentBox.one(this[_SELECTOR_FILTER]);
+
+ this._events.concat([
+ this.get(HOST).after('destroyedChange',
+ this._afterHostDestroyedChange, this),
+
+ contentBox.one(this[_SELECTOR_COLLAPSE]).on('click',
+ this._onCollapseClick, this),
+ contentBox.one(this[_SELECTOR_PAUSE]).on('click',
+ this._onPauseClick, this),
+
+ filterNode.on('valueChange', this._onFilter, this),
+ filterNode.on('key', this._onFilterEscapeKey, 'up:27', this),
+
+ this.after({
+ collapsedChange: this._afterCollapsedChange,
+ draggableChange: this._afterDraggableChange,
+ hostAttrsChange: this._afterHostAttrsChange,
+ excludeChange : this._afterExcludeChange,
+ filterChange : this._afterFilterChange,
+ includeChange : this._afterIncludeChange,
+ pausedChange : this._afterPausedChange
+ })
+ ]);
+ },
+
+ syncUI: function () {
+ this._uiSetCollapsed(this.get(COLLAPSED));
+ this._uiSetDraggable(this.get('draggable'));
+ this._uiSetFilter(this.get(FILTER));
+ this._uiSetPaused(this.get(PAUSED));
+
+ this._uiSetPosition();
+
+ this._syncAttrs();
+ },
+
+ // -- Protected Prototype Methods ------------------------------------------
+
+ /**
+ * Sets up event handlers for host attribute value change events.
+ *
+ * @method _bindHostValueChangeEvents
+ * @protected
+ */
+ _bindHostValueChangeEvents: function () {
+ var attrs = this.get(HOST_ATTRS),
+ host = this.get(HOST),
+ events = [];
+
+ YArray.each(attrs, function (name) {
+ events.push(host.after(name + 'Change',
+ Y.bind(this._afterHostAttrValueChange, this, name)));
+ }, this);
+
+ this._hostEvents = events;
+ },
+
+ /**
+ * Formats a value for display based on its type.
+ *
+ * @method _formatValue
+ * @param {Any} value The value to format.
+ * @protected
+ */
+ _formatValue: function (value) {
+ var escapeHtml = Y.Escape.html,
+ type = Lang.type(value),
+ subs;
+
+ switch (type) {
+ case TYPE_OBJECT:
+ if (value instanceof Node) {
+ type = TYPE_YNODE;
+ value = escapeHtml(value.toString().split(' ')[0]);
+ }
+ else if (value instanceof Boolean) {
+ type = TYPE_BOOLEAN;
+ value = value.toString();
+ }
+ else if (value instanceof Number) {
+ type = TYPE_NUMBER;
+ value = value.toString();
+ }
+ else if (value instanceof String) {
+ type = TYPE_STRING;
+ value = '"' + escapeHtml(value.toString()) + '"';
+ }
+ else {
+ // TODO: Support more objects
+ value = '[object]';
+ }
+ break;
+
+ case TYPE_ARRAY:
+ // TODO: Support arrays
+ value = '[array]';
+ break;
+
+ case TYPE_FUNCTION:
+ // TODO: Support functions
+ value = '[function]';
+ break;
+
+ case TYPE_BOOLEAN:
+ value = value.toString();
+ break;
+
+ case TYPE_STRING:
+ value = '"' + escapeHtml(value.toString()) + '"';
+ break;
+
+ case TYPE_NUMBER:
+ value = escapeHtml(value.toString());
+ break;
+
+ case TYPE_NULL:
+ case TYPE_UNDEFINED:
+ value = type;
+ break;
+
+ case TYPE_ERROR:
+ case TYPE_REGEXP:
+ value = escapeHtml(value.toString());
+ break;
+
+ case TYPE_DATE:
+ type = TYPE_DATE;
+ value = escapeHtml(value.toString());
+ break;
+
+ default:
+ type = TYPE_DEFAULT;
+ value = escapeHtml(value.toString());
+ }
+
+ subs = {
+ inspector_value_class: this[_CLASS_VALUE],
+ inspector_type_class : this.getClassName('type-' + type),
+ str_value : value
+ };
+
+ return substitute(Inspector.VALUE_TEMPLATE, subs);
+
+ // These old ideas might be useful for better array/object support.
+
+ // if (Lang.isArray(value)) {
+ // YArray.each(value, function (v, i) {
+ // var tmp = this._formatValue(v, depth);
+ //
+ // if (tmp) {
+ // formattedValue += '<li><b>' + escape(i.toString()) + '</b> ' + tmp + '</li>';
+ // }
+ // }, this);
+ // }
+ // else if (Lang.isObject(value)) {
+ // YObject.each(value, function (v, k) {
+ // var tmp = this._formatValue(v, depth);
+ //
+ // if (tmp) {
+ // formattedValue += '<li><b>' + escape(k) + '</b> ' + tmp + '</li>';
+ // }
+ // }, this);
+ // }
+ },
+
+ /**
+ * Detaches all event handles in the given array.
+ *
+ * @method _purgeEvents
+ * @param {Array} events Array of event handles.
+ * @protected
+ */
+ _purgeEvents: function (events) {
+ while (events && events.length) {
+ events.pop().detach();
+ }
+ },
+
+ /**
+ * Renders a single row (name column only) for the given attribute name.
+ *
+ * @method _renderAttr
+ * @param {String} name Attribute name.
+ * @param {Number} i Index.
+ * @protected
+ */
+ _renderAttr: function(name, i) {
+ var guid = Y.guid(),
+ parityClass = i % 2 === 0 ? this[_CLASS_EVEN] : this[_CLASS_ODD],
+ subs = {
+ inspector_row_parity_class: parityClass,
+ inspector_name_cell_class : this[_CLASS_NAME_CELL],
+ inspector_value_cell_class: this[_CLASS_VALUE_CELL],
+ str_name: name,
+ id_guid : guid
+ },
+ node = Node.create(substitute(Inspector.ATTR_TEMPLATE, subs)),
+ tbody = this._tbody;
+
+ tbody.append(node);
+
+ this._attrNodes[name] = tbody.one('#' + guid);
+ },
+
+ /**
+ * Renders all rows (name column only) for all attributes.
+ *
+ * @method _renderAttrs
+ * @protected
+ */
+ _renderAttrs: function () {
+ var attrs = this.get(HOST_ATTRS).sort();
+
+ this._tbody.empty(true);
+
+ YArray.each(attrs, this._renderAttr, this);
+ },
+
+ /**
+ * Renders the body section of the UI. Intended for use only during the
+ * render lifecycle.
+ *
+ * @method _renderBody
+ * @protected
+ */
+ _renderBody: function () {
+ var contentBox = this.get(CONTENT_BOX),
+ strings = this.get(STRINGS),
+ subs = {
+ str_name : strings.name,
+ str_value : strings.value,
+ inspector_bd_class: this.getClassName('bd')
+ },
+ body = Node.create(substitute(Inspector.BODY_TEMPLATE, subs));
+
+ this._body = body;
+ this._tbody = body.one('tbody');
+
+ contentBox.append(body);
+ },
+
+ /**
+ * Renders the footer section of the UI. Intended for use only during the
+ * render lifecycle.
+ *
+ * @method _renderFoot
+ * @protected
+ */
+ _renderFoot: function () {
+ var contentBox = this.get(CONTENT_BOX),
+ strings = this.get(STRINGS),
+ subs = {
+ str_filter : strings.filter_attrs,
+ str_pause : strings.pause,
+ inspector_checkbox_class : this.getClassName('checkbox'),
+ inspector_controls_class : this.getClassName('controls'),
+ inspector_ft_class : this.getClassName('ft'),
+ inspector_pause_class : this.getClassName('pause'),
+ inspector_pause_label_class: this.getClassName('pause-label'),
+ inspector_searchbox_class : this[_CLASS_FILTER]
+ };
+
+ this._foot = Node.create(substitute(Inspector.FOOTER_TEMPLATE, subs));
+
+ contentBox.append(this._foot);
+ },
+
+ /**
+ * Renders the header section of the UI. Intended for use only during the
+ * render lifecycle.
+ *
+ * @method _renderHead
+ * @protected
+ */
+ _renderHead: function () {
+ var contentBox = this.get(CONTENT_BOX),
+ strings = this.get(STRINGS),
+ subs = {
+ str_collapse : strings.collapse,
+ str_name : this.get(NAME),
+ str_title : strings.title,
+ inspector_button_class : this.getClassName('button'),
+ inspector_collapse_class: this.getClassName('collapse'),
+ inspector_hd_class : this.getClassName('hd'),
+ inspector_name_class : this.getClassName(NAME),
+ inspector_title_class : this.getClassName('title')
+ };
+
+ this._head = Node.create(substitute(Inspector.HEADER_TEMPLATE, subs));
+
+ contentBox.append(this._head);
+ },
+
+ /**
+ * Syncs the host's attributes with the Inspector instance and applies any
+ * <code>include</code> or <code>exclude</code> filters.
+ *
+ * @method _syncAttrs
+ * @protected
+ */
+ _syncAttrs: function () {
+ var host = this.get(HOST),
+ attrs = host.getAttrs(),
+ exclude = this.get(EXCLUDE),
+ include = this.get(INCLUDE);
+
+ YObject.each(attrs, function (value, name) {
+ if (include.length && include.indexOf(name) === -1) {
+ delete attrs[name];
+ }
+ else if (exclude.length && exclude.indexOf(name) !== -1) {
+ delete attrs[name];
+ }
+ });
+
+ this._set(HOST_ATTRS, YObject.keys(attrs));
+ },
+
+ // -- Protected UI Methods -------------------------------------------------
+
+ /**
+ * Filters visible attributes by the given filter value.
+ *
+ * @method _uiFilterAttrs
+ * @param {String} value Filter value.
+ * @protected
+ */
+ _uiFilterAttrs: function (value) {
+ var selector = this[_SELECTOR_NAME_CELL],
+ hide = [],
+ show = [],
+ cell;
+
+ YObject.each(this._attrNodes, function (node) {
+ if (value) {
+ cell = node.one(selector);
+
+ if (cell.get(TEXT_CONTENT).indexOf(value) !== -1) {
+ show.push(node);
+ }
+ else {
+ hide.push(node);
+ }
+ }
+ else {
+ show.push(node);
+ }
+ });
+
+ Y.all(hide).setStyle(DISPLAY, NONE);
+ Y.all(show).setStyle(DISPLAY, EMPTY_STRING);
+ },
+
+ /**
+ * Sets the host destroyed state in the UI.
+ *
+ * @method _uiSetHostDestroyed
+ * @protected
+ */
+ _uiSetHostDestroyed: function () {
+ var node = this._head.one('.' + this.getClassName(NAME));
+
+ if (node) {
+ node.addClass(this.getClassName('destroyed'));
+ }
+ },
+
+ /**
+ * Sets the value for the given attribute name.
+ *
+ * @method _uiSetAttrValue
+ * @param {String} name Attribute name.
+ * @param {Any} value Attribute value.
+ * @protected
+ */
+ _uiSetAttrValue: function(name, value) {
+ var node = this._attrNodes[name],
+ cell = node.one(this[_SELECTOR_VALUE_CELL]);
+
+ cell.setContent(this._formatValue(value));
+ },
+
+ /**
+ * Sets the value for all attributes.
+ *
+ * @method _uiSetAttrValues
+ * @protected
+ */
+ _uiSetAttrValues: function () {
+ var host = this.get(HOST),
+ attrs = this.get(HOST_ATTRS);
+
+ YArray.each(attrs, function (name) {
+ this._uiSetAttrValue(name, host.get(name));
+ }, this);
+ },
+
+ /**
+ * Sets the height of the UI. Sets the body height to the specified height
+ * minus the combined heights of the header and footer. Overrides
+ * <code>Widget.prototype._uiSetHeight</code>.
+ *
+ * @method _uiSetHeight
+ * @param {Number} height Height.
+ * @protected
+ */
+ _uiSetHeight: function (height) {
+ Inspector.superclass._uiSetHeight.apply(this, arguments);
+
+ if (this._head && this._foot) {
+ height = this.get(BOUNDING_BOX).get(OFFSET_HEIGHT) -
+ this._head.get(OFFSET_HEIGHT) -
+ this._foot.get(OFFSET_HEIGHT);
+
+ this._body.setStyle(HEIGHT, height - 2 + 'px');
+ }
+ },
+
+ /**
+ * Sets the UI collapsed state.
+ *
+ * @method _uiSetCollapsed
+ * @param {Boolean} collapsed Whether the UI should be collapsed.
+ * @protected
+ */
+ _uiSetCollapsed : function (collapsed) {
+ var boundingBox = this.get(BOUNDING_BOX),
+ button = this._head.one(this[_SELECTOR_COLLAPSE]),
+ buttonText, height, method;
+
+ if (collapsed) {
+ buttonText = this.get(STRINGS + '.expand');
+ height = this._head.get(OFFSET_HEIGHT);
+ method = 'addClass';
+ }
+ else {
+ buttonText = this.get(STRINGS + '.collapse');
+ height = this.get(HEIGHT);
+ method = 'removeClass';
+ }
+
+ boundingBox[method](this[_CLASS_COLLAPSED]);
+ button.setContent(buttonText);
+
+ this._uiSetHeight(height);
+ },
+
+ /**
+ * Sets the UI draggable state.
+ *
+ * @method _uiSetDraggable
+ * @param {Boolean} draggable Whether the UI should be draggable.
+ * @protected
+ */
+ _uiSetDraggable: function (draggable) {
+ if (this._dd) {
+ this._dd.set('lock', !draggable);
+ }
+ else if (draggable) {
+ this._dd = new Y.DD.Drag({
+ node : this.get(BOUNDING_BOX),
+ handles: ['.' + this.getClassName('hd')]
+ }).plug(Y.Plugin.DDConstrained);
+ }
+ },
+
+ /**
+ * Sets the UI filter input witht the given filter value.
+ *
+ * @method _uiSetFilter
+ * @param {String} value Filter value.
+ * @protected
+ */
+ _uiSetFilter: function (value) {
+ var node = this._foot.one(this[_SELECTOR_FILTER]);
+
+ if (node) {
+ node.set(VALUE, value);
+ }
+ },
+
+ /**
+ * Sets the UI paused state.
+ *
+ * @method _uiSetPaused
+ * @param {Boolean} paused Whether the UI should be paused.
+ * @protected
+ */
+ _uiSetPaused : function (paused) {
+ var node = this._foot.one(this[_SELECTOR_PAUSE]);
+
+ if (node) {
+ node.set(CHECKED, paused);
+ }
+ },
+
+ /**
+ * Sets the UI position and zIndex, adjusting for the presence of other
+ * Inspector instances, such that they appear to stack. Intended to be
+ * called during the syncUI lifecycle event.
+ *
+ * @method _uiSetPosition
+ * @protected
+ */
+ _uiSetPosition: function () {
+ var boundingBox = this.get(BOUNDING_BOX),
+ count = INSTANCE_COUNT - 1,
+ offset = this._head.get(OFFSET_HEIGHT);
+
+ boundingBox.setStyle('top', (count * offset) + 'px');
+
+ this.set('zIndex', this.get('zIndex') + count);
+ },
+
+ /**
+ * Mini lifecycle for updating all attributes. Purges existing host events,
+ * re-renders all attributes, then binds new host events.
+ *
+ * @method _uiSyncAttrs
+ * @protected
+ */
+ _uiSyncAttrs: function () {
+ this._purgeEvents(this._hostEvents);
+
+ this._renderAttrs();
+
+ this._uiSetAttrValues();
+ this._uiFilterAttrs(this.get(FILTER));
+
+ this._bindHostValueChangeEvents();
+ },
+
+ // -- Protected Host Event Handlers ----------------------------------------
+
+ /**
+ * Handles <code>[attribute]Change</code> events on the host.
+ *
+ * @method _afterHostAttrValueChange
+ * @param {String} name Attribute name.
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterHostAttrValueChange: function (name, e) {
+ if (!this.get(PAUSED)) {
+ this._uiSetAttrValue(name, e.newVal);
+ }
+ },
+
+ /**
+ * Handles <code>destroyedChange</code> events on the host.
+ *
+ * @method _afterHostDestroyedChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterHostDestroyedChange: function (e) {
+ if (e.newVal) {
+ this._uiSetHostDestroyed();
+ }
+ },
+
+ // -- Protected Event Handlers ---------------------------------------------
+
+ /**
+ * Handles <code>collaspedChange</code> events.
+ *
+ * @method _afterCollapsedChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterCollapsedChange: function (e) {
+ this._uiSetCollapsed(e.newVal);
+ },
+
+ /**
+ * Handles <code>draggableChange</code> events.
+ *
+ * @method _afterDraggableChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterDraggableChange: function (e) {
+ this._uiSetDraggable(e.newVal);
+ },
+
+ /**
+ * Handles <code>excludeChange</code> events.
+ *
+ * @method _afterExcludeChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterExcludeChange: function (e) {
+ this._syncAttrs();
+ },
+
+ /**
+ * Handles <code>filterChange</code> events.
+ *
+ * @method _afterFilterChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterFilterChange: function (e) {
+ var filter = e.newVal;
+
+ if (e.src !== UI_SRC) {
+ this._uiSetFilter(filter);
+ }
+
+ this._uiFilterAttrs(filter);
+ },
+
+ /**
+ * Handles <code>hostAttrsChange</code> events.
+ *
+ * @method _afterHostAttrsChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterHostAttrsChange: function (e) {
+ this._uiSyncAttrs();
+ },
+
+ /**
+ * Handles <code>includeChange</code> events.
+ *
+ * @method _afterIncludeChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterIncludeChange: function (e) {
+ this._syncAttrs();
+ },
+
+ /**
+ * Handles <code>pausedChange</code> events.
+ *
+ * @method _afterPausedChange
+ * @param {EventFacade} e
+ * @protected
+ */
+ _afterPausedChange : function (e) {
+ var paused = e.newVal;
+
+ if (e.src !== UI_SRC) {
+ this._uiSetPaused(paused);
+ }
+
+ if (!paused) {
+ this._syncAttrs();
+ }
+ },
+
+ /**
+ * Handles <code>click</code> events on the collapse button.
+ *
+ * @method _onCollapseClick
+ * @param {EventFacade} e
+ * @protected
+ */
+ _onCollapseClick: function (e) {
+ this.set(COLLAPSED, !this.get(COLLAPSED));
+ },
+
+ /**
+ * Handles <code>click</code> events on the pause checkbox.
+ *
+ * @method _onPauseClick
+ * @param {EventFacade} e
+ * @protected
+ */
+ _onPauseClick: function (e) {
+ this.set(PAUSED, e.target.get(CHECKED), {src: UI_SRC});
+ },
+
+ /**
+ * Handles <code>valueChange</code> events on the filter input.
+ *
+ * @method _onFilter
+ * @param {EventFacade} e
+ * @protected
+ */
+ _onFilter: function (e) {
+ this.set(FILTER, e.newVal);
+ },
+
+ /**
+ * Handles <code>esc</code> <code>keyUp</code> events on the filter input.
+ *
+ * @method _onFilterEscapeKey
+ * @param {EventFacade} e
+ * @protected
+ */
+ _onFilterEscapeKey: function (e) {
+ this.set(FILTER, null);
+ }
+},
+{
+ ATTRS: {
+ /**
+ * If <code>true</code>, Inspector will initially render collapsed.
+ *
+ * @attribute collapsed
+ * @type Boolean
+ * @default false
+ */
+ collapsed: {
+ value : false,
+ validator: Lang.isBoolean
+ },
+
+ /**
+ * If <code>true</code> Inspector will be draggable, with the header
+ * node as the drag handle.
+ *
+ * @attribute draggable
+ * @type Boolean
+ * @default true
+ */
+ draggable: {
+ value : true,
+ validator: Lang.isBoolean
+ },
+
+ /**
+ * Array of attribute names to exclude from being displayed.
+ *
+ * @attribute exclude
+ * @type Array
+ */
+ exclude: {
+ value : [],
+ validator: Lang.isArray
+ },
+
+ /**
+ * Filter text value.
+ *
+ * @attribute filter
+ * @type String
+ */
+ filter: {
+ value: ''
+ },
+
+ // The "height" attribute is documented in Widget.
+ height: {
+ value: '300px'
+ },
+
+ /**
+ * The object to inspect.
+ *
+ * @attribute host
+ * @type Object
+ * @writeonce
+ */
+ host: {
+ value : null,
+ writeOnce: 'initOnly',
+ validator: function (v) {
+ return v instanceof Y.Base;
+ }
+ },
+
+ /**
+ * Name/value pairs of the host object's attributes.
+ *
+ * @attribute hostAttrs
+ * @type Object
+ * @readonly
+ */
+ hostAttrs: {
+ value : {},
+ readOnly: true
+ },
+
+ /**
+ * Array of attribute names to include. Opposite of, and overrides
+ * <code>exclude</code>.
+ *
+ * @attribute include
+ * @type Array
+ */
+ include: {
+ value : [],
+ validator: Lang.isArray
+ },
+
+ /**
+ * Display name of the Inspector instance. If not specified, the host
+ * object's <code>name</code> property will be used if present.
+ *
+ * @attribute name
+ * @type String
+ * @writeonce
+ */
+ name: {
+ value : null,
+ writeOnce: 'initOnly',
+ getter : function (value) {
+ var host, name;
+
+ if (value) {
+ name = value;
+ }
+ else {
+ host = this.get(HOST);
+ name = host.name ? host.name : '[No name]';
+ }
+
+ return name;
+ }
+ },
+
+ /**
+ * If <code>true</code>, Inspector will intitally be paused.
+ *
+ * @attribute paused
+ * @type Boolean
+ * @default false
+ */
+ paused: {
+ value: false,
+ validator : Lang.isBoolean
+ },
+
+ /**
+ * Translatable strings used by Inspector.
+ *
+ * @attribute strings
+ * @type Object
+ */
+ strings: {
+ valueFn: function () {
+ return Y.Intl.get('gallery-inspector');
+ }
+ },
+
+ // The "width" attribute is documented in Widget.
+ width: {
+ value: '275px'
+ }
+
+ // The "zIndex" attribute is documented in WidgetStack.
+ },
+
+ CSS_PREFIX: Y.ClassNameManager.getClassName('inspector'),
+
+ BODY_TEMPLATE:
+ '<div class="{inspector_bd_class}">' +
+ '<table>' +
+ '<thead>' +
+ '<tr>' +
+ '<th scope="col">{str_name}</th>' +
+ '<th scope="col">{str_value}</th>' +
+ '</tr>' +
+ '</thead>' +
+ '<tbody></tbody>' +
+ '</table>' +
+ '</div>',
+
+ FOOTER_TEMPLATE:
+ '<div class="{inspector_ft_class}">' +
+ '<div class="{inspector_controls_class}">' +
+ '<label class="{inspector_pause_label_class}">' +
+ '<input type="checkbox" class="{inspector_checkbox_class} ' +
+ '{inspector_pause_class}" value="1">{str_pause}' +
+ '</label>' +
+ '<input type="search" class="{inspector_searchbox_class}"' +
+ 'placeholder="{str_filter}"/>' +
+ '</div>'+
+ '</div>',
+
+ HEADER_TEMPLATE:
+ '<div class="{inspector_hd_class}">' +
+ '<h4 class="{inspector_title_class}">{str_title}: ' +
+ '<span class="{inspector_name_class}">{str_name}</span></h4>' +
+ '<button type="button" class="' +
+ '{inspector_button_class} {inspector_collapse_class}">{str_collapse}' +
+ '</button>' +
+ '</div>',
+
+ ATTR_TEMPLATE:
+ '<tr id="{id_guid}" class="{inspector_row_parity_class}">' +
+ '<th class="{inspector_name_cell_class}" scope="row">{str_name}</th>' +
+ '<td class="{inspector_value_cell_class}"></td>' +
+ '</tr>',
+
+ VALUE_TEMPLATE:
+ '<span class="{inspector_value_class} {inspector_type_class}">' +
+ '{str_value}' +
+ '</span>'
+});
+
+Y.Inspector = Inspector;
+
+
+}, 'gallery-2011.05.04-20-03' ,{lang:['en'], requires:['dd-constrain', 'escape', 'event-key', 'event-valuechange', 'substitute', 'widget', 'widget-stack'], skinnable:true});
View
2  build/gallery-inspector/gallery-inspector-min.js
@@ -0,0 +1,2 @@
+YUI.add("gallery-inspector",function(f){var ac=f.Lang,y=f.Node,h=f.Widget,S=f.Array,w=f.Object,V="boundingBox",b="checked",r="collapsed",B="contentBox",c="display",m="",J="exclude",j="filter",F="height",C="include",v="host",I="hostAttrs",H="name",L="none",O="offsetHeight",D="paused",a="strings",G="textContent",U="value",e="array",d="boolean",Q="date",z="error",E="function",i="null",x="number",k="object",W="regexp",N="string",l="undefined",p="default",t="node",o="_CLASS_COLLAPSED",Z="_CLASS_EVEN",M="_CLASS_FILTER",ab="_CLASS_NAME_CELL",u="_CLASS_ODD",A="_CLASS_VALUE",P="_CLASS_VALUE_CELL",T="_SELECTOR_COLLAPSE",g="_SELECTOR_FILTER",K="_SELECTOR_NAME_CELL",q="_SELECTOR_PAUSE",n="_SELECTOR_VALUE_CELL",s=0,R=h.UI_SRC,aa=f.substitute,X=f.Base.create("inspector",h,[f.WidgetStack],{initializer:function(Y){s+=1;this._events=[];this._hostEvents=[];this._attrNodes={};this[o]=this.getClassName(r);this[Z]=this.getClassName("even");this[M]=this.getClassName(j);this[ab]=this.getClassName("name-cell");this[u]=this.getClassName("odd");this[A]=this.getClassName(U);this[P]=this.getClassName("value-cell");this[T]="."+this.getClassName("collapse");this[g]="."+this[M];this[K]="."+this[ab];this[q]="."+this.getClassName("pause");this[n]="."+this[P];},destructor:function(){s-=1;this._purgeEvents(this._events.concat(this._hostEvents));if(this._dd){this._dd.destroy();}},renderUI:function(){this._renderHead();this._renderBody();this._renderFoot();},bindUI:function(){var Y=this.get(B),ad=Y.one(this[g]);this._events.concat([this.get(v).after("destroyedChange",this._afterHostDestroyedChange,this),Y.one(this[T]).on("click",this._onCollapseClick,this),Y.one(this[q]).on("click",this._onPauseClick,this),ad.on("valueChange",this._onFilter,this),ad.on("key",this._onFilterEscapeKey,"up:27",this),this.after({collapsedChange:this._afterCollapsedChange,draggableChange:this._afterDraggableChange,hostAttrsChange:this._afterHostAttrsChange,excludeChange:this._afterExcludeChange,filterChange:this._afterFilterChange,includeChange:this._afterIncludeChange,pausedChange:this._afterPausedChange})]);},syncUI:function(){this._uiSetCollapsed(this.get(r));this._uiSetDraggable(this.get("draggable"));this._uiSetFilter(this.get(j));this._uiSetPaused(this.get(D));this._uiSetPosition();this._syncAttrs();},_bindHostValueChangeEvents:function(){var Y=this.get(I),ae=this.get(v),ad=[];S.each(Y,function(af){ad.push(ae.after(af+"Change",f.bind(this._afterHostAttrValueChange,this,af)));},this);this._hostEvents=ad;},_formatValue:function(af){var Y=f.Escape.html,ae=ac.type(af),ad;switch(ae){case k:if(af instanceof y){ae=t;af=Y(af.toString().split(" ")[0]);}else{if(af instanceof Boolean){ae=d;af=af.toString();}else{if(af instanceof Number){ae=x;af=af.toString();}else{if(af instanceof String){ae=N;af='"'+Y(af.toString())+'"';}else{af="[object]";}}}}break;case e:af="[array]";break;case E:af="[function]";break;case d:af=af.toString();break;case N:af='"'+Y(af.toString())+'"';break;case x:af=Y(af.toString());break;case i:case l:af=ae;break;case z:case W:af=Y(af.toString());break;case Q:ae=Q;af=Y(af.toString());break;default:ae=p;af=Y(af.toString());}ad={inspector_value_class:this[A],inspector_type_class:this.getClassName("type-"+ae),str_value:af};return aa(X.VALUE_TEMPLATE,ad);},_purgeEvents:function(Y){while(Y&&Y.length){Y.pop().detach();}},_renderAttr:function(ae,ag){var ad=f.guid(),ai=ag%2===0?this[Z]:this[u],af={inspector_row_parity_class:ai,inspector_name_cell_class:this[ab],inspector_value_cell_class:this[P],str_name:ae,id_guid:ad},ah=y.create(aa(X.ATTR_TEMPLATE,af)),Y=this._tbody;Y.append(ah);this._attrNodes[ae]=Y.one("#"+ad);},_renderAttrs:function(){var Y=this.get(I).sort();this._tbody.empty(true);S.each(Y,this._renderAttr,this);},_renderBody:function(){var ae=this.get(B),ad=this.get(a),af={str_name:ad.name,str_value:ad.value,inspector_bd_class:this.getClassName("bd")},Y=y.create(aa(X.BODY_TEMPLATE,af));this._body=Y;this._tbody=Y.one("tbody");ae.append(Y);},_renderFoot:function(){var ad=this.get(B),Y=this.get(a),ae={str_filter:Y.filter_attrs,str_pause:Y.pause,inspector_checkbox_class:this.getClassName("checkbox"),inspector_controls_class:this.getClassName("controls"),inspector_ft_class:this.getClassName("ft"),inspector_pause_class:this.getClassName("pause"),inspector_pause_label_class:this.getClassName("pause-label"),inspector_searchbox_class:this[M]};this._foot=y.create(aa(X.FOOTER_TEMPLATE,ae));ad.append(this._foot);},_renderHead:function(){var ad=this.get(B),Y=this.get(a),ae={str_collapse:Y.collapse,str_name:this.get(H),str_title:Y.title,inspector_button_class:this.getClassName("button"),inspector_collapse_class:this.getClassName("collapse"),inspector_hd_class:this.getClassName("hd"),inspector_name_class:this.getClassName(H),inspector_title_class:this.getClassName("title")};this._head=y.create(aa(X.HEADER_TEMPLATE,ae));ad.append(this._head);},_syncAttrs:function(){var af=this.get(v),ae=af.getAttrs(),ad=this.get(J),Y=this.get(C);w.each(ae,function(ah,ag){if(Y.length&&Y.indexOf(ag)===-1){delete ae[ag];}else{if(ad.length&&ad.indexOf(ag)!==-1){delete ae[ag];}}});this._set(I,w.keys(ae));},_uiFilterAttrs:function(ag){var ad=this[K],af=[],ae=[],Y;w.each(this._attrNodes,function(ah){if(ag){Y=ah.one(ad);if(Y.get(G).indexOf(ag)!==-1){ae.push(ah);}else{af.push(ah);}}else{ae.push(ah);}});f.all(af).setStyle(c,L);f.all(ae).setStyle(c,m);},_uiSetHostDestroyed:function(){var Y=this._head.one("."+this.getClassName(H));if(Y){Y.addClass(this.getClassName("destroyed"));}},_uiSetAttrValue:function(ad,af){var ae=this._attrNodes[ad],Y=ae.one(this[n]);Y.setContent(this._formatValue(af));},_uiSetAttrValues:function(){var ad=this.get(v),Y=this.get(I);S.each(Y,function(ae){this._uiSetAttrValue(ae,ad.get(ae));},this);},_uiSetHeight:function(Y){X.superclass._uiSetHeight.apply(this,arguments);if(this._head&&this._foot){Y=this.get(V).get(O)-this._head.get(O)-this._foot.get(O);this._body.setStyle(F,Y-2+"px");}},_uiSetCollapsed:function(ag){var ad=this.get(V),ae=this._head.one(this[T]),af,Y,ah;
+if(ag){af=this.get(a+".expand");Y=this._head.get(O);ah="addClass";}else{af=this.get(a+".collapse");Y=this.get(F);ah="removeClass";}ad[ah](this[o]);ae.setContent(af);this._uiSetHeight(Y);},_uiSetDraggable:function(Y){if(this._dd){this._dd.set("lock",!Y);}else{if(Y){this._dd=new f.DD.Drag({node:this.get(V),handles:["."+this.getClassName("hd")]}).plug(f.Plugin.DDConstrained);}}},_uiSetFilter:function(ad){var Y=this._foot.one(this[g]);if(Y){Y.set(U,ad);}},_uiSetPaused:function(Y){var ad=this._foot.one(this[q]);if(ad){ad.set(b,Y);}},_uiSetPosition:function(){var Y=this.get(V),ad=s-1,ae=this._head.get(O);Y.setStyle("top",(ad*ae)+"px");this.set("zIndex",this.get("zIndex")+ad);},_uiSyncAttrs:function(){this._purgeEvents(this._hostEvents);this._renderAttrs();this._uiSetAttrValues();this._uiFilterAttrs(this.get(j));this._bindHostValueChangeEvents();},_afterHostAttrValueChange:function(Y,ad){if(!this.get(D)){this._uiSetAttrValue(Y,ad.newVal);}},_afterHostDestroyedChange:function(Y){if(Y.newVal){this._uiSetHostDestroyed();}},_afterCollapsedChange:function(Y){this._uiSetCollapsed(Y.newVal);},_afterDraggableChange:function(Y){this._uiSetDraggable(Y.newVal);},_afterExcludeChange:function(Y){this._syncAttrs();},_afterFilterChange:function(ad){var Y=ad.newVal;if(ad.src!==R){this._uiSetFilter(Y);}this._uiFilterAttrs(Y);},_afterHostAttrsChange:function(Y){this._uiSyncAttrs();},_afterIncludeChange:function(Y){this._syncAttrs();},_afterPausedChange:function(ad){var Y=ad.newVal;if(ad.src!==R){this._uiSetPaused(Y);}if(!Y){this._syncAttrs();}},_onCollapseClick:function(Y){this.set(r,!this.get(r));},_onPauseClick:function(Y){this.set(D,Y.target.get(b),{src:R});},_onFilter:function(Y){this.set(j,Y.newVal);},_onFilterEscapeKey:function(Y){this.set(j,null);}},{ATTRS:{collapsed:{value:false,validator:ac.isBoolean},draggable:{value:true,validator:ac.isBoolean},exclude:{value:[],validator:ac.isArray},filter:{value:""},height:{value:"300px"},host:{value:null,writeOnce:"initOnly",validator:function(Y){return Y instanceof f.Base;}},hostAttrs:{value:{},readOnly:true},include:{value:[],validator:ac.isArray},name:{value:null,writeOnce:"initOnly",getter:function(ae){var ad,Y;if(ae){Y=ae;}else{ad=this.get(v);Y=ad.name?ad.name:"[No name]";}return Y;}},paused:{value:false,validator:ac.isBoolean},strings:{valueFn:function(){return f.Intl.get("gallery-inspector");}},width:{value:"275px"}},CSS_PREFIX:f.ClassNameManager.getClassName("inspector"),BODY_TEMPLATE:'<div class="{inspector_bd_class}">'+"<table>"+"<thead>"+"<tr>"+'<th scope="col">{str_name}</th>'+'<th scope="col">{str_value}</th>'+"</tr>"+"</thead>"+"<tbody></tbody>"+"</table>"+"</div>",FOOTER_TEMPLATE:'<div class="{inspector_ft_class}">'+'<div class="{inspector_controls_class}">'+'<label class="{inspector_pause_label_class}">'+'<input type="checkbox" class="{inspector_checkbox_class} '+'{inspector_pause_class}" value="1">{str_pause}'+"</label>"+'<input type="search" class="{inspector_searchbox_class}"'+'placeholder="{str_filter}"/>'+"</div>"+"</div>",HEADER_TEMPLATE:'<div class="{inspector_hd_class}">'+'<h4 class="{inspector_title_class}">{str_title}: '+'<span class="{inspector_name_class}">{str_name}</span></h4>'+'<button type="button" class="'+'{inspector_button_class} {inspector_collapse_class}">{str_collapse}'+"</button>"+"</div>",ATTR_TEMPLATE:'<tr id="{id_guid}" class="{inspector_row_parity_class}">'+'<th class="{inspector_name_cell_class}" scope="row">{str_name}</th>'+'<td class="{inspector_value_cell_class}"></td>'+"</tr>",VALUE_TEMPLATE:'<span class="{inspector_value_class} {inspector_type_class}">'+"{str_value}"+"</span>"});f.Inspector=X;},"gallery-2011.05.04-20-03",{lang:["en"],requires:["dd-constrain","escape","event-key","event-valuechange","substitute","widget","widget-stack"],skinnable:true});
View
42 build/gallery-inspector/gallery-inspector-plugin-debug.js
@@ -0,0 +1,42 @@
+YUI.add('gallery-inspector-plugin', function(Y) {
+
+/**
+ * Binds a new Inspector instance to an existing object.
+ *
+ * @module gallery-inspector
+ * @submodule gallery-inspector-plugin
+ */
+
+/**
+ * <p>Binds a new Inspector instance to an existing object.</p>
+ *
+ * <p>Example:</p>
+ *
+ * <pre>
+ * myWidget.plug(Y.Plugin.Inspector);
+ * </pre>
+ *
+ * @class Plugin.Inspector
+ * @extends Inspector
+ */
+var Plugin = Y.Plugin;
+
+function InspectorPlugin(config) {
+ if (!config.render && config.render !== false) {
+ config.render = true;
+ }
+
+ InspectorPlugin.superclass.constructor.apply(this, arguments);
+}
+
+Y.extend(InspectorPlugin, Y.Inspector, {}, {
+ CSS_PREFIX: Y.ClassNameManager.getClassName('inspector'),
+ NAME : 'inspectorPlugin',
+ NS : 'inspector'
+});
+
+Plugin.Inspector = InspectorPlugin;
+
+
+
+}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-inspector']});
View
1  build/gallery-inspector/gallery-inspector-plugin-min.js
@@ -0,0 +1 @@
+YUI.add("gallery-inspector-plugin",function(c){var b=c.Plugin;function a(d){if(!d.render&&d.render!==false){d.render=true;}a.superclass.constructor.apply(this,arguments);}c.extend(a,c.Inspector,{},{CSS_PREFIX:c.ClassNameManager.getClassName("inspector"),NAME:"inspectorPlugin",NS:"inspector"});b.Inspector=a;},"gallery-2011.05.04-20-03",{requires:["gallery-inspector"]});
View
42 build/gallery-inspector/gallery-inspector-plugin.js
@@ -0,0 +1,42 @@
+YUI.add('gallery-inspector-plugin', function(Y) {
+
+/**
+ * Binds a new Inspector instance to an existing object.
+ *
+ * @module gallery-inspector
+ * @submodule gallery-inspector-plugin
+ */
+
+/**
+ * <p>Binds a new Inspector instance to an existing object.</p>
+ *
+ * <p>Example:</p>
+ *
+ * <pre>
+ * myWidget.plug(Y.Plugin.Inspector);
+ * </pre>
+ *
+ * @class Plugin.Inspector
+ * @extends Inspector
+ */
+var Plugin = Y.Plugin;
+
+function InspectorPlugin(config) {
+ if (!config.render && config.render !== false) {
+ config.render = true;
+ }
+
+ InspectorPlugin.superclass.constructor.apply(this, arguments);
+}
+
+Y.extend(InspectorPlugin, Y.Inspector, {}, {
+ CSS_PREFIX: Y.ClassNameManager.getClassName('inspector'),
+ NAME : 'inspectorPlugin',
+ NS : 'inspector'
+});
+
+Plugin.Inspector = InspectorPlugin;
+
+
+
+}, 'gallery-2011.05.04-20-03' ,{requires:['gallery-inspector']});
View
1,019 build/gallery-inspector/gallery-inspector.js
@@ -0,0 +1,1019 @@
+YUI.add('gallery-inspector', function(Y) {
+
+/**
+ * Real-time attribute inspector widget.
+ *
+ * @module gallery-inspector
+ * @class Inspector
+ * @extends Widget
+ * @uses WidgetStack
+ * @constructor
+ * @param {Object} config Configuration object.
+ */
+
+var Lang = Y.Lang,
+ Node = Y.Node,
+ Widget = Y.Widget,
+ YArray = Y.Array,
+ YObject = Y.Object,
+
+ // Lots of shorthands.
+ BOUNDING_BOX = 'boundingBox',
+ CHECKED = 'checked',
+ COLLAPSED = 'collapsed',
+ CONTENT_BOX = 'contentBox',
+ DISPLAY = 'display',
+ EMPTY_STRING = '',
+ EXCLUDE = 'exclude',
+ FILTER = 'filter',
+ HEIGHT = 'height',
+ INCLUDE = 'include',
+ HOST = 'host',
+ HOST_ATTRS = 'hostAttrs',
+ NAME = 'name',
+ NONE = 'none',
+ OFFSET_HEIGHT = 'offsetHeight',
+ PAUSED = 'paused',
+ STRINGS = 'strings',
+ TEXT_CONTENT = 'textContent',
+ VALUE = 'value',
+
+ TYPE_ARRAY = 'array',
+ TYPE_BOOLEAN = 'boolean',
+ TYPE_DATE = 'date',
+ TYPE_ERROR = 'error',
+ TYPE_FUNCTION = 'function',
+ TYPE_NULL = 'null',
+ TYPE_NUMBER = 'number',