wickes-css2 2.103.0-IC-977-colors-semantic.1 → 2.103.0-IC-976-pre-commit-lint.1
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/build/css/category-main.css +1 -1
- package/build/css/components/card-product-banner.css +1 -1
- package/build/css/homepage-main.css +1 -1
- package/build/css/kitchen-plp-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/page_my-orders.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.css +1 -1
- package/build/css/pages/page_wismo-orders.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/js/account-members.min.js +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +54 -0
- package/build/js/kitchen/kitchen-plp.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/plp-cards-v2.js +15 -6
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +7 -3
- package/src/components/card_product_v2.hbs +10 -5
- package/src/components/card_sponsor_banner.hbs +8 -0
- package/src/components/card_sponsor_product.hbs +6 -0
- package/src/components/injected-content.hbs +1 -1
- package/src/data/data_search-results_v2.json +56 -141
- package/src/js/components/banner-placement-manager.js +258 -0
- package/src/js/emulation/banner-placement-manager.js +53 -0
- package/src/js/page/plp-cards-v2.js +15 -6
- package/src/js/page/plp-load-more.js +1 -1
- package/src/page_plp_v2.html +16 -6
- package/src/page_search-results.html +12 -2
- package/src/scss/components/_custom-slider.scss +6 -6
- package/src/scss/components/card-product-banner.scss +91 -3
- package/src/scss/helpers/_variables.scss +1 -3
- package/src/scss/libs/_bootstrap-extracted.scss +2 -2
- package/src/scss/libs/_cat-libs.scss +10 -10
- package/src/scss/libs/_font-awesome-icons.scss +2 -0
- package/src/scss/libs/_homepage-libs.scss +12 -12
- package/src/scss/libs/_plp-libs.scss +11 -11
- package/src/scss/libs/_skeleton.scss +2 -2
- package/src/scss/libs/_store-locator-libs.scss +1 -1
- package/src/scss/libs/flatpickr.scss +4 -4
- package/src/scss/pages/_checkout-confirmation-new.scss +2 -2
- package/src/scss/pages/page_products-list-combined.scss +11 -0
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/scss/partials/_main-nav.scss +2 -2
- package/src/js/components/product-banner.js +0 -148
- package/src/scss/helpers/_colors-semantic.scss +0 -224
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wickes-css2",
|
|
3
|
-
"version": "2.103.0-IC-
|
|
3
|
+
"version": "2.103.0-IC-976-pre-commit-lint.1",
|
|
4
4
|
"description": "CSS and JS and page templates in use by Wickes",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"lint:scss": "sass-lint -v --no-exit --max-warnings=0",
|
|
7
8
|
"lint:fix": "sass-lint-auto-fix",
|
|
8
|
-
"build": "gulp build"
|
|
9
|
+
"build": "gulp build",
|
|
10
|
+
"prepare": "husky install"
|
|
9
11
|
},
|
|
10
12
|
"keywords": [
|
|
11
13
|
"css",
|
|
@@ -79,12 +81,14 @@
|
|
|
79
81
|
"hbsfy": "^2.8.1",
|
|
80
82
|
"helper": "0.0.13",
|
|
81
83
|
"highlight.js": "9.13.0",
|
|
84
|
+
"husky": "8",
|
|
82
85
|
"jquery": "^3.5.1",
|
|
83
86
|
"jquery.scrollbar": "^0.2.11",
|
|
84
87
|
"js-cookie": "^3.0.1",
|
|
85
88
|
"node-gyp": "^8.0.0",
|
|
86
89
|
"popper.js": "^1.12.9",
|
|
87
90
|
"rebuild": "^0.1.2",
|
|
91
|
+
"sass-lint": "^1.13.1",
|
|
88
92
|
"simplebar": "^6.2.5",
|
|
89
93
|
"skeleton-screen-css": "^1.1.0",
|
|
90
94
|
"swiper": "^4.1.6",
|
|
@@ -108,7 +112,7 @@
|
|
|
108
112
|
"branches": [
|
|
109
113
|
"alt-master",
|
|
110
114
|
{
|
|
111
|
-
"name": "custom-tag/IC-
|
|
115
|
+
"name": "custom-tag/IC-976-pre-commit-lint",
|
|
112
116
|
"prerelease": "${name.replace(/^custom-tag\\//g, '')}"
|
|
113
117
|
}
|
|
114
118
|
],
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
<div class="product-card__reviews product-card__reviews-v2">
|
|
20
20
|
<div class="product-rating product-rating-v2">
|
|
21
21
|
<div class="rating-bg">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
23
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
24
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
25
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
26
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
27
27
|
|
|
28
28
|
<div class="rating-overlay" data-rating="{{#if review-rating}}{{review-rating}}{{else}}0{{/if}}">
|
|
29
29
|
<span class="star-overlay">
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
</div>
|
|
49
49
|
{{/if}}
|
|
50
50
|
</div>
|
|
51
|
+
{{#if isSponsor}}
|
|
52
|
+
<div class="product-card__sponsored">Sponsored</div>
|
|
53
|
+
{{else}}
|
|
54
|
+
<div class="product-card__sponsored product-card__sponsored--empty"> </div>
|
|
55
|
+
{{/if}}
|
|
51
56
|
{{#if switch-vat}}
|
|
52
57
|
<div class="including-vat product-card__price {{#if sale}} product-card__price_sale {{/if}} {{#if
|
|
53
58
|
recommended}}product-card__min-height{{/if}}">
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div class="card-sponsor-banner {{#unless show}}d-none{{/unless}}"
|
|
2
|
+
{{#if desktop-position}}data-desktop-position="{{desktop-position}}"{{/if}}
|
|
3
|
+
{{#if mobile-position}}data-mobile-position="{{mobile-position}}"{{/if}}
|
|
4
|
+
>
|
|
5
|
+
<a class="card-sponsor-banner__link" href="{{href}}">
|
|
6
|
+
<img class="card-sponsor-banner__image" src="{{src}}" alt="banner">
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
@@ -4,25 +4,70 @@
|
|
|
4
4
|
{
|
|
5
5
|
"src": "https://eu-images.contentstack.com/v3/assets/blt066259863543a0d2/bltf2fa907eeef56dc5/62161f9af3bcce42fe002786/PLP-DecoratingTools-230222.jpg",
|
|
6
6
|
"href": "/sitemap.html",
|
|
7
|
-
"desktop-position":
|
|
8
|
-
"mobile-position":
|
|
7
|
+
"desktop-position": 8,
|
|
8
|
+
"mobile-position": 7,
|
|
9
9
|
"show": false
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"sponsor-product": [
|
|
13
|
+
{
|
|
14
|
+
"isSponsor": true,
|
|
15
|
+
"desktop-position": 4,
|
|
16
|
+
"mobile-position": 3,
|
|
17
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
18
|
+
"code": "492747",
|
|
19
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
20
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
21
|
+
"reviews": "0",
|
|
22
|
+
"review-rating": "4.3",
|
|
23
|
+
"price": "<span class='product-card__price-value-text'>From</span> £99,009.00",
|
|
24
|
+
"perSQM": "£1,444.00",
|
|
25
|
+
"recommended": false,
|
|
26
|
+
"badge-text": "new",
|
|
27
|
+
"badge-color": "green",
|
|
28
|
+
"badge-text-color": "gray"
|
|
10
29
|
},
|
|
11
30
|
{
|
|
12
|
-
"
|
|
13
|
-
"
|
|
31
|
+
"isSponsor": true,
|
|
32
|
+
"desktop-position": 5,
|
|
33
|
+
"mobile-position": 4,
|
|
34
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
35
|
+
"code": "492747",
|
|
36
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
37
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
38
|
+
"reviews": "0",
|
|
39
|
+
"review-rating": "4.3",
|
|
40
|
+
"price": "<span class='product-card__price-value-text'>From</span> £99,009.00",
|
|
41
|
+
"perSQM": "£1,444.00",
|
|
42
|
+
"recommended": false,
|
|
43
|
+
"badge-text": "new",
|
|
44
|
+
"badge-color": "green",
|
|
45
|
+
"badge-text-color": "gray"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"isSponsor": true,
|
|
14
49
|
"desktop-position": 7,
|
|
15
50
|
"mobile-position": 5,
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
51
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
52
|
+
"code": "721657",
|
|
53
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
54
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
55
|
+
"reviews": "21",
|
|
56
|
+
"review-rating": "4.4",
|
|
57
|
+
"price": "£2,009.00",
|
|
58
|
+
"SQM": "£1,555.00",
|
|
59
|
+
"click-collect-only": true,
|
|
60
|
+
"badge-text": "Clearance",
|
|
61
|
+
"badge-color": "yellow",
|
|
62
|
+
"badge-text-color": "white"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"sponsor-banner": [
|
|
20
66
|
{
|
|
21
67
|
"src": "https://eu-images.contentstack.com/v3/assets/blt066259863543a0d2/bltf2fa907eeef56dc5/62161f9af3bcce42fe002786/PLP-DecoratingTools-230222.jpg",
|
|
22
68
|
"href": "/sitemap.html",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"show": false
|
|
69
|
+
"desktop-position": 6,
|
|
70
|
+
"mobile-position": 8
|
|
26
71
|
}
|
|
27
72
|
],
|
|
28
73
|
"products": [
|
|
@@ -196,136 +241,6 @@
|
|
|
196
241
|
"recommended": false,
|
|
197
242
|
"new": true,
|
|
198
243
|
"new-range": true
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
202
|
-
"code": "737934",
|
|
203
|
-
"src": "./img/placeholders/map-2.png",
|
|
204
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
205
|
-
"reviews": "0",
|
|
206
|
-
"price": "£2,009.00",
|
|
207
|
-
"recommended": false
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim ",
|
|
211
|
-
"code": "247767",
|
|
212
|
-
"src": "./img/placeholders/map-2.png",
|
|
213
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
214
|
-
"reviews": "0",
|
|
215
|
-
"price": "£2,009.00",
|
|
216
|
-
"recommended": false
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
220
|
-
"code": "978004",
|
|
221
|
-
"src": "./img/placeholders/map-2.png",
|
|
222
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
223
|
-
"reviews": "0",
|
|
224
|
-
"price": "£2,009.00",
|
|
225
|
-
"recommended": false
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
229
|
-
"code": "523586",
|
|
230
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
231
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
232
|
-
"reviews": "0",
|
|
233
|
-
"perSQM": "£1,444.00",
|
|
234
|
-
"recommended": false
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
238
|
-
"code": "729112",
|
|
239
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
240
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
241
|
-
"reviews": "0",
|
|
242
|
-
"price": "£2,315.00",
|
|
243
|
-
"recommended": false
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"sale": {
|
|
247
|
-
"discount": "15% off",
|
|
248
|
-
"price": "£2,315.00"
|
|
249
|
-
},
|
|
250
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
251
|
-
"code": "279966",
|
|
252
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
253
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
254
|
-
"reviews": "0",
|
|
255
|
-
|
|
256
|
-
"recommended": false
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
260
|
-
"code": "813053",
|
|
261
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
262
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
263
|
-
"reviews": "0",
|
|
264
|
-
"SQM": "£1,555.00",
|
|
265
|
-
"recommended": false
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
269
|
-
"code": "655972",
|
|
270
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
271
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
272
|
-
"reviews": "0",
|
|
273
|
-
|
|
274
|
-
"recommended": false
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
278
|
-
"code": "757775",
|
|
279
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
280
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
281
|
-
"reviews": "0",
|
|
282
|
-
|
|
283
|
-
"recommended": false
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
287
|
-
"code": "276523",
|
|
288
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
289
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
290
|
-
"reviews": "0",
|
|
291
|
-
|
|
292
|
-
"recommended": false
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
296
|
-
"code": "334333",
|
|
297
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
298
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
299
|
-
"reviews": "0",
|
|
300
|
-
|
|
301
|
-
"recommended": false
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
305
|
-
"code": "597258",
|
|
306
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
307
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
308
|
-
"reviews": "0",
|
|
309
|
-
|
|
310
|
-
"recommended": false
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
314
|
-
"code": "806538",
|
|
315
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
316
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
317
|
-
"reviews": "0",
|
|
318
|
-
"perSQM": "£1,444.00",
|
|
319
|
-
"recommended": false
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
323
|
-
"code": "276521",
|
|
324
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
325
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
326
|
-
"reviews": "0",
|
|
327
|
-
|
|
328
|
-
"recommended": false
|
|
329
244
|
}
|
|
330
245
|
]
|
|
331
246
|
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
Wick.BannerPlacementManager = {
|
|
3
|
+
SPONSOR_BANNERS_DISPLAYED_EVENT: 'sponsorAdsDisplayedEvent',
|
|
4
|
+
el: {
|
|
5
|
+
banners: '.card-product-banner',
|
|
6
|
+
sponsorBanners: '.card-sponsor-banner',
|
|
7
|
+
sponsorProducts: '.card-sponsor-product',
|
|
8
|
+
allBanners: '.card-product-banner, .card-sponsor-banner, .card-sponsor-product',
|
|
9
|
+
productCard: '.product-card',
|
|
10
|
+
allListSlots: '.product-card, .card-product-banner, .card-sponsor-banner, .card-sponsor-product',
|
|
11
|
+
productsWrap: '.products-list-v2',
|
|
12
|
+
$products: $('.product-card'),
|
|
13
|
+
attrPositionDesktop: 'data-desktop-position',
|
|
14
|
+
attrPositionMobile: 'data-mobile-position',
|
|
15
|
+
attrRequiredAmountDesktop: 'data-required-amount-desktop',
|
|
16
|
+
attrRequiredAmountMobile: 'data-required-amount-mobile',
|
|
17
|
+
hide: 'd-none',
|
|
18
|
+
sponsoredAdvBanners: '.sponsored-ad'
|
|
19
|
+
},
|
|
20
|
+
classes: {
|
|
21
|
+
sponsorBanners: 'card-sponsor-banner',
|
|
22
|
+
sponsorProducts: 'card-sponsor-product',
|
|
23
|
+
productBanners: 'card-product-banner',
|
|
24
|
+
bannerInactiveClass: 'card-product-banner--inactive'
|
|
25
|
+
},
|
|
26
|
+
isEventSent: false,
|
|
27
|
+
currentBreakpoint: null,
|
|
28
|
+
checkProductsInColumn() {
|
|
29
|
+
Wick.BannerPlacementManager.addInactiveClasses();
|
|
30
|
+
Wick.BannerPlacementManager.arrangeBannersInRightOrder();
|
|
31
|
+
const $allBanners = $(Wick.BannerPlacementManager.el.allBanners);
|
|
32
|
+
const totalProducts = Wick.BannerPlacementManager.getListLength();
|
|
33
|
+
const totalSlots = totalProducts + $allBanners.length;
|
|
34
|
+
$allBanners.each((index, banner) => {
|
|
35
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner);
|
|
36
|
+
|
|
37
|
+
if ($(banner).hasClass('card-product-banner')) {
|
|
38
|
+
if (bannerPosition > totalSlots) {
|
|
39
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
40
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners) || $(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
46
|
+
if (bannerPosition > totalProducts) {
|
|
47
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
48
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
49
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Wick.BannerPlacementManager.hideBannerDueLimit(banner, index);
|
|
55
|
+
Wick.BannerPlacementManager.moveBannerToSpecifiedPosition(banner);
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
moveBannerToSpecifiedPosition(banner) {
|
|
59
|
+
const $listSlots = Wick.BannerPlacementManager.getListSlots();
|
|
60
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner) - 2;
|
|
61
|
+
const listSlotsLength = $listSlots.length;
|
|
62
|
+
|
|
63
|
+
if (Wick.BannerPlacementManager.isBannerVisible(banner)) {
|
|
64
|
+
if (bannerPosition <= listSlotsLength) {
|
|
65
|
+
if ($listSlots[bannerPosition]) {
|
|
66
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
67
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
68
|
+
Wick.BannerPlacementManager.moveBanner(banner, $listSlots[bannerPosition]);
|
|
69
|
+
} else {
|
|
70
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
71
|
+
Wick.BannerPlacementManager.coverEdgeCases(banner);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners) || $(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
75
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
76
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
77
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
78
|
+
} else {
|
|
79
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
moveBanner(banner, targetElement) {
|
|
85
|
+
$(banner).remove();
|
|
86
|
+
$(targetElement).after(banner);
|
|
87
|
+
},
|
|
88
|
+
hideBanner(banner) {
|
|
89
|
+
$(banner).addClass(Wick.BannerPlacementManager.el.hide);
|
|
90
|
+
},
|
|
91
|
+
showBanner(banner) {
|
|
92
|
+
$(banner).removeClass(Wick.BannerPlacementManager.el.hide);
|
|
93
|
+
},
|
|
94
|
+
isBannerVisible(banner) {
|
|
95
|
+
return !$(banner).hasClass(Wick.BannerPlacementManager.el.hide);
|
|
96
|
+
},
|
|
97
|
+
hideBannerDueLimit(banner) {
|
|
98
|
+
const bannerMinLimit = Wick.BannerPlacementManager.getBannerLimit(banner) - 1;
|
|
99
|
+
const $listSlots = Wick.BannerPlacementManager.getListSlots();
|
|
100
|
+
const listProductsLength = $listSlots.length;
|
|
101
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
102
|
+
|
|
103
|
+
if (bannerMinLimit > listProductsLength) {
|
|
104
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
getBannerPosition(banner) {
|
|
108
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
109
|
+
const positionAttribute = isMobile
|
|
110
|
+
? Wick.BannerPlacementManager.el.attrPositionMobile
|
|
111
|
+
: Wick.BannerPlacementManager.el.attrPositionDesktop
|
|
112
|
+
|
|
113
|
+
return banner.hasAttribute(positionAttribute)
|
|
114
|
+
? Number(banner.getAttribute(positionAttribute))
|
|
115
|
+
: Number(Wick.BannerPlacementManager.getListLength() + Wick.BannerPlacementManager.getBannersAmount());
|
|
116
|
+
},
|
|
117
|
+
getBannerLimit(banner) {
|
|
118
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
119
|
+
|
|
120
|
+
const limitAttribute = isMobile
|
|
121
|
+
? Wick.BannerPlacementManager.el.attrRequiredAmountMobile
|
|
122
|
+
: Wick.BannerPlacementManager.el.attrRequiredAmountDesktop;
|
|
123
|
+
|
|
124
|
+
return banner.hasAttribute(limitAttribute)
|
|
125
|
+
? Number(banner.getAttribute(limitAttribute))
|
|
126
|
+
: 0;
|
|
127
|
+
},
|
|
128
|
+
isMobileResolution() {
|
|
129
|
+
return Wick.Responsive.getCurrentBreakpoint() !== 'up-lg';
|
|
130
|
+
},
|
|
131
|
+
getListLength() {
|
|
132
|
+
const $listItems = $(Wick.BannerPlacementManager.el.productsWrap).children(Wick.BannerPlacementManager.el.productCard);
|
|
133
|
+
return $listItems.length;
|
|
134
|
+
},
|
|
135
|
+
getBannersAmount() {
|
|
136
|
+
return $(Wick.BannerPlacementManager.el.allBanners).length;
|
|
137
|
+
},
|
|
138
|
+
getProductsAmount() {
|
|
139
|
+
return Wick.BannerPlacementManager.el.$products.length;
|
|
140
|
+
},
|
|
141
|
+
arrangeBannersInRightOrder() {
|
|
142
|
+
const $allBanners = $(Wick.BannerPlacementManager.el.allBanners);
|
|
143
|
+
|
|
144
|
+
const sponsorProducts = $allBanners.filter((i, el) =>
|
|
145
|
+
$(el).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)
|
|
146
|
+
);
|
|
147
|
+
const sponsorBanners = $allBanners.filter((i, el) =>
|
|
148
|
+
$(el).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners)
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const firstSponsorProductPos = sponsorProducts.length > 0
|
|
152
|
+
? Math.min(...sponsorProducts.map((i, el) => Wick.BannerPlacementManager.getBannerPosition(el)).get())
|
|
153
|
+
: Infinity;
|
|
154
|
+
const firstSponsorBannerPos = sponsorBanners.length > 0
|
|
155
|
+
? Math.min(...sponsorBanners.map((i, el) => Wick.BannerPlacementManager.getBannerPosition(el)).get())
|
|
156
|
+
: Infinity;
|
|
157
|
+
|
|
158
|
+
let groupOrder;
|
|
159
|
+
if (firstSponsorProductPos < firstSponsorBannerPos) {
|
|
160
|
+
groupOrder = [
|
|
161
|
+
Wick.BannerPlacementManager.classes.sponsorProducts,
|
|
162
|
+
Wick.BannerPlacementManager.classes.sponsorBanners,
|
|
163
|
+
Wick.BannerPlacementManager.classes.productBanners
|
|
164
|
+
];
|
|
165
|
+
} else {
|
|
166
|
+
groupOrder = [
|
|
167
|
+
Wick.BannerPlacementManager.classes.sponsorBanners,
|
|
168
|
+
Wick.BannerPlacementManager.classes.sponsorProducts,
|
|
169
|
+
Wick.BannerPlacementManager.classes.productBanners
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
$allBanners.sort((a, b) => {
|
|
174
|
+
function getGroupIndex(el) {
|
|
175
|
+
if ($(el).hasClass(groupOrder[0])) return 0;
|
|
176
|
+
if ($(el).hasClass(groupOrder[1])) return 1;
|
|
177
|
+
if ($(el).hasClass(groupOrder[2])) return 2;
|
|
178
|
+
return 3;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const groupA = getGroupIndex(a);
|
|
182
|
+
const groupB = getGroupIndex(b);
|
|
183
|
+
|
|
184
|
+
if (groupA !== groupB) {
|
|
185
|
+
return groupA - groupB;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const positionA = Wick.BannerPlacementManager.getBannerPosition(a);
|
|
189
|
+
const positionB = Wick.BannerPlacementManager.getBannerPosition(b);
|
|
190
|
+
|
|
191
|
+
return positionA - positionB;
|
|
192
|
+
}).appendTo(Wick.BannerPlacementManager.el.productsWrap);
|
|
193
|
+
},
|
|
194
|
+
addInactiveClasses() {
|
|
195
|
+
$(Wick.BannerPlacementManager.el.allBanners).addClass(Wick.BannerPlacementManager.el.hide);
|
|
196
|
+
},
|
|
197
|
+
removeInactiveClass(banner) {
|
|
198
|
+
$(banner).removeClass(Wick.BannerPlacementManager.classes.bannerInactiveClass)
|
|
199
|
+
},
|
|
200
|
+
insertFirstBanner(banner) {
|
|
201
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner);
|
|
202
|
+
|
|
203
|
+
if (bannerPosition === 1) {
|
|
204
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
205
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
206
|
+
$(banner).remove();
|
|
207
|
+
$(Wick.BannerPlacementManager.el.productsWrap).prepend(banner);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
coverEdgeCases(banner) {
|
|
211
|
+
Wick.BannerPlacementManager.insertFirstBanner(banner);
|
|
212
|
+
},
|
|
213
|
+
getListSlots() {
|
|
214
|
+
return $(Wick.BannerPlacementManager.el.productsWrap)
|
|
215
|
+
.children(Wick.BannerPlacementManager.el.allListSlots);
|
|
216
|
+
},
|
|
217
|
+
getBannerPriority(banner) {
|
|
218
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
219
|
+
return 1;
|
|
220
|
+
}
|
|
221
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners)) {
|
|
222
|
+
return 2;
|
|
223
|
+
}
|
|
224
|
+
return 3;
|
|
225
|
+
},
|
|
226
|
+
dispatchSponsorAdsDisplayedEvent() {
|
|
227
|
+
return new Promise((resolve, reject) => {
|
|
228
|
+
const eventDetail = { resolve, reject };
|
|
229
|
+
const sponsorAdsEvent = createEvent(Wick.BannerPlacementManager.SPONSOR_BANNERS_DISPLAYED_EVENT, { displayed: true }, eventDetail);
|
|
230
|
+
window.dispatchEvent(sponsorAdsEvent);
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
init() {
|
|
234
|
+
Wick.Responsive.onResize(function () {
|
|
235
|
+
if(Wick.BannerPlacementManager.currentBreakpoint !== Wick.Responsive.getCurrentBreakpoint()) {
|
|
236
|
+
Wick.BannerPlacementManager.currentBreakpoint = Wick.Responsive.getCurrentBreakpoint()
|
|
237
|
+
Wick.BannerPlacementManager.checkProductsInColumn();
|
|
238
|
+
|
|
239
|
+
if (
|
|
240
|
+
!Wick.BannerPlacementManager.isEventSent && $(Wick.BannerPlacementManager.el.sponsoredAdvBanners).length
|
|
241
|
+
) {
|
|
242
|
+
Wick.BannerPlacementManager.dispatchSponsorAdsDisplayedEvent();
|
|
243
|
+
Wick.BannerPlacementManager.isEventSent = true;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
$(window).trigger('productBannerPositionChanged');
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
$(document).ready(function () {
|
|
253
|
+
if (!Wick.BannerPlacementManager.getBannersAmount() || !Wick.BannerPlacementManager.getProductsAmount()) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
Wick.BannerPlacementManager.init();
|
|
258
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Simulate prompt for input
|
|
2
|
+
function getInputs() {
|
|
3
|
+
const productBannerPositions = prompt("Enter Product Banner Positions:", "2") || "";
|
|
4
|
+
const sponsorProductPositions = prompt("Enter Sponsor Product Positions (comma-separated):", "6,7,8") || "";
|
|
5
|
+
const sponsorBannerPositions = prompt("Enter Sponsor Banner Positions:", "10") || "";
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
productBannerPositions: productBannerPositions ? productBannerPositions.split(",").map(Number) : [],
|
|
9
|
+
sponsorProductPositions: sponsorProductPositions ? sponsorProductPositions.split(",").map(Number) : [],
|
|
10
|
+
sponsorBannerPositions: sponsorBannerPositions ? sponsorBannerPositions.split(",").map(Number) : [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getPositionAttr() {
|
|
15
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
16
|
+
return isMobile
|
|
17
|
+
? 'data-mobile-position'
|
|
18
|
+
: 'data-desktop-position';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function updatePositions(inputs) {
|
|
22
|
+
const productBannerElements = document.querySelectorAll(".card-product-banner");
|
|
23
|
+
productBannerElements.forEach((el, index) => {
|
|
24
|
+
if (inputs.productBannerPositions[index] !== undefined) {
|
|
25
|
+
el.setAttribute(getPositionAttr(), inputs.productBannerPositions[index]);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const sponsorProductElements = document.querySelectorAll(".card-sponsor-product");
|
|
30
|
+
sponsorProductElements.forEach((el, index) => {
|
|
31
|
+
if (inputs.sponsorProductPositions[index] !== undefined) {
|
|
32
|
+
el.setAttribute(getPositionAttr(), inputs.sponsorProductPositions[index]);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const sponsorBannerElements = document.querySelectorAll(".card-sponsor-banner");
|
|
37
|
+
sponsorBannerElements.forEach((el, index) => {
|
|
38
|
+
if (inputs.sponsorBannerPositions[index] !== undefined) {
|
|
39
|
+
el.setAttribute(getPositionAttr(), inputs.sponsorBannerPositions[index]);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function init() {
|
|
45
|
+
const inputs = getInputs();
|
|
46
|
+
updatePositions(inputs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$(document).ready(function () {
|
|
50
|
+
if ($('.retail-media .products-list.products-list-v2').length) {
|
|
51
|
+
setTimeout(() => init(), 100)
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -6,7 +6,9 @@ $(document).ready(function () {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function cardsContent(itemsInRow) {
|
|
9
|
-
let card = $('.content .product-card, .content .card-product-banner')
|
|
9
|
+
let card = $('.content .product-card, .content .card-product-banner, .content .card-sponsor-banner, .content .card-sponsor-product').filter(function() {
|
|
10
|
+
return $(this).parents('.product-card, .card-product-banner, .card-sponsor-banner, .card-sponsor-product').length === 0;
|
|
11
|
+
});
|
|
10
12
|
let priceSelectors = [
|
|
11
13
|
'.including-vat .product-card__price__old-price',
|
|
12
14
|
'.excluding-vat .product-card__price__old-price',
|
|
@@ -17,6 +19,7 @@ $(document).ready(function () {
|
|
|
17
19
|
revealAll(card, ['.product-card__price__old-price',
|
|
18
20
|
'.product-card__price-sqm',
|
|
19
21
|
'.product-card__price-value',
|
|
22
|
+
'.product-card__sponsored',
|
|
20
23
|
'.energy-efficiency',
|
|
21
24
|
'.energy-efficiency__link']);
|
|
22
25
|
|
|
@@ -33,6 +36,8 @@ $(document).ready(function () {
|
|
|
33
36
|
hideEmptiness(currentRow, '.product-card__price-sqm');
|
|
34
37
|
}
|
|
35
38
|
hideEmptiness(currentRow, '.product-card__price-value');
|
|
39
|
+
hideEmptiness(currentRow, '.product-card__sponsored');
|
|
40
|
+
hideEmptiness(currentRow, '.product-card__price__old-price');
|
|
36
41
|
hideEmptiness(currentRow, '.energy-efficiency');
|
|
37
42
|
hideEmptiness(currentRow, '.energy-efficiency__link');
|
|
38
43
|
|
|
@@ -43,11 +48,15 @@ $(document).ready(function () {
|
|
|
43
48
|
function hideEmptiness(query, className) {
|
|
44
49
|
let currentQuery = query.find(className);
|
|
45
50
|
let rowContent = currentQuery.text();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const classEmptyCheckMap = {
|
|
52
|
+
'.energy-efficiency': 'energy-efficiency--empty',
|
|
53
|
+
'.product-card__sponsored': 'product-card__sponsored--empty',
|
|
54
|
+
'.product-card__price__old-price': 'product-card__price_empty'
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (classEmptyCheckMap[className]) {
|
|
58
|
+
let isClassEmpty = isClassPresentInQuery(currentQuery, classEmptyCheckMap[className]);
|
|
59
|
+
if (isClassEmpty) {
|
|
51
60
|
currentQuery.hide();
|
|
52
61
|
}
|
|
53
62
|
return;
|