Skip to content

Commit

Permalink
inputEx 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ericabouaf committed Aug 20, 2012
1 parent 245575d commit 1b7bd4f
Show file tree
Hide file tree
Showing 88 changed files with 3,133 additions and 3,566 deletions.
12 changes: 11 additions & 1 deletion lib/inputex/src/inputex-autocomplete/inputex-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* Adds autocomplete options
* @method setOptions
* @param {Object} options Options object as passed to the constructor
*/
setOptions: function(options) {
Expand All @@ -45,6 +46,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {
* <li>listen to autocompleter textboxBlurEvent instead of this.el "blur" event</li>
* <li>listener to autocompleter textboxBlurEvent added in buildAutocomplete method</li>
* </ul>
* @method initEvents
*/
initEvents: function() {
inputEx.AutoComplete.superclass.initEvents.call(this);
Expand All @@ -55,6 +57,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* Render the hidden list element
* @method renderComponent
*/
renderComponent: function() {

Expand Down Expand Up @@ -98,6 +101,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* Build the YUI autocompleter
* @method buildAutocomplete
*/
buildAutocomplete: function() {
// Call this function only when this.el AND this.listEl are available
Expand All @@ -115,6 +119,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* itemSelect handler
* @method itemSelectHandler
* @param {} sType
* @param {} aArgs
*/
Expand All @@ -123,6 +128,9 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {
this.setValue( this.options.returnValue ? this.options.returnValue(aData) : aData.label );
},

/**
* @method onBlur
*/
onBlur: function(e){
if(this.el.value == '' && this.options.typeInvite) {
Y.one(this.divEl).addClass("inputEx-typeInvite")
Expand All @@ -133,6 +141,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* Set the value
* @method setValue
* @param {Any} value Value to set
* @param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updated event or not (default is true, pass false to NOT send the event)
*/
Expand All @@ -153,6 +162,7 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {

/**
* Return the hidden value (stored in a hidden input)
* @method getValue
*/
getValue: function() {
return this.hiddenEl.value;
Expand All @@ -164,6 +174,6 @@ Y.extend(inputEx.AutoComplete, inputEx.StringField, {
// Register this class as "autocomplete" type
inputEx.registerType("autocomplete", inputEx.AutoComplete);

}, '3.0.0a',{
}, '3.1.0',{
requires: ['inputex-string','autocomplete']
})
47 changes: 37 additions & 10 deletions lib/inputex/src/inputex-base/inputex-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,74 @@
* The inputExBase class provides the hideOn attribute which can
* be used to hide the widget when certain events occur.
*
* @class inputExBase
* @class inputEx.Base
* @param {Object} config User configuration object
*/
function inputExBase(config) {
Y.after(this._renderUIInputEx, this, 'renderUI');

Y.after(this._bindUIInputEx, this, 'bindUI');

if (this.get("rendered")) {
this._renderUIInputEx();
}
}

/**
* Static property used to define the default attribute
* configuration introduced by inputExBase.
*
* @property inputExBase.ATTRS
* @static
* @type Object
*/
inputExBase.ATTRS = {

/**
* inputEx json configuration
*
* @attribute inputEx
* @type Object
*/
inputEx: {
},


/**
* Instantiated inputEx field (any type)
*
* @attribute field
* @type inputEx.Field
*/
field: {
}
};

inputExBase.prototype = {

/**
* @method _renderUIInputEx
* @private
*/
_renderUIInputEx: function() {
var config = {};
Y.mix(config, this.get('inputEx') );
config.parentEl = this.get('contentBox');
this.set('field', Y.inputEx(config));
},

/**
* @method _bindUIInputEx
* @private
*/
_bindUIInputEx: function() {
// Closing all fields when the widget is hidden
this.on('visibleChange', function(e) {
if(e.newVal === false) {
this.get('field').close();
}
}, this);
}

};


Y.inputEx.Base = inputExBase;


}, '3.0.0a',{
}, '3.1.0',{
requires: ['inputex', 'base']
});

Expand Down
8 changes: 7 additions & 1 deletion lib/inputex/src/inputex-button/inputex-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* set the default options
* @method setOptions
*/
setOptions: function(options) {

Expand Down Expand Up @@ -63,6 +64,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* render the button into the parent Element
* @method render
* @param {DOMElement} parentEl The DOM element where the button should be rendered
* @return {DOMElement} The created button
*/
Expand Down Expand Up @@ -99,6 +101,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* attach the listeners on "click" event and create the custom events
* @method initEvents
*/
initEvents: function() {

Expand Down Expand Up @@ -154,6 +157,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* Disable the button
* @method disable
*/
disable: function() {

Expand All @@ -168,6 +172,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* Enable the button
* @method enable
*/
enable: function() {

Expand All @@ -183,6 +188,7 @@ Y.mix(inputEx.widget.Button.prototype,{

/**
* Purge all event listeners and remove the component from the dom
* @method destroy
*/
destroy: function() {

Expand All @@ -203,6 +209,6 @@ Y.mix(inputEx.widget.Button.prototype,{

});
Y.augment(inputEx.widget.Button, Y.EventTarget, null, null, {});
},'3.0.0a',{
},'3.1.0',{
requires:["inputex"]
});
13 changes: 9 additions & 4 deletions lib/inputex/src/inputex-checkbox/inputex-checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Adds the CheckBox specific options
* @method setOptions
* @param {Object} options Options object as passed to the constructor
*/
setOptions: function(options) {
Expand All @@ -43,6 +44,7 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Render the checkbox and the hidden field
* @method renderComponent
*/
renderComponent: function() {

Expand All @@ -62,16 +64,14 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Clear the previous events and listen for the "change" event
* @method initEvents
*/
initEvents: function() {

// Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)
// It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??
/*if( YAHOO.env.ua.ie && parseInt(YAHOO.env.ua.ie,10) != 7 ) {
Event.addListener(this.el, "click", function() { this.fireUpdatedEvt(); }, this, true);
}*/
if( Y.UA.ie ) {
Y.one(this.el).on("click", function(e) { Y.later(10,this,function(){this.onChange(e);}); }, this);
Y.one(this.el).on("click", function(e) { Y.later(10,this,function(){this.onChange(e);}); }, this);
} else {
Y.one(this.el).on("change", this.onChange, this, true);
}
Expand All @@ -82,6 +82,7 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Function called when the checkbox is toggled
* @method onChange
* @param {Event} e The original 'change' event
*/
onChange: function(e) {
Expand All @@ -92,6 +93,7 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Get the state value
* @method getValue
* @return {Any} one of [checkedValue,uncheckedValue]
*/
getValue: function() {
Expand All @@ -100,6 +102,7 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Set the value of the checkedbox
* @method setValue
* @param {Any} value The value schould be one of [checkedValue,uncheckedValue]
* @param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the 'updated' event or not (default is true, pass false to NOT send the event)
*/
Expand Down Expand Up @@ -142,13 +145,15 @@ Y.extend(inputEx.CheckBox, inputEx.Field, {

/**
* Disable the field
* @method disable
*/
disable: function() {
this.el.disabled = true;
},

/**
* Enable the field
* @method enable
*/
enable: function() {
this.el.disabled = false;
Expand Down
9 changes: 8 additions & 1 deletion lib/inputex/src/inputex-choice/inputex-choice.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Add a choice
* @method addChoice
* @param {Object} config An object describing the choice to add (e.g. { value: 'second' [, label: 'Second' [, position: 1 || after: 'First' || before: 'Third']] })
*/
addChoice: function (config) {
Expand Down Expand Up @@ -75,6 +76,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Remove a choice
* @method removeChoice
* @param {Object} config An object targeting the choice to remove (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
removeChoice: function (config) {
Expand Down Expand Up @@ -109,6 +111,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Hide a choice
* @method hideChoice
* @param {Object} config An object targeting the choice to hide (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
hideChoice: function (config, sendUpdatedEvt) {
Expand Down Expand Up @@ -142,6 +145,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Show a choice
* @method showChoice
* @param {Object} config An object targeting the choice to show (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
showChoice: function (config) {
Expand All @@ -167,6 +171,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Disable a choice
* @method disableChoice
* @param {Object} config An object targeting the choice to disable (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
disableChoice: function (config, unselect) {
Expand Down Expand Up @@ -195,6 +200,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Enable a choice
* @method enableChoice
* @param {Object} config An object targeting the choice to enable (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
enableChoice: function (config) {
Expand All @@ -215,6 +221,7 @@ YUI.add("inputex-choice", function(Y){

/**
* Get the position of a choice in choicesList (NOT in the DOM)
* @method getChoicePosition
* @param {Object} config An object targeting the choice (e.g. { position : 1 } || { value: 'second' } || { label: 'Second' })
*/
getChoicePosition: function (config) {
Expand Down Expand Up @@ -249,6 +256,6 @@ YUI.add("inputex-choice", function(Y){

};

}, '3.0.0a',{
}, '3.1.0',{
requires: ["inputex"]
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
div.inputEx-ColorField button {
background-image: url(palette.png);

background-position: 3px 0;
/*background-position: 3px 0;*/
background-repeat: no-repeat;
margin-left: 2px;
}
Expand Down
Loading

0 comments on commit 1b7bd4f

Please sign in to comment.