Author: lindner
Date: Fri May 16 16:44:45 2008
New Revision: 657252

URL: http://svn.apache.org/viewvc?rev=657252&view=rev
Log:
Incorporate patch from Santiago Gala to move the url= parameter to the end
Reviewed by Paul Lindner
Fixes SHINDIG-189

Modified:
    
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/UrlGenerator.java
    incubator/shindig/trunk/javascript/container/gadgets.js

Modified: 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/UrlGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/UrlGenerator.java?rev=657252&r1=657251&r2=657252&view=diff
==============================================================================
--- 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/UrlGenerator.java
 (original)
+++ 
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/UrlGenerator.java
 Fri May 16 16:44:45 2008
@@ -119,10 +119,7 @@
           break;
         case HTML:
         default:
-          buf.append(iframePrefix)
-             .append("url=")
-             .append(URLEncoder.encode(url, "UTF-8"))
-             .append("&");
+          buf.append(iframePrefix);
           break;
       }
       buf.append("container=").append(context.getContainer());
@@ -148,6 +145,11 @@
         buf.append("&up_").append(URLEncoder.encode(pref.getName(), "UTF-8"))
            .append("=").append(URLEncoder.encode(value, "UTF-8"));
       }
+      // add url last to work around browser bugs
+      if(!type.equals(View.ContentType.URL)) {
+          buf.append("&url=")
+             .append(URLEncoder.encode(url, "UTF-8"));
+        }
     } catch (UnsupportedEncodingException e) {
       throw new RuntimeException("UTF-8 Not supported!", e);
     }

Modified: incubator/shindig/trunk/javascript/container/gadgets.js
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/gadgets.js?rev=657252&r1=657251&r2=657252&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/gadgets.js (original)
+++ incubator/shindig/trunk/javascript/container/gadgets.js Fri May 16 16:44:45 
2008
@@ -534,8 +534,7 @@
 
 gadgets.IfrGadget.prototype.getIframeUrl = function() {
   return this.serverBase_ + 'ifr?' +
-      'url=' + encodeURIComponent(this.specUrl) +
-      '&container=' + this.CONTAINER +
+      'container=' + this.CONTAINER +
       '&mid=' +  this.id +
       '&nocache=' + gadgets.container.nocache_ +
       '&country=' + gadgets.container.country_ +
@@ -546,6 +545,7 @@
       (this.debug ? '&debug=1' : '') +
       this.getAdditionalParams() +
       this.getUserPrefsParams() +
+      '&url=' + encodeURIComponent(this.specUrl) + 
       '#rpctoken=' + this.rpcToken +
       (this.secureToken ? '&st=' + this.secureToken : '') +
       (this.viewParams ?
@@ -587,8 +587,8 @@
     };
 
     var script = document.createElement('script');
-    script.src = 'http://gmodules.com/ig/gadgetsettings?url=' + this.specUrl +
-        '&mid=' + this.id + '&output=js' + this.getUserPrefsParams();
+    script.src = 'http://gmodules.com/ig/gadgetsettings?mid=' + this.id +
+        '&output=js' + this.getUserPrefsParams() +  '&url=' + this.specUrl;
     document.body.appendChild(script);
   }
 };


Reply via email to