You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/09/02 19:34:17 UTC
[1/2] git commit: Remove copyright year
Repository: tapestry-5
Updated Branches:
refs/heads/master bc436140f -> 90e9bccb2
Remove copyright year
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d70596de
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d70596de
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d70596de
Branch: refs/heads/master
Commit: d70596de704ae046b7776a37474d67f4c35d37de
Parents: bc43614
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Sep 2 10:22:13 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Sep 2 10:22:13 2014 -0700
----------------------------------------------------------------------
.../services/javascript/AddBrowserCompatibilityStyles.java | 7 -------
1 file changed, 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d70596de/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
index 5309666..30b20be 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
@@ -1,5 +1,3 @@
-// Copyright 2012 The Apache Software Foundation
-//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -26,11 +24,6 @@ import org.apache.tapestry5.services.MarkupRendererFilter;
*/
public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
{
-
- public AddBrowserCompatibilityStyles()
- {
- }
-
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
{
renderer.renderMarkup(writer);
[2/2] git commit: A few tweaks on TAP5-2371
Posted by hl...@apache.org.
A few tweaks on TAP5-2371
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/90e9bccb
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/90e9bccb
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/90e9bccb
Branch: refs/heads/master
Commit: 90e9bccb2cd3ebc8b502bee0bfc2aa03d11d9ba7
Parents: d70596d
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Sep 2 10:34:28 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Sep 2 10:34:28 2014 -0700
----------------------------------------------------------------------
.../AddBrowserCompatibilityStyles.java | 23 +++++++++++++++-----
.../tapestry5/modules/JavaScriptModule.java | 6 +++--
2 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90e9bccb/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
index 30b20be..e5b01d7 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
@@ -24,6 +24,22 @@ import org.apache.tapestry5.services.MarkupRendererFilter;
*/
public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
{
+ private final String ie9, ie8;
+
+ public AddBrowserCompatibilityStyles()
+ {
+ this(.25);
+ }
+
+ public AddBrowserCompatibilityStyles(double opacity)
+ {
+ // IE9 does not support CSS animations, so we make the loading mask translucent
+ ie9 = String.format("<!--[if IE 9]><style type=\"text/css\">.pageloading-mask{opacity:%.2f;}</style><![endif]-->", opacity);
+ // Older IE versions do not even support opacity, we'll have to resort to a filter
+ ie8 = String.format("<!--[if IE lt 9]><style type=\"text/css\">.pageloading-mask{filter:alpha(opacity=%d);}</style><![endif]-->",
+ (int) (100. * opacity));
+ }
+
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
{
renderer.renderMarkup(writer);
@@ -33,11 +49,8 @@ public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
// Only add the respective style documents if we've rendered an HTML document
if (head != null)
{
- // IE9 does not support CSS animations, so we make the loading mask translucent
- head.raw("<!--[if IE 9]><style type=\"text/css\">.pageloading-mask{opacity:.25;}</style><![endif]-->");
- // Older IE versions do not even support opacity, we'll have to resort to a filter
- head.raw("<!--[if IE lt 9]><style type=\"text/css\">.pageloading-mask{filter:alpha(opacity=25);}</style><![endif]-->");
-
+ head.raw(ie9);
+ head.raw(ie8);
}
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90e9bccb/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
index 4e7079e..6846e60 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
@@ -415,12 +415,14 @@ public class JavaScriptModule
/**
* Contributes 'ConfigureHTMLElement', which writes the attributes into the HTML tag to describe locale, etc.
+ * Contributes 'AddBrowserCompatibilityStyles', which writes {@code <style/>} elements into the {@code <head/>}
+ * element that modifies the page loading mask to work on IE 8 and IE 9.
*/
@Contribute(MarkupRenderer.class)
- public static void renderLocaleAttributeIntoPages(OrderedConfiguration<MarkupRendererFilter> configuration)
+ public static void prepareHTMLPageOnRender(OrderedConfiguration<MarkupRendererFilter> configuration)
{
configuration.addInstance("ConfigureHTMLElement", ConfigureHTMLElementFilter.class);
- configuration.addInstance("AddBrowserCompatibilityStyles", AddBrowserCompatibilityStyles.class);
+ configuration.add("AddBrowserCompatibilityStyles", new AddBrowserCompatibilityStyles());
}
}
[2/2] git commit: A few tweaks on TAP5-2371
Posted by hl...@apache.org.
A few tweaks on TAP5-2371
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/90e9bccb
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/90e9bccb
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/90e9bccb
Branch: refs/heads/master
Commit: 90e9bccb2cd3ebc8b502bee0bfc2aa03d11d9ba7
Parents: d70596d
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Sep 2 10:34:28 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Sep 2 10:34:28 2014 -0700
----------------------------------------------------------------------
.../AddBrowserCompatibilityStyles.java | 23 +++++++++++++++-----
.../tapestry5/modules/JavaScriptModule.java | 6 +++--
2 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90e9bccb/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
index 30b20be..e5b01d7 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
@@ -24,6 +24,22 @@ import org.apache.tapestry5.services.MarkupRendererFilter;
*/
public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
{
+ private final String ie9, ie8;
+
+ public AddBrowserCompatibilityStyles()
+ {
+ this(.25);
+ }
+
+ public AddBrowserCompatibilityStyles(double opacity)
+ {
+ // IE9 does not support CSS animations, so we make the loading mask translucent
+ ie9 = String.format("<!--[if IE 9]><style type=\"text/css\">.pageloading-mask{opacity:%.2f;}</style><![endif]-->", opacity);
+ // Older IE versions do not even support opacity, we'll have to resort to a filter
+ ie8 = String.format("<!--[if IE lt 9]><style type=\"text/css\">.pageloading-mask{filter:alpha(opacity=%d);}</style><![endif]-->",
+ (int) (100. * opacity));
+ }
+
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
{
renderer.renderMarkup(writer);
@@ -33,11 +49,8 @@ public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
// Only add the respective style documents if we've rendered an HTML document
if (head != null)
{
- // IE9 does not support CSS animations, so we make the loading mask translucent
- head.raw("<!--[if IE 9]><style type=\"text/css\">.pageloading-mask{opacity:.25;}</style><![endif]-->");
- // Older IE versions do not even support opacity, we'll have to resort to a filter
- head.raw("<!--[if IE lt 9]><style type=\"text/css\">.pageloading-mask{filter:alpha(opacity=25);}</style><![endif]-->");
-
+ head.raw(ie9);
+ head.raw(ie8);
}
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/90e9bccb/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
index 4e7079e..6846e60 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java
@@ -415,12 +415,14 @@ public class JavaScriptModule
/**
* Contributes 'ConfigureHTMLElement', which writes the attributes into the HTML tag to describe locale, etc.
+ * Contributes 'AddBrowserCompatibilityStyles', which writes {@code <style/>} elements into the {@code <head/>}
+ * element that modifies the page loading mask to work on IE 8 and IE 9.
*/
@Contribute(MarkupRenderer.class)
- public static void renderLocaleAttributeIntoPages(OrderedConfiguration<MarkupRendererFilter> configuration)
+ public static void prepareHTMLPageOnRender(OrderedConfiguration<MarkupRendererFilter> configuration)
{
configuration.addInstance("ConfigureHTMLElement", ConfigureHTMLElementFilter.class);
- configuration.addInstance("AddBrowserCompatibilityStyles", AddBrowserCompatibilityStyles.class);
+ configuration.add("AddBrowserCompatibilityStyles", new AddBrowserCompatibilityStyles());
}
}