wickes-css2 2.105.0-develop.3 → 2.105.0-develop.4
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 -2
- package/build/css/category-main.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_product_search.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/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/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +12122 -11594
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/kitchen/kitchen-plp.min.js +1 -9
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/mini-basket-slider.min.js +1 -1
- package/build/js/page/basket/basket-update-cart-action.js +59 -56
- package/build/js/page/basket/basket-update-cart.js +27 -27
- package/build/js/page/basket/basket-utils.js +40 -33
- package/build/js/page/basket/mini-basket-total.js +70 -66
- package/build/js/page/basket/quantity-change-handler.js +73 -55
- package/build/js/page/basket/update-quantity-operation.js +39 -30
- package/build/js/page/basket/update-quantity.js +62 -62
- package/build/js/page/basket-v2.js +362 -229
- package/build/js/page/billie-business-type.js +27 -27
- package/build/js/page/checkout-payment-details.js +301 -299
- package/build/js/page/components/discounts.js +39 -36
- package/build/js/page/components/mini-basket-slider.js +604 -545
- package/build/js/page/filters/desktop-nav.js +64 -0
- package/build/js/page/filters/mobile-nav.js +93 -0
- package/build/js/page/filters/plp-filters-chips.js +92 -0
- package/build/js/page/filters/plp-filters-mobile.js +150 -0
- package/build/js/page/filters/plp-filters-panel.js +123 -0
- package/build/js/page/filters/plp-filters-utils.js +66 -0
- package/build/js/page/filters/plp-filters.js +256 -0
- package/build/js/page/filters/sort-by.js +172 -0
- package/build/js/page/klarna-modal-scroll-disable.js +4 -4
- package/build/js/page/online-exclusive.js +28 -30
- package/build/js/page/search-filter.js +62 -0
- package/build/js/page/utils/helpers.js +14 -9
- package/build/js/page/utils/show-more-less.js +273 -0
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/plp-filters.min.js +9 -0
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/build/js/search-filter.min.js +1 -0
- package/package.json +3 -3
- package/src/components/accordion.hbs +2 -2
- package/src/components/kitchen/dropdown.hbs +6 -3
- package/src/components/kitchen/filter-modal-content-kitchen.hbs +10 -0
- package/src/components/kitchen/filter-modal.hbs +10 -13
- package/src/components/kitchen/plp-filters.hbs +3 -1
- package/src/components/kitchen/sort-by.hbs +1 -1
- package/src/components/search-filter-modal-content.hbs +102 -0
- package/src/components/search-filter.hbs +121 -112
- package/src/data/data_plp_load-more.json +1 -1
- package/src/elements/btn.hbs +7 -0
- package/src/js/components/general/accordion.js +38 -29
- package/src/js/components/general/cart-slider.js +19 -16
- package/src/js/components/general/create-popup-slider.js +168 -173
- package/src/js/emulation/big-wins.js +1081 -904
- package/src/js/emulation/billie-modal.js +23 -19
- package/src/js/emulation/checkout-payment-details.js +47 -38
- package/src/js/emulation/custom-slider-emulation.js +17 -13
- package/src/js/emulation/filters-emulation.js +164 -0
- package/src/js/emulation/forms.js +360 -323
- package/src/js/emulation/mini-basket-data.js +1051 -923
- package/src/js/emulation/paymentLoader.js +17 -17
- package/src/js/emulation/pdf-file-loader.js +89 -91
- package/src/js/emulation/popover-mini-basket.js +246 -239
- package/src/js/emulation/product-counter.js +50 -0
- package/src/js/emulation/project-list-pdp.js +321 -316
- package/src/js/emulation/repayment-toggle.js +23 -24
- package/src/js/emulation/reset-filter-desktop.js +5 -0
- package/src/js/emulation/selectable.js +22 -18
- package/src/js/emulation/wismo-details.js +23 -31
- package/src/js/page/basket/basket-update-cart-action.js +59 -56
- package/src/js/page/basket/basket-update-cart.js +27 -27
- package/src/js/page/basket/basket-utils.js +40 -33
- package/src/js/page/basket/mini-basket-total.js +70 -66
- package/src/js/page/basket/quantity-change-handler.js +73 -55
- package/src/js/page/basket/update-quantity-operation.js +39 -30
- package/src/js/page/basket/update-quantity.js +62 -62
- package/src/js/page/basket-v2.js +362 -229
- package/src/js/page/billie-business-type.js +27 -27
- package/src/js/page/checkout-payment-details.js +301 -299
- package/src/js/page/components/discounts.js +39 -36
- package/src/js/page/components/mini-basket-slider.js +604 -545
- package/src/js/page/filters/desktop-nav.js +64 -0
- package/src/js/page/filters/mobile-nav.js +93 -0
- package/src/js/page/filters/plp-filters-chips.js +92 -0
- package/src/js/page/filters/plp-filters-mobile.js +150 -0
- package/src/js/page/filters/plp-filters-panel.js +123 -0
- package/src/js/page/filters/plp-filters-utils.js +66 -0
- package/src/js/page/filters/plp-filters.js +256 -0
- package/src/js/page/filters/sort-by.js +172 -0
- package/src/js/page/klarna-modal-scroll-disable.js +4 -4
- package/src/js/page/online-exclusive.js +28 -30
- package/src/js/page/search-filter.js +62 -0
- package/src/js/page/utils/helpers.js +14 -9
- package/src/js/page/utils/show-more-less.js +273 -0
- package/src/page_empty-shared-project-list-bicester-hub.html +3 -0
- package/src/page_kitchen-plp.html +2 -2
- package/src/page_plp-with-paint.html +2 -7
- package/src/page_plp.html +2 -7
- package/src/page_plp_v2-energy-efficiency.html +1 -6
- package/src/page_plp_v2-favourite-products.html +6 -7
- package/src/page_plp_v2-vat.html +2 -7
- package/src/page_plp_v2.html +22 -9
- package/src/page_product_search-vat.html +2 -7
- package/src/page_product_search.html +2 -7
- package/src/page_project-list-with-new-share-popup-android.html +1 -0
- package/src/page_project-list-with-new-share-popup-ios.html +1 -0
- package/src/page_project-list-with-new-share-popup.html +1 -0
- package/src/page_search-results.html +2 -7
- package/src/page_shared-project-list-bicester-hub.html +1 -0
- package/src/scss/common/_common.scss +5 -4
- package/src/scss/components/_accordion.scss +1 -3
- package/src/scss/components/_custom-slider.scss +15 -14
- package/src/scss/components/_date-selection-add-new-styles.scss +6 -7
- package/src/scss/components/_date-selection.scss +1 -1
- package/src/scss/components/{kitchen/_filter-modal.scss → _filter-modal.scss} +55 -4
- package/src/scss/components/{kitchen/_plp-filters.scss → _plp-filters.scss} +31 -13
- package/src/scss/components/_popover-mini-basket.scss +3 -3
- package/src/scss/components/_search-filter.scss +95 -15
- package/src/scss/components/_sort-by.scss +190 -0
- package/src/scss/components/checkout-chip.scss +2 -2
- package/src/scss/components/checkout-payment-repayment-terms.scss +1 -1
- package/src/scss/globals/_global-components.scss +3 -0
- package/src/scss/helpers/_colors-semantic.scss +68 -68
- package/src/scss/helpers/_variables.scss +242 -196
- package/src/scss/kitchen-plp-main.scss +0 -3
- package/src/scss/main.scss +65 -65
- package/src/scss/pages/page_product-details-v2.scss +1 -4
- package/src/scss/pages/page_product_search.scss +9 -1
- package/src/scss/pages/page_products-list-combined.scss +28 -24
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/scss/pages/tradePro-rewards.scss +2 -3
- package/build/js/page/accordion.js +0 -35
- package/build/js/page/kitchen/plp-filters-chips.js +0 -90
- package/build/js/page/kitchen/plp-filters-mobile.js +0 -72
- package/build/js/page/kitchen/plp-filters-panel.js +0 -119
- package/build/js/page/kitchen/plp-filters-utils.js +0 -65
- package/build/js/page/kitchen/plp-filters.js +0 -205
- package/build/js/page/kitchen/sort-by.js +0 -157
- package/src/js/components/general/search-filter.js +0 -21
- package/src/js/page/accordion.js +0 -35
- package/src/js/page/kitchen/plp-filters-chips.js +0 -90
- package/src/js/page/kitchen/plp-filters-mobile.js +0 -72
- package/src/js/page/kitchen/plp-filters-panel.js +0 -119
- package/src/js/page/kitchen/plp-filters-utils.js +0 -65
- package/src/js/page/kitchen/plp-filters.js +0 -205
- package/src/js/page/kitchen/sort-by.js +0 -157
|
@@ -1,372 +1,409 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
|
-
Wick.Forms = (function() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
$rows.append(validationError(errorMsg)).addClass(rowValidationError);
|
|
2
|
+
Wick.Forms = (function () {
|
|
3
|
+
var fieldRow = '.form-row[data-row-required]',
|
|
4
|
+
field = '.form-row__field',
|
|
5
|
+
fieldError = '.form-row__error',
|
|
6
|
+
formInvalid = 'form_invalid',
|
|
7
|
+
rowValidationError = 'form-row_validation-error',
|
|
8
|
+
excludedClassesForForm = [
|
|
9
|
+
'header',
|
|
10
|
+
'quiz-modal__form',
|
|
11
|
+
'search-store',
|
|
12
|
+
'track-order-form',
|
|
13
|
+
'change-password__form',
|
|
14
|
+
'address-book__form',
|
|
15
|
+
],
|
|
16
|
+
// validationError = '<div class="form-row__error">Error message here</div>',
|
|
17
|
+
$forgotPassword = $('.link-forgot-password'),
|
|
18
|
+
scenarios = [
|
|
19
|
+
{
|
|
20
|
+
condition: function () {
|
|
21
|
+
// fill in the valid returning customer's details
|
|
22
|
+
// Email: responsive@test.com; Password: 123456
|
|
23
|
+
return (
|
|
24
|
+
$('#login-email').val() === 'responsive@test.com' &&
|
|
25
|
+
$('#password').val() === '123456'
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
action: function () {
|
|
29
|
+
// redirected to the homepage
|
|
30
|
+
Wick.User.login();
|
|
31
|
+
window.location.href = './';
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
condition: function () {
|
|
36
|
+
// continue as a new user with "test+random@user.com"
|
|
37
|
+
return $('#registration-email').val().length;
|
|
38
|
+
// return $('#registration-email').val() === 'test+random@user.com';
|
|
39
|
+
},
|
|
40
|
+
action: function () {
|
|
41
|
+
// redirected to the register form
|
|
42
|
+
window.location.href = './page_registration.html';
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
condition: function () {
|
|
47
|
+
// When I click forgotten password link
|
|
48
|
+
},
|
|
49
|
+
action: function () {
|
|
50
|
+
// redirected on the "Forgotten Password" page
|
|
51
|
+
window.location.href = './page_forgotten-password.html';
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
validationError = function (errorMsg) {
|
|
56
|
+
return `<div class="form-row__error"> ${errorMsg || 'Error message here'}</div>`;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function isElementInViewport(el) {
|
|
60
|
+
if (typeof jQuery === 'function' && el instanceof jQuery) {
|
|
61
|
+
el = el[0];
|
|
62
|
+
}
|
|
63
|
+
var rect = el.getBoundingClientRect();
|
|
64
|
+
return (
|
|
65
|
+
rect.top >= 0 &&
|
|
66
|
+
rect.left >= 0 &&
|
|
67
|
+
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
68
|
+
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
|
|
69
|
+
);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
let $form;
|
|
73
|
+
var showValidationErrors = function (form, errorMsg) {
|
|
74
|
+
$form = $(form);
|
|
75
|
+
if (!$form.hasClass(formInvalid)) {
|
|
76
|
+
$form.find('.form-row__error').remove();
|
|
77
|
+
var $rows = $form.find(fieldRow).filter(function () {
|
|
78
|
+
return $(this).is(':visible');
|
|
79
|
+
});
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
81
|
+
$rows.append(validationError(errorMsg)).addClass(rowValidationError);
|
|
82
|
+
}
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
var $firstMsg = $form
|
|
85
|
+
.find(fieldRow)
|
|
86
|
+
.filter(function () {
|
|
87
|
+
return $(this).is(':visible');
|
|
88
|
+
})
|
|
89
|
+
.first();
|
|
90
|
+
if ($firstMsg.length && !isElementInViewport($firstMsg)) {
|
|
91
|
+
var inModal = $firstMsg.closest('.modal').length,
|
|
92
|
+
$scrollableEl = inModal ? $firstMsg.closest('.modal') : $('html, body'),
|
|
93
|
+
y = inModal ? 0 : $firstMsg.offset().top - 30;
|
|
94
|
+
|
|
95
|
+
$scrollableEl.animate({ scrollTop: y }, 300);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
87
98
|
|
|
88
|
-
|
|
99
|
+
var clearValidationErrors = function (form) {
|
|
100
|
+
$form = $(form);
|
|
89
101
|
|
|
90
|
-
|
|
91
|
-
.removeClass(rowValidationError)
|
|
92
|
-
.find(fieldError).remove();
|
|
102
|
+
$form.removeClass(formInvalid);
|
|
93
103
|
|
|
94
|
-
|
|
95
|
-
};
|
|
104
|
+
$form.find(fieldRow).removeClass(rowValidationError).find(fieldError).remove();
|
|
96
105
|
|
|
106
|
+
$form.find(fieldError).remove();
|
|
107
|
+
};
|
|
97
108
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
var handleSmoothScroll = function () {
|
|
110
|
+
$('html, body').animate(
|
|
111
|
+
{
|
|
112
|
+
scrollTop: $('.cards-store-list').offset().top - 60,
|
|
113
|
+
},
|
|
114
|
+
300
|
|
115
|
+
);
|
|
116
|
+
};
|
|
103
117
|
|
|
104
|
-
|
|
105
|
-
|
|
118
|
+
var handleFormSubmit = function () {
|
|
119
|
+
var form = this;
|
|
120
|
+
|
|
121
|
+
if ($(form).is('#form-login') || $(form).is('#form-register')) {
|
|
122
|
+
for (var i = 0; i < scenarios.length; i++) {
|
|
123
|
+
var scenario = scenarios[i];
|
|
124
|
+
if (scenario.condition()) {
|
|
125
|
+
scenario.action(this);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
106
130
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return false;
|
|
131
|
+
if ($(form).is('#form-forgotten-password')) {
|
|
132
|
+
if ($(form).find('#email').val().length) {
|
|
133
|
+
window.location.href = './page_upd-pass.html';
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
113
136
|
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
137
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
138
|
+
if ($(form).is('#form-forgotten-password-popup')) {
|
|
139
|
+
if ($(form).find('#email').val().length) {
|
|
140
|
+
window.location.href = './page_checkout_sign-in.html';
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
123
144
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
if ($(form).is('#checkout-form-forgotten-password-popup')) {
|
|
146
|
+
if ($(form).find('#email').val().length) {
|
|
147
|
+
$('.modal-reset-wrap').addClass('d-block');
|
|
148
|
+
$('.request-pass').addClass('d-none');
|
|
149
|
+
$('.modal-title').text('Password Reset');
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
130
153
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
if ($(form).is('.update-pass')) {
|
|
155
|
+
if (
|
|
156
|
+
$(form).find('#new-password').val().length &&
|
|
157
|
+
$(form).find('#confirmed-password').val().length
|
|
158
|
+
) {
|
|
159
|
+
window.location.href = './page_login.html';
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
139
163
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
164
|
+
if ($(form).is('.change-email')) {
|
|
165
|
+
if (
|
|
166
|
+
$(form).find('#new-email').val().length &&
|
|
167
|
+
$(form).find('#confirm-new-email').val().length &&
|
|
168
|
+
$(form).find('#password').val().length
|
|
169
|
+
) {
|
|
170
|
+
window.location.href = './page_my-account.html';
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
146
174
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
if ($(form).is('.form-change-password')) {
|
|
176
|
+
if (
|
|
177
|
+
$(form).find('#current-password').val().length &&
|
|
178
|
+
$(form).find('#new-password').val().length &&
|
|
179
|
+
$(form).find('#confirm-password').val().length
|
|
180
|
+
) {
|
|
181
|
+
window.location.href = './page_my-account.html';
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
155
185
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
186
|
+
if ($(form).is('.form-register')) {
|
|
187
|
+
if (
|
|
188
|
+
$(form).find('#first-name').val().length &&
|
|
189
|
+
$(form).find('#last-name').val().length &&
|
|
190
|
+
$(form).find('#postcode').val().length &&
|
|
191
|
+
$(form).find('#email').val().length &&
|
|
192
|
+
$(form).find('#password').val().length &&
|
|
193
|
+
$(form).find('#confirm-password').val().length
|
|
194
|
+
) {
|
|
195
|
+
window.location.href = './page_my-account.html';
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
164
199
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
$(form).find('#confirm-password').val().length) {
|
|
172
|
-
window.location.href = './page_my-account.html';
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
200
|
+
if ($(form).is('.form-personal-details')) {
|
|
201
|
+
if ($(form).find('#first-name').val().length && $(form).find('#surname').val().length) {
|
|
202
|
+
window.location.href = './page_my-account.html';
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
176
206
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
207
|
+
if ($(form).is('.form-address-details')) {
|
|
208
|
+
if (
|
|
209
|
+
$(form).find('#first-name').val().length &&
|
|
210
|
+
$(form).find('#second-name').val().length &&
|
|
211
|
+
$(form).find('#address1').val().length &&
|
|
212
|
+
$(form).find('#town-city').val().length &&
|
|
213
|
+
$(form).find('#mobile-telephone').val().length
|
|
214
|
+
) {
|
|
215
|
+
window.location.href = './page_my-account_address-book.html';
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
183
219
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
window.location.href = './page_my-account_address-book.html';
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
220
|
+
if ($(form).is('.form-locator')) {
|
|
221
|
+
if ($(form).find('#store-id').val()) {
|
|
222
|
+
window.location.href = './page_store-locator-details.html';
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
194
226
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
227
|
+
if ($(form).is('.form-locator-list')) {
|
|
228
|
+
if ($(form).find('#postcode-town').val().length) {
|
|
229
|
+
var actionAfterSubmit = $(form).attr('data-action');
|
|
230
|
+
if (actionAfterSubmit === 'scroll-to-list') {
|
|
231
|
+
clearValidationErrors(this);
|
|
232
|
+
handleSmoothScroll();
|
|
233
|
+
} else {
|
|
234
|
+
window.location.href = actionAfterSubmit;
|
|
235
|
+
}
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
201
239
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
window.location.href = actionAfterSubmit;
|
|
240
|
+
if ($(form).is('#form-mini-basket')) {
|
|
241
|
+
if (Wick.User.isLoggedIn()) {
|
|
242
|
+
window.location.href = './page_checkout_delivery-address.html';
|
|
243
|
+
} else {
|
|
244
|
+
window.location.href = './page_checkout_sign-in.html';
|
|
245
|
+
}
|
|
246
|
+
return false;
|
|
210
247
|
}
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
248
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
} else {
|
|
219
|
-
window.location.href = './page_checkout_sign-in.html';
|
|
220
|
-
}
|
|
221
|
-
return false;
|
|
222
|
-
}
|
|
249
|
+
function isNotEmpty(field) {
|
|
250
|
+
var $field = $(field);
|
|
251
|
+
var type = ($field.attr('type') || '').toLowerCase();
|
|
223
252
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
253
|
+
if (type === 'checkbox') {
|
|
254
|
+
return $field.is(':checked');
|
|
255
|
+
}
|
|
227
256
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
257
|
+
if (type === 'radio') {
|
|
258
|
+
var name = $field.attr('name');
|
|
259
|
+
if (!name) return false;
|
|
231
260
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (!name) return false;
|
|
261
|
+
var $scope = $field.closest('[data-row-required]');
|
|
262
|
+
if (!$scope.length) $scope = $field.closest('form');
|
|
235
263
|
|
|
236
|
-
|
|
237
|
-
|
|
264
|
+
return $scope
|
|
265
|
+
.find('input[type="radio"][name="' + name.replace(/"/g, '\\"') + '"]')
|
|
266
|
+
.is(':checked');
|
|
267
|
+
}
|
|
238
268
|
|
|
239
|
-
|
|
240
|
-
|
|
269
|
+
return !!$field.val();
|
|
270
|
+
}
|
|
241
271
|
|
|
242
|
-
|
|
243
|
-
|
|
272
|
+
let requiredFields;
|
|
273
|
+
if ($(form).is('#form-checkout-your-details')) {
|
|
274
|
+
requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
275
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
276
|
+
window.location.href = $(form).attr('data-action');
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
244
280
|
|
|
281
|
+
if ($(form).is('#checkout-your-details-modal')) {
|
|
282
|
+
requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
283
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
284
|
+
$('#modalDeliveryEdit').modal('hide');
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
245
288
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
289
|
+
if ($(form).is('#edit-delivery-address')) {
|
|
290
|
+
requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
291
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
292
|
+
$('#modalDeliveryGuest').modal('hide');
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
253
296
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
297
|
+
if ($(form).is('.checkout-register')) {
|
|
298
|
+
if (
|
|
299
|
+
$(form).find('#password').val().length &&
|
|
300
|
+
$(form).find('#confirm-password').val().length
|
|
301
|
+
) {
|
|
302
|
+
window.location.href = './page_my-account.html';
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
261
306
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
}
|
|
307
|
+
if ($(form).is('#form-checkout-voucher')) {
|
|
308
|
+
if ($(form).find('#voucher-code').val().length) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
269
312
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
}
|
|
313
|
+
if ($(form).is('.add-list-id__form')) {
|
|
314
|
+
if ($(form).find('#project-id').val().length) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
277
318
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
}
|
|
319
|
+
if ($(form).is('.header-search')) {
|
|
320
|
+
window.location.href = './page_search-results.html';
|
|
321
|
+
}
|
|
283
322
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
323
|
+
if ($(form).is('.click-and-collect__locator-form')) {
|
|
324
|
+
$form = $(form);
|
|
325
|
+
if ($form.find('#click-and-collect-town').val().length) {
|
|
326
|
+
clearValidationErrors(this);
|
|
327
|
+
} else if (!$form.hasClass(formInvalid)) {
|
|
328
|
+
// Validation for inline form
|
|
329
|
+
$form
|
|
330
|
+
.addClass(formInvalid)
|
|
331
|
+
.find(fieldRow)
|
|
332
|
+
.addClass(rowValidationError)
|
|
333
|
+
.find(field)
|
|
334
|
+
.append(validationError);
|
|
335
|
+
}
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
289
338
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
339
|
+
if ($(form).is('.form-track-order')) {
|
|
340
|
+
$form = $(form);
|
|
341
|
+
|
|
342
|
+
if (
|
|
343
|
+
$form.find('#order').val().length &&
|
|
344
|
+
$form.find('#tel').val().length &&
|
|
345
|
+
$form.find('#email').val().length &&
|
|
346
|
+
$form.find('#postcode').val().length
|
|
347
|
+
) {
|
|
348
|
+
clearValidationErrors(this);
|
|
349
|
+
} else if (!$form.hasClass(formInvalid)) {
|
|
350
|
+
$form.addClass(formInvalid);
|
|
351
|
+
|
|
352
|
+
$(fieldRow).each(function () {
|
|
353
|
+
$(this)
|
|
354
|
+
.addClass(rowValidationError)
|
|
355
|
+
.append(
|
|
356
|
+
'<div class="form-row__error">' + $(this).data('message') + '</div>'
|
|
357
|
+
);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
293
363
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
.find(fieldRow).addClass(rowValidationError)
|
|
302
|
-
.find(field).append(validationError);
|
|
303
|
-
}
|
|
304
|
-
return false;
|
|
305
|
-
}
|
|
364
|
+
if ($(form).is('#edit-billing-address')) {
|
|
365
|
+
requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
366
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
367
|
+
$('#modalEditBilling').modal('hide');
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
306
371
|
|
|
307
|
-
|
|
308
|
-
|
|
372
|
+
showValidationErrors(this);
|
|
373
|
+
return false;
|
|
374
|
+
};
|
|
309
375
|
|
|
310
|
-
|
|
311
|
-
$
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
376
|
+
var scrollLocatorListPage = function () {
|
|
377
|
+
var isLocatorListPage = $('.cards-store-list').length;
|
|
378
|
+
var isScrollNeeded = window.location.hash === '#stores-list';
|
|
379
|
+
if (isLocatorListPage && isScrollNeeded) {
|
|
380
|
+
handleSmoothScroll();
|
|
381
|
+
}
|
|
382
|
+
};
|
|
317
383
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
384
|
+
let bindEvents = function () {
|
|
385
|
+
let selector = excludedClassesForForm.reduce((acc, className) => {
|
|
386
|
+
return acc + ':not([class^="' + className + '"])';
|
|
387
|
+
}, 'form');
|
|
388
|
+
$(document).on('submit', selector, handleFormSubmit);
|
|
389
|
+
$forgotPassword.on('click', scenarios[2].action);
|
|
390
|
+
$('.btn-cancel').on('click', function () {
|
|
391
|
+
window.location.href = './page_my-account.html';
|
|
321
392
|
});
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
393
|
+
$('.btn-previous').on('click', function () {
|
|
394
|
+
window.location.href = './page_login.html';
|
|
395
|
+
});
|
|
396
|
+
};
|
|
326
397
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
398
|
+
var init = function () {
|
|
399
|
+
bindEvents();
|
|
400
|
+
scrollLocatorListPage();
|
|
401
|
+
};
|
|
334
402
|
|
|
335
|
-
|
|
336
|
-
return false;
|
|
337
|
-
};
|
|
403
|
+
init();
|
|
338
404
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
handleSmoothScroll();
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
let bindEvents = function() {
|
|
348
|
-
let selector = excludedClassesForForm.reduce((acc, className) => {
|
|
349
|
-
return acc + ':not([class^="' + className + '"])';
|
|
350
|
-
}, 'form');
|
|
351
|
-
$(document).on('submit', selector, handleFormSubmit);
|
|
352
|
-
$forgotPassword.on('click', scenarios[2].action);
|
|
353
|
-
$('.btn-cancel').on('click', function() {
|
|
354
|
-
window.location.href = './page_my-account.html';
|
|
355
|
-
});
|
|
356
|
-
$('.btn-previous').on('click', function() {
|
|
357
|
-
window.location.href = './page_login.html';
|
|
358
|
-
});
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
var init = function() {
|
|
362
|
-
bindEvents();
|
|
363
|
-
scrollLocatorListPage();
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
init();
|
|
367
|
-
|
|
368
|
-
return {
|
|
369
|
-
showValidationErrors: showValidationErrors,
|
|
370
|
-
clearValidationErrors: clearValidationErrors,
|
|
371
|
-
};
|
|
405
|
+
return {
|
|
406
|
+
showValidationErrors: showValidationErrors,
|
|
407
|
+
clearValidationErrors: clearValidationErrors,
|
|
408
|
+
};
|
|
372
409
|
})();
|