summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn <shawn@qwil.io>2021-09-17 23:38:48 +0100
committerShawn <shawn@qwil.io>2021-09-17 23:38:48 +0100
commit79ea47bc78f58d7c614e93abf3eadb97a001961d (patch)
tree6227e5e6379a57156ab2c30f17edbcde8493af87
parentb1dcd02a3122e4ace4d6d1faa61a9efd321d3335 (diff)
Do not URI encode unless we have to
-rw-r--r--index.html10
-rw-r--r--jitsi_url_generator.js8
2 files changed, 9 insertions, 9 deletions
diff --git a/index.html b/index.html
index 9e44dbe..8763b15 100644
--- a/index.html
+++ b/index.html
@@ -54,14 +54,14 @@
let email = $userInfoEmail.val().trim();
if (displayName) {
- paramGroup['userInfo.displayName'] = '"' + displayName + '"';
+ paramGroup['userInfo.displayName'] = '"' + encodeURIComponent(displayName) + '"';
}
if (email) {
- paramGroup['userInfo.email'] = '"' + email + '"';
+ paramGroup['userInfo.email'] = '"' + encodeURIComponent(email) + '"';
}
- $codeUserInfo.text(encodeParamGroup(paramGroup).join('&'));
+ $codeUserInfo.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('userInfo', paramGroup);
}
@@ -94,7 +94,7 @@
paramGroup['config.notifications'] = '[]';
}
- $codeFeatures.text(encodeParamGroup(paramGroup).join('&'));
+ $codeFeatures.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('features', paramGroup);
}
@@ -153,7 +153,7 @@
paramGroup['config.toolbarButtons'] = (selected.length === 0) ? '[]' : '["' + selected.join('","') + '"]';
}
- $codeToolbar.text(encodeParamGroup(paramGroup).join('&'));
+ $codeToolbar.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('toolbar', paramGroup);
}
diff --git a/jitsi_url_generator.js b/jitsi_url_generator.js
index e801206..9f7af08 100644
--- a/jitsi_url_generator.js
+++ b/jitsi_url_generator.js
@@ -14,7 +14,7 @@ JitsiUrlGenerator.prototype.trigger = function () {
let params = [];
for (let group of Object.values(this.paramGroups)) {
- params = params.concat(encodeParamGroup(group));
+ params = params.concat(flattenParamGroup(group));
}
let url = "https://" + this.domain + "/" + this.roomName;
@@ -51,12 +51,12 @@ function makeUrlGenerator(callback, domain, roomName, paramGroup) {
}
-function encodeParamGroup(group) {
+function flattenParamGroup(group) {
let params = [];
for (let p in group) {
if (group.hasOwnProperty(p)) {
- params.push(encodeURIComponent(p) + '=' + encodeURIComponent(group[p]));
+ params.push(p + '=' + group[p]);
}
}
return params;
-} \ No newline at end of file
+}