@comicrelief/storybook 1.34.2 → 2.0.0
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/README.md +1 -0
- package/build/index.js +3 -3
- package/package.json +2 -2
- package/src/components/BrowserSupportMessage/BrowserSupport.scss +9 -9
- package/src/components/CookieConsentMessage/CookieConsent.scss +13 -13
- package/src/components/Footer/Footer.js +1 -2
- package/src/components/Footer/footer.scss +9 -9
- package/src/components/Footer/package.json +1 -2
- package/src/components/GrantsNearYou/GrantsNearYou.scss +9 -9
- package/src/components/JustInTime/JustInTime.scss +6 -6
- package/src/components/RadioButtons/RadioButtons.scss +9 -9
- package/src/components/SVG/instagram.svg +18 -0
- package/src/components/SVG/spritesheet.svg +142 -0
- package/src/components/SchoolsLookUp/SchoolsLookUp.scss +11 -11
- package/src/components/SocialLink/SocialLink.js +2 -2
- package/src/components/SocialLink/package.json +1 -2
- package/src/sass/base/_components.scss +66 -0
- package/src/sass/base/_core.scss +12 -0
- package/src/sass/base/_variables.scss +9 -0
- package/src/sass/base/components/animations/_animations.scss +37 -0
- package/src/sass/base/components/animations/animations.twig +1 -0
- package/src/sass/base/components/background-colours/_background-colours.scss +105 -0
- package/src/sass/base/components/background-colours/background-colours.twig +28 -0
- package/src/sass/base/components/background-single-msg/_background-single-msg.scss +69 -0
- package/src/sass/base/components/background-single-msg/background-single-msg.twig +16 -0
- package/src/sass/base/components/banners/_card-banner.scss +87 -0
- package/src/sass/base/components/banners/card-banner.json +5 -0
- package/src/sass/base/components/banners/card-banner.twig +13 -0
- package/src/sass/base/components/buttons/_buttons.scss +158 -0
- package/src/sass/base/components/buttons/buttons.twig +4 -0
- package/src/sass/base/components/card-block/_card.scss +85 -0
- package/src/sass/base/components/card-block/card.json +5 -0
- package/src/sass/base/components/card-block/card.twig +13 -0
- package/src/sass/base/components/cards/_cards.scss +55 -0
- package/src/sass/base/components/cards/cards.twig +19 -0
- package/src/sass/base/components/content-block/_content-block.scss +67 -0
- package/src/sass/base/components/content-block/content-block.twig +20 -0
- package/src/sass/base/components/content-wall/_content-wall.scss +57 -0
- package/src/sass/base/components/content-wall/content-wall.twig +211 -0
- package/src/sass/base/components/cookie-consent/_cookie-consent.scss +116 -0
- package/src/sass/base/components/cookie-consent/cookie-consent.json +7 -0
- package/src/sass/base/components/cookie-consent/cookie-consent.twig +7 -0
- package/src/sass/base/components/custom-block/_custom-block.scss +16 -0
- package/src/sass/base/components/demo/_demo.scss +5 -0
- package/src/sass/base/components/demo/demo.json +5 -0
- package/src/sass/base/components/demo/demo.twig +14 -0
- package/src/sass/base/components/email-signup/_email-signup-head.scss +163 -0
- package/src/sass/base/components/email-signup/_email-signup.scss +835 -0
- package/src/sass/base/components/email-signup/email-signup-fundraise.twig +33 -0
- package/src/sass/base/components/email-signup/email-signup-header.twig +38 -0
- package/src/sass/base/components/email-signup/email-signup-interest.twig +35 -0
- package/src/sass/base/components/email-signup/email-signup-standard.twig +50 -0
- package/src/sass/base/components/email-signup/email-signup-workplace.twig +39 -0
- package/src/sass/base/components/email-signup/images/arrow-right.svg +6 -0
- package/src/sass/base/components/email-signup/images/cross-close.svg +5 -0
- package/src/sass/base/components/email-signup/images/error-icon.png +0 -0
- package/src/sass/base/components/email-signup/images/error-red-cross.svg +7 -0
- package/src/sass/base/components/email-signup/images/esuEmailIconLarge.png +0 -0
- package/src/sass/base/components/email-signup/images/esuEmailIconSmall.png +0 -0
- package/src/sass/base/components/email-signup/images/fixedplaceholder-register-interest-bg-1x.png +0 -0
- package/src/sass/base/components/email-signup/images/fixedplaceholder-register-interest-bg-2x.png +0 -0
- package/src/sass/base/components/email-signup/images/fixedplaceholder-register-interest-bg-sm-1x.png +0 -0
- package/src/sass/base/components/email-signup/images/fixedplaceholder-register-interest-bg-sm-2x.png +0 -0
- package/src/sass/base/components/external-link/_external-link.scss +16 -0
- package/src/sass/base/components/feature-articles-block/_feature-articles-block.scss +30 -0
- package/src/sass/base/components/feature-articles-block/feature-articles-block.twig +14 -0
- package/src/sass/base/components/footer/_footer.scss +39 -0
- package/src/sass/base/components/footer/footer.twig +24 -0
- package/src/sass/base/components/form/_form.scss +132 -0
- package/src/sass/base/components/form/_standard-form.scss +361 -0
- package/src/sass/base/components/form/form.twig +146 -0
- package/src/sass/base/components/form/images/checkbox-white-tick.png +0 -0
- package/src/sass/base/components/form/images/error-alert-icon.png +0 -0
- package/src/sass/base/components/fundraising-target/_fundraising-target.scss +99 -0
- package/src/sass/base/components/fundraising-target/fundraising-target.twig +23 -0
- package/src/sass/base/components/grants-near-you/__grants-near-you.scss +111 -0
- package/src/sass/base/components/grid/_grid.scss +73 -0
- package/src/sass/base/components/grid/grid.twig +108 -0
- package/src/sass/base/components/header/_base-header.scss +52 -0
- package/src/sass/base/components/header/base_header.twig +8 -0
- package/src/sass/base/components/iframe-block/_iframe-block.scss +64 -0
- package/src/sass/base/components/just-in-time-block/_just-in-time.scss +90 -0
- package/src/sass/base/components/just-in-time-block/just-in-time-block.twig +11 -0
- package/src/sass/base/components/lightcase/_lightcase.scss +482 -0
- package/src/sass/base/components/links/_links.scss +42 -0
- package/src/sass/base/components/links/links.twig +9 -0
- package/src/sass/base/components/list/_list.scss +37 -0
- package/src/sass/base/components/media/_media.scss +37 -0
- package/src/sass/base/components/media-block/_media-block.scss +84 -0
- package/src/sass/base/components/media-block/js/media-block.js +31 -0
- package/src/sass/base/components/media-block/media-block.twig +31 -0
- package/src/sass/base/components/meta-icons/_meta-icons.scss +74 -0
- package/src/sass/base/components/meta-icons/meta-icons.twig +20 -0
- package/src/sass/base/components/navigation/SR18_logo_date_blacktext.svg +90 -0
- package/src/sass/base/components/navigation/SR18_logo_date_whitetext.svg +91 -0
- package/src/sass/base/components/navigation/_feature-nav.scss +150 -0
- package/src/sass/base/components/navigation/_footer-nav.scss +37 -0
- package/src/sass/base/components/navigation/_hamburger-menu-button.scss +108 -0
- package/src/sass/base/components/navigation/_main-nav.scss +248 -0
- package/src/sass/base/components/navigation/feature-nav-open.twig +22 -0
- package/src/sass/base/components/navigation/feature-nav.twig +46 -0
- package/src/sass/base/components/navigation/footer-nav.twig +16 -0
- package/src/sass/base/components/navigation/js/main-nav.js +173 -0
- package/src/sass/base/components/navigation/main-nav.twig +82 -0
- package/src/sass/base/components/news-article/_news-article.scss +128 -0
- package/src/sass/base/components/news-article/_press-release-article.scss +21 -0
- package/src/sass/base/components/news-article/news-article.twig +60 -0
- package/src/sass/base/components/news-article/press-release-article.twig +54 -0
- package/src/sass/base/components/news-overview/_news.scss +118 -0
- package/src/sass/base/components/news-overview/news.twig +256 -0
- package/src/sass/base/components/news-overview/news_press-releases.twig +148 -0
- package/src/sass/base/components/news-teaser/_news-article-teaser.scss +132 -0
- package/src/sass/base/components/news-teaser/_news-teaser.scss +42 -0
- package/src/sass/base/components/news-teaser/images/copyvideo--play-icon.svg +13 -0
- package/src/sass/base/components/news-teaser/images/copyvideo--play-icon__hover.svg +15 -0
- package/src/sass/base/components/news-teaser/images/play-icon.svg +5 -0
- package/src/sass/base/components/news-teaser/images/press-logos.png +0 -0
- package/src/sass/base/components/news-teaser/news-teaser.twig +15 -0
- package/src/sass/base/components/pagination/_pagination.scss +50 -0
- package/src/sass/base/components/pagination/pagination.twig +29 -0
- package/src/sass/base/components/paragraph--cr-single-message-row/_paragraph--cr-single-message-row.scss +170 -0
- package/src/sass/base/components/partners/_partners.scss +62 -0
- package/src/sass/base/components/partners/partners.twig +25 -0
- package/src/sass/base/components/partners-grid/_partners-grid.scss +97 -0
- package/src/sass/base/components/partners-grid/partners-grid.twig +121 -0
- package/src/sass/base/components/partners-row/_partners-row.scss +54 -0
- package/src/sass/base/components/partners-row/partners-row.twig +18 -0
- package/src/sass/base/components/postcode-lookup/_postcode-lookup.scss +74 -0
- package/src/sass/base/components/postcode-lookup/postcode-lookup.twig +56 -0
- package/src/sass/base/components/progress-bar/_progress-bar.scss +120 -0
- package/src/sass/base/components/progress-bar/images/navbar-sprite.png +0 -0
- package/src/sass/base/components/progress-bar/progress-bar.twig +23 -0
- package/src/sass/base/components/progress-indicator/_progress-indicator.scss +119 -0
- package/src/sass/base/components/progress-indicator/progress-indicator.twig +28 -0
- package/src/sass/base/components/promo-header/_promo-header.scss +244 -0
- package/src/sass/base/components/promo-header/promo-header.twig +16 -0
- package/src/sass/base/components/quote-block/_content-wall-quote.scss +109 -0
- package/src/sass/base/components/quote-block/content-wall-quote.twig +18 -0
- package/src/sass/base/components/related-articles/_related-articles.scss +34 -0
- package/src/sass/base/components/schools-look-up/_schools-look-up.scss +93 -0
- package/src/sass/base/components/search/_search-block.scss +182 -0
- package/src/sass/base/components/search/images/magnify.svg +11 -0
- package/src/sass/base/components/search/images/search_page_icon.png +0 -0
- package/src/sass/base/components/search/images/search_page_icon_hover.png +0 -0
- package/src/sass/base/components/search/search.twig +26 -0
- package/src/sass/base/components/search-results/_search-result.scss +163 -0
- package/src/sass/base/components/search-results/search-results.twig +211 -0
- package/src/sass/base/components/selectbox/_selectbox.scss +471 -0
- package/src/sass/base/components/single-msg/_single-msg.scss +345 -0
- package/src/sass/base/components/single-msg/single-msg.twig +27 -0
- package/src/sass/base/components/social/_social.scss +74 -0
- package/src/sass/base/components/social/social-following.twig +39 -0
- package/src/sass/base/components/social/social-sharing.twig +23 -0
- package/src/sass/base/components/story/_story.scss +309 -0
- package/src/sass/base/components/story/_story.twig +53 -0
- package/src/sass/base/components/svg/instagram.svg +18 -0
- package/src/sass/base/components/svg/spritesheet.svg +142 -0
- package/src/sass/base/components/table/_table.scss +8 -0
- package/src/sass/base/components/table/table.twig +48 -0
- package/src/sass/base/components/teaser-block/_teaser-block.scss +156 -0
- package/src/sass/base/components/teaser-block/teaser-block.twig +17 -0
- package/src/sass/base/components/teaser-block/teaser-row.twig +128 -0
- package/src/sass/base/components/tooltips/_tooltips.scss +46 -0
- package/src/sass/base/components/typography/_typography.scss +99 -0
- package/src/sass/base/components/typography/typography.twig +25 -0
- package/src/sass/base/components/views/_views.scss +11 -0
- package/src/sass/base/core/_base-1-mixins.scss +327 -0
- package/src/sass/base/core/_base-breakpoints.scss +56 -0
- package/src/sass/base/core/_base-common.scss +8 -0
- package/src/sass/base/core/_base-fonts.scss +81 -0
- package/src/sass/base/core/_base-grid.scss +1 -0
- package/src/sass/base/core/_base-helper.scss +4 -0
- package/src/sass/base/core/_base-layout.scss +4 -0
- package/src/sass/base/core/_base-reset.scss +37 -0
- package/src/sass/base/helpers/_js-breakpoint-class-helper.scss +10 -0
- package/src/sass/base/variables/_colours.scss +43 -0
- package/src/sass/base/variables/_grid.scss +51 -0
- package/src/sass/base/variables/_lists.scss +66 -0
- package/src/sass/base/variables/_theme.scss +3 -0
- package/src/sass/base/variables/_typography.scss +88 -0
- package/src/sass/base/variables/colour.twig +82 -0
- package/src/sass/themes/base/base-styleguide.scss +497 -0
- package/src/sass/themes/base/base.scss +8 -0
- package/src/sass/themes/cr/2017/_cr17-components.scss +47 -0
- package/src/sass/themes/cr/2017/_cr17-styleguide.scss +522 -0
- package/src/sass/themes/cr/2017/components/background-colours/_background-colours.scss +104 -0
- package/src/sass/themes/cr/2017/components/background-colours/background-colours.twig +25 -0
- package/src/sass/themes/cr/2017/components/buttons/_buttons.scss +67 -0
- package/src/sass/themes/cr/2017/components/buttons/buttons.twig +39 -0
- package/src/sass/themes/cr/2017/components/content-block/_content-block.scss +5 -0
- package/src/sass/themes/cr/2017/components/content-block/content-block.twig +20 -0
- package/src/sass/themes/cr/2017/components/content-wall/content-wall.twig +213 -0
- package/src/sass/themes/cr/2017/components/cookie-consent/_cookie-consent.scss +18 -0
- package/src/sass/themes/cr/2017/components/cookie-consent/cookie-consent.json +7 -0
- package/src/sass/themes/cr/2017/components/cookie-consent/cookie-consent.twig +4 -0
- package/src/sass/themes/cr/2017/components/email-signup/_email-signup-head.scss +5 -0
- package/src/sass/themes/cr/2017/components/highlight/_highlight.scss +35 -0
- package/src/sass/themes/cr/2017/components/highlight/highlight.twig +1 -0
- package/src/sass/themes/cr/2017/components/just-in-time-block/_just-in-time-block.scss +6 -0
- package/src/sass/themes/cr/2017/components/links/_links.scss +43 -0
- package/src/sass/themes/cr/2017/components/links/links.twig +26 -0
- package/src/sass/themes/cr/2017/components/loading/_loading.scss +101 -0
- package/src/sass/themes/cr/2017/components/media-block/_media-block.scss +16 -0
- package/src/sass/themes/cr/2017/components/media-block/media-block.twig +31 -0
- package/src/sass/themes/cr/2017/components/meta-icons/_meta-icons.scss +64 -0
- package/src/sass/themes/cr/2017/components/navigation/_expanded-footer.scss +291 -0
- package/src/sass/themes/cr/2017/components/navigation/_main-nav.scss +365 -0
- package/src/sass/themes/cr/2017/components/navigation/cr18-logo.png +0 -0
- package/src/sass/themes/cr/2017/components/navigation/expanded-footer.twig +180 -0
- package/src/sass/themes/cr/2017/components/navigation/footer-nav.twig +116 -0
- package/src/sass/themes/cr/2017/components/navigation/js/expanded-footer.js +31 -0
- package/src/sass/themes/cr/2017/components/news-teaser/images/news-default-img.jpg +0 -0
- package/src/sass/themes/cr/2017/components/news-teaser/news-teaser.twig +15 -0
- package/src/sass/themes/cr/2017/components/single-msg/_single-msg.scss +238 -0
- package/src/sass/themes/cr/2017/components/single-msg/single-msg.twig +125 -0
- package/src/sass/themes/cr/2017/components/typography/_fonts.scss +192 -0
- package/src/sass/themes/cr/2017/components/typography/_typography.scss +83 -0
- package/src/sass/themes/cr/2017/components/typography/typography.twig +116 -0
- package/src/sass/themes/cr/2017/cr17.scss +104 -0
- package/src/sass/themes/cr/2017/variables/_colours.scss +20 -0
- package/src/sass/themes/cr/2017/variables/_mixins.scss +56 -0
- package/src/sass/themes/cr/2017/variables/_typography.scss +86 -0
- package/src/sass/themes/cr/2017/variables/colour.twig +51 -0
- package/src/sass/themes/cr/2019/_cr19-components.scss +65 -0
- package/src/sass/themes/cr/2019/_cr19-styleguide.scss +654 -0
- package/src/sass/themes/cr/2019/components/background-colours/_background-colours.scss +340 -0
- package/src/sass/themes/cr/2019/components/background-colours/background-colours.twig +100 -0
- package/src/sass/themes/cr/2019/components/bg-video-copy/_bg-video-copy.scss +206 -0
- package/src/sass/themes/cr/2019/components/bg-video-copy/bg-video-copy.twig +16 -0
- package/src/sass/themes/cr/2019/components/bg-video-copy/js/bg-video-copy.js +72 -0
- package/src/sass/themes/cr/2019/components/bg-video-copy/videos/SR18-promo.mp4 +0 -0
- package/src/sass/themes/cr/2019/components/buttons/_buttons.scss +174 -0
- package/src/sass/themes/cr/2019/components/buttons/buttons.twig +128 -0
- package/src/sass/themes/cr/2019/components/content-block/_content-block.scss +5 -0
- package/src/sass/themes/cr/2019/components/content-block/content-block.twig +20 -0
- package/src/sass/themes/cr/2019/components/content-wall/_content-wall.scss +6 -0
- package/src/sass/themes/cr/2019/components/content-wall/content-wall.twig +213 -0
- package/src/sass/themes/cr/2019/components/cookie-consent/cookie-consent.json +7 -0
- package/src/sass/themes/cr/2019/components/cookie-consent/cookie-consent.twig +7 -0
- package/src/sass/themes/cr/2019/components/copy-copy/_copy-copy.scss +57 -0
- package/src/sass/themes/cr/2019/components/copy-copy/copy-copy.twig +22 -0
- package/src/sass/themes/cr/2019/components/copy-video/_copy-video.scss +152 -0
- package/src/sass/themes/cr/2019/components/copy-video/copy-video.twig +47 -0
- package/src/sass/themes/cr/2019/components/copy-video/js/copy-video.js +62 -0
- package/src/sass/themes/cr/2019/components/email-signup/_email-signup-head.scss +5 -0
- package/src/sass/themes/cr/2019/components/fixed-ratio-image/_fixed-ratio-image.scss +63 -0
- package/src/sass/themes/cr/2019/components/fixed-ratio-image/fixed-ratio-image.twig +10 -0
- package/src/sass/themes/cr/2019/components/full-height-double-image-single-copy/_full-height-double-image-single-copy.scss +107 -0
- package/src/sass/themes/cr/2019/components/full-height-double-image-single-copy/full-height-double-image-single-copy.twig +23 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image/_full-height-single-image.scss +138 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image/full-height-single-image.twig +12 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image-single-copy/_full-height-single-image-single-copy.scss +72 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image-single-copy/full-height-single-image-single-copy.twig +14 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image-triple-copy/_full-height-single-image-triple-copy.scss +158 -0
- package/src/sass/themes/cr/2019/components/full-height-single-image-triple-copy/full-height-single-image-triple-copy.twig +24 -0
- package/src/sass/themes/cr/2019/components/grant-page/_grant-page.scss +18 -0
- package/src/sass/themes/cr/2019/components/highlight/_highlight.scss +38 -0
- package/src/sass/themes/cr/2019/components/highlight/highlight.twig +1 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/_inline-social-icons.scss +43 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/images/ig-icon--dark.svg +17 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/images/ig-icon--light.svg +17 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/images/twitter-icon--dark.svg +9 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/images/twitter-icon--light.svg +9 -0
- package/src/sass/themes/cr/2019/components/inline-social-icons/inline-social-icons.twig +21 -0
- package/src/sass/themes/cr/2019/components/just-in-time-block/_just-in-time-block.scss +15 -0
- package/src/sass/themes/cr/2019/components/links/_links.scss +42 -0
- package/src/sass/themes/cr/2019/components/links/links.twig +28 -0
- package/src/sass/themes/cr/2019/components/list/_list.scss +3 -0
- package/src/sass/themes/cr/2019/components/loading/_loading.scss +101 -0
- package/src/sass/themes/cr/2019/components/media-block/_media-block.scss +16 -0
- package/src/sass/themes/cr/2019/components/media-block/media-block.twig +31 -0
- package/src/sass/themes/cr/2019/components/membership-signup/_membership-signup.scss +447 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/drop-down-white.svg +9 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership-LG.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership-MD.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership-SM.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership2-LG.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership2-md.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/images/membership2-sm.jpg +0 -0
- package/src/sass/themes/cr/2019/components/membership-signup/js/membership-signup.js +490 -0
- package/src/sass/themes/cr/2019/components/membership-signup/membership-signup.twig +103 -0
- package/src/sass/themes/cr/2019/components/meta-icons/_meta-icons.scss +64 -0
- package/src/sass/themes/cr/2019/components/navigation/_expanded-footer.scss +280 -0
- package/src/sass/themes/cr/2019/components/navigation/_main-nav.scss +459 -0
- package/src/sass/themes/cr/2019/components/navigation/cr18-logo.png +0 -0
- package/src/sass/themes/cr/2019/components/navigation/expanded-footer.twig +167 -0
- package/src/sass/themes/cr/2019/components/navigation/footer-nav.twig +116 -0
- package/src/sass/themes/cr/2019/components/navigation/js/expanded-footer.js +31 -0
- package/src/sass/themes/cr/2019/components/navigation/main-nav.twig +97 -0
- package/src/sass/themes/cr/2019/components/news/_news.scss +6 -0
- package/src/sass/themes/cr/2019/components/news-teaser/_news-article-teaser.scss +13 -0
- package/src/sass/themes/cr/2019/components/news-teaser/images/news-default-img--v2.jpg +0 -0
- package/src/sass/themes/cr/2019/components/news-teaser/news-teaser.twig +15 -0
- package/src/sass/themes/cr/2019/components/single-msg/_single-msg.scss +242 -0
- package/src/sass/themes/cr/2019/components/single-msg/single-msg.twig +125 -0
- package/src/sass/themes/cr/2019/components/typography/_fonts.scss +1 -0
- package/src/sass/themes/cr/2019/components/typography/_typography.scss +188 -0
- package/src/sass/themes/cr/2019/components/typography/typography.twig +128 -0
- package/src/sass/themes/cr/2019/cr19.scss +104 -0
- package/src/sass/themes/cr/2019/form.twig +133 -0
- package/src/sass/themes/cr/2019/variables/_colours.scss +48 -0
- package/src/sass/themes/cr/2019/variables/_mixins.scss +44 -0
- package/src/sass/themes/cr/2019/variables/_typography.scss +81 -0
- package/src/sass/themes/cr/2019/variables/colour.twig +162 -0
- package/src/sass/themes/donate/_donate-styleguide.scss +18 -0
- package/src/sass/themes/donate/components/background-colours/_background-colours.scss +9 -0
- package/src/sass/themes/donate/components/banner/_banner.scss +10 -0
- package/src/sass/themes/donate/components/buttons/_buttons.scss +122 -0
- package/src/sass/themes/donate/components/cards/_cards.scss +72 -0
- package/src/sass/themes/donate/components/cards/images/aziza-card.jpg +0 -0
- package/src/sass/themes/donate/components/cards/images/georgia-card.jpg +0 -0
- package/src/sass/themes/donate/components/cards/images/kevin-card.jpg +0 -0
- package/src/sass/themes/donate/components/form/_form.scss +287 -0
- package/src/sass/themes/donate/components/form/images/gift_aid_logo--white.png +0 -0
- package/src/sass/themes/donate/components/form/images/gift_aid_logo.png +0 -0
- package/src/sass/themes/donate/components/full-height-single-image-single-copy/_full-height-single-image-single-copy.scss +234 -0
- package/src/sass/themes/donate/components/giving-type-selector/_giving-type-selector.scss +120 -0
- package/src/sass/themes/donate/components/header/_header.scss +41 -0
- package/src/sass/themes/donate/components/money-buy-block/_money-buy-block.scss +272 -0
- package/src/sass/themes/donate/components/partner-footer/_partner-footer.scss +43 -0
- package/src/sass/themes/donate/components/success/_success.scss +137 -0
- package/src/sass/themes/donate/components/typography/_fonts.scss +1 -0
- package/src/sass/themes/donate/components/typography/_typography.scss +188 -0
- package/src/sass/themes/donate/donate-page.twig +504 -0
- package/src/sass/themes/donate/donate.scss +72 -0
- package/src/sass/themes/donate/failure-page.twig +31 -0
- package/src/sass/themes/donate/success-page.twig +83 -0
- package/src/sass/themes/donate/variables/_colours.scss +33 -0
- package/src/sass/themes/donate/variables/_mixins.scss +36 -0
- package/src/sass/themes/donate/variables/_typography.scss +89 -0
- package/src/sass/themes/frost/_frost-styleguide.scss +150 -0
- package/src/sass/themes/frost/core/_frost-components.scss +0 -0
- package/src/sass/themes/frost/core/_frost-variables.scss +0 -0
- package/src/sass/themes/frost/core/components/_background-images.scss +29 -0
- package/src/sass/themes/frost/core/components/_buttons.scss +57 -0
- package/src/sass/themes/frost/core/components/_campaign-images.scss +54 -0
- package/src/sass/themes/frost/core/components/_cookie-consent.scss +55 -0
- package/src/sass/themes/frost/core/components/_font-awesome.scss +17 -0
- package/src/sass/themes/frost/core/components/_footer.scss +28 -0
- package/src/sass/themes/frost/core/components/_form.scss +695 -0
- package/src/sass/themes/frost/core/components/_gpLink.scss +70 -0
- package/src/sass/themes/frost/core/components/_header.scss +39 -0
- package/src/sass/themes/frost/core/components/_layout.scss +124 -0
- package/src/sass/themes/frost/core/components/_modal.scss +53 -0
- package/src/sass/themes/frost/core/components/_schools-look-up.scss +47 -0
- package/src/sass/themes/frost/core/components/footer-nav.twig +16 -0
- package/src/sass/themes/frost/core/components/form--frost.twig +48 -0
- package/src/sass/themes/frost/core/variables/_colours.scss +15 -0
- package/src/sass/themes/frost/core/variables/_typography.scss +106 -0
- package/src/sass/themes/frost/core/variables/typography.twig +115 -0
- package/src/sass/themes/frost/cr365/components/_header.scss +7 -0
- package/src/sass/themes/frost/cr365/cr365.scss +11 -0
- package/src/sass/themes/frost/frost.scss +62 -0
- package/src/sass/themes/frost/images/campaigns/17-selected.png +0 -0
- package/src/sass/themes/frost/images/campaigns/17.png +0 -0
- package/src/sass/themes/frost/images/campaigns/19-selected.png +0 -0
- package/src/sass/themes/frost/images/campaigns/19.png +0 -0
- package/src/sass/themes/frost/images/campaigns/21-selected.png +0 -0
- package/src/sass/themes/frost/images/campaigns/21.png +0 -0
- package/src/sass/themes/frost/images/landing/construction_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/construction_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/fabrics_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/fabrics_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/football_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/football_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rooftop_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rooftop_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rubbish-dump-01_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rubbish-dump-01_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rubbish-dump-02_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/rubbish-dump-02_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/landing/sack-race_bg.jpg +0 -0
- package/src/sass/themes/frost/images/landing/sack-race_bg@2x.jpg +0 -0
- package/src/sass/themes/frost/images/logo/cr_logo@2x.png +0 -0
- package/src/sass/themes/frost/sr18/components/_buttons.scss +7 -0
- package/src/sass/themes/frost/sr18/components/_cookie-consent.scss +9 -0
- package/src/sass/themes/frost/sr18/components/_form.scss +31 -0
- package/src/sass/themes/frost/sr18/components/_header.scss +15 -0
- package/src/sass/themes/frost/sr18/components/_just-in-time.scss +23 -0
- package/src/sass/themes/frost/sr18/sr18.scss +71 -0
- package/src/sass/themes/frost/sr18/variables/_colours.scss +8 -0
- package/src/sass/themes/payin/_payin-styleguide.scss +17 -0
- package/src/sass/themes/payin/default/components/_payin-form.scss +611 -0
- package/src/sass/themes/payin/default/components/checkbox/_checkbox.scss +42 -0
- package/src/sass/themes/payin/default/components/checkbox/checkbox.twig +7 -0
- package/src/sass/themes/payin/default/components/images/CR__Arrow_L--white.svg +44 -0
- package/src/sass/themes/payin/default/components/images/CR__Arrow_L.svg +44 -0
- package/src/sass/themes/payin/default/components/images/CR__Chevron_D--white.svg +44 -0
- package/src/sass/themes/payin/default/components/images/CR__Chevron_D.svg +44 -0
- package/src/sass/themes/payin/default/components/images/CR__Chevron_U.svg +44 -0
- package/src/sass/themes/payin/default/components/images/arrow.png +0 -0
- package/src/sass/themes/payin/default/components/images/checkbox-checked.png +0 -0
- package/src/sass/themes/payin/default/components/images/checkbox-tick-new.png +0 -0
- package/src/sass/themes/payin/default/components/images/checkbox.png +0 -0
- package/src/sass/themes/payin/default/components/images/drop-down-dark-purple.svg +9 -0
- package/src/sass/themes/payin/default/components/images/error-alert-icon.png +0 -0
- package/src/sass/themes/payin/default/components/images/form_sprite.png +0 -0
- package/src/sass/themes/payin/default/components/images/frsb.jpg +0 -0
- package/src/sass/themes/payin/default/components/images/frsb.png +0 -0
- package/src/sass/themes/payin/default/components/images/icon_sprite.png +0 -0
- package/src/sass/themes/payin/default/components/images/info-icon.jpg +0 -0
- package/src/sass/themes/payin/default/components/images/info-icon.png +0 -0
- package/src/sass/themes/payin/default/components/images/loader.gif +0 -0
- package/src/sass/themes/payin/default/components/images/lookup-icon.png +0 -0
- package/src/sass/themes/payin/default/components/images/payment_icon.jpg +0 -0
- package/src/sass/themes/payin/default/components/images/paypal-logo.png +0 -0
- package/src/sass/themes/payin/default/components/images/paypal.svg +8 -0
- package/src/sass/themes/payin/default/components/payin-form.twig +119 -0
- package/src/sass/themes/payin/default/payin-default.scss +46 -0
- package/src/sass/themes/payin/default/variables/_payin-colours.scss +5 -0
- package/src/sass/themes/payin/default/variables/_payin-mixins.scss +5 -0
- package/src/sass/themes/payin/payin-rnd.scss +3 -0
- package/src/sass/themes/payin/payin-sr.scss +3 -0
- package/src/sass/themes/payin/rednoseday/components/failure/_failure.scss +41 -0
- package/src/sass/themes/payin/rednoseday/components/footer/_footer.scss +22 -0
- package/src/sass/themes/payin/rednoseday/components/form/_form.scss +262 -0
- package/src/sass/themes/payin/rednoseday/components/form/images/drop-down.svg +9 -0
- package/src/sass/themes/payin/rednoseday/components/header/_header.scss +36 -0
- package/src/sass/themes/payin/rednoseday/components/header/cr-logo.svg +27 -0
- package/src/sass/themes/payin/rednoseday/components/header/rnd19-logo.svg +1 -0
- package/src/sass/themes/payin/rednoseday/components/just-in-time-block/_just-in-time.scss +21 -0
- package/src/sass/themes/payin/rednoseday/components/promo-header/_promo-header.scss +28 -0
- package/src/sass/themes/payin/rednoseday/pages/failure-page.twig +14 -0
- package/src/sass/themes/payin/rednoseday/pages/payin-page.twig +859 -0
- package/src/sass/themes/payin/rednoseday/pages/success-page.twig +77 -0
- package/src/sass/themes/payin/rednoseday/payin-rednoseday.scss +33 -0
- package/src/sass/themes/payin/sportrelief/components/cards/_cards.scss +74 -0
- package/src/sass/themes/payin/sportrelief/components/cards/images/myself-friends-family.jpg +0 -0
- package/src/sass/themes/payin/sportrelief/components/cards/images/nursery-school.jpg +0 -0
- package/src/sass/themes/payin/sportrelief/components/cards/images/workplace-organisation.jpg +0 -0
- package/src/sass/themes/payin/sportrelief/components/cards/images/youth-university.jpg +0 -0
- package/src/sass/themes/payin/sportrelief/components/failure/_failure.scss +41 -0
- package/src/sass/themes/payin/sportrelief/components/footer/_footer.scss +3 -0
- package/src/sass/themes/payin/sportrelief/components/form/_form.scss +216 -0
- package/src/sass/themes/payin/sportrelief/components/form/images/drop-down.svg +9 -0
- package/src/sass/themes/payin/sportrelief/components/header/_header.scss +33 -0
- package/src/sass/themes/payin/sportrelief/components/promo-header/_promo-header.scss +28 -0
- package/src/sass/themes/payin/sportrelief/components/success/_success.scss +70 -0
- package/src/sass/themes/payin/sportrelief/pages/failure-page.twig +14 -0
- package/src/sass/themes/payin/sportrelief/pages/payin-page.twig +859 -0
- package/src/sass/themes/payin/sportrelief/pages/success-page.twig +77 -0
- package/src/sass/themes/payin/sportrelief/payin-sportrelief.scss +82 -0
- package/src/sass/themes/rnd/2017/_rnd17-styleguide.scss +496 -0
- package/src/sass/themes/rnd/2017/components/_loading.scss +101 -0
- package/src/sass/themes/rnd/2017/components/_otn.scss +9 -0
- package/src/sass/themes/rnd/2017/components/_theme.scss +246 -0
- package/src/sass/themes/rnd/2017/components/email-signup/_email-signup-sticky-nav.scss +144 -0
- package/src/sass/themes/rnd/2017/components/email-signup/_email-signup.scss +5 -0
- package/src/sass/themes/rnd/2017/components/header/_base-header.scss +26 -0
- package/src/sass/themes/rnd/2017/components/meta-icons/_meta-icons.scss +69 -0
- package/src/sass/themes/rnd/2017/components/navigation/_feature-nav.scss +69 -0
- package/src/sass/themes/rnd/2017/components/navigation/_main-nav.scss +37 -0
- package/src/sass/themes/rnd/2017/components/navigation/_sticky-nav.scss +715 -0
- package/src/sass/themes/rnd/2017/components/navigation/kids-nav/_kids-nav.scss +180 -0
- package/src/sass/themes/rnd/2017/components/navigation/kids-nav/images/kids-nav-sprite.png +0 -0
- package/src/sass/themes/rnd/2017/components/navigation/kids-nav/kids-nav.twig +13 -0
- package/src/sass/themes/rnd/2017/components/search/_search-block-sticky-nav.scss +175 -0
- package/src/sass/themes/rnd/2017/components/search/images/magnify-icon.svg +1 -0
- package/src/sass/themes/rnd/2017/components/search/images/search_page_icon.png +0 -0
- package/src/sass/themes/rnd/2017/components/search/images/search_page_icon_hover.png +0 -0
- package/src/sass/themes/rnd/2017/components/social/_social.scss +21 -0
- package/src/sass/themes/rnd/2017/components/tooltips/_tooltips.scss +14 -0
- package/src/sass/themes/rnd/2017/rnd17.scss +36 -0
- package/src/sass/themes/rnd/2017/variables/_colours.scss +25 -0
- package/src/sass/themes/rnd/2017/variables/_navigation.scss +4 -0
- package/src/sass/themes/shop/2018/_shop18-components.scss +52 -0
- package/src/sass/themes/shop/2018/_shop18-styleguide.scss +504 -0
- package/src/sass/themes/shop/2018/_typography.scss +11 -0
- package/src/sass/themes/shop/2018/base_header.twig +16 -0
- package/src/sass/themes/shop/2018/shop18.scss +68 -0
- package/src/sass/themes/shop/2018/typography.twig +116 -0
- package/src/sass/themes/shop/2019/_shop19-components.scss +60 -0
- package/src/sass/themes/shop/2019/_shop19-styleguide.scss +504 -0
- package/src/sass/themes/shop/2019/background-colours.twig +100 -0
- package/src/sass/themes/shop/2019/base_header.twig +16 -0
- package/src/sass/themes/shop/2019/colour.twig +162 -0
- package/src/sass/themes/shop/2019/form.twig +133 -0
- package/src/sass/themes/shop/2019/shop19.scss +62 -0
- package/src/sass/themes/shop/2019/typography.twig +128 -0
- package/src/sass/themes/shop/2019/variables/_main-nav.scss +3 -0
- package/src/sass/themes/sr/2018/_sr18-styleguide.scss +637 -0
- package/src/sass/themes/sr/2018/base_header.twig +10 -0
- package/src/sass/themes/sr/2018/components/app-link-block/_app-link-block.scss +209 -0
- package/src/sass/themes/sr/2018/components/app-link-block/app-link-block.twig +90 -0
- package/src/sass/themes/sr/2018/components/app-link-block/images/success-tick.svg +13 -0
- package/src/sass/themes/sr/2018/components/background-colours/_background-colours.scss +201 -0
- package/src/sass/themes/sr/2018/components/background-colours/background-colours.twig +46 -0
- package/src/sass/themes/sr/2018/components/background-single-msg/_background-single-msg.scss +3 -0
- package/src/sass/themes/sr/2018/components/bg-graphics/_bg-graphics.scss +126 -0
- package/src/sass/themes/sr/2018/components/bg-graphics/bg-graphics.twig +0 -0
- package/src/sass/themes/sr/2018/components/bg-video-copy/_bg-video-copy.scss +206 -0
- package/src/sass/themes/sr/2018/components/bg-video-copy/bg-video-copy.twig +16 -0
- package/src/sass/themes/sr/2018/components/bg-video-copy/js/bg-video-copy.js +72 -0
- package/src/sass/themes/sr/2018/components/bg-video-copy/videos/SR18-promo.mp4 +0 -0
- package/src/sass/themes/sr/2018/components/buttons/_buttons.scss +169 -0
- package/src/sass/themes/sr/2018/components/buttons/buttons.twig +27 -0
- package/src/sass/themes/sr/2018/components/cookie-consent/cookie-consent.json +7 -0
- package/src/sass/themes/sr/2018/components/cookie-consent/cookie-consent.twig +7 -0
- package/src/sass/themes/sr/2018/components/copy-copy/_copy-copy.scss +57 -0
- package/src/sass/themes/sr/2018/components/copy-copy/copy-copy.twig +22 -0
- package/src/sass/themes/sr/2018/components/copy-video/_copy-video.scss +152 -0
- package/src/sass/themes/sr/2018/components/copy-video/copy-video.twig +47 -0
- package/src/sass/themes/sr/2018/components/copy-video/js/copy-video.js +62 -0
- package/src/sass/themes/sr/2018/components/email-signup/_email-signup-head.scss +23 -0
- package/src/sass/themes/sr/2018/components/email-signup/_email-signup.scss +30 -0
- package/src/sass/themes/sr/2018/components/fixed-ratio-image/_fixed-ratio-image.scss +63 -0
- package/src/sass/themes/sr/2018/components/fixed-ratio-image/fixed-ratio-image.twig +10 -0
- package/src/sass/themes/sr/2018/components/footer-app-links-block/_footer-app-links-block.scss +65 -0
- package/src/sass/themes/sr/2018/components/footer-app-links-block/footer-app-links-block.twig +16 -0
- package/src/sass/themes/sr/2018/components/full-height-double-image-single-copy/_full-height-double-image-single-copy.scss +107 -0
- package/src/sass/themes/sr/2018/components/full-height-double-image-single-copy/full-height-double-image-single-copy.twig +23 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image/_full-height-single-image.scss +138 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image/full-height-single-image.twig +12 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image-single-copy/_full-height-single-image-single-copy.scss +73 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image-single-copy/full-height-single-image-single-copy.twig +14 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image-triple-copy/_full-height-single-image-triple-copy.scss +158 -0
- package/src/sass/themes/sr/2018/components/full-height-single-image-triple-copy/full-height-single-image-triple-copy.twig +24 -0
- package/src/sass/themes/sr/2018/components/just-in-time-block/_just-in-time-block.scss +24 -0
- package/src/sass/themes/sr/2018/components/just-in-time-block/just-in-time-block.twig +11 -0
- package/src/sass/themes/sr/2018/components/links/_links.scss +86 -0
- package/src/sass/themes/sr/2018/components/links/links.twig +94 -0
- package/src/sass/themes/sr/2018/components/lists/_lists.scss +43 -0
- package/src/sass/themes/sr/2018/components/lists/lists.twig +28 -0
- package/src/sass/themes/sr/2018/components/live-total-block/_live-total-block.scss +150 -0
- package/src/sass/themes/sr/2018/components/live-total-block/images/sr18-logo-2018.svg +1 -0
- package/src/sass/themes/sr/2018/components/live-total-block/live-total-block.twig +44 -0
- package/src/sass/themes/sr/2018/components/loading/_loading.scss +101 -0
- package/src/sass/themes/sr/2018/components/media/_media.scss +9 -0
- package/src/sass/themes/sr/2018/components/membership-signup/_membership-signup.scss +479 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/drop-down-black.svg +1 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/drop-down-white.svg +9 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership-LG.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership-MD.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership-SM.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership2-LG.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership2-md.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/images/membership2-sm.jpg +0 -0
- package/src/sass/themes/sr/2018/components/membership-signup/js/membership-signup.js +490 -0
- package/src/sass/themes/sr/2018/components/membership-signup/membership-signup.twig +103 -0
- package/src/sass/themes/sr/2018/components/navigation/_main-nav.scss +704 -0
- package/src/sass/themes/sr/2018/components/navigation/images/SR+IGO_LOGO_RGB.svg +1 -0
- package/src/sass/themes/sr/2018/components/navigation/images/error-alert-icon-ruby.png +0 -0
- package/src/sass/themes/sr/2018/components/news-article/_news-article.scss +118 -0
- package/src/sass/themes/sr/2018/components/news-article/news-article.twig +29 -0
- package/src/sass/themes/sr/2018/components/news-teaser/_news-teaser.scss +8 -0
- package/src/sass/themes/sr/2018/components/promo-header/_promo-header.scss +61 -0
- package/src/sass/themes/sr/2018/components/search/_search-block.scss +177 -0
- package/src/sass/themes/sr/2018/components/search/images/magnify-icon.svg +1 -0
- package/src/sass/themes/sr/2018/components/search/images/search_page_icon.png +0 -0
- package/src/sass/themes/sr/2018/components/search/images/search_page_icon_hover.png +0 -0
- package/src/sass/themes/sr/2018/components/search/search.twig +21 -0
- package/src/sass/themes/sr/2018/components/search-results/_search-results.scss +127 -0
- package/src/sass/themes/sr/2018/components/single-msg/_single-msg.scss +59 -0
- package/src/sass/themes/sr/2018/components/teaser-block/_teaser-block.scss +60 -0
- package/src/sass/themes/sr/2018/components/tooltips/_tooltips.scss +9 -0
- package/src/sass/themes/sr/2018/components/typography/_fonts.scss +23 -0
- package/src/sass/themes/sr/2018/components/typography/_typography.scss +161 -0
- package/src/sass/themes/sr/2018/components/typography/typography.twig +127 -0
- package/src/sass/themes/sr/2018/main-nav.twig +86 -0
- package/src/sass/themes/sr/2018/sr18.scss +135 -0
- package/src/sass/themes/sr/2018/variables/_colours.scss +36 -0
- package/src/sass/themes/sr/2018/variables/_main-nav.scss +3 -0
- package/src/sass/themes/sr/2018/variables/_mixins.scss +82 -0
- package/src/sass/themes/sr/2018/variables/_typography.scss +106 -0
- package/src/sass/themes/sr/2018/variables/colour.twig +58 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
(function($) {
|
|
2
|
+
$(document).ready(function() {
|
|
3
|
+
(function () {
|
|
4
|
+
if ( typeof NodeList.prototype.forEach === "function" ) return false;
|
|
5
|
+
NodeList.prototype.forEach = Array.prototype.forEach;
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
var pattern = /^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*$/;
|
|
9
|
+
/* Set an object where each key will be the id value of each row and their value an array of money buy amount */
|
|
10
|
+
var moneyBuyRows = {};
|
|
11
|
+
var dataLayer = window.dataLayer = window.dataLayer || [];
|
|
12
|
+
var allRows = [];
|
|
13
|
+
var lastBtnPos = '';
|
|
14
|
+
var submitNameID = '';
|
|
15
|
+
|
|
16
|
+
/* Get website-page url */
|
|
17
|
+
var url_string = window.location.href;
|
|
18
|
+
var getQueryString = function ( field, url ) {
|
|
19
|
+
var href = url ? url : window.location.href;
|
|
20
|
+
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
|
|
21
|
+
var string = reg.exec(href);
|
|
22
|
+
return string ? string[1] : null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var totalRows = $('.paragraph--membership-signup').length;
|
|
26
|
+
|
|
27
|
+
$('.paragraph--membership-signup').each(function(i) {
|
|
28
|
+
var $thisParagraph = $(this);
|
|
29
|
+
setFormDefaults($thisParagraph, i);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/* Handle money buy selection */
|
|
33
|
+
$('.paragraph--membership-signup .select-amount-btn').click(function(e) {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
if ($(this).hasClass('active')) {
|
|
36
|
+
return;
|
|
37
|
+
} else {
|
|
38
|
+
var $thisBtn = $(this);
|
|
39
|
+
var $thisForm= $thisBtn.closest('form');
|
|
40
|
+
var thisID = $thisBtn.closest('.paragraph--membership-signup').attr('id');
|
|
41
|
+
|
|
42
|
+
$thisForm.find('select').css("background", "transparent");
|
|
43
|
+
$thisForm.find(".form__field--wrapper").removeClass('active-input');
|
|
44
|
+
$thisForm.find(".form-error").removeClass('show-error');
|
|
45
|
+
$thisForm.find('.select-amount-btn').removeClass("active");
|
|
46
|
+
$thisForm.find("input[name='membership_amount']").val("");
|
|
47
|
+
$(this).addClass("active");
|
|
48
|
+
|
|
49
|
+
var $thisBtnParent = $thisBtn.parents(".membership-signup__wrapper-copy--form-money");
|
|
50
|
+
var descriptionCopies = $thisBtnParent.find(".donation-copy").children();
|
|
51
|
+
var position = $thisBtn.data("position");
|
|
52
|
+
|
|
53
|
+
moneyBuyDescriptionHandler(descriptionCopies, position);
|
|
54
|
+
|
|
55
|
+
var moneyBuySelectedValue = getMoneyBuyValue($thisForm.find('.select-amount-btn.active'));
|
|
56
|
+
setCurrentDataAmount($thisForm, moneyBuySelectedValue);
|
|
57
|
+
|
|
58
|
+
lastBtnPos = position;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/* Watch for action or change on input */
|
|
63
|
+
$(".paragraph--membership-signup input[name='membership_amount']").on("input propertychange click keypress", function(event) {
|
|
64
|
+
var $thisInput = $(this);
|
|
65
|
+
var $thisForm = $thisInput.parents("form");
|
|
66
|
+
var amount = $thisInput.val();
|
|
67
|
+
var id = $thisForm.parents(".paragraph--membership-signup").attr("id");
|
|
68
|
+
var floatedAmound = parseFloat(amount);
|
|
69
|
+
|
|
70
|
+
// Reset this to indicate input field choice
|
|
71
|
+
lastBtnPos = "";
|
|
72
|
+
|
|
73
|
+
if ($thisForm.find(".select-amount-btn").hasClass("active")) {
|
|
74
|
+
$thisForm.find(".select-amount-btn").removeClass("active");
|
|
75
|
+
$thisForm.find(".money-buy--description").removeClass("show-money-buy-copy");
|
|
76
|
+
|
|
77
|
+
/** Reset current amount to zero */
|
|
78
|
+
setCurrentDataAmount($thisInput, 0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Check if user enters input
|
|
82
|
+
if (event.type === "input" || event.type === "click" || event.type === "keypress") {
|
|
83
|
+
if (validateAmount(floatedAmound)) {
|
|
84
|
+
$thisForm.find(".form-error").removeClass("show-error");
|
|
85
|
+
$thisForm.find(".form__field--wrapper").addClass("active-input");
|
|
86
|
+
// Compare money buy value of the row and amount provided by user if they match highlight both input and money buy box and display appropriate copy
|
|
87
|
+
if (moneyBuyRows[id].indexOf(amount.toString()) > -1) {
|
|
88
|
+
var index = moneyBuyRows[id].indexOf(amount) + 1;
|
|
89
|
+
$thisForm.find(".select-amount-btn.money-box--" + index).addClass("active");
|
|
90
|
+
var descriptionCopies = $thisForm.find(".donation-copy").children();
|
|
91
|
+
moneyBuyDescriptionHandler(descriptionCopies, index);
|
|
92
|
+
$thisForm.find(".form__field--wrapper").addClass("active-input");
|
|
93
|
+
} else {
|
|
94
|
+
$thisForm.find(".other-description").addClass("show-money-buy-copy");
|
|
95
|
+
setCurrentDataAmount($thisInput, amount);
|
|
96
|
+
}
|
|
97
|
+
} else if (isNaN(floatedAmound)){
|
|
98
|
+
if($thisForm.find(".form__field--wrapper").hasClass("active-input")) {
|
|
99
|
+
$thisForm.find(".form-error").addClass("show-error");
|
|
100
|
+
$thisForm.find(".other-description").removeClass("show-money-buy-copy");
|
|
101
|
+
} else {
|
|
102
|
+
$thisForm.find(".form-error").removeClass("show-error");
|
|
103
|
+
$thisForm.find(".form__field--wrapper").addClass("active-input");
|
|
104
|
+
$thisForm.find(".other-description").addClass("show-money-buy-copy");
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
$thisForm.find(".other-description").removeClass("show-money-buy-copy");
|
|
108
|
+
$thisForm.find(".form-error").addClass("show-error");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
/* Handle change of currency */
|
|
114
|
+
$('.paragraph--membership-signup select').on( "selectmenuchange input propertychange click", function() {
|
|
115
|
+
var $thisSelect = $(this);
|
|
116
|
+
var $thisForm = $thisSelect.parents('form')
|
|
117
|
+
var currency = $thisSelect.find("option:selected").data("currency");
|
|
118
|
+
var givingType = $thisForm.data("giving-type");
|
|
119
|
+
|
|
120
|
+
if(givingType.toLowerCase() !== "MONTHLY".toLowerCase()) {
|
|
121
|
+
var currency = $thisForm.find("option:selected").data("currency");
|
|
122
|
+
$thisSelect.closest(".membership-signup__wrapper-copy--form-money").find("#js-currency-label").text(currency);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
/* Handle enter-key keyboard event */
|
|
128
|
+
$(".paragraph--membership-signup input[name='membership_amount']").keypress(function (e) {
|
|
129
|
+
var $thisInput = $(this);
|
|
130
|
+
if (e.which == 13) {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
var $thisForm = $thisInput.closest('form');
|
|
133
|
+
var thisID = $thisForm.parents('.paragraph--membership-signup').attr('id');
|
|
134
|
+
var inputValue = parseFloat($thisInput.val());
|
|
135
|
+
|
|
136
|
+
if(!isNaN(inputValue)) {
|
|
137
|
+
setCurrentDataAmount($thisInput, inputValue);
|
|
138
|
+
dataLayer_updateBasket(thisID, 0, 'add');
|
|
139
|
+
handleDatabeforeSubmission($thisForm, inputValue, e);
|
|
140
|
+
} else {
|
|
141
|
+
setCurrentDataAmount($thisInput, 0);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Handle pressing next button event
|
|
147
|
+
$(".paragraph--membership-signup .membership--submit").click(function (e) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
var $thisButton = $(this);
|
|
150
|
+
var $thisForm = $thisButton.closest('form');
|
|
151
|
+
var moneyBuySelected = getMoneyBuyValue($thisForm.find('.select-amount-btn.active'));
|
|
152
|
+
var inputValue = parseFloat($thisForm.find("input[name='membership_amount']").val());
|
|
153
|
+
var $thisFormParent = $thisForm.parents('.paragraph--membership-signup');
|
|
154
|
+
var thisID = $thisFormParent.attr('id');
|
|
155
|
+
|
|
156
|
+
if(!isNaN(moneyBuySelected)){
|
|
157
|
+
setCurrentDataAmount($thisForm, moneyBuySelected);
|
|
158
|
+
dataLayer_updateBasket(thisID, lastBtnPos, 'add');
|
|
159
|
+
handleDatabeforeSubmission($thisForm, moneyBuySelected, e);
|
|
160
|
+
} else if(!isNaN(inputValue)){
|
|
161
|
+
setCurrentDataAmount($thisButton, inputValue);
|
|
162
|
+
dataLayer_updateBasket(thisID, 0, 'add');
|
|
163
|
+
handleDatabeforeSubmission($thisForm, inputValue, e);
|
|
164
|
+
} else {
|
|
165
|
+
setCurrentDataAmount($thisButton, 0);
|
|
166
|
+
handleDatabeforeSubmission($thisForm, 0, e);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
/** FUNCTIONS */
|
|
171
|
+
function setFormDefaults($thisParagraph, i) {
|
|
172
|
+
var thisID = 'mship-' + i;
|
|
173
|
+
$thisParagraph.attr('id', thisID);
|
|
174
|
+
var $newParagraphWithId = $('#'+ thisID);
|
|
175
|
+
|
|
176
|
+
/** Check giving type before taking decision to hide select tag or not */
|
|
177
|
+
var givingType = $newParagraphWithId.find("form").data("giving-type");
|
|
178
|
+
if(givingType.toLowerCase() === "MONTHLY".toLowerCase()) {
|
|
179
|
+
$newParagraphWithId.find('.form__fieldset').addClass("hide-select-tag");
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var $thisForm = $newParagraphWithId.find('form');
|
|
183
|
+
var cartID = $thisForm.data('cart-id');
|
|
184
|
+
var clientID = $thisForm.data('client-id');
|
|
185
|
+
var theseButtons = [];
|
|
186
|
+
|
|
187
|
+
/* Set Box shadow colour */
|
|
188
|
+
var colour = $newParagraphWithId.css("backgroundColor");
|
|
189
|
+
if (colour) {
|
|
190
|
+
$('.img-shadow', $newParagraphWithId).append("<style> " + "#" + thisID + " .img-shadow" + ":before {color:" + colour + "}" + "</style>");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
var rowIDValue = getQueryString("rowID", url_string);
|
|
194
|
+
var scrollHere = '#' + rowIDValue + ' form';
|
|
195
|
+
var amountValue = getQueryString("amount", url_string);
|
|
196
|
+
var amount = parseFloat($newParagraphWithId.find(".select-amount-btn.active").text().replace(/\D/g, ""));
|
|
197
|
+
|
|
198
|
+
$newParagraphWithId.attr("data-current-amount", amount);
|
|
199
|
+
var position = $newParagraphWithId.find(".select-amount-btn.active").data("position");
|
|
200
|
+
|
|
201
|
+
/* Add money buy description && currency */
|
|
202
|
+
var descriptionCopies = $newParagraphWithId.find(".donation-copy").children();
|
|
203
|
+
|
|
204
|
+
/* Populate moneybuyrows object with money buy value of each row */
|
|
205
|
+
moneyBuyRows[thisID] =[];
|
|
206
|
+
$newParagraphWithId.find('.select-amount-btn').each(function(i){
|
|
207
|
+
var currentMoneyBuyValue = getMoneyBuyValue($(this));
|
|
208
|
+
moneyBuyRows[thisID].push(currentMoneyBuyValue);
|
|
209
|
+
|
|
210
|
+
// Cache all our button info for this paragraph in array, to pass to the main paragraph array
|
|
211
|
+
var pos = $(this).data("position");
|
|
212
|
+
theseButtons[pos] = {
|
|
213
|
+
position: pos,
|
|
214
|
+
amount: $(this).data("amount")
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
/* Handle case where users are taken back to cr.com from donation */
|
|
219
|
+
if( url_string.indexOf('&amount=') > -1 && amountValue.length > 0 && rowIDValue.length && url_string.indexOf('&rowID=') > -1 ) {
|
|
220
|
+
$("#" + rowIDValue).find('.select-amount-btn').each(function (i) {
|
|
221
|
+
var currentMoneyBuyValue = getMoneyBuyValue($(this));
|
|
222
|
+
var $thisForm = $(this).parents('form');
|
|
223
|
+
|
|
224
|
+
if (currentMoneyBuyValue === amountValue) {
|
|
225
|
+
$("#" + rowIDValue).find('.select-amount-btn').removeClass('active');
|
|
226
|
+
$(this).addClass('active');
|
|
227
|
+
moneyBuyDescriptionHandler(descriptionCopies, i + 1 );
|
|
228
|
+
} else if (moneyBuyRows[rowIDValue].indexOf(amountValue) === -1 ) {
|
|
229
|
+
$thisForm.find("input[name='membership_amount']").val(amountValue);
|
|
230
|
+
$("#" + rowIDValue).find('.select-amount-btn').removeClass('active');
|
|
231
|
+
$thisForm.find('.form__field--wrapper').addClass("active-input");
|
|
232
|
+
$thisForm.find('.other-description').addClass('show-money-buy-copy');
|
|
233
|
+
}
|
|
234
|
+
document.querySelector(scrollHere).scrollIntoView({ behavior: 'smooth'});
|
|
235
|
+
})
|
|
236
|
+
} else {
|
|
237
|
+
moneyBuyDescriptionHandler(descriptionCopies, position);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Cache all of these for ease-of-use later & prevent endless DOM traversal
|
|
241
|
+
allRows[thisID] = {
|
|
242
|
+
giving_type: givingType == 'MONTHLY' ? 'membership-payment': 'single-payment',
|
|
243
|
+
cart_id: cartID,
|
|
244
|
+
client_id: clientID,
|
|
245
|
+
buttons: theseButtons
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/* Pass the cached row to set up the dataLayer */
|
|
249
|
+
dataLayer_init($newParagraphWithId, thisID);
|
|
250
|
+
|
|
251
|
+
// If we've finished setting up all our rows, check for previous cookies
|
|
252
|
+
if (i === totalRows - 1) {
|
|
253
|
+
checkCookie();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** Money buy description handler */
|
|
258
|
+
function moneyBuyDescriptionHandler(descriptions, position) {
|
|
259
|
+
descriptions.each(function (i) {
|
|
260
|
+
$(this).removeClass('show-money-buy-copy');
|
|
261
|
+
if (position === i + 1) {
|
|
262
|
+
$(this).addClass('show-money-buy-copy');
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** Set value of data current amount */
|
|
268
|
+
function setCurrentDataAmount(selector, amount) {
|
|
269
|
+
selector.parents(".paragraph--membership-signup").attr("data-current-amount", amount);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* Handle data before submission */
|
|
273
|
+
function handleDatabeforeSubmission($thisForm, amount, event) {
|
|
274
|
+
var currency = $thisForm.find("option:selected").val();
|
|
275
|
+
var givingType = $thisForm.data('giving-type');
|
|
276
|
+
var cartId = $thisForm.data('cart-id');
|
|
277
|
+
var clientId = $thisForm.data('client-id');
|
|
278
|
+
var rowID = $thisForm.parents('.paragraph--membership-signup').attr('id');
|
|
279
|
+
|
|
280
|
+
/* Send data */
|
|
281
|
+
if (validateAmount(amount)) {
|
|
282
|
+
$thisForm.find(".form-error").removeClass('show-error');
|
|
283
|
+
nextStepHandler(event, currency, amount, givingType, cartId, clientId, rowID);
|
|
284
|
+
} else {
|
|
285
|
+
$thisForm.find(".form-error").addClass("show-error");
|
|
286
|
+
$thisForm.find(".form__field--wrapper").addClass("active-input");
|
|
287
|
+
$thisForm.find(".other-description").removeClass("show-money-buy-copy");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Get money buy value */
|
|
292
|
+
function getMoneyBuyValue(element) {
|
|
293
|
+
return element.attr("data-amount");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Check and validate amount */
|
|
297
|
+
function validateAmount(amount) {
|
|
298
|
+
if (pattern.test(amount) && (amount >= 1 && amount <= 5000)) {
|
|
299
|
+
return true
|
|
300
|
+
} else {
|
|
301
|
+
return false
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Redirect function for browser support */
|
|
306
|
+
function redirect(url) {
|
|
307
|
+
|
|
308
|
+
var ua = navigator.userAgent.toLowerCase(),
|
|
309
|
+
isIE = ua.indexOf('msie') !== -1,
|
|
310
|
+
version = parseInt(ua.substr(4, 2), 10);
|
|
311
|
+
// Internet Explorer 8 and lower
|
|
312
|
+
if (isIE && version < 9) {
|
|
313
|
+
var link = document.createElement('a');
|
|
314
|
+
link.href = url;
|
|
315
|
+
document.body.appendChild(link);
|
|
316
|
+
link.click();
|
|
317
|
+
}
|
|
318
|
+
// All other browsers can use the standard window.location.href (they don't lose HTTP_REFERER like Internet Explorer 8 & lower does)
|
|
319
|
+
else {
|
|
320
|
+
window.location.href = url;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Submit data */
|
|
325
|
+
function nextStepHandler(e, currency, amount, givingType, cartId, clientId, rowID) {
|
|
326
|
+
e.preventDefault();
|
|
327
|
+
var url = "https://donation.sportrelief.com/";
|
|
328
|
+
var getUrl = $('#paragraph--membership-signup-0').data("donation-url");
|
|
329
|
+
var donationLink = getUrl ? getUrl : url;
|
|
330
|
+
|
|
331
|
+
/* Affiliate value */
|
|
332
|
+
var affiliateValue = getQueryString("affiliate", url_string)? getQueryString("affiliate", url_string) : 'generic';
|
|
333
|
+
|
|
334
|
+
/* Strip out all params now we've saved our required 'affiliate' value */
|
|
335
|
+
if (url_string.indexOf('?') > -1 ) {
|
|
336
|
+
url_string = url_string.substring(0, url_string.indexOf('?'));
|
|
337
|
+
}
|
|
338
|
+
/* Redirect user to donation */
|
|
339
|
+
redirect(donationLink + "?clientOverride=" + clientId + "&amount=" + amount + "¤cy=" + currency + "&givingType=" + givingType + "&cartId=" + cartId + "&affiliate=" + affiliateValue + "&siteurl=" + url_string + '&rowID=' + rowID + '&moneybuy=' + submitNameID);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Set-up data layer stuff on pageload */
|
|
343
|
+
function dataLayer_init($element, thisID) {
|
|
344
|
+
// Grab this Paragraph from our cached array
|
|
345
|
+
var thisParagraph = allRows[thisID];
|
|
346
|
+
// Construct object to push to datalayer, staring with Other Amount field
|
|
347
|
+
var ecommerceObj = {
|
|
348
|
+
'ecommerce': {
|
|
349
|
+
'currencyCode': 'GBP',
|
|
350
|
+
'impressions': [{
|
|
351
|
+
id:'manual-entry',
|
|
352
|
+
name:'manual-entry',
|
|
353
|
+
price:0.00,
|
|
354
|
+
category: thisParagraph['cart_id'],
|
|
355
|
+
position: 0,
|
|
356
|
+
list: thisParagraph['client_id'] + '_' + thisID,
|
|
357
|
+
dimenstion10: thisParagraph['giving_type'],
|
|
358
|
+
}],
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
/* Construct obj to represent each moneybuy button
|
|
363
|
+
use 1-index, not zero as it maps to our btn 'position' values */
|
|
364
|
+
for (i = 1; i < thisParagraph['buttons'].length; i++) {
|
|
365
|
+
|
|
366
|
+
var thisAmount = parseFloat(parseFloat(thisParagraph['buttons'][i]['amount']).toFixed(2));
|
|
367
|
+
|
|
368
|
+
var thisObj = {
|
|
369
|
+
id:'moneybuy-' + thisParagraph['buttons'][i]['amount'],
|
|
370
|
+
name:'moneybuy-' + thisParagraph['buttons'][i]['amount'],
|
|
371
|
+
price: thisAmount,
|
|
372
|
+
brand: allRows[thisID]['giving_type'],
|
|
373
|
+
category: thisParagraph['cart_id'],
|
|
374
|
+
position: thisParagraph['buttons'][i]['position'],
|
|
375
|
+
list: thisParagraph['client_id'] + '_' + thisID,
|
|
376
|
+
dimenstion10: thisParagraph['giving_type']
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
// Add this 'button' object to the impressions array
|
|
380
|
+
ecommerceObj['ecommerce']['impressions'].push(thisObj);
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
// Push to the data layer
|
|
384
|
+
dataLayer.push(ecommerceObj);
|
|
385
|
+
|
|
386
|
+
// If we have a default 'active' button, store the position value
|
|
387
|
+
var $activeBtn = $element.find('.select-amount-btn.active');
|
|
388
|
+
|
|
389
|
+
if ($activeBtn.length > 0) {
|
|
390
|
+
lastBtnPos = $activeBtn.data('position');
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/* Add or remove moneybuy 'products' from the hypothetical basket */
|
|
395
|
+
function dataLayer_updateBasket(thisID, thisBtnPos, type) {
|
|
396
|
+
var thisParagraph = allRows[thisID];
|
|
397
|
+
var thisAmount = '';
|
|
398
|
+
var isBtn = true;
|
|
399
|
+
|
|
400
|
+
// Construct generic ecommerce object for all use cases
|
|
401
|
+
// TODO: handle currency changes
|
|
402
|
+
var ecommerceObj = {
|
|
403
|
+
'ecommerce': {'currencyCode': 'GBP',},
|
|
404
|
+
'event': type === 'add' ? 'addToBasket' : 'removeFromBasket'
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
lastBtnPos = thisBtnPos;
|
|
408
|
+
|
|
409
|
+
// Change our 'amount' source depending on the input type
|
|
410
|
+
if (thisBtnPos == 0) {
|
|
411
|
+
isBtn = false;
|
|
412
|
+
thisAmount = $('#' + thisID).data('current-amount');
|
|
413
|
+
} else {
|
|
414
|
+
thisAmount = allRows[thisID]['buttons'][thisBtnPos]['amount'];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
submitNameID = isBtn ? 'moneybuy-' + thisAmount : 'manual-entry';
|
|
418
|
+
|
|
419
|
+
// Parse this to a 2-decimal place float, need to re-parse after toFixed
|
|
420
|
+
thisAmount = parseFloat(thisAmount).toFixed(2);
|
|
421
|
+
thisAmount = parseFloat(thisAmount);
|
|
422
|
+
|
|
423
|
+
// Switch the values based on the input type
|
|
424
|
+
ecommerceObj['ecommerce'][type] = {
|
|
425
|
+
'actionField': {'list': thisParagraph['client_id'] + '_' + thisID },
|
|
426
|
+
'products': [{
|
|
427
|
+
id: submitNameID,
|
|
428
|
+
name: submitNameID,
|
|
429
|
+
price: thisAmount,
|
|
430
|
+
brand: allRows[thisID]['giving_type'],
|
|
431
|
+
category: allRows[thisID]['cart_id'],
|
|
432
|
+
quantity: 1,
|
|
433
|
+
dimenstion10: allRows[thisID]['giving_type']
|
|
434
|
+
}],
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
dataLayer.push(ecommerceObj);
|
|
438
|
+
|
|
439
|
+
// If this is our 'add' event triggered via submission, add the new cookie
|
|
440
|
+
if ( type === 'add' ){
|
|
441
|
+
updateCookie(thisID, thisBtnPos, 'add');
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function updateCookie(rowID, btnPos, addOrRemove) {
|
|
446
|
+
|
|
447
|
+
// TODO: handle subdomain stuff?
|
|
448
|
+
var domain = window.location.hostname;
|
|
449
|
+
var cookieName = 'mship-previous-amount';
|
|
450
|
+
var expireDate;
|
|
451
|
+
|
|
452
|
+
if (addOrRemove === 'add') {
|
|
453
|
+
expireDate = new Date();
|
|
454
|
+
expireDate.setTime(expireDate.getTime() + (0.5*60*60*1000)); // add 30m to now
|
|
455
|
+
expireDate = expireDate.toUTCString();
|
|
456
|
+
} else {
|
|
457
|
+
expireDate = 'Thu, 01 Jan 1970 00:00:00 GMT';
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
var cookie = [
|
|
461
|
+
cookieName + '=' + rowID + '?' + btnPos,
|
|
462
|
+
'expires=' + expireDate,
|
|
463
|
+
'path=/',
|
|
464
|
+
'domain=.' + domain
|
|
465
|
+
];
|
|
466
|
+
|
|
467
|
+
document.cookie = cookie.join(';');
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* See if the user has previouls submitted an amount here, BUT the
|
|
471
|
+
* cookie hasn't been deleted by Donate after a successful transaction */
|
|
472
|
+
function checkCookie() {
|
|
473
|
+
|
|
474
|
+
var checkCookieValues = (document.cookie.match(/^(?:.*;)?\s*mship-previous-amount\s*=\s*([^;]+)(?:.*)?$/)||[,null])[1];
|
|
475
|
+
|
|
476
|
+
if (checkCookieValues) {
|
|
477
|
+
// Split out our return string to the two values we need
|
|
478
|
+
checkCookieValues = checkCookieValues.split('?');
|
|
479
|
+
var thisID = checkCookieValues[0];
|
|
480
|
+
var thisBtnPos = checkCookieValues[1];
|
|
481
|
+
|
|
482
|
+
// Remove the cookie, as the next submission will set a new one
|
|
483
|
+
updateCookie(thisID, thisBtnPos, 'remove');
|
|
484
|
+
|
|
485
|
+
// Fire off a 'removeFromBasket' event
|
|
486
|
+
dataLayer_updateBasket(thisID, thisBtnPos, 'remove');
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
})(jQuery);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{% set title = "Help someone like Jordan see a better tomorrow" %}
|
|
2
|
+
|
|
3
|
+
{% set sub_title = "Jordan owes his life to the help of group therapy. Become an insider and help save lives." %}
|
|
4
|
+
|
|
5
|
+
{% set form_title = "Choose your monthly donation" %}
|
|
6
|
+
|
|
7
|
+
{% set giving_type = "MONTHLY" %}
|
|
8
|
+
{% set currencyDisabled = (giving_type == "MONTHLY")? "disabled ='disabled'" : "" %}
|
|
9
|
+
|
|
10
|
+
{% set money_buy_1 = "5" %}
|
|
11
|
+
{% set money_buy_2 = "10" %}
|
|
12
|
+
{% set money_buy_3 = "30" %}
|
|
13
|
+
|
|
14
|
+
{% set money_buy_desc_1 = "£5 could provide 5 hot meals for a homeless person in the UK." %}
|
|
15
|
+
{% set money_buy_desc_2 = "£10 could fund an awareness session on harmful practices like FGM and child marriage for girls in Sierra Leone." %}
|
|
16
|
+
{% set money_buy_desc_3 = "£30 could pay for 7 mosquito nets to protect children in Uganda from malaria while they sleep." %}
|
|
17
|
+
|
|
18
|
+
{% set cart_id = "RND19_CHICAGOTOWN" %}
|
|
19
|
+
{% set client_id = "the_fix" %}
|
|
20
|
+
|
|
21
|
+
{% set randomID = random(100, 10000) %}
|
|
22
|
+
|
|
23
|
+
<section class="paragraph--membership-signup {{modifier_class}} bg--light-orange" data-current-amount="0" >
|
|
24
|
+
|
|
25
|
+
<div class="img-shadow objectfit">
|
|
26
|
+
<picture>
|
|
27
|
+
<source media="all and (min-width: 1024px)" srcset="../images/membership2-LG.jpg" type="image/jpeg"/>
|
|
28
|
+
<source media="all and (min-width: 740px)" srcset="../images/membership2-MD.jpg" type="image/jpeg"/>
|
|
29
|
+
<source media="all and (min-width: 0px)" srcset="../images/membership2-SM.jpg" type="image/jpeg"/>
|
|
30
|
+
<img alt="Membership" src="../images/membership2-MD.jpg" typeof="foaf:Image"/>
|
|
31
|
+
</picture>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="membership-signup__wrapper-copy text-align-center">
|
|
35
|
+
|
|
36
|
+
<div class="membership-signup__wrapper-copy--title ">
|
|
37
|
+
<h3>{{ title }}</h3>
|
|
38
|
+
<p class="text--body-small"> {{ sub_title }}</p>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="membership-signup__wrapper-copy--form">
|
|
42
|
+
<p>
|
|
43
|
+
{{ form_title }}
|
|
44
|
+
</p>
|
|
45
|
+
<form class="membership-signup__wrapper-copy--form-money" data-giving-type={{ giving_type }} data-cart-id={{ cart_id }} data-client-id={{ client_id }} >
|
|
46
|
+
<div class="money-buy">
|
|
47
|
+
<button class="select-amount-btn money-box--1 " data-position="1" data-amount={{ money_buy_1 }}>
|
|
48
|
+
<span class="text-align-center"> <span class="currency membership__currency-label"> £ </span>{{ money_buy_1 }}
|
|
49
|
+
</span>
|
|
50
|
+
</button>
|
|
51
|
+
<button class="select-amount-btn money-box--2 active " data-position="2" data-amount={{ money_buy_2 }}>
|
|
52
|
+
<span class="text-align-center"> <span class="currency membership__currency-label"> £ </span>{{ money_buy_2 }}
|
|
53
|
+
</span>
|
|
54
|
+
</button>
|
|
55
|
+
<button class="select-amount-btn money-box--3" data-position="3" data-amount={{ money_buy_3 }}>
|
|
56
|
+
<span class="text-align-center"> <span class="currency membership__currency-label"> £ </span>{{ money_buy_3 }}
|
|
57
|
+
</span>
|
|
58
|
+
</button>
|
|
59
|
+
</diV>
|
|
60
|
+
<div class="form__fieldset clearfix">
|
|
61
|
+
<label for="other-amount">Other amount</label>
|
|
62
|
+
<div class="form__field--wrapper form__money form__field--amount">
|
|
63
|
+
<span id="js-currency-label" class="currency-input-label membership__currency-label">£</span>
|
|
64
|
+
<input aria-describedby="field-label--amount" class="form__field form__field--amount " id="field-input--amount" max="5000" min="1" name="membership_amount" pattern="[^[1-9]+([,.][0-9]+)?$]" placeholder="0" type="number" value="">
|
|
65
|
+
</div>
|
|
66
|
+
<div class="form__field--wrapper form__choice form__field--currency ">
|
|
67
|
+
<select class="form__field form__field--currency" id="membership-currency-{{ randomID }}" name="comicrelief_payinbundle_payment[currency]" {{ currencyDisabled }}>
|
|
68
|
+
<optgroup label="currency">
|
|
69
|
+
<option data-currency="£" value="GBP">£ GBP
|
|
70
|
+
</option>
|
|
71
|
+
<option data-currency="$" value="USD">$ USD
|
|
72
|
+
</option>
|
|
73
|
+
<option data-currency="$" value="AUD">$ AUD
|
|
74
|
+
|
|
75
|
+
</option>
|
|
76
|
+
<option data-currency="€" value="EUR">€ EUR
|
|
77
|
+
</option>
|
|
78
|
+
</optgroup>
|
|
79
|
+
</select>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<span class="form-error" aria-message-error="field-error--amount"> Please enter a number between 1 and 5000 with only 2 numbers after the decimal. </span>
|
|
83
|
+
<button class="btn btn--SR19-light-blue membership--submit" type="submit">Next step
|
|
84
|
+
</button>
|
|
85
|
+
<div class="donation-copy">
|
|
86
|
+
<p class="font--xsmall money-buy--description">
|
|
87
|
+
{{ money_buy_desc_1 }}
|
|
88
|
+
</p>
|
|
89
|
+
<p class="font--xsmall money-buy--description">
|
|
90
|
+
{{ money_buy_desc_2 }}
|
|
91
|
+
</p>
|
|
92
|
+
<p class="font--xsmall money-buy--description">
|
|
93
|
+
{{ money_buy_desc_3 }}
|
|
94
|
+
</p>
|
|
95
|
+
<p class="font--xsmall other-description">
|
|
96
|
+
OTHER AMOUNT can lorem ipsum dolor sit amet, consectetur adipiscing.
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
</form>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|