mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Upgraded the YUI libs to version 0.12.0, released 14 Nov 2006.
This commit is contained in:
parent
6418486c69
commit
d38ed4fba2
79 changed files with 45819 additions and 28246 deletions
|
@ -5,4 +5,5 @@ from:
|
|||
http://developer.yahoo.com/yui
|
||||
|
||||
|
||||
Added to Moodle 13th July, 2006
|
||||
Added to Moodle 13 July 2006
|
||||
Updated to YUI 0.12.0, 23 November 2006
|
||||
|
|
|
@ -1,5 +1,18 @@
|
|||
Animation Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
* added boolean finish argument to Anim.stop()
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
* no changes
|
||||
|
||||
*** version 0.11.1 ***
|
||||
|
||||
* changed "prototype" shorthand to "proto" (workaround firefox < 1.5 scoping
|
||||
bug)
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
* ColorAnim subclass added
|
||||
|
@ -18,3 +31,4 @@ Animation Release Notes
|
|||
|
||||
* Initial release
|
||||
|
||||
|
||||
|
|
488
lib/yui/animation/animation-debug.js
vendored
488
lib/yui/animation/animation-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/animation/animation-min.js
vendored
2
lib/yui/animation/animation-min.js
vendored
File diff suppressed because one or more lines are too long
488
lib/yui/animation/animation.js
vendored
488
lib/yui/animation/animation.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,34 @@
|
|||
AutoComplete Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
* The following constants must be defined as static class properties and are no longer
|
||||
available as instance properties:
|
||||
|
||||
YAHOO.widget.DataSource.ERROR_DATANULL
|
||||
YAHOO.widget.DataSource.ERROR_DATAPARSE
|
||||
YAHOO.widget.DS_XHR.TYPE_JSON
|
||||
YAHOO.widget.DS_XHR.TYPE_XML
|
||||
YAHOO.widget.DS_XHR.TYPE_FLAT
|
||||
YAHOO.widget.DS_XHR.ERROR_DATAXHR
|
||||
|
||||
* The property minQueryLength now supports zero and negative number values for
|
||||
DS_JSFunction and DS_XHR objects, to enable null or empty string queries and to disable
|
||||
AutoComplete functionality altogether, respectively.
|
||||
|
||||
* Enabling the alwaysShowContainer feature will no longer send containerExpandEvent or
|
||||
containerCollapseEvent.
|
||||
|
||||
|
||||
|
||||
**** version 0.11.3 ***
|
||||
|
||||
* The iFrameSrc property has been deprecated. Implementers no longer need to
|
||||
specify an https URL to avoid IE security warnings when working with sites over
|
||||
SSL.
|
||||
|
||||
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
* The method getListIds() has been deprecated for getListItems(), which returns
|
||||
|
|
1970
lib/yui/autocomplete/autocomplete-debug.js
vendored
1970
lib/yui/autocomplete/autocomplete-debug.js
vendored
File diff suppressed because it is too large
Load diff
164
lib/yui/autocomplete/autocomplete-min.js
vendored
164
lib/yui/autocomplete/autocomplete-min.js
vendored
|
@ -1,31 +1,23 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
|
||||
|
||||
YAHOO.widget.AutoComplete=function(inputEl,containerEl,oDataSource,oConfigs){if(inputEl&&containerEl&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}
|
||||
else{return;}
|
||||
if(YAHOO.util.Dom.inDocument(inputEl)){if(typeof inputEl=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl;this._oTextbox=document.getElementById(inputEl);}
|
||||
else{this._sName=(inputEl.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+inputEl.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=inputEl;}}
|
||||
if(YAHOO.util.Dom.inDocument(elInput)){if(typeof elInput=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}
|
||||
else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}}
|
||||
else{return;}
|
||||
if(YAHOO.util.Dom.inDocument(containerEl)){if(typeof containerEl=="string"){this._oContainer=document.getElementById(containerEl);}
|
||||
else{this._oContainer=containerEl;}
|
||||
if(YAHOO.util.Dom.inDocument(elContainer)){if(typeof elContainer=="string"){this._oContainer=document.getElementById(elContainer);}
|
||||
else{this._oContainer=elContainer;}
|
||||
if(this._oContainer.style.display=="none"){}}
|
||||
else{return;}
|
||||
if(typeof oConfigs=="object"){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
|
||||
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
|
||||
this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
|
||||
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.5;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.iFrameSrc="about:blank";YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.getName=function(){return this._sName;};YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
|
||||
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
|
||||
YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);oTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}
|
||||
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.5;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
|
||||
else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;this._oContainer._oContent._oHeader.style.display="block";}}
|
||||
else{this._oContainer._oContent._oHeader.innerHTML="";this._oContainer._oContent._oHeader.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;this._oContainer._oContent._oFooter.style.display="block";}}
|
||||
else{this._oContainer._oContent._oFooter.innerHTML="";this._oContainer._oContent._oFooter.style.display="none";}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;this._oContainer._oContent._oBody.style.display="block";this._oContainer._oContent.style.display="block";}}
|
||||
else{this._oContainer._oContent._oBody.innerHTML="";this._oContainer._oContent.style.display="none";}
|
||||
this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
|
||||
else{return"";}};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){if(sQuery){this._sendQuery(sQuery);}
|
||||
else{return;}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}
|
||||
else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oResultItem,sQuery){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(isNaN(minQueryLength)||(minQueryLength<1)){minQueryLength=1;}
|
||||
var maxResultsDisplayed=this.maxResultsDisplayed;if(isNaN(this.maxResultsDisplayed)||(this.maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
|
||||
var queryDelay=this.queryDelay;if(isNaN(this.queryDelay)||(this.queryDelay<0)){this.queryDelay=0.5;}
|
||||
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){if(typeof aDelimChar=="string"){this.delimChar=[aDelimChar];}
|
||||
|
@ -33,51 +25,29 @@ else if(aDelimChar.constructor!=Array){this.delimChar=null;}}
|
|||
var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(isNaN(animSpeed)||(animSpeed<0)){animSpeed=0.3;}
|
||||
if(!this._oAnim){oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);this._oAnim=oAnim;}
|
||||
else{this._oAnim.duration=animSpeed;}}
|
||||
if(this.forceSelection&&this.delimChar){}
|
||||
if(this.alwaysShowContainer&&(this.useShadow||this.useIFrame)){}
|
||||
if(this.alwaysShowContainer){this._bContainerOpen=true;}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
|
||||
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this.iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
|
||||
if(this.forceSelection&&this.delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
|
||||
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";oIFrame.style.position="absolute";oIFrame.style.width="100%";oIFrame.style.height="100%";oIFrame.tabIndex=-1;this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";oContent.style.display="none";this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd";oHeader.style.display="none";this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";oFooter.style.display="none";this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
|
||||
else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;i--){oldListItems[oldi]=null;}}
|
||||
this._oContainer._oContent._oBody.innerHTML="";}
|
||||
var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
|
||||
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
|
||||
else{oSelf._toggleHighlight(this,"to");}
|
||||
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
|
||||
else{oSelf._toggleHighlight(this,"from");}
|
||||
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
|
||||
else{oSelf._clearList();}
|
||||
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
|
||||
else{oSelf._clearList();}
|
||||
break;case 27:oSelf._clearList();return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:case 13:if((oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
|
||||
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sChar=String.fromCharCode(nKeyCode);var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
|
||||
else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
|
||||
if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
|
||||
oSelf._nDelayID=nDelayID;}
|
||||
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
|
||||
return false;};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}
|
||||
else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}
|
||||
if(oSelf._bContainerOpen){oSelf._clearList();}
|
||||
oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
|
||||
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
|
||||
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;oItem.style.display="none";oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(oSelf){oSelf._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var currValue=this._oTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(oSelf){if(oSelf._queryInterval){clearInterval(oSelf._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=38)||(nKeyCode==40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
|
||||
return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}
|
||||
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
|
||||
if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
|
||||
if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
|
||||
this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
|
||||
else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
|
||||
if(sQuery.length<this.minQueryLength){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
|
||||
this._clearList();return;}
|
||||
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._clearList=function(){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
|
||||
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
|
||||
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
|
||||
if(sQuery&&(sQuery.length<this.minQueryLength)||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
|
||||
this._toggleContainer(false);return;}
|
||||
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
|
||||
if(!oSelf._bFocused||!aResults){return;}
|
||||
var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
|
||||
var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);oItemi.style.display="list-item";oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
|
||||
for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;oItemj.style.display="none";oItemj._sResultKey=null;oItemj._oResultData=null;}
|
||||
if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
|
||||
else{oSelf._oCurItem=null;}
|
||||
oSelf._toggleContainer(true);}
|
||||
else{oSelf._clearList();}
|
||||
var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);oSelf._toggleContainer(ok);}
|
||||
else{oSelf._toggleContainer(false);}
|
||||
oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
|
||||
else{this._oTextbox.value="";}
|
||||
this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=false;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=true;break;}}
|
||||
|
@ -85,13 +55,14 @@ return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oIt
|
|||
var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
|
||||
var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
|
||||
else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
|
||||
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
|
||||
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(bShow){this._oContainer._oIFrame.style.width=width;this._oContainer._oIFrame.style.height=height;}
|
||||
else{this._oContainer._oIFrame.style.width=0;this._oContainer._oIFrame.style.height=0;}}
|
||||
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(this.alwaysShowContainer||bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
|
||||
else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){if(this.alwaysShowContainer){if(bShow){this.containerExpandEvent.fire(this);}
|
||||
else{this.containerCollapseEvent.fire(this);}
|
||||
this._bContainerOpen=bShow;return;}
|
||||
var oContainer=this._oContainer;if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
|
||||
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){this._oContainer._oShadow.style.width=width;this._oContainer._oShadow.style.height=height;}
|
||||
else{this._oContainer._oShadow.style.width=0;this._oContainer._oShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var oContainer=this._oContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}
|
||||
if(!bShow){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){aItems[i].style.display="none";}}
|
||||
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
|
||||
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}
|
||||
if(!bShow&&!this._bContainerOpen){oContainer._oContent.style.display="none";return;}
|
||||
var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
|
||||
if(oAnim.isAnimated()){oAnim.stop();}
|
||||
var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.display="block";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){oContainer._oContent.style.width=wColl+"px";oContainer._oContent.style.height=hColl+"px";}
|
||||
|
@ -104,31 +75,52 @@ else{oContainer._oContent.style.display="none";this.containerCollapseEvent.fire(
|
|||
this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
|
||||
if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
|
||||
var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
|
||||
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?this.delimChar[0]:null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
|
||||
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
|
||||
oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
|
||||
else{oTextbox.value=sResultKey;}
|
||||
if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
|
||||
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._clearList();};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}
|
||||
else{this._clearList();}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
|
||||
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(!this.typeAhead){return;}
|
||||
else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
|
||||
var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
|
||||
if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
|
||||
if(nNewItemIndex==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._oTextbox.value=this._sSavedQuery;}
|
||||
else{this._oTextbox.value=this._sSavedQuery+this._sCurQuery;}}
|
||||
else{this._oTextbox.value=this._sCurQuery;}
|
||||
this._oCurItem=null;return;}
|
||||
if(nNewItemIndex==-2){this._clearList();return;}
|
||||
var oNewItem=this._aListItems[nNewItemIndex];if((YAHOO.util.Dom.getStyle(this._oContainer._oContent,"overflow")=="auto")&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}
|
||||
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}}
|
||||
else{if(oNewItem.offsetTop<this._oContainer._oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
|
||||
else if(oNewItem.offsetTop>(this._oContainer._oContent.scrollTop+this._oContainer._oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-this._oContainer._oContent.offsetHeight;}}}
|
||||
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.prototype.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.prototype.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.getName=function(){return this._sName;};YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
|
||||
if(nNewItemIndex==-2){this._toggleContainer(false);return;}
|
||||
var oNewItem=this._aListItems[nNewItemIndex];var oContent=this._oContainer._oContent;var scrollOn=((YAHOO.util.Dom.getStyle(oContent,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}
|
||||
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
|
||||
else{if(oNewItem.offsetTop<oContent.scrollTop){this._oContainer._oContent.scrollTop=oNewItem.offsetTop;}
|
||||
else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){this._oContainer._oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
|
||||
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
|
||||
else{oSelf._toggleHighlight(this,"to");}
|
||||
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
|
||||
else{oSelf._toggleHighlight(this,"from");}
|
||||
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf){oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){oSelf._bOverContainer=false;if(oSelf._oCurItem){oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
|
||||
else{oSelf._toggleContainer(false);}
|
||||
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
if(oSelf._oCurItem){oSelf._selectItem(oSelf._oCurItem);}
|
||||
else{oSelf._toggleContainer(false);}
|
||||
break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
break;case 13:if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
|
||||
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}
|
||||
else if(nKeyCode==229){oSelf._queryInterval=setInterval(function(){oSelf._onIMEDetected(oSelf);},500);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
|
||||
else{oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
|
||||
if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
|
||||
oSelf._nDelayID=nDelayID;}
|
||||
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf.textboxFocusEvent.fire(oSelf);};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&!oSelf._textMatchesOption())){if(oSelf.forceSelection){oSelf._clearSelection();}
|
||||
else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}}
|
||||
if(oSelf._bContainerOpen){oSelf._toggleContainer(false);}
|
||||
oSelf._cancelIntervalDetection(oSelf);oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
|
||||
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
|
||||
if(this._aCacheHelper){this._aCacheHelper=[];}
|
||||
this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var maxCacheEntries=this.maxCacheEntries;if(isNaN(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
|
||||
if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
|
||||
this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(resultObj){var aCache=this._aCache;if(!aCache||!resultObj||!resultObj.query||!resultObj.results){return;}
|
||||
this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(oResult){var aCache=this._aCache;if(!aCache||!oResult||!oResult.query||!oResult.results){return;}
|
||||
if(aCache.length>=this.maxCacheEntries){aCache.shift();}
|
||||
aCache.push(resultObj);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
|
||||
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query.toLowerCase()):encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
|
||||
aCache.push(oResult);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
|
||||
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query).toLowerCase():encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
|
||||
break;}
|
||||
else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
|
||||
resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
|
||||
|
@ -137,18 +129,20 @@ if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults
|
|||
return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
|
||||
if(!aSchema||(aSchema.constructor!=Array)){return;}
|
||||
else{this.schema=aSchema;}
|
||||
this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.prototype.TYPE_JSON=0;YAHOO.widget.DS_XHR.prototype.TYPE_XML=1;YAHOO.widget.DS_XHR.prototype.TYPE_FLAT=2;YAHOO.widget.DS_XHR.prototype.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.prototype.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!--";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==this.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
|
||||
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
|
||||
this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
|
||||
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
|
||||
for(var foo in oResp){}
|
||||
if(!isXML){oResp=oResp.responseText;}
|
||||
else{oResp=oResp.responseXML;}
|
||||
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATANULL);return;}
|
||||
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAPARSE);return;}
|
||||
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);oCallbackFn(sQuery,aResults,oParent);}};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,oSelf.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}
|
||||
if(this._oConn){YAHOO.util.Connect.abort(this._oConn);}
|
||||
oSelf._oConn=YAHOO.util.Connect.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
|
||||
switch(this.responseType){case this.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
|
||||
else{jsonList=eval("jsonObjParsed."+aSchema[0]);}}
|
||||
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
|
||||
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}
|
||||
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}
|
||||
oCallbackFn(sQuery,aResults,oParent);};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(!isNaN(this.connTimeout)&&this.connTimeout>0){oCallback.timeout=this.connTimeout;}
|
||||
if(this._oConn){this.connMgr.abort(this._oConn);}
|
||||
oSelf._oConn=this.connMgr.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
|
||||
switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList;if(window.JSON&&(navigator.userAgent.toLowerCase().indexOf('khtml')==-1)){var jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
|
||||
else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
|
||||
catch(e){bError=true;break;}}}
|
||||
else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
|
||||
if(oResponse.indexOf("{")<0){bError=true;break;}
|
||||
if(oResponse.indexOf("{}")===0){break;}
|
||||
|
@ -156,26 +150,28 @@ var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
|
|||
jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
|
||||
catch(e){bError=true;break;}}
|
||||
if(!jsonList){bError=true;break;}
|
||||
if(jsonList.constructor!=Array){jsonList=[jsonList];}
|
||||
for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
|
||||
aResultItem.unshift(dataFieldValue);}
|
||||
if(aResultItem.length==1){aResultItem.push(jsonResult);}
|
||||
aResults.unshift(aResultItem);}
|
||||
break;case this.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
|
||||
break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
|
||||
for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
|
||||
else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
|
||||
else{sValue="";}}
|
||||
aFieldSet.unshift(sValue);}
|
||||
aResults.unshift(aFieldSet);}
|
||||
break;case this.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
|
||||
break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
|
||||
var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
|
||||
break;default:break;}
|
||||
sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
|
||||
else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
|
||||
if(!oFunction||(oFunction.constructor!=Function)){return;}
|
||||
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,this.ERROR_DATANULL);return;}
|
||||
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
|
||||
var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(typeof oConfigs=="object"){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
|
||||
if(!aData||(aData.constructor!=Array)){return;}
|
||||
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
|
||||
for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(typeof aData[i]=="string"){aDataset[0]=aData[i];}
|
||||
else{aDataset=aData[i];}
|
||||
var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}
|
||||
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
|
||||
for(var i=aData.length-1;i>=0;i--){var aDataset=[];if(aData[i]){if(aData[i].constructor==String){aDataset[0]=aData[i];}
|
||||
else if(aData[i].constructor==Array){aDataset=aData[i];}}
|
||||
if(aDataset[0]&&(aDataset[0].constructor==String)){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}}
|
||||
this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};
|
1944
lib/yui/autocomplete/autocomplete.js
vendored
1944
lib/yui/autocomplete/autocomplete.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,21 +1,104 @@
|
|||
Calendar Release Notes
|
||||
|
||||
*** version 0.12 ***
|
||||
|
||||
- New documentation format implemented
|
||||
- Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone
|
||||
represents the single Calendar instance, and CalendarGroup represents an
|
||||
n-up instance, defaulting to 2up
|
||||
- Added semantic style classes to Calendar elements to allow for custom
|
||||
styling solely using CSS.
|
||||
- Remapped all configuration properties to use the Config object
|
||||
(familiar to those who use the Container collection of controls).
|
||||
Property names are the same as their previous counterparts, but wrapped
|
||||
into Calendar.cfg, allowing for runtime reconfiguration of most
|
||||
properties.
|
||||
- Added "title" property for setting the Calendar title
|
||||
- Added "close" property for enabling and disabling the close icon
|
||||
- Added "iframe" property for enabling an iframe shim in Internet
|
||||
Explorer 6 and below to fix the select bleed-through bug
|
||||
- pageDate moved to property: "pagedate"
|
||||
- selectedDates moved to property: "selected"
|
||||
- minDate moved to property : "mindate", which accepts a JavaScript Date
|
||||
object like its predecessor, but also supports string dates
|
||||
- maxDate moved to property : "maxdate", which accepts a JavaScript Date
|
||||
object like its predecessor, but also supports string dates
|
||||
- Moved style declarations to initStyles function
|
||||
- Optimized event handling in
|
||||
doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the
|
||||
listener to the outer Calendar container, and only reacting to events on
|
||||
cells with the "selectable" CSS class.
|
||||
- Added domEventMap field for applying DOM event listeners to cells
|
||||
containing specific class and tag combinations.
|
||||
- Moved all cell DOM event attachment to applyListeners function
|
||||
- Added getDateByCellId / getDateFieldsByCellId helper functions
|
||||
- Corrected DateMath.getWeekNumber to comply with ISO week number
|
||||
handling
|
||||
- Separated renderCellDefault style portions into styleCellDefault
|
||||
function for easy extension
|
||||
- Deprecated onBeforeSelect. Created beforeSelectEvent which
|
||||
automatically subscribes to its deprecated predecessor.
|
||||
- Deprecated onSelect. Created selectEvent, which automatically
|
||||
subscribes to its deprecated predecessor.
|
||||
- Deprecated onBeforeDeselect. Created beforeSelectEvent which
|
||||
automatically subscribes to its deprecated predecessor.
|
||||
- Deprecated onDeselect. Created beforeDeselectEvent, which
|
||||
automatically subscribes to its deprecated predecessor.
|
||||
- Deprecated onChangePage. Created changePageEvent, which automatically
|
||||
subscribes to its deprecated predecessor.
|
||||
- Deprecated onRender. Created renderEvent, which automatically
|
||||
subscribes to its deprecated predecessor.
|
||||
- Deprecated onReset. Created resetEvent, which automatically subscribes
|
||||
to its deprecated predecessor.
|
||||
- Deprecated onClear. Created clearEvent, which automatically subscribes
|
||||
to its deprecated predecessor.
|
||||
- Corrected setMonth documentation to refer to 0-11 indexed months.
|
||||
- Added show and hide methods to Calendar for setting the Calendar's
|
||||
display property.
|
||||
- Optimized internal render classes to use innerHTML and string buffers
|
||||
- Removed wireCustomEvents function
|
||||
- Removed wireDefaultEvents function
|
||||
- Removed doNextMonth / doPreviousMonth
|
||||
- Removed all buildShell (header, body, footer) functions, since the
|
||||
Calendar shell is now built dynamically on each render
|
||||
- Wired all CalendarGroup events and configuration properties to be
|
||||
properly delegated to Calendar
|
||||
- Augmented CalendarGroup with all built-in renderers, label functions,
|
||||
hide, show, and initStyles, creating API transparency between Calendar
|
||||
and CalendarGroup.
|
||||
- Made all tagName, createElement, and entity references XHTML compliant
|
||||
- Fixed Daylight Saving Time bug for Brazilian time zone
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
- Calendar_Core: Added arguments for selected/deselected dates to
|
||||
onSelect/onDeselect
|
||||
- CalendarGroup: Fixed bug where selected dates passed to constructor
|
||||
were not represented in selectedDates
|
||||
- Calendar2up: Now displays correctly in Opera 9
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
- DateMath: DateMath.add now properly adds weeks
|
||||
- DateMath: between() function added
|
||||
- DateMath: getWeekNumber() fixed to take starting day of week into account
|
||||
- All references to Calendar's built in CSS class handlers are removed, replaced with calls to Dom utility (addClass, removeClass)
|
||||
- DateMath: getWeekNumber() fixed to take starting day of week into
|
||||
account
|
||||
- All references to Calendar's built in CSS class handlers are removed,
|
||||
replaced with calls to Dom utility (addClass, removeClass)
|
||||
- Several CSS class constants now have clearer names
|
||||
- All CSS classes are now properly namespaced to avoid CSS conflicts
|
||||
- Fixed table:hover bug in CSS
|
||||
- Calendar no longer requires the container ID and variable name to match in order for month navigation to function properly
|
||||
- Calendar month navigation arrows are now represented as background images
|
||||
- Calendar no longer requires the container ID and variable name to
|
||||
match in order for month navigation to function properly
|
||||
- Calendar month navigation arrows are now represented as background
|
||||
images
|
||||
|
||||
*** version 0.10.0 ***
|
||||
|
||||
- Major performance improvements from attaching DOM events to associated table cells only once, when the Calendar shell is built
|
||||
- DOM events for mouseover/mouseout are now fired for all browsers (not just Internet Explorer)
|
||||
- Major performance improvements from attaching DOM events to associated
|
||||
table cells only once, when the Calendar shell is built
|
||||
- DOM events for mouseover/mouseout are now fired for all browsers (not
|
||||
just Internet Explorer)
|
||||
- Reset functionality bug fixed for 2-up Calendar view
|
||||
|
||||
*** version 0.9.0 ***
|
||||
|
|
|
@ -2,17 +2,40 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
Version 0.11.0
|
||||
Version 0.12
|
||||
*/
|
||||
|
||||
.yui-cal2upwrapper {*height:1%;} /* IE */
|
||||
.yui-cal2upwrapper:after {content:'.';clear:both;display:block;visibility:hidden;height:0;} /* others */
|
||||
|
||||
.yui-calcontainer {
|
||||
float:left;
|
||||
position:relative;
|
||||
padding:5px;
|
||||
background-color:#F7F9FB;
|
||||
border:1px solid #7B9EBD;
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.yui-calcontainer iframe {
|
||||
position:absolute;
|
||||
border:none;
|
||||
margin:0;padding:0;
|
||||
left:-1px;
|
||||
top:-1px;
|
||||
z-index:0;
|
||||
width:50em;
|
||||
height:50em;
|
||||
}
|
||||
|
||||
.yui-calcontainer.multi {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.yui-calcontainer.multi .groupcal {
|
||||
padding:5px;
|
||||
background-color:transparent;
|
||||
z-index:1;
|
||||
float:left;
|
||||
position:relative;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.yui-calcontainer .title {
|
||||
|
@ -20,20 +43,32 @@ Version 0.11.0
|
|||
color:#000;
|
||||
font-weight:bold;
|
||||
margin-bottom:5px;
|
||||
height:auto;
|
||||
width:304px;
|
||||
height:25px;
|
||||
position:absolute;
|
||||
top:3px;left:5px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.yui-calcontainer .close-icon {
|
||||
position:absolute;
|
||||
right:3px;
|
||||
top:3px;
|
||||
border:none;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
/* Calendar element styles */
|
||||
|
||||
.yui-calendar {
|
||||
font:100% sans-serif;
|
||||
text-align:center;
|
||||
border-spacing:0;
|
||||
border-collapse:separate;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.yui-calcontainer .title .close-icon {
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:0;
|
||||
border:none;
|
||||
}
|
||||
|
||||
.yui-calcontainer .cal2up {
|
||||
float:left;
|
||||
.yui-calcontainer.withtitle {
|
||||
padding-top:1.5em;
|
||||
}
|
||||
|
||||
.yui-calendar .calnavleft {
|
||||
|
@ -45,6 +80,7 @@ Version 0.11.0
|
|||
width:9px;
|
||||
height:12px;
|
||||
left:2px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.yui-calendar .calnavright {
|
||||
|
@ -56,22 +92,13 @@ Version 0.11.0
|
|||
width:9px;
|
||||
height:12px;
|
||||
right:2px;
|
||||
}
|
||||
|
||||
/* Calendar element styles */
|
||||
|
||||
.yui-calendar {
|
||||
font:100% sans-serif;
|
||||
text-align:center;
|
||||
border-spacing:0;
|
||||
border-collapse:separate;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.yui-calendar td.calcell {
|
||||
width:1.5em;
|
||||
height:1em;
|
||||
padding:.1em .2em;
|
||||
border:1px solid #E0E0E0;
|
||||
background-color:#FFF;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.yui-calendar td.calcell a {
|
||||
|
@ -103,12 +130,6 @@ Version 0.11.0
|
|||
border:1px solid #FF9900;
|
||||
}
|
||||
|
||||
/* Added to perform some correction for Opera 8.5
|
||||
hover redraw bug */
|
||||
table.yui-calendar:hover {
|
||||
background-color:#FFF;
|
||||
}
|
||||
|
||||
.yui-calendar td.calcell.calcellhover a {
|
||||
color:#FFF;
|
||||
}
|
||||
|
@ -126,7 +147,6 @@ table.yui-calendar:hover {
|
|||
.yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; }
|
||||
.yui-calendar td.calcell.highlight4 { background-color:#CCFF99; }
|
||||
|
||||
|
||||
.yui-calendar .calhead {
|
||||
border:1px solid #E0E0E0;
|
||||
vertical-align:middle;
|
||||
|
@ -146,6 +166,8 @@ table.yui-calendar:hover {
|
|||
.yui-calendar .calweekdaycell {
|
||||
color:#666;
|
||||
font-weight:normal;
|
||||
text-align:center;
|
||||
width:1.5em;
|
||||
}
|
||||
|
||||
.yui-calendar .calfoot {
|
||||
|
|
4717
lib/yui/calendar/calendar-debug.js
vendored
4717
lib/yui/calendar/calendar-debug.js
vendored
File diff suppressed because it is too large
Load diff
254
lib/yui/calendar/calendar-min.js
vendored
254
lib/yui/calendar/calendar-min.js
vendored
File diff suppressed because one or more lines are too long
4607
lib/yui/calendar/calendar.js
vendored
4607
lib/yui/calendar/calendar.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,10 +1,70 @@
|
|||
Connection Manager Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
* When uploading files via setForm() and asyncRequest includes a POST data
|
||||
argument, appendPostData() will create hidden input fields for each postData
|
||||
label/value and append each field to the form object.
|
||||
|
||||
* setForm() returns the assembled label/value string of the parsed HTML form
|
||||
fields.
|
||||
|
||||
* NOTE: Opera 9.02 does not allow for more than 12 concurrent Connection Manager
|
||||
objects.
|
||||
|
||||
The following example creates 12 requests in a loop:
|
||||
for(var n=0; n<=12; i++){
|
||||
conn[n] = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
|
||||
}
|
||||
|
||||
If n > 13, Opera 9.02 will crash. Connection manager objects count n must be <=
|
||||
12 at all times. This condition was not present in Opera version 9.01.
|
||||
|
||||
This condition does not apply to other A-Grade browsers (
|
||||
http://developer.yahoo.com/yui/articles/gbs/gbs_browser-chart.html)
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
* YUI Event dependency for file uploading is now optional.
|
||||
|
||||
* uploadFile() now sets unique IDs for each file upload transaction to prevent
|
||||
iframe collisions with parallel uploads.
|
||||
|
||||
* The callback object now has property responseXML to provide support for file
|
||||
upload transactions that return an XML document.
|
||||
|
||||
* setForm() will verify if a select option value attribute is present and use
|
||||
its value, including empty string, before using the text node value.
|
||||
|
||||
* Modified polling mechanism in handleReadyState() and
|
||||
handleTransactionResponse() to prevent infinite polling if JavaScript errors
|
||||
occur in the user-defined callback.
|
||||
|
||||
* createFrame() will now accept a boolean argument of true to set the frame
|
||||
source to "javascript:false" to prevent IE from throwing security warnings in an
|
||||
HTTPS environment.
|
||||
|
||||
* setHeader() now enumerates through the _http_header object using
|
||||
hasOwnProperty() to prevent collisions with members added to Object via
|
||||
prototype.
|
||||
|
||||
* If using setForm() and asyncRequest includes a POST data argument, the data
|
||||
will be concatenated to the HTML form POST message.
|
||||
|
||||
*** version 0.11.2 ***
|
||||
|
||||
* No revisions.
|
||||
|
||||
*** version 0.11.1 ***
|
||||
|
||||
* uploadFile() now verifies the existence of callback.upload before invoking
|
||||
callback, with or without object scope.
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
* Each transactions can be defined with a timeout threshold, in milliseconds,
|
||||
* Each transaction can be defined with a timeout threshold, in milliseconds,
|
||||
through the callback object. If the threshold is reached, and the transaction
|
||||
hasn't completed, the transaction will call abort().
|
||||
hasn't yet completed, the transaction will call abort().
|
||||
|
||||
* abort() will now accept a callback object as the second argument. The
|
||||
failure callback will receive a response object to indicate the transaction was
|
||||
|
@ -78,3 +138,14 @@ and returns false if the connection object is no longer available.
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
549
lib/yui/connection/connection-debug.js
vendored
549
lib/yui/connection/connection-debug.js
vendored
|
@ -2,120 +2,163 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description
|
||||
* The Connection Manager provides a simplified interface to the XMLHttpRequest
|
||||
* object. It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
|
||||
* interactive states and server response, returning the results to a pre-defined
|
||||
* callback you create.
|
||||
* @ class
|
||||
*
|
||||
* @namespace YAHOO.util
|
||||
* @module Connection
|
||||
* @Class Connect
|
||||
*/
|
||||
YAHOO.util.Connect =
|
||||
{
|
||||
/**
|
||||
* Array of MSFT ActiveX ids for XMLHttpRequest.
|
||||
/**
|
||||
* @description Array of MSFT ActiveX ids for XMLHttpRequest.
|
||||
* @property _msxml_progid
|
||||
* @private
|
||||
* @static
|
||||
* @type array
|
||||
*/
|
||||
_msxml_progid:[
|
||||
'MSXML2.XMLHTTP.3.0',
|
||||
'MSXML2.XMLHTTP',
|
||||
'Microsoft.XMLHTTP'
|
||||
],
|
||||
'MSXML2.XMLHTTP.3.0',
|
||||
'MSXML2.XMLHTTP',
|
||||
'Microsoft.XMLHTTP'
|
||||
],
|
||||
|
||||
/**
|
||||
* Object literal of HTTP header(s)
|
||||
* @description Object literal of HTTP header(s)
|
||||
* @property _http_header
|
||||
* @private
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_http_header:{},
|
||||
|
||||
/**
|
||||
* Determines if HTTP headers are set.
|
||||
* @description Determines if HTTP headers are set.
|
||||
* @property _has_http_headers
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_has_http_headers:false,
|
||||
|
||||
/**
|
||||
* Property that that determines if a default header of
|
||||
* @description Determines if a default header of
|
||||
* Content-Type of 'application/x-www-form-urlencoded'
|
||||
* will be added to any client HTTP headers sent.
|
||||
* will be added to any client HTTP headers sent for POST
|
||||
* transactions.
|
||||
* @property _use_default_post_header
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_default_post_header:true,
|
||||
_use_default_post_header:true,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to determine if the data
|
||||
* should be submitted as an HTML form.
|
||||
* @description Determines if a default header of
|
||||
* Content-Type of 'application/x-www-form-urlencoded'
|
||||
* will be added to any client HTTP headers sent for POST
|
||||
* transactions.
|
||||
* @property _default_post_header
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_default_post_header:'application/x-www-form-urlencoded',
|
||||
|
||||
/**
|
||||
* @description Property modified by setForm() to determine if the data
|
||||
* should be submitted as an HTML form.
|
||||
* @property _isFormSubmit
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_isFormSubmit:false,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to determine if a file(s)
|
||||
* @description Property modified by setForm() to determine if a file(s)
|
||||
* upload is expected.
|
||||
* @property _isFileUpload
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_isFileUpload:false,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to set a reference to the HTML
|
||||
* @description Property modified by setForm() to set a reference to the HTML
|
||||
* form node if the desired action is file upload.
|
||||
* @property _formNode
|
||||
* @private
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_formNode:null,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to set the HTML form data
|
||||
* @description Property modified by setForm() to set the HTML form data
|
||||
* for each transaction.
|
||||
* @property _sFormData
|
||||
* @private
|
||||
* @static
|
||||
* @type string
|
||||
*/
|
||||
_sFormData:null,
|
||||
|
||||
/**
|
||||
* Collection of polling references to the polling mechanism in handleReadyState.
|
||||
* @description Collection of polling references to the polling mechanism in handleReadyState.
|
||||
* @property _poll
|
||||
* @private
|
||||
* @type string
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_poll:[],
|
||||
_poll:{},
|
||||
|
||||
/**
|
||||
* Queue of timeout references for each transaction with a defined timeout value.
|
||||
* @description Queue of timeout values for each transaction callback with a defined timeout value.
|
||||
* @property _timeOut
|
||||
* @private
|
||||
* @type string
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_timeOut:[],
|
||||
_timeOut:{},
|
||||
|
||||
/**
|
||||
* The polling frequency, in milliseconds, for HandleReadyState.
|
||||
* @description The polling frequency, in milliseconds, for HandleReadyState.
|
||||
* when attempting to determine a transaction's XHR readyState.
|
||||
* The default is 50 milliseconds.
|
||||
* @property _polling_interval
|
||||
* @private
|
||||
* @static
|
||||
* @type int
|
||||
*/
|
||||
_polling_interval:50,
|
||||
|
||||
/**
|
||||
* A transaction counter that increments the transaction id for each transaction.
|
||||
* @description A transaction counter that increments the transaction id for each transaction.
|
||||
* @property _transaction_id
|
||||
* @private
|
||||
* @static
|
||||
* @type int
|
||||
*/
|
||||
_transaction_id:0,
|
||||
|
||||
/**
|
||||
* Member to add an ActiveX id to the existing xml_progid array.
|
||||
* @description Member to add an ActiveX id to the existing xml_progid array.
|
||||
* In the event(unlikely) a new ActiveX id is introduced, it can be added
|
||||
* without internal code modifications.
|
||||
* @method setProgId
|
||||
* @public
|
||||
* @param string id The ActiveX id to be added to initialize the XHR object.
|
||||
* @static
|
||||
* @param {string} id The ActiveX id to be added to initialize the XHR object.
|
||||
* @return void
|
||||
*/
|
||||
setProgId:function(id)
|
||||
|
@ -125,37 +168,43 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Member to enable or disable the default POST header.
|
||||
* @description Member to enable or disable the default POST header.
|
||||
* @method setDefaultPostHeader
|
||||
* @public
|
||||
* @param boolean b Use default header - true or false .
|
||||
* @static
|
||||
* @param {boolean} b Set and use default header - true or false .
|
||||
* @return void
|
||||
*/
|
||||
setDefaultPostHeader:function(b)
|
||||
{
|
||||
YAHOO.log('Default POST header set to ' + b, 'info', 'Connection');
|
||||
this._default_post_header = b;
|
||||
this._use_default_post_header = b;
|
||||
YAHOO.log('Use default POST header set to ' + b, 'info', 'Connection');
|
||||
},
|
||||
|
||||
/**
|
||||
* Member to modify the default polling interval.
|
||||
* @description Member to modify the default polling interval.
|
||||
* @method setPollingInterval
|
||||
* @public
|
||||
* @static
|
||||
* @param {int} i The polling interval in milliseconds.
|
||||
* @return void
|
||||
*/
|
||||
setPollingInterval:function(i)
|
||||
{
|
||||
if(typeof i == 'number' && isFinite(i)){
|
||||
this._polling_interval = i;
|
||||
YAHOO.log('Default polling interval set to ' + i, 'info', 'Connection');
|
||||
this._polling_interval = i;
|
||||
YAHOO.log('Default polling interval set to ' + i +'ms', 'info', 'Connection');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Instantiates a XMLHttpRequest object and returns an object with two properties:
|
||||
* @description Instantiates a XMLHttpRequest object and returns an object with two properties:
|
||||
* the XMLHttpRequest instance and the transaction id.
|
||||
* @method createXhrObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {int} transactionId Property containing the transaction id for this transaction.
|
||||
* @return connection object
|
||||
* @return object
|
||||
*/
|
||||
createXhrObject:function(transactionId)
|
||||
{
|
||||
|
@ -166,7 +215,7 @@ YAHOO.util.Connect =
|
|||
http = new XMLHttpRequest();
|
||||
// Object literal with http and tId properties
|
||||
obj = { conn:http, tId:transactionId };
|
||||
YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');
|
||||
YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
|
@ -175,9 +224,9 @@ YAHOO.util.Connect =
|
|||
{
|
||||
// Instantiates XMLHttpRequest for IE and assign to http.
|
||||
http = new ActiveXObject(this._msxml_progid[i]);
|
||||
// Object literal with http and tId properties
|
||||
// Object literal with conn and tId properties
|
||||
obj = { conn:http, tId:transactionId };
|
||||
YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
|
||||
YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
|
||||
break;
|
||||
}
|
||||
catch(e){}
|
||||
|
@ -190,11 +239,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* This method is called by asyncRequest to create a
|
||||
* @description This method is called by asyncRequest to create a
|
||||
* valid connection object for the transaction. It also passes a
|
||||
* transaction id and increments the transaction id counter.
|
||||
* @method getConnectionObject
|
||||
* @private
|
||||
* @return object
|
||||
* @static
|
||||
* @return {object}
|
||||
*/
|
||||
getConnectionObject:function()
|
||||
{
|
||||
|
@ -216,11 +267,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Method for initiating an asynchronous request via the XHR object.
|
||||
* @description Method for initiating an asynchronous request via the XHR object.
|
||||
* @method asyncRequest
|
||||
* @public
|
||||
* @static
|
||||
* @param {string} method HTTP transaction method
|
||||
* @param {string} uri Fully qualified path of resource
|
||||
* @param callback User-defined callback function or object
|
||||
* @param {callback} callback User-defined callback function or object
|
||||
* @param {string} postData POST body
|
||||
* @return {object} Returns the connection object
|
||||
*/
|
||||
|
@ -235,8 +288,9 @@ YAHOO.util.Connect =
|
|||
else{
|
||||
if(this._isFormSubmit){
|
||||
if(this._isFileUpload){
|
||||
this.uploadFile(o.tId, callback, uri);
|
||||
this.uploadFile(o.tId, callback, uri, postData);
|
||||
this.releaseObject(o);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -244,101 +298,97 @@ YAHOO.util.Connect =
|
|||
//encoded string that is concatenated to the uri to
|
||||
//create a querystring.
|
||||
if(method == 'GET'){
|
||||
uri += "?" + this._sFormData;
|
||||
if(this._sFormData.length != 0){
|
||||
// If the URI already contains a querystring, append an ampersand
|
||||
// and then concatenate _sFormData to the URI.
|
||||
uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
|
||||
}
|
||||
else{
|
||||
uri += "?" + this._sFormData;
|
||||
}
|
||||
}
|
||||
else if(method == 'POST'){
|
||||
postData = this._sFormData;
|
||||
//If POST data exist in addition to the HTML form data,
|
||||
//it will be concatenated to the form data.
|
||||
postData = postData?this._sFormData + "&" + postData:this._sFormData;
|
||||
}
|
||||
this._sFormData = '';
|
||||
}
|
||||
|
||||
o.conn.open(method, uri, true);
|
||||
|
||||
if(this._isFormSubmit || (postData && this._default_post_header)){
|
||||
this.initHeader('Content-Type','application/x-www-form-urlencoded');
|
||||
if(this._isFormSubmit || (postData && this._use_default_post_header)){
|
||||
this.initHeader('Content-Type', this._default_post_header);
|
||||
YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');
|
||||
if(this._isFormSubmit){
|
||||
this._isFormSubmit = false;
|
||||
}
|
||||
}
|
||||
else if(this._isFormSubmit){
|
||||
this.resetFormState();
|
||||
}
|
||||
|
||||
//Verify whether the transaction has any user-defined HTTP headers
|
||||
//and set them.
|
||||
if(this._has_http_headers){
|
||||
this.setHeader(o);
|
||||
}
|
||||
|
||||
this.handleReadyState(o, callback);
|
||||
postData?o.conn.send(postData):o.conn.send(null);
|
||||
o.conn.send(postData || null);
|
||||
|
||||
return o;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* This method serves as a timer that polls the XHR object's readyState
|
||||
* @description This method serves as a timer that polls the XHR object's readyState
|
||||
* property during a transaction, instead of binding a callback to the
|
||||
* onreadystatechange event. Upon readyState 4, handleTransactionResponse
|
||||
* will process the response, and the timer will be cleared.
|
||||
*
|
||||
* @method handleReadyState
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param callback User-defined callback object
|
||||
* @return void
|
||||
* @param {callback} callback The user-defined callback object
|
||||
* @return {void}
|
||||
*/
|
||||
handleReadyState:function(o, callback)
|
||||
{
|
||||
var timeOut = callback.timeout;
|
||||
var oConn = this;
|
||||
var oConn = this;
|
||||
|
||||
try
|
||||
{
|
||||
if(timeOut !== undefined){
|
||||
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
|
||||
}
|
||||
this._poll[o.tId] = window.setInterval(
|
||||
function(){
|
||||
if(o.conn && o.conn.readyState == 4){
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
oConn._poll.splice(o.tId);
|
||||
if(timeOut){
|
||||
oConn._timeOut.splice(o.tId);
|
||||
}
|
||||
if(callback && callback.timeout){
|
||||
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
}
|
||||
,this._polling_interval);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
oConn._poll.splice(o.tId);
|
||||
if(timeOut){
|
||||
oConn._timeOut.splice(o.tId);
|
||||
this._poll[o.tId] = window.setInterval(
|
||||
function(){
|
||||
if(o.conn && o.conn.readyState == 4){
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
delete oConn._poll[o.tId];
|
||||
|
||||
if(callback && callback.timeout){
|
||||
delete oConn._timeOut[o.tId];
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
,this._polling_interval);
|
||||
},
|
||||
|
||||
/**
|
||||
* This method attempts to interpret the server response and
|
||||
* @description This method attempts to interpret the server response and
|
||||
* determine whether the transaction was successful, or if an error or
|
||||
* exception was encountered.
|
||||
*
|
||||
* @method handleTransactionResponse
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param {object} callback - User-defined callback object
|
||||
* @param {boolean} determines if the transaction was aborted.
|
||||
* @return void
|
||||
* @param {object} callback The sser-defined callback object
|
||||
* @param {boolean} isAbort Determines if the transaction was aborted.
|
||||
* @return {void}
|
||||
*/
|
||||
handleTransactionResponse:function(o, callback, isAbort)
|
||||
{
|
||||
// If no valid callback is provided, then do not process any callback handling.
|
||||
if(!callback){
|
||||
this.releaseObject(o);
|
||||
YAHOO.log('No callback object to process. Transaction complete.', 'warn', 'Connection');
|
||||
YAHOO.log('No callback object to process. Transaction complete.', 'warn', 'Connection');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -377,25 +427,21 @@ YAHOO.util.Connect =
|
|||
}
|
||||
else{
|
||||
switch(httpStatus){
|
||||
// The following case labels are wininet.dll error codes that may be encountered.
|
||||
// Server timeout
|
||||
case 12002:
|
||||
// 12029 to 12031 correspond to dropped connections.
|
||||
case 12029:
|
||||
// The following cases are wininet.dll error codes that may be encountered.
|
||||
case 12002: // Server timeout
|
||||
case 12029: // 12029 to 12031 correspond to dropped connections.
|
||||
case 12030:
|
||||
case 12031:
|
||||
// Connection closed by server.
|
||||
case 12152:
|
||||
// See above comments for variable status.
|
||||
case 13030:
|
||||
responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
|
||||
case 12152: // Connection closed by server.
|
||||
case 13030: // See above comments for variable status.
|
||||
responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
|
||||
if(callback.failure){
|
||||
if(!callback.scope){
|
||||
callback.failure(responseObject);
|
||||
YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope,[responseObject]);
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
YAHOO.log('Failure callback with scope. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +454,7 @@ YAHOO.util.Connect =
|
|||
YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope,[responseObject]);
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
YAHOO.log('Failure callback with scope. HTTP status code is ' + httpStatus, 'warn', 'Connection');
|
||||
}
|
||||
}
|
||||
|
@ -416,16 +462,19 @@ YAHOO.util.Connect =
|
|||
}
|
||||
|
||||
this.releaseObject(o);
|
||||
responseObject = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* This method evaluates the server response, creates and returns the results via
|
||||
* @description This method evaluates the server response, creates and returns the results via
|
||||
* its properties. Success and failure cases will differ in the response
|
||||
* object's property values.
|
||||
* @method createResponseObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param {} callbackArg User-defined argument or arguments to be passed to the callback
|
||||
* @return object
|
||||
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
|
||||
* @return {object}
|
||||
*/
|
||||
createResponseObject:function(o, callbackArg)
|
||||
{
|
||||
|
@ -436,10 +485,10 @@ YAHOO.util.Connect =
|
|||
{
|
||||
var headerStr = o.conn.getAllResponseHeaders();
|
||||
var header = headerStr.split('\n');
|
||||
for(var i=0; i < header.length; i++){
|
||||
for(var i=0; i<header.length; i++){
|
||||
var delimitPos = header[i].indexOf(':');
|
||||
if(delimitPos != -1){
|
||||
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+1);
|
||||
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -461,18 +510,20 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* If a transaction cannot be completed due to dropped or closed connections,
|
||||
* @description If a transaction cannot be completed due to dropped or closed connections,
|
||||
* there may be not be enough information to build a full response object.
|
||||
* The failure callback will be fired and this specific condition can be identified
|
||||
* by a status property value of 0.
|
||||
*
|
||||
* If an abort was successful, the status property will report a value of -1.
|
||||
*
|
||||
* @method createExceptionObject
|
||||
* @private
|
||||
* @param {int} tId Transaction Id
|
||||
* @param callbackArg The user-defined arguments
|
||||
* @param isAbort Determines if the exception is an abort.
|
||||
* @return object
|
||||
* @static
|
||||
* @param {int} tId The Transaction Id
|
||||
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
|
||||
* @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
|
||||
* @return {object}
|
||||
*/
|
||||
createExceptionObject:function(tId, callbackArg, isAbort)
|
||||
{
|
||||
|
@ -501,11 +552,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Public method that stores the custom HTTP headers for each transaction.
|
||||
* @description Public method that stores the custom HTTP headers for each transaction.
|
||||
* @method initHeader
|
||||
* @public
|
||||
* @static
|
||||
* @param {string} label The HTTP header label
|
||||
* @param {string} value The HTTP header value
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
initHeader:function(label,value)
|
||||
{
|
||||
|
@ -513,6 +566,8 @@ YAHOO.util.Connect =
|
|||
this._http_header[label] = value;
|
||||
}
|
||||
else{
|
||||
// Concatenate multiple values, comma-delimited,
|
||||
// for the same header label,
|
||||
this._http_header[label] = value + "," + this._http_header[label];
|
||||
}
|
||||
|
||||
|
@ -520,15 +575,17 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Accessor that sets the HTTP headers for each transaction.
|
||||
* @description Accessor that sets the HTTP headers for each transaction.
|
||||
* @method setHeader
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object for the transaction.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
setHeader:function(o)
|
||||
{
|
||||
for(var prop in this._http_header){
|
||||
if(this._http_header.propertyIsEnumerable){
|
||||
if(this._http_header.hasOwnProperty(prop)){
|
||||
o.conn.setRequestHeader(prop, this._http_header[prop]);
|
||||
YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_header[prop], 'info', 'Connection');
|
||||
}
|
||||
|
@ -540,20 +597,21 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* This method assembles the form label and value pairs and
|
||||
* @description This method assembles the form label and value pairs and
|
||||
* constructs an encoded string.
|
||||
* asyncRequest() will automatically initialize the
|
||||
* transaction with a HTTP header Content-Type of
|
||||
* application/x-www-form-urlencoded.
|
||||
* @method setForm
|
||||
* @public
|
||||
* @static
|
||||
* @param {string || object} form id or name attribute, or form object.
|
||||
* @param {string} optional boolean to indicate SSL environment.
|
||||
* @param {string} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return void
|
||||
* @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return {string} string of the HTML form field name and value pairs..
|
||||
*/
|
||||
setForm:function(formId, isUpload, secureUri)
|
||||
{
|
||||
this._sFormData = '';
|
||||
if(typeof formId == 'string'){
|
||||
// Determine if the argument is a form id or a form name.
|
||||
// Note form name usage is deprecated by supported
|
||||
|
@ -561,6 +619,7 @@ YAHOO.util.Connect =
|
|||
var oForm = (document.getElementById(formId) || document.forms[formId]);
|
||||
}
|
||||
else if(typeof formId == 'object'){
|
||||
// Treat argument as an HTML form object.
|
||||
var oForm = formId;
|
||||
}
|
||||
else{
|
||||
|
@ -575,7 +634,11 @@ YAHOO.util.Connect =
|
|||
// where the secureURI string is a fully qualified HTTP path, used to set the source
|
||||
// of the iframe, to a stub resource in the same domain.
|
||||
if(isUpload){
|
||||
(typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
|
||||
|
||||
// Create iframe in preparation for file upload.
|
||||
this.createFrame(secureUri?secureUri:null);
|
||||
|
||||
// Set form reference and file upload properties to true.
|
||||
this._isFormSubmit = true;
|
||||
this._isFileUpload = true;
|
||||
this._formNode = oForm;
|
||||
|
@ -589,17 +652,14 @@ YAHOO.util.Connect =
|
|||
// Iterate over the form elements collection to construct the
|
||||
// label-value pairs.
|
||||
for (var i=0; i<oForm.elements.length; i++){
|
||||
oDisabled = oForm.elements[i].disabled;
|
||||
|
||||
// If the name attribute is not populated, the form field's
|
||||
// value will not be submitted.
|
||||
oElement = oForm.elements[i];
|
||||
oDisabled = oForm.elements[i].disabled;
|
||||
oName = oForm.elements[i].name;
|
||||
oValue = oForm.elements[i].value;
|
||||
|
||||
// Do not submit fields that are disabled or
|
||||
// do not have a name attribute value.
|
||||
if(!oDisabled && oName !== undefined)
|
||||
if(!oDisabled && oName)
|
||||
{
|
||||
switch (oElement.type)
|
||||
{
|
||||
|
@ -607,7 +667,13 @@ YAHOO.util.Connect =
|
|||
case 'select-multiple':
|
||||
for(var j=0; j<oElement.options.length; j++){
|
||||
if(oElement.options[j].selected){
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].value || oElement.options[j].text) + '&';
|
||||
if(window.ActiveXObject){
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
|
||||
}
|
||||
else{
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -642,33 +708,61 @@ YAHOO.util.Connect =
|
|||
this._isFormSubmit = true;
|
||||
this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
|
||||
|
||||
YAHOO.log('Form initialized for transaction. POST message is: ' + this._sFormData, 'info', 'Connection');
|
||||
YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');
|
||||
|
||||
return this._sFormData;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates an iframe to be used for form file uploads. It is remove from the
|
||||
* document upon completion of the upload transaction.
|
||||
*
|
||||
* @description Resets HTML form properties when an HTML form or HTML form
|
||||
* with file upload transaction is sent.
|
||||
* @method resetFormState
|
||||
* @private
|
||||
* @static
|
||||
* @param {boolean} isUpload Indicates if file upload properties should be reset.
|
||||
* @return {void}
|
||||
*/
|
||||
resetFormState:function(isUpload){
|
||||
this._isFormSubmit = false;
|
||||
this._sFormData = null;
|
||||
if(isUpload){
|
||||
this._isFileUpload = false;
|
||||
this._formNode = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @description Creates an iframe to be used for form file uploads. It is remove from the
|
||||
* document upon completion of the upload transaction.
|
||||
* @method createFrame
|
||||
* @private
|
||||
* @static
|
||||
* @param {string} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
createFrame:function(secureUri){
|
||||
|
||||
// IE does not allow the setting of id and name attributes as DOM
|
||||
// properties. A different iframe creation pattern is required for IE.
|
||||
// IE does not allow the setting of id and name attributes as object
|
||||
// properties via createElement(). A different iframe creation
|
||||
// pattern is required for IE.
|
||||
var frameId = 'yuiIO' + this._transaction_id;
|
||||
if(window.ActiveXObject){
|
||||
var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
|
||||
if(secureUri){
|
||||
// IE will throw a security exception in an SSL environment if the
|
||||
// iframe source isn't set to a valid resource.
|
||||
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
|
||||
|
||||
// IE will throw a security exception in an SSL environment if the
|
||||
// iframe source is undefined.
|
||||
if(typeof secureUri == 'boolean'){
|
||||
io.src = 'javascript:false';
|
||||
}
|
||||
else if(typeof secureURI == 'string'){
|
||||
// Deprecated
|
||||
io.src = secureUri;
|
||||
}
|
||||
}
|
||||
else{
|
||||
var io = document.createElement('IFRAME');
|
||||
io.id = 'ioFrame';
|
||||
io.name = 'ioFrame';
|
||||
var io = document.createElement('iframe');
|
||||
io.id = frameId;
|
||||
io.name = frameId;
|
||||
}
|
||||
|
||||
io.style.position = 'absolute';
|
||||
|
@ -676,31 +770,84 @@ YAHOO.util.Connect =
|
|||
io.style.left = '-1000px';
|
||||
|
||||
document.body.appendChild(io);
|
||||
YAHOO.log('File upload iframe created. Id is:' + frameId, 'info', 'Connection');
|
||||
},
|
||||
|
||||
/**
|
||||
* Uploads HTML form, including files/attachments, targeting the
|
||||
* iframe created in createFrame.
|
||||
*
|
||||
* @description Parses the POST data and creates hidden form elements
|
||||
* for each key-value, and appends them to the HTML form object.
|
||||
* @method appendPostData
|
||||
* @private
|
||||
* @static
|
||||
* @param {string} postData The HTTP POST data
|
||||
* @return {array} formElements Collection of hidden fields.
|
||||
*/
|
||||
appendPostData:function(postData)
|
||||
{
|
||||
var formElements = new Array();
|
||||
var postMessage = postData.split('&');
|
||||
for(var i=0; i < postMessage.length; i++){
|
||||
var delimitPos = postMessage[i].indexOf('=');
|
||||
if(delimitPos != -1){
|
||||
formElements[i] = document.createElement('input');
|
||||
formElements[i].type = 'hidden';
|
||||
formElements[i].name = postMessage[i].substring(0,delimitPos);
|
||||
formElements[i].value = postMessage[i].substring(delimitPos+1);
|
||||
this._formNode.appendChild(formElements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return formElements;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description Uploads HTML form, including files/attachments, to the
|
||||
* iframe created in createFrame.
|
||||
* @method uploadFile
|
||||
* @private
|
||||
* @static
|
||||
* @param {int} id The transaction id.
|
||||
* @param {object} callback - User-defined callback object.
|
||||
* @param {string} uri Fully qualified path of resource.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
uploadFile:function(id, callback, uri){
|
||||
uploadFile:function(id, callback, uri, postData){
|
||||
|
||||
// Each iframe has an id prefix of "yuiIO" followed
|
||||
// by the unique transaction id.
|
||||
var frameId = 'yuiIO' + id;
|
||||
var io = document.getElementById(frameId);
|
||||
|
||||
// Initialize the HTML form properties in case they are
|
||||
// not defined in the HTML form.
|
||||
this._formNode.action = uri;
|
||||
this._formNode.enctype = 'multipart/form-data';
|
||||
this._formNode.method = 'POST';
|
||||
this._formNode.target = 'ioFrame';
|
||||
this._formNode.target = frameId;
|
||||
|
||||
if(this._formNode.encoding){
|
||||
// IE does not respect property enctype for HTML forms.
|
||||
// Instead use property encoding.
|
||||
this._formNode.encoding = 'multipart/form-data';
|
||||
}
|
||||
else{
|
||||
this._formNode.enctype = 'multipart/form-data';
|
||||
}
|
||||
|
||||
|
||||
if(postData){
|
||||
var oElements = this.appendPostData(postData);
|
||||
}
|
||||
|
||||
this._formNode.submit();
|
||||
|
||||
// Reset form status properties.
|
||||
this._formNode = null;
|
||||
this._isFileUpload = false;
|
||||
this._isFormSubmit = false;
|
||||
if(oElements && oElements.length > 0){
|
||||
for(var i=0; i < oElements.length; i++){
|
||||
this._formNode.removeChild(oElements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset HTML form status properties.
|
||||
this.resetFormState();
|
||||
|
||||
// Create the upload callback handler that fires when the iframe
|
||||
// receives the load event. Subsequently, the event handler is detached
|
||||
|
@ -708,48 +855,76 @@ YAHOO.util.Connect =
|
|||
|
||||
var uploadCallback = function()
|
||||
{
|
||||
var oResponse =
|
||||
var obj = {};
|
||||
obj.tId = id;
|
||||
obj.argument = callback.argument;
|
||||
|
||||
try
|
||||
{
|
||||
tId: id,
|
||||
responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
|
||||
argument: callback.argument
|
||||
obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
|
||||
obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
if(callback.upload){
|
||||
if(!callback.scope){
|
||||
callback.upload(obj);
|
||||
YAHOO.log('Upload callback.', 'info', 'Connection');
|
||||
}
|
||||
else{
|
||||
callback.upload.apply(callback.scope, [obj]);
|
||||
YAHOO.log('Upload callback with scope.', 'info', 'Connection');
|
||||
}
|
||||
}
|
||||
|
||||
if(callback.upload && !callback.scope){
|
||||
callback.upload(oResponse);
|
||||
YAHOO.log('Upload callback.', 'info', 'Connection');
|
||||
if(YAHOO.util.Event){
|
||||
YAHOO.util.Event.removeListener(io, "load", uploadCallback);
|
||||
}
|
||||
else if(window.detachEvent){
|
||||
io.detachEvent('onload', uploadCallback);
|
||||
}
|
||||
else{
|
||||
callback.upload.apply(callback.scope, [oResponse]);
|
||||
YAHOO.log('Upload callback with object scope.', 'info', 'Connection');
|
||||
io.removeEventListener('load', uploadCallback, false);
|
||||
}
|
||||
|
||||
YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
|
||||
window.ioFrame.location.replace('#');
|
||||
setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
|
||||
setTimeout(
|
||||
function(){
|
||||
document.body.removeChild(io);
|
||||
YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
|
||||
}, 100);
|
||||
};
|
||||
|
||||
|
||||
// Bind the onload handler to the iframe to detect the file upload response.
|
||||
YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
|
||||
if(YAHOO.util.Event){
|
||||
YAHOO.util.Event.addListener(io, "load", uploadCallback);
|
||||
}
|
||||
else if(window.attachEvent){
|
||||
io.attachEvent('onload', uploadCallback);
|
||||
}
|
||||
else{
|
||||
io.addEventListener('load', uploadCallback, false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Public method to terminate a transaction, if it has not reached readyState 4.
|
||||
* @description Method to terminate a transaction, if it has not reached readyState 4.
|
||||
* @method abort
|
||||
* @public
|
||||
* @static
|
||||
* @param {object} o The connection object returned by asyncRequest.
|
||||
* @param {object} callback User-defined callback object.
|
||||
* @param {string} isTimeout boolean to indicate if abort was a timeout.
|
||||
* @return void
|
||||
* @return {boolean}
|
||||
*/
|
||||
abort:function(o, callback, isTimeout)
|
||||
{
|
||||
if(this.isCallInProgress(o)){
|
||||
window.clearInterval(this._poll[o.tId]);
|
||||
this._poll.splice(o.tId);
|
||||
if(isTimeout){
|
||||
this._timeOut.splice(o.tId);
|
||||
}
|
||||
o.conn.abort();
|
||||
window.clearInterval(this._poll[o.tId]);
|
||||
delete this._poll[o.tId];
|
||||
if(isTimeout){
|
||||
delete this._timeOut[o.tId];
|
||||
}
|
||||
|
||||
this.handleTransactionResponse(o, callback, true);
|
||||
YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
|
||||
|
@ -757,17 +932,19 @@ YAHOO.util.Connect =
|
|||
return true;
|
||||
}
|
||||
else{
|
||||
YAHOO.log('Transaction ' + o.tId + ' abort failed.', 'warn', 'Connection');
|
||||
|
||||
YAHOO.log('Transaction ' + o.tId + ' abort call failed.', 'warn', 'Connection');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Public method to check if the transaction is still being processed.
|
||||
*
|
||||
* @method isCallInProgress
|
||||
* @public
|
||||
* @static
|
||||
* @param {object} o The connection object returned by asyncRequest
|
||||
* @return boolean
|
||||
* @return {boolean}
|
||||
*/
|
||||
isCallInProgress:function(o)
|
||||
{
|
||||
|
@ -783,18 +960,18 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Dereference the XHR instance and the connection object after the transaction is completed.
|
||||
* @description Dereference the XHR instance and the connection object after the transaction is completed.
|
||||
* @method releaseObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
releaseObject:function(o)
|
||||
{
|
||||
//dereference the XHR instance.
|
||||
o.conn = null;
|
||||
|
||||
YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
|
||||
|
||||
//dereference the connection object.
|
||||
o = null;
|
||||
}
|
||||
|
|
92
lib/yui/connection/connection-min.js
vendored
92
lib/yui/connection/connection-min.js
vendored
|
@ -1,12 +1,7 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_default_post_header:true,_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:[],_timeOut:[],_polling_interval:50,_transaction_id:0,setProgId:function(id)
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)
|
||||
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
|
||||
{this._default_post_header=b;},setPollingInterval:function(i)
|
||||
{this._use_default_post_header=b;},setPollingInterval:function(i)
|
||||
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
|
||||
{var obj,http;try
|
||||
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
|
||||
|
@ -22,34 +17,34 @@ catch(e){}
|
|||
finally
|
||||
{return o;}},asyncRequest:function(method,uri,callback,postData)
|
||||
{var o=this.getConnectionObject();if(!o){return null;}
|
||||
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri);this.releaseObject(o);return;}
|
||||
if(method=='GET'){uri+="?"+this._sFormData;}
|
||||
else if(method=='POST'){postData=this._sFormData;}
|
||||
this._sFormData='';}
|
||||
o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._default_post_header)){this.initHeader('Content-Type','application/x-www-form-urlencoded');if(this._isFormSubmit){this._isFormSubmit=false;}}
|
||||
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri,postData);this.releaseObject(o);return;}
|
||||
if(method=='GET'){if(this._sFormData.length!=0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
|
||||
else{uri+="?"+this._sFormData;}}
|
||||
else if(method=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
|
||||
o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
|
||||
if(this._has_http_headers){this.setHeader(o);}
|
||||
this.handleReadyState(o,callback);postData?o.conn.send(postData):o.conn.send(null);return o;}},handleReadyState:function(o,callback)
|
||||
{var timeOut=callback.timeout;var oConn=this;try
|
||||
{if(timeOut!==undefined){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true)},timeOut);}
|
||||
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
|
||||
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);}
|
||||
catch(e)
|
||||
{window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
|
||||
oConn.handleTransactionResponse(o,callback);}},handleTransactionResponse:function(o,callback,isAbort)
|
||||
this.handleReadyState(o,callback);o.conn.send(postData||null);return o;}},handleReadyState:function(o,callback)
|
||||
{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
|
||||
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){delete oConn._timeOut[o.tId];}
|
||||
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
|
||||
{if(!callback){this.releaseObject(o);return;}
|
||||
var httpStatus,responseObject;try
|
||||
{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
|
||||
else{httpStatus=13030;}}
|
||||
catch(e){httpStatus=13030;}
|
||||
if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
|
||||
if(httpStatus>=200&&httpStatus<300){try
|
||||
{responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
|
||||
else{callback.success.apply(callback.scope,[responseObject]);}}}
|
||||
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,isAbort);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
|
||||
catch(e){}}
|
||||
else{try
|
||||
{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
|
||||
else{callback.failure.apply(callback.scope,[responseObject]);}}
|
||||
break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
|
||||
else{callback.failure.apply(callback.scope,[responseObject]);}}}}
|
||||
this.releaseObject(o);},createResponseObject:function(o,callbackArg)
|
||||
catch(e){}}
|
||||
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
|
||||
{var obj={};var headerObj={};try
|
||||
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+1);}}}
|
||||
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
|
||||
catch(e){}
|
||||
obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
|
||||
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
|
||||
|
@ -60,27 +55,44 @@ return obj;},initHeader:function(label,value)
|
|||
{if(this._http_header[label]===undefined){this._http_header[label]=value;}
|
||||
else{this._http_header[label]=value+","+this._http_header[label];}
|
||||
this._has_http_headers=true;},setHeader:function(o)
|
||||
{for(var prop in this._http_header){if(this._http_header.propertyIsEnumerable){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
|
||||
{for(var prop in this._http_header){if(this._http_header.hasOwnProperty(prop)){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
|
||||
delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)
|
||||
{this._sFormData='';if(typeof formId=='string'){var oForm=(document.getElementById(formId)||document.forms[formId]);}
|
||||
else if(typeof formId=='object'){var oForm=formId;}
|
||||
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
|
||||
else if(typeof formId=='object'){oForm=formId;}
|
||||
else{return;}
|
||||
if(isUpload){(typeof secureUri=='string')?this.createFrame(secureUri):this.createFrame();this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
|
||||
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
|
||||
if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
|
||||
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
|
||||
{switch(oElement.type)
|
||||
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';}}
|
||||
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
|
||||
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
|
||||
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
|
||||
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}
|
||||
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}
|
||||
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);},createFrame:function(secureUri){if(window.ActiveXObject){var io=document.createElement('<IFRAME name="ioFrame" id="ioFrame">');if(secureUri){io.src=secureUri;}}
|
||||
else{var io=document.createElement('IFRAME');io.id='ioFrame';io.name='ioFrame';}
|
||||
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},uploadFile:function(id,callback,uri){this._formNode.action=uri;this._formNode.enctype='multipart/form-data';this._formNode.method='POST';this._formNode.target='ioFrame';this._formNode.submit();this._formNode=null;this._isFileUpload=false;this._isFormSubmit=false;var uploadCallback=function()
|
||||
{var oResponse={tId:id,responseText:document.getElementById("ioFrame").contentWindow.document.body.innerHTML,argument:callback.argument}
|
||||
if(callback.upload&&!callback.scope){callback.upload(oResponse);}
|
||||
else{callback.upload.apply(callback.scope,[oResponse]);}
|
||||
YAHOO.util.Event.removeListener("ioFrame","load",uploadCallback);window.ioFrame.location.replace('#');setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);};YAHOO.util.Event.addListener("ioFrame","load",uploadCallback);},abort:function(o,callback,isTimeout)
|
||||
{if(this.isCallInProgress(o)){window.clearInterval(this._poll[o.tId]);this._poll.splice(o.tId);if(isTimeout){this._timeOut.splice(o.tId);}
|
||||
o.conn.abort();this.handleTransactionResponse(o,callback,true);return true;}
|
||||
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
|
||||
else if(typeof secureURI=='string'){io.src=secureUri;}}
|
||||
else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
|
||||
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
|
||||
{var formElements=new Array();var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
|
||||
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding='multipart/form-data';}
|
||||
else{this._formNode.enctype='multipart/form-data';}
|
||||
if(postData){var oElements=this.appendPostData(postData);}
|
||||
this._formNode.submit();if(oElements&&oElements.length>0){try
|
||||
{for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
|
||||
catch(e){}}
|
||||
this.resetFormState();var uploadCallback=function()
|
||||
{var obj={};obj.tId=id;obj.argument=callback.argument;try
|
||||
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
|
||||
catch(e){}
|
||||
if(callback.upload){if(!callback.scope){callback.upload(obj);}
|
||||
else{callback.upload.apply(callback.scope,[obj]);}}
|
||||
if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
|
||||
else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
|
||||
else{io.removeEventListener('load',uploadCallback,false);}
|
||||
setTimeout(function(){document.body.removeChild(io);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
|
||||
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
|
||||
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
|
||||
{if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){delete this._timeOut[o.tId];}
|
||||
this.handleTransactionResponse(o,callback,true);return true;}
|
||||
else{return false;}},isCallInProgress:function(o)
|
||||
{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
|
||||
else{return false;}},releaseObject:function(o)
|
||||
|
|
585
lib/yui/connection/connection.js
vendored
585
lib/yui/connection/connection.js
vendored
|
@ -2,121 +2,163 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description
|
||||
* The Connection Manager provides a simplified interface to the XMLHttpRequest
|
||||
* object. It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
|
||||
* interactive states and server response, returning the results to a pre-defined
|
||||
* callback you create.
|
||||
* @ class
|
||||
*
|
||||
* @namespace YAHOO.util
|
||||
* @module Connection
|
||||
* @Class Connect
|
||||
*/
|
||||
YAHOO.util.Connect =
|
||||
{
|
||||
/**
|
||||
* Array of MSFT ActiveX ids for XMLHttpRequest.
|
||||
/**
|
||||
* @description Array of MSFT ActiveX ids for XMLHttpRequest.
|
||||
* @property _msxml_progid
|
||||
* @private
|
||||
* @static
|
||||
* @type array
|
||||
*/
|
||||
_msxml_progid:[
|
||||
'MSXML2.XMLHTTP.3.0',
|
||||
'MSXML2.XMLHTTP',
|
||||
'Microsoft.XMLHTTP'
|
||||
],
|
||||
'MSXML2.XMLHTTP.3.0',
|
||||
'MSXML2.XMLHTTP',
|
||||
'Microsoft.XMLHTTP'
|
||||
],
|
||||
|
||||
/**
|
||||
* Object literal of HTTP header(s)
|
||||
* @description Object literal of HTTP header(s)
|
||||
* @property _http_header
|
||||
* @private
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_http_header:{},
|
||||
|
||||
/**
|
||||
* Determines if HTTP headers are set.
|
||||
* @description Determines if HTTP headers are set.
|
||||
* @property _has_http_headers
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_has_http_headers:false,
|
||||
|
||||
/**
|
||||
* Determines if a default header of
|
||||
* @description Determines if a default header of
|
||||
* Content-Type of 'application/x-www-form-urlencoded'
|
||||
* will be added to any client HTTP headers sent for POST
|
||||
* transactions.
|
||||
* @property _use_default_post_header
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_default_post_header:true,
|
||||
_use_default_post_header:true,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to determine if the data
|
||||
* should be submitted as an HTML form.
|
||||
* @description Determines if a default header of
|
||||
* Content-Type of 'application/x-www-form-urlencoded'
|
||||
* will be added to any client HTTP headers sent for POST
|
||||
* transactions.
|
||||
* @property _default_post_header
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_default_post_header:'application/x-www-form-urlencoded',
|
||||
|
||||
/**
|
||||
* @description Property modified by setForm() to determine if the data
|
||||
* should be submitted as an HTML form.
|
||||
* @property _isFormSubmit
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_isFormSubmit:false,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to determine if a file(s)
|
||||
* @description Property modified by setForm() to determine if a file(s)
|
||||
* upload is expected.
|
||||
* @property _isFileUpload
|
||||
* @private
|
||||
* @static
|
||||
* @type boolean
|
||||
*/
|
||||
_isFileUpload:false,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to set a reference to the HTML
|
||||
* @description Property modified by setForm() to set a reference to the HTML
|
||||
* form node if the desired action is file upload.
|
||||
* @property _formNode
|
||||
* @private
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_formNode:null,
|
||||
|
||||
/**
|
||||
* Property modified by setForm() to set the HTML form data
|
||||
* @description Property modified by setForm() to set the HTML form data
|
||||
* for each transaction.
|
||||
* @property _sFormData
|
||||
* @private
|
||||
* @static
|
||||
* @type string
|
||||
*/
|
||||
_sFormData:null,
|
||||
|
||||
/**
|
||||
* Collection of polling references to the polling mechanism in handleReadyState.
|
||||
* @description Collection of polling references to the polling mechanism in handleReadyState.
|
||||
* @property _poll
|
||||
* @private
|
||||
* @type string
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_poll:[],
|
||||
_poll:{},
|
||||
|
||||
/**
|
||||
* Queue of timeout values for each transaction callback with a defined timeout value.
|
||||
* @description Queue of timeout values for each transaction callback with a defined timeout value.
|
||||
* @property _timeOut
|
||||
* @private
|
||||
* @type string
|
||||
* @static
|
||||
* @type object
|
||||
*/
|
||||
_timeOut:[],
|
||||
_timeOut:{},
|
||||
|
||||
/**
|
||||
* The polling frequency, in milliseconds, for HandleReadyState.
|
||||
* @description The polling frequency, in milliseconds, for HandleReadyState.
|
||||
* when attempting to determine a transaction's XHR readyState.
|
||||
* The default is 50 milliseconds.
|
||||
* @property _polling_interval
|
||||
* @private
|
||||
* @static
|
||||
* @type int
|
||||
*/
|
||||
_polling_interval:50,
|
||||
|
||||
/**
|
||||
* A transaction counter that increments the transaction id for each transaction.
|
||||
* @description A transaction counter that increments the transaction id for each transaction.
|
||||
* @property _transaction_id
|
||||
* @private
|
||||
* @static
|
||||
* @type int
|
||||
*/
|
||||
_transaction_id:0,
|
||||
|
||||
/**
|
||||
* Member to add an ActiveX id to the existing xml_progid array.
|
||||
* @description Member to add an ActiveX id to the existing xml_progid array.
|
||||
* In the event(unlikely) a new ActiveX id is introduced, it can be added
|
||||
* without internal code modifications.
|
||||
* @method setProgId
|
||||
* @public
|
||||
* @param string id The ActiveX id to be added to initialize the XHR object.
|
||||
* @static
|
||||
* @param {string} id The ActiveX id to be added to initialize the XHR object.
|
||||
* @return void
|
||||
*/
|
||||
setProgId:function(id)
|
||||
|
@ -125,35 +167,41 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Member to enable or disable the default POST header.
|
||||
* @description Member to enable or disable the default POST header.
|
||||
* @method setDefaultPostHeader
|
||||
* @public
|
||||
* @param boolean b Set and use default header - true or false .
|
||||
* @static
|
||||
* @param {boolean} b Set and use default header - true or false .
|
||||
* @return void
|
||||
*/
|
||||
setDefaultPostHeader:function(b)
|
||||
{
|
||||
this._default_post_header = b;
|
||||
this._use_default_post_header = b;
|
||||
},
|
||||
|
||||
/**
|
||||
* Member to modify the default polling interval.
|
||||
* @description Member to modify the default polling interval.
|
||||
* @method setPollingInterval
|
||||
* @public
|
||||
* @static
|
||||
* @param {int} i The polling interval in milliseconds.
|
||||
* @return void
|
||||
*/
|
||||
setPollingInterval:function(i)
|
||||
{
|
||||
if(typeof i == 'number' && isFinite(i)){
|
||||
this._polling_interval = i;
|
||||
this._polling_interval = i;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Instantiates a XMLHttpRequest object and returns an object with two properties:
|
||||
* @description Instantiates a XMLHttpRequest object and returns an object with two properties:
|
||||
* the XMLHttpRequest instance and the transaction id.
|
||||
* @method createXhrObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {int} transactionId Property containing the transaction id for this transaction.
|
||||
* @return connection object
|
||||
* @return object
|
||||
*/
|
||||
createXhrObject:function(transactionId)
|
||||
{
|
||||
|
@ -172,7 +220,7 @@ YAHOO.util.Connect =
|
|||
{
|
||||
// Instantiates XMLHttpRequest for IE and assign to http.
|
||||
http = new ActiveXObject(this._msxml_progid[i]);
|
||||
// Object literal with http and tId properties
|
||||
// Object literal with conn and tId properties
|
||||
obj = { conn:http, tId:transactionId };
|
||||
break;
|
||||
}
|
||||
|
@ -186,11 +234,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* This method is called by asyncRequest to create a
|
||||
* @description This method is called by asyncRequest to create a
|
||||
* valid connection object for the transaction. It also passes a
|
||||
* transaction id and increments the transaction id counter.
|
||||
* @method getConnectionObject
|
||||
* @private
|
||||
* @return object
|
||||
* @static
|
||||
* @return {object}
|
||||
*/
|
||||
getConnectionObject:function()
|
||||
{
|
||||
|
@ -212,11 +262,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Method for initiating an asynchronous request via the XHR object.
|
||||
* @description Method for initiating an asynchronous request via the XHR object.
|
||||
* @method asyncRequest
|
||||
* @public
|
||||
* @static
|
||||
* @param {string} method HTTP transaction method
|
||||
* @param {string} uri Fully qualified path of resource
|
||||
* @param callback User-defined callback function or object
|
||||
* @param {callback} callback User-defined callback function or object
|
||||
* @param {string} postData POST body
|
||||
* @return {object} Returns the connection object
|
||||
*/
|
||||
|
@ -230,8 +282,9 @@ YAHOO.util.Connect =
|
|||
else{
|
||||
if(this._isFormSubmit){
|
||||
if(this._isFileUpload){
|
||||
this.uploadFile(o.tId, callback, uri);
|
||||
this.uploadFile(o.tId, callback, uri, postData);
|
||||
this.releaseObject(o);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -239,93 +292,89 @@ YAHOO.util.Connect =
|
|||
//encoded string that is concatenated to the uri to
|
||||
//create a querystring.
|
||||
if(method == 'GET'){
|
||||
uri += "?" + this._sFormData;
|
||||
if(this._sFormData.length != 0){
|
||||
// If the URI already contains a querystring, append an ampersand
|
||||
// and then concatenate _sFormData to the URI.
|
||||
uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
|
||||
}
|
||||
else{
|
||||
uri += "?" + this._sFormData;
|
||||
}
|
||||
}
|
||||
else if(method == 'POST'){
|
||||
postData = this._sFormData;
|
||||
//If POST data exist in addition to the HTML form data,
|
||||
//it will be concatenated to the form data.
|
||||
postData = postData?this._sFormData + "&" + postData:this._sFormData;
|
||||
}
|
||||
this._sFormData = '';
|
||||
}
|
||||
|
||||
o.conn.open(method, uri, true);
|
||||
|
||||
if(this._isFormSubmit || (postData && this._default_post_header)){
|
||||
this.initHeader('Content-Type','application/x-www-form-urlencoded');
|
||||
if(this._isFormSubmit || (postData && this._use_default_post_header)){
|
||||
this.initHeader('Content-Type', this._default_post_header);
|
||||
if(this._isFormSubmit){
|
||||
this._isFormSubmit = false;
|
||||
this.resetFormState();
|
||||
}
|
||||
}
|
||||
|
||||
//Verify whether the transaction has any user-defined HTTP headers
|
||||
//and set them.
|
||||
if(this._has_http_headers){
|
||||
this.setHeader(o);
|
||||
}
|
||||
|
||||
this.handleReadyState(o, callback);
|
||||
postData?o.conn.send(postData):o.conn.send(null);
|
||||
o.conn.send(postData || null);
|
||||
|
||||
return o;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* This method serves as a timer that polls the XHR object's readyState
|
||||
* @description This method serves as a timer that polls the XHR object's readyState
|
||||
* property during a transaction, instead of binding a callback to the
|
||||
* onreadystatechange event. Upon readyState 4, handleTransactionResponse
|
||||
* will process the response, and the timer will be cleared.
|
||||
*
|
||||
* @method handleReadyState
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param callback User-defined callback object
|
||||
* @return void
|
||||
* @param {callback} callback The user-defined callback object
|
||||
* @return {void}
|
||||
*/
|
||||
handleReadyState:function(o, callback)
|
||||
{
|
||||
var timeOut = callback.timeout;
|
||||
var oConn = this;
|
||||
var oConn = this;
|
||||
|
||||
try
|
||||
{
|
||||
if(timeOut !== undefined){
|
||||
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true) }, timeOut);
|
||||
}
|
||||
this._poll[o.tId] = window.setInterval(
|
||||
function(){
|
||||
if(o.conn && o.conn.readyState == 4){
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
oConn._poll.splice(o.tId);
|
||||
if(timeOut){
|
||||
oConn._timeOut.splice(o.tId);
|
||||
}
|
||||
if(callback && callback.timeout){
|
||||
this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
}
|
||||
,this._polling_interval);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
oConn._poll.splice(o.tId);
|
||||
if(timeOut){
|
||||
oConn._timeOut.splice(o.tId);
|
||||
this._poll[o.tId] = window.setInterval(
|
||||
function(){
|
||||
if(o.conn && o.conn.readyState == 4){
|
||||
window.clearInterval(oConn._poll[o.tId]);
|
||||
delete oConn._poll[o.tId];
|
||||
|
||||
if(callback && callback.timeout){
|
||||
delete oConn._timeOut[o.tId];
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
}
|
||||
|
||||
oConn.handleTransactionResponse(o, callback);
|
||||
}
|
||||
,this._polling_interval);
|
||||
},
|
||||
|
||||
/**
|
||||
* This method attempts to interpret the server response and
|
||||
* @description This method attempts to interpret the server response and
|
||||
* determine whether the transaction was successful, or if an error or
|
||||
* exception was encountered.
|
||||
*
|
||||
* @method handleTransactionResponse
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param {object} callback - User-defined callback object
|
||||
* @param {boolean} determines if the transaction was aborted.
|
||||
* @return void
|
||||
* @param {object} callback The sser-defined callback object
|
||||
* @param {boolean} isAbort Determines if the transaction was aborted.
|
||||
* @return {void}
|
||||
*/
|
||||
handleTransactionResponse:function(o, callback, isAbort)
|
||||
{
|
||||
|
@ -354,65 +403,72 @@ YAHOO.util.Connect =
|
|||
}
|
||||
|
||||
if(httpStatus >= 200 && httpStatus < 300){
|
||||
responseObject = this.createResponseObject(o, callback.argument);
|
||||
if(callback.success){
|
||||
if(!callback.scope){
|
||||
callback.success(responseObject);
|
||||
}
|
||||
else{
|
||||
// If a scope property is defined, the callback will be fired from
|
||||
// the context of the object.
|
||||
callback.success.apply(callback.scope, [responseObject]);
|
||||
try
|
||||
{
|
||||
responseObject = this.createResponseObject(o, callback.argument);
|
||||
if(callback.success){
|
||||
if(!callback.scope){
|
||||
callback.success(responseObject);
|
||||
}
|
||||
else{
|
||||
// If a scope property is defined, the callback will be fired from
|
||||
// the context of the object.
|
||||
callback.success.apply(callback.scope, [responseObject]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
else{
|
||||
switch(httpStatus){
|
||||
// The following case labels are wininet.dll error codes that may be encountered.
|
||||
// Server timeout
|
||||
case 12002:
|
||||
// 12029 to 12031 correspond to dropped connections.
|
||||
case 12029:
|
||||
case 12030:
|
||||
case 12031:
|
||||
// Connection closed by server.
|
||||
case 12152:
|
||||
// See above comments for variable status.
|
||||
case 13030:
|
||||
responseObject = this.createExceptionObject(o.tId, callback.argument, isAbort);
|
||||
if(callback.failure){
|
||||
if(!callback.scope){
|
||||
callback.failure(responseObject);
|
||||
try
|
||||
{
|
||||
switch(httpStatus){
|
||||
// The following cases are wininet.dll error codes that may be encountered.
|
||||
case 12002: // Server timeout
|
||||
case 12029: // 12029 to 12031 correspond to dropped connections.
|
||||
case 12030:
|
||||
case 12031:
|
||||
case 12152: // Connection closed by server.
|
||||
case 13030: // See above comments for variable status.
|
||||
responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort?isAbort:false));
|
||||
if(callback.failure){
|
||||
if(!callback.scope){
|
||||
callback.failure(responseObject);
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
break;
|
||||
default:
|
||||
responseObject = this.createResponseObject(o, callback.argument);
|
||||
if(callback.failure){
|
||||
if(!callback.scope){
|
||||
callback.failure(responseObject);
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
responseObject = this.createResponseObject(o, callback.argument);
|
||||
if(callback.failure){
|
||||
if(!callback.scope){
|
||||
callback.failure(responseObject);
|
||||
}
|
||||
else{
|
||||
callback.failure.apply(callback.scope, [responseObject]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
|
||||
this.releaseObject(o);
|
||||
responseObject = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* This method evaluates the server response, creates and returns the results via
|
||||
* @description This method evaluates the server response, creates and returns the results via
|
||||
* its properties. Success and failure cases will differ in the response
|
||||
* object's property values.
|
||||
* @method createResponseObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @param {} callbackArg User-defined argument or arguments to be passed to the callback
|
||||
* @return object
|
||||
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
|
||||
* @return {object}
|
||||
*/
|
||||
createResponseObject:function(o, callbackArg)
|
||||
{
|
||||
|
@ -423,10 +479,10 @@ YAHOO.util.Connect =
|
|||
{
|
||||
var headerStr = o.conn.getAllResponseHeaders();
|
||||
var header = headerStr.split('\n');
|
||||
for(var i=0; i < header.length; i++){
|
||||
for(var i=0; i<header.length; i++){
|
||||
var delimitPos = header[i].indexOf(':');
|
||||
if(delimitPos != -1){
|
||||
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+1);
|
||||
headerObj[header[i].substring(0,delimitPos)] = header[i].substring(delimitPos+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -448,18 +504,20 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* If a transaction cannot be completed due to dropped or closed connections,
|
||||
* @description If a transaction cannot be completed due to dropped or closed connections,
|
||||
* there may be not be enough information to build a full response object.
|
||||
* The failure callback will be fired and this specific condition can be identified
|
||||
* by a status property value of 0.
|
||||
*
|
||||
* If an abort was successful, the status property will report a value of -1.
|
||||
*
|
||||
* @method createExceptionObject
|
||||
* @private
|
||||
* @param {int} tId Transaction Id
|
||||
* @param callbackArg The user-defined arguments
|
||||
* @param isAbort Determines if the exception is an abort.
|
||||
* @return object
|
||||
* @static
|
||||
* @param {int} tId The Transaction Id
|
||||
* @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
|
||||
* @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
|
||||
* @return {object}
|
||||
*/
|
||||
createExceptionObject:function(tId, callbackArg, isAbort)
|
||||
{
|
||||
|
@ -488,11 +546,13 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Public method that stores the custom HTTP headers for each transaction.
|
||||
* @description Public method that stores the custom HTTP headers for each transaction.
|
||||
* @method initHeader
|
||||
* @public
|
||||
* @static
|
||||
* @param {string} label The HTTP header label
|
||||
* @param {string} value The HTTP header value
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
initHeader:function(label,value)
|
||||
{
|
||||
|
@ -500,6 +560,8 @@ YAHOO.util.Connect =
|
|||
this._http_header[label] = value;
|
||||
}
|
||||
else{
|
||||
// Concatenate multiple values, comma-delimited,
|
||||
// for the same header label,
|
||||
this._http_header[label] = value + "," + this._http_header[label];
|
||||
}
|
||||
|
||||
|
@ -507,15 +569,17 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Accessor that sets the HTTP headers for each transaction.
|
||||
* @description Accessor that sets the HTTP headers for each transaction.
|
||||
* @method setHeader
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object for the transaction.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
setHeader:function(o)
|
||||
{
|
||||
for(var prop in this._http_header){
|
||||
if(this._http_header.propertyIsEnumerable){
|
||||
if(this._http_header.hasOwnProperty(prop)){
|
||||
o.conn.setRequestHeader(prop, this._http_header[prop]);
|
||||
}
|
||||
}
|
||||
|
@ -526,28 +590,32 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* This method assembles the form label and value pairs and
|
||||
* @description This method assembles the form label and value pairs and
|
||||
* constructs an encoded string.
|
||||
* asyncRequest() will automatically initialize the
|
||||
* transaction with a HTTP header Content-Type of
|
||||
* application/x-www-form-urlencoded.
|
||||
* @method setForm
|
||||
* @public
|
||||
* @static
|
||||
* @param {string || object} form id or name attribute, or form object.
|
||||
* @param {string} optional boolean to indicate SSL environment.
|
||||
* @param {string} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return void
|
||||
* @param {string || boolean} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return {string} string of the HTML form field name and value pairs..
|
||||
*/
|
||||
setForm:function(formId, isUpload, secureUri)
|
||||
{
|
||||
this._sFormData = '';
|
||||
this.resetFormState();
|
||||
var oForm;
|
||||
if(typeof formId == 'string'){
|
||||
// Determine if the argument is a form id or a form name.
|
||||
// Note form name usage is deprecated by supported
|
||||
// here for legacy reasons.
|
||||
var oForm = (document.getElementById(formId) || document.forms[formId]);
|
||||
oForm = (document.getElementById(formId) || document.forms[formId]);
|
||||
}
|
||||
else if(typeof formId == 'object'){
|
||||
var oForm = formId;
|
||||
// Treat argument as an HTML form object.
|
||||
oForm = formId;
|
||||
}
|
||||
else{
|
||||
return;
|
||||
|
@ -560,7 +628,11 @@ YAHOO.util.Connect =
|
|||
// where the secureURI string is a fully qualified HTTP path, used to set the source
|
||||
// of the iframe, to a stub resource in the same domain.
|
||||
if(isUpload){
|
||||
(typeof secureUri == 'string')?this.createFrame(secureUri):this.createFrame();
|
||||
|
||||
// Create iframe in preparation for file upload.
|
||||
this.createFrame(secureUri?secureUri:null);
|
||||
|
||||
// Set form reference and file upload properties to true.
|
||||
this._isFormSubmit = true;
|
||||
this._isFileUpload = true;
|
||||
this._formNode = oForm;
|
||||
|
@ -574,11 +646,8 @@ YAHOO.util.Connect =
|
|||
// Iterate over the form elements collection to construct the
|
||||
// label-value pairs.
|
||||
for (var i=0; i<oForm.elements.length; i++){
|
||||
oDisabled = oForm.elements[i].disabled;
|
||||
|
||||
// If the name attribute is not populated, the form field's
|
||||
// value will not be submitted.
|
||||
oElement = oForm.elements[i];
|
||||
oDisabled = oForm.elements[i].disabled;
|
||||
oName = oForm.elements[i].name;
|
||||
oValue = oForm.elements[i].value;
|
||||
|
||||
|
@ -592,7 +661,13 @@ YAHOO.util.Connect =
|
|||
case 'select-multiple':
|
||||
for(var j=0; j<oElement.options.length; j++){
|
||||
if(oElement.options[j].selected){
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].value || oElement.options[j].text) + '&';
|
||||
if(window.ActiveXObject){
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text) + '&';
|
||||
}
|
||||
else{
|
||||
this._sFormData += encodeURIComponent(oName) + '=' + encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text) + '&';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -626,32 +701,57 @@ YAHOO.util.Connect =
|
|||
|
||||
this._isFormSubmit = true;
|
||||
this._sFormData = this._sFormData.substr(0, this._sFormData.length - 1);
|
||||
|
||||
return this._sFormData;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates an iframe to be used for form file uploads. It is remove from the
|
||||
* document upon completion of the upload transaction.
|
||||
*
|
||||
* @description Resets HTML form properties when an HTML form or HTML form
|
||||
* with file upload transaction is sent.
|
||||
* @method resetFormState
|
||||
* @private
|
||||
* @param {string} optional qualified path of iframe resource for SSL in IE.
|
||||
* @return void
|
||||
* @static
|
||||
* @return {void}
|
||||
*/
|
||||
resetFormState:function(){
|
||||
this._isFormSubmit = false;
|
||||
this._isFileUpload = false;
|
||||
this._formNode = null;
|
||||
this._sFormData = "";
|
||||
},
|
||||
|
||||
/**
|
||||
* @description Creates an iframe to be used for form file uploads. It is remove from the
|
||||
* document upon completion of the upload transaction.
|
||||
* @method createFrame
|
||||
* @private
|
||||
* @static
|
||||
* @param {string} secureUri Optional qualified path of iframe resource for SSL in IE.
|
||||
* @return {void}
|
||||
*/
|
||||
createFrame:function(secureUri){
|
||||
|
||||
// IE does not allow the setting of id and name attributes as DOM
|
||||
// properties. A different iframe creation pattern is required for IE.
|
||||
// IE does not allow the setting of id and name attributes as object
|
||||
// properties via createElement(). A different iframe creation
|
||||
// pattern is required for IE.
|
||||
var frameId = 'yuiIO' + this._transaction_id;
|
||||
if(window.ActiveXObject){
|
||||
var io = document.createElement('<IFRAME name="ioFrame" id="ioFrame">');
|
||||
if(secureUri){
|
||||
// IE will throw a security exception in an SSL environment if the
|
||||
// iframe source isn't set to a valid resource.
|
||||
var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
|
||||
|
||||
// IE will throw a security exception in an SSL environment if the
|
||||
// iframe source is undefined.
|
||||
if(typeof secureUri == 'boolean'){
|
||||
io.src = 'javascript:false';
|
||||
}
|
||||
else if(typeof secureURI == 'string'){
|
||||
// Deprecated
|
||||
io.src = secureUri;
|
||||
}
|
||||
}
|
||||
else{
|
||||
var io = document.createElement('IFRAME');
|
||||
io.id = 'ioFrame';
|
||||
io.name = 'ioFrame';
|
||||
var io = document.createElement('iframe');
|
||||
io.id = frameId;
|
||||
io.name = frameId;
|
||||
}
|
||||
|
||||
io.style.position = 'absolute';
|
||||
|
@ -662,28 +762,83 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Uploads HTML form, including files/attachments, targeting the
|
||||
* iframe created in createFrame.
|
||||
*
|
||||
* @description Parses the POST data and creates hidden form elements
|
||||
* for each key-value, and appends them to the HTML form object.
|
||||
* @method appendPostData
|
||||
* @private
|
||||
* @static
|
||||
* @param {string} postData The HTTP POST data
|
||||
* @return {array} formElements Collection of hidden fields.
|
||||
*/
|
||||
appendPostData:function(postData)
|
||||
{
|
||||
var formElements = new Array();
|
||||
var postMessage = postData.split('&');
|
||||
for(var i=0; i < postMessage.length; i++){
|
||||
var delimitPos = postMessage[i].indexOf('=');
|
||||
if(delimitPos != -1){
|
||||
formElements[i] = document.createElement('input');
|
||||
formElements[i].type = 'hidden';
|
||||
formElements[i].name = postMessage[i].substring(0,delimitPos);
|
||||
formElements[i].value = postMessage[i].substring(delimitPos+1);
|
||||
this._formNode.appendChild(formElements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return formElements;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description Uploads HTML form, including files/attachments, to the
|
||||
* iframe created in createFrame.
|
||||
* @method uploadFile
|
||||
* @private
|
||||
* @static
|
||||
* @param {int} id The transaction id.
|
||||
* @param {object} callback - User-defined callback object.
|
||||
* @param {string} uri Fully qualified path of resource.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
uploadFile:function(id, callback, uri){
|
||||
uploadFile:function(id, callback, uri, postData){
|
||||
|
||||
// Each iframe has an id prefix of "yuiIO" followed
|
||||
// by the unique transaction id.
|
||||
var frameId = 'yuiIO' + id;
|
||||
var io = document.getElementById(frameId);
|
||||
|
||||
// Initialize the HTML form properties in case they are
|
||||
// not defined in the HTML form.
|
||||
this._formNode.action = uri;
|
||||
this._formNode.enctype = 'multipart/form-data';
|
||||
this._formNode.method = 'POST';
|
||||
this._formNode.target = 'ioFrame';
|
||||
this._formNode.target = frameId;
|
||||
|
||||
if(this._formNode.encoding){
|
||||
// IE does not respect property enctype for HTML forms.
|
||||
// Instead use property encoding.
|
||||
this._formNode.encoding = 'multipart/form-data';
|
||||
}
|
||||
else{
|
||||
this._formNode.enctype = 'multipart/form-data';
|
||||
}
|
||||
|
||||
if(postData){
|
||||
var oElements = this.appendPostData(postData);
|
||||
}
|
||||
|
||||
this._formNode.submit();
|
||||
|
||||
// Reset form status properties.
|
||||
this._formNode = null;
|
||||
this._isFileUpload = false;
|
||||
this._isFormSubmit = false;
|
||||
if(oElements && oElements.length > 0){
|
||||
try
|
||||
{
|
||||
for(var i=0; i < oElements.length; i++){
|
||||
this._formNode.removeChild(oElements[i]);
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
}
|
||||
|
||||
// Reset HTML form status properties.
|
||||
this.resetFormState();
|
||||
|
||||
// Create the upload callback handler that fires when the iframe
|
||||
// receives the load event. Subsequently, the event handler is detached
|
||||
|
@ -691,46 +846,71 @@ YAHOO.util.Connect =
|
|||
|
||||
var uploadCallback = function()
|
||||
{
|
||||
var oResponse =
|
||||
var obj = {};
|
||||
obj.tId = id;
|
||||
obj.argument = callback.argument;
|
||||
|
||||
try
|
||||
{
|
||||
tId: id,
|
||||
responseText: document.getElementById("ioFrame").contentWindow.document.body.innerHTML,
|
||||
argument: callback.argument
|
||||
obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
|
||||
obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
if(callback.upload){
|
||||
if(!callback.scope){
|
||||
callback.upload(obj);
|
||||
}
|
||||
else{
|
||||
callback.upload.apply(callback.scope, [obj]);
|
||||
}
|
||||
}
|
||||
|
||||
if(callback.upload && !callback.scope){
|
||||
callback.upload(oResponse);
|
||||
if(YAHOO.util.Event){
|
||||
YAHOO.util.Event.removeListener(io, "load", uploadCallback);
|
||||
}
|
||||
else if(window.detachEvent){
|
||||
io.detachEvent('onload', uploadCallback);
|
||||
}
|
||||
else{
|
||||
callback.upload.apply(callback.scope, [oResponse]);
|
||||
io.removeEventListener('load', uploadCallback, false);
|
||||
}
|
||||
|
||||
YAHOO.util.Event.removeListener("ioFrame", "load", uploadCallback);
|
||||
window.ioFrame.location.replace('#');
|
||||
setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);
|
||||
setTimeout(function(){ document.body.removeChild(io); }, 100);
|
||||
};
|
||||
|
||||
|
||||
// Bind the onload handler to the iframe to detect the file upload response.
|
||||
YAHOO.util.Event.addListener("ioFrame", "load", uploadCallback);
|
||||
if(YAHOO.util.Event){
|
||||
YAHOO.util.Event.addListener(io, "load", uploadCallback);
|
||||
}
|
||||
else if(window.attachEvent){
|
||||
io.attachEvent('onload', uploadCallback);
|
||||
}
|
||||
else{
|
||||
io.addEventListener('load', uploadCallback, false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Public method to terminate a transaction, if it has not reached readyState 4.
|
||||
* @description Method to terminate a transaction, if it has not reached readyState 4.
|
||||
* @method abort
|
||||
* @public
|
||||
* @static
|
||||
* @param {object} o The connection object returned by asyncRequest.
|
||||
* @param {object} callback User-defined callback object.
|
||||
* @param {string} isTimeout boolean to indicate if abort was a timeout.
|
||||
* @return void
|
||||
* @return {boolean}
|
||||
*/
|
||||
abort:function(o, callback, isTimeout)
|
||||
{
|
||||
if(this.isCallInProgress(o)){
|
||||
window.clearInterval(this._poll[o.tId]);
|
||||
this._poll.splice(o.tId);
|
||||
if(isTimeout){
|
||||
this._timeOut.splice(o.tId);
|
||||
}
|
||||
o.conn.abort();
|
||||
window.clearInterval(this._poll[o.tId]);
|
||||
delete this._poll[o.tId];
|
||||
if(isTimeout){
|
||||
delete this._timeOut[o.tId];
|
||||
}
|
||||
|
||||
this.handleTransactionResponse(o, callback, true);
|
||||
|
||||
return true;
|
||||
|
@ -742,9 +922,12 @@ YAHOO.util.Connect =
|
|||
|
||||
/**
|
||||
* Public method to check if the transaction is still being processed.
|
||||
*
|
||||
* @method isCallInProgress
|
||||
* @public
|
||||
* @static
|
||||
* @param {object} o The connection object returned by asyncRequest
|
||||
* @return boolean
|
||||
* @return {boolean}
|
||||
*/
|
||||
isCallInProgress:function(o)
|
||||
{
|
||||
|
@ -760,10 +943,12 @@ YAHOO.util.Connect =
|
|||
},
|
||||
|
||||
/**
|
||||
* Dereference the XHR instance and the connection object after the transaction is completed.
|
||||
* @description Dereference the XHR instance and the connection object after the transaction is completed.
|
||||
* @method releaseObject
|
||||
* @private
|
||||
* @static
|
||||
* @param {object} o The connection object
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
releaseObject:function(o)
|
||||
{
|
||||
|
|
|
@ -1,30 +1,115 @@
|
|||
Container Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
All Classes
|
||||
- New documentation format implemented, and removed unnecessary
|
||||
prototype null references previously used for generating
|
||||
documentation
|
||||
- Modified the
|
||||
|
||||
Config
|
||||
- Added 'undefined' check when reading initial properties for
|
||||
.reset()
|
||||
- Fixed Firefox warning on .resetProperty()
|
||||
- Fixed issue preventing resetProperty() from resetting values
|
||||
correctly
|
||||
|
||||
Module
|
||||
- Removed unused "childNodesInDom" property
|
||||
|
||||
Overlay
|
||||
- Converted center() to use Dom utility
|
||||
- Fixed configVisible() to properly detect actual visible/hidden
|
||||
status in Internet Explorer, which reports "inherit" for all elements
|
||||
by default.
|
||||
- Updated onDomResize to properly reapply "context" property
|
||||
- Unified scroll/resize handlers so that they fire properly (when the
|
||||
event has completed) as opposed to constantly (as seen in Mozilla-
|
||||
based browsers)
|
||||
|
||||
Panel
|
||||
- Modified modality mask to show before Panel is shown (prior to any
|
||||
animation)
|
||||
- Modified buildWrapper to eliminate cloning of the initial markup
|
||||
module, which fixes issues with select options not maintaining their
|
||||
default selections in IE
|
||||
- Modality mask is now z-indexed properly so that the mask z-index is
|
||||
always one less than the Panel z-index
|
||||
|
||||
Dialog
|
||||
- Fixed Connection to get "action" attribute using getAttribute, to
|
||||
allow for form fields named "action"
|
||||
- Added support for "GET" by retrieving the form "method" rather than
|
||||
always defaulting to "POST"
|
||||
|
||||
KeyListener
|
||||
- Fixed to work properly with Safari 2.0 by matching against keyCode
|
||||
or charCode
|
||||
|
||||
*** version 0.11.4 ***
|
||||
|
||||
- Panel: Modality mask is now properly removed from DOM on Panel
|
||||
destroy.
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
- Module: Fixed SSL warning issue in IE
|
||||
- Overlay: Fixed memory leak related to iframe shim in IE
|
||||
- Panel: No focusable elements under the mask can now be tabbed to
|
||||
- Panel: Set Panel container overflow to hidden to fix scrolling issue
|
||||
in Opera 9
|
||||
|
||||
*** version 0.11.2 ***
|
||||
|
||||
- All: JsLint optimization
|
||||
- Overlay: Fixed SSL issues with monitorresize property
|
||||
- OverlayManager: Fixed z-index incrementing issues
|
||||
- Dialog: Form elements called "name" will now function properly
|
||||
- Dialog: Removed unnecessary scope:this reference
|
||||
|
||||
*** version 0.11.1 ***
|
||||
|
||||
- Tooltip: Removed incorrect logger statement
|
||||
- Dialog: Corrected logic that was causing browser lockup in IE for
|
||||
SimpleDialog
|
||||
- Dialog: Fixed "firstButtom" typo
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
- toString function added to all classes for easy logging
|
||||
- YAHOO.extend is now being used for inheritance on all container classes
|
||||
- YAHOO.extend is now being used for inheritance on all container
|
||||
classes
|
||||
- Module: monitorresize feature now works on all browsers
|
||||
- Module: Fixed bug with image root and isSecure
|
||||
- Overlay: Fixed bugs related to IFRAME shim positioning
|
||||
- Overlay: center() now works in quirks mode
|
||||
- Overlay: Overlay now has a custom destroy() method that also removes the IFRAME shim
|
||||
- OverlayManager: Fixed bug in the prototype that was preventing multiple Managers on one page
|
||||
- Overlay: Overlay now has a custom destroy() method that also removes
|
||||
the IFRAME shim
|
||||
- OverlayManager: Fixed bug in the prototype that was preventing
|
||||
multiple Managers on one page
|
||||
- OverlayManager: focusEvent now fires at all appropriate times
|
||||
- Tooltip: context can now be specified as an array, so Tooltips can be reused across multiple context elements
|
||||
- Tooltip: preventoverlap now functions properly for large context elements (i.e, images)
|
||||
- Tooltip: context can now be specified as an array, so Tooltips can be
|
||||
reused across multiple context elements
|
||||
- Tooltip: preventoverlap now functions properly for large context
|
||||
elements (i.e, images)
|
||||
- Tooltip: fixed bugs regarding setTimeout
|
||||
- Tooltip: added mousemove event to allow for more accurate Tooltip positioning
|
||||
- Panel: added dragEvent for monitoring all event handlers for drag and drop
|
||||
- Tooltip: added mousemove event to allow for more accurate Tooltip
|
||||
positioning
|
||||
- Panel: added dragEvent for monitoring all event handlers for drag and
|
||||
drop
|
||||
- Panel: modality mask is now resized on scroll
|
||||
- Panel: KeyListeners are now properly destroyed when the Panel is destroyed
|
||||
- Panel: KeyListeners are now properly destroyed when the Panel is
|
||||
destroyed
|
||||
- Panel: Header is now sized properly in quirks mode
|
||||
- Dialog: Blinking cursor issue is fixed for Firefox
|
||||
- Dialog: callback object for Connection is now public (this.callback)
|
||||
- Dialog: onsuccess/onfailure properties removed (as a result of the public callback object)
|
||||
- Dialog: onsuccess/onfailure properties removed (as a result of the
|
||||
public callback object)
|
||||
- Dialog: Dialog is now invisible by default
|
||||
- Dialog: Buttons are now properly cleaned up on destroy
|
||||
|
||||
*** version 0.10.0 ***
|
||||
|
||||
* Initial release
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ Version 0.11.0
|
|||
-moz-opacity: 0.7;
|
||||
opacity:.70;
|
||||
filter:alpha(opacity=70);
|
||||
zoom:1;
|
||||
}
|
||||
|
||||
.panel {
|
||||
|
@ -108,7 +109,7 @@ Version 0.11.0
|
|||
background-color:#FFF;
|
||||
border:1px solid #000;
|
||||
z-index:1;
|
||||
overflow:auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.panel .hd {
|
||||
|
|
2438
lib/yui/container/container-debug.js
vendored
2438
lib/yui/container/container-debug.js
vendored
File diff suppressed because it is too large
Load diff
321
lib/yui/container/container-min.js
vendored
321
lib/yui/container/container-min.js
vendored
|
@ -1,49 +1,25 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}
|
||||
YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}
|
||||
YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}
|
||||
this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
|
||||
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}
|
||||
this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]
|
||||
if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
|
||||
return cfg;}
|
||||
this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}
|
||||
this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}
|
||||
this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
|
||||
return true;}}else{return false;}}}
|
||||
this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
|
||||
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
|
||||
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
|
||||
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
|
||||
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
|
||||
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
|
||||
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
|
||||
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
|
||||
return true;}else{return false;}}
|
||||
this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}
|
||||
this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
|
||||
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}
|
||||
this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}
|
||||
this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
|
||||
this.queueInProgress=false;eventQueue=new Array();}
|
||||
this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
|
||||
return true;}else{return false;}}
|
||||
this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}
|
||||
this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
|
||||
return output;}
|
||||
this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
|
||||
return output;}}
|
||||
YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}
|
||||
return false;}
|
||||
YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}
|
||||
YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")==0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
|
||||
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
|
||||
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
|
||||
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
|
||||
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
|
||||
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
|
||||
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
|
||||
return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
|
||||
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
|
||||
this.element=el;if(el.id){this.id=el.id;}
|
||||
var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
|
||||
this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
|
||||
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}
|
||||
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}
|
||||
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}
|
||||
if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
|
||||
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
|
||||
|
@ -57,236 +33,115 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
|
|||
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
|
||||
this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
|
||||
var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
|
||||
if(element){element.appendChild(me.element);me.appendEvent.fire();}}
|
||||
if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
|
||||
if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
|
||||
if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
|
||||
if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
|
||||
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
|
||||
this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}
|
||||
if(parent){parent.removeChild(this.element);}
|
||||
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}
|
||||
YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}
|
||||
YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"
|
||||
YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
|
||||
this.initEvent.fire(YAHOO.widget.Overlay);}
|
||||
YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}
|
||||
YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}
|
||||
YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}
|
||||
YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}
|
||||
YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
|
||||
this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
|
||||
e=e.parentNode;}
|
||||
if(currentVis=="inherit"){currentVis="visible";}}
|
||||
var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
|
||||
var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
|
||||
if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
|
||||
e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
|
||||
if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
|
||||
e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}
|
||||
YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}
|
||||
YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
|
||||
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
|
||||
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
|
||||
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
|
||||
h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
|
||||
if(this.iframe){if(zIndex<=0){zIndex=1;}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
|
||||
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}
|
||||
YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}
|
||||
var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}
|
||||
if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}
|
||||
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
|
||||
var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}
|
||||
if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}
|
||||
var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}
|
||||
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}
|
||||
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
|
||||
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
|
||||
this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
|
||||
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}
|
||||
YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
|
||||
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
|
||||
this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
|
||||
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
|
||||
if(!contextAlign){contextAlign=contextArgs[2];}
|
||||
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}
|
||||
switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}
|
||||
YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}
|
||||
var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
|
||||
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
|
||||
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
|
||||
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}
|
||||
YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}
|
||||
YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
|
||||
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}
|
||||
YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}
|
||||
YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}
|
||||
YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
|
||||
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}
|
||||
YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}
|
||||
this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}
|
||||
this.overlays.sort(this.compareZIndexDesc);}}
|
||||
this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null
|
||||
o.blurEvent=null;o.focus=null;o.blur=null;}}
|
||||
this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}
|
||||
var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}
|
||||
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}
|
||||
overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}
|
||||
var focusOnDomEvent=function(e,obj){overlay.focus();}
|
||||
var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}
|
||||
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
|
||||
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}
|
||||
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}
|
||||
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
|
||||
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}
|
||||
this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
|
||||
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
|
||||
this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}
|
||||
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}
|
||||
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}
|
||||
YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
|
||||
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}
|
||||
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
|
||||
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
|
||||
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
|
||||
function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;if(!keyData.shift)keyData.shift=false;if(!keyData.alt)keyData.alt=false;if(!keyData.ctrl)keyData.ctrl=false;if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}
|
||||
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
|
||||
if(!keyData.alt){keyData.alt=false;}
|
||||
if(!keyData.ctrl){keyData.ctrl=false;}
|
||||
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
|
||||
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
|
||||
this.enabled=true;}
|
||||
this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
|
||||
this.enabled=false;}
|
||||
this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}
|
||||
YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);}
|
||||
YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}}
|
||||
YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}
|
||||
YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}}
|
||||
YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}}
|
||||
YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
|
||||
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
|
||||
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Tooltip,YAHOO.widget.Overlay);YAHOO.widget.Tooltip.CSS_TOOLTIP="tt";YAHOO.widget.Tooltip.prototype.init=function(el,userConfig){if(document.readyState&&document.readyState!="complete"){var deferredInit=function(){this.init(el,userConfig);};YAHOO.util.Event.addListener(window,"load",deferredInit,this,true);}else{YAHOO.widget.Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Tooltip);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg.getProperty("container"));this.initEvent.fire(YAHOO.widget.Tooltip);}};YAHOO.widget.Tooltip.prototype.initDefaultConfig=function(){YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty("preventoverlap",{value:true,validator:this.cfg.checkBoolean,supercedes:["x","y","xy"]});this.cfg.addProperty("showdelay",{value:200,handler:this.configShowDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("autodismissdelay",{value:5000,handler:this.configAutoDismissDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("hidedelay",{value:250,handler:this.configHideDelay,validator:this.cfg.checkNumber});this.cfg.addProperty("text",{handler:this.configText,suppressEvent:true});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});};YAHOO.widget.Tooltip.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);}};YAHOO.widget.Tooltip.prototype.configContainer=function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",document.getElementById(container),true);}};YAHOO.widget.Tooltip.prototype.configContext=function(type,args,obj){var context=args[0];if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}
|
||||
context=this.cfg.getProperty("context");}
|
||||
if(this._context){for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.removeListener(el,"mouseover",this.onContextMouseOver);YAHOO.util.Event.removeListener(el,"mousemove",this.onContextMouseMove);YAHOO.util.Event.removeListener(el,"mouseout",this.onContextMouseOut);}}
|
||||
this._context=context;for(var c=0;c<this._context.length;++c){var el=this._context[c];YAHOO.util.Event.addListener(el,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el,"mouseout",this.onContextMouseOut,this);}}}
|
||||
YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);}
|
||||
YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
|
||||
this._context=context;for(var d=0;d<this._context.length;++d){var el2=this._context[d];YAHOO.util.Event.addListener(el2,"mouseover",this.onContextMouseOver,this);YAHOO.util.Event.addListener(el2,"mousemove",this.onContextMouseMove,this);YAHOO.util.Event.addListener(el2,"mouseout",this.onContextMouseOut,this);}}};YAHOO.widget.Tooltip.prototype.onContextMouseMove=function(e,obj){obj.pageX=YAHOO.util.Event.getPageX(e);obj.pageY=YAHOO.util.Event.getPageY(e);};YAHOO.widget.Tooltip.prototype.onContextMouseOver=function(e,obj){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
|
||||
var context=this;YAHOO.util.Event.addListener(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
|
||||
obj.showProcId=obj.doShow(e,context);}
|
||||
YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
|
||||
obj.showProcId=obj.doShow(e,context);};YAHOO.widget.Tooltip.prototype.onContextMouseOut=function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
|
||||
if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
|
||||
if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
|
||||
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));}
|
||||
YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
|
||||
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));};YAHOO.widget.Tooltip.prototype.doShow=function(e,context){var yOffset=25;if(this.browser=="opera"&&context.tagName=="A"){yOffset+=12;}
|
||||
var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
|
||||
me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
|
||||
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));}
|
||||
YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));}
|
||||
YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.logger.log("OVERLAP","warn");this.cfg.setProperty("y",(pageY-height-5))}}
|
||||
YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;}
|
||||
YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.showMaskEvent=null;YAHOO.widget.Panel.prototype.hideMaskEvent=null;YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader(" ");}}},this,true);this.initEvent.fire(YAHOO.widget.Panel);}
|
||||
YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");}
|
||||
YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});}
|
||||
YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();}
|
||||
if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}
|
||||
this.close.innerHTML=" ";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}}
|
||||
YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}
|
||||
if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}}
|
||||
YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML=" ";this.element.appendChild(this.underlay);}
|
||||
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;case"none":default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}}
|
||||
YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMask,this)){this.showEvent.subscribe(this.showMask,this,true);}
|
||||
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));};YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));};YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}};YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;};YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";YAHOO.widget.Panel.prototype.init=function(el,userConfig){YAHOO.widget.Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Panel);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader(" ");}}},this,true);var me=this;this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if(el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="FORM"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",el.blur);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",el2.blur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};YAHOO.widget.Panel.prototype.initEvents=function(){YAHOO.widget.Panel.superclass.initEvents.call(this);this.showMaskEvent=new YAHOO.util.CustomEvent("showMask");this.hideMaskEvent=new YAHOO.util.CustomEvent("hideMask");this.dragEvent=new YAHOO.util.CustomEvent("drag");};YAHOO.widget.Panel.prototype.initDefaultConfig=function(){YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty("close",{value:true,handler:this.configClose,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("draggable",{value:true,handler:this.configDraggable,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("underlay",{value:"shadow",handler:this.configUnderlay,supercedes:["visible"]});this.cfg.addProperty("modal",{value:false,handler:this.configModal,validator:this.cfg.checkBoolean,supercedes:["visible"]});this.cfg.addProperty("keylisteners",{handler:this.configKeyListeners,suppressEvent:true,supercedes:["visible"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};if(val){if(!this.close){this.close=document.createElement("DIV");YAHOO.util.Dom.addClass(this.close,"close");if(this.isSecure){YAHOO.util.Dom.addClass(this.close,"secure");}else{YAHOO.util.Dom.addClass(this.close,"nonsecure");}
|
||||
this.close.innerHTML=" ";this.innerElement.appendChild(this.close);YAHOO.util.Event.addListener(this.close,"click",doHide,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}};YAHOO.widget.Panel.prototype.configDraggable=function(type,args,obj){var val=args[0];if(val){if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}}else{if(this.dd){this.dd.unreg();}
|
||||
if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};YAHOO.widget.Panel.prototype.configUnderlay=function(type,args,obj){var val=args[0];switch(val.toLowerCase()){case"shadow":YAHOO.util.Dom.removeClass(this.element,"matte");YAHOO.util.Dom.addClass(this.element,"shadow");if(!this.underlay){this.underlay=document.createElement("DIV");this.underlay.className="underlay";this.underlay.innerHTML=" ";this.element.appendChild(this.underlay);}
|
||||
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}};YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.showMask,this)){this.beforeShowEvent.subscribe(this.showMask,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.sizeMask,this,true);}}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.sizeMask);}}
|
||||
YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.destroyEvent,this.removeMask,this)){this.destroyEvent.subscribe(this.removeMask,this,true);}
|
||||
this.cfg.refireEvent("zIndex");}else{this.beforeShowEvent.unsubscribe(this.showMask,this);this.hideEvent.unsubscribe(this.hideMask,this);YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.destroyEvent.unsubscribe(this.removeMask,this);}};YAHOO.widget.Panel.prototype.removeMask=function(){if(this.mask){if(this.mask.parentNode){this.mask.parentNode.removeChild(this.mask);}
|
||||
this.mask=null;}};YAHOO.widget.Panel.prototype.configKeyListeners=function(type,args,obj){var listeners=args[0];if(listeners){if(listeners instanceof Array){for(var i=0;i<listeners.length;i++){var listener=listeners[i];if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}}
|
||||
YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var elementClone=this.element.cloneNode(true);this.innerElement=elementClone;this.innerElement.style.visibility="inherit";YAHOO.util.Dom.addClass(this.innerElement,YAHOO.widget.Panel.CSS_PANEL);var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=elementClone.id+"_c";wrapper.appendChild(elementClone);if(elementParent){elementParent.replaceChild(wrapper,this.element);}
|
||||
this.element=wrapper;var childNodes=this.innerElement.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
|
||||
this.initDefaultConfig();}
|
||||
YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}}
|
||||
YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}};YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");};YAHOO.widget.Panel.prototype.configzIndex=function(type,args,obj){YAHOO.widget.Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0;var currentZ=YAHOO.util.Dom.getStyle(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
|
||||
if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;YAHOO.util.Dom.setStyle(this.mask,"zIndex",maskZ);}}};YAHOO.widget.Panel.prototype.buildWrapper=function(){var elementParent=this.element.parentNode;var originalElement=this.element;var wrapper=document.createElement("DIV");wrapper.className=YAHOO.widget.Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
|
||||
wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;YAHOO.util.Dom.setStyle(this.innerElement,"visibility","inherit");};YAHOO.widget.Panel.prototype.sizeUnderlay=function(){if(this.underlay&&this.browser!="gecko"&&this.browser!="safari"){this.underlay.style.width=this.innerElement.offsetWidth+"px";this.underlay.style.height=this.innerElement.offsetHeight+"px";}};YAHOO.widget.Panel.prototype.onDomResize=function(e,obj){YAHOO.widget.Panel.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.sizeUnderlay();},0);};YAHOO.widget.Panel.prototype.registerDragDrop=function(){if(this.header){this.dd=new YAHOO.util.DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
|
||||
var me=this;this.dd.startDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.addClass(me.element,"drag");}
|
||||
if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint
|
||||
this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
|
||||
me.dragEvent.fire("startDrag",arguments);}
|
||||
this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
|
||||
me.dragEvent.fire("onDrag",arguments);}
|
||||
this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
|
||||
me.dragEvent.fire("endDrag",arguments);}
|
||||
this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}}
|
||||
YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML=" ";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);}
|
||||
YAHOO.util.Event.addListener(this.mask,maskClick,this);document.body.appendChild(this.mask);}}
|
||||
YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}}
|
||||
YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}}
|
||||
YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}}
|
||||
YAHOO.widget.Panel.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Panel.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.innerElement;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("underlay");this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);}
|
||||
YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;}
|
||||
YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.beforeSubmitEvent=null;YAHOO.widget.Dialog.prototype.submitEvent=null;YAHOO.widget.Dialog.prototype.manualSubmitEvent=null;YAHOO.widget.Dialog.prototype.asyncSubmitEvent=null;YAHOO.widget.Dialog.prototype.formSubmitEvent=null;YAHOO.widget.Dialog.prototype.cancelEvent=null;YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null,scope:this}
|
||||
this.doSubmit=function(){var method=this.cfg.getProperty("postmethod");switch(method){case"async":YAHOO.util.Connect.setForm(this.form.name);var cObj=YAHOO.util.Connect.asyncRequest('POST',this.form.action,this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}}
|
||||
this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});}
|
||||
YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");}
|
||||
YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);}
|
||||
YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}
|
||||
this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}
|
||||
return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;break;}}}
|
||||
if(me.cfg.getProperty("constraintoviewport")){var offsetHeight=me.element.offsetHeight;var offsetWidth=me.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
|
||||
me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}
|
||||
me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}
|
||||
me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};YAHOO.widget.Panel.prototype.buildMask=function(){if(!this.mask){this.mask=document.createElement("DIV");this.mask.id=this.id+"_mask";this.mask.className="mask";this.mask.innerHTML=" ";var maskClick=function(e,obj){YAHOO.util.Event.stopEvent(e);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};YAHOO.widget.Panel.prototype.showMask=function(){if(this.cfg.getProperty("modal")&&this.mask){YAHOO.util.Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}};YAHOO.widget.Panel.prototype.sizeMask=function(){if(this.mask){this.mask.style.height=YAHOO.util.Dom.getDocumentHeight()+"px";this.mask.style.width=YAHOO.util.Dom.getDocumentWidth()+"px";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty("postmethod",{value:"async",validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});};YAHOO.widget.Dialog.prototype.initEvents=function(){YAHOO.widget.Dialog.superclass.initEvents.call(this);this.beforeSubmitEvent=new YAHOO.util.CustomEvent("beforeSubmit");this.submitEvent=new YAHOO.util.CustomEvent("submit");this.manualSubmitEvent=new YAHOO.util.CustomEvent("manualSubmit");this.asyncSubmitEvent=new YAHOO.util.CustomEvent("asyncSubmit");this.formSubmitEvent=new YAHOO.util.CustomEvent("formSubmit");this.cancelEvent=new YAHOO.util.CustomEvent("cancel");};YAHOO.widget.Dialog.prototype.init=function(el,userConfig){YAHOO.widget.Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Dialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.renderEvent.subscribe(this.registerForm,this,true);this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.beforeRenderEvent.subscribe(function(){var buttonCfg=this.cfg.getProperty("buttons");if(buttonCfg&&buttonCfg!="none"){if(!this.footer){this.setFooter("");}}},this,true);this.initEvent.fire(YAHOO.widget.Dialog);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};YAHOO.widget.Dialog.prototype.registerForm=function(){var form=this.element.getElementsByTagName("FORM")[0];if(!form){var formHTML="<form name=\"frm_"+this.id+"\" action=\"\"></form>";this.body.innerHTML+=formHTML;form=this.element.getElementsByTagName("FORM")[0];}
|
||||
this.firstFormElement=function(){for(var f=0;f<form.elements.length;f++){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}
|
||||
return null;}();this.lastFormElement=function(){for(var f=form.elements.length-1;f>=0;f--){var el=form.elements[f];if(el.focus){if(el.type&&el.type!="hidden"){return el;}}}
|
||||
return null;}();this.form=form;if(this.cfg.getProperty("modal")&&this.form){var me=this;var firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new YAHOO.util.KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
|
||||
var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}
|
||||
YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}
|
||||
htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b==0){this.firstButton=button.htmlButton;}
|
||||
var lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new YAHOO.util.KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}};YAHOO.widget.Dialog.prototype.configButtons=function(type,args,obj){var buttons=args[0];if(buttons!="none"){this.buttonSpan=null;this.buttonSpan=document.createElement("SPAN");this.buttonSpan.className="button-group";for(var b=0;b<buttons.length;b++){var button=buttons[b];var htmlButton=document.createElement("BUTTON");htmlButton.setAttribute("type","button");if(button.isDefault){htmlButton.className="default";this.defaultHtmlButton=htmlButton;}
|
||||
htmlButton.appendChild(document.createTextNode(button.text));YAHOO.util.Event.addListener(htmlButton,"click",button.handler,this,true);this.buttonSpan.appendChild(htmlButton);button.htmlButton=htmlButton;if(b===0){this.firstButton=button.htmlButton;}
|
||||
if(b==(buttons.length-1)){this.lastButton=button.htmlButton;}}
|
||||
this.setFooter(this.buttonSpan);this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");}else{if(this.buttonSpan){if(this.buttonSpan.parentNode){this.buttonSpan.parentNode.removeChild(this.buttonSpan);}
|
||||
this.buttonSpan=null;this.firstButtom=null;this.lastButton=null;this.defaultHtmlButton=null;}}}
|
||||
YAHOO.widget.Dialog.prototype.configOnSuccess=function(type,args,obj){};YAHOO.widget.Dialog.prototype.configOnFailure=function(type,args,obj){};YAHOO.widget.Dialog.prototype.doSubmit=function(){};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
|
||||
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}}
|
||||
YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
|
||||
var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}}
|
||||
YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}}
|
||||
YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}}
|
||||
YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}}
|
||||
YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}}
|
||||
YAHOO.widget.Dialog.prototype.validate=function(){return true;}
|
||||
YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}}
|
||||
YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();}
|
||||
YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}
|
||||
break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=new Array();for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval==""){selval=option.text;}
|
||||
this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
|
||||
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}};YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}
|
||||
var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};YAHOO.widget.Dialog.prototype.blurButtons=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.blur();}}};YAHOO.widget.Dialog.prototype.focusFirstButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[0].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.focusLastButton=function(){var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){var html=buttons[buttons.length-1].htmlButton;if(html){html.focus();}}};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i in this.form){var formItem=form[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[i]=formItem.checked;break;case"textbox":case"text":case"hidden":data[i]=formItem.value;break;}
|
||||
break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=[];for(var x=0;x<formItem.options.length;x++){var option=formItem.options[x];if(option.selected){var selval=option.value;if(!selval||selval===""){selval=option.text;}
|
||||
val[val.length]=selval;}}
|
||||
data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){switch(formItem[0].tagName){case"INPUT":switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}
|
||||
break;case"checkbox":var cbArray=new Array();for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}
|
||||
data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){if(formItem[0].tagName=="INPUT"){switch(formItem[0].type){case"radio":for(var r=0;r<formItem.length;r++){var radio=formItem[r];if(radio.checked){data[radio.name]=radio.value;break;}}
|
||||
break;case"checkbox":var cbArray=[];for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}
|
||||
data[formItem[0].name]=cbArray;break;}}}}}}
|
||||
return data;}
|
||||
YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;}
|
||||
YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});}
|
||||
YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);}
|
||||
YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";}
|
||||
YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}}
|
||||
YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}}
|
||||
YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;}
|
||||
YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
|
||||
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;}
|
||||
YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);}
|
||||
YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();}
|
||||
YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){}
|
||||
YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
|
||||
return output;}
|
||||
YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
|
||||
return data;};YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;};YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);YAHOO.widget.SimpleDialog.ICON_BLOCK="nt/ic/ut/bsc/blck16_1.gif";YAHOO.widget.SimpleDialog.ICON_ALARM="nt/ic/ut/bsc/alrt16_1.gif";YAHOO.widget.SimpleDialog.ICON_HELP="nt/ic/ut/bsc/hlp16_1.gif";YAHOO.widget.SimpleDialog.ICON_INFO="nt/ic/ut/bsc/info16_1.gif";YAHOO.widget.SimpleDialog.ICON_WARN="nt/ic/ut/bsc/warn16_1.gif";YAHOO.widget.SimpleDialog.ICON_TIP="nt/ic/ut/bsc/tip16_1.gif";YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG="simple-dialog";YAHOO.widget.SimpleDialog.prototype.initDefaultConfig=function(){YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty("icon",{value:"none",handler:this.configIcon,suppressEvent:true});this.cfg.addProperty("text",{value:"",handler:this.configText,suppressEvent:true,supercedes:["icon"]});};YAHOO.widget.SimpleDialog.prototype.init=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(YAHOO.widget.SimpleDialog);};YAHOO.widget.SimpleDialog.prototype.registerForm=function(){YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+this.id+"\" value=\"\"/>";};YAHOO.widget.SimpleDialog.prototype.configIcon=function(type,args,obj){var icon=args[0];if(icon&&icon!="none"){var iconHTML="<img src=\""+this.imageRoot+icon+"\" class=\"icon\" />";this.body.innerHTML=iconHTML+this.body.innerHTML;}};YAHOO.widget.SimpleDialog.prototype.configText=function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}};YAHOO.widget.SimpleDialog.prototype.toString=function(){return"SimpleDialog "+this.id;};YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
|
||||
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
|
||||
return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
|
||||
if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);}
|
||||
fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
|
||||
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();}
|
||||
fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}}
|
||||
fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";}
|
||||
slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&¤tX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
|
||||
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");}
|
||||
slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();}
|
||||
slide.handleStartAnimateOut=function(type,args,obj){var clientWidth=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(clientWidth+25),y];}
|
||||
slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var x=pos[0];var y=pos[1];obj.overlay.cfg.setProperty("xy",[x,y],true);obj.overlay.cfg.refireEvent("iframe");}
|
||||
slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");var offsetWidth=obj.overlay.element.offsetWidth;obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;}
|
||||
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&¤tX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
|
||||
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};
|
2443
lib/yui/container/container.js
vendored
2443
lib/yui/container/container.js
vendored
File diff suppressed because it is too large
Load diff
1698
lib/yui/container/container_core-debug.js
vendored
1698
lib/yui/container/container_core-debug.js
vendored
File diff suppressed because it is too large
Load diff
170
lib/yui/container/container_core-min.js
vendored
170
lib/yui/container/container_core-min.js
vendored
|
@ -1,49 +1,25 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}}
|
||||
YAHOO.util.Config.prototype={owner:null,configChangedEvent:null,queueInProgress:false,addProperty:function(key,propertyObject){},getConfig:function(){},getProperty:function(key){},resetProperty:function(key){},setProperty:function(key,value,silent){},queueProperty:function(key,value){},refireEvent:function(key){},applyConfig:function(userConfig,init){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key,handler,obj,override){},unsubscribeFromConfigEvent:function(key,handler,obj){},checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}}
|
||||
YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}}
|
||||
this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
|
||||
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}}
|
||||
this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop]
|
||||
if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
|
||||
return cfg;}
|
||||
this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}}
|
||||
this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){this.setProperty(key,initialConfig[key].value);}else{return undefined;}}
|
||||
this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
|
||||
return true;}}else{return false;}}}
|
||||
this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
|
||||
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
|
||||
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
|
||||
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
|
||||
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
|
||||
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
|
||||
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
|
||||
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
|
||||
return true;}else{return false;}}
|
||||
this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}}
|
||||
this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
|
||||
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}}
|
||||
this.refresh=function(){for(var prop in config){this.refireEvent(prop);}}
|
||||
this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
|
||||
this.queueInProgress=false;eventQueue=new Array();}
|
||||
this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
|
||||
return true;}else{return false;}}
|
||||
this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}}
|
||||
this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
|
||||
return output;}
|
||||
this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
|
||||
return output;}}
|
||||
YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;break;}}
|
||||
return false;}
|
||||
YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}}
|
||||
YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL=null;YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,childNodesInDOM:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,beforeInitEvent:null,initEvent:null,appendEvent:null,beforeRenderEvent:null,renderEvent:null,changeHeaderEvent:null,changeBodyEvent:null,changeFooterEvent:null,changeContentEvent:null,destroyEvent:null,beforeShowEvent:null,showEvent:null,beforeHideEvent:null,hideEvent:null,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")==0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
|
||||
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
|
||||
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
|
||||
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
|
||||
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
|
||||
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
|
||||
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
|
||||
return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};YAHOO.widget.Module.IMG_ROOT="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO.widget.Module.IMG_ROOT_SSL="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO.widget.Module.CSS_MODULE="module";YAHOO.widget.Module.CSS_HEADER="hd";YAHOO.widget.Module.CSS_BODY="bd";YAHOO.widget.Module.CSS_FOOTER="ft";YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,initEvents:function(){this.beforeInitEvent=new YAHOO.util.CustomEvent("beforeInit");this.initEvent=new YAHOO.util.CustomEvent("init");this.appendEvent=new YAHOO.util.CustomEvent("append");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.changeHeaderEvent=new YAHOO.util.CustomEvent("changeHeader");this.changeBodyEvent=new YAHOO.util.CustomEvent("changeBody");this.changeFooterEvent=new YAHOO.util.CustomEvent("changeFooter");this.changeContentEvent=new YAHOO.util.CustomEvent("changeContent");this.destroyEvent=new YAHOO.util.CustomEvent("destroy");this.beforeShowEvent=new YAHOO.util.CustomEvent("beforeShow");this.showEvent=new YAHOO.util.CustomEvent("show");this.beforeHideEvent=new YAHOO.util.CustomEvent("beforeHide");this.hideEvent=new YAHOO.util.CustomEvent("hide");},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty("visible",{value:true,handler:this.configVisible,validator:this.cfg.checkBoolean});this.cfg.addProperty("effect",{suppressEvent:true,supercedes:["visible"]});this.cfg.addProperty("monitorresize",{value:true,handler:this.configMonitorResize});},init:function(el,userConfig){this.initEvents();this.beforeInitEvent.fire(YAHOO.widget.Module);this.cfg=new YAHOO.util.Config(this);if(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}
|
||||
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}
|
||||
this.element=el;if(el.id){this.id=el.id;}
|
||||
var childNodes=this.element.childNodes;if(childNodes){for(var i=0;i<childNodes.length;i++){var child=childNodes[i];switch(child.className){case YAHOO.widget.Module.CSS_HEADER:this.header=child;break;case YAHOO.widget.Module.CSS_BODY:this.body=child;break;case YAHOO.widget.Module.CSS_FOOTER:this.footer=child;break;}}}
|
||||
this.initDefaultConfig();YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
|
||||
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&this.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=this.RESIZE_MONITOR_SECURE_URL;}
|
||||
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}
|
||||
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}
|
||||
if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}
|
||||
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}
|
||||
|
@ -57,97 +33,67 @@ if(typeof footerContent=="string"){this.footer.innerHTML=footerContent;}else{thi
|
|||
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){if(!this.footer){this.footer=document.createElement("DIV");this.footer.className=YAHOO.widget.Module.CSS_FOOTER;}
|
||||
this.footer.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
|
||||
var me=this;var appendTo=function(element){if(typeof element=="string"){element=document.getElementById(element);}
|
||||
if(element){element.appendChild(me.element);me.appendEvent.fire();}}
|
||||
if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
|
||||
if(element){element.appendChild(me.element);me.appendEvent.fire();}};if(appendToNode){appendTo(appendToNode);}else{if(!YAHOO.util.Dom.inDocument(this.element)){return false;}}
|
||||
if(this.header&&!YAHOO.util.Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
|
||||
if(this.body&&!YAHOO.util.Dom.inDocument(this.body)){if(this.footer&&YAHOO.util.Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
|
||||
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
|
||||
this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}
|
||||
if(parent){parent.removeChild(this.element);}
|
||||
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}}
|
||||
YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;}
|
||||
YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);}
|
||||
YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="promo/m/irs/blank.gif";YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.beforeMoveEvent=null;YAHOO.widget.Overlay.prototype.moveEvent=null;YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.element=null;this.header=null;this.body=null;this.footer=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{YAHOO.util.Event.removeListener(this.resizeMonitor,"resize",this.onDomResize);this.resizeMonitor=null;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"
|
||||
YAHOO.widget.Overlay.TOP_LEFT="tl";YAHOO.widget.Overlay.TOP_RIGHT="tr";YAHOO.widget.Overlay.BOTTOM_LEFT="bl";YAHOO.widget.Overlay.BOTTOM_RIGHT="br";YAHOO.widget.Overlay.CSS_OVERLAY="overlay";YAHOO.widget.Overlay.prototype.init=function(el,userConfig){YAHOO.widget.Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(YAHOO.widget.Overlay);YAHOO.util.Dom.addClass(this.element,YAHOO.widget.Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
|
||||
this.initEvent.fire(YAHOO.widget.Overlay);}
|
||||
YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);}
|
||||
YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});}
|
||||
YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");}
|
||||
YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");}
|
||||
YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");var effect=this.cfg.getProperty("effect");var effectInstances=new Array();if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
|
||||
this.initEvent.fire(YAHOO.widget.Overlay);};YAHOO.widget.Overlay.prototype.initEvents=function(){YAHOO.widget.Overlay.superclass.initEvents.call(this);this.beforeMoveEvent=new YAHOO.util.CustomEvent("beforeMove",this);this.moveEvent=new YAHOO.util.CustomEvent("move",this);};YAHOO.widget.Overlay.prototype.initDefaultConfig=function(){YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty("x",{handler:this.configX,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("y",{handler:this.configY,validator:this.cfg.checkNumber,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("xy",{handler:this.configXY,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("context",{handler:this.configContext,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("fixedcenter",{value:false,handler:this.configFixedCenter,validator:this.cfg.checkBoolean,supercedes:["iframe","visible"]});this.cfg.addProperty("width",{handler:this.configWidth,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("height",{handler:this.configHeight,suppressEvent:true,supercedes:["iframe"]});this.cfg.addProperty("zIndex",{value:null,handler:this.configzIndex});this.cfg.addProperty("constraintoviewport",{value:false,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});this.cfg.addProperty("iframe",{value:(this.browser=="ie"?true:false),handler:this.configIframe,validator:this.cfg.checkBoolean,supercedes:["zIndex"]});};YAHOO.widget.Overlay.prototype.moveTo=function(x,y){this.cfg.setProperty("xy",[x,y]);};YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"show-scrollbars");YAHOO.util.Dom.addClass(this.element,"hide-scrollbars");};YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars=function(){YAHOO.util.Dom.removeClass(this.element,"hide-scrollbars");YAHOO.util.Dom.addClass(this.element,"show-scrollbars");};YAHOO.widget.Overlay.prototype.configVisible=function(type,args,obj){var visible=args[0];var currentVis=YAHOO.util.Dom.getStyle(this.element,"visibility");if(currentVis=="inherit"){var e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=YAHOO.util.Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}
|
||||
e=e.parentNode;}
|
||||
if(currentVis=="inherit"){currentVis="visible";}}
|
||||
var effect=this.cfg.getProperty("effect");var effectInstances=[];if(effect){if(effect instanceof Array){for(var i=0;i<effect.length;i++){var eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
|
||||
var isMacGecko=(this.platform=="mac"&&this.browser=="gecko");if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
|
||||
if(effect){if(visible){if(currentVis!="visible"){this.beforeShowEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){e.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
|
||||
e.animateIn();}}}}else{if(currentVis!="visible"){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
|
||||
if(effect){if(currentVis!="hidden"){this.beforeHideEvent.fire();for(var i=0;i<effectInstances.length;i++){var e=effectInstances[i];if(i==0&&!YAHOO.util.Config.alreadySubscribed(e.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){e.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
|
||||
e.animateOut();}}}else{if(currentVis!="hidden"){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}}
|
||||
YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}}
|
||||
YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
|
||||
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();for(var j=0;j<effectInstances.length;j++){var ei=effectInstances[j];if(j===0&&!YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
|
||||
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
|
||||
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();for(var k=0;k<effectInstances.length;k++){var h=effectInstances[k];if(k===0&&!YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
|
||||
h.animateOut();}}else if(currentVis===""){YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();YAHOO.util.Dom.setStyle(this.element,"visibility","hidden");this.cfg.refireEvent("iframe");this.hideEvent.fire();}}}};YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent=function(){if(this.cfg.getProperty("visible")){this.center();}};YAHOO.widget.Overlay.prototype.configFixedCenter=function(type,args,obj){var val=args[0];if(val){this.center();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent,this.doCenterOnDOMEvent,this)){YAHOO.widget.Overlay.windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}};YAHOO.widget.Overlay.prototype.configHeight=function(type,args,obj){var height=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configWidth=function(type,args,obj){var width=args[0];var el=this.element;YAHOO.util.Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.configzIndex=function(type,args,obj){var zIndex=args[0];var el=this.element;if(!zIndex){zIndex=YAHOO.util.Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
|
||||
if(this.iframe){if(zIndex<=0){zIndex=1;}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"zIndex",(zIndex-1));}
|
||||
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);}
|
||||
YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);}
|
||||
YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];var el=this.element;var showIframe=function(){if(this.iframe){this.iframe.style.display="block";}}
|
||||
var hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}}
|
||||
if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,showIframe,this)){this.showEvent.subscribe(showIframe,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,hideIframe,this)){this.hideEvent.subscribe(hideIframe,this,true);}
|
||||
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};YAHOO.widget.Overlay.prototype.configXY=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configX=function(type,args,obj){var x=args[0];var y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.configY=function(type,args,obj){var x=this.cfg.getProperty("x");var y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");YAHOO.util.Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}
|
||||
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}
|
||||
var x=this.cfg.getProperty("x");var y=this.cfg.getProperty("y");if(!x||!y){this.syncPosition();x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");}
|
||||
if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}
|
||||
var parent=el.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){showIframe.call(this);}else{hideIframe.call(this);}}
|
||||
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}
|
||||
YAHOO.util.Dom.setStyle(this.iframe,"position","absolute");YAHOO.util.Dom.setStyle(this.iframe,"border","none");YAHOO.util.Dom.setStyle(this.iframe,"margin","0");YAHOO.util.Dom.setStyle(this.iframe,"padding","0");YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}
|
||||
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}
|
||||
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=el.clientWidth;var height=el.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
|
||||
this.showEvent.unsubscribe(showIframe,this);this.hideEvent.unsubscribe(hideIframe,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}}
|
||||
YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
|
||||
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}}
|
||||
YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
|
||||
YAHOO.util.Dom.setXY(this.iframe,[x,y]);var width=this.element.clientWidth;var height=this.element.clientHeight;YAHOO.util.Dom.setStyle(this.iframe,"width",(width+2)+"px");YAHOO.util.Dom.setStyle(this.iframe,"height",(height+2)+"px");if(iframeDisplay=="none"){this.iframe.style.display="none";}}}else{if(this.iframe){this.iframe.style.display="none";}
|
||||
this.showEvent.unsubscribe(this.showIframe,this);this.hideEvent.unsubscribe(this.hideIframe,this);}};YAHOO.widget.Overlay.prototype.configConstrainToViewport=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}};YAHOO.widget.Overlay.prototype.configContext=function(type,args,obj){var contextArgs=args[0];if(contextArgs){var contextEl=contextArgs[0];var elementMagnetCorner=contextArgs[1];var contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
|
||||
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}};YAHOO.widget.Overlay.prototype.align=function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context");if(contextArgs){var context=contextArgs[0];var element=this.element;var me=this;if(!elementAlign){elementAlign=contextArgs[1];}
|
||||
if(!contextAlign){contextAlign=contextArgs[2];}
|
||||
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}}
|
||||
switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}}
|
||||
YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var width=parseInt(this.cfg.getProperty("width"));if(isNaN(width)){width=0;}
|
||||
var offsetHeight=this.element.offsetHeight;var offsetWidth=(width>0?width:this.element.offsetWidth);var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=window.scrollX||document.documentElement.scrollLeft;var scrollY=window.scrollY||document.documentElement.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
|
||||
if(element&&context){var elementRegion=YAHOO.util.Dom.getRegion(element);var contextRegion=YAHOO.util.Dom.getRegion(context);var doAlign=function(v,h){switch(elementAlign){case YAHOO.widget.Overlay.TOP_LEFT:me.moveTo(h,v);break;case YAHOO.widget.Overlay.TOP_RIGHT:me.moveTo(h-element.offsetWidth,v);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:me.moveTo(h,v-element.offsetHeight);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:me.moveTo(h-element.offsetWidth,v-element.offsetHeight);break;}};switch(contextAlign){case YAHOO.widget.Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case YAHOO.widget.Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case YAHOO.widget.Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case YAHOO.widget.Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var topConstraint=scrollY+10;var leftConstraint=scrollX+10;var bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;var rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
|
||||
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
|
||||
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);}
|
||||
YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.element.style.left=parseInt(x)+"px";this.element.style.top=parseInt(y)+"px";this.syncPosition();this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);}
|
||||
YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);this.cfg.refireEvent("iframe");}
|
||||
YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
|
||||
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;}
|
||||
YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){YAHOO.widget.Overlay.windowScrollEvent.fire();}
|
||||
YAHOO.widget.Overlay.windowResizeHandler=function(e){YAHOO.widget.Overlay.windowResizeEvent.fire();}
|
||||
YAHOO.widget.Overlay._initialized==null;if(YAHOO.widget.Overlay._initialized==null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
|
||||
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);}
|
||||
YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},getActive:function(){},focus:function(overlay){},remove:function(overlay){},blurAll:function(){},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;}
|
||||
this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex)+1));}
|
||||
this.overlays.sort(this.compareZIndexDesc);}}
|
||||
this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null
|
||||
o.blurEvent=null;o.focus=null;o.blur=null;}}
|
||||
this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}}
|
||||
var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=new Array();}
|
||||
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();}
|
||||
overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();}
|
||||
var focusOnDomEvent=function(e,obj){overlay.focus();}
|
||||
var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex));}else{overlay.cfg.setProperty("zIndex",0);}
|
||||
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;var viewPortWidth=YAHOO.util.Dom.getClientWidth();var viewPortHeight=YAHOO.util.Dom.getClientHeight();var elementWidth=this.element.offsetWidth;var elementHeight=this.element.offsetHeight;var x=(viewPortWidth/2)-(elementWidth/2)+scrollX;var y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};YAHOO.widget.Overlay.prototype.syncPosition=function(){var pos=YAHOO.util.Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
|
||||
this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}
|
||||
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}
|
||||
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){YAHOO.util.Event.addListener(window,"scroll",YAHOO.widget.Overlay.windowScrollHandler);YAHOO.util.Event.addListener(window,"resize",YAHOO.widget.Overlay.windowResizeHandler);YAHOO.widget.Overlay._initialized=true;}
|
||||
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
|
||||
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){this.blurAll();activeOverlay=o;YAHOO.util.Dom.addClass(activeOverlay.element,YAHOO.widget.OverlayManager.CSS_FOCUSED);this.overlays.sort(this.compareZIndexDesc);var topZIndex=YAHOO.util.Dom.getStyle(this.overlays[0].element,"zIndex");if(!isNaN(topZIndex)&&this.overlays[0]!=overlay){activeOverlay.cfg.setProperty("zIndex",(parseInt(topZIndex,10)+2));}
|
||||
this.overlays.sort(this.compareZIndexDesc);}};this.remove=function(overlay){var o=this.find(overlay);if(o){var originalZ=YAHOO.util.Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,this.overlays.length-1);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){activeOverlay=null;for(var o=0;o<this.overlays.length;o++){YAHOO.util.Dom.removeClass(this.overlays[o].element,YAHOO.widget.OverlayManager.CSS_FOCUSED);}};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
|
||||
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},register:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=new YAHOO.util.CustomEvent("focus");overlay.blurEvent=new YAHOO.util.CustomEvent("blur");var mgr=this;overlay.focus=function(){mgr.focus(this);this.focusEvent.fire();};overlay.blur=function(){mgr.blurAll();this.blurEvent.fire();};var focusOnDomEvent=function(e,obj){overlay.focus();};var focusevent=this.cfg.getProperty("focusevent");YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);var zIndex=YAHOO.util.Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
|
||||
this.overlays.push(overlay);return true;}else if(overlay instanceof Array){var regcount=0;for(var i=0;i<overlay.length;i++){if(this.register(overlay[i])){regcount++;}}
|
||||
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o].id==overlay){return this.overlays[o];}}}
|
||||
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}}
|
||||
YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
|
||||
if(regcount>0){return true;}}else{return false;}},find:function(overlay){if(overlay instanceof YAHOO.widget.Overlay){for(var o=0;o<this.overlays.length;o++){if(this.overlays[o]==overlay){return this.overlays[o];}}}else if(typeof overlay=="string"){for(var p=0;p<this.overlays.length;p++){if(this.overlays[p].id==overlay){return this.overlays[p];}}}
|
||||
return null;},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex");var zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].show();}},hideAll:function(){for(var o=0;o<this.overlays.length;o++){this.overlays[o].hide();}},toString:function(){return"OverlayManager";}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
|
||||
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
|
||||
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
|
||||
function handleKeyPress(e,obj){var keyPressed=e.charCode||e.keyCode;if(!keyData.shift)keyData.shift=false;if(!keyData.alt)keyData.alt=false;if(!keyData.ctrl)keyData.ctrl=false;if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){if(keyPressed==keyData.keys[i]){keyEvent.fire(keyPressed,e);break;}}}else{if(keyPressed==keyData.keys){keyEvent.fire(keyPressed,e);}}}}
|
||||
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
|
||||
if(!keyData.alt){keyData.alt=false;}
|
||||
if(!keyData.ctrl){keyData.ctrl=false;}
|
||||
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
|
||||
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
|
||||
this.enabled=true;}
|
||||
this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
|
||||
this.enabled=false;}
|
||||
this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");}}
|
||||
YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.prototype.enabled=null;YAHOO.util.KeyListener.prototype.enable=function(){};YAHOO.util.KeyListener.prototype.disable=function(){};YAHOO.util.KeyListener.prototype.enabledEvent=null;YAHOO.util.KeyListener.prototype.disabledEvent=null;
|
||||
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
|
||||
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
|
||||
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};YAHOO.widget.ContainerEffect.prototype.init=function(){this.beforeAnimateInEvent=new YAHOO.util.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent=new YAHOO.util.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent=new YAHOO.util.CustomEvent("animateInComplete");this.animateOutCompleteEvent=new YAHOO.util.CustomEvent("animateOutComplete");this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);};YAHOO.widget.ContainerEffect.prototype.animateIn=function(){this.beforeAnimateInEvent.fire();this.animIn.animate();};YAHOO.widget.ContainerEffect.prototype.animateOut=function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut=function(type,args,obj){};YAHOO.widget.ContainerEffect.prototype.toString=function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
|
||||
return output;};YAHOO.widget.ContainerEffect.FADE=function(overlay,dur){var fade=new YAHOO.widget.ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
|
||||
if(obj.overlay.underlay){obj.initialUnderlayOpacity=YAHOO.util.Dom.getStyle(obj.overlay.underlay,"opacity");obj.overlay.underlay.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
if(obj.overlay.underlay){YAHOO.util.Dom.setStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
|
||||
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){YAHOO.util.Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){obj.overlay.underlay.style.filter=null;}};fade.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}
|
||||
YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");YAHOO.util.Dom.setStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};YAHOO.widget.ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||YAHOO.util.Dom.getX(overlay.element);var y=overlay.cfg.getProperty("y")||YAHOO.util.Dom.getY(overlay.element);var clientWidth=YAHOO.util.Dom.getClientWidth();var offsetWidth=overlay.element.offsetWidth;var slide=new YAHOO.widget.ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:YAHOO.util.Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:YAHOO.util.Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=(-25-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var currentX=pos[0];var currentY=pos[1];if(YAHOO.util.Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&¤tX<x){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","visible");}
|
||||
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=YAHOO.util.Dom.getViewportWidth();var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var yso=pos[1];var currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=YAHOO.util.Dom.getXY(obj.overlay.element);var xto=pos[0];var yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){YAHOO.util.Dom.setStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};
|
1702
lib/yui/container/container_core.js
vendored
1702
lib/yui/container/container_core.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,34 @@
|
|||
Dom Release Notes
|
||||
|
||||
*** version .12.0 ***
|
||||
|
||||
* fixed getXY for IE null parent
|
||||
* branching set/getStyle at load time instead of run time
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
* fixed getX and getY returning incorrect values for collections
|
||||
* fixed getXY incorrectly calculated for Opera inline elements
|
||||
* fixed isAncestor failure in safari when 2nd arg is document.documentElement
|
||||
* fixed infinite loop in replaceClass when oldClassName == newClassName
|
||||
* getDocumentWidth no longer includes scrollbars
|
||||
|
||||
|
||||
*** version 0.11.2 ***
|
||||
* limit depth of parent.document crawl to 1 for getXY
|
||||
* test offsetParent instead of parentNode for getXY
|
||||
* return null if no el fo r get
|
||||
* just addClass if no class to replace for replaceClass
|
||||
|
||||
|
||||
*** version 0.11.1 ***
|
||||
|
||||
* return null if el is null for get()
|
||||
* test offsetParent rather than parentNode for getXY()
|
||||
* limit depth of parent.document crawl for IE getXY() to 1
|
||||
* if no oldClassName to replace, just addClass for replaceClass()
|
||||
|
||||
|
||||
*** version 0.11.0 ***
|
||||
* Work around Opera 9 broken currentStyle
|
||||
* Removed timeout wrapper from setXY retry
|
||||
|
|
1419
lib/yui/dom/dom-debug.js
vendored
1419
lib/yui/dom/dom-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/dom/dom-min.js
vendored
2
lib/yui/dom/dom-min.js
vendored
File diff suppressed because one or more lines are too long
1407
lib/yui/dom/dom.js
vendored
1407
lib/yui/dom/dom.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,53 @@
|
|||
Drag and Drop Release Notes
|
||||
|
||||
0.12.0
|
||||
|
||||
* The logic to determine if a drag should be initiated has been isolated
|
||||
to the clickValidator method. This method can be overridden to provide
|
||||
custom valdiation logic. For example, it is possible to specify hotspots
|
||||
of any dimension or shape. The provided example shows how to make only
|
||||
a circular region in the middle of the element initiate a drag.
|
||||
|
||||
* Added a new drag and drop event: onInvalidDrop. This is executed when
|
||||
the dragged element in dropped in a location without a target. Previously
|
||||
this condition could only detected by implementing handlers for three
|
||||
other events.
|
||||
|
||||
* Now accepts an element reference in lieu of an id. Ids will
|
||||
be generated if the element does not have one.
|
||||
|
||||
* Fixed horizontal autoscroll when scrollTop is zero.
|
||||
|
||||
* Added hasOuterHandles property to bypass the isOverTarget check in the
|
||||
mousedown validation routine. Fixes setOuterHandleElId.
|
||||
|
||||
0.11.4
|
||||
|
||||
* YAHOO.util.DragDropMgr.swapNode now handles adjacent nodes properly
|
||||
|
||||
* Fixed missing variable declarations
|
||||
|
||||
0.11.3
|
||||
|
||||
* Fixed a JavaScript error that would be generated when trying to implement
|
||||
DDProxy using the default settings and a tiny element.
|
||||
|
||||
* Fixed an error that resulted when constraints were applied to DragDrop
|
||||
instances.
|
||||
|
||||
0.11.2
|
||||
|
||||
* Drag and drop will no longer interfere with selecting text on elements
|
||||
that are not involved in drag and drop.
|
||||
|
||||
* The shared drag and drop proxy element now resizes correctly when autoResize
|
||||
is enabled.
|
||||
|
||||
0.11.1
|
||||
|
||||
* Fixes an issue where the setXY cache could get out of sync if the element's
|
||||
offsetParent is changed during onDragDrop.
|
||||
|
||||
0.11.0
|
||||
|
||||
* The Dom.util.setXY calculation for the initial placement of the dragged
|
||||
|
@ -32,7 +80,7 @@ Drag and Drop Release Notes
|
|||
|
||||
0.10.0
|
||||
|
||||
* Improved the performance in intersect mode
|
||||
* Improved the performance when in intersect mode
|
||||
|
||||
* It was possible for the drag and drop initialization to be skipped
|
||||
for very slow loading pages. This was fixed.
|
||||
|
|
1799
lib/yui/dragdrop/dragdrop-debug.js
vendored
1799
lib/yui/dragdrop/dragdrop-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/dragdrop/dragdrop-min.js
vendored
2
lib/yui/dragdrop/dragdrop-min.js
vendored
File diff suppressed because one or more lines are too long
1727
lib/yui/dragdrop/dragdrop.js
vendored
1727
lib/yui/dragdrop/dragdrop.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,72 @@
|
|||
|
||||
YUI Library - Event - Release Notes
|
||||
|
||||
0.12.0
|
||||
|
||||
* If the function argument is not provided to Event.removeListener, all
|
||||
all listeners for the specified event type on the element will be removed.
|
||||
|
||||
* CustomEvent now has an optional parameter that defines the signature of
|
||||
the listeners for this event. Two signatures are supported:
|
||||
|
||||
YAHOO.util.CustomEvent.LIST:
|
||||
param1: event name
|
||||
param2: array of arguments provided to fire()
|
||||
param3: <optional> the custom object supplied to subscribe()
|
||||
|
||||
YAHOO.util.CustomEvent.FLAT:
|
||||
param1: the first argument provided to fire()
|
||||
param2: <optional> the custom object supplied to subscribe()
|
||||
|
||||
The new flat signature makes it possible to provide a better API
|
||||
when using custom events, and it makes it possible to transparently
|
||||
wrap DOM events.
|
||||
|
||||
* The parameters for overriding scope in both Event.addListener, and
|
||||
CustomEvent.subscribe have been augmented. In addition to the
|
||||
previous behavior where a true value would make the previous parameter
|
||||
the execution scope, an object can be supplied instead. If an object
|
||||
is provided, that object becomes the scope obj. This makes it possible
|
||||
to pass a both a custom object and adjust the scope to a different object.
|
||||
|
||||
* Added EventProvider, which is a wrapper for CustomEvent that makes it
|
||||
possible to subscribe to events by name, whether or not the event has
|
||||
been created. This class was designed to be used with YAHOO.augment.
|
||||
EventProvider custom events are created with the new FLAT listener
|
||||
signature.
|
||||
|
||||
* CustomEvent subscribers can return false to stop the propagation of
|
||||
the event.
|
||||
|
||||
* CustomEvents now have an onSubscribe custom event that can used to the
|
||||
case where a subscriber subscribes to an one-time event that has already
|
||||
happened. Also provides a way for the implementer to defer initialization
|
||||
logic until after the first subscription.
|
||||
|
||||
* Event.getCharCode now always returns keyCode if charCode is not available.
|
||||
|
||||
* Added Event.onContentReady, which is similar to onAvailable, but it also
|
||||
checks simblings to try to determine when the element's children are
|
||||
available.
|
||||
|
||||
0.11.4
|
||||
|
||||
* Fixed a memory leak in IE6 that occurred when the utility was hosted in
|
||||
an iframe.
|
||||
|
||||
* Fixed an issue with Safari click listeners when listeners were removed.
|
||||
|
||||
0.11.3
|
||||
|
||||
* The listener cache is now pruned when events are removed. This fixes
|
||||
a performance issue when adding many listeners, removing them, and
|
||||
adding them again repeatedly.
|
||||
|
||||
* Safari click listeners will work correctly if a bound element is removed
|
||||
from the DOM and a new element with the same ID is added.
|
||||
|
||||
* Removed the code that automatically unsubscribed custom event listeners.
|
||||
|
||||
0.11.0
|
||||
|
||||
* Added Event.purgeElement which will remove all listeners added via
|
||||
|
@ -53,3 +119,4 @@ YUI Library - Event - Release Notes
|
|||
* Fixed browser detection for Opera installations reporting as IE.
|
||||
|
||||
* It is now possible to remove and re-add legacy events (Safari click event).
|
||||
|
||||
|
|
1076
lib/yui/event/event-debug.js
vendored
1076
lib/yui/event/event-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/event/event-min.js
vendored
2
lib/yui/event/event-min.js
vendored
File diff suppressed because one or more lines are too long
1056
lib/yui/event/event.js
vendored
1056
lib/yui/event/event.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,9 +1,13 @@
|
|||
CSS Fonts Release Notes
|
||||
YUI Library - Fonts - Release Notes
|
||||
|
||||
*** version 0.11.0 ***
|
||||
Version 0.12.0
|
||||
|
||||
* No changes.
|
||||
* No changes.
|
||||
|
||||
*** version 0.10.0 ***
|
||||
Version 0.11.0
|
||||
|
||||
* Initial release.
|
||||
* No changes.
|
||||
|
||||
Version 0.10.0
|
||||
|
||||
* Initial release.
|
||||
|
|
8
lib/yui/fonts/fonts-min.css
vendored
8
lib/yui/fonts/fonts-min.css
vendored
|
@ -1,7 +1 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 84.5% for !IE, keywords for IE
|
||||
* 84.5% for !IE, keywords for IE to preserve user font-size adjustment
|
||||
* Percents could work for IE, but for backCompat purposes, we are using keywords.
|
||||
* x-small is for IE < 6 and IE6 quirks mode.
|
||||
* x-small is for IE6/7 quirks mode.
|
||||
*
|
||||
*/
|
||||
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
|
||||
|
|
|
@ -1,10 +1,40 @@
|
|||
CSS Grids Release Notes
|
||||
YUI Library - Grids - Release Notes
|
||||
|
||||
*** version 0.11.0 ***
|
||||
Version 0.12.0
|
||||
|
||||
* Removed line #43 because it set an already-set value.
|
||||
Was: ".yui-t7 #main .yui-b{min-width:750px;}"
|
||||
* Removed redundant "text-align:left" from nodes below #doc.
|
||||
|
||||
*** version 0.10.0 ***
|
||||
* Removed small-font treatment on #ft.
|
||||
|
||||
* Initial release.
|
||||
* Removed margin-bottom from #hd,#bd.
|
||||
|
||||
* Added two new #doc definitions (#doc2 and #doc3) that provide
|
||||
950px centered and 100% page width presets to supplement the
|
||||
original 750px centered page width.
|
||||
|
||||
* Made ".first" selectors more precise by binding to divs, to
|
||||
make it less likely that our .first definitions will impact
|
||||
nested content elements wishing to use this nomenclature.
|
||||
|
||||
* Fixed "nested yui-gc" bug.
|
||||
|
||||
* Fixed build-process whitespace bug with .yui-t2 and .yui-t5.
|
||||
|
||||
* Migrated .yui-t's technique to "negative margins" technique
|
||||
from "floated ems".
|
||||
|
||||
* The "negative margins" technique caused z-index issues, so
|
||||
position:relative was added to the secondary yui-b to enable
|
||||
correct z-index.
|
||||
|
||||
* Make optimization benefits from inheritence wins via code
|
||||
reorganizations.
|
||||
|
||||
Version 0.11.0
|
||||
|
||||
* Removed line #43 because it set an already-set value.
|
||||
Was: ".yui-t7 #main .yui-b{min-width:750px;}"
|
||||
|
||||
Version 0.10.0
|
||||
|
||||
* Initial release.
|
9
lib/yui/grids/grids-min.css
vendored
9
lib/yui/grids/grids-min.css
vendored
|
@ -1,7 +1,2 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
body{text-align:center;}#doc{width:57.69em;*width:56.3em;min-width:750px;margin:auto;text-align:left;}#hd,#bd{margin-bottom:1em;text-align:left;}#ft{font-size:77%;font-family:verdana;clear:both;}.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b{float:right;}.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{float:left;}.yui-t1 #yui-main .yui-b{width:76%;min-width:570px;}.yui-t1 .yui-b{width:21.33%;min-width:160px;}.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b{width:73.4%;min-width:550px;}.yui-t2 .yui-b, .yui-t4 .yui-b{width:24%;min-width:180px;}.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b{width:57.6%;min-width:430px;}.yui-t3 .yui-b, .yui-t6 .yui-b{width:40%;min-width:300px;}.yui-t5 #yui-main .yui-b{width:65.4%;min-width:490px;}.yui-t5 .yui-b{width:32%;min-width:240px;}.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u{float:right;display:inline;}.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first{float:left;}.yui-g .yui-u, .yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb .first, .yui-gc .first, .yui-gd .first{margin-left:0;}.yui-gc .first, .yui-gd .yui-u{width:66%;}.yui-gd .first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge .first, .yui-gf .yui-u{width:74.2%;}.yui-gf .first{width:24%;}.yui-ge .first{width:74.2%;}#bd:after, .yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd, .yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf{zoom:1;}
|
||||
/* Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
|
|
@ -2,81 +2,129 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
body {
|
||||
text-align:center;
|
||||
|
||||
/* for all templates and grids */
|
||||
body{text-align:center;}
|
||||
#ft{clear:both;}
|
||||
/**/
|
||||
/* 750 centered, and backward compatibility */
|
||||
#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
|
||||
margin:auto;text-align:left;
|
||||
width:57.69em;*width:56.3em;min-width:750px;}
|
||||
/* 950 centered */
|
||||
#doc2 {
|
||||
width:73.074em;*width:71.313em;min-width:950px;}
|
||||
/* 100% with 10px viewport side matting */
|
||||
#doc3 {
|
||||
margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */
|
||||
width:auto;}
|
||||
|
||||
/* below required for all fluid grids; adjust widths and margins above accordingly */
|
||||
|
||||
/* to preserve source-order independence for Gecko */
|
||||
.yui-b{position:relative;}
|
||||
.yui-b{_position:static;} /* for IE < 7 */
|
||||
#yui-main .yui-b{position:static;}
|
||||
|
||||
#yui-main {width:100%;}
|
||||
.yui-t1 #yui-main,
|
||||
.yui-t2 #yui-main,
|
||||
.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
|
||||
|
||||
.yui-t4 #yui-main,
|
||||
.yui-t5 #yui-main,
|
||||
.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
|
||||
|
||||
.yui-t1 .yui-b {
|
||||
float:left;
|
||||
width:12.3207em;*width:12.0106em;}
|
||||
.yui-t1 #yui-main .yui-b{
|
||||
margin-left:13.3207em;*margin-left:13.0106em;
|
||||
}
|
||||
|
||||
#doc {
|
||||
width:57.69em;
|
||||
*width:56.3em; /* IE */
|
||||
min-width:750px;
|
||||
margin:auto;
|
||||
text-align:left;
|
||||
.yui-t2 .yui-b {
|
||||
float:left;
|
||||
width:13.8456em;*width:13.512em;}
|
||||
.yui-t2 #yui-main .yui-b {
|
||||
margin-left:14.8456em;*margin-left:14.512em;
|
||||
}
|
||||
|
||||
#hd,#bd {margin-bottom:1em;text-align:left;}
|
||||
#ft {font-size:77%;font-family:verdana;clear:both;}
|
||||
|
||||
/* rules for main templates */
|
||||
.yui-t1 #yui-main .yui-b, .yui-t2 #yui-main .yui-b, .yui-t3 #yui-main .yui-b, .yui-t4 .yui-b, .yui-t5 .yui-b, .yui-t6 .yui-b {float:right;}
|
||||
.yui-t1 .yui-b, .yui-t2 .yui-b, .yui-t3 .yui-b, .yui-t4 #yui-main .yui-b, .yui-t5 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {float:left;}
|
||||
|
||||
/* t1: L160 */
|
||||
.yui-t1 #yui-main .yui-b {width:76%;min-width:570px;}
|
||||
.yui-t1 .yui-b {width:21.33%;min-width:160px;}
|
||||
|
||||
/* t2 & t4: L180 & R180 */
|
||||
.yui-t2 #yui-main .yui-b, .yui-t4 #yui-main .yui-b {width:73.4%;min-width:550px;}
|
||||
.yui-t2 .yui-b, .yui-t4 .yui-b {width:24%;min-width:180px;}
|
||||
|
||||
/* t3 & t6: L300 & R300 */
|
||||
.yui-t3 #yui-main .yui-b, .yui-t6 #yui-main .yui-b {width:57.6%;min-width:430px;}
|
||||
.yui-t3 .yui-b, .yui-t6 .yui-b {width:40%;min-width:300px;}
|
||||
|
||||
/* t5: R240 */
|
||||
.yui-t5 #yui-main .yui-b {width:65.4%;min-width:490px;}
|
||||
.yui-t5 .yui-b {width:32%;min-width:240px;}
|
||||
|
||||
/* t7: 750 */
|
||||
|
||||
|
||||
|
||||
/* grid-generic rules for all templates */
|
||||
|
||||
/* all modules and grids nested in a grid get floated */
|
||||
.yui-g .yui-u, .yui-g .yui-g, .yui-ge .yui-u, .yui-gf .yui-u {
|
||||
float:right;
|
||||
display:inline; /* IE */
|
||||
.yui-t3 .yui-b {
|
||||
float:left;
|
||||
width:23.0759em;*width:22.52em;}
|
||||
.yui-t3 #yui-main .yui-b {
|
||||
margin-left:24.0759em;*margin-left:23.52em;
|
||||
}
|
||||
|
||||
/* float left and kill margin on first for added flex */
|
||||
.yui-g .first, .yui-gd .first, .yui-ge .first, .yui-gf .first {float:left; }
|
||||
|
||||
/* 2 col */
|
||||
.yui-g .yui-u, .yui-g .yui-g {width:49.1%;}
|
||||
.yui-g .yui-g .yui-u {width:48.1%;} /* smaller for nested to preserve margins */
|
||||
|
||||
/* 3 col */
|
||||
.yui-gb .yui-u, .yui-gc .yui-u, .yui-gd .yui-u {
|
||||
float:left; /* need to reverse the order for 3 */
|
||||
margin-left:2%; *margin-left:1.895%;
|
||||
width:32%;
|
||||
.yui-t4 .yui-b {
|
||||
float:right;
|
||||
width:13.8456em;*width:13.512em;}
|
||||
.yui-t4 #yui-main .yui-b {
|
||||
margin-right:14.8456em;*margin-right:14.512em;
|
||||
}
|
||||
|
||||
.yui-gb .first, .yui-gc .first, .yui-gd .first {margin-left:0;}
|
||||
.yui-t5 .yui-b {
|
||||
float:right;
|
||||
width:18.4608em;*width:18.016em;}
|
||||
.yui-t5 #yui-main .yui-b {
|
||||
margin-right:19.4608em;*margin-right:19.016em;
|
||||
}
|
||||
|
||||
/* colspan 2 */
|
||||
.yui-gc .first, .yui-gd .yui-u {width:66%;}
|
||||
.yui-gd .first {width:32%;}
|
||||
.yui-t6 .yui-b {
|
||||
float:right;
|
||||
width:23.0759em;*width:22.52em;}
|
||||
.yui-t6 #yui-main .yui-b {
|
||||
margin-right:24.0759em;*margin-right:23.52em;
|
||||
}
|
||||
|
||||
/* colspan 3 */
|
||||
.yui-ge .yui-u {width:24%;}
|
||||
.yui-ge .first, .yui-gf .yui-u {width:74.2%;}
|
||||
.yui-gf .first {width:24%;}
|
||||
.yui-ge .first {width:74.2%;}
|
||||
|
||||
/* self clear floated parent containers */
|
||||
#bd:after, .yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after {content:".";display:block;height:0;clear:both;visibility:hidden;}
|
||||
#bd, .yui-g, .yui-gb, .yui-gc, .yui-gd, .yui-ge, .yui-gf {zoom:1;} /* IE */
|
||||
.yui-t7 #yui-main .yui-b {
|
||||
display:block;margin:0 0 1em 0;
|
||||
}
|
||||
#yui-main .yui-b {float:none;width:auto;}
|
||||
/* GRIDS (not TEMPLATES) */
|
||||
.yui-g .yui-u,
|
||||
.yui-g .yui-g,
|
||||
.yui-gc .yui-u,
|
||||
.yui-gc .yui-g .yui-u,
|
||||
.yui-ge .yui-u,
|
||||
.yui-gf .yui-u{float:right;display:inline;}
|
||||
.yui-g div.first,
|
||||
.yui-gc div.first,
|
||||
.yui-gc div.first div.first,
|
||||
.yui-gd div.first,
|
||||
.yui-ge div.first,
|
||||
.yui-gf div.first{float:left;}
|
||||
.yui-g .yui-u,
|
||||
.yui-g .yui-g{width:49.1%;}
|
||||
.yui-g .yui-g .yui-u,
|
||||
.yui-gc .yui-g .yui-u {width:48.1%;}
|
||||
.yui-gb .yui-u,
|
||||
.yui-gc .yui-u,
|
||||
.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}
|
||||
.yui-gb div.first,
|
||||
.yui-gc div.first,
|
||||
.yui-gd div.first{margin-left:0;}
|
||||
.yui-gc div.first,
|
||||
.yui-gd .yui-u{width:66%;}
|
||||
.yui-gd div.first{width:32%;}
|
||||
.yui-ge .yui-u{width:24%;}
|
||||
.yui-ge div.first,
|
||||
.yui-gf .yui-u{width:74.2%;}
|
||||
.yui-gf div.first{width:24%;}
|
||||
.yui-ge div.first{width:74.2%;}
|
||||
#bd:after,
|
||||
.yui-g:after,
|
||||
.yui-gb:after,
|
||||
.yui-gc:after,
|
||||
.yui-gd:after,
|
||||
.yui-ge:after,
|
||||
.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
|
||||
#bd,
|
||||
.yui-g,
|
||||
.yui-gb,
|
||||
.yui-gc,
|
||||
.yui-gd,
|
||||
.yui-ge,
|
||||
.yui-gf{zoom:1;}
|
|
@ -1,5 +1,33 @@
|
|||
Logger Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
* Added method formatMsg(oLogMsg) to support custom formatting of log messages
|
||||
for output to a LogReader.
|
||||
|
||||
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
* The Logger static method enableFirebug() has been RENAMED to
|
||||
enableBrowserConsole().
|
||||
|
||||
* The Logger static method disableFirebug() has been RENAMED to
|
||||
disableBrowserConsole().
|
||||
|
||||
* By default, the Logger will not automatically output to Firebug or Safari's
|
||||
JavaScript console. To enable this feature, implementers should now explicitly
|
||||
call
|
||||
YAHOO.widget.Logger.enableBrowserConsole().
|
||||
|
||||
* Implementers may now cap the size of the YAHOO.widget.Logger stack by setting
|
||||
the property YAHOO.widget.Logger.maxStackEntries.
|
||||
|
||||
* Implementers may now control the number of items displayed in each console by
|
||||
setting the LogReader properties thresholdMax and thresholdMin.
|
||||
|
||||
|
||||
|
||||
*** version 0.11.0 ***
|
||||
|
||||
* Initial release
|
||||
|
|
|
@ -1 +1,20 @@
|
|||
/* logger default styles */
/* font size is controlled here: default 77% */
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}
/* width is controlled here: default 31em */
.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}
.yui-log p {margin:1px;padding:.1em;}
.yui-log button {font-family:monospace;}
.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}
/* height is controlled here: default 20em*/
.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}
.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}
.yui-log .yui-log-ft .yui-log-categoryfilters {}
.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
.yui-log .yui-log-filtergrp {margin-right:.5em;}
.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
.yui-log .warn {background-color:#F58516;} /* F58516 orange */
.yui-log .error {background-color:#E32F0B;color:black;} /* E32F0B red */
.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
.yui-log .window {background-color:#F2E886;} /* F2E886 tan */
|
||||
/* logger default styles */
|
||||
/* font size is controlled here: default 77% */
|
||||
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}
|
||||
/* width is controlled here: default 31em */
|
||||
.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;}
|
||||
.yui-log p {margin:1px;padding:.1em;}
|
||||
.yui-log button {font-family:monospace;}
|
||||
.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;}
|
||||
/* height is controlled here: default 20em*/
|
||||
.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}
|
||||
.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;}
|
||||
.yui-log .yui-log-ft .yui-log-categoryfilters {}
|
||||
.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}
|
||||
.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;}
|
||||
.yui-log .yui-log-filtergrp {margin-right:.5em;}
|
||||
.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */
|
||||
.yui-log .warn {background-color:#F58516;} /* F58516 orange */
|
||||
.yui-log .error {background-color:#E32F0B;} /* E32F0B red */
|
||||
.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */
|
||||
.yui-log .window {background-color:#F2E886;} /* F2E886 tan */
|
||||
|
|
1503
lib/yui/logger/logger-debug.js
vendored
1503
lib/yui/logger/logger-debug.js
vendored
File diff suppressed because it is too large
Load diff
95
lib/yui/logger/logger-min.js
vendored
95
lib/yui/logger/logger-min.js
vendored
|
@ -1,63 +1,56 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
|
||||
|
||||
YAHOO.widget.Logger={loggerEnabled:true,_firebugEnabled:true,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
|
||||
else if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}
|
||||
var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
|
||||
else{sClass=sSource;}
|
||||
if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
|
||||
var timestamp=new Date();var logEntry={time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail,msg:sMsg};this._stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._firebugEnabled){this._printToFirebug(logEntry);}
|
||||
return true;}
|
||||
else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log(null,"Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableFirebug=function(){YAHOO.log("YAHOO.Logger output to Firebug has been disabled.");this._firebugEnabled=false;};YAHOO.widget.Logger.enableFirebug=function(){this._firebugEnabled=true;YAHOO.log("YAHOO.Logger output to Firebug has been enabled.");};YAHOO.widget.Logger._createNewCategory=function(category){this.categories.push(category);this.categoryCreateEvent.fire(category);};YAHOO.widget.Logger._isNewCategory=function(category){for(var i=0;i<this.categories.length;i++){if(category==this.categories[i]){return false;}}
|
||||
return true;};YAHOO.widget.Logger._createNewSource=function(source){this.sources.push(source);this.sourceCreateEvent.fire(source);};YAHOO.widget.Logger._isNewSource=function(source){if(source){for(var i=0;i<this.sources.length;i++){if(source==this.sources[i]){return false;}}
|
||||
return true;}};YAHOO.widget.Logger._printToFirebug=function(entry){if(window.console&&console.log){var category=entry.category;var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
|
||||
else{localTime=time.toString();}
|
||||
var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
|
||||
elapsedTime+"ms): "+
|
||||
entry.source+": "+
|
||||
entry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(msg,url,line){try{YAHOO.widget.Logger.log(msg+' ('+url+', line '+line+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
|
||||
catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
|
||||
window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
YAHOO.widget.LogMsg=function(oConfigs){if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}
|
||||
this._source=sSource;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(sMsg,sCategory){YAHOO.widget.Logger.log(sMsg,sCategory,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(sSource){if(!sSource){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}
|
||||
else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(containerEl,oConfig){var oSelf=this;if(typeof oConfig=="object"){for(var param in oConfig){this[param]=oConfig[param];}}
|
||||
if(containerEl){if(typeof containerEl=="string"){this._containerEl=document.getElementById(containerEl);}
|
||||
else if(containerEl.tagName){this._containerEl=containerEl;}
|
||||
this._containerEl.className="yui-log";}
|
||||
if(!this._containerEl){if(YAHOO.widget.LogReader._defaultContainerEl){this._containerEl=YAHOO.widget.LogReader._defaultContainerEl;}
|
||||
else{this._containerEl=document.body.appendChild(document.createElement("div"));this._containerEl.id="yui-log";this._containerEl.className="yui-log";YAHOO.widget.LogReader._defaultContainerEl=this._containerEl;}
|
||||
var containerStyle=this._containerEl.style;if(this.width){containerStyle.width=this.width;}
|
||||
else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){var oSelf=this;this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}
|
||||
if(elContainer){if(typeof elContainer=="string"){this._elContainer=document.getElementById(elContainer);}
|
||||
else if(elContainer.tagName){this._elContainer=elContainer;}
|
||||
this._elContainer.className="yui-log";}
|
||||
if(!this._elContainer){if(YAHOO.widget.LogReader._elDefaultContainer){this._elContainer=YAHOO.widget.LogReader._elDefaultContainer;}
|
||||
else{this._elContainer=document.body.appendChild(document.createElement("div"));this._elContainer.id="yui-log";this._elContainer.className="yui-log";YAHOO.widget.LogReader._elDefaultContainer=this._elContainer;}
|
||||
var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}
|
||||
if(this.left){containerStyle.left=this.left;}
|
||||
if(this.right){containerStyle.right=this.right;}
|
||||
if(this.bottom){containerStyle.bottom=this.bottom;}
|
||||
if(this.top){containerStyle.top=this.top;}
|
||||
if(this.fontSize){containerStyle.fontSize=this.fontSize;}}
|
||||
if(this._containerEl){if(!this._hdEl){this._hdEl=this._containerEl.appendChild(document.createElement("div"));this._hdEl.id="yui-log-hd"+YAHOO.widget.LogReader._index;this._hdEl.className="yui-log-hd";this._collapseEl=this._hdEl.appendChild(document.createElement("div"));this._collapseEl.className="yui-log-btns";this._collapseBtn=document.createElement("input");this._collapseBtn.type="button";this._collapseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._collapseBtn.className="yui-log-button";this._collapseBtn.value="Collapse";this._collapseBtn=this._collapseEl.appendChild(this._collapseBtn);YAHOO.util.Event.addListener(oSelf._collapseBtn,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._hdEl.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._defaultContainerEl==this._containerEl)){var ylog_dd=new YAHOO.util.DD(this._containerEl.id);ylog_dd.setHandleElId(this._hdEl.id);this._hdEl.style.cursor="move";}}
|
||||
if(!this._consoleEl){this._consoleEl=this._containerEl.appendChild(document.createElement("div"));this._consoleEl.className="yui-log-bd";if(this.height){this._consoleEl.style.height=this.height;}}
|
||||
if(!this._ftEl&&this.footerEnabled){this._ftEl=this._containerEl.appendChild(document.createElement("div"));this._ftEl.className="yui-log-ft";this._btnsEl=this._ftEl.appendChild(document.createElement("div"));this._btnsEl.className="yui-log-btns";this._pauseBtn=document.createElement("input");this._pauseBtn.type="button";this._pauseBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._pauseBtn.className="yui-log-button";this._pauseBtn.value="Pause";this._pauseBtn=this._btnsEl.appendChild(this._pauseBtn);YAHOO.util.Event.addListener(oSelf._pauseBtn,'click',oSelf._onClickPauseBtn,oSelf);this._clearBtn=document.createElement("input");this._clearBtn.type="button";this._clearBtn.style.fontSize=YAHOO.util.Dom.getStyle(this._containerEl,"fontSize");this._clearBtn.className="yui-log-button";this._clearBtn.value="Clear";this._clearBtn=this._btnsEl.appendChild(this._clearBtn);YAHOO.util.Event.addListener(oSelf._clearBtn,'click',oSelf._onClickClearBtn,oSelf);this._categoryFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._categoryFiltersEl.className="yui-log-categoryfilters";this._sourceFiltersEl=this._ftEl.appendChild(document.createElement("div"));this._sourceFiltersEl.className="yui-log-sourcefilters";}}
|
||||
if(this._elContainer){if(!this._elHd){this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._elDefaultContainer==this._elContainer)){var ylog_dd=new YAHOO.util.DD(this._elContainer.id);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}}
|
||||
if(!this._elConsole){this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}}
|
||||
if(!this._elFt&&this.footerEnabled){this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}}
|
||||
if(!this._buffer){this._buffer=[];}
|
||||
YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);this._lastTime=YAHOO.widget.Logger.getStartTime();this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._categoryFiltersEl){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}
|
||||
this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._sourceFiltersEl){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}
|
||||
YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);YAHOO.widget.LogReader._index++;this._filterLogs();};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._containerEl.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._containerEl.style.display="block";};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){var regEx=/>/g;sTitle=sTitle.replace(regEx,">");regEx=/</g;sTitle=sTitle.replace(regEx,"<");this._title.innerHTML=(sTitle);};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader._defaultContainerEl=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._containerEl=null;YAHOO.widget.LogReader.prototype._hdEl=null;YAHOO.widget.LogReader.prototype._collapseEl=null;YAHOO.widget.LogReader.prototype._collapseBtn=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._consoleEl=null;YAHOO.widget.LogReader.prototype._ftEl=null;YAHOO.widget.LogReader.prototype._btnsEl=null;YAHOO.widget.LogReader.prototype._categoryFiltersEl=null;YAHOO.widget.LogReader.prototype._sourceFiltersEl=null;YAHOO.widget.LogReader.prototype._pauseBtn=null;YAHOO.widget.LogReader.prototype._clearBtn=null;YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(category){var oSelf=this;if(this._ftEl){var parentEl=this._categoryFiltersEl;var filters=this._categoryFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var categoryChk=document.createElement("input");categoryChk.id="yui-log-filter-"+category+YAHOO.widget.LogReader._index;categoryChk.className="yui-log-filter-"+category;categoryChk.type="checkbox";categoryChk.category=category;categoryChk=filterEl.appendChild(categoryChk);categoryChk.checked=true;filters.push(category);YAHOO.util.Event.addListener(categoryChk,'click',oSelf._onCheckCategory,oSelf);var categoryChkLbl=filterEl.appendChild(document.createElement("label"));categoryChkLbl.htmlFor=categoryChk.id;categoryChkLbl.className=category;categoryChkLbl.innerHTML=category;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(source){var oSelf=this;if(this._ftEl){var parentEl=this._sourceFiltersEl;var filters=this._sourceFilters;var filterEl=parentEl.appendChild(document.createElement("span"));filterEl.className="yui-log-filtergrp";var sourceChk=document.createElement("input");sourceChk.id="yui-log-filter"+source+YAHOO.widget.LogReader._index;sourceChk.className="yui-log-filter"+source;sourceChk.type="checkbox";sourceChk.source=source;sourceChk=filterEl.appendChild(sourceChk);sourceChk.checked=true;filters.push(source);YAHOO.util.Event.addListener(sourceChk,'click',oSelf._onCheckSource,oSelf);var sourceChkLbl=filterEl.appendChild(document.createElement("label"));sourceChkLbl.htmlFor=sourceChk.id;sourceChkLbl.className=source;sourceChkLbl.innerHTML=source;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._consoleEl!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._lastTime=YAHOO.widget.Logger.getStartTime();var consoleEl=this._consoleEl;while(consoleEl.hasChildNodes()){consoleEl.removeChild(consoleEl.firstChild);}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._consoleEl!==null){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
|
||||
this._buffer=[];this._printToConsole(entries);if(!this.newestOnTop){this._consoleEl.scrollTop=this._consoleEl.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=0;i<entriesLen;i++){var entry=aEntries[i];var category=entry.category;var source=entry.source;var sourceDetail=entry.sourceDetail;var okToPrint=false;var okToFilterCats=false;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
|
||||
if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
|
||||
if(okToPrint){var label=entry.category.substring(0,4).toUpperCase();var time=entry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
|
||||
this._lastTime=YAHOO.widget.Logger.getStartTime();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);this._categoryFilters=[];var catsLen=YAHOO.widget.Logger.categories.length;if(this._elCategoryFilters){for(var i=0;i<catsLen;i++){this._createCategoryCheckbox(YAHOO.widget.Logger.categories[i]);}}
|
||||
this._sourceFilters=[];var sourcesLen=YAHOO.widget.Logger.sources.length;if(this._elSourceFilters){for(var j=0;j<sourcesLen;j++){this._createSourceCheckbox(YAHOO.widget.Logger.sources[j]);}}
|
||||
YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.widget.LogReader.prototype.logReaderEnabled=true;YAHOO.widget.LogReader.prototype.width=null;YAHOO.widget.LogReader.prototype.height=null;YAHOO.widget.LogReader.prototype.top=null;YAHOO.widget.LogReader.prototype.left=null;YAHOO.widget.LogReader.prototype.right=null;YAHOO.widget.LogReader.prototype.bottom=null;YAHOO.widget.LogReader.prototype.fontSize=null;YAHOO.widget.LogReader.prototype.footerEnabled=true;YAHOO.widget.LogReader.prototype.verboseOutput=true;YAHOO.widget.LogReader.prototype.newestOnTop=true;YAHOO.widget.LogReader.prototype.thresholdMax=500;YAHOO.widget.LogReader.prototype.thresholdMin=100;YAHOO.widget.LogReader.prototype.toString=function(){return"LogReader instance"+this._sName;};YAHOO.widget.LogReader.prototype.pause=function(){this._timeout=null;this.logReaderEnabled=false;};YAHOO.widget.LogReader.prototype.resume=function(){this.logReaderEnabled=true;this._printBuffer();};YAHOO.widget.LogReader.prototype.hide=function(){this._elContainer.style.display="none";};YAHOO.widget.LogReader.prototype.show=function(){this._elContainer.style.display="block";};YAHOO.widget.LogReader.prototype.setTitle=function(sTitle){this._title.innerHTML=this.html2Text(sTitle);};YAHOO.widget.LogReader.prototype.getLastTime=function(){return this._lastTime;};YAHOO.widget.LogReader.prototype.formatMsg=function(oLogMsg){var category=oLogMsg.category;var label=category.substring(0,4).toUpperCase();var time=oLogMsg.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
|
||||
else{localTime=time.toString();}
|
||||
var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this._lastTime;this._lastTime=msecs;var verboseOutput=(this.verboseOutput)?"<br>":"";var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var output="<span class='"+category+"'>"+label+"</span> "+
|
||||
totalTime+"ms (+"+
|
||||
elapsedTime+") "+localTime+": "+
|
||||
sourceAndDetail+": "+
|
||||
verboseOutput+
|
||||
entry.msg;var oNewElement=(this.newestOnTop)?this._consoleEl.insertBefore(document.createElement("p"),this._consoleEl.firstChild):this._consoleEl.appendChild(document.createElement("p"));oNewElement.innerHTML=output;}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(type,args,oSelf){var category=args[0];if(oSelf._ftEl){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(type,args,oSelf){var source=args[0];if(oSelf._ftEl){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
|
||||
var msecs=time.getTime();var startTime=YAHOO.widget.Logger.getStartTime();var totalTime=msecs-startTime;var elapsedTime=msecs-this.getLastTime();var source=oLogMsg.source;var sourceDetail=oLogMsg.sourceDetail;var sourceAndDetail=(sourceDetail)?source+" "+sourceDetail:source;var msg=this.html2Text(oLogMsg.msg);var output=(this.verboseOutput)?["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ","</p><p>",sourceAndDetail,": </p><p>",msg,"</p>"]:["<p><span class='",category,"'>",label,"</span> ",totalTime,"ms (+",elapsedTime,") ",localTime,": ",sourceAndDetail,": ",msg,"</p>"];return output.join("");};YAHOO.widget.LogReader.prototype.html2Text=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");}
|
||||
return"";};YAHOO.widget.LogReader._index=0;YAHOO.widget.LogReader.prototype._sName=null;YAHOO.widget.LogReader._elDefaultContainer=null;YAHOO.widget.LogReader.prototype._buffer=null;YAHOO.widget.LogReader.prototype._consoleMsgCount=0;YAHOO.widget.LogReader.prototype._lastTime=null;YAHOO.widget.LogReader.prototype._timeout=null;YAHOO.widget.LogReader.prototype._categoryFilters=null;YAHOO.widget.LogReader.prototype._sourceFilters=null;YAHOO.widget.LogReader.prototype._elContainer=null;YAHOO.widget.LogReader.prototype._elHd=null;YAHOO.widget.LogReader.prototype._elCollapse=null;YAHOO.widget.LogReader.prototype._btnCollapse=null;YAHOO.widget.LogReader.prototype._title=null;YAHOO.widget.LogReader.prototype._elConsole=null;YAHOO.widget.LogReader.prototype._elFt=null;YAHOO.widget.LogReader.prototype._elBtns=null;YAHOO.widget.LogReader.prototype._elCategoryFilters=null;YAHOO.widget.LogReader.prototype._elSourceFilters=null;YAHOO.widget.LogReader.prototype._btnPause=null;YAHOO.widget.LogReader.prototype._btnClear=null;YAHOO.widget.LogReader.prototype._createCategoryCheckbox=function(sCategory){var oSelf=this;if(this._elFt){var elParent=this._elCategoryFilters;var filters=this._categoryFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkCategory=document.createElement("input");chkCategory.id="yui-log-filter-"+sCategory+this._sName;chkCategory.className="yui-log-filter-"+sCategory;chkCategory.type="checkbox";chkCategory.category=sCategory;chkCategory=elFilter.appendChild(chkCategory);chkCategory.checked=true;filters.push(sCategory);YAHOO.util.Event.addListener(chkCategory,'click',oSelf._onCheckCategory,oSelf);var lblCategory=elFilter.appendChild(document.createElement("label"));lblCategory.htmlFor=chkCategory.id;lblCategory.className=sCategory;lblCategory.innerHTML=sCategory;}};YAHOO.widget.LogReader.prototype._createSourceCheckbox=function(sSource){var oSelf=this;if(this._elFt){var elParent=this._elSourceFilters;var filters=this._sourceFilters;var elFilter=elParent.appendChild(document.createElement("span"));elFilter.className="yui-log-filtergrp";var chkSource=document.createElement("input");chkSource.id="yui-log-filter"+sSource+this._sName;chkSource.className="yui-log-filter"+sSource;chkSource.type="checkbox";chkSource.source=sSource;chkSource=elFilter.appendChild(chkSource);chkSource.checked=true;filters.push(sSource);YAHOO.util.Event.addListener(chkSource,'click',oSelf._onCheckSource,oSelf);var lblSource=elFilter.appendChild(document.createElement("label"));lblSource.htmlFor=chkSource.id;lblSource.className=sSource;lblSource.innerHTML=sSource;}};YAHOO.widget.LogReader.prototype._filterLogs=function(){if(this._elConsole!==null){this._clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack());}};YAHOO.widget.LogReader.prototype._clearConsole=function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;this._lastTime=YAHOO.widget.Logger.getStartTime();var elConsole=this._elConsole;while(elConsole.hasChildNodes()){elConsole.removeChild(elConsole.firstChild);}};YAHOO.widget.LogReader.prototype._printBuffer=function(){this._timeout=null;if(this._elConsole!==null){var thresholdMax=this.thresholdMax;thresholdMax=(thresholdMax&&!isNaN(thresholdMax))?thresholdMax:500;if(this._consoleMsgCount<thresholdMax){var entries=[];for(var i=0;i<this._buffer.length;i++){entries[i]=this._buffer[i];}
|
||||
this._buffer=[];this._printToConsole(entries);}
|
||||
else{this._filterLogs();}
|
||||
if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}};YAHOO.widget.LogReader.prototype._printToConsole=function(aEntries){var entriesLen=aEntries.length;var thresholdMin=this.thresholdMin;if(isNaN(thresholdMin)||(thresholdMin>this.thresholdMax)){thresholdMin=0;}
|
||||
var entriesStartIndex=(entriesLen>thresholdMin)?(entriesLen-thresholdMin):0;var sourceFiltersLen=this._sourceFilters.length;var categoryFiltersLen=this._categoryFilters.length;for(var i=entriesStartIndex;i<entriesLen;i++){var okToPrint=false;var okToFilterCats=false;var entry=aEntries[i];var source=entry.source;var category=entry.category;for(var j=0;j<sourceFiltersLen;j++){if(source==this._sourceFilters[j]){okToFilterCats=true;break;}}
|
||||
if(okToFilterCats){for(var k=0;k<categoryFiltersLen;k++){if(category==this._categoryFilters[k]){okToPrint=true;break;}}}
|
||||
if(okToPrint){var output=this.formatMsg(entry);var container=(this.verboseOutput)?"CODE":"PRE";var oNewElement=(this.newestOnTop)?this._elConsole.insertBefore(document.createElement(container),this._elConsole.firstChild):this._elConsole.appendChild(document.createElement(container));oNewElement.innerHTML=output;this._consoleMsgCount++;this._lastTime=entry.time.getTime();}}};YAHOO.widget.LogReader.prototype._onCategoryCreate=function(sType,aArgs,oSelf){var category=aArgs[0];if(oSelf._elFt){oSelf._createCategoryCheckbox(category);}};YAHOO.widget.LogReader.prototype._onSourceCreate=function(sType,aArgs,oSelf){var source=aArgs[0];if(oSelf._elFt){oSelf._createSourceCheckbox(source);}};YAHOO.widget.LogReader.prototype._onCheckCategory=function(v,oSelf){var newFilter=this.category;var filtersArray=oSelf._categoryFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
|
||||
else{filtersArray.push(newFilter);}
|
||||
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onCheckSource=function(v,oSelf){var newFilter=this.source;var filtersArray=oSelf._sourceFilters;if(!this.checked){for(var i=0;i<filtersArray.length;i++){if(newFilter==filtersArray[i]){filtersArray.splice(i,1);break;}}}
|
||||
else{filtersArray.push(newFilter);}
|
||||
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._collapseBtn;if(btn.value=="Expand"){oSelf._consoleEl.style.display="block";if(oSelf._ftEl){oSelf._ftEl.style.display="block";}
|
||||
oSelf._filterLogs();};YAHOO.widget.LogReader.prototype._onClickCollapseBtn=function(v,oSelf){var btn=oSelf._btnCollapse;if(btn.value=="Expand"){oSelf._elConsole.style.display="block";if(oSelf._elFt){oSelf._elFt.style.display="block";}
|
||||
btn.value="Collapse";}
|
||||
else{oSelf._consoleEl.style.display="none";if(oSelf._ftEl){oSelf._ftEl.style.display="none";}
|
||||
btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._pauseBtn;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}
|
||||
else{oSelf.pause();btn.value="Resume";}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf._clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(type,args,oSelf){var logEntry=args[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},100);}};
|
||||
else{oSelf._elConsole.style.display="none";if(oSelf._elFt){oSelf._elFt.style.display="none";}
|
||||
btn.value="Expand";}};YAHOO.widget.LogReader.prototype._onClickPauseBtn=function(v,oSelf){var btn=oSelf._btnPause;if(btn.value=="Resume"){oSelf.resume();btn.value="Pause";}
|
||||
else{oSelf.pause();btn.value="Resume";}};YAHOO.widget.LogReader.prototype._onClickClearBtn=function(v,oSelf){oSelf._clearConsole();};YAHOO.widget.LogReader.prototype._onNewLog=function(sType,aArgs,oSelf){var logEntry=aArgs[0];oSelf._buffer.push(logEntry);if(oSelf.logReaderEnabled===true&&oSelf._timeout===null){oSelf._timeout=setTimeout(function(){oSelf._printBuffer();},100);}};YAHOO.widget.LogReader.prototype._onReset=function(sType,aArgs,oSelf){oSelf._filterLogs();};YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null};YAHOO.widget.Logger.log=function(sMsg,sCategory,sSource){if(this.loggerEnabled){if(!sCategory){sCategory="info";}
|
||||
else{sCategory=sCategory.toLocaleLowerCase();if(this._isNewCategory(sCategory)){this._createNewCategory(sCategory);}}
|
||||
var sClass="global";var sDetail=null;if(sSource){var spaceIndex=sSource.indexOf(" ");if(spaceIndex>0){sClass=sSource.substring(0,spaceIndex);sDetail=sSource.substring(spaceIndex,sSource.length);}
|
||||
else{sClass=sSource;}
|
||||
if(this._isNewSource(sClass)){this._createNewSource(sClass);}}
|
||||
var timestamp=new Date();var logEntry=new YAHOO.widget.LogMsg({msg:sMsg,time:timestamp,category:sCategory,source:sClass,sourceDetail:sDetail});var stack=this._stack;var maxStackEntries=this.maxStackEntries;if(maxStackEntries&&!isNaN(maxStackEntries)&&(stack.length>=maxStackEntries)){stack.shift();}
|
||||
stack.push(logEntry);this.newLogEvent.fire(logEntry);if(this._browserConsoleEnabled){this._printToBrowserConsole(logEntry);}
|
||||
return true;}
|
||||
else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(sCategory){this.categories.push(sCategory);this.categoryCreateEvent.fire(sCategory);};YAHOO.widget.Logger._isNewCategory=function(sCategory){for(var i=0;i<this.categories.length;i++){if(sCategory==this.categories[i]){return false;}}
|
||||
return true;};YAHOO.widget.Logger._createNewSource=function(sSource){this.sources.push(sSource);this.sourceCreateEvent.fire(sSource);};YAHOO.widget.Logger._isNewSource=function(sSource){if(sSource){for(var i=0;i<this.sources.length;i++){if(sSource==this.sources[i]){return false;}}
|
||||
return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(oEntry){if(window.console&&console.log){var category=oEntry.category;var label=oEntry.category.substring(0,4).toUpperCase();var time=oEntry.time;if(time.toLocaleTimeString){var localTime=time.toLocaleTimeString();}
|
||||
else{localTime=time.toString();}
|
||||
var msecs=time.getTime();var elapsedTime=(YAHOO.widget.Logger._lastTime)?(msecs-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=msecs;var output=localTime+" ("+
|
||||
elapsedTime+"ms): "+
|
||||
oEntry.source+": "+
|
||||
oEntry.msg;console.log(output);}};YAHOO.widget.Logger._onWindowError=function(sMsg,sUrl,sLine){try{YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')',"window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}
|
||||
catch(e){return false;}};if(window.onerror){YAHOO.widget.Logger._origOnWindowError=window.onerror;}
|
||||
window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger.log("Logger initialized");
|
1503
lib/yui/logger/logger.js
vendored
1503
lib/yui/logger/logger.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -73,10 +73,152 @@ Fixed the following bugs:
|
|||
* Users can now control or shift-click on MenuItem links
|
||||
|
||||
|
||||
Changes
|
||||
-------
|
||||
Changes:
|
||||
--------
|
||||
* In the Menu stylesheet (menu.css), switched from using "first" class to
|
||||
"first-of-type" class
|
||||
|
||||
* Changed case of MenuModuleItem class's "subMenuIndicator" property
|
||||
to "submenuIndicator"
|
||||
|
||||
|
||||
*** version 0.11.3 ***
|
||||
|
||||
Added the following features:
|
||||
-----------------------------
|
||||
|
||||
* Added a "target" configuration property to the MenuModuleItem object that
|
||||
allows the user to specify the target of an item's anchor element. Items
|
||||
that make use of the "target" configuration property will require the user
|
||||
to click exactly on the item's anchor element to navigate to the specified
|
||||
URL.
|
||||
|
||||
* Items without a "url" property set will automatically hide their parent
|
||||
menu instance(s) when clicked.
|
||||
|
||||
|
||||
Fixed the following bugs:
|
||||
-------------------------
|
||||
|
||||
* Items in a submenu should now navigate to their specified URL when clicked.
|
||||
|
||||
* Removed MenuBar's use of "overflow:hidden." This fixes an issue in Firefox
|
||||
1.5 in which submenus of a Menubar instance cannot overlay other absolutely
|
||||
positioned elements on the page.
|
||||
|
||||
* Submenus of a Menubar instance will now automatically have their iframe shim
|
||||
enabled in IE<7.
|
||||
|
||||
* Statically positioned Menubar and Menu instances will now render with the
|
||||
correct position and dimensions in Safari.
|
||||
|
||||
* MenuModuleItem's "focus" method now checks to make sure that an item's
|
||||
"display" style property is not "none" before trying to set focus to its
|
||||
anchor element.
|
||||
|
||||
* A ContextMenu instance will now hide all other ContextMenu instances before
|
||||
displaying itself.
|
||||
|
||||
* Removed the dead space in front of an item's submenu indicator image in IE.
|
||||
This space was causing an item's submenu to flicker when the user hovered
|
||||
over it.
|
||||
|
||||
|
||||
Changes:
|
||||
--------
|
||||
|
||||
* Moved the DOM event handlers for every menu from the root DIV node of each
|
||||
instance to the document object. This change reduces the number of DOM event
|
||||
handlers used by Menu to eight, improving the cleanup time required by the
|
||||
Event utility.
|
||||
|
||||
|
||||
*** version 0.12 ***
|
||||
|
||||
Added the following features:
|
||||
-----------------------------
|
||||
|
||||
* Added the YAHOO.widget.MenuManager singleton class.
|
||||
|
||||
* Added two new methods to YAHOO.widget.Menu:
|
||||
|
||||
* "addItems" - Adds an array of items to a menu.
|
||||
|
||||
* "getRoot" - Returns the root menu in a menu hierarchy.
|
||||
|
||||
* Added two new events to YAHOO.widget.Menu:
|
||||
|
||||
* "itemAddedEvent" - Fires when an item is added to a menu.
|
||||
|
||||
* "itemRemovedEvent" - Fires when an item is removed from a menu.
|
||||
|
||||
* Added two new properties to YAHOO.widget.Menu:
|
||||
|
||||
* "itemData" - Array of items to be added to the menu.
|
||||
|
||||
* "lazyLoad" - Boolean indicating if the menu's "lazy load" feature
|
||||
is enabled.
|
||||
|
||||
* Added new configuration properties to YAHOO.widget.Menu:
|
||||
|
||||
* "hidedelay" - Hides the menu after the specified number of milliseconds.
|
||||
|
||||
* "showdelay" - Shows the menu after the specified number of milliseconds.
|
||||
|
||||
* "container" - The containing element the menu should be rendered into.
|
||||
|
||||
* "clicktohide" - Boolean indicating if the menu will automatically be
|
||||
hidden if the user clicks outside of it.
|
||||
|
||||
* "autosubmenudisplay" - Boolean indicating if submenus are automatically
|
||||
made visible when the user mouses over the menu's items.
|
||||
|
||||
* Added a "toString" method to YAHOO.widget.MenuItem, YAHOO.widget.MenuBarItem
|
||||
and YAHOO.widget.ContextMenuItem that returns the class name followed by the
|
||||
value of the item's "text" configuration property.
|
||||
|
||||
|
||||
Fixed the following bugs:
|
||||
-------------------------
|
||||
|
||||
* Setting a YAHOO.widget.ContextMenu instance's "trigger" configuration
|
||||
property will remove all previous triggers before setting up the new ones.
|
||||
|
||||
* "destroy" method of YAHOO.widget.ContextMenu cleans up all DOM event handlers.
|
||||
|
||||
* Clicking on a menu item with a submenu no longer hides/collapses the
|
||||
entire menu.
|
||||
|
||||
* Clicking an item's submenu indicator image no longer collapses the
|
||||
entire menu.
|
||||
|
||||
|
||||
Changes:
|
||||
--------
|
||||
|
||||
* Deprecated the YAHOO.widget.MenuModule and YAHOO.widget.MenuModuleItem
|
||||
classes. The Base classes are now YAHOO.widget.Menu and
|
||||
YAHOO.widget.MenuItem.
|
||||
|
||||
* "addItem" and "insertItem" methods of YAHOO.widget.Menu now accept an
|
||||
object literal representing YAHOO.widget.MenuItem configuration properties.
|
||||
|
||||
* "clearActiveItem" now takes an argument: flag indicating if the Menu
|
||||
instance's active item should be blurred.
|
||||
|
||||
* Switched the default value of the "visible" configuration property for
|
||||
YAHOO.widget.Menu to "false."
|
||||
|
||||
* Switched the default value of the "constraintoviewport" configuration
|
||||
property for YAHOO.widget.Menu to "true."
|
||||
|
||||
* Overloaded the "submenu" configuration property for YAHOO.widget.MenuItem
|
||||
so that it now can accept any of the following:
|
||||
|
||||
* YAHOO.widget.Menu instance
|
||||
* Object literal representation of a menu
|
||||
* Element id
|
||||
* Element reference
|
||||
|
||||
* "hide" and "show" methods of statically positioned menus now toggle the their
|
||||
element's "display" style property between "block" and "none."
|
|
@ -1,23 +1,31 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
Version 0.11.0
|
||||
http://developer.yahoo.com/yui/license.txt
|
||||
Version: 0.12
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Menu styles */
|
||||
|
||||
div.yuimenu {
|
||||
|
||||
z-index:1;
|
||||
visibility:hidden;
|
||||
background-color:#f6f7ee;
|
||||
border:solid 1px #c4c4be;
|
||||
padding:1px;
|
||||
|
||||
}
|
||||
|
||||
/* Submenus are positioned absolute and hidden by default */
|
||||
|
||||
div.yuimenu div.yuimenu,
|
||||
div.yuimenubar div.yuimenu {
|
||||
|
||||
position:absolute;
|
||||
visibility:hidden;
|
||||
|
||||
}
|
||||
|
||||
/* MenuBar Styles */
|
||||
|
||||
|
@ -28,12 +36,12 @@ div.yuimenubar {
|
|||
}
|
||||
|
||||
/*
|
||||
Application of "zoom:1" triggers "haslayout" in IE so that the module's
|
||||
Applying a width triggers "haslayout" in IE so that the module's
|
||||
body clears its floated elements
|
||||
*/
|
||||
div.yuimenubar div.bd {
|
||||
|
||||
zoom:1;
|
||||
width:100%;
|
||||
|
||||
}
|
||||
|
||||
|
@ -90,7 +98,6 @@ div.yuimenubar ul {
|
|||
list-style-type:none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
|
@ -263,7 +270,8 @@ div.yuimenu li.yuimenuitem img {
|
|||
|
||||
height:8px;
|
||||
width:8px;
|
||||
margin:0 -16px 0 10px;
|
||||
margin:0 -16px 0 0;
|
||||
padding-left:10px;
|
||||
border:0;
|
||||
|
||||
}
|
||||
|
@ -279,10 +287,11 @@ div.yuimenu li.checked img.checked {
|
|||
height:8px;
|
||||
width:8px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:0;
|
||||
position:absolute;
|
||||
left:6px;
|
||||
_left:-16px; /* Underscore hack b/c this is for IE 5.5 and IE 6 only */
|
||||
_left:-16px; /* Underscore hack b/c this is for IE 6 only */
|
||||
top:.5em;
|
||||
|
||||
}
|
8674
lib/yui/menu/menu-debug.js
vendored
8674
lib/yui/menu/menu-debug.js
vendored
File diff suppressed because it is too large
Load diff
10
lib/yui/menu/menu-min.js
vendored
10
lib/yui/menu/menu-min.js
vendored
File diff suppressed because one or more lines are too long
8283
lib/yui/menu/menu.js
vendored
8283
lib/yui/menu/menu.js
vendored
File diff suppressed because it is too large
Load diff
8
lib/yui/reset-fonts-grids/README
Executable file
8
lib/yui/reset-fonts-grids/README
Executable file
|
@ -0,0 +1,8 @@
|
|||
YUI Library - Reset+Fonts+Grids (RFG) - Release Notes
|
||||
|
||||
Version 0.12.0
|
||||
|
||||
* Initial release.
|
||||
|
||||
* This file is a convenience file containing an in-order
|
||||
concatenation of Reset, Fonts, and Grids.
|
4
lib/yui/reset-fonts-grids/reset-fonts-grids-min.css
vendored
Executable file
4
lib/yui/reset-fonts-grids/reset-fonts-grids-min.css
vendored
Executable file
|
@ -0,0 +1,4 @@
|
|||
/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */
|
||||
/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
|
||||
/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
|
||||
/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
|
174
lib/yui/reset-fonts-grids/reset-fonts-grids.css
Executable file
174
lib/yui/reset-fonts-grids/reset-fonts-grids.css
Executable file
|
@ -0,0 +1,174 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/*=============*/
|
||||
/* reset.css */
|
||||
/*=============*/
|
||||
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
|
||||
table{border-collapse:collapse;border-spacing:0;}
|
||||
fieldset,img{border:0;}
|
||||
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
|
||||
ol,ul {list-style:none;}
|
||||
caption,th {text-align:left;}
|
||||
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
|
||||
q:before,q:after{content:'';}
|
||||
abbr,acronym {border:0;}
|
||||
|
||||
/*=============*/
|
||||
/* fonts.css */
|
||||
/*=============*/
|
||||
|
||||
/**
|
||||
* 84.5% for !IE, keywords for IE to preserve user font-size adjustment
|
||||
* Percents could work for IE, but for backCompat purposes, we are using keywords.
|
||||
* x-small is for IE6/7 quirks mode.
|
||||
*
|
||||
*/
|
||||
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
|
||||
table {font-size:inherit;font:100%;}
|
||||
/**
|
||||
* 99% for safari; 100% is too large
|
||||
*/
|
||||
select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}
|
||||
/**
|
||||
* Bump up !IE to get to 13px equivalent
|
||||
*/
|
||||
pre, code {font:115% monospace;*font-size:100%;}
|
||||
/**
|
||||
* Default line-height based on font-size rather than "computed-value"
|
||||
* see: http://www.w3.org/TR/CSS21/visudet.html#line-height
|
||||
*/
|
||||
body * {line-height:1.22em;}
|
||||
|
||||
/*=============*/
|
||||
/* grids.css */
|
||||
/*=============*/
|
||||
|
||||
/* for all templates and grids */
|
||||
body{text-align:center;}
|
||||
#ft{clear:both;}
|
||||
/**/
|
||||
/* 750 centered, and backward compatibility */
|
||||
#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
|
||||
margin:auto;text-align:left;
|
||||
width:57.69em;*width:56.3em;min-width:750px;}
|
||||
/* 950 centered */
|
||||
#doc2 {
|
||||
width:73.074em;*width:71.313em;min-width:950px;}
|
||||
/* 100% with 10px viewport side matting */
|
||||
#doc3 {
|
||||
margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */
|
||||
width:auto;}
|
||||
|
||||
/* below required for all fluid grids; adjust widths and margins above accordingly */
|
||||
|
||||
/* to preserve source-order independence for Gecko */
|
||||
.yui-b{position:relative;}
|
||||
.yui-b{_position:static;} /* for IE < 7 */
|
||||
#yui-main .yui-b{position:static;}
|
||||
|
||||
#yui-main {width:100%;}
|
||||
.yui-t1 #yui-main,
|
||||
.yui-t2 #yui-main,
|
||||
.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
|
||||
|
||||
.yui-t4 #yui-main,
|
||||
.yui-t5 #yui-main,
|
||||
.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
|
||||
|
||||
.yui-t1 .yui-b {
|
||||
float:left;
|
||||
width:12.3207em;*width:12.0106em;}
|
||||
.yui-t1 #yui-main .yui-b{
|
||||
margin-left:13.3207em;*margin-left:13.0106em;
|
||||
}
|
||||
|
||||
.yui-t2 .yui-b {
|
||||
float:left;
|
||||
width:13.8456em;*width:13.512em;}
|
||||
.yui-t2 #yui-main .yui-b {
|
||||
margin-left:14.8456em;*margin-left:14.512em;
|
||||
}
|
||||
|
||||
.yui-t3 .yui-b {
|
||||
float:left;
|
||||
width:23.0759em;*width:22.52em;}
|
||||
.yui-t3 #yui-main .yui-b {
|
||||
margin-left:24.0759em;*margin-left:23.52em;
|
||||
}
|
||||
|
||||
.yui-t4 .yui-b {
|
||||
float:right;
|
||||
width:13.8456em;*width:13.512em;}
|
||||
.yui-t4 #yui-main .yui-b {
|
||||
margin-right:14.8456em;*margin-right:14.512em;
|
||||
}
|
||||
|
||||
.yui-t5 .yui-b {
|
||||
float:right;
|
||||
width:18.4608em;*width:18.016em;}
|
||||
.yui-t5 #yui-main .yui-b {
|
||||
margin-right:19.4608em;*margin-right:19.016em;
|
||||
}
|
||||
|
||||
.yui-t6 .yui-b {
|
||||
float:right;
|
||||
width:23.0759em;*width:22.52em;}
|
||||
.yui-t6 #yui-main .yui-b {
|
||||
margin-right:24.0759em;*margin-right:23.52em;
|
||||
}
|
||||
|
||||
.yui-t7 #yui-main .yui-b {
|
||||
display:block;margin:0 0 1em 0;
|
||||
}
|
||||
#yui-main .yui-b {float:none;width:auto;}
|
||||
/* GRIDS (not TEMPLATES) */
|
||||
.yui-g .yui-u,
|
||||
.yui-g .yui-g,
|
||||
.yui-gc .yui-u,
|
||||
.yui-gc .yui-g .yui-u,
|
||||
.yui-ge .yui-u,
|
||||
.yui-gf .yui-u{float:right;display:inline;}
|
||||
.yui-g div.first,
|
||||
.yui-gc div.first,
|
||||
.yui-gc div.first div.first,
|
||||
.yui-gd div.first,
|
||||
.yui-ge div.first,
|
||||
.yui-gf div.first{float:left;}
|
||||
.yui-g .yui-u,
|
||||
.yui-g .yui-g{width:49.1%;}
|
||||
.yui-g .yui-g .yui-u,
|
||||
.yui-gc .yui-g .yui-u {width:48.1%;}
|
||||
.yui-gb .yui-u,
|
||||
.yui-gc .yui-u,
|
||||
.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}
|
||||
.yui-gb div.first,
|
||||
.yui-gc div.first,
|
||||
.yui-gd div.first{margin-left:0;}
|
||||
.yui-gc div.first,
|
||||
.yui-gd .yui-u{width:66%;}
|
||||
.yui-gd div.first{width:32%;}
|
||||
.yui-ge .yui-u{width:24%;}
|
||||
.yui-ge div.first,
|
||||
.yui-gf .yui-u{width:74.2%;}
|
||||
.yui-gf div.first{width:24%;}
|
||||
.yui-ge div.first{width:74.2%;}
|
||||
#bd:after,
|
||||
.yui-g:after,
|
||||
.yui-gb:after,
|
||||
.yui-gc:after,
|
||||
.yui-gd:after,
|
||||
.yui-ge:after,
|
||||
.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
|
||||
#bd,
|
||||
.yui-g,
|
||||
.yui-gb,
|
||||
.yui-gc,
|
||||
.yui-gd,
|
||||
.yui-ge,
|
||||
.yui-gf{zoom:1;}
|
|
@ -1,9 +1,17 @@
|
|||
CSS Reset Release Notes
|
||||
YUI Library - Reset - Release Notes
|
||||
|
||||
*** version 0.11.0 ***
|
||||
Version 0.12.0
|
||||
|
||||
* No changes.
|
||||
* Added: h1,h2,h3,h4,h5,h6{font-weight:normal;}
|
||||
|
||||
*** version 0.10.0 ***
|
||||
* Added: abbr,acronym {border:0;}
|
||||
|
||||
* Initial release
|
||||
* Added: textarea {padding:0;margin:0;}
|
||||
|
||||
Version 0.11.0
|
||||
|
||||
* No changes.
|
||||
|
||||
Version 0.10.0
|
||||
|
||||
* Initial release.
|
8
lib/yui/reset/reset-min.css
vendored
8
lib/yui/reset/reset-min.css
vendored
|
@ -1,7 +1 @@
|
|||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
*/
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
|
|
@ -2,13 +2,14 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
|
||||
table{border-collapse:collapse;border-spacing:0;}
|
||||
fieldset,img{border:0;}
|
||||
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
|
||||
ol,ul {list-style:none;}
|
||||
caption,th {text-align:left;}
|
||||
h1,h2,h3,h4,h5,h6{font-size:100%;}
|
||||
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
|
||||
q:before,q:after{content:'';}
|
||||
abbr,acronym {border:0;}
|
|
@ -1,5 +1,30 @@
|
|||
Slider - Release Notes
|
||||
|
||||
0.12.0
|
||||
|
||||
* Added "slideStart", "slideEnd", and "change" custom events. The abstract
|
||||
methods these will eventually replace still work.
|
||||
|
||||
* The default animation duration is 0.2 seconds (reduced from 0.4 seconds),
|
||||
and is configurable via the animationDuration property.
|
||||
|
||||
* Keyboard navigation is now built in. The background needs a tabindex for
|
||||
keyboard nav to work. Keyboard nav can be disabled by setting enableKeys
|
||||
to false. The number of pixels the slider moves when the arrow keys
|
||||
are pressed is controlled by keyIncrement, and defaults to 20. Note,
|
||||
Safari support limited to background element types that support focus
|
||||
in that browser. http://bugs.webkit.org/show_bug.cgi?id=7138
|
||||
|
||||
* Fixed broken doctype in examples/index.html
|
||||
|
||||
* Catching an unhandled script exception in FF that could occur when
|
||||
attempting to focus the slider background while a text field without
|
||||
autocomplete="false" has focus
|
||||
|
||||
0.11.3
|
||||
|
||||
* No change
|
||||
|
||||
0.11.0
|
||||
|
||||
* When the thumb is clicked and dragged, the click position delta is properly
|
||||
|
|
1729
lib/yui/slider/slider-debug.js
vendored
1729
lib/yui/slider/slider-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/slider/slider-min.js
vendored
2
lib/yui/slider/slider-min.js
vendored
File diff suppressed because one or more lines are too long
1657
lib/yui/slider/slider.js
vendored
1657
lib/yui/slider/slider.js
vendored
File diff suppressed because it is too large
Load diff
6
lib/yui/tabview/README
Executable file
6
lib/yui/tabview/README
Executable file
|
@ -0,0 +1,6 @@
|
|||
Tabview Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
* Initial release
|
||||
|
1951
lib/yui/tabview/tabview-debug.js
vendored
Executable file
1951
lib/yui/tabview/tabview-debug.js
vendored
Executable file
File diff suppressed because it is too large
Load diff
1
lib/yui/tabview/tabview-min.js
vendored
Executable file
1
lib/yui/tabview/tabview-min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1950
lib/yui/tabview/tabview.js
vendored
Executable file
1950
lib/yui/tabview/tabview.js
vendored
Executable file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,35 @@
|
|||
TreeView - Release Notes
|
||||
|
||||
0.12.0
|
||||
|
||||
* TreeView now augments EventProvider, and has custom events for expand,
|
||||
collapse, animStart, animComplete, and labelClick. Existing implementations
|
||||
using abstract methods for these events (if they exist) will still work.
|
||||
New events can be plugged into the tree by the Node implementation. For
|
||||
example, TaskNode adds a checkClick event. EventProvider makes it safe
|
||||
to do this because implementing code can call subscribe() prior to the
|
||||
event creation.
|
||||
|
||||
* YAHOO.util.Event is now a requirement for the widget
|
||||
|
||||
* TreeView::removeChildren no longer expands and collapses the node.
|
||||
|
||||
* Documented the moveComplete property
|
||||
|
||||
* createElement("DIV") changed to createElement("div")
|
||||
|
||||
0.11.4
|
||||
|
||||
* Fixed a javascript error on the HTML node example page.
|
||||
|
||||
0.11.3
|
||||
|
||||
* popNode now clears the tree, previousSibling, nextSibling, and parent
|
||||
properties of the node that is being removed from the tree.
|
||||
|
||||
* Fixed the paths to the images in the tree.css file that is included in
|
||||
build/assets.
|
||||
|
||||
0.11.0
|
||||
|
||||
* Added TreeView -> popNode, which differs from removeNode in that the
|
||||
|
|
|
@ -3,81 +3,81 @@
|
|||
/* first or middle sibling, no children */
|
||||
.ygtvtn {
|
||||
width:16px; height:22px;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tn.gif) 0 0 no-repeat;
|
||||
background: url(tn.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* first or middle sibling, collapsable */
|
||||
.ygtvtm {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tm.gif) 0 0 no-repeat;
|
||||
background: url(tm.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* first or middle sibling, collapsable, hover */
|
||||
.ygtvtmh {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tmh.gif) 0 0 no-repeat;
|
||||
background: url(tmh.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* first or middle sibling, expandable */
|
||||
.ygtvtp {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tp.gif) 0 0 no-repeat;
|
||||
background: url(tp.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* first or middle sibling, expandable, hover */
|
||||
.ygtvtph {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/tph.gif) 0 0 no-repeat;
|
||||
background: url(tph.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* last sibling, no children */
|
||||
.ygtvln {
|
||||
width:16px; height:22px;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/ln.gif) 0 0 no-repeat;
|
||||
background: url(ln.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* Last sibling, collapsable */
|
||||
.ygtvlm {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lm.gif) 0 0 no-repeat;
|
||||
background: url(lm.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* Last sibling, collapsable, hover */
|
||||
.ygtvlmh {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lmh.gif) 0 0 no-repeat;
|
||||
background: url(lmh.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* Last sibling, expandable */
|
||||
.ygtvlp {
|
||||
width:16px; height:22px;
|
||||
cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lp.gif) 0 0 no-repeat;
|
||||
background: url(lp.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* Last sibling, expandable, hover */
|
||||
.ygtvlph {
|
||||
width:16px; height:22px; cursor:pointer ;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/lph.gif) 0 0 no-repeat;
|
||||
background: url(lph.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* Loading icon */
|
||||
.ygtvloading {
|
||||
width:16px; height:22px;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/loading.gif) 0 0 no-repeat;
|
||||
background: url(loading.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
/* the style for the empty cells that are used for rendering the depth
|
||||
* of the node */
|
||||
.ygtvdepthcell {
|
||||
width:16px; height:22px;
|
||||
background: url(../../../../../../../i/us/nt/widg/tree/dflt/vline.gif) 0 0 no-repeat;
|
||||
background: url(vline.gif) 0 0 no-repeat;
|
||||
}
|
||||
|
||||
.ygtvblankdepthcell { width:16px; height:22px; }
|
||||
|
|
1044
lib/yui/treeview/treeview-debug.js
vendored
1044
lib/yui/treeview/treeview-debug.js
vendored
File diff suppressed because it is too large
Load diff
2
lib/yui/treeview/treeview-min.js
vendored
2
lib/yui/treeview/treeview-min.js
vendored
File diff suppressed because one or more lines are too long
1020
lib/yui/treeview/treeview.js
vendored
1020
lib/yui/treeview/treeview.js
vendored
File diff suppressed because it is too large
Load diff
23
lib/yui/yahoo-dom-event/README
Executable file
23
lib/yui/yahoo-dom-event/README
Executable file
|
@ -0,0 +1,23 @@
|
|||
yahoo-event-dom.js Release Notes
|
||||
|
||||
*** version 0.12.0 ***
|
||||
|
||||
The yahoo-event-dom.js file rolls up the three most commonly-used YUI Utilities
|
||||
into a single file; it includes the following files:
|
||||
|
||||
* Yahoo Global Object
|
||||
* Event
|
||||
* Dom
|
||||
|
||||
These three files serve as a common foundation for most YUI components and
|
||||
third-party implementations. On pages where you do not need additional YUI
|
||||
Utilities (Connection Manager, Animation Utility, Drag & Drop Utility), the
|
||||
yahoo-event-dom.js aggregate will often be an optimal choice.
|
||||
|
||||
Note: If you do require additional utilities, the full utilities.js file is
|
||||
provided in this distribution; utilities.js includes all YUI Utilities in a
|
||||
single file.
|
||||
|
||||
Please see the blog article on www.yuiblog.com titled "YUI: Weighing in on
|
||||
Pageweights" at http://yuiblog.com/blog/2006/10/16/pageweight-yui0114/ for more
|
||||
details.
|
1
lib/yui/yahoo-dom-event/yahoo-dom-event.js
vendored
Executable file
1
lib/yui/yahoo-dom-event/yahoo-dom-event.js
vendored
Executable file
File diff suppressed because one or more lines are too long
|
@ -1,10 +1,37 @@
|
|||
YAHOO Global Namespace - Release Notes
|
||||
|
||||
0.12.0
|
||||
|
||||
* Added YAHOO.augment, which copies all or part of the prototype of one
|
||||
object to another.
|
||||
|
||||
* YAHOO.namespace now can create multiple namespaces.
|
||||
|
||||
* Added an optional third parameter to YAHOO.extend: overrides. It takes
|
||||
an object literal of properties/methods to apply to the subclass
|
||||
prototype, overriding the superclass if present.
|
||||
|
||||
0.11.4
|
||||
|
||||
* Changed window.YAHOO = window.YAHOO || {} to
|
||||
if (typeof YAHOO == "undefined") YAHOO = {} because the previous statement
|
||||
contributed to a memory leak in IE6 when the library was hosted in an
|
||||
iframe.
|
||||
|
||||
0.11.3
|
||||
|
||||
* Changed var YAHOO = window.YAHOO || {} to window.YAHOO = window.YAHOO || {}.
|
||||
This fixes an issue in IE where YAHOO would get overwritten if previously
|
||||
defined via array notation (window["YAHOO"]).
|
||||
|
||||
0.11.0
|
||||
|
||||
* Added YAHOO.extend, which provides an easy way to assign the prototype,
|
||||
constructor, and superclass properties inheritance properties. It also
|
||||
prevents the constructor of the superclass from being exectuted twice.
|
||||
|
||||
0.10.0
|
||||
|
||||
* Added YAHOO.log that provides a safe way to plumb logging statements in
|
||||
code that will work if the logging component isn't available.
|
||||
|
||||
|
|
148
lib/yui/yahoo/yahoo-debug.js
vendored
148
lib/yui/yahoo/yahoo-debug.js
vendored
|
@ -1,61 +1,81 @@
|
|||
|
||||
/*
|
||||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Yahoo global namespace
|
||||
* @constructor
|
||||
* The YAHOO object is the single global object used by YUI Library. It
|
||||
* contains utility function for setting up namespaces, inheritance, and
|
||||
* logging. YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
|
||||
* created automatically for and used by the library.
|
||||
* @module yahoo
|
||||
* @title YAHOO Global
|
||||
*/
|
||||
var YAHOO = window.YAHOO || {};
|
||||
|
||||
/**
|
||||
* The YAHOO global namespace object
|
||||
* @class YAHOO
|
||||
* @static
|
||||
*/
|
||||
if (typeof YAHOO == "undefined") {
|
||||
var YAHOO = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the namespace specified and creates it if it doesn't exist
|
||||
*
|
||||
* <pre>
|
||||
* YAHOO.namespace("property.package");
|
||||
* YAHOO.namespace("YAHOO.property.package");
|
||||
*
|
||||
* </pre>
|
||||
* Either of the above would create YAHOO.property, then
|
||||
* YAHOO.property.package
|
||||
*
|
||||
* @param {String} ns The name of the namespace
|
||||
* @return {Object} A reference to the namespace object
|
||||
* Be careful when naming packages. Reserved words may work in some browsers
|
||||
* and not others. For instance, the following will fail in Safari:
|
||||
* <pre>
|
||||
* YAHOO.namespace("really.long.nested.namespace");
|
||||
* </pre>
|
||||
* This fails because "long" is a future reserved word in ECMAScript
|
||||
*
|
||||
* @method namespace
|
||||
* @static
|
||||
* @param {String*} arguments 1-n namespaces to create
|
||||
* @return {Object} A reference to the last namespace object created
|
||||
*/
|
||||
YAHOO.namespace = function(ns) {
|
||||
YAHOO.namespace = function() {
|
||||
var a=arguments, o=null, i, j, d;
|
||||
for (i=0; i<a.length; ++i) {
|
||||
d=a[i].split(".");
|
||||
o=YAHOO;
|
||||
|
||||
if (!ns || !ns.length) {
|
||||
return null;
|
||||
// YAHOO is implied, so it is ignored if it is included
|
||||
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
|
||||
o[d[j]]=o[d[j]] || {};
|
||||
o=o[d[j]];
|
||||
}
|
||||
}
|
||||
|
||||
var levels = ns.split(".");
|
||||
var nsobj = YAHOO;
|
||||
|
||||
// YAHOO is implied, so it is ignored if it is included
|
||||
for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
|
||||
nsobj[levels[i]] = nsobj[levels[i]] || {};
|
||||
nsobj = nsobj[levels[i]];
|
||||
}
|
||||
|
||||
return nsobj;
|
||||
return o;
|
||||
};
|
||||
|
||||
/**
|
||||
* Uses YAHOO.widget.Logger to output a log message, if the widget is available.
|
||||
*
|
||||
* @param {string} sMsg The message to log.
|
||||
* @param {string} sCategory The log category for the message. Default
|
||||
* categories are "info", "warn", "error", time".
|
||||
* Custom categories can be used as well. (opt)
|
||||
* @param {string} sSource The source of the the message (opt)
|
||||
* @return {boolean} True if the log operation was successful.
|
||||
* @method log
|
||||
* @static
|
||||
* @param {String} msg The message to log.
|
||||
* @param {String} cat The log category for the message. Default
|
||||
* categories are "info", "warn", "error", time".
|
||||
* Custom categories can be used as well. (opt)
|
||||
* @param {String} src The source of the the message (opt)
|
||||
* @return {Boolean} True if the log operation was successful.
|
||||
*/
|
||||
YAHOO.log = function(sMsg, sCategory, sSource) {
|
||||
var l = YAHOO.widget.Logger;
|
||||
YAHOO.log = function(msg, cat, src) {
|
||||
var l=YAHOO.widget.Logger;
|
||||
if(l && l.log) {
|
||||
return l.log(sMsg, sCategory, sSource);
|
||||
return l.log(msg, cat, src);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -65,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
|
|||
* Utility to set up the prototype, constructor and superclass properties to
|
||||
* support an inheritance strategy that can chain constructors and methods.
|
||||
*
|
||||
* @param {Function} subclass the object to modify
|
||||
* @param {Function} superclass the object to inherit
|
||||
* @method extend
|
||||
* @static
|
||||
* @param {Function} subc the object to modify
|
||||
* @param {Function} superc the object to inherit
|
||||
* @param {String[]} overrides additional properties/methods to add to the
|
||||
* subclass prototype. These will override the
|
||||
* matching items obtained from the superclass
|
||||
* if present.
|
||||
*/
|
||||
YAHOO.extend = function(subclass, superclass) {
|
||||
var f = function() {};
|
||||
f.prototype = superclass.prototype;
|
||||
subclass.prototype = new f();
|
||||
subclass.prototype.constructor = subclass;
|
||||
subclass.superclass = superclass.prototype;
|
||||
if (superclass.prototype.constructor == Object.prototype.constructor) {
|
||||
superclass.prototype.constructor = superclass;
|
||||
YAHOO.extend = function(subc, superc, overrides) {
|
||||
var F = function() {};
|
||||
F.prototype=superc.prototype;
|
||||
subc.prototype=new F();
|
||||
subc.prototype.constructor=subc;
|
||||
subc.superclass=superc.prototype;
|
||||
if (superc.prototype.constructor == Object.prototype.constructor) {
|
||||
superc.prototype.constructor=superc;
|
||||
}
|
||||
|
||||
if (overrides) {
|
||||
for (var i in overrides) {
|
||||
subc.prototype[i]=overrides[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
YAHOO.namespace("util");
|
||||
YAHOO.namespace("widget");
|
||||
YAHOO.namespace("example");
|
||||
/**
|
||||
* Applies all prototype properties in the supplier to the receiver if the
|
||||
* receiver does not have these properties yet. Optionally, one or more
|
||||
* methods/properties can be specified (as additional parameters). This
|
||||
* option will overwrite the property if receiver has it already.
|
||||
*
|
||||
* @method augment
|
||||
* @static
|
||||
* @param {Function} r the object to receive the augmentation
|
||||
* @param {Function} s the object that supplies the properties to augment
|
||||
* @param {String*} arguments zero or more properties methods to augment the
|
||||
* receiver with. If none specified, everything
|
||||
* in the supplier will be used unless it would
|
||||
* overwrite an existing property in the receiver
|
||||
*/
|
||||
YAHOO.augment = function(r, s) {
|
||||
var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
|
||||
if (a[2]) {
|
||||
for (i=2; i<a.length; ++i) {
|
||||
rp[a[i]] = sp[a[i]];
|
||||
}
|
||||
} else {
|
||||
for (p in sp) {
|
||||
if (!rp[p]) {
|
||||
rp[p] = sp[p];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
YAHOO.namespace("util", "widget", "example");
|
||||
|
||||
|
|
2
lib/yui/yahoo/yahoo-min.js
vendored
2
lib/yui/yahoo/yahoo-min.js
vendored
|
@ -1 +1 @@
|
|||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");
|
||||
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");
|
147
lib/yui/yahoo/yahoo.js
vendored
147
lib/yui/yahoo/yahoo.js
vendored
|
@ -2,59 +2,80 @@
|
|||
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 0.11.0
|
||||
version: 0.12.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Yahoo global namespace
|
||||
* @constructor
|
||||
* The YAHOO object is the single global object used by YUI Library. It
|
||||
* contains utility function for setting up namespaces, inheritance, and
|
||||
* logging. YAHOO.util, YAHOO.widget, and YAHOO.example are namespaces
|
||||
* created automatically for and used by the library.
|
||||
* @module yahoo
|
||||
* @title YAHOO Global
|
||||
*/
|
||||
var YAHOO = window.YAHOO || {};
|
||||
|
||||
/**
|
||||
* The YAHOO global namespace object
|
||||
* @class YAHOO
|
||||
* @static
|
||||
*/
|
||||
if (typeof YAHOO == "undefined") {
|
||||
var YAHOO = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the namespace specified and creates it if it doesn't exist
|
||||
*
|
||||
* <pre>
|
||||
* YAHOO.namespace("property.package");
|
||||
* YAHOO.namespace("YAHOO.property.package");
|
||||
*
|
||||
* </pre>
|
||||
* Either of the above would create YAHOO.property, then
|
||||
* YAHOO.property.package
|
||||
*
|
||||
* @param {String} ns The name of the namespace
|
||||
* @return {Object} A reference to the namespace object
|
||||
* Be careful when naming packages. Reserved words may work in some browsers
|
||||
* and not others. For instance, the following will fail in Safari:
|
||||
* <pre>
|
||||
* YAHOO.namespace("really.long.nested.namespace");
|
||||
* </pre>
|
||||
* This fails because "long" is a future reserved word in ECMAScript
|
||||
*
|
||||
* @method namespace
|
||||
* @static
|
||||
* @param {String*} arguments 1-n namespaces to create
|
||||
* @return {Object} A reference to the last namespace object created
|
||||
*/
|
||||
YAHOO.namespace = function(ns) {
|
||||
YAHOO.namespace = function() {
|
||||
var a=arguments, o=null, i, j, d;
|
||||
for (i=0; i<a.length; ++i) {
|
||||
d=a[i].split(".");
|
||||
o=YAHOO;
|
||||
|
||||
if (!ns || !ns.length) {
|
||||
return null;
|
||||
// YAHOO is implied, so it is ignored if it is included
|
||||
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; ++j) {
|
||||
o[d[j]]=o[d[j]] || {};
|
||||
o=o[d[j]];
|
||||
}
|
||||
}
|
||||
|
||||
var levels = ns.split(".");
|
||||
var nsobj = YAHOO;
|
||||
|
||||
// YAHOO is implied, so it is ignored if it is included
|
||||
for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
|
||||
nsobj[levels[i]] = nsobj[levels[i]] || {};
|
||||
nsobj = nsobj[levels[i]];
|
||||
}
|
||||
|
||||
return nsobj;
|
||||
return o;
|
||||
};
|
||||
|
||||
/**
|
||||
* Uses YAHOO.widget.Logger to output a log message, if the widget is available.
|
||||
*
|
||||
* @param {string} sMsg The message to log.
|
||||
* @param {string} sCategory The log category for the message. Default
|
||||
* categories are "info", "warn", "error", time".
|
||||
* Custom categories can be used as well. (opt)
|
||||
* @param {string} sSource The source of the the message (opt)
|
||||
* @return {boolean} True if the log operation was successful.
|
||||
* @method log
|
||||
* @static
|
||||
* @param {String} msg The message to log.
|
||||
* @param {String} cat The log category for the message. Default
|
||||
* categories are "info", "warn", "error", time".
|
||||
* Custom categories can be used as well. (opt)
|
||||
* @param {String} src The source of the the message (opt)
|
||||
* @return {Boolean} True if the log operation was successful.
|
||||
*/
|
||||
YAHOO.log = function(sMsg, sCategory, sSource) {
|
||||
var l = YAHOO.widget.Logger;
|
||||
YAHOO.log = function(msg, cat, src) {
|
||||
var l=YAHOO.widget.Logger;
|
||||
if(l && l.log) {
|
||||
return l.log(sMsg, sCategory, sSource);
|
||||
return l.log(msg, cat, src);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -64,21 +85,61 @@ YAHOO.log = function(sMsg, sCategory, sSource) {
|
|||
* Utility to set up the prototype, constructor and superclass properties to
|
||||
* support an inheritance strategy that can chain constructors and methods.
|
||||
*
|
||||
* @param {Function} subclass the object to modify
|
||||
* @param {Function} superclass the object to inherit
|
||||
* @method extend
|
||||
* @static
|
||||
* @param {Function} subc the object to modify
|
||||
* @param {Function} superc the object to inherit
|
||||
* @param {String[]} overrides additional properties/methods to add to the
|
||||
* subclass prototype. These will override the
|
||||
* matching items obtained from the superclass
|
||||
* if present.
|
||||
*/
|
||||
YAHOO.extend = function(subclass, superclass) {
|
||||
var f = function() {};
|
||||
f.prototype = superclass.prototype;
|
||||
subclass.prototype = new f();
|
||||
subclass.prototype.constructor = subclass;
|
||||
subclass.superclass = superclass.prototype;
|
||||
if (superclass.prototype.constructor == Object.prototype.constructor) {
|
||||
superclass.prototype.constructor = superclass;
|
||||
YAHOO.extend = function(subc, superc, overrides) {
|
||||
var F = function() {};
|
||||
F.prototype=superc.prototype;
|
||||
subc.prototype=new F();
|
||||
subc.prototype.constructor=subc;
|
||||
subc.superclass=superc.prototype;
|
||||
if (superc.prototype.constructor == Object.prototype.constructor) {
|
||||
superc.prototype.constructor=superc;
|
||||
}
|
||||
|
||||
if (overrides) {
|
||||
for (var i in overrides) {
|
||||
subc.prototype[i]=overrides[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
YAHOO.namespace("util");
|
||||
YAHOO.namespace("widget");
|
||||
YAHOO.namespace("example");
|
||||
/**
|
||||
* Applies all prototype properties in the supplier to the receiver if the
|
||||
* receiver does not have these properties yet. Optionally, one or more
|
||||
* methods/properties can be specified (as additional parameters). This
|
||||
* option will overwrite the property if receiver has it already.
|
||||
*
|
||||
* @method augment
|
||||
* @static
|
||||
* @param {Function} r the object to receive the augmentation
|
||||
* @param {Function} s the object that supplies the properties to augment
|
||||
* @param {String*} arguments zero or more properties methods to augment the
|
||||
* receiver with. If none specified, everything
|
||||
* in the supplier will be used unless it would
|
||||
* overwrite an existing property in the receiver
|
||||
*/
|
||||
YAHOO.augment = function(r, s) {
|
||||
var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
|
||||
if (a[2]) {
|
||||
for (i=2; i<a.length; ++i) {
|
||||
rp[a[i]] = sp[a[i]];
|
||||
}
|
||||
} else {
|
||||
for (p in sp) {
|
||||
if (!rp[p]) {
|
||||
rp[p] = sp[p];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
YAHOO.namespace("util", "widget", "example");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue