sfc-utils 1.4.184 → 1.4.186
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/brands.js +1 -1
- package/brands2.js +1 -1
- package/brands3.js +1 -1
- package/components/helpers/utilfunctions.mjs +8 -18
- package/package.json +1 -1
package/brands.js
CHANGED
|
@@ -43,7 +43,7 @@ let getBrands = function (market) {
|
|
|
43
43
|
},
|
|
44
44
|
attributes: {
|
|
45
45
|
marketPrefix: "sf",
|
|
46
|
-
siteName: "
|
|
46
|
+
siteName: "San Francisco Chronicle",
|
|
47
47
|
twitter: "sfchronicle",
|
|
48
48
|
gaAccount: "UA-1616916-26",
|
|
49
49
|
subscribeLink: "https://www.sfchronicle.com/subproject",
|
package/brands2.js
CHANGED
|
@@ -34,7 +34,7 @@ let getBrands2 = function (market) {
|
|
|
34
34
|
},
|
|
35
35
|
attributes: {
|
|
36
36
|
marketPrefix: "sf",
|
|
37
|
-
siteName: "
|
|
37
|
+
siteName: "San Francisco Chronicle",
|
|
38
38
|
twitter: "sfchronicle",
|
|
39
39
|
gaAccount: "UA-1616916-26",
|
|
40
40
|
//subscribeLink: "https://www.sfchronicle.com/subproject",
|
package/brands3.js
CHANGED
|
@@ -42,7 +42,7 @@ let getBrands3 = function (market) {
|
|
|
42
42
|
},
|
|
43
43
|
attributes: {
|
|
44
44
|
marketPrefix: "sf",
|
|
45
|
-
siteName: "
|
|
45
|
+
siteName: "San Francisco Chronicle",
|
|
46
46
|
twitter: "sfchronicle",
|
|
47
47
|
gaAccount: "UA-1616916-26",
|
|
48
48
|
subscribeLink: "https://www.sfchronicle.com/subproject",
|
|
@@ -72,8 +72,9 @@ function appendLayoutScripts(
|
|
|
72
72
|
link.rel = "stylesheet";
|
|
73
73
|
link.href = `https://htlbid.com/v3/${shortDomain}/hnpbid.css`;
|
|
74
74
|
document.head.appendChild(link);
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
// Poll for hnpbid every 200ms for up to 10 seconds
|
|
76
|
+
const pollForHnpbid = (attempt = 0, maxAttempts = 50) => {
|
|
77
|
+
// 50 attempts * 200ms = 10 seconds
|
|
77
78
|
if (window.hnpbid) {
|
|
78
79
|
console.log("hnpbid exists");
|
|
79
80
|
window.hnpbid = window.hnpbid || {};
|
|
@@ -102,24 +103,13 @@ function appendLayoutScripts(
|
|
|
102
103
|
// init
|
|
103
104
|
window.hnpbid.layout();
|
|
104
105
|
});
|
|
106
|
+
} else if (attempt < maxAttempts) {
|
|
107
|
+
setTimeout(() => pollForHnpbid(attempt + 1, maxAttempts), 200);
|
|
105
108
|
} else {
|
|
106
|
-
console.log("hnpbid does not exist");
|
|
107
|
-
// If global var was not defined, start Juice
|
|
108
|
-
let script = document.createElement("script");
|
|
109
|
-
script.type = "text/javascript";
|
|
110
|
-
script.id = "adPositionManagerScriptTag";
|
|
111
|
-
script.src = "https://aps.hearstnp.com/Scripts/loadAds.js";
|
|
112
|
-
document.body.appendChild(script);
|
|
109
|
+
console.log("hnpbid does not exist! ads disabled");
|
|
113
110
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
console.log("juice fallback");
|
|
117
|
-
// If no category, this is the old version and we're supporting Juice (expires in Nov 2024)
|
|
118
|
-
let script = document.createElement("script");
|
|
119
|
-
script.type = "text/javascript";
|
|
120
|
-
script.id = "adPositionManagerScriptTag";
|
|
121
|
-
script.src = "https://aps.hearstnp.com/Scripts/loadAds.js";
|
|
122
|
-
document.body.appendChild(script);
|
|
111
|
+
};
|
|
112
|
+
pollForHnpbid();
|
|
123
113
|
}
|
|
124
114
|
}
|
|
125
115
|
|