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 2015/06/03 10:09:20 UTC

svn commit: r1683248 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main: java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: lofwyr
Date: Wed Jun  3 08:09:19 2015
New Revision: 1683248

URL: http://svn.apache.org/r1683248
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
 - sizes of image and popup

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ImageRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ImageRenderer.java?rev=1683248&r1=1683247&r2=1683248&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ImageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ImageRenderer.java Wed Jun  3 08:09:19 2015
@@ -78,16 +78,8 @@ public class ImageRenderer extends Layou
     }
 
     writer.startElement(HtmlElements.IMG, image);
-
-    if (image.getWidth() != null) {
-      writer.writeAttribute(HtmlAttributes.WIDTH, "" + image.getWidth().getPixel(), false);
-    }
-    if (image.getHeight() != null) {
-      writer.writeAttribute(HtmlAttributes.HEIGHT, "" + image.getHeight().getPixel(), false);
-    }
-
-    final String clientId = image.getClientId(facesContext);
-    writer.writeIdAttribute(clientId);
+    writer.writeIdAttribute(image.getClientId(facesContext));
+    writer.writeStyleAttribute(new Style(facesContext, image));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
     if (src != null) {
       writer.writeAttribute(HtmlAttributes.SRC, src, true);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java?rev=1683248&r1=1683247&r2=1683248&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PopupRenderer.java Wed Jun  3 08:09:19 2015
@@ -22,6 +22,7 @@ package org.apache.myfaces.tobago.render
 import org.apache.myfaces.tobago.component.UIPopup;
 import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.TobagoClass;
@@ -52,6 +53,7 @@ public class PopupRenderer extends Layou
     writer.writeIdAttribute(popup.getClientId(facesContext));
     writer.startElement(HtmlElements.DIV, null);
     writer.writeClassAttribute(BootstrapClass.MODAL_DIALOG);
+    writer.writeStyleAttribute(new Style(facesContext, popup));
     writer.startElement(HtmlElements.DIV, null);
     writer.writeClassAttribute(BootstrapClass.MODAL_CONTENT);
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/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/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1683248&r1=1683247&r2=1683248&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Jun  3 08:09:19 2015
@@ -923,21 +923,30 @@ var Tobago = {
     });
   },
 
-  initCss: function(elements) {
+  initCss: function (elements) {
     // element styles
     console.time("[tobago] initCss"); // @DEV_ONLY
-    Tobago.Utils.selectWithJQuery(elements, ".tobago-popup[data-tobago-style]").each(function () {
-      var element = jQuery(this);
-      var data = element.data("tobago-style");
-      element.css({
-        left: data.left,
-        top: data.top,
-        width: data.width,
-        height: data.height,
-        zIndex: data.zIndex
-      });
-    });
-/* XXX this is the old Tobago 2.0 behaviour, should be deleded und removing these information from the tags
+    Tobago.Utils.selectWithJQuery(elements, ".tobago-image").add(
+        Tobago.Utils.selectWithJQuery(elements, ".modal-dialog[data-tobago-style]")).each(function () {
+          var element = jQuery(this);
+          var data = element.data("tobago-style");
+/* todo
+          if (data.width) {
+            element.css("width", data.width);
+          }
+          if (data.height) {
+            element.css("height", data.height);
+          }
+*/
+          element.css({
+            left: data.left,
+            top: data.top,
+            width: data.width,
+            height: data.height,
+            zIndex: data.zIndex
+          });
+        });
+    /* XXX this is the old Tobago 2.0 behaviour, should be deleded und removing these information from the tags
     Tobago.Utils.selectWithJQuery(elements, "[data-tobago-style]").each(function () {
       var element = jQuery(this);
       if (Tobago.browser.isMsie678) { // IE before 9 doesn't support multiple backgrounds, so we use only the first.