sfc-utils 1.4.139 → 1.4.141

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.
Files changed (3) hide show
  1. package/accountswap.js +11 -0
  2. package/nav2.js +10 -10
  3. package/package.json +1 -1
package/accountswap.js CHANGED
@@ -11,6 +11,17 @@ const pollForAccount = async function (i, isNav) {
11
11
  if (!i) {
12
12
  i = 0;
13
13
  }
14
+ // Add a click event to signin to load it with a return URL
15
+ //
16
+ if (isNav) {
17
+ const signinButton = document.querySelector(".hnp-signin");
18
+ if (signinButton) {
19
+ // Change the href to include the return URL params
20
+ signinButton.href = `${
21
+ signinButton.href
22
+ }?prevousLocation=${encodeURIComponent(window.location.href)}`;
23
+ }
24
+ }
14
25
  // Safecheck for treg since it might not be global yet
15
26
  if (window && window.treg && window.treg.identity) {
16
27
  // Now we have all the vars to know if we're logged in
package/nav2.js CHANGED
@@ -1,4 +1,4 @@
1
- let { getBrands3 } = require("./brands");
1
+ let { getBrands3 } = require("./brands3");
2
2
 
3
3
  // Handle nav for various markets and include nav options for other links
4
4
  let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
@@ -140,20 +140,20 @@ let getNav2 = function (meta, urlAdd, forceColor, navLink, navArray) {
140
140
 
141
141
  // Using style tags just to make this easy
142
142
  let rightBlock = `
143
- <a id="nav2-sub-box" style="font-weight: 700;" href="${subscribeLink}" target="_blank">
143
+ <a id="nav2-sub-box" class="hnp-subscribe" style="font-weight: 700;" href="${subscribeLink}" target="_blank">
144
144
  <div>Subscribe</div>
145
145
  </a>
146
146
  `;
147
147
 
148
148
  // If there's a signin link, add it here
149
- if (signinLink) {
150
- rightBlock =
151
- `
152
- <a id="nav2-sub-box" style="margin: 0; font-weight: 700;" href="${signinLink}" target="_blank">
153
- <span>Sign in</span>
154
- </a>
155
- <span style="font-size: 14px; padding: 2px 0 2px;">or</span>` + rightBlock;
156
- }
149
+ // if (signinLink) {
150
+ // rightBlock =
151
+ // `
152
+ // <a id="nav2-sub-box" class="hnp-signin" style="margin: 0; font-weight: 700;" href="${signinLink}">
153
+ // <span>Sign in</span>
154
+ // </a>
155
+ // <span style="font-size: 14px; padding: 2px 0 2px;">or</span>` + rightBlock;
156
+ // }
157
157
 
158
158
  let navHTML = `<nav class="nav2-container ${invertClass}">
159
159
  <div class="nav2-left">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.139",
3
+ "version": "1.4.141",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",