web-manager 3.1.23 → 3.1.25
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -2
- package/lib/utilities.js +28 -13
- package/package.json +2 -2
package/index.js
CHANGED
@@ -474,9 +474,11 @@ function Manager() {
|
|
474
474
|
This.properties.page.status.initializing = true;
|
475
475
|
|
476
476
|
// set other properties
|
477
|
-
This.properties.meta.environment =
|
478
|
-
|
477
|
+
This.properties.meta.environment = window.location.host.match(/:40|ngrok/)
|
478
|
+
? 'development'
|
479
|
+
: 'production';
|
479
480
|
|
481
|
+
// Load polyfills
|
480
482
|
init_loadPolyfills(This, configuration, function() {
|
481
483
|
This.properties.page.status.initializing = false;
|
482
484
|
// This.properties.genericPromise = new Promise(resolve => { resolve() });
|
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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "web-manager",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.25",
|
4
4
|
"description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -28,4 +28,4 @@
|
|
28
28
|
"firebase": "^8.10.1",
|
29
29
|
"lazysizes": "^5.3.2"
|
30
30
|
}
|
31
|
-
}
|
31
|
+
}
|