Version Description
- Fix: Breadcrumbs issues
- Fix: Ajax search plugins conflict since previous release
- Feature: New position option "in meta" for brands in the single product page
- Feature: New param "only_parents" for "pwb-az-listing"
- Enhancement: Sections for brands settings tab in admin
- Enhancement: "[pwb-az-listing]" transient for better performance in large sites
Download this release
Release Info
Developer | quadlayers |
Plugin | Perfect Brands for WooCommerce |
Version | 1.7.9 |
Comparing to | |
See all releases |
Code changes from version 1.7.8 to 1.7.9
- assets/css/styles-admin.css +220 -220
- assets/css/styles-frontend.css +353 -350
- assets/css/styles-frontend.min.css +1 -1
- assets/js/functions-admin.js +347 -347
- assets/js/functions-frontend.js +157 -157
- assets/lib/slick/config.rb +9 -9
- assets/lib/slick/fonts/slick.svg +14 -14
- assets/lib/slick/slick-theme.css +204 -204
- assets/lib/slick/slick-theme.less +168 -168
- assets/lib/slick/slick-theme.scss +194 -194
- assets/lib/slick/slick.css +119 -119
- assets/lib/slick/slick.js +3004 -3004
- assets/lib/slick/slick.less +100 -100
- assets/lib/slick/slick.min.js +1 -1
- assets/lib/slick/slick.scss +100 -100
- classes/admin/class-brands-custom-fields.php +176 -176
- classes/admin/class-brands-exporter.php +128 -128
- classes/admin/class-edit-brands-page.php +143 -143
- classes/admin/class-pwb-admin-tab.php +288 -240
- classes/admin/class-pwb-coupon.php +77 -77
- classes/admin/class-pwb-dummy-data.php +94 -94
- classes/admin/class-pwb-exporter-support.php +40 -40
- classes/admin/class-pwb-importer-support.php +53 -53
- classes/admin/class-pwb-migrate.php +124 -124
- classes/admin/class-pwb-system-status.php +61 -61
- classes/class-perfect-woocommerce-brands.php +982 -940
- classes/class-pwb-api-support.php +140 -140
- classes/class-pwb-product-tab.php +66 -66
- classes/class-pwb-term.php +39 -39
- classes/shortcodes/class-pwb-all-brands.php +170 -170
- classes/shortcodes/class-pwb-az-listing.php +80 -62
- classes/shortcodes/class-pwb-brand.php +33 -33
- classes/shortcodes/class-pwb-carousel.php +74 -74
- classes/shortcodes/class-pwb-product-carousel.php +98 -98
- classes/widgets/class-pwb-dropdown.php +93 -93
- classes/widgets/class-pwb-filter-by-brand.php +200 -200
- classes/widgets/class-pwb-list.php +129 -129
- lang/perfect-woocommerce-brands-ca.po +718 -718
- lang/perfect-woocommerce-brands-es_ES.mo +0 -0
- lang/perfect-woocommerce-brands-es_ES.po +0 -718
- lang/perfect-woocommerce-brands.pot +686 -686
- main.php +107 -107
- readme.txt +148 -186
- templates/admin/brands-exporter.php +15 -15
- templates/admin/edit-brands-bottom.php +15 -15
- templates/shortcodes/az-listing.php +53 -57
- templates/shortcodes/brand.php +34 -34
- templates/shortcodes/carousel.php +22 -22
- templates/shortcodes/product-carousel.php +32 -32
- templates/widgets/dropdown.php +19 -19
- templates/widgets/filter-by-brand.php +23 -23
- templates/widgets/list-logo.php +28 -28
- templates/widgets/list.php +22 -22
- uninstall.php +20 -20
assets/css/styles-admin.css
CHANGED
@@ -1,220 +1,220 @@
|
|
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 |
-
#wp-pwb-brand-description-field-wrap, #brand-description-help-text{
|
48 |
-
width: 95%;
|
49 |
-
}
|
50 |
-
.taxonomy-pwb-brand .term-description-wrap{
|
51 |
-
display: none!important;
|
52 |
-
}
|
53 |
-
.taxonomy-pwb-brand #col-right.pwb-force-full-width .pwb-edit-brands-bottom > span{
|
54 |
-
-ms-transform: rotate(180deg);
|
55 |
-
-webkit-transform: rotate(180deg);
|
56 |
-
transform: rotate(180deg);
|
57 |
-
}
|
58 |
-
.taxonomy-pwb-brand table.wp-list-table .column-featured{
|
59 |
-
width: 48px;
|
60 |
-
}
|
61 |
-
.taxonomy-pwb-brand .pwb-edit-brands-bottom{
|
62 |
-
margin-top: 20px;
|
63 |
-
margin-bottom: 20px;
|
64 |
-
background-color: #f6f6f6;
|
65 |
-
border-top: 1px solid #e4e4e4;
|
66 |
-
padding: 10px;
|
67 |
-
}
|
68 |
-
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span:hover{
|
69 |
-
cursor: pointer;
|
70 |
-
}
|
71 |
-
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
|
72 |
-
float: left;
|
73 |
-
}
|
74 |
-
.taxonomy-pwb-brand .pwb-featured-count{
|
75 |
-
font-style: italic;
|
76 |
-
float: right;
|
77 |
-
margin-left: 12px;
|
78 |
-
margin-top: 0;
|
79 |
-
margin-bottom: 0;
|
80 |
-
}
|
81 |
-
.taxonomy-pwb-brand table.wp-list-table .column-featured .dashicons-star-empty:hover:before{
|
82 |
-
content: "\f155";
|
83 |
-
}
|
84 |
-
.taxonomy-pwb-brand table .column-featured > span:hover{
|
85 |
-
cursor: pointer;
|
86 |
-
}
|
87 |
-
@media screen and (max-width: 782px) {
|
88 |
-
.taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
|
89 |
-
display: none;
|
90 |
-
}
|
91 |
-
.taxonomy-pwb-brand .wp-list-table td.column-logo:before {
|
92 |
-
content: ""!important;
|
93 |
-
}
|
94 |
-
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
|
95 |
-
display: none;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
@media screen and (min-width: 782px) {
|
99 |
-
.taxonomy-pwb-brand #col-right.pwb-force-full-width{
|
100 |
-
width: 100%!important;
|
101 |
-
}
|
102 |
-
.taxonomy-pwb-brand #col-left.pwb-force-full-width{
|
103 |
-
width: 0!important;
|
104 |
-
display: none!important;
|
105 |
-
}
|
106 |
-
.taxonomy-pwb-brand table.wp-list-table .column-featured,
|
107 |
-
.taxonomy-pwb-brand .wp-list-table .column-logo{
|
108 |
-
text-align: center;
|
109 |
-
}
|
110 |
-
.taxonomy-pwb-brand .pwb-featured-col-title{
|
111 |
-
display: none;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
.pwb-brands-exporter{
|
115 |
-
margin-top: 20px;
|
116 |
-
padding-top: 20px;
|
117 |
-
border-top: 1px solid #ddd;
|
118 |
-
text-align: right;
|
119 |
-
}
|
120 |
-
.pwb-brands-exporter p{
|
121 |
-
font-style: italic;
|
122 |
-
}
|
123 |
-
.taxonomy-pwb-brand .wp-list-table .column-logo{
|
124 |
-
width: 52px;
|
125 |
-
white-space: nowrap;
|
126 |
-
}
|
127 |
-
/* ----------------------- /Taxonomy pwb-brand ----------------------- */
|
128 |
-
|
129 |
-
/* ----------------------- Settings page ----------------------- */
|
130 |
-
#wc_pwb_admin_status_result{
|
131 |
-
display: none;
|
132 |
-
background-color: #f6f6f6;
|
133 |
-
padding: 14px;
|
134 |
-
}
|
135 |
-
#wc_pwb_admin_tab_tools_system_status{
|
136 |
-
display: none!important;
|
137 |
-
}
|
138 |
-
select.pwb-admin-tab-field, input[type="text"].pwb-admin-tab-field{
|
139 |
-
min-width:350px;
|
140 |
-
display:block;
|
141 |
-
height:auto;
|
142 |
-
}
|
143 |
-
/* ----------------------- /Settings page ----------------------- */
|
144 |
-
|
145 |
-
table.wp-list-table .column-taxonomy-pwb-brand{
|
146 |
-
width: 11%!important;
|
147 |
-
}
|
148 |
-
.pwb-display-as-logo{
|
149 |
-
display: none;
|
150 |
-
}
|
151 |
-
.pwb-display-as-logo.show{
|
152 |
-
display: block;
|
153 |
-
}
|
154 |
-
.pwb-notice-dismissible p a{
|
155 |
-
margin-right: 12px;
|
156 |
-
}
|
157 |
-
.pwb-notice-dismissible .dashicons-heart{
|
158 |
-
color: #f188ff;
|
159 |
-
margin-left: 3px;
|
160 |
-
}
|
161 |
-
.pwb-modal{
|
162 |
-
position: fixed;
|
163 |
-
top: 0;
|
164 |
-
right: 0;
|
165 |
-
bottom: 0;
|
166 |
-
left: 0;
|
167 |
-
z-index: 99999999999;
|
168 |
-
line-height: 1;
|
169 |
-
background: rgba(0,0,0,0.9);
|
170 |
-
font-size: 2em;
|
171 |
-
padding-top: 20px;
|
172 |
-
text-align: center;
|
173 |
-
}
|
174 |
-
.pwb-modal-inner {
|
175 |
-
max-width: 70%;
|
176 |
-
margin: 0 auto;
|
177 |
-
animation: pwbblinkkf 3s linear infinite;
|
178 |
-
color: #fff;
|
179 |
-
}
|
180 |
-
.pwb-modal-inner p{
|
181 |
-
font-size: 2em;
|
182 |
-
}
|
183 |
-
@keyframes pwbblinkkf {
|
184 |
-
50% { opacity: 0; }
|
185 |
-
}
|
186 |
-
@keyframes PWBLoadingOverlay {
|
187 |
-
to {transform: rotate(360deg);}
|
188 |
-
}
|
189 |
-
.pwb-loading-overlay{
|
190 |
-
position: relative;
|
191 |
-
}
|
192 |
-
.pwb-loading-overlay::after{
|
193 |
-
content: "";
|
194 |
-
position: absolute;
|
195 |
-
top: 0;
|
196 |
-
right: 0;
|
197 |
-
bottom: 0;
|
198 |
-
left: 0;
|
199 |
-
background-color: rgba( 255, 255, 255, .7 );
|
200 |
-
z-index: 1;
|
201 |
-
}
|
202 |
-
.pwb-loading-overlay::before{
|
203 |
-
content: "";
|
204 |
-
position: absolute;
|
205 |
-
box-sizing: border-box;
|
206 |
-
top: 50%;
|
207 |
-
left: 50%;
|
208 |
-
width: 15px;
|
209 |
-
height: 15px;
|
210 |
-
margin-top: -7.5px;
|
211 |
-
margin-left: -7.5px;
|
212 |
-
border-radius: 50%;
|
213 |
-
border-top: 2px solid #000;
|
214 |
-
border-right: 2px solid transparent;
|
215 |
-
animation: PWBLoadingOverlay .6s linear infinite;
|
216 |
-
z-index: 1;
|
217 |
-
}
|
218 |
-
input.pwb-brands-import-file{
|
219 |
-
display: none!important;
|
220 |
-
}
|
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 |
+
#wp-pwb-brand-description-field-wrap, #brand-description-help-text{
|
48 |
+
width: 95%;
|
49 |
+
}
|
50 |
+
.taxonomy-pwb-brand .term-description-wrap{
|
51 |
+
display: none!important;
|
52 |
+
}
|
53 |
+
.taxonomy-pwb-brand #col-right.pwb-force-full-width .pwb-edit-brands-bottom > span{
|
54 |
+
-ms-transform: rotate(180deg);
|
55 |
+
-webkit-transform: rotate(180deg);
|
56 |
+
transform: rotate(180deg);
|
57 |
+
}
|
58 |
+
.taxonomy-pwb-brand table.wp-list-table .column-featured{
|
59 |
+
width: 48px;
|
60 |
+
}
|
61 |
+
.taxonomy-pwb-brand .pwb-edit-brands-bottom{
|
62 |
+
margin-top: 20px;
|
63 |
+
margin-bottom: 20px;
|
64 |
+
background-color: #f6f6f6;
|
65 |
+
border-top: 1px solid #e4e4e4;
|
66 |
+
padding: 10px;
|
67 |
+
}
|
68 |
+
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span:hover{
|
69 |
+
cursor: pointer;
|
70 |
+
}
|
71 |
+
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
|
72 |
+
float: left;
|
73 |
+
}
|
74 |
+
.taxonomy-pwb-brand .pwb-featured-count{
|
75 |
+
font-style: italic;
|
76 |
+
float: right;
|
77 |
+
margin-left: 12px;
|
78 |
+
margin-top: 0;
|
79 |
+
margin-bottom: 0;
|
80 |
+
}
|
81 |
+
.taxonomy-pwb-brand table.wp-list-table .column-featured .dashicons-star-empty:hover:before{
|
82 |
+
content: "\f155";
|
83 |
+
}
|
84 |
+
.taxonomy-pwb-brand table .column-featured > span:hover{
|
85 |
+
cursor: pointer;
|
86 |
+
}
|
87 |
+
@media screen and (max-width: 782px) {
|
88 |
+
.taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
|
89 |
+
display: none;
|
90 |
+
}
|
91 |
+
.taxonomy-pwb-brand .wp-list-table td.column-logo:before {
|
92 |
+
content: ""!important;
|
93 |
+
}
|
94 |
+
.taxonomy-pwb-brand .pwb-edit-brands-bottom > span{
|
95 |
+
display: none;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
@media screen and (min-width: 782px) {
|
99 |
+
.taxonomy-pwb-brand #col-right.pwb-force-full-width{
|
100 |
+
width: 100%!important;
|
101 |
+
}
|
102 |
+
.taxonomy-pwb-brand #col-left.pwb-force-full-width{
|
103 |
+
width: 0!important;
|
104 |
+
display: none!important;
|
105 |
+
}
|
106 |
+
.taxonomy-pwb-brand table.wp-list-table .column-featured,
|
107 |
+
.taxonomy-pwb-brand .wp-list-table .column-logo{
|
108 |
+
text-align: center;
|
109 |
+
}
|
110 |
+
.taxonomy-pwb-brand .pwb-featured-col-title{
|
111 |
+
display: none;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
.pwb-brands-exporter{
|
115 |
+
margin-top: 20px;
|
116 |
+
padding-top: 20px;
|
117 |
+
border-top: 1px solid #ddd;
|
118 |
+
text-align: right;
|
119 |
+
}
|
120 |
+
.pwb-brands-exporter p{
|
121 |
+
font-style: italic;
|
122 |
+
}
|
123 |
+
.taxonomy-pwb-brand .wp-list-table .column-logo{
|
124 |
+
width: 52px;
|
125 |
+
white-space: nowrap;
|
126 |
+
}
|
127 |
+
/* ----------------------- /Taxonomy pwb-brand ----------------------- */
|
128 |
+
|
129 |
+
/* ----------------------- Settings page ----------------------- */
|
130 |
+
#wc_pwb_admin_status_result{
|
131 |
+
display: none;
|
132 |
+
background-color: #f6f6f6;
|
133 |
+
padding: 14px;
|
134 |
+
}
|
135 |
+
#wc_pwb_admin_tab_tools_system_status{
|
136 |
+
display: none!important;
|
137 |
+
}
|
138 |
+
select.pwb-admin-tab-field, input[type="text"].pwb-admin-tab-field{
|
139 |
+
min-width:350px;
|
140 |
+
display:block;
|
141 |
+
height:auto;
|
142 |
+
}
|
143 |
+
/* ----------------------- /Settings page ----------------------- */
|
144 |
+
|
145 |
+
table.wp-list-table .column-taxonomy-pwb-brand{
|
146 |
+
width: 11%!important;
|
147 |
+
}
|
148 |
+
.pwb-display-as-logo{
|
149 |
+
display: none;
|
150 |
+
}
|
151 |
+
.pwb-display-as-logo.show{
|
152 |
+
display: block;
|
153 |
+
}
|
154 |
+
.pwb-notice-dismissible p a{
|
155 |
+
margin-right: 12px;
|
156 |
+
}
|
157 |
+
.pwb-notice-dismissible .dashicons-heart{
|
158 |
+
color: #f188ff;
|
159 |
+
margin-left: 3px;
|
160 |
+
}
|
161 |
+
.pwb-modal{
|
162 |
+
position: fixed;
|
163 |
+
top: 0;
|
164 |
+
right: 0;
|
165 |
+
bottom: 0;
|
166 |
+
left: 0;
|
167 |
+
z-index: 99999999999;
|
168 |
+
line-height: 1;
|
169 |
+
background: rgba(0,0,0,0.9);
|
170 |
+
font-size: 2em;
|
171 |
+
padding-top: 20px;
|
172 |
+
text-align: center;
|
173 |
+
}
|
174 |
+
.pwb-modal-inner {
|
175 |
+
max-width: 70%;
|
176 |
+
margin: 0 auto;
|
177 |
+
animation: pwbblinkkf 3s linear infinite;
|
178 |
+
color: #fff;
|
179 |
+
}
|
180 |
+
.pwb-modal-inner p{
|
181 |
+
font-size: 2em;
|
182 |
+
}
|
183 |
+
@keyframes pwbblinkkf {
|
184 |
+
50% { opacity: 0; }
|
185 |
+
}
|
186 |
+
@keyframes PWBLoadingOverlay {
|
187 |
+
to {transform: rotate(360deg);}
|
188 |
+
}
|
189 |
+
.pwb-loading-overlay{
|
190 |
+
position: relative;
|
191 |
+
}
|
192 |
+
.pwb-loading-overlay::after{
|
193 |
+
content: "";
|
194 |
+
position: absolute;
|
195 |
+
top: 0;
|
196 |
+
right: 0;
|
197 |
+
bottom: 0;
|
198 |
+
left: 0;
|
199 |
+
background-color: rgba( 255, 255, 255, .7 );
|
200 |
+
z-index: 1;
|
201 |
+
}
|
202 |
+
.pwb-loading-overlay::before{
|
203 |
+
content: "";
|
204 |
+
position: absolute;
|
205 |
+
box-sizing: border-box;
|
206 |
+
top: 50%;
|
207 |
+
left: 50%;
|
208 |
+
width: 15px;
|
209 |
+
height: 15px;
|
210 |
+
margin-top: -7.5px;
|
211 |
+
margin-left: -7.5px;
|
212 |
+
border-radius: 50%;
|
213 |
+
border-top: 2px solid #000;
|
214 |
+
border-right: 2px solid transparent;
|
215 |
+
animation: PWBLoadingOverlay .6s linear infinite;
|
216 |
+
z-index: 1;
|
217 |
+
}
|
218 |
+
input.pwb-brands-import-file{
|
219 |
+
display: none!important;
|
220 |
+
}
|
assets/css/styles-frontend.css
CHANGED
@@ -1,350 +1,353 @@
|
|
1 |
-
/* ----------------------- Global ----------------------- */
|
2 |
-
.pwb-clearfix:after{
|
3 |
-
content: "";
|
4 |
-
display: table;
|
5 |
-
clear: both;
|
6 |
-
}
|
7 |
-
.pwb-before-loop{
|
8 |
-
margin-bottom: 1em;
|
9 |
-
}
|
10 |
-
.pwb-after-loop{
|
11 |
-
margin-top: 1em;
|
12 |
-
}
|
13 |
-
/* ----------------------- /Global ----------------------- */
|
14 |
-
|
15 |
-
/* ----------------------- Carousels ----------------------- */
|
16 |
-
.pwb-carousel .pwb-slick-slide a{
|
17 |
-
display: block;
|
18 |
-
}
|
19 |
-
.pwb-carousel .pwb-slick-slide a > img{
|
20 |
-
margin: 0 auto;
|
21 |
-
}
|
22 |
-
.pwb-carousel .pwb-slick-slide, .pwb-product-carousel .pwb-slick-slide{
|
23 |
-
margin: 0 10px;
|
24 |
-
}
|
25 |
-
.pwb-carousel .slick-prev, .pwb-carousel .slick-next,
|
26 |
-
.pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
|
27 |
-
font-size: 0;
|
28 |
-
position: absolute;
|
29 |
-
top: 0;
|
30 |
-
bottom: 0;
|
31 |
-
display: block;
|
32 |
-
cursor: pointer;
|
33 |
-
font-size: 22px;
|
34 |
-
width: 30px;
|
35 |
-
overflow: hidden;
|
36 |
-
text-align: center;
|
37 |
-
color: #aeaeae;
|
38 |
-
border: none;
|
39 |
-
outline: none;
|
40 |
-
z-index: 999;
|
41 |
-
background: #eee;
|
42 |
-
opacity: 0;
|
43 |
-
transition: opacity 0.3s ease-in-out;
|
44 |
-
-webkit-transition: opacity 0.3s ease-in-out;
|
45 |
-
-moz-transition: opacity 0.3s ease-in-out;
|
46 |
-
-o-transition: opacity 0.3s ease-in-out;
|
47 |
-
}
|
48 |
-
.pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
|
49 |
-
.pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
|
50 |
-
display: inline-block;
|
51 |
-
height: 20px;
|
52 |
-
width: 20px;
|
53 |
-
padding: 10px;
|
54 |
-
position: absolute;
|
55 |
-
top: 50%;
|
56 |
-
margin-top: -20px;
|
57 |
-
left: 0;
|
58 |
-
right: 0;
|
59 |
-
}
|
60 |
-
.pwb-carousel .slick-prev:hover,
|
61 |
-
.pwb-carousel .slick-prev:focus,
|
62 |
-
.pwb-carousel .slick-next:hover,
|
63 |
-
.pwb-carousel .slick-next:focus,
|
64 |
-
.pwb-product-carousel .slick-prev:hover,
|
65 |
-
.pwb-product-carousel .slick-prev:focus,
|
66 |
-
.pwb-product-carousel .slick-next:hover,
|
67 |
-
.pwb-product-carousel .slick-next:focus{
|
68 |
-
outline: none;
|
69 |
-
}
|
70 |
-
.pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
|
71 |
-
left: 0;
|
72 |
-
}
|
73 |
-
.pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
|
74 |
-
right: 0;
|
75 |
-
}
|
76 |
-
.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
|
77 |
-
.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
|
78 |
-
opacity: 0.8;
|
79 |
-
}
|
80 |
-
.pwb-product-carousel .pwb-amount{
|
81 |
-
display: block;
|
82 |
-
width: 100%;
|
83 |
-
margin-bottom: 12px;
|
84 |
-
}
|
85 |
-
/* ------ Preloader ------ */
|
86 |
-
.pwb-carousel, .pwb-product-carousel{
|
87 |
-
min-height: 30px;
|
88 |
-
}
|
89 |
-
.pwb-carousel .pwb-slick-slide,
|
90 |
-
.pwb-product-carousel .pwb-slick-slide{
|
91 |
-
display: none;
|
92 |
-
}
|
93 |
-
.pwb-carousel.slick-initialized .pwb-slick-slide,
|
94 |
-
.pwb-product-carousel.slick-initialized .pwb-slick-slide{
|
95 |
-
display: block;
|
96 |
-
}
|
97 |
-
.pwb-carousel .slick-list,
|
98 |
-
.pwb-product-carousel .slick-list {
|
99 |
-
opacity: 0;
|
100 |
-
position: absolute;
|
101 |
-
}
|
102 |
-
.pwb-carousel.slick-initialized,
|
103 |
-
.pwb-product-carousel.slick-initialized {
|
104 |
-
min-height: none;
|
105 |
-
}
|
106 |
-
.pwb-carousel.slick-initialized .slick-list,
|
107 |
-
.pwb-product-carousel.slick-initialized .slick-list {
|
108 |
-
opacity: 1;
|
109 |
-
position: relative;
|
110 |
-
transition: opacity 0.2s ease-in;
|
111 |
-
}
|
112 |
-
.pwb-carousel.slick-initialized .pwb-carousel-loader,
|
113 |
-
.pwb-product-carousel.slick-initialized .pwb-carousel-loader {
|
114 |
-
display: none!important;
|
115 |
-
opacity: 0!important;
|
116 |
-
}
|
117 |
-
.pwb-carousel-loader{
|
118 |
-
font-size: 10px;
|
119 |
-
margin: 50px auto;
|
120 |
-
text-indent: -9999em;
|
121 |
-
width: 30px;
|
122 |
-
height: 30px;
|
123 |
-
border-radius: 50%;
|
124 |
-
background: #525252;
|
125 |
-
background: -moz-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
126 |
-
background: -webkit-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
127 |
-
background: -o-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
128 |
-
background: -ms-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
129 |
-
background: linear-gradient(to right, #525252 10%, rgba(82,82,82, 0) 42%);
|
130 |
-
position: relative;
|
131 |
-
-webkit-animation: PWBCarouselLoader 1.4s infinite linear;
|
132 |
-
animation: PWBCarouselLoader 1.4s infinite linear;
|
133 |
-
-webkit-transform: translateZ(0);
|
134 |
-
-ms-transform: translateZ(0);
|
135 |
-
transform: translateZ(0);
|
136 |
-
}
|
137 |
-
.pwb-carousel-loader:before {
|
138 |
-
width: 50%;
|
139 |
-
height: 50%;
|
140 |
-
background: #525252;
|
141 |
-
border-radius: 100% 0 0 0;
|
142 |
-
position: absolute;
|
143 |
-
top: 0;
|
144 |
-
left: 0;
|
145 |
-
content: '';
|
146 |
-
}
|
147 |
-
.pwb-carousel-loader:after {
|
148 |
-
background: #ffffff;
|
149 |
-
width: 75%;
|
150 |
-
height: 75%;
|
151 |
-
border-radius: 50%;
|
152 |
-
content: '';
|
153 |
-
margin: auto;
|
154 |
-
position: absolute;
|
155 |
-
top: 0;
|
156 |
-
left: 0;
|
157 |
-
bottom: 0;
|
158 |
-
right: 0;
|
159 |
-
}
|
160 |
-
@-webkit-keyframes PWBCarouselLoader {
|
161 |
-
0% {
|
162 |
-
-webkit-transform: rotate(0deg);
|
163 |
-
transform: rotate(0deg);
|
164 |
-
}
|
165 |
-
100% {
|
166 |
-
-webkit-transform: rotate(360deg);
|
167 |
-
transform: rotate(360deg);
|
168 |
-
}
|
169 |
-
}
|
170 |
-
@keyframes PWBCarouselLoader {
|
171 |
-
0% {
|
172 |
-
-webkit-transform: rotate(0deg);
|
173 |
-
transform: rotate(0deg);
|
174 |
-
}
|
175 |
-
100% {
|
176 |
-
-webkit-transform: rotate(360deg);
|
177 |
-
transform: rotate(360deg);
|
178 |
-
}
|
179 |
-
}
|
180 |
-
/* ------ /Preloader ------ */
|
181 |
-
|
182 |
-
/* ----------------------- /Carousels ----------------------- */
|
183 |
-
|
184 |
-
/* ----------------------- PWB All Brands ----------------------- */
|
185 |
-
.pwb-brands-cols-outer{
|
186 |
-
margin-left: -15px;
|
187 |
-
margin-right: -15px;
|
188 |
-
}
|
189 |
-
.pwb-all-brands .pwb-pagination-wrapper{
|
190 |
-
margin-top: 20px;
|
191 |
-
padding-top: 10px;
|
192 |
-
border-top: 1px solid #ededed;
|
193 |
-
text-align: right;
|
194 |
-
}
|
195 |
-
.pwb-all-brands .pwb-pagination{
|
196 |
-
display: inline-block;
|
197 |
-
margin-right: 10px;
|
198 |
-
background-color: #ededed;
|
199 |
-
color: #333;
|
200 |
-
text-align: center;
|
201 |
-
padding: 10px;
|
202 |
-
}
|
203 |
-
.pwb-all-brands .pwb-brands-cols-outer:after{
|
204 |
-
content: "";
|
205 |
-
display: table;
|
206 |
-
clear: both;
|
207 |
-
}
|
208 |
-
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
|
209 |
-
padding: 0 15px;
|
210 |
-
width: 20%;
|
211 |
-
float: left;
|
212 |
-
}
|
213 |
-
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
|
214 |
-
height: 25px;
|
215 |
-
overflow: hidden;
|
216 |
-
font-size: 14px;
|
217 |
-
}
|
218 |
-
/* ----------------------- /PWB All Brands ----------------------- */
|
219 |
-
|
220 |
-
/* ----------------------- PWB AZ Listing ----------------------- */
|
221 |
-
.pwb-az-listing-row{
|
222 |
-
margin-bottom: 20px;
|
223 |
-
}
|
224 |
-
.pwb-az-listing-row-in{
|
225 |
-
margin-left: -5px;
|
226 |
-
margin-right: -5px;
|
227 |
-
}
|
228 |
-
.pwb-az-listing-col{
|
229 |
-
padding: 5px;
|
230 |
-
}
|
231 |
-
.pwb-az-listing-col > a{
|
232 |
-
display: block;
|
233 |
-
text-transform: uppercase;
|
234 |
-
white-space:nowrap;
|
235 |
-
overflow:hidden;
|
236 |
-
}
|
237 |
-
.pwb-az-listing-title{
|
238 |
-
border-bottom: 1px solid #ddd;
|
239 |
-
font-weight: bold;
|
240 |
-
font-size: 115%;
|
241 |
-
text-transform: uppercase;
|
242 |
-
}
|
243 |
-
.pwb-az-listing-header{
|
244 |
-
margin-bottom: 30px;
|
245 |
-
}
|
246 |
-
.pwb-az-listing-header ul{
|
247 |
-
margin: 0;
|
248 |
-
padding: 0;
|
249 |
-
list-style: none;
|
250 |
-
margin-right: -2px;
|
251 |
-
margin-left: -2px;
|
252 |
-
}
|
253 |
-
.pwb-az-listing-header li{
|
254 |
-
display: inline-block;
|
255 |
-
float: left;
|
256 |
-
width: 25px;
|
257 |
-
height: 25px;
|
258 |
-
margin: 2px;
|
259 |
-
line-height: 25px;
|
260 |
-
border: 1px solid #ddd;
|
261 |
-
text-align: center;
|
262 |
-
}
|
263 |
-
.pwb-az-listing-header a{
|
264 |
-
text-transform: uppercase;
|
265 |
-
}
|
266 |
-
/* ----------------------- /PWB AZ Listing ----------------------- */
|
267 |
-
|
268 |
-
/* ----------------------- Filter products widget ----------------------- */
|
269 |
-
.pwb-filter-products input[type="checkbox"]{
|
270 |
-
margin-right: 10px;
|
271 |
-
}
|
272 |
-
.pwb-filter-products li{
|
273 |
-
margin-bottom: 5px;
|
274 |
-
}
|
275 |
-
/* ----------------------- /Filter products widget ----------------------- */
|
276 |
-
|
277 |
-
/* ----------------------- Columns ----------------------- */
|
278 |
-
.pwb-row:after{
|
279 |
-
content: "";
|
280 |
-
display: table;
|
281 |
-
clear: both;
|
282 |
-
}
|
283 |
-
.pwb-columns-2{
|
284 |
-
width: 50%;
|
285 |
-
}
|
286 |
-
.pwb-columns-3{
|
287 |
-
width: 33.33333%;
|
288 |
-
}
|
289 |
-
.pwb-columns-4{
|
290 |
-
width: 25%;
|
291 |
-
}
|
292 |
-
.pwb-columns-5{
|
293 |
-
width: 20%;
|
294 |
-
}
|
295 |
-
.pwb-columns-6{
|
296 |
-
width: 16.66666%;
|
297 |
-
}
|
298 |
-
.pwb-columns{
|
299 |
-
float: left;
|
300 |
-
}
|
301 |
-
/* ----------------------- /Columns ----------------------- */
|
302 |
-
|
303 |
-
/* ----------------------- Single product ----------------------- */
|
304 |
-
.pwb-single-product-brands{
|
305 |
-
padding-top: 1em;
|
306 |
-
}
|
307 |
-
.pwb-
|
308 |
-
|
309 |
-
}
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
.pwb-
|
323 |
-
width:
|
324 |
-
}
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
}
|
334 |
-
.pwb-
|
335 |
-
|
336 |
-
}
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
|
|
|
|
|
1 |
+
/* ----------------------- Global ----------------------- */
|
2 |
+
.pwb-clearfix:after{
|
3 |
+
content: "";
|
4 |
+
display: table;
|
5 |
+
clear: both;
|
6 |
+
}
|
7 |
+
.pwb-before-loop{
|
8 |
+
margin-bottom: 1em;
|
9 |
+
}
|
10 |
+
.pwb-after-loop{
|
11 |
+
margin-top: 1em;
|
12 |
+
}
|
13 |
+
/* ----------------------- /Global ----------------------- */
|
14 |
+
|
15 |
+
/* ----------------------- Carousels ----------------------- */
|
16 |
+
.pwb-carousel .pwb-slick-slide a{
|
17 |
+
display: block;
|
18 |
+
}
|
19 |
+
.pwb-carousel .pwb-slick-slide a > img{
|
20 |
+
margin: 0 auto;
|
21 |
+
}
|
22 |
+
.pwb-carousel .pwb-slick-slide, .pwb-product-carousel .pwb-slick-slide{
|
23 |
+
margin: 0 10px;
|
24 |
+
}
|
25 |
+
.pwb-carousel .slick-prev, .pwb-carousel .slick-next,
|
26 |
+
.pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
|
27 |
+
font-size: 0;
|
28 |
+
position: absolute;
|
29 |
+
top: 0;
|
30 |
+
bottom: 0;
|
31 |
+
display: block;
|
32 |
+
cursor: pointer;
|
33 |
+
font-size: 22px;
|
34 |
+
width: 30px;
|
35 |
+
overflow: hidden;
|
36 |
+
text-align: center;
|
37 |
+
color: #aeaeae;
|
38 |
+
border: none;
|
39 |
+
outline: none;
|
40 |
+
z-index: 999;
|
41 |
+
background: #eee;
|
42 |
+
opacity: 0;
|
43 |
+
transition: opacity 0.3s ease-in-out;
|
44 |
+
-webkit-transition: opacity 0.3s ease-in-out;
|
45 |
+
-moz-transition: opacity 0.3s ease-in-out;
|
46 |
+
-o-transition: opacity 0.3s ease-in-out;
|
47 |
+
}
|
48 |
+
.pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
|
49 |
+
.pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
|
50 |
+
display: inline-block;
|
51 |
+
height: 20px;
|
52 |
+
width: 20px;
|
53 |
+
padding: 10px;
|
54 |
+
position: absolute;
|
55 |
+
top: 50%;
|
56 |
+
margin-top: -20px;
|
57 |
+
left: 0;
|
58 |
+
right: 0;
|
59 |
+
}
|
60 |
+
.pwb-carousel .slick-prev:hover,
|
61 |
+
.pwb-carousel .slick-prev:focus,
|
62 |
+
.pwb-carousel .slick-next:hover,
|
63 |
+
.pwb-carousel .slick-next:focus,
|
64 |
+
.pwb-product-carousel .slick-prev:hover,
|
65 |
+
.pwb-product-carousel .slick-prev:focus,
|
66 |
+
.pwb-product-carousel .slick-next:hover,
|
67 |
+
.pwb-product-carousel .slick-next:focus{
|
68 |
+
outline: none;
|
69 |
+
}
|
70 |
+
.pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
|
71 |
+
left: 0;
|
72 |
+
}
|
73 |
+
.pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
|
74 |
+
right: 0;
|
75 |
+
}
|
76 |
+
.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
|
77 |
+
.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
|
78 |
+
opacity: 0.8;
|
79 |
+
}
|
80 |
+
.pwb-product-carousel .pwb-amount{
|
81 |
+
display: block;
|
82 |
+
width: 100%;
|
83 |
+
margin-bottom: 12px;
|
84 |
+
}
|
85 |
+
/* ------ Preloader ------ */
|
86 |
+
.pwb-carousel, .pwb-product-carousel{
|
87 |
+
min-height: 30px;
|
88 |
+
}
|
89 |
+
.pwb-carousel .pwb-slick-slide,
|
90 |
+
.pwb-product-carousel .pwb-slick-slide{
|
91 |
+
display: none;
|
92 |
+
}
|
93 |
+
.pwb-carousel.slick-initialized .pwb-slick-slide,
|
94 |
+
.pwb-product-carousel.slick-initialized .pwb-slick-slide{
|
95 |
+
display: block;
|
96 |
+
}
|
97 |
+
.pwb-carousel .slick-list,
|
98 |
+
.pwb-product-carousel .slick-list {
|
99 |
+
opacity: 0;
|
100 |
+
position: absolute;
|
101 |
+
}
|
102 |
+
.pwb-carousel.slick-initialized,
|
103 |
+
.pwb-product-carousel.slick-initialized {
|
104 |
+
min-height: none;
|
105 |
+
}
|
106 |
+
.pwb-carousel.slick-initialized .slick-list,
|
107 |
+
.pwb-product-carousel.slick-initialized .slick-list {
|
108 |
+
opacity: 1;
|
109 |
+
position: relative;
|
110 |
+
transition: opacity 0.2s ease-in;
|
111 |
+
}
|
112 |
+
.pwb-carousel.slick-initialized .pwb-carousel-loader,
|
113 |
+
.pwb-product-carousel.slick-initialized .pwb-carousel-loader {
|
114 |
+
display: none!important;
|
115 |
+
opacity: 0!important;
|
116 |
+
}
|
117 |
+
.pwb-carousel-loader{
|
118 |
+
font-size: 10px;
|
119 |
+
margin: 50px auto;
|
120 |
+
text-indent: -9999em;
|
121 |
+
width: 30px;
|
122 |
+
height: 30px;
|
123 |
+
border-radius: 50%;
|
124 |
+
background: #525252;
|
125 |
+
background: -moz-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
126 |
+
background: -webkit-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
127 |
+
background: -o-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
128 |
+
background: -ms-linear-gradient(left, #525252 10%, rgba(82,82,82, 0) 42%);
|
129 |
+
background: linear-gradient(to right, #525252 10%, rgba(82,82,82, 0) 42%);
|
130 |
+
position: relative;
|
131 |
+
-webkit-animation: PWBCarouselLoader 1.4s infinite linear;
|
132 |
+
animation: PWBCarouselLoader 1.4s infinite linear;
|
133 |
+
-webkit-transform: translateZ(0);
|
134 |
+
-ms-transform: translateZ(0);
|
135 |
+
transform: translateZ(0);
|
136 |
+
}
|
137 |
+
.pwb-carousel-loader:before {
|
138 |
+
width: 50%;
|
139 |
+
height: 50%;
|
140 |
+
background: #525252;
|
141 |
+
border-radius: 100% 0 0 0;
|
142 |
+
position: absolute;
|
143 |
+
top: 0;
|
144 |
+
left: 0;
|
145 |
+
content: '';
|
146 |
+
}
|
147 |
+
.pwb-carousel-loader:after {
|
148 |
+
background: #ffffff;
|
149 |
+
width: 75%;
|
150 |
+
height: 75%;
|
151 |
+
border-radius: 50%;
|
152 |
+
content: '';
|
153 |
+
margin: auto;
|
154 |
+
position: absolute;
|
155 |
+
top: 0;
|
156 |
+
left: 0;
|
157 |
+
bottom: 0;
|
158 |
+
right: 0;
|
159 |
+
}
|
160 |
+
@-webkit-keyframes PWBCarouselLoader {
|
161 |
+
0% {
|
162 |
+
-webkit-transform: rotate(0deg);
|
163 |
+
transform: rotate(0deg);
|
164 |
+
}
|
165 |
+
100% {
|
166 |
+
-webkit-transform: rotate(360deg);
|
167 |
+
transform: rotate(360deg);
|
168 |
+
}
|
169 |
+
}
|
170 |
+
@keyframes PWBCarouselLoader {
|
171 |
+
0% {
|
172 |
+
-webkit-transform: rotate(0deg);
|
173 |
+
transform: rotate(0deg);
|
174 |
+
}
|
175 |
+
100% {
|
176 |
+
-webkit-transform: rotate(360deg);
|
177 |
+
transform: rotate(360deg);
|
178 |
+
}
|
179 |
+
}
|
180 |
+
/* ------ /Preloader ------ */
|
181 |
+
|
182 |
+
/* ----------------------- /Carousels ----------------------- */
|
183 |
+
|
184 |
+
/* ----------------------- PWB All Brands ----------------------- */
|
185 |
+
.pwb-brands-cols-outer{
|
186 |
+
margin-left: -15px;
|
187 |
+
margin-right: -15px;
|
188 |
+
}
|
189 |
+
.pwb-all-brands .pwb-pagination-wrapper{
|
190 |
+
margin-top: 20px;
|
191 |
+
padding-top: 10px;
|
192 |
+
border-top: 1px solid #ededed;
|
193 |
+
text-align: right;
|
194 |
+
}
|
195 |
+
.pwb-all-brands .pwb-pagination{
|
196 |
+
display: inline-block;
|
197 |
+
margin-right: 10px;
|
198 |
+
background-color: #ededed;
|
199 |
+
color: #333;
|
200 |
+
text-align: center;
|
201 |
+
padding: 10px;
|
202 |
+
}
|
203 |
+
.pwb-all-brands .pwb-brands-cols-outer:after{
|
204 |
+
content: "";
|
205 |
+
display: table;
|
206 |
+
clear: both;
|
207 |
+
}
|
208 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
|
209 |
+
padding: 0 15px;
|
210 |
+
width: 20%;
|
211 |
+
float: left;
|
212 |
+
}
|
213 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
|
214 |
+
height: 25px;
|
215 |
+
overflow: hidden;
|
216 |
+
font-size: 14px;
|
217 |
+
}
|
218 |
+
/* ----------------------- /PWB All Brands ----------------------- */
|
219 |
+
|
220 |
+
/* ----------------------- PWB AZ Listing ----------------------- */
|
221 |
+
.pwb-az-listing-row{
|
222 |
+
margin-bottom: 20px;
|
223 |
+
}
|
224 |
+
.pwb-az-listing-row-in{
|
225 |
+
margin-left: -5px;
|
226 |
+
margin-right: -5px;
|
227 |
+
}
|
228 |
+
.pwb-az-listing-col{
|
229 |
+
padding: 5px;
|
230 |
+
}
|
231 |
+
.pwb-az-listing-col > a{
|
232 |
+
display: block;
|
233 |
+
text-transform: uppercase;
|
234 |
+
white-space:nowrap;
|
235 |
+
overflow:hidden;
|
236 |
+
}
|
237 |
+
.pwb-az-listing-title{
|
238 |
+
border-bottom: 1px solid #ddd;
|
239 |
+
font-weight: bold;
|
240 |
+
font-size: 115%;
|
241 |
+
text-transform: uppercase;
|
242 |
+
}
|
243 |
+
.pwb-az-listing-header{
|
244 |
+
margin-bottom: 30px;
|
245 |
+
}
|
246 |
+
.pwb-az-listing-header ul{
|
247 |
+
margin: 0;
|
248 |
+
padding: 0;
|
249 |
+
list-style: none;
|
250 |
+
margin-right: -2px;
|
251 |
+
margin-left: -2px;
|
252 |
+
}
|
253 |
+
.pwb-az-listing-header li{
|
254 |
+
display: inline-block;
|
255 |
+
float: left;
|
256 |
+
width: 25px;
|
257 |
+
height: 25px;
|
258 |
+
margin: 2px;
|
259 |
+
line-height: 25px;
|
260 |
+
border: 1px solid #ddd;
|
261 |
+
text-align: center;
|
262 |
+
}
|
263 |
+
.pwb-az-listing-header a{
|
264 |
+
text-transform: uppercase;
|
265 |
+
}
|
266 |
+
/* ----------------------- /PWB AZ Listing ----------------------- */
|
267 |
+
|
268 |
+
/* ----------------------- Filter products widget ----------------------- */
|
269 |
+
.pwb-filter-products input[type="checkbox"]{
|
270 |
+
margin-right: 10px;
|
271 |
+
}
|
272 |
+
.pwb-filter-products li{
|
273 |
+
margin-bottom: 5px;
|
274 |
+
}
|
275 |
+
/* ----------------------- /Filter products widget ----------------------- */
|
276 |
+
|
277 |
+
/* ----------------------- Columns ----------------------- */
|
278 |
+
.pwb-row:after{
|
279 |
+
content: "";
|
280 |
+
display: table;
|
281 |
+
clear: both;
|
282 |
+
}
|
283 |
+
.pwb-columns-2{
|
284 |
+
width: 50%;
|
285 |
+
}
|
286 |
+
.pwb-columns-3{
|
287 |
+
width: 33.33333%;
|
288 |
+
}
|
289 |
+
.pwb-columns-4{
|
290 |
+
width: 25%;
|
291 |
+
}
|
292 |
+
.pwb-columns-5{
|
293 |
+
width: 20%;
|
294 |
+
}
|
295 |
+
.pwb-columns-6{
|
296 |
+
width: 16.66666%;
|
297 |
+
}
|
298 |
+
.pwb-columns{
|
299 |
+
float: left;
|
300 |
+
}
|
301 |
+
/* ----------------------- /Columns ----------------------- */
|
302 |
+
|
303 |
+
/* ----------------------- Single product ----------------------- */
|
304 |
+
.pwb-single-product-brands{
|
305 |
+
padding-top: 1em;
|
306 |
+
}
|
307 |
+
.product_meta .pwb-single-product-brands{
|
308 |
+
padding-top: 0;
|
309 |
+
}
|
310 |
+
.pwb-text-before-brands-links{
|
311 |
+
margin-right: 4px;
|
312 |
+
}
|
313 |
+
/* ----------------------- /Single product ----------------------- */
|
314 |
+
|
315 |
+
/* ----------------------- Responsive ----------------------- */
|
316 |
+
@media screen and (max-width: 1000px) {
|
317 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
|
318 |
+
width: 25%;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
@media screen and (max-width: 700px) {
|
322 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
|
323 |
+
width: 50%;
|
324 |
+
}
|
325 |
+
.pwb-columns-5, .pwb-columns-6{
|
326 |
+
width: 25%;
|
327 |
+
}
|
328 |
+
}
|
329 |
+
@media screen and (max-width: 480px) {
|
330 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
|
331 |
+
width: 100%;
|
332 |
+
float: none;
|
333 |
+
}
|
334 |
+
.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
|
335 |
+
height: auto;
|
336 |
+
}
|
337 |
+
.pwb-columns-3, .pwb-columns-4, .pwb-columns-5, .pwb-columns-6{
|
338 |
+
width: 50%;
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
@media (min-width: 576px) {
|
343 |
+
.pwb-az-listing-col{
|
344 |
+
width: 50%;
|
345 |
+
float: left;
|
346 |
+
}
|
347 |
+
}
|
348 |
+
@media (min-width: 992px) {
|
349 |
+
.pwb-az-listing-col{
|
350 |
+
width: 25%;
|
351 |
+
}
|
352 |
+
}
|
353 |
+
/* ----------------------- /Responsive ----------------------- */
|
assets/css/styles-frontend.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.pwb-clearfix:after{content:"";display:table;clear:both}.pwb-before-loop{margin-bottom:1em}.pwb-after-loop{margin-top:1em}.pwb-carousel .pwb-slick-slide a{display:block}.pwb-carousel .pwb-slick-slide a>img{margin:0 auto}.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 .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{display:none}.pwb-carousel.slick-initialized .pwb-slick-slide,.pwb-product-carousel.slick-initialized .pwb-slick-slide{display:block}.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-az-listing-row{margin-bottom:20px}.pwb-az-listing-row-in{margin-left:-5px;margin-right:-5px}.pwb-az-listing-col{padding:5px}.pwb-az-listing-col>a{display:block;text-transform:uppercase;white-space:nowrap;overflow:hidden}.pwb-az-listing-title{border-bottom:1px solid #ddd;font-weight:bold;font-size:115%;text-transform:uppercase}.pwb-az-listing-header{margin-bottom:30px}.pwb-az-listing-header ul{margin:0;padding:0;list-style:none;margin-right:-2px;margin-left:-2px}.pwb-az-listing-header li{display:inline-block;float:left;width:25px;height:25px;margin:2px;line-height:25px;border:1px solid #ddd;text-align:center}.pwb-az-listing-header a{text-transform:uppercase}.pwb-filter-products input[type="checkbox"]{margin-right:10px}.pwb-filter-products li{margin-bottom:5px}.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-5{width:20%}.pwb-columns-6{width:16.66666%}.pwb-columns{float:left}.pwb-single-product-brands{padding-top:1em}.pwb-text-before-brands-links{margin-right:
|
1 |
+
.pwb-clearfix:after{content:"";display:table;clear:both}.pwb-before-loop{margin-bottom:1em}.pwb-after-loop{margin-top:1em}.pwb-carousel .pwb-slick-slide a{display:block}.pwb-carousel .pwb-slick-slide a>img{margin:0 auto}.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 .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{display:none}.pwb-carousel.slick-initialized .pwb-slick-slide,.pwb-product-carousel.slick-initialized .pwb-slick-slide{display:block}.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-az-listing-row{margin-bottom:20px}.pwb-az-listing-row-in{margin-left:-5px;margin-right:-5px}.pwb-az-listing-col{padding:5px}.pwb-az-listing-col>a{display:block;text-transform:uppercase;white-space:nowrap;overflow:hidden}.pwb-az-listing-title{border-bottom:1px solid #ddd;font-weight:bold;font-size:115%;text-transform:uppercase}.pwb-az-listing-header{margin-bottom:30px}.pwb-az-listing-header ul{margin:0;padding:0;list-style:none;margin-right:-2px;margin-left:-2px}.pwb-az-listing-header li{display:inline-block;float:left;width:25px;height:25px;margin:2px;line-height:25px;border:1px solid #ddd;text-align:center}.pwb-az-listing-header a{text-transform:uppercase}.pwb-filter-products input[type="checkbox"]{margin-right:10px}.pwb-filter-products li{margin-bottom:5px}.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-5{width:20%}.pwb-columns-6{width:16.66666%}.pwb-columns{float:left}.pwb-single-product-brands{padding-top:1em}.product_meta .pwb-single-product-brands{padding-top:0}.pwb-text-before-brands-links{margin-right:4px}@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%}.pwb-columns-5,.pwb-columns-6{width:25%}}@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,.pwb-columns-5,.pwb-columns-6{width:50%}}@media(min-width:576px){.pwb-az-listing-col{width:50%;float:left}}@media(min-width:992px){.pwb-az-listing-col{width:25%}}
|
assets/js/functions-admin.js
CHANGED
@@ -1,347 +1,347 @@
|
|
1 |
-
jQuery( function ( $ ) {
|
2 |
-
|
3 |
-
var media_uploader = null;
|
4 |
-
|
5 |
-
function open_media_uploader_image( event, imageSelectorButton ){
|
6 |
-
|
7 |
-
var $imageSelectorScope = imageSelectorButton.parent();
|
8 |
-
|
9 |
-
media_uploader = wp.media({
|
10 |
-
frame: "post",
|
11 |
-
state: "insert",
|
12 |
-
multiple: false
|
13 |
-
});
|
14 |
-
|
15 |
-
media_uploader.on("insert", function(){
|
16 |
-
var json = media_uploader.state().get("selection").first().toJSON();
|
17 |
-
var image_id = json.id;
|
18 |
-
var image_url = json.url;
|
19 |
-
var image_html = '<img src="'+image_url+'" width="90" height="90">';
|
20 |
-
|
21 |
-
var current_selector = '';
|
22 |
-
switch (event.target.id) {
|
23 |
-
case 'pwb_brand_image_select':
|
24 |
-
current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
|
25 |
-
break;
|
26 |
-
case 'pwb_brand_banner_select':
|
27 |
-
current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
|
28 |
-
break;
|
29 |
-
}
|
30 |
-
|
31 |
-
$(current_selector).val(image_id);
|
32 |
-
$(current_selector+'_result').remove();
|
33 |
-
|
34 |
-
if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
|
35 |
-
$('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
|
36 |
-
}else{
|
37 |
-
$imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
|
38 |
-
}
|
39 |
-
add_delete_link( $imageSelectorScope );
|
40 |
-
|
41 |
-
});
|
42 |
-
|
43 |
-
media_uploader.open();
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
$('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
|
48 |
-
open_media_uploader_image( event, $(this) );
|
49 |
-
});
|
50 |
-
|
51 |
-
//bind remove image event for edit page
|
52 |
-
$('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
|
53 |
-
add_delete_link( $(this).parent() );
|
54 |
-
});
|
55 |
-
|
56 |
-
//clear custom fields when brand is added
|
57 |
-
if( $('body').hasClass('edit-tags-php') && $('body').hasClass('taxonomy-pwb-brand') ){
|
58 |
-
jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
|
59 |
-
//Check ajax action of request that succeeded
|
60 |
-
if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
|
61 |
-
$('#pwb_brand_image').val('');
|
62 |
-
$('#pwb_brand_banner').val('');
|
63 |
-
$('.pwb_brand_image_selected').remove();
|
64 |
-
}
|
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(pwb_ajax_object_admin.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="'+pwb_ajax_object_admin.site_url+'/wp-admin/images/loading.gif">');
|
116 |
-
var data = { 'action': 'pwb_admin_save_screen_settings', 'new_val': $(this).is(':checked') };
|
117 |
-
$.post(pwb_ajax_object_admin.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 |
-
if( $('.pwb-admin-selectwoo').length ){
|
130 |
-
$('.pwb-admin-selectwoo').selectWoo();
|
131 |
-
}
|
132 |
-
|
133 |
-
// migrate brands
|
134 |
-
$('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
|
135 |
-
|
136 |
-
if( $(this).val() != '-' ){
|
137 |
-
|
138 |
-
if( confirm(pwb_ajax_object_admin.translations.migrate_notice) ){
|
139 |
-
|
140 |
-
$('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
|
141 |
-
$('.pwb-modal-inner').html('<p>'+pwb_ajax_object_admin.translations.migrating+'</p>');
|
142 |
-
|
143 |
-
var data = {
|
144 |
-
'action': 'pwb_admin_migrate_brands',
|
145 |
-
'from': $(this).val()
|
146 |
-
};
|
147 |
-
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
148 |
-
|
149 |
-
setTimeout( function(){
|
150 |
-
location.href = pwb_ajax_object_admin.brands_url;
|
151 |
-
}, 1000 );
|
152 |
-
|
153 |
-
});
|
154 |
-
|
155 |
-
}else{
|
156 |
-
|
157 |
-
}
|
158 |
-
|
159 |
-
}
|
160 |
-
|
161 |
-
$(this).val('-');//reset to default value
|
162 |
-
|
163 |
-
} );
|
164 |
-
|
165 |
-
// dummy data
|
166 |
-
$('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
|
167 |
-
|
168 |
-
if( $(this).val() != '-' ){
|
169 |
-
|
170 |
-
if( confirm(pwb_ajax_object_admin.translations.dummy_data_notice) ){
|
171 |
-
|
172 |
-
$('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
|
173 |
-
$('.pwb-modal-inner').html('<p>'+pwb_ajax_object_admin.translations.dummy_data+'</p>');
|
174 |
-
|
175 |
-
var data = {
|
176 |
-
'action': 'pwb_admin_dummy_data',
|
177 |
-
'from': $(this).val()
|
178 |
-
};
|
179 |
-
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
180 |
-
|
181 |
-
setTimeout( function(){
|
182 |
-
location.href = pwb_ajax_object_admin.brands_url;
|
183 |
-
}, 1000 );
|
184 |
-
|
185 |
-
});
|
186 |
-
|
187 |
-
}else{
|
188 |
-
|
189 |
-
}
|
190 |
-
|
191 |
-
}
|
192 |
-
|
193 |
-
$(this).val('-');//reset to default value
|
194 |
-
|
195 |
-
} );
|
196 |
-
|
197 |
-
var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
|
198 |
-
$systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
|
199 |
-
$('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
|
200 |
-
e.preventDefault();
|
201 |
-
if( !$('#wc_pwb_admin_status_result').length ){
|
202 |
-
$systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
|
203 |
-
$('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
|
204 |
-
jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
|
205 |
-
e.preventDefault();
|
206 |
-
var refNode = $( this )[0];
|
207 |
-
if ( $.browser.msie ) {
|
208 |
-
var range = document.body.createTextRange();
|
209 |
-
range.moveToElementText( refNode );
|
210 |
-
range.select();
|
211 |
-
} else if ( $.browser.mozilla || $.browser.opera ) {
|
212 |
-
var selection = window.getSelection();
|
213 |
-
var range = document.createRange();
|
214 |
-
range.selectNodeContents( refNode );
|
215 |
-
selection.removeAllRanges();
|
216 |
-
selection.addRange( range );
|
217 |
-
} else if ( $.browser.safari ) {
|
218 |
-
var selection = window.getSelection();
|
219 |
-
selection.setBaseAndExtent( refNode, 0, refNode, 1 );
|
220 |
-
}
|
221 |
-
} );
|
222 |
-
}
|
223 |
-
$('#wc_pwb_admin_status_result').html('<img src="'+pwb_ajax_object_admin.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
|
224 |
-
$('#wc_pwb_admin_status_result').show();
|
225 |
-
var data = {
|
226 |
-
'action': 'pwb_system_status'
|
227 |
-
};
|
228 |
-
jQuery.post(ajaxurl, data, function(response) {
|
229 |
-
$('#wc_pwb_admin_status_result').html(response);
|
230 |
-
$('#wc_pwb_admin_status_result').trigger('click');
|
231 |
-
});
|
232 |
-
|
233 |
-
} );
|
234 |
-
|
235 |
-
/* ····························· /Settings tab ····························· */
|
236 |
-
|
237 |
-
/* ····························· Admin notices ····························· */
|
238 |
-
$( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
|
239 |
-
|
240 |
-
e.preventDefault();
|
241 |
-
|
242 |
-
var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
|
243 |
-
|
244 |
-
var data = {
|
245 |
-
'action': 'dismiss_pwb_notice',
|
246 |
-
'notice_name': noticeName
|
247 |
-
};
|
248 |
-
jQuery.post(ajaxurl, data, function(response) {
|
249 |
-
//callback
|
250 |
-
});
|
251 |
-
|
252 |
-
} );
|
253 |
-
/* ····························· /Admin notices ····························· */
|
254 |
-
|
255 |
-
/* ····························· Widgets ····························· */
|
256 |
-
pwbBindEventsToWigets();
|
257 |
-
//Fires when a widget is added to a sidebar
|
258 |
-
jQuery(document).bind('widget-added',function(e, widget){
|
259 |
-
pwbBindEventsToWigets( widget );
|
260 |
-
});
|
261 |
-
//Fires on widget save
|
262 |
-
jQuery(document).on('widget-updated', function(e, widget){
|
263 |
-
pwbBindEventsToWigets( widget );
|
264 |
-
});
|
265 |
-
function pwbBindEventsToWigets( widget ){
|
266 |
-
$currentWidget = $(".pwb-select-display-as");
|
267 |
-
if( widget != undefined ){
|
268 |
-
$currentWidget = $(".pwb-select-display-as", widget);
|
269 |
-
}
|
270 |
-
$currentWidget.on("change",function(){
|
271 |
-
if( $(this).val()=="brand_logo" ){
|
272 |
-
$(this).parent().siblings(".pwb-display-as-logo").addClass("show");
|
273 |
-
}else{
|
274 |
-
$(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
|
275 |
-
}
|
276 |
-
});
|
277 |
-
}
|
278 |
-
/* ····························· /Widgets ····························· */
|
279 |
-
|
280 |
-
/* ····························· Brands exporter ····························· */
|
281 |
-
$('button.pwb-brands-export').on('click', function(e){
|
282 |
-
e.preventDefault();
|
283 |
-
|
284 |
-
var $clickedBtn = $(this);
|
285 |
-
$clickedBtn.addClass('pwb-loading-overlay');
|
286 |
-
$clickedBtn.prop("disabled",true);
|
287 |
-
|
288 |
-
var data = { 'action': 'pwb_brands_export' };
|
289 |
-
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
290 |
-
|
291 |
-
if( response.success ){
|
292 |
-
$clickedBtn.removeClass('pwb-loading-overlay');
|
293 |
-
$clickedBtn.prop("disabled",false);
|
294 |
-
|
295 |
-
//descarga el archivo json de exportación
|
296 |
-
$('#pwb-download-export-file').remove();
|
297 |
-
var link = document.createElement("a");
|
298 |
-
link.download = 'brands.json';
|
299 |
-
link.id = 'pwb-download-export-file';
|
300 |
-
link.href = response.data.export_file_url;
|
301 |
-
$('body').append( link );
|
302 |
-
link.click();
|
303 |
-
}
|
304 |
-
|
305 |
-
});
|
306 |
-
|
307 |
-
});
|
308 |
-
|
309 |
-
$('button.pwb-brands-import').on('click', function(e){
|
310 |
-
e.preventDefault();
|
311 |
-
$('input.pwb-brands-import-file').trigger('click');
|
312 |
-
});
|
313 |
-
$('input.pwb-brands-import-file').on('change', function(e){
|
314 |
-
e.preventDefault();
|
315 |
-
|
316 |
-
var $clickedBtn = $('button.pwb-brands-import');
|
317 |
-
$clickedBtn.addClass('pwb-loading-overlay');
|
318 |
-
$clickedBtn.prop("disabled",true);
|
319 |
-
|
320 |
-
var file = $(this)[0].files[0];
|
321 |
-
|
322 |
-
var reqData = new FormData();
|
323 |
-
reqData.append('action', 'pwb_brands_import');
|
324 |
-
reqData.append('file', file);
|
325 |
-
|
326 |
-
$.ajax({
|
327 |
-
url: pwb_ajax_object_admin.ajax_url,
|
328 |
-
type: 'post',
|
329 |
-
cache: false,
|
330 |
-
dataType: 'json',
|
331 |
-
contentType: false,
|
332 |
-
processData: false,
|
333 |
-
data: reqData,
|
334 |
-
success: function( resp ){
|
335 |
-
if( resp.success ){
|
336 |
-
$clickedBtn.removeClass('pwb-loading-overlay');
|
337 |
-
location.reload();
|
338 |
-
}else{
|
339 |
-
alert('Importer error');
|
340 |
-
}
|
341 |
-
}
|
342 |
-
});
|
343 |
-
|
344 |
-
})
|
345 |
-
/* ····························· /Brands exporter ····························· */
|
346 |
-
|
347 |
-
});
|
1 |
+
jQuery( function ( $ ) {
|
2 |
+
|
3 |
+
var media_uploader = null;
|
4 |
+
|
5 |
+
function open_media_uploader_image( event, imageSelectorButton ){
|
6 |
+
|
7 |
+
var $imageSelectorScope = imageSelectorButton.parent();
|
8 |
+
|
9 |
+
media_uploader = wp.media({
|
10 |
+
frame: "post",
|
11 |
+
state: "insert",
|
12 |
+
multiple: false
|
13 |
+
});
|
14 |
+
|
15 |
+
media_uploader.on("insert", function(){
|
16 |
+
var json = media_uploader.state().get("selection").first().toJSON();
|
17 |
+
var image_id = json.id;
|
18 |
+
var image_url = json.url;
|
19 |
+
var image_html = '<img src="'+image_url+'" width="90" height="90">';
|
20 |
+
|
21 |
+
var current_selector = '';
|
22 |
+
switch (event.target.id) {
|
23 |
+
case 'pwb_brand_image_select':
|
24 |
+
current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
|
25 |
+
break;
|
26 |
+
case 'pwb_brand_banner_select':
|
27 |
+
current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
|
28 |
+
break;
|
29 |
+
}
|
30 |
+
|
31 |
+
$(current_selector).val(image_id);
|
32 |
+
$(current_selector+'_result').remove();
|
33 |
+
|
34 |
+
if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
|
35 |
+
$('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
|
36 |
+
}else{
|
37 |
+
$imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
|
38 |
+
}
|
39 |
+
add_delete_link( $imageSelectorScope );
|
40 |
+
|
41 |
+
});
|
42 |
+
|
43 |
+
media_uploader.open();
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
$('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
|
48 |
+
open_media_uploader_image( event, $(this) );
|
49 |
+
});
|
50 |
+
|
51 |
+
//bind remove image event for edit page
|
52 |
+
$('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
|
53 |
+
add_delete_link( $(this).parent() );
|
54 |
+
});
|
55 |
+
|
56 |
+
//clear custom fields when brand is added
|
57 |
+
if( $('body').hasClass('edit-tags-php') && $('body').hasClass('taxonomy-pwb-brand') ){
|
58 |
+
jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
|
59 |
+
//Check ajax action of request that succeeded
|
60 |
+
if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
|
61 |
+
$('#pwb_brand_image').val('');
|
62 |
+
$('#pwb_brand_banner').val('');
|
63 |
+
$('.pwb_brand_image_selected').remove();
|
64 |
+
}
|
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(pwb_ajax_object_admin.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="'+pwb_ajax_object_admin.site_url+'/wp-admin/images/loading.gif">');
|
116 |
+
var data = { 'action': 'pwb_admin_save_screen_settings', 'new_val': $(this).is(':checked') };
|
117 |
+
$.post(pwb_ajax_object_admin.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 |
+
if( $('.pwb-admin-selectwoo').length ){
|
130 |
+
$('.pwb-admin-selectwoo').selectWoo();
|
131 |
+
}
|
132 |
+
|
133 |
+
// migrate brands
|
134 |
+
$('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
|
135 |
+
|
136 |
+
if( $(this).val() != '-' ){
|
137 |
+
|
138 |
+
if( confirm(pwb_ajax_object_admin.translations.migrate_notice) ){
|
139 |
+
|
140 |
+
$('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
|
141 |
+
$('.pwb-modal-inner').html('<p>'+pwb_ajax_object_admin.translations.migrating+'</p>');
|
142 |
+
|
143 |
+
var data = {
|
144 |
+
'action': 'pwb_admin_migrate_brands',
|
145 |
+
'from': $(this).val()
|
146 |
+
};
|
147 |
+
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
148 |
+
|
149 |
+
setTimeout( function(){
|
150 |
+
location.href = pwb_ajax_object_admin.brands_url;
|
151 |
+
}, 1000 );
|
152 |
+
|
153 |
+
});
|
154 |
+
|
155 |
+
}else{
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
}
|
160 |
+
|
161 |
+
$(this).val('-');//reset to default value
|
162 |
+
|
163 |
+
} );
|
164 |
+
|
165 |
+
// dummy data
|
166 |
+
$('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
|
167 |
+
|
168 |
+
if( $(this).val() != '-' ){
|
169 |
+
|
170 |
+
if( confirm(pwb_ajax_object_admin.translations.dummy_data_notice) ){
|
171 |
+
|
172 |
+
$('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
|
173 |
+
$('.pwb-modal-inner').html('<p>'+pwb_ajax_object_admin.translations.dummy_data+'</p>');
|
174 |
+
|
175 |
+
var data = {
|
176 |
+
'action': 'pwb_admin_dummy_data',
|
177 |
+
'from': $(this).val()
|
178 |
+
};
|
179 |
+
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
180 |
+
|
181 |
+
setTimeout( function(){
|
182 |
+
location.href = pwb_ajax_object_admin.brands_url;
|
183 |
+
}, 1000 );
|
184 |
+
|
185 |
+
});
|
186 |
+
|
187 |
+
}else{
|
188 |
+
|
189 |
+
}
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
+
$(this).val('-');//reset to default value
|
194 |
+
|
195 |
+
} );
|
196 |
+
|
197 |
+
var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
|
198 |
+
$systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
|
199 |
+
$('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
|
200 |
+
e.preventDefault();
|
201 |
+
if( !$('#wc_pwb_admin_status_result').length ){
|
202 |
+
$systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
|
203 |
+
$('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
|
204 |
+
jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
|
205 |
+
e.preventDefault();
|
206 |
+
var refNode = $( this )[0];
|
207 |
+
if ( $.browser.msie ) {
|
208 |
+
var range = document.body.createTextRange();
|
209 |
+
range.moveToElementText( refNode );
|
210 |
+
range.select();
|
211 |
+
} else if ( $.browser.mozilla || $.browser.opera ) {
|
212 |
+
var selection = window.getSelection();
|
213 |
+
var range = document.createRange();
|
214 |
+
range.selectNodeContents( refNode );
|
215 |
+
selection.removeAllRanges();
|
216 |
+
selection.addRange( range );
|
217 |
+
} else if ( $.browser.safari ) {
|
218 |
+
var selection = window.getSelection();
|
219 |
+
selection.setBaseAndExtent( refNode, 0, refNode, 1 );
|
220 |
+
}
|
221 |
+
} );
|
222 |
+
}
|
223 |
+
$('#wc_pwb_admin_status_result').html('<img src="'+pwb_ajax_object_admin.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
|
224 |
+
$('#wc_pwb_admin_status_result').show();
|
225 |
+
var data = {
|
226 |
+
'action': 'pwb_system_status'
|
227 |
+
};
|
228 |
+
jQuery.post(ajaxurl, data, function(response) {
|
229 |
+
$('#wc_pwb_admin_status_result').html(response);
|
230 |
+
$('#wc_pwb_admin_status_result').trigger('click');
|
231 |
+
});
|
232 |
+
|
233 |
+
} );
|
234 |
+
|
235 |
+
/* ····························· /Settings tab ····························· */
|
236 |
+
|
237 |
+
/* ····························· Admin notices ····························· */
|
238 |
+
$( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
|
239 |
+
|
240 |
+
e.preventDefault();
|
241 |
+
|
242 |
+
var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
|
243 |
+
|
244 |
+
var data = {
|
245 |
+
'action': 'dismiss_pwb_notice',
|
246 |
+
'notice_name': noticeName
|
247 |
+
};
|
248 |
+
jQuery.post(ajaxurl, data, function(response) {
|
249 |
+
//callback
|
250 |
+
});
|
251 |
+
|
252 |
+
} );
|
253 |
+
/* ····························· /Admin notices ····························· */
|
254 |
+
|
255 |
+
/* ····························· Widgets ····························· */
|
256 |
+
pwbBindEventsToWigets();
|
257 |
+
//Fires when a widget is added to a sidebar
|
258 |
+
jQuery(document).bind('widget-added',function(e, widget){
|
259 |
+
pwbBindEventsToWigets( widget );
|
260 |
+
});
|
261 |
+
//Fires on widget save
|
262 |
+
jQuery(document).on('widget-updated', function(e, widget){
|
263 |
+
pwbBindEventsToWigets( widget );
|
264 |
+
});
|
265 |
+
function pwbBindEventsToWigets( widget ){
|
266 |
+
$currentWidget = $(".pwb-select-display-as");
|
267 |
+
if( widget != undefined ){
|
268 |
+
$currentWidget = $(".pwb-select-display-as", widget);
|
269 |
+
}
|
270 |
+
$currentWidget.on("change",function(){
|
271 |
+
if( $(this).val()=="brand_logo" ){
|
272 |
+
$(this).parent().siblings(".pwb-display-as-logo").addClass("show");
|
273 |
+
}else{
|
274 |
+
$(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
|
275 |
+
}
|
276 |
+
});
|
277 |
+
}
|
278 |
+
/* ····························· /Widgets ····························· */
|
279 |
+
|
280 |
+
/* ····························· Brands exporter ····························· */
|
281 |
+
$('button.pwb-brands-export').on('click', function(e){
|
282 |
+
e.preventDefault();
|
283 |
+
|
284 |
+
var $clickedBtn = $(this);
|
285 |
+
$clickedBtn.addClass('pwb-loading-overlay');
|
286 |
+
$clickedBtn.prop("disabled",true);
|
287 |
+
|
288 |
+
var data = { 'action': 'pwb_brands_export' };
|
289 |
+
$.post(pwb_ajax_object_admin.ajax_url, data, function(response) {
|
290 |
+
|
291 |
+
if( response.success ){
|
292 |
+
$clickedBtn.removeClass('pwb-loading-overlay');
|
293 |
+
$clickedBtn.prop("disabled",false);
|
294 |
+
|
295 |
+
//descarga el archivo json de exportación
|
296 |
+
$('#pwb-download-export-file').remove();
|
297 |
+
var link = document.createElement("a");
|
298 |
+
link.download = 'brands.json';
|
299 |
+
link.id = 'pwb-download-export-file';
|
300 |
+
link.href = response.data.export_file_url;
|
301 |
+
$('body').append( link );
|
302 |
+
link.click();
|
303 |
+
}
|
304 |
+
|
305 |
+
});
|
306 |
+
|
307 |
+
});
|
308 |
+
|
309 |
+
$('button.pwb-brands-import').on('click', function(e){
|
310 |
+
e.preventDefault();
|
311 |
+
$('input.pwb-brands-import-file').trigger('click');
|
312 |
+
});
|
313 |
+
$('input.pwb-brands-import-file').on('change', function(e){
|
314 |
+
e.preventDefault();
|
315 |
+
|
316 |
+
var $clickedBtn = $('button.pwb-brands-import');
|
317 |
+
$clickedBtn.addClass('pwb-loading-overlay');
|
318 |
+
$clickedBtn.prop("disabled",true);
|
319 |
+
|
320 |
+
var file = $(this)[0].files[0];
|
321 |
+
|
322 |
+
var reqData = new FormData();
|
323 |
+
reqData.append('action', 'pwb_brands_import');
|
324 |
+
reqData.append('file', file);
|
325 |
+
|
326 |
+
$.ajax({
|
327 |
+
url: pwb_ajax_object_admin.ajax_url,
|
328 |
+
type: 'post',
|
329 |
+
cache: false,
|
330 |
+
dataType: 'json',
|
331 |
+
contentType: false,
|
332 |
+
processData: false,
|
333 |
+
data: reqData,
|
334 |
+
success: function( resp ){
|
335 |
+
if( resp.success ){
|
336 |
+
$clickedBtn.removeClass('pwb-loading-overlay');
|
337 |
+
location.reload();
|
338 |
+
}else{
|
339 |
+
alert('Importer error');
|
340 |
+
}
|
341 |
+
}
|
342 |
+
});
|
343 |
+
|
344 |
+
})
|
345 |
+
/* ····························· /Brands exporter ····························· */
|
346 |
+
|
347 |
+
});
|
assets/js/functions-frontend.js
CHANGED
@@ -1,157 +1,157 @@
|
|
1 |
-
jQuery( function ( $ ) {
|
2 |
-
|
3 |
-
$('.pwb-dropdown-widget').on('change',function(){
|
4 |
-
var href = $(this).find(":selected").val();
|
5 |
-
location.href = href;
|
6 |
-
});
|
7 |
-
|
8 |
-
if( typeof $.fn.slick === 'function' ){
|
9 |
-
|
10 |
-
$('.pwb-carousel').slick({
|
11 |
-
slide: '.pwb-slick-slide',
|
12 |
-
infinite: true,
|
13 |
-
draggable: false,
|
14 |
-
prevArrow: '<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+'</span></div>',
|
15 |
-
nextArrow: '<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+'</span></div>',
|
16 |
-
speed: 300,
|
17 |
-
lazyLoad: 'progressive',
|
18 |
-
responsive: [
|
19 |
-
{
|
20 |
-
breakpoint: 1024,
|
21 |
-
settings: {
|
22 |
-
slidesToShow: 4,
|
23 |
-
draggable: true,
|
24 |
-
arrows: false
|
25 |
-
}
|
26 |
-
},
|
27 |
-
{
|
28 |
-
breakpoint: 600,
|
29 |
-
settings: {
|
30 |
-
slidesToShow: 3,
|
31 |
-
draggable: true,
|
32 |
-
arrows: false
|
33 |
-
}
|
34 |
-
},
|
35 |
-
{
|
36 |
-
breakpoint: 480,
|
37 |
-
settings: {
|
38 |
-
slidesToShow: 2,
|
39 |
-
draggable: true,
|
40 |
-
arrows: false
|
41 |
-
}
|
42 |
-
}
|
43 |
-
]
|
44 |
-
});
|
45 |
-
|
46 |
-
$('.pwb-product-carousel').slick({
|
47 |
-
slide: '.pwb-slick-slide',
|
48 |
-
infinite: true,
|
49 |
-
draggable: false,
|
50 |
-
prevArrow: '<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+'</span></div>',
|
51 |
-
nextArrow: '<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+'</span></div>',
|
52 |
-
speed: 300,
|
53 |
-
lazyLoad: 'progressive',
|
54 |
-
responsive: [
|
55 |
-
{
|
56 |
-
breakpoint: 1024,
|
57 |
-
settings: {
|
58 |
-
slidesToShow: 3,
|
59 |
-
draggable: true,
|
60 |
-
arrows: false
|
61 |
-
}
|
62 |
-
},
|
63 |
-
{
|
64 |
-
breakpoint: 600,
|
65 |
-
settings: {
|
66 |
-
slidesToShow: 2,
|
67 |
-
draggable: true,
|
68 |
-
arrows: false
|
69 |
-
}
|
70 |
-
},
|
71 |
-
{
|
72 |
-
breakpoint: 480,
|
73 |
-
settings: {
|
74 |
-
slidesToShow: 1,
|
75 |
-
draggable: true,
|
76 |
-
arrows: false
|
77 |
-
}
|
78 |
-
}
|
79 |
-
]
|
80 |
-
});
|
81 |
-
|
82 |
-
}
|
83 |
-
|
84 |
-
/* ··························· Filter by brand widget ··························· */
|
85 |
-
|
86 |
-
var PWBFilterByBrand = function(){
|
87 |
-
|
88 |
-
var baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
|
89 |
-
var currentUrl = window.location.href;
|
90 |
-
|
91 |
-
var marcas = [];
|
92 |
-
$('.pwb-filter-products input[type="checkbox"]').each(function(index){
|
93 |
-
if( $(this).prop('checked') ) marcas.push( $(this).val() );
|
94 |
-
});
|
95 |
-
marcas = marcas.join();
|
96 |
-
|
97 |
-
if( marcas ){
|
98 |
-
|
99 |
-
//removes previous "pwb-brand" from url
|
100 |
-
currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
|
101 |
-
|
102 |
-
//removes pagination
|
103 |
-
currentUrl = currentUrl.replace(/\/page\/\d*\//i, "");
|
104 |
-
|
105 |
-
if( currentUrl.indexOf("?") === -1 ){
|
106 |
-
currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
|
107 |
-
}else{
|
108 |
-
currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
|
109 |
-
}
|
110 |
-
|
111 |
-
}else{
|
112 |
-
currentUrl = baseUrl;
|
113 |
-
}
|
114 |
-
|
115 |
-
location.href = currentUrl;
|
116 |
-
|
117 |
-
}
|
118 |
-
|
119 |
-
$('.pwb-filter-products button').on( 'click', function(){ PWBFilterByBrand(); } );
|
120 |
-
$('.pwb-filter-products.pwb-hide-submit-btn input').on( 'change', function(){ PWBFilterByBrand(); } );
|
121 |
-
|
122 |
-
var brands = PWBgetUrlParameter('pwb-brand-filter');
|
123 |
-
|
124 |
-
if(brands!=null){
|
125 |
-
var brands_array = brands.split(',');
|
126 |
-
$('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
|
127 |
-
for ( var i = 0, l = brands_array.length; i < l; i++ ) {
|
128 |
-
$('.pwb-filter-products input[type="checkbox"]').each(function(index){
|
129 |
-
if($(this).val()){
|
130 |
-
if(brands_array[i]==$(this).val()){
|
131 |
-
$(this).prop('checked',true);
|
132 |
-
}
|
133 |
-
}
|
134 |
-
});
|
135 |
-
}
|
136 |
-
}else{
|
137 |
-
$('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
|
138 |
-
}
|
139 |
-
|
140 |
-
/* ··························· /Filter by brand widget ··························· */
|
141 |
-
|
142 |
-
});
|
143 |
-
|
144 |
-
var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
|
145 |
-
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
146 |
-
sURLVariables = sPageURL.split('&'),
|
147 |
-
sParameterName,
|
148 |
-
i;
|
149 |
-
|
150 |
-
for (i = 0; i < sURLVariables.length; i++) {
|
151 |
-
sParameterName = sURLVariables[i].split('=');
|
152 |
-
|
153 |
-
if (sParameterName[0] === sParam) {
|
154 |
-
return sParameterName[1] === undefined ? true : sParameterName[1];
|
155 |
-
}
|
156 |
-
}
|
157 |
-
};
|
1 |
+
jQuery( function ( $ ) {
|
2 |
+
|
3 |
+
$('.pwb-dropdown-widget').on('change',function(){
|
4 |
+
var href = $(this).find(":selected").val();
|
5 |
+
location.href = href;
|
6 |
+
});
|
7 |
+
|
8 |
+
if( typeof $.fn.slick === 'function' ){
|
9 |
+
|
10 |
+
$('.pwb-carousel').slick({
|
11 |
+
slide: '.pwb-slick-slide',
|
12 |
+
infinite: true,
|
13 |
+
draggable: false,
|
14 |
+
prevArrow: '<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+'</span></div>',
|
15 |
+
nextArrow: '<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+'</span></div>',
|
16 |
+
speed: 300,
|
17 |
+
lazyLoad: 'progressive',
|
18 |
+
responsive: [
|
19 |
+
{
|
20 |
+
breakpoint: 1024,
|
21 |
+
settings: {
|
22 |
+
slidesToShow: 4,
|
23 |
+
draggable: true,
|
24 |
+
arrows: false
|
25 |
+
}
|
26 |
+
},
|
27 |
+
{
|
28 |
+
breakpoint: 600,
|
29 |
+
settings: {
|
30 |
+
slidesToShow: 3,
|
31 |
+
draggable: true,
|
32 |
+
arrows: false
|
33 |
+
}
|
34 |
+
},
|
35 |
+
{
|
36 |
+
breakpoint: 480,
|
37 |
+
settings: {
|
38 |
+
slidesToShow: 2,
|
39 |
+
draggable: true,
|
40 |
+
arrows: false
|
41 |
+
}
|
42 |
+
}
|
43 |
+
]
|
44 |
+
});
|
45 |
+
|
46 |
+
$('.pwb-product-carousel').slick({
|
47 |
+
slide: '.pwb-slick-slide',
|
48 |
+
infinite: true,
|
49 |
+
draggable: false,
|
50 |
+
prevArrow: '<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+'</span></div>',
|
51 |
+
nextArrow: '<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+'</span></div>',
|
52 |
+
speed: 300,
|
53 |
+
lazyLoad: 'progressive',
|
54 |
+
responsive: [
|
55 |
+
{
|
56 |
+
breakpoint: 1024,
|
57 |
+
settings: {
|
58 |
+
slidesToShow: 3,
|
59 |
+
draggable: true,
|
60 |
+
arrows: false
|
61 |
+
}
|
62 |
+
},
|
63 |
+
{
|
64 |
+
breakpoint: 600,
|
65 |
+
settings: {
|
66 |
+
slidesToShow: 2,
|
67 |
+
draggable: true,
|
68 |
+
arrows: false
|
69 |
+
}
|
70 |
+
},
|
71 |
+
{
|
72 |
+
breakpoint: 480,
|
73 |
+
settings: {
|
74 |
+
slidesToShow: 1,
|
75 |
+
draggable: true,
|
76 |
+
arrows: false
|
77 |
+
}
|
78 |
+
}
|
79 |
+
]
|
80 |
+
});
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
/* ··························· Filter by brand widget ··························· */
|
85 |
+
|
86 |
+
var PWBFilterByBrand = function(){
|
87 |
+
|
88 |
+
var baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
|
89 |
+
var currentUrl = window.location.href;
|
90 |
+
|
91 |
+
var marcas = [];
|
92 |
+
$('.pwb-filter-products input[type="checkbox"]').each(function(index){
|
93 |
+
if( $(this).prop('checked') ) marcas.push( $(this).val() );
|
94 |
+
});
|
95 |
+
marcas = marcas.join();
|
96 |
+
|
97 |
+
if( marcas ){
|
98 |
+
|
99 |
+
//removes previous "pwb-brand" from url
|
100 |
+
currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
|
101 |
+
|
102 |
+
//removes pagination
|
103 |
+
currentUrl = currentUrl.replace(/\/page\/\d*\//i, "");
|
104 |
+
|
105 |
+
if( currentUrl.indexOf("?") === -1 ){
|
106 |
+
currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
|
107 |
+
}else{
|
108 |
+
currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
|
109 |
+
}
|
110 |
+
|
111 |
+
}else{
|
112 |
+
currentUrl = baseUrl;
|
113 |
+
}
|
114 |
+
|
115 |
+
location.href = currentUrl;
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
$('.pwb-filter-products button').on( 'click', function(){ PWBFilterByBrand(); } );
|
120 |
+
$('.pwb-filter-products.pwb-hide-submit-btn input').on( 'change', function(){ PWBFilterByBrand(); } );
|
121 |
+
|
122 |
+
var brands = PWBgetUrlParameter('pwb-brand-filter');
|
123 |
+
|
124 |
+
if(brands!=null){
|
125 |
+
var brands_array = brands.split(',');
|
126 |
+
$('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
|
127 |
+
for ( var i = 0, l = brands_array.length; i < l; i++ ) {
|
128 |
+
$('.pwb-filter-products input[type="checkbox"]').each(function(index){
|
129 |
+
if($(this).val()){
|
130 |
+
if(brands_array[i]==$(this).val()){
|
131 |
+
$(this).prop('checked',true);
|
132 |
+
}
|
133 |
+
}
|
134 |
+
});
|
135 |
+
}
|
136 |
+
}else{
|
137 |
+
$('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
|
138 |
+
}
|
139 |
+
|
140 |
+
/* ··························· /Filter by brand widget ··························· */
|
141 |
+
|
142 |
+
});
|
143 |
+
|
144 |
+
var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
|
145 |
+
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
146 |
+
sURLVariables = sPageURL.split('&'),
|
147 |
+
sParameterName,
|
148 |
+
i;
|
149 |
+
|
150 |
+
for (i = 0; i < sURLVariables.length; i++) {
|
151 |
+
sParameterName = sURLVariables[i].split('=');
|
152 |
+
|
153 |
+
if (sParameterName[0] === sParam) {
|
154 |
+
return sParameterName[1] === undefined ? true : sParameterName[1];
|
155 |
+
}
|
156 |
+
}
|
157 |
+
};
|
assets/lib/slick/config.rb
CHANGED
@@ -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/lib/slick/fonts/slick.svg
CHANGED
@@ -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="→" 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="←" 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="•" 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="a" 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="→" 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="←" 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="•" 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="a" 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/lib/slick/slick-theme.css
CHANGED
@@ -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/lib/slick/slick-theme.less
CHANGED
@@ -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/lib/slick/slick-theme.scss
CHANGED
@@ -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/lib/slick/slick.css
CHANGED
@@ -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/lib/slick/slick.js
CHANGED
@@ -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/lib/slick/slick.less
CHANGED
@@ -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/lib/slick/slick.min.js
CHANGED
@@ -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/lib/slick/slick.scss
CHANGED
@@ -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-brands-custom-fields.php
CHANGED
@@ -1,176 +1,176 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Perfect_Woocommerce_Brands\Admin;
|
3 |
-
|
4 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
5 |
-
|
6 |
-
class Brands_Custom_Fields {
|
7 |
-
|
8 |
-
function __construct(){
|
9 |
-
add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
|
10 |
-
add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
|
11 |
-
add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
|
12 |
-
add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
public function add_brands_metafields_form(){
|
16 |
-
ob_start();
|
17 |
-
?>
|
18 |
-
|
19 |
-
<div class="form-field pwb_brand_cont">
|
20 |
-
<label for="pwb_brand_desc"><?php _e( 'Description' ); ?></label>
|
21 |
-
<textarea id="pwb_brand_description_field" name="pwb_brand_description_field" rows="5" cols="40"></textarea>
|
22 |
-
<p id="brand-description-help-text"><?php _e( 'Brand description for the archive pages. You can include some html markup and shortcodes.', 'perfect-woocommerce-brands' ); ?></p>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<div class="form-field pwb_brand_cont">
|
26 |
-
<label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
|
27 |
-
<input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
|
28 |
-
<a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<div class="form-field pwb_brand_cont">
|
32 |
-
<label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
|
33 |
-
<input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
|
34 |
-
<a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
35 |
-
<p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
|
36 |
-
</div>
|
37 |
-
|
38 |
-
<div class="form-field pwb_brand_cont">
|
39 |
-
<label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
|
40 |
-
<input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
|
41 |
-
<p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<?php wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
|
45 |
-
|
46 |
-
<?php
|
47 |
-
echo ob_get_clean();
|
48 |
-
}
|
49 |
-
|
50 |
-
public function add_brands_metafields_form_edit($term){
|
51 |
-
$term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
|
52 |
-
$term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
|
53 |
-
$term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
|
54 |
-
ob_start();
|
55 |
-
?>
|
56 |
-
<table class="form-table pwb_brand_cont">
|
57 |
-
<tr class="form-field">
|
58 |
-
<th>
|
59 |
-
<label for="pwb_brand_desc"><?php _e( 'Description' ); ?></label>
|
60 |
-
</th>
|
61 |
-
<td>
|
62 |
-
<?php wp_editor( html_entity_decode( $term->description ), 'pwb_brand_description_field', array( 'editor_height' => 120 ) ); ?>
|
63 |
-
<p id="brand-description-help-text"><?php _e( 'Brand description for the archive pages. You can include some html markup and shortcodes.', 'perfect-woocommerce-brands' ); ?></p>
|
64 |
-
</td>
|
65 |
-
</tr>
|
66 |
-
<tr class="form-field">
|
67 |
-
<th>
|
68 |
-
<label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
|
69 |
-
</th>
|
70 |
-
<td>
|
71 |
-
<input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
|
72 |
-
<a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
73 |
-
|
74 |
-
<?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
|
75 |
-
<?php if( !empty($current_image) ): ?>
|
76 |
-
<div class="pwb_brand_image_selected">
|
77 |
-
<span>
|
78 |
-
<?php echo $current_image;?>
|
79 |
-
<a href="#" class="pwb_brand_image_selected_remove">X</a>
|
80 |
-
</span>
|
81 |
-
</div>
|
82 |
-
<?php endif; ?>
|
83 |
-
|
84 |
-
</td>
|
85 |
-
</tr>
|
86 |
-
<tr class="form-field">
|
87 |
-
<th>
|
88 |
-
<label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
|
89 |
-
</th>
|
90 |
-
<td>
|
91 |
-
<input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
|
92 |
-
<a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
93 |
-
|
94 |
-
<?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
|
95 |
-
<?php if( !empty($current_image) ): ?>
|
96 |
-
<div class="pwb_brand_image_selected">
|
97 |
-
<span>
|
98 |
-
<?php echo $current_image;?>
|
99 |
-
<a href="#" class="pwb_brand_image_selected_remove">X</a>
|
100 |
-
</span>
|
101 |
-
</div>
|
102 |
-
<?php endif; ?>
|
103 |
-
|
104 |
-
</td>
|
105 |
-
</tr>
|
106 |
-
<tr class="form-field">
|
107 |
-
<th>
|
108 |
-
<label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
|
109 |
-
</th>
|
110 |
-
<td>
|
111 |
-
<input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
|
112 |
-
<p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
|
113 |
-
<div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
|
114 |
-
</td>
|
115 |
-
</tr>
|
116 |
-
</table>
|
117 |
-
|
118 |
-
<?php wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
|
119 |
-
|
120 |
-
<?php
|
121 |
-
echo ob_get_clean();
|
122 |
-
}
|
123 |
-
|
124 |
-
public function add_brands_metafields_save( $term_id ){
|
125 |
-
|
126 |
-
if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
|
127 |
-
return;
|
128 |
-
|
129 |
-
/* ·············· Brand image ·············· */
|
130 |
-
$old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
|
131 |
-
$new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
|
132 |
-
|
133 |
-
if ( $old_img && '' === $new_img )
|
134 |
-
delete_term_meta( $term_id, 'pwb_brand_image' );
|
135 |
-
|
136 |
-
else if ( $old_img !== $new_img )
|
137 |
-
update_term_meta( $term_id, 'pwb_brand_image', $new_img );
|
138 |
-
/* ·············· /Brand image ·············· */
|
139 |
-
|
140 |
-
/* ·············· Brand banner ·············· */
|
141 |
-
$old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
|
142 |
-
$new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
|
143 |
-
|
144 |
-
if ( $old_img && '' === $new_img )
|
145 |
-
delete_term_meta( $term_id, 'pwb_brand_banner' );
|
146 |
-
|
147 |
-
else if ( $old_img !== $new_img )
|
148 |
-
update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
|
149 |
-
/* ·············· /Brand banner ·············· */
|
150 |
-
|
151 |
-
/* ·············· Brand banner link ·············· */
|
152 |
-
$old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
|
153 |
-
$new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
|
154 |
-
|
155 |
-
if ( $old_img && '' === $new_img )
|
156 |
-
delete_term_meta( $term_id, 'pwb_brand_banner_link' );
|
157 |
-
|
158 |
-
else if ( $old_img !== $new_img )
|
159 |
-
update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
|
160 |
-
/* ·············· /Brand banner link ·············· */
|
161 |
-
|
162 |
-
/* ·············· Brand desc ·············· */
|
163 |
-
if( isset( $_POST['pwb_brand_description_field'] ) ){
|
164 |
-
$allowed_tags = apply_filters(
|
165 |
-
'pwb_description_allowed_tags',
|
166 |
-
'<p><span><a><ul><ol><li><h1><h2><h3><h4><h5><h6><pre><strong><em><blockquote><del><ins><img><code><hr>'
|
167 |
-
);
|
168 |
-
$desc = strip_tags( wp_unslash( $_POST['pwb_brand_description_field'] ), $allowed_tags );
|
169 |
-
global $wpdb;
|
170 |
-
$wpdb->update( $wpdb->term_taxonomy, [ 'description' => $desc ], [ 'term_id' => $term_id ] );
|
171 |
-
}
|
172 |
-
/* ·············· /Brand desc ·············· */
|
173 |
-
|
174 |
-
}
|
175 |
-
|
176 |
-
}
|
1 |
+
<?php
|
2 |
+
namespace Perfect_Woocommerce_Brands\Admin;
|
3 |
+
|
4 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
5 |
+
|
6 |
+
class Brands_Custom_Fields {
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
|
10 |
+
add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
|
11 |
+
add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
|
12 |
+
add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
public function add_brands_metafields_form(){
|
16 |
+
ob_start();
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class="form-field pwb_brand_cont">
|
20 |
+
<label for="pwb_brand_desc"><?php _e( 'Description' ); ?></label>
|
21 |
+
<textarea id="pwb_brand_description_field" name="pwb_brand_description_field" rows="5" cols="40"></textarea>
|
22 |
+
<p id="brand-description-help-text"><?php _e( 'Brand description for the archive pages. You can include some html markup and shortcodes.', 'perfect-woocommerce-brands' ); ?></p>
|
23 |
+
</div>
|
24 |
+
|
25 |
+
<div class="form-field pwb_brand_cont">
|
26 |
+
<label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
|
27 |
+
<input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
|
28 |
+
<a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div class="form-field pwb_brand_cont">
|
32 |
+
<label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
|
33 |
+
<input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
|
34 |
+
<a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
35 |
+
<p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div class="form-field pwb_brand_cont">
|
39 |
+
<label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
|
40 |
+
<input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
|
41 |
+
<p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<?php wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
|
45 |
+
|
46 |
+
<?php
|
47 |
+
echo ob_get_clean();
|
48 |
+
}
|
49 |
+
|
50 |
+
public function add_brands_metafields_form_edit($term){
|
51 |
+
$term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
|
52 |
+
$term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
|
53 |
+
$term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
|
54 |
+
ob_start();
|
55 |
+
?>
|
56 |
+
<table class="form-table pwb_brand_cont">
|
57 |
+
<tr class="form-field">
|
58 |
+
<th>
|
59 |
+
<label for="pwb_brand_desc"><?php _e( 'Description' ); ?></label>
|
60 |
+
</th>
|
61 |
+
<td>
|
62 |
+
<?php wp_editor( html_entity_decode( $term->description ), 'pwb_brand_description_field', array( 'editor_height' => 120 ) ); ?>
|
63 |
+
<p id="brand-description-help-text"><?php _e( 'Brand description for the archive pages. You can include some html markup and shortcodes.', 'perfect-woocommerce-brands' ); ?></p>
|
64 |
+
</td>
|
65 |
+
</tr>
|
66 |
+
<tr class="form-field">
|
67 |
+
<th>
|
68 |
+
<label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
|
69 |
+
</th>
|
70 |
+
<td>
|
71 |
+
<input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
|
72 |
+
<a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
73 |
+
|
74 |
+
<?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
|
75 |
+
<?php if( !empty($current_image) ): ?>
|
76 |
+
<div class="pwb_brand_image_selected">
|
77 |
+
<span>
|
78 |
+
<?php echo $current_image;?>
|
79 |
+
<a href="#" class="pwb_brand_image_selected_remove">X</a>
|
80 |
+
</span>
|
81 |
+
</div>
|
82 |
+
<?php endif; ?>
|
83 |
+
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
<tr class="form-field">
|
87 |
+
<th>
|
88 |
+
<label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
|
89 |
+
</th>
|
90 |
+
<td>
|
91 |
+
<input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
|
92 |
+
<a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
|
93 |
+
|
94 |
+
<?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
|
95 |
+
<?php if( !empty($current_image) ): ?>
|
96 |
+
<div class="pwb_brand_image_selected">
|
97 |
+
<span>
|
98 |
+
<?php echo $current_image;?>
|
99 |
+
<a href="#" class="pwb_brand_image_selected_remove">X</a>
|
100 |
+
</span>
|
101 |
+
</div>
|
102 |
+
<?php endif; ?>
|
103 |
+
|
104 |
+
</td>
|
105 |
+
</tr>
|
106 |
+
<tr class="form-field">
|
107 |
+
<th>
|
108 |
+
<label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
|
109 |
+
</th>
|
110 |
+
<td>
|
111 |
+
<input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
|
112 |
+
<p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
|
113 |
+
<div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
</table>
|
117 |
+
|
118 |
+
<?php wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
|
119 |
+
|
120 |
+
<?php
|
121 |
+
echo ob_get_clean();
|
122 |
+
}
|
123 |
+
|
124 |
+
public function add_brands_metafields_save( $term_id ){
|
125 |
+
|
126 |
+
if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
|
127 |
+
return;
|
128 |
+
|
129 |
+
/* ·············· Brand image ·············· */
|
130 |
+
$old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
|
131 |
+
$new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
|
132 |
+
|
133 |
+
if ( $old_img && '' === $new_img )
|
134 |
+
delete_term_meta( $term_id, 'pwb_brand_image' );
|
135 |
+
|
136 |
+
else if ( $old_img !== $new_img )
|
137 |
+
update_term_meta( $term_id, 'pwb_brand_image', $new_img );
|
138 |
+
/* ·············· /Brand image ·············· */
|
139 |
+
|
140 |
+
/* ·············· Brand banner ·············· */
|
141 |
+
$old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
|
142 |
+
$new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
|
143 |
+
|
144 |
+
if ( $old_img && '' === $new_img )
|
145 |
+
delete_term_meta( $term_id, 'pwb_brand_banner' );
|
146 |
+
|
147 |
+
else if ( $old_img !== $new_img )
|
148 |
+
update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
|
149 |
+
/* ·············· /Brand banner ·············· */
|
150 |
+
|
151 |
+
/* ·············· Brand banner link ·············· */
|
152 |
+
$old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
|
153 |
+
$new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
|
154 |
+
|
155 |
+
if ( $old_img && '' === $new_img )
|
156 |
+
delete_term_meta( $term_id, 'pwb_brand_banner_link' );
|
157 |
+
|
158 |
+
else if ( $old_img !== $new_img )
|
159 |
+
update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
|
160 |
+
/* ·············· /Brand banner link ·············· */
|
161 |
+
|
162 |
+
/* ·············· Brand desc ·············· */
|
163 |
+
if( isset( $_POST['pwb_brand_description_field'] ) ){
|
164 |
+
$allowed_tags = apply_filters(
|
165 |
+
'pwb_description_allowed_tags',
|
166 |
+
'<p><span><a><ul><ol><li><h1><h2><h3><h4><h5><h6><pre><strong><em><blockquote><del><ins><img><code><hr>'
|
167 |
+
);
|
168 |
+
$desc = strip_tags( wp_unslash( $_POST['pwb_brand_description_field'] ), $allowed_tags );
|
169 |
+
global $wpdb;
|
170 |
+
$wpdb->update( $wpdb->term_taxonomy, [ 'description' => $desc ], [ 'term_id' => $term_id ] );
|
171 |
+
}
|
172 |
+
/* ·············· /Brand desc ·············· */
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
+
}
|
classes/admin/class-brands-exporter.php
CHANGED
@@ -1,128 +1,128 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Perfect_Woocommerce_Brands\Admin;
|
3 |
-
|
4 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
5 |
-
|
6 |
-
class Brands_Exporter {
|
7 |
-
|
8 |
-
function __construct(){
|
9 |
-
add_action( 'after-pwb-brand-table', array( $this, 'exporter_button' ) );
|
10 |
-
add_action( 'wp_ajax_pwb_brands_export', array( $this, 'export_brands' ) );
|
11 |
-
add_action( 'wp_ajax_pwb_brands_import', array( $this, 'import_brands' ) );
|
12 |
-
}
|
13 |
-
|
14 |
-
public function exporter_button(){
|
15 |
-
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
16 |
-
'brands-exporter', 'admin', array( 'ok' => 'va' )
|
17 |
-
);
|
18 |
-
}
|
19 |
-
|
20 |
-
public function export_brands(){
|
21 |
-
$this->get_brands();
|
22 |
-
wp_die();
|
23 |
-
}
|
24 |
-
|
25 |
-
private function get_brands(){
|
26 |
-
|
27 |
-
$brands_data = array();
|
28 |
-
|
29 |
-
$brands = get_terms( 'pwb-brand',array( 'hide_empty' => false ) );
|
30 |
-
foreach( $brands as $brand ){
|
31 |
-
|
32 |
-
$current_brand = array(
|
33 |
-
'slug' => $brand->slug,
|
34 |
-
'name' => $brand->name,
|
35 |
-
'banner_link' => get_term_meta( $brand->term_id, 'pwb_brand_banner_link', true ),
|
36 |
-
'desc' => htmlentities( $brand->description )
|
37 |
-
);
|
38 |
-
|
39 |
-
$image = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
|
40 |
-
$image = wp_get_attachment_image_src( $image, 'full' );
|
41 |
-
if( $image ) $current_brand['image'] = $image[0];
|
42 |
-
|
43 |
-
$banner = get_term_meta( $brand->term_id, 'pwb_brand_banner', true );
|
44 |
-
$banner = wp_get_attachment_image_src( $banner, 'full' );
|
45 |
-
if( $banner ) $current_brand['banner'] = $banner[0];
|
46 |
-
|
47 |
-
$brands_data[] = $current_brand;
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
$export_file = fopen( WP_CONTENT_DIR . '/uploads/pwb-export.json', 'w' );
|
52 |
-
fwrite( $export_file, json_encode( $brands_data ) );
|
53 |
-
fclose( $export_file );
|
54 |
-
|
55 |
-
$result = array( 'export_file_url' => WP_CONTENT_URL . '/uploads/pwb-export.json' );
|
56 |
-
|
57 |
-
wp_send_json_success( $result );
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
public function import_brands(){
|
62 |
-
|
63 |
-
if( isset( $_FILES['file'] ) ){
|
64 |
-
$file = $_FILES['file'];
|
65 |
-
|
66 |
-
$file_content = json_decode( file_get_contents( $file['tmp_name'] ), true );
|
67 |
-
|
68 |
-
if( is_array( $file_content ) ){
|
69 |
-
|
70 |
-
foreach( $file_content as $brand ){
|
71 |
-
|
72 |
-
$new_brand = wp_insert_term( $brand['name'], 'pwb-brand', array(
|
73 |
-
'slug' => $brand['slug'],
|
74 |
-
'description' => html_entity_decode( $brand['desc'] )
|
75 |
-
));
|
76 |
-
|
77 |
-
if( !is_wp_error( $new_brand ) ){
|
78 |
-
|
79 |
-
if( !empty( $brand['image'] ) )
|
80 |
-
$this->upload_remote_image_and_attach( $brand['image'], $new_brand['term_id'], 'pwb_brand_image' );
|
81 |
-
if( !empty( $brand['banner'] ) )
|
82 |
-
$this->upload_remote_image_and_attach( $brand['banner'], $new_brand['term_id'], 'pwb_brand_banner' );
|
83 |
-
if( !empty( $brand['banner_link'] ) )
|
84 |
-
update_term_meta( $new_brand['term_id'], 'pwb_brand_banner_link', $brand['banner_link'], true );
|
85 |
-
|
86 |
-
}
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
wp_send_json_success();
|
91 |
-
|
92 |
-
}else{
|
93 |
-
wp_send_json_error();
|
94 |
-
}
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
}else{
|
99 |
-
wp_send_json_error();
|
100 |
-
}
|
101 |
-
|
102 |
-
wp_die();
|
103 |
-
}
|
104 |
-
|
105 |
-
private function upload_remote_image_and_attach( $image_url, $term_id, $meta_key ){
|
106 |
-
|
107 |
-
$get = wp_remote_get( $image_url );
|
108 |
-
$type = wp_remote_retrieve_header( $get, 'content-type' );
|
109 |
-
|
110 |
-
if( !$type ) return false;
|
111 |
-
|
112 |
-
$mirror = wp_upload_bits( basename( $image_url ), '', wp_remote_retrieve_body( $get ) );
|
113 |
-
|
114 |
-
$attachment = array(
|
115 |
-
'post_title' => basename( $image_url ),
|
116 |
-
'post_mime_type' => $type
|
117 |
-
);
|
118 |
-
|
119 |
-
$attach_id = wp_insert_attachment( $attachment, $mirror['file'] );
|
120 |
-
require_once ABSPATH . 'wp-admin/includes/image.php';
|
121 |
-
$attach_data = wp_generate_attachment_metadata( $attach_id, $mirror['file'] );
|
122 |
-
wp_update_attachment_metadata( $attach_id, $attach_data );
|
123 |
-
|
124 |
-
update_term_meta( $term_id, $meta_key, $attach_id, true );
|
125 |
-
|
126 |
-
}
|
127 |
-
|
128 |
-
}
|
1 |
+
<?php
|
2 |
+
namespace Perfect_Woocommerce_Brands\Admin;
|
3 |
+
|
4 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
5 |
+
|
6 |
+
class Brands_Exporter {
|
7 |
+
|
8 |
+
function __construct(){
|
9 |
+
add_action( 'after-pwb-brand-table', array( $this, 'exporter_button' ) );
|
10 |
+
add_action( 'wp_ajax_pwb_brands_export', array( $this, 'export_brands' ) );
|
11 |
+
add_action( 'wp_ajax_pwb_brands_import', array( $this, 'import_brands' ) );
|
12 |
+
}
|
13 |
+
|
14 |
+
public function exporter_button(){
|
15 |
+
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
16 |
+
'brands-exporter', 'admin', array( 'ok' => 'va' )
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function export_brands(){
|
21 |
+
$this->get_brands();
|
22 |
+
wp_die();
|
23 |
+
}
|
24 |
+
|
25 |
+
private function get_brands(){
|
26 |
+
|
27 |
+
$brands_data = array();
|
28 |
+
|
29 |
+
$brands = get_terms( 'pwb-brand',array( 'hide_empty' => false ) );
|
30 |
+
foreach( $brands as $brand ){
|
31 |
+
|
32 |
+
$current_brand = array(
|
33 |
+
'slug' => $brand->slug,
|
34 |
+
'name' => $brand->name,
|
35 |
+
'banner_link' => get_term_meta( $brand->term_id, 'pwb_brand_banner_link', true ),
|
36 |
+
'desc' => htmlentities( $brand->description )
|
37 |
+
);
|
38 |
+
|
39 |
+
$image = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
|
40 |
+
$image = wp_get_attachment_image_src( $image, 'full' );
|
41 |
+
if( $image ) $current_brand['image'] = $image[0];
|
42 |
+
|
43 |
+
$banner = get_term_meta( $brand->term_id, 'pwb_brand_banner', true );
|
44 |
+
$banner = wp_get_attachment_image_src( $banner, 'full' );
|
45 |
+
if( $banner ) $current_brand['banner'] = $banner[0];
|
46 |
+
|
47 |
+
$brands_data[] = $current_brand;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
$export_file = fopen( WP_CONTENT_DIR . '/uploads/pwb-export.json', 'w' );
|
52 |
+
fwrite( $export_file, json_encode( $brands_data ) );
|
53 |
+
fclose( $export_file );
|
54 |
+
|
55 |
+
$result = array( 'export_file_url' => WP_CONTENT_URL . '/uploads/pwb-export.json' );
|
56 |
+
|
57 |
+
wp_send_json_success( $result );
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
public function import_brands(){
|
62 |
+
|
63 |
+
if( isset( $_FILES['file'] ) ){
|
64 |
+
$file = $_FILES['file'];
|
65 |
+
|
66 |
+
$file_content = json_decode( file_get_contents( $file['tmp_name'] ), true );
|
67 |
+
|
68 |
+
if( is_array( $file_content ) ){
|
69 |
+
|
70 |
+
foreach( $file_content as $brand ){
|
71 |
+
|
72 |
+
$new_brand = wp_insert_term( $brand['name'], 'pwb-brand', array(
|
73 |
+
'slug' => $brand['slug'],
|
74 |
+
'description' => html_entity_decode( $brand['desc'] )
|
75 |
+
));
|
76 |
+
|
77 |
+
if( !is_wp_error( $new_brand ) ){
|
78 |
+
|
79 |
+
if( !empty( $brand['image'] ) )
|
80 |
+
$this->upload_remote_image_and_attach( $brand['image'], $new_brand['term_id'], 'pwb_brand_image' );
|
81 |
+
if( !empty( $brand['banner'] ) )
|
82 |
+
$this->upload_remote_image_and_attach( $brand['banner'], $new_brand['term_id'], 'pwb_brand_banner' );
|
83 |
+
if( !empty( $brand['banner_link'] ) )
|
84 |
+
update_term_meta( $new_brand['term_id'], 'pwb_brand_banner_link', $brand['banner_link'], true );
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
wp_send_json_success();
|
91 |
+
|
92 |
+
}else{
|
93 |
+
wp_send_json_error();
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
}else{
|
99 |
+
wp_send_json_error();
|
100 |
+
}
|
101 |
+
|
102 |
+
wp_die();
|
103 |
+
}
|
104 |
+
|
105 |
+
private function upload_remote_image_and_attach( $image_url, $term_id, $meta_key ){
|
106 |
+
|
107 |
+
$get = wp_remote_get( $image_url );
|
108 |
+
$type = wp_remote_retrieve_header( $get, 'content-type' );
|
109 |
+
|
110 |
+
if( !$type ) return false;
|
111 |
+
|
112 |
+
$mirror = wp_upload_bits( basename( $image_url ), '', wp_remote_retrieve_body( $get ) );
|
113 |
+
|
114 |
+
$attachment = array(
|
115 |
+
'post_title' => basename( $image_url ),
|
116 |
+
'post_mime_type' => $type
|
117 |
+
);
|
118 |
+
|
119 |
+
$attach_id = wp_insert_attachment( $attachment, $mirror['file'] );
|
120 |
+
require_once ABSPATH . 'wp-admin/includes/image.php';
|
121 |
+
$attach_data = wp_generate_attachment_metadata( $attach_id, $mirror['file'] );
|
122 |
+
wp_update_attachment_metadata( $attach_id, $attach_data );
|
123 |
+
|
124 |
+
update_term_meta( $term_id, $meta_key, $attach_id, true );
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
classes/admin/class-edit-brands-page.php
CHANGED
@@ -1,143 +1,143 @@
|
|
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( $columns ){
|
68 |
-
$new_columns = array();
|
69 |
-
|
70 |
-
if ( isset( $columns['cb'] ) ) {
|
71 |
-
$new_columns['cb'] = $columns['cb'];
|
72 |
-
unset( $columns['cb'] );
|
73 |
-
}
|
74 |
-
|
75 |
-
if( isset( $columns['description'] ) ) unset( $columns['description'] );
|
76 |
-
|
77 |
-
$new_columns['logo'] = __( 'Logo', 'perfect-woocommerce-brands' );
|
78 |
-
$columns['featured'] = '<span class="pwb-featured-col-title">'.__( 'Featured', 'perfect-woocommerce-brands' ).'</span>';
|
79 |
-
|
80 |
-
return array_merge( $new_columns, $columns );
|
81 |
-
}
|
82 |
-
|
83 |
-
public function brand_taxonomy_columns($c, $column_name, $term_id){
|
84 |
-
switch( $column_name ){
|
85 |
-
case 'logo':
|
86 |
-
$image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('40','40') );
|
87 |
-
return ( $image ) ? $image : wc_placeholder_img( array('40','40') );
|
88 |
-
break;
|
89 |
-
case 'featured':
|
90 |
-
$featured_class = ( $this->is_featured_brand( $term_id ) ) ? 'dashicons-star-filled' : 'dashicons-star-empty';
|
91 |
-
printf(
|
92 |
-
'<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
|
93 |
-
$featured_class, __('Set as featured', 'perfect-woocommerce-brands'), $term_id
|
94 |
-
);
|
95 |
-
break;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
private function is_featured_brand( $brand_id ){
|
100 |
-
return ( get_term_meta( $brand_id, 'pwb_featured_brand', true ) );
|
101 |
-
}
|
102 |
-
|
103 |
-
public function set_featured_brand(){
|
104 |
-
if( isset( $_POST['brand'] ) ){
|
105 |
-
$direction = 'up';
|
106 |
-
$brand = intval( $_POST['brand'] );
|
107 |
-
if( $this->is_featured_brand( $brand ) ){
|
108 |
-
delete_term_meta( $brand, 'pwb_featured_brand', true );
|
109 |
-
$direction = 'down';
|
110 |
-
}else{
|
111 |
-
update_term_meta( $brand, 'pwb_featured_brand', true );
|
112 |
-
}
|
113 |
-
wp_send_json_success( array( 'success' => true, 'direction' => $direction ) );
|
114 |
-
}else{
|
115 |
-
wp_send_json_error( array( 'success' => false, 'error_msg' => __( 'Error!','perfect-woocommerce-brands' ) ) );
|
116 |
-
}
|
117 |
-
wp_die();
|
118 |
-
}
|
119 |
-
|
120 |
-
public function add_screen_options( $status, $args ){
|
121 |
-
if( self::is_edit_brands_page() ){
|
122 |
-
$featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
|
123 |
-
ob_start();
|
124 |
-
?>
|
125 |
-
<legend><?php _e('Brands','perfect-woocommerce-brands');?></legend>
|
126 |
-
<label>
|
127 |
-
<input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured,true);?>>
|
128 |
-
<?php _e('Show featured brands first','perfect-woocommerce-brands');?>
|
129 |
-
</label>
|
130 |
-
<?php
|
131 |
-
return ob_get_clean();
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
public function save_screen_options(){
|
136 |
-
if( isset( $_POST['new_val'] ) ){
|
137 |
-
$new_val = ( $_POST['new_val'] == 'true' ) ? true : false;
|
138 |
-
update_user_option( self::$current_user->ID, 'pwb-first-featured-brands', $new_val );
|
139 |
-
}
|
140 |
-
wp_die();
|
141 |
-
}
|
142 |
-
|
143 |
-
}
|
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( $columns ){
|
68 |
+
$new_columns = array();
|
69 |
+
|
70 |
+
if ( isset( $columns['cb'] ) ) {
|
71 |
+
$new_columns['cb'] = $columns['cb'];
|
72 |
+
unset( $columns['cb'] );
|
73 |
+
}
|
74 |
+
|
75 |
+
if( isset( $columns['description'] ) ) unset( $columns['description'] );
|
76 |
+
|
77 |
+
$new_columns['logo'] = __( 'Logo', 'perfect-woocommerce-brands' );
|
78 |
+
$columns['featured'] = '<span class="pwb-featured-col-title">'.__( 'Featured', 'perfect-woocommerce-brands' ).'</span>';
|
79 |
+
|
80 |
+
return array_merge( $new_columns, $columns );
|
81 |
+
}
|
82 |
+
|
83 |
+
public function brand_taxonomy_columns($c, $column_name, $term_id){
|
84 |
+
switch( $column_name ){
|
85 |
+
case 'logo':
|
86 |
+
$image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('40','40') );
|
87 |
+
return ( $image ) ? $image : wc_placeholder_img( array('40','40') );
|
88 |
+
break;
|
89 |
+
case 'featured':
|
90 |
+
$featured_class = ( $this->is_featured_brand( $term_id ) ) ? 'dashicons-star-filled' : 'dashicons-star-empty';
|
91 |
+
printf(
|
92 |
+
'<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
|
93 |
+
$featured_class, __('Set as featured', 'perfect-woocommerce-brands'), $term_id
|
94 |
+
);
|
95 |
+
break;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
private function is_featured_brand( $brand_id ){
|
100 |
+
return ( get_term_meta( $brand_id, 'pwb_featured_brand', true ) );
|
101 |
+
}
|
102 |
+
|
103 |
+
public function set_featured_brand(){
|
104 |
+
if( isset( $_POST['brand'] ) ){
|
105 |
+
$direction = 'up';
|
106 |
+
$brand = intval( $_POST['brand'] );
|
107 |
+
if( $this->is_featured_brand( $brand ) ){
|
108 |
+
delete_term_meta( $brand, 'pwb_featured_brand', true );
|
109 |
+
$direction = 'down';
|
110 |
+
}else{
|
111 |
+
update_term_meta( $brand, 'pwb_featured_brand', true );
|
112 |
+
}
|
113 |
+
wp_send_json_success( array( 'success' => true, 'direction' => $direction ) );
|
114 |
+
}else{
|
115 |
+
wp_send_json_error( array( 'success' => false, 'error_msg' => __( 'Error!','perfect-woocommerce-brands' ) ) );
|
116 |
+
}
|
117 |
+
wp_die();
|
118 |
+
}
|
119 |
+
|
120 |
+
public function add_screen_options( $status, $args ){
|
121 |
+
if( self::is_edit_brands_page() ){
|
122 |
+
$featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
|
123 |
+
ob_start();
|
124 |
+
?>
|
125 |
+
<legend><?php _e('Brands','perfect-woocommerce-brands');?></legend>
|
126 |
+
<label>
|
127 |
+
<input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured,true);?>>
|
128 |
+
<?php _e('Show featured brands first','perfect-woocommerce-brands');?>
|
129 |
+
</label>
|
130 |
+
<?php
|
131 |
+
return ob_get_clean();
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
public function save_screen_options(){
|
136 |
+
if( isset( $_POST['new_val'] ) ){
|
137 |
+
$new_val = ( $_POST['new_val'] == 'true' ) ? true : false;
|
138 |
+
update_user_option( self::$current_user->ID, 'pwb-first-featured-brands', $new_val );
|
139 |
+
}
|
140 |
+
wp_die();
|
141 |
+
}
|
142 |
+
|
143 |
+
}
|
classes/admin/class-pwb-admin-tab.php
CHANGED
@@ -1,240 +1,288 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
)
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
'
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Perfect_Woocommerce_Brands\Admin;
|
4 |
+
|
5 |
+
use WC_Admin_Settings, WC_Settings_Page;
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
|
9 |
+
function pwb_admin_tab() {
|
10 |
+
|
11 |
+
class Pwb_Admin_Tab extends WC_Settings_Page {
|
12 |
+
|
13 |
+
public function __construct() {
|
14 |
+
|
15 |
+
$this->id = 'pwb_admin_tab';
|
16 |
+
$this->label = __( 'Brands', 'perfect-woocommerce-brands' );
|
17 |
+
|
18 |
+
add_filter( 'woocommerce_settings_tabs_array', [ $this, 'add_settings_page' ], 20 );
|
19 |
+
add_action( 'woocommerce_settings_' . $this->id, [ $this, 'output' ] );
|
20 |
+
add_action( 'woocommerce_sections_' . $this->id, [ $this, 'output_sections' ] );
|
21 |
+
add_action( 'woocommerce_settings_save_' . $this->id, [ $this, 'save' ] );
|
22 |
+
}
|
23 |
+
|
24 |
+
public function get_sections() {
|
25 |
+
|
26 |
+
$sections = array(
|
27 |
+
'' => __( 'General', 'perfect-woocommerce-brands' ),
|
28 |
+
'brand-pages' => __( 'Brand pages & loop', 'perfect-woocommerce-brands' ),
|
29 |
+
'single-product' => __( 'Single product', 'perfect-woocommerce-brands' ),
|
30 |
+
'tools' => __( 'Developer tools', 'perfect-woocommerce-brands' ),
|
31 |
+
);
|
32 |
+
|
33 |
+
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function get_settings( $current_section = '' ) {
|
37 |
+
|
38 |
+
$available_image_sizes_adapted = array();
|
39 |
+
$available_image_sizes = get_intermediate_image_sizes();
|
40 |
+
foreach( $available_image_sizes as $image_size ) $available_image_sizes_adapted[$image_size] = $image_size;
|
41 |
+
$available_image_sizes_adapted['full'] = 'full';
|
42 |
+
|
43 |
+
$pages_select_adapted = array( '-' => '-' );
|
44 |
+
$pages_select = get_pages();
|
45 |
+
foreach( $pages_select as $page ) $pages_select_adapted[$page->ID] = $page->post_title;
|
46 |
+
|
47 |
+
if ( 'single-product' == $current_section ) {
|
48 |
+
|
49 |
+
$settings = apply_filters( 'wc_pwb_admin_tab_settings', array(
|
50 |
+
|
51 |
+
'section_title' => array(
|
52 |
+
'name' => __( 'Single product', 'perfect-woocommerce-brands' ),
|
53 |
+
'type' => 'title',
|
54 |
+
'desc' => '',
|
55 |
+
'id' => 'wc_pwb_admin_tab_section_title'
|
56 |
+
),
|
57 |
+
'brand_single_product_tab' => array(
|
58 |
+
'name' => __( 'Single product tab', 'perfect-woocommerce-brands' ),
|
59 |
+
'type' => 'checkbox',
|
60 |
+
'default' => 'yes',
|
61 |
+
'desc' => __( 'Show brand tab in single product page', 'perfect-woocommerce-brands' ),
|
62 |
+
'id' => 'wc_pwb_admin_tab_brand_single_product_tab'
|
63 |
+
),
|
64 |
+
'show_brand_in_single' => array(
|
65 |
+
'name' => __( 'Show brands in single product', 'perfect-woocommerce-brands' ),
|
66 |
+
'type' => 'select',
|
67 |
+
'class' => 'pwb-admin-tab-field',
|
68 |
+
'desc' => __( 'Show brand logo (or name) in single product', 'perfect-woocommerce-brands' ),
|
69 |
+
'default' => 'brand_image',
|
70 |
+
'id' => 'wc_pwb_admin_tab_brands_in_single',
|
71 |
+
'options' => array(
|
72 |
+
'no' => __( 'No', 'perfect-woocommerce-brands' ),
|
73 |
+
'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
|
74 |
+
'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
|
75 |
+
)
|
76 |
+
),
|
77 |
+
'brand_single_position' => array(
|
78 |
+
'name' => __( 'Brand position', 'perfect-woocommerce-brands' ),
|
79 |
+
'type' => 'select',
|
80 |
+
'class' => 'pwb-admin-tab-field',
|
81 |
+
'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
|
82 |
+
'id' => 'wc_pwb_admin_tab_brand_single_position',
|
83 |
+
'options' => array(
|
84 |
+
'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
|
85 |
+
'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
|
86 |
+
'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
|
87 |
+
'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
|
88 |
+
'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
|
89 |
+
'meta' => __( 'In meta', 'perfect-woocommerce-brands' ),
|
90 |
+
'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
|
91 |
+
'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
|
92 |
+
)
|
93 |
+
),
|
94 |
+
'section_end' => array(
|
95 |
+
'type' => 'sectionend',
|
96 |
+
'id' => 'wc_pwb_admin_tab_section_end'
|
97 |
+
)
|
98 |
+
|
99 |
+
) );
|
100 |
+
|
101 |
+
} elseif ( 'brand-pages' == $current_section ) {
|
102 |
+
|
103 |
+
$settings = apply_filters( 'wc_pwb_admin_tab_brand_pages_settings', array(
|
104 |
+
|
105 |
+
'section_title' => array(
|
106 |
+
'name' => __( 'Brand pages & loop', 'perfect-woocommerce-brands' ),
|
107 |
+
'type' => 'title',
|
108 |
+
'desc' => '',
|
109 |
+
'id' => 'wc_pwb_admin_tab_section_title'
|
110 |
+
),
|
111 |
+
'brand_description' => array(
|
112 |
+
'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
|
113 |
+
'type' => 'select',
|
114 |
+
'class' => 'pwb-admin-tab-field',
|
115 |
+
'default' => 'yes',
|
116 |
+
'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
|
117 |
+
'id' => 'wc_pwb_admin_tab_brand_desc',
|
118 |
+
'options' => array(
|
119 |
+
'yes' => __( 'Yes, before product loop', 'perfect-woocommerce-brands' ),
|
120 |
+
'yes_after_loop' => __( 'Yes, after product loop', 'perfect-woocommerce-brands' ),
|
121 |
+
'no' => __( 'No, hide description', 'perfect-woocommerce-brands' )
|
122 |
+
)
|
123 |
+
),
|
124 |
+
'brand_banner' => array(
|
125 |
+
'name' => __( 'Show brand banner', 'perfect-woocommerce-brands' ),
|
126 |
+
'type' => 'select',
|
127 |
+
'class' => 'pwb-admin-tab-field',
|
128 |
+
'default' => 'yes',
|
129 |
+
'desc' => __( 'Show brand banner (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
|
130 |
+
'id' => 'wc_pwb_admin_tab_brand_banner',
|
131 |
+
'options' => array(
|
132 |
+
'yes' => __( 'Yes, before product loop', 'perfect-woocommerce-brands' ),
|
133 |
+
'yes_after_loop' => __( 'Yes, after product loop', 'perfect-woocommerce-brands' ),
|
134 |
+
'no' => __( 'No, hide banner', 'perfect-woocommerce-brands' )
|
135 |
+
)
|
136 |
+
),
|
137 |
+
'show_brand_on_loop' => array(
|
138 |
+
'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
|
139 |
+
'type' => 'select',
|
140 |
+
'class' => 'pwb-admin-tab-field',
|
141 |
+
'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
|
142 |
+
'id' => 'wc_pwb_admin_tab_brands_in_loop',
|
143 |
+
'options' => array(
|
144 |
+
'no' => __( 'No', 'perfect-woocommerce-brands' ),
|
145 |
+
'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
|
146 |
+
'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
|
147 |
+
)
|
148 |
+
),
|
149 |
+
'section_end' => array(
|
150 |
+
'type' => 'sectionend',
|
151 |
+
'id' => 'wc_pwb_admin_tab_section_end'
|
152 |
+
)
|
153 |
+
|
154 |
+
) );
|
155 |
+
|
156 |
+
} elseif ( 'tools' == $current_section ) {
|
157 |
+
|
158 |
+
$settings = apply_filters( 'wc_pwb_admin_tab_tools_settings', array(
|
159 |
+
|
160 |
+
'section_title' => array(
|
161 |
+
'name' => __( 'Developer tools', 'perfect-woocommerce-brands' ),
|
162 |
+
'type' => 'title',
|
163 |
+
'desc' => '',
|
164 |
+
'id' => 'wc_pwb_admin_tab_section_tools_title'
|
165 |
+
),
|
166 |
+
'brand_import' => array(
|
167 |
+
'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
|
168 |
+
'type' => 'select',
|
169 |
+
'class' => 'pwb-admin-tab-field',
|
170 |
+
'desc' => sprintf(
|
171 |
+
__( 'Import brands from other brand plugin. <a href="%s" target="_blank">Click here for more details</a>', 'perfect-woocommerce-brands' ),
|
172 |
+
'https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin'
|
173 |
+
),
|
174 |
+
'id' => 'wc_pwb_admin_tab_tools_migrate',
|
175 |
+
'options' => array(
|
176 |
+
'-' => __( '-', 'perfect-woocommerce-brands' ),
|
177 |
+
'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' ),
|
178 |
+
'ultimate' => __( 'Ultimate WooCommerce Brands', 'perfect-woocommerce-brands' ),
|
179 |
+
'woobrands' => __( 'Offical WooCommerce Brands', 'perfect-woocommerce-brands' )
|
180 |
+
)
|
181 |
+
),
|
182 |
+
'brand_dummy_data' => array(
|
183 |
+
'name' => __( 'Dummy data', 'perfect-woocommerce-brands' ),
|
184 |
+
'type' => 'select',
|
185 |
+
'class' => 'pwb-admin-tab-field',
|
186 |
+
'desc' => __( 'Import generic brands and assign it to products randomly', 'perfect-woocommerce-brands' ),
|
187 |
+
'id' => 'wc_pwb_admin_tab_tools_dummy_data',
|
188 |
+
'options' => array(
|
189 |
+
'-' => __( '-', 'perfect-woocommerce-brands' ),
|
190 |
+
'start_import' => __( 'Start import', 'perfect-woocommerce-brands' )
|
191 |
+
)
|
192 |
+
),
|
193 |
+
'brands_system_status' => array(
|
194 |
+
'name' => __( 'System status', 'perfect-woocommerce-brands' ),
|
195 |
+
'type' => 'textarea',
|
196 |
+
'desc' => __( 'Show system status', 'perfect-woocommerce-brands' ),
|
197 |
+
'id' => 'wc_pwb_admin_tab_tools_system_status'
|
198 |
+
),
|
199 |
+
'section_end' => array(
|
200 |
+
'type' => 'sectionend',
|
201 |
+
'id' => 'wc_pwb_admin_tab_section_tools_end'
|
202 |
+
)
|
203 |
+
|
204 |
+
) );
|
205 |
+
|
206 |
+
} else {
|
207 |
+
|
208 |
+
$brands_url = get_option( 'wc_pwb_admin_tab_slug', __( 'brands', 'perfect-woocommerce-brands' ) ) . '/' . __( 'brand-name', 'perfect-woocommerce-brands' ) . '/';
|
209 |
+
|
210 |
+
$settings = apply_filters( 'wc_pwb_admin_tab_product_settings', array(
|
211 |
+
|
212 |
+
'section_title' => array(
|
213 |
+
'name' => __( 'General', 'perfect-woocommerce-brands' ),
|
214 |
+
'type' => 'title',
|
215 |
+
'desc' => '',
|
216 |
+
'id' => 'wc_pwb_admin_tab_section_title'
|
217 |
+
),
|
218 |
+
'slug' => array(
|
219 |
+
'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
|
220 |
+
'type' => 'text',
|
221 |
+
'class' => 'pwb-admin-tab-field',
|
222 |
+
'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
|
223 |
+
'desc_tip' => sprintf(
|
224 |
+
__( 'Your brands URLs will look like "%s"', 'perfect-woocommerce-brands' ),
|
225 |
+
'https://site.com/' . $brands_url
|
226 |
+
),
|
227 |
+
'id' => 'wc_pwb_admin_tab_slug',
|
228 |
+
'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
|
229 |
+
),
|
230 |
+
'brand_logo_size' => array(
|
231 |
+
'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
|
232 |
+
'type' => 'select',
|
233 |
+
'class' => 'pwb-admin-tab-field',
|
234 |
+
'desc' => __( 'Select the size for the brand logo image around the site', 'perfect-woocommerce-brands' ),
|
235 |
+
'desc_tip'=> __( 'The default image sizes can be configured under "Settings > Media". You can also define your own image sizes', 'perfect-woocommerce-brands' ),
|
236 |
+
'id' => 'wc_pwb_admin_tab_brand_logo_size',
|
237 |
+
'options' => $available_image_sizes_adapted
|
238 |
+
),
|
239 |
+
'brands_page_id' => array(
|
240 |
+
'name' => __( 'Brands page', 'perfect-woocommerce-brands' ),
|
241 |
+
'type' => 'select',
|
242 |
+
'class' => 'pwb-admin-tab-field pwb-admin-selectwoo',
|
243 |
+
'desc' => __( 'For linking breadcrumbs', 'perfect-woocommerce-brands' ),
|
244 |
+
'desc_tip' => __( 'Select your "Brands" page (if you have one), it will be linked in the breadcrumbs.', 'perfect-woocommerce-brands' ),
|
245 |
+
'id' => 'wc_pwb_admin_tab_brands_page_id',
|
246 |
+
'options' => $pages_select_adapted
|
247 |
+
),
|
248 |
+
'section_end' => array(
|
249 |
+
'type' => 'sectionend',
|
250 |
+
'id' => 'wc_pwb_admin_tab_section_end'
|
251 |
+
)
|
252 |
+
|
253 |
+
) );
|
254 |
+
|
255 |
+
}
|
256 |
+
|
257 |
+
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
|
258 |
+
|
259 |
+
}
|
260 |
+
|
261 |
+
public function output() {
|
262 |
+
|
263 |
+
global $current_section;
|
264 |
+
|
265 |
+
$settings = $this->get_settings( $current_section );
|
266 |
+
WC_Admin_Settings::output_fields( $settings );
|
267 |
+
}
|
268 |
+
|
269 |
+
public function save() {
|
270 |
+
|
271 |
+
update_option( 'old_wc_pwb_admin_tab_slug', get_taxonomy('pwb-brand')->rewrite['slug'] );
|
272 |
+
if( isset( $_POST['wc_pwb_admin_tab_slug'] ) ) {
|
273 |
+
$_POST['wc_pwb_admin_tab_slug'] = sanitize_title( $_POST['wc_pwb_admin_tab_slug'] );
|
274 |
+
}
|
275 |
+
|
276 |
+
global $current_section;
|
277 |
+
|
278 |
+
$settings = $this->get_settings( $current_section );
|
279 |
+
WC_Admin_Settings::save_fields( $settings );
|
280 |
+
}
|
281 |
+
|
282 |
+
}
|
283 |
+
|
284 |
+
return new Pwb_Admin_Tab();
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
add_filter( 'woocommerce_get_settings_pages', 'Perfect_Woocommerce_Brands\Admin\pwb_admin_tab', 15 );
|
classes/admin/class-pwb-coupon.php
CHANGED
@@ -1,77 +1,77 @@
|
|
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 |
-
if( $product->is_type( 'variation' ) ){
|
68 |
-
$product_id = $product->get_parent_id();
|
69 |
-
}else{
|
70 |
-
$product_id = is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id;
|
71 |
-
}
|
72 |
-
$product_brands = wp_get_post_terms( $product_id, 'pwb-brand', array( 'fields' => 'ids' ) );
|
73 |
-
$valid_brands = array_intersect( $selected_brands, $product_brands );
|
74 |
-
return !empty( $valid_brands );
|
75 |
-
}
|
76 |
-
|
77 |
-
}
|
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 |
+
if( $product->is_type( 'variation' ) ){
|
68 |
+
$product_id = $product->get_parent_id();
|
69 |
+
}else{
|
70 |
+
$product_id = is_callable( array( $product, 'get_id' ) ) ? $product->get_id() : $product->id;
|
71 |
+
}
|
72 |
+
$product_brands = wp_get_post_terms( $product_id, 'pwb-brand', array( 'fields' => 'ids' ) );
|
73 |
+
$valid_brands = array_intersect( $selected_brands, $product_brands );
|
74 |
+
return !empty( $valid_brands );
|
75 |
+
}
|
76 |
+
|
77 |
+
}
|
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 <strong>sit</strong> amet consectetur adipiscing elit etiam mollis faucibus aliquet';
|
54 |
-
$desc.= 'sed risus turpis dapibus vel <strong>rhoncus</strong> a vestibulum sed lectus in hac habitasse platea dictumst';
|
55 |
-
$desc.= 'suspendisse non luctus felis <strong>morbi</strong> 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 <strong>sit</strong> amet consectetur adipiscing elit etiam mollis faucibus aliquet';
|
54 |
+
$desc.= 'sed risus turpis dapibus vel <strong>rhoncus</strong> a vestibulum sed lectus in hac habitasse platea dictumst';
|
55 |
+
$desc.= 'suspendisse non luctus felis <strong>morbi</strong> 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/admin/class-pwb-exporter-support.php
CHANGED
@@ -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/admin/class-pwb-importer-support.php
CHANGED
@@ -1,53 +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_action( 'woocommerce_product_import_inserted_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 |
-
}
|
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_action( 'woocommerce_product_import_inserted_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,940 +1,982 @@
|
|
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( 'plugin_row_meta', array( '\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands', 'plugin_row_meta' ), 10, 2 );
|
10 |
-
add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
|
11 |
-
add_action( 'init', array( $this, 'add_brands_metafields' ) );
|
12 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
13 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
14 |
-
$this->brand_logo_position();
|
15 |
-
add_action( 'wp', array( $this, 'brand_desc_position' ) );
|
16 |
-
add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
|
17 |
-
$this->add_shortcodes();
|
18 |
-
if( is_plugin_active('js_composer/js_composer.php') || is_plugin_active('visual_composer/js_composer.php') ){
|
19 |
-
add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
|
20 |
-
}
|
21 |
-
add_action( 'widgets_init', array( $this, 'register_widgets' ) );
|
22 |
-
add_filter( 'woocommerce_structured_data_product', array( $this, 'product_microdata' ), 10, 2 );
|
23 |
-
add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
|
24 |
-
add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
|
25 |
-
add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
|
26 |
-
add_action( 'admin_notices', array( $this, 'review_notice' ) );
|
27 |
-
|
28 |
-
add_action( 'wp', function(){
|
29 |
-
if( is_tax('pwb-brand') )
|
30 |
-
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
|
31 |
-
});
|
32 |
-
add_action( 'woocommerce_product_duplicate', array( $this, 'product_duplicate_save' ), 10, 2 );
|
33 |
-
|
34 |
-
add_filter( 'woocommerce_get_breadcrumb', array( $this, 'breadcrumbs' ) );
|
35 |
-
|
36 |
-
add_filter( 'shortcode_atts_products', array( $this, 'extend_products_shortcode_atts' ), 10, 4 );
|
37 |
-
add_filter( 'woocommerce_shortcode_products_query', array( $this, 'extend_products_shortcode' ), 10, 2 );
|
38 |
-
|
39 |
-
add_filter( 'manage_edit-product_sortable_columns', array( $this, 'brands_column_sortable' ), 90 );
|
40 |
-
add_action( 'posts_clauses', array( $this, 'brands_column_sortable_posts' ), 10, 2 );
|
41 |
-
add_filter( 'post_type_link', array( $this, 'brand_name_in_url' ), 10, 2 );
|
42 |
-
add_action( 'pre_get_posts', array( $this, 'search_by_brand_name' ) );
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
$
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
$
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
));
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
$
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
}
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
'
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
"
|
415 |
-
"
|
416 |
-
"
|
417 |
-
"
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
"
|
423 |
-
"
|
424 |
-
"
|
425 |
-
"
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
"
|
430 |
-
"
|
431 |
-
"
|
432 |
-
"
|
433 |
-
"description" => __( "
|
434 |
-
)
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
"
|
448 |
-
"
|
449 |
-
|
450 |
-
|
451 |
-
"
|
452 |
-
"
|
453 |
-
|
454 |
-
|
455 |
-
"
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
"
|
472 |
-
"
|
473 |
-
"
|
474 |
-
"
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
"
|
479 |
-
"
|
480 |
-
"
|
481 |
-
"
|
482 |
-
"description" => __( "
|
483 |
-
),
|
484 |
-
array(
|
485 |
-
"type" => "
|
486 |
-
"
|
487 |
-
"
|
488 |
-
"
|
489 |
-
"value" =>
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
"
|
508 |
-
"
|
509 |
-
"
|
510 |
-
"
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
"
|
536 |
-
"
|
537 |
-
"
|
538 |
-
"
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
"
|
545 |
-
"
|
546 |
-
"
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
"
|
557 |
-
"heading" => __( "
|
558 |
-
"param_name" => "
|
559 |
-
"
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
));
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
'
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
'
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
)
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
'
|
759 |
-
'
|
760 |
-
'
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
)
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
}
|
810 |
-
|
811 |
-
public
|
812 |
-
$
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
$
|
819 |
-
|
820 |
-
)
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
$queried_object
|
864 |
-
|
865 |
-
$
|
866 |
-
$
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
$
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
}
|
879 |
-
|
880 |
-
public
|
881 |
-
|
882 |
-
|
883 |
-
$
|
884 |
-
|
885 |
-
|
886 |
-
if(
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
}
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
$
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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( 'plugin_row_meta', array( '\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands', 'plugin_row_meta' ), 10, 2 );
|
10 |
+
add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
|
11 |
+
add_action( 'init', array( $this, 'add_brands_metafields' ) );
|
12 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
13 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
14 |
+
$this->brand_logo_position();
|
15 |
+
add_action( 'wp', array( $this, 'brand_desc_position' ) );
|
16 |
+
add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
|
17 |
+
$this->add_shortcodes();
|
18 |
+
if( is_plugin_active('js_composer/js_composer.php') || is_plugin_active('visual_composer/js_composer.php') ){
|
19 |
+
add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
|
20 |
+
}
|
21 |
+
add_action( 'widgets_init', array( $this, 'register_widgets' ) );
|
22 |
+
add_filter( 'woocommerce_structured_data_product', array( $this, 'product_microdata' ), 10, 2 );
|
23 |
+
add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
|
24 |
+
add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
|
25 |
+
add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
|
26 |
+
add_action( 'admin_notices', array( $this, 'review_notice' ) );
|
27 |
+
|
28 |
+
add_action( 'wp', function(){
|
29 |
+
if( is_tax('pwb-brand') )
|
30 |
+
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
|
31 |
+
});
|
32 |
+
add_action( 'woocommerce_product_duplicate', array( $this, 'product_duplicate_save' ), 10, 2 );
|
33 |
+
|
34 |
+
add_filter( 'woocommerce_get_breadcrumb', array( $this, 'breadcrumbs' ) );
|
35 |
+
|
36 |
+
add_filter( 'shortcode_atts_products', array( $this, 'extend_products_shortcode_atts' ), 10, 4 );
|
37 |
+
add_filter( 'woocommerce_shortcode_products_query', array( $this, 'extend_products_shortcode' ), 10, 2 );
|
38 |
+
|
39 |
+
add_filter( 'manage_edit-product_sortable_columns', array( $this, 'brands_column_sortable' ), 90 );
|
40 |
+
add_action( 'posts_clauses', array( $this, 'brands_column_sortable_posts' ), 10, 2 );
|
41 |
+
add_filter( 'post_type_link', array( $this, 'brand_name_in_url' ), 10, 2 );
|
42 |
+
add_action( 'pre_get_posts', array( $this, 'search_by_brand_name' ) );
|
43 |
+
|
44 |
+
//clean caches
|
45 |
+
add_action( 'edited_terms', array( $this, 'clean_caches' ), 10, 2 );
|
46 |
+
add_action( 'created_term', array( $this, 'clean_caches_after_edit_brand' ), 10, 3 );
|
47 |
+
add_action( 'delete_term', array( $this, 'clean_caches_after_edit_brand' ), 10, 3 );
|
48 |
+
}
|
49 |
+
|
50 |
+
public function clean_caches( $term_id, $taxonomy ) {
|
51 |
+
if ( $taxonomy != 'pwb-brand' ) return;
|
52 |
+
delete_transient('pwb_az_listing_cache');
|
53 |
+
}
|
54 |
+
|
55 |
+
public function clean_caches_after_edit_brand( $term_id, $tt_id, $taxonomy ) {
|
56 |
+
if ( $taxonomy != 'pwb-brand' ) return;
|
57 |
+
delete_transient('pwb_az_listing_cache');
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Show row meta on the plugin screen.
|
62 |
+
*
|
63 |
+
* @param mixed $links Plugin Row Meta.
|
64 |
+
* @param mixed $file Plugin Base file.
|
65 |
+
*
|
66 |
+
* @return array
|
67 |
+
*/
|
68 |
+
public static function plugin_row_meta( $links, $file ) {
|
69 |
+
if( PWB_PLUGIN_BASENAME === $file ){
|
70 |
+
$row_meta = array(
|
71 |
+
'docs' => '<a target="_blank" rel="noopener noferrer" href="https://github.com/titodevera/perfect-woocommerce-brands/wiki">' . esc_html__( 'Developer docs', 'perfect-woocommerce-brands' ) . '</a>',
|
72 |
+
);
|
73 |
+
return array_merge( $links, $row_meta );
|
74 |
+
}
|
75 |
+
return (array)$links;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function brand_name_in_url( $permalink, $post ){
|
79 |
+
if( $post->post_type == 'product' && strpos( $permalink, '%pwb-brand%' ) !== false ) {
|
80 |
+
$term = 'product';
|
81 |
+
$brands = wp_get_post_terms( $post->ID, 'pwb-brand' );
|
82 |
+
if( ! empty( $brands ) && ! is_wp_error( $brands ) ) $term = current( $brands )->slug;
|
83 |
+
$permalink = str_replace( '%pwb-brand%', $term, $permalink );
|
84 |
+
}
|
85 |
+
return $permalink;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function brands_column_sortable_posts( $clauses, $wp_query ) {
|
89 |
+
global $wpdb;
|
90 |
+
|
91 |
+
if ( isset( $wp_query->query['orderby'] ) && 'taxonomy-pwb-brand' == $wp_query->query['orderby'] ) {
|
92 |
+
|
93 |
+
$clauses['join'] .= "
|
94 |
+
LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id
|
95 |
+
LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id)
|
96 |
+
LEFT OUTER JOIN {$wpdb->terms} USING (term_id)";
|
97 |
+
|
98 |
+
$clauses['where'] .= " AND (taxonomy = 'pwb-brand' OR taxonomy IS NULL)";
|
99 |
+
$clauses['groupby'] = "object_id";
|
100 |
+
$clauses['orderby'] = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC) ";
|
101 |
+
$clauses['orderby'] .= ( 'ASC' == strtoupper( $wp_query->get('order') ) ) ? 'ASC' : 'DESC';
|
102 |
+
}
|
103 |
+
|
104 |
+
return $clauses;
|
105 |
+
}
|
106 |
+
|
107 |
+
public function brands_column_sortable( $columns ){
|
108 |
+
$columns['taxonomy-pwb-brand'] = 'taxonomy-pwb-brand';
|
109 |
+
return $columns;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function extend_products_shortcode_atts( $out, $pairs, $atts, $shortcode ){
|
113 |
+
if( !empty( $atts['brands'] ) ) $out['brands'] = explode( ',', $atts['brands'] );
|
114 |
+
return $out;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function extend_products_shortcode( $query_args, $atts ){
|
118 |
+
|
119 |
+
if( !empty( $atts['brands'] ) ){
|
120 |
+
global $wpdb;
|
121 |
+
|
122 |
+
$terms = $atts['brands'];
|
123 |
+
$terms_count = count( $atts['brands'] );
|
124 |
+
$terms_adapted = '';
|
125 |
+
|
126 |
+
$terms_i = 0;
|
127 |
+
foreach( $terms as $brand ){
|
128 |
+
$terms_adapted .= '"'.$brand.'"';
|
129 |
+
$terms_i++;
|
130 |
+
if( $terms_i < $terms_count ) $terms_adapted .= ',';
|
131 |
+
}
|
132 |
+
|
133 |
+
$ids = $wpdb->get_col( "
|
134 |
+
SELECT DISTINCT tr.object_id
|
135 |
+
FROM {$wpdb->prefix}term_relationships as tr
|
136 |
+
INNER JOIN {$wpdb->prefix}term_taxonomy as tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
137 |
+
INNER JOIN {$wpdb->prefix}terms as t ON tt.term_id = t.term_id
|
138 |
+
WHERE tt.taxonomy LIKE 'pwb_brand' AND t.slug IN ($terms_adapted)
|
139 |
+
" );
|
140 |
+
|
141 |
+
if ( ! empty( $ids ) ) {
|
142 |
+
if ( 1 === count( $ids ) ) {
|
143 |
+
$query_args['p'] = $ids[0];
|
144 |
+
} else {
|
145 |
+
$query_args['post__in'] = $ids;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
return $query_args;
|
151 |
+
}
|
152 |
+
|
153 |
+
public function review_notice(){
|
154 |
+
$show_notice = get_option('wc_pwb_notice_plugin_review', true);
|
155 |
+
$activate_on = get_option('pwb_activate_on', time());
|
156 |
+
$now = time();
|
157 |
+
$one_week = 604800;
|
158 |
+
$date_diff = $now - $activate_on;
|
159 |
+
|
160 |
+
if ( $show_notice && $date_diff > $one_week ) {
|
161 |
+
?>
|
162 |
+
<div class="notice notice-info pwb-notice-dismissible is-dismissible" data-notice="wc_pwb_notice_plugin_review">
|
163 |
+
<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>
|
164 |
+
<p>
|
165 |
+
<?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' ); ?>
|
166 |
+
<?php _e( '<a href="https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands" target="_blank">Translate the plugin</a>', 'perfect-woocommerce-brands' ); ?>
|
167 |
+
<?php _e( '<a href="https://github.com/titodevera/perfect-woocommerce-brands" target="_blank">View on GitHub</a>', 'perfect-woocommerce-brands' ); ?>
|
168 |
+
</p>
|
169 |
+
</div>
|
170 |
+
<?php
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
public function dismiss_pwb_notice(){
|
175 |
+
$notice_name_whitelist = array( 'wc_pwb_notice_plugin_review' );
|
176 |
+
if( isset( $_POST['notice_name'] ) && in_array( $_POST['notice_name'], $notice_name_whitelist ) ){
|
177 |
+
update_option( $_POST['notice_name'], 0 );
|
178 |
+
echo 'ok';
|
179 |
+
}else{
|
180 |
+
echo 'error';
|
181 |
+
}
|
182 |
+
wp_die();
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Adds a settings shortcut to plugin´s actions on plugins list
|
187 |
+
*/
|
188 |
+
public function plugin_action_links( $links ) {
|
189 |
+
$settings_url = esc_url( admin_url( 'admin.php?page=wc-settings&tab=pwb_admin_tab' ) );
|
190 |
+
array_unshift( $links, '<a href="'. $settings_url .'">'.__('Settings','perfect-woocommerce-brands').'</a>' );
|
191 |
+
return $links;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function pwb_brand_filter( $query ){
|
195 |
+
|
196 |
+
if( !empty( $_GET['pwb-brand-filter'] ) ){
|
197 |
+
|
198 |
+
$terms_array = explode( ',', $_GET['pwb-brand-filter'] );
|
199 |
+
|
200 |
+
//remove invalid terms (security)
|
201 |
+
for($i=0; $i < count($terms_array); $i++) {
|
202 |
+
if( !term_exists( $terms_array[$i], 'pwb-brand' ) ) unset($terms_array[$i]);
|
203 |
+
}
|
204 |
+
|
205 |
+
$filterable_product = false;
|
206 |
+
if( is_product_taxonomy() || is_post_type_archive( 'product' ) )
|
207 |
+
$filterable_product = true;
|
208 |
+
|
209 |
+
if( $filterable_product && $query->is_main_query() ) {
|
210 |
+
|
211 |
+
$query->set('tax_query', array(
|
212 |
+
array (
|
213 |
+
'taxonomy' => 'pwb-brand',
|
214 |
+
'field' => 'slug',
|
215 |
+
'terms' => $terms_array
|
216 |
+
)
|
217 |
+
));
|
218 |
+
|
219 |
+
}
|
220 |
+
|
221 |
+
}
|
222 |
+
|
223 |
+
}
|
224 |
+
|
225 |
+
/*
|
226 |
+
* Adds microdata (brands) to single products
|
227 |
+
*/
|
228 |
+
public function product_microdata( $markup, $product ){
|
229 |
+
|
230 |
+
$new_markup = array();
|
231 |
+
$brands = wp_get_post_terms( $product->get_id(), 'pwb-brand');
|
232 |
+
foreach ($brands as $brand) {
|
233 |
+
$new_markup['brand'][] = $brand->name;
|
234 |
+
}
|
235 |
+
|
236 |
+
return array_merge( $markup, $new_markup );
|
237 |
+
|
238 |
+
}
|
239 |
+
|
240 |
+
public function add_shortcodes(){
|
241 |
+
add_shortcode( 'pwb-carousel', array(
|
242 |
+
'\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
|
243 |
+
'carousel_shortcode'
|
244 |
+
) );
|
245 |
+
add_shortcode( 'pwb-product-carousel', array(
|
246 |
+
'\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
|
247 |
+
'product_carousel_shortcode'
|
248 |
+
) );
|
249 |
+
add_shortcode( 'pwb-all-brands', array(
|
250 |
+
'\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
|
251 |
+
'all_brands_shortcode'
|
252 |
+
) );
|
253 |
+
add_shortcode( 'pwb-az-listing', array(
|
254 |
+
'\Perfect_Woocommerce_Brands\Shortcodes\PWB_AZ_Listing_Shortcode',
|
255 |
+
'shortcode'
|
256 |
+
) );
|
257 |
+
add_shortcode( 'pwb-brand', array(
|
258 |
+
'\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
|
259 |
+
'brand_shortcode'
|
260 |
+
) );
|
261 |
+
}
|
262 |
+
|
263 |
+
public function register_widgets(){
|
264 |
+
register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
|
265 |
+
register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
|
266 |
+
register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
|
267 |
+
}
|
268 |
+
|
269 |
+
public function show_brands_in_loop(){
|
270 |
+
|
271 |
+
$brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
|
272 |
+
$image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
|
273 |
+
|
274 |
+
if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
|
275 |
+
|
276 |
+
global $product;
|
277 |
+
$product_id = $product->get_id();
|
278 |
+
$product_brands = wp_get_post_terms($product_id, 'pwb-brand');
|
279 |
+
if(!empty($product_brands)){
|
280 |
+
echo '<div class="pwb-brands-in-loop">';
|
281 |
+
foreach ($product_brands as $brand) {
|
282 |
+
|
283 |
+
echo '<span>';
|
284 |
+
$brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
|
285 |
+
$attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
|
286 |
+
|
287 |
+
$attachment_html = wp_get_attachment_image( $attachment_id, $image_size_selected );
|
288 |
+
if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
|
289 |
+
echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
|
290 |
+
}else{
|
291 |
+
echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
|
292 |
+
}
|
293 |
+
echo '</span>';
|
294 |
+
|
295 |
+
}
|
296 |
+
echo '</div>';
|
297 |
+
}
|
298 |
+
|
299 |
+
}
|
300 |
+
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* woocommerce_single_product_summary hook.
|
305 |
+
*
|
306 |
+
* @hooked woocommerce_template_single_title - 5
|
307 |
+
* @hooked woocommerce_template_single_rating - 10
|
308 |
+
* @hooked woocommerce_template_single_price - 10
|
309 |
+
* @hooked woocommerce_template_single_excerpt - 20
|
310 |
+
* @hooked woocommerce_template_single_add_to_cart - 30
|
311 |
+
* @hooked woocommerce_template_single_meta - 40
|
312 |
+
* @hooked woocommerce_template_single_sharing - 50
|
313 |
+
*/
|
314 |
+
private function brand_logo_position(){
|
315 |
+
$position = 41;
|
316 |
+
$position_selected = get_option('wc_pwb_admin_tab_brand_single_position');
|
317 |
+
if ( ! $position_selected ) {
|
318 |
+
update_option( 'wc_pwb_admin_tab_brand_single_position', 'after_meta' );
|
319 |
+
}
|
320 |
+
|
321 |
+
switch ( $position_selected ) {
|
322 |
+
case 'before_title':
|
323 |
+
$position = 4;
|
324 |
+
break;
|
325 |
+
case 'after_title':
|
326 |
+
$position = 6;
|
327 |
+
break;
|
328 |
+
case 'after_price':
|
329 |
+
$position = 11;
|
330 |
+
break;
|
331 |
+
case 'after_excerpt':
|
332 |
+
$position = 21;
|
333 |
+
break;
|
334 |
+
case 'after_add_to_cart':
|
335 |
+
$position = 31;
|
336 |
+
break;
|
337 |
+
case 'after_meta':
|
338 |
+
$position = 41;
|
339 |
+
break;
|
340 |
+
case 'after_sharing':
|
341 |
+
$position = 51;
|
342 |
+
break;
|
343 |
+
}
|
344 |
+
|
345 |
+
if ( $position_selected == 'meta' ) {
|
346 |
+
add_action( 'woocommerce_product_meta_end', [ $this, 'action_woocommerce_single_product_summary' ] );
|
347 |
+
} else {
|
348 |
+
add_action( 'woocommerce_single_product_summary', [ $this, 'action_woocommerce_single_product_summary' ], $position );
|
349 |
+
}
|
350 |
+
|
351 |
+
}
|
352 |
+
|
353 |
+
public function brand_desc_position(){
|
354 |
+
|
355 |
+
if( is_tax('pwb-brand') && !is_paged() ){
|
356 |
+
|
357 |
+
$show_banner = get_option('wc_pwb_admin_tab_brand_banner');
|
358 |
+
$show_desc = get_option('wc_pwb_admin_tab_brand_desc');
|
359 |
+
|
360 |
+
if( (!$show_banner || $show_banner == 'yes') && (!$show_desc || $show_desc == 'yes') ){
|
361 |
+
//show banner and description before loop
|
362 |
+
add_action( 'woocommerce_archive_description', array( $this, 'print_brand_banner_and_desc' ), 15);
|
363 |
+
|
364 |
+
}elseif( $show_banner == 'yes_after_loop' && $show_desc == 'yes_after_loop' ){
|
365 |
+
//show banner and description after loop
|
366 |
+
add_action( 'woocommerce_after_main_content', array( $this, 'print_brand_banner_and_desc' ), 9);
|
367 |
+
|
368 |
+
}else{
|
369 |
+
//show banner and description independently
|
370 |
+
|
371 |
+
if( !$show_banner || $show_banner == 'yes' ){
|
372 |
+
add_action( 'woocommerce_archive_description', array( $this, 'print_brand_banner' ), 15);
|
373 |
+
}elseif( $show_banner == 'yes_after_loop' ){
|
374 |
+
add_action( 'woocommerce_after_main_content', array( $this, 'print_brand_banner' ), 9);
|
375 |
+
}
|
376 |
+
|
377 |
+
if( !$show_desc || $show_desc == 'yes' ){
|
378 |
+
add_action( 'woocommerce_archive_description', array( $this, 'print_brand_desc' ), 15);
|
379 |
+
}elseif( $show_desc == 'yes_after_loop' ){
|
380 |
+
add_action( 'woocommerce_after_main_content', array( $this, 'print_brand_desc' ), 9);
|
381 |
+
}
|
382 |
+
|
383 |
+
}
|
384 |
+
|
385 |
+
}
|
386 |
+
|
387 |
+
}
|
388 |
+
|
389 |
+
/*
|
390 |
+
* Maps shortcode (for visual composer plugin)
|
391 |
+
*
|
392 |
+
* @since 1.0
|
393 |
+
* @link https://vc.wpbakery.com/
|
394 |
+
* @return mixed
|
395 |
+
*/
|
396 |
+
public function vc_map_shortcodes(){
|
397 |
+
$available_image_sizes_adapted = array();
|
398 |
+
$available_image_sizes = get_intermediate_image_sizes();
|
399 |
+
|
400 |
+
foreach($available_image_sizes as $image_size){
|
401 |
+
$available_image_sizes_adapted[$image_size] = $image_size;
|
402 |
+
}
|
403 |
+
|
404 |
+
vc_map(array(
|
405 |
+
"name" => __( "PWB Product carousel", "perfect-woocommerce-brands" ),
|
406 |
+
"description" => __( "Product carousel by brand or by category", "perfect-woocommerce-brands" ),
|
407 |
+
"base" => "pwb-product-carousel",
|
408 |
+
"class" => "",
|
409 |
+
"icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
|
410 |
+
"category" => "WooCommerce",
|
411 |
+
"params" => array(
|
412 |
+
array(
|
413 |
+
"type" => "dropdown",
|
414 |
+
"heading" => __( "Brand", "perfect-woocommerce-brands" ),
|
415 |
+
"param_name" => "brand",
|
416 |
+
"admin_label" => true,
|
417 |
+
"value" => self::get_brands_array( true )
|
418 |
+
),
|
419 |
+
array(
|
420 |
+
"type" => "textfield",
|
421 |
+
"holder" => "div",
|
422 |
+
"heading" => __( "Products", "perfect-woocommerce-brands" ),
|
423 |
+
"param_name" => "products",
|
424 |
+
"value" => "10",
|
425 |
+
"description" => __( "Number of products to load", "perfect-woocommerce-brands" )
|
426 |
+
),
|
427 |
+
array(
|
428 |
+
"type" => "textfield",
|
429 |
+
"holder" => "div",
|
430 |
+
"heading" => __( "Products to show", "perfect-woocommerce-brands" ),
|
431 |
+
"param_name" => "products_to_show",
|
432 |
+
"value" => "5",
|
433 |
+
"description" => __( "Number of products to show", "perfect-woocommerce-brands" )
|
434 |
+
),
|
435 |
+
array(
|
436 |
+
"type" => "textfield",
|
437 |
+
"holder" => "div",
|
438 |
+
"heading" => __( "Products to scroll", "perfect-woocommerce-brands" ),
|
439 |
+
"param_name" => "products_to_scroll",
|
440 |
+
"value" => "1",
|
441 |
+
"description" => __( "Number of products to scroll", "perfect-woocommerce-brands" )
|
442 |
+
),
|
443 |
+
array(
|
444 |
+
"type" => "checkbox",
|
445 |
+
"holder" => "div",
|
446 |
+
"heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
|
447 |
+
"param_name" => "autoplay",
|
448 |
+
"description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
|
449 |
+
),
|
450 |
+
array(
|
451 |
+
"type" => "checkbox",
|
452 |
+
"holder" => "div",
|
453 |
+
"heading" => __( "Arrows", "perfect-woocommerce-brands" ),
|
454 |
+
"param_name" => "arrows",
|
455 |
+
"description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
|
456 |
+
)
|
457 |
+
)
|
458 |
+
));
|
459 |
+
|
460 |
+
vc_map(array(
|
461 |
+
"name" => __( "PWB Brands carousel", "perfect-woocommerce-brands" ),
|
462 |
+
"description" => __( "Brands carousel", "perfect-woocommerce-brands" ),
|
463 |
+
"base" => "pwb-carousel",
|
464 |
+
"class" => "",
|
465 |
+
"icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
|
466 |
+
"category" => "WooCommerce",
|
467 |
+
"params" => array(
|
468 |
+
array(
|
469 |
+
"type" => "textfield",
|
470 |
+
"holder" => "div",
|
471 |
+
"heading" => __( "Items", "perfect-woocommerce-brands" ),
|
472 |
+
"param_name" => "items",
|
473 |
+
"value" => "10",
|
474 |
+
"description" => __( "Number of items to load (or 'featured')", "perfect-woocommerce-brands" )
|
475 |
+
),
|
476 |
+
array(
|
477 |
+
"type" => "textfield",
|
478 |
+
"holder" => "div",
|
479 |
+
"heading" => __( "Items to show", "perfect-woocommerce-brands" ),
|
480 |
+
"param_name" => "items_to_show",
|
481 |
+
"value" => "5",
|
482 |
+
"description" => __( "Number of items to show", "perfect-woocommerce-brands" )
|
483 |
+
),
|
484 |
+
array(
|
485 |
+
"type" => "textfield",
|
486 |
+
"holder" => "div",
|
487 |
+
"heading" => __( "Items to scroll", "perfect-woocommerce-brands" ),
|
488 |
+
"param_name" => "items_to_scroll",
|
489 |
+
"value" => "1",
|
490 |
+
"description" => __( "Number of items to scroll", "perfect-woocommerce-brands" )
|
491 |
+
),
|
492 |
+
array(
|
493 |
+
"type" => "checkbox",
|
494 |
+
"holder" => "div",
|
495 |
+
"heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
|
496 |
+
"param_name" => "autoplay",
|
497 |
+
"description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
|
498 |
+
),
|
499 |
+
array(
|
500 |
+
"type" => "checkbox",
|
501 |
+
"holder" => "div",
|
502 |
+
"heading" => __( "Arrows", "perfect-woocommerce-brands" ),
|
503 |
+
"param_name" => "arrows",
|
504 |
+
"description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
|
505 |
+
),
|
506 |
+
array(
|
507 |
+
"type" => "dropdown",
|
508 |
+
"heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
|
509 |
+
"param_name" => "image_size",
|
510 |
+
"admin_label" => true,
|
511 |
+
"value" => $available_image_sizes_adapted
|
512 |
+
)
|
513 |
+
)
|
514 |
+
|
515 |
+
|
516 |
+
));
|
517 |
+
|
518 |
+
vc_map(array(
|
519 |
+
"name" => __( "PWB All brands", "perfect-woocommerce-brands" ),
|
520 |
+
"description" => __( "Show all brands", "perfect-woocommerce-brands" ),
|
521 |
+
"base" => "pwb-all-brands",
|
522 |
+
"class" => "",
|
523 |
+
"icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
|
524 |
+
"category" => "WooCommerce",
|
525 |
+
"params" => array(
|
526 |
+
array(
|
527 |
+
"type" => "textfield",
|
528 |
+
"holder" => "div",
|
529 |
+
"heading" => __( "Brands per page", "perfect-woocommerce-brands" ),
|
530 |
+
"param_name" => "per_page",
|
531 |
+
"value" => "10",
|
532 |
+
"description" => __( "Show x brands per page", "perfect-woocommerce-brands" )
|
533 |
+
),
|
534 |
+
array(
|
535 |
+
"type" => "dropdown",
|
536 |
+
"heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
|
537 |
+
"param_name" => "image_size",
|
538 |
+
"admin_label" => true,
|
539 |
+
"value" => $available_image_sizes_adapted
|
540 |
+
),
|
541 |
+
array(
|
542 |
+
"type" => "dropdown",
|
543 |
+
"heading" => __( "Order by", "perfect-woocommerce-brands" ),
|
544 |
+
"param_name" => "order_by",
|
545 |
+
"admin_label" => true,
|
546 |
+
"value" => array(
|
547 |
+
'name' => 'name',
|
548 |
+
'slug' => 'slug',
|
549 |
+
'term_id' => 'term_id',
|
550 |
+
'id' => 'id',
|
551 |
+
'description' => 'description',
|
552 |
+
'rand' => 'rand'
|
553 |
+
)
|
554 |
+
),
|
555 |
+
array(
|
556 |
+
"type" => "dropdown",
|
557 |
+
"heading" => __( "Order", "perfect-woocommerce-brands" ),
|
558 |
+
"param_name" => "order",
|
559 |
+
"admin_label" => true,
|
560 |
+
"value" => array(
|
561 |
+
'ASC' => 'ASC',
|
562 |
+
'DSC' => 'DSC'
|
563 |
+
)
|
564 |
+
),
|
565 |
+
array(
|
566 |
+
"type" => "dropdown",
|
567 |
+
"heading" => __( "Title position", "perfect-woocommerce-brands" ),
|
568 |
+
"param_name" => "title_position",
|
569 |
+
"admin_label" => true,
|
570 |
+
"value" => array(
|
571 |
+
__( "Before image", "perfect-woocommerce-brands" ) => 'before',
|
572 |
+
__( "After image", "perfect-woocommerce-brands" ) => 'after',
|
573 |
+
__( "Hide", "perfect-woocommerce-brands" ) => 'none'
|
574 |
+
)
|
575 |
+
),
|
576 |
+
array(
|
577 |
+
"type" => "checkbox",
|
578 |
+
"holder" => "div",
|
579 |
+
"heading" => __( "Hide empty", "perfect-woocommerce-brands" ),
|
580 |
+
"param_name" => "hide_empty",
|
581 |
+
"description" => __( "Hide brands that have not been assigned to any product", "perfect-woocommerce-brands" )
|
582 |
+
)
|
583 |
+
)
|
584 |
+
|
585 |
+
|
586 |
+
));
|
587 |
+
|
588 |
+
vc_map(array(
|
589 |
+
"name" => __( "PWB AZ Listing", "perfect-woocommerce-brands" ),
|
590 |
+
"description" => __( "AZ Listing for brands", "perfect-woocommerce-brands" ),
|
591 |
+
"base" => "pwb-az-listing",
|
592 |
+
"class" => "",
|
593 |
+
"icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
|
594 |
+
"category" => "WooCommerce",
|
595 |
+
"params" => array(
|
596 |
+
array(
|
597 |
+
"type" => "dropdown",
|
598 |
+
"heading" => __( "Only parent brands", "perfect-woocommerce-brands" ),
|
599 |
+
"param_name" => "only_parents",
|
600 |
+
"admin_label" => true,
|
601 |
+
"value" => array( __('No') => 'no', __('Yes') => 'yes' ),
|
602 |
+
)
|
603 |
+
)
|
604 |
+
));
|
605 |
+
|
606 |
+
vc_map(array(
|
607 |
+
"name" => __( "PWB brand", "perfect-woocommerce-brands" ),
|
608 |
+
"description" => __( "Show brand for a specific product", "perfect-woocommerce-brands" ),
|
609 |
+
"base" => "pwb-brand",
|
610 |
+
"class" => "",
|
611 |
+
"icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
|
612 |
+
"category" => "WooCommerce",
|
613 |
+
|
614 |
+
"params" => array(
|
615 |
+
array(
|
616 |
+
"type" => "textfield",
|
617 |
+
"holder" => "div",
|
618 |
+
"heading" => __( "Product id", "perfect-woocommerce-brands" ),
|
619 |
+
"param_name" => "product_id",
|
620 |
+
"value" => null,
|
621 |
+
"description" => __( "Product id (post id)", "perfect-woocommerce-brands" )
|
622 |
+
),
|
623 |
+
array(
|
624 |
+
"type" => "dropdown",
|
625 |
+
"heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
|
626 |
+
"param_name" => "image_size",
|
627 |
+
"admin_label" => true,
|
628 |
+
"value" => $available_image_sizes_adapted
|
629 |
+
)
|
630 |
+
|
631 |
+
)
|
632 |
+
|
633 |
+
|
634 |
+
));
|
635 |
+
}
|
636 |
+
|
637 |
+
public function action_woocommerce_single_product_summary() {
|
638 |
+
$brands = wp_get_post_terms( get_the_ID(), 'pwb-brand');
|
639 |
+
|
640 |
+
if( !is_wp_error( $brands ) ){
|
641 |
+
|
642 |
+
if( sizeof( $brands ) > 0 ){
|
643 |
+
|
644 |
+
$show_as = get_option( 'wc_pwb_admin_tab_brands_in_single' );
|
645 |
+
|
646 |
+
if( $show_as!='no' ){
|
647 |
+
|
648 |
+
do_action( 'pwb_before_single_product_brands', $brands );
|
649 |
+
|
650 |
+
echo '<div class="pwb-single-product-brands pwb-clearfix">';
|
651 |
+
|
652 |
+
if ( $show_as == 'brand_link' ) {
|
653 |
+
$before_brands_links = '<span class="pwb-text-before-brands-links">';
|
654 |
+
$before_brands_links.= apply_filters( 'pwb_text_before_brands_links', __('Brands', 'perfect-woocommerce-brands') );
|
655 |
+
$before_brands_links.= ':</span>';
|
656 |
+
echo apply_filters( 'pwb_html_before_brands_links', $before_brands_links );
|
657 |
+
}
|
658 |
+
|
659 |
+
foreach( $brands as $brand ){
|
660 |
+
$brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
|
661 |
+
$attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
|
662 |
+
|
663 |
+
$image_size = 'thumbnail';
|
664 |
+
$image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
|
665 |
+
if($image_size_selected!=false){
|
666 |
+
$image_size = $image_size_selected;
|
667 |
+
}
|
668 |
+
|
669 |
+
$attachment_html = wp_get_attachment_image($attachment_id,$image_size);
|
670 |
+
|
671 |
+
if( !empty($attachment_html) && $show_as=='brand_image' || !empty($attachment_html) && !$show_as ){
|
672 |
+
echo '<a href="'.$brand_link.'" title="'.$brand->name.'">'.$attachment_html.'</a>';
|
673 |
+
}else{
|
674 |
+
echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
|
675 |
+
}
|
676 |
+
}
|
677 |
+
echo '</div>';
|
678 |
+
|
679 |
+
do_action( 'pwb_after_single_product_brands', $brands );
|
680 |
+
|
681 |
+
}
|
682 |
+
|
683 |
+
}
|
684 |
+
|
685 |
+
}
|
686 |
+
|
687 |
+
}
|
688 |
+
|
689 |
+
public function enqueue_scripts(){
|
690 |
+
|
691 |
+
wp_register_script(
|
692 |
+
'pwb-lib-slick',
|
693 |
+
PWB_PLUGIN . '/assets/lib/slick/slick.min.js',
|
694 |
+
array('jquery'),
|
695 |
+
'1.8.0',
|
696 |
+
true
|
697 |
+
);
|
698 |
+
|
699 |
+
wp_register_style(
|
700 |
+
'pwb-lib-slick',
|
701 |
+
PWB_PLUGIN . '/assets/lib/slick/slick.css',
|
702 |
+
array(),
|
703 |
+
'1.8.0',
|
704 |
+
'all'
|
705 |
+
);
|
706 |
+
|
707 |
+
wp_enqueue_style(
|
708 |
+
'pwb-styles-frontend',
|
709 |
+
PWB_PLUGIN . '/assets/css/styles-frontend.min.css',
|
710 |
+
array(),
|
711 |
+
PWB_PLUGIN_VERSION,
|
712 |
+
'all'
|
713 |
+
);
|
714 |
+
|
715 |
+
wp_register_script(
|
716 |
+
'pwb-functions-frontend',
|
717 |
+
PWB_PLUGIN . '/assets/js/functions-frontend.min.js',
|
718 |
+
array('jquery'),
|
719 |
+
PWB_PLUGIN_VERSION,
|
720 |
+
true
|
721 |
+
);
|
722 |
+
|
723 |
+
wp_localize_script( 'pwb-functions-frontend', 'pwb_ajax_object', array(
|
724 |
+
'carousel_prev' => apply_filters('pwb_carousel_prev','<'),
|
725 |
+
'carousel_next' => apply_filters('pwb_carousel_next','>')
|
726 |
+
) );
|
727 |
+
|
728 |
+
wp_enqueue_script('pwb-functions-frontend');
|
729 |
+
|
730 |
+
}
|
731 |
+
|
732 |
+
public function admin_enqueue_scripts( $hook ){
|
733 |
+
$screen = get_current_screen();
|
734 |
+
if($hook == 'edit-tags.php' && $screen->taxonomy == 'pwb-brand' || $hook == 'term.php' && $screen->taxonomy == 'pwb-brand') {
|
735 |
+
wp_enqueue_media();
|
736 |
+
}
|
737 |
+
|
738 |
+
wp_enqueue_style('pwb-styles-admin', PWB_PLUGIN . '/assets/css/styles-admin.min.css', array(), PWB_PLUGIN_VERSION);
|
739 |
+
|
740 |
+
wp_register_script('pwb-functions-admin', PWB_PLUGIN . '/assets/js/functions-admin.min.js', array('jquery'), PWB_PLUGIN_VERSION, true);
|
741 |
+
wp_localize_script( 'pwb-functions-admin', 'pwb_ajax_object_admin', array(
|
742 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
743 |
+
'site_url' => site_url(),
|
744 |
+
'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
|
745 |
+
'translations' => array(
|
746 |
+
'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
|
747 |
+
'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands'),
|
748 |
+
'dummy_data_notice' => __('¿Start loading dummy data?','perfect-woocommerce-brands'),
|
749 |
+
'dummy_data' => __('We are importing the dummy data. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
|
750 |
+
)
|
751 |
+
) );
|
752 |
+
wp_enqueue_script( 'pwb-functions-admin' );
|
753 |
+
|
754 |
+
}
|
755 |
+
|
756 |
+
public function register_brands_taxonomy(){
|
757 |
+
$labels = array(
|
758 |
+
'name' => __( 'Brands', 'perfect-woocommerce-brands' ),
|
759 |
+
'singular_name' => __( 'Brand', 'perfect-woocommerce-brands' ),
|
760 |
+
'menu_name' => __( 'Brands', 'perfect-woocommerce-brands' ),
|
761 |
+
'all_items' => __( 'All Brands', 'perfect-woocommerce-brands' ),
|
762 |
+
'edit_item' => __( 'Edit Brand', 'perfect-woocommerce-brands' ),
|
763 |
+
'view_item' => __( 'View Brand', 'perfect-woocommerce-brands' ),
|
764 |
+
'update_item' => __( 'Update Brand', 'perfect-woocommerce-brands' ),
|
765 |
+
'add_new_item' => __( 'Add New Brand', 'perfect-woocommerce-brands' ),
|
766 |
+
'new_item_name' => __( 'New Brand Name', 'perfect-woocommerce-brands' ),
|
767 |
+
'parent_item' => __( 'Parent Brand', 'perfect-woocommerce-brands' ),
|
768 |
+
'parent_item_colon' => __( 'Parent Brand:', 'perfect-woocommerce-brands' ),
|
769 |
+
'search_items' => __( 'Search Brands', 'perfect-woocommerce-brands' ),
|
770 |
+
'popular_items' => __( 'Popular Brands', 'perfect-woocommerce-brands' ),
|
771 |
+
'separate_items_with_commas' => __( 'Separate brands with commas', 'perfect-woocommerce-brands' ),
|
772 |
+
'add_or_remove_items' => __( 'Add or remove brands', 'perfect-woocommerce-brands' ),
|
773 |
+
'choose_from_most_used' => __( 'Choose from the most used brands', 'perfect-woocommerce-brands' ),
|
774 |
+
'not_found' => __( 'No brands found', 'perfect-woocommerce-brands' )
|
775 |
+
);
|
776 |
+
|
777 |
+
$new_slug = get_option('wc_pwb_admin_tab_slug');
|
778 |
+
$old_slug = get_option('old_wc_pwb_admin_tab_slug');
|
779 |
+
|
780 |
+
$new_slug = ($new_slug!=false) ? $new_slug : 'brand';
|
781 |
+
$old_slug = ($old_slug!=false) ? $old_slug : 'null';
|
782 |
+
|
783 |
+
$args = array(
|
784 |
+
'hierarchical' => true,
|
785 |
+
'labels' => $labels,
|
786 |
+
'show_ui' => true,
|
787 |
+
'query_var' => true,
|
788 |
+
'public' => true,
|
789 |
+
'show_admin_column' => true,
|
790 |
+
'rewrite' => array(
|
791 |
+
'slug' => apply_filters( 'pwb_taxonomy_rewrite', $new_slug ),
|
792 |
+
'hierarchical'=> true,
|
793 |
+
'with_front' => apply_filters( 'pwb_taxonomy_with_front', true ),
|
794 |
+
'ep_mask' => EP_PERMALINK
|
795 |
+
)
|
796 |
+
);
|
797 |
+
|
798 |
+
register_taxonomy( 'pwb-brand', array( 'product' ), $args );
|
799 |
+
|
800 |
+
if($new_slug != false && $old_slug!= false && $new_slug != $old_slug){
|
801 |
+
flush_rewrite_rules();
|
802 |
+
update_option( 'old_wc_pwb_admin_tab_slug', $new_slug );
|
803 |
+
}
|
804 |
+
|
805 |
+
}
|
806 |
+
|
807 |
+
public function add_brands_metafields(){
|
808 |
+
register_meta( 'term', 'pwb_brand_image', array($this,'add_brands_metafields_sanitize') );
|
809 |
+
}
|
810 |
+
|
811 |
+
public function add_brands_metafields_sanitize($brand_img){
|
812 |
+
return $brand_img;
|
813 |
+
}
|
814 |
+
|
815 |
+
public static function get_brands( $hide_empty = false, $order_by = 'name', $order = 'ASC', $only_featured = false, $pwb_term = false, $only_parents = false ){
|
816 |
+
$result = array();
|
817 |
+
|
818 |
+
$brands_args = array( 'hide_empty' => $hide_empty, 'orderby' => $order_by, 'order' => $order );
|
819 |
+
if( $only_featured ) $brands_args['meta_query'] = array( array( 'key' => 'pwb_featured_brand', 'value' => true ) );
|
820 |
+
if( $only_parents ) $brands_args['parent'] = 0;
|
821 |
+
|
822 |
+
$brands = get_terms('pwb-brand', $brands_args);
|
823 |
+
|
824 |
+
foreach( $brands as $key => $brand ){
|
825 |
+
|
826 |
+
if( $pwb_term ){
|
827 |
+
$brands[$key] = new PWB_Term( $brand );
|
828 |
+
}else{
|
829 |
+
$brand_image_id = get_term_meta($brand->term_id, 'pwb_brand_image', true);
|
830 |
+
$brand_banner_id = get_term_meta($brand->term_id, 'pwb_brand_banner', true);
|
831 |
+
$brand->brand_image = wp_get_attachment_image_src($brand_image_id);
|
832 |
+
$brand->brand_banner = wp_get_attachment_image_src($brand_banner_id);
|
833 |
+
}
|
834 |
+
|
835 |
+
}
|
836 |
+
|
837 |
+
if( is_array($brands) && count($brands)>0 ) $result = $brands;
|
838 |
+
|
839 |
+
return $result;
|
840 |
+
}
|
841 |
+
|
842 |
+
public static function get_brands_array( $is_select = false ){
|
843 |
+
$result = array();
|
844 |
+
|
845 |
+
//if is for select input adds default value
|
846 |
+
if( $is_select )
|
847 |
+
$result[0] = __( 'All', 'perfect-woocommerce-brands' );
|
848 |
+
|
849 |
+
$brands = get_terms('pwb-brand',array(
|
850 |
+
'hide_empty' => false
|
851 |
+
));
|
852 |
+
|
853 |
+
foreach ($brands as $brand) {
|
854 |
+
$result[$brand->term_id] = $brand->slug;
|
855 |
+
}
|
856 |
+
|
857 |
+
return $result;
|
858 |
+
|
859 |
+
}
|
860 |
+
|
861 |
+
public function print_brand_banner(){
|
862 |
+
$queried_object = get_queried_object();
|
863 |
+
$brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
|
864 |
+
$brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
|
865 |
+
$show_banner = get_option('wc_pwb_admin_tab_brand_banner');
|
866 |
+
$show_banner = get_option('wc_pwb_admin_tab_brand_banner');
|
867 |
+
$show_banner_class = ( !$show_banner || $show_banner == 'yes' ) ? 'pwb-before-loop' : 'pwb-after-loop';
|
868 |
+
|
869 |
+
if( $brand_banner!='' ){
|
870 |
+
echo '<div class="pwb-brand-banner pwb-clearfix '.$show_banner_class.'">';
|
871 |
+
if( $brand_banner_link!='' ){
|
872 |
+
echo '<a href="'.site_url($brand_banner_link).'">'.wp_get_attachment_image ( $brand_banner, 'full', false ).'</a>';
|
873 |
+
}else{
|
874 |
+
echo wp_get_attachment_image ( $brand_banner, 'full', false );
|
875 |
+
}
|
876 |
+
echo '</div>';
|
877 |
+
}
|
878 |
+
}
|
879 |
+
|
880 |
+
public function print_brand_desc(){
|
881 |
+
$queried_object = get_queried_object();
|
882 |
+
$show_desc = get_option('wc_pwb_admin_tab_brand_desc');
|
883 |
+
$show_desc = get_option('wc_pwb_admin_tab_brand_desc');
|
884 |
+
$show_desc_class = ( !$show_desc || $show_desc == 'yes' ) ? 'pwb-before-loop' : 'pwb-after-loop';
|
885 |
+
|
886 |
+
if( $queried_object->description != '' && $show_desc !== 'no' ){
|
887 |
+
echo '<div class="pwb-brand-description '.$show_desc_class.'">';
|
888 |
+
echo do_shortcode( wpautop( $queried_object->description ) );
|
889 |
+
echo '</div>';
|
890 |
+
}
|
891 |
+
}
|
892 |
+
|
893 |
+
public function print_brand_banner_and_desc(){
|
894 |
+
$queried_object = get_queried_object();
|
895 |
+
|
896 |
+
$show_desc = get_option('wc_pwb_admin_tab_brand_desc');
|
897 |
+
$show_desc_class = ( !$show_desc || $show_desc == 'yes' ) ? 'pwb-before-loop' : 'pwb-after-loop';
|
898 |
+
|
899 |
+
$brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
|
900 |
+
$brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
|
901 |
+
|
902 |
+
if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
|
903 |
+
echo '<div class="pwb-brand-banner-cont '.$show_desc_class.'">';
|
904 |
+
$this->print_brand_banner();
|
905 |
+
$this->print_brand_desc();
|
906 |
+
echo '</div>';
|
907 |
+
}
|
908 |
+
|
909 |
+
}
|
910 |
+
|
911 |
+
public static function render_template( $name, $folder = '', $data, $private = true ){
|
912 |
+
//default template
|
913 |
+
if( $folder ) $folder = $folder . '/';
|
914 |
+
$template_file = dirname( __DIR__ ) . '/templates/' . $folder . $name . '.php';
|
915 |
+
|
916 |
+
//theme overrides
|
917 |
+
if( !$private ){
|
918 |
+
$theme_template_path = get_stylesheet_directory() . '/perfect-woocommerce-brands/';
|
919 |
+
if( file_exists( $theme_template_path . $folder . $name . '.php' ) )
|
920 |
+
$template_file = $theme_template_path . $folder . $name . '.php';
|
921 |
+
}
|
922 |
+
|
923 |
+
extract($data);
|
924 |
+
|
925 |
+
ob_start();
|
926 |
+
include $template_file;
|
927 |
+
return ob_get_clean();
|
928 |
+
}
|
929 |
+
|
930 |
+
public function product_duplicate_save( $duplicate, $product ){
|
931 |
+
$product_brands = wp_get_object_terms( $product->get_id(), 'pwb-brand', array( 'fields' => 'ids' ) );
|
932 |
+
wp_set_object_terms( $duplicate->get_id(), $product_brands, 'pwb-brand' );
|
933 |
+
}
|
934 |
+
|
935 |
+
public function breadcrumbs( $crumbs ) {
|
936 |
+
|
937 |
+
if ( is_tax('pwb-brand') ) {
|
938 |
+
|
939 |
+
$brands_page_id = get_option('wc_pwb_admin_tab_brands_page_id');
|
940 |
+
|
941 |
+
if ( ! empty( $brands_page_id ) && $brands_page_id != '-' ) {
|
942 |
+
|
943 |
+
$cur_brand = get_queried_object();
|
944 |
+
$brand_ancestors = get_ancestors( $cur_brand->term_id, 'pwb-brand', 'taxonomy' );
|
945 |
+
|
946 |
+
$brand_page_pos = count( $crumbs ) - ( count( $brand_ancestors ) + 2 );
|
947 |
+
if ( is_paged() ) $brand_page_pos -= 1;
|
948 |
+
|
949 |
+
if ( isset( $crumbs[$brand_page_pos][1] ) )
|
950 |
+
$crumbs[$brand_page_pos][1] = get_page_link( $brands_page_id );
|
951 |
+
|
952 |
+
}
|
953 |
+
|
954 |
+
}
|
955 |
+
|
956 |
+
return $crumbs;
|
957 |
+
}
|
958 |
+
|
959 |
+
/**
|
960 |
+
* Redirect if the search matchs with a brands name
|
961 |
+
* Better search experience
|
962 |
+
*/
|
963 |
+
public function search_by_brand_name( $query ) {
|
964 |
+
|
965 |
+
if ( wp_doing_ajax() ) return;
|
966 |
+
|
967 |
+
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
|
968 |
+
|
969 |
+
$brands = get_terms( array( 'taxonomy' => 'pwb-brand', 'fields' => 'id=>name' ) );
|
970 |
+
|
971 |
+
if ( $match = array_search( strtolower( trim( $query->get('s') ) ), array_map('strtolower', $brands ) ) ) {
|
972 |
+
|
973 |
+
wp_redirect( get_term_link( $match ) );
|
974 |
+
exit;
|
975 |
+
|
976 |
+
}
|
977 |
+
|
978 |
+
}
|
979 |
+
|
980 |
+
}
|
981 |
+
|
982 |
+
}
|
classes/class-pwb-api-support.php
CHANGED
@@ -1,140 +1,140 @@
|
|
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( "wc/v1", "wc/v2", "wc/v3" );
|
11 |
-
private $base = 'brands';
|
12 |
-
|
13 |
-
function __construct(){
|
14 |
-
add_action('rest_api_init', array($this, 'register_endpoints'));
|
15 |
-
add_action('rest_api_init', array($this, 'register_fields'));
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Registers the endpoint for all possible $namespaces
|
20 |
-
*/
|
21 |
-
public function register_endpoints(){
|
22 |
-
foreach( $this->namespaces as $namespace ) {
|
23 |
-
register_rest_route($namespace, '/'.$this->base, array(
|
24 |
-
array(
|
25 |
-
'methods' => WP_REST_Server::READABLE,
|
26 |
-
'callback' => function () {
|
27 |
-
return rest_ensure_response(
|
28 |
-
Perfect_Woocommerce_Brands::get_brands()
|
29 |
-
);
|
30 |
-
}
|
31 |
-
),
|
32 |
-
array(
|
33 |
-
'methods' => WP_REST_Server::CREATABLE,
|
34 |
-
'callback' => array( $this, 'create_brand' )
|
35 |
-
),
|
36 |
-
array(
|
37 |
-
'methods' => WP_REST_Server::DELETABLE,
|
38 |
-
'callback' => array( $this, 'delete_brand' )
|
39 |
-
)
|
40 |
-
));
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
public function delete_brand( $request ){
|
45 |
-
foreach( $request['brands'] as $brand ){
|
46 |
-
$delete_result = wp_delete_term( $brand, 'pwb-brand' );
|
47 |
-
if( is_wp_error( $delete_result ) ) return $delete_result;
|
48 |
-
}
|
49 |
-
return true;
|
50 |
-
}
|
51 |
-
|
52 |
-
public function create_brand( $request ){
|
53 |
-
$new_brand = wp_insert_term( $request['name'], 'pwb-brand', array( 'slug' => $request['slug'], 'description' => $request['description'] ) );
|
54 |
-
if( !is_wp_error( $new_brand ) ){
|
55 |
-
return array('id' => $new_brand['term_id'], 'name' => $request['name'], 'slug' => $request['slug'], 'description' => $request['description']);
|
56 |
-
}else{
|
57 |
-
return $new_brand;
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Entry point for all rest field settings
|
63 |
-
*/
|
64 |
-
public function register_fields(){
|
65 |
-
register_rest_field('product', 'brands', array(
|
66 |
-
'get_callback' => array($this, "get_callback"),
|
67 |
-
'update_callback' => array($this, "update_callback"),
|
68 |
-
'schema' => $this->get_schema(),
|
69 |
-
));
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Returns the schema of the "brands" field on the /product route
|
74 |
-
* To attach a brand to a product just append a "brands" key containing an array of brand id's
|
75 |
-
* An empty array wil detach all brands.
|
76 |
-
* @return array
|
77 |
-
*/
|
78 |
-
public function get_schema(){
|
79 |
-
return array(
|
80 |
-
'description' => __('Product brands', 'perfect-woocommerce-brands'),
|
81 |
-
'type' => 'array',
|
82 |
-
'items' => array(
|
83 |
-
"type" => "integer"
|
84 |
-
),
|
85 |
-
'context' => array("view", "edit")
|
86 |
-
);
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Returns all attached brands to a GET request to /products(/id)
|
91 |
-
* @param $product
|
92 |
-
* @return array|\WP_Error
|
93 |
-
*/
|
94 |
-
public function get_callback($product){
|
95 |
-
$brands = wp_get_post_terms($product['id'], 'pwb-brand');
|
96 |
-
|
97 |
-
$result_brands_array = array();
|
98 |
-
foreach ($brands as $brand) {
|
99 |
-
$result_brands_array[] = array(
|
100 |
-
'id' => $brand->term_id,
|
101 |
-
'name' => $brand->name,
|
102 |
-
'slug' => $brand->slug
|
103 |
-
);
|
104 |
-
}
|
105 |
-
|
106 |
-
return $result_brands_array;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Entry point for an update call
|
111 |
-
* @param $brands
|
112 |
-
* @param $product
|
113 |
-
*/
|
114 |
-
public function update_callback($brands, $product){
|
115 |
-
$this->remove_brands($product);
|
116 |
-
$this->add_brands($brands, $product);
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Detaches all brands from a product
|
122 |
-
* @param \WC_Product $product
|
123 |
-
*/
|
124 |
-
private function remove_brands($product){
|
125 |
-
$brands = wp_get_post_terms($product->get_id(), 'pwb-brand');
|
126 |
-
if (!empty($brands)) {
|
127 |
-
wp_set_post_terms($product->get_id(), array(), 'pwb-brand');
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Attaches the given brands to a product. Earlier attached brands, not in this array, will be removed
|
133 |
-
* @param array $brands
|
134 |
-
* @param \WC_Product $product
|
135 |
-
*/
|
136 |
-
private function add_brands($brands, $product){
|
137 |
-
wp_set_post_terms($product->get_id(), $brands, "pwb-brand");
|
138 |
-
}
|
139 |
-
|
140 |
-
}
|
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( "wc/v1", "wc/v2", "wc/v3" );
|
11 |
+
private $base = 'brands';
|
12 |
+
|
13 |
+
function __construct(){
|
14 |
+
add_action('rest_api_init', array($this, 'register_endpoints'));
|
15 |
+
add_action('rest_api_init', array($this, 'register_fields'));
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Registers the endpoint for all possible $namespaces
|
20 |
+
*/
|
21 |
+
public function register_endpoints(){
|
22 |
+
foreach( $this->namespaces as $namespace ) {
|
23 |
+
register_rest_route($namespace, '/'.$this->base, array(
|
24 |
+
array(
|
25 |
+
'methods' => WP_REST_Server::READABLE,
|
26 |
+
'callback' => function () {
|
27 |
+
return rest_ensure_response(
|
28 |
+
Perfect_Woocommerce_Brands::get_brands()
|
29 |
+
);
|
30 |
+
}
|
31 |
+
),
|
32 |
+
array(
|
33 |
+
'methods' => WP_REST_Server::CREATABLE,
|
34 |
+
'callback' => array( $this, 'create_brand' )
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'methods' => WP_REST_Server::DELETABLE,
|
38 |
+
'callback' => array( $this, 'delete_brand' )
|
39 |
+
)
|
40 |
+
));
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
public function delete_brand( $request ){
|
45 |
+
foreach( $request['brands'] as $brand ){
|
46 |
+
$delete_result = wp_delete_term( $brand, 'pwb-brand' );
|
47 |
+
if( is_wp_error( $delete_result ) ) return $delete_result;
|
48 |
+
}
|
49 |
+
return true;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function create_brand( $request ){
|
53 |
+
$new_brand = wp_insert_term( $request['name'], 'pwb-brand', array( 'slug' => $request['slug'], 'description' => $request['description'] ) );
|
54 |
+
if( !is_wp_error( $new_brand ) ){
|
55 |
+
return array('id' => $new_brand['term_id'], 'name' => $request['name'], 'slug' => $request['slug'], 'description' => $request['description']);
|
56 |
+
}else{
|
57 |
+
return $new_brand;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Entry point for all rest field settings
|
63 |
+
*/
|
64 |
+
public function register_fields(){
|
65 |
+
register_rest_field('product', 'brands', array(
|
66 |
+
'get_callback' => array($this, "get_callback"),
|
67 |
+
'update_callback' => array($this, "update_callback"),
|
68 |
+
'schema' => $this->get_schema(),
|
69 |
+
));
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Returns the schema of the "brands" field on the /product route
|
74 |
+
* To attach a brand to a product just append a "brands" key containing an array of brand id's
|
75 |
+
* An empty array wil detach all brands.
|
76 |
+
* @return array
|
77 |
+
*/
|
78 |
+
public function get_schema(){
|
79 |
+
return array(
|
80 |
+
'description' => __('Product brands', 'perfect-woocommerce-brands'),
|
81 |
+
'type' => 'array',
|
82 |
+
'items' => array(
|
83 |
+
"type" => "integer"
|
84 |
+
),
|
85 |
+
'context' => array("view", "edit")
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Returns all attached brands to a GET request to /products(/id)
|
91 |
+
* @param $product
|
92 |
+
* @return array|\WP_Error
|
93 |
+
*/
|
94 |
+
public function get_callback($product){
|
95 |
+
$brands = wp_get_post_terms($product['id'], 'pwb-brand');
|
96 |
+
|
97 |
+
$result_brands_array = array();
|
98 |
+
foreach ($brands as $brand) {
|
99 |
+
$result_brands_array[] = array(
|
100 |
+
'id' => $brand->term_id,
|
101 |
+
'name' => $brand->name,
|
102 |
+
'slug' => $brand->slug
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
return $result_brands_array;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Entry point for an update call
|
111 |
+
* @param $brands
|
112 |
+
* @param $product
|
113 |
+
*/
|
114 |
+
public function update_callback($brands, $product){
|
115 |
+
$this->remove_brands($product);
|
116 |
+
$this->add_brands($brands, $product);
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Detaches all brands from a product
|
122 |
+
* @param \WC_Product $product
|
123 |
+
*/
|
124 |
+
private function remove_brands($product){
|
125 |
+
$brands = wp_get_post_terms($product->get_id(), 'pwb-brand');
|
126 |
+
if (!empty($brands)) {
|
127 |
+
wp_set_post_terms($product->get_id(), array(), 'pwb-brand');
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Attaches the given brands to a product. Earlier attached brands, not in this array, will be removed
|
133 |
+
* @param array $brands
|
134 |
+
* @param \WC_Product $product
|
135 |
+
*/
|
136 |
+
private function add_brands($brands, $product){
|
137 |
+
wp_set_post_terms($product->get_id(), $brands, "pwb-brand");
|
138 |
+
}
|
139 |
+
|
140 |
+
}
|
classes/class-pwb-product-tab.php
CHANGED
@@ -1,66 +1,66 @@
|
|
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 |
-
global $product;
|
16 |
-
|
17 |
-
if( isset( $product ) ){
|
18 |
-
$brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
|
19 |
-
|
20 |
-
if( !empty( $brands ) ){
|
21 |
-
$show_brand_tab = get_option( 'wc_pwb_admin_tab_brand_single_product_tab' );
|
22 |
-
if( $show_brand_tab == 'yes' || !$show_brand_tab ){
|
23 |
-
$tabs['pwb_tab'] = array(
|
24 |
-
'title' => __( 'Brand', 'perfect-woocommerce-brands' ),
|
25 |
-
'priority' => 20,
|
26 |
-
'callback' => array( $this, 'product_tab_content' )
|
27 |
-
);
|
28 |
-
}
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
return $tabs;
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
public function product_tab_content(){
|
37 |
-
|
38 |
-
global $product;
|
39 |
-
$brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
|
40 |
-
|
41 |
-
ob_start();
|
42 |
-
?>
|
43 |
-
|
44 |
-
<h2><?php echo apply_filters( 'woocommerce_product_brand_heading', __('Brand', 'perfect-woocommerce-brands') ); ?></h2>
|
45 |
-
<?php foreach( $brands as $brand ): ?>
|
46 |
-
|
47 |
-
<?php
|
48 |
-
$image_size = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
|
49 |
-
$brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
|
50 |
-
$brand_logo = wp_get_attachment_image( $brand_logo, apply_filters( 'pwb_product_tab_brand_logo_size', $image_size ) );
|
51 |
-
?>
|
52 |
-
|
53 |
-
<div id="tab-pwb_tab-content">
|
54 |
-
<h3><?php echo $brand->name;?></h3>
|
55 |
-
<?php if( !empty($brand->description) ) echo '<div>'.do_shortcode($brand->description).'</div>';?>
|
56 |
-
<?php if( !empty($brand_logo) ) echo '<span>'.$brand_logo.'</span>';?>
|
57 |
-
</div>
|
58 |
-
|
59 |
-
<?php endforeach; ?>
|
60 |
-
|
61 |
-
<?php
|
62 |
-
echo ob_get_clean();
|
63 |
-
|
64 |
-
}
|
65 |
-
|
66 |
-
}
|
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 |
+
global $product;
|
16 |
+
|
17 |
+
if( isset( $product ) ){
|
18 |
+
$brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
|
19 |
+
|
20 |
+
if( !empty( $brands ) ){
|
21 |
+
$show_brand_tab = get_option( 'wc_pwb_admin_tab_brand_single_product_tab' );
|
22 |
+
if( $show_brand_tab == 'yes' || !$show_brand_tab ){
|
23 |
+
$tabs['pwb_tab'] = array(
|
24 |
+
'title' => __( 'Brand', 'perfect-woocommerce-brands' ),
|
25 |
+
'priority' => 20,
|
26 |
+
'callback' => array( $this, 'product_tab_content' )
|
27 |
+
);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
return $tabs;
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
public function product_tab_content(){
|
37 |
+
|
38 |
+
global $product;
|
39 |
+
$brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
|
40 |
+
|
41 |
+
ob_start();
|
42 |
+
?>
|
43 |
+
|
44 |
+
<h2><?php echo apply_filters( 'woocommerce_product_brand_heading', __('Brand', 'perfect-woocommerce-brands') ); ?></h2>
|
45 |
+
<?php foreach( $brands as $brand ): ?>
|
46 |
+
|
47 |
+
<?php
|
48 |
+
$image_size = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
|
49 |
+
$brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
|
50 |
+
$brand_logo = wp_get_attachment_image( $brand_logo, apply_filters( 'pwb_product_tab_brand_logo_size', $image_size ) );
|
51 |
+
?>
|
52 |
+
|
53 |
+
<div id="tab-pwb_tab-content">
|
54 |
+
<h3><?php echo $brand->name;?></h3>
|
55 |
+
<?php if( !empty($brand->description) ) echo '<div>'.do_shortcode($brand->description).'</div>';?>
|
56 |
+
<?php if( !empty($brand_logo) ) echo '<span>'.$brand_logo.'</span>';?>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
<?php endforeach; ?>
|
60 |
+
|
61 |
+
<?php
|
62 |
+
echo ob_get_clean();
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
classes/class-pwb-term.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Perfect_Woocommerce_Brands;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
-
|
7 |
-
class PWB_Term{
|
8 |
-
|
9 |
-
protected $term_obj, $id, $name, $link, $image, $banner, $banner_link, $desc, $slug;
|
10 |
-
|
11 |
-
function __construct( $term_obj ){
|
12 |
-
$this->term_obj = $term_obj;
|
13 |
-
$this->is_wp_term();
|
14 |
-
}
|
15 |
-
|
16 |
-
private function is_wp_term(){
|
17 |
-
if( is_a( $this->term_obj, 'WP_Term' ) ){
|
18 |
-
$this->build_pwb_term( $this->term_obj );
|
19 |
-
}else{
|
20 |
-
throw new Exception( __('Only WP_Term objects are allowed', 'perfect-woocommerce-brands') );
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
protected function build_pwb_term(){
|
25 |
-
$this->id = $this->term_obj->term_id;
|
26 |
-
$this->name = $this->term_obj->name;
|
27 |
-
$this->slug = $this->term_obj->slug;
|
28 |
-
$this->desc = get_term_meta( $this->id, 'pwb_brand_banner_description', true );
|
29 |
-
$this->link = get_term_link( $this->term_obj->term_id );
|
30 |
-
$this->image = htmlentities( wp_get_attachment_image( get_term_meta( $this->id, 'pwb_brand_image', true ), 'full' ) );
|
31 |
-
$this->banner = htmlentities( wp_get_attachment_image( get_term_meta( $this->id, 'pwb_brand_banner', true ), 'full' ) );
|
32 |
-
$this->banner_link = get_term_meta( $this->id, 'pwb_brand_banner_link', true) ;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function get( $key = 'id' ){
|
36 |
-
return ( isset( $this->$key ) ) ? $this->$key : false;
|
37 |
-
}
|
38 |
-
|
39 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Perfect_Woocommerce_Brands;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
+
|
7 |
+
class PWB_Term{
|
8 |
+
|
9 |
+
protected $term_obj, $id, $name, $link, $image, $banner, $banner_link, $desc, $slug;
|
10 |
+
|
11 |
+
function __construct( $term_obj ){
|
12 |
+
$this->term_obj = $term_obj;
|
13 |
+
$this->is_wp_term();
|
14 |
+
}
|
15 |
+
|
16 |
+
private function is_wp_term(){
|
17 |
+
if( is_a( $this->term_obj, 'WP_Term' ) ){
|
18 |
+
$this->build_pwb_term( $this->term_obj );
|
19 |
+
}else{
|
20 |
+
throw new Exception( __('Only WP_Term objects are allowed', 'perfect-woocommerce-brands') );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
protected function build_pwb_term(){
|
25 |
+
$this->id = $this->term_obj->term_id;
|
26 |
+
$this->name = $this->term_obj->name;
|
27 |
+
$this->slug = $this->term_obj->slug;
|
28 |
+
$this->desc = get_term_meta( $this->id, 'pwb_brand_banner_description', true );
|
29 |
+
$this->link = get_term_link( $this->term_obj->term_id );
|
30 |
+
$this->image = htmlentities( wp_get_attachment_image( get_term_meta( $this->id, 'pwb_brand_image', true ), 'full' ) );
|
31 |
+
$this->banner = htmlentities( wp_get_attachment_image( get_term_meta( $this->id, 'pwb_brand_banner', true ), 'full' ) );
|
32 |
+
$this->banner_link = get_term_meta( $this->id, 'pwb_brand_banner_link', true) ;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function get( $key = 'id' ){
|
36 |
+
return ( isset( $this->$key ) ) ? $this->$key : false;
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
classes/shortcodes/class-pwb-all-brands.php
CHANGED
@@ -1,170 +1,170 @@
|
|
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 = ( $atts['hide_empty'] != 'true' ) ? false : true;
|
20 |
-
|
21 |
-
ob_start();
|
22 |
-
|
23 |
-
$brands = array();
|
24 |
-
if( $atts['order_by'] == 'rand' ){
|
25 |
-
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
|
26 |
-
shuffle( $brands );
|
27 |
-
}else{
|
28 |
-
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
|
29 |
-
}
|
30 |
-
|
31 |
-
//remove residual empty brands
|
32 |
-
foreach ( $brands as $key => $brand ) {
|
33 |
-
|
34 |
-
$count = self::count_visible_products( $brand->term_id );
|
35 |
-
|
36 |
-
if ( ! $count && $hide_empty ){
|
37 |
-
unset( $brands[$key] );
|
38 |
-
} else {
|
39 |
-
$brands[$key]->count_pwb = $count;
|
40 |
-
}
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
?>
|
45 |
-
<div class="pwb-all-brands">
|
46 |
-
<?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
|
47 |
-
</div>
|
48 |
-
<?php
|
49 |
-
|
50 |
-
return ob_get_clean();
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* WP_Term->count property don´t care about hidden products
|
55 |
-
* Counts the products in a specific brand
|
56 |
-
*/
|
57 |
-
public static function count_visible_products( $brand_id ) {
|
58 |
-
|
59 |
-
$args = array(
|
60 |
-
'posts_per_page' => -1,
|
61 |
-
'post_type' => 'product',
|
62 |
-
'tax_query' => array(
|
63 |
-
array(
|
64 |
-
'taxonomy' => 'pwb-brand',
|
65 |
-
'field' => 'ID',
|
66 |
-
'terms' => $brand_id
|
67 |
-
),
|
68 |
-
array(
|
69 |
-
'taxonomy' => 'product_visibility',
|
70 |
-
'field' => 'name',
|
71 |
-
'terms' => 'exclude-from-catalog',
|
72 |
-
'operator' => 'NOT IN',
|
73 |
-
)
|
74 |
-
)
|
75 |
-
);
|
76 |
-
$wc_query = new \WP_Query($args);
|
77 |
-
|
78 |
-
return $wc_query->found_posts;
|
79 |
-
|
80 |
-
}
|
81 |
-
|
82 |
-
public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
|
83 |
-
$page = 1;
|
84 |
-
|
85 |
-
if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
|
86 |
-
$page = $_GET['pwb-page'];
|
87 |
-
}
|
88 |
-
|
89 |
-
$page = $page < 1 ? 1 : $page;
|
90 |
-
|
91 |
-
// start position in the $display_array
|
92 |
-
// +1 is to account for total values.
|
93 |
-
$start = ($page - 1) * ($show_per_page);
|
94 |
-
$offset = $show_per_page;
|
95 |
-
|
96 |
-
$outArray = array_slice($display_array, $start, $offset);
|
97 |
-
|
98 |
-
//pagination links
|
99 |
-
$total_elements = count($display_array);
|
100 |
-
$pages = ((int)$total_elements / (int)$show_per_page);
|
101 |
-
$pages = ceil($pages);
|
102 |
-
if($pages>=1 && $page <= $pages){
|
103 |
-
|
104 |
-
?>
|
105 |
-
<div class="pwb-brands-cols-outer">
|
106 |
-
<?php
|
107 |
-
foreach( $outArray as $brand ) {
|
108 |
-
|
109 |
-
$brand_id = $brand->term_id;
|
110 |
-
$brand_name = $brand->name;
|
111 |
-
$brand_link = get_term_link($brand_id);
|
112 |
-
|
113 |
-
$attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
|
114 |
-
$attachment_html = $brand_name;
|
115 |
-
if($attachment_id!=''){
|
116 |
-
$attachment_html = wp_get_attachment_image( $attachment_id, $image_size );
|
117 |
-
}
|
118 |
-
|
119 |
-
?>
|
120 |
-
<div class="pwb-brands-col3">
|
121 |
-
|
122 |
-
<?php if( $title_position != 'none' && $title_position != 'after' ): ?>
|
123 |
-
<p>
|
124 |
-
<a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
|
125 |
-
<small>(<?php echo $brand->count_pwb;?>)</small>
|
126 |
-
</p>
|
127 |
-
<?php endif; ?>
|
128 |
-
|
129 |
-
<div>
|
130 |
-
<a href="<?php echo $brand_link;?>" title="<?php echo $brand_name;?>"><?php echo $attachment_html;?></a>
|
131 |
-
</div>
|
132 |
-
|
133 |
-
<?php if( $title_position != 'none' && $title_position == 'after' ): ?>
|
134 |
-
<p>
|
135 |
-
<a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
|
136 |
-
<small>(<?php echo $brand->count_pwb;?>)</small>
|
137 |
-
</p>
|
138 |
-
<?php endif; ?>
|
139 |
-
|
140 |
-
</div>
|
141 |
-
<?php
|
142 |
-
}
|
143 |
-
?>
|
144 |
-
</div>
|
145 |
-
<?php
|
146 |
-
$next = $page + 1;
|
147 |
-
$prev = $page - 1;
|
148 |
-
|
149 |
-
echo '<div class="pwb-pagination-wrapper">';
|
150 |
-
if($prev>1){
|
151 |
-
echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">«</a>';
|
152 |
-
}
|
153 |
-
if($prev>0){
|
154 |
-
echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">‹</a>';
|
155 |
-
}
|
156 |
-
|
157 |
-
if($next<=$pages){
|
158 |
-
echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">›</a>';
|
159 |
-
}
|
160 |
-
if($next<$pages){
|
161 |
-
echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">»</a>';
|
162 |
-
}
|
163 |
-
echo '</div>';
|
164 |
-
|
165 |
-
}else{
|
166 |
-
echo __('No results','perfect-woocommerce-brands');
|
167 |
-
}
|
168 |
-
|
169 |
-
}
|
170 |
-
}
|
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 = ( $atts['hide_empty'] != 'true' ) ? false : true;
|
20 |
+
|
21 |
+
ob_start();
|
22 |
+
|
23 |
+
$brands = array();
|
24 |
+
if( $atts['order_by'] == 'rand' ){
|
25 |
+
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
|
26 |
+
shuffle( $brands );
|
27 |
+
}else{
|
28 |
+
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
|
29 |
+
}
|
30 |
+
|
31 |
+
//remove residual empty brands
|
32 |
+
foreach ( $brands as $key => $brand ) {
|
33 |
+
|
34 |
+
$count = self::count_visible_products( $brand->term_id );
|
35 |
+
|
36 |
+
if ( ! $count && $hide_empty ){
|
37 |
+
unset( $brands[$key] );
|
38 |
+
} else {
|
39 |
+
$brands[$key]->count_pwb = $count;
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
?>
|
45 |
+
<div class="pwb-all-brands">
|
46 |
+
<?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
|
47 |
+
</div>
|
48 |
+
<?php
|
49 |
+
|
50 |
+
return ob_get_clean();
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* WP_Term->count property don´t care about hidden products
|
55 |
+
* Counts the products in a specific brand
|
56 |
+
*/
|
57 |
+
public static function count_visible_products( $brand_id ) {
|
58 |
+
|
59 |
+
$args = array(
|
60 |
+
'posts_per_page' => -1,
|
61 |
+
'post_type' => 'product',
|
62 |
+
'tax_query' => array(
|
63 |
+
array(
|
64 |
+
'taxonomy' => 'pwb-brand',
|
65 |
+
'field' => 'ID',
|
66 |
+
'terms' => $brand_id
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'taxonomy' => 'product_visibility',
|
70 |
+
'field' => 'name',
|
71 |
+
'terms' => 'exclude-from-catalog',
|
72 |
+
'operator' => 'NOT IN',
|
73 |
+
)
|
74 |
+
)
|
75 |
+
);
|
76 |
+
$wc_query = new \WP_Query($args);
|
77 |
+
|
78 |
+
return $wc_query->found_posts;
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
+
public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
|
83 |
+
$page = 1;
|
84 |
+
|
85 |
+
if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
|
86 |
+
$page = $_GET['pwb-page'];
|
87 |
+
}
|
88 |
+
|
89 |
+
$page = $page < 1 ? 1 : $page;
|
90 |
+
|
91 |
+
// start position in the $display_array
|
92 |
+
// +1 is to account for total values.
|
93 |
+
$start = ($page - 1) * ($show_per_page);
|
94 |
+
$offset = $show_per_page;
|
95 |
+
|
96 |
+
$outArray = array_slice($display_array, $start, $offset);
|
97 |
+
|
98 |
+
//pagination links
|
99 |
+
$total_elements = count($display_array);
|
100 |
+
$pages = ((int)$total_elements / (int)$show_per_page);
|
101 |
+
$pages = ceil($pages);
|
102 |
+
if($pages>=1 && $page <= $pages){
|
103 |
+
|
104 |
+
?>
|
105 |
+
<div class="pwb-brands-cols-outer">
|
106 |
+
<?php
|
107 |
+
foreach( $outArray as $brand ) {
|
108 |
+
|
109 |
+
$brand_id = $brand->term_id;
|
110 |
+
$brand_name = $brand->name;
|
111 |
+
$brand_link = get_term_link($brand_id);
|
112 |
+
|
113 |
+
$attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
|
114 |
+
$attachment_html = $brand_name;
|
115 |
+
if($attachment_id!=''){
|
116 |
+
$attachment_html = wp_get_attachment_image( $attachment_id, $image_size );
|
117 |
+
}
|
118 |
+
|
119 |
+
?>
|
120 |
+
<div class="pwb-brands-col3">
|
121 |
+
|
122 |
+
<?php if( $title_position != 'none' && $title_position != 'after' ): ?>
|
123 |
+
<p>
|
124 |
+
<a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
|
125 |
+
<small>(<?php echo $brand->count_pwb;?>)</small>
|
126 |
+
</p>
|
127 |
+
<?php endif; ?>
|
128 |
+
|
129 |
+
<div>
|
130 |
+
<a href="<?php echo $brand_link;?>" title="<?php echo $brand_name;?>"><?php echo $attachment_html;?></a>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<?php if( $title_position != 'none' && $title_position == 'after' ): ?>
|
134 |
+
<p>
|
135 |
+
<a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
|
136 |
+
<small>(<?php echo $brand->count_pwb;?>)</small>
|
137 |
+
</p>
|
138 |
+
<?php endif; ?>
|
139 |
+
|
140 |
+
</div>
|
141 |
+
<?php
|
142 |
+
}
|
143 |
+
?>
|
144 |
+
</div>
|
145 |
+
<?php
|
146 |
+
$next = $page + 1;
|
147 |
+
$prev = $page - 1;
|
148 |
+
|
149 |
+
echo '<div class="pwb-pagination-wrapper">';
|
150 |
+
if($prev>1){
|
151 |
+
echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">«</a>';
|
152 |
+
}
|
153 |
+
if($prev>0){
|
154 |
+
echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">‹</a>';
|
155 |
+
}
|
156 |
+
|
157 |
+
if($next<=$pages){
|
158 |
+
echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">›</a>';
|
159 |
+
}
|
160 |
+
if($next<$pages){
|
161 |
+
echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">»</a>';
|
162 |
+
}
|
163 |
+
echo '</div>';
|
164 |
+
|
165 |
+
}else{
|
166 |
+
echo __('No results','perfect-woocommerce-brands');
|
167 |
+
}
|
168 |
+
|
169 |
+
}
|
170 |
+
}
|
classes/shortcodes/class-pwb-az-listing.php
CHANGED
@@ -1,62 +1,80 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Perfect_Woocommerce_Brands\Shortcodes;
|
3 |
-
use WP_Query;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
-
|
7 |
-
class PWB_AZ_Listing_Shortcode{
|
8 |
-
|
9 |
-
public static function shortcode( $atts ) {
|
10 |
-
|
11 |
-
$
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
'
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
'
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Perfect_Woocommerce_Brands\Shortcodes;
|
3 |
+
use WP_Query;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
+
|
7 |
+
class PWB_AZ_Listing_Shortcode {
|
8 |
+
|
9 |
+
public static function shortcode( $atts ) {
|
10 |
+
|
11 |
+
$grouped_brands = get_transient('pwb_az_listing_cache');
|
12 |
+
|
13 |
+
if ( ! $grouped_brands ) {
|
14 |
+
|
15 |
+
$atts = shortcode_atts( array(
|
16 |
+
'only_parents' => false,
|
17 |
+
), $atts, 'pwb-az-listing' );
|
18 |
+
|
19 |
+
$only_parents = filter_var( $atts['only_parents'], FILTER_VALIDATE_BOOLEAN );
|
20 |
+
|
21 |
+
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( true, 'name', 'ASC', false, false, $only_parents );
|
22 |
+
$grouped_brands = array();
|
23 |
+
|
24 |
+
foreach ( $brands as $brand ) {
|
25 |
+
|
26 |
+
if ( self::has_products( $brand->term_id ) ) {
|
27 |
+
|
28 |
+
$letter = mb_substr( htmlspecialchars_decode( $brand->name ), 0, 1 );
|
29 |
+
$letter = strtolower( $letter );
|
30 |
+
$grouped_brands[$letter][] = [ 'brand_term' => $brand ];
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
set_transient( 'pwb_az_listing_cache', $grouped_brands, 43200 );//12 hours
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
41 |
+
'az-listing',
|
42 |
+
'shortcodes',
|
43 |
+
array( 'grouped_brands' => $grouped_brands ),
|
44 |
+
false
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
private static function has_products( $brand_id ){
|
50 |
+
|
51 |
+
$args = array(
|
52 |
+
'posts_per_page' => -1,
|
53 |
+
'post_type' => 'product',
|
54 |
+
'tax_query' => array(
|
55 |
+
array(
|
56 |
+
'taxonomy' => 'pwb-brand',
|
57 |
+
'field' => 'term_id',
|
58 |
+
'terms' => array( $brand_id )
|
59 |
+
)
|
60 |
+
),
|
61 |
+
'fields' => 'ids'
|
62 |
+
);
|
63 |
+
|
64 |
+
if( get_option('woocommerce_hide_out_of_stock_items') === 'yes' ){
|
65 |
+
$args['meta_query'] = array(
|
66 |
+
array(
|
67 |
+
'key' => '_stock_status',
|
68 |
+
'value' => 'outofstock',
|
69 |
+
'compare' => 'NOT IN'
|
70 |
+
)
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
$wp_query = new WP_Query($args);
|
75 |
+
wp_reset_postdata();
|
76 |
+
return $wp_query->posts;
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
}
|
classes/shortcodes/class-pwb-brand.php
CHANGED
@@ -1,33 +1,33 @@
|
|
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 |
-
'as_link' => false,
|
12 |
-
'image_size' => 'thumbnail',
|
13 |
-
), $atts, 'pwb-brand' );
|
14 |
-
|
15 |
-
if( !$atts['product_id'] && is_singular('product') ) $atts['product_id'] = get_the_ID();
|
16 |
-
|
17 |
-
$brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
|
18 |
-
|
19 |
-
foreach( $brands as $key => $brand ){
|
20 |
-
$brands[$key]->term_link = get_term_link ( $brand->term_id, 'pwb-brand' );
|
21 |
-
$brands[$key]->image = wp_get_attachment_image( get_term_meta( $brand->term_id, 'pwb_brand_image', 1 ), $atts['image_size'] );
|
22 |
-
}
|
23 |
-
|
24 |
-
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
25 |
-
'brand',
|
26 |
-
'shortcodes',
|
27 |
-
array( 'brands' => $brands, 'as_link' => $atts['as_link'] ),
|
28 |
-
false
|
29 |
-
);
|
30 |
-
|
31 |
-
}
|
32 |
-
|
33 |
-
}
|
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 |
+
'as_link' => false,
|
12 |
+
'image_size' => 'thumbnail',
|
13 |
+
), $atts, 'pwb-brand' );
|
14 |
+
|
15 |
+
if( !$atts['product_id'] && is_singular('product') ) $atts['product_id'] = get_the_ID();
|
16 |
+
|
17 |
+
$brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
|
18 |
+
|
19 |
+
foreach( $brands as $key => $brand ){
|
20 |
+
$brands[$key]->term_link = get_term_link ( $brand->term_id, 'pwb-brand' );
|
21 |
+
$brands[$key]->image = wp_get_attachment_image( get_term_meta( $brand->term_id, 'pwb_brand_image', 1 ), $atts['image_size'] );
|
22 |
+
}
|
23 |
+
|
24 |
+
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
25 |
+
'brand',
|
26 |
+
'shortcodes',
|
27 |
+
array( 'brands' => $brands, 'as_link' => $atts['as_link'] ),
|
28 |
+
false
|
29 |
+
);
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
}
|
classes/shortcodes/class-pwb-carousel.php
CHANGED
@@ -1,74 +1,74 @@
|
|
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 |
-
'hide_empty' => false
|
20 |
-
), $atts, 'pwb-carousel' );
|
21 |
-
|
22 |
-
//enqueue deps
|
23 |
-
if( !wp_style_is('pwb-lib-slick') ) wp_enqueue_style('pwb-lib-slick');
|
24 |
-
if( !wp_script_is('pwb-lib-slick') ) wp_enqueue_script('pwb-lib-slick');
|
25 |
-
|
26 |
-
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
27 |
-
'carousel',
|
28 |
-
'shortcodes',
|
29 |
-
array( 'slick_settings' => self::slick_settings(), 'brands' => self::brands_data() ),
|
30 |
-
false
|
31 |
-
);
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
private static function slick_settings(){
|
36 |
-
|
37 |
-
$slick_settings = array(
|
38 |
-
'slidesToShow' => (int)self::$atts['items_to_show'],
|
39 |
-
'slidesToScroll' => (int)self::$atts['items_to_scroll'],
|
40 |
-
'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
|
41 |
-
'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
|
42 |
-
);
|
43 |
-
return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
private static function brands_data(){
|
48 |
-
|
49 |
-
$brands = array();
|
50 |
-
$foreach_i = 0;
|
51 |
-
if( self::$atts['items'] == 'featured' ){
|
52 |
-
$brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( self::$atts['items'], 'name', 'ASC', true );
|
53 |
-
}else{
|
54 |
-
$brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( self::$atts['items'] );
|
55 |
-
}
|
56 |
-
foreach( $brands_array as $brand ){
|
57 |
-
if( self::$atts['items'] != 'featured' && $foreach_i >= (int)self::$atts['items'] ) break;
|
58 |
-
|
59 |
-
$brand_id = $brand->term_id;
|
60 |
-
$brand_link = get_term_link($brand_id);
|
61 |
-
$attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
|
62 |
-
$attachment_html = $brand->name;
|
63 |
-
if($attachment_id!='') $attachment_html = wp_get_attachment_image( $attachment_id, self::$atts['image_size'] );
|
64 |
-
|
65 |
-
$brands[] = array( 'link' => $brand_link, 'attachment_html' => $attachment_html, 'name' => $brand->name );
|
66 |
-
|
67 |
-
$foreach_i++;
|
68 |
-
}
|
69 |
-
|
70 |
-
return $brands;
|
71 |
-
|
72 |
-
}
|
73 |
-
|
74 |
-
}
|
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 |
+
'hide_empty' => false
|
20 |
+
), $atts, 'pwb-carousel' );
|
21 |
+
|
22 |
+
//enqueue deps
|
23 |
+
if( !wp_style_is('pwb-lib-slick') ) wp_enqueue_style('pwb-lib-slick');
|
24 |
+
if( !wp_script_is('pwb-lib-slick') ) wp_enqueue_script('pwb-lib-slick');
|
25 |
+
|
26 |
+
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
27 |
+
'carousel',
|
28 |
+
'shortcodes',
|
29 |
+
array( 'slick_settings' => self::slick_settings(), 'brands' => self::brands_data() ),
|
30 |
+
false
|
31 |
+
);
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
private static function slick_settings(){
|
36 |
+
|
37 |
+
$slick_settings = array(
|
38 |
+
'slidesToShow' => (int)self::$atts['items_to_show'],
|
39 |
+
'slidesToScroll' => (int)self::$atts['items_to_scroll'],
|
40 |
+
'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
|
41 |
+
'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
|
42 |
+
);
|
43 |
+
return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
private static function brands_data(){
|
48 |
+
|
49 |
+
$brands = array();
|
50 |
+
$foreach_i = 0;
|
51 |
+
if( self::$atts['items'] == 'featured' ){
|
52 |
+
$brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( self::$atts['items'], 'name', 'ASC', true );
|
53 |
+
}else{
|
54 |
+
$brands_array = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( self::$atts['items'] );
|
55 |
+
}
|
56 |
+
foreach( $brands_array as $brand ){
|
57 |
+
if( self::$atts['items'] != 'featured' && $foreach_i >= (int)self::$atts['items'] ) break;
|
58 |
+
|
59 |
+
$brand_id = $brand->term_id;
|
60 |
+
$brand_link = get_term_link($brand_id);
|
61 |
+
$attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
|
62 |
+
$attachment_html = $brand->name;
|
63 |
+
if($attachment_id!='') $attachment_html = wp_get_attachment_image( $attachment_id, self::$atts['image_size'] );
|
64 |
+
|
65 |
+
$brands[] = array( 'link' => $brand_link, 'attachment_html' => $attachment_html, 'name' => $brand->name );
|
66 |
+
|
67 |
+
$foreach_i++;
|
68 |
+
}
|
69 |
+
|
70 |
+
return $brands;
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
classes/shortcodes/class-pwb-product-carousel.php
CHANGED
@@ -1,98 +1,98 @@
|
|
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 |
-
'category' => "all",
|
15 |
-
'products' => "10",
|
16 |
-
'products_to_show' => "5",
|
17 |
-
'products_to_scroll' => "1",
|
18 |
-
'autoplay' => "false",
|
19 |
-
'arrows' => "false"
|
20 |
-
), $atts, 'pwb-product-carousel' );
|
21 |
-
|
22 |
-
//enqueue deps
|
23 |
-
if( !wp_style_is('pwb-lib-slick') ) wp_enqueue_style('pwb-lib-slick');
|
24 |
-
if( !wp_script_is('pwb-lib-slick') ) wp_enqueue_script('pwb-lib-slick');
|
25 |
-
|
26 |
-
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
27 |
-
'product-carousel',
|
28 |
-
'shortcodes',
|
29 |
-
array( 'slick_settings' => self::slick_settings(), 'products' => self::products_data() ),
|
30 |
-
false
|
31 |
-
);
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
private static function slick_settings(){
|
36 |
-
|
37 |
-
$slick_settings = array(
|
38 |
-
'slidesToShow' => (int)self::$atts['products_to_show'],
|
39 |
-
'slidesToScroll' => (int)self::$atts['products_to_scroll'],
|
40 |
-
'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
|
41 |
-
'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
|
42 |
-
);
|
43 |
-
return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
private static function products_data(){
|
48 |
-
|
49 |
-
$products = array();
|
50 |
-
|
51 |
-
$args = array(
|
52 |
-
'post_type' => 'product',
|
53 |
-
'posts_per_page' => (int)self::$atts['products'],
|
54 |
-
'paged' => false
|
55 |
-
);
|
56 |
-
|
57 |
-
if( self::$atts['brand'] != 'all' ){
|
58 |
-
$args['tax_query'] = array(
|
59 |
-
array(
|
60 |
-
'taxonomy' => 'pwb-brand',
|
61 |
-
'field' => 'slug',
|
62 |
-
'terms' => self::$atts['brand']
|
63 |
-
)
|
64 |
-
);
|
65 |
-
}
|
66 |
-
if( self::$atts['category'] != 'all'){
|
67 |
-
$woo_category_query = array(
|
68 |
-
'taxonomy' => 'product_cat',
|
69 |
-
'field' => 'slug',
|
70 |
-
'terms' => self::$atts['category']
|
71 |
-
);
|
72 |
-
if(isset($args['tax_query']) && is_array($args['tax_query'])) {
|
73 |
-
$args['tax_query'][] = $woo_category_query;
|
74 |
-
} else {
|
75 |
-
$args['tax_query'] = array($woo_category_query);
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
$loop = new \WP_Query( $args );
|
80 |
-
if( $loop->have_posts() ) {
|
81 |
-
while ( $loop->have_posts() ) : $loop->the_post();
|
82 |
-
$product = wc_get_product( get_the_ID() );
|
83 |
-
|
84 |
-
$products[] = array(
|
85 |
-
'id' => get_the_ID(),
|
86 |
-
'permalink' => get_the_permalink(),
|
87 |
-
'thumbnail' => woocommerce_get_product_thumbnail(),
|
88 |
-
'title' => $product->get_title()
|
89 |
-
);
|
90 |
-
endwhile;
|
91 |
-
}
|
92 |
-
wp_reset_postdata();
|
93 |
-
|
94 |
-
return $products;
|
95 |
-
|
96 |
-
}
|
97 |
-
|
98 |
-
}
|
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 |
+
'category' => "all",
|
15 |
+
'products' => "10",
|
16 |
+
'products_to_show' => "5",
|
17 |
+
'products_to_scroll' => "1",
|
18 |
+
'autoplay' => "false",
|
19 |
+
'arrows' => "false"
|
20 |
+
), $atts, 'pwb-product-carousel' );
|
21 |
+
|
22 |
+
//enqueue deps
|
23 |
+
if( !wp_style_is('pwb-lib-slick') ) wp_enqueue_style('pwb-lib-slick');
|
24 |
+
if( !wp_script_is('pwb-lib-slick') ) wp_enqueue_script('pwb-lib-slick');
|
25 |
+
|
26 |
+
return \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
27 |
+
'product-carousel',
|
28 |
+
'shortcodes',
|
29 |
+
array( 'slick_settings' => self::slick_settings(), 'products' => self::products_data() ),
|
30 |
+
false
|
31 |
+
);
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
private static function slick_settings(){
|
36 |
+
|
37 |
+
$slick_settings = array(
|
38 |
+
'slidesToShow' => (int)self::$atts['products_to_show'],
|
39 |
+
'slidesToScroll' => (int)self::$atts['products_to_scroll'],
|
40 |
+
'autoplay' => ( self::$atts['autoplay'] === 'true' ) ? true: false,
|
41 |
+
'arrows' => ( self::$atts['arrows'] === 'true' ) ? true: false
|
42 |
+
);
|
43 |
+
return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
private static function products_data(){
|
48 |
+
|
49 |
+
$products = array();
|
50 |
+
|
51 |
+
$args = array(
|
52 |
+
'post_type' => 'product',
|
53 |
+
'posts_per_page' => (int)self::$atts['products'],
|
54 |
+
'paged' => false
|
55 |
+
);
|
56 |
+
|
57 |
+
if( self::$atts['brand'] != 'all' ){
|
58 |
+
$args['tax_query'] = array(
|
59 |
+
array(
|
60 |
+
'taxonomy' => 'pwb-brand',
|
61 |
+
'field' => 'slug',
|
62 |
+
'terms' => self::$atts['brand']
|
63 |
+
)
|
64 |
+
);
|
65 |
+
}
|
66 |
+
if( self::$atts['category'] != 'all'){
|
67 |
+
$woo_category_query = array(
|
68 |
+
'taxonomy' => 'product_cat',
|
69 |
+
'field' => 'slug',
|
70 |
+
'terms' => self::$atts['category']
|
71 |
+
);
|
72 |
+
if(isset($args['tax_query']) && is_array($args['tax_query'])) {
|
73 |
+
$args['tax_query'][] = $woo_category_query;
|
74 |
+
} else {
|
75 |
+
$args['tax_query'] = array($woo_category_query);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
$loop = new \WP_Query( $args );
|
80 |
+
if( $loop->have_posts() ) {
|
81 |
+
while ( $loop->have_posts() ) : $loop->the_post();
|
82 |
+
$product = wc_get_product( get_the_ID() );
|
83 |
+
|
84 |
+
$products[] = array(
|
85 |
+
'id' => get_the_ID(),
|
86 |
+
'permalink' => get_the_permalink(),
|
87 |
+
'thumbnail' => woocommerce_get_product_thumbnail(),
|
88 |
+
'title' => $product->get_title()
|
89 |
+
);
|
90 |
+
endwhile;
|
91 |
+
}
|
92 |
+
wp_reset_postdata();
|
93 |
+
|
94 |
+
return $products;
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
}
|
classes/widgets/class-pwb-dropdown.php
CHANGED
@@ -1,93 +1,93 @@
|
|
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' => __( '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 |
-
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
20 |
-
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
21 |
-
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
22 |
-
?>
|
23 |
-
|
24 |
-
<p>
|
25 |
-
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>">
|
26 |
-
<?php echo __( 'Title', 'perfect-woocommerce-brands' );?>
|
27 |
-
</label>
|
28 |
-
<input
|
29 |
-
class="widefat"
|
30 |
-
type="text"
|
31 |
-
id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
|
32 |
-
name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
|
33 |
-
value="<?php if(isset($title)) echo esc_attr($title); ?>">
|
34 |
-
</p>
|
35 |
-
|
36 |
-
<p>
|
37 |
-
<input
|
38 |
-
type="checkbox"
|
39 |
-
id="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>"
|
40 |
-
name="<?php echo esc_attr( $this->get_field_name('hide_empty') ); ?>"
|
41 |
-
<?php checked( $hide_empty ); ?>>
|
42 |
-
<label for="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>">
|
43 |
-
<?php echo __( 'Hide empty', 'perfect-woocommerce-brands' );?>
|
44 |
-
</label>
|
45 |
-
</p>
|
46 |
-
|
47 |
-
<p>
|
48 |
-
<input
|
49 |
-
type="checkbox"
|
50 |
-
id="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>"
|
51 |
-
name="<?php echo esc_attr( $this->get_field_name('only_featured') ); ?>"
|
52 |
-
<?php checked( $only_featured ); ?>>
|
53 |
-
<label for="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>">
|
54 |
-
<?php echo __( 'Only favorite brands', 'perfect-woocommerce-brands' );?>
|
55 |
-
</label>
|
56 |
-
</p>
|
57 |
-
|
58 |
-
<?php
|
59 |
-
}
|
60 |
-
|
61 |
-
public function widget( $args, $instance ){
|
62 |
-
extract($args);
|
63 |
-
extract($instance);
|
64 |
-
|
65 |
-
$queried_obj = get_queried_object();
|
66 |
-
$queried_brand_id = ( isset( $queried_obj->term_id ) ) ? $queried_obj->term_id : false;
|
67 |
-
|
68 |
-
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
69 |
-
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
70 |
-
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands(
|
71 |
-
$hide_empty, 'name', 'ASC', $only_featured, true
|
72 |
-
);
|
73 |
-
|
74 |
-
if( is_array( $brands ) && count( $brands ) > 0 ){
|
75 |
-
|
76 |
-
echo $before_widget;
|
77 |
-
|
78 |
-
if( !empty( $title ) ) echo $before_title . $title . $after_title;
|
79 |
-
|
80 |
-
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
81 |
-
'dropdown',
|
82 |
-
'widgets',
|
83 |
-
array( 'brands' => $brands, 'selected' => $queried_brand_id ),
|
84 |
-
false
|
85 |
-
);
|
86 |
-
|
87 |
-
echo $after_widget;
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
92 |
-
|
93 |
-
}
|
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' => __( '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 |
+
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
20 |
+
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
21 |
+
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
22 |
+
?>
|
23 |
+
|
24 |
+
<p>
|
25 |
+
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>">
|
26 |
+
<?php echo __( 'Title', 'perfect-woocommerce-brands' );?>
|
27 |
+
</label>
|
28 |
+
<input
|
29 |
+
class="widefat"
|
30 |
+
type="text"
|
31 |
+
id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
|
32 |
+
name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
|
33 |
+
value="<?php if(isset($title)) echo esc_attr($title); ?>">
|
34 |
+
</p>
|
35 |
+
|
36 |
+
<p>
|
37 |
+
<input
|
38 |
+
type="checkbox"
|
39 |
+
id="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>"
|
40 |
+
name="<?php echo esc_attr( $this->get_field_name('hide_empty') ); ?>"
|
41 |
+
<?php checked( $hide_empty ); ?>>
|
42 |
+
<label for="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>">
|
43 |
+
<?php echo __( 'Hide empty', 'perfect-woocommerce-brands' );?>
|
44 |
+
</label>
|
45 |
+
</p>
|
46 |
+
|
47 |
+
<p>
|
48 |
+
<input
|
49 |
+
type="checkbox"
|
50 |
+
id="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>"
|
51 |
+
name="<?php echo esc_attr( $this->get_field_name('only_featured') ); ?>"
|
52 |
+
<?php checked( $only_featured ); ?>>
|
53 |
+
<label for="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>">
|
54 |
+
<?php echo __( 'Only favorite brands', 'perfect-woocommerce-brands' );?>
|
55 |
+
</label>
|
56 |
+
</p>
|
57 |
+
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
|
61 |
+
public function widget( $args, $instance ){
|
62 |
+
extract($args);
|
63 |
+
extract($instance);
|
64 |
+
|
65 |
+
$queried_obj = get_queried_object();
|
66 |
+
$queried_brand_id = ( isset( $queried_obj->term_id ) ) ? $queried_obj->term_id : false;
|
67 |
+
|
68 |
+
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
69 |
+
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
70 |
+
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands(
|
71 |
+
$hide_empty, 'name', 'ASC', $only_featured, true
|
72 |
+
);
|
73 |
+
|
74 |
+
if( is_array( $brands ) && count( $brands ) > 0 ){
|
75 |
+
|
76 |
+
echo $before_widget;
|
77 |
+
|
78 |
+
if( !empty( $title ) ) echo $before_title . $title . $after_title;
|
79 |
+
|
80 |
+
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
81 |
+
'dropdown',
|
82 |
+
'widgets',
|
83 |
+
array( 'brands' => $brands, 'selected' => $queried_brand_id ),
|
84 |
+
false
|
85 |
+
);
|
86 |
+
|
87 |
+
echo $after_widget;
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
|
93 |
+
}
|
classes/widgets/class-pwb-filter-by-brand.php
CHANGED
@@ -1,200 +1,200 @@
|
|
1 |
-
<?php
|
2 |
-
namespace Perfect_Woocommerce_Brands\Widgets;
|
3 |
-
use WP_Query;
|
4 |
-
|
5 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
-
|
7 |
-
class PWB_Filter_By_Brand_Widget extends \WP_Widget {
|
8 |
-
|
9 |
-
function __construct() {
|
10 |
-
$params = array(
|
11 |
-
'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
|
12 |
-
'name' => __( 'Filter products by brand', 'perfect-woocommerce-brands' )
|
13 |
-
);
|
14 |
-
parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
|
15 |
-
}
|
16 |
-
|
17 |
-
public function form( $instance ) {
|
18 |
-
extract($instance);
|
19 |
-
|
20 |
-
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
21 |
-
$limit = ( isset( $instance[ 'limit' ] ) ) ? $instance[ 'limit' ] : 20;
|
22 |
-
$hide_submit_btn = ( isset( $hide_submit_btn ) && $hide_submit_btn == 'on' ) ? true : false;
|
23 |
-
?>
|
24 |
-
<p>
|
25 |
-
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
26 |
-
<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 ); ?>" />
|
27 |
-
</p>
|
28 |
-
<p>
|
29 |
-
<label for="<?php echo $this->get_field_id( 'limit' ); ?>">
|
30 |
-
<?php echo __( 'Max number of brands', 'perfect-woocommerce-brands' );?>
|
31 |
-
</label>
|
32 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo esc_attr( $limit ); ?>" />
|
33 |
-
</p>
|
34 |
-
<p>
|
35 |
-
<input
|
36 |
-
type="checkbox"
|
37 |
-
id="<?php echo esc_attr( $this->get_field_id('hide_submit_btn') ); ?>"
|
38 |
-
name="<?php echo esc_attr( $this->get_field_name('hide_submit_btn') ); ?>"
|
39 |
-
<?php checked( $hide_submit_btn ); ?>>
|
40 |
-
<label for="<?php echo esc_attr( $this->get_field_id('hide_submit_btn') ); ?>">
|
41 |
-
<?php echo __( 'Hide filter button', 'perfect-woocommerce-brands' );?>
|
42 |
-
</label>
|
43 |
-
</p>
|
44 |
-
<?php
|
45 |
-
}
|
46 |
-
|
47 |
-
public function update( $new_instance, $old_instance ) {
|
48 |
-
$limit = trim( strip_tags( $new_instance['limit'] ) );
|
49 |
-
$limit = filter_var( $limit, FILTER_VALIDATE_INT, [ 'options' => [ 'min_range' => 1 ] ] );
|
50 |
-
|
51 |
-
$instance = array();
|
52 |
-
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
|
53 |
-
$instance['limit'] = ( $limit != false ) ? $limit : $old_instance['limit'];
|
54 |
-
$instance['hide_submit_btn'] = ( isset( $new_instance['hide_submit_btn'] ) ) ? $new_instance['hide_submit_btn'] : '';
|
55 |
-
return $instance;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function widget( $args, $instance ) {
|
59 |
-
extract( $args );
|
60 |
-
extract( $instance );
|
61 |
-
|
62 |
-
if( !is_tax('pwb-brand') && !is_product() ){
|
63 |
-
|
64 |
-
$hide_submit_btn = ( isset( $hide_submit_btn ) && $hide_submit_btn == 'on' ) ? true : false;
|
65 |
-
|
66 |
-
$show_widget = true;
|
67 |
-
$current_products = false;
|
68 |
-
if( is_product_taxonomy() || is_shop() ){
|
69 |
-
$current_products = $this->current_products_query();
|
70 |
-
if( empty( $current_products ) ) $show_widget = false;
|
71 |
-
}
|
72 |
-
|
73 |
-
if( $show_widget ){
|
74 |
-
|
75 |
-
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
76 |
-
$title = apply_filters( 'widget_title', $title );
|
77 |
-
$limit = ( isset( $instance[ 'limit' ] ) ) ? $instance[ 'limit' ] : 20;
|
78 |
-
|
79 |
-
echo $args['before_widget'];
|
80 |
-
if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title'];
|
81 |
-
$this->render_widget( $current_products, $limit, $hide_submit_btn );
|
82 |
-
echo $args['after_widget'];
|
83 |
-
}
|
84 |
-
|
85 |
-
}
|
86 |
-
|
87 |
-
}
|
88 |
-
|
89 |
-
public function render_widget( $current_products, $limit, $hide_submit_btn ){
|
90 |
-
|
91 |
-
$result_brands = array();
|
92 |
-
|
93 |
-
if( is_product_taxonomy() || is_shop() ){
|
94 |
-
|
95 |
-
if( !empty( $current_products ) ) $result_brands = $this->get_products_brands( $current_products );
|
96 |
-
|
97 |
-
if( is_shop() ){
|
98 |
-
$cate_url = get_permalink( wc_get_page_id( 'shop' ) );
|
99 |
-
}else{
|
100 |
-
$cate = get_queried_object();
|
101 |
-
$cateID = $cate->term_id;
|
102 |
-
$cate_url = get_term_link($cateID);
|
103 |
-
}
|
104 |
-
|
105 |
-
}else{
|
106 |
-
//no product category
|
107 |
-
$cate_url = get_permalink( wc_get_page_id( 'shop' ) );
|
108 |
-
$result_brands = get_terms( 'pwb-brand', array( 'hide_empty' => true, 'fields' => 'ids' ) );
|
109 |
-
}
|
110 |
-
|
111 |
-
if( $limit > 0 ) $result_brands = array_slice( $result_brands, 0, $limit );
|
112 |
-
|
113 |
-
global $wp;
|
114 |
-
$current_url = home_url(add_query_arg(array(),$wp->request));
|
115 |
-
|
116 |
-
if( !empty( $result_brands ) ){
|
117 |
-
|
118 |
-
$result_brands_ordered = array();
|
119 |
-
foreach( $result_brands as $brand ){
|
120 |
-
$brand = get_term($brand);
|
121 |
-
$result_brands_ordered[$brand->name] = $brand;
|
122 |
-
}
|
123 |
-
ksort($result_brands_ordered);
|
124 |
-
|
125 |
-
$result_brands_ordered = apply_filters( 'pwb_widget_brand_filter', $result_brands_ordered );
|
126 |
-
|
127 |
-
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
128 |
-
'filter-by-brand',
|
129 |
-
'widgets',
|
130 |
-
array( 'cate_url' => $cate_url, 'brands' => $result_brands_ordered, 'hide_submit_btn' => $hide_submit_btn ),
|
131 |
-
false
|
132 |
-
);
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
private function current_products_query(){
|
139 |
-
|
140 |
-
$args = array(
|
141 |
-
'posts_per_page' => -1,
|
142 |
-
'post_type' => 'product',
|
143 |
-
'tax_query' => array(
|
144 |
-
array(
|
145 |
-
'taxonomy' => 'pwb-brand',
|
146 |
-
'operator' => 'EXISTS'
|
147 |
-
)
|
148 |
-
),
|
149 |
-
'fields' => 'ids'
|
150 |
-
);
|
151 |
-
|
152 |
-
$cat = get_queried_object();
|
153 |
-
if( is_a( $cat, 'WP_Term' ) ){
|
154 |
-
$cat_id = $cat->term_id;
|
155 |
-
$cat_id_array = get_term_children( $cat_id, $cat->taxonomy );
|
156 |
-
$cat_id_array[] = $cat_id;
|
157 |
-
$args['tax_query'][] = array(
|
158 |
-
'taxonomy' => $cat->taxonomy,
|
159 |
-
'field' => 'term_id',
|
160 |
-
'terms' => $cat_id_array
|
161 |
-
);
|
162 |
-
}
|
163 |
-
|
164 |
-
if( get_option('woocommerce_hide_out_of_stock_items') === 'yes' ){
|
165 |
-
$args['meta_query'] = array(
|
166 |
-
array(
|
167 |
-
'key' => '_stock_status',
|
168 |
-
'value' => 'outofstock',
|
169 |
-
'compare' => 'NOT IN'
|
170 |
-
)
|
171 |
-
);
|
172 |
-
}
|
173 |
-
|
174 |
-
$wp_query = new WP_Query($args);
|
175 |
-
wp_reset_postdata();
|
176 |
-
return $wp_query->posts;
|
177 |
-
|
178 |
-
}
|
179 |
-
|
180 |
-
private function get_products_brands( $product_ids ){
|
181 |
-
|
182 |
-
$product_ids = implode(',', array_map('intval', $product_ids) );
|
183 |
-
|
184 |
-
global $wpdb;
|
185 |
-
$brand_ids = $wpdb->get_col( "SELECT DISTINCT t.term_id
|
186 |
-
FROM {$wpdb->prefix}terms AS t
|
187 |
-
INNER JOIN {$wpdb->prefix}term_taxonomy AS tt
|
188 |
-
ON t.term_id = tt.term_id
|
189 |
-
INNER JOIN {$wpdb->prefix}term_relationships AS tr
|
190 |
-
ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
191 |
-
WHERE tt.taxonomy IN ('pwb-brand')
|
192 |
-
AND tr.object_id IN ($product_ids)
|
193 |
-
ORDER BY t.name ASC
|
194 |
-
" );
|
195 |
-
|
196 |
-
return ( $brand_ids ) ? $brand_ids : false;
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
}
|
1 |
+
<?php
|
2 |
+
namespace Perfect_Woocommerce_Brands\Widgets;
|
3 |
+
use WP_Query;
|
4 |
+
|
5 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
6 |
+
|
7 |
+
class PWB_Filter_By_Brand_Widget extends \WP_Widget {
|
8 |
+
|
9 |
+
function __construct() {
|
10 |
+
$params = array(
|
11 |
+
'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
|
12 |
+
'name' => __( 'Filter products by brand', 'perfect-woocommerce-brands' )
|
13 |
+
);
|
14 |
+
parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
|
15 |
+
}
|
16 |
+
|
17 |
+
public function form( $instance ) {
|
18 |
+
extract($instance);
|
19 |
+
|
20 |
+
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
21 |
+
$limit = ( isset( $instance[ 'limit' ] ) ) ? $instance[ 'limit' ] : 20;
|
22 |
+
$hide_submit_btn = ( isset( $hide_submit_btn ) && $hide_submit_btn == 'on' ) ? true : false;
|
23 |
+
?>
|
24 |
+
<p>
|
25 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
26 |
+
<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 ); ?>" />
|
27 |
+
</p>
|
28 |
+
<p>
|
29 |
+
<label for="<?php echo $this->get_field_id( 'limit' ); ?>">
|
30 |
+
<?php echo __( 'Max number of brands', 'perfect-woocommerce-brands' );?>
|
31 |
+
</label>
|
32 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo esc_attr( $limit ); ?>" />
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
<input
|
36 |
+
type="checkbox"
|
37 |
+
id="<?php echo esc_attr( $this->get_field_id('hide_submit_btn') ); ?>"
|
38 |
+
name="<?php echo esc_attr( $this->get_field_name('hide_submit_btn') ); ?>"
|
39 |
+
<?php checked( $hide_submit_btn ); ?>>
|
40 |
+
<label for="<?php echo esc_attr( $this->get_field_id('hide_submit_btn') ); ?>">
|
41 |
+
<?php echo __( 'Hide filter button', 'perfect-woocommerce-brands' );?>
|
42 |
+
</label>
|
43 |
+
</p>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
|
47 |
+
public function update( $new_instance, $old_instance ) {
|
48 |
+
$limit = trim( strip_tags( $new_instance['limit'] ) );
|
49 |
+
$limit = filter_var( $limit, FILTER_VALIDATE_INT, [ 'options' => [ 'min_range' => 1 ] ] );
|
50 |
+
|
51 |
+
$instance = array();
|
52 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
|
53 |
+
$instance['limit'] = ( $limit != false ) ? $limit : $old_instance['limit'];
|
54 |
+
$instance['hide_submit_btn'] = ( isset( $new_instance['hide_submit_btn'] ) ) ? $new_instance['hide_submit_btn'] : '';
|
55 |
+
return $instance;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function widget( $args, $instance ) {
|
59 |
+
extract( $args );
|
60 |
+
extract( $instance );
|
61 |
+
|
62 |
+
if( !is_tax('pwb-brand') && !is_product() ){
|
63 |
+
|
64 |
+
$hide_submit_btn = ( isset( $hide_submit_btn ) && $hide_submit_btn == 'on' ) ? true : false;
|
65 |
+
|
66 |
+
$show_widget = true;
|
67 |
+
$current_products = false;
|
68 |
+
if( is_product_taxonomy() || is_shop() ){
|
69 |
+
$current_products = $this->current_products_query();
|
70 |
+
if( empty( $current_products ) ) $show_widget = false;
|
71 |
+
}
|
72 |
+
|
73 |
+
if( $show_widget ){
|
74 |
+
|
75 |
+
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
76 |
+
$title = apply_filters( 'widget_title', $title );
|
77 |
+
$limit = ( isset( $instance[ 'limit' ] ) ) ? $instance[ 'limit' ] : 20;
|
78 |
+
|
79 |
+
echo $args['before_widget'];
|
80 |
+
if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title'];
|
81 |
+
$this->render_widget( $current_products, $limit, $hide_submit_btn );
|
82 |
+
echo $args['after_widget'];
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
public function render_widget( $current_products, $limit, $hide_submit_btn ){
|
90 |
+
|
91 |
+
$result_brands = array();
|
92 |
+
|
93 |
+
if( is_product_taxonomy() || is_shop() ){
|
94 |
+
|
95 |
+
if( !empty( $current_products ) ) $result_brands = $this->get_products_brands( $current_products );
|
96 |
+
|
97 |
+
if( is_shop() ){
|
98 |
+
$cate_url = get_permalink( wc_get_page_id( 'shop' ) );
|
99 |
+
}else{
|
100 |
+
$cate = get_queried_object();
|
101 |
+
$cateID = $cate->term_id;
|
102 |
+
$cate_url = get_term_link($cateID);
|
103 |
+
}
|
104 |
+
|
105 |
+
}else{
|
106 |
+
//no product category
|
107 |
+
$cate_url = get_permalink( wc_get_page_id( 'shop' ) );
|
108 |
+
$result_brands = get_terms( 'pwb-brand', array( 'hide_empty' => true, 'fields' => 'ids' ) );
|
109 |
+
}
|
110 |
+
|
111 |
+
if( $limit > 0 ) $result_brands = array_slice( $result_brands, 0, $limit );
|
112 |
+
|
113 |
+
global $wp;
|
114 |
+
$current_url = home_url(add_query_arg(array(),$wp->request));
|
115 |
+
|
116 |
+
if( !empty( $result_brands ) ){
|
117 |
+
|
118 |
+
$result_brands_ordered = array();
|
119 |
+
foreach( $result_brands as $brand ){
|
120 |
+
$brand = get_term($brand);
|
121 |
+
$result_brands_ordered[$brand->name] = $brand;
|
122 |
+
}
|
123 |
+
ksort($result_brands_ordered);
|
124 |
+
|
125 |
+
$result_brands_ordered = apply_filters( 'pwb_widget_brand_filter', $result_brands_ordered );
|
126 |
+
|
127 |
+
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
128 |
+
'filter-by-brand',
|
129 |
+
'widgets',
|
130 |
+
array( 'cate_url' => $cate_url, 'brands' => $result_brands_ordered, 'hide_submit_btn' => $hide_submit_btn ),
|
131 |
+
false
|
132 |
+
);
|
133 |
+
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
private function current_products_query(){
|
139 |
+
|
140 |
+
$args = array(
|
141 |
+
'posts_per_page' => -1,
|
142 |
+
'post_type' => 'product',
|
143 |
+
'tax_query' => array(
|
144 |
+
array(
|
145 |
+
'taxonomy' => 'pwb-brand',
|
146 |
+
'operator' => 'EXISTS'
|
147 |
+
)
|
148 |
+
),
|
149 |
+
'fields' => 'ids'
|
150 |
+
);
|
151 |
+
|
152 |
+
$cat = get_queried_object();
|
153 |
+
if( is_a( $cat, 'WP_Term' ) ){
|
154 |
+
$cat_id = $cat->term_id;
|
155 |
+
$cat_id_array = get_term_children( $cat_id, $cat->taxonomy );
|
156 |
+
$cat_id_array[] = $cat_id;
|
157 |
+
$args['tax_query'][] = array(
|
158 |
+
'taxonomy' => $cat->taxonomy,
|
159 |
+
'field' => 'term_id',
|
160 |
+
'terms' => $cat_id_array
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
if( get_option('woocommerce_hide_out_of_stock_items') === 'yes' ){
|
165 |
+
$args['meta_query'] = array(
|
166 |
+
array(
|
167 |
+
'key' => '_stock_status',
|
168 |
+
'value' => 'outofstock',
|
169 |
+
'compare' => 'NOT IN'
|
170 |
+
)
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
$wp_query = new WP_Query($args);
|
175 |
+
wp_reset_postdata();
|
176 |
+
return $wp_query->posts;
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
private function get_products_brands( $product_ids ){
|
181 |
+
|
182 |
+
$product_ids = implode(',', array_map('intval', $product_ids) );
|
183 |
+
|
184 |
+
global $wpdb;
|
185 |
+
$brand_ids = $wpdb->get_col( "SELECT DISTINCT t.term_id
|
186 |
+
FROM {$wpdb->prefix}terms AS t
|
187 |
+
INNER JOIN {$wpdb->prefix}term_taxonomy AS tt
|
188 |
+
ON t.term_id = tt.term_id
|
189 |
+
INNER JOIN {$wpdb->prefix}term_relationships AS tr
|
190 |
+
ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
191 |
+
WHERE tt.taxonomy IN ('pwb-brand')
|
192 |
+
AND tr.object_id IN ($product_ids)
|
193 |
+
ORDER BY t.name ASC
|
194 |
+
" );
|
195 |
+
|
196 |
+
return ( $brand_ids ) ? $brand_ids : false;
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
}
|
classes/widgets/class-pwb-list.php
CHANGED
@@ -1,129 +1,129 @@
|
|
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' => __( '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 |
-
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
20 |
-
if( !isset( $display_as ) ) $display_as = 'brand_logo';
|
21 |
-
if( !isset( $columns ) ) $columns = '2';
|
22 |
-
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
23 |
-
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
24 |
-
$randomize = ( isset( $randomize ) && $randomize == 'on' ) ? true : false;
|
25 |
-
?>
|
26 |
-
|
27 |
-
<p>
|
28 |
-
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
|
29 |
-
<input
|
30 |
-
class="widefat"
|
31 |
-
type="text"
|
32 |
-
id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
|
33 |
-
name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
|
34 |
-
value="<?php if(isset($title)) echo esc_attr($title); ?>">
|
35 |
-
</p>
|
36 |
-
<p>
|
37 |
-
<label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
|
38 |
-
<select
|
39 |
-
class="widefat pwb-select-display-as"
|
40 |
-
id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
|
41 |
-
name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
|
42 |
-
<option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
|
43 |
-
<option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
|
44 |
-
</select>
|
45 |
-
</p>
|
46 |
-
<p class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
|
47 |
-
<label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
|
48 |
-
<select
|
49 |
-
class="widefat"
|
50 |
-
id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
|
51 |
-
name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
|
52 |
-
<option value="1" <?php selected( $columns, '1' ); ?>>1</option>
|
53 |
-
<option value="2" <?php selected( $columns, '2' ); ?>>2</option>
|
54 |
-
<option value="3" <?php selected( $columns, '3' ); ?>>3</option>
|
55 |
-
<option value="4" <?php selected( $columns, '4' ); ?>>4</option>
|
56 |
-
<option value="5" <?php selected( $columns, '5' ); ?>>5</option>
|
57 |
-
<option value="6" <?php selected( $columns, '6' ); ?>>6</option>
|
58 |
-
</select>
|
59 |
-
</p>
|
60 |
-
<p>
|
61 |
-
<input
|
62 |
-
type="checkbox"
|
63 |
-
id="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>"
|
64 |
-
name="<?php echo esc_attr( $this->get_field_name('hide_empty') ); ?>"
|
65 |
-
<?php checked( $hide_empty ); ?>>
|
66 |
-
<label for="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>">
|
67 |
-
<?php echo __( 'Hide empty', 'perfect-woocommerce-brands' );?>
|
68 |
-
</label>
|
69 |
-
</p>
|
70 |
-
<p>
|
71 |
-
<input
|
72 |
-
type="checkbox"
|
73 |
-
id="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>"
|
74 |
-
name="<?php echo esc_attr( $this->get_field_name('only_featured') ); ?>"
|
75 |
-
<?php checked( $only_featured ); ?>>
|
76 |
-
<label for="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>">
|
77 |
-
<?php echo __( 'Only favorite brands', 'perfect-woocommerce-brands' );?>
|
78 |
-
</label>
|
79 |
-
</p>
|
80 |
-
<p class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
|
81 |
-
<input
|
82 |
-
type="checkbox"
|
83 |
-
id="<?php echo esc_attr( $this->get_field_id('randomize') ); ?>"
|
84 |
-
name="<?php echo esc_attr( $this->get_field_name('randomize') ); ?>"
|
85 |
-
<?php checked( $randomize ); ?>>
|
86 |
-
<label for="<?php echo esc_attr( $this->get_field_id('randomize') ); ?>">
|
87 |
-
<?php echo __( 'Randomize', 'perfect-woocommerce-brands' );?>
|
88 |
-
</label>
|
89 |
-
</p>
|
90 |
-
|
91 |
-
<?php
|
92 |
-
}
|
93 |
-
|
94 |
-
public function widget( $args, $instance ){
|
95 |
-
extract( $args );
|
96 |
-
extract( $instance );
|
97 |
-
|
98 |
-
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
99 |
-
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
100 |
-
$randomize = ( isset( $randomize ) && $randomize == 'on' ) ? true : false;
|
101 |
-
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands(
|
102 |
-
$hide_empty, 'name', 'ASC', $only_featured, true
|
103 |
-
);
|
104 |
-
if( isset( $randomize ) && $randomize == 'on' && $display_as == 'brand_logo' ) shuffle( $brands );
|
105 |
-
|
106 |
-
if( is_array( $brands ) && count( $brands ) > 0 ){
|
107 |
-
|
108 |
-
echo $before_widget;
|
109 |
-
|
110 |
-
if( !empty( $title ) ) echo $before_title . $title . $after_title;
|
111 |
-
|
112 |
-
if( !isset( $display_as ) ) $display_as = 'brand_logo';
|
113 |
-
if( !isset( $columns ) ) $columns = '2';
|
114 |
-
$li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
|
115 |
-
|
116 |
-
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
117 |
-
( $display_as == 'brand_logo' ) ? 'list-logo' : 'list',
|
118 |
-
'widgets',
|
119 |
-
array( 'brands' => $brands, 'li_class' => $li_class, 'title_prefix' => __( 'Go to', 'perfect-woocommerce-brands' ) ),
|
120 |
-
false
|
121 |
-
);
|
122 |
-
|
123 |
-
echo $after_widget;
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
-
}
|
128 |
-
|
129 |
-
}
|
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' => __( '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 |
+
$title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
|
20 |
+
if( !isset( $display_as ) ) $display_as = 'brand_logo';
|
21 |
+
if( !isset( $columns ) ) $columns = '2';
|
22 |
+
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
23 |
+
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
24 |
+
$randomize = ( isset( $randomize ) && $randomize == 'on' ) ? true : false;
|
25 |
+
?>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
<label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
|
29 |
+
<input
|
30 |
+
class="widefat"
|
31 |
+
type="text"
|
32 |
+
id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
|
33 |
+
name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
|
34 |
+
value="<?php if(isset($title)) echo esc_attr($title); ?>">
|
35 |
+
</p>
|
36 |
+
<p>
|
37 |
+
<label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
|
38 |
+
<select
|
39 |
+
class="widefat pwb-select-display-as"
|
40 |
+
id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
|
41 |
+
name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
|
42 |
+
<option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
|
43 |
+
<option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
|
44 |
+
</select>
|
45 |
+
</p>
|
46 |
+
<p class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
|
47 |
+
<label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
|
48 |
+
<select
|
49 |
+
class="widefat"
|
50 |
+
id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
|
51 |
+
name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
|
52 |
+
<option value="1" <?php selected( $columns, '1' ); ?>>1</option>
|
53 |
+
<option value="2" <?php selected( $columns, '2' ); ?>>2</option>
|
54 |
+
<option value="3" <?php selected( $columns, '3' ); ?>>3</option>
|
55 |
+
<option value="4" <?php selected( $columns, '4' ); ?>>4</option>
|
56 |
+
<option value="5" <?php selected( $columns, '5' ); ?>>5</option>
|
57 |
+
<option value="6" <?php selected( $columns, '6' ); ?>>6</option>
|
58 |
+
</select>
|
59 |
+
</p>
|
60 |
+
<p>
|
61 |
+
<input
|
62 |
+
type="checkbox"
|
63 |
+
id="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>"
|
64 |
+
name="<?php echo esc_attr( $this->get_field_name('hide_empty') ); ?>"
|
65 |
+
<?php checked( $hide_empty ); ?>>
|
66 |
+
<label for="<?php echo esc_attr( $this->get_field_id('hide_empty') ); ?>">
|
67 |
+
<?php echo __( 'Hide empty', 'perfect-woocommerce-brands' );?>
|
68 |
+
</label>
|
69 |
+
</p>
|
70 |
+
<p>
|
71 |
+
<input
|
72 |
+
type="checkbox"
|
73 |
+
id="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>"
|
74 |
+
name="<?php echo esc_attr( $this->get_field_name('only_featured') ); ?>"
|
75 |
+
<?php checked( $only_featured ); ?>>
|
76 |
+
<label for="<?php echo esc_attr( $this->get_field_id('only_featured') ); ?>">
|
77 |
+
<?php echo __( 'Only favorite brands', 'perfect-woocommerce-brands' );?>
|
78 |
+
</label>
|
79 |
+
</p>
|
80 |
+
<p class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
|
81 |
+
<input
|
82 |
+
type="checkbox"
|
83 |
+
id="<?php echo esc_attr( $this->get_field_id('randomize') ); ?>"
|
84 |
+
name="<?php echo esc_attr( $this->get_field_name('randomize') ); ?>"
|
85 |
+
<?php checked( $randomize ); ?>>
|
86 |
+
<label for="<?php echo esc_attr( $this->get_field_id('randomize') ); ?>">
|
87 |
+
<?php echo __( 'Randomize', 'perfect-woocommerce-brands' );?>
|
88 |
+
</label>
|
89 |
+
</p>
|
90 |
+
|
91 |
+
<?php
|
92 |
+
}
|
93 |
+
|
94 |
+
public function widget( $args, $instance ){
|
95 |
+
extract( $args );
|
96 |
+
extract( $instance );
|
97 |
+
|
98 |
+
$hide_empty = ( isset( $hide_empty ) && $hide_empty == 'on' ) ? true : false;
|
99 |
+
$only_featured = ( isset( $only_featured ) && $only_featured == 'on' ) ? true : false;
|
100 |
+
$randomize = ( isset( $randomize ) && $randomize == 'on' ) ? true : false;
|
101 |
+
$brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands(
|
102 |
+
$hide_empty, 'name', 'ASC', $only_featured, true
|
103 |
+
);
|
104 |
+
if( isset( $randomize ) && $randomize == 'on' && $display_as == 'brand_logo' ) shuffle( $brands );
|
105 |
+
|
106 |
+
if( is_array( $brands ) && count( $brands ) > 0 ){
|
107 |
+
|
108 |
+
echo $before_widget;
|
109 |
+
|
110 |
+
if( !empty( $title ) ) echo $before_title . $title . $after_title;
|
111 |
+
|
112 |
+
if( !isset( $display_as ) ) $display_as = 'brand_logo';
|
113 |
+
if( !isset( $columns ) ) $columns = '2';
|
114 |
+
$li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
|
115 |
+
|
116 |
+
echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
|
117 |
+
( $display_as == 'brand_logo' ) ? 'list-logo' : 'list',
|
118 |
+
'widgets',
|
119 |
+
array( 'brands' => $brands, 'li_class' => $li_class, 'title_prefix' => __( 'Go to', 'perfect-woocommerce-brands' ) ),
|
120 |
+
false
|
121 |
+
);
|
122 |
+
|
123 |
+
echo $after_widget;
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
}
|
lang/perfect-woocommerce-brands-ca.po
CHANGED
@@ -1,718 +1,718 @@
|
|
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 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: \n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2018-11-29 00:15+0100\n"
|
11 |
-
"PO-Revision-Date: 2018-11-29 00:19+0100\n"
|
12 |
-
"Last-Translator: Lluís Martí <lluis@manies.cat>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"Language: ca \n"
|
15 |
-
"MIME-Version: 1.0\n"
|
16 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
-
"Content-Transfer-Encoding: 8bit\n"
|
18 |
-
"Plural-Forms: \n"
|
19 |
-
"X-Generator: Eazy Po 0.9.5.3\n"
|
20 |
-
|
21 |
-
#: main.php:106
|
22 |
-
msgid ""
|
23 |
-
"Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
|
24 |
-
"active WooCommerce plugin."
|
25 |
-
msgstr ""
|
26 |
-
"Perfect WooCommerce Brands necessita WooCommerce per a funcionar. Si us plau, "
|
27 |
-
"instal·la i activa WooCommerce."
|
28 |
-
|
29 |
-
#: classes/class-perfect-woocommerce-brands.php:52
|
30 |
-
msgid ""
|
31 |
-
"We know that you´re in love with Perfect WooCommerce Brands, you can help us "
|
32 |
-
"making it a bit better. Thanks a lot!"
|
33 |
-
msgstr ""
|
34 |
-
"Sabem que Perfect WooCommerce Brands t'encanta, pots ajudar-nos a "
|
35 |
-
"fer-lo una mica millor. ¡Moltes gràcies!"
|
36 |
-
|
37 |
-
#: classes/class-perfect-woocommerce-brands.php:54
|
38 |
-
msgid ""
|
39 |
-
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
40 |
-
"reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
|
41 |
-
msgstr ""
|
42 |
-
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
43 |
-
"reviews/?rate=5#new-post\" target=\"_blank\">Deixar una review</a>"
|
44 |
-
|
45 |
-
#: classes/class-perfect-woocommerce-brands.php:55
|
46 |
-
msgid ""
|
47 |
-
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
48 |
-
"woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
|
49 |
-
msgstr ""
|
50 |
-
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
51 |
-
"woocommerce-brands\" target=\"_blank\">Traduir el plugin</a>"
|
52 |
-
|
53 |
-
#: classes/class-perfect-woocommerce-brands.php:56
|
54 |
-
msgid ""
|
55 |
-
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
56 |
-
"\"_blank\">View on GitHub</a>"
|
57 |
-
msgstr ""
|
58 |
-
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
59 |
-
"\"_blank\">Veure a GitHub</a>"
|
60 |
-
|
61 |
-
#: classes/class-perfect-woocommerce-brands.php:79
|
62 |
-
msgid "Settings"
|
63 |
-
msgstr "Ajustaments"
|
64 |
-
|
65 |
-
#: classes/class-perfect-woocommerce-brands.php:280
|
66 |
-
msgid "PWB Product carousel"
|
67 |
-
msgstr "PWB Carrussel de productes"
|
68 |
-
|
69 |
-
#: classes/class-perfect-woocommerce-brands.php:281
|
70 |
-
msgid "Product carousel by brand or by category"
|
71 |
-
msgstr "Carrussel de productes per marca o categoria"
|
72 |
-
|
73 |
-
#: classes/class-perfect-woocommerce-brands.php:289
|
74 |
-
#: classes/class-perfect-woocommerce-brands.php:611
|
75 |
-
#: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
|
76 |
-
#: classes/admin/class-pwb-exporter-support.php:22
|
77 |
-
#: classes/admin/class-pwb-importer-support.php:22
|
78 |
-
#: classes/admin/class-pwb-importer-support.php:33
|
79 |
-
msgid "Brand"
|
80 |
-
msgstr "Marca"
|
81 |
-
|
82 |
-
#: classes/class-perfect-woocommerce-brands.php:297
|
83 |
-
msgid "Products"
|
84 |
-
msgstr "Productes"
|
85 |
-
|
86 |
-
#: classes/class-perfect-woocommerce-brands.php:300
|
87 |
-
msgid "Number of products to load"
|
88 |
-
msgstr "Número de productes per carregar"
|
89 |
-
|
90 |
-
#: classes/class-perfect-woocommerce-brands.php:305
|
91 |
-
msgid "Products to show"
|
92 |
-
msgstr "Productes per mostrar"
|
93 |
-
|
94 |
-
#: classes/class-perfect-woocommerce-brands.php:308
|
95 |
-
msgid "Number of products to show"
|
96 |
-
msgstr "Número de productes per mostrar"
|
97 |
-
|
98 |
-
#: classes/class-perfect-woocommerce-brands.php:313
|
99 |
-
msgid "Products to scroll"
|
100 |
-
msgstr "Número de productes per scroll"
|
101 |
-
|
102 |
-
#: classes/class-perfect-woocommerce-brands.php:316
|
103 |
-
msgid "Number of products to scroll"
|
104 |
-
msgstr "Número de productes per cada scroll"
|
105 |
-
|
106 |
-
#: classes/class-perfect-woocommerce-brands.php:321
|
107 |
-
#: classes/class-perfect-woocommerce-brands.php:370
|
108 |
-
msgid "Autoplay"
|
109 |
-
msgstr "Mode automàtic"
|
110 |
-
|
111 |
-
#: classes/class-perfect-woocommerce-brands.php:323
|
112 |
-
#: classes/class-perfect-woocommerce-brands.php:372
|
113 |
-
msgid "Autoplay carousel"
|
114 |
-
msgstr "Mode automàtic pel carrussel"
|
115 |
-
|
116 |
-
#: classes/class-perfect-woocommerce-brands.php:328
|
117 |
-
#: classes/class-perfect-woocommerce-brands.php:377
|
118 |
-
msgid "Arrows"
|
119 |
-
msgstr "Dates de navegació"
|
120 |
-
|
121 |
-
#: classes/class-perfect-woocommerce-brands.php:330
|
122 |
-
#: classes/class-perfect-woocommerce-brands.php:379
|
123 |
-
msgid "Display prev and next arrows"
|
124 |
-
msgstr "Mostrar fletxes de navegació"
|
125 |
-
|
126 |
-
#: classes/class-perfect-woocommerce-brands.php:336
|
127 |
-
msgid "PWB Brands carousel"
|
128 |
-
msgstr "PWB Carrussel de marques"
|
129 |
-
|
130 |
-
#: classes/class-perfect-woocommerce-brands.php:337
|
131 |
-
msgid "Brands carousel"
|
132 |
-
msgstr "Carrussel de marques"
|
133 |
-
|
134 |
-
#: classes/class-perfect-woocommerce-brands.php:346
|
135 |
-
msgid "Items"
|
136 |
-
msgstr "Elemento"
|
137 |
-
|
138 |
-
#: classes/class-perfect-woocommerce-brands.php:349
|
139 |
-
msgid "Number of items to load (or 'featured')"
|
140 |
-
msgstr "Número d'elements per cargar (o 'featured')"
|
141 |
-
|
142 |
-
#: classes/class-perfect-woocommerce-brands.php:354
|
143 |
-
msgid "Items to show"
|
144 |
-
msgstr "Elements a mostrar"
|
145 |
-
|
146 |
-
#: classes/class-perfect-woocommerce-brands.php:357
|
147 |
-
msgid "Number of items to show"
|
148 |
-
msgstr "Número d'elements a mostrar"
|
149 |
-
|
150 |
-
#: classes/class-perfect-woocommerce-brands.php:362
|
151 |
-
msgid "Items to scroll"
|
152 |
-
msgstr "Número d'elements per scroll"
|
153 |
-
|
154 |
-
#: classes/class-perfect-woocommerce-brands.php:365
|
155 |
-
msgid "Number of items to scroll"
|
156 |
-
msgstr "Número d'elements per cada scroll"
|
157 |
-
|
158 |
-
#: classes/class-perfect-woocommerce-brands.php:383
|
159 |
-
#: classes/class-perfect-woocommerce-brands.php:411
|
160 |
-
#: classes/class-perfect-woocommerce-brands.php:492
|
161 |
-
#: classes/admin/class-pwb-admin-tab.php:129
|
162 |
-
msgid "Brand logo size"
|
163 |
-
msgstr "Mida del logo de la marca"
|
164 |
-
|
165 |
-
#: classes/class-perfect-woocommerce-brands.php:394
|
166 |
-
msgid "PWB All brands"
|
167 |
-
msgstr "PWB Totes les marques"
|
168 |
-
|
169 |
-
#: classes/class-perfect-woocommerce-brands.php:395
|
170 |
-
msgid "Show all brands"
|
171 |
-
msgstr "Mostrar totes les marques"
|
172 |
-
|
173 |
-
#: classes/class-perfect-woocommerce-brands.php:404
|
174 |
-
msgid "Brands per page"
|
175 |
-
msgstr "Marques per pàgina"
|
176 |
-
|
177 |
-
#: classes/class-perfect-woocommerce-brands.php:407
|
178 |
-
msgid "Show x brands per page"
|
179 |
-
msgstr "Mostrar x marques per pàgina"
|
180 |
-
|
181 |
-
#: classes/class-perfect-woocommerce-brands.php:418
|
182 |
-
msgid "Order by"
|
183 |
-
msgstr "Ordenar per"
|
184 |
-
|
185 |
-
#: classes/class-perfect-woocommerce-brands.php:432
|
186 |
-
msgid "Order"
|
187 |
-
msgstr "Ordre"
|
188 |
-
|
189 |
-
#: classes/class-perfect-woocommerce-brands.php:442
|
190 |
-
msgid "Title position"
|
191 |
-
msgstr "Posició del títol"
|
192 |
-
|
193 |
-
#: classes/class-perfect-woocommerce-brands.php:446
|
194 |
-
msgid "Before image"
|
195 |
-
msgstr "Abans de la imatge"
|
196 |
-
|
197 |
-
#: classes/class-perfect-woocommerce-brands.php:447
|
198 |
-
msgid "After image"
|
199 |
-
msgstr "Després de la imatge"
|
200 |
-
|
201 |
-
#: classes/class-perfect-woocommerce-brands.php:448
|
202 |
-
msgid "Hide"
|
203 |
-
msgstr "Amagar"
|
204 |
-
|
205 |
-
#: classes/class-perfect-woocommerce-brands.php:454
|
206 |
-
#: classes/widgets/class-pwb-dropdown.php:43
|
207 |
-
#: classes/widgets/class-pwb-list.php:67
|
208 |
-
msgid "Hide empty"
|
209 |
-
msgstr "Amagar buides"
|
210 |
-
|
211 |
-
#: classes/class-perfect-woocommerce-brands.php:456
|
212 |
-
msgid "Hide brands that have not been assigned to any product"
|
213 |
-
msgstr "Amagar marque que no han estat assignades a cap producte"
|
214 |
-
|
215 |
-
#: classes/class-perfect-woocommerce-brands.php:464
|
216 |
-
msgid "PWB AZ Listing"
|
217 |
-
msgstr "PWB Llista A-Z"
|
218 |
-
|
219 |
-
#: classes/class-perfect-woocommerce-brands.php:465
|
220 |
-
msgid "AZ Listing for brands"
|
221 |
-
msgstr "Llistat A-Z de marques"
|
222 |
-
|
223 |
-
#: classes/class-perfect-woocommerce-brands.php:474
|
224 |
-
msgid "PWB brand"
|
225 |
-
msgstr "PWB Marca"
|
226 |
-
|
227 |
-
#: classes/class-perfect-woocommerce-brands.php:475
|
228 |
-
msgid "Show brand for a specific product"
|
229 |
-
msgstr "Veure marques d'un producte específic"
|
230 |
-
|
231 |
-
#: classes/class-perfect-woocommerce-brands.php:485
|
232 |
-
msgid "Product id"
|
233 |
-
msgstr "Id del producte"
|
234 |
-
|
235 |
-
#: classes/class-perfect-woocommerce-brands.php:488
|
236 |
-
msgid "Product id (post id)"
|
237 |
-
msgstr "Id del producte (id del post)"
|
238 |
-
|
239 |
-
#: classes/class-perfect-woocommerce-brands.php:533
|
240 |
-
#: classes/shortcodes/class-pwb-brand.php:29
|
241 |
-
#: classes/shortcodes/class-pwb-brand.php:31
|
242 |
-
msgid "View brand"
|
243 |
-
msgstr "Veure marca"
|
244 |
-
|
245 |
-
#: classes/class-perfect-woocommerce-brands.php:598
|
246 |
-
msgid "¿Start migration?"
|
247 |
-
msgstr "Començar la migració?"
|
248 |
-
|
249 |
-
#: classes/class-perfect-woocommerce-brands.php:599
|
250 |
-
msgid ""
|
251 |
-
"We are migrating the product brands. ¡Don´t close this window until the "
|
252 |
-
"process is finished!"
|
253 |
-
msgstr ""
|
254 |
-
"Estem migrant les marques de producte. ¡No tanquis aquesta finestra fins que "
|
255 |
-
"el procés finalitzi!"
|
256 |
-
|
257 |
-
#: classes/class-perfect-woocommerce-brands.php:600
|
258 |
-
msgid "¿Start loading dummy data?"
|
259 |
-
msgstr "Començar amb la importació?"
|
260 |
-
|
261 |
-
#: classes/class-perfect-woocommerce-brands.php:601
|
262 |
-
msgid ""
|
263 |
-
"We are importing the dummy data. ¡Don´t close this window until the process "
|
264 |
-
"is finished!"
|
265 |
-
msgstr ""
|
266 |
-
"En aquest moment estem important les marques fictícies. ¡No tanquis aquesta "
|
267 |
-
"finestra fins que no acabi el procés!"
|
268 |
-
|
269 |
-
#: classes/class-perfect-woocommerce-brands.php:610
|
270 |
-
#: classes/class-perfect-woocommerce-brands.php:612
|
271 |
-
#: classes/admin/class-edit-brands-page.php:128
|
272 |
-
#: classes/admin/class-pwb-admin-tab.php:21
|
273 |
-
#: classes/widgets/class-pwb-dropdown.php:19
|
274 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:20
|
275 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:75
|
276 |
-
#: classes/widgets/class-pwb-list.php:19 templates/widgets/dropdown.php:16
|
277 |
-
msgid "Brands"
|
278 |
-
msgstr "Marques"
|
279 |
-
|
280 |
-
#: classes/class-perfect-woocommerce-brands.php:613
|
281 |
-
msgid "All Brands"
|
282 |
-
msgstr "Totes las marques"
|
283 |
-
|
284 |
-
#: classes/class-perfect-woocommerce-brands.php:614
|
285 |
-
msgid "Edit Brand"
|
286 |
-
msgstr "Editar marca"
|
287 |
-
|
288 |
-
#: classes/class-perfect-woocommerce-brands.php:615
|
289 |
-
msgid "View Brand"
|
290 |
-
msgstr "Veure marca"
|
291 |
-
|
292 |
-
#: classes/class-perfect-woocommerce-brands.php:616
|
293 |
-
msgid "Update Brand"
|
294 |
-
msgstr "Actualitzar marca"
|
295 |
-
|
296 |
-
#: classes/class-perfect-woocommerce-brands.php:617
|
297 |
-
msgid "Add New Brand"
|
298 |
-
msgstr "Afegir nova marca"
|
299 |
-
|
300 |
-
#: classes/class-perfect-woocommerce-brands.php:618
|
301 |
-
msgid "New Brand Name"
|
302 |
-
msgstr "Nou nom de marca"
|
303 |
-
|
304 |
-
#: classes/class-perfect-woocommerce-brands.php:619
|
305 |
-
msgid "Parent Brand"
|
306 |
-
msgstr "Marca Pare"
|
307 |
-
|
308 |
-
#: classes/class-perfect-woocommerce-brands.php:620
|
309 |
-
msgid "Parent Brand:"
|
310 |
-
msgstr "Marca Pare:"
|
311 |
-
|
312 |
-
#: classes/class-perfect-woocommerce-brands.php:621
|
313 |
-
msgid "Search Brands"
|
314 |
-
msgstr "Cercar Marques"
|
315 |
-
|
316 |
-
#: classes/class-perfect-woocommerce-brands.php:622
|
317 |
-
msgid "Popular Brands"
|
318 |
-
msgstr "Marques Populars"
|
319 |
-
|
320 |
-
#: classes/class-perfect-woocommerce-brands.php:623
|
321 |
-
msgid "Separate brands with commas"
|
322 |
-
msgstr "Separar marques amb comes"
|
323 |
-
|
324 |
-
#: classes/class-perfect-woocommerce-brands.php:624
|
325 |
-
msgid "Add or remove brands"
|
326 |
-
msgstr "Afegir o eliminar marques"
|
327 |
-
|
328 |
-
#: classes/class-perfect-woocommerce-brands.php:625
|
329 |
-
msgid "Choose from the most used brands"
|
330 |
-
msgstr "Seleccionar de les marques més utilitzades"
|
331 |
-
|
332 |
-
#: classes/class-perfect-woocommerce-brands.php:626
|
333 |
-
msgid "No brands found"
|
334 |
-
msgstr "No s'han trobat marques"
|
335 |
-
|
336 |
-
#: classes/class-perfect-woocommerce-brands.php:697
|
337 |
-
msgid "All"
|
338 |
-
msgstr "Totes"
|
339 |
-
|
340 |
-
#: classes/class-pwb-api-support.php:87
|
341 |
-
msgid "Product brands"
|
342 |
-
msgstr "Marques del producte"
|
343 |
-
|
344 |
-
#: classes/class-pwb-term.php:20
|
345 |
-
msgid "Only WP_Term objects are allowed"
|
346 |
-
msgstr "Només es permeten objectes del tipus WP_Term"
|
347 |
-
|
348 |
-
#: classes/admin/class-brands-custom-fields.php:20
|
349 |
-
#: classes/admin/class-brands-custom-fields.php:59
|
350 |
-
msgid "Description"
|
351 |
-
msgstr "Descripció"
|
352 |
-
|
353 |
-
#: classes/admin/class-brands-custom-fields.php:22
|
354 |
-
#: classes/admin/class-brands-custom-fields.php:63
|
355 |
-
msgid ""
|
356 |
-
"Brand description for the archive pages. You can include some html markup "
|
357 |
-
"and shortcodes."
|
358 |
-
msgstr ""
|
359 |
-
"Descripció de la marca per a la pàgina d'arxiu. Pots incloure marcat "
|
360 |
-
"html i shortcodes."
|
361 |
-
|
362 |
-
#: classes/admin/class-brands-custom-fields.php:26
|
363 |
-
#: classes/admin/class-brands-custom-fields.php:68
|
364 |
-
#: classes/widgets/class-pwb-list.php:43
|
365 |
-
msgid "Brand logo"
|
366 |
-
msgstr "Logo de la marca"
|
367 |
-
|
368 |
-
#: classes/admin/class-brands-custom-fields.php:28
|
369 |
-
#: classes/admin/class-brands-custom-fields.php:34
|
370 |
-
#: classes/admin/class-brands-custom-fields.php:72
|
371 |
-
#: classes/admin/class-brands-custom-fields.php:92
|
372 |
-
msgid "Select image"
|
373 |
-
msgstr "Seleccionar imatge"
|
374 |
-
|
375 |
-
#: classes/admin/class-brands-custom-fields.php:32
|
376 |
-
#: classes/admin/class-brands-custom-fields.php:88
|
377 |
-
msgid "Brand banner"
|
378 |
-
msgstr "Banner de la marca"
|
379 |
-
|
380 |
-
#: classes/admin/class-brands-custom-fields.php:35
|
381 |
-
msgid "This image will be shown on brand page"
|
382 |
-
msgstr "Aquesta imatge es mostrarà a la pàgina de la marca"
|
383 |
-
|
384 |
-
#: classes/admin/class-brands-custom-fields.php:39
|
385 |
-
#: classes/admin/class-brands-custom-fields.php:108
|
386 |
-
msgid "Brand banner link"
|
387 |
-
msgstr "Enlĺaç per al banner de la marca"
|
388 |
-
|
389 |
-
#: classes/admin/class-brands-custom-fields.php:41
|
390 |
-
#: classes/admin/class-brands-custom-fields.php:112
|
391 |
-
msgid "This link should be relative to site url. Example: product/product-name"
|
392 |
-
msgstr ""
|
393 |
-
"Aquest enllaç ha de ser relatiu a la url del lloc web. Exemple: producte/"
|
394 |
-
"nom-del-producte"
|
395 |
-
|
396 |
-
#: classes/admin/class-edit-brands-page.php:39
|
397 |
-
msgid "featured"
|
398 |
-
msgstr "preferida"
|
399 |
-
|
400 |
-
#: classes/admin/class-edit-brands-page.php:74
|
401 |
-
msgid "Logo"
|
402 |
-
msgstr "Logo"
|
403 |
-
|
404 |
-
#: classes/admin/class-edit-brands-page.php:96
|
405 |
-
msgid "Set as featured"
|
406 |
-
msgstr "Marcar com a preferida"
|
407 |
-
|
408 |
-
#: classes/admin/class-edit-brands-page.php:118
|
409 |
-
msgid "Error!"
|
410 |
-
msgstr "Error!"
|
411 |
-
|
412 |
-
#: classes/admin/class-edit-brands-page.php:131
|
413 |
-
msgid "Show featured brands first"
|
414 |
-
msgstr "Mostrar marques preferides primer"
|
415 |
-
|
416 |
-
#: classes/admin/class-pwb-admin-tab.php:70
|
417 |
-
msgid "Brands settings"
|
418 |
-
msgstr "Ajustaments de les marques"
|
419 |
-
|
420 |
-
#: classes/admin/class-pwb-admin-tab.php:76
|
421 |
-
msgid "Slug"
|
422 |
-
msgstr "Slug"
|
423 |
-
|
424 |
-
#: classes/admin/class-pwb-admin-tab.php:79
|
425 |
-
msgid "Brands taxonomy slug"
|
426 |
-
msgstr "Slug de la taxonomia marques"
|
427 |
-
|
428 |
-
#: classes/admin/class-pwb-admin-tab.php:84
|
429 |
-
msgid "Show brand description"
|
430 |
-
msgstr "Mostrar descripció de la marca"
|
431 |
-
|
432 |
-
#: classes/admin/class-pwb-admin-tab.php:88
|
433 |
-
msgid "Show brand description (if is set) on brand archive page"
|
434 |
-
msgstr "Mostrar descripció de la marca a la pàgina d'arxiu"
|
435 |
-
|
436 |
-
#: classes/admin/class-pwb-admin-tab.php:91
|
437 |
-
msgid "Yes, before product loop"
|
438 |
-
msgstr "Si, abans dels productes"
|
439 |
-
|
440 |
-
#: classes/admin/class-pwb-admin-tab.php:92
|
441 |
-
msgid "Yes, after product loop"
|
442 |
-
msgstr "Si, després dels productes"
|
443 |
-
|
444 |
-
#: classes/admin/class-pwb-admin-tab.php:93
|
445 |
-
msgid "No, hide description"
|
446 |
-
msgstr "No, ocultar descripció"
|
447 |
-
|
448 |
-
#: classes/admin/class-pwb-admin-tab.php:97
|
449 |
-
msgid "Single product tab"
|
450 |
-
msgstr "Tab a la pàgina del producte"
|
451 |
-
|
452 |
-
#: classes/admin/class-pwb-admin-tab.php:100
|
453 |
-
msgid "Show brand tab in single product page"
|
454 |
-
msgstr "Mostrar pestanya amb informació de la marca a la pàgina del producte"
|
455 |
-
|
456 |
-
#: classes/admin/class-pwb-admin-tab.php:104
|
457 |
-
msgid "Show brands in loop"
|
458 |
-
msgstr "Mostrar marques al loop"
|
459 |
-
|
460 |
-
#: classes/admin/class-pwb-admin-tab.php:107
|
461 |
-
msgid "Show brand logo (or name) in product loop"
|
462 |
-
msgstr "Mostrar el logo de la marca (o el nom) al loop"
|
463 |
-
|
464 |
-
#: classes/admin/class-pwb-admin-tab.php:110
|
465 |
-
#: classes/admin/class-pwb-admin-tab.php:123
|
466 |
-
msgid "No"
|
467 |
-
msgstr "No"
|
468 |
-
|
469 |
-
#: classes/admin/class-pwb-admin-tab.php:111
|
470 |
-
#: classes/admin/class-pwb-admin-tab.php:124
|
471 |
-
msgid "Show brand link"
|
472 |
-
msgstr "Mostrar el link de la marca"
|
473 |
-
|
474 |
-
#: classes/admin/class-pwb-admin-tab.php:112
|
475 |
-
#: classes/admin/class-pwb-admin-tab.php:125
|
476 |
-
msgid "Show brand image (if is set)"
|
477 |
-
msgstr "Mostrar el logo de la marca (si en té un d'assignat)"
|
478 |
-
|
479 |
-
#: classes/admin/class-pwb-admin-tab.php:116
|
480 |
-
msgid "Show brands in single product"
|
481 |
-
msgstr "Mostrar marques a la pàgina del producte"
|
482 |
-
|
483 |
-
#: classes/admin/class-pwb-admin-tab.php:119
|
484 |
-
msgid "Show brand logo (or name) in single product"
|
485 |
-
msgstr "Mostrar el logo de la marca (o el nom) a la pàgina del producte"
|
486 |
-
|
487 |
-
#: classes/admin/class-pwb-admin-tab.php:137
|
488 |
-
msgid "Brand position"
|
489 |
-
msgstr "Posició de la marca"
|
490 |
-
|
491 |
-
#: classes/admin/class-pwb-admin-tab.php:140
|
492 |
-
msgid "For single product"
|
493 |
-
msgstr "A la pàgina individual de cada producte"
|
494 |
-
|
495 |
-
#: classes/admin/class-pwb-admin-tab.php:143
|
496 |
-
msgid "Before title"
|
497 |
-
msgstr "Abans del títol"
|
498 |
-
|
499 |
-
#: classes/admin/class-pwb-admin-tab.php:144
|
500 |
-
msgid "After title"
|
501 |
-
msgstr "Després del títol"
|
502 |
-
|
503 |
-
#: classes/admin/class-pwb-admin-tab.php:145
|
504 |
-
msgid "After price"
|
505 |
-
msgstr "Després del preu"
|
506 |
-
|
507 |
-
#: classes/admin/class-pwb-admin-tab.php:146
|
508 |
-
msgid "After excerpt"
|
509 |
-
msgstr "Després de la descripció curta"
|
510 |
-
|
511 |
-
#: classes/admin/class-pwb-admin-tab.php:147
|
512 |
-
msgid "After add to cart"
|
513 |
-
msgstr "Després del botó de comprar"
|
514 |
-
|
515 |
-
#: classes/admin/class-pwb-admin-tab.php:148
|
516 |
-
msgid "After meta"
|
517 |
-
msgstr "Després del meta"
|
518 |
-
|
519 |
-
#: classes/admin/class-pwb-admin-tab.php:149
|
520 |
-
msgid "After sharing"
|
521 |
-
msgstr "Després de compartir"
|
522 |
-
|
523 |
-
#: classes/admin/class-pwb-admin-tab.php:153
|
524 |
-
msgid "Brands page"
|
525 |
-
msgstr "Pàgina de marques"
|
526 |
-
|
527 |
-
#: classes/admin/class-pwb-admin-tab.php:156
|
528 |
-
msgid "For linking breadcrumbs"
|
529 |
-
msgstr "Per a l'enllaç de las molles de pa"
|
530 |
-
|
531 |
-
#: classes/admin/class-pwb-admin-tab.php:173
|
532 |
-
msgid "Tools"
|
533 |
-
msgstr "Eines"
|
534 |
-
|
535 |
-
#: classes/admin/class-pwb-admin-tab.php:179
|
536 |
-
#: templates/admin/brands-exporter.php:16
|
537 |
-
msgid "Import brands"
|
538 |
-
msgstr "Importar marques"
|
539 |
-
|
540 |
-
#: classes/admin/class-pwb-admin-tab.php:183
|
541 |
-
#, php-format
|
542 |
-
msgid ""
|
543 |
-
"Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
|
544 |
-
"\">Click here for more details</a>"
|
545 |
-
msgstr ""
|
546 |
-
"Importar marques de producte d'un altre plugin de marques. <a href=\"%s\" target="
|
547 |
-
"\"_blank\">Clica aquí per a veure la documentació</a>"
|
548 |
-
|
549 |
-
#: classes/admin/class-pwb-admin-tab.php:188
|
550 |
-
#: classes/admin/class-pwb-admin-tab.php:201
|
551 |
-
msgid "-"
|
552 |
-
msgstr "-"
|
553 |
-
|
554 |
-
#: classes/admin/class-pwb-admin-tab.php:189
|
555 |
-
msgid "YITH WooCommerce Brands Add-On"
|
556 |
-
msgstr "YITH WooCommerce Brands Add-On"
|
557 |
-
|
558 |
-
#: classes/admin/class-pwb-admin-tab.php:190
|
559 |
-
msgid "Ultimate WooCommerce Brands"
|
560 |
-
msgstr "Ultimate WooCommerce Brands"
|
561 |
-
|
562 |
-
#: classes/admin/class-pwb-admin-tab.php:191
|
563 |
-
msgid "Offical WooCommerce Brands"
|
564 |
-
msgstr "Offical WooCommerce Brands"
|
565 |
-
|
566 |
-
#: classes/admin/class-pwb-admin-tab.php:195
|
567 |
-
msgid "Dummy data"
|
568 |
-
msgstr "Dades fictícies"
|
569 |
-
|
570 |
-
#: classes/admin/class-pwb-admin-tab.php:198
|
571 |
-
msgid "Import generic brands and assign it to products randomly"
|
572 |
-
msgstr ""
|
573 |
-
"Importar marques genèriques i assignar-les als productes existents de forma "
|
574 |
-
"aleatòria"
|
575 |
-
|
576 |
-
#: classes/admin/class-pwb-admin-tab.php:202
|
577 |
-
msgid "Start import"
|
578 |
-
msgstr "Començar importació"
|
579 |
-
|
580 |
-
#: classes/admin/class-pwb-admin-tab.php:206
|
581 |
-
msgid "System status"
|
582 |
-
msgstr "Estat del sistema"
|
583 |
-
|
584 |
-
#: classes/admin/class-pwb-admin-tab.php:208
|
585 |
-
msgid "Show system status"
|
586 |
-
msgstr "Veure estat del sistema"
|
587 |
-
|
588 |
-
#: classes/admin/class-pwb-coupon.php:24
|
589 |
-
msgid "Brands restriction"
|
590 |
-
msgstr "Restriccions de marca"
|
591 |
-
|
592 |
-
#: classes/admin/class-pwb-coupon.php:25
|
593 |
-
msgid "Any brand"
|
594 |
-
msgstr "Qualsevol marca"
|
595 |
-
|
596 |
-
#: classes/admin/class-pwb-coupon.php:34
|
597 |
-
msgid ""
|
598 |
-
"Coupon will be valid if there are at least one product of this brands in the "
|
599 |
-
"cart"
|
600 |
-
msgstr ""
|
601 |
-
"El cupó serà vàlido si existeix com a mínim un producte de la marca indicada al "
|
602 |
-
"cistell"
|
603 |
-
|
604 |
-
#: classes/shortcodes/class-pwb-all-brands.php:108
|
605 |
-
msgid "First page"
|
606 |
-
msgstr "Primera pàgina"
|
607 |
-
|
608 |
-
#: classes/shortcodes/class-pwb-all-brands.php:111
|
609 |
-
msgid "Previous page"
|
610 |
-
msgstr "Pàgina anterior"
|
611 |
-
|
612 |
-
#: classes/shortcodes/class-pwb-all-brands.php:115
|
613 |
-
msgid "Next page"
|
614 |
-
msgstr "Següent pàgina"
|
615 |
-
|
616 |
-
#: classes/shortcodes/class-pwb-all-brands.php:118
|
617 |
-
msgid "Last page"
|
618 |
-
msgstr "Darrera pàgina"
|
619 |
-
|
620 |
-
#: classes/shortcodes/class-pwb-all-brands.php:123
|
621 |
-
msgid "No results"
|
622 |
-
msgstr "No s'han trobat resultats"
|
623 |
-
|
624 |
-
#: classes/widgets/class-pwb-dropdown.php:10
|
625 |
-
msgid "Adds a brands dropdown to your site"
|
626 |
-
msgstr "Afegeox un desplegable amb les marques al teu lloc"
|
627 |
-
|
628 |
-
#: classes/widgets/class-pwb-dropdown.php:11
|
629 |
-
msgid "Brands dropdown"
|
630 |
-
msgstr "Desplegable de marques"
|
631 |
-
|
632 |
-
#: classes/widgets/class-pwb-dropdown.php:26
|
633 |
-
msgid "Title"
|
634 |
-
msgstr "Títol"
|
635 |
-
|
636 |
-
#: classes/widgets/class-pwb-dropdown.php:54
|
637 |
-
#: classes/widgets/class-pwb-list.php:77
|
638 |
-
msgid "Only favorite brands"
|
639 |
-
msgstr "Només marques preferides"
|
640 |
-
|
641 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:11
|
642 |
-
msgid "Recommended for product categories or shop page"
|
643 |
-
msgstr "Recomanat per a les categories de producte i la pàgina de la botiga"
|
644 |
-
|
645 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:12
|
646 |
-
msgid "Filter products by brand"
|
647 |
-
msgstr "Filtrar productes por marca"
|
648 |
-
|
649 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:25
|
650 |
-
#: classes/widgets/class-pwb-list.php:28
|
651 |
-
msgid "Title:"
|
652 |
-
msgstr "Títol:"
|
653 |
-
|
654 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:30
|
655 |
-
msgid "Max number of brands"
|
656 |
-
msgstr "Número màxim de marques"
|
657 |
-
|
658 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:41
|
659 |
-
msgid "Hide filter button"
|
660 |
-
msgstr "No mostrar el botó Filtrar"
|
661 |
-
|
662 |
-
#: classes/widgets/class-pwb-list.php:10
|
663 |
-
msgid "Adds a brands list to your site"
|
664 |
-
msgstr "Afegeix una llista de marques al teu lloc"
|
665 |
-
|
666 |
-
#: classes/widgets/class-pwb-list.php:11
|
667 |
-
msgid "Brands list"
|
668 |
-
msgstr "Llista de marques"
|
669 |
-
|
670 |
-
#: classes/widgets/class-pwb-list.php:37
|
671 |
-
msgid "Display as:"
|
672 |
-
msgstr "Mostrar com:"
|
673 |
-
|
674 |
-
#: classes/widgets/class-pwb-list.php:42
|
675 |
-
msgid "Brand name"
|
676 |
-
msgstr "Nom de la marca"
|
677 |
-
|
678 |
-
#: classes/widgets/class-pwb-list.php:47
|
679 |
-
msgid "Columns:"
|
680 |
-
msgstr "Columnes:"
|
681 |
-
|
682 |
-
#: classes/widgets/class-pwb-list.php:87
|
683 |
-
msgid "Randomize"
|
684 |
-
msgstr "Aleatori"
|
685 |
-
|
686 |
-
#: classes/widgets/class-pwb-list.php:119
|
687 |
-
msgid "Go to"
|
688 |
-
msgstr "Anar a"
|
689 |
-
|
690 |
-
#: templates/admin/brands-exporter.php:15
|
691 |
-
msgid "Export brands"
|
692 |
-
msgstr "Exportar marques"
|
693 |
-
|
694 |
-
#: templates/admin/brands-exporter.php:18
|
695 |
-
msgid ""
|
696 |
-
"This tool allows you to export and import the brands between different sites "
|
697 |
-
"using PWB."
|
698 |
-
msgstr ""
|
699 |
-
"Aquesta eina permet exportar i importar marques entre dos llocs "
|
700 |
-
"diferents que utilitzen PWB"
|
701 |
-
|
702 |
-
#: templates/shortcodes/carousel.php:24
|
703 |
-
#: templates/shortcodes/product-carousel.php:28
|
704 |
-
msgid "Loading"
|
705 |
-
msgstr "Carregant"
|
706 |
-
|
707 |
-
#: templates/shortcodes/product-carousel.php:34
|
708 |
-
msgid "Nothing found"
|
709 |
-
msgstr "Aquí no hi ha res"
|
710 |
-
|
711 |
-
#: templates/widgets/filter-by-brand.php:25
|
712 |
-
msgid "Apply filter"
|
713 |
-
msgstr "Filtrar"
|
714 |
-
|
715 |
-
#: classes/widgets/class-pwb-dropdown.php:66
|
716 |
-
#: classes/widgets/class-pwb-list.php:115
|
717 |
-
msgid "There is not available brands"
|
718 |
-
msgstr "No es troben marques disponibles"
|
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 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2018-11-29 00:15+0100\n"
|
11 |
+
"PO-Revision-Date: 2018-11-29 00:19+0100\n"
|
12 |
+
"Last-Translator: Lluís Martí <lluis@manies.cat>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
"Language: ca \n"
|
15 |
+
"MIME-Version: 1.0\n"
|
16 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
+
"Content-Transfer-Encoding: 8bit\n"
|
18 |
+
"Plural-Forms: \n"
|
19 |
+
"X-Generator: Eazy Po 0.9.5.3\n"
|
20 |
+
|
21 |
+
#: main.php:106
|
22 |
+
msgid ""
|
23 |
+
"Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
|
24 |
+
"active WooCommerce plugin."
|
25 |
+
msgstr ""
|
26 |
+
"Perfect WooCommerce Brands necessita WooCommerce per a funcionar. Si us plau, "
|
27 |
+
"instal·la i activa WooCommerce."
|
28 |
+
|
29 |
+
#: classes/class-perfect-woocommerce-brands.php:52
|
30 |
+
msgid ""
|
31 |
+
"We know that you´re in love with Perfect WooCommerce Brands, you can help us "
|
32 |
+
"making it a bit better. Thanks a lot!"
|
33 |
+
msgstr ""
|
34 |
+
"Sabem que Perfect WooCommerce Brands t'encanta, pots ajudar-nos a "
|
35 |
+
"fer-lo una mica millor. ¡Moltes gràcies!"
|
36 |
+
|
37 |
+
#: classes/class-perfect-woocommerce-brands.php:54
|
38 |
+
msgid ""
|
39 |
+
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
40 |
+
"reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
|
41 |
+
msgstr ""
|
42 |
+
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
43 |
+
"reviews/?rate=5#new-post\" target=\"_blank\">Deixar una review</a>"
|
44 |
+
|
45 |
+
#: classes/class-perfect-woocommerce-brands.php:55
|
46 |
+
msgid ""
|
47 |
+
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
48 |
+
"woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
|
49 |
+
msgstr ""
|
50 |
+
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
51 |
+
"woocommerce-brands\" target=\"_blank\">Traduir el plugin</a>"
|
52 |
+
|
53 |
+
#: classes/class-perfect-woocommerce-brands.php:56
|
54 |
+
msgid ""
|
55 |
+
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
56 |
+
"\"_blank\">View on GitHub</a>"
|
57 |
+
msgstr ""
|
58 |
+
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
59 |
+
"\"_blank\">Veure a GitHub</a>"
|
60 |
+
|
61 |
+
#: classes/class-perfect-woocommerce-brands.php:79
|
62 |
+
msgid "Settings"
|
63 |
+
msgstr "Ajustaments"
|
64 |
+
|
65 |
+
#: classes/class-perfect-woocommerce-brands.php:280
|
66 |
+
msgid "PWB Product carousel"
|
67 |
+
msgstr "PWB Carrussel de productes"
|
68 |
+
|
69 |
+
#: classes/class-perfect-woocommerce-brands.php:281
|
70 |
+
msgid "Product carousel by brand or by category"
|
71 |
+
msgstr "Carrussel de productes per marca o categoria"
|
72 |
+
|
73 |
+
#: classes/class-perfect-woocommerce-brands.php:289
|
74 |
+
#: classes/class-perfect-woocommerce-brands.php:611
|
75 |
+
#: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
|
76 |
+
#: classes/admin/class-pwb-exporter-support.php:22
|
77 |
+
#: classes/admin/class-pwb-importer-support.php:22
|
78 |
+
#: classes/admin/class-pwb-importer-support.php:33
|
79 |
+
msgid "Brand"
|
80 |
+
msgstr "Marca"
|
81 |
+
|
82 |
+
#: classes/class-perfect-woocommerce-brands.php:297
|
83 |
+
msgid "Products"
|
84 |
+
msgstr "Productes"
|
85 |
+
|
86 |
+
#: classes/class-perfect-woocommerce-brands.php:300
|
87 |
+
msgid "Number of products to load"
|
88 |
+
msgstr "Número de productes per carregar"
|
89 |
+
|
90 |
+
#: classes/class-perfect-woocommerce-brands.php:305
|
91 |
+
msgid "Products to show"
|
92 |
+
msgstr "Productes per mostrar"
|
93 |
+
|
94 |
+
#: classes/class-perfect-woocommerce-brands.php:308
|
95 |
+
msgid "Number of products to show"
|
96 |
+
msgstr "Número de productes per mostrar"
|
97 |
+
|
98 |
+
#: classes/class-perfect-woocommerce-brands.php:313
|
99 |
+
msgid "Products to scroll"
|
100 |
+
msgstr "Número de productes per scroll"
|
101 |
+
|
102 |
+
#: classes/class-perfect-woocommerce-brands.php:316
|
103 |
+
msgid "Number of products to scroll"
|
104 |
+
msgstr "Número de productes per cada scroll"
|
105 |
+
|
106 |
+
#: classes/class-perfect-woocommerce-brands.php:321
|
107 |
+
#: classes/class-perfect-woocommerce-brands.php:370
|
108 |
+
msgid "Autoplay"
|
109 |
+
msgstr "Mode automàtic"
|
110 |
+
|
111 |
+
#: classes/class-perfect-woocommerce-brands.php:323
|
112 |
+
#: classes/class-perfect-woocommerce-brands.php:372
|
113 |
+
msgid "Autoplay carousel"
|
114 |
+
msgstr "Mode automàtic pel carrussel"
|
115 |
+
|
116 |
+
#: classes/class-perfect-woocommerce-brands.php:328
|
117 |
+
#: classes/class-perfect-woocommerce-brands.php:377
|
118 |
+
msgid "Arrows"
|
119 |
+
msgstr "Dates de navegació"
|
120 |
+
|
121 |
+
#: classes/class-perfect-woocommerce-brands.php:330
|
122 |
+
#: classes/class-perfect-woocommerce-brands.php:379
|
123 |
+
msgid "Display prev and next arrows"
|
124 |
+
msgstr "Mostrar fletxes de navegació"
|
125 |
+
|
126 |
+
#: classes/class-perfect-woocommerce-brands.php:336
|
127 |
+
msgid "PWB Brands carousel"
|
128 |
+
msgstr "PWB Carrussel de marques"
|
129 |
+
|
130 |
+
#: classes/class-perfect-woocommerce-brands.php:337
|
131 |
+
msgid "Brands carousel"
|
132 |
+
msgstr "Carrussel de marques"
|
133 |
+
|
134 |
+
#: classes/class-perfect-woocommerce-brands.php:346
|
135 |
+
msgid "Items"
|
136 |
+
msgstr "Elemento"
|
137 |
+
|
138 |
+
#: classes/class-perfect-woocommerce-brands.php:349
|
139 |
+
msgid "Number of items to load (or 'featured')"
|
140 |
+
msgstr "Número d'elements per cargar (o 'featured')"
|
141 |
+
|
142 |
+
#: classes/class-perfect-woocommerce-brands.php:354
|
143 |
+
msgid "Items to show"
|
144 |
+
msgstr "Elements a mostrar"
|
145 |
+
|
146 |
+
#: classes/class-perfect-woocommerce-brands.php:357
|
147 |
+
msgid "Number of items to show"
|
148 |
+
msgstr "Número d'elements a mostrar"
|
149 |
+
|
150 |
+
#: classes/class-perfect-woocommerce-brands.php:362
|
151 |
+
msgid "Items to scroll"
|
152 |
+
msgstr "Número d'elements per scroll"
|
153 |
+
|
154 |
+
#: classes/class-perfect-woocommerce-brands.php:365
|
155 |
+
msgid "Number of items to scroll"
|
156 |
+
msgstr "Número d'elements per cada scroll"
|
157 |
+
|
158 |
+
#: classes/class-perfect-woocommerce-brands.php:383
|
159 |
+
#: classes/class-perfect-woocommerce-brands.php:411
|
160 |
+
#: classes/class-perfect-woocommerce-brands.php:492
|
161 |
+
#: classes/admin/class-pwb-admin-tab.php:129
|
162 |
+
msgid "Brand logo size"
|
163 |
+
msgstr "Mida del logo de la marca"
|
164 |
+
|
165 |
+
#: classes/class-perfect-woocommerce-brands.php:394
|
166 |
+
msgid "PWB All brands"
|
167 |
+
msgstr "PWB Totes les marques"
|
168 |
+
|
169 |
+
#: classes/class-perfect-woocommerce-brands.php:395
|
170 |
+
msgid "Show all brands"
|
171 |
+
msgstr "Mostrar totes les marques"
|
172 |
+
|
173 |
+
#: classes/class-perfect-woocommerce-brands.php:404
|
174 |
+
msgid "Brands per page"
|
175 |
+
msgstr "Marques per pàgina"
|
176 |
+
|
177 |
+
#: classes/class-perfect-woocommerce-brands.php:407
|
178 |
+
msgid "Show x brands per page"
|
179 |
+
msgstr "Mostrar x marques per pàgina"
|
180 |
+
|
181 |
+
#: classes/class-perfect-woocommerce-brands.php:418
|
182 |
+
msgid "Order by"
|
183 |
+
msgstr "Ordenar per"
|
184 |
+
|
185 |
+
#: classes/class-perfect-woocommerce-brands.php:432
|
186 |
+
msgid "Order"
|
187 |
+
msgstr "Ordre"
|
188 |
+
|
189 |
+
#: classes/class-perfect-woocommerce-brands.php:442
|
190 |
+
msgid "Title position"
|
191 |
+
msgstr "Posició del títol"
|
192 |
+
|
193 |
+
#: classes/class-perfect-woocommerce-brands.php:446
|
194 |
+
msgid "Before image"
|
195 |
+
msgstr "Abans de la imatge"
|
196 |
+
|
197 |
+
#: classes/class-perfect-woocommerce-brands.php:447
|
198 |
+
msgid "After image"
|
199 |
+
msgstr "Després de la imatge"
|
200 |
+
|
201 |
+
#: classes/class-perfect-woocommerce-brands.php:448
|
202 |
+
msgid "Hide"
|
203 |
+
msgstr "Amagar"
|
204 |
+
|
205 |
+
#: classes/class-perfect-woocommerce-brands.php:454
|
206 |
+
#: classes/widgets/class-pwb-dropdown.php:43
|
207 |
+
#: classes/widgets/class-pwb-list.php:67
|
208 |
+
msgid "Hide empty"
|
209 |
+
msgstr "Amagar buides"
|
210 |
+
|
211 |
+
#: classes/class-perfect-woocommerce-brands.php:456
|
212 |
+
msgid "Hide brands that have not been assigned to any product"
|
213 |
+
msgstr "Amagar marque que no han estat assignades a cap producte"
|
214 |
+
|
215 |
+
#: classes/class-perfect-woocommerce-brands.php:464
|
216 |
+
msgid "PWB AZ Listing"
|
217 |
+
msgstr "PWB Llista A-Z"
|
218 |
+
|
219 |
+
#: classes/class-perfect-woocommerce-brands.php:465
|
220 |
+
msgid "AZ Listing for brands"
|
221 |
+
msgstr "Llistat A-Z de marques"
|
222 |
+
|
223 |
+
#: classes/class-perfect-woocommerce-brands.php:474
|
224 |
+
msgid "PWB brand"
|
225 |
+
msgstr "PWB Marca"
|
226 |
+
|
227 |
+
#: classes/class-perfect-woocommerce-brands.php:475
|
228 |
+
msgid "Show brand for a specific product"
|
229 |
+
msgstr "Veure marques d'un producte específic"
|
230 |
+
|
231 |
+
#: classes/class-perfect-woocommerce-brands.php:485
|
232 |
+
msgid "Product id"
|
233 |
+
msgstr "Id del producte"
|
234 |
+
|
235 |
+
#: classes/class-perfect-woocommerce-brands.php:488
|
236 |
+
msgid "Product id (post id)"
|
237 |
+
msgstr "Id del producte (id del post)"
|
238 |
+
|
239 |
+
#: classes/class-perfect-woocommerce-brands.php:533
|
240 |
+
#: classes/shortcodes/class-pwb-brand.php:29
|
241 |
+
#: classes/shortcodes/class-pwb-brand.php:31
|
242 |
+
msgid "View brand"
|
243 |
+
msgstr "Veure marca"
|
244 |
+
|
245 |
+
#: classes/class-perfect-woocommerce-brands.php:598
|
246 |
+
msgid "¿Start migration?"
|
247 |
+
msgstr "Començar la migració?"
|
248 |
+
|
249 |
+
#: classes/class-perfect-woocommerce-brands.php:599
|
250 |
+
msgid ""
|
251 |
+
"We are migrating the product brands. ¡Don´t close this window until the "
|
252 |
+
"process is finished!"
|
253 |
+
msgstr ""
|
254 |
+
"Estem migrant les marques de producte. ¡No tanquis aquesta finestra fins que "
|
255 |
+
"el procés finalitzi!"
|
256 |
+
|
257 |
+
#: classes/class-perfect-woocommerce-brands.php:600
|
258 |
+
msgid "¿Start loading dummy data?"
|
259 |
+
msgstr "Començar amb la importació?"
|
260 |
+
|
261 |
+
#: classes/class-perfect-woocommerce-brands.php:601
|
262 |
+
msgid ""
|
263 |
+
"We are importing the dummy data. ¡Don´t close this window until the process "
|
264 |
+
"is finished!"
|
265 |
+
msgstr ""
|
266 |
+
"En aquest moment estem important les marques fictícies. ¡No tanquis aquesta "
|
267 |
+
"finestra fins que no acabi el procés!"
|
268 |
+
|
269 |
+
#: classes/class-perfect-woocommerce-brands.php:610
|
270 |
+
#: classes/class-perfect-woocommerce-brands.php:612
|
271 |
+
#: classes/admin/class-edit-brands-page.php:128
|
272 |
+
#: classes/admin/class-pwb-admin-tab.php:21
|
273 |
+
#: classes/widgets/class-pwb-dropdown.php:19
|
274 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:20
|
275 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:75
|
276 |
+
#: classes/widgets/class-pwb-list.php:19 templates/widgets/dropdown.php:16
|
277 |
+
msgid "Brands"
|
278 |
+
msgstr "Marques"
|
279 |
+
|
280 |
+
#: classes/class-perfect-woocommerce-brands.php:613
|
281 |
+
msgid "All Brands"
|
282 |
+
msgstr "Totes las marques"
|
283 |
+
|
284 |
+
#: classes/class-perfect-woocommerce-brands.php:614
|
285 |
+
msgid "Edit Brand"
|
286 |
+
msgstr "Editar marca"
|
287 |
+
|
288 |
+
#: classes/class-perfect-woocommerce-brands.php:615
|
289 |
+
msgid "View Brand"
|
290 |
+
msgstr "Veure marca"
|
291 |
+
|
292 |
+
#: classes/class-perfect-woocommerce-brands.php:616
|
293 |
+
msgid "Update Brand"
|
294 |
+
msgstr "Actualitzar marca"
|
295 |
+
|
296 |
+
#: classes/class-perfect-woocommerce-brands.php:617
|
297 |
+
msgid "Add New Brand"
|
298 |
+
msgstr "Afegir nova marca"
|
299 |
+
|
300 |
+
#: classes/class-perfect-woocommerce-brands.php:618
|
301 |
+
msgid "New Brand Name"
|
302 |
+
msgstr "Nou nom de marca"
|
303 |
+
|
304 |
+
#: classes/class-perfect-woocommerce-brands.php:619
|
305 |
+
msgid "Parent Brand"
|
306 |
+
msgstr "Marca Pare"
|
307 |
+
|
308 |
+
#: classes/class-perfect-woocommerce-brands.php:620
|
309 |
+
msgid "Parent Brand:"
|
310 |
+
msgstr "Marca Pare:"
|
311 |
+
|
312 |
+
#: classes/class-perfect-woocommerce-brands.php:621
|
313 |
+
msgid "Search Brands"
|
314 |
+
msgstr "Cercar Marques"
|
315 |
+
|
316 |
+
#: classes/class-perfect-woocommerce-brands.php:622
|
317 |
+
msgid "Popular Brands"
|
318 |
+
msgstr "Marques Populars"
|
319 |
+
|
320 |
+
#: classes/class-perfect-woocommerce-brands.php:623
|
321 |
+
msgid "Separate brands with commas"
|
322 |
+
msgstr "Separar marques amb comes"
|
323 |
+
|
324 |
+
#: classes/class-perfect-woocommerce-brands.php:624
|
325 |
+
msgid "Add or remove brands"
|
326 |
+
msgstr "Afegir o eliminar marques"
|
327 |
+
|
328 |
+
#: classes/class-perfect-woocommerce-brands.php:625
|
329 |
+
msgid "Choose from the most used brands"
|
330 |
+
msgstr "Seleccionar de les marques més utilitzades"
|
331 |
+
|
332 |
+
#: classes/class-perfect-woocommerce-brands.php:626
|
333 |
+
msgid "No brands found"
|
334 |
+
msgstr "No s'han trobat marques"
|
335 |
+
|
336 |
+
#: classes/class-perfect-woocommerce-brands.php:697
|
337 |
+
msgid "All"
|
338 |
+
msgstr "Totes"
|
339 |
+
|
340 |
+
#: classes/class-pwb-api-support.php:87
|
341 |
+
msgid "Product brands"
|
342 |
+
msgstr "Marques del producte"
|
343 |
+
|
344 |
+
#: classes/class-pwb-term.php:20
|
345 |
+
msgid "Only WP_Term objects are allowed"
|
346 |
+
msgstr "Només es permeten objectes del tipus WP_Term"
|
347 |
+
|
348 |
+
#: classes/admin/class-brands-custom-fields.php:20
|
349 |
+
#: classes/admin/class-brands-custom-fields.php:59
|
350 |
+
msgid "Description"
|
351 |
+
msgstr "Descripció"
|
352 |
+
|
353 |
+
#: classes/admin/class-brands-custom-fields.php:22
|
354 |
+
#: classes/admin/class-brands-custom-fields.php:63
|
355 |
+
msgid ""
|
356 |
+
"Brand description for the archive pages. You can include some html markup "
|
357 |
+
"and shortcodes."
|
358 |
+
msgstr ""
|
359 |
+
"Descripció de la marca per a la pàgina d'arxiu. Pots incloure marcat "
|
360 |
+
"html i shortcodes."
|
361 |
+
|
362 |
+
#: classes/admin/class-brands-custom-fields.php:26
|
363 |
+
#: classes/admin/class-brands-custom-fields.php:68
|
364 |
+
#: classes/widgets/class-pwb-list.php:43
|
365 |
+
msgid "Brand logo"
|
366 |
+
msgstr "Logo de la marca"
|
367 |
+
|
368 |
+
#: classes/admin/class-brands-custom-fields.php:28
|
369 |
+
#: classes/admin/class-brands-custom-fields.php:34
|
370 |
+
#: classes/admin/class-brands-custom-fields.php:72
|
371 |
+
#: classes/admin/class-brands-custom-fields.php:92
|
372 |
+
msgid "Select image"
|
373 |
+
msgstr "Seleccionar imatge"
|
374 |
+
|
375 |
+
#: classes/admin/class-brands-custom-fields.php:32
|
376 |
+
#: classes/admin/class-brands-custom-fields.php:88
|
377 |
+
msgid "Brand banner"
|
378 |
+
msgstr "Banner de la marca"
|
379 |
+
|
380 |
+
#: classes/admin/class-brands-custom-fields.php:35
|
381 |
+
msgid "This image will be shown on brand page"
|
382 |
+
msgstr "Aquesta imatge es mostrarà a la pàgina de la marca"
|
383 |
+
|
384 |
+
#: classes/admin/class-brands-custom-fields.php:39
|
385 |
+
#: classes/admin/class-brands-custom-fields.php:108
|
386 |
+
msgid "Brand banner link"
|
387 |
+
msgstr "Enlĺaç per al banner de la marca"
|
388 |
+
|
389 |
+
#: classes/admin/class-brands-custom-fields.php:41
|
390 |
+
#: classes/admin/class-brands-custom-fields.php:112
|
391 |
+
msgid "This link should be relative to site url. Example: product/product-name"
|
392 |
+
msgstr ""
|
393 |
+
"Aquest enllaç ha de ser relatiu a la url del lloc web. Exemple: producte/"
|
394 |
+
"nom-del-producte"
|
395 |
+
|
396 |
+
#: classes/admin/class-edit-brands-page.php:39
|
397 |
+
msgid "featured"
|
398 |
+
msgstr "preferida"
|
399 |
+
|
400 |
+
#: classes/admin/class-edit-brands-page.php:74
|
401 |
+
msgid "Logo"
|
402 |
+
msgstr "Logo"
|
403 |
+
|
404 |
+
#: classes/admin/class-edit-brands-page.php:96
|
405 |
+
msgid "Set as featured"
|
406 |
+
msgstr "Marcar com a preferida"
|
407 |
+
|
408 |
+
#: classes/admin/class-edit-brands-page.php:118
|
409 |
+
msgid "Error!"
|
410 |
+
msgstr "Error!"
|
411 |
+
|
412 |
+
#: classes/admin/class-edit-brands-page.php:131
|
413 |
+
msgid "Show featured brands first"
|
414 |
+
msgstr "Mostrar marques preferides primer"
|
415 |
+
|
416 |
+
#: classes/admin/class-pwb-admin-tab.php:70
|
417 |
+
msgid "Brands settings"
|
418 |
+
msgstr "Ajustaments de les marques"
|
419 |
+
|
420 |
+
#: classes/admin/class-pwb-admin-tab.php:76
|
421 |
+
msgid "Slug"
|
422 |
+
msgstr "Slug"
|
423 |
+
|
424 |
+
#: classes/admin/class-pwb-admin-tab.php:79
|
425 |
+
msgid "Brands taxonomy slug"
|
426 |
+
msgstr "Slug de la taxonomia marques"
|
427 |
+
|
428 |
+
#: classes/admin/class-pwb-admin-tab.php:84
|
429 |
+
msgid "Show brand description"
|
430 |
+
msgstr "Mostrar descripció de la marca"
|
431 |
+
|
432 |
+
#: classes/admin/class-pwb-admin-tab.php:88
|
433 |
+
msgid "Show brand description (if is set) on brand archive page"
|
434 |
+
msgstr "Mostrar descripció de la marca a la pàgina d'arxiu"
|
435 |
+
|
436 |
+
#: classes/admin/class-pwb-admin-tab.php:91
|
437 |
+
msgid "Yes, before product loop"
|
438 |
+
msgstr "Si, abans dels productes"
|
439 |
+
|
440 |
+
#: classes/admin/class-pwb-admin-tab.php:92
|
441 |
+
msgid "Yes, after product loop"
|
442 |
+
msgstr "Si, després dels productes"
|
443 |
+
|
444 |
+
#: classes/admin/class-pwb-admin-tab.php:93
|
445 |
+
msgid "No, hide description"
|
446 |
+
msgstr "No, ocultar descripció"
|
447 |
+
|
448 |
+
#: classes/admin/class-pwb-admin-tab.php:97
|
449 |
+
msgid "Single product tab"
|
450 |
+
msgstr "Tab a la pàgina del producte"
|
451 |
+
|
452 |
+
#: classes/admin/class-pwb-admin-tab.php:100
|
453 |
+
msgid "Show brand tab in single product page"
|
454 |
+
msgstr "Mostrar pestanya amb informació de la marca a la pàgina del producte"
|
455 |
+
|
456 |
+
#: classes/admin/class-pwb-admin-tab.php:104
|
457 |
+
msgid "Show brands in loop"
|
458 |
+
msgstr "Mostrar marques al loop"
|
459 |
+
|
460 |
+
#: classes/admin/class-pwb-admin-tab.php:107
|
461 |
+
msgid "Show brand logo (or name) in product loop"
|
462 |
+
msgstr "Mostrar el logo de la marca (o el nom) al loop"
|
463 |
+
|
464 |
+
#: classes/admin/class-pwb-admin-tab.php:110
|
465 |
+
#: classes/admin/class-pwb-admin-tab.php:123
|
466 |
+
msgid "No"
|
467 |
+
msgstr "No"
|
468 |
+
|
469 |
+
#: classes/admin/class-pwb-admin-tab.php:111
|
470 |
+
#: classes/admin/class-pwb-admin-tab.php:124
|
471 |
+
msgid "Show brand link"
|
472 |
+
msgstr "Mostrar el link de la marca"
|
473 |
+
|
474 |
+
#: classes/admin/class-pwb-admin-tab.php:112
|
475 |
+
#: classes/admin/class-pwb-admin-tab.php:125
|
476 |
+
msgid "Show brand image (if is set)"
|
477 |
+
msgstr "Mostrar el logo de la marca (si en té un d'assignat)"
|
478 |
+
|
479 |
+
#: classes/admin/class-pwb-admin-tab.php:116
|
480 |
+
msgid "Show brands in single product"
|
481 |
+
msgstr "Mostrar marques a la pàgina del producte"
|
482 |
+
|
483 |
+
#: classes/admin/class-pwb-admin-tab.php:119
|
484 |
+
msgid "Show brand logo (or name) in single product"
|
485 |
+
msgstr "Mostrar el logo de la marca (o el nom) a la pàgina del producte"
|
486 |
+
|
487 |
+
#: classes/admin/class-pwb-admin-tab.php:137
|
488 |
+
msgid "Brand position"
|
489 |
+
msgstr "Posició de la marca"
|
490 |
+
|
491 |
+
#: classes/admin/class-pwb-admin-tab.php:140
|
492 |
+
msgid "For single product"
|
493 |
+
msgstr "A la pàgina individual de cada producte"
|
494 |
+
|
495 |
+
#: classes/admin/class-pwb-admin-tab.php:143
|
496 |
+
msgid "Before title"
|
497 |
+
msgstr "Abans del títol"
|
498 |
+
|
499 |
+
#: classes/admin/class-pwb-admin-tab.php:144
|
500 |
+
msgid "After title"
|
501 |
+
msgstr "Després del títol"
|
502 |
+
|
503 |
+
#: classes/admin/class-pwb-admin-tab.php:145
|
504 |
+
msgid "After price"
|
505 |
+
msgstr "Després del preu"
|
506 |
+
|
507 |
+
#: classes/admin/class-pwb-admin-tab.php:146
|
508 |
+
msgid "After excerpt"
|
509 |
+
msgstr "Després de la descripció curta"
|
510 |
+
|
511 |
+
#: classes/admin/class-pwb-admin-tab.php:147
|
512 |
+
msgid "After add to cart"
|
513 |
+
msgstr "Després del botó de comprar"
|
514 |
+
|
515 |
+
#: classes/admin/class-pwb-admin-tab.php:148
|
516 |
+
msgid "After meta"
|
517 |
+
msgstr "Després del meta"
|
518 |
+
|
519 |
+
#: classes/admin/class-pwb-admin-tab.php:149
|
520 |
+
msgid "After sharing"
|
521 |
+
msgstr "Després de compartir"
|
522 |
+
|
523 |
+
#: classes/admin/class-pwb-admin-tab.php:153
|
524 |
+
msgid "Brands page"
|
525 |
+
msgstr "Pàgina de marques"
|
526 |
+
|
527 |
+
#: classes/admin/class-pwb-admin-tab.php:156
|
528 |
+
msgid "For linking breadcrumbs"
|
529 |
+
msgstr "Per a l'enllaç de las molles de pa"
|
530 |
+
|
531 |
+
#: classes/admin/class-pwb-admin-tab.php:173
|
532 |
+
msgid "Tools"
|
533 |
+
msgstr "Eines"
|
534 |
+
|
535 |
+
#: classes/admin/class-pwb-admin-tab.php:179
|
536 |
+
#: templates/admin/brands-exporter.php:16
|
537 |
+
msgid "Import brands"
|
538 |
+
msgstr "Importar marques"
|
539 |
+
|
540 |
+
#: classes/admin/class-pwb-admin-tab.php:183
|
541 |
+
#, php-format
|
542 |
+
msgid ""
|
543 |
+
"Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
|
544 |
+
"\">Click here for more details</a>"
|
545 |
+
msgstr ""
|
546 |
+
"Importar marques de producte d'un altre plugin de marques. <a href=\"%s\" target="
|
547 |
+
"\"_blank\">Clica aquí per a veure la documentació</a>"
|
548 |
+
|
549 |
+
#: classes/admin/class-pwb-admin-tab.php:188
|
550 |
+
#: classes/admin/class-pwb-admin-tab.php:201
|
551 |
+
msgid "-"
|
552 |
+
msgstr "-"
|
553 |
+
|
554 |
+
#: classes/admin/class-pwb-admin-tab.php:189
|
555 |
+
msgid "YITH WooCommerce Brands Add-On"
|
556 |
+
msgstr "YITH WooCommerce Brands Add-On"
|
557 |
+
|
558 |
+
#: classes/admin/class-pwb-admin-tab.php:190
|
559 |
+
msgid "Ultimate WooCommerce Brands"
|
560 |
+
msgstr "Ultimate WooCommerce Brands"
|
561 |
+
|
562 |
+
#: classes/admin/class-pwb-admin-tab.php:191
|
563 |
+
msgid "Offical WooCommerce Brands"
|
564 |
+
msgstr "Offical WooCommerce Brands"
|
565 |
+
|
566 |
+
#: classes/admin/class-pwb-admin-tab.php:195
|
567 |
+
msgid "Dummy data"
|
568 |
+
msgstr "Dades fictícies"
|
569 |
+
|
570 |
+
#: classes/admin/class-pwb-admin-tab.php:198
|
571 |
+
msgid "Import generic brands and assign it to products randomly"
|
572 |
+
msgstr ""
|
573 |
+
"Importar marques genèriques i assignar-les als productes existents de forma "
|
574 |
+
"aleatòria"
|
575 |
+
|
576 |
+
#: classes/admin/class-pwb-admin-tab.php:202
|
577 |
+
msgid "Start import"
|
578 |
+
msgstr "Començar importació"
|
579 |
+
|
580 |
+
#: classes/admin/class-pwb-admin-tab.php:206
|
581 |
+
msgid "System status"
|
582 |
+
msgstr "Estat del sistema"
|
583 |
+
|
584 |
+
#: classes/admin/class-pwb-admin-tab.php:208
|
585 |
+
msgid "Show system status"
|
586 |
+
msgstr "Veure estat del sistema"
|
587 |
+
|
588 |
+
#: classes/admin/class-pwb-coupon.php:24
|
589 |
+
msgid "Brands restriction"
|
590 |
+
msgstr "Restriccions de marca"
|
591 |
+
|
592 |
+
#: classes/admin/class-pwb-coupon.php:25
|
593 |
+
msgid "Any brand"
|
594 |
+
msgstr "Qualsevol marca"
|
595 |
+
|
596 |
+
#: classes/admin/class-pwb-coupon.php:34
|
597 |
+
msgid ""
|
598 |
+
"Coupon will be valid if there are at least one product of this brands in the "
|
599 |
+
"cart"
|
600 |
+
msgstr ""
|
601 |
+
"El cupó serà vàlido si existeix com a mínim un producte de la marca indicada al "
|
602 |
+
"cistell"
|
603 |
+
|
604 |
+
#: classes/shortcodes/class-pwb-all-brands.php:108
|
605 |
+
msgid "First page"
|
606 |
+
msgstr "Primera pàgina"
|
607 |
+
|
608 |
+
#: classes/shortcodes/class-pwb-all-brands.php:111
|
609 |
+
msgid "Previous page"
|
610 |
+
msgstr "Pàgina anterior"
|
611 |
+
|
612 |
+
#: classes/shortcodes/class-pwb-all-brands.php:115
|
613 |
+
msgid "Next page"
|
614 |
+
msgstr "Següent pàgina"
|
615 |
+
|
616 |
+
#: classes/shortcodes/class-pwb-all-brands.php:118
|
617 |
+
msgid "Last page"
|
618 |
+
msgstr "Darrera pàgina"
|
619 |
+
|
620 |
+
#: classes/shortcodes/class-pwb-all-brands.php:123
|
621 |
+
msgid "No results"
|
622 |
+
msgstr "No s'han trobat resultats"
|
623 |
+
|
624 |
+
#: classes/widgets/class-pwb-dropdown.php:10
|
625 |
+
msgid "Adds a brands dropdown to your site"
|
626 |
+
msgstr "Afegeox un desplegable amb les marques al teu lloc"
|
627 |
+
|
628 |
+
#: classes/widgets/class-pwb-dropdown.php:11
|
629 |
+
msgid "Brands dropdown"
|
630 |
+
msgstr "Desplegable de marques"
|
631 |
+
|
632 |
+
#: classes/widgets/class-pwb-dropdown.php:26
|
633 |
+
msgid "Title"
|
634 |
+
msgstr "Títol"
|
635 |
+
|
636 |
+
#: classes/widgets/class-pwb-dropdown.php:54
|
637 |
+
#: classes/widgets/class-pwb-list.php:77
|
638 |
+
msgid "Only favorite brands"
|
639 |
+
msgstr "Només marques preferides"
|
640 |
+
|
641 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:11
|
642 |
+
msgid "Recommended for product categories or shop page"
|
643 |
+
msgstr "Recomanat per a les categories de producte i la pàgina de la botiga"
|
644 |
+
|
645 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:12
|
646 |
+
msgid "Filter products by brand"
|
647 |
+
msgstr "Filtrar productes por marca"
|
648 |
+
|
649 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:25
|
650 |
+
#: classes/widgets/class-pwb-list.php:28
|
651 |
+
msgid "Title:"
|
652 |
+
msgstr "Títol:"
|
653 |
+
|
654 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:30
|
655 |
+
msgid "Max number of brands"
|
656 |
+
msgstr "Número màxim de marques"
|
657 |
+
|
658 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:41
|
659 |
+
msgid "Hide filter button"
|
660 |
+
msgstr "No mostrar el botó Filtrar"
|
661 |
+
|
662 |
+
#: classes/widgets/class-pwb-list.php:10
|
663 |
+
msgid "Adds a brands list to your site"
|
664 |
+
msgstr "Afegeix una llista de marques al teu lloc"
|
665 |
+
|
666 |
+
#: classes/widgets/class-pwb-list.php:11
|
667 |
+
msgid "Brands list"
|
668 |
+
msgstr "Llista de marques"
|
669 |
+
|
670 |
+
#: classes/widgets/class-pwb-list.php:37
|
671 |
+
msgid "Display as:"
|
672 |
+
msgstr "Mostrar com:"
|
673 |
+
|
674 |
+
#: classes/widgets/class-pwb-list.php:42
|
675 |
+
msgid "Brand name"
|
676 |
+
msgstr "Nom de la marca"
|
677 |
+
|
678 |
+
#: classes/widgets/class-pwb-list.php:47
|
679 |
+
msgid "Columns:"
|
680 |
+
msgstr "Columnes:"
|
681 |
+
|
682 |
+
#: classes/widgets/class-pwb-list.php:87
|
683 |
+
msgid "Randomize"
|
684 |
+
msgstr "Aleatori"
|
685 |
+
|
686 |
+
#: classes/widgets/class-pwb-list.php:119
|
687 |
+
msgid "Go to"
|
688 |
+
msgstr "Anar a"
|
689 |
+
|
690 |
+
#: templates/admin/brands-exporter.php:15
|
691 |
+
msgid "Export brands"
|
692 |
+
msgstr "Exportar marques"
|
693 |
+
|
694 |
+
#: templates/admin/brands-exporter.php:18
|
695 |
+
msgid ""
|
696 |
+
"This tool allows you to export and import the brands between different sites "
|
697 |
+
"using PWB."
|
698 |
+
msgstr ""
|
699 |
+
"Aquesta eina permet exportar i importar marques entre dos llocs "
|
700 |
+
"diferents que utilitzen PWB"
|
701 |
+
|
702 |
+
#: templates/shortcodes/carousel.php:24
|
703 |
+
#: templates/shortcodes/product-carousel.php:28
|
704 |
+
msgid "Loading"
|
705 |
+
msgstr "Carregant"
|
706 |
+
|
707 |
+
#: templates/shortcodes/product-carousel.php:34
|
708 |
+
msgid "Nothing found"
|
709 |
+
msgstr "Aquí no hi ha res"
|
710 |
+
|
711 |
+
#: templates/widgets/filter-by-brand.php:25
|
712 |
+
msgid "Apply filter"
|
713 |
+
msgstr "Filtrar"
|
714 |
+
|
715 |
+
#: classes/widgets/class-pwb-dropdown.php:66
|
716 |
+
#: classes/widgets/class-pwb-list.php:115
|
717 |
+
msgid "There is not available brands"
|
718 |
+
msgstr "No es troben marques disponibles"
|
lang/perfect-woocommerce-brands-es_ES.mo
DELETED
Binary file
|
lang/perfect-woocommerce-brands-es_ES.po
DELETED
@@ -1,718 +0,0 @@
|
|
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 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: \n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2018-11-29 00:15+0100\n"
|
11 |
-
"PO-Revision-Date: 2018-11-29 00:19+0100\n"
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"Language: \n"
|
15 |
-
"MIME-Version: 1.0\n"
|
16 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
-
"Content-Transfer-Encoding: 8bit\n"
|
18 |
-
"Plural-Forms: \n"
|
19 |
-
"X-Generator: Eazy Po 0.9.5.3\n"
|
20 |
-
|
21 |
-
#: main.php:106
|
22 |
-
msgid ""
|
23 |
-
"Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
|
24 |
-
"active WooCommerce plugin."
|
25 |
-
msgstr ""
|
26 |
-
"Perfect WooCommerce Brands necesita WooCommerce para funcionar. Por favor, "
|
27 |
-
"instala y activa WooCommerce."
|
28 |
-
|
29 |
-
#: classes/class-perfect-woocommerce-brands.php:52
|
30 |
-
msgid ""
|
31 |
-
"We know that you´re in love with Perfect WooCommerce Brands, you can help us "
|
32 |
-
"making it a bit better. Thanks a lot!"
|
33 |
-
msgstr ""
|
34 |
-
"Sabemos que Perfect WooCommerce Brands te encanta, puedes ayudarnos a "
|
35 |
-
"hacerlo un poco mejor. ¡Muchas gracias!"
|
36 |
-
|
37 |
-
#: classes/class-perfect-woocommerce-brands.php:54
|
38 |
-
msgid ""
|
39 |
-
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
40 |
-
"reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
|
41 |
-
msgstr ""
|
42 |
-
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
43 |
-
"reviews/?rate=5#new-post\" target=\"_blank\">Dejar una review</a>"
|
44 |
-
|
45 |
-
#: classes/class-perfect-woocommerce-brands.php:55
|
46 |
-
msgid ""
|
47 |
-
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
48 |
-
"woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
|
49 |
-
msgstr ""
|
50 |
-
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
51 |
-
"woocommerce-brands\" target=\"_blank\">Traducir el plugin</a>"
|
52 |
-
|
53 |
-
#: classes/class-perfect-woocommerce-brands.php:56
|
54 |
-
msgid ""
|
55 |
-
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
56 |
-
"\"_blank\">View on GitHub</a>"
|
57 |
-
msgstr ""
|
58 |
-
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
59 |
-
"\"_blank\">Ver en GitHub</a>"
|
60 |
-
|
61 |
-
#: classes/class-perfect-woocommerce-brands.php:79
|
62 |
-
msgid "Settings"
|
63 |
-
msgstr "Ajustes"
|
64 |
-
|
65 |
-
#: classes/class-perfect-woocommerce-brands.php:280
|
66 |
-
msgid "PWB Product carousel"
|
67 |
-
msgstr "PWB Carrusel de productos"
|
68 |
-
|
69 |
-
#: classes/class-perfect-woocommerce-brands.php:281
|
70 |
-
msgid "Product carousel by brand or by category"
|
71 |
-
msgstr "Carrusel de productos por marca o categoría"
|
72 |
-
|
73 |
-
#: classes/class-perfect-woocommerce-brands.php:289
|
74 |
-
#: classes/class-perfect-woocommerce-brands.php:611
|
75 |
-
#: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
|
76 |
-
#: classes/admin/class-pwb-exporter-support.php:22
|
77 |
-
#: classes/admin/class-pwb-importer-support.php:22
|
78 |
-
#: classes/admin/class-pwb-importer-support.php:33
|
79 |
-
msgid "Brand"
|
80 |
-
msgstr "Marca"
|
81 |
-
|
82 |
-
#: classes/class-perfect-woocommerce-brands.php:297
|
83 |
-
msgid "Products"
|
84 |
-
msgstr "Productos"
|
85 |
-
|
86 |
-
#: classes/class-perfect-woocommerce-brands.php:300
|
87 |
-
msgid "Number of products to load"
|
88 |
-
msgstr "Número de productos que cargar"
|
89 |
-
|
90 |
-
#: classes/class-perfect-woocommerce-brands.php:305
|
91 |
-
msgid "Products to show"
|
92 |
-
msgstr "Productos a mostrar"
|
93 |
-
|
94 |
-
#: classes/class-perfect-woocommerce-brands.php:308
|
95 |
-
msgid "Number of products to show"
|
96 |
-
msgstr "Número de productos que mostrar"
|
97 |
-
|
98 |
-
#: classes/class-perfect-woocommerce-brands.php:313
|
99 |
-
msgid "Products to scroll"
|
100 |
-
msgstr "Número de productos por scroll"
|
101 |
-
|
102 |
-
#: classes/class-perfect-woocommerce-brands.php:316
|
103 |
-
msgid "Number of products to scroll"
|
104 |
-
msgstr "Número de productos por cada scroll"
|
105 |
-
|
106 |
-
#: classes/class-perfect-woocommerce-brands.php:321
|
107 |
-
#: classes/class-perfect-woocommerce-brands.php:370
|
108 |
-
msgid "Autoplay"
|
109 |
-
msgstr "Modo automático"
|
110 |
-
|
111 |
-
#: classes/class-perfect-woocommerce-brands.php:323
|
112 |
-
#: classes/class-perfect-woocommerce-brands.php:372
|
113 |
-
msgid "Autoplay carousel"
|
114 |
-
msgstr "Modo automático para el carrusel"
|
115 |
-
|
116 |
-
#: classes/class-perfect-woocommerce-brands.php:328
|
117 |
-
#: classes/class-perfect-woocommerce-brands.php:377
|
118 |
-
msgid "Arrows"
|
119 |
-
msgstr "Flechas de navegación"
|
120 |
-
|
121 |
-
#: classes/class-perfect-woocommerce-brands.php:330
|
122 |
-
#: classes/class-perfect-woocommerce-brands.php:379
|
123 |
-
msgid "Display prev and next arrows"
|
124 |
-
msgstr "Mostrar flechas de navegación"
|
125 |
-
|
126 |
-
#: classes/class-perfect-woocommerce-brands.php:336
|
127 |
-
msgid "PWB Brands carousel"
|
128 |
-
msgstr "PWB Carrusel de marcas"
|
129 |
-
|
130 |
-
#: classes/class-perfect-woocommerce-brands.php:337
|
131 |
-
msgid "Brands carousel"
|
132 |
-
msgstr "Carrusel de marcas"
|
133 |
-
|
134 |
-
#: classes/class-perfect-woocommerce-brands.php:346
|
135 |
-
msgid "Items"
|
136 |
-
msgstr "Elementos"
|
137 |
-
|
138 |
-
#: classes/class-perfect-woocommerce-brands.php:349
|
139 |
-
msgid "Number of items to load (or 'featured')"
|
140 |
-
msgstr "Número de elementos a cargar (o 'featured')"
|
141 |
-
|
142 |
-
#: classes/class-perfect-woocommerce-brands.php:354
|
143 |
-
msgid "Items to show"
|
144 |
-
msgstr "Elementos a mostrar"
|
145 |
-
|
146 |
-
#: classes/class-perfect-woocommerce-brands.php:357
|
147 |
-
msgid "Number of items to show"
|
148 |
-
msgstr "Número de elementos a mostrar"
|
149 |
-
|
150 |
-
#: classes/class-perfect-woocommerce-brands.php:362
|
151 |
-
msgid "Items to scroll"
|
152 |
-
msgstr "Número de elementos por scroll"
|
153 |
-
|
154 |
-
#: classes/class-perfect-woocommerce-brands.php:365
|
155 |
-
msgid "Number of items to scroll"
|
156 |
-
msgstr "Número de elementos por cada scroll"
|
157 |
-
|
158 |
-
#: classes/class-perfect-woocommerce-brands.php:383
|
159 |
-
#: classes/class-perfect-woocommerce-brands.php:411
|
160 |
-
#: classes/class-perfect-woocommerce-brands.php:492
|
161 |
-
#: classes/admin/class-pwb-admin-tab.php:129
|
162 |
-
msgid "Brand logo size"
|
163 |
-
msgstr "Tamaño del logo de la marca"
|
164 |
-
|
165 |
-
#: classes/class-perfect-woocommerce-brands.php:394
|
166 |
-
msgid "PWB All brands"
|
167 |
-
msgstr "PWB Todas las marcas"
|
168 |
-
|
169 |
-
#: classes/class-perfect-woocommerce-brands.php:395
|
170 |
-
msgid "Show all brands"
|
171 |
-
msgstr "Mostrar todas las marcas"
|
172 |
-
|
173 |
-
#: classes/class-perfect-woocommerce-brands.php:404
|
174 |
-
msgid "Brands per page"
|
175 |
-
msgstr "Marcas por página"
|
176 |
-
|
177 |
-
#: classes/class-perfect-woocommerce-brands.php:407
|
178 |
-
msgid "Show x brands per page"
|
179 |
-
msgstr "Mostrar x marcas por página"
|
180 |
-
|
181 |
-
#: classes/class-perfect-woocommerce-brands.php:418
|
182 |
-
msgid "Order by"
|
183 |
-
msgstr "Ordenar por"
|
184 |
-
|
185 |
-
#: classes/class-perfect-woocommerce-brands.php:432
|
186 |
-
msgid "Order"
|
187 |
-
msgstr "Orden"
|
188 |
-
|
189 |
-
#: classes/class-perfect-woocommerce-brands.php:442
|
190 |
-
msgid "Title position"
|
191 |
-
msgstr "Posición del título"
|
192 |
-
|
193 |
-
#: classes/class-perfect-woocommerce-brands.php:446
|
194 |
-
msgid "Before image"
|
195 |
-
msgstr "Antes de la imagen"
|
196 |
-
|
197 |
-
#: classes/class-perfect-woocommerce-brands.php:447
|
198 |
-
msgid "After image"
|
199 |
-
msgstr "Después de la imagen"
|
200 |
-
|
201 |
-
#: classes/class-perfect-woocommerce-brands.php:448
|
202 |
-
msgid "Hide"
|
203 |
-
msgstr "Ocultar"
|
204 |
-
|
205 |
-
#: classes/class-perfect-woocommerce-brands.php:454
|
206 |
-
#: classes/widgets/class-pwb-dropdown.php:43
|
207 |
-
#: classes/widgets/class-pwb-list.php:67
|
208 |
-
msgid "Hide empty"
|
209 |
-
msgstr "Ocultar vacías"
|
210 |
-
|
211 |
-
#: classes/class-perfect-woocommerce-brands.php:456
|
212 |
-
msgid "Hide brands that have not been assigned to any product"
|
213 |
-
msgstr "Ocultar marcas que no han sido asignadas a ningún producto"
|
214 |
-
|
215 |
-
#: classes/class-perfect-woocommerce-brands.php:464
|
216 |
-
msgid "PWB AZ Listing"
|
217 |
-
msgstr "Lista A-Z"
|
218 |
-
|
219 |
-
#: classes/class-perfect-woocommerce-brands.php:465
|
220 |
-
msgid "AZ Listing for brands"
|
221 |
-
msgstr "Listado A-Z de marcas"
|
222 |
-
|
223 |
-
#: classes/class-perfect-woocommerce-brands.php:474
|
224 |
-
msgid "PWB brand"
|
225 |
-
msgstr "PWB Marca"
|
226 |
-
|
227 |
-
#: classes/class-perfect-woocommerce-brands.php:475
|
228 |
-
msgid "Show brand for a specific product"
|
229 |
-
msgstr "Ver marcas de un producto específico"
|
230 |
-
|
231 |
-
#: classes/class-perfect-woocommerce-brands.php:485
|
232 |
-
msgid "Product id"
|
233 |
-
msgstr "Id del producto"
|
234 |
-
|
235 |
-
#: classes/class-perfect-woocommerce-brands.php:488
|
236 |
-
msgid "Product id (post id)"
|
237 |
-
msgstr "Id del producto (id del post)"
|
238 |
-
|
239 |
-
#: classes/class-perfect-woocommerce-brands.php:533
|
240 |
-
#: classes/shortcodes/class-pwb-brand.php:29
|
241 |
-
#: classes/shortcodes/class-pwb-brand.php:31
|
242 |
-
msgid "View brand"
|
243 |
-
msgstr "Ver marca"
|
244 |
-
|
245 |
-
#: classes/class-perfect-woocommerce-brands.php:598
|
246 |
-
msgid "¿Start migration?"
|
247 |
-
msgstr "¿Comenzar la migración?"
|
248 |
-
|
249 |
-
#: classes/class-perfect-woocommerce-brands.php:599
|
250 |
-
msgid ""
|
251 |
-
"We are migrating the product brands. ¡Don´t close this window until the "
|
252 |
-
"process is finished!"
|
253 |
-
msgstr ""
|
254 |
-
"Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
|
255 |
-
"el proceso finalice!"
|
256 |
-
|
257 |
-
#: classes/class-perfect-woocommerce-brands.php:600
|
258 |
-
msgid "¿Start loading dummy data?"
|
259 |
-
msgstr "¿Comenzar con la importación?"
|
260 |
-
|
261 |
-
#: classes/class-perfect-woocommerce-brands.php:601
|
262 |
-
msgid ""
|
263 |
-
"We are importing the dummy data. ¡Don´t close this window until the process "
|
264 |
-
"is finished!"
|
265 |
-
msgstr ""
|
266 |
-
"En este momento estamos importando las marcas ficticias. ¡No cierre esta "
|
267 |
-
"ventana hasta que termine el proceso!"
|
268 |
-
|
269 |
-
#: classes/class-perfect-woocommerce-brands.php:610
|
270 |
-
#: classes/class-perfect-woocommerce-brands.php:612
|
271 |
-
#: classes/admin/class-edit-brands-page.php:128
|
272 |
-
#: classes/admin/class-pwb-admin-tab.php:21
|
273 |
-
#: classes/widgets/class-pwb-dropdown.php:19
|
274 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:20
|
275 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:75
|
276 |
-
#: classes/widgets/class-pwb-list.php:19 templates/widgets/dropdown.php:16
|
277 |
-
msgid "Brands"
|
278 |
-
msgstr "Marcas"
|
279 |
-
|
280 |
-
#: classes/class-perfect-woocommerce-brands.php:613
|
281 |
-
msgid "All Brands"
|
282 |
-
msgstr "Todas las marcas"
|
283 |
-
|
284 |
-
#: classes/class-perfect-woocommerce-brands.php:614
|
285 |
-
msgid "Edit Brand"
|
286 |
-
msgstr "Editar marca"
|
287 |
-
|
288 |
-
#: classes/class-perfect-woocommerce-brands.php:615
|
289 |
-
msgid "View Brand"
|
290 |
-
msgstr "Ver marca"
|
291 |
-
|
292 |
-
#: classes/class-perfect-woocommerce-brands.php:616
|
293 |
-
msgid "Update Brand"
|
294 |
-
msgstr "Actualizar marca"
|
295 |
-
|
296 |
-
#: classes/class-perfect-woocommerce-brands.php:617
|
297 |
-
msgid "Add New Brand"
|
298 |
-
msgstr "Añadir nueva marca"
|
299 |
-
|
300 |
-
#: classes/class-perfect-woocommerce-brands.php:618
|
301 |
-
msgid "New Brand Name"
|
302 |
-
msgstr "Nuevo nombre de marca"
|
303 |
-
|
304 |
-
#: classes/class-perfect-woocommerce-brands.php:619
|
305 |
-
msgid "Parent Brand"
|
306 |
-
msgstr "Marca Padre"
|
307 |
-
|
308 |
-
#: classes/class-perfect-woocommerce-brands.php:620
|
309 |
-
msgid "Parent Brand:"
|
310 |
-
msgstr "Marca Padre:"
|
311 |
-
|
312 |
-
#: classes/class-perfect-woocommerce-brands.php:621
|
313 |
-
msgid "Search Brands"
|
314 |
-
msgstr "Buscar Marcas"
|
315 |
-
|
316 |
-
#: classes/class-perfect-woocommerce-brands.php:622
|
317 |
-
msgid "Popular Brands"
|
318 |
-
msgstr "Marcas Populares"
|
319 |
-
|
320 |
-
#: classes/class-perfect-woocommerce-brands.php:623
|
321 |
-
msgid "Separate brands with commas"
|
322 |
-
msgstr "Separar marcas con comas"
|
323 |
-
|
324 |
-
#: classes/class-perfect-woocommerce-brands.php:624
|
325 |
-
msgid "Add or remove brands"
|
326 |
-
msgstr "Añadir o eliminar marcas"
|
327 |
-
|
328 |
-
#: classes/class-perfect-woocommerce-brands.php:625
|
329 |
-
msgid "Choose from the most used brands"
|
330 |
-
msgstr "Seleccionar de las marcas más utilizadas"
|
331 |
-
|
332 |
-
#: classes/class-perfect-woocommerce-brands.php:626
|
333 |
-
msgid "No brands found"
|
334 |
-
msgstr "No se han encontrado marcas"
|
335 |
-
|
336 |
-
#: classes/class-perfect-woocommerce-brands.php:697
|
337 |
-
msgid "All"
|
338 |
-
msgstr "Todas"
|
339 |
-
|
340 |
-
#: classes/class-pwb-api-support.php:87
|
341 |
-
msgid "Product brands"
|
342 |
-
msgstr "Marcas del producto"
|
343 |
-
|
344 |
-
#: classes/class-pwb-term.php:20
|
345 |
-
msgid "Only WP_Term objects are allowed"
|
346 |
-
msgstr "Solo se permiten objetos del tipo WP_Term"
|
347 |
-
|
348 |
-
#: classes/admin/class-brands-custom-fields.php:20
|
349 |
-
#: classes/admin/class-brands-custom-fields.php:59
|
350 |
-
msgid "Description"
|
351 |
-
msgstr "Descripción"
|
352 |
-
|
353 |
-
#: classes/admin/class-brands-custom-fields.php:22
|
354 |
-
#: classes/admin/class-brands-custom-fields.php:63
|
355 |
-
msgid ""
|
356 |
-
"Brand description for the archive pages. You can include some html markup "
|
357 |
-
"and shortcodes."
|
358 |
-
msgstr ""
|
359 |
-
"Descripción de la marca para la página de archivo. Puedes incluir marcado "
|
360 |
-
"html y shortcodes."
|
361 |
-
|
362 |
-
#: classes/admin/class-brands-custom-fields.php:26
|
363 |
-
#: classes/admin/class-brands-custom-fields.php:68
|
364 |
-
#: classes/widgets/class-pwb-list.php:43
|
365 |
-
msgid "Brand logo"
|
366 |
-
msgstr "Logo de la marca"
|
367 |
-
|
368 |
-
#: classes/admin/class-brands-custom-fields.php:28
|
369 |
-
#: classes/admin/class-brands-custom-fields.php:34
|
370 |
-
#: classes/admin/class-brands-custom-fields.php:72
|
371 |
-
#: classes/admin/class-brands-custom-fields.php:92
|
372 |
-
msgid "Select image"
|
373 |
-
msgstr "Seleccionar imagen"
|
374 |
-
|
375 |
-
#: classes/admin/class-brands-custom-fields.php:32
|
376 |
-
#: classes/admin/class-brands-custom-fields.php:88
|
377 |
-
msgid "Brand banner"
|
378 |
-
msgstr "Banner de la marca"
|
379 |
-
|
380 |
-
#: classes/admin/class-brands-custom-fields.php:35
|
381 |
-
msgid "This image will be shown on brand page"
|
382 |
-
msgstr "Esta imagen se mostrará en la página de la marca"
|
383 |
-
|
384 |
-
#: classes/admin/class-brands-custom-fields.php:39
|
385 |
-
#: classes/admin/class-brands-custom-fields.php:108
|
386 |
-
msgid "Brand banner link"
|
387 |
-
msgstr "Enlace para el banner de la marca"
|
388 |
-
|
389 |
-
#: classes/admin/class-brands-custom-fields.php:41
|
390 |
-
#: classes/admin/class-brands-custom-fields.php:112
|
391 |
-
msgid "This link should be relative to site url. Example: product/product-name"
|
392 |
-
msgstr ""
|
393 |
-
"Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
|
394 |
-
"nombre-del-producto"
|
395 |
-
|
396 |
-
#: classes/admin/class-edit-brands-page.php:39
|
397 |
-
msgid "featured"
|
398 |
-
msgstr "favorita"
|
399 |
-
|
400 |
-
#: classes/admin/class-edit-brands-page.php:74
|
401 |
-
msgid "Logo"
|
402 |
-
msgstr "Logo"
|
403 |
-
|
404 |
-
#: classes/admin/class-edit-brands-page.php:96
|
405 |
-
msgid "Set as featured"
|
406 |
-
msgstr "Marcar como favorita"
|
407 |
-
|
408 |
-
#: classes/admin/class-edit-brands-page.php:118
|
409 |
-
msgid "Error!"
|
410 |
-
msgstr "Error!"
|
411 |
-
|
412 |
-
#: classes/admin/class-edit-brands-page.php:131
|
413 |
-
msgid "Show featured brands first"
|
414 |
-
msgstr "Mostrar marcas favoritas primero"
|
415 |
-
|
416 |
-
#: classes/admin/class-pwb-admin-tab.php:70
|
417 |
-
msgid "Brands settings"
|
418 |
-
msgstr "Ajustes de las marcas"
|
419 |
-
|
420 |
-
#: classes/admin/class-pwb-admin-tab.php:76
|
421 |
-
msgid "Slug"
|
422 |
-
msgstr "Slug"
|
423 |
-
|
424 |
-
#: classes/admin/class-pwb-admin-tab.php:79
|
425 |
-
msgid "Brands taxonomy slug"
|
426 |
-
msgstr "Slug de la taxonomía marcas"
|
427 |
-
|
428 |
-
#: classes/admin/class-pwb-admin-tab.php:84
|
429 |
-
msgid "Show brand description"
|
430 |
-
msgstr "Mostrar descripción de la marca"
|
431 |
-
|
432 |
-
#: classes/admin/class-pwb-admin-tab.php:88
|
433 |
-
msgid "Show brand description (if is set) on brand archive page"
|
434 |
-
msgstr "Mostrar descripción de la marca en la página de archivo"
|
435 |
-
|
436 |
-
#: classes/admin/class-pwb-admin-tab.php:91
|
437 |
-
msgid "Yes, before product loop"
|
438 |
-
msgstr "Si, antes de los productos"
|
439 |
-
|
440 |
-
#: classes/admin/class-pwb-admin-tab.php:92
|
441 |
-
msgid "Yes, after product loop"
|
442 |
-
msgstr "Si, después de los productos"
|
443 |
-
|
444 |
-
#: classes/admin/class-pwb-admin-tab.php:93
|
445 |
-
msgid "No, hide description"
|
446 |
-
msgstr "No, ocultar descripción"
|
447 |
-
|
448 |
-
#: classes/admin/class-pwb-admin-tab.php:97
|
449 |
-
msgid "Single product tab"
|
450 |
-
msgstr "Tab en la página del producto"
|
451 |
-
|
452 |
-
#: classes/admin/class-pwb-admin-tab.php:100
|
453 |
-
msgid "Show brand tab in single product page"
|
454 |
-
msgstr "Mostrar pestaña con información de la marca en la página del producto"
|
455 |
-
|
456 |
-
#: classes/admin/class-pwb-admin-tab.php:104
|
457 |
-
msgid "Show brands in loop"
|
458 |
-
msgstr "Mostrar marcas en el loop"
|
459 |
-
|
460 |
-
#: classes/admin/class-pwb-admin-tab.php:107
|
461 |
-
msgid "Show brand logo (or name) in product loop"
|
462 |
-
msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
|
463 |
-
|
464 |
-
#: classes/admin/class-pwb-admin-tab.php:110
|
465 |
-
#: classes/admin/class-pwb-admin-tab.php:123
|
466 |
-
msgid "No"
|
467 |
-
msgstr "No"
|
468 |
-
|
469 |
-
#: classes/admin/class-pwb-admin-tab.php:111
|
470 |
-
#: classes/admin/class-pwb-admin-tab.php:124
|
471 |
-
msgid "Show brand link"
|
472 |
-
msgstr "Mostrar el link de la marca"
|
473 |
-
|
474 |
-
#: classes/admin/class-pwb-admin-tab.php:112
|
475 |
-
#: classes/admin/class-pwb-admin-tab.php:125
|
476 |
-
msgid "Show brand image (if is set)"
|
477 |
-
msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
|
478 |
-
|
479 |
-
#: classes/admin/class-pwb-admin-tab.php:116
|
480 |
-
msgid "Show brands in single product"
|
481 |
-
msgstr "Mostrar marcas en la página del producto"
|
482 |
-
|
483 |
-
#: classes/admin/class-pwb-admin-tab.php:119
|
484 |
-
msgid "Show brand logo (or name) in single product"
|
485 |
-
msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
|
486 |
-
|
487 |
-
#: classes/admin/class-pwb-admin-tab.php:137
|
488 |
-
msgid "Brand position"
|
489 |
-
msgstr "Posición de la marca"
|
490 |
-
|
491 |
-
#: classes/admin/class-pwb-admin-tab.php:140
|
492 |
-
msgid "For single product"
|
493 |
-
msgstr "En la página individual de cada producto"
|
494 |
-
|
495 |
-
#: classes/admin/class-pwb-admin-tab.php:143
|
496 |
-
msgid "Before title"
|
497 |
-
msgstr "Antes del título"
|
498 |
-
|
499 |
-
#: classes/admin/class-pwb-admin-tab.php:144
|
500 |
-
msgid "After title"
|
501 |
-
msgstr "Después del título"
|
502 |
-
|
503 |
-
#: classes/admin/class-pwb-admin-tab.php:145
|
504 |
-
msgid "After price"
|
505 |
-
msgstr "Después del precio"
|
506 |
-
|
507 |
-
#: classes/admin/class-pwb-admin-tab.php:146
|
508 |
-
msgid "After excerpt"
|
509 |
-
msgstr "Después de la descripción corta"
|
510 |
-
|
511 |
-
#: classes/admin/class-pwb-admin-tab.php:147
|
512 |
-
msgid "After add to cart"
|
513 |
-
msgstr "Después del botón de comprar"
|
514 |
-
|
515 |
-
#: classes/admin/class-pwb-admin-tab.php:148
|
516 |
-
msgid "After meta"
|
517 |
-
msgstr "Después del meta"
|
518 |
-
|
519 |
-
#: classes/admin/class-pwb-admin-tab.php:149
|
520 |
-
msgid "After sharing"
|
521 |
-
msgstr "Después de compartir"
|
522 |
-
|
523 |
-
#: classes/admin/class-pwb-admin-tab.php:153
|
524 |
-
msgid "Brands page"
|
525 |
-
msgstr "Página de marcas"
|
526 |
-
|
527 |
-
#: classes/admin/class-pwb-admin-tab.php:156
|
528 |
-
msgid "For linking breadcrumbs"
|
529 |
-
msgstr "Para el enlace de las migas de pan"
|
530 |
-
|
531 |
-
#: classes/admin/class-pwb-admin-tab.php:173
|
532 |
-
msgid "Tools"
|
533 |
-
msgstr "Herramientas"
|
534 |
-
|
535 |
-
#: classes/admin/class-pwb-admin-tab.php:179
|
536 |
-
#: templates/admin/brands-exporter.php:16
|
537 |
-
msgid "Import brands"
|
538 |
-
msgstr "Importar marcas"
|
539 |
-
|
540 |
-
#: classes/admin/class-pwb-admin-tab.php:183
|
541 |
-
#, php-format
|
542 |
-
msgid ""
|
543 |
-
"Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
|
544 |
-
"\">Click here for more details</a>"
|
545 |
-
msgstr ""
|
546 |
-
"Importar marcas de producto de otro plugin de marcas. <a href=\"%s\" target="
|
547 |
-
"\"_blank\">Pulsa aquí para ver la documentación</a>"
|
548 |
-
|
549 |
-
#: classes/admin/class-pwb-admin-tab.php:188
|
550 |
-
#: classes/admin/class-pwb-admin-tab.php:201
|
551 |
-
msgid "-"
|
552 |
-
msgstr "-"
|
553 |
-
|
554 |
-
#: classes/admin/class-pwb-admin-tab.php:189
|
555 |
-
msgid "YITH WooCommerce Brands Add-On"
|
556 |
-
msgstr "YITH WooCommerce Brands Add-On"
|
557 |
-
|
558 |
-
#: classes/admin/class-pwb-admin-tab.php:190
|
559 |
-
msgid "Ultimate WooCommerce Brands"
|
560 |
-
msgstr "Ultimate WooCommerce Brands"
|
561 |
-
|
562 |
-
#: classes/admin/class-pwb-admin-tab.php:191
|
563 |
-
msgid "Offical WooCommerce Brands"
|
564 |
-
msgstr "Offical WooCommerce Brands"
|
565 |
-
|
566 |
-
#: classes/admin/class-pwb-admin-tab.php:195
|
567 |
-
msgid "Dummy data"
|
568 |
-
msgstr "Datos ficticios"
|
569 |
-
|
570 |
-
#: classes/admin/class-pwb-admin-tab.php:198
|
571 |
-
msgid "Import generic brands and assign it to products randomly"
|
572 |
-
msgstr ""
|
573 |
-
"Importar marcas genéricas y asignarlas a los productos existentes de forma "
|
574 |
-
"aleatoria"
|
575 |
-
|
576 |
-
#: classes/admin/class-pwb-admin-tab.php:202
|
577 |
-
msgid "Start import"
|
578 |
-
msgstr "Comenzar importación"
|
579 |
-
|
580 |
-
#: classes/admin/class-pwb-admin-tab.php:206
|
581 |
-
msgid "System status"
|
582 |
-
msgstr "Estado del sistema"
|
583 |
-
|
584 |
-
#: classes/admin/class-pwb-admin-tab.php:208
|
585 |
-
msgid "Show system status"
|
586 |
-
msgstr "Ver estado del sistema"
|
587 |
-
|
588 |
-
#: classes/admin/class-pwb-coupon.php:24
|
589 |
-
msgid "Brands restriction"
|
590 |
-
msgstr "Restricciones de marca"
|
591 |
-
|
592 |
-
#: classes/admin/class-pwb-coupon.php:25
|
593 |
-
msgid "Any brand"
|
594 |
-
msgstr "Cualquier marca"
|
595 |
-
|
596 |
-
#: classes/admin/class-pwb-coupon.php:34
|
597 |
-
msgid ""
|
598 |
-
"Coupon will be valid if there are at least one product of this brands in the "
|
599 |
-
"cart"
|
600 |
-
msgstr ""
|
601 |
-
"El cupón será válido si existe al menos un producto de la marca señalada en "
|
602 |
-
"el carrito"
|
603 |
-
|
604 |
-
#: classes/shortcodes/class-pwb-all-brands.php:108
|
605 |
-
msgid "First page"
|
606 |
-
msgstr "Primera página"
|
607 |
-
|
608 |
-
#: classes/shortcodes/class-pwb-all-brands.php:111
|
609 |
-
msgid "Previous page"
|
610 |
-
msgstr "Página anterior"
|
611 |
-
|
612 |
-
#: classes/shortcodes/class-pwb-all-brands.php:115
|
613 |
-
msgid "Next page"
|
614 |
-
msgstr "Siguiente página"
|
615 |
-
|
616 |
-
#: classes/shortcodes/class-pwb-all-brands.php:118
|
617 |
-
msgid "Last page"
|
618 |
-
msgstr "Última página"
|
619 |
-
|
620 |
-
#: classes/shortcodes/class-pwb-all-brands.php:123
|
621 |
-
msgid "No results"
|
622 |
-
msgstr "No se han encontrado resultados"
|
623 |
-
|
624 |
-
#: classes/widgets/class-pwb-dropdown.php:10
|
625 |
-
msgid "Adds a brands dropdown to your site"
|
626 |
-
msgstr "Añade un desplegable con las marcas a tu sitio"
|
627 |
-
|
628 |
-
#: classes/widgets/class-pwb-dropdown.php:11
|
629 |
-
msgid "Brands dropdown"
|
630 |
-
msgstr "Desplegable de marcas"
|
631 |
-
|
632 |
-
#: classes/widgets/class-pwb-dropdown.php:26
|
633 |
-
msgid "Title"
|
634 |
-
msgstr "Título"
|
635 |
-
|
636 |
-
#: classes/widgets/class-pwb-dropdown.php:54
|
637 |
-
#: classes/widgets/class-pwb-list.php:77
|
638 |
-
msgid "Only favorite brands"
|
639 |
-
msgstr "Solo marcas favoritas"
|
640 |
-
|
641 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:11
|
642 |
-
msgid "Recommended for product categories or shop page"
|
643 |
-
msgstr "Recomendado para las categorías de producto y la página de la tienda"
|
644 |
-
|
645 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:12
|
646 |
-
msgid "Filter products by brand"
|
647 |
-
msgstr "Filtrar productos por marca"
|
648 |
-
|
649 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:25
|
650 |
-
#: classes/widgets/class-pwb-list.php:28
|
651 |
-
msgid "Title:"
|
652 |
-
msgstr "Título:"
|
653 |
-
|
654 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:30
|
655 |
-
msgid "Max number of brands"
|
656 |
-
msgstr "Número máximo de marcas"
|
657 |
-
|
658 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:41
|
659 |
-
msgid "Hide filter button"
|
660 |
-
msgstr "No mostrar el botón Filtrar"
|
661 |
-
|
662 |
-
#: classes/widgets/class-pwb-list.php:10
|
663 |
-
msgid "Adds a brands list to your site"
|
664 |
-
msgstr "Añade una lista de marcas a tu sitio"
|
665 |
-
|
666 |
-
#: classes/widgets/class-pwb-list.php:11
|
667 |
-
msgid "Brands list"
|
668 |
-
msgstr "Lista de marcas"
|
669 |
-
|
670 |
-
#: classes/widgets/class-pwb-list.php:37
|
671 |
-
msgid "Display as:"
|
672 |
-
msgstr "Mostrar como:"
|
673 |
-
|
674 |
-
#: classes/widgets/class-pwb-list.php:42
|
675 |
-
msgid "Brand name"
|
676 |
-
msgstr "Nombre de la marca"
|
677 |
-
|
678 |
-
#: classes/widgets/class-pwb-list.php:47
|
679 |
-
msgid "Columns:"
|
680 |
-
msgstr "Columnas:"
|
681 |
-
|
682 |
-
#: classes/widgets/class-pwb-list.php:87
|
683 |
-
msgid "Randomize"
|
684 |
-
msgstr "Aleatorio"
|
685 |
-
|
686 |
-
#: classes/widgets/class-pwb-list.php:119
|
687 |
-
msgid "Go to"
|
688 |
-
msgstr "Ir a"
|
689 |
-
|
690 |
-
#: templates/admin/brands-exporter.php:15
|
691 |
-
msgid "Export brands"
|
692 |
-
msgstr "Exportar marcas"
|
693 |
-
|
694 |
-
#: templates/admin/brands-exporter.php:18
|
695 |
-
msgid ""
|
696 |
-
"This tool allows you to export and import the brands between different sites "
|
697 |
-
"using PWB."
|
698 |
-
msgstr ""
|
699 |
-
"Esta herramienta permite exportar e importar marcas entre dos sitios "
|
700 |
-
"diferentes que utilizan PWB"
|
701 |
-
|
702 |
-
#: templates/shortcodes/carousel.php:24
|
703 |
-
#: templates/shortcodes/product-carousel.php:28
|
704 |
-
msgid "Loading"
|
705 |
-
msgstr "Cargando"
|
706 |
-
|
707 |
-
#: templates/shortcodes/product-carousel.php:34
|
708 |
-
msgid "Nothing found"
|
709 |
-
msgstr "Aquí no hay nada"
|
710 |
-
|
711 |
-
#: templates/widgets/filter-by-brand.php:25
|
712 |
-
msgid "Apply filter"
|
713 |
-
msgstr "Filtrar"
|
714 |
-
|
715 |
-
#: classes/widgets/class-pwb-dropdown.php:66
|
716 |
-
#: classes/widgets/class-pwb-list.php:115
|
717 |
-
msgid "There is not available brands"
|
718 |
-
msgstr "No se encuentran marcas disponibles"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lang/perfect-woocommerce-brands.pot
CHANGED
@@ -1,686 +1,686 @@
|
|
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-11-29 00:11+0100\n"
|
12 |
-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\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 |
-
|
20 |
-
#: main.php:106
|
21 |
-
msgid ""
|
22 |
-
"Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
|
23 |
-
"active WooCommerce plugin."
|
24 |
-
msgstr ""
|
25 |
-
|
26 |
-
#: classes/class-perfect-woocommerce-brands.php:52
|
27 |
-
msgid ""
|
28 |
-
"We know that you´re in love with Perfect WooCommerce Brands, you can help us "
|
29 |
-
"making it a bit better. Thanks a lot!"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: classes/class-perfect-woocommerce-brands.php:54
|
33 |
-
msgid ""
|
34 |
-
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
35 |
-
"reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: classes/class-perfect-woocommerce-brands.php:55
|
39 |
-
msgid ""
|
40 |
-
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
41 |
-
"woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: classes/class-perfect-woocommerce-brands.php:56
|
45 |
-
msgid ""
|
46 |
-
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
47 |
-
"\"_blank\">View on GitHub</a>"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: classes/class-perfect-woocommerce-brands.php:79
|
51 |
-
msgid "Settings"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: classes/class-perfect-woocommerce-brands.php:280
|
55 |
-
msgid "PWB Product carousel"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: classes/class-perfect-woocommerce-brands.php:281
|
59 |
-
msgid "Product carousel by brand or by category"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: classes/class-perfect-woocommerce-brands.php:289
|
63 |
-
#: classes/class-perfect-woocommerce-brands.php:611
|
64 |
-
#: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
|
65 |
-
#: classes/admin/class-pwb-exporter-support.php:22
|
66 |
-
#: classes/admin/class-pwb-importer-support.php:22
|
67 |
-
#: classes/admin/class-pwb-importer-support.php:33
|
68 |
-
msgid "Brand"
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: classes/class-perfect-woocommerce-brands.php:297
|
72 |
-
msgid "Products"
|
73 |
-
msgstr ""
|
74 |
-
|
75 |
-
#: classes/class-perfect-woocommerce-brands.php:300
|
76 |
-
msgid "Number of products to load"
|
77 |
-
msgstr ""
|
78 |
-
|
79 |
-
#: classes/class-perfect-woocommerce-brands.php:305
|
80 |
-
msgid "Products to show"
|
81 |
-
msgstr ""
|
82 |
-
|
83 |
-
#: classes/class-perfect-woocommerce-brands.php:308
|
84 |
-
msgid "Number of products to show"
|
85 |
-
msgstr ""
|
86 |
-
|
87 |
-
#: classes/class-perfect-woocommerce-brands.php:313
|
88 |
-
msgid "Products to scroll"
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#: classes/class-perfect-woocommerce-brands.php:316
|
92 |
-
msgid "Number of products to scroll"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: classes/class-perfect-woocommerce-brands.php:321
|
96 |
-
#: classes/class-perfect-woocommerce-brands.php:370
|
97 |
-
msgid "Autoplay"
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: classes/class-perfect-woocommerce-brands.php:323
|
101 |
-
#: classes/class-perfect-woocommerce-brands.php:372
|
102 |
-
msgid "Autoplay carousel"
|
103 |
-
msgstr ""
|
104 |
-
|
105 |
-
#: classes/class-perfect-woocommerce-brands.php:328
|
106 |
-
#: classes/class-perfect-woocommerce-brands.php:377
|
107 |
-
msgid "Arrows"
|
108 |
-
msgstr ""
|
109 |
-
|
110 |
-
#: classes/class-perfect-woocommerce-brands.php:330
|
111 |
-
#: classes/class-perfect-woocommerce-brands.php:379
|
112 |
-
msgid "Display prev and next arrows"
|
113 |
-
msgstr ""
|
114 |
-
|
115 |
-
#: classes/class-perfect-woocommerce-brands.php:336
|
116 |
-
msgid "PWB Brands carousel"
|
117 |
-
msgstr ""
|
118 |
-
|
119 |
-
#: classes/class-perfect-woocommerce-brands.php:337
|
120 |
-
msgid "Brands carousel"
|
121 |
-
msgstr ""
|
122 |
-
|
123 |
-
#: classes/class-perfect-woocommerce-brands.php:346
|
124 |
-
msgid "Items"
|
125 |
-
msgstr ""
|
126 |
-
|
127 |
-
#: classes/class-perfect-woocommerce-brands.php:349
|
128 |
-
msgid "Number of items to load (or 'featured')"
|
129 |
-
msgstr ""
|
130 |
-
|
131 |
-
#: classes/class-perfect-woocommerce-brands.php:354
|
132 |
-
msgid "Items to show"
|
133 |
-
msgstr ""
|
134 |
-
|
135 |
-
#: classes/class-perfect-woocommerce-brands.php:357
|
136 |
-
msgid "Number of items to show"
|
137 |
-
msgstr ""
|
138 |
-
|
139 |
-
#: classes/class-perfect-woocommerce-brands.php:362
|
140 |
-
msgid "Items to scroll"
|
141 |
-
msgstr ""
|
142 |
-
|
143 |
-
#: classes/class-perfect-woocommerce-brands.php:365
|
144 |
-
msgid "Number of items to scroll"
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: classes/class-perfect-woocommerce-brands.php:383
|
148 |
-
#: classes/class-perfect-woocommerce-brands.php:411
|
149 |
-
#: classes/class-perfect-woocommerce-brands.php:492
|
150 |
-
#: classes/admin/class-pwb-admin-tab.php:129
|
151 |
-
msgid "Brand logo size"
|
152 |
-
msgstr ""
|
153 |
-
|
154 |
-
#: classes/class-perfect-woocommerce-brands.php:394
|
155 |
-
msgid "PWB All brands"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
#: classes/class-perfect-woocommerce-brands.php:395
|
159 |
-
msgid "Show all brands"
|
160 |
-
msgstr ""
|
161 |
-
|
162 |
-
#: classes/class-perfect-woocommerce-brands.php:404
|
163 |
-
msgid "Brands per page"
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: classes/class-perfect-woocommerce-brands.php:407
|
167 |
-
msgid "Show x brands per page"
|
168 |
-
msgstr ""
|
169 |
-
|
170 |
-
#: classes/class-perfect-woocommerce-brands.php:418
|
171 |
-
msgid "Order by"
|
172 |
-
msgstr ""
|
173 |
-
|
174 |
-
#: classes/class-perfect-woocommerce-brands.php:432
|
175 |
-
msgid "Order"
|
176 |
-
msgstr ""
|
177 |
-
|
178 |
-
#: classes/class-perfect-woocommerce-brands.php:442
|
179 |
-
msgid "Title position"
|
180 |
-
msgstr ""
|
181 |
-
|
182 |
-
#: classes/class-perfect-woocommerce-brands.php:446
|
183 |
-
msgid "Before image"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: classes/class-perfect-woocommerce-brands.php:447
|
187 |
-
msgid "After image"
|
188 |
-
msgstr ""
|
189 |
-
|
190 |
-
#: classes/class-perfect-woocommerce-brands.php:448
|
191 |
-
msgid "Hide"
|
192 |
-
msgstr ""
|
193 |
-
|
194 |
-
#: classes/class-perfect-woocommerce-brands.php:454
|
195 |
-
#: classes/widgets/class-pwb-dropdown.php:43
|
196 |
-
#: classes/widgets/class-pwb-list.php:67
|
197 |
-
msgid "Hide empty"
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: classes/class-perfect-woocommerce-brands.php:456
|
201 |
-
msgid "Hide brands that have not been assigned to any product"
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: classes/class-perfect-woocommerce-brands.php:464
|
205 |
-
msgid "PWB AZ Listing"
|
206 |
-
msgstr ""
|
207 |
-
|
208 |
-
#: classes/class-perfect-woocommerce-brands.php:465
|
209 |
-
msgid "AZ Listing for brands"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: classes/class-perfect-woocommerce-brands.php:474
|
213 |
-
msgid "PWB brand"
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
#: classes/class-perfect-woocommerce-brands.php:475
|
217 |
-
msgid "Show brand for a specific product"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: classes/class-perfect-woocommerce-brands.php:485
|
221 |
-
msgid "Product id"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: classes/class-perfect-woocommerce-brands.php:488
|
225 |
-
msgid "Product id (post id)"
|
226 |
-
msgstr ""
|
227 |
-
|
228 |
-
#: classes/class-perfect-woocommerce-brands.php:533
|
229 |
-
#: classes/shortcodes/class-pwb-brand.php:29
|
230 |
-
#: classes/shortcodes/class-pwb-brand.php:31
|
231 |
-
msgid "View brand"
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: classes/class-perfect-woocommerce-brands.php:598
|
235 |
-
msgid "¿Start migration?"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: classes/class-perfect-woocommerce-brands.php:599
|
239 |
-
msgid ""
|
240 |
-
"We are migrating the product brands. ¡Don´t close this window until the "
|
241 |
-
"process is finished!"
|
242 |
-
msgstr ""
|
243 |
-
|
244 |
-
#: classes/class-perfect-woocommerce-brands.php:600
|
245 |
-
msgid "¿Start loading dummy data?"
|
246 |
-
msgstr ""
|
247 |
-
|
248 |
-
#: classes/class-perfect-woocommerce-brands.php:601
|
249 |
-
msgid ""
|
250 |
-
"We are importing the dummy data. ¡Don´t close this window until the process "
|
251 |
-
"is finished!"
|
252 |
-
msgstr ""
|
253 |
-
|
254 |
-
#: classes/class-perfect-woocommerce-brands.php:610
|
255 |
-
#: classes/class-perfect-woocommerce-brands.php:612
|
256 |
-
#: classes/admin/class-edit-brands-page.php:128
|
257 |
-
#: classes/admin/class-pwb-admin-tab.php:21
|
258 |
-
#: classes/widgets/class-pwb-dropdown.php:19
|
259 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:20
|
260 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:75
|
261 |
-
#: classes/widgets/class-pwb-list.php:19 templates/widgets/dropdown.php:16
|
262 |
-
msgid "Brands"
|
263 |
-
msgstr ""
|
264 |
-
|
265 |
-
#: classes/class-perfect-woocommerce-brands.php:613
|
266 |
-
msgid "All Brands"
|
267 |
-
msgstr ""
|
268 |
-
|
269 |
-
#: classes/class-perfect-woocommerce-brands.php:614
|
270 |
-
msgid "Edit Brand"
|
271 |
-
msgstr ""
|
272 |
-
|
273 |
-
#: classes/class-perfect-woocommerce-brands.php:615
|
274 |
-
msgid "View Brand"
|
275 |
-
msgstr ""
|
276 |
-
|
277 |
-
#: classes/class-perfect-woocommerce-brands.php:616
|
278 |
-
msgid "Update Brand"
|
279 |
-
msgstr ""
|
280 |
-
|
281 |
-
#: classes/class-perfect-woocommerce-brands.php:617
|
282 |
-
msgid "Add New Brand"
|
283 |
-
msgstr ""
|
284 |
-
|
285 |
-
#: classes/class-perfect-woocommerce-brands.php:618
|
286 |
-
msgid "New Brand Name"
|
287 |
-
msgstr ""
|
288 |
-
|
289 |
-
#: classes/class-perfect-woocommerce-brands.php:619
|
290 |
-
msgid "Parent Brand"
|
291 |
-
msgstr ""
|
292 |
-
|
293 |
-
#: classes/class-perfect-woocommerce-brands.php:620
|
294 |
-
msgid "Parent Brand:"
|
295 |
-
msgstr ""
|
296 |
-
|
297 |
-
#: classes/class-perfect-woocommerce-brands.php:621
|
298 |
-
msgid "Search Brands"
|
299 |
-
msgstr ""
|
300 |
-
|
301 |
-
#: classes/class-perfect-woocommerce-brands.php:622
|
302 |
-
msgid "Popular Brands"
|
303 |
-
msgstr ""
|
304 |
-
|
305 |
-
#: classes/class-perfect-woocommerce-brands.php:623
|
306 |
-
msgid "Separate brands with commas"
|
307 |
-
msgstr ""
|
308 |
-
|
309 |
-
#: classes/class-perfect-woocommerce-brands.php:624
|
310 |
-
msgid "Add or remove brands"
|
311 |
-
msgstr ""
|
312 |
-
|
313 |
-
#: classes/class-perfect-woocommerce-brands.php:625
|
314 |
-
msgid "Choose from the most used brands"
|
315 |
-
msgstr ""
|
316 |
-
|
317 |
-
#: classes/class-perfect-woocommerce-brands.php:626
|
318 |
-
msgid "No brands found"
|
319 |
-
msgstr ""
|
320 |
-
|
321 |
-
#: classes/class-perfect-woocommerce-brands.php:697
|
322 |
-
msgid "All"
|
323 |
-
msgstr ""
|
324 |
-
|
325 |
-
#: classes/class-pwb-api-support.php:87
|
326 |
-
msgid "Product brands"
|
327 |
-
msgstr ""
|
328 |
-
|
329 |
-
#: classes/class-pwb-term.php:20
|
330 |
-
msgid "Only WP_Term objects are allowed"
|
331 |
-
msgstr ""
|
332 |
-
|
333 |
-
#: classes/admin/class-brands-custom-fields.php:20
|
334 |
-
#: classes/admin/class-brands-custom-fields.php:59
|
335 |
-
msgid "Description"
|
336 |
-
msgstr ""
|
337 |
-
|
338 |
-
#: classes/admin/class-brands-custom-fields.php:22
|
339 |
-
#: classes/admin/class-brands-custom-fields.php:63
|
340 |
-
msgid ""
|
341 |
-
"Brand description for the archive pages. You can include some html markup "
|
342 |
-
"and shortcodes."
|
343 |
-
msgstr ""
|
344 |
-
|
345 |
-
#: classes/admin/class-brands-custom-fields.php:26
|
346 |
-
#: classes/admin/class-brands-custom-fields.php:68
|
347 |
-
#: classes/widgets/class-pwb-list.php:43
|
348 |
-
msgid "Brand logo"
|
349 |
-
msgstr ""
|
350 |
-
|
351 |
-
#: classes/admin/class-brands-custom-fields.php:28
|
352 |
-
#: classes/admin/class-brands-custom-fields.php:34
|
353 |
-
#: classes/admin/class-brands-custom-fields.php:72
|
354 |
-
#: classes/admin/class-brands-custom-fields.php:92
|
355 |
-
msgid "Select image"
|
356 |
-
msgstr ""
|
357 |
-
|
358 |
-
#: classes/admin/class-brands-custom-fields.php:32
|
359 |
-
#: classes/admin/class-brands-custom-fields.php:88
|
360 |
-
msgid "Brand banner"
|
361 |
-
msgstr ""
|
362 |
-
|
363 |
-
#: classes/admin/class-brands-custom-fields.php:35
|
364 |
-
msgid "This image will be shown on brand page"
|
365 |
-
msgstr ""
|
366 |
-
|
367 |
-
#: classes/admin/class-brands-custom-fields.php:39
|
368 |
-
#: classes/admin/class-brands-custom-fields.php:108
|
369 |
-
msgid "Brand banner link"
|
370 |
-
msgstr ""
|
371 |
-
|
372 |
-
#: classes/admin/class-brands-custom-fields.php:41
|
373 |
-
#: classes/admin/class-brands-custom-fields.php:112
|
374 |
-
msgid "This link should be relative to site url. Example: product/product-name"
|
375 |
-
msgstr ""
|
376 |
-
|
377 |
-
#: classes/admin/class-edit-brands-page.php:39
|
378 |
-
msgid "featured"
|
379 |
-
msgstr ""
|
380 |
-
|
381 |
-
#: classes/admin/class-edit-brands-page.php:74
|
382 |
-
msgid "Logo"
|
383 |
-
msgstr ""
|
384 |
-
|
385 |
-
#: classes/admin/class-edit-brands-page.php:96
|
386 |
-
msgid "Set as featured"
|
387 |
-
msgstr ""
|
388 |
-
|
389 |
-
#: classes/admin/class-edit-brands-page.php:118
|
390 |
-
msgid "Error!"
|
391 |
-
msgstr ""
|
392 |
-
|
393 |
-
#: classes/admin/class-edit-brands-page.php:131
|
394 |
-
msgid "Show featured brands first"
|
395 |
-
msgstr ""
|
396 |
-
|
397 |
-
#: classes/admin/class-pwb-admin-tab.php:70
|
398 |
-
msgid "Brands settings"
|
399 |
-
msgstr ""
|
400 |
-
|
401 |
-
#: classes/admin/class-pwb-admin-tab.php:76
|
402 |
-
msgid "Slug"
|
403 |
-
msgstr ""
|
404 |
-
|
405 |
-
#: classes/admin/class-pwb-admin-tab.php:79
|
406 |
-
msgid "Brands taxonomy slug"
|
407 |
-
msgstr ""
|
408 |
-
|
409 |
-
#: classes/admin/class-pwb-admin-tab.php:84
|
410 |
-
msgid "Show brand description"
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: classes/admin/class-pwb-admin-tab.php:88
|
414 |
-
msgid "Show brand description (if is set) on brand archive page"
|
415 |
-
msgstr ""
|
416 |
-
|
417 |
-
#: classes/admin/class-pwb-admin-tab.php:91
|
418 |
-
msgid "Yes, before product loop"
|
419 |
-
msgstr ""
|
420 |
-
|
421 |
-
#: classes/admin/class-pwb-admin-tab.php:92
|
422 |
-
msgid "Yes, after product loop"
|
423 |
-
msgstr ""
|
424 |
-
|
425 |
-
#: classes/admin/class-pwb-admin-tab.php:93
|
426 |
-
msgid "No, hide description"
|
427 |
-
msgstr ""
|
428 |
-
|
429 |
-
#: classes/admin/class-pwb-admin-tab.php:97
|
430 |
-
msgid "Single product tab"
|
431 |
-
msgstr ""
|
432 |
-
|
433 |
-
#: classes/admin/class-pwb-admin-tab.php:100
|
434 |
-
msgid "Show brand tab in single product page"
|
435 |
-
msgstr ""
|
436 |
-
|
437 |
-
#: classes/admin/class-pwb-admin-tab.php:104
|
438 |
-
msgid "Show brands in loop"
|
439 |
-
msgstr ""
|
440 |
-
|
441 |
-
#: classes/admin/class-pwb-admin-tab.php:107
|
442 |
-
msgid "Show brand logo (or name) in product loop"
|
443 |
-
msgstr ""
|
444 |
-
|
445 |
-
#: classes/admin/class-pwb-admin-tab.php:110
|
446 |
-
#: classes/admin/class-pwb-admin-tab.php:123
|
447 |
-
msgid "No"
|
448 |
-
msgstr ""
|
449 |
-
|
450 |
-
#: classes/admin/class-pwb-admin-tab.php:111
|
451 |
-
#: classes/admin/class-pwb-admin-tab.php:124
|
452 |
-
msgid "Show brand link"
|
453 |
-
msgstr ""
|
454 |
-
|
455 |
-
#: classes/admin/class-pwb-admin-tab.php:112
|
456 |
-
#: classes/admin/class-pwb-admin-tab.php:125
|
457 |
-
msgid "Show brand image (if is set)"
|
458 |
-
msgstr ""
|
459 |
-
|
460 |
-
#: classes/admin/class-pwb-admin-tab.php:116
|
461 |
-
msgid "Show brands in single product"
|
462 |
-
msgstr ""
|
463 |
-
|
464 |
-
#: classes/admin/class-pwb-admin-tab.php:119
|
465 |
-
msgid "Show brand logo (or name) in single product"
|
466 |
-
msgstr ""
|
467 |
-
|
468 |
-
#: classes/admin/class-pwb-admin-tab.php:137
|
469 |
-
msgid "Brand position"
|
470 |
-
msgstr ""
|
471 |
-
|
472 |
-
#: classes/admin/class-pwb-admin-tab.php:140
|
473 |
-
msgid "For single product"
|
474 |
-
msgstr ""
|
475 |
-
|
476 |
-
#: classes/admin/class-pwb-admin-tab.php:143
|
477 |
-
msgid "Before title"
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: classes/admin/class-pwb-admin-tab.php:144
|
481 |
-
msgid "After title"
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: classes/admin/class-pwb-admin-tab.php:145
|
485 |
-
msgid "After price"
|
486 |
-
msgstr ""
|
487 |
-
|
488 |
-
#: classes/admin/class-pwb-admin-tab.php:146
|
489 |
-
msgid "After excerpt"
|
490 |
-
msgstr ""
|
491 |
-
|
492 |
-
#: classes/admin/class-pwb-admin-tab.php:147
|
493 |
-
msgid "After add to cart"
|
494 |
-
msgstr ""
|
495 |
-
|
496 |
-
#: classes/admin/class-pwb-admin-tab.php:148
|
497 |
-
msgid "After meta"
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: classes/admin/class-pwb-admin-tab.php:149
|
501 |
-
msgid "After sharing"
|
502 |
-
msgstr ""
|
503 |
-
|
504 |
-
#: classes/admin/class-pwb-admin-tab.php:153
|
505 |
-
msgid "Brands page"
|
506 |
-
msgstr ""
|
507 |
-
|
508 |
-
#: classes/admin/class-pwb-admin-tab.php:156
|
509 |
-
msgid "For linking breadcrumbs"
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#: classes/admin/class-pwb-admin-tab.php:173
|
513 |
-
msgid "Tools"
|
514 |
-
msgstr ""
|
515 |
-
|
516 |
-
#: classes/admin/class-pwb-admin-tab.php:179
|
517 |
-
#: templates/admin/brands-exporter.php:16
|
518 |
-
msgid "Import brands"
|
519 |
-
msgstr ""
|
520 |
-
|
521 |
-
#: classes/admin/class-pwb-admin-tab.php:183
|
522 |
-
#, php-format
|
523 |
-
msgid ""
|
524 |
-
"Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
|
525 |
-
"\">Click here for more details</a>"
|
526 |
-
msgstr ""
|
527 |
-
|
528 |
-
#: classes/admin/class-pwb-admin-tab.php:188
|
529 |
-
#: classes/admin/class-pwb-admin-tab.php:201
|
530 |
-
msgid "-"
|
531 |
-
msgstr ""
|
532 |
-
|
533 |
-
#: classes/admin/class-pwb-admin-tab.php:189
|
534 |
-
msgid "YITH WooCommerce Brands Add-On"
|
535 |
-
msgstr ""
|
536 |
-
|
537 |
-
#: classes/admin/class-pwb-admin-tab.php:190
|
538 |
-
msgid "Ultimate WooCommerce Brands"
|
539 |
-
msgstr ""
|
540 |
-
|
541 |
-
#: classes/admin/class-pwb-admin-tab.php:191
|
542 |
-
msgid "Offical WooCommerce Brands"
|
543 |
-
msgstr ""
|
544 |
-
|
545 |
-
#: classes/admin/class-pwb-admin-tab.php:195
|
546 |
-
msgid "Dummy data"
|
547 |
-
msgstr ""
|
548 |
-
|
549 |
-
#: classes/admin/class-pwb-admin-tab.php:198
|
550 |
-
msgid "Import generic brands and assign it to products randomly"
|
551 |
-
msgstr ""
|
552 |
-
|
553 |
-
#: classes/admin/class-pwb-admin-tab.php:202
|
554 |
-
msgid "Start import"
|
555 |
-
msgstr ""
|
556 |
-
|
557 |
-
#: classes/admin/class-pwb-admin-tab.php:206
|
558 |
-
msgid "System status"
|
559 |
-
msgstr ""
|
560 |
-
|
561 |
-
#: classes/admin/class-pwb-admin-tab.php:208
|
562 |
-
msgid "Show system status"
|
563 |
-
msgstr ""
|
564 |
-
|
565 |
-
#: classes/admin/class-pwb-coupon.php:24
|
566 |
-
msgid "Brands restriction"
|
567 |
-
msgstr ""
|
568 |
-
|
569 |
-
#: classes/admin/class-pwb-coupon.php:25
|
570 |
-
msgid "Any brand"
|
571 |
-
msgstr ""
|
572 |
-
|
573 |
-
#: classes/admin/class-pwb-coupon.php:34
|
574 |
-
msgid ""
|
575 |
-
"Coupon will be valid if there are at least one product of this brands in the "
|
576 |
-
"cart"
|
577 |
-
msgstr ""
|
578 |
-
|
579 |
-
#: classes/shortcodes/class-pwb-all-brands.php:108
|
580 |
-
msgid "First page"
|
581 |
-
msgstr ""
|
582 |
-
|
583 |
-
#: classes/shortcodes/class-pwb-all-brands.php:111
|
584 |
-
msgid "Previous page"
|
585 |
-
msgstr ""
|
586 |
-
|
587 |
-
#: classes/shortcodes/class-pwb-all-brands.php:115
|
588 |
-
msgid "Next page"
|
589 |
-
msgstr ""
|
590 |
-
|
591 |
-
#: classes/shortcodes/class-pwb-all-brands.php:118
|
592 |
-
msgid "Last page"
|
593 |
-
msgstr ""
|
594 |
-
|
595 |
-
#: classes/shortcodes/class-pwb-all-brands.php:123
|
596 |
-
msgid "No results"
|
597 |
-
msgstr ""
|
598 |
-
|
599 |
-
#: classes/widgets/class-pwb-dropdown.php:10
|
600 |
-
msgid "Adds a brands dropdown to your site"
|
601 |
-
msgstr ""
|
602 |
-
|
603 |
-
#: classes/widgets/class-pwb-dropdown.php:11
|
604 |
-
msgid "Brands dropdown"
|
605 |
-
msgstr ""
|
606 |
-
|
607 |
-
#: classes/widgets/class-pwb-dropdown.php:26
|
608 |
-
msgid "Title"
|
609 |
-
msgstr ""
|
610 |
-
|
611 |
-
#: classes/widgets/class-pwb-dropdown.php:54
|
612 |
-
#: classes/widgets/class-pwb-list.php:77
|
613 |
-
msgid "Only favorite brands"
|
614 |
-
msgstr ""
|
615 |
-
|
616 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:11
|
617 |
-
msgid "Recommended for product categories or shop page"
|
618 |
-
msgstr ""
|
619 |
-
|
620 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:12
|
621 |
-
msgid "Filter products by brand"
|
622 |
-
msgstr ""
|
623 |
-
|
624 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:25
|
625 |
-
#: classes/widgets/class-pwb-list.php:28
|
626 |
-
msgid "Title:"
|
627 |
-
msgstr ""
|
628 |
-
|
629 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:30
|
630 |
-
msgid "Max number of brands"
|
631 |
-
msgstr ""
|
632 |
-
|
633 |
-
#: classes/widgets/class-pwb-filter-by-brand.php:41
|
634 |
-
msgid "Hide filter button"
|
635 |
-
msgstr ""
|
636 |
-
|
637 |
-
#: classes/widgets/class-pwb-list.php:10
|
638 |
-
msgid "Adds a brands list to your site"
|
639 |
-
msgstr ""
|
640 |
-
|
641 |
-
#: classes/widgets/class-pwb-list.php:11
|
642 |
-
msgid "Brands list"
|
643 |
-
msgstr ""
|
644 |
-
|
645 |
-
#: classes/widgets/class-pwb-list.php:37
|
646 |
-
msgid "Display as:"
|
647 |
-
msgstr ""
|
648 |
-
|
649 |
-
#: classes/widgets/class-pwb-list.php:42
|
650 |
-
msgid "Brand name"
|
651 |
-
msgstr ""
|
652 |
-
|
653 |
-
#: classes/widgets/class-pwb-list.php:47
|
654 |
-
msgid "Columns:"
|
655 |
-
msgstr ""
|
656 |
-
|
657 |
-
#: classes/widgets/class-pwb-list.php:87
|
658 |
-
msgid "Randomize"
|
659 |
-
msgstr ""
|
660 |
-
|
661 |
-
#: classes/widgets/class-pwb-list.php:119
|
662 |
-
msgid "Go to"
|
663 |
-
msgstr ""
|
664 |
-
|
665 |
-
#: templates/admin/brands-exporter.php:15
|
666 |
-
msgid "Export brands"
|
667 |
-
msgstr ""
|
668 |
-
|
669 |
-
#: templates/admin/brands-exporter.php:18
|
670 |
-
msgid ""
|
671 |
-
"This tool allows you to export and import the brands between different sites "
|
672 |
-
"using PWB."
|
673 |
-
msgstr ""
|
674 |
-
|
675 |
-
#: templates/shortcodes/carousel.php:24
|
676 |
-
#: templates/shortcodes/product-carousel.php:28
|
677 |
-
msgid "Loading"
|
678 |
-
msgstr ""
|
679 |
-
|
680 |
-
#: templates/shortcodes/product-carousel.php:34
|
681 |
-
msgid "Nothing found"
|
682 |
-
msgstr ""
|
683 |
-
|
684 |
-
#: templates/widgets/filter-by-brand.php:25
|
685 |
-
msgid "Apply filter"
|
686 |
-
msgstr ""
|
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-11-29 00:11+0100\n"
|
12 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\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 |
+
|
20 |
+
#: main.php:106
|
21 |
+
msgid ""
|
22 |
+
"Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
|
23 |
+
"active WooCommerce plugin."
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: classes/class-perfect-woocommerce-brands.php:52
|
27 |
+
msgid ""
|
28 |
+
"We know that you´re in love with Perfect WooCommerce Brands, you can help us "
|
29 |
+
"making it a bit better. Thanks a lot!"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: classes/class-perfect-woocommerce-brands.php:54
|
33 |
+
msgid ""
|
34 |
+
"<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
|
35 |
+
"reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: classes/class-perfect-woocommerce-brands.php:55
|
39 |
+
msgid ""
|
40 |
+
"<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
|
41 |
+
"woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: classes/class-perfect-woocommerce-brands.php:56
|
45 |
+
msgid ""
|
46 |
+
"<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
|
47 |
+
"\"_blank\">View on GitHub</a>"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: classes/class-perfect-woocommerce-brands.php:79
|
51 |
+
msgid "Settings"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: classes/class-perfect-woocommerce-brands.php:280
|
55 |
+
msgid "PWB Product carousel"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: classes/class-perfect-woocommerce-brands.php:281
|
59 |
+
msgid "Product carousel by brand or by category"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: classes/class-perfect-woocommerce-brands.php:289
|
63 |
+
#: classes/class-perfect-woocommerce-brands.php:611
|
64 |
+
#: classes/class-pwb-product-tab.php:18 classes/class-pwb-product-tab.php:35
|
65 |
+
#: classes/admin/class-pwb-exporter-support.php:22
|
66 |
+
#: classes/admin/class-pwb-importer-support.php:22
|
67 |
+
#: classes/admin/class-pwb-importer-support.php:33
|
68 |
+
msgid "Brand"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: classes/class-perfect-woocommerce-brands.php:297
|
72 |
+
msgid "Products"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: classes/class-perfect-woocommerce-brands.php:300
|
76 |
+
msgid "Number of products to load"
|
77 |
+
msgstr ""
|
78 |
+
|
79 |
+
#: classes/class-perfect-woocommerce-brands.php:305
|
80 |
+
msgid "Products to show"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: classes/class-perfect-woocommerce-brands.php:308
|
84 |
+
msgid "Number of products to show"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: classes/class-perfect-woocommerce-brands.php:313
|
88 |
+
msgid "Products to scroll"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: classes/class-perfect-woocommerce-brands.php:316
|
92 |
+
msgid "Number of products to scroll"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: classes/class-perfect-woocommerce-brands.php:321
|
96 |
+
#: classes/class-perfect-woocommerce-brands.php:370
|
97 |
+
msgid "Autoplay"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: classes/class-perfect-woocommerce-brands.php:323
|
101 |
+
#: classes/class-perfect-woocommerce-brands.php:372
|
102 |
+
msgid "Autoplay carousel"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: classes/class-perfect-woocommerce-brands.php:328
|
106 |
+
#: classes/class-perfect-woocommerce-brands.php:377
|
107 |
+
msgid "Arrows"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: classes/class-perfect-woocommerce-brands.php:330
|
111 |
+
#: classes/class-perfect-woocommerce-brands.php:379
|
112 |
+
msgid "Display prev and next arrows"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: classes/class-perfect-woocommerce-brands.php:336
|
116 |
+
msgid "PWB Brands carousel"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: classes/class-perfect-woocommerce-brands.php:337
|
120 |
+
msgid "Brands carousel"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: classes/class-perfect-woocommerce-brands.php:346
|
124 |
+
msgid "Items"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: classes/class-perfect-woocommerce-brands.php:349
|
128 |
+
msgid "Number of items to load (or 'featured')"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: classes/class-perfect-woocommerce-brands.php:354
|
132 |
+
msgid "Items to show"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: classes/class-perfect-woocommerce-brands.php:357
|
136 |
+
msgid "Number of items to show"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: classes/class-perfect-woocommerce-brands.php:362
|
140 |
+
msgid "Items to scroll"
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: classes/class-perfect-woocommerce-brands.php:365
|
144 |
+
msgid "Number of items to scroll"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: classes/class-perfect-woocommerce-brands.php:383
|
148 |
+
#: classes/class-perfect-woocommerce-brands.php:411
|
149 |
+
#: classes/class-perfect-woocommerce-brands.php:492
|
150 |
+
#: classes/admin/class-pwb-admin-tab.php:129
|
151 |
+
msgid "Brand logo size"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: classes/class-perfect-woocommerce-brands.php:394
|
155 |
+
msgid "PWB All brands"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: classes/class-perfect-woocommerce-brands.php:395
|
159 |
+
msgid "Show all brands"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: classes/class-perfect-woocommerce-brands.php:404
|
163 |
+
msgid "Brands per page"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: classes/class-perfect-woocommerce-brands.php:407
|
167 |
+
msgid "Show x brands per page"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: classes/class-perfect-woocommerce-brands.php:418
|
171 |
+
msgid "Order by"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: classes/class-perfect-woocommerce-brands.php:432
|
175 |
+
msgid "Order"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: classes/class-perfect-woocommerce-brands.php:442
|
179 |
+
msgid "Title position"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: classes/class-perfect-woocommerce-brands.php:446
|
183 |
+
msgid "Before image"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: classes/class-perfect-woocommerce-brands.php:447
|
187 |
+
msgid "After image"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: classes/class-perfect-woocommerce-brands.php:448
|
191 |
+
msgid "Hide"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: classes/class-perfect-woocommerce-brands.php:454
|
195 |
+
#: classes/widgets/class-pwb-dropdown.php:43
|
196 |
+
#: classes/widgets/class-pwb-list.php:67
|
197 |
+
msgid "Hide empty"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
+
#: classes/class-perfect-woocommerce-brands.php:456
|
201 |
+
msgid "Hide brands that have not been assigned to any product"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: classes/class-perfect-woocommerce-brands.php:464
|
205 |
+
msgid "PWB AZ Listing"
|
206 |
+
msgstr ""
|
207 |
+
|
208 |
+
#: classes/class-perfect-woocommerce-brands.php:465
|
209 |
+
msgid "AZ Listing for brands"
|
210 |
+
msgstr ""
|
211 |
+
|
212 |
+
#: classes/class-perfect-woocommerce-brands.php:474
|
213 |
+
msgid "PWB brand"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: classes/class-perfect-woocommerce-brands.php:475
|
217 |
+
msgid "Show brand for a specific product"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: classes/class-perfect-woocommerce-brands.php:485
|
221 |
+
msgid "Product id"
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: classes/class-perfect-woocommerce-brands.php:488
|
225 |
+
msgid "Product id (post id)"
|
226 |
+
msgstr ""
|
227 |
+
|
228 |
+
#: classes/class-perfect-woocommerce-brands.php:533
|
229 |
+
#: classes/shortcodes/class-pwb-brand.php:29
|
230 |
+
#: classes/shortcodes/class-pwb-brand.php:31
|
231 |
+
msgid "View brand"
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: classes/class-perfect-woocommerce-brands.php:598
|
235 |
+
msgid "¿Start migration?"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: classes/class-perfect-woocommerce-brands.php:599
|
239 |
+
msgid ""
|
240 |
+
"We are migrating the product brands. ¡Don´t close this window until the "
|
241 |
+
"process is finished!"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: classes/class-perfect-woocommerce-brands.php:600
|
245 |
+
msgid "¿Start loading dummy data?"
|
246 |
+
msgstr ""
|
247 |
+
|
248 |
+
#: classes/class-perfect-woocommerce-brands.php:601
|
249 |
+
msgid ""
|
250 |
+
"We are importing the dummy data. ¡Don´t close this window until the process "
|
251 |
+
"is finished!"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: classes/class-perfect-woocommerce-brands.php:610
|
255 |
+
#: classes/class-perfect-woocommerce-brands.php:612
|
256 |
+
#: classes/admin/class-edit-brands-page.php:128
|
257 |
+
#: classes/admin/class-pwb-admin-tab.php:21
|
258 |
+
#: classes/widgets/class-pwb-dropdown.php:19
|
259 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:20
|
260 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:75
|
261 |
+
#: classes/widgets/class-pwb-list.php:19 templates/widgets/dropdown.php:16
|
262 |
+
msgid "Brands"
|
263 |
+
msgstr ""
|
264 |
+
|
265 |
+
#: classes/class-perfect-woocommerce-brands.php:613
|
266 |
+
msgid "All Brands"
|
267 |
+
msgstr ""
|
268 |
+
|
269 |
+
#: classes/class-perfect-woocommerce-brands.php:614
|
270 |
+
msgid "Edit Brand"
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: classes/class-perfect-woocommerce-brands.php:615
|
274 |
+
msgid "View Brand"
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: classes/class-perfect-woocommerce-brands.php:616
|
278 |
+
msgid "Update Brand"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: classes/class-perfect-woocommerce-brands.php:617
|
282 |
+
msgid "Add New Brand"
|
283 |
+
msgstr ""
|
284 |
+
|
285 |
+
#: classes/class-perfect-woocommerce-brands.php:618
|
286 |
+
msgid "New Brand Name"
|
287 |
+
msgstr ""
|
288 |
+
|
289 |
+
#: classes/class-perfect-woocommerce-brands.php:619
|
290 |
+
msgid "Parent Brand"
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#: classes/class-perfect-woocommerce-brands.php:620
|
294 |
+
msgid "Parent Brand:"
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
#: classes/class-perfect-woocommerce-brands.php:621
|
298 |
+
msgid "Search Brands"
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: classes/class-perfect-woocommerce-brands.php:622
|
302 |
+
msgid "Popular Brands"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: classes/class-perfect-woocommerce-brands.php:623
|
306 |
+
msgid "Separate brands with commas"
|
307 |
+
msgstr ""
|
308 |
+
|
309 |
+
#: classes/class-perfect-woocommerce-brands.php:624
|
310 |
+
msgid "Add or remove brands"
|
311 |
+
msgstr ""
|
312 |
+
|
313 |
+
#: classes/class-perfect-woocommerce-brands.php:625
|
314 |
+
msgid "Choose from the most used brands"
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: classes/class-perfect-woocommerce-brands.php:626
|
318 |
+
msgid "No brands found"
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
#: classes/class-perfect-woocommerce-brands.php:697
|
322 |
+
msgid "All"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: classes/class-pwb-api-support.php:87
|
326 |
+
msgid "Product brands"
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: classes/class-pwb-term.php:20
|
330 |
+
msgid "Only WP_Term objects are allowed"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: classes/admin/class-brands-custom-fields.php:20
|
334 |
+
#: classes/admin/class-brands-custom-fields.php:59
|
335 |
+
msgid "Description"
|
336 |
+
msgstr ""
|
337 |
+
|
338 |
+
#: classes/admin/class-brands-custom-fields.php:22
|
339 |
+
#: classes/admin/class-brands-custom-fields.php:63
|
340 |
+
msgid ""
|
341 |
+
"Brand description for the archive pages. You can include some html markup "
|
342 |
+
"and shortcodes."
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: classes/admin/class-brands-custom-fields.php:26
|
346 |
+
#: classes/admin/class-brands-custom-fields.php:68
|
347 |
+
#: classes/widgets/class-pwb-list.php:43
|
348 |
+
msgid "Brand logo"
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: classes/admin/class-brands-custom-fields.php:28
|
352 |
+
#: classes/admin/class-brands-custom-fields.php:34
|
353 |
+
#: classes/admin/class-brands-custom-fields.php:72
|
354 |
+
#: classes/admin/class-brands-custom-fields.php:92
|
355 |
+
msgid "Select image"
|
356 |
+
msgstr ""
|
357 |
+
|
358 |
+
#: classes/admin/class-brands-custom-fields.php:32
|
359 |
+
#: classes/admin/class-brands-custom-fields.php:88
|
360 |
+
msgid "Brand banner"
|
361 |
+
msgstr ""
|
362 |
+
|
363 |
+
#: classes/admin/class-brands-custom-fields.php:35
|
364 |
+
msgid "This image will be shown on brand page"
|
365 |
+
msgstr ""
|
366 |
+
|
367 |
+
#: classes/admin/class-brands-custom-fields.php:39
|
368 |
+
#: classes/admin/class-brands-custom-fields.php:108
|
369 |
+
msgid "Brand banner link"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: classes/admin/class-brands-custom-fields.php:41
|
373 |
+
#: classes/admin/class-brands-custom-fields.php:112
|
374 |
+
msgid "This link should be relative to site url. Example: product/product-name"
|
375 |
+
msgstr ""
|
376 |
+
|
377 |
+
#: classes/admin/class-edit-brands-page.php:39
|
378 |
+
msgid "featured"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
#: classes/admin/class-edit-brands-page.php:74
|
382 |
+
msgid "Logo"
|
383 |
+
msgstr ""
|
384 |
+
|
385 |
+
#: classes/admin/class-edit-brands-page.php:96
|
386 |
+
msgid "Set as featured"
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: classes/admin/class-edit-brands-page.php:118
|
390 |
+
msgid "Error!"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: classes/admin/class-edit-brands-page.php:131
|
394 |
+
msgid "Show featured brands first"
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: classes/admin/class-pwb-admin-tab.php:70
|
398 |
+
msgid "Brands settings"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: classes/admin/class-pwb-admin-tab.php:76
|
402 |
+
msgid "Slug"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: classes/admin/class-pwb-admin-tab.php:79
|
406 |
+
msgid "Brands taxonomy slug"
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: classes/admin/class-pwb-admin-tab.php:84
|
410 |
+
msgid "Show brand description"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: classes/admin/class-pwb-admin-tab.php:88
|
414 |
+
msgid "Show brand description (if is set) on brand archive page"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
#: classes/admin/class-pwb-admin-tab.php:91
|
418 |
+
msgid "Yes, before product loop"
|
419 |
+
msgstr ""
|
420 |
+
|
421 |
+
#: classes/admin/class-pwb-admin-tab.php:92
|
422 |
+
msgid "Yes, after product loop"
|
423 |
+
msgstr ""
|
424 |
+
|
425 |
+
#: classes/admin/class-pwb-admin-tab.php:93
|
426 |
+
msgid "No, hide description"
|
427 |
+
msgstr ""
|
428 |
+
|
429 |
+
#: classes/admin/class-pwb-admin-tab.php:97
|
430 |
+
msgid "Single product tab"
|
431 |
+
msgstr ""
|
432 |
+
|
433 |
+
#: classes/admin/class-pwb-admin-tab.php:100
|
434 |
+
msgid "Show brand tab in single product page"
|
435 |
+
msgstr ""
|
436 |
+
|
437 |
+
#: classes/admin/class-pwb-admin-tab.php:104
|
438 |
+
msgid "Show brands in loop"
|
439 |
+
msgstr ""
|
440 |
+
|
441 |
+
#: classes/admin/class-pwb-admin-tab.php:107
|
442 |
+
msgid "Show brand logo (or name) in product loop"
|
443 |
+
msgstr ""
|
444 |
+
|
445 |
+
#: classes/admin/class-pwb-admin-tab.php:110
|
446 |
+
#: classes/admin/class-pwb-admin-tab.php:123
|
447 |
+
msgid "No"
|
448 |
+
msgstr ""
|
449 |
+
|
450 |
+
#: classes/admin/class-pwb-admin-tab.php:111
|
451 |
+
#: classes/admin/class-pwb-admin-tab.php:124
|
452 |
+
msgid "Show brand link"
|
453 |
+
msgstr ""
|
454 |
+
|
455 |
+
#: classes/admin/class-pwb-admin-tab.php:112
|
456 |
+
#: classes/admin/class-pwb-admin-tab.php:125
|
457 |
+
msgid "Show brand image (if is set)"
|
458 |
+
msgstr ""
|
459 |
+
|
460 |
+
#: classes/admin/class-pwb-admin-tab.php:116
|
461 |
+
msgid "Show brands in single product"
|
462 |
+
msgstr ""
|
463 |
+
|
464 |
+
#: classes/admin/class-pwb-admin-tab.php:119
|
465 |
+
msgid "Show brand logo (or name) in single product"
|
466 |
+
msgstr ""
|
467 |
+
|
468 |
+
#: classes/admin/class-pwb-admin-tab.php:137
|
469 |
+
msgid "Brand position"
|
470 |
+
msgstr ""
|
471 |
+
|
472 |
+
#: classes/admin/class-pwb-admin-tab.php:140
|
473 |
+
msgid "For single product"
|
474 |
+
msgstr ""
|
475 |
+
|
476 |
+
#: classes/admin/class-pwb-admin-tab.php:143
|
477 |
+
msgid "Before title"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
#: classes/admin/class-pwb-admin-tab.php:144
|
481 |
+
msgid "After title"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: classes/admin/class-pwb-admin-tab.php:145
|
485 |
+
msgid "After price"
|
486 |
+
msgstr ""
|
487 |
+
|
488 |
+
#: classes/admin/class-pwb-admin-tab.php:146
|
489 |
+
msgid "After excerpt"
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: classes/admin/class-pwb-admin-tab.php:147
|
493 |
+
msgid "After add to cart"
|
494 |
+
msgstr ""
|
495 |
+
|
496 |
+
#: classes/admin/class-pwb-admin-tab.php:148
|
497 |
+
msgid "After meta"
|
498 |
+
msgstr ""
|
499 |
+
|
500 |
+
#: classes/admin/class-pwb-admin-tab.php:149
|
501 |
+
msgid "After sharing"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
#: classes/admin/class-pwb-admin-tab.php:153
|
505 |
+
msgid "Brands page"
|
506 |
+
msgstr ""
|
507 |
+
|
508 |
+
#: classes/admin/class-pwb-admin-tab.php:156
|
509 |
+
msgid "For linking breadcrumbs"
|
510 |
+
msgstr ""
|
511 |
+
|
512 |
+
#: classes/admin/class-pwb-admin-tab.php:173
|
513 |
+
msgid "Tools"
|
514 |
+
msgstr ""
|
515 |
+
|
516 |
+
#: classes/admin/class-pwb-admin-tab.php:179
|
517 |
+
#: templates/admin/brands-exporter.php:16
|
518 |
+
msgid "Import brands"
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: classes/admin/class-pwb-admin-tab.php:183
|
522 |
+
#, php-format
|
523 |
+
msgid ""
|
524 |
+
"Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
|
525 |
+
"\">Click here for more details</a>"
|
526 |
+
msgstr ""
|
527 |
+
|
528 |
+
#: classes/admin/class-pwb-admin-tab.php:188
|
529 |
+
#: classes/admin/class-pwb-admin-tab.php:201
|
530 |
+
msgid "-"
|
531 |
+
msgstr ""
|
532 |
+
|
533 |
+
#: classes/admin/class-pwb-admin-tab.php:189
|
534 |
+
msgid "YITH WooCommerce Brands Add-On"
|
535 |
+
msgstr ""
|
536 |
+
|
537 |
+
#: classes/admin/class-pwb-admin-tab.php:190
|
538 |
+
msgid "Ultimate WooCommerce Brands"
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#: classes/admin/class-pwb-admin-tab.php:191
|
542 |
+
msgid "Offical WooCommerce Brands"
|
543 |
+
msgstr ""
|
544 |
+
|
545 |
+
#: classes/admin/class-pwb-admin-tab.php:195
|
546 |
+
msgid "Dummy data"
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
#: classes/admin/class-pwb-admin-tab.php:198
|
550 |
+
msgid "Import generic brands and assign it to products randomly"
|
551 |
+
msgstr ""
|
552 |
+
|
553 |
+
#: classes/admin/class-pwb-admin-tab.php:202
|
554 |
+
msgid "Start import"
|
555 |
+
msgstr ""
|
556 |
+
|
557 |
+
#: classes/admin/class-pwb-admin-tab.php:206
|
558 |
+
msgid "System status"
|
559 |
+
msgstr ""
|
560 |
+
|
561 |
+
#: classes/admin/class-pwb-admin-tab.php:208
|
562 |
+
msgid "Show system status"
|
563 |
+
msgstr ""
|
564 |
+
|
565 |
+
#: classes/admin/class-pwb-coupon.php:24
|
566 |
+
msgid "Brands restriction"
|
567 |
+
msgstr ""
|
568 |
+
|
569 |
+
#: classes/admin/class-pwb-coupon.php:25
|
570 |
+
msgid "Any brand"
|
571 |
+
msgstr ""
|
572 |
+
|
573 |
+
#: classes/admin/class-pwb-coupon.php:34
|
574 |
+
msgid ""
|
575 |
+
"Coupon will be valid if there are at least one product of this brands in the "
|
576 |
+
"cart"
|
577 |
+
msgstr ""
|
578 |
+
|
579 |
+
#: classes/shortcodes/class-pwb-all-brands.php:108
|
580 |
+
msgid "First page"
|
581 |
+
msgstr ""
|
582 |
+
|
583 |
+
#: classes/shortcodes/class-pwb-all-brands.php:111
|
584 |
+
msgid "Previous page"
|
585 |
+
msgstr ""
|
586 |
+
|
587 |
+
#: classes/shortcodes/class-pwb-all-brands.php:115
|
588 |
+
msgid "Next page"
|
589 |
+
msgstr ""
|
590 |
+
|
591 |
+
#: classes/shortcodes/class-pwb-all-brands.php:118
|
592 |
+
msgid "Last page"
|
593 |
+
msgstr ""
|
594 |
+
|
595 |
+
#: classes/shortcodes/class-pwb-all-brands.php:123
|
596 |
+
msgid "No results"
|
597 |
+
msgstr ""
|
598 |
+
|
599 |
+
#: classes/widgets/class-pwb-dropdown.php:10
|
600 |
+
msgid "Adds a brands dropdown to your site"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: classes/widgets/class-pwb-dropdown.php:11
|
604 |
+
msgid "Brands dropdown"
|
605 |
+
msgstr ""
|
606 |
+
|
607 |
+
#: classes/widgets/class-pwb-dropdown.php:26
|
608 |
+
msgid "Title"
|
609 |
+
msgstr ""
|
610 |
+
|
611 |
+
#: classes/widgets/class-pwb-dropdown.php:54
|
612 |
+
#: classes/widgets/class-pwb-list.php:77
|
613 |
+
msgid "Only favorite brands"
|
614 |
+
msgstr ""
|
615 |
+
|
616 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:11
|
617 |
+
msgid "Recommended for product categories or shop page"
|
618 |
+
msgstr ""
|
619 |
+
|
620 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:12
|
621 |
+
msgid "Filter products by brand"
|
622 |
+
msgstr ""
|
623 |
+
|
624 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:25
|
625 |
+
#: classes/widgets/class-pwb-list.php:28
|
626 |
+
msgid "Title:"
|
627 |
+
msgstr ""
|
628 |
+
|
629 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:30
|
630 |
+
msgid "Max number of brands"
|
631 |
+
msgstr ""
|
632 |
+
|
633 |
+
#: classes/widgets/class-pwb-filter-by-brand.php:41
|
634 |
+
msgid "Hide filter button"
|
635 |
+
msgstr ""
|
636 |
+
|
637 |
+
#: classes/widgets/class-pwb-list.php:10
|
638 |
+
msgid "Adds a brands list to your site"
|
639 |
+
msgstr ""
|
640 |
+
|
641 |
+
#: classes/widgets/class-pwb-list.php:11
|
642 |
+
msgid "Brands list"
|
643 |
+
msgstr ""
|
644 |
+
|
645 |
+
#: classes/widgets/class-pwb-list.php:37
|
646 |
+
msgid "Display as:"
|
647 |
+
msgstr ""
|
648 |
+
|
649 |
+
#: classes/widgets/class-pwb-list.php:42
|
650 |
+
msgid "Brand name"
|
651 |
+
msgstr ""
|
652 |
+
|
653 |
+
#: classes/widgets/class-pwb-list.php:47
|
654 |
+
msgid "Columns:"
|
655 |
+
msgstr ""
|
656 |
+
|
657 |
+
#: classes/widgets/class-pwb-list.php:87
|
658 |
+
msgid "Randomize"
|
659 |
+
msgstr ""
|
660 |
+
|
661 |
+
#: classes/widgets/class-pwb-list.php:119
|
662 |
+
msgid "Go to"
|
663 |
+
msgstr ""
|
664 |
+
|
665 |
+
#: templates/admin/brands-exporter.php:15
|
666 |
+
msgid "Export brands"
|
667 |
+
msgstr ""
|
668 |
+
|
669 |
+
#: templates/admin/brands-exporter.php:18
|
670 |
+
msgid ""
|
671 |
+
"This tool allows you to export and import the brands between different sites "
|
672 |
+
"using PWB."
|
673 |
+
msgstr ""
|
674 |
+
|
675 |
+
#: templates/shortcodes/carousel.php:24
|
676 |
+
#: templates/shortcodes/product-carousel.php:28
|
677 |
+
msgid "Loading"
|
678 |
+
msgstr ""
|
679 |
+
|
680 |
+
#: templates/shortcodes/product-carousel.php:34
|
681 |
+
msgid "Nothing found"
|
682 |
+
msgstr ""
|
683 |
+
|
684 |
+
#: templates/widgets/filter-by-brand.php:25
|
685 |
+
msgid "Apply filter"
|
686 |
+
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.7.
|
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.7.
|
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: 3.1.0
|
26 |
-
* WC tested up to:
|
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.7.
|
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/class-pwb-term.php';
|
59 |
-
require 'classes/widgets/class-pwb-dropdown.php';
|
60 |
-
require 'classes/widgets/class-pwb-list.php';
|
61 |
-
require 'classes/widgets/class-pwb-filter-by-brand.php';
|
62 |
-
require 'classes/shortcodes/class-pwb-product-carousel.php';
|
63 |
-
require 'classes/shortcodes/class-pwb-carousel.php';
|
64 |
-
require 'classes/shortcodes/class-pwb-all-brands.php';
|
65 |
-
require 'classes/shortcodes/class-pwb-az-listing.php';
|
66 |
-
require 'classes/shortcodes/class-pwb-brand.php';
|
67 |
-
require 'classes/class-perfect-woocommerce-brands.php';
|
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 |
-
if( is_admin() ){
|
74 |
-
|
75 |
-
require 'classes/admin/class-pwb-system-status.php';
|
76 |
-
new Admin\PWB_System_Status();
|
77 |
-
require 'classes/admin/class-pwb-admin-tab.php';
|
78 |
-
require 'classes/admin/class-pwb-migrate.php';
|
79 |
-
new Admin\PWB_Migrate();
|
80 |
-
require 'classes/admin/class-pwb-dummy-data.php';
|
81 |
-
new Admin\PWB_Dummy_Data();
|
82 |
-
require 'classes/admin/class-edit-brands-page.php';
|
83 |
-
new Admin\Edit_Brands_Page();
|
84 |
-
require 'classes/admin/class-brands-custom-fields.php';
|
85 |
-
new Admin\Brands_Custom_Fields();
|
86 |
-
require 'classes/admin/class-brands-exporter.php';
|
87 |
-
new Admin\Brands_Exporter();
|
88 |
-
require 'classes/admin/class-pwb-importer-support.php';
|
89 |
-
new PWB_Importer_Support();
|
90 |
-
require 'classes/admin/class-pwb-exporter-support.php';
|
91 |
-
new PWB_Exporter_Support();
|
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.7.9
|
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.7.9, Copyright (C) 2019 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: 3.1.0
|
26 |
+
* WC tested up to: 4.0
|
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.7.9' );
|
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/class-pwb-term.php';
|
59 |
+
require 'classes/widgets/class-pwb-dropdown.php';
|
60 |
+
require 'classes/widgets/class-pwb-list.php';
|
61 |
+
require 'classes/widgets/class-pwb-filter-by-brand.php';
|
62 |
+
require 'classes/shortcodes/class-pwb-product-carousel.php';
|
63 |
+
require 'classes/shortcodes/class-pwb-carousel.php';
|
64 |
+
require 'classes/shortcodes/class-pwb-all-brands.php';
|
65 |
+
require 'classes/shortcodes/class-pwb-az-listing.php';
|
66 |
+
require 'classes/shortcodes/class-pwb-brand.php';
|
67 |
+
require 'classes/class-perfect-woocommerce-brands.php';
|
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 |
+
if( is_admin() ){
|
74 |
+
|
75 |
+
require 'classes/admin/class-pwb-system-status.php';
|
76 |
+
new Admin\PWB_System_Status();
|
77 |
+
require 'classes/admin/class-pwb-admin-tab.php';
|
78 |
+
require 'classes/admin/class-pwb-migrate.php';
|
79 |
+
new Admin\PWB_Migrate();
|
80 |
+
require 'classes/admin/class-pwb-dummy-data.php';
|
81 |
+
new Admin\PWB_Dummy_Data();
|
82 |
+
require 'classes/admin/class-edit-brands-page.php';
|
83 |
+
new Admin\Edit_Brands_Page();
|
84 |
+
require 'classes/admin/class-brands-custom-fields.php';
|
85 |
+
new Admin\Brands_Custom_Fields();
|
86 |
+
require 'classes/admin/class-brands-exporter.php';
|
87 |
+
new Admin\Brands_Exporter();
|
88 |
+
require 'classes/admin/class-pwb-importer-support.php';
|
89 |
+
new PWB_Importer_Support();
|
90 |
+
require 'classes/admin/class-pwb-exporter-support.php';
|
91 |
+
new PWB_Exporter_Support();
|
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,186 +1,148 @@
|
|
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.7
|
6 |
-
Tested up to: 5.3
|
7 |
-
Requires PHP: 5.6
|
8 |
-
Stable tag: 1.7.
|
9 |
-
License: GPL3
|
10 |
-
License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
-
|
12 |
-
Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
|
13 |
-
|
14 |
-
== Description ==
|
15 |
-
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.
|
16 |
-
Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
|
17 |
-
With this extension you can add product brands to your WooCommerce site.
|
18 |
-
|
19 |
-
= Requirements =
|
20 |
-
> * PHP 5.6 or higher (PHP7 recommended)
|
21 |
-
> * WordPress 4.7 or higher
|
22 |
-
> * WooCommerce 3.1.0 or higher
|
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
|
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 |
-
> * Shortcode: A-Z Listing
|
37 |
-
> * Widget: Display brands as dropdown
|
38 |
-
> * Widget: Display brands as list (brand names or brand logos)
|
39 |
-
> * Widget: Filter products by brand
|
40 |
-
> * Customizable brands slug
|
41 |
-
> * Show the brands in products loop
|
42 |
-
> * Import brands (migrate) from other brands plugins
|
43 |
-
> * Dummy data installer (logos by heroturko)
|
44 |
-
> * WooCommerce REST API support
|
45 |
-
> * WooCommerce built-in product importer/exporter support
|
46 |
-
> * Brand tab for single product page
|
47 |
-
> * Favorite brands
|
48 |
-
> * Brands json import/export
|
49 |
-
> * Brand structured data
|
50 |
-
> * And much more!
|
51 |
-
|
52 |
-
|
53 |
-
== Installation ==
|
54 |
-
1. Upload the plugin to the '/wp-content/plugins/' directory.
|
55 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
56 |
-
|
57 |
-
|
58 |
-
== Frequently Asked Questions ==
|
59 |
-
= Is Perfect WooCommerce Brands free? =
|
60 |
-
Yes, of course. This plugin is 100% free. No ads, no premium version exists.
|
61 |
-
|
62 |
-
= Where are the plugin settings? =
|
63 |
-
Go to `WooCommerce/Settings/` and click on `Brands` tab
|
64 |
-
|
65 |
-
= 404 error on brand pages =
|
66 |
-
Go to `Settings/Permalinks` and click on `Save Changes` button to flush the permalinks
|
67 |
-
|
68 |
-
= PWB is awesome! Can I contribute? =
|
69 |
-
Yes you can! Join in on our [GitHub repository](https://github.com/titodevera/perfect-woocommerce-brands) 🙂
|
70 |
-
You can also contribute [translating the plugin](https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands/)
|
71 |
-
|
72 |
-
= Developer Documentation =
|
73 |
-
[Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki)
|
74 |
-
|
75 |
-
== Screenshots ==
|
76 |
-
1. Brands carousel
|
77 |
-
2. Brands page
|
78 |
-
3. Brands taxonomy
|
79 |
-
4. Brands shortcodes (with Visual Composer)
|
80 |
-
5. Product carousel by brand
|
81 |
-
|
82 |
-
|
83 |
-
== Changelog ==
|
84 |
-
= 1.7.
|
85 |
-
* Fix:
|
86 |
-
*
|
87 |
-
* Feature:
|
88 |
-
* Feature:
|
89 |
-
*
|
90 |
-
*
|
91 |
-
= 1.7.
|
92 |
-
*
|
93 |
-
*
|
94 |
-
*
|
95 |
-
*
|
96 |
-
* Dev: New filter hook "
|
97 |
-
*
|
98 |
-
|
99 |
-
|
100 |
-
*
|
101 |
-
*
|
102 |
-
*
|
103 |
-
*
|
104 |
-
|
105 |
-
*
|
106 |
-
= 1.7.
|
107 |
-
*
|
108 |
-
*
|
109 |
-
*
|
110 |
-
*
|
111 |
-
|
112 |
-
*
|
113 |
-
= 1.7.
|
114 |
-
*
|
115 |
-
*
|
116 |
-
|
117 |
-
*
|
118 |
-
*
|
119 |
-
*
|
120 |
-
|
121 |
-
|
122 |
-
*
|
123 |
-
|
124 |
-
*
|
125 |
-
*
|
126 |
-
*
|
127 |
-
*
|
128 |
-
|
129 |
-
*
|
130 |
-
|
131 |
-
*
|
132 |
-
*
|
133 |
-
*
|
134 |
-
*
|
135 |
-
*
|
136 |
-
*
|
137 |
-
|
138 |
-
*
|
139 |
-
*
|
140 |
-
*
|
141 |
-
*
|
142 |
-
|
143 |
-
*
|
144 |
-
*
|
145 |
-
*
|
146 |
-
*
|
147 |
-
*
|
148 |
-
*
|
149 |
-
* Enhancement: Hide widgets when there are no results to show
|
150 |
-
* Fix: "Dokan Multivendor Marketplace" JavaScript conflict in admin
|
151 |
-
= 1.6.4 =
|
152 |
-
* Feature: Visual editor with shortcode support added to brand description
|
153 |
-
* Feature: Hide empty brands in brand widgets
|
154 |
-
* Feature: Place brand description before or after product loop
|
155 |
-
* Fix: WC import not assigning brands
|
156 |
-
* Minor fixes and tweaks
|
157 |
-
= 1.6.3 =
|
158 |
-
* Requirements: No more longer support for very old php versions (5.4 minimum)
|
159 |
-
* Fix: Product carousels shortcode display fixes
|
160 |
-
* Fix: Missing .pot file
|
161 |
-
* Fix: Coupon codes stopped working since latest update
|
162 |
-
* Fix: Carousel preloader is not working
|
163 |
-
= 1.6.2 =
|
164 |
-
* Fix: Carousels problems on responsive after the last update
|
165 |
-
= 1.6.1 =
|
166 |
-
* Feature: Favorite brands
|
167 |
-
* Fix: Brand logo full size option for single product
|
168 |
-
* Fix: Coupons brands restriction (thanks @josk79)
|
169 |
-
* Fix: Import products fixes
|
170 |
-
* Fix: PHP7 warning on 'class-perfect-woocommerce-brands.php'
|
171 |
-
* Fix: Brand not added when Duplicating Product
|
172 |
-
* Enhancement: Filter by brand widget enhancements
|
173 |
-
* Enhancement: Carousels enhancements
|
174 |
-
* Enhancement: JS and CSS minified
|
175 |
-
= 1.6.0 =
|
176 |
-
* Feature: Migrate brands from the official WooCommerce Brand's plugin (pull request, thanks Chunkford)
|
177 |
-
* Feature: Support for the new WooCommerce product importer/exporter
|
178 |
-
* Feature: Brand tab in single product page
|
179 |
-
* Enhancement: Brands dropdown widget selects the current brand if is a brand archive page
|
180 |
-
* Enhancement: Hide the brand name in "Display all brands" shortcode (title_position="none")
|
181 |
-
* Enhancement: Important enhancements for the REST API
|
182 |
-
* Fix: The brand property is not recognized by Google
|
183 |
-
* Fix: No shortcode appeared in some Visual Composer versions
|
184 |
-
* Fix: Filter by brand widget fixes
|
185 |
-
* Fix: Brand description adds description twice
|
186 |
-
* Other minor bug fixes and code improvements
|
1 |
+
=== Perfect WooCommerce Brands ===
|
2 |
+
Contributors: quadlayers, 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.7
|
6 |
+
Tested up to: 5.3
|
7 |
+
Requires PHP: 5.6
|
8 |
+
Stable tag: 1.7.9
|
9 |
+
License: GPL3
|
10 |
+
License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
|
11 |
+
|
12 |
+
Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
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.
|
16 |
+
Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
|
17 |
+
With this extension you can add product brands to your WooCommerce site.
|
18 |
+
|
19 |
+
= Requirements =
|
20 |
+
> * PHP 5.6 or higher (PHP7 recommended)
|
21 |
+
> * WordPress 4.7 or higher
|
22 |
+
> * WooCommerce 3.1.0 or higher
|
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
|
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 |
+
> * Shortcode: A-Z Listing
|
37 |
+
> * Widget: Display brands as dropdown
|
38 |
+
> * Widget: Display brands as list (brand names or brand logos)
|
39 |
+
> * Widget: Filter products by brand
|
40 |
+
> * Customizable brands slug
|
41 |
+
> * Show the brands in products loop
|
42 |
+
> * Import brands (migrate) from other brands plugins
|
43 |
+
> * Dummy data installer (logos by heroturko)
|
44 |
+
> * WooCommerce REST API support
|
45 |
+
> * WooCommerce built-in product importer/exporter support
|
46 |
+
> * Brand tab for single product page
|
47 |
+
> * Favorite brands
|
48 |
+
> * Brands json import/export
|
49 |
+
> * Brand structured data
|
50 |
+
> * And much more!
|
51 |
+
|
52 |
+
|
53 |
+
== Installation ==
|
54 |
+
1. Upload the plugin to the '/wp-content/plugins/' directory.
|
55 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
56 |
+
|
57 |
+
|
58 |
+
== Frequently Asked Questions ==
|
59 |
+
= Is Perfect WooCommerce Brands free? =
|
60 |
+
Yes, of course. This plugin is 100% free. No ads, no premium version exists.
|
61 |
+
|
62 |
+
= Where are the plugin settings? =
|
63 |
+
Go to `WooCommerce/Settings/` and click on `Brands` tab
|
64 |
+
|
65 |
+
= 404 error on brand pages =
|
66 |
+
Go to `Settings/Permalinks` and click on `Save Changes` button to flush the permalinks
|
67 |
+
|
68 |
+
= PWB is awesome! Can I contribute? =
|
69 |
+
Yes you can! Join in on our [GitHub repository](https://github.com/titodevera/perfect-woocommerce-brands) 🙂
|
70 |
+
You can also contribute [translating the plugin](https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands/)
|
71 |
+
|
72 |
+
= Developer Documentation =
|
73 |
+
[Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki)
|
74 |
+
|
75 |
+
== Screenshots ==
|
76 |
+
1. Brands carousel
|
77 |
+
2. Brands page
|
78 |
+
3. Brands taxonomy
|
79 |
+
4. Brands shortcodes (with Visual Composer)
|
80 |
+
5. Product carousel by brand
|
81 |
+
|
82 |
+
|
83 |
+
== Changelog ==
|
84 |
+
= 1.7.9 =
|
85 |
+
* Fix: Breadcrumbs issues
|
86 |
+
* Fix: Ajax search plugins conflict since previous release
|
87 |
+
* Feature: New position option "in meta" for brands in the single product page
|
88 |
+
* Feature: New param "only_parents" for "pwb-az-listing"
|
89 |
+
* Enhancement: Sections for brands settings tab in admin
|
90 |
+
* Enhancement: "[pwb-az-listing]" transient for better performance in large sites
|
91 |
+
= 1.7.8 =
|
92 |
+
* Fix: Hidden products contribute towards product count for "pwb-all-brands" shortcode
|
93 |
+
* Enhancement: Replace hardcoded thumbnail size for product loops with selected size (thanks @orjhor)
|
94 |
+
* Feature: Redirect if the search matches with a brand name. Better product search experience.
|
95 |
+
* Feature: Add the possibility to filter by product category on product carousel shortcode (thanks @lasdou)
|
96 |
+
* Dev: New filter hook "pwb_html_before_brands_links"
|
97 |
+
* Tested on WooCommerce 3.9
|
98 |
+
= 1.7.7 =
|
99 |
+
* Enhancement: Better support for special characters in "AZ-Listing" shortcode
|
100 |
+
* Fix: Filter by brand widget shows incorrect brands under certain conditions
|
101 |
+
* Fix: Filter by brands in product tags pages and other product taxonomies
|
102 |
+
* Update: WC 3.8 compatibility
|
103 |
+
* Dev: New filter hook "pwb_text_before_brands_links"
|
104 |
+
* Dev: New filter hook "pwb_product_tab_brand_logo_size"
|
105 |
+
* Dev: "[pwb-az-listing]" and "[pwb-brand]" templates for theme overrides
|
106 |
+
= 1.7.6 =
|
107 |
+
* Tested up to, bump
|
108 |
+
* Dev: New filter hook "woocommerce_product_brand_heading" for editing the "Brand" tab heading
|
109 |
+
* Fix: Some problems with the "Brand" product tab
|
110 |
+
* Fix: Avoid a possible JS conflict caused by "wp_localize_script"
|
111 |
+
= 1.7.5 =
|
112 |
+
* Fix: Stupid JS error introduced in the previous version
|
113 |
+
= 1.7.4 =
|
114 |
+
* Fix: Mismatched columns when a brand is added
|
115 |
+
* Tweak: Disable brand tab when product not have brand
|
116 |
+
* Dev: New filter hook 'pwb_dropdown_placeholder'
|
117 |
+
* Dev: New filter hooks 'pwb_carousel_prev' and 'pwb_carousel_next' for customize the carousel arrows
|
118 |
+
* Dev: Override templates via a theme
|
119 |
+
* Minor fixes and tweaks
|
120 |
+
= 1.7.3 =
|
121 |
+
* Enhancement: Performance improvements
|
122 |
+
* Fix: Breadcrumbs doesn't take in account pagination
|
123 |
+
= 1.7.2 =
|
124 |
+
* Feature: Now is possible to use %pwb-brand% in the product URLs
|
125 |
+
* Fix: Fatal error in some themes (like Salient)
|
126 |
+
* Fix: Some php notices and warnings fixed
|
127 |
+
* Fix: Don't show brand description/banner in paged
|
128 |
+
= 1.7.1 =
|
129 |
+
* Feature: Extends the [products] shortcode to allow 'brands' attribute
|
130 |
+
* Feature: The brands column is sortable now
|
131 |
+
* Catalan translation (thanks to Lluisma)
|
132 |
+
* Enhancement: Easier select brands page link in breadcrumbs
|
133 |
+
* Enhancement: Configure the brand banner and the brand description position independently
|
134 |
+
* Dev: New filter 'pwb_taxonomy_rewrite' to change the rewrite slug
|
135 |
+
* Dev: New filter 'pwb_taxonomy_with_front' to change default "with_front" value
|
136 |
+
* Fix: Fatal error in PHP5.4
|
137 |
+
= 1.7.0 =
|
138 |
+
* Feature: A-Z Listing shortcode
|
139 |
+
* Feature: New brands exporter/importer introduced
|
140 |
+
* Fix: Missing some brands to filter
|
141 |
+
* Fix: Coupon doesn’t work for product variations (thanks @gekomees)
|
142 |
+
* Fix: The brand description is not shown if there are no products
|
143 |
+
* Enhancement: wpautop() for brand descriptions
|
144 |
+
* Enhancement: Other filter by brand widget enhancements
|
145 |
+
* Enhancement: Brands page link in breadcrumbs
|
146 |
+
* Enhancement: Enqueue the carousel lib conditionally
|
147 |
+
* Dev: New filter hook 'pwb_description_allowed_tags'
|
148 |
+
* Update: WC 3.5 compatibility
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/admin/brands-exporter.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the edit-tags.php exporter/importer
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<div class="pwb-brands-exporter pwb-clearfix">
|
11 |
-
<button class="button pwb-brands-export"><?php _e('Export brands', 'perfect-woocommerce-brands');?></button>
|
12 |
-
<button class="button pwb-brands-import"><?php _e('Import brands', 'perfect-woocommerce-brands');?></button>
|
13 |
-
<input type="file" class="pwb-brands-import-file" accept="application/json">
|
14 |
-
<p><?php _e( 'This tool allows you to export and import the brands between different sites using PWB.', 'perfect-woocommerce-brands' );?></p>
|
15 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the edit-tags.php exporter/importer
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<div class="pwb-brands-exporter pwb-clearfix">
|
11 |
+
<button class="button pwb-brands-export"><?php _e('Export brands', 'perfect-woocommerce-brands');?></button>
|
12 |
+
<button class="button pwb-brands-import"><?php _e('Import brands', 'perfect-woocommerce-brands');?></button>
|
13 |
+
<input type="file" class="pwb-brands-import-file" accept="application/json">
|
14 |
+
<p><?php _e( 'This tool allows you to export and import the brands between different sites using PWB.', 'perfect-woocommerce-brands' );?></p>
|
15 |
+
</div>
|
templates/admin/edit-brands-bottom.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the edit-tags.php table footer
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<div class="pwb-edit-brands-bottom pwb-clearfix">
|
11 |
-
<span class="dashicons dashicons-admin-collapse"></span>
|
12 |
-
<p class="pwb-featured-count">
|
13 |
-
<span><?php echo $data['featured_count'];?></span> <?php echo $data['text_featured'];?>
|
14 |
-
</p>
|
15 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the edit-tags.php table footer
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<div class="pwb-edit-brands-bottom pwb-clearfix">
|
11 |
+
<span class="dashicons dashicons-admin-collapse"></span>
|
12 |
+
<p class="pwb-featured-count">
|
13 |
+
<span><?php echo $data['featured_count'];?></span> <?php echo $data['text_featured'];?>
|
14 |
+
</p>
|
15 |
+
</div>
|
templates/shortcodes/az-listing.php
CHANGED
@@ -1,57 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the a-z Listing
|
4 |
-
* @version 1.0.
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<?php if( !empty( $grouped_brands ) ): ?>
|
11 |
-
|
12 |
-
<div class="pwb-az-listing">
|
13 |
-
|
14 |
-
<div class="pwb-az-listing-header">
|
15 |
-
|
16 |
-
<ul class="pwb-clearfix">
|
17 |
-
|
18 |
-
<?php foreach( $grouped_brands as $letter => $brand_group ): ?>
|
19 |
-
<li><a href="#pwb-az-listing-<?php echo $letter;?>"><?php echo $letter;?></a></li>
|
20 |
-
<?php endforeach; ?>
|
21 |
-
|
22 |
-
</ul>
|
23 |
-
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<div class="pwb-az-listing-content">
|
27 |
-
|
28 |
-
<?php foreach( $grouped_brands as $letter => $brand_group ): ?>
|
29 |
-
|
30 |
-
<div id="pwb-az-listing-<?php echo $letter;?>" class="pwb-az-listing-row pwb-clearfix">
|
31 |
-
<p class="pwb-az-listing-title"><?php echo $letter;?></p>
|
32 |
-
<div class="pwb-az-listing-row-in">
|
33 |
-
|
34 |
-
<?php foreach( $brand_group as $brand ): ?>
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
</div>
|
56 |
-
|
57 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the a-z Listing
|
4 |
+
* @version 1.0.1
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<?php if( !empty( $grouped_brands ) ): ?>
|
11 |
+
|
12 |
+
<div class="pwb-az-listing">
|
13 |
+
|
14 |
+
<div class="pwb-az-listing-header">
|
15 |
+
|
16 |
+
<ul class="pwb-clearfix">
|
17 |
+
|
18 |
+
<?php foreach( $grouped_brands as $letter => $brand_group ): ?>
|
19 |
+
<li><a href="#pwb-az-listing-<?php echo $letter;?>"><?php echo $letter;?></a></li>
|
20 |
+
<?php endforeach; ?>
|
21 |
+
|
22 |
+
</ul>
|
23 |
+
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div class="pwb-az-listing-content">
|
27 |
+
|
28 |
+
<?php foreach( $grouped_brands as $letter => $brand_group ): ?>
|
29 |
+
|
30 |
+
<div id="pwb-az-listing-<?php echo $letter;?>" class="pwb-az-listing-row pwb-clearfix">
|
31 |
+
<p class="pwb-az-listing-title"><?php echo $letter;?></p>
|
32 |
+
<div class="pwb-az-listing-row-in">
|
33 |
+
|
34 |
+
<?php foreach( $brand_group as $brand ): ?>
|
35 |
+
|
36 |
+
<div class="pwb-az-listing-col">
|
37 |
+
<a href="<?php echo get_term_link($brand['brand_term']->term_id);?>">
|
38 |
+
<?php echo $brand['brand_term']->name;?>
|
39 |
+
</a>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<?php endforeach; ?>
|
43 |
+
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<?php endforeach; ?>
|
48 |
+
|
49 |
+
</div>
|
50 |
+
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
templates/shortcodes/brand.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the "pwb-brand" shortcode
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<?php if( !empty( $brands ) ): ?>
|
11 |
-
|
12 |
-
<div class="pwb-brand-shortcode">
|
13 |
-
|
14 |
-
<?php foreach( $brands as $brand ): ?>
|
15 |
-
|
16 |
-
<a href="<?php echo $brand->term_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>">
|
17 |
-
|
18 |
-
<?php if( !$as_link && !empty( $brand->image ) ): ?>
|
19 |
-
|
20 |
-
<?php echo $brand->image;?>
|
21 |
-
|
22 |
-
<?php else: ?>
|
23 |
-
|
24 |
-
<?php echo $brand->name;?>
|
25 |
-
|
26 |
-
<?php endif; ?>
|
27 |
-
|
28 |
-
</a>
|
29 |
-
|
30 |
-
<?php endforeach; ?>
|
31 |
-
|
32 |
-
</div>
|
33 |
-
|
34 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the "pwb-brand" shortcode
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<?php if( !empty( $brands ) ): ?>
|
11 |
+
|
12 |
+
<div class="pwb-brand-shortcode">
|
13 |
+
|
14 |
+
<?php foreach( $brands as $brand ): ?>
|
15 |
+
|
16 |
+
<a href="<?php echo $brand->term_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>">
|
17 |
+
|
18 |
+
<?php if( !$as_link && !empty( $brand->image ) ): ?>
|
19 |
+
|
20 |
+
<?php echo $brand->image;?>
|
21 |
+
|
22 |
+
<?php else: ?>
|
23 |
+
|
24 |
+
<?php echo $brand->name;?>
|
25 |
+
|
26 |
+
<?php endif; ?>
|
27 |
+
|
28 |
+
</a>
|
29 |
+
|
30 |
+
<?php endforeach; ?>
|
31 |
+
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<?php endif; ?>
|
templates/shortcodes/carousel.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the carousels
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<div class="pwb-carousel" data-slick="<?php echo $slick_settings; ?>">
|
11 |
-
|
12 |
-
<?php foreach( $brands as $brand ): ?>
|
13 |
-
<div class="pwb-slick-slide">
|
14 |
-
<a href="<?php echo $brand['link'];?>" title="<?php echo $brand['name']; ?>">
|
15 |
-
<?php echo $brand['attachment_html'];?>
|
16 |
-
</a>
|
17 |
-
</div>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
|
20 |
-
<div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
|
21 |
-
|
22 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the carousels
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<div class="pwb-carousel" data-slick="<?php echo $slick_settings; ?>">
|
11 |
+
|
12 |
+
<?php foreach( $brands as $brand ): ?>
|
13 |
+
<div class="pwb-slick-slide">
|
14 |
+
<a href="<?php echo $brand['link'];?>" title="<?php echo $brand['name']; ?>">
|
15 |
+
<?php echo $brand['attachment_html'];?>
|
16 |
+
</a>
|
17 |
+
</div>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
|
20 |
+
<div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
|
21 |
+
|
22 |
+
</div>
|
templates/shortcodes/product-carousel.php
CHANGED
@@ -1,32 +1,32 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the product carousels
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<?php if( !empty( $products ) ): ?>
|
11 |
-
|
12 |
-
<div class="pwb-product-carousel" data-slick="<?php echo $slick_settings; ?>">
|
13 |
-
|
14 |
-
<?php foreach( $products as $product ): ?>
|
15 |
-
<div class="pwb-slick-slide">
|
16 |
-
<a href="<?php echo $product['permalink']; ?>">
|
17 |
-
<?php echo $product['thumbnail']; ?>
|
18 |
-
<h3><?php echo $product['title']; ?></h3>
|
19 |
-
<?php echo do_shortcode('[add_to_cart id="'.$product['id'].'" style=""]'); ?>
|
20 |
-
</a>
|
21 |
-
</div>
|
22 |
-
<?php endforeach; ?>
|
23 |
-
|
24 |
-
<div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
|
25 |
-
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<?php else: ?>
|
29 |
-
|
30 |
-
<div><?php _e('Nothing found');?></div>
|
31 |
-
|
32 |
-
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the product carousels
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<?php if( !empty( $products ) ): ?>
|
11 |
+
|
12 |
+
<div class="pwb-product-carousel" data-slick="<?php echo $slick_settings; ?>">
|
13 |
+
|
14 |
+
<?php foreach( $products as $product ): ?>
|
15 |
+
<div class="pwb-slick-slide">
|
16 |
+
<a href="<?php echo $product['permalink']; ?>">
|
17 |
+
<?php echo $product['thumbnail']; ?>
|
18 |
+
<h3><?php echo $product['title']; ?></h3>
|
19 |
+
<?php echo do_shortcode('[add_to_cart id="'.$product['id'].'" style=""]'); ?>
|
20 |
+
</a>
|
21 |
+
</div>
|
22 |
+
<?php endforeach; ?>
|
23 |
+
|
24 |
+
<div class="pwb-carousel-loader"><?php _e('Loading','perfect-woocommerce-brands');?>...</div>
|
25 |
+
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<?php else: ?>
|
29 |
+
|
30 |
+
<div><?php _e('Nothing found');?></div>
|
31 |
+
|
32 |
+
<?php endif; ?>
|
templates/widgets/dropdown.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the dropdown widget
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<select class="pwb-dropdown-widget">
|
11 |
-
<option selected="true" disabled="disabled">
|
12 |
-
<?php echo apply_filters( 'pwb_dropdown_placeholder', __( 'Brands', 'perfect-woocommerce-brands' ) ); ?>
|
13 |
-
</option>
|
14 |
-
<?php foreach( $brands as $brand ): ?>
|
15 |
-
<option value="<?php echo $brand->get('link');?>" <?php selected( $data['selected'], $brand->get('id') );?>>
|
16 |
-
<?php echo $brand->get('name');?>
|
17 |
-
</option>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
</select>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the dropdown widget
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<select class="pwb-dropdown-widget">
|
11 |
+
<option selected="true" disabled="disabled">
|
12 |
+
<?php echo apply_filters( 'pwb_dropdown_placeholder', __( 'Brands', 'perfect-woocommerce-brands' ) ); ?>
|
13 |
+
</option>
|
14 |
+
<?php foreach( $brands as $brand ): ?>
|
15 |
+
<option value="<?php echo $brand->get('link');?>" <?php selected( $data['selected'], $brand->get('id') );?>>
|
16 |
+
<?php echo $brand->get('name');?>
|
17 |
+
</option>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
</select>
|
templates/widgets/filter-by-brand.php
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying filter by brand widget
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<div class="pwb-filter-products<?php if( $hide_submit_btn ) echo ' pwb-hide-submit-btn'; ?>" data-cat-url="<?php echo $cate_url;?>">
|
11 |
-
<ul>
|
12 |
-
<?php foreach( $brands as $brand ): ?>
|
13 |
-
<li>
|
14 |
-
<label>
|
15 |
-
<input type="checkbox" data-brand="<?php echo $brand->term_id;?>" value="<?php echo $brand->slug;?>"><?php echo $brand->name; ?>
|
16 |
-
</label>
|
17 |
-
</li>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
</ul>
|
20 |
-
<?php if( !$hide_submit_btn ): ?>
|
21 |
-
<button><?php _e('Apply filter','perfect-woocommerce-brands') ?></button>
|
22 |
-
<?php endif;?>
|
23 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying filter by brand widget
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<div class="pwb-filter-products<?php if( $hide_submit_btn ) echo ' pwb-hide-submit-btn'; ?>" data-cat-url="<?php echo $cate_url;?>">
|
11 |
+
<ul>
|
12 |
+
<?php foreach( $brands as $brand ): ?>
|
13 |
+
<li>
|
14 |
+
<label>
|
15 |
+
<input type="checkbox" data-brand="<?php echo $brand->term_id;?>" value="<?php echo $brand->slug;?>"><?php echo $brand->name; ?>
|
16 |
+
</label>
|
17 |
+
</li>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
</ul>
|
20 |
+
<?php if( !$hide_submit_btn ): ?>
|
21 |
+
<button><?php _e('Apply filter','perfect-woocommerce-brands') ?></button>
|
22 |
+
<?php endif;?>
|
23 |
+
</div>
|
templates/widgets/list-logo.php
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the list logo widget
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<ul class="pwb-row">
|
11 |
-
|
12 |
-
<?php foreach( $data['brands'] as $brand ): ?>
|
13 |
-
|
14 |
-
<li class="<?php echo $data['li_class'];?>">
|
15 |
-
|
16 |
-
<a href="<?php echo $brand->get('link');?>" title="<?php echo $data['title_prefix'] . ' ' . $brand->get('name'); ?>">
|
17 |
-
|
18 |
-
<?php if( !empty( html_entity_decode( $brand->get('image') ) ) ): ?>
|
19 |
-
<?php echo html_entity_decode( $brand->get('image') ); ?>
|
20 |
-
<?php endif; ?>
|
21 |
-
|
22 |
-
</a>
|
23 |
-
|
24 |
-
</li>
|
25 |
-
|
26 |
-
<?php endforeach; ?>
|
27 |
-
|
28 |
-
</ul>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the list logo widget
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<ul class="pwb-row">
|
11 |
+
|
12 |
+
<?php foreach( $data['brands'] as $brand ): ?>
|
13 |
+
|
14 |
+
<li class="<?php echo $data['li_class'];?>">
|
15 |
+
|
16 |
+
<a href="<?php echo $brand->get('link');?>" title="<?php echo $data['title_prefix'] . ' ' . $brand->get('name'); ?>">
|
17 |
+
|
18 |
+
<?php if( !empty( html_entity_decode( $brand->get('image') ) ) ): ?>
|
19 |
+
<?php echo html_entity_decode( $brand->get('image') ); ?>
|
20 |
+
<?php endif; ?>
|
21 |
+
|
22 |
+
</a>
|
23 |
+
|
24 |
+
</li>
|
25 |
+
|
26 |
+
<?php endforeach; ?>
|
27 |
+
|
28 |
+
</ul>
|
templates/widgets/list.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying the list widget
|
4 |
-
* @version 1.0.0
|
5 |
-
*/
|
6 |
-
|
7 |
-
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
-
?>
|
9 |
-
|
10 |
-
<ul class="pwb-row">
|
11 |
-
|
12 |
-
<?php foreach( $data['brands'] as $brand ): ?>
|
13 |
-
|
14 |
-
<li>
|
15 |
-
<a href="<?php echo $brand->get('link');?>" title="<?php echo $data['title_prefix'] . ' ' . $brand->get('name'); ?>">
|
16 |
-
<?php echo $brand->get('name'); ?>
|
17 |
-
</a>
|
18 |
-
</li>
|
19 |
-
|
20 |
-
<?php endforeach; ?>
|
21 |
-
|
22 |
-
</ul>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the list widget
|
4 |
+
* @version 1.0.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
8 |
+
?>
|
9 |
+
|
10 |
+
<ul class="pwb-row">
|
11 |
+
|
12 |
+
<?php foreach( $data['brands'] as $brand ): ?>
|
13 |
+
|
14 |
+
<li>
|
15 |
+
<a href="<?php echo $brand->get('link');?>" title="<?php echo $data['title_prefix'] . ' ' . $brand->get('name'); ?>">
|
16 |
+
<?php echo $brand->get('name'); ?>
|
17 |
+
</a>
|
18 |
+
</li>
|
19 |
+
|
20 |
+
<?php endforeach; ?>
|
21 |
+
|
22 |
+
</ul>
|
uninstall.php
CHANGED
@@ -1,20 +1,20 @@
|
|
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 |
-
//elimina el archivo de marcas exportadas si existe
|
16 |
-
unlink( WP_CONTENT_DIR . '/uploads/pwb-export.json' );
|
17 |
-
|
18 |
-
//update permalinks and clean cache
|
19 |
-
flush_rewrite_rules();
|
20 |
-
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 |
+
//elimina el archivo de marcas exportadas si existe
|
16 |
+
unlink( WP_CONTENT_DIR . '/uploads/pwb-export.json' );
|
17 |
+
|
18 |
+
//update permalinks and clean cache
|
19 |
+
flush_rewrite_rules();
|
20 |
+
wp_cache_flush();
|