You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/12/07 14:17:06 UTC

svn commit: r1211425 - 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: lofwyr
Date: Wed Dec  7 13:17:06 2011
New Revision: 1211425

URL: http://svn.apache.org/viewvc?rev=1211425&view=rev
Log:
TOBAGO-1064: Wait animation for partially rendered elements (AJAX)
 - style no longer needs the size of the images (less work for theme writers)
 - DOM cleanup

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/msie_6_0/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_7_0/style/style.css
    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/standard/script/tobago.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=1211425&r1=1211424&r2=1211425&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 Dec  7 13:17:06 2011
@@ -626,7 +626,9 @@ public class PageRenderer extends PageRe
 
     writer.startElement(HtmlElements.IMG, null);
     writer.writeClassAttribute(Classes.create(page, "overlayErrorPreloadedImage"));
-    final String error = ResourceManagerUtils.getImageWithPath(facesContext, "image/dialog-error.png");
+    final String error = ClientProperties.getInstance(facesContext).getUserAgent().isMsie6()
+        ? ResourceManagerUtils.getImageWithPath(facesContext, "image/remove.gif") // XXX why png doesn't work in ie6?
+        : ResourceManagerUtils.getImageWithPath(facesContext, "image/dialog-error.png");
     writer.writeAttribute(HtmlAttributes.SRC, error, false);
     writer.endElement(HtmlElements.IMG);
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_6_0/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/msie_6_0/style/style.css?rev=1211425&r1=1211424&r2=1211425&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_6_0/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_6_0/style/style.css Wed Dec  7 13:17:06 2011
@@ -35,6 +35,17 @@
   display: inline-block;
 }
 
+/* page -------------------------------------------------------------- */
+
+.tobago-page-overlayCenter {
+  position: absolute;
+  top: 50%;
+}
+
+.tobago-page-overlayCenter img {
+  top: -50%;
+}
+
 /* tab/tabGroup -------------------------------------------------------------- */
 
 .tobago-tab {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_7_0/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/msie_7_0/style/style.css?rev=1211425&r1=1211424&r2=1211425&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_7_0/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie_7_0/style/style.css Wed Dec  7 13:17:06 2011
@@ -35,6 +35,17 @@
   display: inline-block;
 }
 
+/* page -------------------------------------------------------------- */
+
+.tobago-page-overlayCenter {
+  position: absolute;
+  top: 50%;
+}
+
+.tobago-page-overlayCenter img {
+  top: -50%;
+}
+
 /* tab/tabGroup -------------------------------------------------------------- */
 
 .tobago-tabGroupToolBar-item img {

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=1211425&r1=1211424&r2=1211425&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 Dec  7 13:17:06 2011
@@ -581,37 +581,36 @@ li.tobago-menu-markup-selected {
   position: absolute;
 }
 
-.tobago-page-overlayBarrier {
-  display: none;
+.tobago-page-overlay {
+  display: table;
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
-  cursor: wait;
 /* TODO: better z-index strategy */
   z-index: 10000;
 }
 
-.tobago-page-overlayWait {
-  display: none;
-  position: absolute;
-  text-align: center;
-  left: 50%;
-  top: 50%;
-  width: 0;
-  height: 0;
+.tobago-page-overlay-markup-wait {
   cursor: wait;
+}
+
+.tobago-page-overlay-markup-error {
+  cursor: default;
+}
+
+.tobago-page-overlayCenter {
+  display: table-cell;
+  text-align: center;
+  vertical-align: middle;
+  width: 100%;
 /* TODO: better z-index strategy */
   z-index: 10000;
 }
 
-.tobago-page-overlayWait img {
-  position: absolute;
-  /* half width of the image */
-  left: -45px;
-  /* half height of the image */
-  top: -5px;
+.tobago-page-overlayCenter img {
+  position: relative;
 }
 
 .tobago-page-overlayWaitPreloadedImage, .tobago-page-overlayErrorPreloadedImage {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/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/standard/script/tobago.js?rev=1211425&r1=1211424&r2=1211425&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Dec  7 13:17:06 2011
@@ -356,11 +356,10 @@ var Tobago = {
       LOG.warn('Deprecation: Please call createOverlay() with a jQuery object.'); // @DEV_ONLY
     }
 
-    if (element.children(".tobago-page-overlayBarrier").size() > 0) {
+    if (element.children(".tobago-page-overlay").size() > 0) {
 
-      // todo: optimize! May be set an attribute or a alternative class.
-      // is this a error overlay?
-      if (element.find(".tobago-page-overlayBarrier img").attr("src").indexOf("error") > -1) {
+      // is this an error overlay?
+      if (element.children(".tobago-page-overlay-markup-error").size() > 0) {
         Tobago.deleteOverlay(element);
       } else {
         LOG.warn('There is already a overlay barrier'); // @DEV_ONLY
@@ -370,9 +369,11 @@ var Tobago = {
 
     Tobago.ie6bugfix(element.get(0));
 
-    element.append("<div class='tobago-page-overlayBarrier'><div class='tobago-page-overlayWait'><img></div></div>");
+    element.append("<div class='tobago-page-overlay tobago-page-overlay-markup-"
+            + (error ? "error" : "wait")
+            + "'><div class='tobago-page-overlayCenter'><img></div></div>");
 
-    var wait = element.find(".tobago-page-overlayWait");
+    var wait = element.find(".tobago-page-overlayCenter");
     var image = wait.children("img");
     var src = error
         ? jQuery("body > .tobago-page-overlayErrorPreloadedImage").attr("src")
@@ -381,13 +382,13 @@ var Tobago = {
     wait.show();
 
     if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6) {
-      element.children(".tobago-page-overlayBarrier")
+      element.children(".tobago-page-overlay")
           .css({
             width:element.css("width"),
             height:element.css("height")});
     }
 
-    element.children(".tobago-page-overlayBarrier")
+    element.children(".tobago-page-overlay")
         .css({
           backgroundColor:jQuery('.tobago-page').css("background-color"),
           filter:'alpha(opacity=80)', //IE
@@ -420,7 +421,7 @@ var Tobago = {
       LOG.warn('Deprecation: Please call deleteOverlay() with a jQuery object.'); // @DEV_ONLY
     }
 
-    element.children(".tobago-page-overlayBarrier").remove();
+    element.children(".tobago-page-overlay").remove();
   },
 
   ie6bugfix: function(element) {