@mindful-web/marko-web 1.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/.eslintignore +3 -0
- package/LICENSE +21 -0
- package/browser/.eslintrc.js +1 -0
- package/browser/components/element-id.js +1 -0
- package/browser/components/gated-download/wufoo.vue +97 -0
- package/browser/components/image-slide.vue +54 -0
- package/browser/components/image-slider.vue +87 -0
- package/browser/components/index.js +15 -0
- package/browser/components/load-more-trigger.vue +129 -0
- package/browser/components/oembed.vue +133 -0
- package/browser/components/trigger-in-view-event.vue +41 -0
- package/browser/components/trigger-screen-change-event.vue +94 -0
- package/browser/event-bus.js +5 -0
- package/browser/index.js +83 -0
- package/browser/jquery-full.js +3 -0
- package/browser/jquery.js +3 -0
- package/browser/utils/clean-path.js +4 -0
- package/browser/vue.js +3 -0
- package/components/browser-component/script.marko +10 -0
- package/components/browser-component/script.marko.js +39 -0
- package/components/browser-component.marko +25 -0
- package/components/browser-component.marko.js +75 -0
- package/components/deferred-stylesheet.marko +6 -0
- package/components/deferred-stylesheet.marko.js +28 -0
- package/components/document/components/body-wrapper.marko +8 -0
- package/components/document/components/body-wrapper.marko.js +33 -0
- package/components/document/components/error.marko +26 -0
- package/components/document/components/error.marko.js +88 -0
- package/components/document/components/live-reload.marko +7 -0
- package/components/document/components/live-reload.marko.js +30 -0
- package/components/document/components/polyfill.marko +8 -0
- package/components/document/components/polyfill.marko.js +33 -0
- package/components/document/components/styles.marko +20 -0
- package/components/document/components/styles.marko.js +61 -0
- package/components/document/container.marko +15 -0
- package/components/document/container.marko.js +54 -0
- package/components/document/index.marko +63 -0
- package/components/document/index.marko.js +139 -0
- package/components/document/marko.json +46 -0
- package/components/element/array.marko +19 -0
- package/components/element/array.marko.js +67 -0
- package/components/element/audio.marko +5 -0
- package/components/element/audio.marko.js +33 -0
- package/components/element/block.marko +11 -0
- package/components/element/block.marko.js +44 -0
- package/components/element/clear.marko +4 -0
- package/components/element/clear.marko.js +32 -0
- package/components/element/components/image.marko +32 -0
- package/components/element/components/image.marko.js +62 -0
- package/components/element/components/text.marko +11 -0
- package/components/element/components/text.marko.js +37 -0
- package/components/element/content/address1.marko +14 -0
- package/components/element/content/address1.marko.js +40 -0
- package/components/element/content/address2.marko +14 -0
- package/components/element/content/address2.marko.js +40 -0
- package/components/element/content/audio.marko +13 -0
- package/components/element/content/audio.marko.js +39 -0
- package/components/element/content/authors.marko +12 -0
- package/components/element/content/authors.marko.js +43 -0
- package/components/element/content/body.marko +28 -0
- package/components/element/content/body.marko.js +66 -0
- package/components/element/content/byline.marko +15 -0
- package/components/element/content/byline.marko.js +41 -0
- package/components/element/content/city-state-zip.marko +14 -0
- package/components/element/content/city-state-zip.marko.js +40 -0
- package/components/element/content/contributors.marko +12 -0
- package/components/element/content/contributors.marko.js +43 -0
- package/components/element/content/country.marko +14 -0
- package/components/element/content/country.marko.js +40 -0
- package/components/element/content/embed-code.marko +15 -0
- package/components/element/content/embed-code.marko.js +41 -0
- package/components/element/content/end-date.marko +17 -0
- package/components/element/content/end-date.marko.js +43 -0
- package/components/element/content/ends.marko +14 -0
- package/components/element/content/ends.marko.js +40 -0
- package/components/element/content/fax.marko +14 -0
- package/components/element/content/fax.marko.js +40 -0
- package/components/element/content/images.marko +12 -0
- package/components/element/content/images.marko.js +43 -0
- package/components/element/content/marko.json +328 -0
- package/components/element/content/mobile.marko +14 -0
- package/components/element/content/mobile.marko.js +40 -0
- package/components/element/content/name.marko +15 -0
- package/components/element/content/name.marko.js +41 -0
- package/components/element/content/phone.marko +14 -0
- package/components/element/content/phone.marko.js +40 -0
- package/components/element/content/photographers.marko +12 -0
- package/components/element/content/photographers.marko.js +43 -0
- package/components/element/content/public-email.marko +19 -0
- package/components/element/content/public-email.marko.js +47 -0
- package/components/element/content/published.marko +17 -0
- package/components/element/content/published.marko.js +43 -0
- package/components/element/content/short-name.marko +15 -0
- package/components/element/content/short-name.marko.js +41 -0
- package/components/element/content/sidebar-stubs.marko +24 -0
- package/components/element/content/sidebar-stubs.marko.js +63 -0
- package/components/element/content/sidebars.marko +27 -0
- package/components/element/content/sidebars.marko.js +63 -0
- package/components/element/content/source.marko +14 -0
- package/components/element/content/source.marko.js +40 -0
- package/components/element/content/sponsors.marko +12 -0
- package/components/element/content/sponsors.marko.js +43 -0
- package/components/element/content/start-date.marko +17 -0
- package/components/element/content/start-date.marko.js +43 -0
- package/components/element/content/starts.marko +14 -0
- package/components/element/content/starts.marko.js +40 -0
- package/components/element/content/teaser.marko +15 -0
- package/components/element/content/teaser.marko.js +41 -0
- package/components/element/content/title.marko +14 -0
- package/components/element/content/title.marko.js +40 -0
- package/components/element/content/tollfree.marko +14 -0
- package/components/element/content/tollfree.marko.js +40 -0
- package/components/element/content/transcript.marko +22 -0
- package/components/element/content/transcript.marko.js +53 -0
- package/components/element/content/website.marko +22 -0
- package/components/element/content/website.marko.js +51 -0
- package/components/element/date.marko +2 -0
- package/components/element/date.marko.js +27 -0
- package/components/element/extract-render.js +1 -0
- package/components/element/image/caption.marko +15 -0
- package/components/element/image/caption.marko.js +41 -0
- package/components/element/image/credit.marko +15 -0
- package/components/element/image/credit.marko.js +41 -0
- package/components/element/image/display-name.marko +14 -0
- package/components/element/image/display-name.marko.js +40 -0
- package/components/element/image/marko.json +38 -0
- package/components/element/image/slider.marko +18 -0
- package/components/element/image/slider.marko.js +50 -0
- package/components/element/img.marko +12 -0
- package/components/element/img.marko.js +43 -0
- package/components/element/index.marko +12 -0
- package/components/element/index.marko.js +47 -0
- package/components/element/link.marko +25 -0
- package/components/element/link.marko.js +54 -0
- package/components/element/magazine-issue/description.marko +14 -0
- package/components/element/magazine-issue/description.marko.js +40 -0
- package/components/element/magazine-issue/digital-edition-url.marko +22 -0
- package/components/element/magazine-issue/digital-edition-url.marko.js +51 -0
- package/components/element/magazine-issue/marko.json +42 -0
- package/components/element/magazine-issue/name.marko +14 -0
- package/components/element/magazine-issue/name.marko.js +40 -0
- package/components/element/magazine-issue/pdf-url.marko +22 -0
- package/components/element/magazine-issue/pdf-url.marko.js +51 -0
- package/components/element/magazine-publication/cancel-url.marko +22 -0
- package/components/element/magazine-publication/cancel-url.marko.js +51 -0
- package/components/element/magazine-publication/change-address-url.marko +22 -0
- package/components/element/magazine-publication/change-address-url.marko.js +51 -0
- package/components/element/magazine-publication/description.marko +14 -0
- package/components/element/magazine-publication/description.marko.js +40 -0
- package/components/element/magazine-publication/einquiry-url.marko +22 -0
- package/components/element/magazine-publication/einquiry-url.marko.js +51 -0
- package/components/element/magazine-publication/marko.json +82 -0
- package/components/element/magazine-publication/name.marko +14 -0
- package/components/element/magazine-publication/name.marko.js +40 -0
- package/components/element/magazine-publication/renewal-url.marko +22 -0
- package/components/element/magazine-publication/renewal-url.marko.js +51 -0
- package/components/element/magazine-publication/reprints-url.marko +22 -0
- package/components/element/magazine-publication/reprints-url.marko.js +51 -0
- package/components/element/magazine-publication/subscribe-url.marko +22 -0
- package/components/element/magazine-publication/subscribe-url.marko.js +51 -0
- package/components/element/marko.json +211 -0
- package/components/element/obj-array.marko +17 -0
- package/components/element/obj-array.marko.js +56 -0
- package/components/element/obj-audio.marko +20 -0
- package/components/element/obj-audio.marko.js +50 -0
- package/components/element/obj-date.marko +25 -0
- package/components/element/obj-date.marko.js +55 -0
- package/components/element/obj-nodes.marko +20 -0
- package/components/element/obj-nodes.marko.js +62 -0
- package/components/element/obj-text.marko +23 -0
- package/components/element/obj-text.marko.js +53 -0
- package/components/element/obj.marko +23 -0
- package/components/element/obj.marko.js +61 -0
- package/components/element/object-link.js +49 -0
- package/components/element/object-type.js +9 -0
- package/components/element/picture.marko +38 -0
- package/components/element/picture.marko.js +85 -0
- package/components/element/show-element.js +8 -0
- package/components/element/text.marko +37 -0
- package/components/element/text.marko.js +76 -0
- package/components/element/website-section/description.marko +16 -0
- package/components/element/website-section/description.marko.js +44 -0
- package/components/element/website-section/hierarchy.marko +19 -0
- package/components/element/website-section/hierarchy.marko.js +60 -0
- package/components/element/website-section/marko.json +31 -0
- package/components/element/website-section/name.marko +18 -0
- package/components/element/website-section/name.marko.js +46 -0
- package/components/font/google.marko +6 -0
- package/components/font/google.marko.js +41 -0
- package/components/font/link.marko +14 -0
- package/components/font/link.marko.js +45 -0
- package/components/font/marko.json +21 -0
- package/components/font/typekit.marko +5 -0
- package/components/font/typekit.marko.js +38 -0
- package/components/load-more/index.marko +53 -0
- package/components/load-more/index.marko.js +119 -0
- package/components/load-more/marko.json +30 -0
- package/components/load-more/trigger.marko +11 -0
- package/components/load-more/trigger.marko.js +40 -0
- package/components/marko.json +37 -0
- package/components/node/body.marko +40 -0
- package/components/node/body.marko.js +112 -0
- package/components/node/element.marko +6 -0
- package/components/node/element.marko.js +39 -0
- package/components/node/footer.marko +19 -0
- package/components/node/footer.marko.js +63 -0
- package/components/node/header.marko +19 -0
- package/components/node/header.marko.js +63 -0
- package/components/node/image-inner-wrapper.marko +61 -0
- package/components/node/image-inner-wrapper.marko.js +116 -0
- package/components/node/image-wrapper.marko +34 -0
- package/components/node/image-wrapper.marko.js +98 -0
- package/components/node/image.marko +51 -0
- package/components/node/image.marko.js +93 -0
- package/components/node/index.marko +35 -0
- package/components/node/index.marko.js +100 -0
- package/components/node/marko.json +189 -0
- package/components/node/utils/image-height.js +3 -0
- package/components/node/utils/image-values.js +17 -0
- package/components/node-list/body.marko +19 -0
- package/components/node-list/body.marko.js +50 -0
- package/components/node-list/element.marko +3 -0
- package/components/node-list/element.marko.js +35 -0
- package/components/node-list/footer.marko +19 -0
- package/components/node-list/footer.marko.js +50 -0
- package/components/node-list/header.marko +19 -0
- package/components/node-list/header.marko.js +50 -0
- package/components/node-list/index.marko +36 -0
- package/components/node-list/index.marko.js +93 -0
- package/components/node-list/marko.json +121 -0
- package/components/node-list/node.marko +15 -0
- package/components/node-list/node.marko.js +49 -0
- package/components/node-list/nodes.marko +82 -0
- package/components/node-list/nodes.marko.js +126 -0
- package/components/page/container.marko +13 -0
- package/components/page/container.marko.js +46 -0
- package/components/page/description.marko +4 -0
- package/components/page/description.marko.js +26 -0
- package/components/page/image.marko +50 -0
- package/components/page/image.marko.js +122 -0
- package/components/page/layouts/content.marko +23 -0
- package/components/page/layouts/content.marko.js +63 -0
- package/components/page/layouts/default.marko +20 -0
- package/components/page/layouts/default.marko.js +61 -0
- package/components/page/layouts/dynamic-page.marko +19 -0
- package/components/page/layouts/dynamic-page.marko.js +59 -0
- package/components/page/layouts/magazine-issue.marko +19 -0
- package/components/page/layouts/magazine-issue.marko.js +59 -0
- package/components/page/layouts/magazine-publication.marko +19 -0
- package/components/page/layouts/magazine-publication.marko.js +59 -0
- package/components/page/layouts/marko.json +86 -0
- package/components/page/layouts/website-section.marko +25 -0
- package/components/page/layouts/website-section.marko.js +78 -0
- package/components/page/marko.json +93 -0
- package/components/page/metadata/components/common.marko +54 -0
- package/components/page/metadata/components/common.marko.js +117 -0
- package/components/page/metadata/content.marko +147 -0
- package/components/page/metadata/content.marko.js +216 -0
- package/components/page/metadata/default.marko +2 -0
- package/components/page/metadata/default.marko.js +29 -0
- package/components/page/metadata/dynamic-page.marko +40 -0
- package/components/page/metadata/dynamic-page.marko.js +84 -0
- package/components/page/metadata/google-structured-data/content.js +138 -0
- package/components/page/metadata/magazine-issue.marko +39 -0
- package/components/page/metadata/magazine-issue.marko.js +83 -0
- package/components/page/metadata/magazine-publication.marko +35 -0
- package/components/page/metadata/magazine-publication.marko.js +79 -0
- package/components/page/metadata/marko.json +32 -0
- package/components/page/metadata/website-section.marko +48 -0
- package/components/page/metadata/website-section.marko.js +92 -0
- package/components/page/rel-canonical.marko +13 -0
- package/components/page/rel-canonical.marko.js +42 -0
- package/components/page/title.marko +18 -0
- package/components/page/title.marko.js +46 -0
- package/components/page/wrapper.marko +16 -0
- package/components/page/wrapper.marko.js +63 -0
- package/components/resolve/marko.json +6 -0
- package/components/resolve/page.marko +10 -0
- package/components/resolve/page.marko.js +49 -0
- package/components/rss/marko.json +10 -0
- package/components/rss/website-section.marko +17 -0
- package/components/rss/website-section.marko.js +46 -0
- package/config/abstract-config.js +42 -0
- package/config/core.js +48 -0
- package/config/site.js +6 -0
- package/express/apollo.js +34 -0
- package/express/asset-loader.js +55 -0
- package/express/cdn.js +27 -0
- package/express/css-loader.js +117 -0
- package/express/embedded-media.js +31 -0
- package/express/error-handlers.js +113 -0
- package/express/find-content-alias.js +30 -0
- package/express/get-redirect.js +44 -0
- package/express/graphql-proxy.js +17 -0
- package/express/index.js +153 -0
- package/express/json-error-handler.js +30 -0
- package/express/load-document.js +3 -0
- package/express/load-more.js +6 -0
- package/express/load-object.js +10 -0
- package/express/oembed.js +18 -0
- package/express/rss.js +19 -0
- package/express/sitemaps.js +16 -0
- package/express/website-context.js +19 -0
- package/index.js +8 -0
- package/integration/test-website-boot.js +198 -0
- package/marko.json +6 -0
- package/middleware/disabled-features.js +15 -0
- package/middleware/index.js +15 -0
- package/middleware/page-node/index.js +45 -0
- package/middleware/page-node/resolved.js +26 -0
- package/middleware/with-content.js +54 -0
- package/middleware/with-dynamic-page.js +37 -0
- package/middleware/with-load-more.js +9 -0
- package/middleware/with-magazine-issue.js +24 -0
- package/middleware/with-magazine-publication.js +24 -0
- package/middleware/with-website-section.js +47 -0
- package/package.json +64 -0
- package/scss/carousel.scss +42 -0
- package/scss/document.scss +55 -0
- package/scss/fonts/alata-fallback.scss +7 -0
- package/scss/fonts/alegreya-fallback.scss +6 -0
- package/scss/fonts/arimo-fallback.scss +7 -0
- package/scss/fonts/fira-sans-fallback.scss +7 -0
- package/scss/fonts/ibm-plex-sans-fallback.scss +7 -0
- package/scss/fonts/informapro-fallback.scss +6 -0
- package/scss/fonts/lato-fallback.scss +7 -0
- package/scss/fonts/manrope-fallback.scss +6 -0
- package/scss/fonts/merriweather-fallback.scss +7 -0
- package/scss/fonts/montserrat-fallback.scss +7 -0
- package/scss/fonts/open-sans-condensed-fallback.scss +6 -0
- package/scss/fonts/open-sans-fallback.scss +7 -0
- package/scss/fonts/oswald-fallback.scss +7 -0
- package/scss/fonts/poppins-fallback.scss +6 -0
- package/scss/fonts/pt-sans-fallback.scss +6 -0
- package/scss/fonts/pt-serif-fallback.scss +6 -0
- package/scss/fonts/public-sans-fallback.scss +7 -0
- package/scss/fonts/raleway-fallback.scss +6 -0
- package/scss/fonts/roboto-condensed-fallback.scss +7 -0
- package/scss/fonts/roboto-fallback.scss +7 -0
- package/scss/fonts/roboto-slab-fallback.scss +7 -0
- package/scss/fonts/solitaire-mvb-pro-fallback.scss +6 -0
- package/scss/fonts/source-sans-4-fallback.scss +7 -0
- package/scss/fonts/source-serif-pro-fallback.scss +7 -0
- package/scss/fonts/synthese-fallback.scss +6 -0
- package/scss/fonts/zilla-slab-fallback.scss +6 -0
- package/scss/load-more.scss +3 -0
- package/scss/node-list.scss +144 -0
- package/scss/node.scss +371 -0
- package/scss/page-image.scss +15 -0
- package/start-server.js +169 -0
- package/utils/apply-query-params.js +16 -0
- package/utils/build-content-input.js +9 -0
- package/utils/build-marko-global.js +1 -0
- package/utils/default-value.js +1 -0
- package/utils/embedded-media/facebook-oembed.js +50 -0
- package/utils/embedded-media/image.js +71 -0
- package/utils/embedded-media/index.js +8 -0
- package/utils/embedded-media/instagram-oembed.js +57 -0
- package/utils/embedded-media/oembed.js +18 -0
- package/utils/hierarchy-aliases.js +3 -0
- package/utils/hierarchy-ids.js +3 -0
- package/utils/index.js +11 -0
- package/utils/is-dev.js +1 -0
- package/utils/published-content/description.js +1 -0
- package/utils/render-ssr-component-from-marko.js +18 -0
- package/utils/render-ssr-component.js +15 -0
- package/utils/should-collapse.js +1 -0
package/.eslintignore
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Parameter1 LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../../eslintrc.browser');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default (name) => `marko-web-${name}-${Date.now()}-${Math.floor(Math.random() * 1000)}`;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="canDownload"
|
|
4
|
+
class="button-wrapper"
|
|
5
|
+
>
|
|
6
|
+
<p>
|
|
7
|
+
Your download should start automatically.
|
|
8
|
+
If not,
|
|
9
|
+
<a
|
|
10
|
+
:href="target"
|
|
11
|
+
target="_blank"
|
|
12
|
+
rel="noopener noreferer"
|
|
13
|
+
>
|
|
14
|
+
click here
|
|
15
|
+
</a>
|
|
16
|
+
to access this document.
|
|
17
|
+
</p>
|
|
18
|
+
</div>
|
|
19
|
+
<div v-else>
|
|
20
|
+
<strong>To access this piece of premium content, please fill out the following form:</strong>
|
|
21
|
+
<div :id="formId" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import cleanPath from '../../utils/clean-path';
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
props: {
|
|
30
|
+
formHash: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
userName: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
label: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'Download',
|
|
41
|
+
},
|
|
42
|
+
target: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
height: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: '400',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data: () => ({ canDownload: false }),
|
|
52
|
+
computed: {
|
|
53
|
+
formId() {
|
|
54
|
+
return `wufoo-${this.formHash}`;
|
|
55
|
+
},
|
|
56
|
+
formUrl() {
|
|
57
|
+
return `https://${this.userName}.wufoo.com/forms/${cleanPath(this.formHash)}`;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
async mounted() {
|
|
61
|
+
if (!window.WufooForm) {
|
|
62
|
+
await (new Promise((resolve, reject) => {
|
|
63
|
+
const s = document.createElement('script');
|
|
64
|
+
s.src = 'https://secure.wufoo.com/scripts/embed/form.js';
|
|
65
|
+
s.async = 1;
|
|
66
|
+
s.onerror = () => reject(new Error('Unable to load Wufoo form script.'));
|
|
67
|
+
s.onload = resolve;
|
|
68
|
+
const scr = document.getElementsByTagName('script')[0];
|
|
69
|
+
scr.parentNode.insertBefore(s, scr);
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
this.init();
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
init() {
|
|
76
|
+
const options = {
|
|
77
|
+
userName: this.userName,
|
|
78
|
+
formHash: this.formHash,
|
|
79
|
+
autoResize: true,
|
|
80
|
+
height: this.height,
|
|
81
|
+
header: 'hide',
|
|
82
|
+
async: true,
|
|
83
|
+
ssl: true,
|
|
84
|
+
addSubmitListener: (e) => {
|
|
85
|
+
if (e.data === 'wufoo-submit-done' && this.target) {
|
|
86
|
+
this.canDownload = true;
|
|
87
|
+
window.open(this.target);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
const instance = new window.WufooForm();
|
|
92
|
+
instance.initialize(options);
|
|
93
|
+
instance.display();
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="carousel-item" :class="classNames">
|
|
3
|
+
<img :src="image.src" :srcset="image.srcset" :alt="image.alt">
|
|
4
|
+
<div class="carousel-caption">
|
|
5
|
+
<h5 v-if="image.displayName">
|
|
6
|
+
{{ image.displayName }}
|
|
7
|
+
</h5>
|
|
8
|
+
<p v-if="image.caption" class="carousel-caption--caption">
|
|
9
|
+
{{ image.caption }}
|
|
10
|
+
</p>
|
|
11
|
+
<p v-if="image.credit" class="carousel-caption--credit">
|
|
12
|
+
Source: {{ image.credit }}
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
props: {
|
|
21
|
+
activeIndex: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
index: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
length: {
|
|
30
|
+
type: Number,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
image: {
|
|
34
|
+
type: Object,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
classNames() {
|
|
40
|
+
const { activeIndex, index, length } = this;
|
|
41
|
+
const prevIdx = activeIndex - 1 < 0 ? activeIndex : activeIndex - 1;
|
|
42
|
+
const nextIdx = activeIndex + 1 >= length ? activeIndex : activeIndex + 1;
|
|
43
|
+
const active = index === activeIndex;
|
|
44
|
+
const carouselItemLeft = index === prevIdx && activeIndex !== index;
|
|
45
|
+
const carouselItemRight = index === nextIdx && activeIndex !== index;
|
|
46
|
+
return {
|
|
47
|
+
active,
|
|
48
|
+
'carousel-item-prev': carouselItemLeft,
|
|
49
|
+
'carousel-item-next': carouselItemRight,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classNames">
|
|
3
|
+
<ol class="carousel-indicators">
|
|
4
|
+
<li
|
|
5
|
+
v-for="(image, index) in images"
|
|
6
|
+
:key="index"
|
|
7
|
+
:class="{ active: index === activeIndex }"
|
|
8
|
+
@click="set(index)"
|
|
9
|
+
/>
|
|
10
|
+
</ol>
|
|
11
|
+
<div class="carousel-inner">
|
|
12
|
+
<image-slide
|
|
13
|
+
v-for="(image, index) in images"
|
|
14
|
+
:key="index"
|
|
15
|
+
:length="images.length"
|
|
16
|
+
:index="index"
|
|
17
|
+
:image="image"
|
|
18
|
+
:active-index="activeIndex"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<a
|
|
22
|
+
href="#previous-slide"
|
|
23
|
+
class="carousel-control-prev"
|
|
24
|
+
role="button"
|
|
25
|
+
@click="decrement"
|
|
26
|
+
>
|
|
27
|
+
<span class="carousel-control-prev-icon" aria-label="Previous Slide" aria-hidden="true" />
|
|
28
|
+
</a>
|
|
29
|
+
<a
|
|
30
|
+
href="#next-slide"
|
|
31
|
+
class="carousel-control-next"
|
|
32
|
+
role="button"
|
|
33
|
+
@click="increment"
|
|
34
|
+
>
|
|
35
|
+
<span class="carousel-control-next-icon" aria-label="Next Slide" aria-hidden="true" />
|
|
36
|
+
</a>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import ImageSlide from './image-slide.vue';
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
components: {
|
|
45
|
+
ImageSlide,
|
|
46
|
+
},
|
|
47
|
+
props: {
|
|
48
|
+
images: {
|
|
49
|
+
type: Array,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
modifiers: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default: () => [],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
data: () => ({
|
|
58
|
+
activeIndex: 0,
|
|
59
|
+
blockName: 'carousel',
|
|
60
|
+
}),
|
|
61
|
+
|
|
62
|
+
computed: {
|
|
63
|
+
classNames() {
|
|
64
|
+
const { blockName } = this;
|
|
65
|
+
return [
|
|
66
|
+
blockName,
|
|
67
|
+
...this.modifiers.map((mod) => `${blockName}--${mod}`),
|
|
68
|
+
];
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
methods: {
|
|
73
|
+
set(index) {
|
|
74
|
+
this.activeIndex = index;
|
|
75
|
+
},
|
|
76
|
+
increment() {
|
|
77
|
+
const { activeIndex } = this;
|
|
78
|
+
const { length } = this.images;
|
|
79
|
+
this.activeIndex = (activeIndex + 1 >= length) ? activeIndex : activeIndex + 1;
|
|
80
|
+
},
|
|
81
|
+
decrement() {
|
|
82
|
+
const { activeIndex } = this;
|
|
83
|
+
this.activeIndex = (activeIndex - 1 < 0) ? activeIndex : activeIndex - 1;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const LoadMoreTrigger = () => import(/* webpackChunkName: "load-more-trigger" */ './load-more-trigger.vue');
|
|
2
|
+
const TriggerInViewEvent = () => import(/* webpackChunkName: "trigger-in-view-event" */ './trigger-in-view-event.vue');
|
|
3
|
+
const TriggerScreenChangeEvent = () => import(/* webpackChunkName: "trigger-screen-change-event" */ './trigger-screen-change-event.vue');
|
|
4
|
+
const OEmbed = () => import(/* webpackChunkName: "oembed" */ './oembed.vue');
|
|
5
|
+
const WufooGatedDownload = () => import(/* webpackChunkName: "wufoo-gated-download" */ './gated-download/wufoo.vue');
|
|
6
|
+
const ImageSlider = () => import(/* webpackChunkName: "image-slider" */ './image-slider.vue');
|
|
7
|
+
|
|
8
|
+
export default (Browser) => {
|
|
9
|
+
Browser.register('LoadMoreTrigger', LoadMoreTrigger);
|
|
10
|
+
Browser.register('TriggerInViewEvent', TriggerInViewEvent);
|
|
11
|
+
Browser.register('TriggerScreenChangeEvent', TriggerScreenChangeEvent);
|
|
12
|
+
Browser.register('OEmbed', OEmbed);
|
|
13
|
+
Browser.register('WufooGatedDownload', WufooGatedDownload);
|
|
14
|
+
Browser.register('ImageSlider', ImageSlider);
|
|
15
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="elementId"
|
|
4
|
+
:class="classes"
|
|
5
|
+
:style="{ display: display }"
|
|
6
|
+
:data-expand="expand"
|
|
7
|
+
>
|
|
8
|
+
<div v-if="error">
|
|
9
|
+
<pre>An unexpected error occurred: {{ error.message }}</pre>
|
|
10
|
+
<pre>{{ error.stack }}</pre>
|
|
11
|
+
</div>
|
|
12
|
+
<button
|
|
13
|
+
v-else
|
|
14
|
+
:class="buttonClass"
|
|
15
|
+
:disabled="loading"
|
|
16
|
+
@click="load()"
|
|
17
|
+
>
|
|
18
|
+
<template v-if="loading">
|
|
19
|
+
Loading...
|
|
20
|
+
</template>
|
|
21
|
+
<template v-else>
|
|
22
|
+
{{ buttonLabel }}
|
|
23
|
+
</template>
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import $ from '../jquery';
|
|
30
|
+
import elementId from './element-id';
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
props: {
|
|
34
|
+
mountPoint: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
pageNumber: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 1,
|
|
41
|
+
},
|
|
42
|
+
provide: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => ({}),
|
|
45
|
+
},
|
|
46
|
+
appendTo: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
maxPages: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: null,
|
|
53
|
+
},
|
|
54
|
+
className: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: null,
|
|
57
|
+
},
|
|
58
|
+
buttonClass: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: null,
|
|
61
|
+
},
|
|
62
|
+
buttonLabel: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'Load More Content',
|
|
65
|
+
},
|
|
66
|
+
expand: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 250,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
data: () => ({ loading: false, hasLoaded: false, error: null }),
|
|
72
|
+
computed: {
|
|
73
|
+
classes() {
|
|
74
|
+
const classes = ['load-more-trigger', 'lazyload'];
|
|
75
|
+
if (this.className) classes.push(this.className);
|
|
76
|
+
return classes;
|
|
77
|
+
},
|
|
78
|
+
elementId() {
|
|
79
|
+
return elementId('load-more');
|
|
80
|
+
},
|
|
81
|
+
display() {
|
|
82
|
+
if (this.hasLoaded) return 'none';
|
|
83
|
+
return 'block';
|
|
84
|
+
},
|
|
85
|
+
canLazyload() {
|
|
86
|
+
if (this.maxPages === 0) return false;
|
|
87
|
+
const max = parseInt(this.maxPages, 10);
|
|
88
|
+
if (!max) return true;
|
|
89
|
+
return this.pageNumber <= max;
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
created() {
|
|
93
|
+
if (this.canLazyload) document.addEventListener('lazybeforeunveil', this.lazyload.bind(this));
|
|
94
|
+
},
|
|
95
|
+
methods: {
|
|
96
|
+
lazyload({ target }) {
|
|
97
|
+
if (target.id === this.elementId) this.load();
|
|
98
|
+
},
|
|
99
|
+
async load() {
|
|
100
|
+
const input = {
|
|
101
|
+
...this.provide,
|
|
102
|
+
pageNumber: this.pageNumber + 1,
|
|
103
|
+
};
|
|
104
|
+
this.error = null;
|
|
105
|
+
this.loading = true;
|
|
106
|
+
const href = `${this.mountPoint}/?input=${encodeURIComponent(JSON.stringify(input))}`;
|
|
107
|
+
try {
|
|
108
|
+
const r = await fetch(href, { credentials: 'same-origin' });
|
|
109
|
+
const html = await r.text();
|
|
110
|
+
const temp = document.createElement('div');
|
|
111
|
+
if (this.appendTo) {
|
|
112
|
+
const parent = document.querySelector(this.appendTo);
|
|
113
|
+
if (parent) {
|
|
114
|
+
parent.appendChild(temp);
|
|
115
|
+
$(temp).replaceWith(html);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
} catch (e) {
|
|
119
|
+
// @todo Log this!
|
|
120
|
+
this.error = e;
|
|
121
|
+
} finally {
|
|
122
|
+
this.loading = false;
|
|
123
|
+
this.hasLoaded = true;
|
|
124
|
+
document.removeEventListener('lazybeforeunveil', this.lazyload.bind(this));
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
</script>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-v-html-->
|
|
2
|
+
<template>
|
|
3
|
+
<span
|
|
4
|
+
v-if="oembedType === 'link'"
|
|
5
|
+
:id="id"
|
|
6
|
+
class="lazyload"
|
|
7
|
+
:data-embed-type="attrs.type"
|
|
8
|
+
:data-oembed-type="oembedType"
|
|
9
|
+
:data-oembed-provider="provider"
|
|
10
|
+
:data-expand="expand"
|
|
11
|
+
>
|
|
12
|
+
<iframe
|
|
13
|
+
:src="oembedUrl"
|
|
14
|
+
width="100%"
|
|
15
|
+
height="100%"
|
|
16
|
+
frameborder="0"
|
|
17
|
+
/>
|
|
18
|
+
</span>
|
|
19
|
+
<span
|
|
20
|
+
v-else
|
|
21
|
+
:id="id"
|
|
22
|
+
class="lazyload"
|
|
23
|
+
:data-embed-type="attrs.type"
|
|
24
|
+
:data-oembed-type="oembedType"
|
|
25
|
+
:data-oembed-provider="provider"
|
|
26
|
+
:data-expand="expand"
|
|
27
|
+
v-html="html"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
props: {
|
|
34
|
+
url: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
expand: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 250,
|
|
41
|
+
},
|
|
42
|
+
attrs: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: () => ({}),
|
|
45
|
+
},
|
|
46
|
+
mountPoint: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
data: () => ({
|
|
52
|
+
loading: false,
|
|
53
|
+
error: null,
|
|
54
|
+
embed: null,
|
|
55
|
+
oembedType: null,
|
|
56
|
+
oembedUrl: null,
|
|
57
|
+
provider: null,
|
|
58
|
+
observer: null,
|
|
59
|
+
}),
|
|
60
|
+
computed: {
|
|
61
|
+
id() {
|
|
62
|
+
const clean = `${this.attrs.id}`.replace(/[\W|-]/ig, '');
|
|
63
|
+
return `${clean}-${Date.now()}`;
|
|
64
|
+
},
|
|
65
|
+
html() {
|
|
66
|
+
if (this.embed) return this.embed;
|
|
67
|
+
if (this.error) return `<pre>An unexpected error occurred: ${this.error.message}</pre>`;
|
|
68
|
+
if (this.loading) return `Loading embed from ${this.url}`;
|
|
69
|
+
return '';
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
mounted() {
|
|
73
|
+
document.addEventListener('lazybeforeunveil', this.lazyload.bind(this));
|
|
74
|
+
if (window.MutationObserver) {
|
|
75
|
+
// inline script tags aren't added to the DOM, so the twitter widget never loads
|
|
76
|
+
// This would be widespread -- if the payload returns a script tag, ensure that it is
|
|
77
|
+
// appended to the head rather than written as part of the `embed` code here.
|
|
78
|
+
this.observer = new MutationObserver((mutationList) => {
|
|
79
|
+
for (let i = 0; i < mutationList.length; i += 1) {
|
|
80
|
+
const mutation = mutationList[i];
|
|
81
|
+
if (mutation.type === 'childList') {
|
|
82
|
+
for (let x = 0; x < mutation.addedNodes.length; x += 1) {
|
|
83
|
+
const added = mutation.addedNodes[x];
|
|
84
|
+
if (added.tagName && added.tagName === 'SCRIPT') {
|
|
85
|
+
const script = document.createElement('script');
|
|
86
|
+
for (let n = 0; n < added.attributes.length; n += 1) {
|
|
87
|
+
const { name, value } = added.attributes[n];
|
|
88
|
+
script.setAttribute(name, value);
|
|
89
|
+
}
|
|
90
|
+
document.querySelector('head').appendChild(script);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const node = document.getElementById(this.id);
|
|
97
|
+
this.observer.observe(node, { childList: true, subtree: true });
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
beforeDestroy() {
|
|
101
|
+
document.removeEventListener('lazybeforeunveil', this.lazyload);
|
|
102
|
+
if (this.observer) this.observer.disconnect();
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
lazyload({ target }) {
|
|
106
|
+
if (target.id === this.id) this.load();
|
|
107
|
+
},
|
|
108
|
+
async load() {
|
|
109
|
+
this.loading = true;
|
|
110
|
+
const href = `${this.mountPoint}?url=${encodeURIComponent(this.url)}`;
|
|
111
|
+
try {
|
|
112
|
+
const r = await fetch(href, { credentials: 'same-origin' });
|
|
113
|
+
const {
|
|
114
|
+
html,
|
|
115
|
+
type,
|
|
116
|
+
provider_name: provider,
|
|
117
|
+
url,
|
|
118
|
+
} = await r.json();
|
|
119
|
+
this.oembedType = type;
|
|
120
|
+
this.provider = provider;
|
|
121
|
+
this.embed = html;
|
|
122
|
+
this.oembedUrl = url;
|
|
123
|
+
} catch (e) {
|
|
124
|
+
// @todo Log this!
|
|
125
|
+
this.error = e;
|
|
126
|
+
} finally {
|
|
127
|
+
this.loading = false;
|
|
128
|
+
document.removeEventListener('lazybeforeunveil', this.lazyload);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :id="elementId" class="lazyload" :data-expand="expand" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import EventBus from '../event-bus';
|
|
7
|
+
import elementId from './element-id';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
props: {
|
|
11
|
+
eventName: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'in-view',
|
|
14
|
+
},
|
|
15
|
+
expand: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: -100,
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({}),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
elementId() {
|
|
26
|
+
return elementId(`${this.eventName}-event`);
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
created() {
|
|
30
|
+
document.addEventListener('lazybeforeunveil', this.trigger.bind(this));
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
trigger(event) {
|
|
34
|
+
const { target } = event;
|
|
35
|
+
if (target.id === this.elementId) {
|
|
36
|
+
EventBus.$emit(this.eventName, { event, data: this.data });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :id="elementId" style="display: none;" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import EventBus from '../event-bus';
|
|
7
|
+
import elementId from './element-id';
|
|
8
|
+
import $ from '../jquery';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
props: {
|
|
12
|
+
multiplier: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 1.35,
|
|
15
|
+
},
|
|
16
|
+
screenHeight: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 1000,
|
|
19
|
+
},
|
|
20
|
+
scrollTimeoutMs: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 250,
|
|
23
|
+
},
|
|
24
|
+
eventName: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'screen_change',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
data: () => ({
|
|
31
|
+
activeScreen: 1,
|
|
32
|
+
didScroll: true,
|
|
33
|
+
}),
|
|
34
|
+
|
|
35
|
+
computed: {
|
|
36
|
+
elementId() {
|
|
37
|
+
return elementId(`${this.eventName}-event`);
|
|
38
|
+
},
|
|
39
|
+
maxHeight() {
|
|
40
|
+
const { screenHeight } = this;
|
|
41
|
+
if (!screenHeight) return window.innerHeight;
|
|
42
|
+
return screenHeight;
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
watch: {
|
|
47
|
+
activeScreen(current, old) {
|
|
48
|
+
const direction = current < old ? 'Up' : 'Down';
|
|
49
|
+
this.trigger(direction);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
mounted() {
|
|
54
|
+
$(window).on('scroll', () => {
|
|
55
|
+
this.didScroll = true;
|
|
56
|
+
});
|
|
57
|
+
setInterval(this.handleScroll, this.scrollTimeoutMs);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
beforeDestroy() {
|
|
61
|
+
clearInterval(this.handleScroll);
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
methods: {
|
|
65
|
+
getScrollY() {
|
|
66
|
+
return window.pageYOffset || window.scrollY;
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
handleScroll() {
|
|
70
|
+
if (this.didScroll) {
|
|
71
|
+
this.setActiveScreen();
|
|
72
|
+
this.didScroll = false;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
setActiveScreen() {
|
|
77
|
+
const screenHeight = this.maxHeight * this.multiplier;
|
|
78
|
+
this.activeScreen = Math.floor(this.getScrollY() / screenHeight) + 1;
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
trigger(direction) {
|
|
82
|
+
EventBus.$emit(this.eventName, {
|
|
83
|
+
direction,
|
|
84
|
+
activeScreen: this.activeScreen,
|
|
85
|
+
scrollY: this.getScrollY(),
|
|
86
|
+
maxHeight: this.maxHeight,
|
|
87
|
+
multiplier: this.multiplier,
|
|
88
|
+
innerHeight: window.innerHeight,
|
|
89
|
+
innerWidth: window.innerWidth,
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|