All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.struts2.static.domTT.js Maven / Gradle / Ivy

There is a newer version: 6.4.0
Show newest version
//Version: 0.7.3
var domLib_userAgent=navigator.userAgent.toLowerCase();var domLib_isMac=navigator.appVersion.indexOf("Mac")!=-1;var domLib_isWin=domLib_userAgent.indexOf("windows")!=-1;var domLib_isOpera=domLib_userAgent.indexOf("opera")!=-1;var domLib_isOpera7up=domLib_userAgent.match(/opera.(7|8)/i);var domLib_isSafari=domLib_userAgent.indexOf("safari")!=-1;var domLib_isKonq=domLib_userAgent.indexOf("konqueror")!=-1;var domLib_isKHTML=(domLib_isKonq||domLib_isSafari||domLib_userAgent.indexOf("khtml")!=-1);var domLib_isIE=(!domLib_isKHTML&&!domLib_isOpera&&(domLib_userAgent.indexOf("msie 5")!=-1||domLib_userAgent.indexOf("msie 6")!=-1||domLib_userAgent.indexOf("msie 7")!=-1));var domLib_isIE5up=domLib_isIE;var domLib_isIE50=(domLib_isIE&&domLib_userAgent.indexOf("msie 5.0")!=-1);var domLib_isIE55=(domLib_isIE&&domLib_userAgent.indexOf("msie 5.5")!=-1);var domLib_isIE5=(domLib_isIE50||domLib_isIE55);var domLib_isGecko=domLib_userAgent.indexOf("gecko/")!=-1;var domLib_isMacIE=(domLib_isIE&&domLib_isMac);var domLib_isIE55up=domLib_isIE5up&&!domLib_isIE50&&!domLib_isMacIE;var domLib_isIE6up=domLib_isIE55up&&!domLib_isIE55;var domLib_standardsMode=(document.compatMode&&document.compatMode=="CSS1Compat");var domLib_useLibrary=(domLib_isOpera7up||domLib_isKHTML||domLib_isIE5up||domLib_isGecko||domLib_isMacIE||document.defaultView);var domLib_hasBrokenTimeout=(domLib_isMacIE||(domLib_isKonq&&domLib_userAgent.match(/konqueror\/3.([2-9])/)==null));var domLib_canFade=(domLib_isGecko||domLib_isIE||domLib_isSafari||domLib_isOpera);var domLib_canDrawOverSelect=(domLib_isMac||domLib_isOpera||domLib_isGecko);var domLib_canDrawOverFlash=(domLib_isMac||domLib_isWin);var domLib_eventTarget=domLib_isIE?"srcElement":"currentTarget";var domLib_eventButton=domLib_isIE?"button":"which";var domLib_eventTo=domLib_isIE?"toElement":"relatedTarget";var domLib_stylePointer=domLib_isIE?"hand":"pointer";var domLib_styleNoMaxWidth=domLib_isOpera?"10000px":"none";var domLib_autoId=1;var domLib_zIndex=100;var domLib_collisionElements;var domLib_collisionsCached=false;var domLib_timeoutStateId=0;var domLib_timeoutStates=new Hash();if(!document.ELEMENT_NODE){document.ELEMENT_NODE=1;document.DOCUMENT_NODE=9;}
function domLib_clone(_1){var _2={};for(var i in _1){var _4=_1[i];try{if(_4!=null&&typeof(_4)=="object"&&_4!=window&&!_4.nodeType){_2[i]=domLib_clone(_4);}else{_2[i]=_4;}}
catch(e){_2[i]=_4;}}
return _2;}
function Hash(){this.length=0;this.numericLength=0;this.elementData=[];for(var i=0;i_16.get("leftCenter")&&_15.get("left")>_16.get("right"))||(_15.get("topCenter")<=_16.get("topCenter")&&_15.get("bottom")<_16.get("top"))||(_15.get("topCenter")>_16.get("topCenter")&&_15.get("top")>_16.get("bottom"))){_14.hideList.remove(_f.id);if(!_14.hideList.length){_14.style.visibility="visible";if(domLib_isKonq){_14.style.display="";}}}else{_14.hideList.set(_f.id,true);_14.style.visibility="hidden";if(domLib_isKonq){_14.style.display="none";}}}}}
function domLib_getOffsets(_19,_1a){if(typeof(_1a)=="undefined"){_1a=false;}
var _1b=_19;var _1c=_19.offsetWidth;var _1d=_19.offsetHeight;var _1e=0;var _1f=0;while(_19){_1e+=_19.offsetLeft;_1f+=_19.offsetTop;_19=_19.offsetParent;if(_19&&!_1a){_1e-=_19.scrollLeft;_1f-=_19.scrollTop;}}
if(domLib_isMacIE){_1e+=10;_1f+=10;}
return new Hash("left",_1e,"top",_1f,"right",_1e+_1c,"bottom",_1f+_1d,"leftCenter",_1e+_1c/2,"topCenter",_1f+_1d/2,"radius",Math.max(_1c,_1d));}
function domLib_setTimeout(_20,_21,_22){if(typeof(_22)=="undefined"){_22=[];}
if(_21==-1){return 0;}else{if(_21==0){_20(_22);return 0;}}
var _23=domLib_clone(_22);if(!domLib_hasBrokenTimeout){return setTimeout(function(){_20(_23);},_21);}else{var id=domLib_timeoutStateId++;var _25=new Hash();_25.set("function",_20);_25.set("args",_23);domLib_timeoutStates.set(id,_25);_25.set("timeoutId",setTimeout("domLib_timeoutStates.get("+id+").get('function')(domLib_timeoutStates.get("+id+").get('args')); domLib_timeoutStates.remove("+id+");",_21));return id;}}
function domLib_clearTimeout(_26){if(!domLib_hasBrokenTimeout){if(_26>0){clearTimeout(_26);}}else{if(domLib_timeoutStates.has(_26)){clearTimeout(domLib_timeoutStates.get(_26).get("timeoutId"));domLib_timeoutStates.remove(_26);}}}
function domLib_getEventPosition(_27){var _28=new Hash("x",0,"y",0,"scrollX",0,"scrollY",0);if(domLib_isIE){var doc=(domLib_standardsMode?document.documentElement:document.body);if(doc){_28.set("x",_27.clientX+doc.scrollLeft);_28.set("y",_27.clientY+doc.scrollTop);_28.set("scrollX",doc.scrollLeft);_28.set("scrollY",doc.scrollTop);}}else{_28.set("x",_27.pageX);_28.set("y",_27.pageY);_28.set("scrollX",_27.pageX-_27.clientX);_28.set("scrollY",_27.pageY-_27.clientY);}
return _28;}
function domLib_getIFrameReference(_2a){if(domLib_isGecko||domLib_isIE){return _2a.frameElement;}else{var _2b=_2a.name;if(!_2b||!_2a.parent){return null;}
var _2c=_2a.parent.document.getElementsByTagName("iframe");for(var i=0;i<_2c.length;i++){if(_2c[i].name==_2b){return _2c[i];}}
return null;}}
function domLib_getElementsByTagNames(_2e,_2f){var _30=[];for(var i=0;i<_2e.length;i++){var _32=document.getElementsByTagName(_2e[i]);for(var j=0;j<_32.length;j++){if(_32[j].tagName=="OBJECT"&&domLib_isGecko){var _34=_32[j].childNodes;var _35=false;for(var k=0;k<_34.length;k++){if(_34[k].tagName=="EMBED"){_35=true;break;}}
if(_35){continue;}}
if(_2f&&domLib_getComputedStyle(_32[j],"visibility")=="hidden"){continue;}
_30[_30.length]=_32[j];}}
return _30;}
function domLib_getComputedStyle(_37,_38){if(domLib_isIE){var _39=_38.replace(/-(.)/,function(a,b){return b.toUpperCase();});return eval("in_obj.currentStyle."+_39);}else{if(domLib_isKonq){return eval("in_obj.style."+_38);}else{return document.defaultView.getComputedStyle(_37,null).getPropertyValue(_38);}}}
var domTT_offsetX=(domLib_isIE?-2:0);var domTT_offsetY=(domLib_isIE?4:2);var domTT_direction="southeast";var domTT_mouseHeight=domLib_isIE?13:19;var domTT_closeLink="X";var domTT_closeAction="hide";var domTT_activateDelay=500;var domTT_maxWidth=false;var domTT_styleClass="domTT";var domTT_fade="neither";var domTT_lifetime=0;var domTT_grid=0;var domTT_trailDelay=200;var domTT_useGlobalMousePosition=true;var domTT_postponeActivation=false;var domTT_tooltipIdPrefix="[domTT]";var domTT_screenEdgeDetection=true;var domTT_screenEdgePadding=4;var domTT_oneOnly=false;var domTT_cloneNodes=false;var domTT_detectCollisions=true;var domTT_bannedTags=["OPTION"];var domTT_draggable=false;if(typeof(domTT_dragEnabled)=="undefined"){domTT_dragEnabled=false;}
var domTT_predefined=new Hash();var domTT_tooltips=new Hash();var domTT_lastOpened=0;var domTT_documentLoaded=false;var domTT_mousePosition=null;if(domLib_useLibrary&&domTT_useGlobalMousePosition){document.onmousemove=function(_3c){if(typeof(_3c)=="undefined"){_3c=window.event;}
domTT_mousePosition=domLib_getEventPosition(_3c);if(domTT_dragEnabled&&domTT_dragMouseDown){domTT_dragUpdate(_3c);}};}
function domTT_activate(_3d,_3e){if(!domLib_useLibrary||(domTT_postponeActivation&&!domTT_documentLoaded)){return false;}
if(typeof(_3e)=="undefined"){_3e=window.event;}
if(_3e!=null){var _3f=_3e.srcElement?_3e.srcElement:_3e.target;if(_3f!=null&&(","+domTT_bannedTags.join(",")+",").indexOf(","+_3f.tagName+",")!=-1){return false;}}
var _40=document.body;if(_3e!=null&&_3e.type.match(/key|mouse|click|contextmenu/i)){if(_3d.nodeType&&_3d.nodeType!=document.DOCUMENT_NODE){_40=_3d;}}else{if(typeof(_3d)!="object"&&!(_40=domTT_tooltips.get(_3d))){var _41=document.createElement("div");_40=document.body.appendChild(_41);_40.style.display="none";_40.id=_3d;}}
if(!_40.id){_40.id="__autoId"+domLib_autoId++;}
if(domTT_oneOnly&&domTT_lastOpened){domTT_deactivate(domTT_lastOpened);}
domTT_lastOpened=_40.id;var _42=domTT_tooltips.get(_40.id);if(_42){if(_42.get("eventType")!=_3e.type){if(_42.get("type")=="greasy"){_42.set("closeAction","destroy");domTT_deactivate(_40.id);}else{if(_42.get("status")!="inactive"){return _40.id;}}}else{if(_42.get("status")=="inactive"){_42.set("status","pending");_42.set("activateTimeout",domLib_setTimeout(domTT_runShow,_42.get("delay"),[_40.id,_3e]));return _40.id;}else{return _40.id;}}}
var _43=new Hash("caption","","content","","clearMouse",true,"closeAction",domTT_closeAction,"closeLink",domTT_closeLink,"delay",domTT_activateDelay,"direction",domTT_direction,"draggable",domTT_draggable,"fade",domTT_fade,"fadeMax",100,"grid",domTT_grid,"id",domTT_tooltipIdPrefix+_40.id,"inframe",false,"lifetime",domTT_lifetime,"offsetX",domTT_offsetX,"offsetY",domTT_offsetY,"parent",document.body,"position","absolute","styleClass",domTT_styleClass,"type","greasy","trail",false,"lazy",false);for(var i=2;i_5c){_4d.style.width=_5c+"px";}
_48.set("offsetWidth",_4d.offsetWidth);_48.set("offsetHeight",_4d.offsetHeight);if(domLib_isKonq&&_4f&&!_4d.style.width){var _5d=document.defaultView.getComputedStyle(_4d,"").getPropertyValue("border-left-width");var _5e=document.defaultView.getComputedStyle(_4d,"").getPropertyValue("border-right-width");_5d=_5d.substring(_5d.indexOf(":")+2,_5d.indexOf(";"));_5e=_5e.substring(_5e.indexOf(":")+2,_5e.indexOf(";"));var _5f=2*((_5d?parseInt(_5d):0)+(_5e?parseInt(_5e):0));_4d.style.width=(_4d.offsetWidth-_5f)+"px";}
if(domLib_isIE||domLib_isOpera){if(!_4d.style.width){_4d.style.width=(_4d.offsetWidth-2)+"px";}
_4d.style.height=(_4d.offsetHeight-2)+"px";}
var _60,_61;if(_48.get("position")=="absolute"&&!(_48.has("x")&&_48.has("y"))){switch(_48.get("direction")){case"northeast":_60=_48.get("offsetX");_61=0-_4d.offsetHeight-_48.get("offsetY");break;case"northwest":_60=0-_4d.offsetWidth-_48.get("offsetX");_61=0-_4d.offsetHeight-_48.get("offsetY");break;case"north":_60=0-parseInt(_4d.offsetWidth/2);_61=0-_4d.offsetHeight-_48.get("offsetY");break;case"southwest":_60=0-_4d.offsetWidth-_48.get("offsetX");_61=_48.get("offsetY");break;case"southeast":_60=_48.get("offsetX");_61=_48.get("offsetY");break;case"south":_60=0-parseInt(_4d.offsetWidth/2);_61=_48.get("offsetY");break;}
if(_48.get("inframe")){var _62=domLib_getIFrameReference(window);if(_62){var _63=domLib_getOffsets(_62);_60+=_63.get("left");_61+=_63.get("top");}}}else{_60=0;_61=0;_48.set("trail",false);}
_48.set("offsetX",_60);_48.set("offsetY",_61);if(_48.get("clearMouse")&&_48.get("direction").indexOf("south")!=-1){_48.set("mouseOffset",domTT_mouseHeight);}else{_48.set("mouseOffset",0);}
if(domLib_canFade&&typeof(Fadomatic)=="function"){if(_48.get("fade")!="neither"){var _64=new Fadomatic(_4d,10,0,0,_48.get("fadeMax"));_48.set("fadeHandler",_64);}}else{_48.set("fade","neither");}
if(_48.get("trail")&&typeof(_49.onmousemove)!="function"){_49.onmousemove=function(_65){domTT_mousemove(this,_65);};}
if(typeof(_49.onmouseout)!="function"){_49.onmouseout=function(_66){domTT_mouseout(this,_66);};}
if(_48.get("type")=="sticky"){if(_48.get("position")=="absolute"&&domTT_dragEnabled&&_48.get("draggable")){if(domLib_isIE){_53.onselectstart=function(){return false;};}
_53.onmousedown=function(_67){domTT_dragStart(_4d,_67);};_53.onmousemove=function(_68){domTT_dragUpdate(_68);};_53.onmouseup=function(){domTT_dragStop();};}}else{if(_48.get("type")=="velcro"){_4d.onmouseout=function(_69){if(typeof(_69)=="undefined"){_69=window.event;}
if(!domLib_isDescendantOf(_69[domLib_eventTo],_4d,domTT_bannedTags)){domTT_deactivate(_49.id);}};_4d.onclick=function(_6a){domTT_deactivate(_49.id);};}}
if(_48.get("position")=="relative"){_4d.style.position="relative";}
_48.set("node",_4d);_48.set("status","inactive");}
function domTT_show(_6b,_6c){var _6d=domTT_tooltips.get(_6b);var _6e=_6d.get("status");var _6f=_6d.get("node");if(_6d.get("position")=="absolute"){var _70,_71;if(_6d.has("x")&&_6d.has("y")){_70=_6d.get("x");_71=_6d.get("y");}else{if(!domTT_useGlobalMousePosition||domTT_mousePosition==null||_6e=="active"||_6d.get("delay")==0){var _72=domLib_getEventPosition(_6c);var _73=_72.get("x");var _74=_72.get("y");if(_6d.get("inframe")){_73-=_72.get("scrollX");_74-=_72.get("scrollY");}
if(_6e=="active"&&_6d.get("trail")!==true){var _75=_6d.get("trail");if(_75=="x"){_70=_73;_71=_6d.get("mouseY");}else{if(_75=="y"){_70=_6d.get("mouseX");_71=_74;}}}else{_70=_73;_71=_74;}}else{_70=domTT_mousePosition.get("x");_71=domTT_mousePosition.get("y");if(_6d.get("inframe")){_70-=domTT_mousePosition.get("scrollX");_71-=domTT_mousePosition.get("scrollY");}}}
if(_6d.get("grid")){if(_6c.type!="mousemove"||(_6e=="active"&&(Math.abs(_6d.get("lastX")-_70)>_6d.get("grid")||Math.abs(_6d.get("lastY")-_71)>_6d.get("grid")))){_6d.set("lastX",_70);_6d.set("lastY",_71);}else{return false;}}
_6d.set("mouseX",_70);_6d.set("mouseY",_71);var _76;if(domTT_screenEdgeDetection){_76=domTT_correctEdgeBleed(_6d.get("offsetWidth"),_6d.get("offsetHeight"),_70,_71,_6d.get("offsetX"),_6d.get("offsetY"),_6d.get("mouseOffset"),_6d.get("inframe")?window.parent:window);}else{_76={"x":_70+_6d.get("offsetX"),"y":_71+_6d.get("offsetY")+_6d.get("mouseOffset")};}
_6f.style.left=_76.x+"px";_6f.style.top=_76.y+"px";_6f.style.zIndex=domLib_zIndex++;}
if(_6e=="pending"){_6d.set("status","active");_6f.style.display="";_6f.style.visibility="visible";var _77=_6d.get("fade");if(_77!="neither"){var _78=_6d.get("fadeHandler");if(_77=="out"||_77=="both"){_78.haltFade();if(_77=="out"){_78.halt();}}
if(_77=="in"||_77=="both"){_78.fadeIn();}}
if(_6d.get("type")=="greasy"&&_6d.get("lifetime")!=0){_6d.set("lifetimeTimeout",domLib_setTimeout(domTT_runDeactivate,_6d.get("lifetime"),[_6f.id]));}}
if(_6d.get("position")=="absolute"&&domTT_detectCollisions){domLib_detectCollisions(_6f,false,true);}}
function domTT_deactivate(_79){var _7a=domTT_tooltips.get(_79);if(_7a){var _7b=_7a.get("status");if(_7b=="pending"){domLib_clearTimeout(_7a.get("activateTimeout"));_7a.set("status","inactive");}else{if(_7b=="active"){if(_7a.get("lifetime")){domLib_clearTimeout(_7a.get("lifetimeTimeout"));}
var _7c=_7a.get("node");if(_7a.get("closeAction")=="hide"){var _7d=_7a.get("fade");if(_7d!="neither"){var _7e=_7a.get("fadeHandler");if(_7d=="out"||_7d=="both"){_7e.fadeOut();}else{_7e.hide();}}else{_7c.style.display="none";}}else{_7a.get("parent").removeChild(_7c);domTT_tooltips.remove(_7a.get("owner").id);domTT_tooltips.remove(_7a.get("id"));}
_7a.set("status","inactive");if(domTT_detectCollisions){domLib_detectCollisions(_7c,true,true);}}}}}
function domTT_mouseout(_7f,_80){if(!domLib_useLibrary){return false;}
if(typeof(_80)=="undefined"){_80=window.event;}
var _81=domLib_isDescendantOf(_80[domLib_eventTo],_7f,domTT_bannedTags);var _82=domTT_tooltips.get(_7f.id);if(_82&&(_82.get("type")=="greasy"||_82.get("status")!="active")){if(!_81){domTT_deactivate(_7f.id);try{window.status=window.defaultStatus;}
catch(e){}}}else{if(!_81){try{window.status=window.defaultStatus;}
catch(e){}}}}
function domTT_mousemove(_83,_84){if(!domLib_useLibrary){return false;}
if(typeof(_84)=="undefined"){_84=window.event;}
var _85=domTT_tooltips.get(_83.id);if(_85&&_85.get("trail")&&_85.get("status")=="active"){if(_85.get("lazy")){domLib_setTimeout(domTT_runShow,domTT_trailDelay,[_83.id,_84]);}else{domTT_show(_83.id,_84);}}}
function domTT_correctEdgeBleed(_86,_87,_88,_89,_8a,_8b,_8c,_8d){var win,doc;var _90,_91;var _92,_93,_94,_95;var x=_88+_8a;var y=_89+_8b+_8c;win=(typeof(_8d)=="undefined"?window:_8d);doc=((domLib_standardsMode&&(domLib_isIE||domLib_isGecko))?win.document.documentElement:win.document.body);if(domLib_isIE){_92=doc.clientHeight;_93=doc.clientWidth;_94=doc.scrollTop;_95=doc.scrollLeft;}else{_92=doc.clientHeight;_93=doc.clientWidth;if(domLib_isKHTML){_92=win.innerHeight;}
_94=win.pageYOffset;_95=win.pageXOffset;}
if((_90=(x-_95)+_86-(_93-domTT_screenEdgePadding))>0){x-=_90;}
if((x-_95)0){y=_89-_87-_8b;}
if((y-_94)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy