diff --git a/vf-components/vf-componenet-rollup/package.variables.scss b/vf-components/vf-componenet-rollup/package.variables.scss index 8cedb58f5..ecf3d133b 100644 --- a/vf-components/vf-componenet-rollup/package.variables.scss +++ b/vf-components/vf-componenet-rollup/package.variables.scss @@ -3,5 +3,5 @@ $componentInfo: ( version: "1.0.0-beta.4", location: "components/vf-componenet-rollup", vfCoreVersion: "2.2.37", - buildTimeStamp: "Fri, 02 Dec 2022 11:50:46 GMT" + buildTimeStamp: "Tue, 06 Dec 2022 10:16:34 GMT" ); \ No newline at end of file diff --git a/vf-components/vfwp-admin/package.variables.scss b/vf-components/vfwp-admin/package.variables.scss index 2b514a157..2816d9212 100644 --- a/vf-components/vfwp-admin/package.variables.scss +++ b/vf-components/vfwp-admin/package.variables.scss @@ -3,5 +3,5 @@ $componentInfo: ( version: "0.0.1", location: "components/vfwp-admin", vfCoreVersion: "2.2.37", - buildTimeStamp: "Fri, 02 Dec 2022 11:50:46 GMT" + buildTimeStamp: "Tue, 06 Dec 2022 10:16:34 GMT" ); \ No newline at end of file diff --git a/vf-components/vfwp-autocomplete/package.variables.scss b/vf-components/vfwp-autocomplete/package.variables.scss index f7a274967..63fa37c34 100644 --- a/vf-components/vfwp-autocomplete/package.variables.scss +++ b/vf-components/vfwp-autocomplete/package.variables.scss @@ -3,5 +3,5 @@ $componentInfo: ( version: "0.0.1", location: "components/vfwp-autocomplete", vfCoreVersion: "2.2.37", - buildTimeStamp: "Fri, 02 Dec 2022 11:50:46 GMT" + buildTimeStamp: "Tue, 06 Dec 2022 10:16:34 GMT" ); \ No newline at end of file diff --git a/vf-components/vfwp-gutenberg-blocks/package.variables.scss b/vf-components/vfwp-gutenberg-blocks/package.variables.scss index 33c389176..d1e64aee0 100644 --- a/vf-components/vfwp-gutenberg-blocks/package.variables.scss +++ b/vf-components/vfwp-gutenberg-blocks/package.variables.scss @@ -3,5 +3,5 @@ $componentInfo: ( version: "0.0.1", location: "components/vfwp-gutenberg-blocks", vfCoreVersion: "2.2.37", - buildTimeStamp: "Fri, 02 Dec 2022 11:50:46 GMT" + buildTimeStamp: "Tue, 06 Dec 2022 10:16:34 GMT" ); \ No newline at end of file diff --git a/vf-components/vfwp-gutenberg-iframe/package.variables.scss b/vf-components/vfwp-gutenberg-iframe/package.variables.scss index b01fed18c..3f3479552 100644 --- a/vf-components/vfwp-gutenberg-iframe/package.variables.scss +++ b/vf-components/vfwp-gutenberg-iframe/package.variables.scss @@ -3,5 +3,5 @@ $componentInfo: ( version: "0.0.1", location: "components/vfwp-gutenberg-iframe", vfCoreVersion: "2.2.37", - buildTimeStamp: "Fri, 02 Dec 2022 11:50:46 GMT" + buildTimeStamp: "Tue, 06 Dec 2022 10:16:34 GMT" ); \ No newline at end of file diff --git a/wp-content/themes/vf-wp/assets/assets/vf-component-initialization/index.js b/wp-content/themes/vf-wp/assets/assets/vf-component-initialization/index.js index ad9a93a7c..3918c74e4 100644 --- a/wp-content/themes/vf-wp/assets/assets/vf-component-initialization/index.js +++ b/wp-content/themes/vf-wp/assets/assets/vf-component-initialization/index.js @@ -1 +1 @@ -'use strict'; +"use strict"; diff --git a/wp-content/themes/vf-wp/assets/assets/vf-flag/vf-flag.css b/wp-content/themes/vf-wp/assets/assets/vf-flag/vf-flag.css index f56728a84..a19194667 100644 --- a/wp-content/themes/vf-wp/assets/assets/vf-flag/vf-flag.css +++ b/wp-content/themes/vf-wp/assets/assets/vf-flag/vf-flag.css @@ -97,7 +97,7 @@ * Component: @visual-framework/vf-flag * Version: 1.0.0-alpha.2 * Location: components/vf-core-components/vf-flag - * Build time: Fri, 02 Dec 2022 11:49:38 GMT + * Build time: Tue, 06 Dec 2022 10:16:00 GMT */ .vf-flag { display: table; diff --git a/wp-content/themes/vf-wp/assets/assets/vf-header/vf-header.css b/wp-content/themes/vf-wp/assets/assets/vf-header/vf-header.css index b326b8069..d19cafe86 100644 --- a/wp-content/themes/vf-wp/assets/assets/vf-header/vf-header.css +++ b/wp-content/themes/vf-wp/assets/assets/vf-header/vf-header.css @@ -330,16 +330,14 @@ html:not(.vf-disable-deprecated) [class*=with-title-block][class*=theme] .vf-mas text-decoration-thickness: 4px; text-underline-offset: 0.5em; text-underline-position: under; - -webkit-text-decoration-color: #000000; - text-decoration-color: #000000; + text-decoration-color: #000000; } .vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link[aria-selected=true] { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 0.5em; text-underline-position: under; - -webkit-text-decoration-color: #3b6fb6; - text-decoration-color: #3b6fb6; + text-decoration-color: #3b6fb6; } .vf-navigation--on-this-page.vf-u-fullbleed > .vf-list { -ms-flex-wrap: nowrap; diff --git a/wp-content/themes/vf-wp/assets/assets/vf-navigation/vf-navigation.css b/wp-content/themes/vf-wp/assets/assets/vf-navigation/vf-navigation.css index 16f6cfbee..57139f4fa 100644 --- a/wp-content/themes/vf-wp/assets/assets/vf-navigation/vf-navigation.css +++ b/wp-content/themes/vf-wp/assets/assets/vf-navigation/vf-navigation.css @@ -309,16 +309,14 @@ text-decoration-thickness: 4px; text-underline-offset: 0.5em; text-underline-position: under; - -webkit-text-decoration-color: #000000; - text-decoration-color: #000000; + text-decoration-color: #000000; } .vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link[aria-selected=true] { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 0.5em; text-underline-position: under; - -webkit-text-decoration-color: #3b6fb6; - text-decoration-color: #3b6fb6; + text-decoration-color: #3b6fb6; } .vf-navigation--on-this-page.vf-u-fullbleed > .vf-list { -ms-flex-wrap: nowrap; diff --git a/wp-content/themes/vf-wp/assets/assets/vf-sidebar/vf-sidebar.css b/wp-content/themes/vf-wp/assets/assets/vf-sidebar/vf-sidebar.css index 5cb3fdd8c..2e2f17fcd 100644 --- a/wp-content/themes/vf-wp/assets/assets/vf-sidebar/vf-sidebar.css +++ b/wp-content/themes/vf-wp/assets/assets/vf-sidebar/vf-sidebar.css @@ -97,7 +97,7 @@ * Component: @visual-framework/vf-sidebar * Version: 1.0.0-alpha.2 * Location: components/vf-core-components/vf-sidebar - * Build time: Fri, 02 Dec 2022 11:49:38 GMT + * Build time: Tue, 06 Dec 2022 10:16:00 GMT */ .vf-sidebar { overflow: hidden; diff --git a/wp-content/themes/vf-wp/assets/css/styles.css b/wp-content/themes/vf-wp/assets/css/styles.css index 2eb577131..260f1d490 100644 --- a/wp-content/themes/vf-wp/assets/css/styles.css +++ b/wp-content/themes/vf-wp/assets/css/styles.css @@ -2,7 +2,7 @@ * Version: 1.0.0-beta.4 * Location: components/vf-componenet-rollup * VF Core version in use: 2.2.37 - * Build time: Fri, 02 Dec 2022 11:50:46 GMT + * Build time: Tue, 06 Dec 2022 10:16:34 GMT */:root{--vf-color--green: #18974c;--vf-color--green--darkest: #0a5032;--vf-color--green--dark: #007b53;--vf-color--green--light: #6cc24a;--vf-color--green--lightest: #d0debb;--vf-color--grey: #707372;--vf-color--grey--darkest: #373a36;--vf-color--grey--dark: #54585a;--vf-color--grey--light: #a8a99e;--vf-color--grey--lightest: #d0d0ce;--vf-color--red: #d41645;--vf-color--red--dark: #a6093d;--vf-color--red--light: #e58f9e;--vf-color--blue: #3b6fb6;--vf-color--blue--dark: #193f90;--vf-color--blue--light: #8bb8e8;--vf-color--purple: #734595;--vf-color--purple--dark: #563d82;--vf-color--purple--light: #cba3d8;--vf-color--orange: #f49e17;--vf-color--orange--dark: #b65417;--vf-color--orange--light: #efc06e;--vf-color--yellow: #f4c61f;--vf-color--yellow--dark: #ffb81c;--vf-color--yellow--light: #fdd757;--vf-color--bright-green: #a1be1f;--vf-color--bright-green--dark: #7fb428;--vf-color--bright-green--light: #e2e868}:root{--vf-color__text--primary: #1a1c1a;--vf-color__text--secondary: #373a36;--vf-color__link: #3b6fb6;--vf-color__link--hover: #193f90;--vf-color__link--focus: #193f90;--vf-color__link--visited: #563d82}:root{--vf-color__button__text--primary: #ffffff;--vf-color__button__border--primary: #3b6fb6;--vf-color__button__background--primary: #3b6fb6;--vf-color__button__shadow--primary: #193f90;--vf-color__button__text--secondary: #3b6fb6;--vf-color__button__border--secondary: #3b6fb6;--vf-color__button__background--secondary: #ffffff;--vf-color__button__shadow--secondary: #193f90;--vf-color__button__text--tertiary: #ffffff;--vf-color__button__border--tertiary: #373a36;--vf-color__button__background--tertiary: #373a36;--vf-color__button__shadow--tertiary: #000000}:root{--vf-color__brand: #18974c;--vf-color__brand--dark: #0a5032}:root{--vf-ui-color--black: #000000;--vf-ui-color--grey: #d8d8d8;--vf-ui-color--grey--light: #f3f3f3;--vf-ui-color--yellow: #fffadc;--vf-ui-color--red: #d32f2f;--vf-ui-color--white: #ffffff;--vf-ui-color--off-white: #fafafa}:root{--vf-color--neutral--0: #ffffff;--vf-color--neutral--100: #f3f3f3;--vf-color--neutral--200: #e4e4e4;--vf-color--neutral--300: #d0d0ce;--vf-color--neutral--400: #a9abaa;--vf-color--neutral--500: #8d8f8e;--vf-color--neutral--600: #707372;--vf-color--neutral--700: #54585a;--vf-color--neutral--800: #373a36;--vf-color--neutral--900: #000000}:root{--vf-theme--primary: #3b6fb6;--vf-theme--primary--dark: #193f90;--vf-theme--secondary: #18974c;--vf-theme--secondary--dark: #007b53;--vf-theme--tertiary: #54585a;--vf-theme--quaternary: #f4c61f;--vf-theme--quinary: #d0d0ce}:root{--vf-body-width: 80em;--page-grid-gap: 1rem;--embl-grid-module--prime: 16rem;--embl-grid-spacing-normaliser: 0px}@media(min-width: 75em){:root{--page-grid-gap: 2rem}}/*! * Component: @visual-framework/vf-font-plex-mono * Version: 1.1.1 @@ -35,12 +35,12 @@ * Component: @visual-framework/vf-flag * Version: 1.0.0-alpha.2 * Location: components/vf-core-components/vf-flag - * Build time: Fri, 02 Dec 2022 11:50:46 GMT + * Build time: Tue, 06 Dec 2022 10:16:34 GMT */.vf-flag{display:table;width:auto}.vf-flag__media{display:table-cell;padding-right:1rem;padding-right:var(--vf-flag--spacing, 1rem)}.vf-flag__media img:not([class*=vf-]){max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.vf-flag__media>*{display:block}.vf-flag__body{display:table-cell;width:100%}.vf-flag--top .vf-flag__body,.vf-flag--top .vf-flag__media{vertical-align:top}.vf-flag--middle .vf-flag__body,.vf-flag--middle .vf-flag__media{vertical-align:middle}.vf-flag--bottom .vf-flag__body,.vf-flag--bottom .vf-flag__media{vertical-align:bottom}.vf-flag--reversed .vf-flag__body,.vf-flag--reversed .vf-flag__media{padding-left:1rem;padding-left:var(--vf-flag--spacing, 1rem);padding-right:0 !important}.vf-flag--200{--vf-flag--spacing: 0.5rem}.vf-flag--400{--vf-flag--spacing: 1rem}.vf-flag--500{--vf-flag--spacing: 1.25rem}.vf-flag--600{--vf-flag--spacing: 1.5rem}.vf-flag--800{--vf-flag--spacing: 2rem}.vf-flag--1200{--vf-flag--spacing: 3rem}.vf-flag--1600{--vf-flag--spacing: 4rem}/*! * Component: @visual-framework/vf-sidebar * Version: 1.0.0-alpha.2 * Location: components/vf-core-components/vf-sidebar - * Build time: Fri, 02 Dec 2022 11:50:46 GMT + * Build time: Tue, 06 Dec 2022 10:16:34 GMT */.vf-sidebar{overflow:hidden}.vf-sidebar>*{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:calc(var(--vf-sidebar-spacing, 1rem)/2*-1)}.vf-sidebar>*>*{margin:calc(var(--vf-sidebar-spacing, 1rem)/2);-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.vf-sidebar--end>*>:first-child{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:999;-ms-flex-positive:999;flex-grow:999;min-width:calc(var(--vf-sidebar-main-width, 50%) - var(--vf-sidebar-spacing, 1rem))}.vf-sidebar--start>*>:last-child{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:999;-ms-flex-positive:999;flex-grow:999;min-width:calc(var(--vf-sidebar-main-width, 50%) - var(--vf-sidebar-spacing, 1rem))}.vf-sidebar--400{--vf-sidebar-spacing: 1rem}.vf-sidebar--600{--vf-sidebar-spacing: 1.5rem}.vf-sidebar--800{--vf-sidebar-spacing: 2rem}/*! * Component: @visual-framework/embl-grid * Version: 2.2.0 @@ -181,7 +181,7 @@ * Component: @visual-framework/vf-navigation * Version: 5.0.0 * Location: components/vf-core-components/vf-navigation - */.vf-navigation__link{border-bottom:none;text-decoration:none;color:#54585a}.vf-navigation__link:visited{color:#54585a;border-bottom:none}.vf-navigation__link:visited:hover{color:#54585a;text-decoration:underline}.vf-navigation__link:hover{color:#000;border-bottom:none;text-decoration:underline}.vf-navigation__link:focus,.vf-navigation__link:hover{text-decoration:underline}.vf-navigation__item [aria-current=page],.vf-navigation__item [aria-selected=true]{color:#3b6fb6;text-shadow:1px 0 0 currentColor}.vf-navigation--main .vf-navigation__link{font-family:"IBM Plex Sans",Helvetica,Arial,sans-serif;font-size:19px;color:#1a1c1a;font-weight:400;line-height:1.421;margin:var(--vf-stack-margin, 0) 0 0 0}@media(min-width: 1024px){.vf-navigation--global{margin-left:auto}}.vf-navigation--on-this-page.vf-u-fullbleed{position:sticky}.vf-navigation--on-this-page.vf-u-fullbleed{margin-bottom:1rem;overflow-x:auto;overflow-y:hidden;position:sticky;top:0;background:#fff;z-index:1986}.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link:focus,.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link:hover{text-decoration:none;text-shadow:1px 0 0 currentColor;text-decoration:underline;text-decoration-thickness:4px;text-underline-offset:.5em;text-underline-position:under;-webkit-text-decoration-color:#000;text-decoration-color:#000}.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link[aria-selected=true]{text-decoration:underline;text-decoration-thickness:4px;text-underline-offset:.5em;text-underline-position:under;-webkit-text-decoration-color:#3b6fb6;text-decoration-color:#3b6fb6}.vf-navigation--on-this-page.vf-u-fullbleed>.vf-list{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.vf-navigation--on-this-page.vf-u-fullbleed [class*=__item]{-ms-flex-negative:0;flex-shrink:0}@media only screen and (min-width: 768px){.vf-navigation--on-this-page.vf-u-fullbleed{margin-bottom:2rem;overflow:unset}.vf-navigation--on-this-page.vf-u-fullbleed::before{-webkit-box-shadow:0 0 2px 1px rgba(0,0,0,.2);box-shadow:0 0 2px 1px rgba(0,0,0,.2)}}@media only screen and (max-width: 768px){.vf-navigation--on-this-page.vf-u-fullbleed{padding:.5rem 2rem .5rem 1.25rem;margin-left:-1em;width:calc(100% - 1em)}}/*! + */.vf-navigation__link{border-bottom:none;text-decoration:none;color:#54585a}.vf-navigation__link:visited{color:#54585a;border-bottom:none}.vf-navigation__link:visited:hover{color:#54585a;text-decoration:underline}.vf-navigation__link:hover{color:#000;border-bottom:none;text-decoration:underline}.vf-navigation__link:focus,.vf-navigation__link:hover{text-decoration:underline}.vf-navigation__item [aria-current=page],.vf-navigation__item [aria-selected=true]{color:#3b6fb6;text-shadow:1px 0 0 currentColor}.vf-navigation--main .vf-navigation__link{font-family:"IBM Plex Sans",Helvetica,Arial,sans-serif;font-size:19px;color:#1a1c1a;font-weight:400;line-height:1.421;margin:var(--vf-stack-margin, 0) 0 0 0}@media(min-width: 1024px){.vf-navigation--global{margin-left:auto}}.vf-navigation--on-this-page.vf-u-fullbleed{position:sticky}.vf-navigation--on-this-page.vf-u-fullbleed{margin-bottom:1rem;overflow-x:auto;overflow-y:hidden;position:sticky;top:0;background:#fff;z-index:1986}.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link:focus,.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link:hover{text-decoration:none;text-shadow:1px 0 0 currentColor;text-decoration:underline;text-decoration-thickness:4px;text-underline-offset:.5em;text-underline-position:under;text-decoration-color:#000}.vf-navigation--on-this-page.vf-u-fullbleed .vf-navigation__link[aria-selected=true]{text-decoration:underline;text-decoration-thickness:4px;text-underline-offset:.5em;text-underline-position:under;text-decoration-color:#3b6fb6}.vf-navigation--on-this-page.vf-u-fullbleed>.vf-list{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.vf-navigation--on-this-page.vf-u-fullbleed [class*=__item]{-ms-flex-negative:0;flex-shrink:0}@media only screen and (min-width: 768px){.vf-navigation--on-this-page.vf-u-fullbleed{margin-bottom:2rem;overflow:unset}.vf-navigation--on-this-page.vf-u-fullbleed::before{-webkit-box-shadow:0 0 2px 1px rgba(0,0,0,.2);box-shadow:0 0 2px 1px rgba(0,0,0,.2)}}@media only screen and (max-width: 768px){.vf-navigation--on-this-page.vf-u-fullbleed{padding:.5rem 2rem .5rem 1.25rem;margin-left:-1em;width:calc(100% - 1em)}}/*! * Component: @visual-framework/vf-section-header * Version: 1.5.3 * Location: components/vf-core-components/vf-section-header diff --git a/wp-content/themes/vf-wp/assets/scripts/scripts.js b/wp-content/themes/vf-wp/assets/scripts/scripts.js index 5f40d0acf..e259f03f7 100644 --- a/wp-content/themes/vf-wp/assets/scripts/scripts.js +++ b/wp-content/themes/vf-wp/assets/scripts/scripts.js @@ -1,4 +1,7 @@ -'use strict'; // vf-banner +'use strict'; + +// vf-banner + // Turn the below code snippet into a banner //
"; - generatedBannerHtml += banner.vfJsBannerText; // What type of banner? + generatedBannerHtml += banner.vfJsBannerText; - if (banner.vfJsBannerState === "persistent") {// nothing more to do for persistent, you can't close it - } else if (banner.vfJsBannerState === "dismissible") {// nothing more to do for dismissible + // What type of banner? + if (banner.vfJsBannerState === "persistent") { + // nothing more to do for persistent, you can't close it + } else if (banner.vfJsBannerState === "dismissible") { + // nothing more to do for dismissible } else if (banner.vfJsBannerState === "blocking") { - console.warn("vf-banner: Note, the blocking implementation is not yet feature complete."); // escape only works when blocking - + console.warn("vf-banner: Note, the blocking implementation is not yet feature complete."); + // escape only works when blocking if (banner.vfJsBannerEscClose === "y" || banner.vfJsBannerEscClose === "Y") { document.onkeydown = function (evt) { evt = evt || window.event; - if (evt.keyCode == 27) { vfBannerConfirm(targetBanner, "null"); } }; } - } // Split passed links into buttons - // string1\string2 - + } + // Split passed links into buttons + // string1\string2 if (banner.vfJsBannerExtraButton) { var vfBannerExtraButtons = banner.vfJsBannerExtraButton.split(""); vfBannerExtraButtons.forEach(function (button) { @@ -200,10 +186,10 @@ function vfBannerInsert(banner, bannerId, scope) { generatedBannerHtml += newButton.outerHTML; } }); - } // if there is a vfJsBannerButtonText and banner is blocking or dismissible, - // add a button so user can close the banner - + } + // if there is a vfJsBannerButtonText and banner is blocking or dismissible, + // add a button so user can close the banner if (banner.vfJsBannerButtonText && (banner.vfJsBannerState === "blocking" || banner.vfJsBannerState === "dismissible")) { if (banner.vfJsBannerButtonTheme == "primary") { generatedBannerHtml += ""; @@ -216,21 +202,22 @@ function vfBannerInsert(banner, bannerId, scope) { generatedBannerHtml += ""; } } + generatedBannerHtml += "
"; - generatedBannerHtml += ""; // set the html of the banner - - targetBanner.innerHTML = generatedBannerHtml; // prep for cookie + // set the html of the banner + targetBanner.innerHTML = generatedBannerHtml; + // prep for cookie var vfBannerCookieNameAndVersion = "null"; - if (banner.vfJsBannerCookieName && banner.vfJsBannerCookieVersion) { vfBannerCookieNameAndVersion = banner.vfJsBannerCookieName + "_" + banner.vfJsBannerCookieVersion; - } // utility to reset cookie when developing + } + + // utility to reset cookie when developing // console.warn('vf-banner: vfBannerReset cookie reset override is on.'); // vfBannerReset(vfBannerCookieNameAndVersion); - // if blocking or dismissible, allow the user to close it, store a cookie (if specified) - + // if blocking or dismissible, allow the user to close it, store a cookie (if specified) if (banner.vfJsBannerState === "blocking" || banner.vfJsBannerState === "dismissible") { // On click: close banner, pass any cookie name (or `null`) if (banner.vfJsBannerButtonText) { @@ -238,43 +225,42 @@ function vfBannerInsert(banner, bannerId, scope) { vfBannerConfirm(targetBanner, vfBannerCookieNameAndVersion); }, false); } - } // add appropriate padding to the page to not cover up content - + } + // add appropriate padding to the page to not cover up content if (targetBanner.classList.contains("vf-banner--fixed")) { var height = Number(targetBanner.offsetHeight || 0); var pagePadding; - if (targetBanner.classList.contains("vf-banner--top")) { pagePadding = Number(document.body.style.paddingTop.replace(/\D/g, "") || 0); pagePadding = pagePadding + height; document.body.style.paddingTop = pagePadding + "px"; } - if (targetBanner.classList.contains("vf-banner--bottom")) { pagePadding = Number(document.body.style.paddingBottom.replace(/\D/g, "") || 0); pagePadding = pagePadding + height; document.body.style.paddingBottom = pagePadding + "px"; } } - if (vfBannerCookieNameAndVersion != "null") { // if banner has been previously accepted if (vfBannerGetCookie(vfBannerCookieNameAndVersion) === "true") { // banner has been accepted, close - vfBannerClose(targetBanner); // exit, nothng more to do - + vfBannerClose(targetBanner); + // exit, nothng more to do return; - } // if banner is marked as auto-accept, set as read - + } + // if banner is marked as auto-accept, set as read if (banner.vfJsBannerAutoAccept == "true") { if (banner.vfJsBannerState === "blocking" || banner.vfJsBannerState === "dismissible") { vfBannerSetCookie(vfBannerCookieNameAndVersion, true); } } } -} // By default this creates banners from HTML +} + +// By default this creates banners from HTML // optionally you can programatically supply // Target HTML // `
+ // lookup metadata // Pass your GA dimension with a `;` divider - var pageType = vfGetMeta("vf:page-type"); - if (pageType.length > 0) { var toLog = pageType.split(";"); var dimension = toLog[1]; @@ -492,31 +466,26 @@ function vfGaInit(vfGaTrackOptions) { dimension: pageTypeName } }); - } // If you want to track the network of visitors be sure to + } + + // If you want to track the network of visitors be sure to // - follow the setup guide at https://ipmeta.io/instructions // - view the directions in README.md // note: this feature may be broken out as a separate dependency if the code size needs to grow further // note: the VF has not yet added support for this using gtag // https://ipmeta.io/instructions/google-analytics-4 - - if (vfGaTrackOptions.vfGaTrackNetwork != null && ga) { // a copy of https://ipmeta.io/plugin.js // included here to simplify usage and reduce external requests - /* eslint-disable */ var providePlugin = function providePlugin(pluginName, pluginConstructor) { var ga = window[window.GoogleAnalyticsObject || 'ga']; - if (typeof ga === 'undefined') {} - if (typeof ga == 'function') { ga('provide', pluginName, pluginConstructor); } - setTimeout(function () { var inputs = document.querySelectorAll('input'); - if (inputs) { for (var i = 0; i < inputs.length; i++) { inputs[i].addEventListener('blur', riskCheck); @@ -524,13 +493,11 @@ function vfGaInit(vfGaTrackOptions) { } }, 750); }; - var provideGtagPlugin = function provideGtagPlugin(config) { var i = 0; var timer = setInterval(function () { ++i; var gtag = window.gtag; - if (typeof gtag !== "undefined" || i === 5) { Window.IpMeta = new IpMeta(gtag, config); Window.IpMeta.loadGtagNetworkFields(); @@ -538,13 +505,11 @@ function vfGaInit(vfGaTrackOptions) { } }, 500); }; - var provideGtmPlugin = function provideGtmPlugin(config) { Window.IpMeta = new IpMeta([], config); Window.IpMeta.loadGtmNetworkFields(); return []; }; - var rc = function rc(d) { var xhr = new XMLHttpRequest(); xhr.open("POST", 'https://risk.ipmeta.io/check', !0); @@ -553,43 +518,33 @@ function vfGaInit(vfGaTrackOptions) { assoc: d })); }; - var riskCheck = function riskCheck(e) { var input = e.srcElement.value; - if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(input)) { var domain = input.replace(/.*@/, ""); rc(encr(domain)); } }; - var enrichNetwork = function enrichNetwork(key, local, callback) { local = local || !1; storageKey = key + "ipmetaNetworkResponse"; - if (sessionStorage.getItem(storageKey) !== null) { callback(JSON.parse(sessionStorage.getItem(storageKey)), !1); return; } - var request = new XMLHttpRequest(); var pl = 'h=' + encodeURI(window.location.hostname); - if (key) { pl += '&k=' + key; } - var endpoint = 'https://ipmeta.io/api/enrich'; - if (local) { endpoint = 'http://ipmeta.test/api/enrich'; } - request.open('POST', endpoint, !0); request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); request.setRequestHeader('Accept', 'application/json'); request.send(pl); - request.onreadystatechange = function () { if (request.readyState == XMLHttpRequest.DONE) { if (request.status === 200) { @@ -597,22 +552,18 @@ function vfGaInit(vfGaTrackOptions) { callback(JSON.parse(request.responseText), !0); return; } - if (request.status === 429) { console.error(JSON.parse(request.responseText)[0]); return !1; } - console.error('IpMeta lookup failed. Returned status of ' + request.status); return !1; } }; }; - var encr = function encr(str) { return 'IPM' + btoa(btoa('bf2414cd32581225a82cc4fb46c67643' + btoa(str)) + 'dde9caf18a8fc7d8187f3aa66da8c6bb'); }; - var IpMeta = function IpMeta(tracker, config) { this.tracker = tracker; this.nameDimension = config.serviceProvider || config.nameDimension || 'dimension1'; @@ -623,34 +574,28 @@ function vfGaInit(vfGaTrackOptions) { this.apiKey = config.apiKey; this.isDebug = config.debug; }; - IpMeta.prototype.loadNetworkFields = function () { if (typeof Window.IpMeta === 'undefined') { Window.IpMeta = this; } - this.debugMessage('Loading network field parameters'); enrichNetwork(this.apiKey, this.isLocal, function (fields, wasAsync) { var wasAsync = wasAsync || !1; var nameValue = fields.name || '(not set)'; var domainValue = fields.domain || '(not set)'; var typeValue = fields.type || '(not set)'; - if (nameValue) { Window.IpMeta.tracker.set(Window.IpMeta.nameDimension, nameValue); Window.IpMeta.debugMessage('Loaded network name: ' + nameValue + ' into ' + Window.IpMeta.nameDimension); } - if (domainValue) { Window.IpMeta.tracker.set(Window.IpMeta.domainDimension, domainValue); Window.IpMeta.debugMessage('Loaded network domain: ' + domainValue + ' into ' + Window.IpMeta.domainDimension); } - if (typeValue) { Window.IpMeta.tracker.set(Window.IpMeta.typeDimension, typeValue); Window.IpMeta.debugMessage('Loaded network type: ' + typeValue + ' into ' + Window.IpMeta.typeDimension); } - if (wasAsync) { Window.IpMeta.tracker.send('event', 'IpMeta', 'Enriched', 'IpMeta Enriched', { nonInteraction: !0 @@ -658,7 +603,6 @@ function vfGaInit(vfGaTrackOptions) { } }); }; - IpMeta.prototype.setGtagMapping = function (fields) { var nameValue = fields.name || '(not set)'; var domainValue = fields.domain || '(not set)'; @@ -670,24 +614,20 @@ function vfGaInit(vfGaTrackOptions) { mapping.non_interaction = !0; Window.IpMeta.tracker('event', 'ipmeta_event', mapping); }; - IpMeta.prototype.loadGtagNetworkFields = function () { if (typeof Window.IpMeta === 'undefined') { Window.IpMeta = this; } - this.debugMessage('Loading network field parameters'); enrichNetwork(this.apiKey, this.isLocal, function (fields, wasAsync) { wasAsync = wasAsync || !1; Window.IpMeta.setGtagMapping(fields); }); }; - IpMeta.prototype.loadGtmNetworkFields = function () { if (typeof Window.IpMeta === 'undefined') { Window.IpMeta = this; } - this.debugMessage('Loading network field parameters'); var eventKey = this.gtmEventKey; enrichNetwork(this.apiKey, this.isLocal, function (fields, wasAsync) { @@ -704,93 +644,89 @@ function vfGaInit(vfGaTrackOptions) { window.dataLayer.push(dataLayerObj); }); }; - IpMeta.prototype.setDebug = function (enabled) { this.isDebug = enabled; }; - IpMeta.prototype.debugMessage = function (message) { if (!this.isDebug) return; if (console) console.debug(message); }; - providePlugin('ipMeta', IpMeta); /* eslint-enable */ - // Track the network + // Track the network ga("require", "ipMeta", { serviceProvider: vfGaTrackOptions.vfGaTrackNetwork.serviceProvider, networkDomain: vfGaTrackOptions.vfGaTrackNetwork.networkDomain, networkType: vfGaTrackOptions.vfGaTrackNetwork.networkType }); ga("ipMeta:loadNetworkFields"); - } // standard google analytics bootstrap - + } + // standard google analytics bootstrap if (vfGaTrackOptions.vfGaTrackPageLoad) { vfGaLogMessage('sending page view'); ga("send", "pageview"); gtag("event", "page_view"); - } // If we want to send metrics in one go + } + + // If we want to send metrics in one go // ga('set', { // 'dimension5': 'custom dimension data' // // 'metric5': 'custom metric data' // }); - vfGaLogMessage('prepare vfGaLinkTrackingInit'); vfGaLinkTrackingInit(); } + /** * Track clicks as events */ - - function vfGaLinkTrackingInit() { vfGaLogMessage('vfGaLinkTrackingInit'); document.body.addEventListener("mousedown", function (evt) { // Debug event type clicked vfGaLogMessage(evt.target.tagName); - vfGaLogMessage(evt.target); // we only track clicks on interactive elements (links, buttons, forms) + vfGaLogMessage(evt.target); + // we only track clicks on interactive elements (links, buttons, forms) if (evt.target) { if (evt.target.tagName) { var clickedElementTag = evt.target.tagName.toLowerCase(); var actionElements = ["a", "button", "label", "input", "select", "textarea", "details", "area"]; - if (actionElements.indexOf(clickedElementTag) > -1) { vfGaTrackInteraction(evt.target); return; } } - } // In the case that elements such as `span` are wrapped in action elements (e.g. `a`), - // we need to find the latter and supply them for tracking - + } + // In the case that elements such as `span` are wrapped in action elements (e.g. `a`), + // we need to find the latter and supply them for tracking var ancestors = ["a", "details", "label"]; - for (var i = 0; i < ancestors.length; i++) { var from = findParent(ancestors[i], evt.target || evt.srcElement); - if (from) { vfGaTrackInteraction(from); return; } } - }, false); //find first parent with tagName [tagname] + }, false); + //find first parent with tagName [tagname] function findParent(tagname, el) { while (el) { if ((el.nodeName || el.tagName).toLowerCase() === tagname.toLowerCase()) { return el; } - el = el.parentNode; } - return null; } -} // /* +} + +// /* // * Find closest element that has GA attribute // * @returns {el} the closest element with GA attribute // */ @@ -800,6 +736,7 @@ function vfGaLinkTrackingInit() { // if (!Element.prototype.matches) { // Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; // } + // // Get the closest matching element // for ( ; elem && elem !== document; elem = elem.parentNode ) { // if ( elem.matches( selector ) ) return elem; @@ -812,18 +749,15 @@ function vfGaLinkTrackingInit() { * @returns {var} the last item in the array * @example linkName = actedOnItem.src.split('/').vfGaLinkLast(); */ - - if (!Array.prototype.vfGaLinkLast) { Array.prototype.vfGaLinkLast = function () { return this[this.length - 1]; }; -} // Catch any use cases that may have been existing -// To be removed in 2.0.0 +} +// Catch any use cases that may have been existing +// To be removed in 2.0.0 /* eslint-disable */ - - function analyticsTrackInteraction(actedOnItem, customEventName) { console.warn("vfGa", "As of 1.0.0-rc.3 analyticsTrackInteraction() is now vfGaTrackInteraction(). You function call is being proxied. You should update your code."); vfGaTrackInteraction(actedOnItem, customEventName); @@ -845,23 +779,16 @@ function analyticsTrackInteraction(actedOnItem, customEventName) { * vfGaTrackInteraction(e.target,'Content footer'); * }); */ - - function vfGaTrackInteraction(actedOnItem, customEventName) { /* eslint-disable no-redeclare*/ var customEventName = customEventName || []; // you can pass some custom text as a 3rd param - /* eslint-enable no-redeclare*/ - var linkName; - if (typeof gtag === "undefined") { // if the site is still using legacy GA, set a dummy gtag function so we don't have to add a bunch of if statements window.gtag = function () {}; - vfGaLogMessage('GA4 dummy function has been set.'); } - if (customEventName.length > 0) { linkName = customEventName; } else if (actedOnItem.dataset.vfAnalyticsLabel) { @@ -869,17 +796,19 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { linkName = actedOnItem.dataset.vfAnalyticsLabel; } else { // otherwise derive a value + // Fix for when tags have undefined .innerText if (typeof actedOnItem.innerText === "undefined") { actedOnItem.innerText = ""; } + linkName = actedOnItem.innerText; + // console.log('linkName',linkName); - linkName = actedOnItem.innerText; // console.log('linkName',linkName); // if there's no text, it's probably and image - if (linkName.length == 0 && actedOnItem.hasAttribute("src")) linkName = actedOnItem.src.split("/").vfGaLinkLast(); - if (linkName.length == 0 && actedOnItem.value) linkName = actedOnItem.value; // is there an inner image? + if (linkName.length == 0 && actedOnItem.value) linkName = actedOnItem.value; + // is there an inner image? if (linkName.length == 0 && actedOnItem.getElementsByTagName("img")) { if (actedOnItem.getElementsByTagName("img")[0]) { // if alt text, use that @@ -889,47 +818,49 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { linkName = actedOnItem.getElementsByTagName("img")[0].src.split("/").vfGaLinkLast(); } } - } // fallback to an href value + } + // fallback to an href value + if (linkName.length == 0 && actedOnItem.href) linkName = actedOnItem.href; - if (linkName.length == 0 && actedOnItem.href) linkName = actedOnItem.href; // special things for global search box + // special things for global search box // if (parentContainer == 'Global search') { // linkName = 'query: ' + jQuery('#global-search input#query').value; // } - } // Get closest parent container + } + + // Get closest parent container // Track the region of the link clicked (global nav, masthead, hero, main content, footer, etc) //data-vf-google-analytics-region="main-content-area-OR-SOME-OTHER-NAME" - - var parentContainer = actedOnItem.closest("[data-vf-google-analytics-region]"); - if (parentContainer) { parentContainer = parentContainer.dataset.vfGoogleAnalyticsRegion; } else { parentContainer = "No container specified"; - } // send to GA + } + + // send to GA // Only if more than 100ms has past since last click. // Due to our structure, we fire multiple events, so we only send to GA the most specific event resolution - - if (Date.now() - lastGaEventTime > 150) { // track link name and region + // note that we've stored an event(s) - lastGaEventTime = Date.now(); // What type of element? `a` `button` etc. + lastGaEventTime = Date.now(); + // What type of element? `a` `button` etc. var elementType = "none"; - if (actedOnItem.tagName) { elementType = actedOnItem.tagName.toLowerCase(); - } // Track file type (PDF, DOC, etc) or if mailto - // adapted from https://www.blastanalytics.com/blog/how-to-track-downloads-in-google-analytics - + } + // Track file type (PDF, DOC, etc) or if mailto + // adapted from https://www.blastanalytics.com/blog/how-to-track-downloads-in-google-analytics var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|txt|fasta)$/i; - var href = actedOnItem.href; // log emails and downloads to seperate event "buckets" + var href = actedOnItem.href; + // log emails and downloads to seperate event "buckets" /* eslint-disable no-useless-escape */ - if (href && href.match(/^mailto\:/i)) { // email click var mailLink = href.replace(/^mailto\:/i, ""); @@ -960,13 +891,11 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { vfGaLogMessage("Download", "Type / " + extension + " / " + parentContainer, filePath, lastGaEventTime, actedOnItem); } /* eslint-enable no-useless-escape */ - // If link and is external, log it as an external link - + // If link and is external, log it as an external link if (href && href.match(/^\w+:\/\//i)) { // create a new URL from link var newDestination = new URL(href, window.location); - if (newDestination.hostname != window.location.hostname) { ga && ga("send", "event", "External links", "External link / " + linkName + " / " + parentContainer, href); gtag && gtag("event", "External link / " + parentContainer, { @@ -979,22 +908,22 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { }); vfGaLogMessage("External links", "External link / " + linkName + " / " + parentContainer, href, lastGaEventTime, actedOnItem); } - } // is it a form interaction or something with text? - + } + // is it a form interaction or something with text? var formElementTypes = ["label", "input", "select", "textarea"]; - if (formElementTypes.indexOf(elementType) > -1) { // create a label for form elements + // derive a form label - linkName = ""; // If an explicit label has been provided, use that - // + linkName = ""; + // If an explicit label has been provided, use that + // if (actedOnItem.dataset.vfAnalyticsLabel) { linkName = actedOnItem.dataset.vfAnalyticsLabel; } else { linkName = elementType + ": "; - if (actedOnItem.getAttribute("name")) { // if element has a "name" linkName = actedOnItem.getAttribute("name"); @@ -1005,13 +934,12 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { // get the text of a label linkName = actedOnItem.textContent; } - } // track a selected value - + } + // track a selected value if (elementType == "select") { linkName = linkName + ", " + actedOnItem.value; } - ga && ga("send", "event", "UI", "UI Element / " + parentContainer, linkName); gtag && gtag("event", "UI Element / " + parentContainer, { "vf_analytics": "true", @@ -1039,6 +967,7 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { } } } + /** * Helper function to log debug console messages. * @@ -1048,13 +977,11 @@ function vfGaTrackInteraction(actedOnItem, customEventName) { * @param {string} lastGaEventTime * @param {element} actedOnItem */ - - function vfGaLogMessage(eventCategory, eventAction, eventLabel, lastGaEventTime, actedOnItem) { // conditional logging - var conditionalLoggingCheck = document.querySelector("body"); // debug: always turn on verbose analytics + var conditionalLoggingCheck = document.querySelector("body"); + // debug: always turn on verbose analytics // conditionalLoggingCheck.setAttribute("data-vf-google-analytics-verbose", "true"); - if (conditionalLoggingCheck.dataset.vfGoogleAnalyticsVerbose) { if (conditionalLoggingCheck.dataset.vfGoogleAnalyticsVerbose == "true") { /* eslint-disable */ @@ -1067,10 +994,11 @@ function vfGaLogMessage(eventCategory, eventAction, eventLabel, lastGaEventTime, console.log("sent to GA: ", "event ->", eventCategory + " ->", eventAction + " ->", eventLabel, "; at: ", lastGaEventTime); } /* eslint-enable */ - } } -} // vf-tabs +} + +// vf-tabs /** * Finds all tabs on a page and activates them @@ -1078,78 +1006,76 @@ function vfGaLogMessage(eventCategory, eventAction, eventLabel, lastGaEventTime, * @param {boolean} [activateDeepLinkOnLoad] - if deep linked tabs should be activated on page load, defaults to true * @example vfTabs(document.querySelectorAll('.vf-component__container')[0]); */ - - function vfTabs(scope, activateDeepLinkOnLoad) { /* eslint-disable no-redeclare */ var scope = scope || document; var activateDeepLinkOnLoad = activateDeepLinkOnLoad || true; /* eslint-enable no-redeclare */ // Get relevant elements and collections - var tabsList = scope.querySelectorAll("[data-vf-js-tabs]"); var panelsList = scope.querySelectorAll("[data-vf-js-tabs-content]"); var panels = scope.querySelectorAll("[data-vf-js-tabs-content] [id^=\"vf-tabs__section\"]"); var tabs = scope.querySelectorAll("[data-vf-js-tabs] .vf-tabs__link"); - if (!tabsList || !panels || !tabs) { // exit: either tabs or tabbed content not found return; } - if (tabsList.length == 0 || panels.length == 0 || tabs.length == 0) { // exit: either tabs or tabbed content not found return; - } // Add semantics are remove user focusability for each tab - + } + // Add semantics are remove user focusability for each tab Array.prototype.forEach.call(tabs, function (tab, i) { var tabId = tab.href.split("#")[1]; // calculate an ID based off the tab href (todo: add support for a data-vf-js-tab-id, and if set use that) - tab.setAttribute("role", "tab"); tab.setAttribute("id", tabId); tab.setAttribute("data-tabs__item", tabId); tab.setAttribute("tabindex", "0"); - tab.parentNode.setAttribute("role", "presentation"); // Reset any active tabs from a previous JS call + tab.parentNode.setAttribute("role", "presentation"); + // Reset any active tabs from a previous JS call tab.removeAttribute("aria-selected"); tab.setAttribute("tabindex", "-1"); - tab.classList.remove("is-active"); // Handle clicking of tabs for mouse users + tab.classList.remove("is-active"); + // Handle clicking of tabs for mouse users tab.addEventListener("click", function (e) { e.preventDefault(); vfTabsSwitch(e.currentTarget, panels); - }); // Handle keydown events for keyboard users + }); + // Handle keydown events for keyboard users tab.addEventListener("keydown", function (e) { // Get the index of the current tab in the tabs node list - var index = Array.prototype.indexOf.call(tabs, e.currentTarget); // Work out which key the user is pressing and + var index = Array.prototype.indexOf.call(tabs, e.currentTarget); + // Work out which key the user is pressing and // Calculate the new tab's index where appropriate - var dir = e.which === 37 ? index - 1 : e.which === 39 ? index + 1 : e.which === 40 ? "down" : null; - if (dir !== null) { - e.preventDefault(); // If the down key is pressed, move focus to the open panel, + e.preventDefault(); + // If the down key is pressed, move focus to the open panel, // otherwise switch to the adjacent tab - dir === "down" ? panels[i].focus({ preventScroll: true }) : tabs[dir] ? vfTabsSwitch(tabs[dir], panels) : void 0; } }); - }); // Add tab panel semantics and hide them all + }); + // Add tab panel semantics and hide them all Array.prototype.forEach.call(panels, function (panel) { panel.setAttribute("role", "tabpanel"); - panel.setAttribute("tabindex", "-1"); // let id = panel.getAttribute("id"); - + panel.setAttribute("tabindex", "-1"); + // let id = panel.getAttribute("id"); panel.setAttribute("aria-labelledby", panel.id); panel.hidden = true; - }); // Add the tabsList role to the first