@4site/engrid-scripts 0.19.11 → 0.19.13
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/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/welcome-back.d.ts +3 -0
- package/dist/welcome-back.js +34 -16
- package/package.json +2 -2
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AppVersion = "0.19.
|
|
1
|
+
export declare const AppVersion = "0.19.13";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AppVersion = "0.19.
|
|
1
|
+
export const AppVersion = "0.19.13";
|
package/dist/welcome-back.d.ts
CHANGED
package/dist/welcome-back.js
CHANGED
|
@@ -7,29 +7,47 @@
|
|
|
7
7
|
*
|
|
8
8
|
* All the text content and positioning is configurable through the "WelcomeBack" option.
|
|
9
9
|
*/
|
|
10
|
-
import { ENGrid } from ".";
|
|
10
|
+
import { ENGrid, RememberMeEvents } from ".";
|
|
11
11
|
import * as cookie from "./cookie";
|
|
12
12
|
export class WelcomeBack {
|
|
13
13
|
constructor() {
|
|
14
14
|
var _a;
|
|
15
15
|
this.supporterDetails = {};
|
|
16
16
|
this.options = (_a = ENGrid.getOption("WelcomeBack")) !== null && _a !== void 0 ? _a : false;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
this.addWelcomeBack();
|
|
30
|
-
this.addPersonalDetailsSummary();
|
|
31
|
-
this.addEventListeners();
|
|
17
|
+
this.rememberMeEvents = RememberMeEvents.getInstance();
|
|
18
|
+
this.hasRun = false;
|
|
19
|
+
if (!this.shouldRun())
|
|
20
|
+
return;
|
|
21
|
+
if (ENGrid.getOption("RememberMe")) {
|
|
22
|
+
this.rememberMeEvents.onLoad.subscribe(() => {
|
|
23
|
+
this.run();
|
|
24
|
+
});
|
|
25
|
+
this.rememberMeEvents.onClear.subscribe(() => {
|
|
26
|
+
this.resetWelcomeBack();
|
|
27
|
+
});
|
|
32
28
|
}
|
|
29
|
+
else {
|
|
30
|
+
this.run();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
run() {
|
|
34
|
+
if (this.hasRun)
|
|
35
|
+
return;
|
|
36
|
+
this.hasRun = true;
|
|
37
|
+
this.supporterDetails = {
|
|
38
|
+
firstName: ENGrid.getFieldValue("supporter.firstName"),
|
|
39
|
+
lastName: ENGrid.getFieldValue("supporter.lastName"),
|
|
40
|
+
emailAddress: ENGrid.getFieldValue("supporter.emailAddress"),
|
|
41
|
+
address1: ENGrid.getFieldValue("supporter.address1"),
|
|
42
|
+
address2: ENGrid.getFieldValue("supporter.address2"),
|
|
43
|
+
city: ENGrid.getFieldValue("supporter.city"),
|
|
44
|
+
region: ENGrid.getFieldValue("supporter.region"),
|
|
45
|
+
postcode: ENGrid.getFieldValue("supporter.postcode"),
|
|
46
|
+
country: ENGrid.getFieldValue("supporter.country"),
|
|
47
|
+
};
|
|
48
|
+
this.addWelcomeBack();
|
|
49
|
+
this.addPersonalDetailsSummary();
|
|
50
|
+
this.addEventListeners();
|
|
33
51
|
}
|
|
34
52
|
shouldRun() {
|
|
35
53
|
return (!!document.querySelector(".fast-personal-details") &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4site/engrid-scripts",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.13",
|
|
4
4
|
"description": "Scripts for the ENGRID Project",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"strongly-typed-events": "^2.0.9"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/4site-interactive-studios/engrid#readme",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "aad6c3aff1ee8afa1d8bfd11b0bc43967cab9d99",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"nodemon": "^2.0.20"
|
|
31
31
|
}
|