You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2011/02/02 23:05:40 UTC

svn commit: r1066657 - /myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Author: bommel
Date: Wed Feb  2 22:05:39 2011
New Revision: 1066657

URL: http://svn.apache.org/viewvc?rev=1066657&view=rev
Log:
(TOBAGO-969) Support for redirect in the ajax case
(TOBAGO-965) Setting focus in popup does not work anymore with IE*

Modified:
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/branches/tobago-1.0.x/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.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1066657&r1=1066656&r2=1066657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Feb  2 22:05:39 2011
@@ -1025,7 +1025,7 @@ var Tobago = {
             element.disabled = true;
             hidden.value += element.id + ",";
           } else {
-            if (firstPopupElement == null && Tobago.isFunction(element.focus)) {
+            if (firstPopupElement == null && element.focus) {
               firstPopupElement = element;
             }
           }
@@ -1041,7 +1041,7 @@ var Tobago = {
             anchor.disabled = true;
             hidden.value += anchor.id + ",";
           } else {
-            if (firstPopupElement == null && Tobago.isFunction(anchor.focus)) {
+            if (firstPopupElement == null && anchor.focus) {
               firstPopupElement = anchor;
             }
           }
@@ -2207,6 +2207,8 @@ Tobago.Updater = {
 
   CODE_RELOAD_REQUIRED: "<status code=\"309\"/>",
 
+  CODE_REDIRECT: "<redirect url=\"",
+
   UPDATE_TIMEOUT: 5000,  // Five seconds
 
   options: {
@@ -2223,6 +2225,10 @@ Tobago.Updater = {
       if (transport.status == 304) {
         LOG.debug("skip update response status 304");
         receiver.skipUpdate = true;
+      } else if (response.substring(0, Tobago.Updater.CODE_REDIRECT.length) == Tobago.Updater.CODE_REDIRECT)  {
+        var url = response.substring(Tobago.Updater.CODE_REDIRECT.length);
+        url = url.substring(0, url.indexOf('\"'));
+        window.location = url;
       } else if (response.substring(0, Tobago.Updater.CODE_NOT_MODIFIED.length) == Tobago.Updater.CODE_NOT_MODIFIED) {
         // no update needed, do nothing
         LOG.debug("skip update");
@@ -2271,7 +2277,7 @@ Tobago.Updater = {
       if (options) {
         Tobago.extend(requestOptions, options);
       }
-
+      // TODO should isFunction used?
       if (Tobago.isFunction(requestOptions.createOverlay)) {
         Tobago.createOverlay(container);
         if (requestOptions.onFailure === undefined) {