web-manager 3.2.64 → 3.2.66

Sign up to get free protection for your applications and to get access to all the features.
package/lib/account.js CHANGED
@@ -478,6 +478,10 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
478
478
  account.personal.telephone.countryCode = account.personal.telephone.countryCode || 0;
479
479
  account.personal.telephone.national = account.personal.telephone.national || 0;
480
480
 
481
+ account.personal.company = account.personal.company || {};
482
+ account.personal.company.name = account.personal.company.name || '';
483
+ account.personal.company.position = account.personal.company.position || '';
484
+
481
485
  // Set UI elements
482
486
  // In a try/catch because this lib is used in node sometimes
483
487
  try {
package/lib/utilities.js CHANGED
@@ -76,17 +76,32 @@ Utilities.set = function (obj, path, value) {
76
76
  // https://dzone.com/articles/cross-browser-javascript-copy-and-paste
77
77
  // https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
78
78
  Utilities.clipboardCopy = function (input) {
79
- var el = document.createElement('textarea');
80
- el.setAttribute('style','width:1px;border:0;opacity:0;');
81
- el.value = input && input.nodeType ? input.value || input.innerText || input.innerHTML : input;
82
- document.body.appendChild(el);
83
- el.select();
79
+ // Get the text from the input
80
+ var text = input && input.nodeType
81
+ ? input.value || input.innerText || input.innerHTML
82
+ : input;
83
+
84
+ // Try to use the modern clipboard API
84
85
  try {
85
- document.execCommand('copy');
86
+ navigator.clipboard.writeText(text);
86
87
  } catch (e) {
87
- alert('Please press Ctrl/Cmd+C to copy');
88
+ // Try creating a textarea and copying the text to it
89
+ var el = document.createElement('textarea');
90
+ el.setAttribute('style','width:1px;border:0;opacity:0;');
91
+ el.value = text;
92
+ document.body.appendChild(el);
93
+ el.select();
94
+
95
+ // Try to copy the text
96
+ try {
97
+ document.execCommand('copy');
98
+ } catch (e) {
99
+ alert('Please press Ctrl+C/Cmd+C to copy');
100
+ }
101
+
102
+ // Remove the textarea
103
+ document.body.removeChild(el);
88
104
  }
89
- document.body.removeChild(el);
90
105
  }
91
106
 
92
107
  // Escape HTML
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.64",
3
+ "version": "3.2.66",
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": {