You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2014/09/02 17:14:19 UTC
git commit: TAP5-2371: add some conditional CSS to make the page
loading mask work with browsers that do not support CSS transitions (i.e. IE)
Repository: tapestry-5
Updated Branches:
refs/heads/master 38b3aa905 -> e2eced130
TAP5-2371: add some conditional CSS to make the page loading mask work with browsers that do not support CSS transitions (i.e. IE)
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/e2eced13
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/e2eced13
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/e2eced13
Branch: refs/heads/master
Commit: e2eced130217f403a4ba3ae2e7ef98010b9a7d4d
Parents: 38b3aa9
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Tue Sep 2 17:12:48 2014 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Tue Sep 2 17:12:48 2014 +0200
----------------------------------------------------------------------
.../AddBrowserCompatibilityStyles.java | 50 ++++++++++++++++++++
.../tapestry5/modules/JavaScriptModule.java | 1 +
.../META-INF/assets/tapestry5/tapestry.css | 5 +-
3 files changed, 52 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e2eced13/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
new file mode 100644
index 0000000..5309666
--- /dev/null
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/AddBrowserCompatibilityStyles.java
@@ -0,0 +1,50 @@
+// 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
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.internal.services.javascript;
+
+import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.dom.Element;
+import org.apache.tapestry5.services.MarkupRenderer;
+import org.apache.tapestry5.services.MarkupRendererFilter;
+
+/**
+ * Responsible for adding additional style tags that contain directives for non-standards compatible browsers
+ *
+ * @since 5.4
+ */
+public class AddBrowserCompatibilityStyles implements MarkupRendererFilter
+{
+
+ public AddBrowserCompatibilityStyles()
+ {
+ }
+
+ public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
+ {
+ renderer.renderMarkup(writer);
+
+ Element head = writer.getDocument().find("html/head");
+
+ // 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]-->");
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e2eced13/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 713eb45..4e7079e 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
@@ -420,6 +420,7 @@ public class JavaScriptModule
public static void renderLocaleAttributeIntoPages(OrderedConfiguration<MarkupRendererFilter> configuration)
{
configuration.addInstance("ConfigureHTMLElement", ConfigureHTMLElementFilter.class);
+ configuration.addInstance("AddBrowserCompatibilityStyles", AddBrowserCompatibilityStyles.class);
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/e2eced13/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
index 0aae520..5869e0a 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
@@ -58,10 +58,7 @@ div.datefield-popup.well {
left: 0;
z-index: 1040;
background-color: #000;
- /* Some translucency, for browsers w/o animation support. */
- opacity: .25;
- /* IE: */
- filter:alpha(opacity=25);
+ opacity: 0;
animation-name: pageloading-mask-fade-in;
animation-duration: 250ms;
animation-delay: 250ms;