about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGeorg Lukas <georg@op-co.de>2017-04-03 16:48:27 +0200
committerGeorg Lukas <georg@op-co.de>2017-04-03 16:48:27 +0200
commit19405cb5c738f5f8497f863e9434b431084ba06c (patch)
tree642160120dc4a78ab1eac9b32d762fa670945286
parent518788dedf4f06dae6faaac29c17fac26ea24f79 (diff)
downloadphp-xmpp-invitation-19405cb5c738f5f8497f863e9434b431084ba06c.tar.gz
Provide both URL-encoded and 'plain' JID from hash parser
-rw-r--r--scripts/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/main.js b/scripts/main.js
index 8a79b4f..2cb124c 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -56,9 +56,9 @@
 
 		var jid_parts = jid.split("?");
 		jid_parts[0] = encodeURIComponent(jid_parts[0]) // URL-encode the JID only
-		jid = jid_parts.join("?");
+		var jid_encoded = jid_parts.join("?");
 
-		return {jid: jid, name: name};
+		return {jid: jid, jid_encoded: jid_encoded, name: name};
 	}
 
 	function translate_ui() {
@@ -76,7 +76,7 @@
 
 	function rehash() {
 		display_data = load_hash();
-		document.getElementById('button').href = "xmpp:" + display_data.jid;
+		document.getElementById('button').href = "xmpp:" + display_data.jid_encoded;
 		document.getElementById('url_in').value = "xmpp:" + display_data.jid;
 		translate_ui();
 	}