myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: TOBAGO-1721 Optimize HTML output when two renderer are involved * forgot tc:bar -> improve CSS class writing and markups
Date Thu, 12 Oct 2017 14:56:50 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 66f2839  TOBAGO-1721 Optimize HTML output when two renderer are involved * forgot
tc:bar -> improve CSS class writing and markups
66f2839 is described below

commit 66f2839d71a2fb62849b73beafc303eb5575004f
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Thu Oct 12 16:56:45 2017 +0200

    TOBAGO-1721 Optimize HTML output when two renderer are involved
    * forgot tc:bar -> improve CSS class writing and markups
---
 .../tobago/internal/renderkit/renderer/BarRenderer.java      |  4 ++++
 .../org/apache/myfaces/tobago/renderkit/css/TobagoClass.java |  1 +
 .../apache/myfaces/tobago/webapp/TobagoResponseWriter.java   |  2 +-
 tobago-core/src/main/resources/scss/_tobago.scss             |  4 ++++
 .../src/main/resources/META-INF/tobago-config.xml            | 12 ++++++++++++
 5 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
index 8deae82..c51e770 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/BarRenderer.java
@@ -30,6 +30,7 @@ import org.apache.myfaces.tobago.internal.util.JQueryUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
 import org.apache.myfaces.tobago.renderkit.css.BootstrapClass;
 import org.apache.myfaces.tobago.renderkit.css.Icons;
+import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.Arias;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -58,6 +59,9 @@ public class BarRenderer extends RendererBase {
     writer.startElement(HtmlElements.NAV);
     writer.writeIdAttribute(clientId);
     writer.writeClassAttribute(
+        TobagoClass.BAR,
+        TobagoClass.BAR.createMarkup(bar.getMarkup()),
+        TobagoClass.BAR.createDefaultMarkups(bar),
         BootstrapClass.NAVBAR,
         getNavbarExpand(markup),
         getNavbarColorScheme(markup),
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
index 43d8363..d06a5f7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
@@ -121,6 +121,7 @@ public enum TobagoClass implements CssItem {
 
   // component based classes
 
+  BAR("tobago-bar"),
   BOX("tobago-box"),
   BOX__HEADER("tobago-box-header"),
   BUTTON("tobago-button"),
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
index 57d208e..d093a73 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
@@ -219,7 +219,7 @@ public abstract class TobagoResponseWriter extends ResponseWriter {
   private boolean writeCssItem(final StringBuilder builder, final CssItem... cssItems) {
     boolean render = false;
     for (CssItem cssItem : cssItems) {
-      if (cssItem != null) {
+      if (cssItem != null && !"".equals(cssItem.getName())) {
         builder.append(cssItem.getName());
         builder.append(' ');
         render = true;
diff --git a/tobago-core/src/main/resources/scss/_tobago.scss b/tobago-core/src/main/resources/scss/_tobago.scss
index 91014c9..da6ff4a 100644
--- a/tobago-core/src/main/resources/scss/_tobago.scss
+++ b/tobago-core/src/main/resources/scss/_tobago.scss
@@ -84,6 +84,10 @@ Todo: check, if this is needed? (It doesn't work with the build system)
 .tobago-label-container {
 }
 
+/* bar -------------------------------------------------------------- */
+.tobago-bar {
+}
+
 /* box -------------------------------------------------------------- */
 
 .tobago-box {
diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
index c508954..e382e75 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
@@ -38,6 +38,18 @@
       <versioned>true</versioned>
       <renderers>
         <renderer>
+          <name>Bar</name>
+          <supported-markup>
+            <markup>togglerLeft</markup>
+            <markup>small</markup>
+            <markup>medium</markup>
+            <markup>large</markup>
+            <markup>extraLarge</markup>
+            <markup>light</markup>
+            <markup>dark</markup>
+          </supported-markup>
+        </renderer>
+        <renderer>
           <name>Button</name>
           <supported-markup>
             <markup>default</markup>

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <commits@myfaces.apache.org>'].

Mime
View raw message