Skip to content

Commit

Permalink
Gallery Build Tag: gallery-2010.03.02-18
Browse files Browse the repository at this point in the history
  • Loading branch information
YUI Builder committed Mar 2, 2010
1 parent 1869428 commit 9b0cb90
Show file tree
Hide file tree
Showing 14 changed files with 937 additions and 400 deletions.
94 changes: 85 additions & 9 deletions build/gallery-accordion/gallery-accordion-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ Y.extend( Accordion, Y.Widget, {
this._initEvents();

this.after( "render", Y.bind( this._afterRender, this ) );

this._forCollapsing = {};
this._forExpanding = {};
this._animations = {};
},


Expand Down Expand Up @@ -439,13 +435,40 @@ Y.extend( Accordion, Y.Widget, {
this.publish( ITEMREORDERED );
},


/**
* Contains items for collapsing
* @property _forCollapsing
* @protected
* @type Object
*/
_forCollapsing : {},


/**
* Contains items for expanding
* @property _forExpanding
* @protected
* @type Object
*/
_forExpanding : {},


/**
* Contains currently running animations
* @property _animations
* @protected
* @type Object
*/
_animations : {},


/**
* Collection of items handles.
* Keeps track of each items's event handle, as returned from <code>Y.on</code> or <code>Y.after</code>.
* @property _itemHandles
* @private
* @type Array
* @type Object
*/
_itemsHandles: {},

Expand Down Expand Up @@ -1379,6 +1402,47 @@ Y.extend( Accordion, Y.Widget, {
}
},


/**
* Handles the change of "contentUpdate" property of given item
*
* @method _afterContentUpdate
* @protected
* @param params {EventFacade} The event facade for the attribute change
*/
_afterContentUpdate : function( params ){
var item, itemContentHeight, body, bodyHeight, expanded, auto, anim;

item = params.currentTarget;
auto = item.get( "contentHeight" ).method === "auto";
expanded = item.get( EXPANDED );

if( auto && expanded && params.src !== Y.Widget.UI_SRC ){
Y.later( 0, this, function(){
itemContentHeight = this._getItemContentHeight( item );

body = item.getStdModNode( WidgetStdMod.BODY );
bodyHeight = this._getNodeOffsetHeight( body );

if( itemContentHeight !== bodyHeight ){
anim = this._animations[ item ];

// stop waiting animation
if( anim ){
anim.stop();
}

this._adjustStretchItems();

if( itemContentHeight < bodyHeight ){
this._processCollapsing( item, itemContentHeight, !expanded );
} else if( itemContentHeight > bodyHeight ){
this._processExpanding( item, itemContentHeight, !expanded );
}
}
} );
}
},


/**
Expand Down Expand Up @@ -1594,7 +1658,8 @@ Y.extend( Accordion, Y.Widget, {
itemHandles = {
"expandedChange" : item.after( "expandedChange", Y.bind( this._afterItemExpand, this ) ),
"alwaysVisibleChange" : item.after( "alwaysVisibleChange", Y.bind( this._afterItemAlwaysVisible, this ) ),
"contentHeightChange" : item.after( "contentHeightChange", Y.bind( this._afterContentHeight, this ) )
"contentHeightChange" : item.after( "contentHeightChange", Y.bind( this._afterContentHeight, this ) ),
"contentUpdate" : item.after( "contentUpdate", Y.bind( this._afterContentUpdate, this ) )
};

this._itemsHandles[ item ] = itemHandles;
Expand Down Expand Up @@ -1853,7 +1918,7 @@ AccordionItem.ATTRS = {
},

/**
* @description The node, contains label
* @description The node, which contains item's label
*
* @attribute nodeLabel
* @default null
Expand Down Expand Up @@ -2430,11 +2495,11 @@ Y.extend( AccordionItem, Y.Widget, {
* @param config {Object} Configuration object literal for the AccordionItem
*/
initializer: function( config ) {

this.after( "labelChange", Y.bind( this._labelChanged, this ) );
this.after( "closableChange", Y.bind( this._closableChanged, this ) );
},


/**
* Destructor lifecycle implementation for the AccordionItem class.
*
Expand Down Expand Up @@ -2602,6 +2667,17 @@ Y.extend( AccordionItem, Y.Widget, {
},


/**
* Forces the item to resize as result of direct content manipulation (via 'innerHTML').
* This method should be invoked if 'contentHeight' property has been set to 'auto'.
*
* @method resize
*/
resize : function(){
this.fire( "contentUpdate" );
},


/**
* Parses and returns the yuiConfig attribute from contentBox. It must be stringified JSON object.
* This function will be replaced with more clever solution when YUI 3.1 becomes available
Expand Down Expand Up @@ -2824,4 +2900,4 @@ Y.AccordionItem = AccordionItem;



}, 'gallery-2009.12.08-22' ,{requires:['event', 'anim-easing', 'widget', 'widget-stdmod', 'json-parse'], optional:['dd-constrain', 'dd-proxy', 'dd-drop']});
}, 'gallery-2010.03.02-18' ,{requires:['event', 'anim-easing', 'widget', 'widget-stdmod', 'json-parse'], optional:['dd-constrain', 'dd-proxy', 'dd-drop']});
8 changes: 4 additions & 4 deletions build/gallery-accordion/gallery-accordion-min.js

Large diffs are not rendered by default.

94 changes: 85 additions & 9 deletions build/gallery-accordion/gallery-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ Y.extend( Accordion, Y.Widget, {
this._initEvents();

this.after( "render", Y.bind( this._afterRender, this ) );

this._forCollapsing = {};
this._forExpanding = {};
this._animations = {};
},


Expand Down Expand Up @@ -439,13 +435,40 @@ Y.extend( Accordion, Y.Widget, {
this.publish( ITEMREORDERED );
},


/**
* Contains items for collapsing
* @property _forCollapsing
* @protected
* @type Object
*/
_forCollapsing : {},


/**
* Contains items for expanding
* @property _forExpanding
* @protected
* @type Object
*/
_forExpanding : {},


/**
* Contains currently running animations
* @property _animations
* @protected
* @type Object
*/
_animations : {},


/**
* Collection of items handles.
* Keeps track of each items's event handle, as returned from <code>Y.on</code> or <code>Y.after</code>.
* @property _itemHandles
* @private
* @type Array
* @type Object
*/
_itemsHandles: {},

Expand Down Expand Up @@ -1379,6 +1402,47 @@ Y.extend( Accordion, Y.Widget, {
}
},


/**
* Handles the change of "contentUpdate" property of given item
*
* @method _afterContentUpdate
* @protected
* @param params {EventFacade} The event facade for the attribute change
*/
_afterContentUpdate : function( params ){
var item, itemContentHeight, body, bodyHeight, expanded, auto, anim;

item = params.currentTarget;
auto = item.get( "contentHeight" ).method === "auto";
expanded = item.get( EXPANDED );

if( auto && expanded && params.src !== Y.Widget.UI_SRC ){
Y.later( 0, this, function(){
itemContentHeight = this._getItemContentHeight( item );

body = item.getStdModNode( WidgetStdMod.BODY );
bodyHeight = this._getNodeOffsetHeight( body );

if( itemContentHeight !== bodyHeight ){
anim = this._animations[ item ];

// stop waiting animation
if( anim ){
anim.stop();
}

this._adjustStretchItems();

if( itemContentHeight < bodyHeight ){
this._processCollapsing( item, itemContentHeight, !expanded );
} else if( itemContentHeight > bodyHeight ){
this._processExpanding( item, itemContentHeight, !expanded );
}
}
} );
}
},


/**
Expand Down Expand Up @@ -1594,7 +1658,8 @@ Y.extend( Accordion, Y.Widget, {
itemHandles = {
"expandedChange" : item.after( "expandedChange", Y.bind( this._afterItemExpand, this ) ),
"alwaysVisibleChange" : item.after( "alwaysVisibleChange", Y.bind( this._afterItemAlwaysVisible, this ) ),
"contentHeightChange" : item.after( "contentHeightChange", Y.bind( this._afterContentHeight, this ) )
"contentHeightChange" : item.after( "contentHeightChange", Y.bind( this._afterContentHeight, this ) ),
"contentUpdate" : item.after( "contentUpdate", Y.bind( this._afterContentUpdate, this ) )
};

this._itemsHandles[ item ] = itemHandles;
Expand Down Expand Up @@ -1853,7 +1918,7 @@ AccordionItem.ATTRS = {
},

/**
* @description The node, contains label
* @description The node, which contains item's label
*
* @attribute nodeLabel
* @default null
Expand Down Expand Up @@ -2430,11 +2495,11 @@ Y.extend( AccordionItem, Y.Widget, {
* @param config {Object} Configuration object literal for the AccordionItem
*/
initializer: function( config ) {

this.after( "labelChange", Y.bind( this._labelChanged, this ) );
this.after( "closableChange", Y.bind( this._closableChanged, this ) );
},


/**
* Destructor lifecycle implementation for the AccordionItem class.
*
Expand Down Expand Up @@ -2602,6 +2667,17 @@ Y.extend( AccordionItem, Y.Widget, {
},


/**
* Forces the item to resize as result of direct content manipulation (via 'innerHTML').
* This method should be invoked if 'contentHeight' property has been set to 'auto'.
*
* @method resize
*/
resize : function(){
this.fire( "contentUpdate" );
},


/**
* Parses and returns the yuiConfig attribute from contentBox. It must be stringified JSON object.
* This function will be replaced with more clever solution when YUI 3.1 becomes available
Expand Down Expand Up @@ -2824,4 +2900,4 @@ Y.AccordionItem = AccordionItem;



}, 'gallery-2009.12.08-22' ,{requires:['event', 'anim-easing', 'widget', 'widget-stdmod', 'json-parse'], optional:['dd-constrain', 'dd-proxy', 'dd-drop']});
}, 'gallery-2010.03.02-18' ,{requires:['event', 'anim-easing', 'widget', 'widget-stdmod', 'json-parse'], optional:['dd-constrain', 'dd-proxy', 'dd-drop']});
69 changes: 69 additions & 0 deletions build/gallery-event-nav-keys/gallery-event-nav-keys-debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
YUI.add('gallery-event-nav-keys', function(Y) {

var keys = {
enter : 13,
esc : 27,
backspace: 8,
tab : 9,
pageUp : 33,
pageDown : 34,
left : 37,
up : 38,
right : 39,
down : 40
};

Y.Object.each( keys, function ( keyCode, name ) {
Y.Event.define( name, {
publishConfig: { emitFacade: false },

on: function ( node, sub, ce ) {
sub._evtGuid = Y.guid() + '|';

node.on( sub._evtGuid + 'keydown', function ( e ) {
if ( e.keyCode === keyCode ) {
e.type = name;
ce.fire( e );
}
});
},

detach: function (node, sub, ce) {
node.detach(sub._evtGuid + '*');
}
} );
} );

Y.Event.define( 'arrow', {
publishConfig: { emitFacade: false },

on: function ( node, sub, ce ) {
var directions = this._directions;

sub._evtGuid = Y.guid() + '|';

node.on( 'keydown', function ( e ) {
if ( e.keyCode > 36 && e.keyCode < 41 ) {
e.originalType = e.type;
e.type = 'arrow';
e.direction = directions[ e.keyCode ];

ce.fire( e );
}
} );
},

detach: function ( node, sub, ce ) {
node.detach( sub._evtGuid + '*' );
},

_directions: {
37: 'left',
38: 'up',
39: 'right',
40: 'down'
}
} );


}, 'gallery-2010.03.02-18' ,{requires:['event-synthetic']});
1 change: 1 addition & 0 deletions build/gallery-event-nav-keys/gallery-event-nav-keys-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b0cb90

Please sign in to comment.