From 79f46eaf48b8891fa8cf7cbde52c12551d6ae6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 13 Nov 2018 18:18:43 +0100 Subject: [PATCH] Replace jquery-lazy with lazysizes --- package-lock.json | 13 ++++------ package.json | 2 +- .../Resources/Private/Assets/js/_app.js | 11 +-------- .../Assets/js/components/SearchResultItem.vue | 8 +++---- .../Resources/Private/Assets/scss/_base.scss | 2 +- .../Private/Partials/Disturber/Large.html | 2 +- .../Private/Partials/Disturber/Reminder.html | 2 +- .../Private/Partials/Disturber/Small.html | 2 +- .../Private/Partials/Hotel/TeaserWide.html | 16 ++++++------- .../Private/Partials/News/List/Item.html | 16 ++++++------- .../Resources/Private/Partials/Officetip.html | 4 +++- .../Private/Partials/Product/TeaserWide.html | 8 +++---- .../Private/Partials/RegionMaps.html | 2 +- .../Resources/Private/Partials/Teamer.html | 4 +++- .../Private/Partials/TeaserImage.html | 24 +++++++++---------- .../Private/Partials/TeaserWideImage.html | 10 ++++---- .../Private/Partials/Textmedia/Default.html | 2 +- .../Partials/Textmedia/Partnerlogos.html | 2 +- .../Templates/FluidStyledContent/Lineup.html | 2 +- .../Private/Templates/Team/List.html | 3 ++- webpack.config.js | 2 +- 21 files changed, 65 insertions(+), 72 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2cba11df..aebd0fff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4920,14 +4920,6 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-1.12.4.tgz", "integrity": "sha1-AeHfuikP5z3rp3zurLD5ui/sngw=" }, - "jquery-lazy": { - "version": "1.7.10", - "resolved": "https://registry.npmjs.org/jquery-lazy/-/jquery-lazy-1.7.10.tgz", - "integrity": "sha512-1vBpU+igfZJ58BrQrk2OFl3TMriGeIfZUg35uSIajZF4GcxF96NtdS3LbWk5a72rH2ypz0odTsAkqhUsICknhw==", - "requires": { - "jquery": ">=1.7.2" - } - }, "js-base64": { "version": "2.4.9", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.9.tgz", @@ -5046,6 +5038,11 @@ "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", "dev": true }, + "lazysizes": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lazysizes/-/lazysizes-4.1.4.tgz", + "integrity": "sha512-jVplgeHHoQ6a2RZtxCAKFAnm6QPQmEIKq4JWSTI1XfCBhn+CqDgMKWDJO81f8VtVBdAlHs+BzP2WGzMLUi3oFg==" + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", diff --git a/package.json b/package.json index 4387be82..74cab8ce 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "flatpickr": "^4.5.2", "font-awesome": "^4.7.0", "jquery": "^1.12.4", - "jquery-lazy": "^1.7.10", + "lazysizes": "^4.1.4", "leaflet": "^1.3.4", "normalize.css": "^7.0.0", "picturefill": "^3.0.3", diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js index 5de5fdbd..d356bea4 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js @@ -12,7 +12,7 @@ global.$ = global.jQuery = $; require('cookieconsent'); require('slick-carousel'); -require('jquery-lazy'); +require('lazysizes'); require('bootstrap-sass/assets/javascripts/bootstrap'); require('picturefill'); require('leaflet'); @@ -292,13 +292,6 @@ new Vue({ $filterPanel.addClass('in'); } }, - initImageLazyLoading () { - $('.lazy').Lazy({ - scrollDirection: 'vertical', - effect: 'fadeIn', - visibleOnly: true - }); - }, initPartnerIdSelect () { $('[data-force-partnerid-select]').on('click', '.booking-link', function (e) { e.preventDefault(); @@ -377,7 +370,6 @@ new Vue({ Vue.nextTick(() => { this.initContentsliders(); this.initTooltips(); - this.initImageLazyLoading(); this.initFilterpanel(); this.appendPaCode(); }); @@ -422,7 +414,6 @@ new Vue({ this.initContentsliders(); this.initPhoneLinks(); this.initTooltips(); - this.initImageLazyLoading(); this.initDropdownMenuBehavior(); this.initPartnerIdSelect(); this.initFaqFilter(); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue index 125baea0..b41b5c22 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue @@ -5,10 +5,10 @@ - - - - + + + diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/_base.scss b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/_base.scss index 23b48d0d..df832129 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/_base.scss +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/_base.scss @@ -121,7 +121,7 @@ a.anchor:target { } // Image lazy loading placeholder -img.lazy { +img.lazyloading { background: url(../images/lazy.png) no-repeat top center; } diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html index 53736427..7eb232d8 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Large.html @@ -11,7 +11,7 @@
- {teaserImage.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Reminder.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Reminder.html index 3a122893..01165b24 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Reminder.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Reminder.html @@ -11,7 +11,7 @@ - {teaserImage.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html index 2c484aae..e8bfc78e 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Disturber/Small.html @@ -11,7 +11,7 @@
- {teaserImage.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html index 05aadc2e..a95a1f45 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html @@ -109,16 +109,16 @@ - - - - {image.alternative} @@ -126,19 +126,19 @@ - - - - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/News/List/Item.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/News/List/Item.html index b2314069..d66818e0 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/News/List/Item.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/News/List/Item.html @@ -10,20 +10,20 @@ - + {mediaElement.originalResource.alternative} - + {mediaElement.originalResource.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html index 0fa624f5..ad6e8ead 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html @@ -5,7 +5,9 @@

Officetipp

- + {officetip.author.name} {officetip.author.name} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/TeaserWide.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/TeaserWide.html index 5b9a85b1..702095bb 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/TeaserWide.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/TeaserWide.html @@ -112,10 +112,10 @@ - - - - + + + {image.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/RegionMaps.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/RegionMaps.html index 586adb8b..ce29d6bb 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/RegionMaps.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/RegionMaps.html @@ -6,7 +6,7 @@
- {regionMap.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Teamer.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Teamer.html index cef7c8bf..1e29543b 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Teamer.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Teamer.html @@ -6,7 +6,9 @@
- + {teamerInCharge.name} {teamerInCharge.name} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserImage.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserImage.html index 6c0f4fba..26541bc0 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserImage.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserImage.html @@ -1,49 +1,49 @@ - - - - - - {image.alternative} - - - - - - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserWideImage.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserWideImage.html index 47f4d869..4d9417ac 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserWideImage.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserWideImage.html @@ -1,19 +1,19 @@ - - - - - {image.alternative} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Textmedia/Default.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Textmedia/Default.html index 5323958d..ab5b2962 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Textmedia/Default.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Textmedia/Default.html @@ -8,7 +8,7 @@ {data.bodytext -> f:format.html()} - {files.0.originalResource.alternative}