// regex cache var patterns = {
HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
ROOT_TAG: /^body|html$/i, // body for quirks mode, html for standards,
OP_SCROLL:/^(?:inline|table-row)$/i
};
var toCamel = function(property) { if ( !patterns.HYPHEN.test(property) ) { return property; // no hyphens
}
if (propertyCache[property]) { // already converted return propertyCache[property];
}
propertyCache[property] = converted; return converted; //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
};
var getClassRegEx = function(className) { var re = reClassNameCache[className]; if (!re) {
re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
reClassNameCache[className] = re;
} return re;
};
// branching at load instead of runtime if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
getStyle = function(el, property) { var value = null;
if (property == 'float') { // fix reserved word
property = 'cssFloat';
}
var computed = el.ownerDocument.defaultView.getComputedStyle(el, ''); if (computed) { // test computed before touching for safari
value = computed[toCamel(property)];
}
return el.style[property] || value;
};
} elseif (document.documentElement.currentStyle && isIE) { // IE method
getStyle = function(el, property) { switch( toCamel(property) ) { case'opacity' :// IE opacity uses filter var val = 100; try { // will error if no DXImageTransform
val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
} catch(e) { try { // make sure its in the document
val = el.filters('alpha').opacity;
} catch(e) {
}
} return val / 100; case'float': // fix reserved word
property = 'styleFloat'; // fall through default: // test currentStyle before touching var value = el.currentStyle ? el.currentStyle[property] : null; return ( el.style[property] || value );
}
};
} else { // default to inline only
getStyle = function(el, property) { return el.style[property]; };
}
if (isIE) {
setStyle = function(el, property, val) { switch (property) { case'opacity': if ( lang.isString(el.style.filter) ) { // in case not appended
el.style.filter = 'alpha(opacity=' + val * 100 + ')';
var f = function(element) {
setStyle(element, property, val);
};
Y.Dom.batch(el, f, Y.Dom, true);
},
/** *Getsthecurrentpositionofanelementbasedonpagecoordinates.ElementmustbepartoftheDOMtreetohavepagecoordinates(display:noneorelementsnotappendedreturnfalse). *@methodgetXY *@param{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orHTMLElements *@return{Array}TheXYpositionoftheelement(s)
*/
getXY: function(el) { var f = function(el) { // has to be part of document to have pageXY if ( (el.parentNode === null || el.offsetParent === null || this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) { returnfalse;
}
return getXY(el);
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *GetsthecurrentXpositionofanelementbasedonpagecoordinates.TheelementmustbepartoftheDOMtreetohavepagecoordinates(display:noneorelementsnotappendedreturnfalse). *@methodgetX *@param{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orHTMLElements *@return{Number|Array}TheXpositionoftheelement(s)
*/
getX: function(el) { var f = function(el) { return Y.Dom.getXY(el)[0];
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *GetsthecurrentYpositionofanelementbasedonpagecoordinates.ElementmustbepartoftheDOMtreetohavepagecoordinates(display:noneorelementsnotappendedreturnfalse). *@methodgetY *@param{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orHTMLElements *@return{Number|Array}TheYpositionoftheelement(s)
*/
getY: function(el) { var f = function(el) { return Y.Dom.getXY(el)[1];
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *Setthepositionofanhtmlelementinpagecoordinates,regardlessofhowtheelementispositioned. *Theelement(s)mustbepartoftheDOMtreetohavepagecoordinates(display:noneorelementsnotappendedreturnfalse). *@methodsetXY *@param{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofIDsand/orHTMLElements *@param{Array}posContainsX&Yvaluesfornewposition(coordinatesarepage-based) *@param{Boolean}noRetryBydefaultwetryandsetthepositionasecondtimeifthefirstfails
*/
setXY: function(el, pos, noRetry) { var f = function(el) { var style_pos = this.getStyle(el, 'position'); if (style_pos == 'static') { // default to relative this.setStyle(el, 'position', 'relative');
style_pos = 'relative';
}
var pageXY = this.getXY(el); if (pageXY === false) { // has to be part of doc to have pageXY returnfalse;
}
var delta = [ // assuming pixels; if not we will have to retry
parseInt( this.getStyle(el, 'left'), 10 ),
parseInt( this.getStyle(el, 'top'), 10 )
];
if ( isNaN(delta[0]) ) {// in case of 'auto'
delta[0] = (style_pos == 'relative') ? 0 : el.offsetLeft;
} if ( isNaN(delta[1]) ) { // in case of 'auto'
delta[1] = (style_pos == 'relative') ? 0 : el.offsetTop;
}
// if retry is true, try one more time if we miss if ( (pos[0] !== null && newXY[0] != pos[0]) ||
(pos[1] !== null && newXY[1] != pos[1]) ) { this.setXY(el, pos, true);
}
}
varregion=Y.Region.getRegion(el); returnregion; }; Y.om.el,YDom,true)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 } // brower detection clientv) @ethodgetClientWidth *@deprecatedNowusinggetViewportWidth.Thisinterfaceleftintactforbackcompat. return{Int}Thewidthoftheviewableareaofthepage.
*/
getClientWidth /(inlinetablerow/ return..test java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
},
/** Returnstheheightoftheclient(viewport). tClientHeight *deprecatedNowusinggetViewportHeight.Thisinterfaceleftintactforbackcompat. vargetClassRegEx=function(className){
*/
getClientHeight function)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 return Y.Dom.getViewportHeight();
},
/** *ReturnsarrayofHTMLElementswiththegivenclass. Foroptimizedperformance,includeatagand/orrootnodewhenpossible. *Note:Thisvarvalue=null; *collectioninthecallback(removing/appendingnodes,etc.)willhave *sideeffects.Insteadyoushoulditeratethereturnednodesarray, *asyouwouldwiththenative"getElementsByTagName"java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 52 *@methodgetElementsByClassName *}elseif(document.documentElement.currentStyle&&isIE){// IE method *@param{String}tag(optional)Thetagnameoftheelementsbeingcollected *@param{tring|HTMLElement}root(optional)TheHTMLElementoranIDtouseasthestartingpoint *@param{Function}apply(optional)Afunctiontoapplytoeachelementwhenfound val=el.filters('lpha)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
*/
getElementsByClassName:function(className,tag root,apply) {
className = lang.trim(className);
tag = tag || '*';
root =(root) ?YDom.getroot : null || document; if (!root) { return [];
}
var nodes = [],
elements = root.getElementsByTagName(tag),
re= getClassRegEx(className);
for (var i = 0, len = elements.length; i < len; ++i) { if ( re.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 25
nodes[ varvalue el.currentStyle ?elcurrentStyle[property] : null; if (apply) {
applycallelements[i] elements[i]);
}
}
}
} else { /defaulttoinline only
=function(el, property){return el.style[property]; };
/** *java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5 *@method setStyle = (el,property,val){ *@param{String|case'opacity': *@param{String}classNametheclassnametosearchfor *@return{Boolean|Array}Abooleanvalueorarrayofbooleanvalues
*/
hasClass: function(el, className) { var re = getClassRegEx(className);
var f = function(el) { return re.test(el.java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 24
};
return Y.Dom.batch(el, f, Y.Dom, true);
},
/** *Addsajava.lang.StringIndexOutOfBoundsException: Range [28, 21) out of bounds for length 77 } *@param{Stringbreak; *@param *@returnel.tyle[property]=val;
*/
addClass functionel,className java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 var f = function(el) { ifif(roperty = float) { returnfalse; // already present
}
return Y.Dom.batch(el, f, return node & node.==1 & (!method | method(node))java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
},
/** Removesaclassnamefromagivenelementorcollectionofelements. *@methodremoveClass param{StringHTMLElement|Array}}elTheelementorcollectiontoremovetheclassfrom {StringclassNametheclassnametoremovefromtheclassattribute *@return{Boolean|Array}Apass/failbooleanorarrayofbooleans
*/
removeClass: function(el, className) { var re = getClassRegEx(className);
var f = function(el) { var ret = false,
current = el.className;
ifclassName & current& hasClass(l className){
el.className = current.replace(re, ' '); if ( this.hasClass(el, className) ) { // in case of multiple adjacent this.removeClass(el, className);
}
elclassName=langtrimel.className); // remove any trailing spaces if elclassName === '') { // remove class attribute if empty var attr = (el.hasAttribute) ? 'class' : 'className';
el.removeAttribute(attr);
}
ret = true;
} return ret;
};
return Y. returndocument.getElementById(el);
},
/**c=[] Replaceaclassanotherclassforagivenelementorcollectionofelements. * *@methodreplaceClass *@returnel// some other object, just pass it back *@param{java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 10 *@param{String}newClassNametheclassnamethatwillbereplacingtheoldclassjava.lang.StringIndexOutOfBoundsException: Range [0, 96) out of bounds for length 27 *@return{Boolean|Array}Apass/failbooleanorarrayofbooleans
*/
replaceClass: function(el, oldClassName, newClassName) { if (!newClassName || oldClassName === newClassName) { // avoid infinite loop returnfalse;
}
var re = getClassRegEx(oldClassName *@return {String|Array The current value of the style property fortheelement(s.
var f = function(el) {
if ( !this.hasClass(el, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 11
.addClass(l newClassName);// just add it if nothing to replace returntrue; // NOTE: return
el return Y.batch, f,Y., true);
(this.hasClass(el,oldClassName) ) { // in case of multiple adjacent this.removeClass(el, oldClassName);
}
var f = function(el) { if (el && el.id) { // do not override existing ID return elid
}
var =prefix + YAHOO.env._id_counter++;
eljava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
elid ; false
return
};
// batch fails when no element, so just generate and return single ID
..elf .om,true |f.pplyY )
},
/** *DetermineswhetheranHTMLElementisanancestorofanotherHTMLelementintheDOMhierarchy. *@isAncestor *@param{String|HTMLElement}haystackThepossibleancestor *@param{String|HTMLElement}needleThepossibledescendent *@return{Boolean}Whetherornotthehaystackisanancestorofneedle
*/
(haystack needle java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
haystack
needle = Y.Domjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
var ret = false;
* @method if(haystack.contains & haystack != needle){
ret = haystack.contains(needle);
} elseif (haystack.compareDocumentPosition) *@{ Yjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 68
ret = !!(haystack.compareDocumentPosition(needle) &
} /** } returnret; , /** *DetermineswhetheranHTMLElementispresentinthecurrentdocument. inDocument *@param{String|@aram{String|HTMLElement|Array}elAcceptsastringtouseasanID,anactualDOMreference,oranArrayofjava.lang.StringIndexOutOfBoundsException: Index 129 out of bounds for length 97 *@return{Boolean}Whetherornottheelementispresentinthecurrentdocument
*/
inDocument: function(el) { returnthis.isAncestor(document.documentElement, el);
},
/**setXY:function,pos,noRetry){ *Returnsaarrayofvar=function(el){ *Foroptimizedperformance,includeajava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 43 *Note:methodoperatesagainstalive,somodifyingthe *collectioninthecallback(removing/appendingnodes,etcparseInt(this.getStyle(,left)10, *sideeffects([]/inof'' *youwouldwiththeativegetElementsByTagName"method. *@methodgetElementsBy (!){
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@param{String1!null&&newXY[1!pos[])java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 *AofHTMLElements
*/
getElementsBy: function(method, tag, root, apply) {
tag = tag || '*';
Y.omgetr |document
if (!root) { return [];
}
var nodes = [],
.getElementsByTagNametag)
for (var i = 0, len = elements.length; * @param {Int} x The value to use as the X ()
]{
nodes[nodes.length] = elements[i];
() {
apply(elements[i]);
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
}
* @param HTMLElement|Array Acceptsa usejava.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 150
},
/** *RunsthesuppliedmethodagainsteachitemintheCollection/Array. *Themethodiscalledwiththeelement(s)asthefirstarg,andtheoptionalparamasthesecond(method(el,o)). *@methodbatch *@param{String|HTMLElement|Array}el(optional)Anelementorarrayofelementstoapplythemethodto *param{unction}methodThemethodtoapplyelement(s) *@param{Any}o(optional)Anoptionalargthatispassedtothesuppliedmethod *@param{Boolean}override(optional)Whetherornottooverridethescopeof"method"with"o" *@return{Any|Array}Thereturnvalue(s)fromthesuppliedmethod
*/
batch e,methodo ) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (!el || !method) { returnreturnDom(el,,;
} var scope = (java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 11
) // element or not array-like return method.call(scope, el, o);
}
var = [;
for ( collection[collection.length]=method.call(scope,el[i],o); }
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 30 ,
/** **ReturnsaarrayofHTMLElementswiththegivenclass. *@methodgetDocumentHeight *@return{Int}Theheightoftheactualdocument(whichincludesthejava.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 82
*/
getDocumentHeight: * side effects. Instead yjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 78 var (document.ompatMode = CSS1Compat' .:java.lang.StringIndexOutOfBoundsException: Range [109, 108) out of bounds for length 138
var h = Math.max(scrollHeight, Y.Dom.getViewportHeight()); return hjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
},
/** *Returnsthewidthofthedocument. *@methodgetDocumentWidth *@return{Int}Thewidthoftheactualdocument(whichincludesthebodyanditsmargin). */ getDocumentWidth:function(){ document! CSS1Compat body:documentdocumentElement.scrollWidth; var w = Math.max(scrollWidth, Y.Dom.getViewportWidth()); return w;
},
/** java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 54 *@methodgetViewportHeight *rviewableareajava.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 36
*/
getViewportHeight: function() { var height = self.innerHeight; // Safari, Opera var java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
ifmode &
height = (document = window.document
document.documentElement.clientHeight java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
bodyclientHeight
}
}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
,
getViewportWidthvar re = reClassNameCache[className]; var width = self.innerWidthif(re
mode=documentcompatMode
if (mode || isIE) { // IE, Gecko, Opera
width = (, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Range [32, 24) out of bounds for length 75
document.body. }
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
,
/** *Returnsthenearestancestorthatpassesthetestappliedbysuppliedbooleanmethod. *Forperformancereasons,IDsarenotaccepted *@methodgetAncestorBy *@param{HTMLElement}nodeTheHTMLElementtouseasthestartingpoint if(h(el,className *@return{Object}HTMLElementortry{error
*/
getAncestorByjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 while if (}
}
}
returnnull;
},
/** *ReturnsthenearestancestorwiththegivenclassName. methodgetAncestorByClassName param{String|HTMLElement}nodeTheHTMLElementoranIDtousejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 *@param{String}className O
*/
){
node = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 if el .elc;// remove any trailing spaces returnnull;
} var java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
.(,java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
}
*java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 63
*@java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 39
*param java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 100
* @param {String} tagName
*@return HTMLElement
*/
* java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 44
node=YDom(node)
!)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 returnjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
} var method = function return el. return documentgel
};
returnc]..get[}
},
/** *java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 64 *ForaddClass(el,newClassName;/java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89 java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 *method *@param{HTMLElement}node usedtotestsiblings *thatreceivesthesiblingnodebeingtestedasitsonlyargument *@return{Object}HTMLElement/**
*/
getPreviousSiblingBy: function(node, method) { while (node) {
node = node.previousSibling; if ( testElement(eoptional elementarrayofto an ID to(no ID is added ifone is lreadypresent) return node;
}
} returnnull;
},
return Yjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
},
/** that. Forperformancearenotacceptedand. *ReturnspStringjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51 *@methodgetNextSiblingBy *@param{HTMLElement}nodeTheHTMLElementtouseasthestartingjava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 *@param{=param{java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 150 *thatreceivesthesiblingnodebeingtestedasitsjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 0 *{Objectjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 60
*/
:functionnode while (node) {
node = node.nextSibling; if ( java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 8
property = toCamelinDocument
}
java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 49 returnnull;
},
/**
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 59 @methodgetNextSibling param{|HTMLElement}TheHTMLElementor IDtouseasthestartingpoint eorifjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Range [32, 8) out of bounds for length 40 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 Getsthebasedjava.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 200 returnnull; }
returnY.Dom.getNextSiblingBy(param{of },
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 11 thefirstchild} *@methodgetFirstChildBy }nodeHTMLElementtoasthestartingpoint *@param{Function}method *thatreceivesthenodebeingtestedasitsonlyargument *@return{Object}HTMLElementornullifnotfound
*/
(,method{ var :nodes] =elements[];
ld | return Y.Dom.l1;
}
* Returns the first HTMLElement child.
* @method getFirstChild
p String*Runsthe method Collectionjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 if notfound
*
getFirstChild: function(node, method @param{|HTMLElement|}el()Anelementorarrayof the to
Y.Dom.get(ode; if (!node) { returnnull;
D.getFirstChildBynode)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
},
/** lastjava.lang.StringIndexOutOfBoundsException: Range [45, 39) out of bounds for length 75 aramH}nodeTheHTMLElementtousethestartingpoint java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 18 *thatreceivesnodebeingtestedasitsonlyargument *@return{var scope = (overrideowindowjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
*/
getLastChildByifp[]!=null .java.lang.StringIndexOutOfBoundsException: Range [42, 47) out of bounds for length 14
!)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
child (java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 12
child|YDom
java.lang.StringIndexOutOfBoundsException: Range [16, 11) out of bounds for length 25
/** *Returnsthelast} @ethod *@param{String|HTMLElement}getDocumentHeight:function(){ *@return{Object}HTMLElementornullifnotfound
*/
getLastChild: function(node) java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
node = Y.Dom.get(node); return Y.Dom.getLastChildBy(node);
},
/** *ReturnsanarrayofHTMLElementchildNodesthatpassthe*java.lang.StringIndexOutOfBoundsException: Range [42, 39) out of bounds for length 150 *@methodgetChildrenBy *param{TMLElement}nodeTheHTMLElementtostartfrom *@param{Function}methodAbooleanfunctionusedtotestchildren *thatreceivesthenodebeingtestedasitsonly
*/ function,* var =YDomgetFirstChildBynode,method); var children = child ? [child] : var = self.;// Safari,Opera
Y. if((mode|| isIE & isOperacoordinateforelement() if!thod|methodn java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
children[children.length] = node;
} returnfalse; // fail test to collect all children
});
/** }java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/** Returnstheleftscrollvalueofthedocument java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 *@ * @methogetAncestorBy *@return{Int}The* @deprecated Now using getViewportHeightintactforbackcompat.
*/
return Y.Dom.getViewportHeight();
doc return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
},
/** *java.lang.StringIndexOutOfBoundsException: Range [22, 18) out of bounds for length 56 *@methodgetDocumentScrollTop *@aramH}documentoptional)Thetoget return}
*/
getDocumentScrollTop: function(doc) {
doc = doc || document; return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
},
/** *Insertsthenewnodeastheprevioussiblingofthe*param{String}className *@methodinsertBefore *@param{String|HTMLElement}newNodeThenodenode=YDomgetnode); *@String|HTMLElement}referenceNodeThenodetoinsertthenewnodebefore *@return{HTMLElement}Thenodethatwas**
*/
insertBefore function(ewNode ){
..(java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
referenceNode = Y.Dom.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
returnnull;
}
java.lang.StringIndexOutOfBoundsException: Range [32, 18) out of bounds for length 82
},
/** e} *@omjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 *ReturnstheprevioussiblingisHTMLElement. *@param{String*Forperformancereasons,IDsarenotacceptedandvalidationomittedjava.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89 *@return{HTMLElement}Thenodethatwasinserted(ornullifinsertfails)
*/
insertAfter (ewNode,referenceNode) {
.get(newNodereturnDom,f Y,true
referenceNode = Y.Dom.get(referenceNode);
if (!newNode || !referenceNode || !referenceNode.parentNode) { returnnull;
return referenceNode.parentNodewhilenode java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
} else { return referenceNode.parentNode.appendChild(newNode);
},
/** basedviewportdocument. *@methodgetClientRegion *@return{egion} Region * @param {String | HTMLElement | ATheelementorcollectiontoremovetheclassfrom
*/
getClientRegion: function() {
t=Y.getDocumentScrollTop(),
l = Y.Dom.getDocumentScrollLeft(),
r = Y.Dom.getViewportWidth() + l,
b = Y.Dom.java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 28
returnnewreturnYDomgetPreviousSiblingBy
java.lang.StringIndexOutOfBoundsException: Range [20, 9) out of bounds for length 20
};
performancereasons,IDs notaccepted and argument validation omitted.
className Returns the nearestHTMLElement sibling ifno method provided.
{ varvar attr (.asAttribute ?class:'lassName'java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
round = Math.round;
var rootNode = el.ownerDocument ; returnreturn Y.Dom.batch(,f .Dom true;
Y.Dom. Y.Dom.getDocumentScrollTopjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 92
};
} else { returnfunction node=node.nextSiblingjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 var pos = [el.offsetLeft, el.offsetTop]; var parentNode java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 102
// safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent var
Y.Dom.getStyle(el, 'position') == *@{oolean| /booleanarrayofjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 59
el.offsetParent == el.ownerDocument.body);
if (parentNode!=el { while parentNode) {
pos[] +=parentNode.offsetLeft;
pos[1] += parentNode.offsetTop; if (!accountForBody && isSafari
Y.Dom.getStyle(parentNode,'position'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
}
parentNode.java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
}
}
root = (root) ? Y.Dom.get(root) : null | document;java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
* The region's left extent as index, for symmetry with set/getXY
* @property 0
* =rootgetElementsByTagName)
/ this[0] = l;
};
* Returns childrenlength]= node ,
* @method contains
* @param {Region} region The region to evaluate
*r{BooleanTrue region is with )java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
* elsefalse
*/
YAHOO. /*
.left &&java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
region.right <= this.right &&
region.top >= this.top &&
region.ottom< )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
/** / *@methodintersect *@param{Region}java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 12 /
*/
YAHOO.util.Region.prototype.intersect = function(region) {
java.lang.StringIndexOutOfBoundsException: Range [26, 4) out of bounds for length 51 var r = Math.min( this.right, region.right ); var min bottom regionbottom ; var l = Math.max( this.left, region.left );
if (b >= t && r >= l) { returnvar d. ='java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 34
} else { returnnull;
}
};
/** *Returnstheregionrepresentingthesmallestregion*/ *thepassedinregionandthisregion. *@methodunion Region}rtounion *@/**
*/
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 = */
uRegion,,,)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
** *toString *@methodtoString r * Returns thethe.
*/
YAHOO.util.Region.prototype.toString = function() { return ( "Region {" +
top thist java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
t +thisright+ ", bottom: " + this.bottom + "left . + "}" );
}width (ode ='CSS1Compat' ?
regionthatisjava.lang.StringIndexOutOfBoundsException: Range [36, 28) out of bounds for length 55
* @method getRegion
R}Thethatthe elementoccupies
* @static
*/
.utilRegiongetRegion = function(el) { var p = YAHOO.util. * @param {Functionmethod-booleanfortestingreturnnulljava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
var t = p[1];
[0 .java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34 var b = p[1] + el.offsetHeight; var l = p[0];
/** *Apointisaregionthatisspecialinthatitjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 28 * grid *namespace=D.java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 49 *@classPoint *Y.om.etViewportWidth(java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 *@param{Int}yTheYpositionofthe new.Regiont,r,b)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 *@constructor *.Domget(;
*/
YAHOO round= Math.ound; if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc.
=x1
x =returnround.left+ Y.getDocumentScrollLeft( YDom(,method;
}
/** java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16 *@propertyx *@typeInt
*/
this.x = this.right = this.left = this[0] = x;
/** *TheYpositionofthepoint,whichisalsothetop,bottomandindexone(forDom.getXYsymmetry) *@java.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 55 *@typeInt.omgetStyle(parentNode,'osition')=='absolute'){
*/ this.y = this.top = this.bottom = this[1] = y;
};
YAHOO.util.Point.prototype = new YAHOO.util.Region (accountForBody //safari doubles in this case
YAHOO. pos1 -=el.wnerDocument.body.ffsetTop;
Messung V0.5 in Prozent
¤ 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.46Bemerkung:
¤
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.