[Pkg-javascript-commits] [sockjs-client] 113/434: Do pass fourth parameter to the iframe-enabled transports - base_url.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit c6be65bcf26111e94a991330ed24f6bfba3fce62
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Thu Sep 1 17:27:12 2011 +0100

    Do pass fourth parameter to the iframe-enabled transports - base_url.
---
 lib/trans-iframe-within.js | 3 ++-
 lib/trans-iframe.js        | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/trans-iframe-within.js b/lib/trans-iframe-within.js
index bf76afe..630257a 100644
--- a/lib/trans-iframe-within.js
+++ b/lib/trans-iframe-within.js
@@ -37,13 +37,14 @@ SockJS.bootstrap_iframe = function() {
             var version = p[0];
             var protocol = p[1];
             var trans_url = p[2];
+            var base_url = p[3];
             if (version !== SockJS.version) {
                 utils.log("Incompatibile SockJS! Main site uses:" +
                           " \"" + version + "\", the iframe:" +
                           " \"" + SockJS.version + "\".");
             }
             facade = new FacadeJS();
-            facade._transport = new FacadeJS[protocol](facade, trans_url);
+            facade._transport = new FacadeJS[protocol](facade, trans_url, base_url);
             break;
         case 'm':
             facade._doSend(data);
diff --git a/lib/trans-iframe.js b/lib/trans-iframe.js
index 4f7e306..07b2136 100644
--- a/lib/trans-iframe.js
+++ b/lib/trans-iframe.js
@@ -12,6 +12,7 @@ IframeTransport.prototype.i_constructor = function(ri, trans_url, base_url) {
     var that = this;
     that.ri = ri;
     that.origin = utils.getOrigin(base_url);
+    that.base_url = base_url;
     that.trans_url = trans_url;
 
     var iframe_url = base_url + '/iframe.html';
@@ -62,7 +63,7 @@ IframeTransport.prototype.onmessage = function(e) {
     switch(type) {
     case 's':
         that.iframeObj.loaded();
-        that.postMessage('s', JSON.stringify([SockJS.version, that.protocol, that.trans_url]));
+        that.postMessage('s', JSON.stringify([SockJS.version, that.protocol, that.trans_url, that.base_url]));
         break;
     case 't':
         that.ri._didMessage(data);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list