Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B85C200BD4 for ; Thu, 1 Dec 2016 15:02:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2A259160B0F; Thu, 1 Dec 2016 14:02:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00C01160B0B for ; Thu, 1 Dec 2016 15:02:22 +0100 (CET) Received: (qmail 9834 invoked by uid 500); 1 Dec 2016 14:02:22 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 9815 invoked by uid 99); 1 Dec 2016 14:02:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2016 14:02:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AF284C1372 for ; Thu, 1 Dec 2016 14:02:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XteMT1ot58Jy for ; Thu, 1 Dec 2016 14:02:14 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C5F5A5F47D for ; Thu, 1 Dec 2016 14:02:13 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4764DE0253 for ; Thu, 1 Dec 2016 14:02:12 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id F065A3A0056 for ; Thu, 1 Dec 2016 14:02:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@myfaces.apache.org From: lofwyr@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161201140210.F065A3A0056@svn01-us-west.apache.org> archived-at: Thu, 01 Dec 2016 14:02:24 -0000 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