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 15:53:51 UTC

svn commit: r1683335 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-example/tobago-example-test/src/main/webapp/test/section/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/ tobago-theme/tobago-theme-...

Author: lofwyr
Date: Wed Jun  3 13:53:51 2015
New Revision: 1683335

URL: http://svn.apache.org/r1683335
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap
 - do spacing of tc:section via CSS (not with a space char)

Added:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/section.xhtml
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css

Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/section.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/section.xhtml?rev=1683335&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/section.xhtml (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-test/src/main/webapp/test/section/section.xhtml Wed Jun  3 13:53:51 2015
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+-->
+
+<f:view
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:f="http://java.sun.com/jsf/core">
+
+  <tc:page id="page">
+    <f:facet name="layout">
+      <tc:flowLayout />
+    </f:facet>
+
+    <tc:section label="Main Section" image="glyphicon-heart">
+      <tc:section label="1st Sub-Section">
+        1st content
+      </tc:section>
+      <tc:section>
+        2nd content (title has no label nor image)
+      </tc:section>
+      <tc:section label="3rd Sub-Section with image" image="glyphicon-star">
+        3rd content
+      </tc:section>
+      <tc:section image="glyphicon-star-empty">
+        4th content (title has only an image)
+        <tc:section label="Sub-Sub-Section" image="glyphicon-star-empty">
+          <tc:section label="Sub-Sub-Sub-Section" image="glyphicon-star-empty">
+            <tc:section label="Sub-Sub-Sub-Sub-Section" image="glyphicon-star-empty">
+              <tc:section label="Sub-Sub-Sub-Sub-Sub-Section" image="glyphicon-star-empty">
+                Level 6
+              </tc:section>
+            </tc:section>
+          </tc:section>
+        </tc:section>
+      </tc:section>
+
+    </tc:section>
+  </tc:page>
+</f:view>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.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/util/HtmlRendererUtils.java?rev=1683335&r1=1683334&r2=1683335&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java Wed Jun  3 13:53:51 2015
@@ -111,14 +111,10 @@ public final class HtmlRendererUtils {
       writer.writeClassAttribute(BootstrapClass.GLYPHICON, BootstrapClass.glyphicon(image));
       writer.endElement(HtmlElements.SPAN);
     }
-    if (image != null && label != null) {
-      writer.writeText(" ");
-    }
-    if (image == null && label == null) { // needed, otherwise the look is broken (bootstrap 3.3.1)
-      writer.writeText(HtmlRendererUtils.CHAR_NON_BEAKING_SPACE);
-    }
     if (label != null) {
+      writer.startElement(HtmlElements.SPAN, null);
       writer.writeText(label);
+      writer.endElement(HtmlElements.SPAN);
     }
   }
 
@@ -132,7 +128,7 @@ public final class HtmlRendererUtils {
         writer.endElement(HtmlElements.SPAN);
       } else {
         if (ResourceManagerUtils.isAbsoluteResource(image)) {
-          // absolute Path to image : nothing to do
+          // absolute Path to image: nothing to do
         } else {
           image = getImageWithPath(facesContext, image, disabled);
         }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css
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/style/tobago.css?rev=1683335&r1=1683334&r2=1683335&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/style/tobago.css (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/style/tobago.css Wed Jun  3 13:53:51 2015
@@ -220,11 +220,11 @@ fixes missing space, I thinks normal Web
   margin-left: 0;
 }
 
-.tobago-button > * {
+.tobago-button > *, .tobago-link > * {
   margin-left: 5px;
 }
 
-.tobago-button > *:first-child {
+.tobago-button > *:first-child, .tobago-link > *:first-child {
   margin-left: 0;
 }
 
@@ -249,3 +249,12 @@ fixes missing space, I thinks normal Web
 .tobago-tabGroup-toolBar {
   display: none;
 }
+
+h1 > *, h2 > *, h3 > *, h4 > *, h5 > *, h6 > * {
+  margin-left: 1em;
+}
+
+h1 > *:first-child, h2 > *:first-child, h3 > *:first-child, h4 > *:first-child, h5 > *:first-child, h6 > *:first-child {
+  margin-left: 0;
+}
+