Permalink
Browse files

Gallery Build Tag: gallery-2011.05.04-20-03

  • Loading branch information...
1 parent 1969293 commit 1e696a3c3387433ce2e1e548fd2f9ed1be54fa76 YUI Builder committed May 4, 2011
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
@@ -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']});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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']});
@@ -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']});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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']});
@@ -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
},
@@ -808,6 +783,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']});
Oops, something went wrong.

0 comments on commit 1e696a3

Please sign in to comment.