web-manager 3.1.11 → 3.1.12
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/README.md +8 -0
- package/lib/utilities.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -212,6 +212,8 @@ The Web Manager .utilities() API wraps some useful functions such as getting and
|
|
212
212
|
```html
|
213
213
|
<script type="text/javascript">
|
214
214
|
console.log('--- Exploring the .utilities() API ---');
|
215
|
+
|
216
|
+
// .get() and .set()
|
215
217
|
Manager.ready(function() {
|
216
218
|
var object = {
|
217
219
|
key1: 'val1',
|
@@ -234,6 +236,12 @@ The Web Manager .utilities() API wraps some useful functions such as getting and
|
|
234
236
|
console.log('Root object (final)', Manager.utilities().get(object)); // Get whole object a final time
|
235
237
|
|
236
238
|
});
|
239
|
+
|
240
|
+
// .clipboardCopy()
|
241
|
+
Manager.utilities().clipboardCopy('I am copied to the clipboard!')
|
242
|
+
|
243
|
+
// .escapeHTML()
|
244
|
+
Manager.utilities().escapeHTML('<strong>This will will NOT render as bold!</strong>')
|
237
245
|
</script>
|
238
246
|
```
|
239
247
|
|
package/lib/utilities.js
CHANGED
@@ -75,7 +75,7 @@ Utilities.clipboardCopy = function (input) {
|
|
75
75
|
|
76
76
|
// Escape HTML
|
77
77
|
Utilities.escapeHTML = function (string) {
|
78
|
-
return string.replace(/[&<>"'`=\/]/g, function (s) {
|
78
|
+
return (string || '').replace(/[&<>"'`=\/]/g, function (s) {
|
79
79
|
return htmlEscapeMap[s];
|
80
80
|
});
|
81
81
|
}
|
package/package.json
CHANGED