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 18:32:23 UTC

svn commit: r1497834 - in /myfaces/tobago/trunk: 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/test/attribute/ tobago-e...

Author: lofwyr
Date: Fri Jun 28 16:32:22 2013
New Revision: 1497834

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

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

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/script.xhtml Fri Jun 28 16:32:22 2013
@@ -62,10 +62,10 @@
           }
         });
 
-        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 == -1) {
           LOG.error("Script for theme 'standard' not found!");

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/resource-manager/tobago1134.xhtml Fri Jun 28 16:32:22 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/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js Fri Jun 28 16:32:22 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/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/mode-valueIfSet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/mode-valueIfSet.xhtml?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/mode-valueIfSet.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/attribute/mode-valueIfSet.xhtml Fri Jun 28 16:32:22 2013
@@ -107,16 +107,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/trunk/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tx/id-and-fieldId.xhtml Fri Jun 28 16:32:22 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/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-calendar.js Fri Jun 28 16:32:22 2013
@@ -250,7 +250,7 @@ Tobago.Calendar.getDateField = function 
 Tobago.Calendar.initFromDateField = function (calendar) {
   var dateField = Tobago.Calendar.getDateField(calendar);
   var pattern = dateField.data("tobago-pattern");
-  var value = dateField.attr("value");
+  var value = dateField.val();
   var date = new Date(getDateFromFormat(value, pattern));
   if (date.getTime() == 0) {
     date = new Date();

Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1497834&r1=1497833&r2=1497834&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Fri Jun 28 16:32:22 2013
@@ -2641,7 +2641,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;
 };
 
@@ -2932,7 +2932,7 @@ Tobago.File.init = function(elements) {
     if (pos >= 0) {
       filename = filename.substr(pos + 1);
     }
-    pretty.attr('value', filename);
+    pretty.val(filename);
   });
   if (files.length > 0) {
     jQuery("form").attr('enctype', 'multipart/form-data')