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 2019/09/26 07:30:51 UTC

[myfaces-tobago] branch master updated (3d073db -> c40e25f)

This is an automated email from the ASF dual-hosted git repository.

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


    from 3d073db  update plugin, hope this repairs download problems of the Jenkins
     new e1312f1  simple refactoring
     new c40e25f  custom element: tobago-label * fixes: tobago-label is not a custom element, it uses <label>

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../renderkit/renderer/LabelLayoutRendererBase.java   |  5 +++--
 .../myfaces/tobago/renderkit/css/TobagoClass.java     |  1 +
 tobago-core/src/main/resources/scss/_tobago.scss      | 19 +++++++++++++------
 .../src/main/npm/ts/tobago-jsf.ts                     |  8 +++-----
 .../src/main/npm/ts/tobago-page.ts                    |  4 ++++
 5 files changed, 24 insertions(+), 13 deletions(-)


[myfaces-tobago] 02/02: custom element: tobago-label * fixes: tobago-label is not a custom element, it uses

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c40e25fac8c89dbfdaa459d3d002424c00329799
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Sep 26 09:30:34 2019 +0200

    custom element: tobago-label
    * fixes: tobago-label is not a custom element, it uses <label>
    
    issue: TOBAGO-1633: TS refactoring
---
 .../renderkit/renderer/LabelLayoutRendererBase.java   |  5 +++--
 .../myfaces/tobago/renderkit/css/TobagoClass.java     |  1 +
 tobago-core/src/main/resources/scss/_tobago.scss      | 19 +++++++++++++------
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
index 82d75d7..6733303 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
@@ -129,7 +129,7 @@ public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase
 
     if (labelLayout == LabelLayout.gridLeft || labelLayout == LabelLayout.gridRight
         || labelLayout == LabelLayout.gridTop || labelLayout == LabelLayout.gridBottom) {
-      writer.startElement(HtmlElements.TOBAGO_LABEL);
+      writer.startElement(HtmlElements.LABEL);
       writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "label");
     } else {
       writer.startElement(getComponentTag());
@@ -139,6 +139,7 @@ public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase
         flex ? TobagoClass.FLEX_LAYOUT : null,
         flex ? BootstrapClass.D_FLEX : null,
         BootstrapClass.FORM_GROUP,
+        TobagoClass.LABEL__CONTAINER,
         ComponentUtils.getBooleanAttribute(component, Attributes.required) ? TobagoClass.REQUIRED : null,
         markup != null && markup.contains(Markup.SPREAD) ? TobagoClass.SPREAD : null);
 
@@ -163,7 +164,7 @@ public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase
       case gridRight:
       case gridTop:
       case gridBottom:
-        writer.endElement(HtmlElements.TOBAGO_LABEL);
+        writer.endElement(HtmlElements.LABEL);
 
         writer.startElement(getComponentTag());
         writer.writeIdAttribute(clientId);
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 731910e..33abe3a 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
@@ -140,6 +140,7 @@ public enum TobagoClass implements CssItem {
   @Deprecated
   INPUT_GROUP_OUTER(INPUT__GROUP__OUTER.getName()),
   LABEL("tobago-label"),
+  LABEL__CONTAINER("tobago-label-container"),
   LINK("tobago-link"),
   LINKS("tobago-links"),
   MESSAGES("tobago-messages"),
diff --git a/tobago-core/src/main/resources/scss/_tobago.scss b/tobago-core/src/main/resources/scss/_tobago.scss
index 21cc683..8a2ccd7 100644
--- a/tobago-core/src/main/resources/scss/_tobago.scss
+++ b/tobago-core/src/main/resources/scss/_tobago.scss
@@ -277,7 +277,7 @@ tobago-file {
 }
 
 /* the non-label-element inside of a label-layout with flex box */
-tobago-label.tobago-flexLayout > {
+.tobago-label-container.tobago-flexLayout > {
   .form-control, .form-control-plaintext, .twitter-typeahead,
   .tobago-input-group-outer, .tobago-messages-container,
   .tobago-selectManyShuttle {
@@ -316,7 +316,7 @@ tobago-label.tobago-flexLayout > {
   grid-column-gap: $spacer-x; // old
   column-gap: $spacer-x;
 
-  tobago-label > {
+  .tobago-label-container > {
     .tobago-textarea, .tobago-selectManyListbox, .tobago-selectManyShuttle {
       height: 100%;
     }
@@ -366,11 +366,18 @@ tobago-label.tobago-flexLayout > {
 }
 
 /* label ----------------------------------------------------------- */
-tobago-label {
+
+// todo remove
+.tobago-label {
+}
+
+/* XXX check if this is needed (was .tobago-label before)
+label {
   width: 100%;
 }
+*/
 
-.tobago-flexLayout > tobago-label {
+.tobago-flexLayout > label {
   width: 155px;
 }
 
@@ -1644,8 +1651,8 @@ fixme: there is a problem with the selectManyShuttle with this style.
   display: none;
 }
 
-.tobago-required .tobago-label:after,
-tobago-label.tobago-required:after {
+.tobago-required label:after,
+label.tobago-required:after {
   content: "*";
   color: theme-color("danger");
 }


[myfaces-tobago] 01/02: simple refactoring

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e1312f117e6c79c3d61dd8c47c9141a45d4e1c71
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Sep 26 08:34:52 2019 +0200

    simple refactoring
    
    issue: TOBAGO-1633: TS refactoring
---
 tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts  | 8 +++-----
 tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-page.ts | 4 ++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
index 34f2588..75ca34d 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
@@ -19,7 +19,7 @@ import {Listener, Phase} from "./tobago-listener";
 import {ReloadManager} from "./tobago-reload";
 import {Overlay} from "./tobago-overlay";
 
-export enum JsfParameter {
+enum JsfParameter {
   VIEW_STATE = "javax.faces.ViewState",
   CLIENT_WINDOW = "javax.faces.ClientWindow",
   VIEW_ROOT = "javax.faces.ViewRoot",
@@ -28,7 +28,7 @@ export enum JsfParameter {
   RESOURCE = "javax.faces.Resource"
 }
 
-class Jsf {
+export class Jsf {
 
   private static isId = function (id: string): boolean {
     switch (id) {
@@ -54,7 +54,7 @@ class Jsf {
     }
   };
 
-  static init = function (): void {
+  static registerAjaxListener = function (): void {
     jsf.ajax.addOnEvent(function (event): void {
       console.timeEnd("[tobago-jsf] jsf-ajax");
       console.time("[tobago-jsf] jsf-ajax");
@@ -91,5 +91,3 @@ class Jsf {
     });
   };
 }
-
-Listener.register(Jsf.init, Phase.DOCUMENT_READY);
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-page.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-page.ts
index 038e935..931fe6b 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-page.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-page.ts
@@ -16,6 +16,7 @@
  */
 
 import {DomUtils} from "./tobago-utils";
+import {Jsf} from "./tobago-jsf";
 
 export class Page extends HTMLElement {
 
@@ -39,6 +40,9 @@ export class Page extends HTMLElement {
   }
 
   connectedCallback(): void {
+
+    Jsf.registerAjaxListener();
+
     this.addEventListener("keypress", function (event: KeyboardEvent): boolean {
       let code = event.which; // XXX deprecated
       if (code === 0) {