/* Copyright(c)2008,Yahoo!Inc.Allrightsjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 46 CodelicensedundertheBSDLicense: http://developer.yahoo.net/yui/license.txt version:2.6.0
*/ /** *ThedommoduleprovideshelpermethodsformanipulatingDom*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 mode=document.compatMode; *
*/
(function() {
nodes ijava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
lang = YAHOO.lang,
getStyle, // for load time browser branching
setStyle
propertyCache = {}, // for faster hyphen converts
reClassNameCache = {}, // cache regexes for className
; // cache for faster lookups
YAHOO.env._id_counter = YAHOO.env._id_counter || 0; // for use with generateId (global to save state if Dom is overwritten)
// regex cache
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 61
HYPHEN:java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 13
ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
OP_SCROLL:/^(?:inline|table-row)$/i
}; return; var toCamel = function(property) { if patternsHYPHEN.property)){ return property}java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
if (propertyCache[property]) { // already converted return java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 11
}
var converted = property;
while/** converted=converted.replace(RegExp.$1, RegExp.$1.substr(1).toUpperCase()); } propertyCache[property]=converted*@methodhasClass
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 ./[-]/java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 145 }; vargetClassRegEx=function(className){ re=reClassNameCache[className]; !){ re=newRegExp('(?:^|\\s+)'+ * @return {Boolean | Array} A boolean valuevarmode.; reClassNameCache[className]=re;
returnre; ;
// branching at load instead of runtime . document.documentElement.clientWidth:// Standards getStyle=function(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 12 varvalue=null; if(property==*aclasstoelementorjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 74 property='cssFloat'; }
varcomputed=el.ownerDocument.defaultView.getComputedStyle(el,''); if(computed){// test computed before touching for safari value=computed[toCamel(property)]; } returnel.style[property]*BooleanApass/booleanarrayjava.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 77 }; )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 switch(toCamel(property)){ returnfalse; varval=100; {java.lang.StringIndexOutOfBoundsException: Range [42, 39) out of bounds for length 62 valel'java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 85
}( try{// make sure its in the document val=el.filters('java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 }catch(e){ } } returnval/100; case'float':// fix reserved word propertystyleFloat;/java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 default: // test currentStyle before touching varvalue*@{String}classNameclassnametoremovefromthejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 24 return(el.style[property]||value); } }; }else{// default to inline only getStyle=function(el,property){*@ } if(isIE){ setStyle=function(l,property,val){ switch(property){ var =false, if(lang.isString(el.style.filter)=el.className;; java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 if/ el.style.zoom=1;// when no layout or cant tell } } break; case'float': property='styleFloat'; java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 el.style[property]=val; } }; }else{ el,property,val){ if(propertyjava.lang.StringIndexOutOfBoundsException: Range [47, 42) out of bounds for length 49 property='cssFloat'; } el.style[property]= return Y.D(,method)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 };}java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10 }
var * ReturnsReturnsthenearestancestorwiththegiventagName. returnnode&&node.nodeType==1&&(!method||method(node@ethodgetAncestorByTagName };
if (typeof el === 'string') { // id return document.etElementById(el);
}
if ('length' in el) { // array-like
=[]java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 for ;
c[.length = YDom.el[
}
return
}
;
}
returnnull;
},
/** *NormalizescurrentStyleandReturnstheprevioussiblingthatisanjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 12 *@methodgetStyle *@param{String|HTMLElement|Array}eljava.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 12 @getPreviousSiblingBy .removeClass(eloldClassName);
java.lang.StringIndexOutOfBoundsException: Range [16, 11) out of bounds for length 11 getStyle:function(el,property){ property=toCamel(property); varf=function(element){ ,property); }; returnY.Dom.batch(el,f,Y.Dom,true); , /** *WrapperforsettingstylepropertiesofHTMLElements.Normalizes"opacity"acrossmodernbrowsers. *@methodsetStyle *@String|HTMLElement|Array}elAcceptsstringtouseasanID,actualDOMreference,anArrayofIDs/orHTMLElements. *@param{String}propertyThestylepropertyto*@return}HTMLElementornullifnotfoundrethaystack..contains(needle); *@param{String}valThevaluejava.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 10
*/
setStyle: function(el, property, val) {
*@methodinDocument
var f = function(element *param {String elThe java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 17
setStyle(element, property, val);
};
return{Boolean}Whetheror not theelement is java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 24
},
/** *Getsthecurrentpositionofan thenextthatisanHTMLElement *@param{String|HTMLElement|java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 10 *@return{Array}TheXYpositionoftheelement(s)
*/
getXY: function(el) { var f = function(el) { // has to be part of document to have pageXY if ( (el.*For performance include aor @turn{bject}HTMLElement or notjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) { returnfalse;
}
return getNextSibling: function( collection inthecallback (removing/ppending nodes,etc.) willjava.lang.StringIndexOutOfBoundsException: Range [80, 76) out of bounds for length 80
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *GetsthecurrentXpositionofanelementonpagecoordinates.The*asyou withthenative"getElementsByTagName"method. *@methodgetX *@{tring|* @param {String} tag (optionaltagnameoftheelementsbeingcollected *@{Number|ArrayTheXpositiontheelementsjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
*/
getX var f = function(el) { return Y.Dom.getXY(el)[0];
;
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *getElementsBy: * @param {HTMLElementThetousestarting *@getY *@{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orjava.lang.StringIndexOutOfBoundsException: Index 147 out of bounds for length 67 java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 68
*/
getY nodesnodeslength []java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 var f = function(el) {
getXY(l[];
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** thepositionofanhtmlelementincoordinates,regardlessjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 11 *Theelement(s)mustreturnnodes *@methodsetXY *@aram{suppliedagainsteachinCollectionAjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 *@param{Array}posContainsX&Yvaluesfornewposition(coordinatesarepage/ *@param{Boolean}noRetryBydefaultwetryandsetthepositionnode=getn)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
*/
setXY: function(el, pos, noRetry} var f = function(el returnY.om(ode; varstyle_pos =this.getStyle(l 'position'); if (style_pos == 'static') { // default to relative this.setStyle(el, 'position', 'relative');
style_pos =*paramBoolean (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* thelast HTMLElementchild thatpassesthetest method.
var pageXY = this.getXY(el);
* @methodgetLastChildBy returnfalse @ramTMLElementtoasstarting
}
if ( isNaN(delta[0]) ) {// in case of 'auto'
[0 style_pos = thattheasjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 67
} return java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
delta[1] = (style_pos == 'relative') ? (ltagName | length ==undefined {
}
if (os0]= null){elstyle.left = pos[0] - pageXY[0] + delta[0] + 'px'; } if (pos[1] !== null) var =[;
if(!oRetry { var newXY=this.etXY(l;
// if retry is true, try one more time if we miss
;
(pos[1] ! } this.setXY(el, pos, truevar = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 return | .java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 10
}
*Returns heightofthedocumentjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
Y. * @methogetDocumentHeight
}
/** *SettheXposition*mgetLastChild *TheelementmustbepartoftheDOMtreetohavepagecoordinates(display:noneorelementsvarscrollHeight=(ocument.compatMode!CSS1Compat'?document.ody.scrollHeight:document.documentElement.scrollHeight; *@methodsetX *@param{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orHTMLElements. *}Thevalueusethecoordinate()java.lang.StringIndexOutOfBoundsException: Range [82, 83) out of bounds for length 82
*/
{
Y.Dom.setXY(el, [x, null]);
},
/** *Set*/ *TheelementmustbepartoftheDOMtreetogetChildrenBy:(node/ *@methodsetY *@param{String|HTMLElement|java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fortheelement()
*/
setY height=(mode (!thod method(ode)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
Y.Dom.setXY(el, [null, y]);
},
/** *Returnstheregionpositionofthejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 17 *TheelementmustbepartoftheDOMtreetohave *@methodgetRegion *@param{String|HTMLElement|Array}el/** *@return{Regionjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
getRegion:function(el){ var/** if((el.parentNode===nullof this.getStyle(l,'display'=varwidth=selfinnerWidth;//Safari returnfalse; }
region=YRegion.getRegion(el); returnregion; }; returnY.Dom.batch(el,f,Y.Dom,true); , /** *(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 *@methodgetClientWidth *@deprecatedNowusinggetViewportWidth.Thisjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 0 *@return{Int}Theofviewablearea,
*/
getClientWidth: function() { return.getViewportWidth*java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 57
},
/** *Returnstheheightoftheclient(viewport). *@methodgetClientHeight .Thisinterfaceleftforbackjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96 *@return{ntTheheightoftheviewableareaofthepage.
*/
getClientHeight: function() {
java.lang.StringIndexOutOfBoundsException: Range [18, 12) out of bounds for length 45
},
/** *ReturnsaarrayofHTMLElementswiththegivenclass. *Foroptimizedperformance,includeatagand/orrootnodewhenpossible. *Note:ThismethodoperatesagainstaReturnsthetopscrollvalueofthedocument p{TMLDocument(documenttojava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 14 *sideeffects.Insteadyoushoulditeratethe*@java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 *asyouwouldwiththenative"getElementsByTagName"method. *@methodgetElementsByClassName *@aramString} *@param{String}tag(optional)Thetagnameoftheelementsbeingjava.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 11 *@param{String|HTMLElement}root(optional)TheHTMLElementoranIDtouseasthestartingpoint *@param{Function}apply(optional)Afunctiontoapplytoeachelementwhenfound *@return{java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
*/
getElementsByClassName:functionclassName, ,root,apply) {
className /
tag = tag || '*';
root = (root) ? Y.Dom.get(root) : null || document; if (! * @param {St|HTMLElement TheHTMLElement .met; return [];
}
var nodes = [],
elements = root.getElementsByTagName(tag),
re = getClassRegEx(className);
for (var i = 0, len = elements.length; i < len; ++i) { if(re.(lements[i]className) ) {
nodes[nodes.length] = elements[i]; if (apply) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return referenceNode.newNode )
}
}
}
return nodes;
},
/** *Determinesenewjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 * YY..nodeethod; *@param{String|HTMLElement|Array}elTheelementjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@param{String}classNametheclassnametosearchfor *@return{Boolean|Array}Abooleanvalueorarrayofbooleanvalues
*/
e)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 var re = getClassRegEx(className);
var f = function(el) {
/
};
:functionnewNode {
Ybatch , )
},
/** *Addsaclassnametoagivenelementorcollectionofelements. *@methodaddClass |}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@return{Boolean|Array}A*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
addClass =.reviousSibling var () java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 if nodejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 returnfalse; // already present
}
/** *Removesaclassnamefromagivenelementorcollectionofelements. *@methodremoveClass }eltojava.lang.StringIndexOutOfBoundsException: Range [88, 87) out of bounds for length 102 *@param{String}classNametheclassnametoremovefromtheclassattribute *@return{Boolean|Array}Apass/failboolean
*/
=Y.omgetnode)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 var re = getClassRegEx(className);
var f = function(el) { var ret
current = el.className;
if (className && current && this.hasClass(el, className)) {
el.* java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 73 if (el.className = *@ethodjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
l)'' c;
el.removeAttribute(attr);
}
ret true
} return retjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
..el,,Y,);
},
/** *Replaceaclasswithanotherclassforagivenelementorcollectionofelements. *IfnooldClassNameispresent,thenewClassNameissimplyadded. *@methodreplaceClass *@param{String|HTMLElement|Array}elTheelementorreturn; *@param{java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 11 /** returnBoolean|Array}Apass/failorofjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 59
*/
replaceClass: function =)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if (!newClassName || oldClassName 0+ java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 56 returnfalse;
var re = getClassRegEx(oldClassName);
var f = function(el) {
if ( !this.hasClassForBody = true; this.addClass(el, newClassName); // just add it if nothing to replace returntrue; // NOTE: return
}
= parentNodeoffsetParent;
if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent this.removeClass(el, oldClassName);
}
.className =lang.trim(lclassName); // remove any trailing spaces returntrue;
}
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *ReturnsanIDandappliesittotheelement"el",ifprovided. *@methodgenerateId *@param{String|HTMLElement|Array}el(optional)AnoptionalelementarrayofelementstoaddanIDto(noIDisaddedifoneisalreadypresent). *@param{Stringjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 *return{String|Array}The,orarrayofjava.lang.StringIndexOutOfBoundsException: Range [0, 75) out of bounds for length 11
*/
generateId: function(el, prefix) {
prefix = prefix || 'yui-gen';
arf=function(el) { if (el && el.id) { // do not override existing ID return el.id;
}
var id = prefix + YAHOO.env._id_counter++;
if getFirstChild:function(odemethod){
el.id = id;
}
return id;
};
// batch fails when no element, so just generate and return single ID return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments);
},
/** *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 isAncestor *@param{String|HTMLElement}haystackThepossibleancestor *@param{String|HTMLElement}needleThepossibledescendent *@eturnorthehancestor*prjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 34
*/
isAncestor: function(haystack, needle) {
haystack = Y.Dom. *@aram{TMLElement} java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 33
needle = Y.Dom.get(needle);
var ret =false;
if*/ if (haystack.contains && java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 42
ret = haystack.contains(needle);
} elseif(haystack.compareDocumentPosition){ // gecko
ret = /** } }else{ } returnret; }, /** *DetermineswhetheranHTMLElementisjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 16 *@methodinDocument *@param{String|HTMLElement}elTheelementtosearchfor resentjava.lang.StringIndexOutOfBoundsException: Range [0, 69) out of bounds for length 7
*/
inDocument:function(){ returnthis.isAncestor(document.documentElement, el);
}
/** *ReturnsaarrayofHTMLElements/** / *Notemethodjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 32 *collectioninthecallback(removing/appendingnodes,etc.)willhave * * @ret{bject}HTMLElementorfound *asyouwouldwiththenative"getElementsByTagName"methodgetLastChild::function(node){ *YomgetLastChildBy((; *@param{Function}method-Abooleanmethodfortestingelementswhichreceivestheelement, *@param{String}tag(optional)Thetag/ *@param{String| *@*method *@return{paramHTMLElement}nodestart
*/
getElementsBy: function(method, tag, root, this.left ljava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
tag=tag || '*';
|
f (root java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 return [];
}
var nodes = [],
elements = .(tag);
for (var i = 0, * if(methodelementsi)){
nodes[nodes.length] = elements[i];
apply {
apply(elements[i]);
}
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
return nodes;
}
/** *RunsthesuppliedmethodagainsteachitemintheCollection/Array. *Themethodiscalledwith@eturn{Boolean}iftheregioncontained}; *@methodbatch *@param{String|HTMLElement|Array}el(optional)Anelementorarrayofelementstoapplythemethodjava.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 57
*@bottom=this.bottom; *@param{Booleanjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@return{Any|Array}Thereturnvalue(s)fromthesuppliedmethod
*/
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 50
el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
if (!el | node =Y.getnode; returnfalse;
}
= (override)? o: java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 3
if (el.tagName }
. . * l)
}
var collection = [];
for (var/** collection[collection.length]=method.call(scope,el[i],o); } returncollection; }, /** *Returnsjava.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 3 *@method var t = Math.max( this.top,region.top); *@return{Int}Theheightof b=Math.(this.,region.)
*/
getDocumentHeightgetDocumentScrollLeft: function(doc) {
scrollHeight=(ocumentcompatMode! CSS1Compatdoc=doc| document;
/** *Returnsthewidthofthedocument. *@methodjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@ethodgetDocumentScrollTop
*/
getDocumentWidth:function){ var scrollWidth = (document.compatMode != 'CSS1Compat') ? document.body.scrollWidth : document.documentElement.scrollWidth; var w = Math @return {Int The that the document isscrolled to the top return w;
} *@param {Region} regionThe egion thattocreatethe with
/**doc=doc||document; *Returnsthecurrentheightoftheviewport. *@methodgetViewportHeight *@return{Int}Theheightoftheviewableareaofthepage(excludesscrollbars).
*/
getViewportHeight: function() { varjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0 var mode = * @param {String | HTMLElementreturnnewYAHOO.il(t ,b,ljava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
/** widthjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 53 *@methodgetViewportWidth *@return{Int}Thewidthoftheviewableareaofthepage(excludesscrollbars).
*/
getViewportWidth: function() { var width = self.innerWidth; // Safari var ", righ:" .
if (mode || " left:"+thisleft+
m ?
document.documentElement
document.body.clientWidth; // Quirks
} return width * Returns a that occupied by * Returns a region that is occupied by the(ornullinsertfails
},
/** *Returnstheancestorthat *FornewNode=Y.om*@eturn{gion *@methodgetAncestorBy *@param{HTMLElement}nodeTheHTMLElementtouseasthestartingpoint }Abooleanmethodtesting; *@return{Object}HTMLElementornullifnotfound
*/
getAncestorBy: java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 17 whilevar r =p] +eloffsetWidth; if ( testElement(node, method) ) { return node;
}
}
returnnull;
},
/** *ReturnsthenearestancestorwiththegivenclassName. *@methodgetAncestorByClassName ///////////////////////////////////////////////////////////////////////////// StringclassName *@return{Object}HTMLElement
*/
getAncestorByClassName:functionnode className {
node = Y.Dom.get(node); if (!node) { returnnull;
} var method = function(el) { return Y.Dom.hasClass(el, classNamejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 11 return Y.Dom.getAncestorBy( @vart=.omgetDocumentScrollTop(),
},
/** *ReturnsthenearestancestorwiththegiventagName. *@methodgetAncestorByTagName *@param{String|HTMLElement}nodeTheHTMLElementoranIDtouseasthestartingpoint *@param{String}tagName *@return{Object}HTMLElement
*/
getAncestorByTagName: function(node, tagName) {
node=Y.node) if (!node) { returnnull;
} var method = function(el) { return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
return..getAncestorBy(node )java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
},
/** *ReturnsthenextHTMLElementsiblingthatpassesthebooleanmethod. ,IDsarenotacceptedandargumentvalidationomitted. *ReturnsthenearestHTMLElementsiblingifnomethodprovided. *@methodgetNextSiblingBy *@param{HTMLElement}nodeTheHTMLElementtouseasthestartingpoint *@param{Function}methodAbooleanfunctionusedtotestsiblings *thatreceivesthesiblingnodebeingtestedasitsonly*@namespaceYAHOO.util *returnObject}HTMLElementornullfound
*/
getNextSiblingBy: function * @param {nt the bottom extent while (node) {
node = node.nextSibling; if ( testElement(node, method) ) { return node;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 return java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
},
/** *ReturnsthenextsiblingthatisanHTMLElement *@methodgetNextSibling *@param{String|HTMLElement}nodeTheHTMLElementoranIDtouseasthestartingpoint *@return{Object}HTMLElementornullifnotfound
*/
getNextSibling: function(node) {
*@ropertyjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 if * @ypeInt returnnull;
}
return Y
}
/** *ReturnsthefirstHTMLElementchildthatpassesthetestmethod. *@methodgetFirstChildBy *@param{java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 7 *@param{Function}methodAbooleanfunctionusedtotestchildren *thatreceivesthenodebeingtestedasitsonlyargument *@return{Object}HTMLElementornullifnotfound
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 var child = ( testElement(node.firstChildTheregionsextent return child || Y.Dom. p
},
/** ** *@ethod *@param{String|HTMLElement}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 *@return{leftextentasindex,forwith/
*/
getFirstChild (ode method java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 returnnull;
} return Y.Dom.getFirstChildBy(node);
},
/** *ReturnsthelastHTMLElementchildthatpassesthetestmethod. *@methodgetLastChildBy *@param{HTMLElement}nodeTheHTMLElementtouseasthestartingpoint paramFunction}methodAbooleanfunctionusedjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 76 *thatreceives.<.right& *@return{Object.ottom=this.;
*/
getLastChildBy: function(node, method) {
*Returnsareaofthe returnnull;
} var child *@eturn{nt theregionsarea return child*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
},
**
* Returns an array ofvarr= Math.in(this.ight region.ight ;
* @method getChildrenBy var b =Math.in .,regionbottom)
* @param l .( left regionleft)
* that receives the node being tested as its only argument
* @return {Array} A static array of HTMLElements
*
getChildrenBy: function(node, method) { var child = Y.Dom.getFirstChildBy(node, method); var children = child ? [child] : [];
Y.Dom.getNextSiblingBy(child, function(node) { if *Returnsregionrepresentingthesmallestregion can
children[children.length] = node;
} returnfalse; // fail test to collect all children
});
/** *Returnstheleftscrollvalueofthedocument *@methodgetDocumentScrollLeft *@param{HTMLDocument}document(optional)Thedocumenttogetthescroll @{nt}Theamountthatthejava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 78
*/
getDocumentScrollLeft: function(doc) {
doc.til.egion.rototype.oString =()java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
},
/** *Returnsthetopscrollvalueofthe":"+this.+ *@methodgetDocumentScrollTop *@java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@return{Int}Theamountthatthedocumentisscrolledtothetop
*/
getDocumentScrollTop: function(doc) {
doc = doc || document; return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
/** thenewasprevioussiblingthe *@methodinsertBefore *@param{String|HTMLElement}newNodeThenodetobeinsertedvart=[] *@param{String|HTMLElement}referenceNodeThenodetoinsertthenewnodebefore *@return{HTMLElementjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
insertBefore: function(newNode, referenceNode) {
Apointis regionthatisspecialinthat t singlepointon
referenceNode = Y.Dom.get(referenceNode);
if (!newNode || !referenceNode || !referenceNode.parentNode) { returnnull;
}
return.arentNodeinsertBefore(newNode );
},
/** *Insertsthenewnodeasthenextsiblingofthereferencenode *@methodinsertAfter *@param{String|HTMLElement}newNodeThenodetobeinserted *@param{String|HTMLElementjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 *@return{HTMLElement}Thenodethatwasinserted(ornullifinsertfails)
*/
insertAfter: function(newNode, referenceNode) {
newNode = Y.Dom.get(newNode);
referenceNode = Y.Dom.get(referenceNode);
if (!newNode || !referenceNode || !referenceNode.parentNode) { returnnull;
}
if (referenceNode.nextSibling) { return referenceNode.arentNode.nsertBeforenewNode .nextSibling)
} else {
java.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 5
}
},
/** *CreatesaRegionbasedontheviewportrelativetothedocumentYAHOO.til..prototypenewYAHOO.tilRegion(; *@methodgetClientRegion *@return{Region}ARegionobjectrepresentingtheviewportwhichaccountsfordocumentscroll
*/
getClientRegion: function() { var t = Y.Dom.getDocumentScrollTop(),
l = Y.Dom.getDocumentScrollLeft(),
r = Y.Dom.getViewportWidth() + l,
b = Y.Dom.getViewportHeight() + t;
returnnew Y.Region(t, r, b, l);
}
};
var getXY = function() { if (document.documentElement.getBoundingClientRect) { // IE returnfunction(el) { var box = el.getBoundingClientRect(),
round = Math.round;
var rootNode = el.ownerDocument; return [round(box.left + Y.Dom.getDocumentScrollLeft(rootNode)), round(box.top +
Y.Dom.getDocumentScrollTop(rootNode))];
};
} else { returnfunction(el) { // manually calculate by crawling up offsetParents var pos = [el.offsetLeft, el.offsetTop]; var parentNode = el.offsetParent;
// safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent var accountForBody = (isSafari &&
Y.Dom.getStyle(el, 'position') == 'absolute' &&
el.offsetParent == el.ownerDocument.body);
if (accountForBody) { //safari doubles in this case
pos[0] -= el.ownerDocument.body.offsetLeft;
pos[1] -= el.ownerDocument.body.offsetTop;
}
parentNode = el.parentNode;
// account for any scrolled ancestors while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) )
{ if (parentNode.scrollTop || parentNode.scrollLeft) {
pos[0] -= parentNode.scrollLeft;
pos[1] -= parentNode.scrollTop;
}
/** *Returnstheregionwherethepassedinregionoverlapswiththisone *@methodintersect *@param{Region}regionTheregionthatintersects *@return{Region}Theoverlapregion,ornullifthereisnooverlap
*/
YAHOO.util.Region.prototype.intersect = function(region) { var t = Math.max( this.top, region.top ); var r = Math.min( this.right, region.right ); var b = Math.min( this.bottom, region.bottom ); var l = Math.max( this.left, region.left );
if (b >= t && r >= l) { returnnew YAHOO.util.Region(t, r, b, l);
} else { returnnull;
}
};
/** *Returnstheregionrepresentingthesmallestregionthatcancontainboth *thepassedinregionandthisregion. *@methodunion *@param{Region}regionTheregionthattocreatetheunionwith *@return{Region}Theunionregion
*/
YAHOO.util.Region.prototype.union = function(region) { var t = Math.min( this.top, region.top ); var r = Math.max( this.right, region.right ); var b = Math.max( this.bottom, region.bottom ); var l = Math.min( this.left, region.left );
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.32Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.