sfc-utils 1.4.182 → 1.4.184
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
CHANGED
|
@@ -13,7 +13,12 @@ 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 (
|
|
16
|
+
if (
|
|
17
|
+
window &&
|
|
18
|
+
window.treg &&
|
|
19
|
+
window.treg.realm &&
|
|
20
|
+
window.treg.realm.core
|
|
21
|
+
) {
|
|
17
22
|
window.treg.realm.core.login();
|
|
18
23
|
}
|
|
19
24
|
e.preventDefault();
|
|
@@ -34,11 +39,21 @@ const swapSubscribeForAccount = async function () {
|
|
|
34
39
|
const maxTries = 20; // 20 * 500ms = 10 seconds
|
|
35
40
|
while (!swapped && tries < maxTries) {
|
|
36
41
|
tries++;
|
|
37
|
-
if (
|
|
42
|
+
if (
|
|
43
|
+
window &&
|
|
44
|
+
window.treg &&
|
|
45
|
+
window.treg.identity &&
|
|
46
|
+
window.treg.identity.id
|
|
47
|
+
) {
|
|
38
48
|
const rightBlock = document.querySelector(".nav2-right");
|
|
39
49
|
if (rightBlock && rightBlock.innerText) {
|
|
40
50
|
rightBlock.innerHTML = `<a id="nav2-sub-box" href="${accountURL}"><div>Account</div></a>`;
|
|
41
|
-
if (
|
|
51
|
+
if (
|
|
52
|
+
window &&
|
|
53
|
+
window.treg &&
|
|
54
|
+
window.treg.realm &&
|
|
55
|
+
window.treg.realm.iframeProfile
|
|
56
|
+
) {
|
|
42
57
|
const subButton = document.querySelector("#nav2-sub-box");
|
|
43
58
|
if (subButton) {
|
|
44
59
|
subButton.onclick = function (e) {
|
|
@@ -41,15 +41,7 @@ function appendLayoutScripts(
|
|
|
41
41
|
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
|
|
42
42
|
f.parentNode.insertBefore(j, f);
|
|
43
43
|
})(window, document, "script", "dataLayer", "GTM-P38VLD8M");
|
|
44
|
-
//
|
|
45
|
-
let script = document.createElement("script");
|
|
46
|
-
script.type = "text/javascript";
|
|
47
|
-
script.src = "https://projects.sfchronicle.com/shared/js/md5.js";
|
|
48
|
-
document.body.appendChild(script);
|
|
49
|
-
let script2 = document.createElement("script");
|
|
50
|
-
script2.type = "text/javascript";
|
|
51
|
-
script2.src = "https://nexus.ensighten.com/hearst/news/Bootstrap.js";
|
|
52
|
-
document.body.appendChild(script2);
|
|
44
|
+
// NO MORE ENSIGHTEN OR MD5!
|
|
53
45
|
} else {
|
|
54
46
|
let script = document.createElement("script");
|
|
55
47
|
script.type = "text/javascript";
|
|
@@ -27,7 +27,7 @@ const LayoutHelmet = ({
|
|
|
27
27
|
MARKET_KEY,
|
|
28
28
|
CANONICAL_URL,
|
|
29
29
|
ANALYTICS_CREDIT,
|
|
30
|
-
|
|
30
|
+
HEARST_CATEGORY,
|
|
31
31
|
},
|
|
32
32
|
} = meta;
|
|
33
33
|
|
|
@@ -128,8 +128,8 @@ const LayoutHelmet = ({
|
|
|
128
128
|
|
|
129
129
|
// Set section with fallback
|
|
130
130
|
let articleSection = "Local";
|
|
131
|
-
if (
|
|
132
|
-
articleSection =
|
|
131
|
+
if (HEARST_CATEGORY && typeof HEARST_CATEGORY === "string") {
|
|
132
|
+
articleSection = HEARST_CATEGORY.split(",")[0];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
// Set the default schema that will be used as a fallback
|