Author: dbiatenia
Date: 2007-07-09 10:27:42 -0400 (Mon, 09 Jul 2007)
New Revision: 1550
Removed:
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/image/
Modified:
branches/3.0.2/sandbox/tooltip/src/main/config/component/toolTip.xml
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
Log:
Modified: branches/3.0.2/sandbox/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- branches/3.0.2/sandbox/tooltip/src/main/config/component/toolTip.xml 2007-07-09
14:04:30 UTC (rev 1549)
+++ branches/3.0.2/sandbox/tooltip/src/main/config/component/toolTip.xml 2007-07-09
14:27:42 UTC (rev 1550)
@@ -58,7 +58,7 @@
<defaultvalue><![CDATA["client"]]></defaultvalue>
</property>
<property>
- <name>disabled</name>
+ <name>disabled</name>
<classname>boolean</classname>
<description>If false the components is rendered on the client but Js for
calling – disabled.</description>
<defaultvalue>false</defaultvalue>
Modified:
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-09
14:04:30 UTC (rev 1549)
+++
branches/3.0.2/sandbox/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-09
14:27:42 UTC (rev 1550)
@@ -9,10 +9,6 @@
import org.ajax4jsf.framework.renderer.AjaxComponentRendererBase;
import org.ajax4jsf.framework.skin.Skin;
import org.richfaces.component.UIToolTip;
-import org.richfaces.renderkit.html.image.cornerimages.BottomLeftToolTipCornerImage;
-import org.richfaces.renderkit.html.image.cornerimages.BottomRightToolTipCornerImage;
-import org.richfaces.renderkit.html.image.cornerimages.TopLeftToolTipCornerImage;
-import org.richfaces.renderkit.html.image.cornerimages.TopRightToolTipCornerImage;
public class ToolTipRenderer extends AjaxComponentRendererBase{
@@ -34,13 +30,14 @@
* @param position
* @throws IOException
*/
+ /*
public void insertImage(FacesContext context, UIComponent component, Object position)
throws IOException{
//if(position == null) throw new IllegalArgumentException("Parameter passed is
invalid, use \"0 - 3\"");
String posStr = (String)position;
drawImageElement(context, component, posStr);
}
+ */
-
/**
*
* @param writer
@@ -48,6 +45,7 @@
* @param position 0-tl, 1-tr, 2-bl, 3-br
* @throws IOException
*/
+/*
private void drawImageElement(FacesContext context, UIComponent component, String
position) throws IOException{
String imageSrc = getImageSrc(context, component, position);
ResponseWriter writer = context.getResponseWriter();
@@ -63,8 +61,8 @@
writer.writeAttribute("height", String.valueOf(h), null);
writer.endElement("img");
}
-
-
+*/
+/*
protected String getImageSrc(FacesContext context, UIComponent component, String
position){
String color = getBgColor(context, component);
String imageSource = null;
@@ -80,6 +78,7 @@
return imageSource;
}
+*/
public String getBgColor(FacesContext context, UIComponent component){
Skin skin = getSkin(context);
@@ -100,7 +99,7 @@
context.getResponseWriter().write(value.toString());
}
}
-
+/*
protected String getTopRightDivStyle(FacesContext context, UIComponent component){
String trImgSrc = getImageSrc(context, component, "tr");
return "background: url(" + trImgSrc + ") no-repeat top
right;";
@@ -123,7 +122,7 @@
protected String getBRImageSrc(FacesContext context, UIComponent component){
return getImageSrc(context, component, "br");
}
-
+*/
public void insertScript(FacesContext context, UIComponent component) throws
IOException{
UIToolTip toolTip = (UIToolTip)component;
Modified:
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2007-07-09
14:04:30 UTC (rev 1549)
+++
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2007-07-09
14:27:42 UTC (rev 1550)
@@ -4,13 +4,16 @@
xmlns:u="http://jsf.exadel.com/template/util"
xmlns="http://www.w3.org/1999/xhtml">
-<f:verbatim>
-img.corner {
- width: 15px;
- height: 15px;
- border: none;
- display: block !important;
-}
-</f:verbatim>
+ <u:selector name=".dr-rich-tool-tip">
+ <u:style name="background-color" skin="tipBackgroundColor"/>
+ <u:style name="padding" value="7px"/>
+ <u:style name="border" value="1px solid"/>
+ <u:style name="border-color" skin="tipBorderColor"/>
+ <u:style name="font-size" skin="generalSizeFont"/>
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ <u:style name="color" skin="generalFontColor"/>
+ <u:style name="float" value="left"/>
+ </u:selector>
+
</f:template>
Modified:
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-09
14:04:30 UTC (rev 1549)
+++
branches/3.0.2/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-09
14:27:42 UTC (rev 1550)
@@ -29,8 +29,14 @@
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;
+/*
+var isIE = false;
+alert("RichFaces.navigatorType().indexOf('MSIE', 0) != -1 -- " +
RichFaces.navigatorType().indexOf('MSIE', 0) != -1);
+if(RichFaces.navigatorType().indexOf('MSIE', 0) != -1){
+ isIE = true;
+}
+*/
-
ToolTip = Class.create();
ToolTip.prototype = {
@@ -45,18 +51,33 @@
this.verticalOffset = verticalOffset;
this.toolTip = $(id);
- this.toolTipW = this.toolTip.clientWidth;
- this.toolTipH = this.toolTip.clientHeight;
+ this.toolTip.style.visibility='hidden';
+ this.toolTip.style.display='block';
+
+ this.toolTipOffsetW = this.toolTip.offsetWidth;
+ this.toolTipOffsetH = this.toolTip.offsetHeight;
+
+ this.toolTipW = this.toolTip.getWidth();
+ this.toolTipH = this.toolTip.getHeight();
+
+ this.toolTipBorderHeight = (this.toolTipOffsetH - this.toolTipH) / 2;
+ this.toolTipBorderWidth = (this.toolTipOffsetW - this.toolTipW) / 2;
+ this.toolTip.style.visibility = 'visible';
this.toolTip.style.display = "none";
this.parentAttached = false;
+ if(IE){
+ var toolTipZindex = parseInt(this.toolTip.style.zIndex);
+ new Insertion.Before(this.toolTip,
+ "<iframe src=\"javascript:''\" frameborder=\"0\"
scrolling=\"no\" id=\"" + this.id + "iframe\"" +
+ "style=\"position: absolute; width: " + this.toolTipOffsetW +
"px; height: " + this.toolTipOffsetH + "px; display:
none;background-color:black; z-index: " +
+ + (toolTipZindex-1) + ";\">" + "</iframe>");
+ this.iframe = $(this.id + 'iframe');
+ }
- //document.body.attachEvent("load", this.attachOnLoadEvents);
- //document.body.onload = this.attachOnLoadEvents.bindAsEventListener(this);
-
+
Event.observe(document.getElementsByTagName("body")[0],
"mousemove", this.attachOnLoadEvents.bindAsEventListener(this), true);
},
attachOnLoadEvents: function(){
- //alert('onload');
if(!this.parentAttached){
this.parent = $(this.parentId);
if(this.parent != null && !this.disabled){
@@ -77,12 +98,21 @@
doShow: function(){
this.setToolTipPosition();
+ if(this.iframe){
+
+ this.iframe.style.top = parseInt(this.toolTip.style.top) - this.toolTipBorderHeight;
+ this.iframe.style.left = parseInt(this.toolTip.style.left) - this.toolTipBorderWidth;
+ this.iframe.style.display = "block";
+ }
this.toolTip.style.display = "block";
},
doHide: function(){
this.toolTip.style.display = "none";
+ if(this.iframe){
+ this.iframe.style.display = "none";
+ }
},
doEnable: function(){
Modified:
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
---
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-09
14:04:30 UTC (rev 1549)
+++
branches/3.0.2/sandbox/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-09
14:27:42 UTC (rev 1550)
@@ -17,105 +17,30 @@
<h:scripts>
new org.ajax4jsf.framework.resource.PrototypeScript(),
new org.ajax4jsf.framework.ajax.AjaxScript(),
+ /org/richfaces/renderkit/html/scripts/browser_info.js,
/org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/tooltip.js
</h:scripts>
-<!--
- <style type="text/css">
- .roundtop {
- background: url(#{this:getTRImageSrc(context, component)}) no-repeat top right;
- }
-
- .roundbottom {
- background: url(#{this:getBRImageSrc(context, component)}) no-repeat top right;
- }
- </style>
-
-
-
-
- <div style="#{this:getMainDivStyle(context, component)}">
- <div class="roundtop">
- <f:call name="insertImage">
- <f:parameter value="tl"/>
- </f:call>
- </div>
- <p style="margin: 0 10px;">
- <f:call name="insertValue"/>
- <vcp:body>
- <f:call name="renderChildren"/>
- </vcp:body>
- <f:clientid var="clientId"/>
-
- </p>
- <div class="roundbottom">
- <f:call name="insertImage">
- <f:parameter value="bl"/>
- </f:call>
- </div>
-</div>
-
-
- <hr/>
--->
-
<f:clientid var="clientId"/>
- <div id="tooltip#{clientId}" style="position: absolute; display :
none;">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="15px">
- <f:call name="insertImage">
- <f:parameter value="tl"/>
- </f:call>
- </td>
- <td bgcolor="#{this:getBgColor(context, component)}"><f:call
name="insertImage">
- <f:parameter value="br"/>
- </f:call></td>
- <td width="15px">
- <f:call name="insertImage">
- <f:parameter value="tr"/>
- </f:call>
- </td>
- </tr>
- <tr>
- <td bgcolor="#{this:getBgColor(context, component)}"></td>
- <td bgcolor="#{this:getBgColor(context, component)}">
+ <div id="tooltip#{clientId}" style="position: absolute; display :
none;z-index:99" class="dr-rich-tool-tip rich-tool-tip">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("defaultContent")!=null &&
component.getFacet("defaultContent").isRendered()) {]]>
</jsp:scriptlet>
- <span class="dr-rich-tool-tip rich-tool-tip">
+ <!-- span class="dr-rich-tool-tip rich-tool-tip"-->
<u:insertFacet name="defaultContent" />
- </span>
+ <!-- /span-->
<jsp:scriptlet>
<![CDATA[} else {]]>
</jsp:scriptlet>
- <span class="dr-rich-tool-tip
rich-tool-tip">#{component.attributes['value']}</span>
+ <!-- span class="dr-rich-tool-tip rich-tool-tip"-->
+ #{component.attributes['value']}
+ <!-- /span-->
<jsp:scriptlet>
<![CDATA[}]]>
</jsp:scriptlet>
- </td>
- <td bgcolor="#{this:getBgColor(context, component)}"></td>
- </tr>
- <tr>
- <td>
- <f:call name="insertImage">
- <f:parameter value="bl"/>
- </f:call>
- </td>
- <td bgcolor="#{this:getBgColor(context, component)}"><f:call
name="insertImage">
- <f:parameter value="br"/>
- </f:call></td>
- <td>
- <f:call name="insertImage">
- <f:parameter value="br"/>
- </f:call>
- </td>
- </tr>
-
- </table>
<f:call name="insertScript"/>
</div>
<!-- f:call name="utils.encodeEndFormIfNessesary"/-->