diff --git a/core/src/main/java/org/apache/struts2/components/UIBean.java b/core/src/main/java/org/apache/struts2/components/UIBean.java index 663ad6c28..c6851f937 100644 --- a/core/src/main/java/org/apache/struts2/components/UIBean.java +++ b/core/src/main/java/org/apache/struts2/components/UIBean.java @@ -457,6 +457,10 @@ public abstract class UIBean extends Component { // javascript tooltip attribute protected String tooltip; protected String tooltipConfig; + protected String javascriptTooltip; + protected String tooltipDelay; + protected String tooltipCssClass; + protected String tooltipIconPath; protected String defaultTemplateDir; protected String defaultUITheme; @@ -776,6 +780,38 @@ public abstract class UIBean extends Component { else { LOG.warn("No ancestor Form found, javascript based tooltip will not work, however standard HTML tooltip using alt and title attribute will still work "); } + + //TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped + String jsTooltipEnabled = (String) getParameters().get("jsTooltipEnabled"); + if (jsTooltipEnabled != null) + this.javascriptTooltip = jsTooltipEnabled; + + //TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped + String tooltipIcon = (String) getParameters().get("tooltipIcon"); + if (tooltipIcon != null) + this.addParameter("tooltipIconPath", tooltipIcon); + if (this.tooltipIconPath != null) + this.addParameter("tooltipIconPath", findString(this.tooltipIconPath)); + + //TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped + String tooltipDelayParam = (String) getParameters().get("tooltipDelay"); + if (tooltipDelayParam != null) + this.addParameter("tooltipDelay", tooltipDelayParam); + if (this.tooltipDelay != null) + this.addParameter("tooltipDelay", findString(this.tooltipDelay)); + + if (this.javascriptTooltip != null) { + Boolean jsTooltips = (Boolean) findValue(this.javascriptTooltip, Boolean.class); + //TODO use a Boolean model when tooltipConfig is dropped + this.addParameter("jsTooltipEnabled", jsTooltips.toString()); + + if (form != null) + form.addParameter("hasTooltip", jsTooltips); + if (this.tooltipCssClass != null) + this.addParameter("tooltipCssClass", findString(this.tooltipCssClass)); + } + + } evaluateExtraParams(); @@ -847,6 +883,12 @@ public abstract class UIBean extends Component { } } } + if (component.javascriptTooltip != null) + tooltipConfig.put("jsTooltipEnabled", component.javascriptTooltip); + if (component.tooltipIconPath != null) + tooltipConfig.put("tooltipIcon", component.tooltipIconPath); + if (component.tooltipDelay != null) + tooltipConfig.put("tooltipDelay", component.tooltipDelay); return tooltipConfig; } @@ -1033,7 +1075,7 @@ public abstract class UIBean extends Component { this.tooltip = tooltip; } - @StrutsTagAttribute(description="Set the tooltip configuration") + @StrutsTagAttribute(description="Deprecated. Use individual tooltip configuration attributes instead.") public void setTooltipConfig(String tooltipConfig) { this.tooltipConfig = tooltipConfig; } @@ -1042,4 +1084,25 @@ public abstract class UIBean extends Component { public void setKey(String key) { this.key = key; } + + @StrutsTagAttribute(description="Use JavaScript to generate tooltips", type="Boolean", defaultValue="false") + public void setJavascriptTooltip(String javascriptTooltip) { + this.javascriptTooltip = javascriptTooltip; + } + + @StrutsTagAttribute(description="CSS class applied to JavaScrip tooltips", defaultValue="StrutsTTClassic") + public void setTooltipCssClass(String tooltipCssClass) { + this.tooltipCssClass = tooltipCssClass; + } + + @StrutsTagAttribute(description="Delay in milliseconds, before showing JavaScript tooltips ", + defaultValue="Classic") + public void setTooltipDelay(String tooltipDelay) { + this.tooltipDelay = tooltipDelay; + } + + @StrutsTagAttribute(description="Icon path used for image that will have the tooltip") + public void setTooltipIconPath(String tooltipIconPath) { + this.tooltipIconPath = tooltipIconPath; + } } diff --git a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java index 04ea068ca..b3d023003 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java @@ -64,7 +64,10 @@ public abstract class AbstractUITag extends ComponentTagSupport { // tooltip attributes protected String tooltip; protected String tooltipConfig; - + protected String javascriptTooltip; + protected String tooltipDelay; + protected String tooltipCssClass; + protected String tooltipIconPath; protected void populateParams() { super.populateParams(); @@ -101,6 +104,10 @@ public abstract class AbstractUITag extends ComponentTagSupport { uiBean.setOnchange(onchange); uiBean.setTooltip(tooltip); uiBean.setTooltipConfig(tooltipConfig); + uiBean.setJavascriptTooltip(javascriptTooltip); + uiBean.setTooltipCssClass(tooltipCssClass); + uiBean.setTooltipDelay(tooltipDelay); + uiBean.setTooltipIconPath(tooltipIconPath); uiBean.setAccesskey(accesskey); uiBean.setKey(key); } @@ -231,5 +238,21 @@ public abstract class AbstractUITag extends ComponentTagSupport { public void setKey(String key) { this.key = key; + } + + public void setJavascriptTooltip(String javascriptTooltip) { + this.javascriptTooltip = javascriptTooltip; + } + + public void setTooltipCssClass(String tooltipCssClass) { + this.tooltipCssClass = tooltipCssClass; + } + + public void setTooltipDelay(String tooltipDelay) { + this.tooltipDelay = tooltipDelay; + } + + public void setTooltipIconPath(String tooltipIconPath) { + this.tooltipIconPath = tooltipIconPath; } } diff --git a/core/src/main/resources/org/apache/struts2/static/domTT.css b/core/src/main/resources/org/apache/struts2/static/domTT.css new file mode 100644 index 000000000..1e262e3dd --- /dev/null +++ b/core/src/main/resources/org/apache/struts2/static/domTT.css @@ -0,0 +1,21 @@ +/* Classic Style */ +div.StrutsTTClassic { + border: 1px solid black; + background-color: InfoBackground; +} +div.StrutsTTClassic .caption { + font-family: serif; + font-size: 13px; + _font-size: 12px; + font-weight: bold; + font-style: italic; + padding: 1px 2px; +} +div.StrutsTTClassic .contents { + color: InfoText; + font-size: 13px; + _font-size: 12px; + font-family: Arial, sans-serif; + padding: 1px 2px; + _padding-bottom: 0; +} \ No newline at end of file diff --git a/core/src/main/resources/org/apache/struts2/static/domTT.js b/core/src/main/resources/org/apache/struts2/static/domTT.js new file mode 100644 index 000000000..337d19da2 --- /dev/null +++ b/core/src/main/resources/org/apache/struts2/static/domTT.js @@ -0,0 +1,120 @@ +//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)<#t/> <#if (parameters.hasTooltip?default(false))><#t/> <#lt/> - <#lt/> + <#lt/> + <#lt/>"/> + <#t/> diff --git a/core/src/main/resources/template/xhtml/tooltip.ftl b/core/src/main/resources/template/xhtml/tooltip.ftl index 5029c560b..a6d531fb4 100644 --- a/core/src/main/resources/template/xhtml/tooltip.ftl +++ b/core/src/main/resources/template/xhtml/tooltip.ftl @@ -1,24 +1,19 @@ <#if parameters.tooltip?exists><#t/> - <#assign tooltipHashCode=parameters.tooltip.hashCode() /> - <#t/> - src='<@s.url value="${parameters.tooltipIcon}" includeParams="none" encode="false" />' + <#t/> + src='<@s.url value="${parameters.tooltipIconPath}" includeParams="none" encode="false" />' <#else><#t/> - src='<@s.url value="/struts/dojo/struts/tooltip.gif" includeParams="none" encode="false" />' + src='<@s.url value="/struts/tooltip.gif" includeParams="none" encode="false" />' <#t/> - alt="${parameters.tooltip?html}" - title="${parameters.tooltip?html}" /> + alt="${parameters.tooltip?html}" <#if parameters.jsTooltipEnabled?default('false') == 'true'> - <#t/> - <#t/>toggle="${parameters.tooltipToggle}"<#t/> - <#t/> - <#if parameters.tooltipToggleDuration?exists><#t/> - <#t/>toggleDuration="${parameters.tooltipToggleDuration}"<#t/> - <#t/> + onmouseover="domTT_activate(this, event, 'content', '${parameters.tooltip}'<#t/> <#if parameters.tooltipDelay?exists><#t/> - <#t/>delay="${parameters.tooltipDelay}"<#t/> + <#t/>,'delay', '${parameters.tooltipDelay}'<#t/> <#t/> - caption="${parameters.tooltip}"> + <#t/>,'styleClass', '${parameters.tooltipCssClass?default("StrutsTTClassic")}'<#t/> + <#t/>)" /> + <#else> + title="${parameters.tooltip?html}"/> <#t/> diff --git a/core/src/site/resources/tags/a.html b/core/src/site/resources/tags/a.html index bf2f4b449..d121cbe9f 100644 --- a/core/src/site/resources/tags/a.html +++ b/core/src/site/resources/tags/a.html @@ -75,6 +75,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -297,7 +305,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/actionerror.html b/core/src/site/resources/tags/actionerror.html index c7e7a144b..bf0e2f50a 100644 --- a/core/src/site/resources/tags/actionerror.html +++ b/core/src/site/resources/tags/actionerror.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/actionmessage.html b/core/src/site/resources/tags/actionmessage.html index dce7a8de3..7dced5ea7 100644 --- a/core/src/site/resources/tags/actionmessage.html +++ b/core/src/site/resources/tags/actionmessage.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/checkbox.html b/core/src/site/resources/tags/checkbox.html index 1ac284df3..f34dd83b4 100644 --- a/core/src/site/resources/tags/checkbox.html +++ b/core/src/site/resources/tags/checkbox.html @@ -75,6 +75,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -289,7 +297,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/checkboxlist.html b/core/src/site/resources/tags/checkboxlist.html index 2fa99ee6b..6f31f3fd8 100644 --- a/core/src/site/resources/tags/checkboxlist.html +++ b/core/src/site/resources/tags/checkboxlist.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -305,7 +313,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/combobox.html b/core/src/site/resources/tags/combobox.html index fb1120ad3..5bcd8eec6 100644 --- a/core/src/site/resources/tags/combobox.html +++ b/core/src/site/resources/tags/combobox.html @@ -91,6 +91,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -361,7 +369,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/component.html b/core/src/site/resources/tags/component.html index 27271cadf..6c241de07 100644 --- a/core/src/site/resources/tags/component.html +++ b/core/src/site/resources/tags/component.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/debug.html b/core/src/site/resources/tags/debug.html index 912646720..bdab1736f 100644 --- a/core/src/site/resources/tags/debug.html +++ b/core/src/site/resources/tags/debug.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/div.html b/core/src/site/resources/tags/div.html index 0c7d56e64..a1b8d975c 100644 --- a/core/src/site/resources/tags/div.html +++ b/core/src/site/resources/tags/div.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -289,7 +297,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/doubleselect.html b/core/src/site/resources/tags/doubleselect.html index 3c156d9e7..069759a91 100644 --- a/core/src/site/resources/tags/doubleselect.html +++ b/core/src/site/resources/tags/doubleselect.html @@ -331,6 +331,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -585,7 +593,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/fielderror.html b/core/src/site/resources/tags/fielderror.html index dbebd7aaf..6f78254e8 100644 --- a/core/src/site/resources/tags/fielderror.html +++ b/core/src/site/resources/tags/fielderror.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/file.html b/core/src/site/resources/tags/file.html index 5b227c65d..d85f05fb9 100644 --- a/core/src/site/resources/tags/file.html +++ b/core/src/site/resources/tags/file.html @@ -75,6 +75,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -297,7 +305,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/form.html b/core/src/site/resources/tags/form.html index 600753163..34a8f8da6 100644 --- a/core/src/site/resources/tags/form.html +++ b/core/src/site/resources/tags/form.html @@ -91,6 +91,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -353,7 +361,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip validate diff --git a/core/src/site/resources/tags/head.html b/core/src/site/resources/tags/head.html index 4ff1bbfbf..f32a12328 100644 --- a/core/src/site/resources/tags/head.html +++ b/core/src/site/resources/tags/head.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/hidden.html b/core/src/site/resources/tags/hidden.html index 41ab9a034..685abb20b 100644 --- a/core/src/site/resources/tags/hidden.html +++ b/core/src/site/resources/tags/hidden.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/inputtransferselect.html b/core/src/site/resources/tags/inputtransferselect.html index 3521df28a..c40bb23d3 100644 --- a/core/src/site/resources/tags/inputtransferselect.html +++ b/core/src/site/resources/tags/inputtransferselect.html @@ -131,6 +131,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -417,7 +425,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip upLabel diff --git a/core/src/site/resources/tags/label.html b/core/src/site/resources/tags/label.html index 9474060a6..607ed3cc4 100644 --- a/core/src/site/resources/tags/label.html +++ b/core/src/site/resources/tags/label.html @@ -75,6 +75,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -289,7 +297,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/optiontransferselect.html b/core/src/site/resources/tags/optiontransferselect.html index c9a9221b9..a1129e7f6 100644 --- a/core/src/site/resources/tags/optiontransferselect.html +++ b/core/src/site/resources/tags/optiontransferselect.html @@ -435,6 +435,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -745,7 +753,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/password.html b/core/src/site/resources/tags/password.html index e4038f842..cfbb17151 100644 --- a/core/src/site/resources/tags/password.html +++ b/core/src/site/resources/tags/password.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -321,7 +329,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/radio.html b/core/src/site/resources/tags/radio.html index c20a80e8a..5f58e29b4 100644 --- a/core/src/site/resources/tags/radio.html +++ b/core/src/site/resources/tags/radio.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -305,7 +313,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/reset.html b/core/src/site/resources/tags/reset.html index d33221fa0..1fdaf1484 100644 --- a/core/src/site/resources/tags/reset.html +++ b/core/src/site/resources/tags/reset.html @@ -83,6 +83,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -305,7 +313,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip type diff --git a/core/src/site/resources/tags/select.html b/core/src/site/resources/tags/select.html index 008304da2..1a58187f6 100644 --- a/core/src/site/resources/tags/select.html +++ b/core/src/site/resources/tags/select.html @@ -91,6 +91,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -345,7 +353,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/submit.html b/core/src/site/resources/tags/submit.html index e32c68d90..852b3e3ce 100644 --- a/core/src/site/resources/tags/submit.html +++ b/core/src/site/resources/tags/submit.html @@ -83,6 +83,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -313,7 +321,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip type diff --git a/core/src/site/resources/tags/table.html b/core/src/site/resources/tags/table.html index c07e4c14d..7bf77b9d2 100644 --- a/core/src/site/resources/tags/table.html +++ b/core/src/site/resources/tags/table.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -305,7 +313,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/textarea.html b/core/src/site/resources/tags/textarea.html index 139ae0dd4..2d381ef00 100644 --- a/core/src/site/resources/tags/textarea.html +++ b/core/src/site/resources/tags/textarea.html @@ -75,6 +75,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -305,7 +313,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/textfield.html b/core/src/site/resources/tags/textfield.html index a88af3374..1b3c32216 100644 --- a/core/src/site/resources/tags/textfield.html +++ b/core/src/site/resources/tags/textfield.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -313,7 +321,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/token.html b/core/src/site/resources/tags/token.html index bd5e1cb1f..2e9113f78 100644 --- a/core/src/site/resources/tags/token.html +++ b/core/src/site/resources/tags/token.html @@ -67,6 +67,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -281,7 +289,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/site/resources/tags/updownselect.html b/core/src/site/resources/tags/updownselect.html index 45a2afd59..8b5e639cd 100644 --- a/core/src/site/resources/tags/updownselect.html +++ b/core/src/site/resources/tags/updownselect.html @@ -115,6 +115,14 @@ Please do not edit it directly. String id for referencing element. For UI and form tags it will be used as HTML id attribute + + javascriptTooltip + false + false + true + Boolean + Use JavaScript to generate tooltips + key false @@ -393,7 +401,31 @@ Please do not edit it directly. true String - Set the tooltip configuration + Deprecated. Use individual tooltip configuration attributes instead. + + + tooltipCssClass + false + StrutsTTClassic + true + String + CSS class applied to JavaScrip tooltips + + + tooltipDelay + false + Classic + true + String + Delay in milliseconds, before showing JavaScript tooltips + + + tooltipIconPath + false + + true + String + Icon path used for image that will have the tooltip value diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java index 6a0568ea2..1fd839ac1 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/TooltipTest.java @@ -67,6 +67,38 @@ public class TooltipTest extends AbstractUITagTest { verify(TooltipTest.class.getResource("tooltip-1.txt")); } + + public void testWithoutFormOverridingNew() throws Exception { + + // we test it on textfield component, but since the tooltip are common to + // all components, it will be the same for other components as well. + FormTag formTag = new FormTag(); + formTag.setPageContext(pageContext); + formTag.setId("myFormId"); + formTag.setAction("testAction"); + formTag.setName("myForm"); + + + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("MyLabel"); + tag.setId("myId"); + + + //same parameters as the OGNL map configuration, output must be the same + tag.setTooltip("myTooltip"); + tag.setTooltipIconPath("/struts/tooltip/myTooltip.gif"); + tag.setTooltipDelay("500"); + tag.setJavascriptTooltip("true"); + + + formTag.doStartTag(); + tag.doStartTag(); + tag.doEndTag(); + formTag.doEndTag(); + + verify(TooltipTest.class.getResource("tooltip-1.txt")); + } public void testWithFormOverriding() throws Exception { @@ -85,6 +117,36 @@ public class TooltipTest extends AbstractUITagTest { ); + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("MyLabel"); + tag.setId("myId"); + + tag.setTooltip("myTooltip"); + + formTag.doStartTag(); + tag.doStartTag(); + tag.doEndTag(); + formTag.doEndTag(); + + verify(TooltipTest.class.getResource("tooltip-2.txt")); + } + + public void testWithFormOverridingNew() throws Exception { + + FormTag formTag = new FormTag(); + formTag.setPageContext(pageContext); + formTag.setName("myForm"); + formTag.setId("myFormId"); + formTag.setAction("testAction"); + + // same parameters as the OGNL map configuration, output must be the same + formTag.setTooltip("myTooltip"); + formTag.setTooltipIconPath("/struts/tooltip/myTooltip.gif"); + formTag.setTooltipDelay("500"); + formTag.setJavascriptTooltip("true"); + + TextFieldTag tag = new TextFieldTag(); tag.setPageContext(pageContext); tag.setLabel("MyLabel"); @@ -138,6 +200,40 @@ public class TooltipTest extends AbstractUITagTest { verify(TooltipTest.class.getResource("tooltip-3.txt")); } + public void testWithPartialFormOverridingNew() throws Exception { + + FormTag formTag = new FormTag(); + formTag.setName("myForm"); + formTag.setPageContext(pageContext); + formTag.setId("myFormId"); + formTag.setAction("testAction"); + + // same parameters as the OGNL map configuration, output must be the same + formTag.setTooltip("myTooltip"); + formTag.setTooltipIconPath("/struts/tooltip/myTooltip.gif"); + formTag.setTooltipDelay("500"); + formTag.setJavascriptTooltip("true"); + + + TextFieldTag tag = new TextFieldTag(); + tag.setPageContext(pageContext); + tag.setLabel("MyLabel"); + tag.setId("myId"); + + + //same parameters as the OGNL map configuration, output must be the same + tag.setTooltip("myTooltip"); + tag.setTooltipIconPath("/struts/tooltip/myTooltip2.gif"); + tag.setTooltipDelay("5000"); + tag.setJavascriptTooltip("true"); + + formTag.doStartTag(); + tag.doStartTag(); + tag.doEndTag(); + formTag.doEndTag(); + + verify(TooltipTest.class.getResource("tooltip-3.txt")); + } public void testUsingParamValueToSetConfigurations() throws Exception { FormTag formTag = new FormTag(); diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt index 2a1299a24..0cde700ea 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt @@ -1,22 +1,22 @@
- - - - - -
+ + + + + MyLabel:myTooltip + + + + + + + - - - - + + + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt index 4b552bb32..4c8c4b1bb 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt @@ -1,19 +1,19 @@
- - - - - -
+ + + + + MyLabel:myTooltip + + + + + + + - - - + + + \ No newline at end of file diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt index f43504ae2..29aa3c177 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt @@ -1,20 +1,22 @@
- - - - - -
+ + + + + MyLabel:myTooltip + + + + + + + - - + + +