Perfect Brands for WooCommerce - Version 1.6.3

Version Description

  • Requirements: No more longer support for very old php versions (5.4 minimum)
  • Fix: Product carousels shortcode display fixes
  • Fix: Missing .pot file
  • Fix: Coupon codes stopped working since latest update
  • Fix: Carousel preloader is not working
Download this release

Release Info

Developer titodevera
Plugin Icon 128x128 Perfect Brands for WooCommerce
Version 1.6.3
Comparing to
See all releases

Code changes from version 1.6.2 to 1.6.3

Files changed (48) hide show
  1. assets/css/styles-admin.css +163 -163
  2. assets/css/styles-frontend.css +253 -253
  3. assets/css/styles-frontend.min.css +1 -1
  4. assets/js/{pwb_admin_functions.js → functions-admin.js} +276 -276
  5. assets/js/{pwb_admin_functions.min.js → functions-admin.min.js} +0 -0
  6. assets/js/{pwb_frontend_functions.js → functions-frontend.js} +149 -149
  7. assets/js/{pwb_frontend_functions.min.js → functions-frontend.min.js} +0 -0
  8. assets/{js → lib}/slick/ajax-loader.gif +0 -0
  9. assets/{js → lib}/slick/config.rb +9 -9
  10. assets/{js → lib}/slick/fonts/slick.eot +0 -0
  11. assets/{js → lib}/slick/fonts/slick.svg +14 -14
  12. assets/{js → lib}/slick/fonts/slick.ttf +0 -0
  13. assets/{js → lib}/slick/fonts/slick.woff +0 -0
  14. assets/{js → lib}/slick/slick-theme.css +204 -204
  15. assets/{js → lib}/slick/slick-theme.less +168 -168
  16. assets/{js → lib}/slick/slick-theme.scss +194 -194
  17. assets/{js → lib}/slick/slick.css +119 -119
  18. assets/{js → lib}/slick/slick.js +3004 -3004
  19. assets/{js → lib}/slick/slick.less +100 -100
  20. assets/{js → lib}/slick/slick.min.js +1 -1
  21. assets/{js → lib}/slick/slick.scss +100 -100
  22. classes/admin/class-edit-brands-page.php +146 -146
  23. classes/admin/class-pwb-admin-tab.php +213 -213
  24. classes/admin/class-pwb-coupon.php +73 -73
  25. classes/admin/class-pwb-dummy-data.php +94 -94
  26. classes/{class-pwb-exporter-support.php → admin/class-pwb-exporter-support.php} +40 -40
  27. classes/{class-pwb-importer-support.php → admin/class-pwb-importer-support.php} +53 -51
  28. classes/admin/class-pwb-migrate.php +124 -124
  29. classes/admin/class-pwb-system-status.php +61 -61
  30. classes/class-perfect-woocommerce-brands.php +856 -860
  31. classes/class-pwb-api-support.php +150 -150
  32. classes/class-pwb-product-tab.php +56 -56
  33. classes/shortcodes/class-pwb-all-brands.php +130 -130
  34. classes/shortcodes/class-pwb-brand.php +43 -43
  35. classes/shortcodes/class-pwb-carousel.php +68 -68
  36. classes/shortcodes/class-pwb-product-carousel.php +80 -80
  37. classes/widgets/class-pwb-dropdown.php +73 -73
  38. classes/widgets/class-pwb-filter-by-brand.php +130 -130
  39. classes/widgets/class-pwb-list.php +110 -110
  40. lang/perfect-woocommerce-brands-es_ES.po +718 -718
  41. lang/perfect-woocommerce-brands.pot +625 -0
  42. main.php +107 -107
  43. readme.txt +170 -164
  44. templates/admin/edit-brands-bottom.php +19 -19
  45. templates/shortcodes/carousel.php +26 -26
  46. templates/shortcodes/product-carousel.php +36 -36
  47. templates/widgets/filter-by-brand.php +25 -25
  48. uninstall.php +17 -17
assets/css/styles-admin.css CHANGED
@@ -1,163 +1,163 @@
1
- /* ----------------------- Global ----------------------- */
2
- .pwb-clearfix:after{
3
- content: "";
4
- display: table;
5
- clear: both;
6
- }
7
- .pwb-blocked{
8
- opacity: .6;
9
- }
10
- /* ----------------------- /Global ----------------------- */
11
- /* ----------------------- Taxonomy pwb-brand ----------------------- */
12
- .taxonomy-pwb-brand .pwb_brand_image_selected_remove{
13
- color: #FF3030;
14
- font-family: Arial, Helvetica, sans-serif;
15
- text-decoration: none;
16
- font-size: 20px;
17
- font-weight: bold;
18
- position: absolute;
19
- top: 0;
20
- right: 0;
21
- bottom: 0;
22
- left: 0;
23
- background-color: rgba(0, 0, 0, 0.5);
24
- opacity: 0;
25
- -webkit-transition: opacity 200ms ease-in-out;
26
- -moz-transition: opacity 200ms ease-in-out;
27
- -ms-transition: opacity 200ms ease-in-out;
28
- -o-transition: opacity 200ms ease-in-out;
29
- transition: opacity 200ms ease-in-out;
30
- }
31
- .taxonomy-pwb-brand .pwb_brand_image_selected span{
32
- display: inline-block;
33
- position: relative;
34
- text-align: center;
35
- line-height: 90px;
36
- height: 90px;
37
- }
38
- .taxonomy-pwb-brand .pwb_brand_image_selected span:hover .pwb_brand_image_selected_remove{
39
- opacity: 1;
40
- }
41
- .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_image, .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_banner{
42
- display: none;
43
- }
44
- .taxonomy-pwb-brand .pwb_brand_cont div{
45
- margin-top: 10px;
46
- }
47
- .taxonomy-pwb-brand #col-right.pwb-force-full-width .pwb-edit-brands-bottom > span{
48
- -ms-transform: rotate(180deg);
49
- -webkit-transform: rotate(180deg);
50
- transform: rotate(180deg);
51
- }
52
- .taxonomy-pwb-brand table.wp-list-table .column-featured{
53
- width: 48px;
54
- text-align: center;
55
- }
56
- .taxonomy-pwb-brand .pwb-edit-brands-bottom{
57
- margin-top: 20px;
58
- margin-bottom: 20px;
59
- background-color: #f6f6f6;
60
- border-top: 1px solid #e4e4e4;
61
- padding: 10px;
62
- }
63
- .taxonomy-pwb-brand .pwb-edit-brands-bottom > span:hover{
64
- cursor: pointer;
65
- }
66
- .taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
67
- float: left;
68
- }
69
- .taxonomy-pwb-brand .pwb-featured-count{
70
- font-style: italic;
71
- float: right;
72
- margin-left: 12px;
73
- margin-top: 0;
74
- margin-bottom: 0;
75
- }
76
- .taxonomy-pwb-brand table.wp-list-table .column-featured .dashicons-star-empty:hover:before{
77
- content: "\f155";
78
- }
79
- .taxonomy-pwb-brand table .column-featured > span:hover{
80
- cursor: pointer;
81
- }
82
- @media screen and (max-width: 782px) {
83
- .taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
84
- display: none;
85
- }
86
- .taxonomy-pwb-brand .wp-list-table td.column-logo:before {
87
- content: ""!important;
88
- }
89
- .taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
90
- display: none;
91
- }
92
- }
93
- @media screen and (min-width: 782px) {
94
- .taxonomy-pwb-brand #col-right.pwb-force-full-width{
95
- width: 100%!important;
96
- }
97
- .taxonomy-pwb-brand #col-left.pwb-force-full-width{
98
- width: 0!important;
99
- display: none!important;
100
- }
101
- }
102
- /* ----------------------- /Taxonomy pwb-brand ----------------------- */
103
-
104
- /* ----------------------- Widgets page ----------------------- */
105
- .widgets-php .widget[id*="_pwb_"] .widget-title{
106
- border-left: 2px solid #cda000;
107
- }
108
- /* ----------------------- /Widgets page ----------------------- */
109
-
110
- /* ----------------------- Settings page ----------------------- */
111
- #wc_pwb_admin_status_result{
112
- display: none;
113
- background-color: #f6f6f6;
114
- padding: 14px;
115
- }
116
- #wc_pwb_admin_tab_tools_system_status{
117
- display: none!important;
118
- }
119
- select.pwb-admin-tab-field, input[type="text"].pwb-admin-tab-field{
120
- min-width:350px;
121
- display:block;
122
- height:auto;
123
- }
124
- /* ----------------------- /Settings page ----------------------- */
125
-
126
- .pwb-display-as-logo{
127
- display: none;
128
- }
129
- .pwb-display-as-logo.show{
130
- display: block;
131
- }
132
- .pwb-notice-dismissible p a{
133
- margin-right: 12px;
134
- }
135
- .pwb-notice-dismissible .dashicons-heart{
136
- color: #f188ff;
137
- margin-left: 3px;
138
- }
139
- .pwb-modal{
140
- position: fixed;
141
- top: 0;
142
- right: 0;
143
- bottom: 0;
144
- left: 0;
145
- z-index: 99999999999;
146
- line-height: 1;
147
- background: rgba(0,0,0,0.9);
148
- font-size: 2em;
149
- padding-top: 20px;
150
- text-align: center;
151
- }
152
- .pwb-modal-inner {
153
- max-width: 70%;
154
- margin: 0 auto;
155
- animation: pwbblinkkf 3s linear infinite;
156
- color: #fff;
157
- }
158
- .pwb-modal-inner p{
159
- font-size: 2em;
160
- }
161
- @keyframes pwbblinkkf {
162
- 50% { opacity: 0; }
163
- }
1
+ /* ----------------------- Global ----------------------- */
2
+ .pwb-clearfix:after{
3
+ content: "";
4
+ display: table;
5
+ clear: both;
6
+ }
7
+ .pwb-blocked{
8
+ opacity: .6;
9
+ }
10
+ /* ----------------------- /Global ----------------------- */
11
+ /* ----------------------- Taxonomy pwb-brand ----------------------- */
12
+ .taxonomy-pwb-brand .pwb_brand_image_selected_remove{
13
+ color: #FF3030;
14
+ font-family: Arial, Helvetica, sans-serif;
15
+ text-decoration: none;
16
+ font-size: 20px;
17
+ font-weight: bold;
18
+ position: absolute;
19
+ top: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ left: 0;
23
+ background-color: rgba(0, 0, 0, 0.5);
24
+ opacity: 0;
25
+ -webkit-transition: opacity 200ms ease-in-out;
26
+ -moz-transition: opacity 200ms ease-in-out;
27
+ -ms-transition: opacity 200ms ease-in-out;
28
+ -o-transition: opacity 200ms ease-in-out;
29
+ transition: opacity 200ms ease-in-out;
30
+ }
31
+ .taxonomy-pwb-brand .pwb_brand_image_selected span{
32
+ display: inline-block;
33
+ position: relative;
34
+ text-align: center;
35
+ line-height: 90px;
36
+ height: 90px;
37
+ }
38
+ .taxonomy-pwb-brand .pwb_brand_image_selected span:hover .pwb_brand_image_selected_remove{
39
+ opacity: 1;
40
+ }
41
+ .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_image, .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_banner{
42
+ display: none;
43
+ }
44
+ .taxonomy-pwb-brand .pwb_brand_cont div{
45
+ margin-top: 10px;
46
+ }
47
+ .taxonomy-pwb-brand #col-right.pwb-force-full-width .pwb-edit-brands-bottom > span{
48
+ -ms-transform: rotate(180deg);
49
+ -webkit-transform: rotate(180deg);
50
+ transform: rotate(180deg);
51
+ }
52
+ .taxonomy-pwb-brand table.wp-list-table .column-featured{
53
+ width: 48px;
54
+ text-align: center;
55
+ }
56
+ .taxonomy-pwb-brand .pwb-edit-brands-bottom{
57
+ margin-top: 20px;
58
+ margin-bottom: 20px;
59
+ background-color: #f6f6f6;
60
+ border-top: 1px solid #e4e4e4;
61
+ padding: 10px;
62
+ }
63
+ .taxonomy-pwb-brand .pwb-edit-brands-bottom > span:hover{
64
+ cursor: pointer;
65
+ }
66
+ .taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
67
+ float: left;
68
+ }
69
+ .taxonomy-pwb-brand .pwb-featured-count{
70
+ font-style: italic;
71
+ float: right;
72
+ margin-left: 12px;
73
+ margin-top: 0;
74
+ margin-bottom: 0;
75
+ }
76
+ .taxonomy-pwb-brand table.wp-list-table .column-featured .dashicons-star-empty:hover:before{
77
+ content: "\f155";
78
+ }
79
+ .taxonomy-pwb-brand table .column-featured > span:hover{
80
+ cursor: pointer;
81
+ }
82
+ @media screen and (max-width: 782px) {
83
+ .taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
84
+ display: none;
85
+ }
86
+ .taxonomy-pwb-brand .wp-list-table td.column-logo:before {
87
+ content: ""!important;
88
+ }
89
+ .taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
90
+ display: none;
91
+ }
92
+ }
93
+ @media screen and (min-width: 782px) {
94
+ .taxonomy-pwb-brand #col-right.pwb-force-full-width{
95
+ width: 100%!important;
96
+ }
97
+ .taxonomy-pwb-brand #col-left.pwb-force-full-width{
98
+ width: 0!important;
99
+ display: none!important;
100
+ }
101
+ }
102
+ /* ----------------------- /Taxonomy pwb-brand ----------------------- */
103
+
104
+ /* ----------------------- Widgets page ----------------------- */
105
+ .widgets-php .widget[id*="_pwb_"] .widget-title{
106
+ border-left: 2px solid #cda000;
107
+ }
108
+ /* ----------------------- /Widgets page ----------------------- */
109
+
110
+ /* ----------------------- Settings page ----------------------- */
111
+ #wc_pwb_admin_status_result{
112
+ display: none;
113
+ background-color: #f6f6f6;
114
+ padding: 14px;
115
+ }
116
+ #wc_pwb_admin_tab_tools_system_status{
117
+ display: none!important;
118
+ }
119
+ select.pwb-admin-tab-field, input[type="text"].pwb-admin-tab-field{
120
+ min-width:350px;
121
+ display:block;
122
+ height:auto;
123
+ }
124
+ /* ----------------------- /Settings page ----------------------- */
125
+
126
+ .pwb-display-as-logo{
127
+ display: none;
128
+ }
129
+ .pwb-display-as-logo.show{
130
+ display: block;
131
+ }
132
+ .pwb-notice-dismissible p a{
133
+ margin-right: 12px;
134
+ }
135
+ .pwb-notice-dismissible .dashicons-heart{
136
+ color: #f188ff;
137
+ margin-left: 3px;
138
+ }
139
+ .pwb-modal{
140
+ position: fixed;
141
+ top: 0;
142
+ right: 0;
143
+ bottom: 0;
144
+ left: 0;
145
+ z-index: 99999999999;
146
+ line-height: 1;
147
+ background: rgba(0,0,0,0.9);
148
+ font-size: 2em;
149
+ padding-top: 20px;
150
+ text-align: center;
151
+ }
152
+ .pwb-modal-inner {
153
+ max-width: 70%;
154
+ margin: 0 auto;
155
+ animation: pwbblinkkf 3s linear infinite;
156
+ color: #fff;
157
+ }
158
+ .pwb-modal-inner p{
159
+ font-size: 2em;
160
+ }
161
+ @keyframes pwbblinkkf {
162
+ 50% { opacity: 0; }
163
+ }
assets/css/styles-frontend.css CHANGED
@@ -1,253 +1,253 @@
1
- /* ----------------------- Global ----------------------- */
2
- .pwb-clearfix:after{
3
- content: "";
4
- display: table;
5
- clear: both;
6
- }
7
- /* ----------------------- /Global ----------------------- */
8
-
9
- /* ----------------------- Carousels ----------------------- */
10
- .pwb-carousel .slick-slide a{
11
- display: block;
12
- }
13
- .pwb-carousel .slick-slide a > img{
14
- margin: 0 auto;
15
- }
16
- .pwb-carousel .slick-loading .slick-list, .pwb-product-carousel .slick-loading .slick-list{
17
- background: #fff url('./ajax-loader.gif') center center no-repeat;
18
- }
19
- .pwb-carousel .slick-slide, .pwb-product-carousel .slick-slide{
20
- margin: 0 10px;
21
- }
22
- .pwb-carousel .slick-prev, .pwb-carousel .slick-next,
23
- .pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
24
- font-size: 0;
25
- position: absolute;
26
- top: 0;
27
- bottom: 0;
28
- display: block;
29
- cursor: pointer;
30
- font-size: 22px;
31
- width: 30px;
32
- overflow: hidden;
33
- text-align: center;
34
- color: #aeaeae;
35
- border: none;
36
- outline: none;
37
- z-index: 999;
38
- background: #eee;
39
- opacity: 0;
40
- transition: opacity 0.3s ease-in-out;
41
- -webkit-transition: opacity 0.3s ease-in-out;
42
- -moz-transition: opacity 0.3s ease-in-out;
43
- -o-transition: opacity 0.3s ease-in-out;
44
- }
45
- .pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
46
- .pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
47
- display: inline-block;
48
- height: 20px;
49
- width: 20px;
50
- padding: 10px;
51
- position: absolute;
52
- top: 50%;
53
- margin-top: -20px;
54
- left: 0;
55
- right: 0;
56
- }
57
- .pwb-carousel .slick-prev:hover,
58
- .pwb-carousel .slick-prev:focus,
59
- .pwb-carousel .slick-next:hover,
60
- .pwb-carousel .slick-next:focus,
61
- .pwb-product-carousel .slick-prev:hover,
62
- .pwb-product-carousel .slick-prev:focus,
63
- .pwb-product-carousel .slick-next:hover,
64
- .pwb-product-carousel .slick-next:focus{
65
- outline: none;
66
- }
67
- .pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
68
- left: 0;
69
- }
70
- .pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
71
- right: 0;
72
- }
73
- .pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
74
- .pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
75
- opacity: 0.8;
76
- }
77
- .pwb-product-carousel .pwb-amount{
78
- display: block;
79
- width: 100%;
80
- margin-bottom: 12px;
81
- }
82
- /* ------ Preloader ------ */
83
- .pwb-carousel, .pwb-product-carousel{
84
- min-height: 30px;
85
- }
86
- .pwb-carousel .slick-list,
87
- .pwb-product-carousel .slick-list {
88
- opacity: 0;
89
- position: absolute;
90
- }
91
- .pwb-carousel.slick-initialized,
92
- .pwb-product-carousel.slick-initialized {
93
- min-height: none;
94
- }
95
- .pwb-carousel.slick-initialized .slick-list,
96
- .pwb-product-carousel.slick-initialized .slick-list {
97
- opacity: 1;
98
- position: relative;
99
- transition: opacity 0.2s ease-in;
100
- }
101
- .pwb-carousel.slick-initialized .pwb-carousel-loader,
102
- .pwb-product-carousel.slick-initialized .pwb-carousel-loader {
103
- display: none!important;
104
- opacity: 0!important;
105
- }
106
- .pwb-carousel-loader{
107
- font-size: 10px;
108
- margin: 50px auto;
109
- text-indent: -9999em;
110
- width: 30px;
111
- height: 30px;
112
- border-radius: 50%;
113
- background: #525252;
114
- background: -moz-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
115
- background: -webkit-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
116
- background: -o-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
117
- background: -ms-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
118
- background: linear-gradient(to right, #525252 10%, rgba(82,82,82, 0) 42%);
119
- position: relative;
120
- -webkit-animation: PWBCarouselLoader 1.4s infinite linear;
121
- animation: PWBCarouselLoader 1.4s infinite linear;
122
- -webkit-transform: translateZ(0);
123
- -ms-transform: translateZ(0);
124
- transform: translateZ(0);
125
- }
126
- .pwb-carousel-loader:before {
127
- width: 50%;
128
- height: 50%;
129
- background: #525252;
130
- border-radius: 100% 0 0 0;
131
- position: absolute;
132
- top: 0;
133
- left: 0;
134
- content: '';
135
- }
136
- .pwb-carousel-loader:after {
137
- background: #ffffff;
138
- width: 75%;
139
- height: 75%;
140
- border-radius: 50%;
141
- content: '';
142
- margin: auto;
143
- position: absolute;
144
- top: 0;
145
- left: 0;
146
- bottom: 0;
147
- right: 0;
148
- }
149
- @-webkit-keyframes PWBCarouselLoader {
150
- 0% {
151
- -webkit-transform: rotate(0deg);
152
- transform: rotate(0deg);
153
- }
154
- 100% {
155
- -webkit-transform: rotate(360deg);
156
- transform: rotate(360deg);
157
- }
158
- }
159
- @keyframes PWBCarouselLoader {
160
- 0% {
161
- -webkit-transform: rotate(0deg);
162
- transform: rotate(0deg);
163
- }
164
- 100% {
165
- -webkit-transform: rotate(360deg);
166
- transform: rotate(360deg);
167
- }
168
- }
169
- /* ------ /Preloader ------ */
170
-
171
- /* ----------------------- /Carousels ----------------------- */
172
-
173
- /* ----------------------- PWB All Brands ----------------------- */
174
- .pwb-brands-cols-outer{
175
- margin-left: -15px;
176
- margin-right: -15px;
177
- }
178
- .pwb-all-brands .pwb-pagination-wrapper{
179
- margin-top: 20px;
180
- padding-top: 10px;
181
- border-top: 1px solid #ededed;
182
- text-align: right;
183
- }
184
- .pwb-all-brands .pwb-pagination{
185
- display: inline-block;
186
- margin-right: 10px;
187
- background-color: #ededed;
188
- color: #333;
189
- text-align: center;
190
- padding: 10px;
191
- }
192
- .pwb-all-brands .pwb-brands-cols-outer:after{
193
- content: "";
194
- display: table;
195
- clear: both;
196
- }
197
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
198
- padding: 0 15px;
199
- width: 20%;
200
- float: left;
201
- }
202
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
203
- height: 25px;
204
- overflow: hidden;
205
- font-size: 14px;
206
- }
207
- /* ----------------------- /PWB All Brands ----------------------- */
208
-
209
- /* ----------------------- Columns ----------------------- */
210
- .pwb-row:after{
211
- content: "";
212
- display: table;
213
- clear: both;
214
- }
215
- .pwb-columns-2{
216
- width: 50%;
217
- }
218
- .pwb-columns-3{
219
- width: 33.33333%;
220
- }
221
- .pwb-columns-4{
222
- width: 25%;
223
- }
224
- .pwb-columns{
225
- display: inline-block;
226
- vertical-align:top;
227
- }
228
- /* ----------------------- /Columns ----------------------- */
229
-
230
- /* ----------------------- Responsive ----------------------- */
231
- @media screen and (max-width: 1000px) {
232
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
233
- width: 25%;
234
- }
235
- }
236
- @media screen and (max-width: 700px) {
237
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
238
- width: 50%;
239
- }
240
- }
241
- @media screen and (max-width: 480px) {
242
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
243
- width: 100%;
244
- float: none;
245
- }
246
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
247
- height: auto;
248
- }
249
- .pwb-columns-3, .pwb-columns-4{
250
- width: 50%;
251
- }
252
- }
253
- /* ----------------------- /Responsive ----------------------- */
1
+ /* ----------------------- Global ----------------------- */
2
+ .pwb-clearfix:after{
3
+ content: "";
4
+ display: table;
5
+ clear: both;
6
+ }
7
+ /* ----------------------- /Global ----------------------- */
8
+
9
+ /* ----------------------- Carousels ----------------------- */
10
+ .pwb-carousel .pwb-slick-slide a{
11
+ display: block;
12
+ }
13
+ .pwb-carousel .pwb-slick-slide a > img{
14
+ margin: 0 auto;
15
+ }
16
+ .pwb-carousel .slick-loading .slick-list, .pwb-product-carousel .slick-loading .slick-list{
17
+ background: #fff url('./ajax-loader.gif') center center no-repeat;
18
+ }
19
+ .pwb-carousel .pwb-slick-slide, .pwb-product-carousel .pwb-slick-slide{
20
+ margin: 0 10px;
21
+ }
22
+ .pwb-carousel .slick-prev, .pwb-carousel .slick-next,
23
+ .pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
24
+ font-size: 0;
25
+ position: absolute;
26
+ top: 0;
27
+ bottom: 0;
28
+ display: block;
29
+ cursor: pointer;
30
+ font-size: 22px;
31
+ width: 30px;
32
+ overflow: hidden;
33
+ text-align: center;
34
+ color: #aeaeae;
35
+ border: none;
36
+ outline: none;
37
+ z-index: 999;
38
+ background: #eee;
39
+ opacity: 0;
40
+ transition: opacity 0.3s ease-in-out;
41
+ -webkit-transition: opacity 0.3s ease-in-out;
42
+ -moz-transition: opacity 0.3s ease-in-out;
43
+ -o-transition: opacity 0.3s ease-in-out;
44
+ }
45
+ .pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
46
+ .pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
47
+ display: inline-block;
48
+ height: 20px;
49
+ width: 20px;
50
+ padding: 10px;
51
+ position: absolute;
52
+ top: 50%;
53
+ margin-top: -20px;
54
+ left: 0;
55
+ right: 0;
56
+ }
57
+ .pwb-carousel .slick-prev:hover,
58
+ .pwb-carousel .slick-prev:focus,
59
+ .pwb-carousel .slick-next:hover,
60
+ .pwb-carousel .slick-next:focus,
61
+ .pwb-product-carousel .slick-prev:hover,
62
+ .pwb-product-carousel .slick-prev:focus,
63
+ .pwb-product-carousel .slick-next:hover,
64
+ .pwb-product-carousel .slick-next:focus{
65
+ outline: none;
66
+ }
67
+ .pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
68
+ left: 0;
69
+ }
70
+ .pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
71
+ right: 0;
72
+ }
73
+ .pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
74
+ .pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
75
+ opacity: 0.8;
76
+ }
77
+ .pwb-product-carousel .pwb-amount{
78
+ display: block;
79
+ width: 100%;
80
+ margin-bottom: 12px;
81
+ }
82
+ /* ------ Preloader ------ */
83
+ .pwb-carousel, .pwb-product-carousel{
84
+ min-height: 30px;
85
+ }
86
+ .pwb-carousel .slick-list,
87
+ .pwb-product-carousel .slick-list {
88
+ opacity: 0;
89
+ position: absolute;
90
+ }
91
+ .pwb-carousel.slick-initialized,
92
+ .pwb-product-carousel.slick-initialized {
93
+ min-height: none;
94
+ }
95
+ .pwb-carousel.slick-initialized .slick-list,
96
+ .pwb-product-carousel.slick-initialized .slick-list {
97
+ opacity: 1;
98
+ position: relative;
99
+ transition: opacity 0.2s ease-in;
100
+ }
101
+ .pwb-carousel.slick-initialized .pwb-carousel-loader,
102
+ .pwb-product-carousel.slick-initialized .pwb-carousel-loader {
103
+ display: none!important;
104
+ opacity: 0!important;
105
+ }
106
+ .pwb-carousel-loader{
107
+ font-size: 10px;
108
+ margin: 50px auto;
109
+ text-indent: -9999em;
110
+ width: 30px;
111
+ height: 30px;
112
+ border-radius: 50%;
113
+ background: #525252;
114
+ background: -moz-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
115
+ background: -webkit-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
116
+ background: -o-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
117
+ background: -ms-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
118
+ background: linear-gradient(to right, #525252 10%, rgba(82,82,82, 0) 42%);
119
+ position: relative;
120
+ -webkit-animation: PWBCarouselLoader 1.4s infinite linear;
121
+ animation: PWBCarouselLoader 1.4s infinite linear;
122
+ -webkit-transform: translateZ(0);
123
+ -ms-transform: translateZ(0);
124
+ transform: translateZ(0);
125
+ }
126
+ .pwb-carousel-loader:before {
127
+ width: 50%;
128
+ height: 50%;
129
+ background: #525252;
130
+ border-radius: 100% 0 0 0;
131
+ position: absolute;
132
+ top: 0;
133
+ left: 0;
134
+ content: '';
135
+ }
136
+ .pwb-carousel-loader:after {
137
+ background: #ffffff;
138
+ width: 75%;
139
+ height: 75%;
140
+ border-radius: 50%;
141
+ content: '';
142
+ margin: auto;
143
+ position: absolute;
144
+ top: 0;
145
+ left: 0;
146
+ bottom: 0;
147
+ right: 0;
148
+ }
149
+ @-webkit-keyframes PWBCarouselLoader {
150
+ 0% {
151
+ -webkit-transform: rotate(0deg);
152
+ transform: rotate(0deg);
153
+ }
154
+ 100% {
155
+ -webkit-transform: rotate(360deg);
156
+ transform: rotate(360deg);
157
+ }
158
+ }
159
+ @keyframes PWBCarouselLoader {
160
+ 0% {
161
+ -webkit-transform: rotate(0deg);
162
+ transform: rotate(0deg);
163
+ }
164
+ 100% {
165
+ -webkit-transform: rotate(360deg);
166
+ transform: rotate(360deg);
167
+ }
168
+ }
169
+ /* ------ /Preloader ------ */
170
+
171
+ /* ----------------------- /Carousels ----------------------- */
172
+
173
+ /* ----------------------- PWB All Brands ----------------------- */
174
+ .pwb-brands-cols-outer{
175
+ margin-left: -15px;
176
+ margin-right: -15px;
177
+ }
178
+ .pwb-all-brands .pwb-pagination-wrapper{
179
+ margin-top: 20px;
180
+ padding-top: 10px;
181
+ border-top: 1px solid #ededed;
182
+ text-align: right;
183
+ }
184
+ .pwb-all-brands .pwb-pagination{
185
+ display: inline-block;
186
+ margin-right: 10px;
187
+ background-color: #ededed;
188
+ color: #333;
189
+ text-align: center;
190
+ padding: 10px;
191
+ }
192
+ .pwb-all-brands .pwb-brands-cols-outer:after{
193
+ content: "";
194
+ display: table;
195
+ clear: both;
196
+ }
197
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
198
+ padding: 0 15px;
199
+ width: 20%;
200
+ float: left;
201
+ }
202
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
203
+ height: 25px;
204
+ overflow: hidden;
205
+ font-size: 14px;
206
+ }
207
+ /* ----------------------- /PWB All Brands ----------------------- */
208
+
209
+ /* ----------------------- Columns ----------------------- */
210
+ .pwb-row:after{
211
+ content: "";
212
+ display: table;
213
+ clear: both;
214
+ }
215
+ .pwb-columns-2{
216
+ width: 50%;
217
+ }
218
+ .pwb-columns-3{
219
+ width: 33.33333%;
220
+ }
221
+ .pwb-columns-4{
222
+ width: 25%;
223
+ }
224
+ .pwb-columns{
225
+ display: inline-block;
226
+ vertical-align:top;
227
+ }
228
+ /* ----------------------- /Columns ----------------------- */
229
+
230
+ /* ----------------------- Responsive ----------------------- */
231
+ @media screen and (max-width: 1000px) {
232
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
233
+ width: 25%;
234
+ }
235
+ }
236
+ @media screen and (max-width: 700px) {
237
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
238
+ width: 50%;
239
+ }
240
+ }
241
+ @media screen and (max-width: 480px) {
242
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
243
+ width: 100%;
244
+ float: none;
245
+ }
246
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
247
+ height: auto;
248
+ }
249
+ .pwb-columns-3, .pwb-columns-4{
250
+ width: 50%;
251
+ }
252
+ }
253
+ /* ----------------------- /Responsive ----------------------- */
assets/css/styles-frontend.min.css CHANGED
@@ -1 +1 @@
1
- .pwb-clearfix:after{content:"";display:table;clear:both}.pwb-carousel .slick-slide a{display:block}.pwb-carousel .slick-slide a>img{margin:0 auto}.pwb-carousel .slick-loading .slick-list,.pwb-product-carousel .slick-loading .slick-list{background:#fff url('./ajax-loader.gif') center center no-repeat}.pwb-carousel .slick-slide,.pwb-product-carousel .slick-slide{margin:0 10px}.pwb-carousel .slick-prev,.pwb-carousel .slick-next,.pwb-product-carousel .slick-prev,.pwb-product-carousel .slick-next{font-size:0;position:absolute;top:0;bottom:0;display:block;cursor:pointer;font-size:22px;width:30px;overflow:hidden;text-align:center;color:#aeaeae;border:0;outline:0;z-index:999;background:#eee;opacity:0;transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out}.pwb-carousel .slick-prev>span,.pwb-carousel .slick-next>span,.pwb-product-carousel .slick-prev>span,.pwb-product-carousel .slick-next>span{display:inline-block;height:20px;width:20px;padding:10px;position:absolute;top:50%;margin-top:-20px;left:0;right:0}.pwb-carousel .slick-prev:hover,.pwb-carousel .slick-prev:focus,.pwb-carousel .slick-next:hover,.pwb-carousel .slick-next:focus,.pwb-product-carousel .slick-prev:hover,.pwb-product-carousel .slick-prev:focus,.pwb-product-carousel .slick-next:hover,.pwb-product-carousel .slick-next:focus{outline:0}.pwb-carousel .slick-prev,.pwb-product-carousel .slick-prev{left:0}.pwb-carousel .slick-next,.pwb-product-carousel .slick-next{right:0}.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{opacity:.8}.pwb-product-carousel .pwb-amount{display:block;width:100%;margin-bottom:12px}.pwb-carousel,.pwb-product-carousel{min-height:30px}.pwb-carousel .slick-list,.pwb-product-carousel .slick-list{opacity:0;position:absolute}.pwb-carousel.slick-initialized,.pwb-product-carousel.slick-initialized{min-height:none}.pwb-carousel.slick-initialized .slick-list,.pwb-product-carousel.slick-initialized .slick-list{opacity:1;position:relative;transition:opacity .2s ease-in}.pwb-carousel.slick-initialized .pwb-carousel-loader,.pwb-product-carousel.slick-initialized .pwb-carousel-loader{display:none!important;opacity:0!important}.pwb-carousel-loader{font-size:10px;margin:50px auto;text-indent:-9999em;width:30px;height:30px;border-radius:50%;background:#525252;background:-moz-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-webkit-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-o-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-ms-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:linear-gradient(to right,#525252 10%,rgba(82,82,82,0) 42%);position:relative;-webkit-animation:PWBCarouselLoader 1.4s infinite linear;animation:PWBCarouselLoader 1.4s infinite linear;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.pwb-carousel-loader:before{width:50%;height:50%;background:#525252;border-radius:100% 0 0 0;position:absolute;top:0;left:0;content:''}.pwb-carousel-loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@-webkit-keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.pwb-brands-cols-outer{margin-left:-15px;margin-right:-15px}.pwb-all-brands .pwb-pagination-wrapper{margin-top:20px;padding-top:10px;border-top:1px solid #ededed;text-align:right}.pwb-all-brands .pwb-pagination{display:inline-block;margin-right:10px;background-color:#ededed;color:#333;text-align:center;padding:10px}.pwb-all-brands .pwb-brands-cols-outer:after{content:"";display:table;clear:both}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{padding:0 15px;width:20%;float:left}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:25px;overflow:hidden;font-size:14px}.pwb-row:after{content:"";display:table;clear:both}.pwb-columns-2{width:50%}.pwb-columns-3{width:33.33333%}.pwb-columns-4{width:25%}.pwb-columns{display:inline-block;vertical-align:top}@media screen and (max-width:1000px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:25%}}@media screen and (max-width:700px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:50%}}@media screen and (max-width:480px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:100%;float:none}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:auto}.pwb-columns-3,.pwb-columns-4{width:50%}}
1
+ .pwb-clearfix:after{content:"";display:table;clear:both}.pwb-carousel .pwb-slick-slide a{display:block}.pwb-carousel .pwb-slick-slide a>img{margin:0 auto}.pwb-carousel .slick-loading .slick-list,.pwb-product-carousel .slick-loading .slick-list{background:#fff url('./ajax-loader.gif') center center no-repeat}.pwb-carousel .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{margin:0 10px}.pwb-carousel .slick-prev,.pwb-carousel .slick-next,.pwb-product-carousel .slick-prev,.pwb-product-carousel .slick-next{font-size:0;position:absolute;top:0;bottom:0;display:block;cursor:pointer;font-size:22px;width:30px;overflow:hidden;text-align:center;color:#aeaeae;border:0;outline:0;z-index:999;background:#eee;opacity:0;transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out}.pwb-carousel .slick-prev>span,.pwb-carousel .slick-next>span,.pwb-product-carousel .slick-prev>span,.pwb-product-carousel .slick-next>span{display:inline-block;height:20px;width:20px;padding:10px;position:absolute;top:50%;margin-top:-20px;left:0;right:0}.pwb-carousel .slick-prev:hover,.pwb-carousel .slick-prev:focus,.pwb-carousel .slick-next:hover,.pwb-carousel .slick-next:focus,.pwb-product-carousel .slick-prev:hover,.pwb-product-carousel .slick-prev:focus,.pwb-product-carousel .slick-next:hover,.pwb-product-carousel .slick-next:focus{outline:0}.pwb-carousel .slick-prev,.pwb-product-carousel .slick-prev{left:0}.pwb-carousel .slick-next,.pwb-product-carousel .slick-next{right:0}.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{opacity:.8}.pwb-product-carousel .pwb-amount{display:block;width:100%;margin-bottom:12px}.pwb-carousel,.pwb-product-carousel{min-height:30px}.pwb-carousel .slick-list,.pwb-product-carousel .slick-list{opacity:0;position:absolute}.pwb-carousel.slick-initialized,.pwb-product-carousel.slick-initialized{min-height:none}.pwb-carousel.slick-initialized .slick-list,.pwb-product-carousel.slick-initialized .slick-list{opacity:1;position:relative;transition:opacity .2s ease-in}.pwb-carousel.slick-initialized .pwb-carousel-loader,.pwb-product-carousel.slick-initialized .pwb-carousel-loader{display:none!important;opacity:0!important}.pwb-carousel-loader{font-size:10px;margin:50px auto;text-indent:-9999em;width:30px;height:30px;border-radius:50%;background:#525252;background:-moz-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-webkit-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-o-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-ms-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:linear-gradient(to right,#525252 10%,rgba(82,82,82,0) 42%);position:relative;-webkit-animation:PWBCarouselLoader 1.4s infinite linear;animation:PWBCarouselLoader 1.4s infinite linear;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.pwb-carousel-loader:before{width:50%;height:50%;background:#525252;border-radius:100% 0 0 0;position:absolute;top:0;left:0;content:''}.pwb-carousel-loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@-webkit-keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.pwb-brands-cols-outer{margin-left:-15px;margin-right:-15px}.pwb-all-brands .pwb-pagination-wrapper{margin-top:20px;padding-top:10px;border-top:1px solid #ededed;text-align:right}.pwb-all-brands .pwb-pagination{display:inline-block;margin-right:10px;background-color:#ededed;color:#333;text-align:center;padding:10px}.pwb-all-brands .pwb-brands-cols-outer:after{content:"";display:table;clear:both}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{padding:0 15px;width:20%;float:left}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:25px;overflow:hidden;font-size:14px}.pwb-row:after{content:"";display:table;clear:both}.pwb-columns-2{width:50%}.pwb-columns-3{width:33.33333%}.pwb-columns-4{width:25%}.pwb-columns{display:inline-block;vertical-align:top}@media screen and (max-width:1000px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:25%}}@media screen and (max-width:700px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:50%}}@media screen and (max-width:480px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:100%;float:none}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:auto}.pwb-columns-3,.pwb-columns-4{width:50%}}
assets/js/{pwb_admin_functions.js → functions-admin.js} RENAMED
@@ -1,276 +1,276 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function( $ ) {
4
-
5
- var media_uploader = null;
6
-
7
- function open_media_uploader_image( event, imageSelectorButton ){
8
-
9
- var $imageSelectorScope = imageSelectorButton.parent();
10
-
11
- media_uploader = wp.media({
12
- frame: "post",
13
- state: "insert",
14
- multiple: false
15
- });
16
-
17
- media_uploader.on("insert", function(){
18
- var json = media_uploader.state().get("selection").first().toJSON();
19
- var image_id = json.id;
20
- var image_url = json.url;
21
- var image_html = '<img src="'+image_url+'" width="90" height="90">';
22
-
23
- var current_selector = '';
24
- switch (event.target.id) {
25
- case 'pwb_brand_image_select':
26
- current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
27
- break;
28
- case 'pwb_brand_banner_select':
29
- current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
30
- break;
31
- }
32
-
33
- $(current_selector).val(image_id);
34
- $(current_selector+'_result').remove();
35
-
36
- if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
37
- $('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
38
- }else{
39
- $imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
40
- }
41
- add_delete_link( $imageSelectorScope );
42
-
43
- });
44
-
45
- media_uploader.open();
46
- }
47
-
48
-
49
- $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
50
- open_media_uploader_image( event, $(this) );
51
- });
52
-
53
- //bind remove image event for edit page
54
- $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
55
- add_delete_link( $(this).parent() );
56
- });
57
-
58
- //clear custom fields when brand is added
59
- jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
60
- //Check ajax action of request that succeeded
61
- if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
62
- $('#pwb_brand_image').val('');
63
- $('#pwb_brand_banner').val('');
64
- $('.pwb_brand_image_selected').remove();
65
- }
66
- });
67
-
68
- function add_delete_link( $imageSelectorScope ){
69
-
70
- $( '.pwb_brand_image_selected span', $imageSelectorScope ).append('<a href="#" class="pwb_brand_image_selected_remove">X</a>');
71
-
72
- $( '.pwb_brand_image_selected_remove', $imageSelectorScope ).on( 'click', function( event ){
73
-
74
- event.preventDefault();
75
- $(this).closest('.pwb_brand_image_selected').remove();
76
-
77
- //remove the img
78
- $('#pwb_brand_image',$imageSelectorScope).val('');
79
- $('#pwb_brand_banner',$imageSelectorScope).val('');
80
-
81
- });
82
-
83
- }
84
-
85
- /* ····························· Edit brands page ····························· */
86
- $('.taxonomy-pwb-brand table .column-featured > span').not('pwb-blocked').on('click', function(e){
87
- e.preventDefault();
88
- var $currentStar = $(this);
89
- $currentStar.addClass('pwb-blocked');
90
- if( $currentStar.hasClass('dashicons-star-filled') ){
91
- $currentStar.removeClass('dashicons-star-filled');
92
- $currentStar.addClass('dashicons-star-empty');
93
- }else{
94
- $currentStar.removeClass('dashicons-star-empty');
95
- $currentStar.addClass('dashicons-star-filled');
96
- }
97
- var data = { 'action': 'pwb_admin_set_featured_brand', 'brand': $currentStar.data('brand-id') };
98
- $.post(ajax_object.ajax_url, data, function( response ) {
99
- $currentStar.removeClass('pwb-blocked');
100
- if( response.success ){
101
- var $featuredCount = $('.taxonomy-pwb-brand .pwb-featured-count > span');
102
- if( response.data.direction == 'up' ){
103
- $featuredCount.html( parseInt( $featuredCount.text() ) + 1 );
104
- }else{
105
- $featuredCount.html( parseInt( $featuredCount.text() ) - 1 );
106
- }
107
- }else{
108
- alert( response.data.error_msg );
109
- }
110
- });
111
- });
112
-
113
- $('.taxonomy-pwb-brand #pwb-first-featured-brands').on('change', function(e){
114
- e.preventDefault();
115
- $('#screen-options-apply').replaceWith('<img src="'+ajax_object.site_url+'/wp-admin/images/loading.gif">');
116
- var data = { 'action': 'pwb_admin_save_screen_settings', 'new_val': $(this).is(':checked') };
117
- $.post(ajax_object.ajax_url, data, function(response) { location.reload(); });
118
- });
119
-
120
- $('.pwb-edit-brands-bottom > span').on('click', function(e){
121
- e.preventDefault();
122
- $('.taxonomy-pwb-brand #col-left').toggleClass('pwb-force-full-width');
123
- $('.taxonomy-pwb-brand #col-right').toggleClass('pwb-force-full-width');
124
- });
125
- /* ····························· /Edit brands page ····························· */
126
-
127
- /* ····························· Settings tab ····························· */
128
-
129
- // migrate brands
130
- $('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
131
-
132
- if( $(this).val() != '-' ){
133
-
134
- if( confirm(ajax_object.translations.migrate_notice) ){
135
-
136
- $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
137
- $('.pwb-modal-inner').html('<p>'+ajax_object.translations.migrating+'</p>');
138
-
139
- var data = {
140
- 'action': 'pwb_admin_migrate_brands',
141
- 'from': $(this).val()
142
- };
143
- $.post(ajax_object.ajax_url, data, function(response) {
144
-
145
- setTimeout( function(){
146
- location.href = ajax_object.brands_url;
147
- }, 1000 );
148
-
149
- });
150
-
151
- }else{
152
-
153
- }
154
-
155
- }
156
-
157
- $(this).val('-');//reset to default value
158
-
159
- } );
160
-
161
- // dummy data
162
- $('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
163
-
164
- if( $(this).val() != '-' ){
165
-
166
- if( confirm(ajax_object.translations.dummy_data_notice) ){
167
-
168
- $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
169
- $('.pwb-modal-inner').html('<p>'+ajax_object.translations.dummy_data+'</p>');
170
-
171
- var data = {
172
- 'action': 'pwb_admin_dummy_data',
173
- 'from': $(this).val()
174
- };
175
- $.post(ajax_object.ajax_url, data, function(response) {
176
-
177
- setTimeout( function(){
178
- location.href = ajax_object.brands_url;
179
- }, 1000 );
180
-
181
- });
182
-
183
- }else{
184
-
185
- }
186
-
187
- }
188
-
189
- $(this).val('-');//reset to default value
190
-
191
- } );
192
-
193
- var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
194
- $systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
195
- $('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
196
- e.preventDefault();
197
- if( !$('#wc_pwb_admin_status_result').length ){
198
- $systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
199
- $('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
200
- jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
201
- e.preventDefault();
202
- var refNode = $( this )[0];
203
- if ( $.browser.msie ) {
204
- var range = document.body.createTextRange();
205
- range.moveToElementText( refNode );
206
- range.select();
207
- } else if ( $.browser.mozilla || $.browser.opera ) {
208
- var selection = window.getSelection();
209
- var range = document.createRange();
210
- range.selectNodeContents( refNode );
211
- selection.removeAllRanges();
212
- selection.addRange( range );
213
- } else if ( $.browser.safari ) {
214
- var selection = window.getSelection();
215
- selection.setBaseAndExtent( refNode, 0, refNode, 1 );
216
- }
217
- } );
218
- }
219
- $('#wc_pwb_admin_status_result').html('<img src="'+ajax_object.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
220
- $('#wc_pwb_admin_status_result').show();
221
- var data = {
222
- 'action': 'pwb_system_status'
223
- };
224
- jQuery.post(ajaxurl, data, function(response) {
225
- $('#wc_pwb_admin_status_result').html(response);
226
- $('#wc_pwb_admin_status_result').trigger('click');
227
- });
228
-
229
- } );
230
-
231
- /* ····························· /Settings tab ····························· */
232
-
233
- /* ····························· Admin notices ····························· */
234
- $( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
235
-
236
- e.preventDefault();
237
-
238
- var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
239
-
240
- var data = {
241
- 'action': 'dismiss_pwb_notice',
242
- 'notice_name': noticeName
243
- };
244
- jQuery.post(ajaxurl, data, function(response) {
245
- //callback
246
- });
247
-
248
- } );
249
- /* ····························· /Admin notices ····························· */
250
-
251
- /* ····························· Widgets ····························· */
252
- pwbBindEventsToWigets();
253
- //Fires when a widget is added to a sidebar
254
- jQuery(document).bind('widget-added',function(e, widget){
255
- pwbBindEventsToWigets( widget );
256
- });
257
- //Fires on widget save
258
- jQuery(document).on('widget-updated', function(e, widget){
259
- pwbBindEventsToWigets( widget );
260
- });
261
- function pwbBindEventsToWigets( widget ){
262
- $currentWidget = $(".pwb-select-display-as");
263
- if( widget != undefined ){
264
- $currentWidget = $(".pwb-select-display-as", widget);
265
- }
266
- $currentWidget.on("change",function(){
267
- if( $(this).val()=="brand_logo" ){
268
- $(this).parent().siblings(".pwb-display-as-logo").addClass("show");
269
- }else{
270
- $(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
271
- }
272
- });
273
- }
274
- /* ····························· /Widgets ····························· */
275
-
276
- });
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function( $ ) {
4
+
5
+ var media_uploader = null;
6
+
7
+ function open_media_uploader_image( event, imageSelectorButton ){
8
+
9
+ var $imageSelectorScope = imageSelectorButton.parent();
10
+
11
+ media_uploader = wp.media({
12
+ frame: "post",
13
+ state: "insert",
14
+ multiple: false
15
+ });
16
+
17
+ media_uploader.on("insert", function(){
18
+ var json = media_uploader.state().get("selection").first().toJSON();
19
+ var image_id = json.id;
20
+ var image_url = json.url;
21
+ var image_html = '<img src="'+image_url+'" width="90" height="90">';
22
+
23
+ var current_selector = '';
24
+ switch (event.target.id) {
25
+ case 'pwb_brand_image_select':
26
+ current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
27
+ break;
28
+ case 'pwb_brand_banner_select':
29
+ current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
30
+ break;
31
+ }
32
+
33
+ $(current_selector).val(image_id);
34
+ $(current_selector+'_result').remove();
35
+
36
+ if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
37
+ $('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
38
+ }else{
39
+ $imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
40
+ }
41
+ add_delete_link( $imageSelectorScope );
42
+
43
+ });
44
+
45
+ media_uploader.open();
46
+ }
47
+
48
+
49
+ $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
50
+ open_media_uploader_image( event, $(this) );
51
+ });
52
+
53
+ //bind remove image event for edit page
54
+ $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
55
+ add_delete_link( $(this).parent() );
56
+ });
57
+
58
+ //clear custom fields when brand is added
59
+ jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
60
+ //Check ajax action of request that succeeded
61
+ if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
62
+ $('#pwb_brand_image').val('');
63
+ $('#pwb_brand_banner').val('');
64
+ $('.pwb_brand_image_selected').remove();
65
+ }
66
+ });
67
+
68
+ function add_delete_link( $imageSelectorScope ){
69
+
70
+ $( '.pwb_brand_image_selected span', $imageSelectorScope ).append('<a href="#" class="pwb_brand_image_selected_remove">X</a>');
71
+
72
+ $( '.pwb_brand_image_selected_remove', $imageSelectorScope ).on( 'click', function( event ){
73
+
74
+ event.preventDefault();
75
+ $(this).closest('.pwb_brand_image_selected').remove();
76
+
77
+ //remove the img
78
+ $('#pwb_brand_image',$imageSelectorScope).val('');
79
+ $('#pwb_brand_banner',$imageSelectorScope).val('');
80
+
81
+ });
82
+
83
+ }
84
+
85
+ /* ····························· Edit brands page ····························· */
86
+ $('.taxonomy-pwb-brand table .column-featured > span').not('pwb-blocked').on('click', function(e){
87
+ e.preventDefault();
88
+ var $currentStar = $(this);
89
+ $currentStar.addClass('pwb-blocked');
90
+ if( $currentStar.hasClass('dashicons-star-filled') ){
91
+ $currentStar.removeClass('dashicons-star-filled');
92
+ $currentStar.addClass('dashicons-star-empty');
93
+ }else{
94
+ $currentStar.removeClass('dashicons-star-empty');
95
+ $currentStar.addClass('dashicons-star-filled');
96
+ }
97
+ var data = { 'action': 'pwb_admin_set_featured_brand', 'brand': $currentStar.data('brand-id') };
98
+ $.post(ajax_object.ajax_url, data, function( response ) {
99
+ $currentStar.removeClass('pwb-blocked');
100
+ if( response.success ){
101
+ var $featuredCount = $('.taxonomy-pwb-brand .pwb-featured-count > span');
102
+ if( response.data.direction == 'up' ){
103
+ $featuredCount.html( parseInt( $featuredCount.text() ) + 1 );
104
+ }else{
105
+ $featuredCount.html( parseInt( $featuredCount.text() ) - 1 );
106
+ }
107
+ }else{
108
+ alert( response.data.error_msg );
109
+ }
110
+ });
111
+ });
112
+
113
+ $('.taxonomy-pwb-brand #pwb-first-featured-brands').on('change', function(e){
114
+ e.preventDefault();
115
+ $('#screen-options-apply').replaceWith('<img src="'+ajax_object.site_url+'/wp-admin/images/loading.gif">');
116
+ var data = { 'action': 'pwb_admin_save_screen_settings', 'new_val': $(this).is(':checked') };
117
+ $.post(ajax_object.ajax_url, data, function(response) { location.reload(); });
118
+ });
119
+
120
+ $('.pwb-edit-brands-bottom > span').on('click', function(e){
121
+ e.preventDefault();
122
+ $('.taxonomy-pwb-brand #col-left').toggleClass('pwb-force-full-width');
123
+ $('.taxonomy-pwb-brand #col-right').toggleClass('pwb-force-full-width');
124
+ });
125
+ /* ····························· /Edit brands page ····························· */
126
+
127
+ /* ····························· Settings tab ····························· */
128
+
129
+ // migrate brands
130
+ $('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
131
+
132
+ if( $(this).val() != '-' ){
133
+
134
+ if( confirm(ajax_object.translations.migrate_notice) ){
135
+
136
+ $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
137
+ $('.pwb-modal-inner').html('<p>'+ajax_object.translations.migrating+'</p>');
138
+
139
+ var data = {
140
+ 'action': 'pwb_admin_migrate_brands',
141
+ 'from': $(this).val()
142
+ };
143
+ $.post(ajax_object.ajax_url, data, function(response) {
144
+
145
+ setTimeout( function(){
146
+ location.href = ajax_object.brands_url;
147
+ }, 1000 );
148
+
149
+ });
150
+
151
+ }else{
152
+
153
+ }
154
+
155
+ }
156
+
157
+ $(this).val('-');//reset to default value
158
+
159
+ } );
160
+
161
+ // dummy data
162
+ $('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
163
+
164
+ if( $(this).val() != '-' ){
165
+
166
+ if( confirm(ajax_object.translations.dummy_data_notice) ){
167
+
168
+ $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
169
+ $('.pwb-modal-inner').html('<p>'+ajax_object.translations.dummy_data+'</p>');
170
+
171
+ var data = {
172
+ 'action': 'pwb_admin_dummy_data',
173
+ 'from': $(this).val()
174
+ };
175
+ $.post(ajax_object.ajax_url, data, function(response) {
176
+
177
+ setTimeout( function(){
178
+ location.href = ajax_object.brands_url;
179
+ }, 1000 );
180
+
181
+ });
182
+
183
+ }else{
184
+
185
+ }
186
+
187
+ }
188
+
189
+ $(this).val('-');//reset to default value
190
+
191
+ } );
192
+
193
+ var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
194
+ $systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
195
+ $('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
196
+ e.preventDefault();
197
+ if( !$('#wc_pwb_admin_status_result').length ){
198
+ $systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
199
+ $('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
200
+ jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
201
+ e.preventDefault();
202
+ var refNode = $( this )[0];
203
+ if ( $.browser.msie ) {
204
+ var range = document.body.createTextRange();
205
+ range.moveToElementText( refNode );
206
+ range.select();
207
+ } else if ( $.browser.mozilla || $.browser.opera ) {
208
+ var selection = window.getSelection();
209
+ var range = document.createRange();
210
+ range.selectNodeContents( refNode );
211
+ selection.removeAllRanges();
212
+ selection.addRange( range );
213
+ } else if ( $.browser.safari ) {
214
+ var selection = window.getSelection();
215
+ selection.setBaseAndExtent( refNode, 0, refNode, 1 );
216
+ }
217
+ } );
218
+ }
219
+ $('#wc_pwb_admin_status_result').html('<img src="'+ajax_object.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
220
+ $('#wc_pwb_admin_status_result').show();
221
+ var data = {
222
+ 'action': 'pwb_system_status'
223
+ };
224
+ jQuery.post(ajaxurl, data, function(response) {
225
+ $('#wc_pwb_admin_status_result').html(response);
226
+ $('#wc_pwb_admin_status_result').trigger('click');
227
+ });
228
+
229
+ } );
230
+
231
+ /* ····························· /Settings tab ····························· */
232
+
233
+ /* ····························· Admin notices ····························· */
234
+ $( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
235
+
236
+ e.preventDefault();
237
+
238
+ var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
239
+
240
+ var data = {
241
+ 'action': 'dismiss_pwb_notice',
242
+ 'notice_name': noticeName
243
+ };
244
+ jQuery.post(ajaxurl, data, function(response) {
245
+ //callback
246
+ });
247
+
248
+ } );
249
+ /* ····························· /Admin notices ····························· */
250
+
251
+ /* ····························· Widgets ····························· */
252
+ pwbBindEventsToWigets();
253
+ //Fires when a widget is added to a sidebar
254
+ jQuery(document).bind('widget-added',function(e, widget){
255
+ pwbBindEventsToWigets( widget );
256
+ });
257
+ //Fires on widget save
258
+ jQuery(document).on('widget-updated', function(e, widget){
259
+ pwbBindEventsToWigets( widget );
260
+ });
261
+ function pwbBindEventsToWigets( widget ){
262
+ $currentWidget = $(".pwb-select-display-as");
263
+ if( widget != undefined ){
264
+ $currentWidget = $(".pwb-select-display-as", widget);
265
+ }
266
+ $currentWidget.on("change",function(){
267
+ if( $(this).val()=="brand_logo" ){
268
+ $(this).parent().siblings(".pwb-display-as-logo").addClass("show");
269
+ }else{
270
+ $(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
271
+ }
272
+ });
273
+ }
274
+ /* ····························· /Widgets ····························· */
275
+
276
+ });
assets/js/{pwb_admin_functions.min.js → functions-admin.min.js} RENAMED
File without changes
assets/js/{pwb_frontend_functions.js → functions-frontend.js} RENAMED
@@ -1,149 +1,149 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function( $ ) {
4
- $('.pwb-dropdown-widget').on('change',function(){
5
- var href = $(this).find(":selected").val();
6
- location.href = href;
7
- });
8
-
9
- $('.pwb-carousel').slick({
10
- slide: '.pwb-slick-slide',
11
- infinite: true,
12
- draggable: false,
13
- prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
14
- nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
15
- speed: 300,
16
- lazyLoad: 'progressive',
17
- responsive: [
18
- {
19
- breakpoint: 1024,
20
- settings: {
21
- slidesToShow: 4,
22
- draggable: true,
23
- arrows: false
24
- }
25
- },
26
- {
27
- breakpoint: 600,
28
- settings: {
29
- slidesToShow: 3,
30
- draggable: true,
31
- arrows: false
32
- }
33
- },
34
- {
35
- breakpoint: 480,
36
- settings: {
37
- slidesToShow: 2,
38
- draggable: true,
39
- arrows: false
40
- }
41
- }
42
- ]
43
- });
44
-
45
- $('.pwb-product-carousel').slick({
46
- slide: '.pwb-slick-slide',
47
- infinite: true,
48
- draggable: false,
49
- prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
50
- nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
51
- speed: 300,
52
- lazyLoad: 'progressive',
53
- responsive: [
54
- {
55
- breakpoint: 1024,
56
- settings: {
57
- slidesToShow: 3,
58
- draggable: true,
59
- arrows: false
60
- }
61
- },
62
- {
63
- breakpoint: 600,
64
- settings: {
65
- slidesToShow: 2,
66
- draggable: true,
67
- arrows: false
68
- }
69
- },
70
- {
71
- breakpoint: 480,
72
- settings: {
73
- slidesToShow: 1,
74
- draggable: true,
75
- arrows: false
76
- }
77
- }
78
- ]
79
- });
80
-
81
-
82
- /* ··························· Filter by brand widget ··························· */
83
-
84
- var brands = PWBgetUrlParameter('pwb-brand-filter');
85
-
86
- $('.pwb-filter-products button').on( 'click', function(){
87
-
88
- var currentUrl = window.location.href;
89
-
90
- var marcas = '';
91
- $('.pwb-filter-products input[type="checkbox"]').each(function(index){
92
- var checked = $(this).prop('checked');
93
- if(checked){
94
- marcas+=$(this).val();
95
- if($('.pwb-filter-products input[type="checkbox"]').length-1 != index){
96
- marcas+=',';
97
- }
98
- }
99
- });
100
-
101
- //removes previous "pwb-brand" from url
102
- currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
103
-
104
- //removes pagination
105
- currentUrl = currentUrl.replace(/\/page\/\d*\//i, "");
106
-
107
- if( currentUrl.indexOf("?") === -1 ){
108
- currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
109
- }else{
110
- currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
111
- }
112
- location.href = currentUrl;
113
-
114
- });
115
-
116
- if(brands!=null){
117
- var brands_array = brands.split(',');
118
- $('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
119
- for ( var i = 0, l = brands_array.length; i < l; i++ ) {
120
- $('.pwb-filter-products input[type="checkbox"]').each(function(index){
121
- if($(this).val()){
122
- if(brands_array[i]==$(this).val()){
123
- $(this).prop('checked',true);
124
- }
125
- }
126
- });
127
- }
128
- }else{
129
- $('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
130
- }
131
-
132
- /* ··························· /Filter by brand widget ··························· */
133
-
134
- });
135
-
136
- var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
137
- var sPageURL = decodeURIComponent(window.location.search.substring(1)),
138
- sURLVariables = sPageURL.split('&'),
139
- sParameterName,
140
- i;
141
-
142
- for (i = 0; i < sURLVariables.length; i++) {
143
- sParameterName = sURLVariables[i].split('=');
144
-
145
- if (sParameterName[0] === sParam) {
146
- return sParameterName[1] === undefined ? true : sParameterName[1];
147
- }
148
- }
149
- };
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function( $ ) {
4
+ $('.pwb-dropdown-widget').on('change',function(){
5
+ var href = $(this).find(":selected").val();
6
+ location.href = href;
7
+ });
8
+
9
+ $('.pwb-carousel').slick({
10
+ slide: '.pwb-slick-slide',
11
+ infinite: true,
12
+ draggable: false,
13
+ prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
14
+ nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
15
+ speed: 300,
16
+ lazyLoad: 'progressive',
17
+ responsive: [
18
+ {
19
+ breakpoint: 1024,
20
+ settings: {
21
+ slidesToShow: 4,
22
+ draggable: true,
23
+ arrows: false
24
+ }
25
+ },
26
+ {
27
+ breakpoint: 600,
28
+ settings: {
29
+ slidesToShow: 3,
30
+ draggable: true,
31
+ arrows: false
32
+ }
33
+ },
34
+ {
35
+ breakpoint: 480,
36
+ settings: {
37
+ slidesToShow: 2,
38
+ draggable: true,
39
+ arrows: false
40
+ }
41
+ }
42
+ ]
43
+ });
44
+
45
+ $('.pwb-product-carousel').slick({
46
+ slide: '.pwb-slick-slide',
47
+ infinite: true,
48
+ draggable: false,
49
+ prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
50
+ nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
51
+ speed: 300,
52
+ lazyLoad: 'progressive',
53
+ responsive: [
54
+ {
55
+ breakpoint: 1024,
56
+ settings: {
57
+ slidesToShow: 3,
58
+ draggable: true,
59
+ arrows: false
60
+ }
61
+ },
62
+ {
63
+ breakpoint: 600,
64
+ settings: {
65
+ slidesToShow: 2,
66
+ draggable: true,
67
+ arrows: false
68
+ }
69
+ },
70
+ {
71
+ breakpoint: 480,
72
+ settings: {
73
+ slidesToShow: 1,
74
+ draggable: true,
75
+ arrows: false
76
+ }
77
+ }
78
+ ]
79
+ });
80
+
81
+
82
+ /* ··························· Filter by brand widget ··························· */
83
+
84
+ var brands = PWBgetUrlParameter('pwb-brand-filter');
85
+
86
+ $('.pwb-filter-products button').on( 'click', function(){
87
+
88
+ var currentUrl = window.location.href;
89
+
90
+ var marcas = '';
91
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
92
+ var checked = $(this).prop('checked');
93
+ if(checked){
94
+ marcas+=$(this).val();
95
+ if($('.pwb-filter-products input[type="checkbox"]').length-1 != index){
96
+ marcas+=',';
97
+ }
98
+ }
99
+ });
100
+
101
+ //removes previous "pwb-brand" from url
102
+ currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
103
+
104
+ //removes pagination
105
+ currentUrl = currentUrl.replace(/\/page\/\d*\//i, "");
106
+
107
+ if( currentUrl.indexOf("?") === -1 ){
108
+ currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
109
+ }else{
110
+ currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
111
+ }
112
+ location.href = currentUrl;
113
+
114
+ });
115
+
116
+ if(brands!=null){
117
+ var brands_array = brands.split(',');
118
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
119
+ for ( var i = 0, l = brands_array.length; i < l; i++ ) {
120
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
121
+ if($(this).val()){
122
+ if(brands_array[i]==$(this).val()){
123
+ $(this).prop('checked',true);
124
+ }
125
+ }
126
+ });
127
+ }
128
+ }else{
129
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
130
+ }
131
+
132
+ /* ··························· /Filter by brand widget ··························· */
133
+
134
+ });
135
+
136
+ var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
137
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
138
+ sURLVariables = sPageURL.split('&'),
139
+ sParameterName,
140
+ i;
141
+
142
+ for (i = 0; i < sURLVariables.length; i++) {
143
+ sParameterName = sURLVariables[i].split('=');
144
+
145
+ if (sParameterName[0] === sParam) {
146
+ return sParameterName[1] === undefined ? true : sParameterName[1];
147
+ }
148
+ }
149
+ };
assets/js/{pwb_frontend_functions.min.js → functions-frontend.min.js} RENAMED
File without changes
assets/{js → lib}/slick/ajax-loader.gif RENAMED
File without changes
assets/{js → lib}/slick/config.rb RENAMED
@@ -1,10 +1,10 @@
1
- css_dir = "."
2
- sass_dir = "."
3
- images_dir = "."
4
- fonts_dir = "fonts"
5
- relative_assets = true
6
-
7
- output_style = :compact
8
- line_comments = false
9
-
10
  preferred_syntax = :scss
1
+ css_dir = "."
2
+ sass_dir = "."
3
+ images_dir = "."
4
+ fonts_dir = "fonts"
5
+ relative_assets = true
6
+
7
+ output_style = :compact
8
+ line_comments = false
9
+
10
  preferred_syntax = :scss
assets/{js → lib}/slick/fonts/slick.eot RENAMED
File without changes
assets/{js → lib}/slick/fonts/slick.svg RENAMED
@@ -1,14 +1,14 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by Fontastic.me</metadata>
5
- <defs>
6
- <font id="slick" horiz-adv-x="512">
7
- <font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
8
- <missing-glyph horiz-adv-x="512" />
9
-
10
- <glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
- <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
- <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
- <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
- </font></defs></svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by Fontastic.me</metadata>
5
+ <defs>
6
+ <font id="slick" horiz-adv-x="512">
7
+ <font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
8
+ <missing-glyph horiz-adv-x="512" />
9
+
10
+ <glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
+ <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
+ <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
+ <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
+ </font></defs></svg>
assets/{js → lib}/slick/fonts/slick.ttf RENAMED
File without changes
assets/{js → lib}/slick/fonts/slick.woff RENAMED
File without changes
assets/{js → lib}/slick/slick-theme.css RENAMED
@@ -1,204 +1,204 @@
1
- @charset 'UTF-8';
2
- /* Slider */
3
- .slick-loading .slick-list
4
- {
5
- background: #fff url('./ajax-loader.gif') center center no-repeat;
6
- }
7
-
8
- /* Icons */
9
- @font-face
10
- {
11
- font-family: 'slick';
12
- font-weight: normal;
13
- font-style: normal;
14
-
15
- src: url('./fonts/slick.eot');
16
- src: url('./fonts/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick.woff') format('woff'), url('./fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg');
17
- }
18
- /* Arrows */
19
- .slick-prev,
20
- .slick-next
21
- {
22
- font-size: 0;
23
- line-height: 0;
24
-
25
- position: absolute;
26
- top: 50%;
27
-
28
- display: block;
29
-
30
- width: 20px;
31
- height: 20px;
32
- padding: 0;
33
- -webkit-transform: translate(0, -50%);
34
- -ms-transform: translate(0, -50%);
35
- transform: translate(0, -50%);
36
-
37
- cursor: pointer;
38
-
39
- color: transparent;
40
- border: none;
41
- outline: none;
42
- background: transparent;
43
- }
44
- .slick-prev:hover,
45
- .slick-prev:focus,
46
- .slick-next:hover,
47
- .slick-next:focus
48
- {
49
- color: transparent;
50
- outline: none;
51
- background: transparent;
52
- }
53
- .slick-prev:hover:before,
54
- .slick-prev:focus:before,
55
- .slick-next:hover:before,
56
- .slick-next:focus:before
57
- {
58
- opacity: 1;
59
- }
60
- .slick-prev.slick-disabled:before,
61
- .slick-next.slick-disabled:before
62
- {
63
- opacity: .25;
64
- }
65
-
66
- .slick-prev:before,
67
- .slick-next:before
68
- {
69
- font-family: 'slick';
70
- font-size: 20px;
71
- line-height: 1;
72
-
73
- opacity: .75;
74
- color: white;
75
-
76
- -webkit-font-smoothing: antialiased;
77
- -moz-osx-font-smoothing: grayscale;
78
- }
79
-
80
- .slick-prev
81
- {
82
- left: -25px;
83
- }
84
- [dir='rtl'] .slick-prev
85
- {
86
- right: -25px;
87
- left: auto;
88
- }
89
- .slick-prev:before
90
- {
91
- content: '←';
92
- }
93
- [dir='rtl'] .slick-prev:before
94
- {
95
- content: '→';
96
- }
97
-
98
- .slick-next
99
- {
100
- right: -25px;
101
- }
102
- [dir='rtl'] .slick-next
103
- {
104
- right: auto;
105
- left: -25px;
106
- }
107
- .slick-next:before
108
- {
109
- content: '→';
110
- }
111
- [dir='rtl'] .slick-next:before
112
- {
113
- content: '←';
114
- }
115
-
116
- /* Dots */
117
- .slick-dotted.slick-slider
118
- {
119
- margin-bottom: 30px;
120
- }
121
-
122
- .slick-dots
123
- {
124
- position: absolute;
125
- bottom: -25px;
126
-
127
- display: block;
128
-
129
- width: 100%;
130
- padding: 0;
131
- margin: 0;
132
-
133
- list-style: none;
134
-
135
- text-align: center;
136
- }
137
- .slick-dots li
138
- {
139
- position: relative;
140
-
141
- display: inline-block;
142
-
143
- width: 20px;
144
- height: 20px;
145
- margin: 0 5px;
146
- padding: 0;
147
-
148
- cursor: pointer;
149
- }
150
- .slick-dots li button
151
- {
152
- font-size: 0;
153
- line-height: 0;
154
-
155
- display: block;
156
-
157
- width: 20px;
158
- height: 20px;
159
- padding: 5px;
160
-
161
- cursor: pointer;
162
-
163
- color: transparent;
164
- border: 0;
165
- outline: none;
166
- background: transparent;
167
- }
168
- .slick-dots li button:hover,
169
- .slick-dots li button:focus
170
- {
171
- outline: none;
172
- }
173
- .slick-dots li button:hover:before,
174
- .slick-dots li button:focus:before
175
- {
176
- opacity: 1;
177
- }
178
- .slick-dots li button:before
179
- {
180
- font-family: 'slick';
181
- font-size: 6px;
182
- line-height: 20px;
183
-
184
- position: absolute;
185
- top: 0;
186
- left: 0;
187
-
188
- width: 20px;
189
- height: 20px;
190
-
191
- content: '•';
192
- text-align: center;
193
-
194
- opacity: .25;
195
- color: black;
196
-
197
- -webkit-font-smoothing: antialiased;
198
- -moz-osx-font-smoothing: grayscale;
199
- }
200
- .slick-dots li.slick-active button:before
201
- {
202
- opacity: .75;
203
- color: black;
204
- }
1
+ @charset 'UTF-8';
2
+ /* Slider */
3
+ .slick-loading .slick-list
4
+ {
5
+ background: #fff url('./ajax-loader.gif') center center no-repeat;
6
+ }
7
+
8
+ /* Icons */
9
+ @font-face
10
+ {
11
+ font-family: 'slick';
12
+ font-weight: normal;
13
+ font-style: normal;
14
+
15
+ src: url('./fonts/slick.eot');
16
+ src: url('./fonts/slick.eot?#iefix') format('embedded-opentype'), url('./fonts/slick.woff') format('woff'), url('./fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg');
17
+ }
18
+ /* Arrows */
19
+ .slick-prev,
20
+ .slick-next
21
+ {
22
+ font-size: 0;
23
+ line-height: 0;
24
+
25
+ position: absolute;
26
+ top: 50%;
27
+
28
+ display: block;
29
+
30
+ width: 20px;
31
+ height: 20px;
32
+ padding: 0;
33
+ -webkit-transform: translate(0, -50%);
34
+ -ms-transform: translate(0, -50%);
35
+ transform: translate(0, -50%);
36
+
37
+ cursor: pointer;
38
+
39
+ color: transparent;
40
+ border: none;
41
+ outline: none;
42
+ background: transparent;
43
+ }
44
+ .slick-prev:hover,
45
+ .slick-prev:focus,
46
+ .slick-next:hover,
47
+ .slick-next:focus
48
+ {
49
+ color: transparent;
50
+ outline: none;
51
+ background: transparent;
52
+ }
53
+ .slick-prev:hover:before,
54
+ .slick-prev:focus:before,
55
+ .slick-next:hover:before,
56
+ .slick-next:focus:before
57
+ {
58
+ opacity: 1;
59
+ }
60
+ .slick-prev.slick-disabled:before,
61
+ .slick-next.slick-disabled:before
62
+ {
63
+ opacity: .25;
64
+ }
65
+
66
+ .slick-prev:before,
67
+ .slick-next:before
68
+ {
69
+ font-family: 'slick';
70
+ font-size: 20px;
71
+ line-height: 1;
72
+
73
+ opacity: .75;
74
+ color: white;
75
+
76
+ -webkit-font-smoothing: antialiased;
77
+ -moz-osx-font-smoothing: grayscale;
78
+ }
79
+
80
+ .slick-prev
81
+ {
82
+ left: -25px;
83
+ }
84
+ [dir='rtl'] .slick-prev
85
+ {
86
+ right: -25px;
87
+ left: auto;
88
+ }
89
+ .slick-prev:before
90
+ {
91
+ content: '←';
92
+ }
93
+ [dir='rtl'] .slick-prev:before
94
+ {
95
+ content: '→';
96
+ }
97
+
98
+ .slick-next
99
+ {
100
+ right: -25px;
101
+ }
102
+ [dir='rtl'] .slick-next
103
+ {
104
+ right: auto;
105
+ left: -25px;
106
+ }
107
+ .slick-next:before
108
+ {
109
+ content: '→';
110
+ }
111
+ [dir='rtl'] .slick-next:before
112
+ {
113
+ content: '←';
114
+ }
115
+
116
+ /* Dots */
117
+ .slick-dotted.slick-slider
118
+ {
119
+ margin-bottom: 30px;
120
+ }
121
+
122
+ .slick-dots
123
+ {
124
+ position: absolute;
125
+ bottom: -25px;
126
+
127
+ display: block;
128
+
129
+ width: 100%;
130
+ padding: 0;
131
+ margin: 0;
132
+
133
+ list-style: none;
134
+
135
+ text-align: center;
136
+ }
137
+ .slick-dots li
138
+ {
139
+ position: relative;
140
+
141
+ display: inline-block;
142
+
143
+ width: 20px;
144
+ height: 20px;
145
+ margin: 0 5px;
146
+ padding: 0;
147
+
148
+ cursor: pointer;
149
+ }
150
+ .slick-dots li button
151
+ {
152
+ font-size: 0;
153
+ line-height: 0;
154
+
155
+ display: block;
156
+
157
+ width: 20px;
158
+ height: 20px;
159
+ padding: 5px;
160
+
161
+ cursor: pointer;
162
+
163
+ color: transparent;
164
+ border: 0;
165
+ outline: none;
166
+ background: transparent;
167
+ }
168
+ .slick-dots li button:hover,
169
+ .slick-dots li button:focus
170
+ {
171
+ outline: none;
172
+ }
173
+ .slick-dots li button:hover:before,
174
+ .slick-dots li button:focus:before
175
+ {
176
+ opacity: 1;
177
+ }
178
+ .slick-dots li button:before
179
+ {
180
+ font-family: 'slick';
181
+ font-size: 6px;
182
+ line-height: 20px;
183
+
184
+ position: absolute;
185
+ top: 0;
186
+ left: 0;
187
+
188
+ width: 20px;
189
+ height: 20px;
190
+
191
+ content: '•';
192
+ text-align: center;
193
+
194
+ opacity: .25;
195
+ color: black;
196
+
197
+ -webkit-font-smoothing: antialiased;
198
+ -moz-osx-font-smoothing: grayscale;
199
+ }
200
+ .slick-dots li.slick-active button:before
201
+ {
202
+ opacity: .75;
203
+ color: black;
204
+ }
assets/{js → lib}/slick/slick-theme.less RENAMED
@@ -1,168 +1,168 @@
1
- @charset "UTF-8";
2
-
3
- // Default Variables
4
-
5
- @slick-font-path: "./fonts/";
6
- @slick-font-family: "slick";
7
- @slick-loader-path: "./";
8
- @slick-arrow-color: white;
9
- @slick-dot-color: black;
10
- @slick-dot-color-active: @slick-dot-color;
11
- @slick-prev-character: "←";
12
- @slick-next-character: "→";
13
- @slick-dot-character: "•";
14
- @slick-dot-size: 6px;
15
- @slick-opacity-default: 0.75;
16
- @slick-opacity-on-hover: 1;
17
- @slick-opacity-not-active: 0.25;
18
-
19
- /* Slider */
20
- .slick-loading .slick-list{
21
- background: #fff url('@{slick-loader-path}ajax-loader.gif') center center no-repeat;
22
- }
23
-
24
- /* Arrows */
25
- .slick-prev,
26
- .slick-next {
27
- position: absolute;
28
- display: block;
29
- height: 20px;
30
- width: 20px;
31
- line-height: 0px;
32
- font-size: 0px;
33
- cursor: pointer;
34
- background: transparent;
35
- color: transparent;
36
- top: 50%;
37
- -webkit-transform: translate(0, -50%);
38
- -ms-transform: translate(0, -50%);
39
- transform: translate(0, -50%);
40
- padding: 0;
41
- border: none;
42
- outline: none;
43
- &:hover, &:focus {
44
- outline: none;
45
- background: transparent;
46
- color: transparent;
47
- &:before {
48
- opacity: @slick-opacity-on-hover;
49
- }
50
- }
51
- &.slick-disabled:before {
52
- opacity: @slick-opacity-not-active;
53
- }
54
- }
55
-
56
- .slick-prev:before, .slick-next:before {
57
- font-family: @slick-font-family;
58
- font-size: 20px;
59
- line-height: 1;
60
- color: @slick-arrow-color;
61
- opacity: @slick-opacity-default;
62
- -webkit-font-smoothing: antialiased;
63
- -moz-osx-font-smoothing: grayscale;
64
-
65
- & when ( @slick-font-family = 'slick' ) {
66
- /* Icons */
67
- @font-face {
68
- font-family: 'slick';
69
- font-weight: normal;
70
- font-style: normal;
71
- src: url('@{slick-font-path}slick.eot');
72
- src: url('@{slick-font-path}slick.eot?#iefix') format('embedded-opentype'), url('@{slick-font-path}slick.woff') format('woff'), url('@{slick-font-path}slick.ttf') format('truetype'), url('@{slick-font-path}slick.svg#slick') format('svg');
73
- }
74
- }
75
- }
76
-
77
- .slick-prev {
78
- left: -25px;
79
- [dir="rtl"] & {
80
- left: auto;
81
- right: -25px;
82
- }
83
- &:before {
84
- content: @slick-prev-character;
85
- [dir="rtl"] & {
86
- content: @slick-next-character;
87
- }
88
- }
89
- }
90
-
91
- .slick-next {
92
- right: -25px;
93
- [dir="rtl"] & {
94
- left: -25px;
95
- right: auto;
96
- }
97
- &:before {
98
- content: @slick-next-character;
99
- [dir="rtl"] & {
100
- content: @slick-prev-character;
101
- }
102
- }
103
- }
104
-
105
- /* Dots */
106
-
107
- .slick-dotted .slick-slider {
108
- margin-bottom: 30px;
109
- }
110
-
111
- .slick-dots {
112
- position: absolute;
113
- bottom: -25px;
114
- list-style: none;
115
- display: block;
116
- text-align: center;
117
- padding: 0;
118
- margin: 0;
119
- width: 100%;
120
- li {
121
- position: relative;
122
- display: inline-block;
123
- height: 20px;
124
- width: 20px;
125
- margin: 0 5px;
126
- padding: 0;
127
- cursor: pointer;
128
- button {
129
- border: 0;
130
- background: transparent;
131
- display: block;
132
- height: 20px;
133
- width: 20px;
134
- outline: none;
135
- line-height: 0px;
136
- font-size: 0px;
137
- color: transparent;
138
- padding: 5px;
139
- cursor: pointer;
140
- &:hover, &:focus {
141
- outline: none;
142
- &:before {
143
- opacity: @slick-opacity-on-hover;
144
- }
145
- }
146
- &:before {
147
- position: absolute;
148
- top: 0;
149
- left: 0;
150
- content: @slick-dot-character;
151
- width: 20px;
152
- height: 20px;
153
- font-family: @slick-font-family;
154
- font-size: @slick-dot-size;
155
- line-height: 20px;
156
- text-align: center;
157
- color: @slick-dot-color;
158
- opacity: @slick-opacity-not-active;
159
- -webkit-font-smoothing: antialiased;
160
- -moz-osx-font-smoothing: grayscale;
161
- }
162
- }
163
- &.slick-active button:before {
164
- color: @slick-dot-color-active;
165
- opacity: @slick-opacity-default;
166
- }
167
- }
168
- }
1
+ @charset "UTF-8";
2
+
3
+ // Default Variables
4
+
5
+ @slick-font-path: "./fonts/";
6
+ @slick-font-family: "slick";
7
+ @slick-loader-path: "./";
8
+ @slick-arrow-color: white;
9
+ @slick-dot-color: black;
10
+ @slick-dot-color-active: @slick-dot-color;
11
+ @slick-prev-character: "←";
12
+ @slick-next-character: "→";
13
+ @slick-dot-character: "•";
14
+ @slick-dot-size: 6px;
15
+ @slick-opacity-default: 0.75;
16
+ @slick-opacity-on-hover: 1;
17
+ @slick-opacity-not-active: 0.25;
18
+
19
+ /* Slider */
20
+ .slick-loading .slick-list{
21
+ background: #fff url('@{slick-loader-path}ajax-loader.gif') center center no-repeat;
22
+ }
23
+
24
+ /* Arrows */
25
+ .slick-prev,
26
+ .slick-next {
27
+ position: absolute;
28
+ display: block;
29
+ height: 20px;
30
+ width: 20px;
31
+ line-height: 0px;
32
+ font-size: 0px;
33
+ cursor: pointer;
34
+ background: transparent;
35
+ color: transparent;
36
+ top: 50%;
37
+ -webkit-transform: translate(0, -50%);
38
+ -ms-transform: translate(0, -50%);
39
+ transform: translate(0, -50%);
40
+ padding: 0;
41
+ border: none;
42
+ outline: none;
43
+ &:hover, &:focus {
44
+ outline: none;
45
+ background: transparent;
46
+ color: transparent;
47
+ &:before {
48
+ opacity: @slick-opacity-on-hover;
49
+ }
50
+ }
51
+ &.slick-disabled:before {
52
+ opacity: @slick-opacity-not-active;
53
+ }
54
+ }
55
+
56
+ .slick-prev:before, .slick-next:before {
57
+ font-family: @slick-font-family;
58
+ font-size: 20px;
59
+ line-height: 1;
60
+ color: @slick-arrow-color;
61
+ opacity: @slick-opacity-default;
62
+ -webkit-font-smoothing: antialiased;
63
+ -moz-osx-font-smoothing: grayscale;
64
+
65
+ & when ( @slick-font-family = 'slick' ) {
66
+ /* Icons */
67
+ @font-face {
68
+ font-family: 'slick';
69
+ font-weight: normal;
70
+ font-style: normal;
71
+ src: url('@{slick-font-path}slick.eot');
72
+ src: url('@{slick-font-path}slick.eot?#iefix') format('embedded-opentype'), url('@{slick-font-path}slick.woff') format('woff'), url('@{slick-font-path}slick.ttf') format('truetype'), url('@{slick-font-path}slick.svg#slick') format('svg');
73
+ }
74
+ }
75
+ }
76
+
77
+ .slick-prev {
78
+ left: -25px;
79
+ [dir="rtl"] & {
80
+ left: auto;
81
+ right: -25px;
82
+ }
83
+ &:before {
84
+ content: @slick-prev-character;
85
+ [dir="rtl"] & {
86
+ content: @slick-next-character;
87
+ }
88
+ }
89
+ }
90
+
91
+ .slick-next {
92
+ right: -25px;
93
+ [dir="rtl"] & {
94
+ left: -25px;
95
+ right: auto;
96
+ }
97
+ &:before {
98
+ content: @slick-next-character;
99
+ [dir="rtl"] & {
100
+ content: @slick-prev-character;
101
+ }
102
+ }
103
+ }
104
+
105
+ /* Dots */
106
+
107
+ .slick-dotted .slick-slider {
108
+ margin-bottom: 30px;
109
+ }
110
+
111
+ .slick-dots {
112
+ position: absolute;
113
+ bottom: -25px;
114
+ list-style: none;
115
+ display: block;
116
+ text-align: center;
117
+ padding: 0;
118
+ margin: 0;
119
+ width: 100%;
120
+ li {
121
+ position: relative;
122
+ display: inline-block;
123
+ height: 20px;
124
+ width: 20px;
125
+ margin: 0 5px;
126
+ padding: 0;
127
+ cursor: pointer;
128
+ button {
129
+ border: 0;
130
+ background: transparent;
131
+ display: block;
132
+ height: 20px;
133
+ width: 20px;
134
+ outline: none;
135
+ line-height: 0px;
136
+ font-size: 0px;
137
+ color: transparent;
138
+ padding: 5px;
139
+ cursor: pointer;
140
+ &:hover, &:focus {
141
+ outline: none;
142
+ &:before {
143
+ opacity: @slick-opacity-on-hover;
144
+ }
145
+ }
146
+ &:before {
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ content: @slick-dot-character;
151
+ width: 20px;
152
+ height: 20px;
153
+ font-family: @slick-font-family;
154
+ font-size: @slick-dot-size;
155
+ line-height: 20px;
156
+ text-align: center;
157
+ color: @slick-dot-color;
158
+ opacity: @slick-opacity-not-active;
159
+ -webkit-font-smoothing: antialiased;
160
+ -moz-osx-font-smoothing: grayscale;
161
+ }
162
+ }
163
+ &.slick-active button:before {
164
+ color: @slick-dot-color-active;
165
+ opacity: @slick-opacity-default;
166
+ }
167
+ }
168
+ }
assets/{js → lib}/slick/slick-theme.scss RENAMED
@@ -1,194 +1,194 @@
1
- @charset "UTF-8";
2
-
3
- // Default Variables
4
-
5
- // Slick icon entity codes outputs the following
6
- // "\2190" outputs ascii character "←"
7
- // "\2192" outputs ascii character "→"
8
- // "\2022" outputs ascii character "•"
9
-
10
- $slick-font-path: "./fonts/" !default;
11
- $slick-font-family: "slick" !default;
12
- $slick-loader-path: "./" !default;
13
- $slick-arrow-color: white !default;
14
- $slick-dot-color: black !default;
15
- $slick-dot-color-active: $slick-dot-color !default;
16
- $slick-prev-character: "\2190" !default;
17
- $slick-next-character: "\2192" !default;
18
- $slick-dot-character: "\2022" !default;
19
- $slick-dot-size: 6px !default;
20
- $slick-opacity-default: 0.75 !default;
21
- $slick-opacity-on-hover: 1 !default;
22
- $slick-opacity-not-active: 0.25 !default;
23
-
24
- @function slick-image-url($url) {
25
- @if function-exists(image-url) {
26
- @return image-url($url);
27
- }
28
- @else {
29
- @return url($slick-loader-path + $url);
30
- }
31
- }
32
-
33
- @function slick-font-url($url) {
34
- @if function-exists(font-url) {
35
- @return font-url($url);
36
- }
37
- @else {
38
- @return url($slick-font-path + $url);
39
- }
40
- }
41
-
42
- /* Slider */
43
-
44
- .slick-list {
45
- .slick-loading & {
46
- background: #fff slick-image-url("ajax-loader.gif") center center no-repeat;
47
- }
48
- }
49
-
50
- /* Icons */
51
- @if $slick-font-family == "slick" {
52
- @font-face {
53
- font-family: "slick";
54
- src: slick-font-url("slick.eot");
55
- src: slick-font-url("slick.eot?#iefix") format("embedded-opentype"), slick-font-url("slick.woff") format("woff"), slick-font-url("slick.ttf") format("truetype"), slick-font-url("slick.svg#slick") format("svg");
56
- font-weight: normal;
57
- font-style: normal;
58
- }
59
- }
60
-
61
- /* Arrows */
62
-
63
- .slick-prev,
64
- .slick-next {
65
- position: absolute;
66
- display: block;
67
- height: 20px;
68
- width: 20px;
69
- line-height: 0px;
70
- font-size: 0px;
71
- cursor: pointer;
72
- background: transparent;
73
- color: transparent;
74
- top: 50%;
75
- -webkit-transform: translate(0, -50%);
76
- -ms-transform: translate(0, -50%);
77
- transform: translate(0, -50%);
78
- padding: 0;
79
- border: none;
80
- outline: none;
81
- &:hover, &:focus {
82
- outline: none;
83
- background: transparent;
84
- color: transparent;
85
- &:before {
86
- opacity: $slick-opacity-on-hover;
87
- }
88
- }
89
- &.slick-disabled:before {
90
- opacity: $slick-opacity-not-active;
91
- }
92
- &:before {
93
- font-family: $slick-font-family;
94
- font-size: 20px;
95
- line-height: 1;
96
- color: $slick-arrow-color;
97
- opacity: $slick-opacity-default;
98
- -webkit-font-smoothing: antialiased;
99
- -moz-osx-font-smoothing: grayscale;
100
- }
101
- }
102
-
103
- .slick-prev {
104
- left: -25px;
105
- [dir="rtl"] & {
106
- left: auto;
107
- right: -25px;
108
- }
109
- &:before {
110
- content: $slick-prev-character;
111
- [dir="rtl"] & {
112
- content: $slick-next-character;
113
- }
114
- }
115
- }
116
-
117
- .slick-next {
118
- right: -25px;
119
- [dir="rtl"] & {
120
- left: -25px;
121
- right: auto;
122
- }
123
- &:before {
124
- content: $slick-next-character;
125
- [dir="rtl"] & {
126
- content: $slick-prev-character;
127
- }
128
- }
129
- }
130
-
131
- /* Dots */
132
-
133
- .slick-dotted.slick-slider {
134
- margin-bottom: 30px;
135
- }
136
-
137
- .slick-dots {
138
- position: absolute;
139
- bottom: -25px;
140
- list-style: none;
141
- display: block;
142
- text-align: center;
143
- padding: 0;
144
- margin: 0;
145
- width: 100%;
146
- li {
147
- position: relative;
148
- display: inline-block;
149
- height: 20px;
150
- width: 20px;
151
- margin: 0 5px;
152
- padding: 0;
153
- cursor: pointer;
154
- button {
155
- border: 0;
156
- background: transparent;
157
- display: block;
158
- height: 20px;
159
- width: 20px;
160
- outline: none;
161
- line-height: 0px;
162
- font-size: 0px;
163
- color: transparent;
164
- padding: 5px;
165
- cursor: pointer;
166
- &:hover, &:focus {
167
- outline: none;
168
- &:before {
169
- opacity: $slick-opacity-on-hover;
170
- }
171
- }
172
- &:before {
173
- position: absolute;
174
- top: 0;
175
- left: 0;
176
- content: $slick-dot-character;
177
- width: 20px;
178
- height: 20px;
179
- font-family: $slick-font-family;
180
- font-size: $slick-dot-size;
181
- line-height: 20px;
182
- text-align: center;
183
- color: $slick-dot-color;
184
- opacity: $slick-opacity-not-active;
185
- -webkit-font-smoothing: antialiased;
186
- -moz-osx-font-smoothing: grayscale;
187
- }
188
- }
189
- &.slick-active button:before {
190
- color: $slick-dot-color-active;
191
- opacity: $slick-opacity-default;
192
- }
193
- }
194
- }
1
+ @charset "UTF-8";
2
+
3
+ // Default Variables
4
+
5
+ // Slick icon entity codes outputs the following
6
+ // "\2190" outputs ascii character "←"
7
+ // "\2192" outputs ascii character "→"
8
+ // "\2022" outputs ascii character "•"
9
+
10
+ $slick-font-path: "./fonts/" !default;
11
+ $slick-font-family: "slick" !default;
12
+ $slick-loader-path: "./" !default;
13
+ $slick-arrow-color: white !default;
14
+ $slick-dot-color: black !default;
15
+ $slick-dot-color-active: $slick-dot-color !default;
16
+ $slick-prev-character: "\2190" !default;
17
+ $slick-next-character: "\2192" !default;
18
+ $slick-dot-character: "\2022" !default;
19
+ $slick-dot-size: 6px !default;
20
+ $slick-opacity-default: 0.75 !default;
21
+ $slick-opacity-on-hover: 1 !default;
22
+ $slick-opacity-not-active: 0.25 !default;
23
+
24
+ @function slick-image-url($url) {
25
+ @if function-exists(image-url) {
26
+ @return image-url($url);
27
+ }
28
+ @else {
29
+ @return url($slick-loader-path + $url);
30
+ }
31
+ }
32
+
33
+ @function slick-font-url($url) {
34
+ @if function-exists(font-url) {
35
+ @return font-url($url);
36
+ }
37
+ @else {
38
+ @return url($slick-font-path + $url);
39
+ }
40
+ }
41
+
42
+ /* Slider */
43
+
44
+ .slick-list {
45
+ .slick-loading & {
46
+ background: #fff slick-image-url("ajax-loader.gif") center center no-repeat;
47
+ }
48
+ }
49
+
50
+ /* Icons */
51
+ @if $slick-font-family == "slick" {
52
+ @font-face {
53
+ font-family: "slick";
54
+ src: slick-font-url("slick.eot");
55
+ src: slick-font-url("slick.eot?#iefix") format("embedded-opentype"), slick-font-url("slick.woff") format("woff"), slick-font-url("slick.ttf") format("truetype"), slick-font-url("slick.svg#slick") format("svg");
56
+ font-weight: normal;
57
+ font-style: normal;
58
+ }
59
+ }
60
+
61
+ /* Arrows */
62
+
63
+ .slick-prev,
64
+ .slick-next {
65
+ position: absolute;
66
+ display: block;
67
+ height: 20px;
68
+ width: 20px;
69
+ line-height: 0px;
70
+ font-size: 0px;
71
+ cursor: pointer;
72
+ background: transparent;
73
+ color: transparent;
74
+ top: 50%;
75
+ -webkit-transform: translate(0, -50%);
76
+ -ms-transform: translate(0, -50%);
77
+ transform: translate(0, -50%);
78
+ padding: 0;
79
+ border: none;
80
+ outline: none;
81
+ &:hover, &:focus {
82
+ outline: none;
83
+ background: transparent;
84
+ color: transparent;
85
+ &:before {
86
+ opacity: $slick-opacity-on-hover;
87
+ }
88
+ }
89
+ &.slick-disabled:before {
90
+ opacity: $slick-opacity-not-active;
91
+ }
92
+ &:before {
93
+ font-family: $slick-font-family;
94
+ font-size: 20px;
95
+ line-height: 1;
96
+ color: $slick-arrow-color;
97
+ opacity: $slick-opacity-default;
98
+ -webkit-font-smoothing: antialiased;
99
+ -moz-osx-font-smoothing: grayscale;
100
+ }
101
+ }
102
+
103
+ .slick-prev {
104
+ left: -25px;
105
+ [dir="rtl"] & {
106
+ left: auto;
107
+ right: -25px;
108
+ }
109
+ &:before {
110
+ content: $slick-prev-character;
111
+ [dir="rtl"] & {
112
+ content: $slick-next-character;
113
+ }
114
+ }
115
+ }
116
+
117
+ .slick-next {
118
+ right: -25px;
119
+ [dir="rtl"] & {
120
+ left: -25px;
121
+ right: auto;
122
+ }
123
+ &:before {
124
+ content: $slick-next-character;
125
+ [dir="rtl"] & {
126
+ content: $slick-prev-character;
127
+ }
128
+ }
129
+ }
130
+
131
+ /* Dots */
132
+
133
+ .slick-dotted.slick-slider {
134
+ margin-bottom: 30px;
135
+ }
136
+
137
+ .slick-dots {
138
+ position: absolute;
139
+ bottom: -25px;
140
+ list-style: none;
141
+ display: block;
142
+ text-align: center;
143
+ padding: 0;
144
+ margin: 0;
145
+ width: 100%;
146
+ li {
147
+ position: relative;
148
+ display: inline-block;
149
+ height: 20px;
150
+ width: 20px;
151
+ margin: 0 5px;
152
+ padding: 0;
153
+ cursor: pointer;
154
+ button {
155
+ border: 0;
156
+ background: transparent;
157
+ display: block;
158
+ height: 20px;
159
+ width: 20px;
160
+ outline: none;
161
+ line-height: 0px;
162
+ font-size: 0px;
163
+ color: transparent;
164
+ padding: 5px;
165
+ cursor: pointer;
166
+ &:hover, &:focus {
167
+ outline: none;
168
+ &:before {
169
+ opacity: $slick-opacity-on-hover;
170
+ }
171
+ }
172
+ &:before {
173
+ position: absolute;
174
+ top: 0;
175
+ left: 0;
176
+ content: $slick-dot-character;
177
+ width: 20px;
178
+ height: 20px;
179
+ font-family: $slick-font-family;
180
+ font-size: $slick-dot-size;
181
+ line-height: 20px;
182
+ text-align: center;
183
+ color: $slick-dot-color;
184
+ opacity: $slick-opacity-not-active;
185
+ -webkit-font-smoothing: antialiased;
186
+ -moz-osx-font-smoothing: grayscale;
187
+ }
188
+ }
189
+ &.slick-active button:before {
190
+ color: $slick-dot-color-active;
191
+ opacity: $slick-opacity-default;
192
+ }
193
+ }
194
+ }
assets/{js → lib}/slick/slick.css RENAMED
@@ -1,119 +1,119 @@
1
- /* Slider */
2
- .slick-slider
3
- {
4
- position: relative;
5
-
6
- display: block;
7
- box-sizing: border-box;
8
-
9
- -webkit-user-select: none;
10
- -moz-user-select: none;
11
- -ms-user-select: none;
12
- user-select: none;
13
-
14
- -webkit-touch-callout: none;
15
- -khtml-user-select: none;
16
- -ms-touch-action: pan-y;
17
- touch-action: pan-y;
18
- -webkit-tap-highlight-color: transparent;
19
- }
20
-
21
- .slick-list
22
- {
23
- position: relative;
24
-
25
- display: block;
26
- overflow: hidden;
27
-
28
- margin: 0;
29
- padding: 0;
30
- }
31
- .slick-list:focus
32
- {
33
- outline: none;
34
- }
35
- .slick-list.dragging
36
- {
37
- cursor: pointer;
38
- cursor: hand;
39
- }
40
-
41
- .slick-slider .slick-track,
42
- .slick-slider .slick-list
43
- {
44
- -webkit-transform: translate3d(0, 0, 0);
45
- -moz-transform: translate3d(0, 0, 0);
46
- -ms-transform: translate3d(0, 0, 0);
47
- -o-transform: translate3d(0, 0, 0);
48
- transform: translate3d(0, 0, 0);
49
- }
50
-
51
- .slick-track
52
- {
53
- position: relative;
54
- top: 0;
55
- left: 0;
56
-
57
- display: block;
58
- margin-left: auto;
59
- margin-right: auto;
60
- }
61
- .slick-track:before,
62
- .slick-track:after
63
- {
64
- display: table;
65
-
66
- content: '';
67
- }
68
- .slick-track:after
69
- {
70
- clear: both;
71
- }
72
- .slick-loading .slick-track
73
- {
74
- visibility: hidden;
75
- }
76
-
77
- .slick-slide
78
- {
79
- display: none;
80
- float: left;
81
-
82
- height: 100%;
83
- min-height: 1px;
84
- }
85
- [dir='rtl'] .slick-slide
86
- {
87
- float: right;
88
- }
89
- .slick-slide img
90
- {
91
- display: block;
92
- }
93
- .slick-slide.slick-loading img
94
- {
95
- display: none;
96
- }
97
- .slick-slide.dragging img
98
- {
99
- pointer-events: none;
100
- }
101
- .slick-initialized .slick-slide
102
- {
103
- display: block;
104
- }
105
- .slick-loading .slick-slide
106
- {
107
- visibility: hidden;
108
- }
109
- .slick-vertical .slick-slide
110
- {
111
- display: block;
112
-
113
- height: auto;
114
-
115
- border: 1px solid transparent;
116
- }
117
- .slick-arrow.slick-hidden {
118
- display: none;
119
- }
1
+ /* Slider */
2
+ .slick-slider
3
+ {
4
+ position: relative;
5
+
6
+ display: block;
7
+ box-sizing: border-box;
8
+
9
+ -webkit-user-select: none;
10
+ -moz-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+
14
+ -webkit-touch-callout: none;
15
+ -khtml-user-select: none;
16
+ -ms-touch-action: pan-y;
17
+ touch-action: pan-y;
18
+ -webkit-tap-highlight-color: transparent;
19
+ }
20
+
21
+ .slick-list
22
+ {
23
+ position: relative;
24
+
25
+ display: block;
26
+ overflow: hidden;
27
+
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+ .slick-list:focus
32
+ {
33
+ outline: none;
34
+ }
35
+ .slick-list.dragging
36
+ {
37
+ cursor: pointer;
38
+ cursor: hand;
39
+ }
40
+
41
+ .slick-slider .slick-track,
42
+ .slick-slider .slick-list
43
+ {
44
+ -webkit-transform: translate3d(0, 0, 0);
45
+ -moz-transform: translate3d(0, 0, 0);
46
+ -ms-transform: translate3d(0, 0, 0);
47
+ -o-transform: translate3d(0, 0, 0);
48
+ transform: translate3d(0, 0, 0);
49
+ }
50
+
51
+ .slick-track
52
+ {
53
+ position: relative;
54
+ top: 0;
55
+ left: 0;
56
+
57
+ display: block;
58
+ margin-left: auto;
59
+ margin-right: auto;
60
+ }
61
+ .slick-track:before,
62
+ .slick-track:after
63
+ {
64
+ display: table;
65
+
66
+ content: '';
67
+ }
68
+ .slick-track:after
69
+ {
70
+ clear: both;
71
+ }
72
+ .slick-loading .slick-track
73
+ {
74
+ visibility: hidden;
75
+ }
76
+
77
+ .slick-slide
78
+ {
79
+ display: none;
80
+ float: left;
81
+
82
+ height: 100%;
83
+ min-height: 1px;
84
+ }
85
+ [dir='rtl'] .slick-slide
86
+ {
87
+ float: right;
88
+ }
89
+ .slick-slide img
90
+ {
91
+ display: block;
92
+ }
93
+ .slick-slide.slick-loading img
94
+ {
95
+ display: none;
96
+ }
97
+ .slick-slide.dragging img
98
+ {
99
+ pointer-events: none;
100
+ }
101
+ .slick-initialized .slick-slide
102
+ {
103
+ display: block;
104
+ }
105
+ .slick-loading .slick-slide
106
+ {
107
+ visibility: hidden;
108
+ }
109
+ .slick-vertical .slick-slide
110
+ {
111
+ display: block;
112
+
113
+ height: auto;
114
+
115
+ border: 1px solid transparent;
116
+ }
117
+ .slick-arrow.slick-hidden {
118
+ display: none;
119
+ }
assets/{js → lib}/slick/slick.js RENAMED
@@ -1,3004 +1,3004 @@
1
- /*
2
- _ _ _ _
3
- ___| (_) ___| | __ (_)___
4
- / __| | |/ __| |/ / | / __|
5
- \__ \ | | (__| < _ | \__ \
6
- |___/_|_|\___|_|\_(_)/ |___/
7
- |__/
8
-
9
- Version: 1.8.0
10
- Author: Ken Wheeler
11
- Website: http://kenwheeler.github.io
12
- Docs: http://kenwheeler.github.io/slick
13
- Repo: http://github.com/kenwheeler/slick
14
- Issues: http://github.com/kenwheeler/slick/issues
15
-
16
- */
17
- /* global window, document, define, jQuery, setInterval, clearInterval */
18
- ;(function(factory) {
19
- 'use strict';
20
- if (typeof define === 'function' && define.amd) {
21
- define(['jquery'], factory);
22
- } else if (typeof exports !== 'undefined') {
23
- module.exports = factory(require('jquery'));
24
- } else {
25
- factory(jQuery);
26
- }
27
-
28
- }(function($) {
29
- 'use strict';
30
- var Slick = window.Slick || {};
31
-
32
- Slick = (function() {
33
-
34
- var instanceUid = 0;
35
-
36
- function Slick(element, settings) {
37
-
38
- var _ = this, dataSettings;
39
-
40
- _.defaults = {
41
- accessibility: true,
42
- adaptiveHeight: false,
43
- appendArrows: $(element),
44
- appendDots: $(element),
45
- arrows: true,
46
- asNavFor: null,
47
- prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',
48
- nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>',
49
- autoplay: false,
50
- autoplaySpeed: 3000,
51
- centerMode: false,
52
- centerPadding: '50px',
53
- cssEase: 'ease',
54
- customPaging: function(slider, i) {
55
- return $('<button type="button" />').text(i + 1);
56
- },
57
- dots: false,
58
- dotsClass: 'slick-dots',
59
- draggable: true,
60
- easing: 'linear',
61
- edgeFriction: 0.35,
62
- fade: false,
63
- focusOnSelect: false,
64
- focusOnChange: false,
65
- infinite: true,
66
- initialSlide: 0,
67
- lazyLoad: 'ondemand',
68
- mobileFirst: false,
69
- pauseOnHover: true,
70
- pauseOnFocus: true,
71
- pauseOnDotsHover: false,
72
- respondTo: 'window',
73
- responsive: null,
74
- rows: 1,
75
- rtl: false,
76
- slide: '',
77
- slidesPerRow: 1,
78
- slidesToShow: 1,
79
- slidesToScroll: 1,
80
- speed: 500,
81
- swipe: true,
82
- swipeToSlide: false,
83
- touchMove: true,
84
- touchThreshold: 5,
85
- useCSS: true,
86
- useTransform: true,
87
- variableWidth: false,
88
- vertical: false,
89
- verticalSwiping: false,
90
- waitForAnimate: true,
91
- zIndex: 1000
92
- };
93
-
94
- _.initials = {
95
- animating: false,
96
- dragging: false,
97
- autoPlayTimer: null,
98
- currentDirection: 0,
99
- currentLeft: null,
100
- currentSlide: 0,
101
- direction: 1,
102
- $dots: null,
103
- listWidth: null,
104
- listHeight: null,
105
- loadIndex: 0,
106
- $nextArrow: null,
107
- $prevArrow: null,
108
- scrolling: false,
109
- slideCount: null,
110
- slideWidth: null,
111
- $slideTrack: null,
112
- $slides: null,
113
- sliding: false,
114
- slideOffset: 0,
115
- swipeLeft: null,
116
- swiping: false,
117
- $list: null,
118
- touchObject: {},
119
- transformsEnabled: false,
120
- unslicked: false
121
- };
122
-
123
- $.extend(_, _.initials);
124
-
125
- _.activeBreakpoint = null;
126
- _.animType = null;
127
- _.animProp = null;
128
- _.breakpoints = [];
129
- _.breakpointSettings = [];
130
- _.cssTransitions = false;
131
- _.focussed = false;
132
- _.interrupted = false;
133
- _.hidden = 'hidden';
134
- _.paused = true;
135
- _.positionProp = null;
136
- _.respondTo = null;
137
- _.rowCount = 1;
138
- _.shouldClick = true;
139
- _.$slider = $(element);
140
- _.$slidesCache = null;
141
- _.transformType = null;
142
- _.transitionType = null;
143
- _.visibilityChange = 'visibilitychange';
144
- _.windowWidth = 0;
145
- _.windowTimer = null;
146
-
147
- dataSettings = $(element).data('slick') || {};
148
-
149
- _.options = $.extend({}, _.defaults, settings, dataSettings);
150
-
151
- _.currentSlide = _.options.initialSlide;
152
-
153
- _.originalSettings = _.options;
154
-
155
- if (typeof document.mozHidden !== 'undefined') {
156
- _.hidden = 'mozHidden';
157
- _.visibilityChange = 'mozvisibilitychange';
158
- } else if (typeof document.webkitHidden !== 'undefined') {
159
- _.hidden = 'webkitHidden';
160
- _.visibilityChange = 'webkitvisibilitychange';
161
- }
162
-
163
- _.autoPlay = $.proxy(_.autoPlay, _);
164
- _.autoPlayClear = $.proxy(_.autoPlayClear, _);
165
- _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
166
- _.changeSlide = $.proxy(_.changeSlide, _);
167
- _.clickHandler = $.proxy(_.clickHandler, _);
168
- _.selectHandler = $.proxy(_.selectHandler, _);
169
- _.setPosition = $.proxy(_.setPosition, _);
170
- _.swipeHandler = $.proxy(_.swipeHandler, _);
171
- _.dragHandler = $.proxy(_.dragHandler, _);
172
- _.keyHandler = $.proxy(_.keyHandler, _);
173
-
174
- _.instanceUid = instanceUid++;
175
-
176
- // A simple way to check for HTML strings
177
- // Strict HTML recognition (must start with <)
178
- // Extracted from jQuery v1.11 source
179
- _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
180
-
181
-
182
- _.registerBreakpoints();
183
- _.init(true);
184
-
185
- }
186
-
187
- return Slick;
188
-
189
- }());
190
-
191
- Slick.prototype.activateADA = function() {
192
- var _ = this;
193
-
194
- _.$slideTrack.find('.slick-active').attr({
195
- 'aria-hidden': 'false'
196
- }).find('a, input, button, select').attr({
197
- 'tabindex': '0'
198
- });
199
-
200
- };
201
-
202
- Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
203
-
204
- var _ = this;
205
-
206
- if (typeof(index) === 'boolean') {
207
- addBefore = index;
208
- index = null;
209
- } else if (index < 0 || (index >= _.slideCount)) {
210
- return false;
211
- }
212
-
213
- _.unload();
214
-
215
- if (typeof(index) === 'number') {
216
- if (index === 0 && _.$slides.length === 0) {
217
- $(markup).appendTo(_.$slideTrack);
218
- } else if (addBefore) {
219
- $(markup).insertBefore(_.$slides.eq(index));
220
- } else {
221
- $(markup).insertAfter(_.$slides.eq(index));
222
- }
223
- } else {
224
- if (addBefore === true) {
225
- $(markup).prependTo(_.$slideTrack);
226
- } else {
227
- $(markup).appendTo(_.$slideTrack);
228
- }
229
- }
230
-
231
- _.$slides = _.$slideTrack.children(this.options.slide);
232
-
233
- _.$slideTrack.children(this.options.slide).detach();
234
-
235
- _.$slideTrack.append(_.$slides);
236
-
237
- _.$slides.each(function(index, element) {
238
- $(element).attr('data-slick-index', index);
239
- });
240
-
241
- _.$slidesCache = _.$slides;
242
-
243
- _.reinit();
244
-
245
- };
246
-
247
- Slick.prototype.animateHeight = function() {
248
- var _ = this;
249
- if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
250
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
251
- _.$list.animate({
252
- height: targetHeight
253
- }, _.options.speed);
254
- }
255
- };
256
-
257
- Slick.prototype.animateSlide = function(targetLeft, callback) {
258
-
259
- var animProps = {},
260
- _ = this;
261
-
262
- _.animateHeight();
263
-
264
- if (_.options.rtl === true && _.options.vertical === false) {
265
- targetLeft = -targetLeft;
266
- }
267
- if (_.transformsEnabled === false) {
268
- if (_.options.vertical === false) {
269
- _.$slideTrack.animate({
270
- left: targetLeft
271
- }, _.options.speed, _.options.easing, callback);
272
- } else {
273
- _.$slideTrack.animate({
274
- top: targetLeft
275
- }, _.options.speed, _.options.easing, callback);
276
- }
277
-
278
- } else {
279
-
280
- if (_.cssTransitions === false) {
281
- if (_.options.rtl === true) {
282
- _.currentLeft = -(_.currentLeft);
283
- }
284
- $({
285
- animStart: _.currentLeft
286
- }).animate({
287
- animStart: targetLeft
288
- }, {
289
- duration: _.options.speed,
290
- easing: _.options.easing,
291
- step: function(now) {
292
- now = Math.ceil(now);
293
- if (_.options.vertical === false) {
294
- animProps[_.animType] = 'translate(' +
295
- now + 'px, 0px)';
296
- _.$slideTrack.css(animProps);
297
- } else {
298
- animProps[_.animType] = 'translate(0px,' +
299
- now + 'px)';
300
- _.$slideTrack.css(animProps);
301
- }
302
- },
303
- complete: function() {
304
- if (callback) {
305
- callback.call();
306
- }
307
- }
308
- });
309
-
310
- } else {
311
-
312
- _.applyTransition();
313
- targetLeft = Math.ceil(targetLeft);
314
-
315
- if (_.options.vertical === false) {
316
- animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
317
- } else {
318
- animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
319
- }
320
- _.$slideTrack.css(animProps);
321
-
322
- if (callback) {
323
- setTimeout(function() {
324
-
325
- _.disableTransition();
326
-
327
- callback.call();
328
- }, _.options.speed);
329
- }
330
-
331
- }
332
-
333
- }
334
-
335
- };
336
-
337
- Slick.prototype.getNavTarget = function() {
338
-
339
- var _ = this,
340
- asNavFor = _.options.asNavFor;
341
-
342
- if ( asNavFor && asNavFor !== null ) {
343
- asNavFor = $(asNavFor).not(_.$slider);
344
- }
345
-
346
- return asNavFor;
347
-
348
- };
349
-
350
- Slick.prototype.asNavFor = function(index) {
351
-
352
- var _ = this,
353
- asNavFor = _.getNavTarget();
354
-
355
- if ( asNavFor !== null && typeof asNavFor === 'object' ) {
356
- asNavFor.each(function() {
357
- var target = $(this).slick('getSlick');
358
- if(!target.unslicked) {
359
- target.slideHandler(index, true);
360
- }
361
- });
362
- }
363
-
364
- };
365
-
366
- Slick.prototype.applyTransition = function(slide) {
367
-
368
- var _ = this,
369
- transition = {};
370
-
371
- if (_.options.fade === false) {
372
- transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
373
- } else {
374
- transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
375
- }
376
-
377
- if (_.options.fade === false) {
378
- _.$slideTrack.css(transition);
379
- } else {
380
- _.$slides.eq(slide).css(transition);
381
- }
382
-
383
- };
384
-
385
- Slick.prototype.autoPlay = function() {
386
-
387
- var _ = this;
388
-
389
- _.autoPlayClear();
390
-
391
- if ( _.slideCount > _.options.slidesToShow ) {
392
- _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
393
- }
394
-
395
- };
396
-
397
- Slick.prototype.autoPlayClear = function() {
398
-
399
- var _ = this;
400
-
401
- if (_.autoPlayTimer) {
402
- clearInterval(_.autoPlayTimer);
403
- }
404
-
405
- };
406
-
407
- Slick.prototype.autoPlayIterator = function() {
408
-
409
- var _ = this,
410
- slideTo = _.currentSlide + _.options.slidesToScroll;
411
-
412
- if ( !_.paused && !_.interrupted && !_.focussed ) {
413
-
414
- if ( _.options.infinite === false ) {
415
-
416
- if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
417
- _.direction = 0;
418
- }
419
-
420
- else if ( _.direction === 0 ) {
421
-
422
- slideTo = _.currentSlide - _.options.slidesToScroll;
423
-
424
- if ( _.currentSlide - 1 === 0 ) {
425
- _.direction = 1;
426
- }
427
-
428
- }
429
-
430
- }
431
-
432
- _.slideHandler( slideTo );
433
-
434
- }
435
-
436
- };
437
-
438
- Slick.prototype.buildArrows = function() {
439
-
440
- var _ = this;
441
-
442
- if (_.options.arrows === true ) {
443
-
444
- _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
445
- _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
446
-
447
- if( _.slideCount > _.options.slidesToShow ) {
448
-
449
- _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
450
- _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
451
-
452
- if (_.htmlExpr.test(_.options.prevArrow)) {
453
- _.$prevArrow.prependTo(_.options.appendArrows);
454
- }
455
-
456
- if (_.htmlExpr.test(_.options.nextArrow)) {
457
- _.$nextArrow.appendTo(_.options.appendArrows);
458
- }
459
-
460
- if (_.options.infinite !== true) {
461
- _.$prevArrow
462
- .addClass('slick-disabled')
463
- .attr('aria-disabled', 'true');
464
- }
465
-
466
- } else {
467
-
468
- _.$prevArrow.add( _.$nextArrow )
469
-
470
- .addClass('slick-hidden')
471
- .attr({
472
- 'aria-disabled': 'true',
473
- 'tabindex': '-1'
474
- });
475
-
476
- }
477
-
478
- }
479
-
480
- };
481
-
482
- Slick.prototype.buildDots = function() {
483
-
484
- var _ = this,
485
- i, dot;
486
-
487
- if (_.options.dots === true) {
488
-
489
- _.$slider.addClass('slick-dotted');
490
-
491
- dot = $('<ul />').addClass(_.options.dotsClass);
492
-
493
- for (i = 0; i <= _.getDotCount(); i += 1) {
494
- dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
495
- }
496
-
497
- _.$dots = dot.appendTo(_.options.appendDots);
498
-
499
- _.$dots.find('li').first().addClass('slick-active');
500
-
501
- }
502
-
503
- };
504
-
505
- Slick.prototype.buildOut = function() {
506
-
507
- var _ = this;
508
-
509
- _.$slides =
510
- _.$slider
511
- .children( _.options.slide + ':not(.slick-cloned)')
512
- .addClass('slick-slide');
513
-
514
- _.slideCount = _.$slides.length;
515
-
516
- _.$slides.each(function(index, element) {
517
- $(element)
518
- .attr('data-slick-index', index)
519
- .data('originalStyling', $(element).attr('style') || '');
520
- });
521
-
522
- _.$slider.addClass('slick-slider');
523
-
524
- _.$slideTrack = (_.slideCount === 0) ?
525
- $('<div class="slick-track"/>').appendTo(_.$slider) :
526
- _.$slides.wrapAll('<div class="slick-track"/>').parent();
527
-
528
- _.$list = _.$slideTrack.wrap(
529
- '<div class="slick-list"/>').parent();
530
- _.$slideTrack.css('opacity', 0);
531
-
532
- if (_.options.centerMode === true || _.options.swipeToSlide === true) {
533
- _.options.slidesToScroll = 1;
534
- }
535
-
536
- $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
537
-
538
- _.setupInfinite();
539
-
540
- _.buildArrows();
541
-
542
- _.buildDots();
543
-
544
- _.updateDots();
545
-
546
-
547
- _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
548
-
549
- if (_.options.draggable === true) {
550
- _.$list.addClass('draggable');
551
- }
552
-
553
- };
554
-
555
- Slick.prototype.buildRows = function() {
556
-
557
- var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
558
-
559
- newSlides = document.createDocumentFragment();
560
- originalSlides = _.$slider.children();
561
-
562
- if(_.options.rows > 1) {
563
-
564
- slidesPerSection = _.options.slidesPerRow * _.options.rows;
565
- numOfSlides = Math.ceil(
566
- originalSlides.length / slidesPerSection
567
- );
568
-
569
- for(a = 0; a < numOfSlides; a++){
570
- var slide = document.createElement('div');
571
- for(b = 0; b < _.options.rows; b++) {
572
- var row = document.createElement('div');
573
- for(c = 0; c < _.options.slidesPerRow; c++) {
574
- var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
575
- if (originalSlides.get(target)) {
576
- row.appendChild(originalSlides.get(target));
577
- }
578
- }
579
- slide.appendChild(row);
580
- }
581
- newSlides.appendChild(slide);
582
- }
583
-
584
- _.$slider.empty().append(newSlides);
585
- _.$slider.children().children().children()
586
- .css({
587
- 'width':(100 / _.options.slidesPerRow) + '%',
588
- 'display': 'inline-block'
589
- });
590
-
591
- }
592
-
593
- };
594
-
595
- Slick.prototype.checkResponsive = function(initial, forceUpdate) {
596
-
597
- var _ = this,
598
- breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
599
- var sliderWidth = _.$slider.width();
600
- var windowWidth = window.innerWidth || $(window).width();
601
-
602
- if (_.respondTo === 'window') {
603
- respondToWidth = windowWidth;
604
- } else if (_.respondTo === 'slider') {
605
- respondToWidth = sliderWidth;
606
- } else if (_.respondTo === 'min') {
607
- respondToWidth = Math.min(windowWidth, sliderWidth);
608
- }
609
-
610
- if ( _.options.responsive &&
611
- _.options.responsive.length &&
612
- _.options.responsive !== null) {
613
-
614
- targetBreakpoint = null;
615
-
616
- for (breakpoint in _.breakpoints) {
617
- if (_.breakpoints.hasOwnProperty(breakpoint)) {
618
- if (_.originalSettings.mobileFirst === false) {
619
- if (respondToWidth < _.breakpoints[breakpoint]) {
620
- targetBreakpoint = _.breakpoints[breakpoint];
621
- }
622
- } else {
623
- if (respondToWidth > _.breakpoints[breakpoint]) {
624
- targetBreakpoint = _.breakpoints[breakpoint];
625
- }
626
- }
627
- }
628
- }
629
-
630
- if (targetBreakpoint !== null) {
631
- if (_.activeBreakpoint !== null) {
632
- if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
633
- _.activeBreakpoint =
634
- targetBreakpoint;
635
- if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
636
- _.unslick(targetBreakpoint);
637
- } else {
638
- _.options = $.extend({}, _.originalSettings,
639
- _.breakpointSettings[
640
- targetBreakpoint]);
641
- if (initial === true) {
642
- _.currentSlide = _.options.initialSlide;
643
- }
644
- _.refresh(initial);
645
- }
646
- triggerBreakpoint = targetBreakpoint;
647
- }
648
- } else {
649
- _.activeBreakpoint = targetBreakpoint;
650
- if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
651
- _.unslick(targetBreakpoint);
652
- } else {
653
- _.options = $.extend({}, _.originalSettings,
654
- _.breakpointSettings[
655
- targetBreakpoint]);
656
- if (initial === true) {
657
- _.currentSlide = _.options.initialSlide;
658
- }
659
- _.refresh(initial);
660
- }
661
- triggerBreakpoint = targetBreakpoint;
662
- }
663
- } else {
664
- if (_.activeBreakpoint !== null) {
665
- _.activeBreakpoint = null;
666
- _.options = _.originalSettings;
667
- if (initial === true) {
668
- _.currentSlide = _.options.initialSlide;
669
- }
670
- _.refresh(initial);
671
- triggerBreakpoint = targetBreakpoint;
672
- }
673
- }
674
-
675
- // only trigger breakpoints during an actual break. not on initialize.
676
- if( !initial && triggerBreakpoint !== false ) {
677
- _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
678
- }
679
- }
680
-
681
- };
682
-
683
- Slick.prototype.changeSlide = function(event, dontAnimate) {
684
-
685
- var _ = this,
686
- $target = $(event.currentTarget),
687
- indexOffset, slideOffset, unevenOffset;
688
-
689
- // If target is a link, prevent default action.
690
- if($target.is('a')) {
691
- event.preventDefault();
692
- }
693
-
694
- // If target is not the <li> element (ie: a child), find the <li>.
695
- if(!$target.is('li')) {
696
- $target = $target.closest('li');
697
- }
698
-
699
- unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
700
- indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
701
-
702
- switch (event.data.message) {
703
-
704
- case 'previous':
705
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
706
- if (_.slideCount > _.options.slidesToShow) {
707
- _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
708
- }
709
- break;
710
-
711
- case 'next':
712
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
713
- if (_.slideCount > _.options.slidesToShow) {
714
- _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
715
- }
716
- break;
717
-
718
- case 'index':
719
- var index = event.data.index === 0 ? 0 :
720
- event.data.index || $target.index() * _.options.slidesToScroll;
721
-
722
- _.slideHandler(_.checkNavigable(index), false, dontAnimate);
723
- $target.children().trigger('focus');
724
- break;
725
-
726
- default:
727
- return;
728
- }
729
-
730
- };
731
-
732
- Slick.prototype.checkNavigable = function(index) {
733
-
734
- var _ = this,
735
- navigables, prevNavigable;
736
-
737
- navigables = _.getNavigableIndexes();
738
- prevNavigable = 0;
739
- if (index > navigables[navigables.length - 1]) {
740
- index = navigables[navigables.length - 1];
741
- } else {
742
- for (var n in navigables) {
743
- if (index < navigables[n]) {
744
- index = prevNavigable;
745
- break;
746
- }
747
- prevNavigable = navigables[n];
748
- }
749
- }
750
-
751
- return index;
752
- };
753
-
754
- Slick.prototype.cleanUpEvents = function() {
755
-
756
- var _ = this;
757
-
758
- if (_.options.dots && _.$dots !== null) {
759
-
760
- $('li', _.$dots)
761
- .off('click.slick', _.changeSlide)
762
- .off('mouseenter.slick', $.proxy(_.interrupt, _, true))
763
- .off('mouseleave.slick', $.proxy(_.interrupt, _, false));
764
-
765
- if (_.options.accessibility === true) {
766
- _.$dots.off('keydown.slick', _.keyHandler);
767
- }
768
- }
769
-
770
- _.$slider.off('focus.slick blur.slick');
771
-
772
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
773
- _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
774
- _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
775
-
776
- if (_.options.accessibility === true) {
777
- _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler);
778
- _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler);
779
- }
780
- }
781
-
782
- _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
783
- _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
784
- _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
785
- _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
786
-
787
- _.$list.off('click.slick', _.clickHandler);
788
-
789
- $(document).off(_.visibilityChange, _.visibility);
790
-
791
- _.cleanUpSlideEvents();
792
-
793
- if (_.options.accessibility === true) {
794
- _.$list.off('keydown.slick', _.keyHandler);
795
- }
796
-
797
- if (_.options.focusOnSelect === true) {
798
- $(_.$slideTrack).children().off('click.slick', _.selectHandler);
799
- }
800
-
801
- $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
802
-
803
- $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
804
-
805
- $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
806
-
807
- $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
808
-
809
- };
810
-
811
- Slick.prototype.cleanUpSlideEvents = function() {
812
-
813
- var _ = this;
814
-
815
- _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
816
- _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
817
-
818
- };
819
-
820
- Slick.prototype.cleanUpRows = function() {
821
-
822
- var _ = this, originalSlides;
823
-
824
- if(_.options.rows > 1) {
825
- originalSlides = _.$slides.children().children();
826
- originalSlides.removeAttr('style');
827
- _.$slider.empty().append(originalSlides);
828
- }
829
-
830
- };
831
-
832
- Slick.prototype.clickHandler = function(event) {
833
-
834
- var _ = this;
835
-
836
- if (_.shouldClick === false) {
837
- event.stopImmediatePropagation();
838
- event.stopPropagation();
839
- event.preventDefault();
840
- }
841
-
842
- };
843
-
844
- Slick.prototype.destroy = function(refresh) {
845
-
846
- var _ = this;
847
-
848
- _.autoPlayClear();
849
-
850
- _.touchObject = {};
851
-
852
- _.cleanUpEvents();
853
-
854
- $('.slick-cloned', _.$slider).detach();
855
-
856
- if (_.$dots) {
857
- _.$dots.remove();
858
- }
859
-
860
- if ( _.$prevArrow && _.$prevArrow.length ) {
861
-
862
- _.$prevArrow
863
- .removeClass('slick-disabled slick-arrow slick-hidden')
864
- .removeAttr('aria-hidden aria-disabled tabindex')
865
- .css('display','');
866
-
867
- if ( _.htmlExpr.test( _.options.prevArrow )) {
868
- _.$prevArrow.remove();
869
- }
870
- }
871
-
872
- if ( _.$nextArrow && _.$nextArrow.length ) {
873
-
874
- _.$nextArrow
875
- .removeClass('slick-disabled slick-arrow slick-hidden')
876
- .removeAttr('aria-hidden aria-disabled tabindex')
877
- .css('display','');
878
-
879
- if ( _.htmlExpr.test( _.options.nextArrow )) {
880
- _.$nextArrow.remove();
881
- }
882
- }
883
-
884
-
885
- if (_.$slides) {
886
-
887
- _.$slides
888
- .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
889
- .removeAttr('aria-hidden')
890
- .removeAttr('data-slick-index')
891
- .each(function(){
892
- $(this).attr('style', $(this).data('originalStyling'));
893
- });
894
-
895
- _.$slideTrack.children(this.options.slide).detach();
896
-
897
- _.$slideTrack.detach();
898
-
899
- _.$list.detach();
900
-
901
- _.$slider.append(_.$slides);
902
- }
903
-
904
- _.cleanUpRows();
905
-
906
- _.$slider.removeClass('slick-slider');
907
- _.$slider.removeClass('slick-initialized');
908
- _.$slider.removeClass('slick-dotted');
909
-
910
- _.unslicked = true;
911
-
912
- if(!refresh) {
913
- _.$slider.trigger('destroy', [_]);
914
- }
915
-
916
- };
917
-
918
- Slick.prototype.disableTransition = function(slide) {
919
-
920
- var _ = this,
921
- transition = {};
922
-
923
- transition[_.transitionType] = '';
924
-
925
- if (_.options.fade === false) {
926
- _.$slideTrack.css(transition);
927
- } else {
928
- _.$slides.eq(slide).css(transition);
929
- }
930
-
931
- };
932
-
933
- Slick.prototype.fadeSlide = function(slideIndex, callback) {
934
-
935
- var _ = this;
936
-
937
- if (_.cssTransitions === false) {
938
-
939
- _.$slides.eq(slideIndex).css({
940
- zIndex: _.options.zIndex
941
- });
942
-
943
- _.$slides.eq(slideIndex).animate({
944
- opacity: 1
945
- }, _.options.speed, _.options.easing, callback);
946
-
947
- } else {
948
-
949
- _.applyTransition(slideIndex);
950
-
951
- _.$slides.eq(slideIndex).css({
952
- opacity: 1,
953
- zIndex: _.options.zIndex
954
- });
955
-
956
- if (callback) {
957
- setTimeout(function() {
958
-
959
- _.disableTransition(slideIndex);
960
-
961
- callback.call();
962
- }, _.options.speed);
963
- }
964
-
965
- }
966
-
967
- };
968
-
969
- Slick.prototype.fadeSlideOut = function(slideIndex) {
970
-
971
- var _ = this;
972
-
973
- if (_.cssTransitions === false) {
974
-
975
- _.$slides.eq(slideIndex).animate({
976
- opacity: 0,
977
- zIndex: _.options.zIndex - 2
978
- }, _.options.speed, _.options.easing);
979
-
980
- } else {
981
-
982
- _.applyTransition(slideIndex);
983
-
984
- _.$slides.eq(slideIndex).css({
985
- opacity: 0,
986
- zIndex: _.options.zIndex - 2
987
- });
988
-
989
- }
990
-
991
- };
992
-
993
- Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
994
-
995
- var _ = this;
996
-
997
- if (filter !== null) {
998
-
999
- _.$slidesCache = _.$slides;
1000
-
1001
- _.unload();
1002
-
1003
- _.$slideTrack.children(this.options.slide).detach();
1004
-
1005
- _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
1006
-
1007
- _.reinit();
1008
-
1009
- }
1010
-
1011
- };
1012
-
1013
- Slick.prototype.focusHandler = function() {
1014
-
1015
- var _ = this;
1016
-
1017
- _.$slider
1018
- .off('focus.slick blur.slick')
1019
- .on('focus.slick blur.slick', '*', function(event) {
1020
-
1021
- event.stopImmediatePropagation();
1022
- var $sf = $(this);
1023
-
1024
- setTimeout(function() {
1025
-
1026
- if( _.options.pauseOnFocus ) {
1027
- _.focussed = $sf.is(':focus');
1028
- _.autoPlay();
1029
- }
1030
-
1031
- }, 0);
1032
-
1033
- });
1034
- };
1035
-
1036
- Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
1037
-
1038
- var _ = this;
1039
- return _.currentSlide;
1040
-
1041
- };
1042
-
1043
- Slick.prototype.getDotCount = function() {
1044
-
1045
- var _ = this;
1046
-
1047
- var breakPoint = 0;
1048
- var counter = 0;
1049
- var pagerQty = 0;
1050
-
1051
- if (_.options.infinite === true) {
1052
- if (_.slideCount <= _.options.slidesToShow) {
1053
- ++pagerQty;
1054
- } else {
1055
- while (breakPoint < _.slideCount) {
1056
- ++pagerQty;
1057
- breakPoint = counter + _.options.slidesToScroll;
1058
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1059
- }
1060
- }
1061
- } else if (_.options.centerMode === true) {
1062
- pagerQty = _.slideCount;
1063
- } else if(!_.options.asNavFor) {
1064
- pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
1065
- }else {
1066
- while (breakPoint < _.slideCount) {
1067
- ++pagerQty;
1068
- breakPoint = counter + _.options.slidesToScroll;
1069
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1070
- }
1071
- }
1072
-
1073
- return pagerQty - 1;
1074
-
1075
- };
1076
-
1077
- Slick.prototype.getLeft = function(slideIndex) {
1078
-
1079
- var _ = this,
1080
- targetLeft,
1081
- verticalHeight,
1082
- verticalOffset = 0,
1083
- targetSlide,
1084
- coef;
1085
-
1086
- _.slideOffset = 0;
1087
- verticalHeight = _.$slides.first().outerHeight(true);
1088
-
1089
- if (_.options.infinite === true) {
1090
- if (_.slideCount > _.options.slidesToShow) {
1091
- _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
1092
- coef = -1
1093
-
1094
- if (_.options.vertical === true && _.options.centerMode === true) {
1095
- if (_.options.slidesToShow === 2) {
1096
- coef = -1.5;
1097
- } else if (_.options.slidesToShow === 1) {
1098
- coef = -2
1099
- }
1100
- }
1101
- verticalOffset = (verticalHeight * _.options.slidesToShow) * coef;
1102
- }
1103
- if (_.slideCount % _.options.slidesToScroll !== 0) {
1104
- if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
1105
- if (slideIndex > _.slideCount) {
1106
- _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
1107
- verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
1108
- } else {
1109
- _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
1110
- verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
1111
- }
1112
- }
1113
- }
1114
- } else {
1115
- if (slideIndex + _.options.slidesToShow > _.slideCount) {
1116
- _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
1117
- verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
1118
- }
1119
- }
1120
-
1121
- if (_.slideCount <= _.options.slidesToShow) {
1122
- _.slideOffset = 0;
1123
- verticalOffset = 0;
1124
- }
1125
-
1126
- if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) {
1127
- _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
1128
- } else if (_.options.centerMode === true && _.options.infinite === true) {
1129
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1130
- } else if (_.options.centerMode === true) {
1131
- _.slideOffset = 0;
1132
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1133
- }
1134
-
1135
- if (_.options.vertical === false) {
1136
- targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
1137
- } else {
1138
- targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
1139
- }
1140
-
1141
- if (_.options.variableWidth === true) {
1142
-
1143
- if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1144
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1145
- } else {
1146
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
1147
- }
1148
-
1149
- if (_.options.rtl === true) {
1150
- if (targetSlide[0]) {
1151
- targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1152
- } else {
1153
- targetLeft = 0;
1154
- }
1155
- } else {
1156
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1157
- }
1158
-
1159
- if (_.options.centerMode === true) {
1160
- if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1161
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1162
- } else {
1163
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
1164
- }
1165
-
1166
- if (_.options.rtl === true) {
1167
- if (targetSlide[0]) {
1168
- targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1169
- } else {
1170
- targetLeft = 0;
1171
- }
1172
- } else {
1173
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1174
- }
1175
-
1176
- targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1177
- }
1178
- }
1179
-
1180
- return targetLeft;
1181
-
1182
- };
1183
-
1184
- Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
1185
-
1186
- var _ = this;
1187
-
1188
- return _.options[option];
1189
-
1190
- };
1191
-
1192
- Slick.prototype.getNavigableIndexes = function() {
1193
-
1194
- var _ = this,
1195
- breakPoint = 0,
1196
- counter = 0,
1197
- indexes = [],
1198
- max;
1199
-
1200
- if (_.options.infinite === false) {
1201
- max = _.slideCount;
1202
- } else {
1203
- breakPoint = _.options.slidesToScroll * -1;
1204
- counter = _.options.slidesToScroll * -1;
1205
- max = _.slideCount * 2;
1206
- }
1207
-
1208
- while (breakPoint < max) {
1209
- indexes.push(breakPoint);
1210
- breakPoint = counter + _.options.slidesToScroll;
1211
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1212
- }
1213
-
1214
- return indexes;
1215
-
1216
- };
1217
-
1218
- Slick.prototype.getSlick = function() {
1219
-
1220
- return this;
1221
-
1222
- };
1223
-
1224
- Slick.prototype.getSlideCount = function() {
1225
-
1226
- var _ = this,
1227
- slidesTraversed, swipedSlide, centerOffset;
1228
-
1229
- centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1230
-
1231
- if (_.options.swipeToSlide === true) {
1232
- _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1233
- if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1234
- swipedSlide = slide;
1235
- return false;
1236
- }
1237
- });
1238
-
1239
- slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
1240
-
1241
- return slidesTraversed;
1242
-
1243
- } else {
1244
- return _.options.slidesToScroll;
1245
- }
1246
-
1247
- };
1248
-
1249
- Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
1250
-
1251
- var _ = this;
1252
-
1253
- _.changeSlide({
1254
- data: {
1255
- message: 'index',
1256
- index: parseInt(slide)
1257
- }
1258
- }, dontAnimate);
1259
-
1260
- };
1261
-
1262
- Slick.prototype.init = function(creation) {
1263
-
1264
- var _ = this;
1265
-
1266
- if (!$(_.$slider).hasClass('slick-initialized')) {
1267
-
1268
- $(_.$slider).addClass('slick-initialized');
1269
-
1270
- _.buildRows();
1271
- _.buildOut();
1272
- _.setProps();
1273
- _.startLoad();
1274
- _.loadSlider();
1275
- _.initializeEvents();
1276
- _.updateArrows();
1277
- _.updateDots();
1278
- _.checkResponsive(true);
1279
- _.focusHandler();
1280
-
1281
- }
1282
-
1283
- if (creation) {
1284
- _.$slider.trigger('init', [_]);
1285
- }
1286
-
1287
- if (_.options.accessibility === true) {
1288
- _.initADA();
1289
- }
1290
-
1291
- if ( _.options.autoplay ) {
1292
-
1293
- _.paused = false;
1294
- _.autoPlay();
1295
-
1296
- }
1297
-
1298
- };
1299
-
1300
- Slick.prototype.initADA = function() {
1301
- var _ = this,
1302
- numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
1303
- tabControlIndexes = _.getNavigableIndexes().filter(function(val) {
1304
- return (val >= 0) && (val < _.slideCount);
1305
- });
1306
-
1307
- _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
1308
- 'aria-hidden': 'true',
1309
- 'tabindex': '-1'
1310
- }).find('a, input, button, select').attr({
1311
- 'tabindex': '-1'
1312
- });
1313
-
1314
- if (_.$dots !== null) {
1315
- _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
1316
- var slideControlIndex = tabControlIndexes.indexOf(i);
1317
-
1318
- $(this).attr({
1319
- 'role': 'tabpanel',
1320
- 'id': 'slick-slide' + _.instanceUid + i,
1321
- 'tabindex': -1
1322
- });
1323
-
1324
- if (slideControlIndex !== -1) {
1325
- $(this).attr({
1326
- 'aria-describedby': 'slick-slide-control' + _.instanceUid + slideControlIndex
1327
- });
1328
- }
1329
- });
1330
-
1331
- _.$dots.attr('role', 'tablist').find('li').each(function(i) {
1332
- var mappedSlideIndex = tabControlIndexes[i];
1333
-
1334
- $(this).attr({
1335
- 'role': 'presentation'
1336
- });
1337
-
1338
- $(this).find('button').first().attr({
1339
- 'role': 'tab',
1340
- 'id': 'slick-slide-control' + _.instanceUid + i,
1341
- 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex,
1342
- 'aria-label': (i + 1) + ' of ' + numDotGroups,
1343
- 'aria-selected': null,
1344
- 'tabindex': '-1'
1345
- });
1346
-
1347
- }).eq(_.currentSlide).find('button').attr({
1348
- 'aria-selected': 'true',
1349
- 'tabindex': '0'
1350
- }).end();
1351
- }
1352
-
1353
- for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) {
1354
- _.$slides.eq(i).attr('tabindex', 0);
1355
- }
1356
-
1357
- _.activateADA();
1358
-
1359
- };
1360
-
1361
- Slick.prototype.initArrowEvents = function() {
1362
-
1363
- var _ = this;
1364
-
1365
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1366
- _.$prevArrow
1367
- .off('click.slick')
1368
- .on('click.slick', {
1369
- message: 'previous'
1370
- }, _.changeSlide);
1371
- _.$nextArrow
1372
- .off('click.slick')
1373
- .on('click.slick', {
1374
- message: 'next'
1375
- }, _.changeSlide);
1376
-
1377
- if (_.options.accessibility === true) {
1378
- _.$prevArrow.on('keydown.slick', _.keyHandler);
1379
- _.$nextArrow.on('keydown.slick', _.keyHandler);
1380
- }
1381
- }
1382
-
1383
- };
1384
-
1385
- Slick.prototype.initDotEvents = function() {
1386
-
1387
- var _ = this;
1388
-
1389
- if (_.options.dots === true) {
1390
- $('li', _.$dots).on('click.slick', {
1391
- message: 'index'
1392
- }, _.changeSlide);
1393
-
1394
- if (_.options.accessibility === true) {
1395
- _.$dots.on('keydown.slick', _.keyHandler);
1396
- }
1397
- }
1398
-
1399
- if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
1400
-
1401
- $('li', _.$dots)
1402
- .on('mouseenter.slick', $.proxy(_.interrupt, _, true))
1403
- .on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1404
-
1405
- }
1406
-
1407
- };
1408
-
1409
- Slick.prototype.initSlideEvents = function() {
1410
-
1411
- var _ = this;
1412
-
1413
- if ( _.options.pauseOnHover ) {
1414
-
1415
- _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
1416
- _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1417
-
1418
- }
1419
-
1420
- };
1421
-
1422
- Slick.prototype.initializeEvents = function() {
1423
-
1424
- var _ = this;
1425
-
1426
- _.initArrowEvents();
1427
-
1428
- _.initDotEvents();
1429
- _.initSlideEvents();
1430
-
1431
- _.$list.on('touchstart.slick mousedown.slick', {
1432
- action: 'start'
1433
- }, _.swipeHandler);
1434
- _.$list.on('touchmove.slick mousemove.slick', {
1435
- action: 'move'
1436
- }, _.swipeHandler);
1437
- _.$list.on('touchend.slick mouseup.slick', {
1438
- action: 'end'
1439
- }, _.swipeHandler);
1440
- _.$list.on('touchcancel.slick mouseleave.slick', {
1441
- action: 'end'
1442
- }, _.swipeHandler);
1443
-
1444
- _.$list.on('click.slick', _.clickHandler);
1445
-
1446
- $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1447
-
1448
- if (_.options.accessibility === true) {
1449
- _.$list.on('keydown.slick', _.keyHandler);
1450
- }
1451
-
1452
- if (_.options.focusOnSelect === true) {
1453
- $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1454
- }
1455
-
1456
- $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1457
-
1458
- $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1459
-
1460
- $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1461
-
1462
- $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1463
- $(_.setPosition);
1464
-
1465
- };
1466
-
1467
- Slick.prototype.initUI = function() {
1468
-
1469
- var _ = this;
1470
-
1471
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1472
-
1473
- _.$prevArrow.show();
1474
- _.$nextArrow.show();
1475
-
1476
- }
1477
-
1478
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1479
-
1480
- _.$dots.show();
1481
-
1482
- }
1483
-
1484
- };
1485
-
1486
- Slick.prototype.keyHandler = function(event) {
1487
-
1488
- var _ = this;
1489
- //Dont slide if the cursor is inside the form fields and arrow keys are pressed
1490
- if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
1491
- if (event.keyCode === 37 && _.options.accessibility === true) {
1492
- _.changeSlide({
1493
- data: {
1494
- message: _.options.rtl === true ? 'next' : 'previous'
1495
- }
1496
- });
1497
- } else if (event.keyCode === 39 && _.options.accessibility === true) {
1498
- _.changeSlide({
1499
- data: {
1500
- message: _.options.rtl === true ? 'previous' : 'next'
1501
- }
1502
- });
1503
- }
1504
- }
1505
-
1506
- };
1507
-
1508
- Slick.prototype.lazyLoad = function() {
1509
-
1510
- var _ = this,
1511
- loadRange, cloneRange, rangeStart, rangeEnd;
1512
-
1513
- function loadImages(imagesScope) {
1514
-
1515
- $('img[data-lazy]', imagesScope).each(function() {
1516
-
1517
- var image = $(this),
1518
- imageSource = $(this).attr('data-lazy'),
1519
- imageSrcSet = $(this).attr('data-srcset'),
1520
- imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
1521
- imageToLoad = document.createElement('img');
1522
-
1523
- imageToLoad.onload = function() {
1524
-
1525
- image
1526
- .animate({ opacity: 0 }, 100, function() {
1527
-
1528
- if (imageSrcSet) {
1529
- image
1530
- .attr('srcset', imageSrcSet );
1531
-
1532
- if (imageSizes) {
1533
- image
1534
- .attr('sizes', imageSizes );
1535
- }
1536
- }
1537
-
1538
- image
1539
- .attr('src', imageSource)
1540
- .animate({ opacity: 1 }, 200, function() {
1541
- image
1542
- .removeAttr('data-lazy data-srcset data-sizes')
1543
- .removeClass('slick-loading');
1544
- });
1545
- _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
1546
- });
1547
-
1548
- };
1549
-
1550
- imageToLoad.onerror = function() {
1551
-
1552
- image
1553
- .removeAttr( 'data-lazy' )
1554
- .removeClass( 'slick-loading' )
1555
- .addClass( 'slick-lazyload-error' );
1556
-
1557
- _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1558
-
1559
- };
1560
-
1561
- imageToLoad.src = imageSource;
1562
-
1563
- });
1564
-
1565
- }
1566
-
1567
- if (_.options.centerMode === true) {
1568
- if (_.options.infinite === true) {
1569
- rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
1570
- rangeEnd = rangeStart + _.options.slidesToShow + 2;
1571
- } else {
1572
- rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
1573
- rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
1574
- }
1575
- } else {
1576
- rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1577
- rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
1578
- if (_.options.fade === true) {
1579
- if (rangeStart > 0) rangeStart--;
1580
- if (rangeEnd <= _.slideCount) rangeEnd++;
1581
- }
1582
- }
1583
-
1584
- loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1585
-
1586
- if (_.options.lazyLoad === 'anticipated') {
1587
- var prevSlide = rangeStart - 1,
1588
- nextSlide = rangeEnd,
1589
- $slides = _.$slider.find('.slick-slide');
1590
-
1591
- for (var i = 0; i < _.options.slidesToScroll; i++) {
1592
- if (prevSlide < 0) prevSlide = _.slideCount - 1;
1593
- loadRange = loadRange.add($slides.eq(prevSlide));
1594
- loadRange = loadRange.add($slides.eq(nextSlide));
1595
- prevSlide--;
1596
- nextSlide++;
1597
- }
1598
- }
1599
-
1600
- loadImages(loadRange);
1601
-
1602
- if (_.slideCount <= _.options.slidesToShow) {
1603
- cloneRange = _.$slider.find('.slick-slide');
1604
- loadImages(cloneRange);
1605
- } else
1606
- if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1607
- cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1608
- loadImages(cloneRange);
1609
- } else if (_.currentSlide === 0) {
1610
- cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1611
- loadImages(cloneRange);
1612
- }
1613
-
1614
- };
1615
-
1616
- Slick.prototype.loadSlider = function() {
1617
-
1618
- var _ = this;
1619
-
1620
- _.setPosition();
1621
-
1622
- _.$slideTrack.css({
1623
- opacity: 1
1624
- });
1625
-
1626
- _.$slider.removeClass('slick-loading');
1627
-
1628
- _.initUI();
1629
-
1630
- if (_.options.lazyLoad === 'progressive') {
1631
- _.progressiveLazyLoad();
1632
- }
1633
-
1634
- };
1635
-
1636
- Slick.prototype.next = Slick.prototype.slickNext = function() {
1637
-
1638
- var _ = this;
1639
-
1640
- _.changeSlide({
1641
- data: {
1642
- message: 'next'
1643
- }
1644
- });
1645
-
1646
- };
1647
-
1648
- Slick.prototype.orientationChange = function() {
1649
-
1650
- var _ = this;
1651
-
1652
- _.checkResponsive();
1653
- _.setPosition();
1654
-
1655
- };
1656
-
1657
- Slick.prototype.pause = Slick.prototype.slickPause = function() {
1658
-
1659
- var _ = this;
1660
-
1661
- _.autoPlayClear();
1662
- _.paused = true;
1663
-
1664
- };
1665
-
1666
- Slick.prototype.play = Slick.prototype.slickPlay = function() {
1667
-
1668
- var _ = this;
1669
-
1670
- _.autoPlay();
1671
- _.options.autoplay = true;
1672
- _.paused = false;
1673
- _.focussed = false;
1674
- _.interrupted = false;
1675
-
1676
- };
1677
-
1678
- Slick.prototype.postSlide = function(index) {
1679
-
1680
- var _ = this;
1681
-
1682
- if( !_.unslicked ) {
1683
-
1684
- _.$slider.trigger('afterChange', [_, index]);
1685
-
1686
- _.animating = false;
1687
-
1688
- if (_.slideCount > _.options.slidesToShow) {
1689
- _.setPosition();
1690
- }
1691
-
1692
- _.swipeLeft = null;
1693
-
1694
- if ( _.options.autoplay ) {
1695
- _.autoPlay();
1696
- }
1697
-
1698
- if (_.options.accessibility === true) {
1699
- _.initADA();
1700
-
1701
- if (_.options.focusOnChange) {
1702
- var $currentSlide = $(_.$slides.get(_.currentSlide));
1703
- $currentSlide.attr('tabindex', 0).focus();
1704
- }
1705
- }
1706
-
1707
- }
1708
-
1709
- };
1710
-
1711
- Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1712
-
1713
- var _ = this;
1714
-
1715
- _.changeSlide({
1716
- data: {
1717
- message: 'previous'
1718
- }
1719
- });
1720
-
1721
- };
1722
-
1723
- Slick.prototype.preventDefault = function(event) {
1724
-
1725
- event.preventDefault();
1726
-
1727
- };
1728
-
1729
- Slick.prototype.progressiveLazyLoad = function( tryCount ) {
1730
-
1731
- tryCount = tryCount || 1;
1732
-
1733
- var _ = this,
1734
- $imgsToLoad = $( 'img[data-lazy]', _.$slider ),
1735
- image,
1736
- imageSource,
1737
- imageSrcSet,
1738
- imageSizes,
1739
- imageToLoad;
1740
-
1741
- if ( $imgsToLoad.length ) {
1742
-
1743
- image = $imgsToLoad.first();
1744
- imageSource = image.attr('data-lazy');
1745
- imageSrcSet = image.attr('data-srcset');
1746
- imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes');
1747
- imageToLoad = document.createElement('img');
1748
-
1749
- imageToLoad.onload = function() {
1750
-
1751
- if (imageSrcSet) {
1752
- image
1753
- .attr('srcset', imageSrcSet );
1754
-
1755
- if (imageSizes) {
1756
- image
1757
- .attr('sizes', imageSizes );
1758
- }
1759
- }
1760
-
1761
- image
1762
- .attr( 'src', imageSource )
1763
- .removeAttr('data-lazy data-srcset data-sizes')
1764
- .removeClass('slick-loading');
1765
-
1766
- if ( _.options.adaptiveHeight === true ) {
1767
- _.setPosition();
1768
- }
1769
-
1770
- _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
1771
- _.progressiveLazyLoad();
1772
-
1773
- };
1774
-
1775
- imageToLoad.onerror = function() {
1776
-
1777
- if ( tryCount < 3 ) {
1778
-
1779
- /**
1780
- * try to load the image 3 times,
1781
- * leave a slight delay so we don't get
1782
- * servers blocking the request.
1783
- */
1784
- setTimeout( function() {
1785
- _.progressiveLazyLoad( tryCount + 1 );
1786
- }, 500 );
1787
-
1788
- } else {
1789
-
1790
- image
1791
- .removeAttr( 'data-lazy' )
1792
- .removeClass( 'slick-loading' )
1793
- .addClass( 'slick-lazyload-error' );
1794
-
1795
- _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1796
-
1797
- _.progressiveLazyLoad();
1798
-
1799
- }
1800
-
1801
- };
1802
-
1803
- imageToLoad.src = imageSource;
1804
-
1805
- } else {
1806
-
1807
- _.$slider.trigger('allImagesLoaded', [ _ ]);
1808
-
1809
- }
1810
-
1811
- };
1812
-
1813
- Slick.prototype.refresh = function( initializing ) {
1814
-
1815
- var _ = this, currentSlide, lastVisibleIndex;
1816
-
1817
- lastVisibleIndex = _.slideCount - _.options.slidesToShow;
1818
-
1819
- // in non-infinite sliders, we don't want to go past the
1820
- // last visible index.
1821
- if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
1822
- _.currentSlide = lastVisibleIndex;
1823
- }
1824
-
1825
- // if less slides than to show, go to start.
1826
- if ( _.slideCount <= _.options.slidesToShow ) {
1827
- _.currentSlide = 0;
1828
-
1829
- }
1830
-
1831
- currentSlide = _.currentSlide;
1832
-
1833
- _.destroy(true);
1834
-
1835
- $.extend(_, _.initials, { currentSlide: currentSlide });
1836
-
1837
- _.init();
1838
-
1839
- if( !initializing ) {
1840
-
1841
- _.changeSlide({
1842
- data: {
1843
- message: 'index',
1844
- index: currentSlide
1845
- }
1846
- }, false);
1847
-
1848
- }
1849
-
1850
- };
1851
-
1852
- Slick.prototype.registerBreakpoints = function() {
1853
-
1854
- var _ = this, breakpoint, currentBreakpoint, l,
1855
- responsiveSettings = _.options.responsive || null;
1856
-
1857
- if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
1858
-
1859
- _.respondTo = _.options.respondTo || 'window';
1860
-
1861
- for ( breakpoint in responsiveSettings ) {
1862
-
1863
- l = _.breakpoints.length-1;
1864
-
1865
- if (responsiveSettings.hasOwnProperty(breakpoint)) {
1866
- currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
1867
-
1868
- // loop through the breakpoints and cut out any existing
1869
- // ones with the same breakpoint number, we don't want dupes.
1870
- while( l >= 0 ) {
1871
- if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
1872
- _.breakpoints.splice(l,1);
1873
- }
1874
- l--;
1875
- }
1876
-
1877
- _.breakpoints.push(currentBreakpoint);
1878
- _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
1879
-
1880
- }
1881
-
1882
- }
1883
-
1884
- _.breakpoints.sort(function(a, b) {
1885
- return ( _.options.mobileFirst ) ? a-b : b-a;
1886
- });
1887
-
1888
- }
1889
-
1890
- };
1891
-
1892
- Slick.prototype.reinit = function() {
1893
-
1894
- var _ = this;
1895
-
1896
- _.$slides =
1897
- _.$slideTrack
1898
- .children(_.options.slide)
1899
- .addClass('slick-slide');
1900
-
1901
- _.slideCount = _.$slides.length;
1902
-
1903
- if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1904
- _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1905
- }
1906
-
1907
- if (_.slideCount <= _.options.slidesToShow) {
1908
- _.currentSlide = 0;
1909
- }
1910
-
1911
- _.registerBreakpoints();
1912
-
1913
- _.setProps();
1914
- _.setupInfinite();
1915
- _.buildArrows();
1916
- _.updateArrows();
1917
- _.initArrowEvents();
1918
- _.buildDots();
1919
- _.updateDots();
1920
- _.initDotEvents();
1921
- _.cleanUpSlideEvents();
1922
- _.initSlideEvents();
1923
-
1924
- _.checkResponsive(false, true);
1925
-
1926
- if (_.options.focusOnSelect === true) {
1927
- $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1928
- }
1929
-
1930
- _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
1931
-
1932
- _.setPosition();
1933
- _.focusHandler();
1934
-
1935
- _.paused = !_.options.autoplay;
1936
- _.autoPlay();
1937
-
1938
- _.$slider.trigger('reInit', [_]);
1939
-
1940
- };
1941
-
1942
- Slick.prototype.resize = function() {
1943
-
1944
- var _ = this;
1945
-
1946
- if ($(window).width() !== _.windowWidth) {
1947
- clearTimeout(_.windowDelay);
1948
- _.windowDelay = window.setTimeout(function() {
1949
- _.windowWidth = $(window).width();
1950
- _.checkResponsive();
1951
- if( !_.unslicked ) { _.setPosition(); }
1952
- }, 50);
1953
- }
1954
- };
1955
-
1956
- Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1957
-
1958
- var _ = this;
1959
-
1960
- if (typeof(index) === 'boolean') {
1961
- removeBefore = index;
1962
- index = removeBefore === true ? 0 : _.slideCount - 1;
1963
- } else {
1964
- index = removeBefore === true ? --index : index;
1965
- }
1966
-
1967
- if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1968
- return false;
1969
- }
1970
-
1971
- _.unload();
1972
-
1973
- if (removeAll === true) {
1974
- _.$slideTrack.children().remove();
1975
- } else {
1976
- _.$slideTrack.children(this.options.slide).eq(index).remove();
1977
- }
1978
-
1979
- _.$slides = _.$slideTrack.children(this.options.slide);
1980
-
1981
- _.$slideTrack.children(this.options.slide).detach();
1982
-
1983
- _.$slideTrack.append(_.$slides);
1984
-
1985
- _.$slidesCache = _.$slides;
1986
-
1987
- _.reinit();
1988
-
1989
- };
1990
-
1991
- Slick.prototype.setCSS = function(position) {
1992
-
1993
- var _ = this,
1994
- positionProps = {},
1995
- x, y;
1996
-
1997
- if (_.options.rtl === true) {
1998
- position = -position;
1999
- }
2000
- x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
2001
- y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
2002
-
2003
- positionProps[_.positionProp] = position;
2004
-
2005
- if (_.transformsEnabled === false) {
2006
- _.$slideTrack.css(positionProps);
2007
- } else {
2008
- positionProps = {};
2009
- if (_.cssTransitions === false) {
2010
- positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
2011
- _.$slideTrack.css(positionProps);
2012
- } else {
2013
- positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
2014
- _.$slideTrack.css(positionProps);
2015
- }
2016
- }
2017
-
2018
- };
2019
-
2020
- Slick.prototype.setDimensions = function() {
2021
-
2022
- var _ = this;
2023
-
2024
- if (_.options.vertical === false) {
2025
- if (_.options.centerMode === true) {
2026
- _.$list.css({
2027
- padding: ('0px ' + _.options.centerPadding)
2028
- });
2029
- }
2030
- } else {
2031
- _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
2032
- if (_.options.centerMode === true) {
2033
- _.$list.css({
2034
- padding: (_.options.centerPadding + ' 0px')
2035
- });
2036
- }
2037
- }
2038
-
2039
- _.listWidth = _.$list.width();
2040
- _.listHeight = _.$list.height();
2041
-
2042
-
2043
- if (_.options.vertical === false && _.options.variableWidth === false) {
2044
- _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
2045
- _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
2046
-
2047
- } else if (_.options.variableWidth === true) {
2048
- _.$slideTrack.width(5000 * _.slideCount);
2049
- } else {
2050
- _.slideWidth = Math.ceil(_.listWidth);
2051
- _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
2052
- }
2053
-
2054
- var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
2055
- if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
2056
-
2057
- };
2058
-
2059
- Slick.prototype.setFade = function() {
2060
-
2061
- var _ = this,
2062
- targetLeft;
2063
-
2064
- _.$slides.each(function(index, element) {
2065
- targetLeft = (_.slideWidth * index) * -1;
2066
- if (_.options.rtl === true) {
2067
- $(element).css({
2068
- position: 'relative',
2069
- right: targetLeft,
2070
- top: 0,
2071
- zIndex: _.options.zIndex - 2,
2072
- opacity: 0
2073
- });
2074
- } else {
2075
- $(element).css({
2076
- position: 'relative',
2077
- left: targetLeft,
2078
- top: 0,
2079
- zIndex: _.options.zIndex - 2,
2080
- opacity: 0
2081
- });
2082
- }
2083
- });
2084
-
2085
- _.$slides.eq(_.currentSlide).css({
2086
- zIndex: _.options.zIndex - 1,
2087
- opacity: 1
2088
- });
2089
-
2090
- };
2091
-
2092
- Slick.prototype.setHeight = function() {
2093
-
2094
- var _ = this;
2095
-
2096
- if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
2097
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
2098
- _.$list.css('height', targetHeight);
2099
- }
2100
-
2101
- };
2102
-
2103
- Slick.prototype.setOption =
2104
- Slick.prototype.slickSetOption = function() {
2105
-
2106
- /**
2107
- * accepts arguments in format of:
2108
- *
2109
- * - for changing a single option's value:
2110
- * .slick("setOption", option, value, refresh )
2111
- *
2112
- * - for changing a set of responsive options:
2113
- * .slick("setOption", 'responsive', [{}, ...], refresh )
2114
- *
2115
- * - for updating multiple values at once (not responsive)
2116
- * .slick("setOption", { 'option': value, ... }, refresh )
2117
- */
2118
-
2119
- var _ = this, l, item, option, value, refresh = false, type;
2120
-
2121
- if( $.type( arguments[0] ) === 'object' ) {
2122
-
2123
- option = arguments[0];
2124
- refresh = arguments[1];
2125
- type = 'multiple';
2126
-
2127
- } else if ( $.type( arguments[0] ) === 'string' ) {
2128
-
2129
- option = arguments[0];
2130
- value = arguments[1];
2131
- refresh = arguments[2];
2132
-
2133
- if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
2134
-
2135
- type = 'responsive';
2136
-
2137
- } else if ( typeof arguments[1] !== 'undefined' ) {
2138
-
2139
- type = 'single';
2140
-
2141
- }
2142
-
2143
- }
2144
-
2145
- if ( type === 'single' ) {
2146
-
2147
- _.options[option] = value;
2148
-
2149
-
2150
- } else if ( type === 'multiple' ) {
2151
-
2152
- $.each( option , function( opt, val ) {
2153
-
2154
- _.options[opt] = val;
2155
-
2156
- });
2157
-
2158
-
2159
- } else if ( type === 'responsive' ) {
2160
-
2161
- for ( item in value ) {
2162
-
2163
- if( $.type( _.options.responsive ) !== 'array' ) {
2164
-
2165
- _.options.responsive = [ value[item] ];
2166
-
2167
- } else {
2168
-
2169
- l = _.options.responsive.length-1;
2170
-
2171
- // loop through the responsive object and splice out duplicates.
2172
- while( l >= 0 ) {
2173
-
2174
- if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
2175
-
2176
- _.options.responsive.splice(l,1);
2177
-
2178
- }
2179
-
2180
- l--;
2181
-
2182
- }
2183
-
2184
- _.options.responsive.push( value[item] );
2185
-
2186
- }
2187
-
2188
- }
2189
-
2190
- }
2191
-
2192
- if ( refresh ) {
2193
-
2194
- _.unload();
2195
- _.reinit();
2196
-
2197
- }
2198
-
2199
- };
2200
-
2201
- Slick.prototype.setPosition = function() {
2202
-
2203
- var _ = this;
2204
-
2205
- _.setDimensions();
2206
-
2207
- _.setHeight();
2208
-
2209
- if (_.options.fade === false) {
2210
- _.setCSS(_.getLeft(_.currentSlide));
2211
- } else {
2212
- _.setFade();
2213
- }
2214
-
2215
- _.$slider.trigger('setPosition', [_]);
2216
-
2217
- };
2218
-
2219
- Slick.prototype.setProps = function() {
2220
-
2221
- var _ = this,
2222
- bodyStyle = document.body.style;
2223
-
2224
- _.positionProp = _.options.vertical === true ? 'top' : 'left';
2225
-
2226
- if (_.positionProp === 'top') {
2227
- _.$slider.addClass('slick-vertical');
2228
- } else {
2229
- _.$slider.removeClass('slick-vertical');
2230
- }
2231
-
2232
- if (bodyStyle.WebkitTransition !== undefined ||
2233
- bodyStyle.MozTransition !== undefined ||
2234
- bodyStyle.msTransition !== undefined) {
2235
- if (_.options.useCSS === true) {
2236
- _.cssTransitions = true;
2237
- }
2238
- }
2239
-
2240
- if ( _.options.fade ) {
2241
- if ( typeof _.options.zIndex === 'number' ) {
2242
- if( _.options.zIndex < 3 ) {
2243
- _.options.zIndex = 3;
2244
- }
2245
- } else {
2246
- _.options.zIndex = _.defaults.zIndex;
2247
- }
2248
- }
2249
-
2250
- if (bodyStyle.OTransform !== undefined) {
2251
- _.animType = 'OTransform';
2252
- _.transformType = '-o-transform';
2253
- _.transitionType = 'OTransition';
2254
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2255
- }
2256
- if (bodyStyle.MozTransform !== undefined) {
2257
- _.animType = 'MozTransform';
2258
- _.transformType = '-moz-transform';
2259
- _.transitionType = 'MozTransition';
2260
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
2261
- }
2262
- if (bodyStyle.webkitTransform !== undefined) {
2263
- _.animType = 'webkitTransform';
2264
- _.transformType = '-webkit-transform';
2265
- _.transitionType = 'webkitTransition';
2266
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2267
- }
2268
- if (bodyStyle.msTransform !== undefined) {
2269
- _.animType = 'msTransform';
2270
- _.transformType = '-ms-transform';
2271
- _.transitionType = 'msTransition';
2272
- if (bodyStyle.msTransform === undefined) _.animType = false;
2273
- }
2274
- if (bodyStyle.transform !== undefined && _.animType !== false) {
2275
- _.animType = 'transform';
2276
- _.transformType = 'transform';
2277
- _.transitionType = 'transition';
2278
- }
2279
- _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
2280
- };
2281
-
2282
-
2283
- Slick.prototype.setSlideClasses = function(index) {
2284
-
2285
- var _ = this,
2286
- centerOffset, allSlides, indexOffset, remainder;
2287
-
2288
- allSlides = _.$slider
2289
- .find('.slick-slide')
2290
- .removeClass('slick-active slick-center slick-current')
2291
- .attr('aria-hidden', 'true');
2292
-
2293
- _.$slides
2294
- .eq(index)
2295
- .addClass('slick-current');
2296
-
2297
- if (_.options.centerMode === true) {
2298
-
2299
- var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;
2300
-
2301
- centerOffset = Math.floor(_.options.slidesToShow / 2);
2302
-
2303
- if (_.options.infinite === true) {
2304
-
2305
- if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
2306
- _.$slides
2307
- .slice(index - centerOffset + evenCoef, index + centerOffset + 1)
2308
- .addClass('slick-active')
2309
- .attr('aria-hidden', 'false');
2310
-
2311
- } else {
2312
-
2313
- indexOffset = _.options.slidesToShow + index;
2314
- allSlides
2315
- .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2)
2316
- .addClass('slick-active')
2317
- .attr('aria-hidden', 'false');
2318
-
2319
- }
2320
-
2321
- if (index === 0) {
2322
-
2323
- allSlides
2324
- .eq(allSlides.length - 1 - _.options.slidesToShow)
2325
- .addClass('slick-center');
2326
-
2327
- } else if (index === _.slideCount - 1) {
2328
-
2329
- allSlides
2330
- .eq(_.options.slidesToShow)
2331
- .addClass('slick-center');
2332
-
2333
- }
2334
-
2335
- }
2336
-
2337
- _.$slides
2338
- .eq(index)
2339
- .addClass('slick-center');
2340
-
2341
- } else {
2342
-
2343
- if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
2344
-
2345
- _.$slides
2346
- .slice(index, index + _.options.slidesToShow)
2347
- .addClass('slick-active')
2348
- .attr('aria-hidden', 'false');
2349
-
2350
- } else if (allSlides.length <= _.options.slidesToShow) {
2351
-
2352
- allSlides
2353
- .addClass('slick-active')
2354
- .attr('aria-hidden', 'false');
2355
-
2356
- } else {
2357
-
2358
- remainder = _.slideCount % _.options.slidesToShow;
2359
- indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
2360
-
2361
- if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
2362
-
2363
- allSlides
2364
- .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
2365
- .addClass('slick-active')
2366
- .attr('aria-hidden', 'false');
2367
-
2368
- } else {
2369
-
2370
- allSlides
2371
- .slice(indexOffset, indexOffset + _.options.slidesToShow)
2372
- .addClass('slick-active')
2373
- .attr('aria-hidden', 'false');
2374
-
2375
- }
2376
-
2377
- }
2378
-
2379
- }
2380
-
2381
- if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') {
2382
- _.lazyLoad();
2383
- }
2384
- };
2385
-
2386
- Slick.prototype.setupInfinite = function() {
2387
-
2388
- var _ = this,
2389
- i, slideIndex, infiniteCount;
2390
-
2391
- if (_.options.fade === true) {
2392
- _.options.centerMode = false;
2393
- }
2394
-
2395
- if (_.options.infinite === true && _.options.fade === false) {
2396
-
2397
- slideIndex = null;
2398
-
2399
- if (_.slideCount > _.options.slidesToShow) {
2400
-
2401
- if (_.options.centerMode === true) {
2402
- infiniteCount = _.options.slidesToShow + 1;
2403
- } else {
2404
- infiniteCount = _.options.slidesToShow;
2405
- }
2406
-
2407
- for (i = _.slideCount; i > (_.slideCount -
2408
- infiniteCount); i -= 1) {
2409
- slideIndex = i - 1;
2410
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
2411
- .attr('data-slick-index', slideIndex - _.slideCount)
2412
- .prependTo(_.$slideTrack).addClass('slick-cloned');
2413
- }
2414
- for (i = 0; i < infiniteCount + _.slideCount; i += 1) {
2415
- slideIndex = i;
2416
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
2417
- .attr('data-slick-index', slideIndex + _.slideCount)
2418
- .appendTo(_.$slideTrack).addClass('slick-cloned');
2419
- }
2420
- _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
2421
- $(this).attr('id', '');
2422
- });
2423
-
2424
- }
2425
-
2426
- }
2427
-
2428
- };
2429
-
2430
- Slick.prototype.interrupt = function( toggle ) {
2431
-
2432
- var _ = this;
2433
-
2434
- if( !toggle ) {
2435
- _.autoPlay();
2436
- }
2437
- _.interrupted = toggle;
2438
-
2439
- };
2440
-
2441
- Slick.prototype.selectHandler = function(event) {
2442
-
2443
- var _ = this;
2444
-
2445
- var targetElement =
2446
- $(event.target).is('.slick-slide') ?
2447
- $(event.target) :
2448
- $(event.target).parents('.slick-slide');
2449
-
2450
- var index = parseInt(targetElement.attr('data-slick-index'));
2451
-
2452
- if (!index) index = 0;
2453
-
2454
- if (_.slideCount <= _.options.slidesToShow) {
2455
-
2456
- _.slideHandler(index, false, true);
2457
- return;
2458
-
2459
- }
2460
-
2461
- _.slideHandler(index);
2462
-
2463
- };
2464
-
2465
- Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
2466
-
2467
- var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
2468
- _ = this, navTarget;
2469
-
2470
- sync = sync || false;
2471
-
2472
- if (_.animating === true && _.options.waitForAnimate === true) {
2473
- return;
2474
- }
2475
-
2476
- if (_.options.fade === true && _.currentSlide === index) {
2477
- return;
2478
- }
2479
-
2480
- if (sync === false) {
2481
- _.asNavFor(index);
2482
- }
2483
-
2484
- targetSlide = index;
2485
- targetLeft = _.getLeft(targetSlide);
2486
- slideLeft = _.getLeft(_.currentSlide);
2487
-
2488
- _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
2489
-
2490
- if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
2491
- if (_.options.fade === false) {
2492
- targetSlide = _.currentSlide;
2493
- if (dontAnimate !== true) {
2494
- _.animateSlide(slideLeft, function() {
2495
- _.postSlide(targetSlide);
2496
- });
2497
- } else {
2498
- _.postSlide(targetSlide);
2499
- }
2500
- }
2501
- return;
2502
- } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
2503
- if (_.options.fade === false) {
2504
- targetSlide = _.currentSlide;
2505
- if (dontAnimate !== true) {
2506
- _.animateSlide(slideLeft, function() {
2507
- _.postSlide(targetSlide);
2508
- });
2509
- } else {
2510
- _.postSlide(targetSlide);
2511
- }
2512
- }
2513
- return;
2514
- }
2515
-
2516
- if ( _.options.autoplay ) {
2517
- clearInterval(_.autoPlayTimer);
2518
- }
2519
-
2520
- if (targetSlide < 0) {
2521
- if (_.slideCount % _.options.slidesToScroll !== 0) {
2522
- animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
2523
- } else {
2524
- animSlide = _.slideCount + targetSlide;
2525
- }
2526
- } else if (targetSlide >= _.slideCount) {
2527
- if (_.slideCount % _.options.slidesToScroll !== 0) {
2528
- animSlide = 0;
2529
- } else {
2530
- animSlide = targetSlide - _.slideCount;
2531
- }
2532
- } else {
2533
- animSlide = targetSlide;
2534
- }
2535
-
2536
- _.animating = true;
2537
-
2538
- _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
2539
-
2540
- oldSlide = _.currentSlide;
2541
- _.currentSlide = animSlide;
2542
-
2543
- _.setSlideClasses(_.currentSlide);
2544
-
2545
- if ( _.options.asNavFor ) {
2546
-
2547
- navTarget = _.getNavTarget();
2548
- navTarget = navTarget.slick('getSlick');
2549
-
2550
- if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
2551
- navTarget.setSlideClasses(_.currentSlide);
2552
- }
2553
-
2554
- }
2555
-
2556
- _.updateDots();
2557
- _.updateArrows();
2558
-
2559
- if (_.options.fade === true) {
2560
- if (dontAnimate !== true) {
2561
-
2562
- _.fadeSlideOut(oldSlide);
2563
-
2564
- _.fadeSlide(animSlide, function() {
2565
- _.postSlide(animSlide);
2566
- });
2567
-
2568
- } else {
2569
- _.postSlide(animSlide);
2570
- }
2571
- _.animateHeight();
2572
- return;
2573
- }
2574
-
2575
- if (dontAnimate !== true) {
2576
- _.animateSlide(targetLeft, function() {
2577
- _.postSlide(animSlide);
2578
- });
2579
- } else {
2580
- _.postSlide(animSlide);
2581
- }
2582
-
2583
- };
2584
-
2585
- Slick.prototype.startLoad = function() {
2586
-
2587
- var _ = this;
2588
-
2589
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2590
-
2591
- _.$prevArrow.hide();
2592
- _.$nextArrow.hide();
2593
-
2594
- }
2595
-
2596
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2597
-
2598
- _.$dots.hide();
2599
-
2600
- }
2601
-
2602
- _.$slider.addClass('slick-loading');
2603
-
2604
- };
2605
-
2606
- Slick.prototype.swipeDirection = function() {
2607
-
2608
- var xDist, yDist, r, swipeAngle, _ = this;
2609
-
2610
- xDist = _.touchObject.startX - _.touchObject.curX;
2611
- yDist = _.touchObject.startY - _.touchObject.curY;
2612
- r = Math.atan2(yDist, xDist);
2613
-
2614
- swipeAngle = Math.round(r * 180 / Math.PI);
2615
- if (swipeAngle < 0) {
2616
- swipeAngle = 360 - Math.abs(swipeAngle);
2617
- }
2618
-
2619
- if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
2620
- return (_.options.rtl === false ? 'left' : 'right');
2621
- }
2622
- if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
2623
- return (_.options.rtl === false ? 'left' : 'right');
2624
- }
2625
- if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
2626
- return (_.options.rtl === false ? 'right' : 'left');
2627
- }
2628
- if (_.options.verticalSwiping === true) {
2629
- if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
2630
- return 'down';
2631
- } else {
2632
- return 'up';
2633
- }
2634
- }
2635
-
2636
- return 'vertical';
2637
-
2638
- };
2639
-
2640
- Slick.prototype.swipeEnd = function(event) {
2641
-
2642
- var _ = this,
2643
- slideCount,
2644
- direction;
2645
-
2646
- _.dragging = false;
2647
- _.swiping = false;
2648
-
2649
- if (_.scrolling) {
2650
- _.scrolling = false;
2651
- return false;
2652
- }
2653
-
2654
- _.interrupted = false;
2655
- _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
2656
-
2657
- if ( _.touchObject.curX === undefined ) {
2658
- return false;
2659
- }
2660
-
2661
- if ( _.touchObject.edgeHit === true ) {
2662
- _.$slider.trigger('edge', [_, _.swipeDirection() ]);
2663
- }
2664
-
2665
- if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
2666
-
2667
- direction = _.swipeDirection();
2668
-
2669
- switch ( direction ) {
2670
-
2671
- case 'left':
2672
- case 'down':
2673
-
2674
- slideCount =
2675
- _.options.swipeToSlide ?
2676
- _.checkNavigable( _.currentSlide + _.getSlideCount() ) :
2677
- _.currentSlide + _.getSlideCount();
2678
-
2679
- _.currentDirection = 0;
2680
-
2681
- break;
2682
-
2683
- case 'right':
2684
- case 'up':
2685
-
2686
- slideCount =
2687
- _.options.swipeToSlide ?
2688
- _.checkNavigable( _.currentSlide - _.getSlideCount() ) :
2689
- _.currentSlide - _.getSlideCount();
2690
-
2691
- _.currentDirection = 1;
2692
-
2693
- break;
2694
-
2695
- default:
2696
-
2697
-
2698
- }
2699
-
2700
- if( direction != 'vertical' ) {
2701
-
2702
- _.slideHandler( slideCount );
2703
- _.touchObject = {};
2704
- _.$slider.trigger('swipe', [_, direction ]);
2705
-
2706
- }
2707
-
2708
- } else {
2709
-
2710
- if ( _.touchObject.startX !== _.touchObject.curX ) {
2711
-
2712
- _.slideHandler( _.currentSlide );
2713
- _.touchObject = {};
2714
-
2715
- }
2716
-
2717
- }
2718
-
2719
- };
2720
-
2721
- Slick.prototype.swipeHandler = function(event) {
2722
-
2723
- var _ = this;
2724
-
2725
- if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
2726
- return;
2727
- } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
2728
- return;
2729
- }
2730
-
2731
- _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
2732
- event.originalEvent.touches.length : 1;
2733
-
2734
- _.touchObject.minSwipe = _.listWidth / _.options
2735
- .touchThreshold;
2736
-
2737
- if (_.options.verticalSwiping === true) {
2738
- _.touchObject.minSwipe = _.listHeight / _.options
2739
- .touchThreshold;
2740
- }
2741
-
2742
- switch (event.data.action) {
2743
-
2744
- case 'start':
2745
- _.swipeStart(event);
2746
- break;
2747
-
2748
- case 'move':
2749
- _.swipeMove(event);
2750
- break;
2751
-
2752
- case 'end':
2753
- _.swipeEnd(event);
2754
- break;
2755
-
2756
- }
2757
-
2758
- };
2759
-
2760
- Slick.prototype.swipeMove = function(event) {
2761
-
2762
- var _ = this,
2763
- edgeWasHit = false,
2764
- curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength;
2765
-
2766
- touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
2767
-
2768
- if (!_.dragging || _.scrolling || touches && touches.length !== 1) {
2769
- return false;
2770
- }
2771
-
2772
- curLeft = _.getLeft(_.currentSlide);
2773
-
2774
- _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
2775
- _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
2776
-
2777
- _.touchObject.swipeLength = Math.round(Math.sqrt(
2778
- Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
2779
-
2780
- verticalSwipeLength = Math.round(Math.sqrt(
2781
- Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
2782
-
2783
- if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) {
2784
- _.scrolling = true;
2785
- return false;
2786
- }
2787
-
2788
- if (_.options.verticalSwiping === true) {
2789
- _.touchObject.swipeLength = verticalSwipeLength;
2790
- }
2791
-
2792
- swipeDirection = _.swipeDirection();
2793
-
2794
- if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
2795
- _.swiping = true;
2796
- event.preventDefault();
2797
- }
2798
-
2799
- positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
2800
- if (_.options.verticalSwiping === true) {
2801
- positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
2802
- }
2803
-
2804
-
2805
- swipeLength = _.touchObject.swipeLength;
2806
-
2807
- _.touchObject.edgeHit = false;
2808
-
2809
- if (_.options.infinite === false) {
2810
- if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
2811
- swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
2812
- _.touchObject.edgeHit = true;
2813
- }
2814
- }
2815
-
2816
- if (_.options.vertical === false) {
2817
- _.swipeLeft = curLeft + swipeLength * positionOffset;
2818
- } else {
2819
- _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2820
- }
2821
- if (_.options.verticalSwiping === true) {
2822
- _.swipeLeft = curLeft + swipeLength * positionOffset;
2823
- }
2824
-
2825
- if (_.options.fade === true || _.options.touchMove === false) {
2826
- return false;
2827
- }
2828
-
2829
- if (_.animating === true) {
2830
- _.swipeLeft = null;
2831
- return false;
2832
- }
2833
-
2834
- _.setCSS(_.swipeLeft);
2835
-
2836
- };
2837
-
2838
- Slick.prototype.swipeStart = function(event) {
2839
-
2840
- var _ = this,
2841
- touches;
2842
-
2843
- _.interrupted = true;
2844
-
2845
- if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2846
- _.touchObject = {};
2847
- return false;
2848
- }
2849
-
2850
- if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2851
- touches = event.originalEvent.touches[0];
2852
- }
2853
-
2854
- _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2855
- _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2856
-
2857
- _.dragging = true;
2858
-
2859
- };
2860
-
2861
- Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2862
-
2863
- var _ = this;
2864
-
2865
- if (_.$slidesCache !== null) {
2866
-
2867
- _.unload();
2868
-
2869
- _.$slideTrack.children(this.options.slide).detach();
2870
-
2871
- _.$slidesCache.appendTo(_.$slideTrack);
2872
-
2873
- _.reinit();
2874
-
2875
- }
2876
-
2877
- };
2878
-
2879
- Slick.prototype.unload = function() {
2880
-
2881
- var _ = this;
2882
-
2883
- $('.slick-cloned', _.$slider).remove();
2884
-
2885
- if (_.$dots) {
2886
- _.$dots.remove();
2887
- }
2888
-
2889
- if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
2890
- _.$prevArrow.remove();
2891
- }
2892
-
2893
- if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
2894
- _.$nextArrow.remove();
2895
- }
2896
-
2897
- _.$slides
2898
- .removeClass('slick-slide slick-active slick-visible slick-current')
2899
- .attr('aria-hidden', 'true')
2900
- .css('width', '');
2901
-
2902
- };
2903
-
2904
- Slick.prototype.unslick = function(fromBreakpoint) {
2905
-
2906
- var _ = this;
2907
- _.$slider.trigger('unslick', [_, fromBreakpoint]);
2908
- _.destroy();
2909
-
2910
- };
2911
-
2912
- Slick.prototype.updateArrows = function() {
2913
-
2914
- var _ = this,
2915
- centerOffset;
2916
-
2917
- centerOffset = Math.floor(_.options.slidesToShow / 2);
2918
-
2919
- if ( _.options.arrows === true &&
2920
- _.slideCount > _.options.slidesToShow &&
2921
- !_.options.infinite ) {
2922
-
2923
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2924
- _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2925
-
2926
- if (_.currentSlide === 0) {
2927
-
2928
- _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2929
- _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2930
-
2931
- } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2932
-
2933
- _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2934
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2935
-
2936
- } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2937
-
2938
- _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2939
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2940
-
2941
- }
2942
-
2943
- }
2944
-
2945
- };
2946
-
2947
- Slick.prototype.updateDots = function() {
2948
-
2949
- var _ = this;
2950
-
2951
- if (_.$dots !== null) {
2952
-
2953
- _.$dots
2954
- .find('li')
2955
- .removeClass('slick-active')
2956
- .end();
2957
-
2958
- _.$dots
2959
- .find('li')
2960
- .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
2961
- .addClass('slick-active');
2962
-
2963
- }
2964
-
2965
- };
2966
-
2967
- Slick.prototype.visibility = function() {
2968
-
2969
- var _ = this;
2970
-
2971
- if ( _.options.autoplay ) {
2972
-
2973
- if ( document[_.hidden] ) {
2974
-
2975
- _.interrupted = true;
2976
-
2977
- } else {
2978
-
2979
- _.interrupted = false;
2980
-
2981
- }
2982
-
2983
- }
2984
-
2985
- };
2986
-
2987
- $.fn.slick = function() {
2988
- var _ = this,
2989
- opt = arguments[0],
2990
- args = Array.prototype.slice.call(arguments, 1),
2991
- l = _.length,
2992
- i,
2993
- ret;
2994
- for (i = 0; i < l; i++) {
2995
- if (typeof opt == 'object' || typeof opt == 'undefined')
2996
- _[i].slick = new Slick(_[i], opt);
2997
- else
2998
- ret = _[i].slick[opt].apply(_[i].slick, args);
2999
- if (typeof ret != 'undefined') return ret;
3000
- }
3001
- return _;
3002
- };
3003
-
3004
- }));
1
+ /*
2
+ _ _ _ _
3
+ ___| (_) ___| | __ (_)___
4
+ / __| | |/ __| |/ / | / __|
5
+ \__ \ | | (__| < _ | \__ \
6
+ |___/_|_|\___|_|\_(_)/ |___/
7
+ |__/
8
+
9
+ Version: 1.8.0
10
+ Author: Ken Wheeler
11
+ Website: http://kenwheeler.github.io
12
+ Docs: http://kenwheeler.github.io/slick
13
+ Repo: http://github.com/kenwheeler/slick
14
+ Issues: http://github.com/kenwheeler/slick/issues
15
+
16
+ */
17
+ /* global window, document, define, jQuery, setInterval, clearInterval */
18
+ ;(function(factory) {
19
+ 'use strict';
20
+ if (typeof define === 'function' && define.amd) {
21
+ define(['jquery'], factory);
22
+ } else if (typeof exports !== 'undefined') {
23
+ module.exports = factory(require('jquery'));
24
+ } else {
25
+ factory(jQuery);
26
+ }
27
+
28
+ }(function($) {
29
+ 'use strict';
30
+ var Slick = window.Slick || {};
31
+
32
+ Slick = (function() {
33
+
34
+ var instanceUid = 0;
35
+
36
+ function Slick(element, settings) {
37
+
38
+ var _ = this, dataSettings;
39
+
40
+ _.defaults = {
41
+ accessibility: true,
42
+ adaptiveHeight: false,
43
+ appendArrows: $(element),
44
+ appendDots: $(element),
45
+ arrows: true,
46
+ asNavFor: null,
47
+ prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',
48
+ nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>',
49
+ autoplay: false,
50
+ autoplaySpeed: 3000,
51
+ centerMode: false,
52
+ centerPadding: '50px',
53
+ cssEase: 'ease',
54
+ customPaging: function(slider, i) {
55
+ return $('<button type="button" />').text(i + 1);
56
+ },
57
+ dots: false,
58
+ dotsClass: 'slick-dots',
59
+ draggable: true,
60
+ easing: 'linear',
61
+ edgeFriction: 0.35,
62
+ fade: false,
63
+ focusOnSelect: false,
64
+ focusOnChange: false,
65
+ infinite: true,
66
+ initialSlide: 0,
67
+ lazyLoad: 'ondemand',
68
+ mobileFirst: false,
69
+ pauseOnHover: true,
70
+ pauseOnFocus: true,
71
+ pauseOnDotsHover: false,
72
+ respondTo: 'window',
73
+ responsive: null,
74
+ rows: 1,
75
+ rtl: false,
76
+ slide: '',
77
+ slidesPerRow: 1,
78
+ slidesToShow: 1,
79
+ slidesToScroll: 1,
80
+ speed: 500,
81
+ swipe: true,
82
+ swipeToSlide: false,
83
+ touchMove: true,
84
+ touchThreshold: 5,
85
+ useCSS: true,
86
+ useTransform: true,
87
+ variableWidth: false,
88
+ vertical: false,
89
+ verticalSwiping: false,
90
+ waitForAnimate: true,
91
+ zIndex: 1000
92
+ };
93
+
94
+ _.initials = {
95
+ animating: false,
96
+ dragging: false,
97
+ autoPlayTimer: null,
98
+ currentDirection: 0,
99
+ currentLeft: null,
100
+ currentSlide: 0,
101
+ direction: 1,
102
+ $dots: null,
103
+ listWidth: null,
104
+ listHeight: null,
105
+ loadIndex: 0,
106
+ $nextArrow: null,
107
+ $prevArrow: null,
108
+ scrolling: false,
109
+ slideCount: null,
110
+ slideWidth: null,
111
+ $slideTrack: null,
112
+ $slides: null,
113
+ sliding: false,
114
+ slideOffset: 0,
115
+ swipeLeft: null,
116
+ swiping: false,
117
+ $list: null,
118
+ touchObject: {},
119
+ transformsEnabled: false,
120
+ unslicked: false
121
+ };
122
+
123
+ $.extend(_, _.initials);
124
+
125
+ _.activeBreakpoint = null;
126
+ _.animType = null;
127
+ _.animProp = null;
128
+ _.breakpoints = [];
129
+ _.breakpointSettings = [];
130
+ _.cssTransitions = false;
131
+ _.focussed = false;
132
+ _.interrupted = false;
133
+ _.hidden = 'hidden';
134
+ _.paused = true;
135
+ _.positionProp = null;
136
+ _.respondTo = null;
137
+ _.rowCount = 1;
138
+ _.shouldClick = true;
139
+ _.$slider = $(element);
140
+ _.$slidesCache = null;
141
+ _.transformType = null;
142
+ _.transitionType = null;
143
+ _.visibilityChange = 'visibilitychange';
144
+ _.windowWidth = 0;
145
+ _.windowTimer = null;
146
+
147
+ dataSettings = $(element).data('slick') || {};
148
+
149
+ _.options = $.extend({}, _.defaults, settings, dataSettings);
150
+
151
+ _.currentSlide = _.options.initialSlide;
152
+
153
+ _.originalSettings = _.options;
154
+
155
+ if (typeof document.mozHidden !== 'undefined') {
156
+ _.hidden = 'mozHidden';
157
+ _.visibilityChange = 'mozvisibilitychange';
158
+ } else if (typeof document.webkitHidden !== 'undefined') {
159
+ _.hidden = 'webkitHidden';
160
+ _.visibilityChange = 'webkitvisibilitychange';
161
+ }
162
+
163
+ _.autoPlay = $.proxy(_.autoPlay, _);
164
+ _.autoPlayClear = $.proxy(_.autoPlayClear, _);
165
+ _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
166
+ _.changeSlide = $.proxy(_.changeSlide, _);
167
+ _.clickHandler = $.proxy(_.clickHandler, _);
168
+ _.selectHandler = $.proxy(_.selectHandler, _);
169
+ _.setPosition = $.proxy(_.setPosition, _);
170
+ _.swipeHandler = $.proxy(_.swipeHandler, _);
171
+ _.dragHandler = $.proxy(_.dragHandler, _);
172
+ _.keyHandler = $.proxy(_.keyHandler, _);
173
+
174
+ _.instanceUid = instanceUid++;
175
+
176
+ // A simple way to check for HTML strings
177
+ // Strict HTML recognition (must start with <)
178
+ // Extracted from jQuery v1.11 source
179
+ _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
180
+
181
+
182
+ _.registerBreakpoints();
183
+ _.init(true);
184
+
185
+ }
186
+
187
+ return Slick;
188
+
189
+ }());
190
+
191
+ Slick.prototype.activateADA = function() {
192
+ var _ = this;
193
+
194
+ _.$slideTrack.find('.slick-active').attr({
195
+ 'aria-hidden': 'false'
196
+ }).find('a, input, button, select').attr({
197
+ 'tabindex': '0'
198
+ });
199
+
200
+ };
201
+
202
+ Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
203
+
204
+ var _ = this;
205
+
206
+ if (typeof(index) === 'boolean') {
207
+ addBefore = index;
208
+ index = null;
209
+ } else if (index < 0 || (index >= _.slideCount)) {
210
+ return false;
211
+ }
212
+
213
+ _.unload();
214
+
215
+ if (typeof(index) === 'number') {
216
+ if (index === 0 && _.$slides.length === 0) {
217
+ $(markup).appendTo(_.$slideTrack);
218
+ } else if (addBefore) {
219
+ $(markup).insertBefore(_.$slides.eq(index));
220
+ } else {
221
+ $(markup).insertAfter(_.$slides.eq(index));
222
+ }
223
+ } else {
224
+ if (addBefore === true) {
225
+ $(markup).prependTo(_.$slideTrack);
226
+ } else {
227
+ $(markup).appendTo(_.$slideTrack);
228
+ }
229
+ }
230
+
231
+ _.$slides = _.$slideTrack.children(this.options.slide);
232
+
233
+ _.$slideTrack.children(this.options.slide).detach();
234
+
235
+ _.$slideTrack.append(_.$slides);
236
+
237
+ _.$slides.each(function(index, element) {
238
+ $(element).attr('data-slick-index', index);
239
+ });
240
+
241
+ _.$slidesCache = _.$slides;
242
+
243
+ _.reinit();
244
+
245
+ };
246
+
247
+ Slick.prototype.animateHeight = function() {
248
+ var _ = this;
249
+ if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
250
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
251
+ _.$list.animate({
252
+ height: targetHeight
253
+ }, _.options.speed);
254
+ }
255
+ };
256
+
257
+ Slick.prototype.animateSlide = function(targetLeft, callback) {
258
+
259
+ var animProps = {},
260
+ _ = this;
261
+
262
+ _.animateHeight();
263
+
264
+ if (_.options.rtl === true && _.options.vertical === false) {
265
+ targetLeft = -targetLeft;
266
+ }
267
+ if (_.transformsEnabled === false) {
268
+ if (_.options.vertical === false) {
269
+ _.$slideTrack.animate({
270
+ left: targetLeft
271
+ }, _.options.speed, _.options.easing, callback);
272
+ } else {
273
+ _.$slideTrack.animate({
274
+ top: targetLeft
275
+ }, _.options.speed, _.options.easing, callback);
276
+ }
277
+
278
+ } else {
279
+
280
+ if (_.cssTransitions === false) {
281
+ if (_.options.rtl === true) {
282
+ _.currentLeft = -(_.currentLeft);
283
+ }
284
+ $({
285
+ animStart: _.currentLeft
286
+ }).animate({
287
+ animStart: targetLeft
288
+ }, {
289
+ duration: _.options.speed,
290
+ easing: _.options.easing,
291
+ step: function(now) {
292
+ now = Math.ceil(now);
293
+ if (_.options.vertical === false) {
294
+ animProps[_.animType] = 'translate(' +
295
+ now + 'px, 0px)';
296
+ _.$slideTrack.css(animProps);
297
+ } else {
298
+ animProps[_.animType] = 'translate(0px,' +
299
+ now + 'px)';
300
+ _.$slideTrack.css(animProps);
301
+ }
302
+ },
303
+ complete: function() {
304
+ if (callback) {
305
+ callback.call();
306
+ }
307
+ }
308
+ });
309
+
310
+ } else {
311
+
312
+ _.applyTransition();
313
+ targetLeft = Math.ceil(targetLeft);
314
+
315
+ if (_.options.vertical === false) {
316
+ animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
317
+ } else {
318
+ animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
319
+ }
320
+ _.$slideTrack.css(animProps);
321
+
322
+ if (callback) {
323
+ setTimeout(function() {
324
+
325
+ _.disableTransition();
326
+
327
+ callback.call();
328
+ }, _.options.speed);
329
+ }
330
+
331
+ }
332
+
333
+ }
334
+
335
+ };
336
+
337
+ Slick.prototype.getNavTarget = function() {
338
+
339
+ var _ = this,
340
+ asNavFor = _.options.asNavFor;
341
+
342
+ if ( asNavFor && asNavFor !== null ) {
343
+ asNavFor = $(asNavFor).not(_.$slider);
344
+ }
345
+
346
+ return asNavFor;
347
+
348
+ };
349
+
350
+ Slick.prototype.asNavFor = function(index) {
351
+
352
+ var _ = this,
353
+ asNavFor = _.getNavTarget();
354
+
355
+ if ( asNavFor !== null && typeof asNavFor === 'object' ) {
356
+ asNavFor.each(function() {
357
+ var target = $(this).slick('getSlick');
358
+ if(!target.unslicked) {
359
+ target.slideHandler(index, true);
360
+ }
361
+ });
362
+ }
363
+
364
+ };
365
+
366
+ Slick.prototype.applyTransition = function(slide) {
367
+
368
+ var _ = this,
369
+ transition = {};
370
+
371
+ if (_.options.fade === false) {
372
+ transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
373
+ } else {
374
+ transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
375
+ }
376
+
377
+ if (_.options.fade === false) {
378
+ _.$slideTrack.css(transition);
379
+ } else {
380
+ _.$slides.eq(slide).css(transition);
381
+ }
382
+
383
+ };
384
+
385
+ Slick.prototype.autoPlay = function() {
386
+
387
+ var _ = this;
388
+
389
+ _.autoPlayClear();
390
+
391
+ if ( _.slideCount > _.options.slidesToShow ) {
392
+ _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
393
+ }
394
+
395
+ };
396
+
397
+ Slick.prototype.autoPlayClear = function() {
398
+
399
+ var _ = this;
400
+
401
+ if (_.autoPlayTimer) {
402
+ clearInterval(_.autoPlayTimer);
403
+ }
404
+
405
+ };
406
+
407
+ Slick.prototype.autoPlayIterator = function() {
408
+
409
+ var _ = this,
410
+ slideTo = _.currentSlide + _.options.slidesToScroll;
411
+
412
+ if ( !_.paused && !_.interrupted && !_.focussed ) {
413
+
414
+ if ( _.options.infinite === false ) {
415
+
416
+ if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
417
+ _.direction = 0;
418
+ }
419
+
420
+ else if ( _.direction === 0 ) {
421
+
422
+ slideTo = _.currentSlide - _.options.slidesToScroll;
423
+
424
+ if ( _.currentSlide - 1 === 0 ) {
425
+ _.direction = 1;
426
+ }
427
+
428
+ }
429
+
430
+ }
431
+
432
+ _.slideHandler( slideTo );
433
+
434
+ }
435
+
436
+ };
437
+
438
+ Slick.prototype.buildArrows = function() {
439
+
440
+ var _ = this;
441
+
442
+ if (_.options.arrows === true ) {
443
+
444
+ _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
445
+ _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
446
+
447
+ if( _.slideCount > _.options.slidesToShow ) {
448
+
449
+ _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
450
+ _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
451
+
452
+ if (_.htmlExpr.test(_.options.prevArrow)) {
453
+ _.$prevArrow.prependTo(_.options.appendArrows);
454
+ }
455
+
456
+ if (_.htmlExpr.test(_.options.nextArrow)) {
457
+ _.$nextArrow.appendTo(_.options.appendArrows);
458
+ }
459
+
460
+ if (_.options.infinite !== true) {
461
+ _.$prevArrow
462
+ .addClass('slick-disabled')
463
+ .attr('aria-disabled', 'true');
464
+ }
465
+
466
+ } else {
467
+
468
+ _.$prevArrow.add( _.$nextArrow )
469
+
470
+ .addClass('slick-hidden')
471
+ .attr({
472
+ 'aria-disabled': 'true',
473
+ 'tabindex': '-1'
474
+ });
475
+
476
+ }
477
+
478
+ }
479
+
480
+ };
481
+
482
+ Slick.prototype.buildDots = function() {
483
+
484
+ var _ = this,
485
+ i, dot;
486
+
487
+ if (_.options.dots === true) {
488
+
489
+ _.$slider.addClass('slick-dotted');
490
+
491
+ dot = $('<ul />').addClass(_.options.dotsClass);
492
+
493
+ for (i = 0; i <= _.getDotCount(); i += 1) {
494
+ dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
495
+ }
496
+
497
+ _.$dots = dot.appendTo(_.options.appendDots);
498
+
499
+ _.$dots.find('li').first().addClass('slick-active');
500
+
501
+ }
502
+
503
+ };
504
+
505
+ Slick.prototype.buildOut = function() {
506
+
507
+ var _ = this;
508
+
509
+ _.$slides =
510
+ _.$slider
511
+ .children( _.options.slide + ':not(.slick-cloned)')
512
+ .addClass('slick-slide');
513
+
514
+ _.slideCount = _.$slides.length;
515
+
516
+ _.$slides.each(function(index, element) {
517
+ $(element)
518
+ .attr('data-slick-index', index)
519
+ .data('originalStyling', $(element).attr('style') || '');
520
+ });
521
+
522
+ _.$slider.addClass('slick-slider');
523
+
524
+ _.$slideTrack = (_.slideCount === 0) ?
525
+ $('<div class="slick-track"/>').appendTo(_.$slider) :
526
+ _.$slides.wrapAll('<div class="slick-track"/>').parent();
527
+
528
+ _.$list = _.$slideTrack.wrap(
529
+ '<div class="slick-list"/>').parent();
530
+ _.$slideTrack.css('opacity', 0);
531
+
532
+ if (_.options.centerMode === true || _.options.swipeToSlide === true) {
533
+ _.options.slidesToScroll = 1;
534
+ }
535
+
536
+ $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
537
+
538
+ _.setupInfinite();
539
+
540
+ _.buildArrows();
541
+
542
+ _.buildDots();
543
+
544
+ _.updateDots();
545
+
546
+
547
+ _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
548
+
549
+ if (_.options.draggable === true) {
550
+ _.$list.addClass('draggable');
551
+ }
552
+
553
+ };
554
+
555
+ Slick.prototype.buildRows = function() {
556
+
557
+ var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
558
+
559
+ newSlides = document.createDocumentFragment();
560
+ originalSlides = _.$slider.children();
561
+
562
+ if(_.options.rows > 1) {
563
+
564
+ slidesPerSection = _.options.slidesPerRow * _.options.rows;
565
+ numOfSlides = Math.ceil(
566
+ originalSlides.length / slidesPerSection
567
+ );
568
+
569
+ for(a = 0; a < numOfSlides; a++){
570
+ var slide = document.createElement('div');
571
+ for(b = 0; b < _.options.rows; b++) {
572
+ var row = document.createElement('div');
573
+ for(c = 0; c < _.options.slidesPerRow; c++) {
574
+ var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
575
+ if (originalSlides.get(target)) {
576
+ row.appendChild(originalSlides.get(target));
577
+ }
578
+ }
579
+ slide.appendChild(row);
580
+ }
581
+ newSlides.appendChild(slide);
582
+ }
583
+
584
+ _.$slider.empty().append(newSlides);
585
+ _.$slider.children().children().children()
586
+ .css({
587
+ 'width':(100 / _.options.slidesPerRow) + '%',
588
+ 'display': 'inline-block'
589
+ });
590
+
591
+ }
592
+
593
+ };
594
+
595
+ Slick.prototype.checkResponsive = function(initial, forceUpdate) {
596
+
597
+ var _ = this,
598
+ breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
599
+ var sliderWidth = _.$slider.width();
600
+ var windowWidth = window.innerWidth || $(window).width();
601
+
602
+ if (_.respondTo === 'window') {
603
+ respondToWidth = windowWidth;
604
+ } else if (_.respondTo === 'slider') {
605
+ respondToWidth = sliderWidth;
606
+ } else if (_.respondTo === 'min') {
607
+ respondToWidth = Math.min(windowWidth, sliderWidth);
608
+ }
609
+
610
+ if ( _.options.responsive &&
611
+ _.options.responsive.length &&
612
+ _.options.responsive !== null) {
613
+
614
+ targetBreakpoint = null;
615
+
616
+ for (breakpoint in _.breakpoints) {
617
+ if (_.breakpoints.hasOwnProperty(breakpoint)) {
618
+ if (_.originalSettings.mobileFirst === false) {
619
+ if (respondToWidth < _.breakpoints[breakpoint]) {
620
+ targetBreakpoint = _.breakpoints[breakpoint];
621
+ }
622
+ } else {
623
+ if (respondToWidth > _.breakpoints[breakpoint]) {
624
+ targetBreakpoint = _.breakpoints[breakpoint];
625
+ }
626
+ }
627
+ }
628
+ }
629
+
630
+ if (targetBreakpoint !== null) {
631
+ if (_.activeBreakpoint !== null) {
632
+ if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
633
+ _.activeBreakpoint =
634
+ targetBreakpoint;
635
+ if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
636
+ _.unslick(targetBreakpoint);
637
+ } else {
638
+ _.options = $.extend({}, _.originalSettings,
639
+ _.breakpointSettings[
640
+ targetBreakpoint]);
641
+ if (initial === true) {
642
+ _.currentSlide = _.options.initialSlide;
643
+ }
644
+ _.refresh(initial);
645
+ }
646
+ triggerBreakpoint = targetBreakpoint;
647
+ }
648
+ } else {
649
+ _.activeBreakpoint = targetBreakpoint;
650
+ if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
651
+ _.unslick(targetBreakpoint);
652
+ } else {
653
+ _.options = $.extend({}, _.originalSettings,
654
+ _.breakpointSettings[
655
+ targetBreakpoint]);
656
+ if (initial === true) {
657
+ _.currentSlide = _.options.initialSlide;
658
+ }
659
+ _.refresh(initial);
660
+ }
661
+ triggerBreakpoint = targetBreakpoint;
662
+ }
663
+ } else {
664
+ if (_.activeBreakpoint !== null) {
665
+ _.activeBreakpoint = null;
666
+ _.options = _.originalSettings;
667
+ if (initial === true) {
668
+ _.currentSlide = _.options.initialSlide;
669
+ }
670
+ _.refresh(initial);
671
+ triggerBreakpoint = targetBreakpoint;
672
+ }
673
+ }
674
+
675
+ // only trigger breakpoints during an actual break. not on initialize.
676
+ if( !initial && triggerBreakpoint !== false ) {
677
+ _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
678
+ }
679
+ }
680
+
681
+ };
682
+
683
+ Slick.prototype.changeSlide = function(event, dontAnimate) {
684
+
685
+ var _ = this,
686
+ $target = $(event.currentTarget),
687
+ indexOffset, slideOffset, unevenOffset;
688
+
689
+ // If target is a link, prevent default action.
690
+ if($target.is('a')) {
691
+ event.preventDefault();
692
+ }
693
+
694
+ // If target is not the <li> element (ie: a child), find the <li>.
695
+ if(!$target.is('li')) {
696
+ $target = $target.closest('li');
697
+ }
698
+
699
+ unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
700
+ indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
701
+
702
+ switch (event.data.message) {
703
+
704
+ case 'previous':
705
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
706
+ if (_.slideCount > _.options.slidesToShow) {
707
+ _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
708
+ }
709
+ break;
710
+
711
+ case 'next':
712
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
713
+ if (_.slideCount > _.options.slidesToShow) {
714
+ _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
715
+ }
716
+ break;
717
+
718
+ case 'index':
719
+ var index = event.data.index === 0 ? 0 :
720
+ event.data.index || $target.index() * _.options.slidesToScroll;
721
+
722
+ _.slideHandler(_.checkNavigable(index), false, dontAnimate);
723
+ $target.children().trigger('focus');
724
+ break;
725
+
726
+ default:
727
+ return;
728
+ }
729
+
730
+ };
731
+
732
+ Slick.prototype.checkNavigable = function(index) {
733
+
734
+ var _ = this,
735
+ navigables, prevNavigable;
736
+
737
+ navigables = _.getNavigableIndexes();
738
+ prevNavigable = 0;
739
+ if (index > navigables[navigables.length - 1]) {
740
+ index = navigables[navigables.length - 1];
741
+ } else {
742
+ for (var n in navigables) {
743
+ if (index < navigables[n]) {
744
+ index = prevNavigable;
745
+ break;
746
+ }
747
+ prevNavigable = navigables[n];
748
+ }
749
+ }
750
+
751
+ return index;
752
+ };
753
+
754
+ Slick.prototype.cleanUpEvents = function() {
755
+
756
+ var _ = this;
757
+
758
+ if (_.options.dots && _.$dots !== null) {
759
+
760
+ $('li', _.$dots)
761
+ .off('click.slick', _.changeSlide)
762
+ .off('mouseenter.slick', $.proxy(_.interrupt, _, true))
763
+ .off('mouseleave.slick', $.proxy(_.interrupt, _, false));
764
+
765
+ if (_.options.accessibility === true) {
766
+ _.$dots.off('keydown.slick', _.keyHandler);
767
+ }
768
+ }
769
+
770
+ _.$slider.off('focus.slick blur.slick');
771
+
772
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
773
+ _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
774
+ _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
775
+
776
+ if (_.options.accessibility === true) {
777
+ _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler);
778
+ _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler);
779
+ }
780
+ }
781
+
782
+ _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
783
+ _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
784
+ _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
785
+ _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
786
+
787
+ _.$list.off('click.slick', _.clickHandler);
788
+
789
+ $(document).off(_.visibilityChange, _.visibility);
790
+
791
+ _.cleanUpSlideEvents();
792
+
793
+ if (_.options.accessibility === true) {
794
+ _.$list.off('keydown.slick', _.keyHandler);
795
+ }
796
+
797
+ if (_.options.focusOnSelect === true) {
798
+ $(_.$slideTrack).children().off('click.slick', _.selectHandler);
799
+ }
800
+
801
+ $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
802
+
803
+ $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
804
+
805
+ $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
806
+
807
+ $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
808
+
809
+ };
810
+
811
+ Slick.prototype.cleanUpSlideEvents = function() {
812
+
813
+ var _ = this;
814
+
815
+ _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
816
+ _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
817
+
818
+ };
819
+
820
+ Slick.prototype.cleanUpRows = function() {
821
+
822
+ var _ = this, originalSlides;
823
+
824
+ if(_.options.rows > 1) {
825
+ originalSlides = _.$slides.children().children();
826
+ originalSlides.removeAttr('style');
827
+ _.$slider.empty().append(originalSlides);
828
+ }
829
+
830
+ };
831
+
832
+ Slick.prototype.clickHandler = function(event) {
833
+
834
+ var _ = this;
835
+
836
+ if (_.shouldClick === false) {
837
+ event.stopImmediatePropagation();
838
+ event.stopPropagation();
839
+ event.preventDefault();
840
+ }
841
+
842
+ };
843
+
844
+ Slick.prototype.destroy = function(refresh) {
845
+
846
+ var _ = this;
847
+
848
+ _.autoPlayClear();
849
+
850
+ _.touchObject = {};
851
+
852
+ _.cleanUpEvents();
853
+
854
+ $('.slick-cloned', _.$slider).detach();
855
+
856
+ if (_.$dots) {
857
+ _.$dots.remove();
858
+ }
859
+
860
+ if ( _.$prevArrow && _.$prevArrow.length ) {
861
+
862
+ _.$prevArrow
863
+ .removeClass('slick-disabled slick-arrow slick-hidden')
864
+ .removeAttr('aria-hidden aria-disabled tabindex')
865
+ .css('display','');
866
+
867
+ if ( _.htmlExpr.test( _.options.prevArrow )) {
868
+ _.$prevArrow.remove();
869
+ }
870
+ }
871
+
872
+ if ( _.$nextArrow && _.$nextArrow.length ) {
873
+
874
+ _.$nextArrow
875
+ .removeClass('slick-disabled slick-arrow slick-hidden')
876
+ .removeAttr('aria-hidden aria-disabled tabindex')
877
+ .css('display','');
878
+
879
+ if ( _.htmlExpr.test( _.options.nextArrow )) {
880
+ _.$nextArrow.remove();
881
+ }
882
+ }
883
+
884
+
885
+ if (_.$slides) {
886
+
887
+ _.$slides
888
+ .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
889
+ .removeAttr('aria-hidden')
890
+ .removeAttr('data-slick-index')
891
+ .each(function(){
892
+ $(this).attr('style', $(this).data('originalStyling'));
893
+ });
894
+
895
+ _.$slideTrack.children(this.options.slide).detach();
896
+
897
+ _.$slideTrack.detach();
898
+
899
+ _.$list.detach();
900
+
901
+ _.$slider.append(_.$slides);
902
+ }
903
+
904
+ _.cleanUpRows();
905
+
906
+ _.$slider.removeClass('slick-slider');
907
+ _.$slider.removeClass('slick-initialized');
908
+ _.$slider.removeClass('slick-dotted');
909
+
910
+ _.unslicked = true;
911
+
912
+ if(!refresh) {
913
+ _.$slider.trigger('destroy', [_]);
914
+ }
915
+
916
+ };
917
+
918
+ Slick.prototype.disableTransition = function(slide) {
919
+
920
+ var _ = this,
921
+ transition = {};
922
+
923
+ transition[_.transitionType] = '';
924
+
925
+ if (_.options.fade === false) {
926
+ _.$slideTrack.css(transition);
927
+ } else {
928
+ _.$slides.eq(slide).css(transition);
929
+ }
930
+
931
+ };
932
+
933
+ Slick.prototype.fadeSlide = function(slideIndex, callback) {
934
+
935
+ var _ = this;
936
+
937
+ if (_.cssTransitions === false) {
938
+
939
+ _.$slides.eq(slideIndex).css({
940
+ zIndex: _.options.zIndex
941
+ });
942
+
943
+ _.$slides.eq(slideIndex).animate({
944
+ opacity: 1
945
+ }, _.options.speed, _.options.easing, callback);
946
+
947
+ } else {
948
+
949
+ _.applyTransition(slideIndex);
950
+
951
+ _.$slides.eq(slideIndex).css({
952
+ opacity: 1,
953
+ zIndex: _.options.zIndex
954
+ });
955
+
956
+ if (callback) {
957
+ setTimeout(function() {
958
+
959
+ _.disableTransition(slideIndex);
960
+
961
+ callback.call();
962
+ }, _.options.speed);
963
+ }
964
+
965
+ }
966
+
967
+ };
968
+
969
+ Slick.prototype.fadeSlideOut = function(slideIndex) {
970
+
971
+ var _ = this;
972
+
973
+ if (_.cssTransitions === false) {
974
+
975
+ _.$slides.eq(slideIndex).animate({
976
+ opacity: 0,
977
+ zIndex: _.options.zIndex - 2
978
+ }, _.options.speed, _.options.easing);
979
+
980
+ } else {
981
+
982
+ _.applyTransition(slideIndex);
983
+
984
+ _.$slides.eq(slideIndex).css({
985
+ opacity: 0,
986
+ zIndex: _.options.zIndex - 2
987
+ });
988
+
989
+ }
990
+
991
+ };
992
+
993
+ Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
994
+
995
+ var _ = this;
996
+
997
+ if (filter !== null) {
998
+
999
+ _.$slidesCache = _.$slides;
1000
+
1001
+ _.unload();
1002
+
1003
+ _.$slideTrack.children(this.options.slide).detach();
1004
+
1005
+ _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
1006
+
1007
+ _.reinit();
1008
+
1009
+ }
1010
+
1011
+ };
1012
+
1013
+ Slick.prototype.focusHandler = function() {
1014
+
1015
+ var _ = this;
1016
+
1017
+ _.$slider
1018
+ .off('focus.slick blur.slick')
1019
+ .on('focus.slick blur.slick', '*', function(event) {
1020
+
1021
+ event.stopImmediatePropagation();
1022
+ var $sf = $(this);
1023
+
1024
+ setTimeout(function() {
1025
+
1026
+ if( _.options.pauseOnFocus ) {
1027
+ _.focussed = $sf.is(':focus');
1028
+ _.autoPlay();
1029
+ }
1030
+
1031
+ }, 0);
1032
+
1033
+ });
1034
+ };
1035
+
1036
+ Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
1037
+
1038
+ var _ = this;
1039
+ return _.currentSlide;
1040
+
1041
+ };
1042
+
1043
+ Slick.prototype.getDotCount = function() {
1044
+
1045
+ var _ = this;
1046
+
1047
+ var breakPoint = 0;
1048
+ var counter = 0;
1049
+ var pagerQty = 0;
1050
+
1051
+ if (_.options.infinite === true) {
1052
+ if (_.slideCount <= _.options.slidesToShow) {
1053
+ ++pagerQty;
1054
+ } else {
1055
+ while (breakPoint < _.slideCount) {
1056
+ ++pagerQty;
1057
+ breakPoint = counter + _.options.slidesToScroll;
1058
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1059
+ }
1060
+ }
1061
+ } else if (_.options.centerMode === true) {
1062
+ pagerQty = _.slideCount;
1063
+ } else if(!_.options.asNavFor) {
1064
+ pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
1065
+ }else {
1066
+ while (breakPoint < _.slideCount) {
1067
+ ++pagerQty;
1068
+ breakPoint = counter + _.options.slidesToScroll;
1069
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1070
+ }
1071
+ }
1072
+
1073
+ return pagerQty - 1;
1074
+
1075
+ };
1076
+
1077
+ Slick.prototype.getLeft = function(slideIndex) {
1078
+
1079
+ var _ = this,
1080
+ targetLeft,
1081
+ verticalHeight,
1082
+ verticalOffset = 0,
1083
+ targetSlide,
1084
+ coef;
1085
+
1086
+ _.slideOffset = 0;
1087
+ verticalHeight = _.$slides.first().outerHeight(true);
1088
+
1089
+ if (_.options.infinite === true) {
1090
+ if (_.slideCount > _.options.slidesToShow) {
1091
+ _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
1092
+ coef = -1
1093
+
1094
+ if (_.options.vertical === true && _.options.centerMode === true) {
1095
+ if (_.options.slidesToShow === 2) {
1096
+ coef = -1.5;
1097
+ } else if (_.options.slidesToShow === 1) {
1098
+ coef = -2
1099
+ }
1100
+ }
1101
+ verticalOffset = (verticalHeight * _.options.slidesToShow) * coef;
1102
+ }
1103
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
1104
+ if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
1105
+ if (slideIndex > _.slideCount) {
1106
+ _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
1107
+ verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
1108
+ } else {
1109
+ _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
1110
+ verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
1111
+ }
1112
+ }
1113
+ }
1114
+ } else {
1115
+ if (slideIndex + _.options.slidesToShow > _.slideCount) {
1116
+ _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
1117
+ verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
1118
+ }
1119
+ }
1120
+
1121
+ if (_.slideCount <= _.options.slidesToShow) {
1122
+ _.slideOffset = 0;
1123
+ verticalOffset = 0;
1124
+ }
1125
+
1126
+ if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) {
1127
+ _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
1128
+ } else if (_.options.centerMode === true && _.options.infinite === true) {
1129
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1130
+ } else if (_.options.centerMode === true) {
1131
+ _.slideOffset = 0;
1132
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1133
+ }
1134
+
1135
+ if (_.options.vertical === false) {
1136
+ targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
1137
+ } else {
1138
+ targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
1139
+ }
1140
+
1141
+ if (_.options.variableWidth === true) {
1142
+
1143
+ if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1144
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1145
+ } else {
1146
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
1147
+ }
1148
+
1149
+ if (_.options.rtl === true) {
1150
+ if (targetSlide[0]) {
1151
+ targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1152
+ } else {
1153
+ targetLeft = 0;
1154
+ }
1155
+ } else {
1156
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1157
+ }
1158
+
1159
+ if (_.options.centerMode === true) {
1160
+ if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1161
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1162
+ } else {
1163
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
1164
+ }
1165
+
1166
+ if (_.options.rtl === true) {
1167
+ if (targetSlide[0]) {
1168
+ targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1169
+ } else {
1170
+ targetLeft = 0;
1171
+ }
1172
+ } else {
1173
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1174
+ }
1175
+
1176
+ targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1177
+ }
1178
+ }
1179
+
1180
+ return targetLeft;
1181
+
1182
+ };
1183
+
1184
+ Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
1185
+
1186
+ var _ = this;
1187
+
1188
+ return _.options[option];
1189
+
1190
+ };
1191
+
1192
+ Slick.prototype.getNavigableIndexes = function() {
1193
+
1194
+ var _ = this,
1195
+ breakPoint = 0,
1196
+ counter = 0,
1197
+ indexes = [],
1198
+ max;
1199
+
1200
+ if (_.options.infinite === false) {
1201
+ max = _.slideCount;
1202
+ } else {
1203
+ breakPoint = _.options.slidesToScroll * -1;
1204
+ counter = _.options.slidesToScroll * -1;
1205
+ max = _.slideCount * 2;
1206
+ }
1207
+
1208
+ while (breakPoint < max) {
1209
+ indexes.push(breakPoint);
1210
+ breakPoint = counter + _.options.slidesToScroll;
1211
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1212
+ }
1213
+
1214
+ return indexes;
1215
+
1216
+ };
1217
+
1218
+ Slick.prototype.getSlick = function() {
1219
+
1220
+ return this;
1221
+
1222
+ };
1223
+
1224
+ Slick.prototype.getSlideCount = function() {
1225
+
1226
+ var _ = this,
1227
+ slidesTraversed, swipedSlide, centerOffset;
1228
+
1229
+ centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1230
+
1231
+ if (_.options.swipeToSlide === true) {
1232
+ _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1233
+ if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1234
+ swipedSlide = slide;
1235
+ return false;
1236
+ }
1237
+ });
1238
+
1239
+ slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
1240
+
1241
+ return slidesTraversed;
1242
+
1243
+ } else {
1244
+ return _.options.slidesToScroll;
1245
+ }
1246
+
1247
+ };
1248
+
1249
+ Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
1250
+
1251
+ var _ = this;
1252
+
1253
+ _.changeSlide({
1254
+ data: {
1255
+ message: 'index',
1256
+ index: parseInt(slide)
1257
+ }
1258
+ }, dontAnimate);
1259
+
1260
+ };
1261
+
1262
+ Slick.prototype.init = function(creation) {
1263
+
1264
+ var _ = this;
1265
+
1266
+ if (!$(_.$slider).hasClass('slick-initialized')) {
1267
+
1268
+ $(_.$slider).addClass('slick-initialized');
1269
+
1270
+ _.buildRows();
1271
+ _.buildOut();
1272
+ _.setProps();
1273
+ _.startLoad();
1274
+ _.loadSlider();
1275
+ _.initializeEvents();
1276
+ _.updateArrows();
1277
+ _.updateDots();
1278
+ _.checkResponsive(true);
1279
+ _.focusHandler();
1280
+
1281
+ }
1282
+
1283
+ if (creation) {
1284
+ _.$slider.trigger('init', [_]);
1285
+ }
1286
+
1287
+ if (_.options.accessibility === true) {
1288
+ _.initADA();
1289
+ }
1290
+
1291
+ if ( _.options.autoplay ) {
1292
+
1293
+ _.paused = false;
1294
+ _.autoPlay();
1295
+
1296
+ }
1297
+
1298
+ };
1299
+
1300
+ Slick.prototype.initADA = function() {
1301
+ var _ = this,
1302
+ numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
1303
+ tabControlIndexes = _.getNavigableIndexes().filter(function(val) {
1304
+ return (val >= 0) && (val < _.slideCount);
1305
+ });
1306
+
1307
+ _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
1308
+ 'aria-hidden': 'true',
1309
+ 'tabindex': '-1'
1310
+ }).find('a, input, button, select').attr({
1311
+ 'tabindex': '-1'
1312
+ });
1313
+
1314
+ if (_.$dots !== null) {
1315
+ _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
1316
+ var slideControlIndex = tabControlIndexes.indexOf(i);
1317
+
1318
+ $(this).attr({
1319
+ 'role': 'tabpanel',
1320
+ 'id': 'slick-slide' + _.instanceUid + i,
1321
+ 'tabindex': -1
1322
+ });
1323
+
1324
+ if (slideControlIndex !== -1) {
1325
+ $(this).attr({
1326
+ 'aria-describedby': 'slick-slide-control' + _.instanceUid + slideControlIndex
1327
+ });
1328
+ }
1329
+ });
1330
+
1331
+ _.$dots.attr('role', 'tablist').find('li').each(function(i) {
1332
+ var mappedSlideIndex = tabControlIndexes[i];
1333
+
1334
+ $(this).attr({
1335
+ 'role': 'presentation'
1336
+ });
1337
+
1338
+ $(this).find('button').first().attr({
1339
+ 'role': 'tab',
1340
+ 'id': 'slick-slide-control' + _.instanceUid + i,
1341
+ 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex,
1342
+ 'aria-label': (i + 1) + ' of ' + numDotGroups,
1343
+ 'aria-selected': null,
1344
+ 'tabindex': '-1'
1345
+ });
1346
+
1347
+ }).eq(_.currentSlide).find('button').attr({
1348
+ 'aria-selected': 'true',
1349
+ 'tabindex': '0'
1350
+ }).end();
1351
+ }
1352
+
1353
+ for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) {
1354
+ _.$slides.eq(i).attr('tabindex', 0);
1355
+ }
1356
+
1357
+ _.activateADA();
1358
+
1359
+ };
1360
+
1361
+ Slick.prototype.initArrowEvents = function() {
1362
+
1363
+ var _ = this;
1364
+
1365
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1366
+ _.$prevArrow
1367
+ .off('click.slick')
1368
+ .on('click.slick', {
1369
+ message: 'previous'
1370
+ }, _.changeSlide);
1371
+ _.$nextArrow
1372
+ .off('click.slick')
1373
+ .on('click.slick', {
1374
+ message: 'next'
1375
+ }, _.changeSlide);
1376
+
1377
+ if (_.options.accessibility === true) {
1378
+ _.$prevArrow.on('keydown.slick', _.keyHandler);
1379
+ _.$nextArrow.on('keydown.slick', _.keyHandler);
1380
+ }
1381
+ }
1382
+
1383
+ };
1384
+
1385
+ Slick.prototype.initDotEvents = function() {
1386
+
1387
+ var _ = this;
1388
+
1389
+ if (_.options.dots === true) {
1390
+ $('li', _.$dots).on('click.slick', {
1391
+ message: 'index'
1392
+ }, _.changeSlide);
1393
+
1394
+ if (_.options.accessibility === true) {
1395
+ _.$dots.on('keydown.slick', _.keyHandler);
1396
+ }
1397
+ }
1398
+
1399
+ if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
1400
+
1401
+ $('li', _.$dots)
1402
+ .on('mouseenter.slick', $.proxy(_.interrupt, _, true))
1403
+ .on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1404
+
1405
+ }
1406
+
1407
+ };
1408
+
1409
+ Slick.prototype.initSlideEvents = function() {
1410
+
1411
+ var _ = this;
1412
+
1413
+ if ( _.options.pauseOnHover ) {
1414
+
1415
+ _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
1416
+ _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
1417
+
1418
+ }
1419
+
1420
+ };
1421
+
1422
+ Slick.prototype.initializeEvents = function() {
1423
+
1424
+ var _ = this;
1425
+
1426
+ _.initArrowEvents();
1427
+
1428
+ _.initDotEvents();
1429
+ _.initSlideEvents();
1430
+
1431
+ _.$list.on('touchstart.slick mousedown.slick', {
1432
+ action: 'start'
1433
+ }, _.swipeHandler);
1434
+ _.$list.on('touchmove.slick mousemove.slick', {
1435
+ action: 'move'
1436
+ }, _.swipeHandler);
1437
+ _.$list.on('touchend.slick mouseup.slick', {
1438
+ action: 'end'
1439
+ }, _.swipeHandler);
1440
+ _.$list.on('touchcancel.slick mouseleave.slick', {
1441
+ action: 'end'
1442
+ }, _.swipeHandler);
1443
+
1444
+ _.$list.on('click.slick', _.clickHandler);
1445
+
1446
+ $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1447
+
1448
+ if (_.options.accessibility === true) {
1449
+ _.$list.on('keydown.slick', _.keyHandler);
1450
+ }
1451
+
1452
+ if (_.options.focusOnSelect === true) {
1453
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1454
+ }
1455
+
1456
+ $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1457
+
1458
+ $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1459
+
1460
+ $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1461
+
1462
+ $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1463
+ $(_.setPosition);
1464
+
1465
+ };
1466
+
1467
+ Slick.prototype.initUI = function() {
1468
+
1469
+ var _ = this;
1470
+
1471
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1472
+
1473
+ _.$prevArrow.show();
1474
+ _.$nextArrow.show();
1475
+
1476
+ }
1477
+
1478
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1479
+
1480
+ _.$dots.show();
1481
+
1482
+ }
1483
+
1484
+ };
1485
+
1486
+ Slick.prototype.keyHandler = function(event) {
1487
+
1488
+ var _ = this;
1489
+ //Dont slide if the cursor is inside the form fields and arrow keys are pressed
1490
+ if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
1491
+ if (event.keyCode === 37 && _.options.accessibility === true) {
1492
+ _.changeSlide({
1493
+ data: {
1494
+ message: _.options.rtl === true ? 'next' : 'previous'
1495
+ }
1496
+ });
1497
+ } else if (event.keyCode === 39 && _.options.accessibility === true) {
1498
+ _.changeSlide({
1499
+ data: {
1500
+ message: _.options.rtl === true ? 'previous' : 'next'
1501
+ }
1502
+ });
1503
+ }
1504
+ }
1505
+
1506
+ };
1507
+
1508
+ Slick.prototype.lazyLoad = function() {
1509
+
1510
+ var _ = this,
1511
+ loadRange, cloneRange, rangeStart, rangeEnd;
1512
+
1513
+ function loadImages(imagesScope) {
1514
+
1515
+ $('img[data-lazy]', imagesScope).each(function() {
1516
+
1517
+ var image = $(this),
1518
+ imageSource = $(this).attr('data-lazy'),
1519
+ imageSrcSet = $(this).attr('data-srcset'),
1520
+ imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
1521
+ imageToLoad = document.createElement('img');
1522
+
1523
+ imageToLoad.onload = function() {
1524
+
1525
+ image
1526
+ .animate({ opacity: 0 }, 100, function() {
1527
+
1528
+ if (imageSrcSet) {
1529
+ image
1530
+ .attr('srcset', imageSrcSet );
1531
+
1532
+ if (imageSizes) {
1533
+ image
1534
+ .attr('sizes', imageSizes );
1535
+ }
1536
+ }
1537
+
1538
+ image
1539
+ .attr('src', imageSource)
1540
+ .animate({ opacity: 1 }, 200, function() {
1541
+ image
1542
+ .removeAttr('data-lazy data-srcset data-sizes')
1543
+ .removeClass('slick-loading');
1544
+ });
1545
+ _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
1546
+ });
1547
+
1548
+ };
1549
+
1550
+ imageToLoad.onerror = function() {
1551
+
1552
+ image
1553
+ .removeAttr( 'data-lazy' )
1554
+ .removeClass( 'slick-loading' )
1555
+ .addClass( 'slick-lazyload-error' );
1556
+
1557
+ _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1558
+
1559
+ };
1560
+
1561
+ imageToLoad.src = imageSource;
1562
+
1563
+ });
1564
+
1565
+ }
1566
+
1567
+ if (_.options.centerMode === true) {
1568
+ if (_.options.infinite === true) {
1569
+ rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
1570
+ rangeEnd = rangeStart + _.options.slidesToShow + 2;
1571
+ } else {
1572
+ rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
1573
+ rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
1574
+ }
1575
+ } else {
1576
+ rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1577
+ rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
1578
+ if (_.options.fade === true) {
1579
+ if (rangeStart > 0) rangeStart--;
1580
+ if (rangeEnd <= _.slideCount) rangeEnd++;
1581
+ }
1582
+ }
1583
+
1584
+ loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1585
+
1586
+ if (_.options.lazyLoad === 'anticipated') {
1587
+ var prevSlide = rangeStart - 1,
1588
+ nextSlide = rangeEnd,
1589
+ $slides = _.$slider.find('.slick-slide');
1590
+
1591
+ for (var i = 0; i < _.options.slidesToScroll; i++) {
1592
+ if (prevSlide < 0) prevSlide = _.slideCount - 1;
1593
+ loadRange = loadRange.add($slides.eq(prevSlide));
1594
+ loadRange = loadRange.add($slides.eq(nextSlide));
1595
+ prevSlide--;
1596
+ nextSlide++;
1597
+ }
1598
+ }
1599
+
1600
+ loadImages(loadRange);
1601
+
1602
+ if (_.slideCount <= _.options.slidesToShow) {
1603
+ cloneRange = _.$slider.find('.slick-slide');
1604
+ loadImages(cloneRange);
1605
+ } else
1606
+ if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1607
+ cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1608
+ loadImages(cloneRange);
1609
+ } else if (_.currentSlide === 0) {
1610
+ cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1611
+ loadImages(cloneRange);
1612
+ }
1613
+
1614
+ };
1615
+
1616
+ Slick.prototype.loadSlider = function() {
1617
+
1618
+ var _ = this;
1619
+
1620
+ _.setPosition();
1621
+
1622
+ _.$slideTrack.css({
1623
+ opacity: 1
1624
+ });
1625
+
1626
+ _.$slider.removeClass('slick-loading');
1627
+
1628
+ _.initUI();
1629
+
1630
+ if (_.options.lazyLoad === 'progressive') {
1631
+ _.progressiveLazyLoad();
1632
+ }
1633
+
1634
+ };
1635
+
1636
+ Slick.prototype.next = Slick.prototype.slickNext = function() {
1637
+
1638
+ var _ = this;
1639
+
1640
+ _.changeSlide({
1641
+ data: {
1642
+ message: 'next'
1643
+ }
1644
+ });
1645
+
1646
+ };
1647
+
1648
+ Slick.prototype.orientationChange = function() {
1649
+
1650
+ var _ = this;
1651
+
1652
+ _.checkResponsive();
1653
+ _.setPosition();
1654
+
1655
+ };
1656
+
1657
+ Slick.prototype.pause = Slick.prototype.slickPause = function() {
1658
+
1659
+ var _ = this;
1660
+
1661
+ _.autoPlayClear();
1662
+ _.paused = true;
1663
+
1664
+ };
1665
+
1666
+ Slick.prototype.play = Slick.prototype.slickPlay = function() {
1667
+
1668
+ var _ = this;
1669
+
1670
+ _.autoPlay();
1671
+ _.options.autoplay = true;
1672
+ _.paused = false;
1673
+ _.focussed = false;
1674
+ _.interrupted = false;
1675
+
1676
+ };
1677
+
1678
+ Slick.prototype.postSlide = function(index) {
1679
+
1680
+ var _ = this;
1681
+
1682
+ if( !_.unslicked ) {
1683
+
1684
+ _.$slider.trigger('afterChange', [_, index]);
1685
+
1686
+ _.animating = false;
1687
+
1688
+ if (_.slideCount > _.options.slidesToShow) {
1689
+ _.setPosition();
1690
+ }
1691
+
1692
+ _.swipeLeft = null;
1693
+
1694
+ if ( _.options.autoplay ) {
1695
+ _.autoPlay();
1696
+ }
1697
+
1698
+ if (_.options.accessibility === true) {
1699
+ _.initADA();
1700
+
1701
+ if (_.options.focusOnChange) {
1702
+ var $currentSlide = $(_.$slides.get(_.currentSlide));
1703
+ $currentSlide.attr('tabindex', 0).focus();
1704
+ }
1705
+ }
1706
+
1707
+ }
1708
+
1709
+ };
1710
+
1711
+ Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1712
+
1713
+ var _ = this;
1714
+
1715
+ _.changeSlide({
1716
+ data: {
1717
+ message: 'previous'
1718
+ }
1719
+ });
1720
+
1721
+ };
1722
+
1723
+ Slick.prototype.preventDefault = function(event) {
1724
+
1725
+ event.preventDefault();
1726
+
1727
+ };
1728
+
1729
+ Slick.prototype.progressiveLazyLoad = function( tryCount ) {
1730
+
1731
+ tryCount = tryCount || 1;
1732
+
1733
+ var _ = this,
1734
+ $imgsToLoad = $( 'img[data-lazy]', _.$slider ),
1735
+ image,
1736
+ imageSource,
1737
+ imageSrcSet,
1738
+ imageSizes,
1739
+ imageToLoad;
1740
+
1741
+ if ( $imgsToLoad.length ) {
1742
+
1743
+ image = $imgsToLoad.first();
1744
+ imageSource = image.attr('data-lazy');
1745
+ imageSrcSet = image.attr('data-srcset');
1746
+ imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes');
1747
+ imageToLoad = document.createElement('img');
1748
+
1749
+ imageToLoad.onload = function() {
1750
+
1751
+ if (imageSrcSet) {
1752
+ image
1753
+ .attr('srcset', imageSrcSet );
1754
+
1755
+ if (imageSizes) {
1756
+ image
1757
+ .attr('sizes', imageSizes );
1758
+ }
1759
+ }
1760
+
1761
+ image
1762
+ .attr( 'src', imageSource )
1763
+ .removeAttr('data-lazy data-srcset data-sizes')
1764
+ .removeClass('slick-loading');
1765
+
1766
+ if ( _.options.adaptiveHeight === true ) {
1767
+ _.setPosition();
1768
+ }
1769
+
1770
+ _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
1771
+ _.progressiveLazyLoad();
1772
+
1773
+ };
1774
+
1775
+ imageToLoad.onerror = function() {
1776
+
1777
+ if ( tryCount < 3 ) {
1778
+
1779
+ /**
1780
+ * try to load the image 3 times,
1781
+ * leave a slight delay so we don't get
1782
+ * servers blocking the request.
1783
+ */
1784
+ setTimeout( function() {
1785
+ _.progressiveLazyLoad( tryCount + 1 );
1786
+ }, 500 );
1787
+
1788
+ } else {
1789
+
1790
+ image
1791
+ .removeAttr( 'data-lazy' )
1792
+ .removeClass( 'slick-loading' )
1793
+ .addClass( 'slick-lazyload-error' );
1794
+
1795
+ _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
1796
+
1797
+ _.progressiveLazyLoad();
1798
+
1799
+ }
1800
+
1801
+ };
1802
+
1803
+ imageToLoad.src = imageSource;
1804
+
1805
+ } else {
1806
+
1807
+ _.$slider.trigger('allImagesLoaded', [ _ ]);
1808
+
1809
+ }
1810
+
1811
+ };
1812
+
1813
+ Slick.prototype.refresh = function( initializing ) {
1814
+
1815
+ var _ = this, currentSlide, lastVisibleIndex;
1816
+
1817
+ lastVisibleIndex = _.slideCount - _.options.slidesToShow;
1818
+
1819
+ // in non-infinite sliders, we don't want to go past the
1820
+ // last visible index.
1821
+ if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
1822
+ _.currentSlide = lastVisibleIndex;
1823
+ }
1824
+
1825
+ // if less slides than to show, go to start.
1826
+ if ( _.slideCount <= _.options.slidesToShow ) {
1827
+ _.currentSlide = 0;
1828
+
1829
+ }
1830
+
1831
+ currentSlide = _.currentSlide;
1832
+
1833
+ _.destroy(true);
1834
+
1835
+ $.extend(_, _.initials, { currentSlide: currentSlide });
1836
+
1837
+ _.init();
1838
+
1839
+ if( !initializing ) {
1840
+
1841
+ _.changeSlide({
1842
+ data: {
1843
+ message: 'index',
1844
+ index: currentSlide
1845
+ }
1846
+ }, false);
1847
+
1848
+ }
1849
+
1850
+ };
1851
+
1852
+ Slick.prototype.registerBreakpoints = function() {
1853
+
1854
+ var _ = this, breakpoint, currentBreakpoint, l,
1855
+ responsiveSettings = _.options.responsive || null;
1856
+
1857
+ if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
1858
+
1859
+ _.respondTo = _.options.respondTo || 'window';
1860
+
1861
+ for ( breakpoint in responsiveSettings ) {
1862
+
1863
+ l = _.breakpoints.length-1;
1864
+
1865
+ if (responsiveSettings.hasOwnProperty(breakpoint)) {
1866
+ currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
1867
+
1868
+ // loop through the breakpoints and cut out any existing
1869
+ // ones with the same breakpoint number, we don't want dupes.
1870
+ while( l >= 0 ) {
1871
+ if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
1872
+ _.breakpoints.splice(l,1);
1873
+ }
1874
+ l--;
1875
+ }
1876
+
1877
+ _.breakpoints.push(currentBreakpoint);
1878
+ _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
1879
+
1880
+ }
1881
+
1882
+ }
1883
+
1884
+ _.breakpoints.sort(function(a, b) {
1885
+ return ( _.options.mobileFirst ) ? a-b : b-a;
1886
+ });
1887
+
1888
+ }
1889
+
1890
+ };
1891
+
1892
+ Slick.prototype.reinit = function() {
1893
+
1894
+ var _ = this;
1895
+
1896
+ _.$slides =
1897
+ _.$slideTrack
1898
+ .children(_.options.slide)
1899
+ .addClass('slick-slide');
1900
+
1901
+ _.slideCount = _.$slides.length;
1902
+
1903
+ if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1904
+ _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1905
+ }
1906
+
1907
+ if (_.slideCount <= _.options.slidesToShow) {
1908
+ _.currentSlide = 0;
1909
+ }
1910
+
1911
+ _.registerBreakpoints();
1912
+
1913
+ _.setProps();
1914
+ _.setupInfinite();
1915
+ _.buildArrows();
1916
+ _.updateArrows();
1917
+ _.initArrowEvents();
1918
+ _.buildDots();
1919
+ _.updateDots();
1920
+ _.initDotEvents();
1921
+ _.cleanUpSlideEvents();
1922
+ _.initSlideEvents();
1923
+
1924
+ _.checkResponsive(false, true);
1925
+
1926
+ if (_.options.focusOnSelect === true) {
1927
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1928
+ }
1929
+
1930
+ _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
1931
+
1932
+ _.setPosition();
1933
+ _.focusHandler();
1934
+
1935
+ _.paused = !_.options.autoplay;
1936
+ _.autoPlay();
1937
+
1938
+ _.$slider.trigger('reInit', [_]);
1939
+
1940
+ };
1941
+
1942
+ Slick.prototype.resize = function() {
1943
+
1944
+ var _ = this;
1945
+
1946
+ if ($(window).width() !== _.windowWidth) {
1947
+ clearTimeout(_.windowDelay);
1948
+ _.windowDelay = window.setTimeout(function() {
1949
+ _.windowWidth = $(window).width();
1950
+ _.checkResponsive();
1951
+ if( !_.unslicked ) { _.setPosition(); }
1952
+ }, 50);
1953
+ }
1954
+ };
1955
+
1956
+ Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1957
+
1958
+ var _ = this;
1959
+
1960
+ if (typeof(index) === 'boolean') {
1961
+ removeBefore = index;
1962
+ index = removeBefore === true ? 0 : _.slideCount - 1;
1963
+ } else {
1964
+ index = removeBefore === true ? --index : index;
1965
+ }
1966
+
1967
+ if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1968
+ return false;
1969
+ }
1970
+
1971
+ _.unload();
1972
+
1973
+ if (removeAll === true) {
1974
+ _.$slideTrack.children().remove();
1975
+ } else {
1976
+ _.$slideTrack.children(this.options.slide).eq(index).remove();
1977
+ }
1978
+
1979
+ _.$slides = _.$slideTrack.children(this.options.slide);
1980
+
1981
+ _.$slideTrack.children(this.options.slide).detach();
1982
+
1983
+ _.$slideTrack.append(_.$slides);
1984
+
1985
+ _.$slidesCache = _.$slides;
1986
+
1987
+ _.reinit();
1988
+
1989
+ };
1990
+
1991
+ Slick.prototype.setCSS = function(position) {
1992
+
1993
+ var _ = this,
1994
+ positionProps = {},
1995
+ x, y;
1996
+
1997
+ if (_.options.rtl === true) {
1998
+ position = -position;
1999
+ }
2000
+ x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
2001
+ y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
2002
+
2003
+ positionProps[_.positionProp] = position;
2004
+
2005
+ if (_.transformsEnabled === false) {
2006
+ _.$slideTrack.css(positionProps);
2007
+ } else {
2008
+ positionProps = {};
2009
+ if (_.cssTransitions === false) {
2010
+ positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
2011
+ _.$slideTrack.css(positionProps);
2012
+ } else {
2013
+ positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
2014
+ _.$slideTrack.css(positionProps);
2015
+ }
2016
+ }
2017
+
2018
+ };
2019
+
2020
+ Slick.prototype.setDimensions = function() {
2021
+
2022
+ var _ = this;
2023
+
2024
+ if (_.options.vertical === false) {
2025
+ if (_.options.centerMode === true) {
2026
+ _.$list.css({
2027
+ padding: ('0px ' + _.options.centerPadding)
2028
+ });
2029
+ }
2030
+ } else {
2031
+ _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
2032
+ if (_.options.centerMode === true) {
2033
+ _.$list.css({
2034
+ padding: (_.options.centerPadding + ' 0px')
2035
+ });
2036
+ }
2037
+ }
2038
+
2039
+ _.listWidth = _.$list.width();
2040
+ _.listHeight = _.$list.height();
2041
+
2042
+
2043
+ if (_.options.vertical === false && _.options.variableWidth === false) {
2044
+ _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
2045
+ _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
2046
+
2047
+ } else if (_.options.variableWidth === true) {
2048
+ _.$slideTrack.width(5000 * _.slideCount);
2049
+ } else {
2050
+ _.slideWidth = Math.ceil(_.listWidth);
2051
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
2052
+ }
2053
+
2054
+ var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
2055
+ if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
2056
+
2057
+ };
2058
+
2059
+ Slick.prototype.setFade = function() {
2060
+
2061
+ var _ = this,
2062
+ targetLeft;
2063
+
2064
+ _.$slides.each(function(index, element) {
2065
+ targetLeft = (_.slideWidth * index) * -1;
2066
+ if (_.options.rtl === true) {
2067
+ $(element).css({
2068
+ position: 'relative',
2069
+ right: targetLeft,
2070
+ top: 0,
2071
+ zIndex: _.options.zIndex - 2,
2072
+ opacity: 0
2073
+ });
2074
+ } else {
2075
+ $(element).css({
2076
+ position: 'relative',
2077
+ left: targetLeft,
2078
+ top: 0,
2079
+ zIndex: _.options.zIndex - 2,
2080
+ opacity: 0
2081
+ });
2082
+ }
2083
+ });
2084
+
2085
+ _.$slides.eq(_.currentSlide).css({
2086
+ zIndex: _.options.zIndex - 1,
2087
+ opacity: 1
2088
+ });
2089
+
2090
+ };
2091
+
2092
+ Slick.prototype.setHeight = function() {
2093
+
2094
+ var _ = this;
2095
+
2096
+ if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
2097
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
2098
+ _.$list.css('height', targetHeight);
2099
+ }
2100
+
2101
+ };
2102
+
2103
+ Slick.prototype.setOption =
2104
+ Slick.prototype.slickSetOption = function() {
2105
+
2106
+ /**
2107
+ * accepts arguments in format of:
2108
+ *
2109
+ * - for changing a single option's value:
2110
+ * .slick("setOption", option, value, refresh )
2111
+ *
2112
+ * - for changing a set of responsive options:
2113
+ * .slick("setOption", 'responsive', [{}, ...], refresh )
2114
+ *
2115
+ * - for updating multiple values at once (not responsive)
2116
+ * .slick("setOption", { 'option': value, ... }, refresh )
2117
+ */
2118
+
2119
+ var _ = this, l, item, option, value, refresh = false, type;
2120
+
2121
+ if( $.type( arguments[0] ) === 'object' ) {
2122
+
2123
+ option = arguments[0];
2124
+ refresh = arguments[1];
2125
+ type = 'multiple';
2126
+
2127
+ } else if ( $.type( arguments[0] ) === 'string' ) {
2128
+
2129
+ option = arguments[0];
2130
+ value = arguments[1];
2131
+ refresh = arguments[2];
2132
+
2133
+ if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
2134
+
2135
+ type = 'responsive';
2136
+
2137
+ } else if ( typeof arguments[1] !== 'undefined' ) {
2138
+
2139
+ type = 'single';
2140
+
2141
+ }
2142
+
2143
+ }
2144
+
2145
+ if ( type === 'single' ) {
2146
+
2147
+ _.options[option] = value;
2148
+
2149
+
2150
+ } else if ( type === 'multiple' ) {
2151
+
2152
+ $.each( option , function( opt, val ) {
2153
+
2154
+ _.options[opt] = val;
2155
+
2156
+ });
2157
+
2158
+
2159
+ } else if ( type === 'responsive' ) {
2160
+
2161
+ for ( item in value ) {
2162
+
2163
+ if( $.type( _.options.responsive ) !== 'array' ) {
2164
+
2165
+ _.options.responsive = [ value[item] ];
2166
+
2167
+ } else {
2168
+
2169
+ l = _.options.responsive.length-1;
2170
+
2171
+ // loop through the responsive object and splice out duplicates.
2172
+ while( l >= 0 ) {
2173
+
2174
+ if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
2175
+
2176
+ _.options.responsive.splice(l,1);
2177
+
2178
+ }
2179
+
2180
+ l--;
2181
+
2182
+ }
2183
+
2184
+ _.options.responsive.push( value[item] );
2185
+
2186
+ }
2187
+
2188
+ }
2189
+
2190
+ }
2191
+
2192
+ if ( refresh ) {
2193
+
2194
+ _.unload();
2195
+ _.reinit();
2196
+
2197
+ }
2198
+
2199
+ };
2200
+
2201
+ Slick.prototype.setPosition = function() {
2202
+
2203
+ var _ = this;
2204
+
2205
+ _.setDimensions();
2206
+
2207
+ _.setHeight();
2208
+
2209
+ if (_.options.fade === false) {
2210
+ _.setCSS(_.getLeft(_.currentSlide));
2211
+ } else {
2212
+ _.setFade();
2213
+ }
2214
+
2215
+ _.$slider.trigger('setPosition', [_]);
2216
+
2217
+ };
2218
+
2219
+ Slick.prototype.setProps = function() {
2220
+
2221
+ var _ = this,
2222
+ bodyStyle = document.body.style;
2223
+
2224
+ _.positionProp = _.options.vertical === true ? 'top' : 'left';
2225
+
2226
+ if (_.positionProp === 'top') {
2227
+ _.$slider.addClass('slick-vertical');
2228
+ } else {
2229
+ _.$slider.removeClass('slick-vertical');
2230
+ }
2231
+
2232
+ if (bodyStyle.WebkitTransition !== undefined ||
2233
+ bodyStyle.MozTransition !== undefined ||
2234
+ bodyStyle.msTransition !== undefined) {
2235
+ if (_.options.useCSS === true) {
2236
+ _.cssTransitions = true;
2237
+ }
2238
+ }
2239
+
2240
+ if ( _.options.fade ) {
2241
+ if ( typeof _.options.zIndex === 'number' ) {
2242
+ if( _.options.zIndex < 3 ) {
2243
+ _.options.zIndex = 3;
2244
+ }
2245
+ } else {
2246
+ _.options.zIndex = _.defaults.zIndex;
2247
+ }
2248
+ }
2249
+
2250
+ if (bodyStyle.OTransform !== undefined) {
2251
+ _.animType = 'OTransform';
2252
+ _.transformType = '-o-transform';
2253
+ _.transitionType = 'OTransition';
2254
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2255
+ }
2256
+ if (bodyStyle.MozTransform !== undefined) {
2257
+ _.animType = 'MozTransform';
2258
+ _.transformType = '-moz-transform';
2259
+ _.transitionType = 'MozTransition';
2260
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
2261
+ }
2262
+ if (bodyStyle.webkitTransform !== undefined) {
2263
+ _.animType = 'webkitTransform';
2264
+ _.transformType = '-webkit-transform';
2265
+ _.transitionType = 'webkitTransition';
2266
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
2267
+ }
2268
+ if (bodyStyle.msTransform !== undefined) {
2269
+ _.animType = 'msTransform';
2270
+ _.transformType = '-ms-transform';
2271
+ _.transitionType = 'msTransition';
2272
+ if (bodyStyle.msTransform === undefined) _.animType = false;
2273
+ }
2274
+ if (bodyStyle.transform !== undefined && _.animType !== false) {
2275
+ _.animType = 'transform';
2276
+ _.transformType = 'transform';
2277
+ _.transitionType = 'transition';
2278
+ }
2279
+ _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
2280
+ };
2281
+
2282
+
2283
+ Slick.prototype.setSlideClasses = function(index) {
2284
+
2285
+ var _ = this,
2286
+ centerOffset, allSlides, indexOffset, remainder;
2287
+
2288
+ allSlides = _.$slider
2289
+ .find('.slick-slide')
2290
+ .removeClass('slick-active slick-center slick-current')
2291
+ .attr('aria-hidden', 'true');
2292
+
2293
+ _.$slides
2294
+ .eq(index)
2295
+ .addClass('slick-current');
2296
+
2297
+ if (_.options.centerMode === true) {
2298
+
2299
+ var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;
2300
+
2301
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
2302
+
2303
+ if (_.options.infinite === true) {
2304
+
2305
+ if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
2306
+ _.$slides
2307
+ .slice(index - centerOffset + evenCoef, index + centerOffset + 1)
2308
+ .addClass('slick-active')
2309
+ .attr('aria-hidden', 'false');
2310
+
2311
+ } else {
2312
+
2313
+ indexOffset = _.options.slidesToShow + index;
2314
+ allSlides
2315
+ .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2)
2316
+ .addClass('slick-active')
2317
+ .attr('aria-hidden', 'false');
2318
+
2319
+ }
2320
+
2321
+ if (index === 0) {
2322
+
2323
+ allSlides
2324
+ .eq(allSlides.length - 1 - _.options.slidesToShow)
2325
+ .addClass('slick-center');
2326
+
2327
+ } else if (index === _.slideCount - 1) {
2328
+
2329
+ allSlides
2330
+ .eq(_.options.slidesToShow)
2331
+ .addClass('slick-center');
2332
+
2333
+ }
2334
+
2335
+ }
2336
+
2337
+ _.$slides
2338
+ .eq(index)
2339
+ .addClass('slick-center');
2340
+
2341
+ } else {
2342
+
2343
+ if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
2344
+
2345
+ _.$slides
2346
+ .slice(index, index + _.options.slidesToShow)
2347
+ .addClass('slick-active')
2348
+ .attr('aria-hidden', 'false');
2349
+
2350
+ } else if (allSlides.length <= _.options.slidesToShow) {
2351
+
2352
+ allSlides
2353
+ .addClass('slick-active')
2354
+ .attr('aria-hidden', 'false');
2355
+
2356
+ } else {
2357
+
2358
+ remainder = _.slideCount % _.options.slidesToShow;
2359
+ indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
2360
+
2361
+ if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
2362
+
2363
+ allSlides
2364
+ .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
2365
+ .addClass('slick-active')
2366
+ .attr('aria-hidden', 'false');
2367
+
2368
+ } else {
2369
+
2370
+ allSlides
2371
+ .slice(indexOffset, indexOffset + _.options.slidesToShow)
2372
+ .addClass('slick-active')
2373
+ .attr('aria-hidden', 'false');
2374
+
2375
+ }
2376
+
2377
+ }
2378
+
2379
+ }
2380
+
2381
+ if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') {
2382
+ _.lazyLoad();
2383
+ }
2384
+ };
2385
+
2386
+ Slick.prototype.setupInfinite = function() {
2387
+
2388
+ var _ = this,
2389
+ i, slideIndex, infiniteCount;
2390
+
2391
+ if (_.options.fade === true) {
2392
+ _.options.centerMode = false;
2393
+ }
2394
+
2395
+ if (_.options.infinite === true && _.options.fade === false) {
2396
+
2397
+ slideIndex = null;
2398
+
2399
+ if (_.slideCount > _.options.slidesToShow) {
2400
+
2401
+ if (_.options.centerMode === true) {
2402
+ infiniteCount = _.options.slidesToShow + 1;
2403
+ } else {
2404
+ infiniteCount = _.options.slidesToShow;
2405
+ }
2406
+
2407
+ for (i = _.slideCount; i > (_.slideCount -
2408
+ infiniteCount); i -= 1) {
2409
+ slideIndex = i - 1;
2410
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
2411
+ .attr('data-slick-index', slideIndex - _.slideCount)
2412
+ .prependTo(_.$slideTrack).addClass('slick-cloned');
2413
+ }
2414
+ for (i = 0; i < infiniteCount + _.slideCount; i += 1) {
2415
+ slideIndex = i;
2416
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
2417
+ .attr('data-slick-index', slideIndex + _.slideCount)
2418
+ .appendTo(_.$slideTrack).addClass('slick-cloned');
2419
+ }
2420
+ _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
2421
+ $(this).attr('id', '');
2422
+ });
2423
+
2424
+ }
2425
+
2426
+ }
2427
+
2428
+ };
2429
+
2430
+ Slick.prototype.interrupt = function( toggle ) {
2431
+
2432
+ var _ = this;
2433
+
2434
+ if( !toggle ) {
2435
+ _.autoPlay();
2436
+ }
2437
+ _.interrupted = toggle;
2438
+
2439
+ };
2440
+
2441
+ Slick.prototype.selectHandler = function(event) {
2442
+
2443
+ var _ = this;
2444
+
2445
+ var targetElement =
2446
+ $(event.target).is('.slick-slide') ?
2447
+ $(event.target) :
2448
+ $(event.target).parents('.slick-slide');
2449
+
2450
+ var index = parseInt(targetElement.attr('data-slick-index'));
2451
+
2452
+ if (!index) index = 0;
2453
+
2454
+ if (_.slideCount <= _.options.slidesToShow) {
2455
+
2456
+ _.slideHandler(index, false, true);
2457
+ return;
2458
+
2459
+ }
2460
+
2461
+ _.slideHandler(index);
2462
+
2463
+ };
2464
+
2465
+ Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
2466
+
2467
+ var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
2468
+ _ = this, navTarget;
2469
+
2470
+ sync = sync || false;
2471
+
2472
+ if (_.animating === true && _.options.waitForAnimate === true) {
2473
+ return;
2474
+ }
2475
+
2476
+ if (_.options.fade === true && _.currentSlide === index) {
2477
+ return;
2478
+ }
2479
+
2480
+ if (sync === false) {
2481
+ _.asNavFor(index);
2482
+ }
2483
+
2484
+ targetSlide = index;
2485
+ targetLeft = _.getLeft(targetSlide);
2486
+ slideLeft = _.getLeft(_.currentSlide);
2487
+
2488
+ _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
2489
+
2490
+ if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
2491
+ if (_.options.fade === false) {
2492
+ targetSlide = _.currentSlide;
2493
+ if (dontAnimate !== true) {
2494
+ _.animateSlide(slideLeft, function() {
2495
+ _.postSlide(targetSlide);
2496
+ });
2497
+ } else {
2498
+ _.postSlide(targetSlide);
2499
+ }
2500
+ }
2501
+ return;
2502
+ } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
2503
+ if (_.options.fade === false) {
2504
+ targetSlide = _.currentSlide;
2505
+ if (dontAnimate !== true) {
2506
+ _.animateSlide(slideLeft, function() {
2507
+ _.postSlide(targetSlide);
2508
+ });
2509
+ } else {
2510
+ _.postSlide(targetSlide);
2511
+ }
2512
+ }
2513
+ return;
2514
+ }
2515
+
2516
+ if ( _.options.autoplay ) {
2517
+ clearInterval(_.autoPlayTimer);
2518
+ }
2519
+
2520
+ if (targetSlide < 0) {
2521
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
2522
+ animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
2523
+ } else {
2524
+ animSlide = _.slideCount + targetSlide;
2525
+ }
2526
+ } else if (targetSlide >= _.slideCount) {
2527
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
2528
+ animSlide = 0;
2529
+ } else {
2530
+ animSlide = targetSlide - _.slideCount;
2531
+ }
2532
+ } else {
2533
+ animSlide = targetSlide;
2534
+ }
2535
+
2536
+ _.animating = true;
2537
+
2538
+ _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
2539
+
2540
+ oldSlide = _.currentSlide;
2541
+ _.currentSlide = animSlide;
2542
+
2543
+ _.setSlideClasses(_.currentSlide);
2544
+
2545
+ if ( _.options.asNavFor ) {
2546
+
2547
+ navTarget = _.getNavTarget();
2548
+ navTarget = navTarget.slick('getSlick');
2549
+
2550
+ if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
2551
+ navTarget.setSlideClasses(_.currentSlide);
2552
+ }
2553
+
2554
+ }
2555
+
2556
+ _.updateDots();
2557
+ _.updateArrows();
2558
+
2559
+ if (_.options.fade === true) {
2560
+ if (dontAnimate !== true) {
2561
+
2562
+ _.fadeSlideOut(oldSlide);
2563
+
2564
+ _.fadeSlide(animSlide, function() {
2565
+ _.postSlide(animSlide);
2566
+ });
2567
+
2568
+ } else {
2569
+ _.postSlide(animSlide);
2570
+ }
2571
+ _.animateHeight();
2572
+ return;
2573
+ }
2574
+
2575
+ if (dontAnimate !== true) {
2576
+ _.animateSlide(targetLeft, function() {
2577
+ _.postSlide(animSlide);
2578
+ });
2579
+ } else {
2580
+ _.postSlide(animSlide);
2581
+ }
2582
+
2583
+ };
2584
+
2585
+ Slick.prototype.startLoad = function() {
2586
+
2587
+ var _ = this;
2588
+
2589
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2590
+
2591
+ _.$prevArrow.hide();
2592
+ _.$nextArrow.hide();
2593
+
2594
+ }
2595
+
2596
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2597
+
2598
+ _.$dots.hide();
2599
+
2600
+ }
2601
+
2602
+ _.$slider.addClass('slick-loading');
2603
+
2604
+ };
2605
+
2606
+ Slick.prototype.swipeDirection = function() {
2607
+
2608
+ var xDist, yDist, r, swipeAngle, _ = this;
2609
+
2610
+ xDist = _.touchObject.startX - _.touchObject.curX;
2611
+ yDist = _.touchObject.startY - _.touchObject.curY;
2612
+ r = Math.atan2(yDist, xDist);
2613
+
2614
+ swipeAngle = Math.round(r * 180 / Math.PI);
2615
+ if (swipeAngle < 0) {
2616
+ swipeAngle = 360 - Math.abs(swipeAngle);
2617
+ }
2618
+
2619
+ if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
2620
+ return (_.options.rtl === false ? 'left' : 'right');
2621
+ }
2622
+ if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
2623
+ return (_.options.rtl === false ? 'left' : 'right');
2624
+ }
2625
+ if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
2626
+ return (_.options.rtl === false ? 'right' : 'left');
2627
+ }
2628
+ if (_.options.verticalSwiping === true) {
2629
+ if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
2630
+ return 'down';
2631
+ } else {
2632
+ return 'up';
2633
+ }
2634
+ }
2635
+
2636
+ return 'vertical';
2637
+
2638
+ };
2639
+
2640
+ Slick.prototype.swipeEnd = function(event) {
2641
+
2642
+ var _ = this,
2643
+ slideCount,
2644
+ direction;
2645
+
2646
+ _.dragging = false;
2647
+ _.swiping = false;
2648
+
2649
+ if (_.scrolling) {
2650
+ _.scrolling = false;
2651
+ return false;
2652
+ }
2653
+
2654
+ _.interrupted = false;
2655
+ _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
2656
+
2657
+ if ( _.touchObject.curX === undefined ) {
2658
+ return false;
2659
+ }
2660
+
2661
+ if ( _.touchObject.edgeHit === true ) {
2662
+ _.$slider.trigger('edge', [_, _.swipeDirection() ]);
2663
+ }
2664
+
2665
+ if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
2666
+
2667
+ direction = _.swipeDirection();
2668
+
2669
+ switch ( direction ) {
2670
+
2671
+ case 'left':
2672
+ case 'down':
2673
+
2674
+ slideCount =
2675
+ _.options.swipeToSlide ?
2676
+ _.checkNavigable( _.currentSlide + _.getSlideCount() ) :
2677
+ _.currentSlide + _.getSlideCount();
2678
+
2679
+ _.currentDirection = 0;
2680
+
2681
+ break;
2682
+
2683
+ case 'right':
2684
+ case 'up':
2685
+
2686
+ slideCount =
2687
+ _.options.swipeToSlide ?
2688
+ _.checkNavigable( _.currentSlide - _.getSlideCount() ) :
2689
+ _.currentSlide - _.getSlideCount();
2690
+
2691
+ _.currentDirection = 1;
2692
+
2693
+ break;
2694
+
2695
+ default:
2696
+
2697
+
2698
+ }
2699
+
2700
+ if( direction != 'vertical' ) {
2701
+
2702
+ _.slideHandler( slideCount );
2703
+ _.touchObject = {};
2704
+ _.$slider.trigger('swipe', [_, direction ]);
2705
+
2706
+ }
2707
+
2708
+ } else {
2709
+
2710
+ if ( _.touchObject.startX !== _.touchObject.curX ) {
2711
+
2712
+ _.slideHandler( _.currentSlide );
2713
+ _.touchObject = {};
2714
+
2715
+ }
2716
+
2717
+ }
2718
+
2719
+ };
2720
+
2721
+ Slick.prototype.swipeHandler = function(event) {
2722
+
2723
+ var _ = this;
2724
+
2725
+ if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
2726
+ return;
2727
+ } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
2728
+ return;
2729
+ }
2730
+
2731
+ _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
2732
+ event.originalEvent.touches.length : 1;
2733
+
2734
+ _.touchObject.minSwipe = _.listWidth / _.options
2735
+ .touchThreshold;
2736
+
2737
+ if (_.options.verticalSwiping === true) {
2738
+ _.touchObject.minSwipe = _.listHeight / _.options
2739
+ .touchThreshold;
2740
+ }
2741
+
2742
+ switch (event.data.action) {
2743
+
2744
+ case 'start':
2745
+ _.swipeStart(event);
2746
+ break;
2747
+
2748
+ case 'move':
2749
+ _.swipeMove(event);
2750
+ break;
2751
+
2752
+ case 'end':
2753
+ _.swipeEnd(event);
2754
+ break;
2755
+
2756
+ }
2757
+
2758
+ };
2759
+
2760
+ Slick.prototype.swipeMove = function(event) {
2761
+
2762
+ var _ = this,
2763
+ edgeWasHit = false,
2764
+ curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength;
2765
+
2766
+ touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
2767
+
2768
+ if (!_.dragging || _.scrolling || touches && touches.length !== 1) {
2769
+ return false;
2770
+ }
2771
+
2772
+ curLeft = _.getLeft(_.currentSlide);
2773
+
2774
+ _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
2775
+ _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
2776
+
2777
+ _.touchObject.swipeLength = Math.round(Math.sqrt(
2778
+ Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
2779
+
2780
+ verticalSwipeLength = Math.round(Math.sqrt(
2781
+ Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
2782
+
2783
+ if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) {
2784
+ _.scrolling = true;
2785
+ return false;
2786
+ }
2787
+
2788
+ if (_.options.verticalSwiping === true) {
2789
+ _.touchObject.swipeLength = verticalSwipeLength;
2790
+ }
2791
+
2792
+ swipeDirection = _.swipeDirection();
2793
+
2794
+ if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
2795
+ _.swiping = true;
2796
+ event.preventDefault();
2797
+ }
2798
+
2799
+ positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
2800
+ if (_.options.verticalSwiping === true) {
2801
+ positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
2802
+ }
2803
+
2804
+
2805
+ swipeLength = _.touchObject.swipeLength;
2806
+
2807
+ _.touchObject.edgeHit = false;
2808
+
2809
+ if (_.options.infinite === false) {
2810
+ if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
2811
+ swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
2812
+ _.touchObject.edgeHit = true;
2813
+ }
2814
+ }
2815
+
2816
+ if (_.options.vertical === false) {
2817
+ _.swipeLeft = curLeft + swipeLength * positionOffset;
2818
+ } else {
2819
+ _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2820
+ }
2821
+ if (_.options.verticalSwiping === true) {
2822
+ _.swipeLeft = curLeft + swipeLength * positionOffset;
2823
+ }
2824
+
2825
+ if (_.options.fade === true || _.options.touchMove === false) {
2826
+ return false;
2827
+ }
2828
+
2829
+ if (_.animating === true) {
2830
+ _.swipeLeft = null;
2831
+ return false;
2832
+ }
2833
+
2834
+ _.setCSS(_.swipeLeft);
2835
+
2836
+ };
2837
+
2838
+ Slick.prototype.swipeStart = function(event) {
2839
+
2840
+ var _ = this,
2841
+ touches;
2842
+
2843
+ _.interrupted = true;
2844
+
2845
+ if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2846
+ _.touchObject = {};
2847
+ return false;
2848
+ }
2849
+
2850
+ if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2851
+ touches = event.originalEvent.touches[0];
2852
+ }
2853
+
2854
+ _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2855
+ _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2856
+
2857
+ _.dragging = true;
2858
+
2859
+ };
2860
+
2861
+ Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2862
+
2863
+ var _ = this;
2864
+
2865
+ if (_.$slidesCache !== null) {
2866
+
2867
+ _.unload();
2868
+
2869
+ _.$slideTrack.children(this.options.slide).detach();
2870
+
2871
+ _.$slidesCache.appendTo(_.$slideTrack);
2872
+
2873
+ _.reinit();
2874
+
2875
+ }
2876
+
2877
+ };
2878
+
2879
+ Slick.prototype.unload = function() {
2880
+
2881
+ var _ = this;
2882
+
2883
+ $('.slick-cloned', _.$slider).remove();
2884
+
2885
+ if (_.$dots) {
2886
+ _.$dots.remove();
2887
+ }
2888
+
2889
+ if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
2890
+ _.$prevArrow.remove();
2891
+ }
2892
+
2893
+ if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
2894
+ _.$nextArrow.remove();
2895
+ }
2896
+
2897
+ _.$slides
2898
+ .removeClass('slick-slide slick-active slick-visible slick-current')
2899
+ .attr('aria-hidden', 'true')
2900
+ .css('width', '');
2901
+
2902
+ };
2903
+
2904
+ Slick.prototype.unslick = function(fromBreakpoint) {
2905
+
2906
+ var _ = this;
2907
+ _.$slider.trigger('unslick', [_, fromBreakpoint]);
2908
+ _.destroy();
2909
+
2910
+ };
2911
+
2912
+ Slick.prototype.updateArrows = function() {
2913
+
2914
+ var _ = this,
2915
+ centerOffset;
2916
+
2917
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
2918
+
2919
+ if ( _.options.arrows === true &&
2920
+ _.slideCount > _.options.slidesToShow &&
2921
+ !_.options.infinite ) {
2922
+
2923
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2924
+ _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2925
+
2926
+ if (_.currentSlide === 0) {
2927
+
2928
+ _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2929
+ _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2930
+
2931
+ } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2932
+
2933
+ _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2934
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2935
+
2936
+ } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2937
+
2938
+ _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2939
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2940
+
2941
+ }
2942
+
2943
+ }
2944
+
2945
+ };
2946
+
2947
+ Slick.prototype.updateDots = function() {
2948
+
2949
+ var _ = this;
2950
+
2951
+ if (_.$dots !== null) {
2952
+
2953
+ _.$dots
2954
+ .find('li')
2955
+ .removeClass('slick-active')
2956
+ .end();
2957
+
2958
+ _.$dots
2959
+ .find('li')
2960
+ .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
2961
+ .addClass('slick-active');
2962
+
2963
+ }
2964
+
2965
+ };
2966
+
2967
+ Slick.prototype.visibility = function() {
2968
+
2969
+ var _ = this;
2970
+
2971
+ if ( _.options.autoplay ) {
2972
+
2973
+ if ( document[_.hidden] ) {
2974
+
2975
+ _.interrupted = true;
2976
+
2977
+ } else {
2978
+
2979
+ _.interrupted = false;
2980
+
2981
+ }
2982
+
2983
+ }
2984
+
2985
+ };
2986
+
2987
+ $.fn.slick = function() {
2988
+ var _ = this,
2989
+ opt = arguments[0],
2990
+ args = Array.prototype.slice.call(arguments, 1),
2991
+ l = _.length,
2992
+ i,
2993
+ ret;
2994
+ for (i = 0; i < l; i++) {
2995
+ if (typeof opt == 'object' || typeof opt == 'undefined')
2996
+ _[i].slick = new Slick(_[i], opt);
2997
+ else
2998
+ ret = _[i].slick[opt].apply(_[i].slick, args);
2999
+ if (typeof ret != 'undefined') return ret;
3000
+ }
3001
+ return _;
3002
+ };
3003
+
3004
+ }));
assets/{js → lib}/slick/slick.less RENAMED
@@ -1,100 +1,100 @@
1
- /* Slider */
2
-
3
- .slick-slider {
4
- position: relative;
5
- display: block;
6
- box-sizing: border-box;
7
- -webkit-touch-callout: none;
8
- -webkit-user-select: none;
9
- -khtml-user-select: none;
10
- -moz-user-select: none;
11
- -ms-user-select: none;
12
- user-select: none;
13
- -ms-touch-action: pan-y;
14
- touch-action: pan-y;
15
- -webkit-tap-highlight-color: transparent;
16
- }
17
- .slick-list {
18
- position: relative;
19
- overflow: hidden;
20
- display: block;
21
- margin: 0;
22
- padding: 0;
23
-
24
- &:focus {
25
- outline: none;
26
- }
27
-
28
- &.dragging {
29
- cursor: pointer;
30
- cursor: hand;
31
- }
32
- }
33
- .slick-slider .slick-track,
34
- .slick-slider .slick-list {
35
- -webkit-transform: translate3d(0, 0, 0);
36
- -moz-transform: translate3d(0, 0, 0);
37
- -ms-transform: translate3d(0, 0, 0);
38
- -o-transform: translate3d(0, 0, 0);
39
- transform: translate3d(0, 0, 0);
40
- }
41
-
42
- .slick-track {
43
- position: relative;
44
- left: 0;
45
- top: 0;
46
- display: block;
47
- margin-left: auto;
48
- margin-right: auto;
49
-
50
- &:before,
51
- &:after {
52
- content: "";
53
- display: table;
54
- }
55
-
56
- &:after {
57
- clear: both;
58
- }
59
-
60
- .slick-loading & {
61
- visibility: hidden;
62
- }
63
- }
64
- .slick-slide {
65
- float: left;
66
- height: 100%;
67
- min-height: 1px;
68
- [dir="rtl"] & {
69
- float: right;
70
- }
71
- img {
72
- display: block;
73
- }
74
- &.slick-loading img {
75
- display: none;
76
- }
77
-
78
- display: none;
79
-
80
- &.dragging img {
81
- pointer-events: none;
82
- }
83
-
84
- .slick-initialized & {
85
- display: block;
86
- }
87
-
88
- .slick-loading & {
89
- visibility: hidden;
90
- }
91
-
92
- .slick-vertical & {
93
- display: block;
94
- height: auto;
95
- border: 1px solid transparent;
96
- }
97
- }
98
- .slick-arrow.slick-hidden {
99
- display: none;
100
- }
1
+ /* Slider */
2
+
3
+ .slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ -webkit-touch-callout: none;
8
+ -webkit-user-select: none;
9
+ -khtml-user-select: none;
10
+ -moz-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+ -ms-touch-action: pan-y;
14
+ touch-action: pan-y;
15
+ -webkit-tap-highlight-color: transparent;
16
+ }
17
+ .slick-list {
18
+ position: relative;
19
+ overflow: hidden;
20
+ display: block;
21
+ margin: 0;
22
+ padding: 0;
23
+
24
+ &:focus {
25
+ outline: none;
26
+ }
27
+
28
+ &.dragging {
29
+ cursor: pointer;
30
+ cursor: hand;
31
+ }
32
+ }
33
+ .slick-slider .slick-track,
34
+ .slick-slider .slick-list {
35
+ -webkit-transform: translate3d(0, 0, 0);
36
+ -moz-transform: translate3d(0, 0, 0);
37
+ -ms-transform: translate3d(0, 0, 0);
38
+ -o-transform: translate3d(0, 0, 0);
39
+ transform: translate3d(0, 0, 0);
40
+ }
41
+
42
+ .slick-track {
43
+ position: relative;
44
+ left: 0;
45
+ top: 0;
46
+ display: block;
47
+ margin-left: auto;
48
+ margin-right: auto;
49
+
50
+ &:before,
51
+ &:after {
52
+ content: "";
53
+ display: table;
54
+ }
55
+
56
+ &:after {
57
+ clear: both;
58
+ }
59
+
60
+ .slick-loading & {
61
+ visibility: hidden;
62
+ }
63
+ }
64
+ .slick-slide {
65
+ float: left;
66
+ height: 100%;
67
+ min-height: 1px;
68
+ [dir="rtl"] & {
69
+ float: right;
70
+ }
71
+ img {
72
+ display: block;
73
+ }
74
+ &.slick-loading img {
75
+ display: none;
76
+ }
77
+
78
+ display: none;
79
+
80
+ &.dragging img {
81
+ pointer-events: none;
82
+ }
83
+
84
+ .slick-initialized & {
85
+ display: block;
86
+ }
87
+
88
+ .slick-loading & {
89
+ visibility: hidden;
90
+ }
91
+
92
+ .slick-vertical & {
93
+ display: block;
94
+ height: auto;
95
+ border: 1px solid transparent;
96
+ }
97
+ }
98
+ .slick-arrow.slick-hidden {
99
+ display: none;
100
+ }
assets/{js → lib}/slick/slick.min.js RENAMED
@@ -1 +1 @@
1
- !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}});
1
+ !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}});
assets/{js → lib}/slick/slick.scss RENAMED
@@ -1,100 +1,100 @@
1
- /* Slider */
2
-
3
- .slick-slider {
4
- position: relative;
5
- display: block;
6
- box-sizing: border-box;
7
- -webkit-touch-callout: none;
8
- -webkit-user-select: none;
9
- -khtml-user-select: none;
10
- -moz-user-select: none;
11
- -ms-user-select: none;
12
- user-select: none;
13
- -ms-touch-action: pan-y;
14
- touch-action: pan-y;
15
- -webkit-tap-highlight-color: transparent;
16
- }
17
- .slick-list {
18
- position: relative;
19
- overflow: hidden;
20
- display: block;
21
- margin: 0;
22
- padding: 0;
23
-
24
- &:focus {
25
- outline: none;
26
- }
27
-
28
- &.dragging {
29
- cursor: pointer;
30
- cursor: hand;
31
- }
32
- }
33
- .slick-slider .slick-track,
34
- .slick-slider .slick-list {
35
- -webkit-transform: translate3d(0, 0, 0);
36
- -moz-transform: translate3d(0, 0, 0);
37
- -ms-transform: translate3d(0, 0, 0);
38
- -o-transform: translate3d(0, 0, 0);
39
- transform: translate3d(0, 0, 0);
40
- }
41
-
42
- .slick-track {
43
- position: relative;
44
- left: 0;
45
- top: 0;
46
- display: block;
47
- margin-left: auto;
48
- margin-right: auto;
49
-
50
- &:before,
51
- &:after {
52
- content: "";
53
- display: table;
54
- }
55
-
56
- &:after {
57
- clear: both;
58
- }
59
-
60
- .slick-loading & {
61
- visibility: hidden;
62
- }
63
- }
64
- .slick-slide {
65
- float: left;
66
- height: 100%;
67
- min-height: 1px;
68
- [dir="rtl"] & {
69
- float: right;
70
- }
71
- img {
72
- display: block;
73
- }
74
- &.slick-loading img {
75
- display: none;
76
- }
77
-
78
- display: none;
79
-
80
- &.dragging img {
81
- pointer-events: none;
82
- }
83
-
84
- .slick-initialized & {
85
- display: block;
86
- }
87
-
88
- .slick-loading & {
89
- visibility: hidden;
90
- }
91
-
92
- .slick-vertical & {
93
- display: block;
94
- height: auto;
95
- border: 1px solid transparent;
96
- }
97
- }
98
- .slick-arrow.slick-hidden {
99
- display: none;
100
- }
1
+ /* Slider */
2
+
3
+ .slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ -webkit-touch-callout: none;
8
+ -webkit-user-select: none;
9
+ -khtml-user-select: none;
10
+ -moz-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+ -ms-touch-action: pan-y;
14
+ touch-action: pan-y;
15
+ -webkit-tap-highlight-color: transparent;
16
+ }
17
+ .slick-list {
18
+ position: relative;
19
+ overflow: hidden;
20
+ display: block;
21
+ margin: 0;
22
+ padding: 0;
23
+
24
+ &:focus {
25
+ outline: none;
26
+ }
27
+
28
+ &.dragging {
29
+ cursor: pointer;
30
+ cursor: hand;
31
+ }
32
+ }
33
+ .slick-slider .slick-track,
34
+ .slick-slider .slick-list {
35
+ -webkit-transform: translate3d(0, 0, 0);
36
+ -moz-transform: translate3d(0, 0, 0);
37
+ -ms-transform: translate3d(0, 0, 0);
38
+ -o-transform: translate3d(0, 0, 0);
39
+ transform: translate3d(0, 0, 0);
40
+ }
41
+
42
+ .slick-track {
43
+ position: relative;
44
+ left: 0;
45
+ top: 0;
46
+ display: block;
47
+ margin-left: auto;
48
+ margin-right: auto;
49
+
50
+ &:before,
51
+ &:after {
52
+ content: "";
53
+ display: table;
54
+ }
55
+
56
+ &:after {
57
+ clear: both;
58
+ }
59
+
60
+ .slick-loading & {
61
+ visibility: hidden;
62
+ }
63
+ }
64
+ .slick-slide {
65
+ float: left;
66
+ height: 100%;
67
+ min-height: 1px;
68
+ [dir="rtl"] & {
69
+ float: right;
70
+ }
71
+ img {
72
+ display: block;
73
+ }
74
+ &.slick-loading img {
75
+ display: none;
76
+ }
77
+
78
+ display: none;
79
+
80
+ &.dragging img {
81
+ pointer-events: none;
82
+ }
83
+
84
+ .slick-initialized & {
85
+ display: block;
86
+ }
87
+
88
+ .slick-loading & {
89
+ visibility: hidden;
90
+ }
91
+
92
+ .slick-vertical & {
93
+ display: block;
94
+ height: auto;
95
+ border: 1px solid transparent;
96
+ }
97
+ }
98
+ .slick-arrow.slick-hidden {
99
+ display: none;
100
+ }
classes/admin/class-edit-brands-page.php CHANGED
@@ -1,146 +1,146 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class Edit_Brands_Page {
7
-
8
- private static $current_user;
9
-
10
- function __construct(){
11
- add_filter( 'get_terms', array( $this, 'brand_list_admin_filter' ), 10, 3 );
12
- add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
13
- add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
14
- add_action( 'wp_ajax_pwb_admin_set_featured_brand', array( $this, 'set_featured_brand' ) );
15
- add_filter( 'screen_settings', array( $this, 'add_screen_options' ), 10, 2 );
16
- add_action( 'wp_ajax_pwb_admin_save_screen_settings', array( $this, 'save_screen_options' ) );
17
- add_action( 'plugins_loaded', function(){ self::$current_user = wp_get_current_user(); } );
18
- add_action( 'after-pwb-brand-table', array( $this, 'add_brands_count' ) );
19
- }
20
-
21
- private static function is_edit_brands_page(){
22
- global $pagenow;
23
- return ( $pagenow == 'edit-tags.php' && isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] == 'pwb-brand' ) ? true : false;
24
- }
25
-
26
- public function add_brands_count( $tax_name ){
27
- $brands = get_terms(
28
- $tax_name,
29
- array( 'hide_empty' => false )
30
- );
31
- $brands_featured = get_terms(
32
- $tax_name,
33
- array( 'hide_empty' => false, 'meta_query' => array( array( 'key' => 'pwb_featured_brand', 'value' => true ) ) )
34
- );
35
-
36
- \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
37
- 'edit-brands-bottom',
38
- 'admin',
39
- array( 'featured_count' => count( $brands_featured ), 'text_featured' => __('featured', 'perfect-woocommerce-brands') )
40
- );
41
-
42
- }
43
-
44
- public function brand_list_admin_filter( $brands, $taxonomies, $args ) {
45
-
46
- if( self::is_edit_brands_page() ){
47
-
48
- $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
49
- if( $featured ){
50
- $featured_brands = array();
51
- $other_brands = array();
52
- foreach( $brands as $brand ) {
53
- if( get_term_meta( $brand->term_id, 'pwb_featured_brand', true ) ){
54
- $featured_brands[] = $brand;
55
- }else{
56
- $other_brands[] = $brand;
57
- }
58
- }
59
- return array_merge( $featured_brands, $other_brands );
60
- }
61
-
62
- }
63
- return $brands;
64
-
65
- }
66
-
67
- public function brand_taxonomy_columns_head($defaults) {
68
-
69
- if( self::is_edit_brands_page() ){
70
- $defaults['featured'] = '';
71
-
72
- $newColumns = array(
73
- 'cb' => $defaults['cb'],
74
- 'logo' => __( 'Logo', 'perfect-woocommerce-brands' )
75
- );
76
-
77
- unset( $defaults['description'] );
78
- unset( $defaults['cb'] );
79
-
80
- return array_merge( $newColumns, $defaults );
81
- }
82
- return $defaults;
83
-
84
- }
85
-
86
- public function brand_taxonomy_columns($c, $column_name, $term_id){
87
- switch( $column_name ){
88
- case 'logo':
89
- $image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('60','60') );
90
- return ( $image ) ? $image : "-";
91
- break;
92
- case 'featured':
93
- $featured_class = ( $this->is_featured_brand( $term_id ) ) ? 'dashicons-star-filled' : 'dashicons-star-empty';
94
- printf(
95
- '<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
96
- $featured_class, __('Set as featured', 'perfect-woocommerce-brands'), $term_id
97
- );
98
- break;
99
- }
100
- }
101
-
102
- private function is_featured_brand( $brand_id ){
103
- return ( get_term_meta( $brand_id, 'pwb_featured_brand', true ) );
104
- }
105
-
106
- public function set_featured_brand(){
107
- if( isset( $_POST['brand'] ) ){
108
- $direction = 'up';
109
- $brand = intval( $_POST['brand'] );
110
- if( $this->is_featured_brand( $brand ) ){
111
- update_term_meta( $brand, 'pwb_featured_brand', false );
112
- $direction = 'down';
113
- }else{
114
- update_term_meta( $brand, 'pwb_featured_brand', true );
115
- }
116
- wp_send_json_success( array( 'success' => true, 'direction' => $direction ) );
117
- }else{
118
- wp_send_json_error( array( 'success' => false, 'error_msg' => __( 'Error!','perfect-woocommerce-brands' ) ) );
119
- }
120
- wp_die();
121
- }
122
-
123
- public function add_screen_options( $status, $args ){
124
- if( self::is_edit_brands_page() ){
125
- $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
126
- ob_start();
127
- ?>
128
- <legend><?php _e('Brands','perfect-woocommerce-brands');?></legend>
129
- <label>
130
- <input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured,true);?>>
131
- <?php _e('Show featured brands first','perfect-woocommerce-brands');?>
132
- </label>
133
- <?php
134
- return ob_get_clean();
135
- }
136
- }
137
-
138
- public function save_screen_options(){
139
- if( isset( $_POST['new_val'] ) ){
140
- $new_val = ( $_POST['new_val'] == 'true' ) ? true : false;
141
- update_user_option( self::$current_user->ID, 'pwb-first-featured-brands', $new_val );
142
- }
143
- wp_die();
144
- }
145
-
146
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class Edit_Brands_Page {
7
+
8
+ private static $current_user;
9
+
10
+ function __construct(){
11
+ add_filter( 'get_terms', array( $this, 'brand_list_admin_filter' ), 10, 3 );
12
+ add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
13
+ add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
14
+ add_action( 'wp_ajax_pwb_admin_set_featured_brand', array( $this, 'set_featured_brand' ) );
15
+ add_filter( 'screen_settings', array( $this, 'add_screen_options' ), 10, 2 );
16
+ add_action( 'wp_ajax_pwb_admin_save_screen_settings', array( $this, 'save_screen_options' ) );
17
+ add_action( 'plugins_loaded', function(){ \Perfect_Woocommerce_Brands\Admin\Edit_Brands_Page::$current_user = wp_get_current_user(); } );
18
+ add_action( 'after-pwb-brand-table', array( $this, 'add_brands_count' ) );
19
+ }
20
+
21
+ private static function is_edit_brands_page(){
22
+ global $pagenow;
23
+ return ( $pagenow == 'edit-tags.php' && isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] == 'pwb-brand' ) ? true : false;
24
+ }
25
+
26
+ public function add_brands_count( $tax_name ){
27
+ $brands = get_terms(
28
+ $tax_name,
29
+ array( 'hide_empty' => false )
30
+ );
31
+ $brands_featured = get_terms(
32
+ $tax_name,
33
+ array( 'hide_empty' => false, 'meta_query' => array( array( 'key' => 'pwb_featured_brand', 'value' => true ) ) )
34
+ );
35
+
36
+ echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
37
+ 'edit-brands-bottom',
38
+ 'admin',
39
+ array( 'featured_count' => count( $brands_featured ), 'text_featured' => __('featured', 'perfect-woocommerce-brands') )
40
+ );
41
+
42
+ }
43
+
44
+ public function brand_list_admin_filter( $brands, $taxonomies, $args ) {
45
+
46
+ if( self::is_edit_brands_page() ){
47
+
48
+ $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
49
+ if( $featured ){
50
+ $featured_brands = array();
51
+ $other_brands = array();
52
+ foreach( $brands as $brand ) {
53
+ if( get_term_meta( $brand->term_id, 'pwb_featured_brand', true ) ){
54
+ $featured_brands[] = $brand;
55
+ }else{
56
+ $other_brands[] = $brand;
57
+ }
58
+ }
59
+ return array_merge( $featured_brands, $other_brands );
60
+ }
61
+
62
+ }
63
+ return $brands;
64
+
65
+ }
66
+
67
+ public function brand_taxonomy_columns_head($defaults) {
68
+
69
+ if( self::is_edit_brands_page() ){
70
+ $defaults['featured'] = '';
71
+
72
+ $newColumns = array(
73
+ 'cb' => $defaults['cb'],
74
+ 'logo' => __( 'Logo', 'perfect-woocommerce-brands' )
75
+ );
76
+
77
+ unset( $defaults['description'] );
78
+ unset( $defaults['cb'] );
79
+
80
+ return array_merge( $newColumns, $defaults );
81
+ }
82
+ return $defaults;
83
+
84
+ }
85
+
86
+ public function brand_taxonomy_columns($c, $column_name, $term_id){
87
+ switch( $column_name ){
88
+ case 'logo':
89
+ $image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('60','60') );
90
+ return ( $image ) ? $image : "-";
91
+ break;
92
+ case 'featured':
93
+ $featured_class = ( $this->is_featured_brand( $term_id ) ) ? 'dashicons-star-filled' : 'dashicons-star-empty';
94
+ printf(
95
+ '<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
96
+ $featured_class, __('Set as featured', 'perfect-woocommerce-brands'), $term_id
97
+ );
98
+ break;
99
+ }
100
+ }
101
+
102
+ private function is_featured_brand( $brand_id ){
103
+ return ( get_term_meta( $brand_id, 'pwb_featured_brand', true ) );
104
+ }
105
+
106
+ public function set_featured_brand(){
107
+ if( isset( $_POST['brand'] ) ){
108
+ $direction = 'up';
109
+ $brand = intval( $_POST['brand'] );
110
+ if( $this->is_featured_brand( $brand ) ){
111
+ update_term_meta( $brand, 'pwb_featured_brand', false );
112
+ $direction = 'down';
113
+ }else{
114
+ update_term_meta( $brand, 'pwb_featured_brand', true );
115
+ }
116
+ wp_send_json_success( array( 'success' => true, 'direction' => $direction ) );
117
+ }else{
118
+ wp_send_json_error( array( 'success' => false, 'error_msg' => __( 'Error!','perfect-woocommerce-brands' ) ) );
119
+ }
120
+ wp_die();
121
+ }
122
+
123
+ public function add_screen_options( $status, $args ){
124
+ if( self::is_edit_brands_page() ){
125
+ $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
126
+ ob_start();
127
+ ?>
128
+ <legend><?php _e('Brands','perfect-woocommerce-brands');?></legend>
129
+ <label>
130
+ <input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured,true);?>>
131
+ <?php _e('Show featured brands first','perfect-woocommerce-brands');?>
132
+ </label>
133
+ <?php
134
+ return ob_get_clean();
135
+ }
136
+ }
137
+
138
+ public function save_screen_options(){
139
+ if( isset( $_POST['new_val'] ) ){
140
+ $new_val = ( $_POST['new_val'] == 'true' ) ? true : false;
141
+ update_user_option( self::$current_user->ID, 'pwb-first-featured-brands', $new_val );
142
+ }
143
+ wp_die();
144
+ }
145
+
146
+ }
classes/admin/class-pwb-admin-tab.php CHANGED
@@ -1,213 +1,213 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class Pwb_Admin_Tab {
7
-
8
- public static function init() {
9
- add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::add_settings_tab', 50 );
10
- add_action( 'woocommerce_settings_tabs_pwb_admin_tab', __CLASS__ . '::settings_tab' );
11
- add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
- }
13
-
14
- /**
15
- * Add a new settings tab to the WooCommerce settings tabs array.
16
- *
17
- * @param array $settings_tabs Array of WooCommerce setting tabs & their labels, excluding the Subscription tab.
18
- * @return array $settings_tabs Array of WooCommerce setting tabs & their labels, including the Subscription tab.
19
- */
20
- public static function add_settings_tab( $settings_tabs ) {
21
- $settings_tabs['pwb_admin_tab'] = __( 'Brands', 'perfect-woocommerce-brands' );
22
- return $settings_tabs;
23
- }
24
-
25
-
26
- /**
27
- * Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
28
- *
29
- * @uses woocommerce_admin_fields()
30
- * @uses self::get_settings()
31
- */
32
- public static function settings_tab() {
33
- woocommerce_admin_fields( self::get_settings() );
34
- woocommerce_admin_fields( self::get_tools() );
35
- }
36
-
37
-
38
- /**
39
- * Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
40
- *
41
- * @uses woocommerce_update_options()
42
- * @uses self::get_settings()
43
- */
44
- public static function update_settings() {
45
- update_option( 'old_wc_pwb_admin_tab_slug', get_taxonomy('pwb-brand')->rewrite['slug'] );
46
-
47
- if(isset($_POST['wc_pwb_admin_tab_slug'])){
48
- $_POST['wc_pwb_admin_tab_slug'] = sanitize_title($_POST['wc_pwb_admin_tab_slug']);
49
- }
50
-
51
- woocommerce_update_options( self::get_settings() );
52
-
53
- }
54
-
55
-
56
- /**
57
- * Get all the settings for this plugin for @see woocommerce_admin_fields() function.
58
- *
59
- * @return array Array of settings for @see woocommerce_admin_fields() function.
60
- */
61
- public static function get_settings() {
62
-
63
- $available_image_sizes_adapted = array();
64
- $available_image_sizes = get_intermediate_image_sizes();
65
-
66
- foreach($available_image_sizes as $image_size){
67
- $available_image_sizes_adapted[$image_size] = $image_size;
68
- }
69
- $available_image_sizes_adapted['full'] = 'full';
70
-
71
- $settings = array(
72
- 'section_title' => array(
73
- 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
74
- 'type' => 'title',
75
- 'desc' => '',
76
- 'id' => 'wc_pwb_admin_tab_section_title'
77
- ),
78
- 'slug' => array(
79
- 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
80
- 'type' => 'text',
81
- 'class' => 'pwb-admin-tab-field',
82
- 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
83
- 'id' => 'wc_pwb_admin_tab_slug',
84
- 'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
85
- ),
86
- 'brand_description' => array(
87
- 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
88
- 'type' => 'checkbox',
89
- 'default' => 'yes',
90
- 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
91
- 'id' => 'wc_pwb_admin_tab_brand_desc'
92
- ),
93
- 'brand_single_product_tab' => array(
94
- 'name' => __( 'Single product tab', 'perfect-woocommerce-brands' ),
95
- 'type' => 'checkbox',
96
- 'default' => 'yes',
97
- 'desc' => __( 'Show brand tab in single product page', 'perfect-woocommerce-brands' ),
98
- 'id' => 'wc_pwb_admin_tab_brand_single_product_tab'
99
- ),
100
- 'show_brand_on_loop' => array(
101
- 'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
102
- 'type' => 'select',
103
- 'class' => 'pwb-admin-tab-field',
104
- 'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
105
- 'id' => 'wc_pwb_admin_tab_brands_in_loop',
106
- 'options' => array(
107
- 'no' => __( 'No', 'perfect-woocommerce-brands' ),
108
- 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
109
- 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
110
- )
111
- ),
112
- 'show_brand_in_single' => array(
113
- 'name' => __( 'Show brands in single product', 'perfect-woocommerce-brands' ),
114
- 'type' => 'select',
115
- 'class' => 'pwb-admin-tab-field',
116
- 'desc' => __( 'Show brand logo (or name) in single product', 'perfect-woocommerce-brands' ),
117
- 'default' => 'brand_image',
118
- 'id' => 'wc_pwb_admin_tab_brands_in_single',
119
- 'options' => array(
120
- 'no' => __( 'No', 'perfect-woocommerce-brands' ),
121
- 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
122
- 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
123
- )
124
- ),
125
- 'brand_logo_size' => array(
126
- 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
127
- 'type' => 'select',
128
- 'class' => 'pwb-admin-tab-field',
129
- 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
130
- 'id' => 'wc_pwb_admin_tab_brand_logo_size',
131
- 'options' => $available_image_sizes_adapted
132
- ),
133
- 'brand_single_position' => array(
134
- 'name' => __( 'Brand position', 'perfect-woocommerce-brands' ),
135
- 'type' => 'select',
136
- 'class' => 'pwb-admin-tab-field',
137
- 'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
138
- 'id' => 'wc_pwb_admin_tab_brand_single_position',
139
- 'options' => array(
140
- 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
141
- 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
142
- 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
143
- 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
144
- 'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
145
- 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
146
- 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
147
- )
148
- ),
149
- 'section_end' => array(
150
- 'type' => 'sectionend',
151
- 'id' => 'wc_pwb_admin_tab_section_end'
152
- )
153
- );
154
-
155
- return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
156
-
157
- }
158
-
159
- public static function get_tools() {
160
-
161
- $tools = array(
162
- 'section_title' => array(
163
- 'name' => __( 'Tools', 'perfect-woocommerce-brands' ),
164
- 'type' => 'title',
165
- 'desc' => '',
166
- 'id' => 'wc_pwb_admin_tab_section_tools_title'
167
- ),
168
- 'brand_import' => array(
169
- 'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
170
- 'type' => 'select',
171
- 'class' => 'pwb-admin-tab-field',
172
- 'desc' => sprintf(
173
- __( 'Import brands from other brand plugin. <a href="%s" target="_blank">Click here for more details</a>', 'perfect-woocommerce-brands' ),
174
- 'https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin'
175
- ),
176
- 'id' => 'wc_pwb_admin_tab_tools_migrate',
177
- 'options' => array(
178
- '-' => __( '-', 'perfect-woocommerce-brands' ),
179
- 'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' ),
180
- 'ultimate' => __( 'Ultimate WooCommerce Brands', 'perfect-woocommerce-brands' ),
181
- 'woobrands' => __( 'Offical WooCommerce Brands', 'perfect-woocommerce-brands' )
182
- )
183
- ),
184
- 'brand_dummy_data' => array(
185
- 'name' => __( 'Dummy data', 'perfect-woocommerce-brands' ),
186
- 'type' => 'select',
187
- 'class' => 'pwb-admin-tab-field',
188
- 'desc' => __( 'Import generic brands and assign it to products randomly', 'perfect-woocommerce-brands' ),
189
- 'id' => 'wc_pwb_admin_tab_tools_dummy_data',
190
- 'options' => array(
191
- '-' => __( '-', 'perfect-woocommerce-brands' ),
192
- 'start_import' => __( 'Start import', 'perfect-woocommerce-brands' )
193
- )
194
- ),
195
- 'brands_system_status' => array(
196
- 'name' => __( 'System status', 'perfect-woocommerce-brands' ),
197
- 'type' => 'textarea',
198
- 'desc' => __( 'Show system status', 'perfect-woocommerce-brands' ),
199
- 'id' => 'wc_pwb_admin_tab_tools_system_status'
200
- ),
201
- 'section_end' => array(
202
- 'type' => 'sectionend',
203
- 'id' => 'wc_pwb_admin_tab_section_tools_end'
204
- )
205
- );
206
-
207
- return apply_filters( 'wc_pwb_admin_tab_tools_settings', $tools );
208
-
209
- }
210
-
211
- }
212
-
213
- Pwb_Admin_Tab::init();
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class Pwb_Admin_Tab {
7
+
8
+ public static function init() {
9
+ add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::add_settings_tab', 50 );
10
+ add_action( 'woocommerce_settings_tabs_pwb_admin_tab', __CLASS__ . '::settings_tab' );
11
+ add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
+ }
13
+
14
+ /**
15
+ * Add a new settings tab to the WooCommerce settings tabs array.
16
+ *
17
+ * @param array $settings_tabs Array of WooCommerce setting tabs & their labels, excluding the Subscription tab.
18
+ * @return array $settings_tabs Array of WooCommerce setting tabs & their labels, including the Subscription tab.
19
+ */
20
+ public static function add_settings_tab( $settings_tabs ) {
21
+ $settings_tabs['pwb_admin_tab'] = __( 'Brands', 'perfect-woocommerce-brands' );
22
+ return $settings_tabs;
23
+ }
24
+
25
+
26
+ /**
27
+ * Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
28
+ *
29
+ * @uses woocommerce_admin_fields()
30
+ * @uses self::get_settings()
31
+ */
32
+ public static function settings_tab() {
33
+ woocommerce_admin_fields( self::get_settings() );
34
+ woocommerce_admin_fields( self::get_tools() );
35
+ }
36
+
37
+
38
+ /**
39
+ * Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
40
+ *
41
+ * @uses woocommerce_update_options()
42
+ * @uses self::get_settings()
43
+ */
44
+ public static function update_settings() {
45
+ update_option( 'old_wc_pwb_admin_tab_slug', get_taxonomy('pwb-brand')->rewrite['slug'] );
46
+
47
+ if(isset($_POST['wc_pwb_admin_tab_slug'])){
48
+ $_POST['wc_pwb_admin_tab_slug'] = sanitize_title($_POST['wc_pwb_admin_tab_slug']);
49
+ }
50
+
51
+ woocommerce_update_options( self::get_settings() );
52
+
53
+ }
54
+
55
+
56
+ /**
57
+ * Get all the settings for this plugin for @see woocommerce_admin_fields() function.
58
+ *
59
+ * @return array Array of settings for @see woocommerce_admin_fields() function.
60
+ */
61
+ public static function get_settings() {
62
+
63
+ $available_image_sizes_adapted = array();
64
+ $available_image_sizes = get_intermediate_image_sizes();
65
+
66
+ foreach($available_image_sizes as $image_size){
67
+ $available_image_sizes_adapted[$image_size] = $image_size;
68
+ }
69
+ $available_image_sizes_adapted['full'] = 'full';
70
+
71
+ $settings = array(
72
+ 'section_title' => array(
73
+ 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
74
+ 'type' => 'title',
75
+ 'desc' => '',
76
+ 'id' => 'wc_pwb_admin_tab_section_title'
77
+ ),
78
+ 'slug' => array(
79
+ 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
80
+ 'type' => 'text',
81
+ 'class' => 'pwb-admin-tab-field',
82
+ 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
83
+ 'id' => 'wc_pwb_admin_tab_slug',
84
+ 'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
85
+ ),
86
+ 'brand_description' => array(
87
+ 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
88
+ 'type' => 'checkbox',
89
+ 'default' => 'yes',
90
+ 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
91
+ 'id' => 'wc_pwb_admin_tab_brand_desc'
92
+ ),
93
+ 'brand_single_product_tab' => array(
94
+ 'name' => __( 'Single product tab', 'perfect-woocommerce-brands' ),
95
+ 'type' => 'checkbox',
96
+ 'default' => 'yes',
97
+ 'desc' => __( 'Show brand tab in single product page', 'perfect-woocommerce-brands' ),
98
+ 'id' => 'wc_pwb_admin_tab_brand_single_product_tab'
99
+ ),
100
+ 'show_brand_on_loop' => array(
101
+ 'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
102
+ 'type' => 'select',
103
+ 'class' => 'pwb-admin-tab-field',
104
+ 'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
105
+ 'id' => 'wc_pwb_admin_tab_brands_in_loop',
106
+ 'options' => array(
107
+ 'no' => __( 'No', 'perfect-woocommerce-brands' ),
108
+ 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
109
+ 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
110
+ )
111
+ ),
112
+ 'show_brand_in_single' => array(
113
+ 'name' => __( 'Show brands in single product', 'perfect-woocommerce-brands' ),
114
+ 'type' => 'select',
115
+ 'class' => 'pwb-admin-tab-field',
116
+ 'desc' => __( 'Show brand logo (or name) in single product', 'perfect-woocommerce-brands' ),
117
+ 'default' => 'brand_image',
118
+ 'id' => 'wc_pwb_admin_tab_brands_in_single',
119
+ 'options' => array(
120
+ 'no' => __( 'No', 'perfect-woocommerce-brands' ),
121
+ 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
122
+ 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
123
+ )
124
+ ),
125
+ 'brand_logo_size' => array(
126
+ 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
127
+ 'type' => 'select',
128
+ 'class' => 'pwb-admin-tab-field',
129
+ 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
130
+ 'id' => 'wc_pwb_admin_tab_brand_logo_size',
131
+ 'options' => $available_image_sizes_adapted
132
+ ),
133
+ 'brand_single_position' => array(
134
+ 'name' => __( 'Brand position', 'perfect-woocommerce-brands' ),
135
+ 'type' => 'select',
136
+ 'class' => 'pwb-admin-tab-field',
137
+ 'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
138
+ 'id' => 'wc_pwb_admin_tab_brand_single_position',
139
+ 'options' => array(
140
+ 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
141
+ 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
142
+ 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
143
+ 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
144
+ 'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
145
+ 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
146
+ 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
147
+ )
148
+ ),
149
+ 'section_end' => array(
150
+ 'type' => 'sectionend',
151
+ 'id' => 'wc_pwb_admin_tab_section_end'
152
+ )
153
+ );
154
+
155
+ return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
156
+
157
+ }
158
+
159
+ public static function get_tools() {
160
+
161
+ $tools = array(
162
+ 'section_title' => array(
163
+ 'name' => __( 'Tools', 'perfect-woocommerce-brands' ),
164
+ 'type' => 'title',
165
+ 'desc' => '',
166
+ 'id' => 'wc_pwb_admin_tab_section_tools_title'
167
+ ),
168
+ 'brand_import' => array(
169
+ 'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
170
+ 'type' => 'select',
171
+ 'class' => 'pwb-admin-tab-field',
172
+ 'desc' => sprintf(
173
+ __( 'Import brands from other brand plugin. <a href="%s" target="_blank">Click here for more details</a>', 'perfect-woocommerce-brands' ),
174
+ 'https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin'
175
+ ),
176
+ 'id' => 'wc_pwb_admin_tab_tools_migrate',
177
+ 'options' => array(
178
+ '-' => __( '-', 'perfect-woocommerce-brands' ),
179
+ 'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' ),
180
+ 'ultimate' => __( 'Ultimate WooCommerce Brands', 'perfect-woocommerce-brands' ),
181
+ 'woobrands' => __( 'Offical WooCommerce Brands', 'perfect-woocommerce-brands' )
182
+ )
183
+ ),
184
+ 'brand_dummy_data' => array(
185
+ 'name' => __( 'Dummy data', 'perfect-woocommerce-brands' ),
186
+ 'type' => 'select',
187
+ 'class' => 'pwb-admin-tab-field',
188
+ 'desc' => __( 'Import generic brands and assign it to products randomly', 'perfect-woocommerce-brands' ),
189
+ 'id' => 'wc_pwb_admin_tab_tools_dummy_data',
190
+ 'options' => array(
191
+ '-' => __( '-', 'perfect-woocommerce-brands' ),
192
+ 'start_import' => __( 'Start import', 'perfect-woocommerce-brands' )
193
+ )
194
+ ),
195
+ 'brands_system_status' => array(
196
+ 'name' => __( 'System status', 'perfect-woocommerce-brands' ),
197
+ 'type' => 'textarea',
198
+ 'desc' => __( 'Show system status', 'perfect-woocommerce-brands' ),
199
+ 'id' => 'wc_pwb_admin_tab_tools_system_status'
200
+ ),
201
+ 'section_end' => array(
202
+ 'type' => 'sectionend',
203
+ 'id' => 'wc_pwb_admin_tab_section_tools_end'
204
+ )
205
+ );
206
+
207
+ return apply_filters( 'wc_pwb_admin_tab_tools_settings', $tools );
208
+
209
+ }
210
+
211
+ }
212
+
213
+ Pwb_Admin_Tab::init();
classes/admin/class-pwb-coupon.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Coupon{
7
-
8
- function __construct(){
9
- add_action( 'woocommerce_coupon_options_usage_restriction', array( $this, 'coupon_restriction' ) );
10
- add_action( 'woocommerce_coupon_options_save', array( $this, 'coupon_save' ) );
11
- add_filter( 'woocommerce_coupon_is_valid', array( $this, 'is_valid_coupon' ), 10, 2 );
12
- add_filter( 'woocommerce_coupon_is_valid_for_product', array( $this, 'is_valid_for_product_brand' ), 10, 4 );
13
- }
14
-
15
- public function coupon_restriction() {
16
- global $thepostid, $post;
17
- $thepostid = empty( $thepostid ) ? $post->get_ID() : $thepostid;
18
-
19
- $selected_brands = get_post_meta( $thepostid, '_pwb_coupon_restriction', true );
20
- if( $selected_brands == '' ) $selected_brands = array();
21
-
22
- ob_start();
23
- ?>
24
- <p class="form-field"><label for="_pwb_coupon_restriction"><?php _e( 'Brands restriction', 'perfect-woocommerce-brands' ); ?></label>
25
- <select id="_pwb_coupon_restriction" name="_pwb_coupon_restriction[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php esc_attr_e( 'Any brand', 'perfect-woocommerce-brands' ); ?>">
26
- <?php
27
- $categories = get_terms( 'pwb-brand', 'orderby=name&hide_empty=0' );
28
- if ( $categories ) {
29
- foreach ( $categories as $cat ) {
30
- echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $selected_brands ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
31
- }
32
- }
33
- ?>
34
- </select> <?php echo wc_help_tip( __( 'Coupon will be valid if there are at least one product of this brands in the cart', 'perfect-woocommerce-brands' ) ); ?></p>
35
- <?php
36
- echo ob_get_clean();
37
-
38
- }
39
-
40
- public function coupon_save( $post_id ){
41
- $_pwb_coupon_restriction = isset( $_POST['_pwb_coupon_restriction'] ) ? $_POST['_pwb_coupon_restriction'] : '';
42
- update_post_meta( $post_id, '_pwb_coupon_restriction', $_pwb_coupon_restriction );
43
- }
44
-
45
- public function is_valid_coupon( $availability, $coupon ){
46
- $selected_brands = get_post_meta( $coupon->get_ID(), '_pwb_coupon_restriction', true );
47
- if( !empty( $selected_brands ) ){
48
- global $woocommerce;
49
- $products = $woocommerce->cart->get_cart();
50
- foreach( $products as $product ) {
51
- $product_brands = wp_get_post_terms( $product['product_id'], 'pwb-brand', array( 'fields' => 'ids' ) );
52
- $valid_brands = array_intersect( $selected_brands, $product_brands );
53
- if( !empty( $valid_brands ) ) return true;
54
- }
55
- return false;
56
- }
57
- return true;
58
- }
59
-
60
- public function is_valid_for_product_brand( $valid, $product, $coupon, $values ){
61
- if ( !$valid ) return false;
62
-
63
- $coupon_id = is_callable( array( $coupon, 'get_id' ) ) ? $coupon->get_id() : $coupon->id;
64
- $selected_brands = get_post_meta( $coupon_id, '_pwb_coupon_restriction', true );
65
- if ( empty( $selected_brands ) ) return;
66
-
67
- $product_id = is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id;
68
- $product_brands = wp_get_post_terms( $product_id, 'pwb-brand', array( 'fields' => 'ids' ) );
69
- $valid_brands = array_intersect( $selected_brands, $product_brands );
70
- return !empty( $valid_brands );
71
- }
72
-
73
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Coupon{
7
+
8
+ function __construct(){
9
+ add_action( 'woocommerce_coupon_options_usage_restriction', array( $this, 'coupon_restriction' ) );
10
+ add_action( 'woocommerce_coupon_options_save', array( $this, 'coupon_save' ) );
11
+ add_filter( 'woocommerce_coupon_is_valid', array( $this, 'is_valid_coupon' ), 10, 2 );
12
+ add_filter( 'woocommerce_coupon_is_valid_for_product', array( $this, 'is_valid_for_product_brand' ), 10, 4 );
13
+ }
14
+
15
+ public function coupon_restriction() {
16
+ global $thepostid, $post;
17
+ $thepostid = empty( $thepostid ) ? $post->get_ID() : $thepostid;
18
+
19
+ $selected_brands = get_post_meta( $thepostid, '_pwb_coupon_restriction', true );
20
+ if( $selected_brands == '' ) $selected_brands = array();
21
+
22
+ ob_start();
23
+ ?>
24
+ <p class="form-field"><label for="_pwb_coupon_restriction"><?php _e( 'Brands restriction', 'perfect-woocommerce-brands' ); ?></label>
25
+ <select id="_pwb_coupon_restriction" name="_pwb_coupon_restriction[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php esc_attr_e( 'Any brand', 'perfect-woocommerce-brands' ); ?>">
26
+ <?php
27
+ $categories = get_terms( 'pwb-brand', 'orderby=name&hide_empty=0' );
28
+ if ( $categories ) {
29
+ foreach ( $categories as $cat ) {
30
+ echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $selected_brands ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
31
+ }
32
+ }
33
+ ?>
34
+ </select> <?php echo wc_help_tip( __( 'Coupon will be valid if there are at least one product of this brands in the cart', 'perfect-woocommerce-brands' ) ); ?></p>
35
+ <?php
36
+ echo ob_get_clean();
37
+
38
+ }
39
+
40
+ public function coupon_save( $post_id ){
41
+ $_pwb_coupon_restriction = isset( $_POST['_pwb_coupon_restriction'] ) ? $_POST['_pwb_coupon_restriction'] : '';
42
+ update_post_meta( $post_id, '_pwb_coupon_restriction', $_pwb_coupon_restriction );
43
+ }
44
+
45
+ public function is_valid_coupon( $availability, $coupon ){
46
+ $selected_brands = get_post_meta( $coupon->get_ID(), '_pwb_coupon_restriction', true );
47
+ if( !empty( $selected_brands ) ){
48
+ global $woocommerce;
49
+ $products = $woocommerce->cart->get_cart();
50
+ foreach( $products as $product ) {
51
+ $product_brands = wp_get_post_terms( $product['product_id'], 'pwb-brand', array( 'fields' => 'ids' ) );
52
+ $valid_brands = array_intersect( $selected_brands, $product_brands );
53
+ if( !empty( $valid_brands ) ) return true;
54
+ }
55
+ return false;
56
+ }
57
+ return true;
58
+ }
59
+
60
+ public function is_valid_for_product_brand( $valid, $product, $coupon, $values ){
61
+ if ( !$valid ) return false;
62
+
63
+ $coupon_id = is_callable( array( $coupon, 'get_id' ) ) ? $coupon->get_id() : $coupon->id;
64
+ $selected_brands = get_post_meta( $coupon_id, '_pwb_coupon_restriction', true );
65
+ if ( empty( $selected_brands ) ) return $valid;
66
+
67
+ $product_id = is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id;
68
+ $product_brands = wp_get_post_terms( $product_id, 'pwb-brand', array( 'fields' => 'ids' ) );
69
+ $valid_brands = array_intersect( $selected_brands, $product_brands );
70
+ return !empty( $valid_brands );
71
+ }
72
+
73
+ }
classes/admin/class-pwb-dummy-data.php CHANGED
@@ -1,94 +1,94 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Dummy_Data {
7
-
8
- function __construct(){
9
- add_action( 'wp_ajax_pwb_admin_dummy_data', array( $this, 'dummy_data' ) );
10
- }
11
-
12
- private static function get_attachment_id_from_src($image_src){
13
- global $wpdb;
14
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
15
- $id = $wpdb->get_var($query);
16
- return $id;
17
- }
18
-
19
- private static function retrieve_img_src( $img ) {
20
- if (preg_match('/<img(\s+?)([^>]*?)src=(\"|\')([^>\\3]*?)\\3([^>]*?)>/is', $img, $m) && isset($m[4]))
21
- return $m[4];
22
- return false;
23
- }
24
-
25
- private static function upload_image( $post_id, $img_url ){
26
-
27
- require_once ABSPATH . "wp-admin" . '/includes/image.php';
28
- require_once ABSPATH . "wp-admin" . '/includes/file.php';
29
- require_once ABSPATH . "wp-admin" . '/includes/media.php';
30
-
31
- //solves media_sideload_image bug with spaces in filenames
32
- $parsed_file = parse_url($img_url);
33
- $path = $parsed_file['path'];
34
- $file_name = basename($path);
35
- $encoded_file_name = rawurlencode($file_name);
36
- $path = str_replace($file_name, $encoded_file_name, $path);
37
- $img_url = $parsed_file['scheme'] . "://" . $parsed_file['host'] . $path;
38
- $image = '';
39
-
40
- preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $img_url, $file_matches);
41
- if(isset($file_matches[0])){
42
- $image = media_sideload_image($img_url, $post_id );
43
- }
44
-
45
- //media_sideload_image returns a html image
46
- //extract the src value for get the attachment id
47
- $image_src = self::retrieve_img_src( $image );
48
- return self::get_attachment_id_from_src( $image_src );
49
-
50
- }
51
-
52
- private function build_description(){
53
- $desc = 'lorem ipsum dolor sit amet consectetur adipiscing elit etiam mollis faucibus aliquet';
54
- $desc.= 'sed risus turpis dapibus vel rhoncus a vestibulum sed lectus in hac habitasse platea dictumst';
55
- $desc.= 'suspendisse non luctus felis morbi id volutpat ligula quisque rutrum arcu at erat lobortis';
56
- $exploded_desc = explode( ' ', $desc );
57
- shuffle( $exploded_desc );
58
- $desc = implode( ' ', $exploded_desc );
59
- return ucfirst( $desc );
60
- }
61
-
62
- public function dummy_data(){
63
-
64
- for( $i=1; $i<11; $i++ ) {
65
- $term_desc = $this->build_description();
66
- $brand_name = 'brand'.$i;
67
- $attachment_id = self::upload_image( false, PWB_PLUGIN . '/assets/img/dummy-data/'.$brand_name.'.png' );
68
- $inserted_brand = wp_insert_term( ucfirst( $brand_name ), 'pwb-brand', array( "description" => $term_desc ) );
69
- if( !is_wp_error( $inserted_brand ) && isset( $inserted_brand['term_id'] ) ){
70
- add_term_meta( $inserted_brand['term_id'], 'pwb_brand_image', $attachment_id );
71
- }
72
- }
73
-
74
- $this->set_brands_randomly();
75
-
76
- wp_die();
77
-
78
- }
79
-
80
- public function set_brands_randomly(){
81
-
82
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands_array();
83
-
84
- $the_query = new \WP_Query( array( 'posts_per_page' => -1 , 'post_type' => 'product' ) );
85
-
86
- while ( $the_query->have_posts() ) {
87
- $the_query->the_post();
88
- wp_set_object_terms( get_the_ID(), array_rand( $brands ), 'pwb-brand' );
89
- }
90
- wp_reset_postdata();
91
-
92
- }
93
-
94
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Dummy_Data {
7
+
8
+ function __construct(){
9
+ add_action( 'wp_ajax_pwb_admin_dummy_data', array( $this, 'dummy_data' ) );
10
+ }
11
+
12
+ private static function get_attachment_id_from_src($image_src){
13
+ global $wpdb;
14
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
15
+ $id = $wpdb->get_var($query);
16
+ return $id;
17
+ }
18
+
19
+ private static function retrieve_img_src( $img ) {
20
+ if (preg_match('/<img(\s+?)([^>]*?)src=(\"|\')([^>\\3]*?)\\3([^>]*?)>/is', $img, $m) && isset($m[4]))
21
+ return $m[4];
22
+ return false;
23
+ }
24
+
25
+ private static function upload_image( $post_id, $img_url ){
26
+
27
+ require_once ABSPATH . "wp-admin" . '/includes/image.php';
28
+ require_once ABSPATH . "wp-admin" . '/includes/file.php';
29
+ require_once ABSPATH . "wp-admin" . '/includes/media.php';
30
+
31
+ //solves media_sideload_image bug with spaces in filenames
32
+ $parsed_file = parse_url($img_url);
33
+ $path = $parsed_file['path'];
34
+ $file_name = basename($path);
35
+ $encoded_file_name = rawurlencode($file_name);
36
+ $path = str_replace($file_name, $encoded_file_name, $path);
37
+ $img_url = $parsed_file['scheme'] . "://" . $parsed_file['host'] . $path;
38
+ $image = '';
39
+
40
+ preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $img_url, $file_matches);
41
+ if(isset($file_matches[0])){
42
+ $image = media_sideload_image($img_url, $post_id );
43
+ }
44
+
45
+ //media_sideload_image returns a html image
46
+ //extract the src value for get the attachment id
47
+ $image_src = self::retrieve_img_src( $image );
48
+ return self::get_attachment_id_from_src( $image_src );
49
+
50
+ }
51
+
52
+ private function build_description(){
53
+ $desc = 'lorem ipsum dolor sit amet consectetur adipiscing elit etiam mollis faucibus aliquet';
54
+ $desc.= 'sed risus turpis dapibus vel rhoncus a vestibulum sed lectus in hac habitasse platea dictumst';
55
+ $desc.= 'suspendisse non luctus felis morbi id volutpat ligula quisque rutrum arcu at erat lobortis';
56
+ $exploded_desc = explode( ' ', $desc );
57
+ shuffle( $exploded_desc );
58
+ $desc = implode( ' ', $exploded_desc );
59
+ return ucfirst( $desc );
60
+ }
61
+
62
+ public function dummy_data(){
63
+
64
+ for( $i=1; $i<11; $i++ ) {
65
+ $term_desc = $this->build_description();
66
+ $brand_name = 'brand'.$i;
67
+ $attachment_id = self::upload_image( false, PWB_PLUGIN . '/assets/img/dummy-data/'.$brand_name.'.png' );
68
+ $inserted_brand = wp_insert_term( ucfirst( $brand_name ), 'pwb-brand', array( "description" => $term_desc ) );
69
+ if( !is_wp_error( $inserted_brand ) && isset( $inserted_brand['term_id'] ) ){
70
+ add_term_meta( $inserted_brand['term_id'], 'pwb_brand_image', $attachment_id );
71
+ }
72
+ }
73
+
74
+ $this->set_brands_randomly();
75
+
76
+ wp_die();
77
+
78
+ }
79
+
80
+ public function set_brands_randomly(){
81
+
82
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands_array();
83
+
84
+ $the_query = new \WP_Query( array( 'posts_per_page' => -1 , 'post_type' => 'product' ) );
85
+
86
+ while ( $the_query->have_posts() ) {
87
+ $the_query->the_post();
88
+ wp_set_object_terms( get_the_ID(), array_rand( $brands ), 'pwb-brand' );
89
+ }
90
+ wp_reset_postdata();
91
+
92
+ }
93
+
94
+ }
classes/{class-pwb-exporter-support.php → admin/class-pwb-exporter-support.php} RENAMED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- namespace Perfect_Woocommerce_Brands;
4
-
5
- defined('ABSPATH') or die('No script kiddies please!');
6
-
7
- class PWB_Exporter_Support{
8
-
9
- function __construct(){
10
- add_filter( 'woocommerce_product_export_column_names', array( $this, 'add_export_column' ) );
11
- add_filter( 'woocommerce_product_export_product_default_columns', array( $this, 'add_export_column' ) );
12
- add_filter( 'woocommerce_product_export_product_column_pwb-brand', array( $this, 'add_export_data' ), 10, 2 );
13
- }
14
-
15
- /**
16
- * Add the custom column to the exporter and the exporter column menu.
17
- *
18
- * @param array $columns
19
- * @return array $columns
20
- */
21
- public function add_export_column( $columns ) {
22
- $columns['pwb-brand'] = __('Brand', 'perfect-woocommerce-brands');
23
- return $columns;
24
- }
25
-
26
- /**
27
- * Provide the data to be exported for one item in the column.
28
- *
29
- * @param mixed $value (default: '')
30
- * @param WC_Product $product
31
- * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
32
- */
33
- public function add_export_data( $value, $product ) {
34
- $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand' );
35
- $brand_names = array();
36
- foreach( $brands as $brand ) $brand_names[] = $brand->name;
37
- return implode( ',', $brand_names );
38
- }
39
-
40
- }
1
+ <?php
2
+
3
+ namespace Perfect_Woocommerce_Brands;
4
+
5
+ defined('ABSPATH') or die('No script kiddies please!');
6
+
7
+ class PWB_Exporter_Support{
8
+
9
+ function __construct(){
10
+ add_filter( 'woocommerce_product_export_column_names', array( $this, 'add_export_column' ) );
11
+ add_filter( 'woocommerce_product_export_product_default_columns', array( $this, 'add_export_column' ) );
12
+ add_filter( 'woocommerce_product_export_product_column_pwb-brand', array( $this, 'add_export_data' ), 10, 2 );
13
+ }
14
+
15
+ /**
16
+ * Add the custom column to the exporter and the exporter column menu.
17
+ *
18
+ * @param array $columns
19
+ * @return array $columns
20
+ */
21
+ public function add_export_column( $columns ) {
22
+ $columns['pwb-brand'] = __('Brand', 'perfect-woocommerce-brands');
23
+ return $columns;
24
+ }
25
+
26
+ /**
27
+ * Provide the data to be exported for one item in the column.
28
+ *
29
+ * @param mixed $value (default: '')
30
+ * @param WC_Product $product
31
+ * @return mixed $value - Should be in a format that can be output into a text file (string, numeric, etc).
32
+ */
33
+ public function add_export_data( $value, $product ) {
34
+ $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand' );
35
+ $brand_names = array();
36
+ foreach( $brands as $brand ) $brand_names[] = $brand->name;
37
+ return implode( ',', $brand_names );
38
+ }
39
+
40
+ }
classes/{class-pwb-importer-support.php → admin/class-pwb-importer-support.php} RENAMED
@@ -1,51 +1,53 @@
1
- <?php
2
-
3
- namespace Perfect_Woocommerce_Brands;
4
-
5
- defined('ABSPATH') or die('No script kiddies please!');
6
-
7
- class PWB_Importer_Support{
8
-
9
- function __construct(){
10
- add_filter( 'woocommerce_csv_product_import_mapping_options', array( $this, 'add_column_to_importer' ) );
11
- add_filter( 'woocommerce_csv_product_import_mapping_default_columns', array( $this, 'add_column_to_mapping_screen' ) );
12
- add_filter( 'woocommerce_product_import_pre_insert_product_object', array( $this, 'process_import' ), 10, 2 );
13
- }
14
-
15
- /**
16
- * Register the 'Custom Column' column in the importer.
17
- *
18
- * @param array $options
19
- * @return array $options
20
- */
21
- public function add_column_to_importer( $options ) {
22
- $options['pwb-brand'] = __('Brand', 'perfect-woocommerce-brands');
23
- return $options;
24
- }
25
-
26
- /**
27
- * Add automatic mapping support for 'Custom Column'.
28
- *
29
- * @param array $columns
30
- * @return array $columns
31
- */
32
- public function add_column_to_mapping_screen( $columns ) {
33
- $columns[__('Brand', 'perfect-woocommerce-brands')] = 'pwb-brand';
34
- return $columns;
35
- }
36
-
37
- /**
38
- * Process the data read from the CSV file.
39
- *
40
- * @param WC_Product $object - Product being imported or updated.
41
- * @param array $data - CSV data read for the product.
42
- * @return WC_Product $object
43
- */
44
- public function process_import( $object, $data ) {
45
- wp_delete_object_term_relationships( $object->get_id(), 'pwb-brand' );
46
- $brands = explode( ',', $data['pwb-brand'] );
47
- foreach( $brands as $brand ) wp_set_object_terms( $object->get_id(), $brand, 'pwb-brand', true );
48
- return $object;
49
- }
50
-
51
- }
 
 
1
+ <?php
2
+
3
+ namespace Perfect_Woocommerce_Brands;
4
+
5
+ defined('ABSPATH') or die('No script kiddies please!');
6
+
7
+ class PWB_Importer_Support{
8
+
9
+ function __construct(){
10
+ add_filter( 'woocommerce_csv_product_import_mapping_options', array( $this, 'add_column_to_importer' ) );
11
+ add_filter( 'woocommerce_csv_product_import_mapping_default_columns', array( $this, 'add_column_to_mapping_screen' ) );
12
+ add_filter( 'woocommerce_product_import_pre_insert_product_object', array( $this, 'process_import' ), 10, 2 );
13
+ }
14
+
15
+ /**
16
+ * Register the 'Custom Column' column in the importer.
17
+ *
18
+ * @param array $options
19
+ * @return array $options
20
+ */
21
+ public function add_column_to_importer( $options ) {
22
+ $options['pwb-brand'] = __('Brand', 'perfect-woocommerce-brands');
23
+ return $options;
24
+ }
25
+
26
+ /**
27
+ * Add automatic mapping support for 'Custom Column'.
28
+ *
29
+ * @param array $columns
30
+ * @return array $columns
31
+ */
32
+ public function add_column_to_mapping_screen( $columns ) {
33
+ $columns[__('Brand', 'perfect-woocommerce-brands')] = 'pwb-brand';
34
+ return $columns;
35
+ }
36
+
37
+ /**
38
+ * Process the data read from the CSV file.
39
+ *
40
+ * @param WC_Product $object - Product being imported or updated.
41
+ * @param array $data - CSV data read for the product.
42
+ * @return WC_Product $object
43
+ */
44
+ public function process_import( $object, $data ) {
45
+ if( isset( $data['pwb-brand'] ) ){
46
+ wp_delete_object_term_relationships( $object->get_id(), 'pwb-brand' );
47
+ $brands = explode( ',', $data['pwb-brand'] );
48
+ foreach( $brands as $brand ) wp_set_object_terms( $object->get_id(), $brand, 'pwb-brand', true );
49
+ }
50
+ return $object;
51
+ }
52
+
53
+ }
classes/admin/class-pwb-migrate.php CHANGED
@@ -1,124 +1,124 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Migrate {
7
-
8
- function __construct(){
9
- add_action( 'wp_ajax_pwb_admin_migrate_brands', array( $this, 'migrate_from' ) );
10
- }
11
-
12
- public function migrate_from(){
13
-
14
- if( isset( $_POST['from'] ) ){
15
-
16
- switch( $_POST['from'] ) {
17
- case 'yith':
18
- $this->migrate_from_yith();
19
- break;
20
- case 'ultimate':
21
- $this->migrate_from_ultimate();
22
- break;
23
- case 'woobrands':
24
- $this->migrate_from_woobrands();
25
- break;
26
- }
27
-
28
-
29
- }
30
-
31
- wp_die();
32
- }
33
-
34
- public function migrate_from_yith(){
35
-
36
- global $wpdb;
37
- $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "yith_product_brand"' );
38
-
39
- foreach( $terms as $term_id ) {
40
-
41
- //change taxonomy
42
- $wpdb->update(
43
- $wpdb->prefix . 'term_taxonomy',
44
- array(
45
- 'taxonomy' => 'pwb-brand'
46
- ),
47
- array(
48
- 'term_id' => $term_id
49
- )
50
- );
51
-
52
- //update term meta
53
- $wpdb->update(
54
- $wpdb->prefix . 'termmeta',
55
- array(
56
- 'meta_key' => 'pwb_brand_image'
57
- ),
58
- array(
59
- 'meta_key' => 'thumbnail_id',
60
- 'term_id' => $term_id
61
- )
62
- );
63
-
64
- }
65
-
66
- }
67
-
68
- public function migrate_from_ultimate(){
69
-
70
- global $wpdb;
71
- $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
72
-
73
- foreach( $terms as $term_id ) {
74
-
75
- //change taxonomy
76
- $wpdb->update(
77
- $wpdb->prefix . 'term_taxonomy',
78
- array(
79
- 'taxonomy' => 'pwb-brand'
80
- ),
81
- array(
82
- 'term_id' => $term_id
83
- )
84
- );
85
-
86
- /**
87
- * Ultimate WooCommerce Brands uses tax-meta-class, tax meta are really options
88
- * @link https://github.com/bainternet/Tax-Meta-Class
89
- */
90
- $term_meta = get_option('tax_meta_'.$term_id);
91
- if( isset( $term_meta['mgwb_image_brand_thumb']['id'] ) )
92
- add_term_meta( $term_id, 'pwb_brand_image', $term_meta['mgwb_image_brand_thumb']['id'] );
93
-
94
- }
95
-
96
- }
97
-
98
- public function migrate_from_woobrands(){
99
-
100
- global $wpdb;
101
- $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
102
-
103
- foreach( $terms as $term_id ) {
104
-
105
- // change taxonomy
106
- $wpdb->update(
107
- $wpdb->prefix . 'term_taxonomy',
108
- array(
109
- 'taxonomy' => 'pwb-brand'
110
- ),
111
- array(
112
- 'term_id' => $term_id
113
- )
114
- );
115
-
116
- // add the logo id
117
- if( $thumb_id = get_woocommerce_term_meta( $term_id, 'thumbnail_id', true ) )
118
- add_term_meta( $term_id, 'pwb_brand_image', $thumb_id );
119
-
120
- }
121
-
122
- }
123
-
124
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Migrate {
7
+
8
+ function __construct(){
9
+ add_action( 'wp_ajax_pwb_admin_migrate_brands', array( $this, 'migrate_from' ) );
10
+ }
11
+
12
+ public function migrate_from(){
13
+
14
+ if( isset( $_POST['from'] ) ){
15
+
16
+ switch( $_POST['from'] ) {
17
+ case 'yith':
18
+ $this->migrate_from_yith();
19
+ break;
20
+ case 'ultimate':
21
+ $this->migrate_from_ultimate();
22
+ break;
23
+ case 'woobrands':
24
+ $this->migrate_from_woobrands();
25
+ break;
26
+ }
27
+
28
+
29
+ }
30
+
31
+ wp_die();
32
+ }
33
+
34
+ public function migrate_from_yith(){
35
+
36
+ global $wpdb;
37
+ $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "yith_product_brand"' );
38
+
39
+ foreach( $terms as $term_id ) {
40
+
41
+ //change taxonomy
42
+ $wpdb->update(
43
+ $wpdb->prefix . 'term_taxonomy',
44
+ array(
45
+ 'taxonomy' => 'pwb-brand'
46
+ ),
47
+ array(
48
+ 'term_id' => $term_id
49
+ )
50
+ );
51
+
52
+ //update term meta
53
+ $wpdb->update(
54
+ $wpdb->prefix . 'termmeta',
55
+ array(
56
+ 'meta_key' => 'pwb_brand_image'
57
+ ),
58
+ array(
59
+ 'meta_key' => 'thumbnail_id',
60
+ 'term_id' => $term_id
61
+ )
62
+ );
63
+
64
+ }
65
+
66
+ }
67
+
68
+ public function migrate_from_ultimate(){
69
+
70
+ global $wpdb;
71
+ $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
72
+
73
+ foreach( $terms as $term_id ) {
74
+
75
+ //change taxonomy
76
+ $wpdb->update(
77
+ $wpdb->prefix . 'term_taxonomy',
78
+ array(
79
+ 'taxonomy' => 'pwb-brand'
80
+ ),
81
+ array(
82
+ 'term_id' => $term_id
83
+ )
84
+ );
85
+
86
+ /**
87
+ * Ultimate WooCommerce Brands uses tax-meta-class, tax meta are really options
88
+ * @link https://github.com/bainternet/Tax-Meta-Class
89
+ */
90
+ $term_meta = get_option('tax_meta_'.$term_id);
91
+ if( isset( $term_meta['mgwb_image_brand_thumb']['id'] ) )
92
+ add_term_meta( $term_id, 'pwb_brand_image', $term_meta['mgwb_image_brand_thumb']['id'] );
93
+
94
+ }
95
+
96
+ }
97
+
98
+ public function migrate_from_woobrands(){
99
+
100
+ global $wpdb;
101
+ $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
102
+
103
+ foreach( $terms as $term_id ) {
104
+
105
+ // change taxonomy
106
+ $wpdb->update(
107
+ $wpdb->prefix . 'term_taxonomy',
108
+ array(
109
+ 'taxonomy' => 'pwb-brand'
110
+ ),
111
+ array(
112
+ 'term_id' => $term_id
113
+ )
114
+ );
115
+
116
+ // add the logo id
117
+ if( $thumb_id = get_woocommerce_term_meta( $term_id, 'thumbnail_id', true ) )
118
+ add_term_meta( $term_id, 'pwb_brand_image', $thumb_id );
119
+
120
+ }
121
+
122
+ }
123
+
124
+ }
classes/admin/class-pwb-system-status.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_System_Status{
7
-
8
- function __construct(){
9
- add_action( 'wp_ajax_pwb_system_status', array( $this, 'pwb_system_status' ) );
10
- }
11
-
12
- public function pwb_system_status(){
13
- print_r(array(
14
- 'home_url' => get_option( 'home' ),
15
- 'site_url' => get_option( 'siteurl' ),
16
- 'version' => WC()->version,
17
- 'wp_version' => get_bloginfo( 'version' ),
18
- 'wp_multisite' => is_multisite(),
19
- 'wp_memory_limit' => WP_MEMORY_LIMIT,
20
- 'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
21
- 'wp_cron' => !( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
22
- 'language' => get_locale(),
23
- 'server_info' => $_SERVER['SERVER_SOFTWARE'],
24
- 'php_version' => phpversion(),
25
- 'php_post_max_size' => ini_get( 'post_max_size' ),
26
- 'php_max_execution_time' => ini_get( 'max_execution_time' ),
27
- 'php_max_input_vars' => ini_get( 'max_input_vars' ),
28
- 'max_upload_size' => wp_max_upload_size(),
29
- 'default_timezone' => date_default_timezone_get(),
30
- 'theme' => $this->theme_info(),
31
- 'active_plugins' => get_option( 'active_plugins' ),
32
- 'pwb_options' => $this->pwb_options()
33
- ));
34
- wp_die();
35
- }
36
-
37
- private function theme_info(){
38
- $current_theme = wp_get_theme();
39
- return array(
40
- 'name' => $current_theme->__get('name'),
41
- 'version' => $current_theme->__get('version'),
42
- 'parent_theme' => $current_theme->__get('parent_theme')
43
- );
44
- }
45
-
46
- private function pwb_options(){
47
- return array(
48
- 'version' => PWB_PLUGIN_VERSION,
49
- 'wc_pwb_admin_tab_brand_single_position' => get_option( 'wc_pwb_admin_tab_brand_single_position' ),
50
- 'old_wc_pwb_admin_tab_slug' => get_option( 'old_wc_pwb_admin_tab_slug' ),
51
- 'wc_pwb_notice_plugin_review' => get_option( 'wc_pwb_notice_plugin_review' ),
52
- 'wc_pwb_admin_tab_slug' => get_option( 'wc_pwb_admin_tab_slug' ),
53
- 'wc_pwb_admin_tab_brand_desc' => get_option( 'wc_pwb_admin_tab_brand_desc' ),
54
- 'wc_pwb_admin_tab_brand_single_product_tab' => get_option( 'wc_pwb_admin_tab_brand_single_product_tab' ),
55
- 'wc_pwb_admin_tab_brands_in_loop' => get_option( 'wc_pwb_admin_tab_brands_in_loop' ),
56
- 'wc_pwb_admin_tab_brands_in_single' => get_option( 'wc_pwb_admin_tab_brands_in_single' ),
57
- 'wc_pwb_admin_tab_brand_logo_size' => get_option( 'wc_pwb_admin_tab_brand_logo_size' )
58
- );
59
- }
60
-
61
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_System_Status{
7
+
8
+ function __construct(){
9
+ add_action( 'wp_ajax_pwb_system_status', array( $this, 'pwb_system_status' ) );
10
+ }
11
+
12
+ public function pwb_system_status(){
13
+ print_r(array(
14
+ 'home_url' => get_option( 'home' ),
15
+ 'site_url' => get_option( 'siteurl' ),
16
+ 'version' => WC()->version,
17
+ 'wp_version' => get_bloginfo( 'version' ),
18
+ 'wp_multisite' => is_multisite(),
19
+ 'wp_memory_limit' => WP_MEMORY_LIMIT,
20
+ 'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
21
+ 'wp_cron' => !( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
22
+ 'language' => get_locale(),
23
+ 'server_info' => $_SERVER['SERVER_SOFTWARE'],
24
+ 'php_version' => phpversion(),
25
+ 'php_post_max_size' => ini_get( 'post_max_size' ),
26
+ 'php_max_execution_time' => ini_get( 'max_execution_time' ),
27
+ 'php_max_input_vars' => ini_get( 'max_input_vars' ),
28
+ 'max_upload_size' => wp_max_upload_size(),
29
+ 'default_timezone' => date_default_timezone_get(),
30
+ 'theme' => $this->theme_info(),
31
+ 'active_plugins' => get_option( 'active_plugins' ),
32
+ 'pwb_options' => $this->pwb_options()
33
+ ));
34
+ wp_die();
35
+ }
36
+
37
+ private function theme_info(){
38
+ $current_theme = wp_get_theme();
39
+ return array(
40
+ 'name' => $current_theme->__get('name'),
41
+ 'version' => $current_theme->__get('version'),
42
+ 'parent_theme' => $current_theme->__get('parent_theme')
43
+ );
44
+ }
45
+
46
+ private function pwb_options(){
47
+ return array(
48
+ 'version' => PWB_PLUGIN_VERSION,
49
+ 'wc_pwb_admin_tab_brand_single_position' => get_option( 'wc_pwb_admin_tab_brand_single_position' ),
50
+ 'old_wc_pwb_admin_tab_slug' => get_option( 'old_wc_pwb_admin_tab_slug' ),
51
+ 'wc_pwb_notice_plugin_review' => get_option( 'wc_pwb_notice_plugin_review' ),
52
+ 'wc_pwb_admin_tab_slug' => get_option( 'wc_pwb_admin_tab_slug' ),
53
+ 'wc_pwb_admin_tab_brand_desc' => get_option( 'wc_pwb_admin_tab_brand_desc' ),
54
+ 'wc_pwb_admin_tab_brand_single_product_tab' => get_option( 'wc_pwb_admin_tab_brand_single_product_tab' ),
55
+ 'wc_pwb_admin_tab_brands_in_loop' => get_option( 'wc_pwb_admin_tab_brands_in_loop' ),
56
+ 'wc_pwb_admin_tab_brands_in_single' => get_option( 'wc_pwb_admin_tab_brands_in_single' ),
57
+ 'wc_pwb_admin_tab_brand_logo_size' => get_option( 'wc_pwb_admin_tab_brand_logo_size' )
58
+ );
59
+ }
60
+
61
+ }
classes/class-perfect-woocommerce-brands.php CHANGED
@@ -1,860 +1,856 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class Perfect_Woocommerce_Brands{
7
-
8
- function __construct(){
9
- add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
10
- add_action( 'init', array( $this, 'add_brands_metafields' ) );
11
- add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
12
- add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
13
- add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
14
- add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
15
- add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
16
- $this->brand_logo_position();
17
- add_action( 'woocommerce_before_shop_loop', array( $this, 'archive_page_banner' ), 9);
18
- add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
19
- if( !is_admin() ) add_action( 'init', array( $this, 'register_frontend_scripts' ) );
20
- $this->add_shortcodes();
21
- if( is_plugin_active('js_composer/js_composer.php') || is_plugin_active('visual_composer/js_composer.php') ){
22
- add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
23
- }
24
- add_action( 'widgets_init', array( $this, 'register_widgets' ) );
25
-
26
- if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '3.0.0', '>=' ) ){
27
- add_filter( 'woocommerce_structured_data_product', array( $this, 'product_microdata' ), 10, 2 );
28
- }else{
29
- add_action( 'wp_head' , array( $this, 'product_microdata_legacy' ), 40 );
30
- }
31
-
32
- add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
33
- add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
34
- add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
35
- add_action( 'admin_notices', array( $this, 'review_notice' ) );
36
-
37
- add_action( 'pre_get_posts', function(){
38
- if( is_tax('pwb-brand') )
39
- remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
40
- });
41
- add_action( 'woocommerce_product_duplicate', array( $this, 'product_duplicate_save' ), 10, 2 );
42
- }
43
-
44
- public function review_notice(){
45
- $show_notice = get_option('wc_pwb_notice_plugin_review', true);
46
- $activate_on = get_option('pwb_activate_on', time());
47
- $now = time();
48
- $one_month = 2592000;
49
- $date_diff = $now - $activate_on;
50
-
51
- if ( $show_notice && $date_diff > $one_month ) {
52
- ?>
53
- <div class="notice notice-info pwb-notice-dismissible is-dismissible" data-notice="wc_pwb_notice_plugin_review">
54
- <p><?php echo __('We know that you´re in love with Perfect WooCommerce Brands, you can help us making it a bit better. Thanks a lot!', 'perfect-woocommerce-brands' ); ?><span class="dashicons dashicons-heart"></span></p>
55
- <p>
56
- <?php _e( '<a href="https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?rate=5#new-post" target="_blank">Leave a review</a>', 'perfect-woocommerce-brands' ); ?>
57
- <?php _e( '<a href="https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands" target="_blank">Translate the plugin</a>', 'perfect-woocommerce-brands' ); ?>
58
- <?php _e( '<a href="https://github.com/titodevera/perfect-woocommerce-brands" target="_blank">View on GitHub</a>', 'perfect-woocommerce-brands' ); ?>
59
- </p>
60
- </div>
61
- <?php
62
- }
63
- }
64
-
65
- public function dismiss_pwb_notice(){
66
- $notice_name_whitelist = array( 'wc_pwb_notice_plugin_review' );
67
- if( isset( $_POST['notice_name'] ) && in_array( $_POST['notice_name'], $notice_name_whitelist ) ){
68
- update_option( $_POST['notice_name'], 0 );
69
- echo 'ok';
70
- }else{
71
- echo 'error';
72
- }
73
- wp_die();
74
- }
75
-
76
- /**
77
- * Adds a settings shortcut to plugin´s actions on plugins list
78
- */
79
- public function plugin_action_links( $links ) {
80
- $settings_url = esc_url( admin_url( 'admin.php?page=wc-settings&tab=pwb_admin_tab' ) );
81
- $links[] = '<a href="'. $settings_url .'">'.__('Settings','perfect-woocommerce-brands').'</a>';
82
- return $links;
83
- }
84
-
85
- public function pwb_brand_filter( $query ){
86
-
87
- if( !empty($_GET['pwb-brand-filter']) ){
88
-
89
- $terms_array = explode(',',$_GET['pwb-brand-filter']);
90
-
91
- //remove invalid terms (security)
92
- for($i=0; $i < count($terms_array); $i++) {
93
- if( !term_exists( $terms_array[$i], 'pwb-brand' ) ) unset($terms_array[$i]);
94
- }
95
-
96
- $filterable_product = false;
97
- if( is_product_category() || is_post_type_archive( 'product' ) )
98
- $filterable_product = true;
99
-
100
- if( $filterable_product && $query->is_main_query() ) {
101
-
102
- $query->set('tax_query', array(
103
- array (
104
- 'taxonomy' => 'pwb-brand',
105
- 'field' => 'slug',
106
- 'terms' => $terms_array
107
- )
108
- ));
109
-
110
- }
111
-
112
- }
113
-
114
- }
115
-
116
- /*
117
- * Adds microdata (brands) to single products (WooCommerce < 3.0.0)
118
- */
119
- public function product_microdata_legacy(){
120
- global $post;
121
-
122
- if( isset( $post->post_type ) && $post->post_type==='product' ){
123
- $brands = wp_get_post_terms( $post->ID, 'pwb-brand');
124
- foreach ($brands as $brand) {
125
- echo '<meta itemprop="brand" content="'.$brand->name.'">';
126
- }
127
- }
128
-
129
- }
130
-
131
- /*
132
- * Adds microdata (brands) to single products (WooCommerce > 3.0.0)
133
- */
134
- public function product_microdata( $markup, $product ){
135
-
136
- $new_markup = array();
137
- $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand');
138
- foreach ($brands as $brand) {
139
- $new_markup['brand'][] = $brand->name;
140
- }
141
-
142
- return array_merge( $markup, $new_markup );
143
-
144
- }
145
-
146
- public function add_shortcodes(){
147
- add_shortcode( 'pwb-carousel', array(
148
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
149
- 'carousel_shortcode'
150
- ) );
151
- add_shortcode( 'pwb-product-carousel', array(
152
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
153
- 'product_carousel_shortcode'
154
- ) );
155
- add_shortcode( 'pwb-all-brands', array(
156
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
157
- 'all_brands_shortcode'
158
- ) );
159
- add_shortcode( 'pwb-brand', array(
160
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
161
- 'brand_shortcode'
162
- ) );
163
- }
164
-
165
- public function register_widgets(){
166
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
167
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
168
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
169
- }
170
-
171
- public function show_brands_in_loop(){
172
-
173
- $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
174
-
175
- if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
176
-
177
- global $product;
178
- $product_id = $product->get_id();
179
- $product_brands = wp_get_post_terms($product_id, 'pwb-brand');
180
- if(!empty($product_brands)){
181
- echo '<div class="pwb-brands-in-loop">';
182
- foreach ($product_brands as $brand) {
183
-
184
- echo '<span>';
185
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
186
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
187
-
188
- $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
189
- if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
190
- echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
191
- }else{
192
- echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
193
- }
194
- echo '</span>';
195
-
196
- }
197
- echo '</div>';
198
- }
199
-
200
- }
201
-
202
- }
203
-
204
- /**
205
- * woocommerce_single_product_summary hook.
206
- *
207
- * @hooked woocommerce_template_single_title - 5
208
- * @hooked woocommerce_template_single_rating - 10
209
- * @hooked woocommerce_template_single_price - 10
210
- * @hooked woocommerce_template_single_excerpt - 20
211
- * @hooked woocommerce_template_single_add_to_cart - 30
212
- * @hooked woocommerce_template_single_meta - 40
213
- * @hooked woocommerce_template_single_sharing - 50
214
- */
215
- private function brand_logo_position(){
216
- $position = 41;
217
- $position_selected = get_option('wc_pwb_admin_tab_brand_single_position');
218
- if(!$position_selected){
219
- update_option('wc_pwb_admin_tab_brand_single_position','after_meta');
220
- }
221
- switch ($position_selected) {
222
- case 'before_title':
223
- $position = 4;
224
- break;
225
- case 'after_title':
226
- $position = 6;
227
- break;
228
- case 'after_price':
229
- $position = 11;
230
- break;
231
- case 'after_excerpt':
232
- $position = 21;
233
- break;
234
- case 'after_add_to_cart':
235
- $position = 31;
236
- break;
237
- case 'after_meta':
238
- $position = 41;
239
- break;
240
- case 'after_sharing':
241
- $position = 51;
242
- break;
243
- }
244
- add_action('woocommerce_single_product_summary', array($this,'action_woocommerce_single_product_summary'), $position);
245
- }
246
-
247
-
248
- /*
249
- * Maps shortcode (for visual composer plugin)
250
- *
251
- * @since 1.0
252
- * @link https://vc.wpbakery.com/
253
- * @return mixed
254
- */
255
- public function vc_map_shortcodes(){
256
- $available_image_sizes_adapted = array();
257
- $available_image_sizes = get_intermediate_image_sizes();
258
-
259
- foreach($available_image_sizes as $image_size){
260
- $available_image_sizes_adapted[$image_size] = $image_size;
261
- }
262
-
263
- vc_map(array(
264
- "name" => __( "PWB Product carousel", "perfect-woocommerce-brands" ),
265
- "description" => __( "Product carousel by brand or by category", "perfect-woocommerce-brands" ),
266
- "base" => "pwb-product-carousel",
267
- "class" => "",
268
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
269
- "category" => "Woocommerce",
270
- "params" => array(
271
- array(
272
- "type" => "dropdown",
273
- "heading" => __( "Brand", "perfect-woocommerce-brands" ),
274
- "param_name" => "brand",
275
- "admin_label" => true,
276
- "value" => self::get_brands_array( true )
277
- ),
278
- array(
279
- "type" => "textfield",
280
- "holder" => "div",
281
- "heading" => __( "Products", "perfect-woocommerce-brands" ),
282
- "param_name" => "products",
283
- "value" => "10",
284
- "description" => __( "Number of products to load", "perfect-woocommerce-brands" )
285
- ),
286
- array(
287
- "type" => "textfield",
288
- "holder" => "div",
289
- "heading" => __( "Products to show", "perfect-woocommerce-brands" ),
290
- "param_name" => "products_to_show",
291
- "value" => "5",
292
- "description" => __( "Number of products to show", "perfect-woocommerce-brands" )
293
- ),
294
- array(
295
- "type" => "textfield",
296
- "holder" => "div",
297
- "heading" => __( "Products to scroll", "perfect-woocommerce-brands" ),
298
- "param_name" => "products_to_scroll",
299
- "value" => "1",
300
- "description" => __( "Number of products to scroll", "perfect-woocommerce-brands" )
301
- ),
302
- array(
303
- "type" => "checkbox",
304
- "holder" => "div",
305
- "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
306
- "param_name" => "autoplay",
307
- "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
308
- ),
309
- array(
310
- "type" => "checkbox",
311
- "holder" => "div",
312
- "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
313
- "param_name" => "arrows",
314
- "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
315
- )
316
- )
317
- ));
318
-
319
- vc_map(array(
320
- "name" => __( "PWB Brands carousel", "perfect-woocommerce-brands" ),
321
- "description" => __( "Brands carousel", "perfect-woocommerce-brands" ),
322
- "base" => "pwb-carousel",
323
- "class" => "",
324
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
325
- "category" => "Woocommerce",
326
- "params" => array(
327
- array(
328
- "type" => "textfield",
329
- "holder" => "div",
330
- "heading" => __( "Items", "perfect-woocommerce-brands" ),
331
- "param_name" => "items",
332
- "value" => "10",
333
- "description" => __( "Number of items to load (or 'featured')", "perfect-woocommerce-brands" )
334
- ),
335
- array(
336
- "type" => "textfield",
337
- "holder" => "div",
338
- "heading" => __( "Items to show", "perfect-woocommerce-brands" ),
339
- "param_name" => "items_to_show",
340
- "value" => "5",
341
- "description" => __( "Number of items to show", "perfect-woocommerce-brands" )
342
- ),
343
- array(
344
- "type" => "textfield",
345
- "holder" => "div",
346
- "heading" => __( "Items to scroll", "perfect-woocommerce-brands" ),
347
- "param_name" => "items_to_scroll",
348
- "value" => "1",
349
- "description" => __( "Number of items to scroll", "perfect-woocommerce-brands" )
350
- ),
351
- array(
352
- "type" => "checkbox",
353
- "holder" => "div",
354
- "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
355
- "param_name" => "autoplay",
356
- "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
357
- ),
358
- array(
359
- "type" => "checkbox",
360
- "holder" => "div",
361
- "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
362
- "param_name" => "arrows",
363
- "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
364
- ),
365
- array(
366
- "type" => "dropdown",
367
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
368
- "param_name" => "image_size",
369
- "admin_label" => true,
370
- "value" => $available_image_sizes_adapted
371
- )
372
- )
373
-
374
-
375
- ));
376
-
377
- vc_map(array(
378
- "name" => __( "PWB All brands", "perfect-woocommerce-brands" ),
379
- "description" => __( "Show all brands", "perfect-woocommerce-brands" ),
380
- "base" => "pwb-all-brands",
381
- "class" => "",
382
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
383
- "category" => "Woocommerce",
384
- "params" => array(
385
- array(
386
- "type" => "textfield",
387
- "holder" => "div",
388
- "heading" => __( "Brands per page", "perfect-woocommerce-brands" ),
389
- "param_name" => "per_page",
390
- "value" => "10",
391
- "description" => __( "Show x brands per page", "perfect-woocommerce-brands" )
392
- ),
393
- array(
394
- "type" => "dropdown",
395
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
396
- "param_name" => "image_size",
397
- "admin_label" => true,
398
- "value" => $available_image_sizes_adapted
399
- ),
400
- array(
401
- "type" => "dropdown",
402
- "heading" => __( "Order by", "perfect-woocommerce-brands" ),
403
- "param_name" => "order_by",
404
- "admin_label" => true,
405
- "value" => array(
406
- 'name' => 'name',
407
- 'slug' => 'slug',
408
- 'term_id' => 'term_id',
409
- 'id' => 'id',
410
- 'description' => 'description',
411
- 'rand' => 'rand'
412
- )
413
- ),
414
- array(
415
- "type" => "dropdown",
416
- "heading" => __( "Order", "perfect-woocommerce-brands" ),
417
- "param_name" => "order",
418
- "admin_label" => true,
419
- "value" => array(
420
- 'ASC' => 'ASC',
421
- 'DSC' => 'DSC'
422
- )
423
- ),
424
- array(
425
- "type" => "dropdown",
426
- "heading" => __( "Title position", "perfect-woocommerce-brands" ),
427
- "param_name" => "title_position",
428
- "admin_label" => true,
429
- "value" => array(
430
- __( "Before image", "perfect-woocommerce-brands" ) => 'before',
431
- __( "After image", "perfect-woocommerce-brands" ) => 'after',
432
- __( "Hide", "perfect-woocommerce-brands" ) => 'none'
433
- )
434
- ),
435
- array(
436
- "type" => "checkbox",
437
- "holder" => "div",
438
- "heading" => __( "Hide empty", "perfect-woocommerce-brands" ),
439
- "param_name" => "hide_empty",
440
- "description" => __( "Hide brands that have not been assigned to any product", "perfect-woocommerce-brands" )
441
- )
442
- )
443
-
444
-
445
- ));
446
-
447
- vc_map(array(
448
- "name" => __( "PWB brand", "perfect-woocommerce-brands" ),
449
- "description" => __( "Show brand for a specific product", "perfect-woocommerce-brands" ),
450
- "base" => "pwb-brand",
451
- "class" => "",
452
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
453
- "category" => "Woocommerce",
454
-
455
- "params" => array(
456
- array(
457
- "type" => "textfield",
458
- "holder" => "div",
459
- "heading" => __( "Product id", "perfect-woocommerce-brands" ),
460
- "param_name" => "product_id",
461
- "value" => null,
462
- "description" => __( "Product id (post id)", "perfect-woocommerce-brands" )
463
- ),
464
- array(
465
- "type" => "dropdown",
466
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
467
- "param_name" => "image_size",
468
- "admin_label" => true,
469
- "value" => $available_image_sizes_adapted
470
- )
471
-
472
- )
473
-
474
-
475
- ));
476
- }
477
-
478
- public function action_woocommerce_single_product_summary() {
479
- $brands = wp_get_post_terms( get_the_ID(), 'pwb-brand');
480
-
481
- if( !is_wp_error( $brands ) ){
482
-
483
- if( sizeof( $brands ) > 0 ){
484
-
485
- $show_as = get_option( 'wc_pwb_admin_tab_brands_in_single' );
486
-
487
- if( $show_as!='no' ){
488
-
489
- do_action( 'pwb_before_single_product_brands', $brands );
490
-
491
- echo '<div class="pwb-single-product-brands pwb-clearfix">';
492
- foreach( $brands as $brand ){
493
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
494
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
495
-
496
- $image_size = 'thumbnail';
497
- $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size');
498
- if($image_size_selected!=false){
499
- $image_size = $image_size_selected;
500
- }
501
-
502
- $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
503
-
504
- if( !empty($attachment_html) && $show_as=='brand_image' || !empty($attachment_html) && !$show_as ){
505
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
506
- }else{
507
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
508
- }
509
- }
510
- echo '</div>';
511
-
512
- do_action( 'pwb_after_single_product_brands', $brands );
513
-
514
- }
515
-
516
- }
517
-
518
- }
519
-
520
- }
521
-
522
- public function register_frontend_scripts(){
523
-
524
- wp_register_script(
525
- 'pwb_slick_lib',
526
- PWB_PLUGIN . '/assets/js/slick/slick.min.js',
527
- array('jquery'),
528
- '1.8.0',
529
- true
530
- );
531
- wp_enqueue_script('pwb_frontend_functions');
532
-
533
- wp_enqueue_style(
534
- 'pwb_slick_lib',
535
- PWB_PLUGIN . '/assets/js/slick/slick.css',
536
- array(),
537
- '1.8.0',
538
- 'all'
539
- );
540
-
541
- wp_enqueue_style(
542
- 'pwb_frontend_styles',
543
- PWB_PLUGIN . '/assets/css/styles-frontend.min.css',
544
- array('pwb_slick_lib'),
545
- PWB_PLUGIN_VERSION,
546
- 'all'
547
- );
548
-
549
- wp_register_script(
550
- 'pwb_frontend_functions',
551
- PWB_PLUGIN . '/assets/js/pwb_frontend_functions.min.js',
552
- array('jquery','pwb_slick_lib'),
553
- PWB_PLUGIN_VERSION,
554
- true
555
- );
556
- wp_enqueue_script('pwb_frontend_functions');
557
-
558
- }
559
-
560
- public function register_admin_scripts($hook){
561
- $screen = get_current_screen();
562
-
563
- wp_register_style('pwb_styles_brands', PWB_PLUGIN . '/assets/css/styles-admin.min.css', array(), PWB_PLUGIN_VERSION);
564
- wp_register_script('pwb_brands_js', PWB_PLUGIN . '/assets/js/pwb_admin_functions.min.js', array('jquery'), PWB_PLUGIN_VERSION, true);
565
-
566
- if ($hook == 'edit-tags.php' && $screen->taxonomy == 'pwb-brand' || $hook == 'term.php' && $screen->taxonomy == 'pwb-brand') {
567
- wp_enqueue_media();
568
- }
569
-
570
- wp_enqueue_style( 'pwb_styles_brands' );
571
- wp_enqueue_script( 'pwb_brands_js' );
572
- wp_localize_script( 'pwb_brands_js', 'ajax_object', array(
573
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
574
- 'site_url' => site_url(),
575
- 'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
576
- 'translations' => array(
577
- 'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
578
- 'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands'),
579
- 'dummy_data_notice' => __('¿Start loading dummy data?','perfect-woocommerce-brands'),
580
- 'dummy_data' => __('We are importing the dummy data. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
581
- )
582
- ) );
583
-
584
- }
585
-
586
- public function register_brands_taxonomy(){
587
- $labels = array(
588
- 'name' => __( 'Brands', 'perfect-woocommerce-brands' ),
589
- 'singular_name' => __( 'Brand', 'perfect-woocommerce-brands' ),
590
- 'menu_name' => __( 'Brands', 'perfect-woocommerce-brands' ),
591
- 'all_items' => __( 'All Brands', 'perfect-woocommerce-brands' ),
592
- 'edit_item' => __( 'Edit Brand', 'perfect-woocommerce-brands' ),
593
- 'view_item' => __( 'View Brand', 'perfect-woocommerce-brands' ),
594
- 'update_item' => __( 'Update Brand', 'perfect-woocommerce-brands' ),
595
- 'add_new_item' => __( 'Add New Brand', 'perfect-woocommerce-brands' ),
596
- 'new_item_name' => __( 'New Brand Name', 'perfect-woocommerce-brands' ),
597
- 'parent_item' => __( 'Parent Brand', 'perfect-woocommerce-brands' ),
598
- 'parent_item_colon' => __( 'Parent Brand:', 'perfect-woocommerce-brands' ),
599
- 'search_items' => __( 'Search Brands', 'perfect-woocommerce-brands' ),
600
- 'popular_items' => __( 'Popular Brands', 'perfect-woocommerce-brands' ),
601
- 'separate_items_with_commas' => __( 'Separate brands with commas', 'perfect-woocommerce-brands' ),
602
- 'add_or_remove_items' => __( 'Add or remove brands', 'perfect-woocommerce-brands' ),
603
- 'choose_from_most_used' => __( 'Choose from the most used brands', 'perfect-woocommerce-brands' ),
604
- 'not_found' => __( 'No brands found', 'perfect-woocommerce-brands' )
605
- );
606
-
607
- $new_slug = get_option('wc_pwb_admin_tab_slug');
608
- $old_slug = get_option('old_wc_pwb_admin_tab_slug');
609
-
610
- $new_slug = ($new_slug!=false) ? $new_slug : 'brand';
611
- $old_slug = ($old_slug!=false) ? $old_slug : 'null';
612
-
613
- $args = array(
614
- 'hierarchical' => true,
615
- 'labels' => $labels,
616
- 'show_ui' => true,
617
- 'query_var' => true,
618
- 'public' => true,
619
- 'show_admin_column' => true,
620
- 'rewrite' => array(
621
- 'slug' => $new_slug,
622
- 'hierarchical' => true,
623
- 'ep_mask' => EP_PERMALINK
624
- )
625
- );
626
-
627
- register_taxonomy( 'pwb-brand', array( 'product' ), $args );
628
-
629
- if($new_slug != false && $old_slug!= false && $new_slug != $old_slug){
630
- flush_rewrite_rules();
631
- update_option( 'old_wc_pwb_admin_tab_slug', $new_slug );
632
- }
633
-
634
- }
635
-
636
- public function add_brands_metafields(){
637
- register_meta( 'term', 'pwb_brand_image', array($this,'add_brands_metafields_sanitize') );
638
- }
639
-
640
- public function add_brands_metafields_sanitize($brand_img){
641
- return $brand_img;
642
- }
643
-
644
- public function add_brands_metafields_form(){
645
- ob_start();
646
- ?>
647
- <div class="form-field pwb_brand_cont">
648
- <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
649
- <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
650
- <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
651
- </div>
652
-
653
- <div class="form-field pwb_brand_cont">
654
- <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
655
- <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
656
- <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
657
- <p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
658
- </div>
659
-
660
- <div class="form-field pwb_brand_cont">
661
- <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
662
- <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
663
- <p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
664
- </div>
665
-
666
- <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
667
-
668
- <?php
669
- echo ob_get_clean();
670
- }
671
-
672
- public function add_brands_metafields_form_edit($term){
673
- $term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
674
- $term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
675
- $term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
676
- ob_start();
677
- ?>
678
- <table class="form-table pwb_brand_cont">
679
- <tr class="form-field">
680
- <th>
681
- <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
682
- </th>
683
- <td>
684
- <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
685
- <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
686
-
687
- <?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
688
- <?php if( !empty($current_image) ): ?>
689
- <div class="pwb_brand_image_selected">
690
- <span>
691
- <?php echo $current_image;?>
692
- <a href="#" class="pwb_brand_image_selected_remove">X</a>
693
- </span>
694
- </div>
695
- <?php endif; ?>
696
-
697
- </td>
698
- </tr>
699
- <tr class="form-field">
700
- <th>
701
- <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
702
- </th>
703
- <td>
704
- <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
705
- <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
706
-
707
- <?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
708
- <?php if( !empty($current_image) ): ?>
709
- <div class="pwb_brand_image_selected">
710
- <span>
711
- <?php echo $current_image;?>
712
- <a href="#" class="pwb_brand_image_selected_remove">X</a>
713
- </span>
714
- </div>
715
- <?php endif; ?>
716
-
717
- </td>
718
- </tr>
719
- <tr class="form-field">
720
- <th>
721
- <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
722
- </th>
723
- <td>
724
- <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
725
- <p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
726
- <div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
727
- </td>
728
- </tr>
729
- </table>
730
-
731
- <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
732
-
733
- <?php
734
- echo ob_get_clean();
735
- }
736
-
737
- public function add_brands_metafields_save( $term_id ){
738
-
739
- if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
740
- return;
741
-
742
- /* ·············· Brand image ·············· */
743
- $old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
744
- $new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
745
-
746
- if ( $old_img && '' === $new_img )
747
- delete_term_meta( $term_id, 'pwb_brand_image' );
748
-
749
- else if ( $old_img !== $new_img )
750
- update_term_meta( $term_id, 'pwb_brand_image', $new_img );
751
- /* ·············· /Brand image ·············· */
752
-
753
- /* ·············· Brand banner ·············· */
754
- $old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
755
- $new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
756
-
757
- if ( $old_img && '' === $new_img )
758
- delete_term_meta( $term_id, 'pwb_brand_banner' );
759
-
760
- else if ( $old_img !== $new_img )
761
- update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
762
- /* ·············· /Brand banner ·············· */
763
-
764
- /* ·············· Brand banner link ·············· */
765
- $old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
766
- $new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
767
-
768
- if ( $old_img && '' === $new_img )
769
- delete_term_meta( $term_id, 'pwb_brand_banner_link' );
770
-
771
- else if ( $old_img !== $new_img )
772
- update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
773
- /* ·············· /Brand banner link ·············· */
774
- }
775
-
776
- public static function get_brands( $hide_empty = false, $order_by = 'name', $order = 'ASC', $only_featured = false ){
777
- $result = array();
778
-
779
- $brands_args = array( 'hide_empty' => $hide_empty, 'order_by' => $order_by, 'order' => $order );
780
- if( $only_featured ) $brands_args['meta_query'] = array( array( 'key' => 'pwb_featured_brand', 'value' => true ) );
781
-
782
- $brands = get_terms('pwb-brand', $brands_args);
783
-
784
- if( is_array($brands) && count($brands)>0 ) $result = $brands;
785
-
786
- return $result;
787
- }
788
-
789
- public static function get_brands_array( $is_select = false ){
790
- $result = array();
791
-
792
- //if is for select input adds default value
793
- if( $is_select )
794
- $result[0] = __( 'All', 'perfect-woocommerce-brands' );
795
-
796
- $brands = get_terms('pwb-brand',array(
797
- 'hide_empty' => false
798
- ));
799
-
800
- foreach ($brands as $brand) {
801
- $result[$brand->term_id] = $brand->slug;
802
- }
803
-
804
- return $result;
805
-
806
- }
807
-
808
- public function archive_page_banner(){
809
- $queried_object = get_queried_object();
810
-
811
- if( is_tax('pwb-brand') ){
812
-
813
- $brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
814
- $brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
815
- $show_desc = get_option('wc_pwb_admin_tab_brand_desc');
816
-
817
- if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
818
- echo '<div class="pwb-brand-banner-cont">';
819
- }
820
-
821
- //pwb-brand archive
822
- if( $brand_banner!='' ){
823
- echo '<div class="pwb-brand-banner pwb-clearfix">';
824
- if($brand_banner_link!=''){
825
- echo '<a href="'.site_url($brand_banner_link).'">'.wp_get_attachment_image ( $brand_banner, 'full', false ).'</a>';
826
- }else{
827
- echo wp_get_attachment_image ( $brand_banner, 'full', false );
828
- }
829
- echo '</div>';
830
- }
831
-
832
- //show brand description
833
- if( $queried_object->description != '' && $show_desc !== 'no' ){
834
- echo '<div class="pwb-brand-description">';
835
- echo $queried_object->description;
836
- echo '</div>';
837
- }
838
-
839
- if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
840
- echo '</div>';
841
- }
842
-
843
- }
844
-
845
- }
846
-
847
- public static function render_template( $name, $folder = '', $data ){
848
- ob_start();
849
- if( $folder ) $folder = $folder . '/';
850
- $template_file = dirname( __DIR__ ) . '/templates/' . $folder . $name . '.php';
851
- include $template_file;
852
- echo ob_get_clean();
853
- }
854
-
855
- public function product_duplicate_save( $duplicate, $product ){
856
- $product_brands = wp_get_object_terms( $product->get_id(), 'pwb-brand', array( 'fields' => 'ids' ) );
857
- wp_set_object_terms( $duplicate->get_id(), $product_brands, 'pwb-brand' );
858
- }
859
-
860
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class Perfect_Woocommerce_Brands{
7
+
8
+ function __construct(){
9
+ add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
10
+ add_action( 'init', array( $this, 'add_brands_metafields' ) );
11
+ add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
12
+ add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
13
+ add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
14
+ add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
15
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
16
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
17
+ $this->brand_logo_position();
18
+ add_action( 'woocommerce_before_shop_loop', array( $this, 'archive_page_banner' ), 9);
19
+ add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
20
+ $this->add_shortcodes();
21
+ if( is_plugin_active('js_composer/js_composer.php') || is_plugin_active('visual_composer/js_composer.php') ){
22
+ add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
23
+ }
24
+ add_action( 'widgets_init', array( $this, 'register_widgets' ) );
25
+
26
+ if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '3.0.0', '>=' ) ){
27
+ add_filter( 'woocommerce_structured_data_product', array( $this, 'product_microdata' ), 10, 2 );
28
+ }else{
29
+ add_action( 'wp_head' , array( $this, 'product_microdata_legacy' ), 40 );
30
+ }
31
+
32
+ add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
33
+ add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
34
+ add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
35
+ add_action( 'admin_notices', array( $this, 'review_notice' ) );
36
+
37
+ add_action( 'pre_get_posts', function(){
38
+ if( is_tax('pwb-brand') )
39
+ remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
40
+ });
41
+ add_action( 'woocommerce_product_duplicate', array( $this, 'product_duplicate_save' ), 10, 2 );
42
+ }
43
+
44
+ public function review_notice(){
45
+ $show_notice = get_option('wc_pwb_notice_plugin_review', true);
46
+ $activate_on = get_option('pwb_activate_on', time());
47
+ $now = time();
48
+ $one_month = 2592000;
49
+ $date_diff = $now - $activate_on;
50
+
51
+ if ( $show_notice && $date_diff > $one_month ) {
52
+ ?>
53
+ <div class="notice notice-info pwb-notice-dismissible is-dismissible" data-notice="wc_pwb_notice_plugin_review">
54
+ <p><?php echo __('We know that you´re in love with Perfect WooCommerce Brands, you can help us making it a bit better. Thanks a lot!', 'perfect-woocommerce-brands' ); ?><span class="dashicons dashicons-heart"></span></p>
55
+ <p>
56
+ <?php _e( '<a href="https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?rate=5#new-post" target="_blank">Leave a review</a>', 'perfect-woocommerce-brands' ); ?>
57
+ <?php _e( '<a href="https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands" target="_blank">Translate the plugin</a>', 'perfect-woocommerce-brands' ); ?>
58
+ <?php _e( '<a href="https://github.com/titodevera/perfect-woocommerce-brands" target="_blank">View on GitHub</a>', 'perfect-woocommerce-brands' ); ?>
59
+ </p>
60
+ </div>
61
+ <?php
62
+ }
63
+ }
64
+
65
+ public function dismiss_pwb_notice(){
66
+ $notice_name_whitelist = array( 'wc_pwb_notice_plugin_review' );
67
+ if( isset( $_POST['notice_name'] ) && in_array( $_POST['notice_name'], $notice_name_whitelist ) ){
68
+ update_option( $_POST['notice_name'], 0 );
69
+ echo 'ok';
70
+ }else{
71
+ echo 'error';
72
+ }
73
+ wp_die();
74
+ }
75
+
76
+ /**
77
+ * Adds a settings shortcut to plugin´s actions on plugins list
78
+ */
79
+ public function plugin_action_links( $links ) {
80
+ $settings_url = esc_url( admin_url( 'admin.php?page=wc-settings&tab=pwb_admin_tab' ) );
81
+ $links[] = '<a href="'. $settings_url .'">'.__('Settings','perfect-woocommerce-brands').'</a>';
82
+ return $links;
83
+ }
84
+
85
+ public function pwb_brand_filter( $query ){
86
+
87
+ if( !empty($_GET['pwb-brand-filter']) ){
88
+
89
+ $terms_array = explode(',',$_GET['pwb-brand-filter']);
90
+
91
+ //remove invalid terms (security)
92
+ for($i=0; $i < count($terms_array); $i++) {
93
+ if( !term_exists( $terms_array[$i], 'pwb-brand' ) ) unset($terms_array[$i]);
94
+ }
95
+
96
+ $filterable_product = false;
97
+ if( is_product_category() || is_post_type_archive( 'product' ) )
98
+ $filterable_product = true;
99
+
100
+ if( $filterable_product && $query->is_main_query() ) {
101
+
102
+ $query->set('tax_query', array(
103
+ array (
104
+ 'taxonomy' => 'pwb-brand',
105
+ 'field' => 'slug',
106
+ 'terms' => $terms_array
107
+ )
108
+ ));
109
+
110
+ }
111
+
112
+ }
113
+
114
+ }
115
+
116
+ /*
117
+ * Adds microdata (brands) to single products (WooCommerce < 3.0.0)
118
+ */
119
+ public function product_microdata_legacy(){
120
+ global $post;
121
+
122
+ if( isset( $post->post_type ) && $post->post_type==='product' ){
123
+ $brands = wp_get_post_terms( $post->ID, 'pwb-brand');
124
+ foreach ($brands as $brand) {
125
+ echo '<meta itemprop="brand" content="'.$brand->name.'">';
126
+ }
127
+ }
128
+
129
+ }
130
+
131
+ /*
132
+ * Adds microdata (brands) to single products (WooCommerce > 3.0.0)
133
+ */
134
+ public function product_microdata( $markup, $product ){
135
+
136
+ $new_markup = array();
137
+ $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand');
138
+ foreach ($brands as $brand) {
139
+ $new_markup['brand'][] = $brand->name;
140
+ }
141
+
142
+ return array_merge( $markup, $new_markup );
143
+
144
+ }
145
+
146
+ public function add_shortcodes(){
147
+ add_shortcode( 'pwb-carousel', array(
148
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
149
+ 'carousel_shortcode'
150
+ ) );
151
+ add_shortcode( 'pwb-product-carousel', array(
152
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
153
+ 'product_carousel_shortcode'
154
+ ) );
155
+ add_shortcode( 'pwb-all-brands', array(
156
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
157
+ 'all_brands_shortcode'
158
+ ) );
159
+ add_shortcode( 'pwb-brand', array(
160
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
161
+ 'brand_shortcode'
162
+ ) );
163
+ }
164
+
165
+ public function register_widgets(){
166
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
167
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
168
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
169
+ }
170
+
171
+ public function show_brands_in_loop(){
172
+
173
+ $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
174
+
175
+ if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
176
+
177
+ global $product;
178
+ $product_id = $product->get_id();
179
+ $product_brands = wp_get_post_terms($product_id, 'pwb-brand');
180
+ if(!empty($product_brands)){
181
+ echo '<div class="pwb-brands-in-loop">';
182
+ foreach ($product_brands as $brand) {
183
+
184
+ echo '<span>';
185
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
186
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
187
+
188
+ $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
189
+ if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
190
+ echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
191
+ }else{
192
+ echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
193
+ }
194
+ echo '</span>';
195
+
196
+ }
197
+ echo '</div>';
198
+ }
199
+
200
+ }
201
+
202
+ }
203
+
204
+ /**
205
+ * woocommerce_single_product_summary hook.
206
+ *
207
+ * @hooked woocommerce_template_single_title - 5
208
+ * @hooked woocommerce_template_single_rating - 10
209
+ * @hooked woocommerce_template_single_price - 10
210
+ * @hooked woocommerce_template_single_excerpt - 20
211
+ * @hooked woocommerce_template_single_add_to_cart - 30
212
+ * @hooked woocommerce_template_single_meta - 40
213
+ * @hooked woocommerce_template_single_sharing - 50
214
+ */
215
+ private function brand_logo_position(){
216
+ $position = 41;
217
+ $position_selected = get_option('wc_pwb_admin_tab_brand_single_position');
218
+ if(!$position_selected){
219
+ update_option('wc_pwb_admin_tab_brand_single_position','after_meta');
220
+ }
221
+ switch ($position_selected) {
222
+ case 'before_title':
223
+ $position = 4;
224
+ break;
225
+ case 'after_title':
226
+ $position = 6;
227
+ break;
228
+ case 'after_price':
229
+ $position = 11;
230
+ break;
231
+ case 'after_excerpt':
232
+ $position = 21;
233
+ break;
234
+ case 'after_add_to_cart':
235
+ $position = 31;
236
+ break;
237
+ case 'after_meta':
238
+ $position = 41;
239
+ break;
240
+ case 'after_sharing':
241
+ $position = 51;
242
+ break;
243
+ }
244
+ add_action('woocommerce_single_product_summary', array($this,'action_woocommerce_single_product_summary'), $position);
245
+ }
246
+
247
+
248
+ /*
249
+ * Maps shortcode (for visual composer plugin)
250
+ *
251
+ * @since 1.0
252
+ * @link https://vc.wpbakery.com/
253
+ * @return mixed
254
+ */
255
+ public function vc_map_shortcodes(){
256
+ $available_image_sizes_adapted = array();
257
+ $available_image_sizes = get_intermediate_image_sizes();
258
+
259
+ foreach($available_image_sizes as $image_size){
260
+ $available_image_sizes_adapted[$image_size] = $image_size;
261
+ }
262
+
263
+ vc_map(array(
264
+ "name" => __( "PWB Product carousel", "perfect-woocommerce-brands" ),
265
+ "description" => __( "Product carousel by brand or by category", "perfect-woocommerce-brands" ),
266
+ "base" => "pwb-product-carousel",
267
+ "class" => "",
268
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
269
+ "category" => "Woocommerce",
270
+ "params" => array(
271
+ array(
272
+ "type" => "dropdown",
273
+ "heading" => __( "Brand", "perfect-woocommerce-brands" ),
274
+ "param_name" => "brand",
275
+ "admin_label" => true,
276
+ "value" => self::get_brands_array( true )
277
+ ),
278
+ array(
279
+ "type" => "textfield",
280
+ "holder" => "div",
281
+ "heading" => __( "Products", "perfect-woocommerce-brands" ),
282
+ "param_name" => "products",
283
+ "value" => "10",
284
+ "description" => __( "Number of products to load", "perfect-woocommerce-brands" )
285
+ ),
286
+ array(
287
+ "type" => "textfield",
288
+ "holder" => "div",
289
+ "heading" => __( "Products to show", "perfect-woocommerce-brands" ),
290
+ "param_name" => "products_to_show",
291
+ "value" => "5",
292
+ "description" => __( "Number of products to show", "perfect-woocommerce-brands" )
293
+ ),
294
+ array(
295
+ "type" => "textfield",
296
+ "holder" => "div",
297
+ "heading" => __( "Products to scroll", "perfect-woocommerce-brands" ),
298
+ "param_name" => "products_to_scroll",
299
+ "value" => "1",
300
+ "description" => __( "Number of products to scroll", "perfect-woocommerce-brands" )
301
+ ),
302
+ array(
303
+ "type" => "checkbox",
304
+ "holder" => "div",
305
+ "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
306
+ "param_name" => "autoplay",
307
+ "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
308
+ ),
309
+ array(
310
+ "type" => "checkbox",
311
+ "holder" => "div",
312
+ "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
313
+ "param_name" => "arrows",
314
+ "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
315
+ )
316
+ )
317
+ ));
318
+
319
+ vc_map(array(
320
+ "name" => __( "PWB Brands carousel", "perfect-woocommerce-brands" ),
321
+ "description" => __( "Brands carousel", "perfect-woocommerce-brands" ),
322
+ "base" => "pwb-carousel",
323
+ "class" => "",
324
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
325
+ "category" => "Woocommerce",
326
+ "params" => array(
327
+ array(
328
+ "type" => "textfield",
329
+ "holder" => "div",
330
+ "heading" => __( "Items", "perfect-woocommerce-brands" ),
331
+ "param_name" => "items",
332
+ "value" => "10",
333
+ "description" => __( "Number of items to load (or 'featured')", "perfect-woocommerce-brands" )
334
+ ),
335
+ array(
336
+ "type" => "textfield",
337
+ "holder" => "div",
338
+ "heading" => __( "Items to show", "perfect-woocommerce-brands" ),
339
+ "param_name" => "items_to_show",
340
+ "value" => "5",
341
+ "description" => __( "Number of items to show", "perfect-woocommerce-brands" )
342
+ ),
343
+ array(
344
+ "type" => "textfield",
345
+ "holder" => "div",
346
+ "heading" => __( "Items to scroll", "perfect-woocommerce-brands" ),
347
+ "param_name" => "items_to_scroll",
348
+ "value" => "1",
349
+ "description" => __( "Number of items to scroll", "perfect-woocommerce-brands" )
350
+ ),
351
+ array(
352
+ "type" => "checkbox",
353
+ "holder" => "div",
354
+ "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
355
+ "param_name" => "autoplay",
356
+ "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
357
+ ),
358
+ array(
359
+ "type" => "checkbox",
360
+ "holder" => "div",
361
+ "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
362
+ "param_name" => "arrows",
363
+ "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
364
+ ),
365
+ array(
366
+ "type" => "dropdown",
367
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
368
+ "param_name" => "image_size",
369
+ "admin_label" => true,
370
+ "value" => $available_image_sizes_adapted
371
+ )
372
+ )
373
+
374
+
375
+ ));
376
+
377
+ vc_map(array(
378
+ "name" => __( "PWB All brands", "perfect-woocommerce-brands" ),
379
+ "description" => __( "Show all brands", "perfect-woocommerce-brands" ),
380
+ "base" => "pwb-all-brands",
381
+ "class" => "",
382
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
383
+ "category" => "Woocommerce",
384
+ "params" => array(
385
+ array(
386
+ "type" => "textfield",
387
+ "holder" => "div",
388
+ "heading" => __( "Brands per page", "perfect-woocommerce-brands" ),
389
+ "param_name" => "per_page",
390
+ "value" => "10",
391
+ "description" => __( "Show x brands per page", "perfect-woocommerce-brands" )
392
+ ),
393
+ array(
394
+ "type" => "dropdown",
395
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
396
+ "param_name" => "image_size",
397
+ "admin_label" => true,
398
+ "value" => $available_image_sizes_adapted
399
+ ),
400
+ array(
401
+ "type" => "dropdown",
402
+ "heading" => __( "Order by", "perfect-woocommerce-brands" ),
403
+ "param_name" => "order_by",
404
+ "admin_label" => true,
405
+ "value" => array(
406
+ 'name' => 'name',
407
+ 'slug' => 'slug',
408
+ 'term_id' => 'term_id',
409
+ 'id' => 'id',
410
+ 'description' => 'description',
411
+ 'rand' => 'rand'
412
+ )
413
+ ),
414
+ array(
415
+ "type" => "dropdown",
416
+ "heading" => __( "Order", "perfect-woocommerce-brands" ),
417
+ "param_name" => "order",
418
+ "admin_label" => true,
419
+ "value" => array(
420
+ 'ASC' => 'ASC',
421
+ 'DSC' => 'DSC'
422
+ )
423
+ ),
424
+ array(
425
+ "type" => "dropdown",
426
+ "heading" => __( "Title position", "perfect-woocommerce-brands" ),
427
+ "param_name" => "title_position",
428
+ "admin_label" => true,
429
+ "value" => array(
430
+ __( "Before image", "perfect-woocommerce-brands" ) => 'before',
431
+ __( "After image", "perfect-woocommerce-brands" ) => 'after',
432
+ __( "Hide", "perfect-woocommerce-brands" ) => 'none'
433
+ )
434
+ ),
435
+ array(
436
+ "type" => "checkbox",
437
+ "holder" => "div",
438
+ "heading" => __( "Hide empty", "perfect-woocommerce-brands" ),
439
+ "param_name" => "hide_empty",
440
+ "description" => __( "Hide brands that have not been assigned to any product", "perfect-woocommerce-brands" )
441
+ )
442
+ )
443
+
444
+
445
+ ));
446
+
447
+ vc_map(array(
448
+ "name" => __( "PWB brand", "perfect-woocommerce-brands" ),
449
+ "description" => __( "Show brand for a specific product", "perfect-woocommerce-brands" ),
450
+ "base" => "pwb-brand",
451
+ "class" => "",
452
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
453
+ "category" => "Woocommerce",
454
+
455
+ "params" => array(
456
+ array(
457
+ "type" => "textfield",
458
+ "holder" => "div",
459
+ "heading" => __( "Product id", "perfect-woocommerce-brands" ),
460
+ "param_name" => "product_id",
461
+ "value" => null,
462
+ "description" => __( "Product id (post id)", "perfect-woocommerce-brands" )
463
+ ),
464
+ array(
465
+ "type" => "dropdown",
466
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
467
+ "param_name" => "image_size",
468
+ "admin_label" => true,
469
+ "value" => $available_image_sizes_adapted
470
+ )
471
+
472
+ )
473
+
474
+
475
+ ));
476
+ }
477
+
478
+ public function action_woocommerce_single_product_summary() {
479
+ $brands = wp_get_post_terms( get_the_ID(), 'pwb-brand');
480
+
481
+ if( !is_wp_error( $brands ) ){
482
+
483
+ if( sizeof( $brands ) > 0 ){
484
+
485
+ $show_as = get_option( 'wc_pwb_admin_tab_brands_in_single' );
486
+
487
+ if( $show_as!='no' ){
488
+
489
+ do_action( 'pwb_before_single_product_brands', $brands );
490
+
491
+ echo '<div class="pwb-single-product-brands pwb-clearfix">';
492
+ foreach( $brands as $brand ){
493
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
494
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
495
+
496
+ $image_size = 'thumbnail';
497
+ $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size');
498
+ if($image_size_selected!=false){
499
+ $image_size = $image_size_selected;
500
+ }
501
+
502
+ $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
503
+
504
+ if( !empty($attachment_html) && $show_as=='brand_image' || !empty($attachment_html) && !$show_as ){
505
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
506
+ }else{
507
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
508
+ }
509
+ }
510
+ echo '</div>';
511
+
512
+ do_action( 'pwb_after_single_product_brands', $brands );
513
+
514
+ }
515
+
516
+ }
517
+
518
+ }
519
+
520
+ }
521
+
522
+ public function enqueue_scripts(){
523
+
524
+ wp_enqueue_script(
525
+ 'pwb-lib-slick',
526
+ PWB_PLUGIN . '/assets/lib/slick/slick.min.js',
527
+ array('jquery'),
528
+ '1.8.0',
529
+ true
530
+ );
531
+
532
+ wp_enqueue_style(
533
+ 'pwb-lib-slick',
534
+ PWB_PLUGIN . '/assets/lib/slick/slick.css',
535
+ array(),
536
+ '1.8.0',
537
+ 'all'
538
+ );
539
+
540
+ wp_enqueue_style(
541
+ 'pwb-styles-frontend',
542
+ PWB_PLUGIN . '/assets/css/styles-frontend.min.css',
543
+ array('pwb-lib-slick'),
544
+ PWB_PLUGIN_VERSION,
545
+ 'all'
546
+ );
547
+
548
+ wp_enqueue_script(
549
+ 'pwb-functions-frontend',
550
+ PWB_PLUGIN . '/assets/js/functions-frontend.min.js',
551
+ array('jquery','pwb-lib-slick'),
552
+ PWB_PLUGIN_VERSION,
553
+ true
554
+ );
555
+
556
+ }
557
+
558
+ public function admin_enqueue_scripts( $hook ){
559
+ $screen = get_current_screen();
560
+ if($hook == 'edit-tags.php' && $screen->taxonomy == 'pwb-brand' || $hook == 'term.php' && $screen->taxonomy == 'pwb-brand') {
561
+ wp_enqueue_media();
562
+ }
563
+
564
+ wp_enqueue_style('pwb-styles-admin', PWB_PLUGIN . '/assets/css/styles-admin.min.css', array(), PWB_PLUGIN_VERSION);
565
+
566
+ wp_register_script('pwb-functions-admin', PWB_PLUGIN . '/assets/js/functions-admin.min.js', array('jquery'), PWB_PLUGIN_VERSION, true);
567
+ wp_localize_script( 'pwb-functions-admin', 'ajax_object', array(
568
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
569
+ 'site_url' => site_url(),
570
+ 'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
571
+ 'translations' => array(
572
+ 'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
573
+ 'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands'),
574
+ 'dummy_data_notice' => __('¿Start loading dummy data?','perfect-woocommerce-brands'),
575
+ 'dummy_data' => __('We are importing the dummy data. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
576
+ )
577
+ ) );
578
+ wp_enqueue_script( 'pwb-functions-admin' );
579
+
580
+ }
581
+
582
+ public function register_brands_taxonomy(){
583
+ $labels = array(
584
+ 'name' => __( 'Brands', 'perfect-woocommerce-brands' ),
585
+ 'singular_name' => __( 'Brand', 'perfect-woocommerce-brands' ),
586
+ 'menu_name' => __( 'Brands', 'perfect-woocommerce-brands' ),
587
+ 'all_items' => __( 'All Brands', 'perfect-woocommerce-brands' ),
588
+ 'edit_item' => __( 'Edit Brand', 'perfect-woocommerce-brands' ),
589
+ 'view_item' => __( 'View Brand', 'perfect-woocommerce-brands' ),
590
+ 'update_item' => __( 'Update Brand', 'perfect-woocommerce-brands' ),
591
+ 'add_new_item' => __( 'Add New Brand', 'perfect-woocommerce-brands' ),
592
+ 'new_item_name' => __( 'New Brand Name', 'perfect-woocommerce-brands' ),
593
+ 'parent_item' => __( 'Parent Brand', 'perfect-woocommerce-brands' ),
594
+ 'parent_item_colon' => __( 'Parent Brand:', 'perfect-woocommerce-brands' ),
595
+ 'search_items' => __( 'Search Brands', 'perfect-woocommerce-brands' ),
596
+ 'popular_items' => __( 'Popular Brands', 'perfect-woocommerce-brands' ),
597
+ 'separate_items_with_commas' => __( 'Separate brands with commas', 'perfect-woocommerce-brands' ),
598
+ 'add_or_remove_items' => __( 'Add or remove brands', 'perfect-woocommerce-brands' ),
599
+ 'choose_from_most_used' => __( 'Choose from the most used brands', 'perfect-woocommerce-brands' ),
600
+ 'not_found' => __( 'No brands found', 'perfect-woocommerce-brands' )
601
+ );
602
+
603
+ $new_slug = get_option('wc_pwb_admin_tab_slug');
604
+ $old_slug = get_option('old_wc_pwb_admin_tab_slug');
605
+
606
+ $new_slug = ($new_slug!=false) ? $new_slug : 'brand';
607
+ $old_slug = ($old_slug!=false) ? $old_slug : 'null';
608
+
609
+ $args = array(
610
+ 'hierarchical' => true,
611
+ 'labels' => $labels,
612
+ 'show_ui' => true,
613
+ 'query_var' => true,
614
+ 'public' => true,
615
+ 'show_admin_column' => true,
616
+ 'rewrite' => array(
617
+ 'slug' => $new_slug,
618
+ 'hierarchical' => true,
619
+ 'ep_mask' => EP_PERMALINK
620
+ )
621
+ );
622
+
623
+ register_taxonomy( 'pwb-brand', array( 'product' ), $args );
624
+
625
+ if($new_slug != false && $old_slug!= false && $new_slug != $old_slug){
626
+ flush_rewrite_rules();
627
+ update_option( 'old_wc_pwb_admin_tab_slug', $new_slug );
628
+ }
629
+
630
+ }
631
+
632
+ public function add_brands_metafields(){
633
+ register_meta( 'term', 'pwb_brand_image', array($this,'add_brands_metafields_sanitize') );
634
+ }
635
+
636
+ public function add_brands_metafields_sanitize($brand_img){
637
+ return $brand_img;
638
+ }
639
+
640
+ public function add_brands_metafields_form(){
641
+ ob_start();
642
+ ?>
643
+ <div class="form-field pwb_brand_cont">
644
+ <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
645
+ <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
646
+ <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
647
+ </div>
648
+
649
+ <div class="form-field pwb_brand_cont">
650
+ <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
651
+ <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
652
+ <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
653
+ <p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
654
+ </div>
655
+
656
+ <div class="form-field pwb_brand_cont">
657
+ <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
658
+ <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
659
+ <p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
660
+ </div>
661
+
662
+ <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
663
+
664
+ <?php
665
+ echo ob_get_clean();
666
+ }
667
+
668
+ public function add_brands_metafields_form_edit($term){
669
+ $term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
670
+ $term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
671
+ $term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
672
+ ob_start();
673
+ ?>
674
+ <table class="form-table pwb_brand_cont">
675
+ <tr class="form-field">
676
+ <th>
677
+ <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
678
+ </th>
679
+ <td>
680
+ <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
681
+ <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
682
+
683
+ <?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
684
+ <?php if( !empty($current_image) ): ?>
685
+ <div class="pwb_brand_image_selected">
686
+ <span>
687
+ <?php echo $current_image;?>
688
+ <a href="#" class="pwb_brand_image_selected_remove">X</a>
689
+ </span>
690
+ </div>
691
+ <?php endif; ?>
692
+
693
+ </td>
694
+ </tr>
695
+ <tr class="form-field">
696
+ <th>
697
+ <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
698
+ </th>
699
+ <td>
700
+ <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
701
+ <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
702
+
703
+ <?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
704
+ <?php if( !empty($current_image) ): ?>
705
+ <div class="pwb_brand_image_selected">
706
+ <span>
707
+ <?php echo $current_image;?>
708
+ <a href="#" class="pwb_brand_image_selected_remove">X</a>
709
+ </span>
710
+ </div>
711
+ <?php endif; ?>
712
+
713
+ </td>
714
+ </tr>
715
+ <tr class="form-field">
716
+ <th>
717
+ <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
718
+ </th>
719
+ <td>
720
+ <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
721
+ <p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
722
+ <div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
723
+ </td>
724
+ </tr>
725
+ </table>
726
+
727
+ <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
728
+
729
+ <?php
730
+ echo ob_get_clean();
731
+ }
732
+
733
+ public function add_brands_metafields_save( $term_id ){
734
+
735
+ if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
736
+ return;
737
+
738
+ /* ·············· Brand image ·············· */
739
+ $old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
740
+ $new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
741
+
742
+ if ( $old_img && '' === $new_img )
743
+ delete_term_meta( $term_id, 'pwb_brand_image' );
744
+
745
+ else if ( $old_img !== $new_img )
746
+ update_term_meta( $term_id, 'pwb_brand_image', $new_img );
747
+ /* ·············· /Brand image ·············· */
748
+
749
+ /* ·············· Brand banner ·············· */
750
+ $old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
751
+ $new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
752
+
753
+ if ( $old_img && '' === $new_img )
754
+ delete_term_meta( $term_id, 'pwb_brand_banner' );
755
+
756
+ else if ( $old_img !== $new_img )
757
+ update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
758
+ /* ·············· /Brand banner ·············· */
759
+
760
+ /* ·············· Brand banner link ·············· */
761
+ $old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
762
+ $new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
763
+
764
+ if ( $old_img && '' === $new_img )
765
+ delete_term_meta( $term_id, 'pwb_brand_banner_link' );
766
+
767
+ else if ( $old_img !== $new_img )
768
+ update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
769
+ /* ·············· /Brand banner link ·············· */
770
+ }
771
+
772
+ public static function get_brands( $hide_empty = false, $order_by = 'name', $order = 'ASC', $only_featured = false ){
773
+ $result = array();
774
+
775
+ $brands_args = array( 'hide_empty' => $hide_empty, 'order_by' => $order_by, 'order' => $order );
776
+ if( $only_featured ) $brands_args['meta_query'] = array( array( 'key' => 'pwb_featured_brand', 'value' => true ) );
777
+
778
+ $brands = get_terms('pwb-brand', $brands_args);
779
+
780
+ if( is_array($brands) && count($brands)>0 ) $result = $brands;
781
+
782
+ return $result;
783
+ }
784
+
785
+ public static function get_brands_array( $is_select = false ){
786
+ $result = array();
787
+
788
+ //if is for select input adds default value
789
+ if( $is_select )
790
+ $result[0] = __( 'All', 'perfect-woocommerce-brands' );
791
+
792
+ $brands = get_terms('pwb-brand',array(
793
+ 'hide_empty' => false
794
+ ));
795
+
796
+ foreach ($brands as $brand) {
797
+ $result[$brand->term_id] = $brand->slug;
798
+ }
799
+
800
+ return $result;
801
+
802
+ }
803
+
804
+ public function archive_page_banner(){
805
+ $queried_object = get_queried_object();
806
+
807
+ if( is_tax('pwb-brand') ){
808
+
809
+ $brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
810
+ $brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
811
+ $show_desc = get_option('wc_pwb_admin_tab_brand_desc');
812
+
813
+ if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
814
+ echo '<div class="pwb-brand-banner-cont">';
815
+ }
816
+
817
+ //pwb-brand archive
818
+ if( $brand_banner!='' ){
819
+ echo '<div class="pwb-brand-banner pwb-clearfix">';
820
+ if($brand_banner_link!=''){
821
+ echo '<a href="'.site_url($brand_banner_link).'">'.wp_get_attachment_image ( $brand_banner, 'full', false ).'</a>';
822
+ }else{
823
+ echo wp_get_attachment_image ( $brand_banner, 'full', false );
824
+ }
825
+ echo '</div>';
826
+ }
827
+
828
+ //show brand description
829
+ if( $queried_object->description != '' && $show_desc !== 'no' ){
830
+ echo '<div class="pwb-brand-description">';
831
+ echo $queried_object->description;
832
+ echo '</div>';
833
+ }
834
+
835
+ if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
836
+ echo '</div>';
837
+ }
838
+
839
+ }
840
+
841
+ }
842
+
843
+ public static function render_template( $name, $folder = '', $data ){
844
+ ob_start();
845
+ if( $folder ) $folder = $folder . '/';
846
+ $template_file = dirname( __DIR__ ) . '/templates/' . $folder . $name . '.php';
847
+ include $template_file;
848
+ return ob_get_clean();
849
+ }
850
+
851
+ public function product_duplicate_save( $duplicate, $product ){
852
+ $product_brands = wp_get_object_terms( $product->get_id(), 'pwb-brand', array( 'fields' => 'ids' ) );
853
+ wp_set_object_terms( $duplicate->get_id(), $product_brands, 'pwb-brand' );
854
+ }
855
+
856
+ }
 
 
 
 
classes/class-pwb-api-support.php CHANGED
@@ -1,150 +1,150 @@
1
- <?php
2
-
3
- namespace Perfect_Woocommerce_Brands;
4
- use WP_Error, WP_REST_Server;
5
-
6
- defined('ABSPATH') or die('No script kiddies please!');
7
-
8
- class PWB_API_Support{
9
-
10
- private $namespaces = array(
11
- "wc/v1",
12
- "wc/v2",
13
- );
14
- private $base = 'brands';
15
-
16
- function __construct(){
17
- add_action('rest_api_init', array($this, 'register_endpoints'));
18
-
19
- /**
20
- * register_rest_field() was introduced in WordPress 4.7.0
21
- */
22
- if (version_compare(PWB_WP_VERSION, '4.7.0', '>=')) {
23
- add_action('rest_api_init', array($this, 'register_fields'));
24
- }
25
-
26
- }
27
-
28
- /**
29
- * Registers the endpoint for all possible $namespaces
30
- */
31
- public function register_endpoints(){
32
- foreach( $this->namespaces as $namespace ) {
33
- register_rest_route($namespace, '/'.$this->base, array(
34
- array(
35
- 'methods' => WP_REST_Server::READABLE,
36
- 'callback' => function () {
37
- return rest_ensure_response(
38
- Perfect_Woocommerce_Brands::get_brands()
39
- );
40
- }
41
- ),
42
- array(
43
- 'methods' => WP_REST_Server::CREATABLE,
44
- 'callback' => array( $this, 'create_brand' )
45
- ),
46
- array(
47
- 'methods' => WP_REST_Server::DELETABLE,
48
- 'callback' => array( $this, 'delete_brand' )
49
- )
50
- ));
51
- }
52
- }
53
-
54
- public function delete_brand( $request ){
55
- foreach( $request['brands'] as $brand ){
56
- $delete_result = wp_delete_term( $brand, 'pwb-brand' );
57
- if( is_wp_error( $delete_result ) ) return $delete_result;
58
- }
59
- return true;
60
- }
61
-
62
- public function create_brand( $request ){
63
- $new_brand = wp_insert_term( $request['name'], 'pwb-brand', array( 'slug' => $request['slug'] ) );
64
- if( !is_wp_error( $new_brand ) ){
65
- return true;
66
- }else{
67
- return $new_brand;
68
- }
69
- }
70
-
71
- /**
72
- * Entry point for all rest field settings
73
- */
74
- public function register_fields(){
75
- register_rest_field('product', 'brands', array(
76
- 'get_callback' => array($this, "get_callback"),
77
- 'update_callback' => array($this, "update_callback"),
78
- 'schema' => $this->get_schema(),
79
- ));
80
- }
81
-
82
- /**
83
- * Returns the schema of the "brands" field on the /product route
84
- * To attach a brand to a product just append a "brands" key containing an array of brand id's
85
- * An empty array wil detach all brands.
86
- * @return array
87
- */
88
- public function get_schema(){
89
- return array(
90
- 'description' => __('Product brands', 'perfect-woocommerce-brands'),
91
- 'type' => 'array',
92
- 'items' => array(
93
- "type" => "integer"
94
- ),
95
- 'context' => array("view", "edit")
96
- );
97
- }
98
-
99
- /**
100
- * Returns all attached brands to a GET request to /products(/id)
101
- * @param $product
102
- * @return array|\WP_Error
103
- */
104
- public function get_callback($product){
105
- $brands = wp_get_post_terms($product['id'], 'pwb-brand');
106
-
107
- $result_brands_array = array();
108
- foreach ($brands as $brand) {
109
- $result_brands_array[] = array(
110
- 'id' => $brand->term_id,
111
- 'name' => $brand->name,
112
- 'slug' => $brand->slug
113
- );
114
- }
115
-
116
- return $result_brands_array;
117
- }
118
-
119
- /**
120
- * Entry point for an update call
121
- * @param $brands
122
- * @param $product
123
- */
124
- public function update_callback($brands, $product){
125
- $this->remove_brands($product);
126
- $this->add_brands($brands, $product);
127
- }
128
-
129
-
130
- /**
131
- * Detaches all brands from a product
132
- * @param \WC_Product $product
133
- */
134
- private function remove_brands($product){
135
- $brands = wp_get_post_terms($product->get_id(), 'pwb-brand');
136
- if (!empty($brands)) {
137
- wp_set_post_terms($product->get_id(), array(), 'pwb-brand');
138
- }
139
- }
140
-
141
- /**
142
- * Attaches the given brands to a product. Earlier attached brands, not in this array, will be removed
143
- * @param array $brands
144
- * @param \WC_Product $product
145
- */
146
- private function add_brands($brands, $product){
147
- wp_set_post_terms($product->get_id(), $brands, "pwb-brand");
148
- }
149
-
150
- }
1
+ <?php
2
+
3
+ namespace Perfect_Woocommerce_Brands;
4
+ use WP_Error, WP_REST_Server;
5
+
6
+ defined('ABSPATH') or die('No script kiddies please!');
7
+
8
+ class PWB_API_Support{
9
+
10
+ private $namespaces = array(
11
+ "wc/v1",
12
+ "wc/v2",
13
+ );
14
+ private $base = 'brands';
15
+
16
+ function __construct(){
17
+ add_action('rest_api_init', array($this, 'register_endpoints'));
18
+
19
+ /**
20
+ * register_rest_field() was introduced in WordPress 4.7.0
21
+ */
22
+ if (version_compare(PWB_WP_VERSION, '4.7.0', '>=')) {
23
+ add_action('rest_api_init', array($this, 'register_fields'));
24
+ }
25
+
26
+ }
27
+
28
+ /**
29
+ * Registers the endpoint for all possible $namespaces
30
+ */
31
+ public function register_endpoints(){
32
+ foreach( $this->namespaces as $namespace ) {
33
+ register_rest_route($namespace, '/'.$this->base, array(
34
+ array(
35
+ 'methods' => WP_REST_Server::READABLE,
36
+ 'callback' => function () {
37
+ return rest_ensure_response(
38
+ Perfect_Woocommerce_Brands::get_brands()
39
+ );
40
+ }
41
+ ),
42
+ array(
43
+ 'methods' => WP_REST_Server::CREATABLE,
44
+ 'callback' => array( $this, 'create_brand' )
45
+ ),
46
+ array(
47
+ 'methods' => WP_REST_Server::DELETABLE,
48
+ 'callback' => array( $this, 'delete_brand' )
49
+ )
50
+ ));
51
+ }
52
+ }
53
+
54
+ public function delete_brand( $request ){
55
+ foreach( $request['brands'] as $brand ){
56
+ $delete_result = wp_delete_term( $brand, 'pwb-brand' );
57
+ if( is_wp_error( $delete_result ) ) return $delete_result;
58
+ }
59
+ return true;
60
+ }
61
+
62
+ public function create_brand( $request ){
63
+ $new_brand = wp_insert_term( $request['name'], 'pwb-brand', array( 'slug' => $request['slug'] ) );
64
+ if( !is_wp_error( $new_brand ) ){
65
+ return true;
66
+ }else{
67
+ return $new_brand;
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Entry point for all rest field settings
73
+ */
74
+ public function register_fields(){
75
+ register_rest_field('product', 'brands', array(
76
+ 'get_callback' => array($this, "get_callback"),
77
+ 'update_callback' => array($this, "update_callback"),
78
+ 'schema' => $this->get_schema(),
79
+ ));
80
+ }
81
+
82
+ /**
83
+ * Returns the schema of the "brands" field on the /product route
84
+ * To attach a brand to a product just append a "brands" key containing an array of brand id's
85
+ * An empty array wil detach all brands.
86
+ * @return array
87
+ */
88
+ public function get_schema(){
89
+ return array(
90
+ 'description' => __('Product brands', 'perfect-woocommerce-brands'),
91
+ 'type' => 'array',
92
+ 'items' => array(
93
+ "type" => "integer"
94
+ ),
95
+ 'context' => array("view", "edit")
96
+ );
97
+ }
98
+
99
+ /**
100
+ * Returns all attached brands to a GET request to /products(/id)
101
+ * @param $product
102
+ * @return array|\WP_Error
103
+ */
104
+ public function get_callback($product){
105
+ $brands = wp_get_post_terms($product['id'], 'pwb-brand');
106
+
107
+ $result_brands_array = array();
108
+ foreach ($brands as $brand) {
109
+ $result_brands_array[] = array(
110
+ 'id' => $brand->term_id,
111
+ 'name' => $brand->name,
112
+ 'slug' => $brand->slug
113
+ );
114
+ }
115
+
116
+ return $result_brands_array;
117
+ }
118
+
119
+ /**
120
+ * Entry point for an update call
121
+ * @param $brands
122
+ * @param $product
123
+ */
124
+ public function update_callback($brands, $product){
125
+ $this->remove_brands($product);
126
+ $this->add_brands($brands, $product);
127
+ }
128
+
129
+
130
+ /**
131
+ * Detaches all brands from a product
132
+ * @param \WC_Product $product
133
+ */
134
+ private function remove_brands($product){
135
+ $brands = wp_get_post_terms($product->get_id(), 'pwb-brand');
136
+ if (!empty($brands)) {
137
+ wp_set_post_terms($product->get_id(), array(), 'pwb-brand');
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Attaches the given brands to a product. Earlier attached brands, not in this array, will be removed
143
+ * @param array $brands
144
+ * @param \WC_Product $product
145
+ */
146
+ private function add_brands($brands, $product){
147
+ wp_set_post_terms($product->get_id(), $brands, "pwb-brand");
148
+ }
149
+
150
+ }
classes/class-pwb-product-tab.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
-
3
- namespace Perfect_Woocommerce_Brands;
4
-
5
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
6
-
7
- class PWB_Product_Tab{
8
-
9
- function __construct(){
10
- add_filter( 'woocommerce_product_tabs', array( $this, 'product_tab' ) );
11
- }
12
-
13
- public function product_tab( $tabs ) {
14
-
15
- $show_brand_tab = get_option( 'wc_pwb_admin_tab_brand_single_product_tab' );
16
- if( $show_brand_tab == 'yes' || !$show_brand_tab ){
17
- $tabs['pwb_tab'] = array(
18
- 'title' => __( 'Brand', 'perfect-woocommerce-brands' ),
19
- 'priority' => 20,
20
- 'callback' => array( $this, 'product_tab_content' )
21
- );
22
- }
23
- return $tabs;
24
-
25
- }
26
-
27
- public function product_tab_content() {
28
-
29
- global $product;
30
- $brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
31
-
32
- ob_start();
33
- ?>
34
-
35
- <h2><?php echo __('Brand', 'perfect-woocommerce-brands'); ?></h2>
36
- <?php foreach( $brands as $brand ): ?>
37
-
38
- <?php
39
- $brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
40
- $brand_logo = wp_get_attachment_image( $brand_logo, 'thumbnail' );
41
- ?>
42
-
43
- <div id="tab-pwb_tab-content">
44
- <h3><?php echo $brand->name;?></h3>
45
- <?php if( !empty($brand->description) ) echo '<div>'.$brand->description.'</div>';?>
46
- <?php if( !empty($brand_logo) ) echo '<span>'.$brand_logo.'</span>';?>
47
- </div>
48
-
49
- <?php endforeach; ?>
50
-
51
- <?php
52
- echo ob_get_clean();
53
-
54
- }
55
-
56
- }
1
+ <?php
2
+
3
+ namespace Perfect_Woocommerce_Brands;
4
+
5
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
6
+
7
+ class PWB_Product_Tab{
8
+
9
+ function __construct(){
10
+ add_filter( 'woocommerce_product_tabs', array( $this, 'product_tab' ) );
11
+ }
12
+
13
+ public function product_tab( $tabs ) {
14
+
15
+ $show_brand_tab = get_option( 'wc_pwb_admin_tab_brand_single_product_tab' );
16
+ if( $show_brand_tab == 'yes' || !$show_brand_tab ){
17
+ $tabs['pwb_tab'] = array(
18
+ 'title' => __( 'Brand', 'perfect-woocommerce-brands' ),
19
+ 'priority' => 20,
20
+ 'callback' => array( $this, 'product_tab_content' )
21
+ );
22
+ }
23
+ return $tabs;
24
+
25
+ }
26
+
27
+ public function product_tab_content() {
28
+
29
+ global $product;
30
+ $brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
31
+
32
+ ob_start();
33
+ ?>
34
+
35
+ <h2><?php echo __('Brand', 'perfect-woocommerce-brands'); ?></h2>
36
+ <?php foreach( $brands as $brand ): ?>
37
+
38
+ <?php
39
+ $brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
40
+ $brand_logo = wp_get_attachment_image( $brand_logo, 'thumbnail' );
41
+ ?>
42
+
43
+ <div id="tab-pwb_tab-content">
44
+ <h3><?php echo $brand->name;?></h3>
45
+ <?php if( !empty($brand->description) ) echo '<div>'.$brand->description.'</div>';?>
46
+ <?php if( !empty($brand_logo) ) echo '<span>'.$brand_logo.'</span>';?>
47
+ </div>
48
+
49
+ <?php endforeach; ?>
50
+
51
+ <?php
52
+ echo ob_get_clean();
53
+
54
+ }
55
+
56
+ }
classes/shortcodes/class-pwb-all-brands.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_All_Brands_Shortcode{
7
-
8
- public static function all_brands_shortcode( $atts ) {
9
-
10
- $atts = shortcode_atts( array(
11
- 'per_page' => "10",
12
- 'image_size' => "thumbnail",
13
- 'hide_empty' => false,
14
- 'order_by' => 'name',
15
- 'order' => 'ASC',
16
- 'title_position' => 'before'
17
- ), $atts, 'pwb-all-brands' );
18
-
19
- $hide_empty = true;
20
- if( $atts['hide_empty'] != 'true' ){
21
- $hide_empty = false;
22
- }
23
-
24
- ob_start();
25
-
26
- $brands = array();
27
- if( $atts['order_by'] == 'rand' ){
28
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
29
- shuffle( $brands );
30
- }else{
31
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
32
- }
33
-
34
- ?>
35
- <div class="pwb-all-brands">
36
- <?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
37
- </div>
38
- <?php
39
-
40
- return ob_get_clean();
41
- }
42
-
43
- public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
44
- $page = 1;
45
-
46
- if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
47
- $page = $_GET['pwb-page'];
48
- }
49
-
50
- $page = $page < 1 ? 1 : $page;
51
-
52
- // start position in the $display_array
53
- // +1 is to account for total values.
54
- $start = ($page - 1) * ($show_per_page);
55
- $offset = $show_per_page;
56
-
57
- $outArray = array_slice($display_array, $start, $offset);
58
-
59
- //pagination links
60
- $total_elements = count($display_array);
61
- $pages = ((int)$total_elements / (int)$show_per_page);
62
- $pages = ceil($pages);
63
- if($pages>=1 && $page <= $pages){
64
-
65
- ?>
66
- <div class="pwb-brands-cols-outer">
67
- <?php
68
- foreach($outArray as $brand){
69
- $brand_id = $brand->term_id;
70
- $brand_name = $brand->name;
71
- $brand_link = get_term_link($brand_id);
72
-
73
- $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
74
- $attachment_html = $brand_name;
75
- if($attachment_id!=''){
76
- $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
77
- }
78
-
79
- ?>
80
- <div class="pwb-brands-col3">
81
-
82
- <?php if( $title_position != 'none' && $title_position != 'after' ): ?>
83
- <p>
84
- <?php echo $brand_name;?>
85
- <small>(<?php echo $brand->count;?>)</small>
86
- </p>
87
- <?php endif; ?>
88
-
89
- <div>
90
- <a href="<?php echo $brand_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>"><?php echo $attachment_html;?></a>
91
- </div>
92
-
93
- <?php if( $title_position != 'none' && $title_position == 'after' ): ?>
94
- <p>
95
- <?php echo $brand_name;?>
96
- <small>(<?php echo $brand->count;?>)</small>
97
- </p>
98
- <?php endif; ?>
99
-
100
- </div>
101
- <?php
102
- }
103
- ?>
104
- </div>
105
- <?php
106
- $next = $page + 1;
107
- $prev = $page - 1;
108
-
109
- echo '<div class="pwb-pagination-wrapper">';
110
- if($prev>1){
111
- echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">&laquo;</a>';
112
- }
113
- if($prev>0){
114
- echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">&lsaquo;</a>';
115
- }
116
-
117
- if($next<=$pages){
118
- echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">&rsaquo;</a>';
119
- }
120
- if($next<$pages){
121
- echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">&raquo;</a>';
122
- }
123
- echo '</div>';
124
-
125
- }else{
126
- echo __('No results','perfect-woocommerce-brands');
127
- }
128
-
129
- }
130
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_All_Brands_Shortcode{
7
+
8
+ public static function all_brands_shortcode( $atts ) {
9
+
10
+ $atts = shortcode_atts( array(
11
+ 'per_page' => "10",
12
+ 'image_size' => "thumbnail",
13
+ 'hide_empty' => false,
14
+ 'order_by' => 'name',
15
+ 'order' => 'ASC',
16
+ 'title_position' => 'before'
17
+ ), $atts, 'pwb-all-brands' );
18
+
19
+ $hide_empty = true;
20
+ if( $atts['hide_empty'] != 'true' ){
21
+ $hide_empty = false;
22
+ }
23
+
24
+ ob_start();
25
+
26
+ $brands = array();
27
+ if( $atts['order_by'] == 'rand' ){
28
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
29
+ shuffle( $brands );
30
+ }else{
31
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
32
+ }
33
+
34
+ ?>
35
+ <div class="pwb-all-brands">
36
+ <?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
37
+ </div>
38
+ <?php
39
+
40
+ return ob_get_clean();
41
+ }
42
+
43
+ public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
44
+ $page = 1;
45
+
46
+ if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
47
+ $page = $_GET['pwb-page'];
48
+ }
49
+
50
+ $page = $page < 1 ? 1 : $page;
51
+
52
+ // start position in the $display_array
53
+ // +1 is to account for total values.
54
+ $start = ($page - 1) * ($show_per_page);
55
+ $offset = $show_per_page;
56
+
57
+ $outArray = array_slice($display_array, $start, $offset);
58
+
59
+ //pagination links
60
+ $total_elements = count($display_array);
61
+ $pages = ((int)$total_elements / (int)$show_per_page);
62
+ $pages = ceil($pages);
63
+ if($pages>=1 && $page <= $pages){
64
+
65
+ ?>
66
+ <div class="pwb-brands-cols-outer">
67
+ <?php
68
+ foreach($outArray as $brand){
69
+ $brand_id = $brand->term_id;
70
+ $brand_name = $brand->name;
71
+ $brand_link = get_term_link($brand_id);
72
+
73
+ $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
74
+ $attachment_html = $brand_name;
75
+ if($attachment_id!=''){
76
+ $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
77
+ }
78
+
79
+ ?>
80
+ <div class="pwb-brands-col3">
81
+
82
+ <?php if( $title_position != 'none' && $title_position != 'after' ): ?>
83
+ <p>
84
+ <?php echo $brand_name;?>
85
+ <small>(<?php echo $brand->count;?>)</small>
86
+ </p>
87
+ <?php endif; ?>
88
+
89
+ <div>
90
+ <a href="<?php echo $brand_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>"><?php echo $attachment_html;?></a>
91
+ </div>
92
+
93
+ <?php if( $title_position != 'none' && $title_position == 'after' ): ?>
94
+ <p>
95
+ <?php echo $brand_name;?>
96
+ <small>(<?php echo $brand->count;?>)</small>
97
+ </p>
98
+ <?php endif; ?>
99
+
100
+ </div>
101
+ <?php
102
+ }
103
+ ?>
104
+ </div>
105
+ <?php
106
+ $next = $page + 1;
107
+ $prev = $page - 1;
108
+
109
+ echo '<div class="pwb-pagination-wrapper">';
110
+ if($prev>1){
111
+ echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">&laquo;</a>';
112
+ }
113
+ if($prev>0){
114
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">&lsaquo;</a>';
115
+ }
116
+
117
+ if($next<=$pages){
118
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">&rsaquo;</a>';
119
+ }
120
+ if($next<$pages){
121
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">&raquo;</a>';
122
+ }
123
+ echo '</div>';
124
+
125
+ }else{
126
+ echo __('No results','perfect-woocommerce-brands');
127
+ }
128
+
129
+ }
130
+ }
classes/shortcodes/class-pwb-brand.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Brand_Shortcode{
7
-
8
- public static function brand_shortcode( $atts ) {
9
- $atts = shortcode_atts( array(
10
- 'product_id' => null,
11
- 'image_size' => 'thumbnail'
12
- ), $atts, 'pwb-brand' );
13
-
14
- ob_start();
15
-
16
- $brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
17
-
18
- if(is_array($brands) && count($brands)>0){
19
-
20
- echo '<div class="pwb-brand-shortcode">';
21
-
22
- foreach($brands as $brand){
23
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
24
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
25
-
26
- $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
27
-
28
- if(!empty($attachment_html)){
29
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
30
- }else{
31
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
32
- }
33
- }
34
-
35
- echo '</div>';
36
-
37
- }
38
-
39
- return ob_get_clean();
40
-
41
- }
42
-
43
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Brand_Shortcode{
7
+
8
+ public static function brand_shortcode( $atts ) {
9
+ $atts = shortcode_atts( array(
10
+ 'product_id' => null,
11
+ 'image_size' => 'thumbnail'
12
+ ), $atts, 'pwb-brand' );
13
+
14
+ ob_start();
15
+
16
+ $brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
17
+
18
+ if(is_array($brands) && count($brands)>0){
19
+
20
+ echo '<div class="pwb-brand-shortcode">';
21
+
22
+ foreach($brands as $brand){
23
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
24
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
25
+
26
+ $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
27
+
28
+ if(!empty($attachment_html)){
29
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
30
+ }else{
31
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
32
+ }
33
+ }
34
+
35
+ echo '</div>';
36
+
37
+ }
38
+
39
+ return ob_get_clean();
40
+
41
+ }
42
+
43
+ }
classes/shortcodes/class-pwb-carousel.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Carousel_Shortcode{
7
-
8
- private static $atts;
9
-
10
- public static function carousel_shortcode( $atts ) {
11
-
12
- self::$atts = shortcode_atts( array(
13
- 'items' => "10",
14
- 'items_to_show' => "5",
15
- 'items_to_scroll' => "1",
16
- 'image_size' => "thumbnail",
17
- 'autoplay' => "false",
18
- 'arrows' => "false"
19
- ), $atts, 'pwb-carousel' );
20
-
21
- \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
22
- 'carousel',
23
- 'shortcodes',
24
- array( 'slick_settings' => self::slick_settings(), 'brands' => self::brands_data() )
25
- );
26
-
27
- }
28
-
29
- private static function slick_settings(){
30
-
31
- $slick_settings = array(
32
- 'slidesToShow' => (int)self::$atts['items_to_show'],
33
- 'slidesToScroll' => (int)self::$atts['items_to_scroll'],
34
- 'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
35
- 'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
36
- );
37
- return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
38
-
39
- }
40
-
41
- private static function brands_data(){
42
-
43
- $brands = array();
44
- $foreach_i = 0;
45
- if( self::$atts['items'] == 'featured' ){
46
- $brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( false, 'name', 'ASC', true );
47
- }else{
48
- $brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands();
49
- }
50
- foreach( $brands_array as $brand ){
51
- if( self::$atts['items'] != 'featured' && $foreach_i >= (int)self::$atts['items'] ) break;
52
-
53
- $brand_id = $brand->term_id;
54
- $brand_link = get_term_link($brand_id);
55
- $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
56
- $attachment_html = $brand->name;
57
- if($attachment_id!='') $attachment_html = wp_get_attachment_image( $attachment_id, self::$atts['image_size'] );
58
-
59
- $brands[] = array( 'link' => $brand_link, 'attachment_html' => $attachment_html );
60
-
61
- $foreach_i++;
62
- }
63
-
64
- return $brands;
65
-
66
- }
67
-
68
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Carousel_Shortcode{
7
+
8
+ private static $atts;
9
+
10
+ public static function carousel_shortcode( $atts ) {
11
+
12
+ self::$atts = shortcode_atts( array(
13
+ 'items' => "10",
14
+ 'items_to_show' => "5",
15
+ 'items_to_scroll' => "1",
16
+ 'image_size' => "thumbnail",
17
+ 'autoplay' => "false",
18
+ 'arrows' => "false"
19
+ ), $atts, 'pwb-carousel' );
20
+
21
+ return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
22
+ 'carousel',
23
+ 'shortcodes',
24
+ array( 'slick_settings' => self::slick_settings(), 'brands' => self::brands_data() )
25
+ );
26
+
27
+ }
28
+
29
+ private static function slick_settings(){
30
+
31
+ $slick_settings = array(
32
+ 'slidesToShow' => (int)self::$atts['items_to_show'],
33
+ 'slidesToScroll' => (int)self::$atts['items_to_scroll'],
34
+ 'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
35
+ 'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
36
+ );
37
+ return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
38
+
39
+ }
40
+
41
+ private static function brands_data(){
42
+
43
+ $brands = array();
44
+ $foreach_i = 0;
45
+ if( self::$atts['items'] == 'featured' ){
46
+ $brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( false, 'name', 'ASC', true );
47
+ }else{
48
+ $brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands();
49
+ }
50
+ foreach( $brands_array as $brand ){
51
+ if( self::$atts['items'] != 'featured' && $foreach_i >= (int)self::$atts['items'] ) break;
52
+
53
+ $brand_id = $brand->term_id;
54
+ $brand_link = get_term_link($brand_id);
55
+ $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
56
+ $attachment_html = $brand->name;
57
+ if($attachment_id!='') $attachment_html = wp_get_attachment_image( $attachment_id, self::$atts['image_size'] );
58
+
59
+ $brands[] = array( 'link' => $brand_link, 'attachment_html' => $attachment_html );
60
+
61
+ $foreach_i++;
62
+ }
63
+
64
+ return $brands;
65
+
66
+ }
67
+
68
+ }
classes/shortcodes/class-pwb-product-carousel.php CHANGED
@@ -1,80 +1,80 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Product_Carousel_Shortcode{
7
-
8
- private static $atts;
9
-
10
- public static function product_carousel_shortcode( $atts ) {
11
-
12
- self::$atts = shortcode_atts( array(
13
- 'brand' => "all",
14
- 'products' => "10",
15
- 'products_to_show' => "5",
16
- 'products_to_scroll' => "1",
17
- 'autoplay' => "false",
18
- 'arrows' => "false"
19
- ), $atts, 'pwb-product-carousel' );
20
-
21
- \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
22
- 'product-carousel',
23
- 'shortcodes',
24
- array( 'slick_settings' => self::slick_settings(), 'products' => self::products_data() )
25
- );
26
-
27
- }
28
-
29
- private static function slick_settings(){
30
-
31
- $slick_settings = array(
32
- 'slidesToShow' => (int)self::$atts['products_to_show'],
33
- 'slidesToScroll' => (int)self::$atts['products_to_scroll'],
34
- 'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
35
- 'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
36
- );
37
- return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
38
-
39
- }
40
-
41
- private static function products_data(){
42
-
43
- $products = array();
44
-
45
- $args = array(
46
- 'post_type' => 'product',
47
- 'posts_per_page' => (int)self::$atts['products'],
48
- 'paged' => false
49
- );
50
-
51
- if( self::$atts['brand'] != 'all' ){
52
- $args['tax_query'] = array(
53
- array(
54
- 'taxonomy' => 'pwb-brand',
55
- 'field' => 'slug',
56
- 'terms' => self::$atts['brand']
57
- )
58
- );
59
- }
60
-
61
- $loop = new \WP_Query( $args );
62
- if( $loop->have_posts() ) {
63
- while ( $loop->have_posts() ) : $loop->the_post();
64
- $product = wc_get_product( get_the_ID() );
65
-
66
- $products[] = array(
67
- 'id' => get_the_ID(),
68
- 'permalink' => get_the_permalink(),
69
- 'thumbnail' => woocommerce_get_product_thumbnail(),
70
- 'title' => $product->get_title()
71
- );
72
- endwhile;
73
- }
74
- wp_reset_postdata();
75
-
76
- return $products;
77
-
78
- }
79
-
80
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Product_Carousel_Shortcode{
7
+
8
+ private static $atts;
9
+
10
+ public static function product_carousel_shortcode( $atts ) {
11
+
12
+ self::$atts = shortcode_atts( array(
13
+ 'brand' => "all",
14
+ 'products' => "10",
15
+ 'products_to_show' => "5",
16
+ 'products_to_scroll' => "1",
17
+ 'autoplay' => "false",
18
+ 'arrows' => "false"
19
+ ), $atts, 'pwb-product-carousel' );
20
+
21
+ return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
22
+ 'product-carousel',
23
+ 'shortcodes',
24
+ array( 'slick_settings' => self::slick_settings(), 'products' => self::products_data() )
25
+ );
26
+
27
+ }
28
+
29
+ private static function slick_settings(){
30
+
31
+ $slick_settings = array(
32
+ 'slidesToShow' => (int)self::$atts['products_to_show'],
33
+ 'slidesToScroll' => (int)self::$atts['products_to_scroll'],
34
+ 'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
35
+ 'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
36
+ );
37
+ return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
38
+
39
+ }
40
+
41
+ private static function products_data(){
42
+
43
+ $products = array();
44
+
45
+ $args = array(
46
+ 'post_type' => 'product',
47
+ 'posts_per_page' => (int)self::$atts['products'],
48
+ 'paged' => false
49
+ );
50
+
51
+ if( self::$atts['brand'] != 'all' ){
52
+ $args['tax_query'] = array(
53
+ array(
54
+ 'taxonomy' => 'pwb-brand',
55
+ 'field' => 'slug',
56
+ 'terms' => self::$atts['brand']
57
+ )
58
+ );
59
+ }
60
+
61
+ $loop = new \WP_Query( $args );
62
+ if( $loop->have_posts() ) {
63
+ while ( $loop->have_posts() ) : $loop->the_post();
64
+ $product = wc_get_product( get_the_ID() );
65
+
66
+ $products[] = array(
67
+ 'id' => get_the_ID(),
68
+ 'permalink' => get_the_permalink(),
69
+ 'thumbnail' => woocommerce_get_product_thumbnail(),
70
+ 'title' => $product->get_title()
71
+ );
72
+ endwhile;
73
+ }
74
+ wp_reset_postdata();
75
+
76
+ return $products;
77
+
78
+ }
79
+
80
+ }
classes/widgets/class-pwb-dropdown.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Dropdown_Widget extends \WP_Widget {
7
-
8
- function __construct(){
9
- $params = array(
10
- 'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_Dropdown_Widget', '', $params);
14
- }
15
-
16
- public function form($instance){
17
- extract($instance);
18
- ?>
19
-
20
- <p>
21
- <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title', 'perfect-woocommerce-brands' );?></label>
22
- <input
23
- class="widefat"
24
- type="text"
25
- id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
- name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
- value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
- </p>
29
-
30
- <?php
31
- }
32
-
33
- public function widget($args, $instance){
34
- extract($args);
35
- extract($instance);
36
-
37
- echo $before_widget;
38
-
39
- if(!empty($title)){
40
- echo $before_title . $title . $after_title;
41
- }
42
-
43
- $this->get_brands();
44
-
45
- echo $after_widget;
46
-
47
- }
48
-
49
- private function get_brands(){
50
- $brands = get_terms('pwb-brand',array(
51
- 'hide_empty' => false
52
- ));
53
-
54
- $queried_obj = get_queried_object();
55
- $queried_brand_id = ( isset( $queried_obj->term_id ) ) ? $queried_obj->term_id : false;
56
-
57
- if( is_array($brands) && count($brands)>0 ){
58
- echo '<select class="pwb-dropdown-widget">';
59
- echo '<option selected="true" disabled="disabled">'.__( 'Brands', 'perfect-woocommerce-brands' ).'</option>';
60
- foreach ($brands as $brand) {
61
- $brand_name = $brand->name;
62
- $brand_link = get_term_link( $brand->term_id );
63
- $selected = ( $brand->term_id == $queried_brand_id ) ? 'selected="selected"' : '';
64
- echo '<option value="'.$brand_link.'" '.$selected.'>'.$brand->name.'</option>';
65
- }
66
- echo '</select>';
67
- }else{
68
- echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
69
- }
70
-
71
- }
72
-
73
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Dropdown_Widget extends \WP_Widget {
7
+
8
+ function __construct(){
9
+ $params = array(
10
+ 'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_Dropdown_Widget', '', $params);
14
+ }
15
+
16
+ public function form($instance){
17
+ extract($instance);
18
+ ?>
19
+
20
+ <p>
21
+ <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title', 'perfect-woocommerce-brands' );?></label>
22
+ <input
23
+ class="widefat"
24
+ type="text"
25
+ id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
+ name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
+ value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
+ </p>
29
+
30
+ <?php
31
+ }
32
+
33
+ public function widget($args, $instance){
34
+ extract($args);
35
+ extract($instance);
36
+
37
+ echo $before_widget;
38
+
39
+ if(!empty($title)){
40
+ echo $before_title . $title . $after_title;
41
+ }
42
+
43
+ $this->get_brands();
44
+
45
+ echo $after_widget;
46
+
47
+ }
48
+
49
+ private function get_brands(){
50
+ $brands = get_terms('pwb-brand',array(
51
+ 'hide_empty' => false
52
+ ));
53
+
54
+ $queried_obj = get_queried_object();
55
+ $queried_brand_id = ( isset( $queried_obj->term_id ) ) ? $queried_obj->term_id : false;
56
+
57
+ if( is_array($brands) && count($brands)>0 ){
58
+ echo '<select class="pwb-dropdown-widget">';
59
+ echo '<option selected="true" disabled="disabled">'.__( 'Brands', 'perfect-woocommerce-brands' ).'</option>';
60
+ foreach ($brands as $brand) {
61
+ $brand_name = $brand->name;
62
+ $brand_link = get_term_link( $brand->term_id );
63
+ $selected = ( $brand->term_id == $queried_brand_id ) ? 'selected="selected"' : '';
64
+ echo '<option value="'.$brand_link.'" '.$selected.'>'.$brand->name.'</option>';
65
+ }
66
+ echo '</select>';
67
+ }else{
68
+ echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
69
+ }
70
+
71
+ }
72
+
73
+ }
classes/widgets/class-pwb-filter-by-brand.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Filter_By_Brand_Widget extends \WP_Widget {
7
-
8
- function __construct() {
9
- $params = array(
10
- 'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Filter products by brand', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
14
- }
15
-
16
- public function form( $instance ) {
17
- $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
18
- ?>
19
- <p>
20
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
21
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
22
- </p>
23
- <?php
24
- }
25
-
26
- public function widget( $args, $instance ) {
27
-
28
- if( !is_tax('pwb-brand') && !is_product() ){
29
- $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
30
- $title = apply_filters( 'widget_title', $title );
31
-
32
- echo $args['before_widget'];
33
- if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title'];
34
- $this->render_widget();
35
- echo $args['after_widget'];
36
- }
37
-
38
- }
39
-
40
- public function render_widget(){
41
-
42
- $brands = get_terms('pwb-brand',array(
43
- 'hide_empty' => false
44
- ));
45
- $brands_ids = array();
46
- foreach ($brands as $brand) {
47
- $brands_ids[] = $brand->term_id;
48
- }
49
-
50
- $cat = get_queried_object();
51
-
52
- if( is_product_category() ){
53
-
54
- $cat_id = $cat->term_taxonomy_id;
55
- $cat_id_array = get_term_children( $cat_id, 'product_cat' );
56
- $cat_id_array[] = $cat_id;
57
-
58
- $result_brands = array();
59
- $args = array(
60
- 'posts_per_page' => -1,
61
- 'post_type' => 'product',
62
- 'tax_query' => array(
63
- 'relation' => 'AND',
64
- array(
65
- 'taxonomy' => 'product_cat',
66
- 'field' => 'term_id',
67
- 'terms' => $cat_id_array
68
- ),
69
- array(
70
- 'taxonomy' => 'pwb-brand',
71
- 'field' => 'term_id',
72
- 'terms' => $brands_ids
73
- )
74
- )
75
- );
76
-
77
- $the_query = new \WP_Query($args);
78
- if ( $the_query->have_posts() ) {
79
- while ( $the_query->have_posts() ) {
80
- $the_query->the_post();
81
-
82
- $product_brands = wp_get_post_terms(get_the_ID(), 'pwb-brand');
83
-
84
- foreach ($product_brands as $brand) {
85
- $result_brands[] = $brand->term_id;
86
- }
87
-
88
- }
89
- } else {
90
- // no posts found
91
- }
92
- wp_reset_postdata();
93
-
94
- $cate = get_queried_object();
95
- $cateID = $cate->term_id;
96
- $cate_url = get_term_link($cateID);
97
-
98
- }else{
99
- //no product category
100
- $cate_url = get_permalink( wc_get_page_id( 'shop' ));
101
- shuffle($brands_ids);
102
- $result_brands = array_slice($brands_ids, 0, 20);
103
- }
104
-
105
- global $wp;
106
- $current_url = home_url(add_query_arg(array(),$wp->request));
107
-
108
- if( !empty( $result_brands ) ){
109
-
110
- $result_brands = array_unique($result_brands);
111
- $result_brands_ordered = array();
112
- foreach( $result_brands as $brand ){
113
- $brand = get_term($brand);
114
- $result_brands_ordered[$brand->name] = $brand;
115
- }
116
- ksort($result_brands_ordered);
117
-
118
- $result_brands_ordered = apply_filters( 'pwb_widget_brand_filter', $result_brands_ordered );
119
-
120
- \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
121
- 'filter-by-brand',
122
- 'widgets',
123
- array( 'cate_url' => $cate_url, 'brands' => $result_brands_ordered )
124
- );
125
-
126
- }
127
-
128
- }
129
-
130
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Filter_By_Brand_Widget extends \WP_Widget {
7
+
8
+ function __construct() {
9
+ $params = array(
10
+ 'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Filter products by brand', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
14
+ }
15
+
16
+ public function form( $instance ) {
17
+ $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
18
+ ?>
19
+ <p>
20
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
21
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
22
+ </p>
23
+ <?php
24
+ }
25
+
26
+ public function widget( $args, $instance ) {
27
+
28
+ if( !is_tax('pwb-brand') && !is_product() ){
29
+ $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
30
+ $title = apply_filters( 'widget_title', $title );
31
+
32
+ echo $args['before_widget'];
33
+ if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title'];
34
+ $this->render_widget();
35
+ echo $args['after_widget'];
36
+ }
37
+
38
+ }
39
+
40
+ public function render_widget(){
41
+
42
+ $brands = get_terms('pwb-brand',array(
43
+ 'hide_empty' => false
44
+ ));
45
+ $brands_ids = array();
46
+ foreach ($brands as $brand) {
47
+ $brands_ids[] = $brand->term_id;
48
+ }
49
+
50
+ $cat = get_queried_object();
51
+
52
+ if( is_product_category() ){
53
+
54
+ $cat_id = $cat->term_taxonomy_id;
55
+ $cat_id_array = get_term_children( $cat_id, 'product_cat' );
56
+ $cat_id_array[] = $cat_id;
57
+
58
+ $result_brands = array();
59
+ $args = array(
60
+ 'posts_per_page' => -1,
61
+ 'post_type' => 'product',
62
+ 'tax_query' => array(
63
+ 'relation' => 'AND',
64
+ array(
65
+ 'taxonomy' => 'product_cat',
66
+ 'field' => 'term_id',
67
+ 'terms' => $cat_id_array
68
+ ),
69
+ array(
70
+ 'taxonomy' => 'pwb-brand',
71
+ 'field' => 'term_id',
72
+ 'terms' => $brands_ids
73
+ )
74
+ )
75
+ );
76
+
77
+ $the_query = new \WP_Query($args);
78
+ if ( $the_query->have_posts() ) {
79
+ while ( $the_query->have_posts() ) {
80
+ $the_query->the_post();
81
+
82
+ $product_brands = wp_get_post_terms(get_the_ID(), 'pwb-brand');
83
+
84
+ foreach ($product_brands as $brand) {
85
+ $result_brands[] = $brand->term_id;
86
+ }
87
+
88
+ }
89
+ } else {
90
+ // no posts found
91
+ }
92
+ wp_reset_postdata();
93
+
94
+ $cate = get_queried_object();
95
+ $cateID = $cate->term_id;
96
+ $cate_url = get_term_link($cateID);
97
+
98
+ }else{
99
+ //no product category
100
+ $cate_url = get_permalink( wc_get_page_id( 'shop' ));
101
+ shuffle($brands_ids);
102
+ $result_brands = array_slice($brands_ids, 0, 20);
103
+ }
104
+
105
+ global $wp;
106
+ $current_url = home_url(add_query_arg(array(),$wp->request));
107
+
108
+ if( !empty( $result_brands ) ){
109
+
110
+ $result_brands = array_unique($result_brands);
111
+ $result_brands_ordered = array();
112
+ foreach( $result_brands as $brand ){
113
+ $brand = get_term($brand);
114
+ $result_brands_ordered[$brand->name] = $brand;
115
+ }
116
+ ksort($result_brands_ordered);
117
+
118
+ $result_brands_ordered = apply_filters( 'pwb_widget_brand_filter', $result_brands_ordered );
119
+
120
+ echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
121
+ 'filter-by-brand',
122
+ 'widgets',
123
+ array( 'cate_url' => $cate_url, 'brands' => $result_brands_ordered )
124
+ );
125
+
126
+ }
127
+
128
+ }
129
+
130
+ }
classes/widgets/class-pwb-list.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_List_Widget extends \WP_Widget {
7
-
8
- function __construct(){
9
- $params = array(
10
- 'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Brands list', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_List_Widget', '', $params);
14
- }
15
-
16
- public function form($instance){
17
- extract($instance);
18
-
19
- if( !isset( $display_as ) ) $display_as = 'brand_logo';
20
- if( !isset( $columns ) ) $columns = '2';
21
- ?>
22
-
23
- <p>
24
- <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
25
- <input
26
- class="widefat"
27
- type="text"
28
- id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
29
- name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
30
- value="<?php if(isset($title)) echo esc_attr($title); ?>">
31
- </p>
32
- <p>
33
- <label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
34
- <select
35
- class="widefat pwb-select-display-as"
36
- id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
37
- name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
38
- <option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
39
- <option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
40
- </select>
41
- </p>
42
- <div class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
43
- <p>
44
- <label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
45
- <select
46
- class="widefat"
47
- id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
48
- name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
49
- <option value="1" <?php selected( $columns, '1' ); ?>>1</option>
50
- <option value="2" <?php selected( $columns, '2' ); ?>>2</option>
51
- <option value="3" <?php selected( $columns, '3' ); ?>>3</option>
52
- <option value="4" <?php selected( $columns, '4' ); ?>>4</option>
53
- </select>
54
- </p>
55
- </div>
56
-
57
- <?php
58
-
59
- }
60
-
61
- public function widget($args, $instance){
62
- extract( $args );
63
- extract( $instance );
64
-
65
- echo $before_widget;
66
-
67
- if( !empty( $title ) ){
68
- echo $before_title . $title . $after_title;
69
- }
70
-
71
- if( !isset( $display_as ) ) $display_as = 'brand_logo';
72
- if( !isset( $columns ) ) $columns = '2';
73
- PWB_List_Widget::get_brands( $display_as, $columns );
74
-
75
- echo $after_widget;
76
-
77
- }
78
-
79
- private static function get_brands( $display_as, $columns ){
80
-
81
- $brands = get_terms('pwb-brand',array(
82
- 'hide_empty' => false
83
- ));
84
-
85
- if(is_array($brands) && count($brands)>0){
86
- echo '<ul class="pwb-row">';
87
- foreach ($brands as $brand) {
88
- $brand_name = $brand->name;
89
- $brand_link = get_term_link( $brand->term_id );
90
-
91
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
92
- $brand_logo = wp_get_attachment_image( $attachment_id, 'full' );
93
-
94
- $li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
95
- echo '<li class="'. $li_class .'">';
96
- if( $display_as == 'brand_logo' && !empty( $brand_logo ) ){
97
- echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand_logo.'</a>';
98
- }else{
99
- echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand->name.'</a>';
100
- }
101
- echo '</li>';
102
- }
103
- echo '</ul>';
104
- }else{
105
- echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
106
- }
107
-
108
- }
109
-
110
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_List_Widget extends \WP_Widget {
7
+
8
+ function __construct(){
9
+ $params = array(
10
+ 'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Brands list', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_List_Widget', '', $params);
14
+ }
15
+
16
+ public function form($instance){
17
+ extract($instance);
18
+
19
+ if( !isset( $display_as ) ) $display_as = 'brand_logo';
20
+ if( !isset( $columns ) ) $columns = '2';
21
+ ?>
22
+
23
+ <p>
24
+ <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
25
+ <input
26
+ class="widefat"
27
+ type="text"
28
+ id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
29
+ name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
30
+ value="<?php if(isset($title)) echo esc_attr($title); ?>">
31
+ </p>
32
+ <p>
33
+ <label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
34
+ <select
35
+ class="widefat pwb-select-display-as"
36
+ id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
37
+ name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
38
+ <option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
39
+ <option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
40
+ </select>
41
+ </p>
42
+ <div class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
43
+ <p>
44
+ <label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
45
+ <select
46
+ class="widefat"
47
+ id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
48
+ name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
49
+ <option value="1" <?php selected( $columns, '1' ); ?>>1</option>
50
+ <option value="2" <?php selected( $columns, '2' ); ?>>2</option>
51
+ <option value="3" <?php selected( $columns, '3' ); ?>>3</option>
52
+ <option value="4" <?php selected( $columns, '4' ); ?>>4</option>
53
+ </select>
54
+ </p>
55
+ </div>
56
+
57
+ <?php
58
+
59
+ }
60
+
61
+ public function widget($args, $instance){
62
+ extract( $args );
63
+ extract( $instance );
64
+
65
+ echo $before_widget;
66
+
67
+ if( !empty( $title ) ){
68
+ echo $before_title . $title . $after_title;
69
+ }
70
+
71
+ if( !isset( $display_as ) ) $display_as = 'brand_logo';
72
+ if( !isset( $columns ) ) $columns = '2';
73
+ PWB_List_Widget::get_brands( $display_as, $columns );
74
+
75
+ echo $after_widget;
76
+
77
+ }
78
+
79
+ private static function get_brands( $display_as, $columns ){
80
+
81
+ $brands = get_terms('pwb-brand',array(
82
+ 'hide_empty' => false
83
+ ));
84
+
85
+ if(is_array($brands) && count($brands)>0){
86
+ echo '<ul class="pwb-row">';
87
+ foreach ($brands as $brand) {
88
+ $brand_name = $brand->name;
89
+ $brand_link = get_term_link( $brand->term_id );
90
+
91
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
92
+ $brand_logo = wp_get_attachment_image( $attachment_id, 'full' );
93
+
94
+ $li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
95
+ echo '<li class="'. $li_class .'">';
96
+ if( $display_as == 'brand_logo' && !empty( $brand_logo ) ){
97
+ echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand_logo.'</a>';
98
+ }else{
99
+ echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand->name.'</a>';
100
+ }
101
+ echo '</li>';
102
+ }
103
+ echo '</ul>';
104
+ }else{
105
+ echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
106
+ }
107
+
108
+ }
109
+
110
+ }
lang/perfect-woocommerce-brands-es_ES.po CHANGED
@@ -1,718 +1,718 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Perfect WooCommerce Brands\n"
4
- "POT-Creation-Date: 2018-02-04 14:46+0100\n"
5
- "PO-Revision-Date: 2018-02-04 14:49+0100\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "Language: es_ES\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Generator: Poedit 2.0.6\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-WPHeader: main.php\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
-
23
- #: classes/admin/class-edit-brands-page.php:39
24
- msgid "featured"
25
- msgstr "favorita"
26
-
27
- #: classes/admin/class-edit-brands-page.php:74
28
- msgid "Logo"
29
- msgstr "Logo"
30
-
31
- #: classes/admin/class-edit-brands-page.php:96
32
- msgid "Set as featured"
33
- msgstr "Marcar como favorita"
34
-
35
- #: classes/admin/class-edit-brands-page.php:118
36
- msgid "Error!"
37
- msgstr "Error!"
38
-
39
- #: classes/admin/class-edit-brands-page.php:128
40
- #: classes/admin/class-pwb-admin-tab.php:21
41
- #: classes/class-perfect-woocommerce-brands.php:588
42
- #: classes/class-perfect-woocommerce-brands.php:590
43
- #: classes/widgets/class-pwb-dropdown.php:59
44
- #: classes/widgets/class-pwb-filter-by-brand.php:17
45
- #: classes/widgets/class-pwb-filter-by-brand.php:29
46
- msgid "Brands"
47
- msgstr "Marcas"
48
-
49
- #: classes/admin/class-edit-brands-page.php:131
50
- msgid "Show featured brands first"
51
- msgstr "Mostrar marcas favoritas primero"
52
-
53
- #: classes/admin/class-pwb-admin-tab.php:73
54
- msgid "Brands settings"
55
- msgstr "Ajustes de las marcas"
56
-
57
- #: classes/admin/class-pwb-admin-tab.php:79
58
- msgid "Slug"
59
- msgstr "Slug"
60
-
61
- #: classes/admin/class-pwb-admin-tab.php:82
62
- msgid "Brands taxonomy slug"
63
- msgstr "Slug de la taxonomía marcas"
64
-
65
- #: classes/admin/class-pwb-admin-tab.php:87
66
- msgid "Show brand description"
67
- msgstr "Mostrar descripción de la marca"
68
-
69
- #: classes/admin/class-pwb-admin-tab.php:90
70
- msgid "Show brand description (if is set) on brand archive page"
71
- msgstr "Mostrar descripción de la marca en la página de archivo"
72
-
73
- #: classes/admin/class-pwb-admin-tab.php:94
74
- msgid "Single product tab"
75
- msgstr "Tab en la página del producto"
76
-
77
- #: classes/admin/class-pwb-admin-tab.php:97
78
- msgid "Show brand tab in single product page"
79
- msgstr "Mostrar pestaña con información de la marca en la página del producto"
80
-
81
- #: classes/admin/class-pwb-admin-tab.php:101
82
- msgid "Show brands in loop"
83
- msgstr "Mostrar marcas en el loop"
84
-
85
- #: classes/admin/class-pwb-admin-tab.php:104
86
- msgid "Show brand logo (or name) in product loop"
87
- msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
88
-
89
- #: classes/admin/class-pwb-admin-tab.php:107
90
- #: classes/admin/class-pwb-admin-tab.php:120
91
- msgid "No"
92
- msgstr "No"
93
-
94
- #: classes/admin/class-pwb-admin-tab.php:108
95
- #: classes/admin/class-pwb-admin-tab.php:121
96
- msgid "Show brand link"
97
- msgstr "Mostrar el link de la marca"
98
-
99
- #: classes/admin/class-pwb-admin-tab.php:109
100
- #: classes/admin/class-pwb-admin-tab.php:122
101
- msgid "Show brand image (if is set)"
102
- msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
103
-
104
- #: classes/admin/class-pwb-admin-tab.php:113
105
- msgid "Show brands in single product"
106
- msgstr "Mostrar marcas en la página del producto"
107
-
108
- #: classes/admin/class-pwb-admin-tab.php:116
109
- msgid "Show brand logo (or name) in single product"
110
- msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
111
-
112
- #: classes/admin/class-pwb-admin-tab.php:126
113
- #: classes/class-perfect-woocommerce-brands.php:367
114
- #: classes/class-perfect-woocommerce-brands.php:395
115
- #: classes/class-perfect-woocommerce-brands.php:466
116
- msgid "Brand logo size"
117
- msgstr "Tamaño del logo de la marca"
118
-
119
- #: classes/admin/class-pwb-admin-tab.php:129
120
- msgid "Brand logo size for single product view"
121
- msgstr "Tamaño del logo para la vista individual de producto"
122
-
123
- #: classes/admin/class-pwb-admin-tab.php:134
124
- msgid "Brand position"
125
- msgstr "Posición de la marca"
126
-
127
- #: classes/admin/class-pwb-admin-tab.php:137
128
- msgid "For single product"
129
- msgstr "En la página individual de cada producto"
130
-
131
- #: classes/admin/class-pwb-admin-tab.php:140
132
- msgid "Before title"
133
- msgstr "Antes del título"
134
-
135
- #: classes/admin/class-pwb-admin-tab.php:141
136
- msgid "After title"
137
- msgstr "Después del título"
138
-
139
- #: classes/admin/class-pwb-admin-tab.php:142
140
- msgid "After price"
141
- msgstr "Después del precio"
142
-
143
- #: classes/admin/class-pwb-admin-tab.php:143
144
- msgid "After excerpt"
145
- msgstr "Después de la descripción corta"
146
-
147
- #: classes/admin/class-pwb-admin-tab.php:144
148
- msgid "After add to cart"
149
- msgstr "Después del botón de comprar"
150
-
151
- #: classes/admin/class-pwb-admin-tab.php:145
152
- msgid "After meta"
153
- msgstr "Después del meta"
154
-
155
- #: classes/admin/class-pwb-admin-tab.php:146
156
- msgid "After sharing"
157
- msgstr "Después de compartir"
158
-
159
- #: classes/admin/class-pwb-admin-tab.php:163
160
- msgid "Tools"
161
- msgstr "Herramientas"
162
-
163
- #: classes/admin/class-pwb-admin-tab.php:169
164
- msgid "Import brands"
165
- msgstr "Importar marcas"
166
-
167
- #: classes/admin/class-pwb-admin-tab.php:173
168
- #, php-format
169
- msgid ""
170
- "Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
171
- "\">Click here for more details</a>"
172
- msgstr ""
173
- "Importar marcas de producto de otro plugin de marcas. <a href=\"%s\" target="
174
- "\"_blank\">Pulsa aquí para ver la documentación</a>"
175
-
176
- #: classes/admin/class-pwb-admin-tab.php:178
177
- #: classes/admin/class-pwb-admin-tab.php:191
178
- msgid "-"
179
- msgstr "-"
180
-
181
- #: classes/admin/class-pwb-admin-tab.php:179
182
- msgid "YITH WooCommerce Brands Add-On"
183
- msgstr "YITH WooCommerce Brands Add-On"
184
-
185
- #: classes/admin/class-pwb-admin-tab.php:180
186
- msgid "Ultimate WooCommerce Brands"
187
- msgstr "Ultimate WooCommerce Brands"
188
-
189
- #: classes/admin/class-pwb-admin-tab.php:181
190
- msgid "Offical WooCommerce Brands"
191
- msgstr "Offical WooCommerce Brands"
192
-
193
- #: classes/admin/class-pwb-admin-tab.php:185
194
- msgid "Dummy data"
195
- msgstr "Datos ficticios"
196
-
197
- #: classes/admin/class-pwb-admin-tab.php:188
198
- msgid "Import generic brands and assign it to products randomly"
199
- msgstr ""
200
- "Importar marcas genéricas y asignarlas a los productos existentes de forma "
201
- "aleatoria"
202
-
203
- #: classes/admin/class-pwb-admin-tab.php:192
204
- msgid "Start import"
205
- msgstr "Comenzar importación"
206
-
207
- #: classes/admin/class-pwb-admin-tab.php:196
208
- msgid "System status"
209
- msgstr "Estado del sistema"
210
-
211
- #: classes/admin/class-pwb-admin-tab.php:198
212
- msgid "Show system status"
213
- msgstr "Ver estado del sistema"
214
-
215
- #: classes/admin/class-pwb-coupon.php:24
216
- msgid "Brands restriction"
217
- msgstr "Restricciones de marca"
218
-
219
- #: classes/admin/class-pwb-coupon.php:25
220
- msgid "Any brand"
221
- msgstr "Cualquier marca"
222
-
223
- #: classes/admin/class-pwb-coupon.php:34
224
- msgid ""
225
- "Coupon will be valid if there are at least one product of this brands in the "
226
- "cart"
227
- msgstr ""
228
- "El cupón será válido si existe al menos un producto de la marca señalada en "
229
- "el carrito"
230
-
231
- #: classes/class-perfect-woocommerce-brands.php:54
232
- msgid ""
233
- "We know that you´re in love with Perfect WooCommerce Brands, you can help us "
234
- "making it a bit better. Thanks a lot!"
235
- msgstr ""
236
- "Sabemos que Perfect WooCommerce Brands te encanta, puedes ayudarnos a "
237
- "hacerlo un poco mejor. ¡Muchas gracias!"
238
-
239
- #: classes/class-perfect-woocommerce-brands.php:56
240
- msgid ""
241
- "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
242
- "reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
243
- msgstr ""
244
- "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
245
- "reviews/?rate=5#new-post\" target=\"_blank\">Dejar una review</a>"
246
-
247
- #: classes/class-perfect-woocommerce-brands.php:57
248
- msgid ""
249
- "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
250
- "woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
251
- msgstr ""
252
- "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
253
- "woocommerce-brands\" target=\"_blank\">Traducir el plugin</a>"
254
-
255
- #: classes/class-perfect-woocommerce-brands.php:58
256
- msgid ""
257
- "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
258
- "\"_blank\">View on GitHub</a>"
259
- msgstr ""
260
- "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
261
- "\"_blank\">Ver en GitHub</a>"
262
-
263
- #: classes/class-perfect-woocommerce-brands.php:81
264
- msgid "Settings"
265
- msgstr "Ajustes"
266
-
267
- #: classes/class-perfect-woocommerce-brands.php:264
268
- msgid "PWB Product carousel"
269
- msgstr "PWB Carrusel de productos"
270
-
271
- #: classes/class-perfect-woocommerce-brands.php:265
272
- msgid "Product carousel by brand or by category"
273
- msgstr "Carrusel de productos por marca o categoría"
274
-
275
- #: classes/class-perfect-woocommerce-brands.php:273
276
- #: classes/class-perfect-woocommerce-brands.php:589
277
- #: classes/class-pwb-exporter-support.php:22
278
- #: classes/class-pwb-importer-support.php:22
279
- #: classes/class-pwb-importer-support.php:33
280
- #: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
281
- msgid "Brand"
282
- msgstr "Marca"
283
-
284
- #: classes/class-perfect-woocommerce-brands.php:281
285
- msgid "Products"
286
- msgstr "Productos"
287
-
288
- #: classes/class-perfect-woocommerce-brands.php:284
289
- msgid "Number of products to load"
290
- msgstr "Número de productos que cargar"
291
-
292
- #: classes/class-perfect-woocommerce-brands.php:289
293
- msgid "Products to show"
294
- msgstr "Productos a mostrar"
295
-
296
- #: classes/class-perfect-woocommerce-brands.php:292
297
- msgid "Number of products to show"
298
- msgstr "Número de productos que mostrar"
299
-
300
- #: classes/class-perfect-woocommerce-brands.php:297
301
- msgid "Products to scroll"
302
- msgstr "Número de productos por scroll"
303
-
304
- #: classes/class-perfect-woocommerce-brands.php:300
305
- msgid "Number of products to scroll"
306
- msgstr "Número de productos por cada scroll"
307
-
308
- #: classes/class-perfect-woocommerce-brands.php:305
309
- #: classes/class-perfect-woocommerce-brands.php:354
310
- msgid "Autoplay"
311
- msgstr "Modo automático"
312
-
313
- #: classes/class-perfect-woocommerce-brands.php:307
314
- #: classes/class-perfect-woocommerce-brands.php:356
315
- msgid "Autoplay carousel"
316
- msgstr "Modo automático para el carrusel"
317
-
318
- #: classes/class-perfect-woocommerce-brands.php:312
319
- #: classes/class-perfect-woocommerce-brands.php:361
320
- msgid "Arrows"
321
- msgstr "Flechas de navegación"
322
-
323
- #: classes/class-perfect-woocommerce-brands.php:314
324
- #: classes/class-perfect-woocommerce-brands.php:363
325
- msgid "Display prev and next arrows"
326
- msgstr "Mostrar flechas de navegación"
327
-
328
- #: classes/class-perfect-woocommerce-brands.php:320
329
- msgid "PWB Brands carousel"
330
- msgstr "PWB Carrusel de marcas"
331
-
332
- #: classes/class-perfect-woocommerce-brands.php:321
333
- msgid "Brands carousel"
334
- msgstr "Carrusel de marcas"
335
-
336
- #: classes/class-perfect-woocommerce-brands.php:330
337
- msgid "Items"
338
- msgstr "Elementos"
339
-
340
- #: classes/class-perfect-woocommerce-brands.php:333
341
- msgid "Number of items to load (or 'featured')"
342
- msgstr "Número de elementos a cargar (o 'featured')"
343
-
344
- #: classes/class-perfect-woocommerce-brands.php:338
345
- msgid "Items to show"
346
- msgstr "Elementos a mostrar"
347
-
348
- #: classes/class-perfect-woocommerce-brands.php:341
349
- msgid "Number of items to show"
350
- msgstr "Número de elementos a mostrar"
351
-
352
- #: classes/class-perfect-woocommerce-brands.php:346
353
- msgid "Items to scroll"
354
- msgstr "Número de elementos por scroll"
355
-
356
- #: classes/class-perfect-woocommerce-brands.php:349
357
- msgid "Number of items to scroll"
358
- msgstr "Número de elementos por cada scroll"
359
-
360
- #: classes/class-perfect-woocommerce-brands.php:378
361
- msgid "PWB All brands"
362
- msgstr "PWB Todas las marcas"
363
-
364
- #: classes/class-perfect-woocommerce-brands.php:379
365
- msgid "Show all brands"
366
- msgstr "Mostrar todas las marcas"
367
-
368
- #: classes/class-perfect-woocommerce-brands.php:388
369
- msgid "Brands per page"
370
- msgstr "Marcas por página"
371
-
372
- #: classes/class-perfect-woocommerce-brands.php:391
373
- msgid "Show x brands per page"
374
- msgstr "Mostrar x marcas por página"
375
-
376
- #: classes/class-perfect-woocommerce-brands.php:402
377
- msgid "Order by"
378
- msgstr "Ordenar por"
379
-
380
- #: classes/class-perfect-woocommerce-brands.php:416
381
- msgid "Order"
382
- msgstr "Orden"
383
-
384
- #: classes/class-perfect-woocommerce-brands.php:426
385
- msgid "Title position"
386
- msgstr "Posición del título"
387
-
388
- #: classes/class-perfect-woocommerce-brands.php:430
389
- msgid "Before image"
390
- msgstr "Antes de la imagen"
391
-
392
- #: classes/class-perfect-woocommerce-brands.php:431
393
- msgid "After image"
394
- msgstr "Después de la imagen"
395
-
396
- #: classes/class-perfect-woocommerce-brands.php:432
397
- msgid "Hide"
398
- msgstr "Ocultar"
399
-
400
- #: classes/class-perfect-woocommerce-brands.php:438
401
- msgid "Hide empty"
402
- msgstr "Ocultar vacías"
403
-
404
- #: classes/class-perfect-woocommerce-brands.php:440
405
- msgid "Hide brands that have not been assigned to any product"
406
- msgstr "Ocultar marcas que no han sido asignadas a ningún producto"
407
-
408
- #: classes/class-perfect-woocommerce-brands.php:448
409
- msgid "PWB brand"
410
- msgstr "PWB Marca"
411
-
412
- #: classes/class-perfect-woocommerce-brands.php:449
413
- msgid "Show brand for a specific product"
414
- msgstr "Ver marcas de un producto específico"
415
-
416
- #: classes/class-perfect-woocommerce-brands.php:459
417
- msgid "Product id"
418
- msgstr "Id del producto"
419
-
420
- #: classes/class-perfect-woocommerce-brands.php:462
421
- msgid "Product id (post id)"
422
- msgstr "Id del producto (id del post)"
423
-
424
- #: classes/class-perfect-woocommerce-brands.php:505
425
- #: classes/class-perfect-woocommerce-brands.php:507
426
- #: classes/shortcodes/class-pwb-all-brands.php:90
427
- #: classes/shortcodes/class-pwb-brand.php:29
428
- #: classes/shortcodes/class-pwb-brand.php:31
429
- #: templates/shortcodes/carousel.php:18
430
- msgid "View brand"
431
- msgstr "Ver marca"
432
-
433
- #: classes/class-perfect-woocommerce-brands.php:577
434
- msgid "¿Start migration?"
435
- msgstr "¿Comenzar la migración?"
436
-
437
- #: classes/class-perfect-woocommerce-brands.php:578
438
- msgid ""
439
- "We are migrating the product brands. ¡Don´t close this window until the "
440
- "process is finished!"
441
- msgstr ""
442
- "Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
443
- "el proceso finalice!"
444
-
445
- #: classes/class-perfect-woocommerce-brands.php:579
446
- msgid "¿Start loading dummy data?"
447
- msgstr "¿Comenzar con la importación?"
448
-
449
- #: classes/class-perfect-woocommerce-brands.php:580
450
- msgid ""
451
- "We are importing the dummy data. ¡Don´t close this window until the process "
452
- "is finished!"
453
- msgstr ""
454
- "En este momento estamos importando las marcas ficticias. ¡No cierre esta "
455
- "ventana hasta que termine el proceso!"
456
-
457
- #: classes/class-perfect-woocommerce-brands.php:591
458
- msgid "All Brands"
459
- msgstr "Todas las marcas"
460
-
461
- #: classes/class-perfect-woocommerce-brands.php:592
462
- msgid "Edit Brand"
463
- msgstr "Editar marca"
464
-
465
- #: classes/class-perfect-woocommerce-brands.php:593
466
- msgid "View Brand"
467
- msgstr "Ver marca"
468
-
469
- #: classes/class-perfect-woocommerce-brands.php:594
470
- msgid "Update Brand"
471
- msgstr "Actualizar marca"
472
-
473
- #: classes/class-perfect-woocommerce-brands.php:595
474
- msgid "Add New Brand"
475
- msgstr "Añadir nueva marca"
476
-
477
- #: classes/class-perfect-woocommerce-brands.php:596
478
- msgid "New Brand Name"
479
- msgstr "Nuevo nombre de marca"
480
-
481
- #: classes/class-perfect-woocommerce-brands.php:597
482
- msgid "Parent Brand"
483
- msgstr "Marca Padre"
484
-
485
- #: classes/class-perfect-woocommerce-brands.php:598
486
- msgid "Parent Brand:"
487
- msgstr "Marca Padre:"
488
-
489
- #: classes/class-perfect-woocommerce-brands.php:599
490
- msgid "Search Brands"
491
- msgstr "Buscar Marcas"
492
-
493
- #: classes/class-perfect-woocommerce-brands.php:600
494
- msgid "Popular Brands"
495
- msgstr "Marcas Populares"
496
-
497
- #: classes/class-perfect-woocommerce-brands.php:601
498
- msgid "Separate brands with commas"
499
- msgstr "Separar marcas con comas"
500
-
501
- #: classes/class-perfect-woocommerce-brands.php:602
502
- msgid "Add or remove brands"
503
- msgstr "Añadir o eliminar marcas"
504
-
505
- #: classes/class-perfect-woocommerce-brands.php:603
506
- msgid "Choose from the most used brands"
507
- msgstr "Seleccionar de las marcas más utilizadas"
508
-
509
- #: classes/class-perfect-woocommerce-brands.php:604
510
- msgid "No brands found"
511
- msgstr "No se han encontrado marcas"
512
-
513
- #: classes/class-perfect-woocommerce-brands.php:648
514
- #: classes/class-perfect-woocommerce-brands.php:681
515
- #: classes/widgets/class-pwb-list.php:39
516
- msgid "Brand logo"
517
- msgstr "Logo de la marca"
518
-
519
- #: classes/class-perfect-woocommerce-brands.php:650
520
- #: classes/class-perfect-woocommerce-brands.php:656
521
- #: classes/class-perfect-woocommerce-brands.php:685
522
- #: classes/class-perfect-woocommerce-brands.php:705
523
- msgid "Select image"
524
- msgstr "Seleccionar imagen"
525
-
526
- #: classes/class-perfect-woocommerce-brands.php:654
527
- #: classes/class-perfect-woocommerce-brands.php:701
528
- msgid "Brand banner"
529
- msgstr "Banner de la marca"
530
-
531
- #: classes/class-perfect-woocommerce-brands.php:657
532
- msgid "This image will be shown on brand page"
533
- msgstr "Esta imagen se mostrará en la página de la marca"
534
-
535
- #: classes/class-perfect-woocommerce-brands.php:661
536
- #: classes/class-perfect-woocommerce-brands.php:721
537
- msgid "Brand banner link"
538
- msgstr "Enlace para el banner de la marca"
539
-
540
- #: classes/class-perfect-woocommerce-brands.php:663
541
- #: classes/class-perfect-woocommerce-brands.php:725
542
- msgid "This link should be relative to site url. Example: product/product-name"
543
- msgstr ""
544
- "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
545
- "nombre-del-producto"
546
-
547
- #: classes/class-perfect-woocommerce-brands.php:794
548
- msgid "All"
549
- msgstr "Todas"
550
-
551
- #: classes/class-pwb-api-support.php:90
552
- msgid "Product brands"
553
- msgstr "Marcas del producto"
554
-
555
- #: classes/shortcodes/class-pwb-all-brands.php:111
556
- msgid "First page"
557
- msgstr "Primera página"
558
-
559
- #: classes/shortcodes/class-pwb-all-brands.php:114
560
- msgid "Previous page"
561
- msgstr "Página anterior"
562
-
563
- #: classes/shortcodes/class-pwb-all-brands.php:118
564
- msgid "Next page"
565
- msgstr "Siguiente página"
566
-
567
- #: classes/shortcodes/class-pwb-all-brands.php:121
568
- msgid "Last page"
569
- msgstr "Última página"
570
-
571
- #: classes/shortcodes/class-pwb-all-brands.php:126
572
- msgid "No results"
573
- msgstr "No se han encontrado resultados"
574
-
575
- #: classes/widgets/class-pwb-dropdown.php:10
576
- msgid "Adds a brands dropdown to your site"
577
- msgstr "Añade un desplegable con las marcas a tu sitio"
578
-
579
- #: classes/widgets/class-pwb-dropdown.php:11
580
- msgid "Brands dropdown"
581
- msgstr "Desplegable de marcas"
582
-
583
- #: classes/widgets/class-pwb-dropdown.php:21
584
- msgid "Title"
585
- msgstr "Título"
586
-
587
- #: classes/widgets/class-pwb-dropdown.php:68
588
- #: classes/widgets/class-pwb-list.php:105
589
- msgid "There is not available brands"
590
- msgstr "No se encuentran marcas disponibles"
591
-
592
- #: classes/widgets/class-pwb-filter-by-brand.php:10
593
- msgid "Recommended for product categories or shop page"
594
- msgstr "Recomendado para las categorías de producto y la página de la tienda"
595
-
596
- #: classes/widgets/class-pwb-filter-by-brand.php:11
597
- msgid "Filter products by brand"
598
- msgstr "Filtrar productos por marca"
599
-
600
- #: classes/widgets/class-pwb-filter-by-brand.php:20
601
- #: classes/widgets/class-pwb-list.php:24
602
- msgid "Title:"
603
- msgstr "Título:"
604
-
605
- #: classes/widgets/class-pwb-list.php:10
606
- msgid "Adds a brands list to your site"
607
- msgstr "Añade una lista de marcas a tu sitio"
608
-
609
- #: classes/widgets/class-pwb-list.php:11
610
- msgid "Brands list"
611
- msgstr "Lista de marcas"
612
-
613
- #: classes/widgets/class-pwb-list.php:33
614
- msgid "Display as:"
615
- msgstr "Mostrar como:"
616
-
617
- #: classes/widgets/class-pwb-list.php:38
618
- msgid "Brand name"
619
- msgstr "Nombre de la marca"
620
-
621
- #: classes/widgets/class-pwb-list.php:44
622
- msgid "Columns:"
623
- msgstr "Columnas:"
624
-
625
- #: classes/widgets/class-pwb-list.php:97 classes/widgets/class-pwb-list.php:99
626
- msgid "Go to"
627
- msgstr "Ir a"
628
-
629
- #: main.php:103
630
- msgid ""
631
- "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
632
- "active WooCommerce plugin."
633
- msgstr ""
634
- "Perfect WooCommerce Brands necesita WooCommerce para funcionar. Por favor, "
635
- "instala y activa WooCommerce."
636
-
637
- #: templates/shortcodes/carousel.php:24
638
- #: templates/shortcodes/product-carousel.php:28
639
- msgid "Loading"
640
- msgstr "Cargando"
641
-
642
- #: templates/shortcodes/product-carousel.php:34
643
- msgid "Nothing found"
644
- msgstr "Aquí no hay nada"
645
-
646
- #: templates/widgets/filter-by-brand.php:24
647
- msgid "Apply filter"
648
- msgstr "Filtrar"
649
-
650
- #. Plugin Name of the plugin/theme
651
- msgid "Perfect WooCommerce Brands"
652
- msgstr "Perfect WooCommerce Brands"
653
-
654
- #. Plugin URI of the plugin/theme
655
- msgid "https://wordpress.org/plugins/perfect-woocommerce-brands/"
656
- msgstr "https://wordpress.org/plugins/perfect-woocommerce-brands/"
657
-
658
- #. Description of the plugin/theme
659
- msgid ""
660
- "Perfect WooCommerce Brands allows you to show product brands in your "
661
- "WooCommerce based store."
662
- msgstr ""
663
- "Perfect WooCommerce Brands te permite trabajar con marcas de producto en tu "
664
- "tienda online basada en WooCommerce."
665
-
666
- #. Author of the plugin/theme
667
- msgid "Alberto de Vera Sevilla"
668
- msgstr "Alberto de Vera Sevilla"
669
-
670
- #. Author URI of the plugin/theme
671
- msgid "https://profiles.wordpress.org/titodevera/"
672
- msgstr "https://profiles.wordpress.org/titodevera/"
673
-
674
- #~ msgid "Number of items to load"
675
- #~ msgstr "Número de elementos que cargar"
676
-
677
- #~ msgid "No products found"
678
- #~ msgstr "No se han encontrado productos"
679
-
680
- #~ msgid ""
681
- #~ "We are offering you maybe the best WooCommerce brands plugin completely "
682
- #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
683
- #~ "Thanks!"
684
- #~ msgstr ""
685
- #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
686
- #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
687
- #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
688
-
689
- #~ msgid ""
690
- #~ "Import brands from other brand plugin. <strong>Both plugins should be "
691
- #~ "installed and active</strong>"
692
- #~ msgstr ""
693
- #~ "Importar marcas de otro plugin. <strong>Ambos plugins han de encontrarse "
694
- #~ "instalados y activados</strong>"
695
-
696
- #~ msgid ""
697
- #~ "We are offering you maybe the best WooCommerce brands plugin completly "
698
- #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
699
- #~ "Thanks!"
700
- #~ msgstr ""
701
- #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
702
- #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
703
- #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
704
-
705
- #~ msgid "Import brands from old plugin installation"
706
- #~ msgstr "Importar marcas de otro plugin"
707
-
708
- #~ msgid "Brands metabox"
709
- #~ msgstr "Marcas metabox"
710
-
711
- #~ msgid "image for this brand"
712
- #~ msgstr "imagen para esta marca"
713
-
714
- #~ msgid "Select an image"
715
- #~ msgstr "Seleccione una imagen"
716
-
717
- #~ msgid "Show a specific brand"
718
- #~ msgstr "Mostrar marcas de un producto en concreto"
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Perfect WooCommerce Brands\n"
4
+ "POT-Creation-Date: 2018-02-04 14:46+0100\n"
5
+ "PO-Revision-Date: 2018-02-04 14:49+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: es_ES\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Generator: Poedit 2.0.6\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: main.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
22
+
23
+ #: classes/admin/class-edit-brands-page.php:39
24
+ msgid "featured"
25
+ msgstr "favorita"
26
+
27
+ #: classes/admin/class-edit-brands-page.php:74
28
+ msgid "Logo"
29
+ msgstr "Logo"
30
+
31
+ #: classes/admin/class-edit-brands-page.php:96
32
+ msgid "Set as featured"
33
+ msgstr "Marcar como favorita"
34
+
35
+ #: classes/admin/class-edit-brands-page.php:118
36
+ msgid "Error!"
37
+ msgstr "Error!"
38
+
39
+ #: classes/admin/class-edit-brands-page.php:128
40
+ #: classes/admin/class-pwb-admin-tab.php:21
41
+ #: classes/class-perfect-woocommerce-brands.php:588
42
+ #: classes/class-perfect-woocommerce-brands.php:590
43
+ #: classes/widgets/class-pwb-dropdown.php:59
44
+ #: classes/widgets/class-pwb-filter-by-brand.php:17
45
+ #: classes/widgets/class-pwb-filter-by-brand.php:29
46
+ msgid "Brands"
47
+ msgstr "Marcas"
48
+
49
+ #: classes/admin/class-edit-brands-page.php:131
50
+ msgid "Show featured brands first"
51
+ msgstr "Mostrar marcas favoritas primero"
52
+
53
+ #: classes/admin/class-pwb-admin-tab.php:73
54
+ msgid "Brands settings"
55
+ msgstr "Ajustes de las marcas"
56
+
57
+ #: classes/admin/class-pwb-admin-tab.php:79
58
+ msgid "Slug"
59
+ msgstr "Slug"
60
+
61
+ #: classes/admin/class-pwb-admin-tab.php:82
62
+ msgid "Brands taxonomy slug"
63
+ msgstr "Slug de la taxonomía marcas"
64
+
65
+ #: classes/admin/class-pwb-admin-tab.php:87
66
+ msgid "Show brand description"
67
+ msgstr "Mostrar descripción de la marca"
68
+
69
+ #: classes/admin/class-pwb-admin-tab.php:90
70
+ msgid "Show brand description (if is set) on brand archive page"
71
+ msgstr "Mostrar descripción de la marca en la página de archivo"
72
+
73
+ #: classes/admin/class-pwb-admin-tab.php:94
74
+ msgid "Single product tab"
75
+ msgstr "Tab en la página del producto"
76
+
77
+ #: classes/admin/class-pwb-admin-tab.php:97
78
+ msgid "Show brand tab in single product page"
79
+ msgstr "Mostrar pestaña con información de la marca en la página del producto"
80
+
81
+ #: classes/admin/class-pwb-admin-tab.php:101
82
+ msgid "Show brands in loop"
83
+ msgstr "Mostrar marcas en el loop"
84
+
85
+ #: classes/admin/class-pwb-admin-tab.php:104
86
+ msgid "Show brand logo (or name) in product loop"
87
+ msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
88
+
89
+ #: classes/admin/class-pwb-admin-tab.php:107
90
+ #: classes/admin/class-pwb-admin-tab.php:120
91
+ msgid "No"
92
+ msgstr "No"
93
+
94
+ #: classes/admin/class-pwb-admin-tab.php:108
95
+ #: classes/admin/class-pwb-admin-tab.php:121
96
+ msgid "Show brand link"
97
+ msgstr "Mostrar el link de la marca"
98
+
99
+ #: classes/admin/class-pwb-admin-tab.php:109
100
+ #: classes/admin/class-pwb-admin-tab.php:122
101
+ msgid "Show brand image (if is set)"
102
+ msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
103
+
104
+ #: classes/admin/class-pwb-admin-tab.php:113
105
+ msgid "Show brands in single product"
106
+ msgstr "Mostrar marcas en la página del producto"
107
+
108
+ #: classes/admin/class-pwb-admin-tab.php:116
109
+ msgid "Show brand logo (or name) in single product"
110
+ msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
111
+
112
+ #: classes/admin/class-pwb-admin-tab.php:126
113
+ #: classes/class-perfect-woocommerce-brands.php:367
114
+ #: classes/class-perfect-woocommerce-brands.php:395
115
+ #: classes/class-perfect-woocommerce-brands.php:466
116
+ msgid "Brand logo size"
117
+ msgstr "Tamaño del logo de la marca"
118
+
119
+ #: classes/admin/class-pwb-admin-tab.php:129
120
+ msgid "Brand logo size for single product view"
121
+ msgstr "Tamaño del logo para la vista individual de producto"
122
+
123
+ #: classes/admin/class-pwb-admin-tab.php:134
124
+ msgid "Brand position"
125
+ msgstr "Posición de la marca"
126
+
127
+ #: classes/admin/class-pwb-admin-tab.php:137
128
+ msgid "For single product"
129
+ msgstr "En la página individual de cada producto"
130
+
131
+ #: classes/admin/class-pwb-admin-tab.php:140
132
+ msgid "Before title"
133
+ msgstr "Antes del título"
134
+
135
+ #: classes/admin/class-pwb-admin-tab.php:141
136
+ msgid "After title"
137
+ msgstr "Después del título"
138
+
139
+ #: classes/admin/class-pwb-admin-tab.php:142
140
+ msgid "After price"
141
+ msgstr "Después del precio"
142
+
143
+ #: classes/admin/class-pwb-admin-tab.php:143
144
+ msgid "After excerpt"
145
+ msgstr "Después de la descripción corta"
146
+
147
+ #: classes/admin/class-pwb-admin-tab.php:144
148
+ msgid "After add to cart"
149
+ msgstr "Después del botón de comprar"
150
+
151
+ #: classes/admin/class-pwb-admin-tab.php:145
152
+ msgid "After meta"
153
+ msgstr "Después del meta"
154
+
155
+ #: classes/admin/class-pwb-admin-tab.php:146
156
+ msgid "After sharing"
157
+ msgstr "Después de compartir"
158
+
159
+ #: classes/admin/class-pwb-admin-tab.php:163
160
+ msgid "Tools"
161
+ msgstr "Herramientas"
162
+
163
+ #: classes/admin/class-pwb-admin-tab.php:169
164
+ msgid "Import brands"
165
+ msgstr "Importar marcas"
166
+
167
+ #: classes/admin/class-pwb-admin-tab.php:173
168
+ #, php-format
169
+ msgid ""
170
+ "Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
171
+ "\">Click here for more details</a>"
172
+ msgstr ""
173
+ "Importar marcas de producto de otro plugin de marcas. <a href=\"%s\" target="
174
+ "\"_blank\">Pulsa aquí para ver la documentación</a>"
175
+
176
+ #: classes/admin/class-pwb-admin-tab.php:178
177
+ #: classes/admin/class-pwb-admin-tab.php:191
178
+ msgid "-"
179
+ msgstr "-"
180
+
181
+ #: classes/admin/class-pwb-admin-tab.php:179
182
+ msgid "YITH WooCommerce Brands Add-On"
183
+ msgstr "YITH WooCommerce Brands Add-On"
184
+
185
+ #: classes/admin/class-pwb-admin-tab.php:180
186
+ msgid "Ultimate WooCommerce Brands"
187
+ msgstr "Ultimate WooCommerce Brands"
188
+
189
+ #: classes/admin/class-pwb-admin-tab.php:181
190
+ msgid "Offical WooCommerce Brands"
191
+ msgstr "Offical WooCommerce Brands"
192
+
193
+ #: classes/admin/class-pwb-admin-tab.php:185
194
+ msgid "Dummy data"
195
+ msgstr "Datos ficticios"
196
+
197
+ #: classes/admin/class-pwb-admin-tab.php:188
198
+ msgid "Import generic brands and assign it to products randomly"
199
+ msgstr ""
200
+ "Importar marcas genéricas y asignarlas a los productos existentes de forma "
201
+ "aleatoria"
202
+
203
+ #: classes/admin/class-pwb-admin-tab.php:192
204
+ msgid "Start import"
205
+ msgstr "Comenzar importación"
206
+
207
+ #: classes/admin/class-pwb-admin-tab.php:196
208
+ msgid "System status"
209
+ msgstr "Estado del sistema"
210
+
211
+ #: classes/admin/class-pwb-admin-tab.php:198
212
+ msgid "Show system status"
213
+ msgstr "Ver estado del sistema"
214
+
215
+ #: classes/admin/class-pwb-coupon.php:24
216
+ msgid "Brands restriction"
217
+ msgstr "Restricciones de marca"
218
+
219
+ #: classes/admin/class-pwb-coupon.php:25
220
+ msgid "Any brand"
221
+ msgstr "Cualquier marca"
222
+
223
+ #: classes/admin/class-pwb-coupon.php:34
224
+ msgid ""
225
+ "Coupon will be valid if there are at least one product of this brands in the "
226
+ "cart"
227
+ msgstr ""
228
+ "El cupón será válido si existe al menos un producto de la marca señalada en "
229
+ "el carrito"
230
+
231
+ #: classes/class-perfect-woocommerce-brands.php:54
232
+ msgid ""
233
+ "We know that you´re in love with Perfect WooCommerce Brands, you can help us "
234
+ "making it a bit better. Thanks a lot!"
235
+ msgstr ""
236
+ "Sabemos que Perfect WooCommerce Brands te encanta, puedes ayudarnos a "
237
+ "hacerlo un poco mejor. ¡Muchas gracias!"
238
+
239
+ #: classes/class-perfect-woocommerce-brands.php:56
240
+ msgid ""
241
+ "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
242
+ "reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
243
+ msgstr ""
244
+ "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
245
+ "reviews/?rate=5#new-post\" target=\"_blank\">Dejar una review</a>"
246
+
247
+ #: classes/class-perfect-woocommerce-brands.php:57
248
+ msgid ""
249
+ "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
250
+ "woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
251
+ msgstr ""
252
+ "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
253
+ "woocommerce-brands\" target=\"_blank\">Traducir el plugin</a>"
254
+
255
+ #: classes/class-perfect-woocommerce-brands.php:58
256
+ msgid ""
257
+ "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
258
+ "\"_blank\">View on GitHub</a>"
259
+ msgstr ""
260
+ "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
261
+ "\"_blank\">Ver en GitHub</a>"
262
+
263
+ #: classes/class-perfect-woocommerce-brands.php:81
264
+ msgid "Settings"
265
+ msgstr "Ajustes"
266
+
267
+ #: classes/class-perfect-woocommerce-brands.php:264
268
+ msgid "PWB Product carousel"
269
+ msgstr "PWB Carrusel de productos"
270
+
271
+ #: classes/class-perfect-woocommerce-brands.php:265
272
+ msgid "Product carousel by brand or by category"
273
+ msgstr "Carrusel de productos por marca o categoría"
274
+
275
+ #: classes/class-perfect-woocommerce-brands.php:273
276
+ #: classes/class-perfect-woocommerce-brands.php:589
277
+ #: classes/class-pwb-exporter-support.php:22
278
+ #: classes/class-pwb-importer-support.php:22
279
+ #: classes/class-pwb-importer-support.php:33
280
+ #: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
281
+ msgid "Brand"
282
+ msgstr "Marca"
283
+
284
+ #: classes/class-perfect-woocommerce-brands.php:281
285
+ msgid "Products"
286
+ msgstr "Productos"
287
+
288
+ #: classes/class-perfect-woocommerce-brands.php:284
289
+ msgid "Number of products to load"
290
+ msgstr "Número de productos que cargar"
291
+
292
+ #: classes/class-perfect-woocommerce-brands.php:289
293
+ msgid "Products to show"
294
+ msgstr "Productos a mostrar"
295
+
296
+ #: classes/class-perfect-woocommerce-brands.php:292
297
+ msgid "Number of products to show"
298
+ msgstr "Número de productos que mostrar"
299
+
300
+ #: classes/class-perfect-woocommerce-brands.php:297
301
+ msgid "Products to scroll"
302
+ msgstr "Número de productos por scroll"
303
+
304
+ #: classes/class-perfect-woocommerce-brands.php:300
305
+ msgid "Number of products to scroll"
306
+ msgstr "Número de productos por cada scroll"
307
+
308
+ #: classes/class-perfect-woocommerce-brands.php:305
309
+ #: classes/class-perfect-woocommerce-brands.php:354
310
+ msgid "Autoplay"
311
+ msgstr "Modo automático"
312
+
313
+ #: classes/class-perfect-woocommerce-brands.php:307
314
+ #: classes/class-perfect-woocommerce-brands.php:356
315
+ msgid "Autoplay carousel"
316
+ msgstr "Modo automático para el carrusel"
317
+
318
+ #: classes/class-perfect-woocommerce-brands.php:312
319
+ #: classes/class-perfect-woocommerce-brands.php:361
320
+ msgid "Arrows"
321
+ msgstr "Flechas de navegación"
322
+
323
+ #: classes/class-perfect-woocommerce-brands.php:314
324
+ #: classes/class-perfect-woocommerce-brands.php:363
325
+ msgid "Display prev and next arrows"
326
+ msgstr "Mostrar flechas de navegación"
327
+
328
+ #: classes/class-perfect-woocommerce-brands.php:320
329
+ msgid "PWB Brands carousel"
330
+ msgstr "PWB Carrusel de marcas"
331
+
332
+ #: classes/class-perfect-woocommerce-brands.php:321
333
+ msgid "Brands carousel"
334
+ msgstr "Carrusel de marcas"
335
+
336
+ #: classes/class-perfect-woocommerce-brands.php:330
337
+ msgid "Items"
338
+ msgstr "Elementos"
339
+
340
+ #: classes/class-perfect-woocommerce-brands.php:333
341
+ msgid "Number of items to load (or 'featured')"
342
+ msgstr "Número de elementos a cargar (o 'featured')"
343
+
344
+ #: classes/class-perfect-woocommerce-brands.php:338
345
+ msgid "Items to show"
346
+ msgstr "Elementos a mostrar"
347
+
348
+ #: classes/class-perfect-woocommerce-brands.php:341
349
+ msgid "Number of items to show"
350
+ msgstr "Número de elementos a mostrar"
351
+
352
+ #: classes/class-perfect-woocommerce-brands.php:346
353
+ msgid "Items to scroll"
354
+ msgstr "Número de elementos por scroll"
355
+
356
+ #: classes/class-perfect-woocommerce-brands.php:349
357
+ msgid "Number of items to scroll"
358
+ msgstr "Número de elementos por cada scroll"
359
+
360
+ #: classes/class-perfect-woocommerce-brands.php:378
361
+ msgid "PWB All brands"
362
+ msgstr "PWB Todas las marcas"
363
+
364
+ #: classes/class-perfect-woocommerce-brands.php:379
365
+ msgid "Show all brands"
366
+ msgstr "Mostrar todas las marcas"
367
+
368
+ #: classes/class-perfect-woocommerce-brands.php:388
369
+ msgid "Brands per page"
370
+ msgstr "Marcas por página"
371
+
372
+ #: classes/class-perfect-woocommerce-brands.php:391
373
+ msgid "Show x brands per page"
374
+ msgstr "Mostrar x marcas por página"
375
+
376
+ #: classes/class-perfect-woocommerce-brands.php:402
377
+ msgid "Order by"
378
+ msgstr "Ordenar por"
379
+
380
+ #: classes/class-perfect-woocommerce-brands.php:416
381
+ msgid "Order"
382
+ msgstr "Orden"
383
+
384
+ #: classes/class-perfect-woocommerce-brands.php:426
385
+ msgid "Title position"
386
+ msgstr "Posición del título"
387
+
388
+ #: classes/class-perfect-woocommerce-brands.php:430
389
+ msgid "Before image"
390
+ msgstr "Antes de la imagen"
391
+
392
+ #: classes/class-perfect-woocommerce-brands.php:431
393
+ msgid "After image"
394
+ msgstr "Después de la imagen"
395
+
396
+ #: classes/class-perfect-woocommerce-brands.php:432
397
+ msgid "Hide"
398
+ msgstr "Ocultar"
399
+
400
+ #: classes/class-perfect-woocommerce-brands.php:438
401
+ msgid "Hide empty"
402
+ msgstr "Ocultar vacías"
403
+
404
+ #: classes/class-perfect-woocommerce-brands.php:440
405
+ msgid "Hide brands that have not been assigned to any product"
406
+ msgstr "Ocultar marcas que no han sido asignadas a ningún producto"
407
+
408
+ #: classes/class-perfect-woocommerce-brands.php:448
409
+ msgid "PWB brand"
410
+ msgstr "PWB Marca"
411
+
412
+ #: classes/class-perfect-woocommerce-brands.php:449
413
+ msgid "Show brand for a specific product"
414
+ msgstr "Ver marcas de un producto específico"
415
+
416
+ #: classes/class-perfect-woocommerce-brands.php:459
417
+ msgid "Product id"
418
+ msgstr "Id del producto"
419
+
420
+ #: classes/class-perfect-woocommerce-brands.php:462
421
+ msgid "Product id (post id)"
422
+ msgstr "Id del producto (id del post)"
423
+
424
+ #: classes/class-perfect-woocommerce-brands.php:505
425
+ #: classes/class-perfect-woocommerce-brands.php:507
426
+ #: classes/shortcodes/class-pwb-all-brands.php:90
427
+ #: classes/shortcodes/class-pwb-brand.php:29
428
+ #: classes/shortcodes/class-pwb-brand.php:31
429
+ #: templates/shortcodes/carousel.php:18
430
+ msgid "View brand"
431
+ msgstr "Ver marca"
432
+
433
+ #: classes/class-perfect-woocommerce-brands.php:577
434
+ msgid "¿Start migration?"
435
+ msgstr "¿Comenzar la migración?"
436
+
437
+ #: classes/class-perfect-woocommerce-brands.php:578
438
+ msgid ""
439
+ "We are migrating the product brands. ¡Don´t close this window until the "
440
+ "process is finished!"
441
+ msgstr ""
442
+ "Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
443
+ "el proceso finalice!"
444
+
445
+ #: classes/class-perfect-woocommerce-brands.php:579
446
+ msgid "¿Start loading dummy data?"
447
+ msgstr "¿Comenzar con la importación?"
448
+
449
+ #: classes/class-perfect-woocommerce-brands.php:580
450
+ msgid ""
451
+ "We are importing the dummy data. ¡Don´t close this window until the process "
452
+ "is finished!"
453
+ msgstr ""
454
+ "En este momento estamos importando las marcas ficticias. ¡No cierre esta "
455
+ "ventana hasta que termine el proceso!"
456
+
457
+ #: classes/class-perfect-woocommerce-brands.php:591
458
+ msgid "All Brands"
459
+ msgstr "Todas las marcas"
460
+
461
+ #: classes/class-perfect-woocommerce-brands.php:592
462
+ msgid "Edit Brand"
463
+ msgstr "Editar marca"
464
+
465
+ #: classes/class-perfect-woocommerce-brands.php:593
466
+ msgid "View Brand"
467
+ msgstr "Ver marca"
468
+
469
+ #: classes/class-perfect-woocommerce-brands.php:594
470
+ msgid "Update Brand"
471
+ msgstr "Actualizar marca"
472
+
473
+ #: classes/class-perfect-woocommerce-brands.php:595
474
+ msgid "Add New Brand"
475
+ msgstr "Añadir nueva marca"
476
+
477
+ #: classes/class-perfect-woocommerce-brands.php:596
478
+ msgid "New Brand Name"
479
+ msgstr "Nuevo nombre de marca"
480
+
481
+ #: classes/class-perfect-woocommerce-brands.php:597
482
+ msgid "Parent Brand"
483
+ msgstr "Marca Padre"
484
+
485
+ #: classes/class-perfect-woocommerce-brands.php:598
486
+ msgid "Parent Brand:"
487
+ msgstr "Marca Padre:"
488
+
489
+ #: classes/class-perfect-woocommerce-brands.php:599
490
+ msgid "Search Brands"
491
+ msgstr "Buscar Marcas"
492
+
493
+ #: classes/class-perfect-woocommerce-brands.php:600
494
+ msgid "Popular Brands"
495
+ msgstr "Marcas Populares"
496
+
497
+ #: classes/class-perfect-woocommerce-brands.php:601
498
+ msgid "Separate brands with commas"
499
+ msgstr "Separar marcas con comas"
500
+
501
+ #: classes/class-perfect-woocommerce-brands.php:602
502
+ msgid "Add or remove brands"
503
+ msgstr "Añadir o eliminar marcas"
504
+
505
+ #: classes/class-perfect-woocommerce-brands.php:603
506
+ msgid "Choose from the most used brands"
507
+ msgstr "Seleccionar de las marcas más utilizadas"
508
+
509
+ #: classes/class-perfect-woocommerce-brands.php:604
510
+ msgid "No brands found"
511
+ msgstr "No se han encontrado marcas"
512
+
513
+ #: classes/class-perfect-woocommerce-brands.php:648
514
+ #: classes/class-perfect-woocommerce-brands.php:681
515
+ #: classes/widgets/class-pwb-list.php:39
516
+ msgid "Brand logo"
517
+ msgstr "Logo de la marca"
518
+
519
+ #: classes/class-perfect-woocommerce-brands.php:650
520
+ #: classes/class-perfect-woocommerce-brands.php:656
521
+ #: classes/class-perfect-woocommerce-brands.php:685
522
+ #: classes/class-perfect-woocommerce-brands.php:705
523
+ msgid "Select image"
524
+ msgstr "Seleccionar imagen"
525
+
526
+ #: classes/class-perfect-woocommerce-brands.php:654
527
+ #: classes/class-perfect-woocommerce-brands.php:701
528
+ msgid "Brand banner"
529
+ msgstr "Banner de la marca"
530
+
531
+ #: classes/class-perfect-woocommerce-brands.php:657
532
+ msgid "This image will be shown on brand page"
533
+ msgstr "Esta imagen se mostrará en la página de la marca"
534
+
535
+ #: classes/class-perfect-woocommerce-brands.php:661
536
+ #: classes/class-perfect-woocommerce-brands.php:721
537
+ msgid "Brand banner link"
538
+ msgstr "Enlace para el banner de la marca"
539
+
540
+ #: classes/class-perfect-woocommerce-brands.php:663
541
+ #: classes/class-perfect-woocommerce-brands.php:725
542
+ msgid "This link should be relative to site url. Example: product/product-name"
543
+ msgstr ""
544
+ "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
545
+ "nombre-del-producto"
546
+
547
+ #: classes/class-perfect-woocommerce-brands.php:794
548
+ msgid "All"
549
+ msgstr "Todas"
550
+
551
+ #: classes/class-pwb-api-support.php:90
552
+ msgid "Product brands"
553
+ msgstr "Marcas del producto"
554
+
555
+ #: classes/shortcodes/class-pwb-all-brands.php:111
556
+ msgid "First page"
557
+ msgstr "Primera página"
558
+
559
+ #: classes/shortcodes/class-pwb-all-brands.php:114
560
+ msgid "Previous page"
561
+ msgstr "Página anterior"
562
+
563
+ #: classes/shortcodes/class-pwb-all-brands.php:118
564
+ msgid "Next page"
565
+ msgstr "Siguiente página"
566
+
567
+ #: classes/shortcodes/class-pwb-all-brands.php:121
568
+ msgid "Last page"
569
+ msgstr "Última página"
570
+
571
+ #: classes/shortcodes/class-pwb-all-brands.php:126
572
+ msgid "No results"
573
+ msgstr "No se han encontrado resultados"
574
+
575
+ #: classes/widgets/class-pwb-dropdown.php:10
576
+ msgid "Adds a brands dropdown to your site"
577
+ msgstr "Añade un desplegable con las marcas a tu sitio"
578
+
579
+ #: classes/widgets/class-pwb-dropdown.php:11
580
+ msgid "Brands dropdown"
581
+ msgstr "Desplegable de marcas"
582
+
583
+ #: classes/widgets/class-pwb-dropdown.php:21
584
+ msgid "Title"
585
+ msgstr "Título"
586
+
587
+ #: classes/widgets/class-pwb-dropdown.php:68
588
+ #: classes/widgets/class-pwb-list.php:105
589
+ msgid "There is not available brands"
590
+ msgstr "No se encuentran marcas disponibles"
591
+
592
+ #: classes/widgets/class-pwb-filter-by-brand.php:10
593
+ msgid "Recommended for product categories or shop page"
594
+ msgstr "Recomendado para las categorías de producto y la página de la tienda"
595
+
596
+ #: classes/widgets/class-pwb-filter-by-brand.php:11
597
+ msgid "Filter products by brand"
598
+ msgstr "Filtrar productos por marca"
599
+
600
+ #: classes/widgets/class-pwb-filter-by-brand.php:20
601
+ #: classes/widgets/class-pwb-list.php:24
602
+ msgid "Title:"
603
+ msgstr "Título:"
604
+
605
+ #: classes/widgets/class-pwb-list.php:10
606
+ msgid "Adds a brands list to your site"
607
+ msgstr "Añade una lista de marcas a tu sitio"
608
+
609
+ #: classes/widgets/class-pwb-list.php:11
610
+ msgid "Brands list"
611
+ msgstr "Lista de marcas"
612
+
613
+ #: classes/widgets/class-pwb-list.php:33
614
+ msgid "Display as:"
615
+ msgstr "Mostrar como:"
616
+
617
+ #: classes/widgets/class-pwb-list.php:38
618
+ msgid "Brand name"
619
+ msgstr "Nombre de la marca"
620
+
621
+ #: classes/widgets/class-pwb-list.php:44
622
+ msgid "Columns:"
623
+ msgstr "Columnas:"
624
+
625
+ #: classes/widgets/class-pwb-list.php:97 classes/widgets/class-pwb-list.php:99
626
+ msgid "Go to"
627
+ msgstr "Ir a"
628
+
629
+ #: main.php:103
630
+ msgid ""
631
+ "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
632
+ "active WooCommerce plugin."
633
+ msgstr ""
634
+ "Perfect WooCommerce Brands necesita WooCommerce para funcionar. Por favor, "
635
+ "instala y activa WooCommerce."
636
+
637
+ #: templates/shortcodes/carousel.php:24
638
+ #: templates/shortcodes/product-carousel.php:28
639
+ msgid "Loading"
640
+ msgstr "Cargando"
641
+
642
+ #: templates/shortcodes/product-carousel.php:34
643
+ msgid "Nothing found"
644
+ msgstr "Aquí no hay nada"
645
+
646
+ #: templates/widgets/filter-by-brand.php:24
647
+ msgid "Apply filter"
648
+ msgstr "Filtrar"
649
+
650
+ #. Plugin Name of the plugin/theme
651
+ msgid "Perfect WooCommerce Brands"
652
+ msgstr "Perfect WooCommerce Brands"
653
+
654
+ #. Plugin URI of the plugin/theme
655
+ msgid "https://wordpress.org/plugins/perfect-woocommerce-brands/"
656
+ msgstr "https://wordpress.org/plugins/perfect-woocommerce-brands/"
657
+
658
+ #. Description of the plugin/theme
659
+ msgid ""
660
+ "Perfect WooCommerce Brands allows you to show product brands in your "
661
+ "WooCommerce based store."
662
+ msgstr ""
663
+ "Perfect WooCommerce Brands te permite trabajar con marcas de producto en tu "
664
+ "tienda online basada en WooCommerce."
665
+
666
+ #. Author of the plugin/theme
667
+ msgid "Alberto de Vera Sevilla"
668
+ msgstr "Alberto de Vera Sevilla"
669
+
670
+ #. Author URI of the plugin/theme
671
+ msgid "https://profiles.wordpress.org/titodevera/"
672
+ msgstr "https://profiles.wordpress.org/titodevera/"
673
+
674
+ #~ msgid "Number of items to load"
675
+ #~ msgstr "Número de elementos que cargar"
676
+
677
+ #~ msgid "No products found"
678
+ #~ msgstr "No se han encontrado productos"
679
+
680
+ #~ msgid ""
681
+ #~ "We are offering you maybe the best WooCommerce brands plugin completely "
682
+ #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
683
+ #~ "Thanks!"
684
+ #~ msgstr ""
685
+ #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
686
+ #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
687
+ #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
688
+
689
+ #~ msgid ""
690
+ #~ "Import brands from other brand plugin. <strong>Both plugins should be "
691
+ #~ "installed and active</strong>"
692
+ #~ msgstr ""
693
+ #~ "Importar marcas de otro plugin. <strong>Ambos plugins han de encontrarse "
694
+ #~ "instalados y activados</strong>"
695
+
696
+ #~ msgid ""
697
+ #~ "We are offering you maybe the best WooCommerce brands plugin completly "
698
+ #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
699
+ #~ "Thanks!"
700
+ #~ msgstr ""
701
+ #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
702
+ #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
703
+ #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
704
+
705
+ #~ msgid "Import brands from old plugin installation"
706
+ #~ msgstr "Importar marcas de otro plugin"
707
+
708
+ #~ msgid "Brands metabox"
709
+ #~ msgstr "Marcas metabox"
710
+
711
+ #~ msgid "image for this brand"
712
+ #~ msgstr "imagen para esta marca"
713
+
714
+ #~ msgid "Select an image"
715
+ #~ msgstr "Seleccione una imagen"
716
+
717
+ #~ msgid "Show a specific brand"
718
+ #~ msgstr "Mostrar marcas de un producto en concreto"
lang/perfect-woocommerce-brands.pot ADDED
@@ -0,0 +1,625 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: PACKAGE VERSION\n"
10
+ "Report-Msgid-Bugs-To: \n"
11
+ "POT-Creation-Date: 2018-02-06 22:57+0100\n"
12
+ "PO-Revision-Date: 2018-02-06 22:57+0100\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "Language: \n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Plural-Forms: \n"
20
+ "X-Generator: Eazy Po 0.9.5.3\n"
21
+
22
+ #: main.php:103
23
+ msgid ""
24
+ "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
25
+ "active WooCommerce plugin."
26
+ msgstr ""
27
+
28
+ #: classes/class-perfect-woocommerce-brands.php:54
29
+ msgid ""
30
+ "We know that you´re in love with Perfect WooCommerce Brands, you can help us "
31
+ "making it a bit better. Thanks a lot!"
32
+ msgstr ""
33
+
34
+ #: classes/class-perfect-woocommerce-brands.php:56
35
+ msgid ""
36
+ "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
37
+ "reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
38
+ msgstr ""
39
+
40
+ #: classes/class-perfect-woocommerce-brands.php:57
41
+ msgid ""
42
+ "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
43
+ "woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
44
+ msgstr ""
45
+
46
+ #: classes/class-perfect-woocommerce-brands.php:58
47
+ msgid ""
48
+ "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
49
+ "\"_blank\">View on GitHub</a>"
50
+ msgstr ""
51
+
52
+ #: classes/class-perfect-woocommerce-brands.php:81
53
+ msgid "Settings"
54
+ msgstr ""
55
+
56
+ #: classes/class-perfect-woocommerce-brands.php:264
57
+ msgid "PWB Product carousel"
58
+ msgstr ""
59
+
60
+ #: classes/class-perfect-woocommerce-brands.php:265
61
+ msgid "Product carousel by brand or by category"
62
+ msgstr ""
63
+
64
+ #: classes/class-perfect-woocommerce-brands.php:273
65
+ #: classes/class-perfect-woocommerce-brands.php:585
66
+ #: classes/class-pwb-exporter-support.php:22
67
+ #: classes/class-pwb-importer-support.php:22
68
+ #: classes/class-pwb-importer-support.php:33
69
+ #: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
70
+ msgid "Brand"
71
+ msgstr ""
72
+
73
+ #: classes/class-perfect-woocommerce-brands.php:281
74
+ msgid "Products"
75
+ msgstr ""
76
+
77
+ #: classes/class-perfect-woocommerce-brands.php:284
78
+ msgid "Number of products to load"
79
+ msgstr ""
80
+
81
+ #: classes/class-perfect-woocommerce-brands.php:289
82
+ msgid "Products to show"
83
+ msgstr ""
84
+
85
+ #: classes/class-perfect-woocommerce-brands.php:292
86
+ msgid "Number of products to show"
87
+ msgstr ""
88
+
89
+ #: classes/class-perfect-woocommerce-brands.php:297
90
+ msgid "Products to scroll"
91
+ msgstr ""
92
+
93
+ #: classes/class-perfect-woocommerce-brands.php:300
94
+ msgid "Number of products to scroll"
95
+ msgstr ""
96
+
97
+ #: classes/class-perfect-woocommerce-brands.php:305
98
+ #: classes/class-perfect-woocommerce-brands.php:354
99
+ msgid "Autoplay"
100
+ msgstr ""
101
+
102
+ #: classes/class-perfect-woocommerce-brands.php:307
103
+ #: classes/class-perfect-woocommerce-brands.php:356
104
+ msgid "Autoplay carousel"
105
+ msgstr ""
106
+
107
+ #: classes/class-perfect-woocommerce-brands.php:312
108
+ #: classes/class-perfect-woocommerce-brands.php:361
109
+ msgid "Arrows"
110
+ msgstr ""
111
+
112
+ #: classes/class-perfect-woocommerce-brands.php:314
113
+ #: classes/class-perfect-woocommerce-brands.php:363
114
+ msgid "Display prev and next arrows"
115
+ msgstr ""
116
+
117
+ #: classes/class-perfect-woocommerce-brands.php:320
118
+ msgid "PWB Brands carousel"
119
+ msgstr ""
120
+
121
+ #: classes/class-perfect-woocommerce-brands.php:321
122
+ msgid "Brands carousel"
123
+ msgstr ""
124
+
125
+ #: classes/class-perfect-woocommerce-brands.php:330
126
+ msgid "Items"
127
+ msgstr ""
128
+
129
+ #: classes/class-perfect-woocommerce-brands.php:333
130
+ msgid "Number of items to load (or 'featured')"
131
+ msgstr ""
132
+
133
+ #: classes/class-perfect-woocommerce-brands.php:338
134
+ msgid "Items to show"
135
+ msgstr ""
136
+
137
+ #: classes/class-perfect-woocommerce-brands.php:341
138
+ msgid "Number of items to show"
139
+ msgstr ""
140
+
141
+ #: classes/class-perfect-woocommerce-brands.php:346
142
+ msgid "Items to scroll"
143
+ msgstr ""
144
+
145
+ #: classes/class-perfect-woocommerce-brands.php:349
146
+ msgid "Number of items to scroll"
147
+ msgstr ""
148
+
149
+ #: classes/class-perfect-woocommerce-brands.php:367
150
+ #: classes/class-perfect-woocommerce-brands.php:395
151
+ #: classes/class-perfect-woocommerce-brands.php:466
152
+ #: classes/admin/class-pwb-admin-tab.php:126
153
+ msgid "Brand logo size"
154
+ msgstr ""
155
+
156
+ #: classes/class-perfect-woocommerce-brands.php:378
157
+ msgid "PWB All brands"
158
+ msgstr ""
159
+
160
+ #: classes/class-perfect-woocommerce-brands.php:379
161
+ msgid "Show all brands"
162
+ msgstr ""
163
+
164
+ #: classes/class-perfect-woocommerce-brands.php:388
165
+ msgid "Brands per page"
166
+ msgstr ""
167
+
168
+ #: classes/class-perfect-woocommerce-brands.php:391
169
+ msgid "Show x brands per page"
170
+ msgstr ""
171
+
172
+ #: classes/class-perfect-woocommerce-brands.php:402
173
+ msgid "Order by"
174
+ msgstr ""
175
+
176
+ #: classes/class-perfect-woocommerce-brands.php:416
177
+ msgid "Order"
178
+ msgstr ""
179
+
180
+ #: classes/class-perfect-woocommerce-brands.php:426
181
+ msgid "Title position"
182
+ msgstr ""
183
+
184
+ #: classes/class-perfect-woocommerce-brands.php:430
185
+ msgid "Before image"
186
+ msgstr ""
187
+
188
+ #: classes/class-perfect-woocommerce-brands.php:431
189
+ msgid "After image"
190
+ msgstr ""
191
+
192
+ #: classes/class-perfect-woocommerce-brands.php:432
193
+ msgid "Hide"
194
+ msgstr ""
195
+
196
+ #: classes/class-perfect-woocommerce-brands.php:438
197
+ msgid "Hide empty"
198
+ msgstr ""
199
+
200
+ #: classes/class-perfect-woocommerce-brands.php:440
201
+ msgid "Hide brands that have not been assigned to any product"
202
+ msgstr ""
203
+
204
+ #: classes/class-perfect-woocommerce-brands.php:448
205
+ msgid "PWB brand"
206
+ msgstr ""
207
+
208
+ #: classes/class-perfect-woocommerce-brands.php:449
209
+ msgid "Show brand for a specific product"
210
+ msgstr ""
211
+
212
+ #: classes/class-perfect-woocommerce-brands.php:459
213
+ msgid "Product id"
214
+ msgstr ""
215
+
216
+ #: classes/class-perfect-woocommerce-brands.php:462
217
+ msgid "Product id (post id)"
218
+ msgstr ""
219
+
220
+ #: classes/class-perfect-woocommerce-brands.php:505
221
+ #: classes/class-perfect-woocommerce-brands.php:507
222
+ #: classes/shortcodes/class-pwb-all-brands.php:90
223
+ #: classes/shortcodes/class-pwb-brand.php:29
224
+ #: classes/shortcodes/class-pwb-brand.php:31
225
+ #: templates/shortcodes/carousel.php:18
226
+ msgid "View brand"
227
+ msgstr ""
228
+
229
+ #: classes/class-perfect-woocommerce-brands.php:572
230
+ msgid "¿Start migration?"
231
+ msgstr ""
232
+
233
+ #: classes/class-perfect-woocommerce-brands.php:573
234
+ msgid ""
235
+ "We are migrating the product brands. ¡Don´t close this window until the "
236
+ "process is finished!"
237
+ msgstr ""
238
+
239
+ #: classes/class-perfect-woocommerce-brands.php:574
240
+ msgid "¿Start loading dummy data?"
241
+ msgstr ""
242
+
243
+ #: classes/class-perfect-woocommerce-brands.php:575
244
+ msgid ""
245
+ "We are importing the dummy data. ¡Don´t close this window until the process "
246
+ "is finished!"
247
+ msgstr ""
248
+
249
+ #: classes/class-perfect-woocommerce-brands.php:584
250
+ #: classes/class-perfect-woocommerce-brands.php:586
251
+ #: classes/admin/class-edit-brands-page.php:128
252
+ #: classes/admin/class-pwb-admin-tab.php:21
253
+ #: classes/widgets/class-pwb-dropdown.php:59
254
+ #: classes/widgets/class-pwb-filter-by-brand.php:17
255
+ #: classes/widgets/class-pwb-filter-by-brand.php:29
256
+ msgid "Brands"
257
+ msgstr ""
258
+
259
+ #: classes/class-perfect-woocommerce-brands.php:587
260
+ msgid "All Brands"
261
+ msgstr ""
262
+
263
+ #: classes/class-perfect-woocommerce-brands.php:588
264
+ msgid "Edit Brand"
265
+ msgstr ""
266
+
267
+ #: classes/class-perfect-woocommerce-brands.php:589
268
+ msgid "View Brand"
269
+ msgstr ""
270
+
271
+ #: classes/class-perfect-woocommerce-brands.php:590
272
+ msgid "Update Brand"
273
+ msgstr ""
274
+
275
+ #: classes/class-perfect-woocommerce-brands.php:591
276
+ msgid "Add New Brand"
277
+ msgstr ""
278
+
279
+ #: classes/class-perfect-woocommerce-brands.php:592
280
+ msgid "New Brand Name"
281
+ msgstr ""
282
+
283
+ #: classes/class-perfect-woocommerce-brands.php:593
284
+ msgid "Parent Brand"
285
+ msgstr ""
286
+
287
+ #: classes/class-perfect-woocommerce-brands.php:594
288
+ msgid "Parent Brand:"
289
+ msgstr ""
290
+
291
+ #: classes/class-perfect-woocommerce-brands.php:595
292
+ msgid "Search Brands"
293
+ msgstr ""
294
+
295
+ #: classes/class-perfect-woocommerce-brands.php:596
296
+ msgid "Popular Brands"
297
+ msgstr ""
298
+
299
+ #: classes/class-perfect-woocommerce-brands.php:597
300
+ msgid "Separate brands with commas"
301
+ msgstr ""
302
+
303
+ #: classes/class-perfect-woocommerce-brands.php:598
304
+ msgid "Add or remove brands"
305
+ msgstr ""
306
+
307
+ #: classes/class-perfect-woocommerce-brands.php:599
308
+ msgid "Choose from the most used brands"
309
+ msgstr ""
310
+
311
+ #: classes/class-perfect-woocommerce-brands.php:600
312
+ msgid "No brands found"
313
+ msgstr ""
314
+
315
+ #: classes/class-perfect-woocommerce-brands.php:644
316
+ #: classes/class-perfect-woocommerce-brands.php:677
317
+ #: classes/widgets/class-pwb-list.php:39
318
+ msgid "Brand logo"
319
+ msgstr ""
320
+
321
+ #: classes/class-perfect-woocommerce-brands.php:646
322
+ #: classes/class-perfect-woocommerce-brands.php:652
323
+ #: classes/class-perfect-woocommerce-brands.php:681
324
+ #: classes/class-perfect-woocommerce-brands.php:701
325
+ msgid "Select image"
326
+ msgstr ""
327
+
328
+ #: classes/class-perfect-woocommerce-brands.php:650
329
+ #: classes/class-perfect-woocommerce-brands.php:697
330
+ msgid "Brand banner"
331
+ msgstr ""
332
+
333
+ #: classes/class-perfect-woocommerce-brands.php:653
334
+ msgid "This image will be shown on brand page"
335
+ msgstr ""
336
+
337
+ #: classes/class-perfect-woocommerce-brands.php:657
338
+ #: classes/class-perfect-woocommerce-brands.php:717
339
+ msgid "Brand banner link"
340
+ msgstr ""
341
+
342
+ #: classes/class-perfect-woocommerce-brands.php:659
343
+ #: classes/class-perfect-woocommerce-brands.php:721
344
+ msgid "This link should be relative to site url. Example: product/product-name"
345
+ msgstr ""
346
+
347
+ #: classes/class-perfect-woocommerce-brands.php:790
348
+ msgid "All"
349
+ msgstr ""
350
+
351
+ #: classes/class-pwb-api-support.php:90
352
+ msgid "Product brands"
353
+ msgstr ""
354
+
355
+ #: classes/admin/class-edit-brands-page.php:39
356
+ msgid "featured"
357
+ msgstr ""
358
+
359
+ #: classes/admin/class-edit-brands-page.php:74
360
+ msgid "Logo"
361
+ msgstr ""
362
+
363
+ #: classes/admin/class-edit-brands-page.php:96
364
+ msgid "Set as featured"
365
+ msgstr ""
366
+
367
+ #: classes/admin/class-edit-brands-page.php:118
368
+ msgid "Error!"
369
+ msgstr ""
370
+
371
+ #: classes/admin/class-edit-brands-page.php:131
372
+ msgid "Show featured brands first"
373
+ msgstr ""
374
+
375
+ #: classes/admin/class-pwb-admin-tab.php:73
376
+ msgid "Brands settings"
377
+ msgstr ""
378
+
379
+ #: classes/admin/class-pwb-admin-tab.php:79
380
+ msgid "Slug"
381
+ msgstr ""
382
+
383
+ #: classes/admin/class-pwb-admin-tab.php:82
384
+ msgid "Brands taxonomy slug"
385
+ msgstr ""
386
+
387
+ #: classes/admin/class-pwb-admin-tab.php:87
388
+ msgid "Show brand description"
389
+ msgstr ""
390
+
391
+ #: classes/admin/class-pwb-admin-tab.php:90
392
+ msgid "Show brand description (if is set) on brand archive page"
393
+ msgstr ""
394
+
395
+ #: classes/admin/class-pwb-admin-tab.php:94
396
+ msgid "Single product tab"
397
+ msgstr ""
398
+
399
+ #: classes/admin/class-pwb-admin-tab.php:97
400
+ msgid "Show brand tab in single product page"
401
+ msgstr ""
402
+
403
+ #: classes/admin/class-pwb-admin-tab.php:101
404
+ msgid "Show brands in loop"
405
+ msgstr ""
406
+
407
+ #: classes/admin/class-pwb-admin-tab.php:104
408
+ msgid "Show brand logo (or name) in product loop"
409
+ msgstr ""
410
+
411
+ #: classes/admin/class-pwb-admin-tab.php:107
412
+ #: classes/admin/class-pwb-admin-tab.php:120
413
+ msgid "No"
414
+ msgstr ""
415
+
416
+ #: classes/admin/class-pwb-admin-tab.php:108
417
+ #: classes/admin/class-pwb-admin-tab.php:121
418
+ msgid "Show brand link"
419
+ msgstr ""
420
+
421
+ #: classes/admin/class-pwb-admin-tab.php:109
422
+ #: classes/admin/class-pwb-admin-tab.php:122
423
+ msgid "Show brand image (if is set)"
424
+ msgstr ""
425
+
426
+ #: classes/admin/class-pwb-admin-tab.php:113
427
+ msgid "Show brands in single product"
428
+ msgstr ""
429
+
430
+ #: classes/admin/class-pwb-admin-tab.php:116
431
+ msgid "Show brand logo (or name) in single product"
432
+ msgstr ""
433
+
434
+ #: classes/admin/class-pwb-admin-tab.php:129
435
+ msgid "Brand logo size for single product view"
436
+ msgstr ""
437
+
438
+ #: classes/admin/class-pwb-admin-tab.php:134
439
+ msgid "Brand position"
440
+ msgstr ""
441
+
442
+ #: classes/admin/class-pwb-admin-tab.php:137
443
+ msgid "For single product"
444
+ msgstr ""
445
+
446
+ #: classes/admin/class-pwb-admin-tab.php:140
447
+ msgid "Before title"
448
+ msgstr ""
449
+
450
+ #: classes/admin/class-pwb-admin-tab.php:141
451
+ msgid "After title"
452
+ msgstr ""
453
+
454
+ #: classes/admin/class-pwb-admin-tab.php:142
455
+ msgid "After price"
456
+ msgstr ""
457
+
458
+ #: classes/admin/class-pwb-admin-tab.php:143
459
+ msgid "After excerpt"
460
+ msgstr ""
461
+
462
+ #: classes/admin/class-pwb-admin-tab.php:144
463
+ msgid "After add to cart"
464
+ msgstr ""
465
+
466
+ #: classes/admin/class-pwb-admin-tab.php:145
467
+ msgid "After meta"
468
+ msgstr ""
469
+
470
+ #: classes/admin/class-pwb-admin-tab.php:146
471
+ msgid "After sharing"
472
+ msgstr ""
473
+
474
+ #: classes/admin/class-pwb-admin-tab.php:163
475
+ msgid "Tools"
476
+ msgstr ""
477
+
478
+ #: classes/admin/class-pwb-admin-tab.php:169
479
+ msgid "Import brands"
480
+ msgstr ""
481
+
482
+ #: classes/admin/class-pwb-admin-tab.php:173
483
+ #, php-format
484
+ msgid ""
485
+ "Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
486
+ "\">Click here for more details</a>"
487
+ msgstr ""
488
+
489
+ #: classes/admin/class-pwb-admin-tab.php:178
490
+ #: classes/admin/class-pwb-admin-tab.php:191
491
+ msgid "-"
492
+ msgstr ""
493
+
494
+ #: classes/admin/class-pwb-admin-tab.php:179
495
+ msgid "YITH WooCommerce Brands Add-On"
496
+ msgstr ""
497
+
498
+ #: classes/admin/class-pwb-admin-tab.php:180
499
+ msgid "Ultimate WooCommerce Brands"
500
+ msgstr ""
501
+
502
+ #: classes/admin/class-pwb-admin-tab.php:181
503
+ msgid "Offical WooCommerce Brands"
504
+ msgstr ""
505
+
506
+ #: classes/admin/class-pwb-admin-tab.php:185
507
+ msgid "Dummy data"
508
+ msgstr ""
509
+
510
+ #: classes/admin/class-pwb-admin-tab.php:188
511
+ msgid "Import generic brands and assign it to products randomly"
512
+ msgstr ""
513
+
514
+ #: classes/admin/class-pwb-admin-tab.php:192
515
+ msgid "Start import"
516
+ msgstr ""
517
+
518
+ #: classes/admin/class-pwb-admin-tab.php:196
519
+ msgid "System status"
520
+ msgstr ""
521
+
522
+ #: classes/admin/class-pwb-admin-tab.php:198
523
+ msgid "Show system status"
524
+ msgstr ""
525
+
526
+ #: classes/admin/class-pwb-coupon.php:24
527
+ msgid "Brands restriction"
528
+ msgstr ""
529
+
530
+ #: classes/admin/class-pwb-coupon.php:25
531
+ msgid "Any brand"
532
+ msgstr ""
533
+
534
+ #: classes/admin/class-pwb-coupon.php:34
535
+ msgid ""
536
+ "Coupon will be valid if there are at least one product of this brands in the "
537
+ "cart"
538
+ msgstr ""
539
+
540
+ #: classes/shortcodes/class-pwb-all-brands.php:111
541
+ msgid "First page"
542
+ msgstr ""
543
+
544
+ #: classes/shortcodes/class-pwb-all-brands.php:114
545
+ msgid "Previous page"
546
+ msgstr ""
547
+
548
+ #: classes/shortcodes/class-pwb-all-brands.php:118
549
+ msgid "Next page"
550
+ msgstr ""
551
+
552
+ #: classes/shortcodes/class-pwb-all-brands.php:121
553
+ msgid "Last page"
554
+ msgstr ""
555
+
556
+ #: classes/shortcodes/class-pwb-all-brands.php:126
557
+ msgid "No results"
558
+ msgstr ""
559
+
560
+ #: classes/widgets/class-pwb-dropdown.php:10
561
+ msgid "Adds a brands dropdown to your site"
562
+ msgstr ""
563
+
564
+ #: classes/widgets/class-pwb-dropdown.php:11
565
+ msgid "Brands dropdown"
566
+ msgstr ""
567
+
568
+ #: classes/widgets/class-pwb-dropdown.php:21
569
+ msgid "Title"
570
+ msgstr ""
571
+
572
+ #: classes/widgets/class-pwb-dropdown.php:68
573
+ #: classes/widgets/class-pwb-list.php:105
574
+ msgid "There is not available brands"
575
+ msgstr ""
576
+
577
+ #: classes/widgets/class-pwb-filter-by-brand.php:10
578
+ msgid "Recommended for product categories or shop page"
579
+ msgstr ""
580
+
581
+ #: classes/widgets/class-pwb-filter-by-brand.php:11
582
+ msgid "Filter products by brand"
583
+ msgstr ""
584
+
585
+ #: classes/widgets/class-pwb-filter-by-brand.php:20
586
+ #: classes/widgets/class-pwb-list.php:24
587
+ msgid "Title:"
588
+ msgstr ""
589
+
590
+ #: classes/widgets/class-pwb-list.php:10
591
+ msgid "Adds a brands list to your site"
592
+ msgstr ""
593
+
594
+ #: classes/widgets/class-pwb-list.php:11
595
+ msgid "Brands list"
596
+ msgstr ""
597
+
598
+ #: classes/widgets/class-pwb-list.php:33
599
+ msgid "Display as:"
600
+ msgstr ""
601
+
602
+ #: classes/widgets/class-pwb-list.php:38
603
+ msgid "Brand name"
604
+ msgstr ""
605
+
606
+ #: classes/widgets/class-pwb-list.php:44
607
+ msgid "Columns:"
608
+ msgstr ""
609
+
610
+ #: classes/widgets/class-pwb-list.php:97 classes/widgets/class-pwb-list.php:99
611
+ msgid "Go to"
612
+ msgstr ""
613
+
614
+ #: templates/shortcodes/carousel.php:24
615
+ #: templates/shortcodes/product-carousel.php:28
616
+ msgid "Loading"
617
+ msgstr ""
618
+
619
+ #: templates/shortcodes/product-carousel.php:34
620
+ msgid "Nothing found"
621
+ msgstr ""
622
+
623
+ #: templates/widgets/filter-by-brand.php:24
624
+ msgid "Apply filter"
625
+ msgstr ""
main.php CHANGED
@@ -1,107 +1,107 @@
1
- <?php
2
- /**
3
- * Plugin Name: Perfect WooCommerce Brands
4
- * Plugin URI: https://wordpress.org/plugins/perfect-woocommerce-brands/
5
- * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
6
- * Version: 1.6.2
7
- * Author: Alberto de Vera Sevilla
8
- * Author URI: https://profiles.wordpress.org/titodevera/
9
- * Text Domain: perfect-woocommerce-brands
10
- * Domain Path: /lang
11
- * License: GPL3
12
- * Perfect WooCommerce Brands version 1.6.2, Copyright (C) 2018 Alberto de Vera Sevilla
13
- * Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation, either version 3 of the License, or
16
- * (at your option) any later version.
17
- *
18
- * Perfect WooCommerce Brands is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
22
- * You should have received a copy of the GNU General Public License
23
- * along with Perfect WooCommerce Brands. If not, see <http://www.gnu.org/licenses/>.
24
- *
25
- * WC requires at least: 2.4
26
- * WC tested up to: 3.3
27
- */
28
-
29
- namespace Perfect_Woocommerce_Brands;
30
-
31
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
32
-
33
- //plugin constants
34
- define( 'PWB_PLUGIN', plugins_url( '', __FILE__ ) );
35
- define( 'PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ) );
36
- define( 'PWB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
37
- define( 'PWB_PLUGIN_VERSION', '1.6.2' );
38
- define( 'PWB_WP_VERSION', get_bloginfo( 'version' ) );
39
- define( 'PWB_WC_VERSION', get_option( 'woocommerce_version' ) );
40
-
41
- register_activation_hook( __FILE__, function(){
42
- update_option( 'pwb_activate_on', time() );
43
- } );
44
-
45
- //clean brands slug on plugin deactivation
46
- register_deactivation_hook( __FILE__, function(){
47
- update_option( 'old_wc_pwb_admin_tab_slug', 'null' );
48
- } );
49
-
50
- //loads textdomain for the translations
51
- add_action( 'plugins_loaded', function(){
52
- load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
53
- } );
54
-
55
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
56
- if( is_plugin_active( 'woocommerce/woocommerce.php' ) ){
57
-
58
- require 'classes/widgets/class-pwb-dropdown.php';
59
- require 'classes/widgets/class-pwb-list.php';
60
- require 'classes/widgets/class-pwb-filter-by-brand.php';
61
- require 'classes/shortcodes/class-pwb-product-carousel.php';
62
- require 'classes/shortcodes/class-pwb-carousel.php';
63
- require 'classes/shortcodes/class-pwb-all-brands.php';
64
- require 'classes/shortcodes/class-pwb-brand.php';
65
- require 'classes/class-perfect-woocommerce-brands.php';
66
-
67
- if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '2.6', '>=' ) ){
68
- require 'classes/class-pwb-api-support.php';
69
- new PWB_API_Support();
70
- require 'classes/admin/class-pwb-coupon.php';
71
- new Admin\PWB_Coupon();
72
- }
73
-
74
- if( is_admin() ){
75
-
76
- require 'classes/admin/class-pwb-system-status.php';
77
- new Admin\PWB_System_Status();
78
- require 'classes/admin/class-pwb-admin-tab.php';
79
- require 'classes/admin/class-pwb-migrate.php';
80
- new Admin\PWB_Migrate();
81
- require 'classes/admin/class-pwb-dummy-data.php';
82
- new Admin\PWB_Dummy_Data();
83
- require 'classes/admin/class-edit-brands-page.php';
84
- new Admin\Edit_Brands_Page();
85
-
86
- if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '3.1.0', '>=' ) ){
87
- require 'classes/class-pwb-importer-support.php';
88
- new PWB_Importer_Support();
89
- require 'classes/class-pwb-exporter-support.php';
90
- new PWB_Exporter_Support();
91
- }
92
-
93
- }else{
94
- include_once 'classes/class-pwb-product-tab.php';
95
- new PWB_Product_Tab();
96
- }
97
-
98
- new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
99
-
100
- }elseif( is_admin() ){
101
-
102
- add_action( 'admin_notices', function() {
103
- $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
104
- printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
105
- });
106
-
107
- }
1
+ <?php
2
+ /**
3
+ * Plugin Name: Perfect WooCommerce Brands
4
+ * Plugin URI: https://wordpress.org/plugins/perfect-woocommerce-brands/
5
+ * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
6
+ * Version: 1.6.3
7
+ * Author: Alberto de Vera Sevilla
8
+ * Author URI: https://profiles.wordpress.org/titodevera/
9
+ * Text Domain: perfect-woocommerce-brands
10
+ * Domain Path: /lang
11
+ * License: GPL3
12
+ * Perfect WooCommerce Brands version 1.6.3, Copyright (C) 2018 Alberto de Vera Sevilla
13
+ * Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
14
+ * it under the terms of the GNU General Public License as published by
15
+ * the Free Software Foundation, either version 3 of the License, or
16
+ * (at your option) any later version.
17
+ *
18
+ * Perfect WooCommerce Brands is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU General Public License for more details.
22
+ * You should have received a copy of the GNU General Public License
23
+ * along with Perfect WooCommerce Brands. If not, see <http://www.gnu.org/licenses/>.
24
+ *
25
+ * WC requires at least: 2.4
26
+ * WC tested up to: 3.3
27
+ */
28
+
29
+ namespace Perfect_Woocommerce_Brands;
30
+
31
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
32
+
33
+ //plugin constants
34
+ define( 'PWB_PLUGIN', plugins_url( '', __FILE__ ) );
35
+ define( 'PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ) );
36
+ define( 'PWB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
37
+ define( 'PWB_PLUGIN_VERSION', '1.6.3' );
38
+ define( 'PWB_WP_VERSION', get_bloginfo( 'version' ) );
39
+ define( 'PWB_WC_VERSION', get_option( 'woocommerce_version' ) );
40
+
41
+ register_activation_hook( __FILE__, function(){
42
+ update_option( 'pwb_activate_on', time() );
43
+ } );
44
+
45
+ //clean brands slug on plugin deactivation
46
+ register_deactivation_hook( __FILE__, function(){
47
+ update_option( 'old_wc_pwb_admin_tab_slug', 'null' );
48
+ } );
49
+
50
+ //loads textdomain for the translations
51
+ add_action( 'plugins_loaded', function(){
52
+ load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
53
+ } );
54
+
55
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
56
+ if( is_plugin_active( 'woocommerce/woocommerce.php' ) ){
57
+
58
+ require 'classes/widgets/class-pwb-dropdown.php';
59
+ require 'classes/widgets/class-pwb-list.php';
60
+ require 'classes/widgets/class-pwb-filter-by-brand.php';
61
+ require 'classes/shortcodes/class-pwb-product-carousel.php';
62
+ require 'classes/shortcodes/class-pwb-carousel.php';
63
+ require 'classes/shortcodes/class-pwb-all-brands.php';
64
+ require 'classes/shortcodes/class-pwb-brand.php';
65
+ require 'classes/class-perfect-woocommerce-brands.php';
66
+
67
+ if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '2.6', '>=' ) ){
68
+ require 'classes/class-pwb-api-support.php';
69
+ new PWB_API_Support();
70
+ require 'classes/admin/class-pwb-coupon.php';
71
+ new Admin\PWB_Coupon();
72
+ }
73
+
74
+ if( is_admin() ){
75
+
76
+ require 'classes/admin/class-pwb-system-status.php';
77
+ new Admin\PWB_System_Status();
78
+ require 'classes/admin/class-pwb-admin-tab.php';
79
+ require 'classes/admin/class-pwb-migrate.php';
80
+ new Admin\PWB_Migrate();
81
+ require 'classes/admin/class-pwb-dummy-data.php';
82
+ new Admin\PWB_Dummy_Data();
83
+ require 'classes/admin/class-edit-brands-page.php';
84
+ new Admin\Edit_Brands_Page();
85
+
86
+ if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '3.1.0', '>=' ) ){
87
+ require 'classes/admin/class-pwb-importer-support.php';
88
+ new PWB_Importer_Support();
89
+ require 'classes/admin/class-pwb-exporter-support.php';
90
+ new PWB_Exporter_Support();
91
+ }
92
+
93
+ }else{
94
+ include_once 'classes/class-pwb-product-tab.php';
95
+ new PWB_Product_Tab();
96
+ }
97
+
98
+ new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
99
+
100
+ }elseif( is_admin() ){
101
+
102
+ add_action( 'admin_notices', function() {
103
+ $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
104
+ printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
105
+ });
106
+
107
+ }
readme.txt CHANGED
@@ -1,164 +1,170 @@
1
- === Perfect WooCommerce Brands ===
2
- Contributors: titodevera
3
- Donate link: mailto:hola@albertodevera.es
4
- Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
- Requires at least: 4.4
6
- Tested up to: 4.9
7
- Stable tag: 1.6.2
8
- License: GPL3
9
- License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
-
11
- Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
12
-
13
- == Description ==
14
- Whether we like to admit it or not, we are all influenced by brands. Brands are a guarantee for quality, they assure product recognition in customers.
15
- Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
16
- With this extension you can add product brands to your WooCommerce site.
17
-
18
- = Requirements =
19
- > * PHP 5.3 or higher (tested on PHP7 too)
20
- > * WordPress 4.4 or higher
21
- > * WooCommerce 2.4.0 or higher
22
- > * Visual Composer (recommended)
23
-
24
- = Features =
25
- > * Very easy to use, 100% free, no ads, no premium version exists
26
- > * Assign brands to products
27
- > * Associate a banner and a link to each brand
28
- > * Translation-ready (English and Spanish included)
29
- > * Visual Composer support
30
- > * Minimalist design and fully responsive
31
- > * Very lightweight
32
- > * Shortcode: Display all brands
33
- > * Shortcode: Display brands carousel
34
- > * Shortcode: Display product carousel by brand
35
- > * Shortcode: Display brands for a specific product
36
- > * Widget: Display brands as dropdown
37
- > * Widget: Display brands as list (brand names or brand logos)
38
- > * Widget: Filter products by brand
39
- > * Customizable brands slug
40
- > * Show the brands in products loop
41
- > * Import brands (migrate) from other brands plugins
42
- > * Dummy data installer (logos by heroturko)
43
- > * WooCommerce REST API support
44
- > * WooCommerce built-in product importer/exporter support (WooCommerce 3.1.0+)
45
- > * Brand tab for single product page
46
- > * Favorite brands
47
- > * And much more!
48
-
49
-
50
- == Installation ==
51
- 1. Upload the plugin to the '/wp-content/plugins/' directory.
52
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
53
-
54
-
55
- == Frequently Asked Questions ==
56
- = Is Perfect WooCommerce Brands free? =
57
- Yes, of course. This plugin is 100% free. No ads, no premium version exists.
58
-
59
- = Where are plugin settings? =
60
- Go to `WooCommerce/Settings/` and click on `Brands` tab
61
-
62
- = How can i use the available shortcodes without Visual Composer? =
63
- [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-can-i-use-the-available-shortcodes-without-Visual-Composer%3F)
64
-
65
- = How to import brands from other brands plugin? =
66
- [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin)
67
-
68
- = REST API docs =
69
- [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/REST-API-docs)
70
-
71
-
72
- == Screenshots ==
73
- 1. Brands carousel
74
- 2. Brands page
75
- 3. Brands taxonomy
76
- 4. Brands shortcodes (with Visual Composer)
77
- 5. Product carousel by brand
78
-
79
-
80
- == Changelog ==
81
- = 1.6.2 =
82
- * Fix: Carousels problems on responsive after the last update
83
- = 1.6.1 =
84
- * Feature: Favorite brands
85
- * Fix: Brand logo full size option for single product
86
- * Fix: Coupons brands restriction (thanks @josk79)
87
- * Fix: Import products fixes
88
- * Fix: PHP7 warning on 'class-perfect-woocommerce-brands.php'
89
- * Fix: Brand not added when Duplicating Product
90
- * Enhancement: Filter by brand widget enhancements
91
- * Enhancement: Carousels enhancements
92
- * Enhancement: JS and CSS minified
93
- = 1.6.0 =
94
- * Feature: Migrate brands from the official WooCommerce Brand's plugin (pull request, thanks Chunkford)
95
- * Feature: Support for the new WooCommerce product importer/exporter
96
- * Feature: Brand tab in single product page
97
- * Enhancement: Brands dropdown widget selects the current brand if is a brand archive page
98
- * Enhancement: Hide the brand name in "Display all brands" shortcode (title_position="none")
99
- * Enhancement: Important enhancements for the REST API
100
- * Fix: The brand property is not recognized by Google
101
- * Fix: No shortcode appeared in some Visual Composer versions
102
- * Fix: Filter by brand widget fixes
103
- * Fix: Brand description adds description twice
104
- * Other minor bug fixes and code improvements
105
- = 1.5.2 =
106
- * Dev: Adding brands to a products via the REST API + updating namespaces to include v2 (pull request, thanks doekenorg)
107
- = 1.5.1 =
108
- * Fix: Fatal error on old php versions (< 5.5)
109
- = 1.5 =
110
- * Feature (Tool): Install dummy data (generate generic brands and assigns them to available products randomly)
111
- * Feature: Restrict coupon by brands
112
- * Feature: Get system status details for a better plugin support
113
- * Feature: Import brands from "Ultimate WooCommerce Brands"
114
- * Dev: 'pwb_before_single_product_brands' and 'pwb_after_single_product_brands' hooks added
115
- * Dev: Basic WordPress REST API support
116
- * Enhancement: Better HTML markup for the brand banner and the brand description for the archive product page
117
- * Enhancement: Brands importer improvements
118
- * Enhancement: New params for "pwb-all-brands" shortcode
119
- * Fix: The brand description is appearing twice
120
- * Fix: Product filter widget does not seems to work in product category page (thanks hassandad)
121
- * Fix: Support for php 5.3 again
122
- * Fix: Removed ES6 code from admin for better browser support
123
- * Other minor bug fixes and code improvements
124
- = 1.4.5 =
125
- * Fix carousel shortcodes bugs
126
- * WooCommerce 2.7 support
127
- = 1.4.4 =
128
- * Important improvement of the user experience when assigning images to a brand
129
- * Feature (Option): Hide brands in single product, show as image or show as link
130
- * Feature: Hide prev/next arrows on carousel shortcodes
131
- * Feature: Hide empty brands option for "Display all brands" shortcode
132
- * Feature: New options for "Display brands as list" widget
133
- * Fix: Autoplay bug on carousel shortcodes
134
- * Tested on PHP7
135
- * Shortcut to the plugin settings added to the plugin list page
136
- * "Help us" notice added
137
- * Minor code improvements
138
- = 1.4.3 =
139
- * Feature (Widget): Filter products by brand
140
- * Feature (Option): Show brand logo in product loop
141
- * Feature: Brand microdata added to product page
142
- * Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
143
- = 1.4.2 =
144
- * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
145
- * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned
146
- = 1.4.1 =
147
- * Feature (Option): Hide brand's description in archive page
148
- * Fix: "pwb-all-brands" and "pwb-brand" show the content before they should
149
- * Clean database on uninstallation
150
- * Minor code improvements and fixes
151
- = 1.4 =
152
- * Feature: Product carousel by brand added
153
- * Minor bug fixes
154
- = 1.3 =
155
- * Feature: If is set, show brand description in brand page
156
- * Feature: Change brands position in single product
157
- = 1.2 =
158
- * Feature: Associate a banner and a link to each brand
159
- * Minor tweaks
160
- * Fully tested on WooCommerce 2.6
161
- = 1.1 =
162
- * Minor bug fixes
163
- = 1.0 =
164
- * Initial release
 
 
 
 
 
 
1
+ === Perfect WooCommerce Brands ===
2
+ Contributors: titodevera
3
+ Donate link: mailto:hola@albertodevera.es
4
+ Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
+ Requires at least: 4.4
6
+ Tested up to: 4.9
7
+ Stable tag: 1.6.3
8
+ License: GPL3
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
+
11
+ Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
12
+
13
+ == Description ==
14
+ Whether we like to admit it or not, we are all influenced by brands. Brands are a guarantee for quality, they assure product recognition in customers.
15
+ Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
16
+ With this extension you can add product brands to your WooCommerce site.
17
+
18
+ = Requirements =
19
+ > * PHP 5.4 or higher (tested on PHP7 too)
20
+ > * WordPress 4.4 or higher
21
+ > * WooCommerce 2.4.0 or higher
22
+ > * Visual Composer (recommended)
23
+
24
+ = Features =
25
+ > * Very easy to use, 100% free, no ads, no premium version exists
26
+ > * Assign brands to products
27
+ > * Associate a banner and a link to each brand
28
+ > * Translation-ready (English and Spanish included)
29
+ > * Visual Composer support
30
+ > * Minimalist design and fully responsive
31
+ > * Very lightweight
32
+ > * Shortcode: Display all brands
33
+ > * Shortcode: Display brands carousel
34
+ > * Shortcode: Display product carousel by brand
35
+ > * Shortcode: Display brands for a specific product
36
+ > * Widget: Display brands as dropdown
37
+ > * Widget: Display brands as list (brand names or brand logos)
38
+ > * Widget: Filter products by brand
39
+ > * Customizable brands slug
40
+ > * Show the brands in products loop
41
+ > * Import brands (migrate) from other brands plugins
42
+ > * Dummy data installer (logos by heroturko)
43
+ > * WooCommerce REST API support
44
+ > * WooCommerce built-in product importer/exporter support (WooCommerce 3.1.0+)
45
+ > * Brand tab for single product page
46
+ > * Favorite brands
47
+ > * And much more!
48
+
49
+
50
+ == Installation ==
51
+ 1. Upload the plugin to the '/wp-content/plugins/' directory.
52
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
53
+
54
+
55
+ == Frequently Asked Questions ==
56
+ = Is Perfect WooCommerce Brands free? =
57
+ Yes, of course. This plugin is 100% free. No ads, no premium version exists.
58
+
59
+ = Where are plugin settings? =
60
+ Go to `WooCommerce/Settings/` and click on `Brands` tab
61
+
62
+ = How can i use the available shortcodes without Visual Composer? =
63
+ [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-can-i-use-the-available-shortcodes-without-Visual-Composer%3F)
64
+
65
+ = How to import brands from other brands plugin? =
66
+ [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin)
67
+
68
+ = REST API docs =
69
+ [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/REST-API-docs)
70
+
71
+
72
+ == Screenshots ==
73
+ 1. Brands carousel
74
+ 2. Brands page
75
+ 3. Brands taxonomy
76
+ 4. Brands shortcodes (with Visual Composer)
77
+ 5. Product carousel by brand
78
+
79
+
80
+ == Changelog ==
81
+ = 1.6.3 =
82
+ * Requirements: No more longer support for very old php versions (5.4 minimum)
83
+ * Fix: Product carousels shortcode display fixes
84
+ * Fix: Missing .pot file
85
+ * Fix: Coupon codes stopped working since latest update
86
+ * Fix: Carousel preloader is not working
87
+ = 1.6.2 =
88
+ * Fix: Carousels problems on responsive after the last update
89
+ = 1.6.1 =
90
+ * Feature: Favorite brands
91
+ * Fix: Brand logo full size option for single product
92
+ * Fix: Coupons brands restriction (thanks @josk79)
93
+ * Fix: Import products fixes
94
+ * Fix: PHP7 warning on 'class-perfect-woocommerce-brands.php'
95
+ * Fix: Brand not added when Duplicating Product
96
+ * Enhancement: Filter by brand widget enhancements
97
+ * Enhancement: Carousels enhancements
98
+ * Enhancement: JS and CSS minified
99
+ = 1.6.0 =
100
+ * Feature: Migrate brands from the official WooCommerce Brand's plugin (pull request, thanks Chunkford)
101
+ * Feature: Support for the new WooCommerce product importer/exporter
102
+ * Feature: Brand tab in single product page
103
+ * Enhancement: Brands dropdown widget selects the current brand if is a brand archive page
104
+ * Enhancement: Hide the brand name in "Display all brands" shortcode (title_position="none")
105
+ * Enhancement: Important enhancements for the REST API
106
+ * Fix: The brand property is not recognized by Google
107
+ * Fix: No shortcode appeared in some Visual Composer versions
108
+ * Fix: Filter by brand widget fixes
109
+ * Fix: Brand description adds description twice
110
+ * Other minor bug fixes and code improvements
111
+ = 1.5.2 =
112
+ * Dev: Adding brands to a products via the REST API + updating namespaces to include v2 (pull request, thanks doekenorg)
113
+ = 1.5.1 =
114
+ * Fix: Fatal error on old php versions (< 5.5)
115
+ = 1.5 =
116
+ * Feature (Tool): Install dummy data (generate generic brands and assigns them to available products randomly)
117
+ * Feature: Restrict coupon by brands
118
+ * Feature: Get system status details for a better plugin support
119
+ * Feature: Import brands from "Ultimate WooCommerce Brands"
120
+ * Dev: 'pwb_before_single_product_brands' and 'pwb_after_single_product_brands' hooks added
121
+ * Dev: Basic WordPress REST API support
122
+ * Enhancement: Better HTML markup for the brand banner and the brand description for the archive product page
123
+ * Enhancement: Brands importer improvements
124
+ * Enhancement: New params for "pwb-all-brands" shortcode
125
+ * Fix: The brand description is appearing twice
126
+ * Fix: Product filter widget does not seems to work in product category page (thanks hassandad)
127
+ * Fix: Support for php 5.3 again
128
+ * Fix: Removed ES6 code from admin for better browser support
129
+ * Other minor bug fixes and code improvements
130
+ = 1.4.5 =
131
+ * Fix carousel shortcodes bugs
132
+ * WooCommerce 2.7 support
133
+ = 1.4.4 =
134
+ * Important improvement of the user experience when assigning images to a brand
135
+ * Feature (Option): Hide brands in single product, show as image or show as link
136
+ * Feature: Hide prev/next arrows on carousel shortcodes
137
+ * Feature: Hide empty brands option for "Display all brands" shortcode
138
+ * Feature: New options for "Display brands as list" widget
139
+ * Fix: Autoplay bug on carousel shortcodes
140
+ * Tested on PHP7
141
+ * Shortcut to the plugin settings added to the plugin list page
142
+ * "Help us" notice added
143
+ * Minor code improvements
144
+ = 1.4.3 =
145
+ * Feature (Widget): Filter products by brand
146
+ * Feature (Option): Show brand logo in product loop
147
+ * Feature: Brand microdata added to product page
148
+ * Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
149
+ = 1.4.2 =
150
+ * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
151
+ * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned
152
+ = 1.4.1 =
153
+ * Feature (Option): Hide brand's description in archive page
154
+ * Fix: "pwb-all-brands" and "pwb-brand" show the content before they should
155
+ * Clean database on uninstallation
156
+ * Minor code improvements and fixes
157
+ = 1.4 =
158
+ * Feature: Product carousel by brand added
159
+ * Minor bug fixes
160
+ = 1.3 =
161
+ * Feature: If is set, show brand description in brand page
162
+ * Feature: Change brands position in single product
163
+ = 1.2 =
164
+ * Feature: Associate a banner and a link to each brand
165
+ * Minor tweaks
166
+ * Fully tested on WooCommerce 2.6
167
+ = 1.1 =
168
+ * Minor bug fixes
169
+ = 1.0 =
170
+ * Initial release
templates/admin/edit-brands-bottom.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * The template for displaying the edit-tags.php table footer
4
- * @version 1.0.0
5
- */
6
-
7
- namespace Perfect_Woocommerce_Brands\Templates;
8
-
9
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
-
11
- extract( $data );
12
- ?>
13
-
14
- <div class="pwb-edit-brands-bottom pwb-clearfix">
15
- <span class="dashicons dashicons-admin-collapse"></span>
16
- <p class="pwb-featured-count">
17
- <span><?php echo $data['featured_count'];?></span> <?php echo $data['text_featured'];?>
18
- </p>
19
- </div>
1
+ <?php
2
+ /**
3
+ * The template for displaying the edit-tags.php table footer
4
+ * @version 1.0.0
5
+ */
6
+
7
+ namespace Perfect_Woocommerce_Brands\Templates;
8
+
9
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
+
11
+ extract( $data );
12
+ ?>
13
+
14
+ <div class="pwb-edit-brands-bottom pwb-clearfix">
15
+ <span class="dashicons dashicons-admin-collapse"></span>
16
+ <p class="pwb-featured-count">
17
+ <span><?php echo $data['featured_count'];?></span> <?php echo $data['text_featured'];?>
18
+ </p>
19
+ </div>
templates/shortcodes/carousel.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- * The template for displaying the carousels
4
- * @version 1.0.0
5
- */
6
-
7
- namespace Perfect_Woocommerce_Brands\Templates;
8
-
9
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
-
11
- extract( $data );
12
- ?>
13
-
14
- <div class="pwb-carousel" data-slick="<?php echo $slick_settings; ?>">
15
-
16
- <?php foreach( $brands as $brand ): ?>
17
- <div class="pwb-slick-slide">
18
- <a href="<?php echo $brand['link'];?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' ); ?>">
19
- <?php echo $brand['attachment_html'];?>
20
- </a>
21
- </div>
22
- <?php endforeach; ?>
23
-
24
- <div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
25
-
26
- </div>
1
+ <?php
2
+ /**
3
+ * The template for displaying the carousels
4
+ * @version 1.0.0
5
+ */
6
+
7
+ namespace Perfect_Woocommerce_Brands\Templates;
8
+
9
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
+
11
+ extract( $data );
12
+ ?>
13
+
14
+ <div class="pwb-carousel" data-slick="<?php echo $slick_settings; ?>">
15
+
16
+ <?php foreach( $brands as $brand ): ?>
17
+ <div class="pwb-slick-slide">
18
+ <a href="<?php echo $brand['link'];?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' ); ?>">
19
+ <?php echo $brand['attachment_html'];?>
20
+ </a>
21
+ </div>
22
+ <?php endforeach; ?>
23
+
24
+ <div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
25
+
26
+ </div>
templates/shortcodes/product-carousel.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
- /**
3
- * The template for displaying the product carousels
4
- * @version 1.0.0
5
- */
6
-
7
- namespace Perfect_Woocommerce_Brands\Templates;
8
-
9
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
-
11
- extract( $data );
12
- ?>
13
-
14
- <?php if( !empty( $products ) ): ?>
15
-
16
- <div class="pwb-product-carousel" data-slick="<?php echo $slick_settings; ?>">
17
-
18
- <?php foreach( $products as $product ): ?>
19
- <div class="pwb-slick-slide">
20
- <a href="<?php echo $product['permalink']; ?>">
21
- <?php echo $product['thumbnail']; ?>
22
- <h3><?php echo $product['title']; ?></h3>
23
- <?php echo do_shortcode('[add_to_cart id="'.$product['id'].'" style=""]'); ?>
24
- </a>
25
- </div>
26
- <?php endforeach; ?>
27
-
28
- <div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
29
-
30
- </div>
31
-
32
- <?php else: ?>
33
-
34
- <div><?php _e('Nothing found');?></div>
35
-
36
- <?php endif; ?>
1
+ <?php
2
+ /**
3
+ * The template for displaying the product carousels
4
+ * @version 1.0.0
5
+ */
6
+
7
+ namespace Perfect_Woocommerce_Brands\Templates;
8
+
9
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
+
11
+ extract( $data );
12
+ ?>
13
+
14
+ <?php if( !empty( $products ) ): ?>
15
+
16
+ <div class="pwb-product-carousel" data-slick="<?php echo $slick_settings; ?>">
17
+
18
+ <?php foreach( $products as $product ): ?>
19
+ <div class="pwb-slick-slide">
20
+ <a href="<?php echo $product['permalink']; ?>">
21
+ <?php echo $product['thumbnail']; ?>
22
+ <h3><?php echo $product['title']; ?></h3>
23
+ <?php echo do_shortcode('[add_to_cart id="'.$product['id'].'" style=""]'); ?>
24
+ </a>
25
+ </div>
26
+ <?php endforeach; ?>
27
+
28
+ <div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
29
+
30
+ </div>
31
+
32
+ <?php else: ?>
33
+
34
+ <div><?php _e('Nothing found');?></div>
35
+
36
+ <?php endif; ?>
templates/widgets/filter-by-brand.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * The template for displaying filter by brand widget
4
- * @version 1.0.0
5
- */
6
-
7
- namespace Perfect_Woocommerce_Brands\Templates;
8
-
9
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
-
11
- extract( $data );
12
- ?>
13
-
14
- <div class="pwb-filter-products" data-cat-url="<?php echo $cate_url;?>">
15
- <ul>
16
- <?php foreach( $brands as $brand ): ?>
17
- <li>
18
- <label>
19
- <input type="checkbox" data-brand="<?php echo $brand->term_id;?>" value="<?php echo $brand->slug;?>"><?php echo $brand->name; ?>
20
- </label>
21
- </li>
22
- <?php endforeach; ?>
23
- </ul>
24
- <button><?php _e('Apply filter','perfect-woocommerce-brands') ?></button>
25
- </div>
1
+ <?php
2
+ /**
3
+ * The template for displaying filter by brand widget
4
+ * @version 1.0.0
5
+ */
6
+
7
+ namespace Perfect_Woocommerce_Brands\Templates;
8
+
9
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
10
+
11
+ extract( $data );
12
+ ?>
13
+
14
+ <div class="pwb-filter-products" data-cat-url="<?php echo $cate_url;?>">
15
+ <ul>
16
+ <?php foreach( $brands as $brand ): ?>
17
+ <li>
18
+ <label>
19
+ <input type="checkbox" data-brand="<?php echo $brand->term_id;?>" value="<?php echo $brand->slug;?>"><?php echo $brand->name; ?>
20
+ </label>
21
+ </li>
22
+ <?php endforeach; ?>
23
+ </ul>
24
+ <button><?php _e('Apply filter','perfect-woocommerce-brands') ?></button>
25
+ </div>
uninstall.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- delete_option('wc_pwb_admin_tab_section_title');
7
- delete_option('wc_pwb_admin_tab_slug');
8
- delete_option('wc_pwb_admin_tab_brand_logo_size');
9
- delete_option('wc_pwb_admin_tab_brand_single_position');
10
- delete_option('wc_pwb_admin_tab_brand_single_product_tab');
11
- delete_option('wc_pwb_admin_tab_brand_desc');
12
- delete_option('wc_pwb_admin_tab_section_end');
13
- delete_option('wc_pwb_notice_plugin_review');
14
-
15
- //update permalinks and clean cache
16
- flush_rewrite_rules();
17
- wp_cache_flush();
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ delete_option('wc_pwb_admin_tab_section_title');
7
+ delete_option('wc_pwb_admin_tab_slug');
8
+ delete_option('wc_pwb_admin_tab_brand_logo_size');
9
+ delete_option('wc_pwb_admin_tab_brand_single_position');
10
+ delete_option('wc_pwb_admin_tab_brand_single_product_tab');
11
+ delete_option('wc_pwb_admin_tab_brand_desc');
12
+ delete_option('wc_pwb_admin_tab_section_end');
13
+ delete_option('wc_pwb_notice_plugin_review');
14
+
15
+ //update permalinks and clean cache
16
+ flush_rewrite_rules();
17
+ wp_cache_flush();