Author: nbelaevski
Date: 2008-07-29 09:22:10 -0400 (Tue, 29 Jul 2008)
New Revision: 9814
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/RenderPhaseViewResourcesVisitor.java
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js
Log:
Extended skinning client-side support
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/RenderPhaseViewResourcesVisitor.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/context/RenderPhaseViewResourcesVisitor.java 2008-07-29
12:21:18 UTC (rev 9813)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/context/RenderPhaseViewResourcesVisitor.java 2008-07-29
13:22:10 UTC (rev 9814)
@@ -525,7 +525,7 @@
//by AJAX request
responseWriter.startElement("script", null);
responseWriter.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
- responseWriter.writeText("window.RICH_FACES_SKINNING_ON=true;", null);
+ responseWriter.writeText("window.RICH_FACES_EXTENDED_SKINNING_ON=true;",
null);
responseWriter.endElement("script");
}
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js 2008-07-29
12:21:18 UTC (rev 9813)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/skinning.js 2008-07-29
13:22:10 UTC (rev 9814)
@@ -1,4 +1,4 @@
-if (window.RICH_FACES_SKINNING_ON) {
+{
var mediaName = "rich-extended-skinning";
var skipNavigator = window.opera || navigator.userAgent.indexOf('AppleWebKit/')
> -1;
@@ -30,15 +30,16 @@
};
var f = function() {
- var styles = getElementByTagName(document, 'link');
- if (styles) {
- var l = styles.length;
- for (var i = 0; i < l; i++) {
- var elt = styles[i];
- resetMedia(elt);
+ if (window.RICH_FACES_EXTENDED_SKINNING_ON) {
+ var styles = getElementByTagName(document, 'link');
+ if (styles) {
+ var l = styles.length;
+ for (var i = 0; i < l; i++) {
+ var elt = styles[i];
+ resetMedia(elt);
+ }
}
- }
-
+ }
};
if (window.addEventListener) {
@@ -52,8 +53,10 @@
if (!window._RICH_FACES_SKINNING_ADDED_TO_AJAX && typeof A4J !=
"undefined" && A4J.AJAX) {
A4J.AJAX.AddHeadElementTransformer(function (elt) {
- if (elt.tagName && elt.tagName.toLowerCase() == 'link') {
- resetMedia(elt);
+ if (window.RICH_FACES_EXTENDED_SKINNING_ON) {
+ if (elt.tagName && elt.tagName.toLowerCase() == 'link') {
+ resetMedia(elt);
+ }
}
});
window._RICH_FACES_SKINNING_ADDED_TO_AJAX = true;
Show replies by date