diff --git a/package-lock.json b/package-lock.json index f94e3ecd..089cbb46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4819,6 +4819,11 @@ "picomatch": "^2.2.3" } }, + "microtip": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/microtip/-/microtip-0.2.2.tgz", + "integrity": "sha512-oah38eH5vSHVFP6yXjbKWOYt92mav++0j3zh844h1vhOscqEg7Rf4agDEIwUTFCcAPPdlhYUQMe6eZfHgD+4oQ==" + }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -7004,6 +7009,12 @@ "resolved": "https://registry.npmjs.org/slick-carousel/-/slick-carousel-1.8.1.tgz", "integrity": "sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA==" }, + "smoothscroll-polyfill": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/smoothscroll-polyfill/-/smoothscroll-polyfill-0.4.4.tgz", + "integrity": "sha512-TK5ZA9U5RqCwMpfoMq/l1mrH0JAR7y7KRvOBx0n2869aLxch+gT9GhN3yUfjiw+d/DiF1mKo14+hd62JyMmoBg==", + "dev": true + }, "sockjs": { "version": "0.3.21", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", diff --git a/package.json b/package.json index 65b2eb5e..c55f57b7 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "jquery": "^1.12.4", "lazysizes": "^4.1.8", "leaflet": "^1.7.1", + "microtip": "^0.2.2", "normalize.css": "^7.0.0", "picturefill": "^3.0.3", "sass-mq": "^3.3.2", @@ -39,9 +40,9 @@ }, "devDependencies": { "@babel/plugin-proposal-object-rest-spread": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.14.5", "@symfony/webpack-encore": "^1.5.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", "autoprefixer": "^9.4.6", "core-js": "^3.15.0", "file-loader": "^6.2.0", @@ -49,6 +50,7 @@ "postcss": "^8.3.5", "postcss-loader": "^5.3.0", "sass-loader": "^9.0.3", + "smoothscroll-polyfill": "^0.4.4", "vue-loader": "^15.9.7", "vue-template-compiler": "^2.6.14" }, diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js index e58f7bf7..2d6bcbc3 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js @@ -6,6 +6,51 @@ const application = Application.start() const context = require.context('./controllers', true, /\.js$/) application.load(definitionsFromContext(context)) +// Polyfills +import smoothscroll from 'smoothscroll-polyfill' +smoothscroll.polyfill() + +// Function to parse config values from JSON data in HTML source +const parseAppConfig = () => { + const configElement = document.getElementById('appconfig'); + if (null === configElement) { + return {} + } + return JSON.parse(configElement.innerHTML); +} + +// Function to append pacode parameter to urls specified in config by domain +const appendPaCode = appConfig => { + const paCode = appConfig.paCode + const externalDomains = appConfig.externalDomains + if (!paCode) { + return + } + document.querySelectorAll('a').forEach(element => { + if (element.hostname === location.hostname) { + return + } + if (externalDomains.indexOf(element.hostname) === -1) { + return + } + let url = element.href + if (!url) { + return + } + if (url.indexOf('agenturcode=') !== -1) { + return + } + const separator = url.indexOf('?') === -1 ? '?' : '&' + url += separator + 'agenturcode=' + paCode + element.href = url + }) +} + +// Executed on document ready +document.addEventListener('DOMContentLoaded', () => { + const appConfig = parseAppConfig() + appendPaCode(appConfig) +}) @@ -16,12 +61,10 @@ import $ from 'jquery' import dayjs from 'dayjs' import 'dayjs/locale/de' import '@fancyapps/fancybox' -import axios from 'axios' global.$ = global.jQuery = $; require('cookieconsent'); -require('slick-carousel'); require('lazysizes'); require('lazysizes/plugins/unveilhooks/ls.unveilhooks'); require('bootstrap-sass/assets/javascripts/bootstrap'); @@ -44,9 +87,6 @@ import HotelList from './components/HotelList.vue' // Define global constants const $window = $(window); -const sliderPrevArrow = ''; -const sliderNextArrow = ''; -const sliderDot = ' diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue index 64055dc8..44732f12 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue @@ -27,7 +27,11 @@ Termin - + + + + + Preis ab inkl. @@ -59,14 +63,16 @@ - + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceTable.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceTable.vue index 2b2186cd..8af16f8b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceTable.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceTable.vue @@ -53,21 +53,25 @@ {{ calculatePrice(row) }} € - - + + + + + + + class="button button--light button--small hidden-xs" + data-toggle="modal" :data-target="'#optservices' + index" + data-microtip-position="top" aria-label="Alle Zusatzleistungen anzeigen" role="tooltip">Optionen