web-manager 3.1.24 → 3.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/account.js +1 -5
- package/lib/utilities.js +28 -13
- package/package.json +1 -1
package/lib/account.js
CHANGED
@@ -398,13 +398,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
398
398
|
billingUpdateBtn.setAttribute('hidden', true);
|
399
399
|
|
400
400
|
if (planIsActive) {
|
401
|
-
updateURL.searchParams.set('appName', utilities.get(self.Manager, 'properties.global.brand.name', 'Unknown'));
|
402
|
-
updateURL.searchParams.set('supportUrl', currentURL.origin + '/support');
|
403
|
-
updateURL.searchParams.set('supportEmail', utilities.get(self.Manager, 'properties.contact.emailSupport', 'unknown@email.com'));
|
404
|
-
updateURL.searchParams.set('userEmail', firebaseUser.email);
|
405
|
-
updateURL.searchParams.set('userId', firebaseUser.uid);
|
406
401
|
updateURL.searchParams.set('orderId', account.plan.payment.orderId);
|
407
402
|
updateURL.searchParams.set('resourceId', account.plan.payment.resourceId);
|
403
|
+
|
408
404
|
billingUpdateBtn.removeAttribute('hidden').setAttribute('href', updateURL.toString());
|
409
405
|
} else {
|
410
406
|
billingSubscribeBtn.removeAttribute('hidden');
|
package/lib/utilities.js
CHANGED
@@ -1,16 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
*/
|
3
3
|
|
4
|
-
var
|
5
|
-
'&': '&',
|
6
|
-
'<': '<',
|
7
|
-
'>': '>',
|
8
|
-
'"': '"',
|
9
|
-
"'": ''',
|
10
|
-
'/': '/',
|
11
|
-
'`': '`',
|
12
|
-
'=': '='
|
13
|
-
};
|
4
|
+
var shadow;
|
14
5
|
|
15
6
|
function Utilities(utilObj) {
|
16
7
|
this.utilities = utilObj;
|
@@ -74,9 +65,33 @@ Utilities.clipboardCopy = function (input) {
|
|
74
65
|
}
|
75
66
|
|
76
67
|
// Escape HTML
|
77
|
-
|
78
|
-
|
79
|
-
|
68
|
+
// https://stackoverflow.com/questions/6234773/can-i-escape-html-special-chars-in-javascript
|
69
|
+
// Utilities.escapeHTML = function (str) {
|
70
|
+
// shadow = shadow || document.createElement('div');
|
71
|
+
// shadow.textContent = str;
|
72
|
+
|
73
|
+
// return shadow.textContent.replace(/["']/g, function(m) {
|
74
|
+
// switch (m) {
|
75
|
+
// case '"':
|
76
|
+
// return '"';
|
77
|
+
// default:
|
78
|
+
// return ''';
|
79
|
+
// }
|
80
|
+
// });
|
81
|
+
// }
|
82
|
+
|
83
|
+
Utilities.escapeHTML = function (str) {
|
84
|
+
shadow = shadow || document.createElement('p');
|
85
|
+
shadow.innerHTML = '';
|
86
|
+
shadow.appendChild(document.createTextNode(str));
|
87
|
+
|
88
|
+
return shadow.innerHTML.replace(/["']/g, function(m) {
|
89
|
+
switch (m) {
|
90
|
+
case '"':
|
91
|
+
return '"';
|
92
|
+
default:
|
93
|
+
return ''';
|
94
|
+
}
|
80
95
|
});
|
81
96
|
}
|
82
97
|
|
package/package.json
CHANGED