[Pkg-owncloud-commits] [owncloud] 112/394: check whether to join url with ? or &

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:11:40 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 54352fe56610ecc179f69c378a78989848070639
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Fri Nov 16 20:28:03 2012 +0100

    check whether to join url with ? or &
---
 core/js/eventsource.js |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/core/js/eventsource.js b/core/js/eventsource.js
index 6d5ba32..4f4515f 100644
--- a/core/js/eventsource.js
+++ b/core/js/eventsource.js
@@ -42,7 +42,13 @@ OC.EventSource=function(src,data){
 	}
 	dataStr+='requesttoken='+OC.Request.Token;
 	if(!this.useFallBack && typeof EventSource !='undefined'){
-		this.source=new EventSource(src+'&'+dataStr);
+		var joinChar = '&';
+		if(src.indexOf('?') == -1) {
+			joinChar = '?';
+		}
+		alert(src.indexOf('?'));
+		alert(joinChar);
+		this.source=new EventSource(src+joinChar+dataStr);
 		this.source.onmessage=function(e){
 			for(var i=0;i<this.typelessListeners.length;i++){
 				this.typelessListeners[i](JSON.parse(e.data));
@@ -54,7 +60,12 @@ OC.EventSource=function(src,data){
 		this.iframe=$('<iframe/>');
 		this.iframe.attr('id',iframeId);
 		this.iframe.hide();
-		this.iframe.attr('src',src+'&fallback=true&fallback_id='+OC.EventSource.iframeCount+'&'+dataStr);
+
+		var joinChar = '&';
+		if(src.indexOf('?') == -1) {
+			joinChar = '?';
+		}
+		alert(src.indexOf('?'));	this.iframe.attr('src',src+joinChar+'fallback=true&fallback_id='+OC.EventSource.iframeCount+'&'+dataStr);
 		$('body').append(this.iframe);
 		this.useFallBack=true;
 		OC.EventSource.iframeCount++

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



More information about the Pkg-owncloud-commits mailing list