From 19405cb5c738f5f8497f863e9434b431084ba06c Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Mon, 3 Apr 2017 16:48:27 +0200 Subject: Provide both URL-encoded and 'plain' JID from hash parser --- scripts/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') 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(); } -- cgit 1.4.1