web-manager 3.2.57 → 3.2.59
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +12 -5
- package/lib/account.js +13 -4
- package/lib/require.js +5 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -470,7 +470,8 @@ Manager.prototype.init = function(configuration, callback) {
|
|
470
470
|
// Load polyfills
|
471
471
|
init_loadPolyfills(self, configuration, function() {
|
472
472
|
self.properties.page.status.initializing = false;
|
473
|
-
|
473
|
+
|
474
|
+
// set options
|
474
475
|
var options_defaults = {
|
475
476
|
// debug: {
|
476
477
|
// environment: self.properties.meta.environment,
|
@@ -487,6 +488,9 @@ Manager.prototype.init = function(configuration, callback) {
|
|
487
488
|
initChecks: {
|
488
489
|
features: [], // an array of javascript and dom features to check for (NIY)
|
489
490
|
},
|
491
|
+
refreshNewVersion: {
|
492
|
+
enabled: true,
|
493
|
+
},
|
490
494
|
auth: {
|
491
495
|
state: 'default', // required, prohibited, default
|
492
496
|
sends: {
|
@@ -1259,7 +1263,12 @@ function showBootstrapModal(exitPopupSettings) {
|
|
1259
1263
|
}
|
1260
1264
|
|
1261
1265
|
function refreshNewVersion(self) {
|
1262
|
-
console.log('refreshNewVersion()');
|
1266
|
+
// console.log('refreshNewVersion()');
|
1267
|
+
|
1268
|
+
// Skip if not enabled
|
1269
|
+
if (!self.properties.options.refreshNewVersion.enabled) {
|
1270
|
+
return;
|
1271
|
+
}
|
1263
1272
|
|
1264
1273
|
// Make request to get the build time (live)
|
1265
1274
|
fetch('/@output/build/build.json?cb=' + new Date().getTime())
|
@@ -1278,7 +1287,7 @@ function refreshNewVersion(self) {
|
|
1278
1287
|
buildTimeCurrent.setHours(buildTimeCurrent.getHours() + 1);
|
1279
1288
|
|
1280
1289
|
// Log
|
1281
|
-
console.log('refreshNewVersion()', data, buildTimeCurrent, buildTimeLive);
|
1290
|
+
// console.log('refreshNewVersion()', data, buildTimeCurrent, buildTimeLive);
|
1282
1291
|
|
1283
1292
|
// If the live time is newer, refresh
|
1284
1293
|
if (buildTimeCurrent < buildTimeLive) {
|
@@ -1348,7 +1357,6 @@ var load_firebase = function(self, options) {
|
|
1348
1357
|
});
|
1349
1358
|
}
|
1350
1359
|
|
1351
|
-
|
1352
1360
|
var load_firebase_auth = function(self, options) {
|
1353
1361
|
return new Promise(function(resolve, reject) {
|
1354
1362
|
// Set shortcuts
|
@@ -1373,7 +1381,6 @@ var load_firebase_auth = function(self, options) {
|
|
1373
1381
|
});
|
1374
1382
|
}
|
1375
1383
|
|
1376
|
-
|
1377
1384
|
var load_firebase_firestore = function(self, options) {
|
1378
1385
|
return new Promise(function(resolve, reject) {
|
1379
1386
|
// Set shortcuts
|
package/lib/account.js
CHANGED
@@ -7,17 +7,26 @@ function Account(init) {
|
|
7
7
|
self.properties = {};
|
8
8
|
self.accountPageInitialized = false;
|
9
9
|
|
10
|
+
// Initialize libraries
|
10
11
|
try {
|
11
12
|
self.dom = init.dom || self.Manager.dom();
|
12
13
|
self.utilities = init.utilities || self.Manager.utilities();
|
14
|
+
} catch (e) {
|
15
|
+
console.error('Failed to initialize libraries');
|
16
|
+
}
|
13
17
|
|
14
|
-
|
18
|
+
// Initialize account page
|
19
|
+
try {
|
20
|
+
// If we're NOT in the browser, skip
|
21
|
+
if (typeof window !== 'undefined') {
|
22
|
+
var url = new URL(window.location.href);
|
15
23
|
|
16
|
-
|
17
|
-
|
24
|
+
if (url.pathname.startsWith('/account')) {
|
25
|
+
self.initializeAccountPage();
|
26
|
+
}
|
18
27
|
}
|
19
28
|
} catch (e) {
|
20
|
-
console.error('Failed to initialize
|
29
|
+
console.error('Failed to initialize account page');
|
21
30
|
}
|
22
31
|
}
|
23
32
|
|
package/lib/require.js
ADDED
package/package.json
CHANGED