You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2012/06/20 15:01:09 UTC
svn commit: r1352076 - in /myfaces/tobago/trunk/tobago-theme:
tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html...
Author: bommel
Date: Wed Jun 20 13:01:08 2012
New Revision: 1352076
URL: http://svn.apache.org/viewvc?rev=1352076&view=rev
Log:
(TOBAGO-1159)
Move pngFixBlankImage and overlayBackgroundImage from JavaScript to dom
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js
myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=1352076&r1=1352075&r2=1352076&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Wed Jun 20 13:01:08 2012
@@ -206,12 +206,10 @@ public class PageRenderer extends PageRe
final Theme theme = client.getTheme();
if (frameKiller) {
- writer.writeJavascript("if (self == top) { "
- + "var forms = document.forms;\n"
- + "for(var i=0;i<forms.length;i++)\n"
- + "{ if (forms[i].style.display == 'none') {"
- + " forms[i].style.display = 'block';} }\n} else { "
- +"top.location = self.location; }\n");
+ writer.writeJavascript("if (self == top) {\n var forms = document.forms;\n"
+ + " for(var i=0;i<forms.length;i++) {\n if (forms[i].style.display == 'none') {"
+ + " forms[i].style.display = 'block';}\n }\n} else { "
+ + " top.location = self.location; }\n");
}
if (debugMode) {
// This tag must not be earlier, because the
@@ -386,14 +384,6 @@ public class PageRenderer extends PageRe
writer.writeIdAttribute(clientId);
writer.writeClassAttribute(Classes.create(page));
- writer.startJavascript();
- writer.write("Tobago.pngFixBlankImage = '");
- writer.write(ResourceManagerUtils.getImageWithPath(facesContext, "image/blank.gif"));
- writer.write("';\n");
- writer.write("Tobago.OVERLAY_BACKGROUND = '");
- writer.write(ResourceManagerUtils.getImageWithPath(facesContext, "image/tobago-overlay-background.png"));
- writer.write("';\n");
- writer.endJavascript();
/*
if (debugMode) {
final String[] jsFiles = new String[]{
@@ -646,6 +636,19 @@ public class PageRenderer extends PageRe
writer.writeAttribute(HtmlAttributes.SRC, error, false);
writer.endElement(HtmlElements.IMG);
+ writer.startElement(HtmlElements.IMG, null);
+ writer.writeClassAttribute(Classes.create(page, "pngFixBlankImage"));
+ final String pngFixBlankImage = ResourceManagerUtils.getImageWithPath(facesContext, "image/blank.gif");
+ writer.writeAttribute(HtmlAttributes.SRC, pngFixBlankImage, false);
+ writer.endElement(HtmlElements.IMG);
+
+ writer.startElement(HtmlElements.IMG, null);
+ writer.writeClassAttribute(Classes.create(page, "overlayBackgroundImage"));
+ final String overlayBackgroundImage = ResourceManagerUtils.getImageWithPath(facesContext,
+ "image/tobago-overlay-background.png");
+ writer.writeAttribute(HtmlAttributes.SRC, overlayBackgroundImage, false);
+ writer.endElement(HtmlElements.IMG);
+
// debugging...
if (debugMode) {
List<String> logMessages = new ArrayList<String>();
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=1352076&r1=1352075&r2=1352076&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Wed Jun 20 13:01:08 2012
@@ -661,7 +661,10 @@ li.tobago-menu-markup-selected {
position: relative;
}
-.tobago-page-overlayWaitPreloadedImage, .tobago-page-overlayErrorPreloadedImage {
+.tobago-page-overlayWaitPreloadedImage,
+.tobago-page-overlayErrorPreloadedImage,
+.tobago-page-pngFixBlankImage,
+.tobago-page-overlayBackgroundImage {
display: none;
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js?rev=1352076&r1=1352075&r2=1352076&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/msie_6_0/script/tobago.js Wed Jun 20 13:01:08 2012
@@ -59,7 +59,7 @@ Tobago.fixPngAlphaInternal = function(el
element.runtimeStyle.backgroundImage = "none";
element.runtimeStyle.filter
= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + element.src + "', sizingMethod='scale')";
- element.src = Tobago.pngFixBlankImage;
+ element.src = jQuery(".tobago-page-pngFixBlankImage").attr("src");
};
Tobago.fixBackgroundPngAlpha = function(element) {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js?rev=1352076&r1=1352075&r2=1352076&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js Wed Jun 20 13:01:08 2012
@@ -53,6 +53,7 @@ Tobago.Popup.setup = function () {
// IE6 doesn't support position:fixed
if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
+ var image = jQuery(".tobago-page-overlayBackgroundImage").attr("src");
shield.css({
position:'absolute',
left:-maxModalPopup.offset().left,
@@ -61,7 +62,7 @@ Tobago.Popup.setup = function () {
height:jQuery(window).height(),
background:'none',
filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
- + Tobago.OVERLAY_BACKGROUND + "', sizingMethod='scale');"
+ + image + "', sizingMethod='scale');"
});
// IE6 needs an iframe to protect the other controls and protect against select-tag shining through.