myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1772208 - in /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script: ./ contrib/
Date Thu, 01 Dec 2016 14:02:10 GMT
Author: lofwyr
Date: Thu Dec  1 14:02:10 2016
New Revision: 1772208

URL: http://svn.apache.org/viewvc?rev=1772208&view=rev
Log:
revert lost history (til alpha-7)

Removed:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/contrib/
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js?rev=1772208&r1=1772207&r2=1772208&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-layout.js
Thu Dec  1 14:02:10 2016
@@ -189,8 +189,8 @@ function layoutFlex(container, orientati
           //container.children().eq(i).css(Modernizr.prefixed("flex"), tokens[i] + " 0 0px");
 // todo: modernizr
 
           var child = container.children().eq(i);
-          if (typeof child != 'undefined' && child.hasClass('tobago-box')) {
-            // XXX Is needed for IE11, otherwise tc:box doesn't displayed properly.
+          if (typeof child != 'undefined' && child.hasClass('tobago-box')
+              && orientation == Tobago.Layout.Orientation.VERTICAL) {
             container.children().eq(i).css(flex, tokens[i] + " 0 auto");
           } else {
             container.children().eq(i).css(flex, tokens[i] + " 0 0px");

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1772208&r1=1772207&r2=1772208&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
Thu Dec  1 14:02:10 2016
@@ -56,9 +56,9 @@ Tobago.Sheet.init = function(elements) {
     var dblclick = commands ? commands.dblclick : undefined;
     new Tobago.Sheet(id, undefined, undefined, undefined, undefined,
         click != undefined ? click.action  : undefined,
-        click != undefined ? click.partially : undefined,
+        click != undefined ? click.partially : undefined, // fixme: partially no longer used
         dblclick != undefined ? dblclick.action : undefined,
-        dblclick != undefined ? dblclick.partially: undefined,
+        dblclick != undefined ? dblclick.partially: undefined, // fixme: partially no longer
used
         sheet.data("tobago-behavior-commands")); // type array
 
     //////////////////////////////////////////////

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js?rev=1772208&r1=1772207&r2=1772208&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tab.js
Thu Dec  1 14:02:10 2016
@@ -25,53 +25,17 @@ Tobago.TabGroup.init = function(elements
 
   var tabGroups = Tobago.Utils.selectWithJQuery(elements, ".tobago-tabGroup");
 
-  // initialize the tab header elements
-  // reload tab case
-  tabGroups.filter("[switchType='reloadTab']").each(function() {
-    jQuery(this)
-        .find(".tobago-tabGroup-header")
-        .first()
-        .children(".tobago-tab")
-        .not(".tobago-tab-markup-disabled")
-        .click(
-            function (event) {
-              var tab = jQuery(this);
-              var activeIndex = Tobago.TabGroup.updateHidden(tab);
-              console.debug("todo: ajax reload, activeIndex=" + activeIndex); // @DEV_ONLY
-              var tabGroup = tab.parents(".tobago-tabGroup:first");
-              var tabGroupId = tabGroup.attr("id");
-              var executeIds = tabGroupId;
-              var renderIds = tabGroupId;
-              var behaviorCommands = tabGroup.data("tobago-behavior-commands");
-              if (behaviorCommands && behaviorCommands.reload) {
-                if (behaviorCommands.reload.execute) {
-                  executeIds = behaviorCommands.reload.execute;
-                }
-                if (behaviorCommands.reload.render) {
-                  renderIds +=  " " + behaviorCommands.reload.render;
-                }
-              }
-
-              jsf.ajax.request(
-                  tabGroupId,
-                  event,
-                  {
-                    execute: executeIds,
-                    render: renderIds
-                  });
-            })
-  });
-
-  // initialize the tab header elements
-  // reload page case
-  tabGroups.filter("[switchType='reloadPage']").each(function() {
-    jQuery(this).find(".tobago-tabGroup-header").first()
-      .children(".tobago-tab").not(".tobago-tab-markup-disabled").click(function() {
-          var activeIndex = Tobago.TabGroup.updateHidden(jQuery(this));
-          console.debug("todo: full reload, activeIndex=" + activeIndex); // @DEV_ONLY
-          var tabGroup = jQuery(this).parents(".tobago-tabGroup:first");
-          Tobago.submitAction(tabGroup.eq(0), tabGroup.attr("id"));
-        })
+  // setting the active index
+  tabGroups.each(function () {
+    jQuery(this).find(".tobago-tabGroup-header").first().children(".tobago-tab").not(".tobago-tab-markup-disabled")
+        .click(function () {
+      // Update the hidden field for the active index.
+      var tab = jQuery(this);
+      var tabGroup = tab.parents(".tobago-tabGroup:first");
+      var hidden = tabGroup.children("input");
+      var activeIndex = tab.attr("tabgroupindex");
+      hidden.val(activeIndex);
+    })
   });
 
   // initialize previous button
@@ -107,31 +71,11 @@ Tobago.TabGroup.init = function(elements
   });
 
 
-  // initialize menu
-  // XXX ":last" is dangerous, please define e.g. a unique class for "menu"
-//  tabGroups.find(".tobago-tabGroupToolBar-button:last").find(".tobago-menu").click(function()
{
-//    var index = jQuery(this).prevAll().size();
-//    var tabGroup = jQuery(this).parents(".tobago-tabGroup:first");
-//    var selected = tabGroup.find(".tobago-tab").eq(index).click();
-//  });
-
   // XXX hack for webkit to avoid scrollbars in box
 //  jQuery('.tobago-tabGroup').hide();
 //  jQuery('.tobago-tabGroup').show();
 };
 
-/**
- * Update the hidden field for the active index.
- * @param tab is a jQuery object which represents the clicked tab area.
- */
-Tobago.TabGroup.updateHidden = function(tab) {
-  var tabGroup = tab.parents(".tobago-tabGroup:first");
-  var hidden = tabGroup.children("input");
-  var activeIndex = tab.attr("tabgroupindex");
-  hidden.val(activeIndex);
-  return activeIndex;
-};
-
 Tobago.TabGroup.ensureScrollPosition = function (header) {
   var tab = header.find(".tobago-tab-markup-selected");
   if (tab.length > 0) {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js?rev=1772208&r1=1772207&r2=1772208&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
Thu Dec  1 14:02:10 2016
@@ -27,7 +27,7 @@ Tobago.Tree.toggleNode = function(elemen
   if (Tobago.Tree.isExpanded(node, expanded)) {
     Tobago.Tree.hideChildren(node);
     toggle.each(function() {
-      src = jQuery(this).data("tobago-src-close");
+      src = jQuery(this).data("tobago-src-closed");
       if (src == null) { // use the open icon if there is no close icon
         src = jQuery(this).data("tobago-src-open");
       }
@@ -53,7 +53,7 @@ Tobago.Tree.toggleNode = function(elemen
       toggle.each(function() {
         src = jQuery(this).data("tobago-src-open");
         if (src == null) { // use the close icon if there is no open icon
-          src = jQuery(this).data("tobago-src-close");
+          src = jQuery(this).data("tobago-src-closed");
         }
         jQuery(this).attr("src", src);
       });

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1772208&r1=1772207&r2=1772208&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Thu Dec  1 14:02:10 2016
@@ -159,12 +159,6 @@ var Tobago = {
       }
     }
 
-    console.time("[tobago] applicationOnload"); // @DEV_ONLY
-    if (this.applicationOnload) {
-      this.applicationOnload();
-    }
-    console.timeEnd("[tobago] applicationOnload"); // @DEV_ONLY
-
     console.timeEnd("[tobago] init"); // @DEV_ONLY
   },
 
@@ -227,12 +221,6 @@ var Tobago = {
       }
     }
 
-    // deprecated:
-    if (this.isSubmit && this.applicationOnunload) {
-      this.applicationOnunload();
-    } else if (!this.isSubmit && this.applicationOnexit) {
-      this.applicationOnexit();
-    }
     this.destroyObjects();
   },
 
@@ -389,45 +377,61 @@ var Tobago = {
     Tobago.reloadTimer[id] = setTimeout(func, time);
   },
 
-  initCommand: function(command) {
+  initCommand: function(element) {
     // command is jQuery object
     // setupInputFacetCommand
-    var commands = command.data("tobago-commands");
+    var commands = element.data("tobago-commands");
 
+    var normalEvents = []; // todo: find a better way to do that in JS
     if (commands.click) {
-      command.click(function (event) {
-        var confirmation = commands.click.confirmation;
+      normalEvents.push({event: "click", command: commands.click});
+    }
+    if (commands.dblclick) {
+      normalEvents.push({event: "dblclick", command: commands.dblclick});
+    }
+    if (commands.focus) {
+      normalEvents.push({event: "focus", command: commands.focus});
+    }
+    if (commands.blur) {
+      normalEvents.push({event: "blur", command: commands.blur});
+    }
+
+    for (var i in normalEvents) {
+
+      element.on(normalEvents[i].event, {command: normalEvents[i].command}, function (event)
{
+        var command = event.data.command;
+        var confirmation = command.confirmation;
         if (confirmation != null) {
           if (!confirm(confirmation)) {
             event.preventDefault();
             return;
           }
         }
-        var collapse = commands.click.collapse;
+        var collapse = command.collapse;
         if (collapse) {
           Tobago.Collapse.execute(collapse);
         }
 
-        if (commands.click.omit != true) {
-          var popup = commands.click.popup;
+        if (command.omit != true) {
+          var popup = command.popup;
           if (popup && popup.command == "close" && popup.immediate) {
             Tobago.Popup.close(this);
           } else {
-            var action = commands.click.action ? commands.click.action : jQuery(this).attr("id");
-            if (commands.click.execute || commands.click.render) {
-              Tobago.preparePartialOverlay(commands.click);
+            var action = command.action ? command.action : jQuery(this).attr("id");
+            if (command.execute || command.render) {
+              Tobago.preparePartialOverlay(command);
               jsf.ajax.request(
-                  jQuery(this).attr("id"),
+                  action,
                   event,
                   {
-                    "javax.faces.behavior.event": "click",
-                    execute: commands.click.execute,
-                    render: commands.click.render
+                    "javax.faces.behavior.event": event.type,
+                    execute: command.execute,
+                    render: command.render
                   });
               event.preventDefault();
               event.stopPropagation();
             } else {
-              Tobago.submitAction(this, action, commands.click);
+              Tobago.submitAction(this, action, command);
             }
             if (popup && popup.command == "close") {
               Tobago.Popup.close(this);
@@ -437,7 +441,7 @@ var Tobago = {
       });
     }
     if (commands.change) {
-      command.change(function(event) {
+      element.change(function(event) {
         if (commands.change.execute || commands.change.render) {
           jsf.ajax.request(
               jQuery(this).attr("name"),
@@ -453,17 +457,19 @@ var Tobago = {
       });
     }
     if (commands.complete) {
-      if (commands.complete.execute || commands.complete.render) {
-        jsf.ajax.request(
-            jQuery(this).attr("id"),
-            null,
-            {
-              "javax.faces.behavior.event": "complete",
-              execute: commands.complete.execute,
-              render: commands.complete.render
-            });
-      } else {
-        Tobago.submitAction(this, commands.complete.action, commands.complete);
+      if (element.val() >= parseFloat(element.attr("max"))) {
+        if (commands.complete.execute || commands.complete.render) {
+          jsf.ajax.request(
+              jQuery(this).attr("id"),
+              null,
+              {
+                "javax.faces.behavior.event": "complete",
+                execute: commands.complete.execute,
+                render: commands.complete.render
+              });
+        } else {
+          Tobago.submitAction(this, commands.complete.action, commands.complete);
+        }
       }
     }
     if (commands.load) {
@@ -1108,47 +1114,6 @@ Tobago.Transport = {
   }
 };
 
-// -------- ToolBar ----------------------------------------------------
-
-Tobago.ToolBar = {};
-
-/**
- * Initializes the tool bars.
- * @param elements  a jQuery object to initialize (ajax) or null for initializing the whole
document (full load).
- */
-Tobago.ToolBar.init = function(elements) {
-
-  Tobago.Utils.selectWithJQuery(elements, ".tobago-tabGroup-toolBar")
-      .find(".tobago-menu[data-tobago-index]").each(function () {
-        var menu = jQuery(this);
-        menu.data("tobago-tabGroup", menu.closest(".tobago-tabGroup"));
-        menu.click(function (event) {
-          var menu = jQuery(this);
-          var tabGroup = menu.data("tobago-tabGroup");
-          var tab = tabGroup.find(".tobago-tab[tabgroupindex=" + menu.data("tobago-index")
+ "]");
-          tab.click();
-          event.stopPropagation();
-        })
-      });
-
-  Tobago.Utils.selectWithJQuery(elements, ".tobago-toolBar-selectOne").find(".tobago-toolBar-button")
-      .click(function () {
-        var button = jQuery(this);
-        var hidden = button.closest(".tobago-toolBar-selectOne").children("input[type=hidden]");
-        hidden.val(button.data("tobago-value"));
-      });
-
-  Tobago.Utils.selectWithJQuery(elements, ".tobago-toolBar-selectBoolean").find(".tobago-toolBar-button")
-      .click(function () {
-        var button = jQuery(this);
-        var hidden = button.closest(".tobago-toolBar-selectBoolean").children("input[type=hidden]");
-        hidden.val(hidden.val() == "true" ? "false" : "true");
-      });
-};
-
-Tobago.registerListener(Tobago.ToolBar.init, Tobago.Phase.DOCUMENT_READY);
-Tobago.registerListener(Tobago.ToolBar.init, Tobago.Phase.AFTER_UPDATE);
-
 // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Commands
 



Mime
View raw message