sfc-utils 1.4.154 → 1.4.156
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/nav2.js +30 -4
- package/package.json +1 -1
package/nav2.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
let { getBrands3 } = require("./brands3");
|
|
2
2
|
|
|
3
3
|
// Handle nav for various markets and include nav options for other links
|
|
4
|
-
let getNav2 = function (
|
|
4
|
+
let getNav2 = function (
|
|
5
|
+
meta,
|
|
6
|
+
urlAdd,
|
|
7
|
+
forceColor,
|
|
8
|
+
navLink,
|
|
9
|
+
navArray,
|
|
10
|
+
overrides
|
|
11
|
+
) {
|
|
5
12
|
// If we aren't passing meta in, we have to call getSettings here
|
|
6
13
|
if (!meta) {
|
|
7
14
|
let { getSettings } = require("./settings");
|
|
@@ -123,6 +130,25 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
123
130
|
subfolder = meta.PROJECT.SUBFOLDER + "/";
|
|
124
131
|
}
|
|
125
132
|
|
|
133
|
+
// Handle overrides assignment
|
|
134
|
+
let desktopIcon = `https://files.sfchronicle.com/static-assets/logos/${marketPrefix}-${color}.png`;
|
|
135
|
+
let mobileIcon = `https://files.sfchronicle.com/static-assets/logos/${marketPrefix}-square-${color}.png`;
|
|
136
|
+
let iconLink = "/";
|
|
137
|
+
if (overrides) {
|
|
138
|
+
if (overrides.desktopIcon) {
|
|
139
|
+
desktopIcon = overrides.desktopIcon;
|
|
140
|
+
}
|
|
141
|
+
if (overrides.mobileIcon) {
|
|
142
|
+
mobileIcon = overrides.mobileIcon;
|
|
143
|
+
}
|
|
144
|
+
if (overrides.subscribeLink) {
|
|
145
|
+
subscribeLink = overrides.subscribeLink;
|
|
146
|
+
}
|
|
147
|
+
if (overrides.iconLink) {
|
|
148
|
+
iconLink = overrides.iconLink;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
126
152
|
// If a link object was provided, format the insert
|
|
127
153
|
let navLinkInsert = "";
|
|
128
154
|
if (navLink && navLink.url !== "") {
|
|
@@ -159,7 +185,7 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
159
185
|
</div>
|
|
160
186
|
<div class="nav2-center">
|
|
161
187
|
<a
|
|
162
|
-
href="
|
|
188
|
+
href="${iconLink}"
|
|
163
189
|
target="_blank"
|
|
164
190
|
rel="noopener noreferrer"
|
|
165
191
|
>
|
|
@@ -167,12 +193,12 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
|
|
|
167
193
|
<img
|
|
168
194
|
class="nav2-desk-logo"
|
|
169
195
|
alt="Logo"
|
|
170
|
-
src="
|
|
196
|
+
src="${desktopIcon}"
|
|
171
197
|
/>
|
|
172
198
|
<img
|
|
173
199
|
class="nav2-mobile-logo"
|
|
174
200
|
alt="Logo"
|
|
175
|
-
src="
|
|
201
|
+
src="${mobileIcon}"
|
|
176
202
|
/>
|
|
177
203
|
</div>
|
|
178
204
|
</a>
|