sfc-utils 1.4.141 → 1.4.142
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/accountswap.js +13 -11
- package/brands3.js +0 -10
- package/nav2.js +8 -10
- package/package.json +1 -1
package/accountswap.js
CHANGED
|
@@ -11,15 +11,16 @@ const pollForAccount = async function (i, isNav) {
|
|
|
11
11
|
if (!i) {
|
|
12
12
|
i = 0;
|
|
13
13
|
}
|
|
14
|
-
// Add a click event to signin
|
|
15
|
-
//
|
|
14
|
+
// Add a click event to signin
|
|
16
15
|
if (isNav) {
|
|
17
16
|
const signinButton = document.querySelector(".hnp-signin");
|
|
18
17
|
if (signinButton) {
|
|
19
|
-
//
|
|
20
|
-
signinButton.
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
// Add event listener to signin button
|
|
19
|
+
signinButton.onclick = function (e) {
|
|
20
|
+
treg.realm.core.login();
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
};
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
// Safecheck for treg since it might not be global yet
|
|
@@ -31,18 +32,19 @@ const pollForAccount = async function (i, isNav) {
|
|
|
31
32
|
}
|
|
32
33
|
if (isNav) {
|
|
33
34
|
// We got a valid entitlement! Let's see if the button exists and swap our new one in
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!subButtonText.innerText) {
|
|
35
|
+
const rightBlock = document.querySelector(".nav2-right");
|
|
36
|
+
if (rightBlock) {
|
|
37
|
+
if (!rightBlock.innerText) {
|
|
38
38
|
// If there's no innerText, keep waiting
|
|
39
39
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
40
40
|
return await pollForAccount(i + 1, isNav);
|
|
41
41
|
}
|
|
42
42
|
// Change the inner HTML
|
|
43
|
-
|
|
43
|
+
rightBlock.innerHTML = `<div id="#nav2-sub-box" href="${accountURL}">Account</div>`;
|
|
44
44
|
// Instead of having a true link, set click event to run treg.realm.iframeProfile.NavigateToIndex()
|
|
45
45
|
if (window.treg.realm.iframeProfile) {
|
|
46
|
+
// Find the newly swapped button
|
|
47
|
+
const subButton = document.querySelector("#nav2-sub-box");
|
|
46
48
|
subButton.onclick = function (e) {
|
|
47
49
|
window.treg.realm.iframeProfile.NavigateToIndex();
|
|
48
50
|
e.preventDefault();
|
package/brands3.js
CHANGED
|
@@ -48,8 +48,6 @@ let getBrands3 = function (market) {
|
|
|
48
48
|
//subscribeLink: "https://www.sfchronicle.com/subproject",
|
|
49
49
|
subscribeLink:
|
|
50
50
|
"https://subscription.sfchronicle.com/checkout/684/1444?origin=button&ipid=project&variant=devhub",
|
|
51
|
-
signinLink:
|
|
52
|
-
"https://realm.hearstnp.com/aGRuLnNhbmZyYW5jaXNjbw==/c2ZjaHJvbmljbGUuY29t/1079/account/login",
|
|
53
51
|
sailCustomer: "fca2a0390286f0e53120a668534d9529",
|
|
54
52
|
sailSiteName: "san-francisco-chronicle",
|
|
55
53
|
siteId: 35,
|
|
@@ -69,8 +67,6 @@ let getBrands3 = function (market) {
|
|
|
69
67
|
invert: true,
|
|
70
68
|
gaAccount: "UA-1616916-24",
|
|
71
69
|
subscribeLink: "https://www.houstonchronicle.com/subproject",
|
|
72
|
-
signinLink:
|
|
73
|
-
"https://realm.hearstnp.com/aGRuLmhvdXN0b24=/aG91c3RvbmNocm9uaWNsZS5jb20=/1078/account/login",
|
|
74
70
|
sailCustomer: "48e30b5083cf6bf47c519651453c9e8a",
|
|
75
71
|
sailSiteName: "houston-chronicle",
|
|
76
72
|
siteId: 33,
|
|
@@ -90,8 +86,6 @@ let getBrands3 = function (market) {
|
|
|
90
86
|
invert: true,
|
|
91
87
|
gaAccount: "UA-1616916-7",
|
|
92
88
|
subscribeLink: "https://www.timesunion.com/subproject",
|
|
93
|
-
signinLink:
|
|
94
|
-
"https://realm.hearstnp.com/aGRuLmFsYmFueQ==/dGltZXN1bmlvbi5jb20=/1077/account/login",
|
|
95
89
|
sailCustomer: "5bb9eee089bdc2e27cbd265535ad1f90",
|
|
96
90
|
sailSiteName: "times-union",
|
|
97
91
|
siteId: 3,
|
|
@@ -111,8 +105,6 @@ let getBrands3 = function (market) {
|
|
|
111
105
|
invert: true,
|
|
112
106
|
gaAccount: "UA-1616916-27",
|
|
113
107
|
subscribeLink: "https://www.expressnews.com/subproject",
|
|
114
|
-
signinLink:
|
|
115
|
-
"https://realm.hearstnp.com/aGRuLnNhbmFudG9uaW8=/ZXhwcmVzc25ld3MuY29t/1080/account/login",
|
|
116
108
|
sailCustomer: "aec52c4681ed63b5beab139a2584f0d4",
|
|
117
109
|
sailSiteName: "san-antonio-express-news",
|
|
118
110
|
siteId: 36,
|
|
@@ -132,8 +124,6 @@ let getBrands3 = function (market) {
|
|
|
132
124
|
invert: true,
|
|
133
125
|
gaAccount: "UA-1616916-99",
|
|
134
126
|
subscribeLink: "https://www.ctinsider.com/subproject",
|
|
135
|
-
signinLink:
|
|
136
|
-
"https://realm.hearstnp.com/aGRuLmN0cHJlbWl1bQ==/Y3RpbnNpZGVyLmNvbQ==/1083/account/login",
|
|
137
127
|
sailCustomer: "9b21160afa226c9f84d27b47c3d52364",
|
|
138
128
|
sailSiteName: "ct-insider",
|
|
139
129
|
siteId: 61,
|
package/nav2.js
CHANGED
|
@@ -27,7 +27,7 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
let {
|
|
30
|
-
attributes: { marketPrefix, invert, subscribeLink
|
|
30
|
+
attributes: { marketPrefix, invert, subscribeLink },
|
|
31
31
|
} = getBrands3(meta.PROJECT.MARKET_KEY);
|
|
32
32
|
// Handle various CT domains
|
|
33
33
|
if (typeof window !== "undefined") {
|
|
@@ -145,15 +145,13 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
145
145
|
</a>
|
|
146
146
|
`;
|
|
147
147
|
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// <span style="font-size: 14px; padding: 2px 0 2px;">or</span>` + rightBlock;
|
|
156
|
-
// }
|
|
148
|
+
// Add sign-in here (we can comment this out if we want to remove this)
|
|
149
|
+
rightBlock =
|
|
150
|
+
`
|
|
151
|
+
<a id="nav2-sub-box" class="hnp-signin" style="margin: 0; font-weight: 700;" href="/realm">
|
|
152
|
+
<span>Sign in</span>
|
|
153
|
+
</a>
|
|
154
|
+
<span style="font-size: 14px; padding: 2px 0 2px;">or</span>` + rightBlock;
|
|
157
155
|
|
|
158
156
|
let navHTML = `<nav class="nav2-container ${invertClass}">
|
|
159
157
|
<div class="nav2-left">
|