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 2013/06/28 16:22:43 UTC

svn commit: r1497788 - in /myfaces/tobago/branches/tobago-1.5.x: tobago-example/tobago-example-test/src/main/webapp/resource-manager/ tobago-example/tobago-example-test/src/main/webapp/script/ tobago-example/tobago-example-test/src/main/webapp/tc/attri...

Author: lofwyr
Date: Fri Jun 28 14:22:43 2013
New Revision: 1497788

URL: http://svn.apache.org/r1497788
Log:
TOBAGO-1177: Update jQuery to 1.10.1
 - using method jQuery.val() instead of jQuery.attr("value")

Modified:
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/mode-valueIfSet.xhtml
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml Fri Jun 28 14:22:43 2013
@@ -40,10 +40,10 @@
         var posScarborough = jQuery("head>script[src='/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago.js']").prevAll().size();
         var posApp = jQuery("head>script[src='/script/tobago.js']").prevAll().size();
 
-        jQuery(Tobago.Utils.escapeClientId("page:standard")).attr('value', posStandard);
-        jQuery(Tobago.Utils.escapeClientId("page:standardApp")).attr('value', posStandardApp);
-        jQuery(Tobago.Utils.escapeClientId("page:scarborough")).attr('value', posScarborough);
-        jQuery(Tobago.Utils.escapeClientId("page:application")).attr('value', posApp);
+        jQuery(Tobago.Utils.escapeClientId("page:standard")).val(posStandard);
+        jQuery(Tobago.Utils.escapeClientId("page:standardApp")).val(posStandardApp);
+        jQuery(Tobago.Utils.escapeClientId("page:scarborough")).val(posScarborough);
+        jQuery(Tobago.Utils.escapeClientId("page:application")).val(posApp);
 
         if (posStandard >= posStandardApp) {
           LOG.error("Script for theme 'standard' must be included before the application specific script of 'standard'!");

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml Fri Jun 28 14:22:43 2013
@@ -25,7 +25,7 @@
 
     <tc:script onload="check()">
       function check() {
-        var value = jQuery(Tobago.Utils.escapeClientId("page:in")).attr("value");
+        var value = jQuery(Tobago.Utils.escapeClientId("page:in")).val();
         if ("666px" != value) {
           LOG.error("value not == 666px");
         }

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js Fri Jun 28 14:22:43 2013
@@ -82,6 +82,9 @@ var TobagoAssert = {
   },
 
   assertAttribute:function (elementOrId, attribute, expected) {
+    if ("value" == attribute) {
+      LOG.error("The assertAttribute() is not allowed for the value attribute, please use assertValue() instead.");
+    }
     var element = TobagoAssert.jQueryElement(elementOrId);
     if (element.attr(attribute) != expected) {
       LOG.error("The attribute '" + attribute + "' of element with id=" + element.attr('id')
@@ -89,6 +92,14 @@ var TobagoAssert = {
     }
   },
 
+  assertValue:function (elementOrId, expected) {
+    var element = TobagoAssert.jQueryElement(elementOrId);
+    if (element.val() != expected) {
+      LOG.error("The value of element with id=" + element.attr('id')
+          + " is '" + element.val() + "', but expected was '" + expected + "'.");
+    }
+  },
+
   assertContent:function (elementOrId, expected) {
     var element = TobagoAssert.jQueryElement(elementOrId);
     if (element.html() != expected) {

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/mode-valueIfSet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/mode-valueIfSet.xhtml?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/mode-valueIfSet.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/attribute/mode-valueIfSet.xhtml Fri Jun 28 14:22:43 2013
@@ -108,16 +108,16 @@
 
         // only to display
         jQuery("#page\\:id-box input").each(function() {
-          jQuery(this).attr('value', (jQuery(this).attr('id')));
+          jQuery(this).val(jQuery(this).attr('id'));
         });
 
         // assertions
-        TobagoAssert.assertAttribute("page:direct", "value", "direct literal");
-        TobagoAssert.assertAttribute("page:v1", "value", "from var");
-        TobagoAssert.assertAttribute("page:v2", "value", "from var");
-        TobagoAssert.assertAttribute("page:v3", "value", "from var ++");
-        TobagoAssert.assertAttribute("page:v4", "value", "value from model");
-        TobagoAssert.assertAttribute("page:vu", "value", "");
+        TobagoAssert.assertValue("page:direct", "direct literal");
+        TobagoAssert.assertValue("page:v1", "from var");
+        TobagoAssert.assertValue("page:v2", "from var");
+        TobagoAssert.assertValue("page:v3", "from var ++");
+        TobagoAssert.assertValue("page:v4", "value from model");
+        TobagoAssert.assertValue("page:vu", "");
 
         var i1 = jQuery(Tobago.Utils.escapeClientId("page:id-box")).find("input:eq(0)");
         TobagoAssert.assertAttribute(i1, "id", "page:my_number_1");

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml Fri Jun 28 14:22:43 2013
@@ -183,14 +183,14 @@
         var label = panel.children(".tobago-label");
         var field = panel.children(fieldClass);
 
-        panelIn.attr("value", panel.attr("id"));
-        labelIn.attr("value", label.attr("id"));
-        fieldIn.attr("value", field.attr("id"));
+        panelIn.val(panel.attr("id"));
+        labelIn.val(label.attr("id"));
+        fieldIn.val(field.attr("id"));
       }
 
       function test(testId, expected) {
         var element = jQuery(Tobago.Utils.escapeClientId(testId));
-        if (element.attr("value") != expected) {
+        if (element.val() != expected) {
           element.addClass("tobago-in-markup-error");
           element.attr("title", "expected: '" + expected + "'");
         }

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-tree.js Fri Jun 28 14:22:43 2013
@@ -22,7 +22,7 @@ Tobago.Tree.toggleNode = function(elemen
   var node = element.closest(".tobago-treeNode, .tobago-treeMenuNode");
   var expanded = node.find(".tobago-treeMenuNode-expanded, .tobago-treeNode-expanded");
   var toggle = node.find(".tobago-treeMenuNode-toggle, .tobago-treeNode-toggle");
-  if ("true" == expanded.attr("value")) {
+  if ("true" == expanded.val()) {
     Tobago.Tree.hideChildren(node);
     toggle.each(function() {
       src = jQuery(this).data("tobago-srcclose");
@@ -32,7 +32,7 @@ Tobago.Tree.toggleNode = function(elemen
       jQuery(this).attr("src", src);
       Tobago.fixPngAlpha(this);
     });
-    expanded.attr("value", "false");
+    expanded.val("false");
     node.filter(".tobago-treeNode").removeClass("tobago-treeNode-markup-expanded");
     node.filter(".tobago-treeMenuNode").removeClass("tobago-treeMenuNode-markup-expanded");
   } else {
@@ -45,7 +45,7 @@ Tobago.Tree.toggleNode = function(elemen
       jQuery(this).attr("src", src);
       Tobago.fixPngAlpha(this);
     });
-    expanded.attr("value", "true");
+    expanded.val("true");
     node.filter(".tobago-treeNode").addClass("tobago-treeNode-markup-expanded");
     node.filter(".tobago-treeMenuNode").addClass("tobago-treeMenuNode-markup-expanded");
   }
@@ -71,7 +71,7 @@ Tobago.Tree.showChildren = function (nod
   children.show().each(function () {
     var child = jQuery(this);
     var expanded = child.find(".tobago-treeMenuNode-expanded, .tobago-treeNode-expanded");
-    if ("true" == expanded.attr("value")) {
+    if ("true" == expanded.val()) {
       Tobago.Tree.showChildren(child);
     }
   });
@@ -146,7 +146,7 @@ Tobago.Tree.init = function(elements) {
     var node = command.parent(".tobago-treeNode");
     var tree = node.closest(".tobago-tree");
     var marked = tree.children(".tobago-tree-marked");
-    marked.attr("value", node.attr("id"));
+    marked.val(node.attr("id"));
     tree.find(".tobago-treeNode").removeClass("tobago-treeNode-markup-marked");
     node.addClass("tobago-treeNode-markup-marked");
   });
@@ -157,7 +157,7 @@ Tobago.Tree.init = function(elements) {
     var node = command.parent(".tobago-treeMenuNode");
     var tree = node.closest(".tobago-treeMenu");
     var marked = tree.children(".tobago-treeMenu-marked");
-    marked.attr("value", node.attr("id"));
+    marked.val(node.attr("id"));
     tree.find(".tobago-treeMenuNode").removeClass("tobago-treeMenuNode-markup-marked");
     node.addClass("tobago-treeMenuNode-markup-marked");
   });

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1497788&r1=1497787&r2=1497788&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Fri Jun 28 14:22:43 2013
@@ -2515,7 +2515,7 @@ Tobago.TabGroup.updateHidden = function(
   var tabGroup = tab.parents(".tobago-tabGroup:first");
   var hidden = tabGroup.children("input");
   var activeIndex = tab.attr("tabgroupindex");
-  hidden.attr("value", activeIndex);
+  hidden.val(activeIndex);
   return activeIndex;
 };