forked from yui/yui3-gallery
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gallery Build Tag: gallery-2010.09.08-19-45
- Loading branch information
YUI Builder
committed
Sep 8, 2010
1 parent
e5cebce
commit 125cd37
Showing
57 changed files
with
24,615 additions
and
3,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 64 additions & 38 deletions
102
build/gallery-button-group/gallery-button-group-debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,69 @@ | ||
YUI.add('gallery-button-group', function(Y) { | ||
|
||
var YL = Y.Lang; | ||
|
||
Y.ButtonGroup = Y.Base.create('button-group', Y.Widget, [Y.WidgetParent,Y.WidgetChild], { | ||
|
||
labelNode : null, | ||
|
||
initializer : function(config) { | ||
this.labelNode = Y.Node.create('<span class="' + this.getClassName('label') + '"/>'); | ||
}, | ||
|
||
renderUI : function() { | ||
this.get('boundingBox').prepend(this.labelNode); | ||
}, | ||
|
||
syncUI : function() { | ||
this.labelNode.set('text',this.get('label')); | ||
} | ||
|
||
|
||
}, { | ||
ATTRS : { | ||
label : { | ||
validator : YL.isString, | ||
setter : function(val) { | ||
this.labelNode.set('text', val); | ||
return val; | ||
} | ||
}, | ||
|
||
defaultChildType : { | ||
value : Y.Button | ||
}, | ||
|
||
alwaysSelected : { | ||
value : false | ||
} | ||
var YL = Y.Lang; | ||
|
||
Y.ButtonGroup = Y.Base.create('button-group', Y.Widget, [Y.WidgetParent,Y.WidgetChild], { | ||
|
||
labelNode : null, | ||
|
||
initializer : function(config) { | ||
Y.log('Y.ButtonGroup::initializer'); | ||
|
||
this.labelNode = Y.Node.create('<span class="' + this.getClassName('label') + '"/>'); | ||
}, | ||
|
||
renderUI : function() { | ||
Y.log('Y.ButtonGroup::renderUI'); | ||
|
||
this.get('boundingBox').prepend(this.labelNode); | ||
}, | ||
|
||
bindUI : function() { | ||
Y.log('Y.ButtonGroup::bindUI'); | ||
|
||
this.on('button:press', function(e) { | ||
if(this.get('alwaysSelected')) { | ||
var selection = this.get('selection'), | ||
button = e.target; | ||
|
||
if(selection === button || ( // selection is the button OR | ||
selection instanceof Y.ArrayList && // selection is an array AND | ||
selection.size() === 1 && // there is only one item AND | ||
selection.item(0) === button) // that one itme is the button | ||
) { | ||
e.preventDefault(); | ||
} | ||
}); | ||
|
||
} | ||
},this); | ||
}, | ||
|
||
syncUI : function() { | ||
Y.log('Y.ButtonGroup::syncUI'); | ||
|
||
this.labelNode.set('text',this.get('label')); | ||
} | ||
|
||
}, { | ||
ATTRS : { | ||
|
||
label : { | ||
validator : YL.isString, | ||
setter : function(val) { | ||
this.labelNode.set('text', val); | ||
return val; | ||
} | ||
}, | ||
|
||
defaultChildType : { | ||
value : Y.Button | ||
}, | ||
|
||
alwaysSelected : { | ||
value : false | ||
} | ||
} | ||
}); | ||
|
||
|
||
}, 'gallery-2010.06.30-19-54' ,{requires:['widget-parent','widget-child']}); | ||
}, 'gallery-2010.09.08-19-45' ,{requires:['widget-parent','widget-child']}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,65 @@ | ||
YUI.add('gallery-button-group', function(Y) { | ||
|
||
var YL = Y.Lang; | ||
|
||
Y.ButtonGroup = Y.Base.create('button-group', Y.Widget, [Y.WidgetParent,Y.WidgetChild], { | ||
|
||
labelNode : null, | ||
|
||
initializer : function(config) { | ||
this.labelNode = Y.Node.create('<span class="' + this.getClassName('label') + '"/>'); | ||
}, | ||
|
||
renderUI : function() { | ||
this.get('boundingBox').prepend(this.labelNode); | ||
}, | ||
|
||
syncUI : function() { | ||
this.labelNode.set('text',this.get('label')); | ||
} | ||
|
||
|
||
}, { | ||
ATTRS : { | ||
label : { | ||
validator : YL.isString, | ||
setter : function(val) { | ||
this.labelNode.set('text', val); | ||
return val; | ||
} | ||
}, | ||
|
||
defaultChildType : { | ||
value : Y.Button | ||
}, | ||
|
||
alwaysSelected : { | ||
value : false | ||
} | ||
var YL = Y.Lang; | ||
|
||
Y.ButtonGroup = Y.Base.create('button-group', Y.Widget, [Y.WidgetParent,Y.WidgetChild], { | ||
|
||
labelNode : null, | ||
|
||
initializer : function(config) { | ||
|
||
this.labelNode = Y.Node.create('<span class="' + this.getClassName('label') + '"/>'); | ||
}, | ||
|
||
renderUI : function() { | ||
|
||
this.get('boundingBox').prepend(this.labelNode); | ||
}, | ||
|
||
bindUI : function() { | ||
|
||
this.on('button:press', function(e) { | ||
if(this.get('alwaysSelected')) { | ||
var selection = this.get('selection'), | ||
button = e.target; | ||
|
||
if(selection === button || ( // selection is the button OR | ||
selection instanceof Y.ArrayList && // selection is an array AND | ||
selection.size() === 1 && // there is only one item AND | ||
selection.item(0) === button) // that one itme is the button | ||
) { | ||
e.preventDefault(); | ||
} | ||
}); | ||
|
||
} | ||
},this); | ||
}, | ||
|
||
syncUI : function() { | ||
|
||
this.labelNode.set('text',this.get('label')); | ||
} | ||
|
||
}, { | ||
ATTRS : { | ||
|
||
label : { | ||
validator : YL.isString, | ||
setter : function(val) { | ||
this.labelNode.set('text', val); | ||
return val; | ||
} | ||
}, | ||
|
||
defaultChildType : { | ||
value : Y.Button | ||
}, | ||
|
||
alwaysSelected : { | ||
value : false | ||
} | ||
} | ||
}); | ||
|
||
|
||
}, 'gallery-2010.06.30-19-54' ,{requires:['widget-parent','widget-child']}); | ||
}, 'gallery-2010.09.08-19-45' ,{requires:['widget-parent','widget-child']}); |
97 changes: 38 additions & 59 deletions
97
build/gallery-button-toggle/gallery-button-toggle-debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,40 @@ | ||
YUI.add('gallery-button-toggle', function(Y) { | ||
|
||
var YL = Y.Lang, | ||
DESELECTED_CALLBACK = 'deselectedCallback'; | ||
|
||
|
||
Y.ButtonToggle = Y.Base.create('button', Y.Button, [], { | ||
|
||
initializer : function(config) { | ||
this.after('selectedChange',this._selectedChanged, this); | ||
}, | ||
|
||
_bindClick : function() { | ||
|
||
this.get('boundingBox').after('click',function(e){ | ||
var parent = null; | ||
if(!this.isRoot()) { | ||
var parent = this.get('parent'), | ||
selection = parent.get('selection'); | ||
if( | ||
parent instanceof Y.ButtonGroup && // we are in a button group | ||
parent.get('alwaysSelected') && // there should always be at least one | ||
this.get('selected') === 1 && // this is selected | ||
( | ||
selection === this || | ||
( | ||
selection instanceof Y.ArrayList && | ||
selection.size() === 1 && | ||
selection.item(0) === this | ||
) | ||
) // this is the only selected | ||
) { | ||
return; | ||
} | ||
} | ||
this.set('selected', (this.get('selected') === 0) ? 1 : 0); | ||
},this); | ||
}, | ||
|
||
_selectedChanged : function(e) { | ||
if(e.newVal) { | ||
if(this.get('callback')) { | ||
(Y.bind(this.get('callback'),this))(); | ||
} | ||
}else{ | ||
if(this.get(DESELECTED_CALLBACK)) { | ||
(Y.bind(this.get(DESELECTED_CALLBACK),this))(); | ||
} | ||
} | ||
} | ||
|
||
}, { | ||
ATTRS : { | ||
deselectedCallback : { | ||
validator : YL.isFunction | ||
} | ||
} | ||
}); | ||
|
||
|
||
}, 'gallery-2010.06.30-19-54' ,{requires:['gallery-button']}); | ||
var YL = Y.Lang, | ||
DESELECTED_CALLBACK = 'deselectedCallback'; | ||
|
||
Y.ButtonToggle = Y.Base.create('button', Y.Button, [], { | ||
|
||
initializer : function(config) { | ||
this.after('selectedChange',this._afterSelectedChanged, this); | ||
}, | ||
|
||
_defPressFn : function(e) { | ||
this.set('selected', (this.get('selected') === 0) ? 1 : 0); | ||
}, | ||
|
||
_afterSelectedChanged : function(e) { | ||
if(e.newVal) { | ||
this._executeCallback(); | ||
}else{ | ||
this._executeDeselectCallback(); | ||
} | ||
}, | ||
|
||
_executeDeselectCallback : function(e) { | ||
Y.log('Y.ButtonToggle::_executeDeselectCallback'); | ||
if(this.get(DESELECTED_CALLBACK)) { | ||
(this.get(DESELECTED_CALLBACK))(); | ||
} | ||
} | ||
|
||
}, { | ||
ATTRS : { | ||
deselectedCallback : { | ||
validator : YL.isFunction | ||
} | ||
} | ||
}); | ||
|
||
|
||
}, 'gallery-2010.09.08-19-45' ,{requires:['gallery-button']}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.