sfc-utils 1.4.173 → 1.4.175
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 +3 -3
- package/package.json +1 -1
- package/settings.js +34 -0
package/accountswap.js
CHANGED
|
@@ -13,7 +13,7 @@ const attachSigninHandler = async function () {
|
|
|
13
13
|
if (signinButton && !signinButton.dataset.realmAttached) {
|
|
14
14
|
signinButton.dataset.realmAttached = "true";
|
|
15
15
|
signinButton.onclick = function (e) {
|
|
16
|
-
if (window
|
|
16
|
+
if (window && window.treg && window.treg.realm && window.treg.realm.core) {
|
|
17
17
|
window.treg.realm.core.login();
|
|
18
18
|
}
|
|
19
19
|
e.preventDefault();
|
|
@@ -34,11 +34,11 @@ const swapSubscribeForAccount = async function () {
|
|
|
34
34
|
const maxTries = 20; // 20 * 500ms = 10 seconds
|
|
35
35
|
while (!swapped && tries < maxTries) {
|
|
36
36
|
tries++;
|
|
37
|
-
if (window
|
|
37
|
+
if (window && window.treg && window.treg.identity && window.treg.identity.id) {
|
|
38
38
|
const rightBlock = document.querySelector(".nav2-right");
|
|
39
39
|
if (rightBlock && rightBlock.innerText) {
|
|
40
40
|
rightBlock.innerHTML = `<a id="nav2-sub-box" href="${accountURL}"><div>Account</div></a>`;
|
|
41
|
-
if (window
|
|
41
|
+
if (window && window.treg && window.treg.realm && window.treg.realm.iframeProfile) {
|
|
42
42
|
const subButton = document.querySelector("#nav2-sub-box");
|
|
43
43
|
if (subButton) {
|
|
44
44
|
subButton.onclick = function (e) {
|
package/package.json
CHANGED
package/settings.js
CHANGED
|
@@ -67,6 +67,37 @@ let getSettings = function () {
|
|
|
67
67
|
if (fullAuthors.length === 0) {
|
|
68
68
|
fullAuthors = null;
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
// Default newsletter based by market
|
|
72
|
+
let defaultNewsletter, defaultNewsletterPromo, defaultNewsletterLegal;
|
|
73
|
+
switch (storySettings.Market_Key) {
|
|
74
|
+
case 'SFC':
|
|
75
|
+
defaultNewsletter = 'SFC_TheMustRead';
|
|
76
|
+
defaultNewsletterPromo = `The Chronicle’s most popular stories and best reads of the moment.`;
|
|
77
|
+
defaultNewsletterLegal = `By subscribing, you agree to our <a href="https://www.sfchronicle.com/terms_of_use/">Terms of Use</a> and acknowledge that your information will be used as described in our <a href="https://www.sfchronicle.com/privacy_policy/"> Privacy Notice</a>.`;
|
|
78
|
+
break
|
|
79
|
+
case 'Houston':
|
|
80
|
+
defaultNewsletter = 'HC_The713';
|
|
81
|
+
defaultNewsletterPromo = `A morning newsletter that keeps you connected to Houston in 5 minutes or less.`;
|
|
82
|
+
defaultNewsletterLegal = `By subscribing, you agree to our <a href="https://www.houstonchronicle.com/terms_of_use/">Terms of Use</a> and acknowledge that your information will be used as described in our <a href="https://www.houstonchronicle.com/privacy_policy/"> Privacy Notice</a>.`;
|
|
83
|
+
break
|
|
84
|
+
case 'SanAntonio':
|
|
85
|
+
defaultNewsletter = 'SAEN_OnOurRadar';
|
|
86
|
+
defaultNewsletterPromo = `Get the mid-morning scoop on developing news in San Antonio.`;
|
|
87
|
+
defaultNewsletterLegal = `By subscribing, you agree to our <a href="https://www.expressnews.com/terms_of_use/">Terms of Use</a> and acknowledge that your information will be used as described in our <a href="https://www.expressnews.com/privacy_policy/"> Privacy Notice</a>.`;
|
|
88
|
+
break
|
|
89
|
+
case 'Albany':
|
|
90
|
+
defaultNewsletter = 'ALB_SundayRead';
|
|
91
|
+
defaultNewsletterPromo = `Answering the week’s biggest questions and delivering them to your inbox.`;
|
|
92
|
+
defaultNewsletterLegal = `By subscribing, you agree to our <a href="https://www.timesunion.com/termsofservice/">Terms of Use</a> and acknowledge that your information will be used as described in our <a href="https://www.timesunion.com/privacypolicy/"> Privacy Notice</a>.`;
|
|
93
|
+
break
|
|
94
|
+
case 'CT':
|
|
95
|
+
defaultNewsletter = 'ct_ins_morning_briefing';
|
|
96
|
+
defaultNewsletterPromo = `Stay connected to Connecticut’s stories with a daily digest of top headlines.`;
|
|
97
|
+
defaultNewsletterLegal = `By subscribing, you agree to our <a href="https://www.ctinsider.com/tos/">Terms of Use</a> and acknowledge that your information will be used as described in our <a href="https://www.ctinsider.com/privacy/"> Privacy Notice</a>.`;
|
|
98
|
+
break
|
|
99
|
+
}
|
|
100
|
+
|
|
70
101
|
// Populate with sheet settings
|
|
71
102
|
settings = {
|
|
72
103
|
PAYWALL_SETTING: storySettings.Paywall,
|
|
@@ -100,14 +131,17 @@ let getSettings = function () {
|
|
|
100
131
|
NEWSLETTER_ID:
|
|
101
132
|
storySettings.NewsletterID ||
|
|
102
133
|
storySettings.Custom_Sailthru_ID ||
|
|
134
|
+
defaultNewsletter ||
|
|
103
135
|
projectSettings.NEWSLETTER_ID,
|
|
104
136
|
NEWSLETTER_PROMO:
|
|
105
137
|
storySettings.NewsletterPromo ||
|
|
106
138
|
storySettings.Custom_Signup_Text ||
|
|
139
|
+
defaultNewsletterPromo ||
|
|
107
140
|
projectSettings.NEWSLETTER_PROMO,
|
|
108
141
|
NEWSLETTER_LEGAL:
|
|
109
142
|
storySettings.NewsletterLegal ||
|
|
110
143
|
storySettings.TOS_Text ||
|
|
144
|
+
defaultNewsletterLegal ||
|
|
111
145
|
projectSettings.NEWSLETTER_LEGAL,
|
|
112
146
|
// Newer things
|
|
113
147
|
RELATED_LINKS_HED: storySettings.Related_Links_Hed,
|