web-manager 3.2.33 → 3.2.35
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/index.js +19 -14
- package/lib/account.js +12 -0
- package/package.json +2 -2
package/index.js
CHANGED
@@ -133,7 +133,7 @@ function Manager() {
|
|
133
133
|
Manager.prototype.set = function(path, value) {
|
134
134
|
var self = this;
|
135
135
|
|
136
|
-
|
136
|
+
return utilities.set(self, 'properties.' + path, value);
|
137
137
|
}
|
138
138
|
|
139
139
|
Manager.prototype.setEventListeners = function() {
|
@@ -141,23 +141,27 @@ function Manager() {
|
|
141
141
|
|
142
142
|
// Setup click handler
|
143
143
|
document.addEventListener('click', function (event) {
|
144
|
+
var target = event.target;
|
145
|
+
|
144
146
|
// auth events
|
145
|
-
if (
|
147
|
+
if (target.matches('.auth-signin-email-btn')) {
|
146
148
|
self.auth().signIn('email');
|
147
|
-
} else if (
|
149
|
+
} else if (target.matches('.auth-signup-email-btn')) {
|
148
150
|
self.auth().signUp('email');
|
149
|
-
} else if (
|
150
|
-
self.auth().signIn(
|
151
|
-
} else if (
|
152
|
-
self.auth().signUp(
|
153
|
-
} else if (
|
151
|
+
} else if (target.matches('.auth-signin-provider-btn')) {
|
152
|
+
self.auth().signIn(target.getAttribute('data-provider'));
|
153
|
+
} else if (target.matches('.auth-signup-provider-btn')) {
|
154
|
+
self.auth().signUp(target.getAttribute('data-provider'));
|
155
|
+
} else if (target.matches('.auth-signout-all-btn')) {
|
154
156
|
self.auth().signOut();
|
155
|
-
} else if (
|
157
|
+
} else if (target.matches('.auth-forgot-email-btn')) {
|
156
158
|
self.auth().forgot();
|
157
|
-
} else if (
|
159
|
+
} else if (target.matches('#prechat-btn')) {
|
158
160
|
load_chatsy(self, self.properties.options);
|
159
|
-
} else if (
|
161
|
+
} else if (target.matches('.auth-subscribe-notifications-btn')) {
|
160
162
|
self.notifications().subscribe()
|
163
|
+
} else if (target.matches('.master-alert-close')) {
|
164
|
+
target.parentElement.setAttribute('hidden', true);
|
161
165
|
}
|
162
166
|
|
163
167
|
// Autorequest
|
@@ -604,10 +608,11 @@ function Manager() {
|
|
604
608
|
try {
|
605
609
|
if (!self.properties.page.isSupportedBrowser) {
|
606
610
|
var box = document.getElementsByClassName('master-alert-outdated')[0];
|
607
|
-
box.
|
608
|
-
document.body.insertBefore(box, document.body.firstChild);
|
611
|
+
box.removeAttribute('hidden');
|
609
612
|
}
|
610
|
-
} catch (e) {
|
613
|
+
} catch (e) {
|
614
|
+
console.error(e);
|
615
|
+
}
|
611
616
|
|
612
617
|
// run the init callback
|
613
618
|
self.properties.page.status.ready = true;
|
package/lib/account.js
CHANGED
@@ -236,6 +236,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
236
236
|
var timestampOld = '1970-01-01T00:00:00.000Z';
|
237
237
|
var timestampUNIXOld = 0;
|
238
238
|
|
239
|
+
console.log('++++++account', JSON.stringify(account, null, 2));
|
240
|
+
console.log('++++++options', JSON.stringify(options, null, 2));
|
241
|
+
|
239
242
|
// Resolve auth
|
240
243
|
account.auth = account.auth || {};
|
241
244
|
account.auth.uid = account.auth.uid || firebaseUser.uid || null;
|
@@ -491,8 +494,16 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
491
494
|
? '<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days '
|
492
495
|
: '');
|
493
496
|
|
497
|
+
|
498
|
+
// Update payment method UI
|
499
|
+
if (account.plan.status === 'suspended') {
|
500
|
+
self.dom.select('.master-alert-suspended').removeAttribute('hidden');
|
501
|
+
}
|
502
|
+
|
503
|
+
// Update API UI
|
494
504
|
_setAuthItem('.auth-apikey-element', self.utilities.get(account, 'api.privateKey', 'n/a'));
|
495
505
|
|
506
|
+
// Update referral UI
|
496
507
|
$referralCount.setInnerHTML(account.affiliate.referrals.length);
|
497
508
|
$referralCode.setInnerHTML(account.affiliate.code).setValue(account.affiliate.code);
|
498
509
|
$referralCode.setInnerHTML(referralURL.toString()).setValue(referralURL.toString());
|
@@ -500,6 +511,7 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
500
511
|
var affiliateLinkURI = encodeURIComponent(referralURL.toString());
|
501
512
|
var affiliateLinkTextURI = encodeURIComponent('Sign up for ' + self.utilities.get(self.Manager, 'properties.global.brand.name', 'this') + ', a useful service:');
|
502
513
|
|
514
|
+
// Update social links
|
503
515
|
$referralSocialLink
|
504
516
|
.each(function ($el) {
|
505
517
|
var provider = $el.dataset.provider;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "web-manager",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.35",
|
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": {
|
@@ -31,7 +31,7 @@
|
|
31
31
|
}
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@sentry/browser": "^7.
|
34
|
+
"@sentry/browser": "^7.98.0",
|
35
35
|
"cookieconsent": "^3.1.1",
|
36
36
|
"firebase": "^9.23.0",
|
37
37
|
"lazysizes": "^5.3.2"
|