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/08/08 12:20:00 UTC

[myfaces-tobago] branch master updated (d053425 -> 292bb2f)

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 d053425  replace jQuery with ES6
     new 00f1740  clean up
     new 292bb2f  delete unused code / cleanup

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:
 .../internal/renderkit/renderer/TreeRenderer.java  | 10 ++---
 .../src/main/npm/ts/tobago-core.ts                 | 14 -------
 .../src/main/npm/ts/tobago-file.ts                 |  2 +-
 .../src/main/npm/ts/tobago-utils.ts                | 48 ----------------------
 4 files changed, 6 insertions(+), 68 deletions(-)


[myfaces-tobago] 01/02: clean up

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 00f1740c5c03ba9c5b9de1ac936bd37e33031d34
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Aug 7 22:26:30 2019 +0200

    clean up
---
 .../tobago-theme-standard/src/main/npm/ts/tobago-core.ts   | 14 --------------
 .../tobago-theme-standard/src/main/npm/ts/tobago-file.ts   |  2 +-
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-core.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-core.ts
index 6feff42..7c9d6fa 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-core.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-core.ts
@@ -128,20 +128,6 @@ export class Tobago4 {
       }
     });
   };
-
-  static toString = function (element) {
-    var result = '';
-    for (var property in element) {
-      if (property && element[property]) {
-        var value = '' + element[property];
-        if (value !== '') {
-          result += '\r\n' + property + '=' + value;
-        }
-      }
-    }
-    return result;
-  };
-
 }
 
 document.addEventListener('DOMContentLoaded', function () {
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-file.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-file.ts
index d5ec0c4..8b57f39 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-file.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-file.ts
@@ -28,7 +28,7 @@ class File {
         let text: string;
         if (real.multiple) {
           const format: string = real.dataset["tobagoFileMultiFormat"];
-          text = format.replace("{}", real.files.length.toString());
+          text = format.replace("{}", String(real.files.length));
         } else {
           text = <string>real.value;
           // remove path, if any. Some old browsers set the path, others like webkit uses the prefix "C:\path\".


[myfaces-tobago] 02/02: delete unused code / cleanup

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 292bb2fc24fc370497351b99d8b172e7e07c87ff
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Aug 8 14:15:23 2019 +0200

    delete unused code / cleanup
    
    issue: TOBAGO-1633: TS refactoring
---
 .../internal/renderkit/renderer/TreeRenderer.java  | 10 ++---
 .../src/main/npm/ts/tobago-utils.ts                | 48 ----------------------
 2 files changed, 5 insertions(+), 53 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
index e4e01ff..44818ba 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
@@ -53,13 +53,13 @@ public class TreeRenderer extends RendererBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  protected static final String SCROLL_POSITION = ComponentUtils.SUB_SEPARATOR + "scrollPosition";
+  protected static final String SCROLL_POSITION = "scrollPosition";
 
   @Override
   public void decode(final FacesContext facesContext, final UIComponent component) {
     final AbstractUITree tree = (AbstractUITree) component;
     final String value = facesContext.getExternalContext().getRequestParameterMap().get(
-        tree.getClientId(facesContext) + SCROLL_POSITION);
+        tree.getClientId(facesContext) + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
     if (value != null) {
       tree.getState().getScrollPosition().update(value);
     }
@@ -162,11 +162,11 @@ public class TreeRenderer extends RendererBase {
     writer.endElement(HtmlElements.INPUT);
 
     writer.startElement(HtmlElements.INPUT);
-    writer.writeIdAttribute(clientId + SCROLL_POSITION);
-    writer.writeNameAttribute(clientId + SCROLL_POSITION);
+    writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
+    writer.writeNameAttribute(clientId + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN);
     writer.writeAttribute(HtmlAttributes.VALUE, tree.getState().getScrollPosition().encode(), false);
-    writer.writeAttribute(DataAttributes.SCROLL_POSITION, Boolean.TRUE.toString(), true);
+    writer.writeAttribute(DataAttributes.SCROLL_POSITION, Boolean.TRUE.toString(), false);
     writer.endElement(HtmlElements.INPUT);
 
     writer.endElement(HtmlElements.DIV);
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
index d90707d..66b8423 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
@@ -189,52 +189,4 @@ export class Tobago4Utils {
     }
     return id.substring(0, id.lastIndexOf(":"));
   }
-
-  /**
-   * fix position, when the element it is outside of the current page
-   * @param elements is an jQuery Array of elements to be fixed.
-   */
-  static keepElementInVisibleArea(elements) {
-    elements.each(function () {
-      var element = jQuery(this);
-      var page = jQuery(".tobago-page-content:first");
-      var left = element.offset().left;
-      var top = element.offset().top;
-      // fix menu position, when it is outside of the current page
-      left = Math.max(0, Math.min(left, page.outerWidth() - element.outerWidth()));
-      top = Math.max(0, Math.min(top, page.outerHeight() - element.outerHeight()));
-      element.css('left', left);
-      element.css('top', top);
-    });
-  }
-
-  static addDataMarkup(element, markupString) {
-    var dataTobagoMarkup = element.attr("data-tobago-markup");
-    if (dataTobagoMarkup !== undefined) {
-      var markups = jQuery.parseJSON(dataTobagoMarkup);
-      markups.push(markupString);
-      element.attr("data-tobago-markup", JSON.stringify(markups));
-    } else {
-      element.attr("data-tobago-markup", JSON.stringify(markupString));
-    }
-  }
-
-  static removeDataMarkup(element, markupString) {
-    var dataTobagoMarkup = element.attr("data-tobago-markup");
-    if (dataTobagoMarkup !== undefined) {
-      var markups = jQuery.parseJSON(dataTobagoMarkup);
-      var index = jQuery.inArray(markupString, markups);
-      if (index >= 0) {
-        markups.splice(index, 1);
-      } else if (markups === markupString) {
-        markups = [];
-      }
-
-      if (markups.length > 0) {
-        element.attr("data-tobago-markup", JSON.stringify(markups));
-      } else {
-        element.removeAttr("data-tobago-markup");
-      }
-    }
-  }
 }
\ No newline at end of file