Lines Matching refs:Lang

8 (function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,Overlay=YAHOO.widget.Overlay,Menu=YAHOO.widget.Menu,m_oButtons={},m_oOverlayManager=null,m_oSubmitTrigger=null,m_oFocusedButton=null;function createInputElement(p_sType,p_sName,p_sValue,p_bChecked){var oInput,sInput;if(Lang.isString(p_sType)&&Lang.isString(p_sName)){if(YAHOO.env.ua.ie){sInput="<input type=\""+p_sType+"\" name=\""+
25 YAHOO.widget.Button=function(p_oElement,p_oAttributes){var fnSuperClass=YAHOO.widget.Button.superclass.constructor,oConfig,oElement;if(arguments.length==1&&!Lang.isString(p_oElement)&&!p_oElement.nodeName){if(!p_oElement.id){p_oElement.id=Dom.generateId();}
27 else{oConfig={element:null,attributes:(p_oAttributes||{})};if(Lang.isString(p_oElement)){oElement=Dom.get(p_oElement);if(oElement){if(!oConfig.attributes.id){oConfig.attributes.id=p_oElement;}
52 else if(Lang.isArray(p_oMenu)){this.on("appendTo",function(){oMenu=new Menu(Dom.generateId(),{lazyload:bLazyLoad,itemdata:p_oMenu});initMenu.call(this);});}
53 else if(Lang.isString(p_oMenu)){oMenuElement=Dom.get(p_oMenu);if(oMenuElement){if(Dom.hasClass(oMenuElement,Menu.prototype.CSS_CLASS_NAME)||oMenuElement.nodeName=="SELECT"){oMenu=new Menu(p_oMenu,{lazyload:bLazyLoad});initMenu.call(this);}
58 if(!this._onclickAttributeValue&&Lang.isObject(p_oObject)&&Lang.isFunction(p_oObject.fn)){this.on("click",p_oObject.fn,p_oObject.obj,p_oObject.scope);this._onclickAttributeValue=p_oObject;}},_setSelectedMenuItem:function(p_nIndex){var oMenu=this._menu,oMenuItem;if(oMenu&&oMenu instanceof Menu){oMenuItem=oMenu.getItem(p_nIndex);if(oMenuItem&&!oMenuItem.cfg.getProperty("selected")){oMenuItem.cfg.setProperty("selected",true);}}},_isActivationKey:function(p_nKeyCode){var sType=this.get("type"),aKeyCodes=(sType=="checkbox"||sType=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,nKeyCodes=aKeyCodes.length,i;if(nKeyCodes>0){i=nKeyCodes-1;do{if(p_nKeyCode==aKeyCodes[i]){return true;}}
104 (p_sType=="link"?"<a></a>":"<button type=\"button\"></button>")+"</"+sNodeName+">";return oElement;},addStateCSSClasses:function(p_sState){var sType=this.get("type");if(Lang.isString(p_sState)){if(p_sState!="activeoption"){this.addClass(this.CSS_CLASS_NAME+("-"+p_sState));}
105 this.addClass("yui-"+sType+("-button-"+p_sState));}},removeStateCSSClasses:function(p_sState){var sType=this.get("type");if(Lang.isString(p_sState)){this.removeClass(this.CSS_CLASS_NAME+("-"+p_sState));this.removeClass("yui-"+sType+("-button-"+p_sState));}},createHiddenFields:function(){this.removeHiddenFields();var oForm=this.getForm(),oButtonField,sType,bCheckable,oMenu,oMenuItem,sName,oValue,oMenuField;if(oForm&&!this.get("disabled")){sType=this.get("type");bCheckable=(sType=="checkbox"||sType=="radio");if(bCheckable||(m_oSubmitTrigger==this)){oButtonField=createInputElement((bCheckable?sType:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(oButtonField){if(bCheckable){oButtonField.style.display="none";}
113 if(oField){if(Lang.isArray(oField)){nFields=oField.length;if(nFields>0){i=nFields-1;do{removeChild(oField[i]);}
123 if(Lang.isString(oContainer)){Event.onContentReady(oContainer,function(){this.appendTo(oContainer);},null,this);}
126 else if(this.get("type")!="link"&&bElInDoc&&oSrcElement&&oSrcElement==oElement){this._addListenersToForm();}},initAttributes:function(p_oAttributes){var oAttributes=p_oAttributes||{};YAHOO.widget.Button.superclass.initAttributes.call(this,oAttributes);this.setAttributeConfig("type",{value:(oAttributes.type||"push"),validator:Lang.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:oAttributes.label,validator:Lang.isString,method:this._setLabel});this.setAttributeConfig("value",{value:oAttributes.value});this.setAttributeConfig("name",{value:oAttributes.name,validator:Lang.isString});this.setAttributeConfig("tabindex",{value:oAttributes.tabindex,validator:Lang.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:oAttributes.title,validator:Lang.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(oAttributes.disabled||false),validator:Lang.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:oAttributes.href,validator:Lang.isString,method:this._setHref});this.setAttributeConfig("target",{value:oAttributes.target,validator:Lang.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(oAttributes.checked||false),validator:Lang.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:oAttributes.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:oAttributes.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(oAttributes.lazyloadmenu===false?false:true),validator:Lang.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(oAttributes.menuclassname||"yui-button-menu"),validator:Lang.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("selectedMenuItem",{value:0,validator:Lang.isNumber,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:oAttributes.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(oAttributes.focusmenu===false?false:true),validator:Lang.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(m_oFocusedButton==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){return this._button.form;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var oElement=this.get("element"),oParentNode=oElement.parentNode,oMenu=this._menu;if(oMenu){oMenu.destroy();}
137 oYUISubmitButton.submitForm();}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(p_oForm){var aButtons=Dom.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",p_oForm),nButtons=aButtons.length,oButton,sId,i;if(nButtons>0){for(i=0;i<nButtons;i++){sId=aButtons[i].id;if(sId){oButton=m_oButtons[sId];if(oButton){oButton.createHiddenFields();}}}}};})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,Button=YAHOO.widget.Button,m_oButtons={};YAHOO.widget.ButtonGroup=function(p_oElement,p_oAttributes){var fnSuperClass=YAHOO.widget.ButtonGroup.superclass.constructor,sNodeName,oElement,sId;if(arguments.length==1&&!Lang.isString(p_oElement)&&!p_oElement.nodeName){if(!p_oElement.id){sId=Dom.generateId();p_oElement.id=sId;}
139 else if(Lang.isString(p_oElement)){oElement=Dom.get(p_oElement);if(oElement){if(oElement.nodeName.toUpperCase()==this.NODE_NAME){fnSuperClass.call(this,oElement,p_oAttributes);}}}
149 this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var oContainer=this.get("container");if(oContainer){if(Lang.isString(oContainer)){Event.onContentReady(oContainer,function(){this.appendTo(oContainer);},null,this);}
150 else{this.appendTo(oContainer);}}},initAttributes:function(p_oAttributes){var oAttributes=p_oAttributes||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,oAttributes);this.setAttributeConfig("name",{value:oAttributes.name,validator:Lang.isString});this.setAttributeConfig("disabled",{value:(oAttributes.disabled||false),validator:Lang.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:oAttributes.value});this.setAttributeConfig("container",{value:oAttributes.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(p_oButton){var oButton,oButtonElement,oGroupElement,nIndex,sButtonName,sGroupName;if(p_oButton instanceof Button&&p_oButton.get("type")=="radio"){oButton=p_oButton;}
151 else if(!Lang.isString(p_oButton)&&!p_oButton.nodeName){p_oButton.type="radio";oButton=new Button(p_oButton);}
157 oButton.on("checkedChange",this._onButtonCheckedChange,oButton,this);return oButton;}},addButtons:function(p_aButtons){var nButtons,oButton,aButtons,i;if(Lang.isArray(p_aButtons)){nButtons=p_aButtons.length;aButtons=[];if(nButtons>0){for(i=0;i<nButtons;i++){oButton=this.addButton(p_aButtons[i]);if(oButton){aButtons[aButtons.length]=oButton;}}
159 while(i--);}}},getButton:function(p_nIndex){if(Lang.isNumber(p_nIndex)){return this._buttons[p_nIndex];}},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(p_nIndex){var oButton,nButtons,i;if(Lang.isNumber(p_nIndex)){oButton=this._buttons[p_nIndex];if(oButton){oButton.focus();}}