Perfect Brands for WooCommerce - Version 1.5.2

Version Description

  • Dev: Adding brands to a products via the REST API + updating namespaces to include v2 (pull request, thanks doekenorg)
Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

assets/css/styles-admin.css CHANGED
@@ -1,102 +1,102 @@
1
- /* ----------------------- Taxonomy pwb-brand ----------------------- */
2
- .taxonomy-pwb-brand .pwb_brand_image_selected_remove{
3
- color: #FF3030;
4
- font-family: Arial, Helvetica, sans-serif;
5
- text-decoration: none;
6
- font-size: 20px;
7
- font-weight: bold;
8
- position: absolute;
9
- top: 0;
10
- right: 0;
11
- bottom: 0;
12
- left: 0;
13
- background-color: rgba(0, 0, 0, 0.5);
14
- opacity: 0;
15
- -webkit-transition: opacity 200ms ease-in-out;
16
- -moz-transition: opacity 200ms ease-in-out;
17
- -ms-transition: opacity 200ms ease-in-out;
18
- -o-transition: opacity 200ms ease-in-out;
19
- transition: opacity 200ms ease-in-out;
20
- }
21
- .taxonomy-pwb-brand .pwb_brand_image_selected span{
22
- display: inline-block;
23
- position: relative;
24
- text-align: center;
25
- line-height: 90px;
26
- height: 90px;
27
- }
28
- .taxonomy-pwb-brand .pwb_brand_image_selected span:hover .pwb_brand_image_selected_remove{
29
- opacity: 1;
30
- }
31
- .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_image, .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_banner{
32
- display: none;
33
- }
34
- .taxonomy-pwb-brand .pwb_brand_cont div{
35
- margin-top: 10px;
36
- }
37
- @media screen and (max-width: 782px) {
38
- .taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
39
- display: none;
40
- }
41
-
42
- .taxonomy-pwb-brand .wp-list-table td.column-logo:before {
43
- content: ""!important;
44
- }
45
- }
46
- /* ----------------------- /Taxonomy pwb-brand ----------------------- */
47
-
48
- /* ----------------------- Widgets page ----------------------- */
49
- .widgets-php .widget[id*="_pwb_"] .widget-title{
50
- border-left: 2px solid #cda000;
51
- }
52
- /* ----------------------- /Widgets page ----------------------- */
53
-
54
- /* ----------------------- Settings page ----------------------- */
55
- #wc_pwb_admin_status_result{
56
- display: none;
57
- background-color: #f6f6f6;
58
- padding: 14px;
59
- }
60
- #wc_pwb_admin_tab_tools_system_status{
61
- display: none!important;
62
- }
63
- /* ----------------------- /Settings page ----------------------- */
64
-
65
- .pwb-display-as-logo{
66
- display: none;
67
- }
68
- .pwb-display-as-logo.show{
69
- display: block;
70
- }
71
- .pwb-notice-dismissible p a{
72
- margin-right: 12px;
73
- }
74
- .pwb-notice-dismissible .dashicons-heart{
75
- color: #f188ff;
76
- margin-left: 3px;
77
- }
78
- .pwb-modal{
79
- position: fixed;
80
- top: 0;
81
- right: 0;
82
- bottom: 0;
83
- left: 0;
84
- z-index: 99999999999;
85
- line-height: 1;
86
- background: rgba(0,0,0,0.9);
87
- font-size: 2em;
88
- padding-top: 20px;
89
- text-align: center;
90
- }
91
- .pwb-modal-inner {
92
- max-width: 70%;
93
- margin: 0 auto;
94
- animation: pwbblinkkf 3s linear infinite;
95
- color: #fff;
96
- }
97
- .pwb-modal-inner p{
98
- font-size: 2em;
99
- }
100
- @keyframes pwbblinkkf {
101
- 50% { opacity: 0; }
102
- }
1
+ /* ----------------------- Taxonomy pwb-brand ----------------------- */
2
+ .taxonomy-pwb-brand .pwb_brand_image_selected_remove{
3
+ color: #FF3030;
4
+ font-family: Arial, Helvetica, sans-serif;
5
+ text-decoration: none;
6
+ font-size: 20px;
7
+ font-weight: bold;
8
+ position: absolute;
9
+ top: 0;
10
+ right: 0;
11
+ bottom: 0;
12
+ left: 0;
13
+ background-color: rgba(0, 0, 0, 0.5);
14
+ opacity: 0;
15
+ -webkit-transition: opacity 200ms ease-in-out;
16
+ -moz-transition: opacity 200ms ease-in-out;
17
+ -ms-transition: opacity 200ms ease-in-out;
18
+ -o-transition: opacity 200ms ease-in-out;
19
+ transition: opacity 200ms ease-in-out;
20
+ }
21
+ .taxonomy-pwb-brand .pwb_brand_image_selected span{
22
+ display: inline-block;
23
+ position: relative;
24
+ text-align: center;
25
+ line-height: 90px;
26
+ height: 90px;
27
+ }
28
+ .taxonomy-pwb-brand .pwb_brand_image_selected span:hover .pwb_brand_image_selected_remove{
29
+ opacity: 1;
30
+ }
31
+ .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_image, .taxonomy-pwb-brand .pwb_brand_cont #pwb_brand_banner{
32
+ display: none;
33
+ }
34
+ .taxonomy-pwb-brand .pwb_brand_cont div{
35
+ margin-top: 10px;
36
+ }
37
+ @media screen and (max-width: 782px) {
38
+ .taxonomy-pwb-brand .wp-list-table thead th.column-logo, .taxonomy-pwb-brand .wp-list-table tfoot th.column-logo {
39
+ display: none;
40
+ }
41
+
42
+ .taxonomy-pwb-brand .wp-list-table td.column-logo:before {
43
+ content: ""!important;
44
+ }
45
+ }
46
+ /* ----------------------- /Taxonomy pwb-brand ----------------------- */
47
+
48
+ /* ----------------------- Widgets page ----------------------- */
49
+ .widgets-php .widget[id*="_pwb_"] .widget-title{
50
+ border-left: 2px solid #cda000;
51
+ }
52
+ /* ----------------------- /Widgets page ----------------------- */
53
+
54
+ /* ----------------------- Settings page ----------------------- */
55
+ #wc_pwb_admin_status_result{
56
+ display: none;
57
+ background-color: #f6f6f6;
58
+ padding: 14px;
59
+ }
60
+ #wc_pwb_admin_tab_tools_system_status{
61
+ display: none!important;
62
+ }
63
+ /* ----------------------- /Settings page ----------------------- */
64
+
65
+ .pwb-display-as-logo{
66
+ display: none;
67
+ }
68
+ .pwb-display-as-logo.show{
69
+ display: block;
70
+ }
71
+ .pwb-notice-dismissible p a{
72
+ margin-right: 12px;
73
+ }
74
+ .pwb-notice-dismissible .dashicons-heart{
75
+ color: #f188ff;
76
+ margin-left: 3px;
77
+ }
78
+ .pwb-modal{
79
+ position: fixed;
80
+ top: 0;
81
+ right: 0;
82
+ bottom: 0;
83
+ left: 0;
84
+ z-index: 99999999999;
85
+ line-height: 1;
86
+ background: rgba(0,0,0,0.9);
87
+ font-size: 2em;
88
+ padding-top: 20px;
89
+ text-align: center;
90
+ }
91
+ .pwb-modal-inner {
92
+ max-width: 70%;
93
+ margin: 0 auto;
94
+ animation: pwbblinkkf 3s linear infinite;
95
+ color: #fff;
96
+ }
97
+ .pwb-modal-inner p{
98
+ font-size: 2em;
99
+ }
100
+ @keyframes pwbblinkkf {
101
+ 50% { opacity: 0; }
102
+ }
assets/css/styles-frontend.css CHANGED
@@ -1,167 +1,167 @@
1
- /* ----------------------- Global ----------------------- */
2
- .pwb-clearfix:after{
3
- content: "";
4
- display: table;
5
- clear: both;
6
- }
7
- /* ----------------------- /Global ----------------------- */
8
-
9
- /* ----------------------- PWB Carousel ----------------------- */
10
- .pwb-carousel .slick-slide a{
11
- display: block;
12
- }
13
- .pwb-carousel .slick-slide a > img{
14
- margin: 0 auto;
15
- }
16
- .pwb-carousel .slick-loading .slick-list, .pwb-product-carousel .slick-loading .slick-list{
17
- background: #fff url('./ajax-loader.gif') center center no-repeat;
18
- }
19
- .pwb-carousel .slick-slide, .pwb-product-carousel .slick-slide{
20
- margin: 0 10px;
21
- }
22
- .pwb-carousel .slick-prev, .pwb-carousel .slick-next,
23
- .pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
24
- font-size: 0;
25
-
26
- position: absolute;
27
- top: 0;
28
- bottom: 0;
29
-
30
- display: block;
31
-
32
- cursor: pointer;
33
-
34
- font-size: 22px;
35
- width: 30px;
36
- overflow: hidden;
37
- text-align: center;
38
-
39
- color: #aeaeae;
40
- border: none;
41
- outline: none;
42
-
43
- z-index: 999;
44
- background: #eee;
45
- opacity: 0;
46
- transition: opacity 0.3s ease-in-out;
47
- -webkit-transition: opacity 0.3s ease-in-out;
48
- -moz-transition: opacity 0.3s ease-in-out;
49
- -o-transition: opacity 0.3s ease-in-out;
50
-
51
- }
52
- .pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
53
- .pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
54
- display: inline-block;
55
- height: 20px;
56
- width: 20px;
57
- padding: 10px;
58
- position: absolute;
59
- top: 50%;
60
- margin-top: -20px;
61
- left: 0;
62
- right: 0;
63
- }
64
- .pwb-carousel .slick-prev:hover,
65
- .pwb-carousel .slick-prev:focus,
66
- .pwb-carousel .slick-next:hover,
67
- .pwb-carousel .slick-next:focus,
68
- .pwb-product-carousel .slick-prev:hover,
69
- .pwb-product-carousel .slick-prev:focus,
70
- .pwb-product-carousel .slick-next:hover,
71
- .pwb-product-carousel .slick-next:focus{
72
- outline: none;
73
- }
74
- .pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
75
- left: 0;
76
- }
77
- .pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
78
- right: 0;
79
- }
80
- .pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
81
- .pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
82
- opacity: 0.8;
83
- }
84
- .pwb-product-carousel .pwb-amount{
85
- display: block;
86
- width: 100%;
87
- margin-bottom: 12px;
88
- }
89
- /* ----------------------- /PWB Carousel ----------------------- */
90
-
91
- /* ----------------------- PWB All Brands ----------------------- */
92
- .pwb-all-brands .pwb-pagination-wrapper{
93
- margin-top: 20px;
94
- padding-top: 10px;
95
- border-top: 1px solid #ededed;
96
- text-align: right;
97
- }
98
- .pwb-all-brands .pwb-pagination{
99
- display: inline-block;
100
- margin-right: 10px;
101
- background-color: #ededed;
102
- color: #333;
103
- text-align: center;
104
- padding: 10px;
105
- }
106
- .pwb-all-brands .pwb-brands-cols-outer:after{
107
- content: "";
108
- display: table;
109
- clear: both;
110
- }
111
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
112
- padding: 0 15px;
113
- width: 20%;
114
- float: left;
115
- }
116
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
117
- height: 25px;
118
- overflow: hidden;
119
- font-size: 14px;
120
- }
121
- /* ----------------------- /PWB All Brands ----------------------- */
122
-
123
- /* ----------------------- Columns ----------------------- */
124
- .pwb-row:after{
125
- content: "";
126
- display: table;
127
- clear: both;
128
- }
129
- .pwb-columns-2{
130
- width: 50%;
131
- }
132
- .pwb-columns-3{
133
- width: 33.33333%;
134
- }
135
- .pwb-columns-4{
136
- width: 25%;
137
- }
138
- .pwb-columns{
139
- display: inline-block;
140
- vertical-align:top;
141
- }
142
- /* ----------------------- /Columns ----------------------- */
143
-
144
- /* ----------------------- Responsive ----------------------- */
145
- @media screen and (max-width: 1000px) {
146
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
147
- width: 25%;
148
- }
149
- }
150
- @media screen and (max-width: 700px) {
151
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
152
- width: 50%;
153
- }
154
- }
155
- @media screen and (max-width: 480px) {
156
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
157
- width: 100%;
158
- float: none;
159
- }
160
- .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
161
- height: auto;
162
- }
163
- .pwb-columns-3, .pwb-columns-4{
164
- width: 50%;
165
- }
166
- }
167
- /* ----------------------- /Responsive ----------------------- */
1
+ /* ----------------------- Global ----------------------- */
2
+ .pwb-clearfix:after{
3
+ content: "";
4
+ display: table;
5
+ clear: both;
6
+ }
7
+ /* ----------------------- /Global ----------------------- */
8
+
9
+ /* ----------------------- PWB Carousel ----------------------- */
10
+ .pwb-carousel .slick-slide a{
11
+ display: block;
12
+ }
13
+ .pwb-carousel .slick-slide a > img{
14
+ margin: 0 auto;
15
+ }
16
+ .pwb-carousel .slick-loading .slick-list, .pwb-product-carousel .slick-loading .slick-list{
17
+ background: #fff url('./ajax-loader.gif') center center no-repeat;
18
+ }
19
+ .pwb-carousel .slick-slide, .pwb-product-carousel .slick-slide{
20
+ margin: 0 10px;
21
+ }
22
+ .pwb-carousel .slick-prev, .pwb-carousel .slick-next,
23
+ .pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
24
+ font-size: 0;
25
+
26
+ position: absolute;
27
+ top: 0;
28
+ bottom: 0;
29
+
30
+ display: block;
31
+
32
+ cursor: pointer;
33
+
34
+ font-size: 22px;
35
+ width: 30px;
36
+ overflow: hidden;
37
+ text-align: center;
38
+
39
+ color: #aeaeae;
40
+ border: none;
41
+ outline: none;
42
+
43
+ z-index: 999;
44
+ background: #eee;
45
+ opacity: 0;
46
+ transition: opacity 0.3s ease-in-out;
47
+ -webkit-transition: opacity 0.3s ease-in-out;
48
+ -moz-transition: opacity 0.3s ease-in-out;
49
+ -o-transition: opacity 0.3s ease-in-out;
50
+
51
+ }
52
+ .pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
53
+ .pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
54
+ display: inline-block;
55
+ height: 20px;
56
+ width: 20px;
57
+ padding: 10px;
58
+ position: absolute;
59
+ top: 50%;
60
+ margin-top: -20px;
61
+ left: 0;
62
+ right: 0;
63
+ }
64
+ .pwb-carousel .slick-prev:hover,
65
+ .pwb-carousel .slick-prev:focus,
66
+ .pwb-carousel .slick-next:hover,
67
+ .pwb-carousel .slick-next:focus,
68
+ .pwb-product-carousel .slick-prev:hover,
69
+ .pwb-product-carousel .slick-prev:focus,
70
+ .pwb-product-carousel .slick-next:hover,
71
+ .pwb-product-carousel .slick-next:focus{
72
+ outline: none;
73
+ }
74
+ .pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
75
+ left: 0;
76
+ }
77
+ .pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
78
+ right: 0;
79
+ }
80
+ .pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
81
+ .pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
82
+ opacity: 0.8;
83
+ }
84
+ .pwb-product-carousel .pwb-amount{
85
+ display: block;
86
+ width: 100%;
87
+ margin-bottom: 12px;
88
+ }
89
+ /* ----------------------- /PWB Carousel ----------------------- */
90
+
91
+ /* ----------------------- PWB All Brands ----------------------- */
92
+ .pwb-all-brands .pwb-pagination-wrapper{
93
+ margin-top: 20px;
94
+ padding-top: 10px;
95
+ border-top: 1px solid #ededed;
96
+ text-align: right;
97
+ }
98
+ .pwb-all-brands .pwb-pagination{
99
+ display: inline-block;
100
+ margin-right: 10px;
101
+ background-color: #ededed;
102
+ color: #333;
103
+ text-align: center;
104
+ padding: 10px;
105
+ }
106
+ .pwb-all-brands .pwb-brands-cols-outer:after{
107
+ content: "";
108
+ display: table;
109
+ clear: both;
110
+ }
111
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
112
+ padding: 0 15px;
113
+ width: 20%;
114
+ float: left;
115
+ }
116
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
117
+ height: 25px;
118
+ overflow: hidden;
119
+ font-size: 14px;
120
+ }
121
+ /* ----------------------- /PWB All Brands ----------------------- */
122
+
123
+ /* ----------------------- Columns ----------------------- */
124
+ .pwb-row:after{
125
+ content: "";
126
+ display: table;
127
+ clear: both;
128
+ }
129
+ .pwb-columns-2{
130
+ width: 50%;
131
+ }
132
+ .pwb-columns-3{
133
+ width: 33.33333%;
134
+ }
135
+ .pwb-columns-4{
136
+ width: 25%;
137
+ }
138
+ .pwb-columns{
139
+ display: inline-block;
140
+ vertical-align:top;
141
+ }
142
+ /* ----------------------- /Columns ----------------------- */
143
+
144
+ /* ----------------------- Responsive ----------------------- */
145
+ @media screen and (max-width: 1000px) {
146
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
147
+ width: 25%;
148
+ }
149
+ }
150
+ @media screen and (max-width: 700px) {
151
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
152
+ width: 50%;
153
+ }
154
+ }
155
+ @media screen and (max-width: 480px) {
156
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
157
+ width: 100%;
158
+ float: none;
159
+ }
160
+ .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
161
+ height: auto;
162
+ }
163
+ .pwb-columns-3, .pwb-columns-4{
164
+ width: 50%;
165
+ }
166
+ }
167
+ /* ----------------------- /Responsive ----------------------- */
assets/js/pwb_admin_functions.js CHANGED
@@ -1,235 +1,235 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function( $ ) {
4
-
5
- var media_uploader = null;
6
-
7
- function open_media_uploader_image( event, imageSelectorButton ){
8
-
9
- var $imageSelectorScope = imageSelectorButton.parent();
10
-
11
- media_uploader = wp.media({
12
- frame: "post",
13
- state: "insert",
14
- multiple: false
15
- });
16
-
17
- media_uploader.on("insert", function(){
18
- var json = media_uploader.state().get("selection").first().toJSON();
19
- var image_id = json.id;
20
- var image_url = json.url;
21
- var image_html = '<img src="'+image_url+'" width="90" height="90">';
22
-
23
- var current_selector = '';
24
- switch (event.target.id) {
25
- case 'pwb_brand_image_select':
26
- current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
27
- break;
28
- case 'pwb_brand_banner_select':
29
- current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
30
- break;
31
- }
32
-
33
- $(current_selector).val(image_id);
34
- $(current_selector+'_result').remove();
35
-
36
- if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
37
- $('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
38
- }else{
39
- $imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
40
- }
41
- add_delete_link( $imageSelectorScope );
42
-
43
- });
44
-
45
- media_uploader.open();
46
- }
47
-
48
-
49
- $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
50
- open_media_uploader_image( event, $(this) );
51
- });
52
-
53
- //bind remove image event for edit page
54
- $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
55
- add_delete_link( $(this).parent() );
56
- });
57
-
58
- //clear custom fields when brand is added
59
- jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
60
- //Check ajax action of request that succeeded
61
- if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
62
- $('#pwb_brand_image').val('');
63
- $('#pwb_brand_banner').val('');
64
- $('.pwb_brand_image_selected').remove();
65
- }
66
- });
67
-
68
- function add_delete_link( $imageSelectorScope ){
69
-
70
- $( '.pwb_brand_image_selected span', $imageSelectorScope ).append('<a href="#" class="pwb_brand_image_selected_remove">X</a>');
71
-
72
- $( '.pwb_brand_image_selected_remove', $imageSelectorScope ).on( 'click', function( event ){
73
-
74
- event.preventDefault();
75
- $(this).closest('.pwb_brand_image_selected').remove();
76
-
77
- //remove the img
78
- $('#pwb_brand_image',$imageSelectorScope).val('');
79
- $('#pwb_brand_banner',$imageSelectorScope).val('');
80
-
81
- });
82
-
83
- }
84
-
85
-
86
- /* ····························· Settings tab ····························· */
87
-
88
- // migrate brands
89
- $('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
90
-
91
- if( $(this).val() != '-' ){
92
-
93
- if( confirm(ajax_object.translations.migrate_notice) ){
94
-
95
- $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
96
- $('.pwb-modal-inner').html('<p>'+ajax_object.translations.migrating+'</p>');
97
-
98
- var data = {
99
- 'action': 'pwb_admin_migrate_brands',
100
- 'from': $(this).val()
101
- };
102
- $.post(ajax_object.ajax_url, data, function(response) {
103
-
104
- setTimeout( function(){
105
- location.href = ajax_object.brands_url;
106
- }, 1000 );
107
-
108
- });
109
-
110
- }else{
111
-
112
- }
113
-
114
- }
115
-
116
- $(this).val('-');//reset to default value
117
-
118
- } );
119
-
120
- // dummy data
121
- $('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
122
-
123
- if( $(this).val() != '-' ){
124
-
125
- if( confirm(ajax_object.translations.dummy_data_notice) ){
126
-
127
- $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
128
- $('.pwb-modal-inner').html('<p>'+ajax_object.translations.dummy_data+'</p>');
129
-
130
- var data = {
131
- 'action': 'pwb_admin_dummy_data',
132
- 'from': $(this).val()
133
- };
134
- $.post(ajax_object.ajax_url, data, function(response) {
135
-
136
- setTimeout( function(){
137
- location.href = ajax_object.brands_url;
138
- }, 1000 );
139
-
140
- });
141
-
142
- }else{
143
-
144
- }
145
-
146
- }
147
-
148
- $(this).val('-');//reset to default value
149
-
150
- } );
151
-
152
- var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
153
- $systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
154
- $('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
155
- e.preventDefault();
156
- if( !$('#wc_pwb_admin_status_result').length ){
157
- $systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
158
- $('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
159
- jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
160
- e.preventDefault();
161
- var refNode = $( this )[0];
162
- if ( $.browser.msie ) {
163
- var range = document.body.createTextRange();
164
- range.moveToElementText( refNode );
165
- range.select();
166
- } else if ( $.browser.mozilla || $.browser.opera ) {
167
- var selection = window.getSelection();
168
- var range = document.createRange();
169
- range.selectNodeContents( refNode );
170
- selection.removeAllRanges();
171
- selection.addRange( range );
172
- } else if ( $.browser.safari ) {
173
- var selection = window.getSelection();
174
- selection.setBaseAndExtent( refNode, 0, refNode, 1 );
175
- }
176
- } );
177
- }
178
- $('#wc_pwb_admin_status_result').html('<img src="'+ajax_object.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
179
- $('#wc_pwb_admin_status_result').show();
180
- var data = {
181
- 'action': 'pwb_system_status'
182
- };
183
- jQuery.post(ajaxurl, data, function(response) {
184
- $('#wc_pwb_admin_status_result').html(response);
185
- $('#wc_pwb_admin_status_result').trigger('click');
186
- });
187
-
188
- } );
189
-
190
- /* ····························· /Settings tab ····························· */
191
-
192
- /* ····························· Admin notices ····························· */
193
- $( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
194
-
195
- e.preventDefault();
196
-
197
- var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
198
-
199
- var data = {
200
- 'action': 'dismiss_pwb_notice',
201
- 'notice_name': noticeName
202
- };
203
- jQuery.post(ajaxurl, data, function(response) {
204
- //callback
205
- });
206
-
207
- } );
208
- /* ····························· /Admin notices ····························· */
209
-
210
- /* ····························· Widgets ····························· */
211
- pwbBindEventsToWigets();
212
- //Fires when a widget is added to a sidebar
213
- jQuery(document).bind('widget-added',function(e, widget){
214
- pwbBindEventsToWigets( widget );
215
- });
216
- //Fires on widget save
217
- jQuery(document).on('widget-updated', function(e, widget){
218
- pwbBindEventsToWigets( widget );
219
- });
220
- function pwbBindEventsToWigets( widget ){
221
- $currentWidget = $(".pwb-select-display-as");
222
- if( widget != undefined ){
223
- $currentWidget = $(".pwb-select-display-as", widget);
224
- }
225
- $currentWidget.on("change",function(){
226
- if( $(this).val()=="brand_logo" ){
227
- $(this).parent().siblings(".pwb-display-as-logo").addClass("show");
228
- }else{
229
- $(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
230
- }
231
- });
232
- }
233
- /* ····························· /Widgets ····························· */
234
-
235
- });
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function( $ ) {
4
+
5
+ var media_uploader = null;
6
+
7
+ function open_media_uploader_image( event, imageSelectorButton ){
8
+
9
+ var $imageSelectorScope = imageSelectorButton.parent();
10
+
11
+ media_uploader = wp.media({
12
+ frame: "post",
13
+ state: "insert",
14
+ multiple: false
15
+ });
16
+
17
+ media_uploader.on("insert", function(){
18
+ var json = media_uploader.state().get("selection").first().toJSON();
19
+ var image_id = json.id;
20
+ var image_url = json.url;
21
+ var image_html = '<img src="'+image_url+'" width="90" height="90">';
22
+
23
+ var current_selector = '';
24
+ switch (event.target.id) {
25
+ case 'pwb_brand_image_select':
26
+ current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'image';
27
+ break;
28
+ case 'pwb_brand_banner_select':
29
+ current_selector = '.taxonomy-pwb-brand #pwb_brand_'+'banner';
30
+ break;
31
+ }
32
+
33
+ $(current_selector).val(image_id);
34
+ $(current_selector+'_result').remove();
35
+
36
+ if( $('.pwb_brand_image_selected',$imageSelectorScope).length ){
37
+ $('.pwb_brand_image_selected span', $imageSelectorScope).html(image_html);
38
+ }else{
39
+ $imageSelectorScope.append('<div class="pwb_brand_image_selected"><span>'+image_html+'</span></div>');
40
+ }
41
+ add_delete_link( $imageSelectorScope );
42
+
43
+ });
44
+
45
+ media_uploader.open();
46
+ }
47
+
48
+
49
+ $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').on('click',function(event){
50
+ open_media_uploader_image( event, $(this) );
51
+ });
52
+
53
+ //bind remove image event for edit page
54
+ $('.taxonomy-pwb-brand #pwb_brand_image_select, .taxonomy-pwb-brand #pwb_brand_banner_select').each(function(){
55
+ add_delete_link( $(this).parent() );
56
+ });
57
+
58
+ //clear custom fields when brand is added
59
+ jQuery( document ).ajaxSuccess(function( event, xhr, settings ) {
60
+ //Check ajax action of request that succeeded
61
+ if( typeof settings != "undefined" && settings.data && ~settings.data.indexOf("action=add-tag") && ~settings.data.indexOf("taxonomy=pwb-brand") ) {
62
+ $('#pwb_brand_image').val('');
63
+ $('#pwb_brand_banner').val('');
64
+ $('.pwb_brand_image_selected').remove();
65
+ }
66
+ });
67
+
68
+ function add_delete_link( $imageSelectorScope ){
69
+
70
+ $( '.pwb_brand_image_selected span', $imageSelectorScope ).append('<a href="#" class="pwb_brand_image_selected_remove">X</a>');
71
+
72
+ $( '.pwb_brand_image_selected_remove', $imageSelectorScope ).on( 'click', function( event ){
73
+
74
+ event.preventDefault();
75
+ $(this).closest('.pwb_brand_image_selected').remove();
76
+
77
+ //remove the img
78
+ $('#pwb_brand_image',$imageSelectorScope).val('');
79
+ $('#pwb_brand_banner',$imageSelectorScope).val('');
80
+
81
+ });
82
+
83
+ }
84
+
85
+
86
+ /* ····························· Settings tab ····························· */
87
+
88
+ // migrate brands
89
+ $('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
90
+
91
+ if( $(this).val() != '-' ){
92
+
93
+ if( confirm(ajax_object.translations.migrate_notice) ){
94
+
95
+ $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
96
+ $('.pwb-modal-inner').html('<p>'+ajax_object.translations.migrating+'</p>');
97
+
98
+ var data = {
99
+ 'action': 'pwb_admin_migrate_brands',
100
+ 'from': $(this).val()
101
+ };
102
+ $.post(ajax_object.ajax_url, data, function(response) {
103
+
104
+ setTimeout( function(){
105
+ location.href = ajax_object.brands_url;
106
+ }, 1000 );
107
+
108
+ });
109
+
110
+ }else{
111
+
112
+ }
113
+
114
+ }
115
+
116
+ $(this).val('-');//reset to default value
117
+
118
+ } );
119
+
120
+ // dummy data
121
+ $('#wc_pwb_admin_tab_tools_dummy_data').on( 'change', function(){
122
+
123
+ if( $(this).val() != '-' ){
124
+
125
+ if( confirm(ajax_object.translations.dummy_data_notice) ){
126
+
127
+ $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
128
+ $('.pwb-modal-inner').html('<p>'+ajax_object.translations.dummy_data+'</p>');
129
+
130
+ var data = {
131
+ 'action': 'pwb_admin_dummy_data',
132
+ 'from': $(this).val()
133
+ };
134
+ $.post(ajax_object.ajax_url, data, function(response) {
135
+
136
+ setTimeout( function(){
137
+ location.href = ajax_object.brands_url;
138
+ }, 1000 );
139
+
140
+ });
141
+
142
+ }else{
143
+
144
+ }
145
+
146
+ }
147
+
148
+ $(this).val('-');//reset to default value
149
+
150
+ } );
151
+
152
+ var $systemStatusBtn = $('#wc_pwb_admin_tab_tools_system_status').siblings('p');
153
+ $systemStatusBtn.addClass('button wc_pwb_admin_tab_status_btn');
154
+ $('.wc_pwb_admin_tab_status_btn').on( 'click', function(e){
155
+ e.preventDefault();
156
+ if( !$('#wc_pwb_admin_status_result').length ){
157
+ $systemStatusTextarea = $('#wc_pwb_admin_tab_tools_system_status');
158
+ $('<pre id="wc_pwb_admin_status_result"></pre>').insertAfter($systemStatusTextarea);
159
+ jQuery( '#wc_pwb_admin_status_result' ).click( function(e) {
160
+ e.preventDefault();
161
+ var refNode = $( this )[0];
162
+ if ( $.browser.msie ) {
163
+ var range = document.body.createTextRange();
164
+ range.moveToElementText( refNode );
165
+ range.select();
166
+ } else if ( $.browser.mozilla || $.browser.opera ) {
167
+ var selection = window.getSelection();
168
+ var range = document.createRange();
169
+ range.selectNodeContents( refNode );
170
+ selection.removeAllRanges();
171
+ selection.addRange( range );
172
+ } else if ( $.browser.safari ) {
173
+ var selection = window.getSelection();
174
+ selection.setBaseAndExtent( refNode, 0, refNode, 1 );
175
+ }
176
+ } );
177
+ }
178
+ $('#wc_pwb_admin_status_result').html('<img src="'+ajax_object.site_url+'/wp-admin/images/spinner.gif'+'" alt="Loading" height="20" width="20">');
179
+ $('#wc_pwb_admin_status_result').show();
180
+ var data = {
181
+ 'action': 'pwb_system_status'
182
+ };
183
+ jQuery.post(ajaxurl, data, function(response) {
184
+ $('#wc_pwb_admin_status_result').html(response);
185
+ $('#wc_pwb_admin_status_result').trigger('click');
186
+ });
187
+
188
+ } );
189
+
190
+ /* ····························· /Settings tab ····························· */
191
+
192
+ /* ····························· Admin notices ····························· */
193
+ $( document ).on( 'click', '.pwb-notice-dismissible .notice-dismiss', function(e) {
194
+
195
+ e.preventDefault();
196
+
197
+ var noticeName = $( this ).closest( '.pwb-notice-dismissible' ).data( 'notice' );
198
+
199
+ var data = {
200
+ 'action': 'dismiss_pwb_notice',
201
+ 'notice_name': noticeName
202
+ };
203
+ jQuery.post(ajaxurl, data, function(response) {
204
+ //callback
205
+ });
206
+
207
+ } );
208
+ /* ····························· /Admin notices ····························· */
209
+
210
+ /* ····························· Widgets ····························· */
211
+ pwbBindEventsToWigets();
212
+ //Fires when a widget is added to a sidebar
213
+ jQuery(document).bind('widget-added',function(e, widget){
214
+ pwbBindEventsToWigets( widget );
215
+ });
216
+ //Fires on widget save
217
+ jQuery(document).on('widget-updated', function(e, widget){
218
+ pwbBindEventsToWigets( widget );
219
+ });
220
+ function pwbBindEventsToWigets( widget ){
221
+ $currentWidget = $(".pwb-select-display-as");
222
+ if( widget != undefined ){
223
+ $currentWidget = $(".pwb-select-display-as", widget);
224
+ }
225
+ $currentWidget.on("change",function(){
226
+ if( $(this).val()=="brand_logo" ){
227
+ $(this).parent().siblings(".pwb-display-as-logo").addClass("show");
228
+ }else{
229
+ $(this).parent().siblings(".pwb-display-as-logo").removeClass("show");
230
+ }
231
+ });
232
+ }
233
+ /* ····························· /Widgets ····························· */
234
+
235
+ });
assets/js/pwb_frontend_functions.js CHANGED
@@ -1,142 +1,142 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function( $ ) {
4
- $('.pwb-dropdown-widget').on('change',function(){
5
- var href = $(this).find(":selected").val();
6
- location.href = href;
7
- });
8
-
9
- $('.pwb-carousel').slick({
10
- infinite: true,
11
- draggable: false,
12
- prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
13
- nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
14
- speed: 300,
15
- responsive: [
16
- {
17
- breakpoint: 1024,
18
- settings: {
19
- slidesToShow: 4,
20
- draggable: true,
21
- arrows: false
22
- }
23
- },
24
- {
25
- breakpoint: 600,
26
- settings: {
27
- slidesToShow: 3,
28
- draggable: true,
29
- arrows: false
30
- }
31
- },
32
- {
33
- breakpoint: 480,
34
- settings: {
35
- slidesToShow: 2,
36
- draggable: true,
37
- arrows: false
38
- }
39
- }
40
- ]
41
- });
42
-
43
- $('.pwb-product-carousel').slick({
44
- infinite: true,
45
- draggable: false,
46
- prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
47
- nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
48
- speed: 300,
49
- responsive: [
50
- {
51
- breakpoint: 1024,
52
- settings: {
53
- slidesToShow: 3,
54
- draggable: true,
55
- arrows: false
56
- }
57
- },
58
- {
59
- breakpoint: 600,
60
- settings: {
61
- slidesToShow: 2,
62
- draggable: true,
63
- arrows: false
64
- }
65
- },
66
- {
67
- breakpoint: 480,
68
- settings: {
69
- slidesToShow: 1,
70
- draggable: true,
71
- arrows: false
72
- }
73
- }
74
- ]
75
- });
76
-
77
-
78
- /* ··························· Filter by brand widget ··························· */
79
-
80
- var brands = PWBgetUrlParameter('pwb-brand-filter');
81
-
82
- $('.pwb-filter-products button').on( 'click', function(){
83
-
84
- var currentUrl = window.location.href;
85
-
86
- var marcas = '';
87
- $('.pwb-filter-products input[type="checkbox"]').each(function(index){
88
- var checked = $(this).prop('checked');
89
- if(checked){
90
- marcas+=$(this).val();
91
- if($('.pwb-filter-products input[type="checkbox"]').length-1 != index){
92
- marcas+=',';
93
- }
94
- }
95
- });
96
-
97
- //removes previous "pwb-brand" from url
98
- currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
99
-
100
- if( currentUrl.indexOf("?") === -1 ){
101
- currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
102
- }else{
103
- currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
104
- }
105
- location.href = currentUrl;
106
-
107
- });
108
-
109
- if(brands!=null){
110
- var brands_array = brands.split(',');
111
- $('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
112
- for ( var i = 0, l = brands_array.length; i < l; i++ ) {
113
- $('.pwb-filter-products input[type="checkbox"]').each(function(index){
114
- if($(this).val()){
115
- if(brands_array[i]==$(this).val()){
116
- $(this).prop('checked',true);
117
- }
118
- }
119
- });
120
- }
121
- }else{
122
- $('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
123
- }
124
-
125
- /* ··························· /Filter by brand widget ··························· */
126
-
127
- });
128
-
129
- var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
130
- var sPageURL = decodeURIComponent(window.location.search.substring(1)),
131
- sURLVariables = sPageURL.split('&'),
132
- sParameterName,
133
- i;
134
-
135
- for (i = 0; i < sURLVariables.length; i++) {
136
- sParameterName = sURLVariables[i].split('=');
137
-
138
- if (sParameterName[0] === sParam) {
139
- return sParameterName[1] === undefined ? true : sParameterName[1];
140
- }
141
- }
142
- };
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function( $ ) {
4
+ $('.pwb-dropdown-widget').on('change',function(){
5
+ var href = $(this).find(":selected").val();
6
+ location.href = href;
7
+ });
8
+
9
+ $('.pwb-carousel').slick({
10
+ infinite: true,
11
+ draggable: false,
12
+ prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
13
+ nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
14
+ speed: 300,
15
+ responsive: [
16
+ {
17
+ breakpoint: 1024,
18
+ settings: {
19
+ slidesToShow: 4,
20
+ draggable: true,
21
+ arrows: false
22
+ }
23
+ },
24
+ {
25
+ breakpoint: 600,
26
+ settings: {
27
+ slidesToShow: 3,
28
+ draggable: true,
29
+ arrows: false
30
+ }
31
+ },
32
+ {
33
+ breakpoint: 480,
34
+ settings: {
35
+ slidesToShow: 2,
36
+ draggable: true,
37
+ arrows: false
38
+ }
39
+ }
40
+ ]
41
+ });
42
+
43
+ $('.pwb-product-carousel').slick({
44
+ infinite: true,
45
+ draggable: false,
46
+ prevArrow: '<div class="slick-prev"><span title="Prev">&lt;</span></div>',
47
+ nextArrow: '<div class="slick-next"><span title="Next">&gt;</span></div>',
48
+ speed: 300,
49
+ responsive: [
50
+ {
51
+ breakpoint: 1024,
52
+ settings: {
53
+ slidesToShow: 3,
54
+ draggable: true,
55
+ arrows: false
56
+ }
57
+ },
58
+ {
59
+ breakpoint: 600,
60
+ settings: {
61
+ slidesToShow: 2,
62
+ draggable: true,
63
+ arrows: false
64
+ }
65
+ },
66
+ {
67
+ breakpoint: 480,
68
+ settings: {
69
+ slidesToShow: 1,
70
+ draggable: true,
71
+ arrows: false
72
+ }
73
+ }
74
+ ]
75
+ });
76
+
77
+
78
+ /* ··························· Filter by brand widget ··························· */
79
+
80
+ var brands = PWBgetUrlParameter('pwb-brand-filter');
81
+
82
+ $('.pwb-filter-products button').on( 'click', function(){
83
+
84
+ var currentUrl = window.location.href;
85
+
86
+ var marcas = '';
87
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
88
+ var checked = $(this).prop('checked');
89
+ if(checked){
90
+ marcas+=$(this).val();
91
+ if($('.pwb-filter-products input[type="checkbox"]').length-1 != index){
92
+ marcas+=',';
93
+ }
94
+ }
95
+ });
96
+
97
+ //removes previous "pwb-brand" from url
98
+ currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
99
+
100
+ if( currentUrl.indexOf("?") === -1 ){
101
+ currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
102
+ }else{
103
+ currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
104
+ }
105
+ location.href = currentUrl;
106
+
107
+ });
108
+
109
+ if(brands!=null){
110
+ var brands_array = brands.split(',');
111
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
112
+ for ( var i = 0, l = brands_array.length; i < l; i++ ) {
113
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
114
+ if($(this).val()){
115
+ if(brands_array[i]==$(this).val()){
116
+ $(this).prop('checked',true);
117
+ }
118
+ }
119
+ });
120
+ }
121
+ }else{
122
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
123
+ }
124
+
125
+ /* ··························· /Filter by brand widget ··························· */
126
+
127
+ });
128
+
129
+ var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
130
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
131
+ sURLVariables = sPageURL.split('&'),
132
+ sParameterName,
133
+ i;
134
+
135
+ for (i = 0; i < sURLVariables.length; i++) {
136
+ sParameterName = sURLVariables[i].split('=');
137
+
138
+ if (sParameterName[0] === sParam) {
139
+ return sParameterName[1] === undefined ? true : sParameterName[1];
140
+ }
141
+ }
142
+ };
assets/js/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/js/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="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
- <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
- <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
- <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
- </font></defs></svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by Fontastic.me</metadata>
5
+ <defs>
6
+ <font id="slick" horiz-adv-x="512">
7
+ <font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
8
+ <missing-glyph horiz-adv-x="512" />
9
+
10
+ <glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
+ <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
+ <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
+ <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
+ </font></defs></svg>
assets/js/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
- margin-top: -10px\9; /*lte IE 8*/
34
- -webkit-transform: translate(0, -50%);
35
- -ms-transform: translate(0, -50%);
36
- transform: translate(0, -50%);
37
-
38
- cursor: pointer;
39
-
40
- color: transparent;
41
- border: none;
42
- outline: none;
43
- background: transparent;
44
- }
45
- .slick-prev:hover,
46
- .slick-prev:focus,
47
- .slick-next:hover,
48
- .slick-next:focus
49
- {
50
- color: transparent;
51
- outline: none;
52
- background: transparent;
53
- }
54
- .slick-prev:hover:before,
55
- .slick-prev:focus:before,
56
- .slick-next:hover:before,
57
- .slick-next:focus:before
58
- {
59
- opacity: 1;
60
- }
61
- .slick-prev.slick-disabled:before,
62
- .slick-next.slick-disabled:before
63
- {
64
- opacity: .25;
65
- }
66
-
67
- .slick-prev:before,
68
- .slick-next:before
69
- {
70
- font-family: 'slick';
71
- font-size: 20px;
72
- line-height: 1;
73
-
74
- opacity: .75;
75
- color: white;
76
-
77
- -webkit-font-smoothing: antialiased;
78
- -moz-osx-font-smoothing: grayscale;
79
- }
80
-
81
- .slick-prev
82
- {
83
- left: -25px;
84
- }
85
- [dir='rtl'] .slick-prev
86
- {
87
- right: -25px;
88
- left: auto;
89
- }
90
- .slick-prev:before
91
- {
92
- content: '←';
93
- }
94
- [dir='rtl'] .slick-prev:before
95
- {
96
- content: '→';
97
- }
98
-
99
- .slick-next
100
- {
101
- right: -25px;
102
- }
103
- [dir='rtl'] .slick-next
104
- {
105
- right: auto;
106
- left: -25px;
107
- }
108
- .slick-next:before
109
- {
110
- content: '→';
111
- }
112
- [dir='rtl'] .slick-next:before
113
- {
114
- content: '←';
115
- }
116
-
117
- /* Dots */
118
- .slick-slider
119
- {
120
- margin-bottom: 30px;
121
- }
122
-
123
- .slick-dots
124
- {
125
- position: absolute;
126
- bottom: -45px;
127
-
128
- display: block;
129
-
130
- width: 100%;
131
- padding: 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
+ margin-top: -10px\9; /*lte IE 8*/
34
+ -webkit-transform: translate(0, -50%);
35
+ -ms-transform: translate(0, -50%);
36
+ transform: translate(0, -50%);
37
+
38
+ cursor: pointer;
39
+
40
+ color: transparent;
41
+ border: none;
42
+ outline: none;
43
+ background: transparent;
44
+ }
45
+ .slick-prev:hover,
46
+ .slick-prev:focus,
47
+ .slick-next:hover,
48
+ .slick-next:focus
49
+ {
50
+ color: transparent;
51
+ outline: none;
52
+ background: transparent;
53
+ }
54
+ .slick-prev:hover:before,
55
+ .slick-prev:focus:before,
56
+ .slick-next:hover:before,
57
+ .slick-next:focus:before
58
+ {
59
+ opacity: 1;
60
+ }
61
+ .slick-prev.slick-disabled:before,
62
+ .slick-next.slick-disabled:before
63
+ {
64
+ opacity: .25;
65
+ }
66
+
67
+ .slick-prev:before,
68
+ .slick-next:before
69
+ {
70
+ font-family: 'slick';
71
+ font-size: 20px;
72
+ line-height: 1;
73
+
74
+ opacity: .75;
75
+ color: white;
76
+
77
+ -webkit-font-smoothing: antialiased;
78
+ -moz-osx-font-smoothing: grayscale;
79
+ }
80
+
81
+ .slick-prev
82
+ {
83
+ left: -25px;
84
+ }
85
+ [dir='rtl'] .slick-prev
86
+ {
87
+ right: -25px;
88
+ left: auto;
89
+ }
90
+ .slick-prev:before
91
+ {
92
+ content: '←';
93
+ }
94
+ [dir='rtl'] .slick-prev:before
95
+ {
96
+ content: '→';
97
+ }
98
+
99
+ .slick-next
100
+ {
101
+ right: -25px;
102
+ }
103
+ [dir='rtl'] .slick-next
104
+ {
105
+ right: auto;
106
+ left: -25px;
107
+ }
108
+ .slick-next:before
109
+ {
110
+ content: '→';
111
+ }
112
+ [dir='rtl'] .slick-next:before
113
+ {
114
+ content: '←';
115
+ }
116
+
117
+ /* Dots */
118
+ .slick-slider
119
+ {
120
+ margin-bottom: 30px;
121
+ }
122
+
123
+ .slick-dots
124
+ {
125
+ position: absolute;
126
+ bottom: -45px;
127
+
128
+ display: block;
129
+
130
+ width: 100%;
131
+ padding: 0;
132
+
133
+ list-style: none;
134
+
135
+ text-align: center;
136
+ }
137
+ .slick-dots li
138
+ {
139
+ position: relative;
140
+
141
+ display: inline-block;
142
+
143
+ width: 20px;
144
+ height: 20px;
145
+ margin: 0 5px;
146
+ padding: 0;
147
+
148
+ cursor: pointer;
149
+ }
150
+ .slick-dots li button
151
+ {
152
+ font-size: 0;
153
+ line-height: 0;
154
+
155
+ display: block;
156
+
157
+ width: 20px;
158
+ height: 20px;
159
+ padding: 5px;
160
+
161
+ cursor: pointer;
162
+
163
+ color: transparent;
164
+ border: 0;
165
+ outline: none;
166
+ background: transparent;
167
+ }
168
+ .slick-dots li button:hover,
169
+ .slick-dots li button:focus
170
+ {
171
+ outline: none;
172
+ }
173
+ .slick-dots li button:hover:before,
174
+ .slick-dots li button:focus:before
175
+ {
176
+ opacity: 1;
177
+ }
178
+ .slick-dots li button:before
179
+ {
180
+ font-family: 'slick';
181
+ font-size: 6px;
182
+ line-height: 20px;
183
+
184
+ position: absolute;
185
+ top: 0;
186
+ left: 0;
187
+
188
+ width: 20px;
189
+ height: 20px;
190
+
191
+ content: '•';
192
+ text-align: center;
193
+
194
+ opacity: .25;
195
+ color: black;
196
+
197
+ -webkit-font-smoothing: antialiased;
198
+ -moz-osx-font-smoothing: grayscale;
199
+ }
200
+ .slick-dots li.slick-active button:before
201
+ {
202
+ opacity: .75;
203
+ color: black;
204
+ }
assets/js/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('./ajax-loader.gif') center center no-repeat;
22
- }
23
-
24
- /* Icons */
25
- @font-face{
26
- font-family: 'slick';
27
- font-weight: normal;
28
- font-style: normal;
29
-
30
- src: url('./fonts/slick.eot');
31
- 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');
32
- }
33
-
34
- /* Arrows */
35
-
36
- .slick-prev,
37
- .slick-next {
38
- position: absolute;
39
- display: block;
40
- height: 20px;
41
- width: 20px;
42
- line-height: 0px;
43
- font-size: 0px;
44
- cursor: pointer;
45
- background: transparent;
46
- color: transparent;
47
- top: 50%;
48
- margin-top: -10px~'\9'; /*lte IE 8*/
49
- -webkit-transform: translate(0, -50%);
50
- -ms-transform: translate(0, -50%);
51
- transform: translate(0, -50%);
52
- padding: 0;
53
- border: none;
54
- outline: none;
55
- &:hover, &:focus {
56
- outline: none;
57
- background: transparent;
58
- color: transparent;
59
- &:before {
60
- opacity: @slick-opacity-on-hover;
61
- }
62
- }
63
- &.slick-disabled:before {
64
- opacity: @slick-opacity-not-active;
65
- }
66
- }
67
-
68
- .slick-prev:before, .slick-next:before {
69
- font-family: @slick-font-family;
70
- font-size: 20px;
71
- line-height: 1;
72
- color: @slick-arrow-color;
73
- opacity: @slick-opacity-default;
74
- -webkit-font-smoothing: antialiased;
75
- -moz-osx-font-smoothing: grayscale;
76
- }
77
-
78
- .slick-prev {
79
- left: -25px;
80
- &[dir="rtl"] {
81
- left: auto;
82
- right: -25px;
83
- }
84
- &:before {
85
- content: @slick-prev-character;
86
- &[dir="rtl"] {
87
- content: @slick-next-character;
88
- }
89
- }
90
- }
91
-
92
- .slick-next {
93
- right: -25px;
94
- &[dir="rtl"] {
95
- left: -25px;
96
- right: auto;
97
- }
98
- &:before {
99
- content: @slick-next-character;
100
- &[dir="rtl"] {
101
- content: @slick-prev-character;
102
- }
103
- }
104
- }
105
-
106
- /* Dots */
107
-
108
- .slick-slider {
109
- margin-bottom: 30px;
110
- }
111
-
112
- .slick-dots {
113
- position: absolute;
114
- bottom: -45px;
115
- list-style: none;
116
- display: block;
117
- text-align: center;
118
- padding: 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('./ajax-loader.gif') center center no-repeat;
22
+ }
23
+
24
+ /* Icons */
25
+ @font-face{
26
+ font-family: 'slick';
27
+ font-weight: normal;
28
+ font-style: normal;
29
+
30
+ src: url('./fonts/slick.eot');
31
+ 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');
32
+ }
33
+
34
+ /* Arrows */
35
+
36
+ .slick-prev,
37
+ .slick-next {
38
+ position: absolute;
39
+ display: block;
40
+ height: 20px;
41
+ width: 20px;
42
+ line-height: 0px;
43
+ font-size: 0px;
44
+ cursor: pointer;
45
+ background: transparent;
46
+ color: transparent;
47
+ top: 50%;
48
+ margin-top: -10px~'\9'; /*lte IE 8*/
49
+ -webkit-transform: translate(0, -50%);
50
+ -ms-transform: translate(0, -50%);
51
+ transform: translate(0, -50%);
52
+ padding: 0;
53
+ border: none;
54
+ outline: none;
55
+ &:hover, &:focus {
56
+ outline: none;
57
+ background: transparent;
58
+ color: transparent;
59
+ &:before {
60
+ opacity: @slick-opacity-on-hover;
61
+ }
62
+ }
63
+ &.slick-disabled:before {
64
+ opacity: @slick-opacity-not-active;
65
+ }
66
+ }
67
+
68
+ .slick-prev:before, .slick-next:before {
69
+ font-family: @slick-font-family;
70
+ font-size: 20px;
71
+ line-height: 1;
72
+ color: @slick-arrow-color;
73
+ opacity: @slick-opacity-default;
74
+ -webkit-font-smoothing: antialiased;
75
+ -moz-osx-font-smoothing: grayscale;
76
+ }
77
+
78
+ .slick-prev {
79
+ left: -25px;
80
+ &[dir="rtl"] {
81
+ left: auto;
82
+ right: -25px;
83
+ }
84
+ &:before {
85
+ content: @slick-prev-character;
86
+ &[dir="rtl"] {
87
+ content: @slick-next-character;
88
+ }
89
+ }
90
+ }
91
+
92
+ .slick-next {
93
+ right: -25px;
94
+ &[dir="rtl"] {
95
+ left: -25px;
96
+ right: auto;
97
+ }
98
+ &:before {
99
+ content: @slick-next-character;
100
+ &[dir="rtl"] {
101
+ content: @slick-prev-character;
102
+ }
103
+ }
104
+ }
105
+
106
+ /* Dots */
107
+
108
+ .slick-slider {
109
+ margin-bottom: 30px;
110
+ }
111
+
112
+ .slick-dots {
113
+ position: absolute;
114
+ bottom: -45px;
115
+ list-style: none;
116
+ display: block;
117
+ text-align: center;
118
+ padding: 0;
119
+ width: 100%;
120
+ li {
121
+ position: relative;
122
+ display: inline-block;
123
+ height: 20px;
124
+ width: 20px;
125
+ margin: 0 5px;
126
+ padding: 0;
127
+ cursor: pointer;
128
+ button {
129
+ border: 0;
130
+ background: transparent;
131
+ display: block;
132
+ height: 20px;
133
+ width: 20px;
134
+ outline: none;
135
+ line-height: 0px;
136
+ font-size: 0px;
137
+ color: transparent;
138
+ padding: 5px;
139
+ cursor: pointer;
140
+ &:hover, &:focus {
141
+ outline: none;
142
+ &:before {
143
+ opacity: @slick-opacity-on-hover;
144
+ }
145
+ }
146
+ &:before {
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ content: @slick-dot-character;
151
+ width: 20px;
152
+ height: 20px;
153
+ font-family: @slick-font-family;
154
+ font-size: @slick-dot-size;
155
+ line-height: 20px;
156
+ text-align: center;
157
+ color: @slick-dot-color;
158
+ opacity: @slick-opacity-not-active;
159
+ -webkit-font-smoothing: antialiased;
160
+ -moz-osx-font-smoothing: grayscale;
161
+ }
162
+ }
163
+ &.slick-active button:before {
164
+ color: @slick-dot-color-active;
165
+ opacity: @slick-opacity-default;
166
+ }
167
+ }
168
+ }
assets/js/slick/slick-theme.scss CHANGED
@@ -1,190 +1,190 @@
1
- @charset "UTF-8";
2
-
3
- // Default Variables
4
-
5
- $slick-font-path: "./fonts/" !default;
6
- $slick-font-family: "slick" !default;
7
- $slick-loader-path: "./" !default;
8
- $slick-arrow-color: white !default;
9
- $slick-dot-color: black !default;
10
- $slick-dot-color-active: $slick-dot-color !default;
11
- $slick-prev-character: "←" !default;
12
- $slick-next-character: "→" !default;
13
- $slick-dot-character: "•" !default;
14
- $slick-dot-size: 6px !default;
15
- $slick-opacity-default: 0.75 !default;
16
- $slick-opacity-on-hover: 1 !default;
17
- $slick-opacity-not-active: 0.25 !default;
18
-
19
- @function slick-image-url($url) {
20
- @if function-exists(image-url) {
21
- @return image-url($url);
22
- }
23
- @else {
24
- @return url($slick-loader-path + $url);
25
- }
26
- }
27
-
28
- @function slick-font-url($url) {
29
- @if function-exists(font-url) {
30
- @return font-url($url);
31
- }
32
- @else {
33
- @return url($slick-font-path + $url);
34
- }
35
- }
36
-
37
- /* Slider */
38
-
39
- .slick-list {
40
- .slick-loading & {
41
- background: #fff slick-image-url("ajax-loader.gif") center center no-repeat;
42
- }
43
- }
44
-
45
- /* Icons */
46
- @if $slick-font-family == "slick" {
47
- @font-face {
48
- font-family: "slick";
49
- src: slick-font-url("slick.eot");
50
- 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");
51
- font-weight: normal;
52
- font-style: normal;
53
- }
54
- }
55
-
56
- /* Arrows */
57
-
58
- .slick-prev,
59
- .slick-next {
60
- position: absolute;
61
- display: block;
62
- height: 20px;
63
- width: 20px;
64
- line-height: 0px;
65
- font-size: 0px;
66
- cursor: pointer;
67
- background: transparent;
68
- color: transparent;
69
- top: 50%;
70
- margin-top: -10px\9; /*lte IE 8*/
71
- -webkit-transform: translate(0, -50%);
72
- -ms-transform: translate(0, -50%);
73
- transform: translate(0, -50%);
74
- padding: 0;
75
- border: none;
76
- outline: none;
77
- &:hover, &:focus {
78
- outline: none;
79
- background: transparent;
80
- color: transparent;
81
- &:before {
82
- opacity: $slick-opacity-on-hover;
83
- }
84
- }
85
- &.slick-disabled:before {
86
- opacity: $slick-opacity-not-active;
87
- }
88
- }
89
-
90
- .slick-prev:before, .slick-next:before {
91
- font-family: $slick-font-family;
92
- font-size: 20px;
93
- line-height: 1;
94
- color: $slick-arrow-color;
95
- opacity: $slick-opacity-default;
96
- -webkit-font-smoothing: antialiased;
97
- -moz-osx-font-smoothing: grayscale;
98
- }
99
-
100
- .slick-prev {
101
- left: -25px;
102
- [dir="rtl"] & {
103
- left: auto;
104
- right: -25px;
105
- }
106
- &:before {
107
- content: $slick-prev-character;
108
- [dir="rtl"] & {
109
- content: $slick-next-character;
110
- }
111
- }
112
- }
113
-
114
- .slick-next {
115
- right: -25px;
116
- [dir="rtl"] & {
117
- left: -25px;
118
- right: auto;
119
- }
120
- &:before {
121
- content: $slick-next-character;
122
- [dir="rtl"] & {
123
- content: $slick-prev-character;
124
- }
125
- }
126
- }
127
-
128
- /* Dots */
129
-
130
- .slick-slider {
131
- margin-bottom: 30px;
132
- }
133
-
134
- .slick-dots {
135
- position: absolute;
136
- bottom: -45px;
137
- list-style: none;
138
- display: block;
139
- text-align: center;
140
- padding: 0;
141
- width: 100%;
142
- li {
143
- position: relative;
144
- display: inline-block;
145
- height: 20px;
146
- width: 20px;
147
- margin: 0 5px;
148
- padding: 0;
149
- cursor: pointer;
150
- button {
151
- border: 0;
152
- background: transparent;
153
- display: block;
154
- height: 20px;
155
- width: 20px;
156
- outline: none;
157
- line-height: 0px;
158
- font-size: 0px;
159
- color: transparent;
160
- padding: 5px;
161
- cursor: pointer;
162
- &:hover, &:focus {
163
- outline: none;
164
- &:before {
165
- opacity: $slick-opacity-on-hover;
166
- }
167
- }
168
- &:before {
169
- position: absolute;
170
- top: 0;
171
- left: 0;
172
- content: $slick-dot-character;
173
- width: 20px;
174
- height: 20px;
175
- font-family: $slick-font-family;
176
- font-size: $slick-dot-size;
177
- line-height: 20px;
178
- text-align: center;
179
- color: $slick-dot-color;
180
- opacity: $slick-opacity-not-active;
181
- -webkit-font-smoothing: antialiased;
182
- -moz-osx-font-smoothing: grayscale;
183
- }
184
- }
185
- &.slick-active button:before {
186
- color: $slick-dot-color-active;
187
- opacity: $slick-opacity-default;
188
- }
189
- }
190
- }
1
+ @charset "UTF-8";
2
+
3
+ // Default Variables
4
+
5
+ $slick-font-path: "./fonts/" !default;
6
+ $slick-font-family: "slick" !default;
7
+ $slick-loader-path: "./" !default;
8
+ $slick-arrow-color: white !default;
9
+ $slick-dot-color: black !default;
10
+ $slick-dot-color-active: $slick-dot-color !default;
11
+ $slick-prev-character: "←" !default;
12
+ $slick-next-character: "→" !default;
13
+ $slick-dot-character: "•" !default;
14
+ $slick-dot-size: 6px !default;
15
+ $slick-opacity-default: 0.75 !default;
16
+ $slick-opacity-on-hover: 1 !default;
17
+ $slick-opacity-not-active: 0.25 !default;
18
+
19
+ @function slick-image-url($url) {
20
+ @if function-exists(image-url) {
21
+ @return image-url($url);
22
+ }
23
+ @else {
24
+ @return url($slick-loader-path + $url);
25
+ }
26
+ }
27
+
28
+ @function slick-font-url($url) {
29
+ @if function-exists(font-url) {
30
+ @return font-url($url);
31
+ }
32
+ @else {
33
+ @return url($slick-font-path + $url);
34
+ }
35
+ }
36
+
37
+ /* Slider */
38
+
39
+ .slick-list {
40
+ .slick-loading & {
41
+ background: #fff slick-image-url("ajax-loader.gif") center center no-repeat;
42
+ }
43
+ }
44
+
45
+ /* Icons */
46
+ @if $slick-font-family == "slick" {
47
+ @font-face {
48
+ font-family: "slick";
49
+ src: slick-font-url("slick.eot");
50
+ 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");
51
+ font-weight: normal;
52
+ font-style: normal;
53
+ }
54
+ }
55
+
56
+ /* Arrows */
57
+
58
+ .slick-prev,
59
+ .slick-next {
60
+ position: absolute;
61
+ display: block;
62
+ height: 20px;
63
+ width: 20px;
64
+ line-height: 0px;
65
+ font-size: 0px;
66
+ cursor: pointer;
67
+ background: transparent;
68
+ color: transparent;
69
+ top: 50%;
70
+ margin-top: -10px\9; /*lte IE 8*/
71
+ -webkit-transform: translate(0, -50%);
72
+ -ms-transform: translate(0, -50%);
73
+ transform: translate(0, -50%);
74
+ padding: 0;
75
+ border: none;
76
+ outline: none;
77
+ &:hover, &:focus {
78
+ outline: none;
79
+ background: transparent;
80
+ color: transparent;
81
+ &:before {
82
+ opacity: $slick-opacity-on-hover;
83
+ }
84
+ }
85
+ &.slick-disabled:before {
86
+ opacity: $slick-opacity-not-active;
87
+ }
88
+ }
89
+
90
+ .slick-prev:before, .slick-next:before {
91
+ font-family: $slick-font-family;
92
+ font-size: 20px;
93
+ line-height: 1;
94
+ color: $slick-arrow-color;
95
+ opacity: $slick-opacity-default;
96
+ -webkit-font-smoothing: antialiased;
97
+ -moz-osx-font-smoothing: grayscale;
98
+ }
99
+
100
+ .slick-prev {
101
+ left: -25px;
102
+ [dir="rtl"] & {
103
+ left: auto;
104
+ right: -25px;
105
+ }
106
+ &:before {
107
+ content: $slick-prev-character;
108
+ [dir="rtl"] & {
109
+ content: $slick-next-character;
110
+ }
111
+ }
112
+ }
113
+
114
+ .slick-next {
115
+ right: -25px;
116
+ [dir="rtl"] & {
117
+ left: -25px;
118
+ right: auto;
119
+ }
120
+ &:before {
121
+ content: $slick-next-character;
122
+ [dir="rtl"] & {
123
+ content: $slick-prev-character;
124
+ }
125
+ }
126
+ }
127
+
128
+ /* Dots */
129
+
130
+ .slick-slider {
131
+ margin-bottom: 30px;
132
+ }
133
+
134
+ .slick-dots {
135
+ position: absolute;
136
+ bottom: -45px;
137
+ list-style: none;
138
+ display: block;
139
+ text-align: center;
140
+ padding: 0;
141
+ width: 100%;
142
+ li {
143
+ position: relative;
144
+ display: inline-block;
145
+ height: 20px;
146
+ width: 20px;
147
+ margin: 0 5px;
148
+ padding: 0;
149
+ cursor: pointer;
150
+ button {
151
+ border: 0;
152
+ background: transparent;
153
+ display: block;
154
+ height: 20px;
155
+ width: 20px;
156
+ outline: none;
157
+ line-height: 0px;
158
+ font-size: 0px;
159
+ color: transparent;
160
+ padding: 5px;
161
+ cursor: pointer;
162
+ &:hover, &:focus {
163
+ outline: none;
164
+ &:before {
165
+ opacity: $slick-opacity-on-hover;
166
+ }
167
+ }
168
+ &:before {
169
+ position: absolute;
170
+ top: 0;
171
+ left: 0;
172
+ content: $slick-dot-character;
173
+ width: 20px;
174
+ height: 20px;
175
+ font-family: $slick-font-family;
176
+ font-size: $slick-dot-size;
177
+ line-height: 20px;
178
+ text-align: center;
179
+ color: $slick-dot-color;
180
+ opacity: $slick-opacity-not-active;
181
+ -webkit-font-smoothing: antialiased;
182
+ -moz-osx-font-smoothing: grayscale;
183
+ }
184
+ }
185
+ &.slick-active button:before {
186
+ color: $slick-dot-color-active;
187
+ opacity: $slick-opacity-default;
188
+ }
189
+ }
190
+ }
assets/js/slick/slick.css CHANGED
@@ -1,119 +1,119 @@
1
- /* Slider */
2
- .slick-slider
3
- {
4
- position: relative;
5
-
6
- display: block;
7
-
8
- -moz-box-sizing: border-box;
9
- box-sizing: border-box;
10
-
11
- -webkit-user-select: none;
12
- -moz-user-select: none;
13
- -ms-user-select: none;
14
- user-select: none;
15
-
16
- -webkit-touch-callout: none;
17
- -khtml-user-select: none;
18
- -ms-touch-action: pan-y;
19
- touch-action: pan-y;
20
- -webkit-tap-highlight-color: transparent;
21
- }
22
-
23
- .slick-list
24
- {
25
- position: relative;
26
-
27
- display: block;
28
- overflow: hidden;
29
-
30
- margin: 0;
31
- padding: 0;
32
- }
33
- .slick-list:focus
34
- {
35
- outline: none;
36
- }
37
- .slick-list.dragging
38
- {
39
- cursor: pointer;
40
- cursor: hand;
41
- }
42
-
43
- .slick-slider .slick-track,
44
- .slick-slider .slick-list
45
- {
46
- -webkit-transform: translate3d(0, 0, 0);
47
- -moz-transform: translate3d(0, 0, 0);
48
- -ms-transform: translate3d(0, 0, 0);
49
- -o-transform: translate3d(0, 0, 0);
50
- transform: translate3d(0, 0, 0);
51
- }
52
-
53
- .slick-track
54
- {
55
- position: relative;
56
- top: 0;
57
- left: 0;
58
-
59
- display: block;
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
+
8
+ -moz-box-sizing: border-box;
9
+ box-sizing: border-box;
10
+
11
+ -webkit-user-select: none;
12
+ -moz-user-select: none;
13
+ -ms-user-select: none;
14
+ user-select: none;
15
+
16
+ -webkit-touch-callout: none;
17
+ -khtml-user-select: none;
18
+ -ms-touch-action: pan-y;
19
+ touch-action: pan-y;
20
+ -webkit-tap-highlight-color: transparent;
21
+ }
22
+
23
+ .slick-list
24
+ {
25
+ position: relative;
26
+
27
+ display: block;
28
+ overflow: hidden;
29
+
30
+ margin: 0;
31
+ padding: 0;
32
+ }
33
+ .slick-list:focus
34
+ {
35
+ outline: none;
36
+ }
37
+ .slick-list.dragging
38
+ {
39
+ cursor: pointer;
40
+ cursor: hand;
41
+ }
42
+
43
+ .slick-slider .slick-track,
44
+ .slick-slider .slick-list
45
+ {
46
+ -webkit-transform: translate3d(0, 0, 0);
47
+ -moz-transform: translate3d(0, 0, 0);
48
+ -ms-transform: translate3d(0, 0, 0);
49
+ -o-transform: translate3d(0, 0, 0);
50
+ transform: translate3d(0, 0, 0);
51
+ }
52
+
53
+ .slick-track
54
+ {
55
+ position: relative;
56
+ top: 0;
57
+ left: 0;
58
+
59
+ display: block;
60
+ }
61
+ .slick-track:before,
62
+ .slick-track:after
63
+ {
64
+ display: table;
65
+
66
+ content: '';
67
+ }
68
+ .slick-track:after
69
+ {
70
+ clear: both;
71
+ }
72
+ .slick-loading .slick-track
73
+ {
74
+ visibility: hidden;
75
+ }
76
+
77
+ .slick-slide
78
+ {
79
+ display: none;
80
+ float: left;
81
+
82
+ height: 100%;
83
+ min-height: 1px;
84
+ }
85
+ [dir='rtl'] .slick-slide
86
+ {
87
+ float: right;
88
+ }
89
+ .slick-slide img
90
+ {
91
+ display: block;
92
+ }
93
+ .slick-slide.slick-loading img
94
+ {
95
+ display: none;
96
+ }
97
+ .slick-slide.dragging img
98
+ {
99
+ pointer-events: none;
100
+ }
101
+ .slick-initialized .slick-slide
102
+ {
103
+ display: block;
104
+ }
105
+ .slick-loading .slick-slide
106
+ {
107
+ visibility: hidden;
108
+ }
109
+ .slick-vertical .slick-slide
110
+ {
111
+ display: block;
112
+
113
+ height: auto;
114
+
115
+ border: 1px solid transparent;
116
+ }
117
+ .slick-arrow.slick-hidden {
118
+ display: none;
119
  }
assets/js/slick/slick.js CHANGED
@@ -1,2670 +1,2670 @@
1
- /*
2
- _ _ _ _
3
- ___| (_) ___| | __ (_)___
4
- / __| | |/ __| |/ / | / __|
5
- \__ \ | | (__| < _ | \__ \
6
- |___/_|_|\___|_|\_(_)/ |___/
7
- |__/
8
-
9
- Version: 1.5.9
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 type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
48
- nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="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" data-role="none" role="button" aria-required="false" tabindex="0">' + (i + 1) + '</button>';
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
- infinite: true,
65
- initialSlide: 0,
66
- lazyLoad: 'ondemand',
67
- mobileFirst: false,
68
- pauseOnHover: true,
69
- pauseOnDotsHover: false,
70
- respondTo: 'window',
71
- responsive: null,
72
- rows: 1,
73
- rtl: false,
74
- slide: '',
75
- slidesPerRow: 1,
76
- slidesToShow: 1,
77
- slidesToScroll: 1,
78
- speed: 500,
79
- swipe: true,
80
- swipeToSlide: false,
81
- touchMove: true,
82
- touchThreshold: 5,
83
- useCSS: true,
84
- useTransform: false,
85
- variableWidth: false,
86
- vertical: false,
87
- verticalSwiping: false,
88
- waitForAnimate: true,
89
- zIndex: 1000
90
- };
91
-
92
- _.initials = {
93
- animating: false,
94
- dragging: false,
95
- autoPlayTimer: null,
96
- currentDirection: 0,
97
- currentLeft: null,
98
- currentSlide: 0,
99
- direction: 1,
100
- $dots: null,
101
- listWidth: null,
102
- listHeight: null,
103
- loadIndex: 0,
104
- $nextArrow: null,
105
- $prevArrow: null,
106
- slideCount: null,
107
- slideWidth: null,
108
- $slideTrack: null,
109
- $slides: null,
110
- sliding: false,
111
- slideOffset: 0,
112
- swipeLeft: null,
113
- $list: null,
114
- touchObject: {},
115
- transformsEnabled: false,
116
- unslicked: false
117
- };
118
-
119
- $.extend(_, _.initials);
120
-
121
- _.activeBreakpoint = null;
122
- _.animType = null;
123
- _.animProp = null;
124
- _.breakpoints = [];
125
- _.breakpointSettings = [];
126
- _.cssTransitions = false;
127
- _.hidden = 'hidden';
128
- _.paused = false;
129
- _.positionProp = null;
130
- _.respondTo = null;
131
- _.rowCount = 1;
132
- _.shouldClick = true;
133
- _.$slider = $(element);
134
- _.$slidesCache = null;
135
- _.transformType = null;
136
- _.transitionType = null;
137
- _.visibilityChange = 'visibilitychange';
138
- _.windowWidth = 0;
139
- _.windowTimer = null;
140
-
141
- dataSettings = $(element).data('slick') || {};
142
-
143
- _.options = $.extend({}, _.defaults, dataSettings, settings);
144
-
145
- _.currentSlide = _.options.initialSlide;
146
-
147
- _.originalSettings = _.options;
148
-
149
- if (typeof document.mozHidden !== 'undefined') {
150
- _.hidden = 'mozHidden';
151
- _.visibilityChange = 'mozvisibilitychange';
152
- } else if (typeof document.webkitHidden !== 'undefined') {
153
- _.hidden = 'webkitHidden';
154
- _.visibilityChange = 'webkitvisibilitychange';
155
- }
156
-
157
- _.autoPlay = $.proxy(_.autoPlay, _);
158
- _.autoPlayClear = $.proxy(_.autoPlayClear, _);
159
- _.changeSlide = $.proxy(_.changeSlide, _);
160
- _.clickHandler = $.proxy(_.clickHandler, _);
161
- _.selectHandler = $.proxy(_.selectHandler, _);
162
- _.setPosition = $.proxy(_.setPosition, _);
163
- _.swipeHandler = $.proxy(_.swipeHandler, _);
164
- _.dragHandler = $.proxy(_.dragHandler, _);
165
- _.keyHandler = $.proxy(_.keyHandler, _);
166
- _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
167
-
168
- _.instanceUid = instanceUid++;
169
-
170
- // A simple way to check for HTML strings
171
- // Strict HTML recognition (must start with <)
172
- // Extracted from jQuery v1.11 source
173
- _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
174
-
175
-
176
- _.registerBreakpoints();
177
- _.init(true);
178
- _.checkResponsive(true);
179
-
180
- }
181
-
182
- return Slick;
183
-
184
- }());
185
-
186
- Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
187
-
188
- var _ = this;
189
-
190
- if (typeof(index) === 'boolean') {
191
- addBefore = index;
192
- index = null;
193
- } else if (index < 0 || (index >= _.slideCount)) {
194
- return false;
195
- }
196
-
197
- _.unload();
198
-
199
- if (typeof(index) === 'number') {
200
- if (index === 0 && _.$slides.length === 0) {
201
- $(markup).appendTo(_.$slideTrack);
202
- } else if (addBefore) {
203
- $(markup).insertBefore(_.$slides.eq(index));
204
- } else {
205
- $(markup).insertAfter(_.$slides.eq(index));
206
- }
207
- } else {
208
- if (addBefore === true) {
209
- $(markup).prependTo(_.$slideTrack);
210
- } else {
211
- $(markup).appendTo(_.$slideTrack);
212
- }
213
- }
214
-
215
- _.$slides = _.$slideTrack.children(this.options.slide);
216
-
217
- _.$slideTrack.children(this.options.slide).detach();
218
-
219
- _.$slideTrack.append(_.$slides);
220
-
221
- _.$slides.each(function(index, element) {
222
- $(element).attr('data-slick-index', index);
223
- });
224
-
225
- _.$slidesCache = _.$slides;
226
-
227
- _.reinit();
228
-
229
- };
230
-
231
- Slick.prototype.animateHeight = function() {
232
- var _ = this;
233
- if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
234
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
235
- _.$list.animate({
236
- height: targetHeight
237
- }, _.options.speed);
238
- }
239
- };
240
-
241
- Slick.prototype.animateSlide = function(targetLeft, callback) {
242
-
243
- var animProps = {},
244
- _ = this;
245
-
246
- _.animateHeight();
247
-
248
- if (_.options.rtl === true && _.options.vertical === false) {
249
- targetLeft = -targetLeft;
250
- }
251
- if (_.transformsEnabled === false) {
252
- if (_.options.vertical === false) {
253
- _.$slideTrack.animate({
254
- left: targetLeft
255
- }, _.options.speed, _.options.easing, callback);
256
- } else {
257
- _.$slideTrack.animate({
258
- top: targetLeft
259
- }, _.options.speed, _.options.easing, callback);
260
- }
261
-
262
- } else {
263
-
264
- if (_.cssTransitions === false) {
265
- if (_.options.rtl === true) {
266
- _.currentLeft = -(_.currentLeft);
267
- }
268
- $({
269
- animStart: _.currentLeft
270
- }).animate({
271
- animStart: targetLeft
272
- }, {
273
- duration: _.options.speed,
274
- easing: _.options.easing,
275
- step: function(now) {
276
- now = Math.ceil(now);
277
- if (_.options.vertical === false) {
278
- animProps[_.animType] = 'translate(' +
279
- now + 'px, 0px)';
280
- _.$slideTrack.css(animProps);
281
- } else {
282
- animProps[_.animType] = 'translate(0px,' +
283
- now + 'px)';
284
- _.$slideTrack.css(animProps);
285
- }
286
- },
287
- complete: function() {
288
- if (callback) {
289
- callback.call();
290
- }
291
- }
292
- });
293
-
294
- } else {
295
-
296
- _.applyTransition();
297
- targetLeft = Math.ceil(targetLeft);
298
-
299
- if (_.options.vertical === false) {
300
- animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
301
- } else {
302
- animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
303
- }
304
- _.$slideTrack.css(animProps);
305
-
306
- if (callback) {
307
- setTimeout(function() {
308
-
309
- _.disableTransition();
310
-
311
- callback.call();
312
- }, _.options.speed);
313
- }
314
-
315
- }
316
-
317
- }
318
-
319
- };
320
-
321
- Slick.prototype.asNavFor = function(index) {
322
-
323
- var _ = this,
324
- asNavFor = _.options.asNavFor;
325
-
326
- if ( asNavFor && asNavFor !== null ) {
327
- asNavFor = $(asNavFor).not(_.$slider);
328
- }
329
-
330
- if ( asNavFor !== null && typeof asNavFor === 'object' ) {
331
- asNavFor.each(function() {
332
- var target = $(this).slick('getSlick');
333
- if(!target.unslicked) {
334
- target.slideHandler(index, true);
335
- }
336
- });
337
- }
338
-
339
- };
340
-
341
- Slick.prototype.applyTransition = function(slide) {
342
-
343
- var _ = this,
344
- transition = {};
345
-
346
- if (_.options.fade === false) {
347
- transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
348
- } else {
349
- transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
350
- }
351
-
352
- if (_.options.fade === false) {
353
- _.$slideTrack.css(transition);
354
- } else {
355
- _.$slides.eq(slide).css(transition);
356
- }
357
-
358
- };
359
-
360
- Slick.prototype.autoPlay = function() {
361
-
362
- var _ = this;
363
-
364
- if (_.autoPlayTimer) {
365
- clearInterval(_.autoPlayTimer);
366
- }
367
-
368
- if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
369
- _.autoPlayTimer = setInterval(_.autoPlayIterator,
370
- _.options.autoplaySpeed);
371
- }
372
-
373
- };
374
-
375
- Slick.prototype.autoPlayClear = function() {
376
-
377
- var _ = this;
378
- if (_.autoPlayTimer) {
379
- clearInterval(_.autoPlayTimer);
380
- }
381
-
382
- };
383
-
384
- Slick.prototype.autoPlayIterator = function() {
385
-
386
- var _ = this;
387
-
388
- if (_.options.infinite === false) {
389
-
390
- if (_.direction === 1) {
391
-
392
- if ((_.currentSlide + 1) === _.slideCount -
393
- 1) {
394
- _.direction = 0;
395
- }
396
-
397
- _.slideHandler(_.currentSlide + _.options.slidesToScroll);
398
-
399
- } else {
400
-
401
- if ((_.currentSlide - 1 === 0)) {
402
-
403
- _.direction = 1;
404
-
405
- }
406
-
407
- _.slideHandler(_.currentSlide - _.options.slidesToScroll);
408
-
409
- }
410
-
411
- } else {
412
-
413
- _.slideHandler(_.currentSlide + _.options.slidesToScroll);
414
-
415
- }
416
-
417
- };
418
-
419
- Slick.prototype.buildArrows = function() {
420
-
421
- var _ = this;
422
-
423
- if (_.options.arrows === true ) {
424
-
425
- _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
426
- _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
427
-
428
- if( _.slideCount > _.options.slidesToShow ) {
429
-
430
- _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
431
- _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
432
-
433
- if (_.htmlExpr.test(_.options.prevArrow)) {
434
- _.$prevArrow.prependTo(_.options.appendArrows);
435
- }
436
-
437
- if (_.htmlExpr.test(_.options.nextArrow)) {
438
- _.$nextArrow.appendTo(_.options.appendArrows);
439
- }
440
-
441
- if (_.options.infinite !== true) {
442
- _.$prevArrow
443
- .addClass('slick-disabled')
444
- .attr('aria-disabled', 'true');
445
- }
446
-
447
- } else {
448
-
449
- _.$prevArrow.add( _.$nextArrow )
450
-
451
- .addClass('slick-hidden')
452
- .attr({
453
- 'aria-disabled': 'true',
454
- 'tabindex': '-1'
455
- });
456
-
457
- }
458
-
459
- }
460
-
461
- };
462
-
463
- Slick.prototype.buildDots = function() {
464
-
465
- var _ = this,
466
- i, dotString;
467
-
468
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
469
-
470
- dotString = '<ul class="' + _.options.dotsClass + '">';
471
-
472
- for (i = 0; i <= _.getDotCount(); i += 1) {
473
- dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
474
- }
475
-
476
- dotString += '</ul>';
477
-
478
- _.$dots = $(dotString).appendTo(
479
- _.options.appendDots);
480
-
481
- _.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
482
-
483
- }
484
-
485
- };
486
-
487
- Slick.prototype.buildOut = function() {
488
-
489
- var _ = this;
490
-
491
- _.$slides =
492
- _.$slider
493
- .children( _.options.slide + ':not(.slick-cloned)')
494
- .addClass('slick-slide');
495
-
496
- _.slideCount = _.$slides.length;
497
-
498
- _.$slides.each(function(index, element) {
499
- $(element)
500
- .attr('data-slick-index', index)
501
- .data('originalStyling', $(element).attr('style') || '');
502
- });
503
-
504
- _.$slider.addClass('slick-slider');
505
-
506
- _.$slideTrack = (_.slideCount === 0) ?
507
- $('<div class="slick-track"/>').appendTo(_.$slider) :
508
- _.$slides.wrapAll('<div class="slick-track"/>').parent();
509
-
510
- _.$list = _.$slideTrack.wrap(
511
- '<div aria-live="polite" class="slick-list"/>').parent();
512
- _.$slideTrack.css('opacity', 0);
513
-
514
- if (_.options.centerMode === true || _.options.swipeToSlide === true) {
515
- _.options.slidesToScroll = 1;
516
- }
517
-
518
- $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
519
-
520
- _.setupInfinite();
521
-
522
- _.buildArrows();
523
-
524
- _.buildDots();
525
-
526
- _.updateDots();
527
-
528
-
529
- _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
530
-
531
- if (_.options.draggable === true) {
532
- _.$list.addClass('draggable');
533
- }
534
-
535
- };
536
-
537
- Slick.prototype.buildRows = function() {
538
-
539
- var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
540
-
541
- newSlides = document.createDocumentFragment();
542
- originalSlides = _.$slider.children();
543
-
544
- if(_.options.rows > 1) {
545
-
546
- slidesPerSection = _.options.slidesPerRow * _.options.rows;
547
- numOfSlides = Math.ceil(
548
- originalSlides.length / slidesPerSection
549
- );
550
-
551
- for(a = 0; a < numOfSlides; a++){
552
- var slide = document.createElement('div');
553
- for(b = 0; b < _.options.rows; b++) {
554
- var row = document.createElement('div');
555
- for(c = 0; c < _.options.slidesPerRow; c++) {
556
- var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
557
- if (originalSlides.get(target)) {
558
- row.appendChild(originalSlides.get(target));
559
- }
560
- }
561
- slide.appendChild(row);
562
- }
563
- newSlides.appendChild(slide);
564
- }
565
-
566
- _.$slider.html(newSlides);
567
- _.$slider.children().children().children()
568
- .css({
569
- 'width':(100 / _.options.slidesPerRow) + '%',
570
- 'display': 'inline-block'
571
- });
572
-
573
- }
574
-
575
- };
576
-
577
- Slick.prototype.checkResponsive = function(initial, forceUpdate) {
578
-
579
- var _ = this,
580
- breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
581
- var sliderWidth = _.$slider.width();
582
- var windowWidth = window.innerWidth || $(window).width();
583
-
584
- if (_.respondTo === 'window') {
585
- respondToWidth = windowWidth;
586
- } else if (_.respondTo === 'slider') {
587
- respondToWidth = sliderWidth;
588
- } else if (_.respondTo === 'min') {
589
- respondToWidth = Math.min(windowWidth, sliderWidth);
590
- }
591
-
592
- if ( _.options.responsive &&
593
- _.options.responsive.length &&
594
- _.options.responsive !== null) {
595
-
596
- targetBreakpoint = null;
597
-
598
- for (breakpoint in _.breakpoints) {
599
- if (_.breakpoints.hasOwnProperty(breakpoint)) {
600
- if (_.originalSettings.mobileFirst === false) {
601
- if (respondToWidth < _.breakpoints[breakpoint]) {
602
- targetBreakpoint = _.breakpoints[breakpoint];
603
- }
604
- } else {
605
- if (respondToWidth > _.breakpoints[breakpoint]) {
606
- targetBreakpoint = _.breakpoints[breakpoint];
607
- }
608
- }
609
- }
610
- }
611
-
612
- if (targetBreakpoint !== null) {
613
- if (_.activeBreakpoint !== null) {
614
- if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
615
- _.activeBreakpoint =
616
- targetBreakpoint;
617
- if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
618
- _.unslick(targetBreakpoint);
619
- } else {
620
- _.options = $.extend({}, _.originalSettings,
621
- _.breakpointSettings[
622
- targetBreakpoint]);
623
- if (initial === true) {
624
- _.currentSlide = _.options.initialSlide;
625
- }
626
- _.refresh(initial);
627
- }
628
- triggerBreakpoint = targetBreakpoint;
629
- }
630
- } else {
631
- _.activeBreakpoint = targetBreakpoint;
632
- if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
633
- _.unslick(targetBreakpoint);
634
- } else {
635
- _.options = $.extend({}, _.originalSettings,
636
- _.breakpointSettings[
637
- targetBreakpoint]);
638
- if (initial === true) {
639
- _.currentSlide = _.options.initialSlide;
640
- }
641
- _.refresh(initial);
642
- }
643
- triggerBreakpoint = targetBreakpoint;
644
- }
645
- } else {
646
- if (_.activeBreakpoint !== null) {
647
- _.activeBreakpoint = null;
648
- _.options = _.originalSettings;
649
- if (initial === true) {
650
- _.currentSlide = _.options.initialSlide;
651
- }
652
- _.refresh(initial);
653
- triggerBreakpoint = targetBreakpoint;
654
- }
655
- }
656
-
657
- // only trigger breakpoints during an actual break. not on initialize.
658
- if( !initial && triggerBreakpoint !== false ) {
659
- _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
660
- }
661
- }
662
-
663
- };
664
-
665
- Slick.prototype.changeSlide = function(event, dontAnimate) {
666
-
667
- var _ = this,
668
- $target = $(event.target),
669
- indexOffset, slideOffset, unevenOffset;
670
-
671
- // If target is a link, prevent default action.
672
- if($target.is('a')) {
673
- event.preventDefault();
674
- }
675
-
676
- // If target is not the <li> element (ie: a child), find the <li>.
677
- if(!$target.is('li')) {
678
- $target = $target.closest('li');
679
- }
680
-
681
- unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
682
- indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
683
-
684
- switch (event.data.message) {
685
-
686
- case 'previous':
687
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
688
- if (_.slideCount > _.options.slidesToShow) {
689
- _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
690
- }
691
- break;
692
-
693
- case 'next':
694
- slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
695
- if (_.slideCount > _.options.slidesToShow) {
696
- _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
697
- }
698
- break;
699
-
700
- case 'index':
701
- var index = event.data.index === 0 ? 0 :
702
- event.data.index || $target.index() * _.options.slidesToScroll;
703
-
704
- _.slideHandler(_.checkNavigable(index), false, dontAnimate);
705
- $target.children().trigger('focus');
706
- break;
707
-
708
- default:
709
- return;
710
- }
711
-
712
- };
713
-
714
- Slick.prototype.checkNavigable = function(index) {
715
-
716
- var _ = this,
717
- navigables, prevNavigable;
718
-
719
- navigables = _.getNavigableIndexes();
720
- prevNavigable = 0;
721
- if (index > navigables[navigables.length - 1]) {
722
- index = navigables[navigables.length - 1];
723
- } else {
724
- for (var n in navigables) {
725
- if (index < navigables[n]) {
726
- index = prevNavigable;
727
- break;
728
- }
729
- prevNavigable = navigables[n];
730
- }
731
- }
732
-
733
- return index;
734
- };
735
-
736
- Slick.prototype.cleanUpEvents = function() {
737
-
738
- var _ = this;
739
-
740
- if (_.options.dots && _.$dots !== null) {
741
-
742
- $('li', _.$dots).off('click.slick', _.changeSlide);
743
-
744
- if (_.options.pauseOnDotsHover === true && _.options.autoplay === true) {
745
-
746
- $('li', _.$dots)
747
- .off('mouseenter.slick', $.proxy(_.setPaused, _, true))
748
- .off('mouseleave.slick', $.proxy(_.setPaused, _, false));
749
-
750
- }
751
-
752
- }
753
-
754
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
755
- _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
756
- _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
757
- }
758
-
759
- _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
760
- _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
761
- _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
762
- _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
763
-
764
- _.$list.off('click.slick', _.clickHandler);
765
-
766
- $(document).off(_.visibilityChange, _.visibility);
767
-
768
- _.$list.off('mouseenter.slick', $.proxy(_.setPaused, _, true));
769
- _.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false));
770
-
771
- if (_.options.accessibility === true) {
772
- _.$list.off('keydown.slick', _.keyHandler);
773
- }
774
-
775
- if (_.options.focusOnSelect === true) {
776
- $(_.$slideTrack).children().off('click.slick', _.selectHandler);
777
- }
778
-
779
- $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
780
-
781
- $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
782
-
783
- $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
784
-
785
- $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
786
- $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
787
- };
788
-
789
- Slick.prototype.cleanUpRows = function() {
790
-
791
- var _ = this, originalSlides;
792
-
793
- if(_.options.rows > 1) {
794
- originalSlides = _.$slides.children().children();
795
- originalSlides.removeAttr('style');
796
- _.$slider.html(originalSlides);
797
- }
798
-
799
- };
800
-
801
- Slick.prototype.clickHandler = function(event) {
802
-
803
- var _ = this;
804
-
805
- if (_.shouldClick === false) {
806
- event.stopImmediatePropagation();
807
- event.stopPropagation();
808
- event.preventDefault();
809
- }
810
-
811
- };
812
-
813
- Slick.prototype.destroy = function(refresh) {
814
-
815
- var _ = this;
816
-
817
- _.autoPlayClear();
818
-
819
- _.touchObject = {};
820
-
821
- _.cleanUpEvents();
822
-
823
- $('.slick-cloned', _.$slider).detach();
824
-
825
- if (_.$dots) {
826
- _.$dots.remove();
827
- }
828
-
829
-
830
- if ( _.$prevArrow && _.$prevArrow.length ) {
831
-
832
- _.$prevArrow
833
- .removeClass('slick-disabled slick-arrow slick-hidden')
834
- .removeAttr('aria-hidden aria-disabled tabindex')
835
- .css("display","");
836
-
837
- if ( _.htmlExpr.test( _.options.prevArrow )) {
838
- _.$prevArrow.remove();
839
- }
840
- }
841
-
842
- if ( _.$nextArrow && _.$nextArrow.length ) {
843
-
844
- _.$nextArrow
845
- .removeClass('slick-disabled slick-arrow slick-hidden')
846
- .removeAttr('aria-hidden aria-disabled tabindex')
847
- .css("display","");
848
-
849
- if ( _.htmlExpr.test( _.options.nextArrow )) {
850
- _.$nextArrow.remove();
851
- }
852
-
853
- }
854
-
855
-
856
- if (_.$slides) {
857
-
858
- _.$slides
859
- .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
860
- .removeAttr('aria-hidden')
861
- .removeAttr('data-slick-index')
862
- .each(function(){
863
- $(this).attr('style', $(this).data('originalStyling'));
864
- });
865
-
866
- _.$slideTrack.children(this.options.slide).detach();
867
-
868
- _.$slideTrack.detach();
869
-
870
- _.$list.detach();
871
-
872
- _.$slider.append(_.$slides);
873
- }
874
-
875
- _.cleanUpRows();
876
-
877
- _.$slider.removeClass('slick-slider');
878
- _.$slider.removeClass('slick-initialized');
879
-
880
- _.unslicked = true;
881
-
882
- if(!refresh) {
883
- _.$slider.trigger('destroy', [_]);
884
- }
885
-
886
- };
887
-
888
- Slick.prototype.disableTransition = function(slide) {
889
-
890
- var _ = this,
891
- transition = {};
892
-
893
- transition[_.transitionType] = '';
894
-
895
- if (_.options.fade === false) {
896
- _.$slideTrack.css(transition);
897
- } else {
898
- _.$slides.eq(slide).css(transition);
899
- }
900
-
901
- };
902
-
903
- Slick.prototype.fadeSlide = function(slideIndex, callback) {
904
-
905
- var _ = this;
906
-
907
- if (_.cssTransitions === false) {
908
-
909
- _.$slides.eq(slideIndex).css({
910
- zIndex: _.options.zIndex
911
- });
912
-
913
- _.$slides.eq(slideIndex).animate({
914
- opacity: 1
915
- }, _.options.speed, _.options.easing, callback);
916
-
917
- } else {
918
-
919
- _.applyTransition(slideIndex);
920
-
921
- _.$slides.eq(slideIndex).css({
922
- opacity: 1,
923
- zIndex: _.options.zIndex
924
- });
925
-
926
- if (callback) {
927
- setTimeout(function() {
928
-
929
- _.disableTransition(slideIndex);
930
-
931
- callback.call();
932
- }, _.options.speed);
933
- }
934
-
935
- }
936
-
937
- };
938
-
939
- Slick.prototype.fadeSlideOut = function(slideIndex) {
940
-
941
- var _ = this;
942
-
943
- if (_.cssTransitions === false) {
944
-
945
- _.$slides.eq(slideIndex).animate({
946
- opacity: 0,
947
- zIndex: _.options.zIndex - 2
948
- }, _.options.speed, _.options.easing);
949
-
950
- } else {
951
-
952
- _.applyTransition(slideIndex);
953
-
954
- _.$slides.eq(slideIndex).css({
955
- opacity: 0,
956
- zIndex: _.options.zIndex - 2
957
- });
958
-
959
- }
960
-
961
- };
962
-
963
- Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
964
-
965
- var _ = this;
966
-
967
- if (filter !== null) {
968
-
969
- _.$slidesCache = _.$slides;
970
-
971
- _.unload();
972
-
973
- _.$slideTrack.children(this.options.slide).detach();
974
-
975
- _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
976
-
977
- _.reinit();
978
-
979
- }
980
-
981
- };
982
-
983
- Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
984
-
985
- var _ = this;
986
- return _.currentSlide;
987
-
988
- };
989
-
990
- Slick.prototype.getDotCount = function() {
991
-
992
- var _ = this;
993
-
994
- var breakPoint = 0;
995
- var counter = 0;
996
- var pagerQty = 0;
997
-
998
- if (_.options.infinite === true) {
999
- while (breakPoint < _.slideCount) {
1000
- ++pagerQty;
1001
- breakPoint = counter + _.options.slidesToScroll;
1002
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1003
- }
1004
- } else if (_.options.centerMode === true) {
1005
- pagerQty = _.slideCount;
1006
- } else {
1007
- while (breakPoint < _.slideCount) {
1008
- ++pagerQty;
1009
- breakPoint = counter + _.options.slidesToScroll;
1010
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1011
- }
1012
- }
1013
-
1014
- return pagerQty - 1;
1015
-
1016
- };
1017
-
1018
- Slick.prototype.getLeft = function(slideIndex) {
1019
-
1020
- var _ = this,
1021
- targetLeft,
1022
- verticalHeight,
1023
- verticalOffset = 0,
1024
- targetSlide;
1025
-
1026
- _.slideOffset = 0;
1027
- verticalHeight = _.$slides.first().outerHeight(true);
1028
-
1029
- if (_.options.infinite === true) {
1030
- if (_.slideCount > _.options.slidesToShow) {
1031
- _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
1032
- verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
1033
- }
1034
- if (_.slideCount % _.options.slidesToScroll !== 0) {
1035
- if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
1036
- if (slideIndex > _.slideCount) {
1037
- _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
1038
- verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
1039
- } else {
1040
- _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
1041
- verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
1042
- }
1043
- }
1044
- }
1045
- } else {
1046
- if (slideIndex + _.options.slidesToShow > _.slideCount) {
1047
- _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
1048
- verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
1049
- }
1050
- }
1051
-
1052
- if (_.slideCount <= _.options.slidesToShow) {
1053
- _.slideOffset = 0;
1054
- verticalOffset = 0;
1055
- }
1056
-
1057
- if (_.options.centerMode === true && _.options.infinite === true) {
1058
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1059
- } else if (_.options.centerMode === true) {
1060
- _.slideOffset = 0;
1061
- _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1062
- }
1063
-
1064
- if (_.options.vertical === false) {
1065
- targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
1066
- } else {
1067
- targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
1068
- }
1069
-
1070
- if (_.options.variableWidth === true) {
1071
-
1072
- if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1073
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1074
- } else {
1075
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
1076
- }
1077
-
1078
- if (_.options.rtl === true) {
1079
- if (targetSlide[0]) {
1080
- targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1081
- } else {
1082
- targetLeft = 0;
1083
- }
1084
- } else {
1085
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1086
- }
1087
-
1088
- if (_.options.centerMode === true) {
1089
- if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1090
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1091
- } else {
1092
- targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
1093
- }
1094
-
1095
- if (_.options.rtl === true) {
1096
- if (targetSlide[0]) {
1097
- targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1098
- } else {
1099
- targetLeft = 0;
1100
- }
1101
- } else {
1102
- targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1103
- }
1104
-
1105
- targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1106
- }
1107
- }
1108
-
1109
- return targetLeft;
1110
-
1111
- };
1112
-
1113
- Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
1114
-
1115
- var _ = this;
1116
-
1117
- return _.options[option];
1118
-
1119
- };
1120
-
1121
- Slick.prototype.getNavigableIndexes = function() {
1122
-
1123
- var _ = this,
1124
- breakPoint = 0,
1125
- counter = 0,
1126
- indexes = [],
1127
- max;
1128
-
1129
- if (_.options.infinite === false) {
1130
- max = _.slideCount;
1131
- } else {
1132
- breakPoint = _.options.slidesToScroll * -1;
1133
- counter = _.options.slidesToScroll * -1;
1134
- max = _.slideCount * 2;
1135
- }
1136
-
1137
- while (breakPoint < max) {
1138
- indexes.push(breakPoint);
1139
- breakPoint = counter + _.options.slidesToScroll;
1140
- counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1141
- }
1142
-
1143
- return indexes;
1144
-
1145
- };
1146
-
1147
- Slick.prototype.getSlick = function() {
1148
-
1149
- return this;
1150
-
1151
- };
1152
-
1153
- Slick.prototype.getSlideCount = function() {
1154
-
1155
- var _ = this,
1156
- slidesTraversed, swipedSlide, centerOffset;
1157
-
1158
- centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1159
-
1160
- if (_.options.swipeToSlide === true) {
1161
- _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1162
- if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1163
- swipedSlide = slide;
1164
- return false;
1165
- }
1166
- });
1167
-
1168
- slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
1169
-
1170
- return slidesTraversed;
1171
-
1172
- } else {
1173
- return _.options.slidesToScroll;
1174
- }
1175
-
1176
- };
1177
-
1178
- Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
1179
-
1180
- var _ = this;
1181
-
1182
- _.changeSlide({
1183
- data: {
1184
- message: 'index',
1185
- index: parseInt(slide)
1186
- }
1187
- }, dontAnimate);
1188
-
1189
- };
1190
-
1191
- Slick.prototype.init = function(creation) {
1192
-
1193
- var _ = this;
1194
-
1195
- if (!$(_.$slider).hasClass('slick-initialized')) {
1196
-
1197
- $(_.$slider).addClass('slick-initialized');
1198
-
1199
- _.buildRows();
1200
- _.buildOut();
1201
- _.setProps();
1202
- _.startLoad();
1203
- _.loadSlider();
1204
- _.initializeEvents();
1205
- _.updateArrows();
1206
- _.updateDots();
1207
-
1208
- }
1209
-
1210
- if (creation) {
1211
- _.$slider.trigger('init', [_]);
1212
- }
1213
-
1214
- if (_.options.accessibility === true) {
1215
- _.initADA();
1216
- }
1217
-
1218
- };
1219
-
1220
- Slick.prototype.initArrowEvents = function() {
1221
-
1222
- var _ = this;
1223
-
1224
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1225
- _.$prevArrow.on('click.slick', {
1226
- message: 'previous'
1227
- }, _.changeSlide);
1228
- _.$nextArrow.on('click.slick', {
1229
- message: 'next'
1230
- }, _.changeSlide);
1231
- }
1232
-
1233
- };
1234
-
1235
- Slick.prototype.initDotEvents = function() {
1236
-
1237
- var _ = this;
1238
-
1239
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1240
- $('li', _.$dots).on('click.slick', {
1241
- message: 'index'
1242
- }, _.changeSlide);
1243
- }
1244
-
1245
- if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
1246
- $('li', _.$dots)
1247
- .on('mouseenter.slick', $.proxy(_.setPaused, _, true))
1248
- .on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1249
- }
1250
-
1251
- };
1252
-
1253
- Slick.prototype.initializeEvents = function() {
1254
-
1255
- var _ = this;
1256
-
1257
- _.initArrowEvents();
1258
-
1259
- _.initDotEvents();
1260
-
1261
- _.$list.on('touchstart.slick mousedown.slick', {
1262
- action: 'start'
1263
- }, _.swipeHandler);
1264
- _.$list.on('touchmove.slick mousemove.slick', {
1265
- action: 'move'
1266
- }, _.swipeHandler);
1267
- _.$list.on('touchend.slick mouseup.slick', {
1268
- action: 'end'
1269
- }, _.swipeHandler);
1270
- _.$list.on('touchcancel.slick mouseleave.slick', {
1271
- action: 'end'
1272
- }, _.swipeHandler);
1273
-
1274
- _.$list.on('click.slick', _.clickHandler);
1275
-
1276
- $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1277
-
1278
- _.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true));
1279
- _.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1280
-
1281
- if (_.options.accessibility === true) {
1282
- _.$list.on('keydown.slick', _.keyHandler);
1283
- }
1284
-
1285
- if (_.options.focusOnSelect === true) {
1286
- $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1287
- }
1288
-
1289
- $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1290
-
1291
- $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1292
-
1293
- $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1294
-
1295
- $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1296
- $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
1297
-
1298
- };
1299
-
1300
- Slick.prototype.initUI = function() {
1301
-
1302
- var _ = this;
1303
-
1304
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1305
-
1306
- _.$prevArrow.show();
1307
- _.$nextArrow.show();
1308
-
1309
- }
1310
-
1311
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1312
-
1313
- _.$dots.show();
1314
-
1315
- }
1316
-
1317
- if (_.options.autoplay === true) {
1318
-
1319
- _.autoPlay();
1320
-
1321
- }
1322
-
1323
- };
1324
-
1325
- Slick.prototype.keyHandler = function(event) {
1326
-
1327
- var _ = this;
1328
- //Dont slide if the cursor is inside the form fields and arrow keys are pressed
1329
- if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
1330
- if (event.keyCode === 37 && _.options.accessibility === true) {
1331
- _.changeSlide({
1332
- data: {
1333
- message: 'previous'
1334
- }
1335
- });
1336
- } else if (event.keyCode === 39 && _.options.accessibility === true) {
1337
- _.changeSlide({
1338
- data: {
1339
- message: 'next'
1340
- }
1341
- });
1342
- }
1343
- }
1344
-
1345
- };
1346
-
1347
- Slick.prototype.lazyLoad = function() {
1348
-
1349
- var _ = this,
1350
- loadRange, cloneRange, rangeStart, rangeEnd;
1351
-
1352
- function loadImages(imagesScope) {
1353
- $('img[data-lazy]', imagesScope).each(function() {
1354
-
1355
- var image = $(this),
1356
- imageSource = $(this).attr('data-lazy'),
1357
- imageToLoad = document.createElement('img');
1358
-
1359
- imageToLoad.onload = function() {
1360
- image
1361
- .animate({ opacity: 0 }, 100, function() {
1362
- image
1363
- .attr('src', imageSource)
1364
- .animate({ opacity: 1 }, 200, function() {
1365
- image
1366
- .removeAttr('data-lazy')
1367
- .removeClass('slick-loading');
1368
- });
1369
- });
1370
- };
1371
-
1372
- imageToLoad.src = imageSource;
1373
-
1374
- });
1375
- }
1376
-
1377
- if (_.options.centerMode === true) {
1378
- if (_.options.infinite === true) {
1379
- rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
1380
- rangeEnd = rangeStart + _.options.slidesToShow + 2;
1381
- } else {
1382
- rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
1383
- rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
1384
- }
1385
- } else {
1386
- rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1387
- rangeEnd = rangeStart + _.options.slidesToShow;
1388
- if (_.options.fade === true) {
1389
- if (rangeStart > 0) rangeStart--;
1390
- if (rangeEnd <= _.slideCount) rangeEnd++;
1391
- }
1392
- }
1393
-
1394
- loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1395
- loadImages(loadRange);
1396
-
1397
- if (_.slideCount <= _.options.slidesToShow) {
1398
- cloneRange = _.$slider.find('.slick-slide');
1399
- loadImages(cloneRange);
1400
- } else
1401
- if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1402
- cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1403
- loadImages(cloneRange);
1404
- } else if (_.currentSlide === 0) {
1405
- cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1406
- loadImages(cloneRange);
1407
- }
1408
-
1409
- };
1410
-
1411
- Slick.prototype.loadSlider = function() {
1412
-
1413
- var _ = this;
1414
-
1415
- _.setPosition();
1416
-
1417
- _.$slideTrack.css({
1418
- opacity: 1
1419
- });
1420
-
1421
- _.$slider.removeClass('slick-loading');
1422
-
1423
- _.initUI();
1424
-
1425
- if (_.options.lazyLoad === 'progressive') {
1426
- _.progressiveLazyLoad();
1427
- }
1428
-
1429
- };
1430
-
1431
- Slick.prototype.next = Slick.prototype.slickNext = function() {
1432
-
1433
- var _ = this;
1434
-
1435
- _.changeSlide({
1436
- data: {
1437
- message: 'next'
1438
- }
1439
- });
1440
-
1441
- };
1442
-
1443
- Slick.prototype.orientationChange = function() {
1444
-
1445
- var _ = this;
1446
-
1447
- _.checkResponsive();
1448
- _.setPosition();
1449
-
1450
- };
1451
-
1452
- Slick.prototype.pause = Slick.prototype.slickPause = function() {
1453
-
1454
- var _ = this;
1455
-
1456
- _.autoPlayClear();
1457
- _.paused = true;
1458
-
1459
- };
1460
-
1461
- Slick.prototype.play = Slick.prototype.slickPlay = function() {
1462
-
1463
- var _ = this;
1464
-
1465
- _.paused = false;
1466
- _.autoPlay();
1467
-
1468
- };
1469
-
1470
- Slick.prototype.postSlide = function(index) {
1471
-
1472
- var _ = this;
1473
-
1474
- _.$slider.trigger('afterChange', [_, index]);
1475
-
1476
- _.animating = false;
1477
-
1478
- _.setPosition();
1479
-
1480
- _.swipeLeft = null;
1481
-
1482
- if (_.options.autoplay === true && _.paused === false) {
1483
- _.autoPlay();
1484
- }
1485
- if (_.options.accessibility === true) {
1486
- _.initADA();
1487
- }
1488
-
1489
- };
1490
-
1491
- Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1492
-
1493
- var _ = this;
1494
-
1495
- _.changeSlide({
1496
- data: {
1497
- message: 'previous'
1498
- }
1499
- });
1500
-
1501
- };
1502
-
1503
- Slick.prototype.preventDefault = function(event) {
1504
- event.preventDefault();
1505
- };
1506
-
1507
- Slick.prototype.progressiveLazyLoad = function() {
1508
-
1509
- var _ = this,
1510
- imgCount, targetImage;
1511
-
1512
- imgCount = $('img[data-lazy]', _.$slider).length;
1513
-
1514
- if (imgCount > 0) {
1515
- targetImage = $('img[data-lazy]', _.$slider).first();
1516
- targetImage.attr('src', null);
1517
- targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
1518
- targetImage.removeAttr('data-lazy');
1519
- _.progressiveLazyLoad();
1520
-
1521
- if (_.options.adaptiveHeight === true) {
1522
- _.setPosition();
1523
- }
1524
- })
1525
- .error(function() {
1526
- targetImage.removeAttr('data-lazy');
1527
- _.progressiveLazyLoad();
1528
- });
1529
- }
1530
-
1531
- };
1532
-
1533
- Slick.prototype.refresh = function( initializing ) {
1534
-
1535
- var _ = this, currentSlide, firstVisible;
1536
-
1537
- firstVisible = _.slideCount - _.options.slidesToShow;
1538
-
1539
- // check that the new breakpoint can actually accept the
1540
- // "current slide" as the current slide, otherwise we need
1541
- // to set it to the closest possible value.
1542
- if ( !_.options.infinite ) {
1543
- if ( _.slideCount <= _.options.slidesToShow ) {
1544
- _.currentSlide = 0;
1545
- } else if ( _.currentSlide > firstVisible ) {
1546
- _.currentSlide = firstVisible;
1547
- }
1548
- }
1549
-
1550
- currentSlide = _.currentSlide;
1551
-
1552
- _.destroy(true);
1553
-
1554
- $.extend(_, _.initials, { currentSlide: currentSlide });
1555
-
1556
- _.init();
1557
-
1558
- if( !initializing ) {
1559
-
1560
- _.changeSlide({
1561
- data: {
1562
- message: 'index',
1563
- index: currentSlide
1564
- }
1565
- }, false);
1566
-
1567
- }
1568
-
1569
- };
1570
-
1571
- Slick.prototype.registerBreakpoints = function() {
1572
-
1573
- var _ = this, breakpoint, currentBreakpoint, l,
1574
- responsiveSettings = _.options.responsive || null;
1575
-
1576
- if ( $.type(responsiveSettings) === "array" && responsiveSettings.length ) {
1577
-
1578
- _.respondTo = _.options.respondTo || 'window';
1579
-
1580
- for ( breakpoint in responsiveSettings ) {
1581
-
1582
- l = _.breakpoints.length-1;
1583
- currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
1584
-
1585
- if (responsiveSettings.hasOwnProperty(breakpoint)) {
1586
-
1587
- // loop through the breakpoints and cut out any existing
1588
- // ones with the same breakpoint number, we don't want dupes.
1589
- while( l >= 0 ) {
1590
- if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
1591
- _.breakpoints.splice(l,1);
1592
- }
1593
- l--;
1594
- }
1595
-
1596
- _.breakpoints.push(currentBreakpoint);
1597
- _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
1598
-
1599
- }
1600
-
1601
- }
1602
-
1603
- _.breakpoints.sort(function(a, b) {
1604
- return ( _.options.mobileFirst ) ? a-b : b-a;
1605
- });
1606
-
1607
- }
1608
-
1609
- };
1610
-
1611
- Slick.prototype.reinit = function() {
1612
-
1613
- var _ = this;
1614
-
1615
- _.$slides =
1616
- _.$slideTrack
1617
- .children(_.options.slide)
1618
- .addClass('slick-slide');
1619
-
1620
- _.slideCount = _.$slides.length;
1621
-
1622
- if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1623
- _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1624
- }
1625
-
1626
- if (_.slideCount <= _.options.slidesToShow) {
1627
- _.currentSlide = 0;
1628
- }
1629
-
1630
- _.registerBreakpoints();
1631
-
1632
- _.setProps();
1633
- _.setupInfinite();
1634
- _.buildArrows();
1635
- _.updateArrows();
1636
- _.initArrowEvents();
1637
- _.buildDots();
1638
- _.updateDots();
1639
- _.initDotEvents();
1640
-
1641
- _.checkResponsive(false, true);
1642
-
1643
- if (_.options.focusOnSelect === true) {
1644
- $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1645
- }
1646
-
1647
- _.setSlideClasses(0);
1648
-
1649
- _.setPosition();
1650
-
1651
- _.$slider.trigger('reInit', [_]);
1652
-
1653
- if (_.options.autoplay === true) {
1654
- _.focusHandler();
1655
- }
1656
-
1657
- };
1658
-
1659
- Slick.prototype.resize = function() {
1660
-
1661
- var _ = this;
1662
-
1663
- if ($(window).width() !== _.windowWidth) {
1664
- clearTimeout(_.windowDelay);
1665
- _.windowDelay = window.setTimeout(function() {
1666
- _.windowWidth = $(window).width();
1667
- _.checkResponsive();
1668
- if( !_.unslicked ) { _.setPosition(); }
1669
- }, 50);
1670
- }
1671
- };
1672
-
1673
- Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1674
-
1675
- var _ = this;
1676
-
1677
- if (typeof(index) === 'boolean') {
1678
- removeBefore = index;
1679
- index = removeBefore === true ? 0 : _.slideCount - 1;
1680
- } else {
1681
- index = removeBefore === true ? --index : index;
1682
- }
1683
-
1684
- if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1685
- return false;
1686
- }
1687
-
1688
- _.unload();
1689
-
1690
- if (removeAll === true) {
1691
- _.$slideTrack.children().remove();
1692
- } else {
1693
- _.$slideTrack.children(this.options.slide).eq(index).remove();
1694
- }
1695
-
1696
- _.$slides = _.$slideTrack.children(this.options.slide);
1697
-
1698
- _.$slideTrack.children(this.options.slide).detach();
1699
-
1700
- _.$slideTrack.append(_.$slides);
1701
-
1702
- _.$slidesCache = _.$slides;
1703
-
1704
- _.reinit();
1705
-
1706
- };
1707
-
1708
- Slick.prototype.setCSS = function(position) {
1709
-
1710
- var _ = this,
1711
- positionProps = {},
1712
- x, y;
1713
-
1714
- if (_.options.rtl === true) {
1715
- position = -position;
1716
- }
1717
- x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
1718
- y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
1719
-
1720
- positionProps[_.positionProp] = position;
1721
-
1722
- if (_.transformsEnabled === false) {
1723
- _.$slideTrack.css(positionProps);
1724
- } else {
1725
- positionProps = {};
1726
- if (_.cssTransitions === false) {
1727
- positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1728
- _.$slideTrack.css(positionProps);
1729
- } else {
1730
- positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1731
- _.$slideTrack.css(positionProps);
1732
- }
1733
- }
1734
-
1735
- };
1736
-
1737
- Slick.prototype.setDimensions = function() {
1738
-
1739
- var _ = this;
1740
-
1741
- if (_.options.vertical === false) {
1742
- if (_.options.centerMode === true) {
1743
- _.$list.css({
1744
- padding: ('0px ' + _.options.centerPadding)
1745
- });
1746
- }
1747
- } else {
1748
- _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1749
- if (_.options.centerMode === true) {
1750
- _.$list.css({
1751
- padding: (_.options.centerPadding + ' 0px')
1752
- });
1753
- }
1754
- }
1755
-
1756
- _.listWidth = _.$list.width();
1757
- _.listHeight = _.$list.height();
1758
-
1759
-
1760
- if (_.options.vertical === false && _.options.variableWidth === false) {
1761
- _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1762
- _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1763
-
1764
- } else if (_.options.variableWidth === true) {
1765
- _.$slideTrack.width(5000 * _.slideCount);
1766
- } else {
1767
- _.slideWidth = Math.ceil(_.listWidth);
1768
- _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1769
- }
1770
-
1771
- var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1772
- if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1773
-
1774
- };
1775
-
1776
- Slick.prototype.setFade = function() {
1777
-
1778
- var _ = this,
1779
- targetLeft;
1780
-
1781
- _.$slides.each(function(index, element) {
1782
- targetLeft = (_.slideWidth * index) * -1;
1783
- if (_.options.rtl === true) {
1784
- $(element).css({
1785
- position: 'relative',
1786
- right: targetLeft,
1787
- top: 0,
1788
- zIndex: _.options.zIndex - 2,
1789
- opacity: 0
1790
- });
1791
- } else {
1792
- $(element).css({
1793
- position: 'relative',
1794
- left: targetLeft,
1795
- top: 0,
1796
- zIndex: _.options.zIndex - 2,
1797
- opacity: 0
1798
- });
1799
- }
1800
- });
1801
-
1802
- _.$slides.eq(_.currentSlide).css({
1803
- zIndex: _.options.zIndex - 1,
1804
- opacity: 1
1805
- });
1806
-
1807
- };
1808
-
1809
- Slick.prototype.setHeight = function() {
1810
-
1811
- var _ = this;
1812
-
1813
- if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
1814
- var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
1815
- _.$list.css('height', targetHeight);
1816
- }
1817
-
1818
- };
1819
-
1820
- Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) {
1821
-
1822
- var _ = this, l, item;
1823
-
1824
- if( option === "responsive" && $.type(value) === "array" ) {
1825
- for ( item in value ) {
1826
- if( $.type( _.options.responsive ) !== "array" ) {
1827
- _.options.responsive = [ value[item] ];
1828
- } else {
1829
- l = _.options.responsive.length-1;
1830
- // loop through the responsive object and splice out duplicates.
1831
- while( l >= 0 ) {
1832
- if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
1833
- _.options.responsive.splice(l,1);
1834
- }
1835
- l--;
1836
- }
1837
- _.options.responsive.push( value[item] );
1838
- }
1839
- }
1840
- } else {
1841
- _.options[option] = value;
1842
- }
1843
-
1844
- if (refresh === true) {
1845
- _.unload();
1846
- _.reinit();
1847
- }
1848
-
1849
- };
1850
-
1851
- Slick.prototype.setPosition = function() {
1852
-
1853
- var _ = this;
1854
-
1855
- _.setDimensions();
1856
-
1857
- _.setHeight();
1858
-
1859
- if (_.options.fade === false) {
1860
- _.setCSS(_.getLeft(_.currentSlide));
1861
- } else {
1862
- _.setFade();
1863
- }
1864
-
1865
- _.$slider.trigger('setPosition', [_]);
1866
-
1867
- };
1868
-
1869
- Slick.prototype.setProps = function() {
1870
-
1871
- var _ = this,
1872
- bodyStyle = document.body.style;
1873
-
1874
- _.positionProp = _.options.vertical === true ? 'top' : 'left';
1875
-
1876
- if (_.positionProp === 'top') {
1877
- _.$slider.addClass('slick-vertical');
1878
- } else {
1879
- _.$slider.removeClass('slick-vertical');
1880
- }
1881
-
1882
- if (bodyStyle.WebkitTransition !== undefined ||
1883
- bodyStyle.MozTransition !== undefined ||
1884
- bodyStyle.msTransition !== undefined) {
1885
- if (_.options.useCSS === true) {
1886
- _.cssTransitions = true;
1887
- }
1888
- }
1889
-
1890
- if ( _.options.fade ) {
1891
- if ( typeof _.options.zIndex === 'number' ) {
1892
- if( _.options.zIndex < 3 ) {
1893
- _.options.zIndex = 3;
1894
- }
1895
- } else {
1896
- _.options.zIndex = _.defaults.zIndex;
1897
- }
1898
- }
1899
-
1900
- if (bodyStyle.OTransform !== undefined) {
1901
- _.animType = 'OTransform';
1902
- _.transformType = '-o-transform';
1903
- _.transitionType = 'OTransition';
1904
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1905
- }
1906
- if (bodyStyle.MozTransform !== undefined) {
1907
- _.animType = 'MozTransform';
1908
- _.transformType = '-moz-transform';
1909
- _.transitionType = 'MozTransition';
1910
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
1911
- }
1912
- if (bodyStyle.webkitTransform !== undefined) {
1913
- _.animType = 'webkitTransform';
1914
- _.transformType = '-webkit-transform';
1915
- _.transitionType = 'webkitTransition';
1916
- if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1917
- }
1918
- if (bodyStyle.msTransform !== undefined) {
1919
- _.animType = 'msTransform';
1920
- _.transformType = '-ms-transform';
1921
- _.transitionType = 'msTransition';
1922
- if (bodyStyle.msTransform === undefined) _.animType = false;
1923
- }
1924
- if (bodyStyle.transform !== undefined && _.animType !== false) {
1925
- _.animType = 'transform';
1926
- _.transformType = 'transform';
1927
- _.transitionType = 'transition';
1928
- }
1929
- _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
1930
- };
1931
-
1932
-
1933
- Slick.prototype.setSlideClasses = function(index) {
1934
-
1935
- var _ = this,
1936
- centerOffset, allSlides, indexOffset, remainder;
1937
-
1938
- allSlides = _.$slider
1939
- .find('.slick-slide')
1940
- .removeClass('slick-active slick-center slick-current')
1941
- .attr('aria-hidden', 'true');
1942
-
1943
- _.$slides
1944
- .eq(index)
1945
- .addClass('slick-current');
1946
-
1947
- if (_.options.centerMode === true) {
1948
-
1949
- centerOffset = Math.floor(_.options.slidesToShow / 2);
1950
-
1951
- if (_.options.infinite === true) {
1952
-
1953
- if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
1954
-
1955
- _.$slides
1956
- .slice(index - centerOffset, index + centerOffset + 1)
1957
- .addClass('slick-active')
1958
- .attr('aria-hidden', 'false');
1959
-
1960
- } else {
1961
-
1962
- indexOffset = _.options.slidesToShow + index;
1963
- allSlides
1964
- .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
1965
- .addClass('slick-active')
1966
- .attr('aria-hidden', 'false');
1967
-
1968
- }
1969
-
1970
- if (index === 0) {
1971
-
1972
- allSlides
1973
- .eq(allSlides.length - 1 - _.options.slidesToShow)
1974
- .addClass('slick-center');
1975
-
1976
- } else if (index === _.slideCount - 1) {
1977
-
1978
- allSlides
1979
- .eq(_.options.slidesToShow)
1980
- .addClass('slick-center');
1981
-
1982
- }
1983
-
1984
- }
1985
-
1986
- _.$slides
1987
- .eq(index)
1988
- .addClass('slick-center');
1989
-
1990
- } else {
1991
-
1992
- if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
1993
-
1994
- _.$slides
1995
- .slice(index, index + _.options.slidesToShow)
1996
- .addClass('slick-active')
1997
- .attr('aria-hidden', 'false');
1998
-
1999
- } else if (allSlides.length <= _.options.slidesToShow) {
2000
-
2001
- allSlides
2002
- .addClass('slick-active')
2003
- .attr('aria-hidden', 'false');
2004
-
2005
- } else {
2006
-
2007
- remainder = _.slideCount % _.options.slidesToShow;
2008
- indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
2009
-
2010
- if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
2011
-
2012
- allSlides
2013
- .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
2014
- .addClass('slick-active')
2015
- .attr('aria-hidden', 'false');
2016
-
2017
- } else {
2018
-
2019
- allSlides
2020
- .slice(indexOffset, indexOffset + _.options.slidesToShow)
2021
- .addClass('slick-active')
2022
- .attr('aria-hidden', 'false');
2023
-
2024
- }
2025
-
2026
- }
2027
-
2028
- }
2029
-
2030
- if (_.options.lazyLoad === 'ondemand') {
2031
- _.lazyLoad();
2032
- }
2033
-
2034
- };
2035
-
2036
- Slick.prototype.setupInfinite = function() {
2037
-
2038
- var _ = this,
2039
- i, slideIndex, infiniteCount;
2040
-
2041
- if (_.options.fade === true) {
2042
- _.options.centerMode = false;
2043
- }
2044
-
2045
- if (_.options.infinite === true && _.options.fade === false) {
2046
-
2047
- slideIndex = null;
2048
-
2049
- if (_.slideCount > _.options.slidesToShow) {
2050
-
2051
- if (_.options.centerMode === true) {
2052
- infiniteCount = _.options.slidesToShow + 1;
2053
- } else {
2054
- infiniteCount = _.options.slidesToShow;
2055
- }
2056
-
2057
- for (i = _.slideCount; i > (_.slideCount -
2058
- infiniteCount); i -= 1) {
2059
- slideIndex = i - 1;
2060
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
2061
- .attr('data-slick-index', slideIndex - _.slideCount)
2062
- .prependTo(_.$slideTrack).addClass('slick-cloned');
2063
- }
2064
- for (i = 0; i < infiniteCount; i += 1) {
2065
- slideIndex = i;
2066
- $(_.$slides[slideIndex]).clone(true).attr('id', '')
2067
- .attr('data-slick-index', slideIndex + _.slideCount)
2068
- .appendTo(_.$slideTrack).addClass('slick-cloned');
2069
- }
2070
- _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
2071
- $(this).attr('id', '');
2072
- });
2073
-
2074
- }
2075
-
2076
- }
2077
-
2078
- };
2079
-
2080
- Slick.prototype.setPaused = function(paused) {
2081
-
2082
- var _ = this;
2083
-
2084
- if (_.options.autoplay === true && _.options.pauseOnHover === true) {
2085
- _.paused = paused;
2086
- if (!paused) {
2087
- _.autoPlay();
2088
- } else {
2089
- _.autoPlayClear();
2090
- }
2091
- }
2092
- };
2093
-
2094
- Slick.prototype.selectHandler = function(event) {
2095
-
2096
- var _ = this;
2097
-
2098
- var targetElement =
2099
- $(event.target).is('.slick-slide') ?
2100
- $(event.target) :
2101
- $(event.target).parents('.slick-slide');
2102
-
2103
- var index = parseInt(targetElement.attr('data-slick-index'));
2104
-
2105
- if (!index) index = 0;
2106
-
2107
- if (_.slideCount <= _.options.slidesToShow) {
2108
-
2109
- _.setSlideClasses(index);
2110
- _.asNavFor(index);
2111
- return;
2112
-
2113
- }
2114
-
2115
- _.slideHandler(index);
2116
-
2117
- };
2118
-
2119
- Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
2120
-
2121
- var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
2122
- _ = this;
2123
-
2124
- sync = sync || false;
2125
-
2126
- if (_.animating === true && _.options.waitForAnimate === true) {
2127
- return;
2128
- }
2129
-
2130
- if (_.options.fade === true && _.currentSlide === index) {
2131
- return;
2132
- }
2133
-
2134
- if (_.slideCount <= _.options.slidesToShow) {
2135
- return;
2136
- }
2137
-
2138
- if (sync === false) {
2139
- _.asNavFor(index);
2140
- }
2141
-
2142
- targetSlide = index;
2143
- targetLeft = _.getLeft(targetSlide);
2144
- slideLeft = _.getLeft(_.currentSlide);
2145
-
2146
- _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
2147
-
2148
- if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
2149
- if (_.options.fade === false) {
2150
- targetSlide = _.currentSlide;
2151
- if (dontAnimate !== true) {
2152
- _.animateSlide(slideLeft, function() {
2153
- _.postSlide(targetSlide);
2154
- });
2155
- } else {
2156
- _.postSlide(targetSlide);
2157
- }
2158
- }
2159
- return;
2160
- } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
2161
- if (_.options.fade === false) {
2162
- targetSlide = _.currentSlide;
2163
- if (dontAnimate !== true) {
2164
- _.animateSlide(slideLeft, function() {
2165
- _.postSlide(targetSlide);
2166
- });
2167
- } else {
2168
- _.postSlide(targetSlide);
2169
- }
2170
- }
2171
- return;
2172
- }
2173
-
2174
- if (_.options.autoplay === true) {
2175
- clearInterval(_.autoPlayTimer);
2176
- }
2177
-
2178
- if (targetSlide < 0) {
2179
- if (_.slideCount % _.options.slidesToScroll !== 0) {
2180
- animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
2181
- } else {
2182
- animSlide = _.slideCount + targetSlide;
2183
- }
2184
- } else if (targetSlide >= _.slideCount) {
2185
- if (_.slideCount % _.options.slidesToScroll !== 0) {
2186
- animSlide = 0;
2187
- } else {
2188
- animSlide = targetSlide - _.slideCount;
2189
- }
2190
- } else {
2191
- animSlide = targetSlide;
2192
- }
2193
-
2194
- _.animating = true;
2195
-
2196
- _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
2197
-
2198
- oldSlide = _.currentSlide;
2199
- _.currentSlide = animSlide;
2200
-
2201
- _.setSlideClasses(_.currentSlide);
2202
-
2203
- _.updateDots();
2204
- _.updateArrows();
2205
-
2206
- if (_.options.fade === true) {
2207
- if (dontAnimate !== true) {
2208
-
2209
- _.fadeSlideOut(oldSlide);
2210
-
2211
- _.fadeSlide(animSlide, function() {
2212
- _.postSlide(animSlide);
2213
- });
2214
-
2215
- } else {
2216
- _.postSlide(animSlide);
2217
- }
2218
- _.animateHeight();
2219
- return;
2220
- }
2221
-
2222
- if (dontAnimate !== true) {
2223
- _.animateSlide(targetLeft, function() {
2224
- _.postSlide(animSlide);
2225
- });
2226
- } else {
2227
- _.postSlide(animSlide);
2228
- }
2229
-
2230
- };
2231
-
2232
- Slick.prototype.startLoad = function() {
2233
-
2234
- var _ = this;
2235
-
2236
- if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2237
-
2238
- _.$prevArrow.hide();
2239
- _.$nextArrow.hide();
2240
-
2241
- }
2242
-
2243
- if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2244
-
2245
- _.$dots.hide();
2246
-
2247
- }
2248
-
2249
- _.$slider.addClass('slick-loading');
2250
-
2251
- };
2252
-
2253
- Slick.prototype.swipeDirection = function() {
2254
-
2255
- var xDist, yDist, r, swipeAngle, _ = this;
2256
-
2257
- xDist = _.touchObject.startX - _.touchObject.curX;
2258
- yDist = _.touchObject.startY - _.touchObject.curY;
2259
- r = Math.atan2(yDist, xDist);
2260
-
2261
- swipeAngle = Math.round(r * 180 / Math.PI);
2262
- if (swipeAngle < 0) {
2263
- swipeAngle = 360 - Math.abs(swipeAngle);
2264
- }
2265
-
2266
- if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
2267
- return (_.options.rtl === false ? 'left' : 'right');
2268
- }
2269
- if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
2270
- return (_.options.rtl === false ? 'left' : 'right');
2271
- }
2272
- if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
2273
- return (_.options.rtl === false ? 'right' : 'left');
2274
- }
2275
- if (_.options.verticalSwiping === true) {
2276
- if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
2277
- return 'left';
2278
- } else {
2279
- return 'right';
2280
- }
2281
- }
2282
-
2283
- return 'vertical';
2284
-
2285
- };
2286
-
2287
- Slick.prototype.swipeEnd = function(event) {
2288
-
2289
- var _ = this,
2290
- slideCount;
2291
-
2292
- _.dragging = false;
2293
-
2294
- _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true;
2295
-
2296
- if (_.touchObject.curX === undefined) {
2297
- return false;
2298
- }
2299
-
2300
- if (_.touchObject.edgeHit === true) {
2301
- _.$slider.trigger('edge', [_, _.swipeDirection()]);
2302
- }
2303
-
2304
- if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
2305
-
2306
- switch (_.swipeDirection()) {
2307
- case 'left':
2308
- slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
2309
- _.slideHandler(slideCount);
2310
- _.currentDirection = 0;
2311
- _.touchObject = {};
2312
- _.$slider.trigger('swipe', [_, 'left']);
2313
- break;
2314
-
2315
- case 'right':
2316
- slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
2317
- _.slideHandler(slideCount);
2318
- _.currentDirection = 1;
2319
- _.touchObject = {};
2320
- _.$slider.trigger('swipe', [_, 'right']);
2321
- break;
2322
- }
2323
- } else {
2324
- if (_.touchObject.startX !== _.touchObject.curX) {
2325
- _.slideHandler(_.currentSlide);
2326
- _.touchObject = {};
2327
- }
2328
- }
2329
-
2330
- };
2331
-
2332
- Slick.prototype.swipeHandler = function(event) {
2333
-
2334
- var _ = this;
2335
-
2336
- if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
2337
- return;
2338
- } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
2339
- return;
2340
- }
2341
-
2342
- _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
2343
- event.originalEvent.touches.length : 1;
2344
-
2345
- _.touchObject.minSwipe = _.listWidth / _.options
2346
- .touchThreshold;
2347
-
2348
- if (_.options.verticalSwiping === true) {
2349
- _.touchObject.minSwipe = _.listHeight / _.options
2350
- .touchThreshold;
2351
- }
2352
-
2353
- switch (event.data.action) {
2354
-
2355
- case 'start':
2356
- _.swipeStart(event);
2357
- break;
2358
-
2359
- case 'move':
2360
- _.swipeMove(event);
2361
- break;
2362
-
2363
- case 'end':
2364
- _.swipeEnd(event);
2365
- break;
2366
-
2367
- }
2368
-
2369
- };
2370
-
2371
- Slick.prototype.swipeMove = function(event) {
2372
-
2373
- var _ = this,
2374
- edgeWasHit = false,
2375
- curLeft, swipeDirection, swipeLength, positionOffset, touches;
2376
-
2377
- touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
2378
-
2379
- if (!_.dragging || touches && touches.length !== 1) {
2380
- return false;
2381
- }
2382
-
2383
- curLeft = _.getLeft(_.currentSlide);
2384
-
2385
- _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
2386
- _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
2387
-
2388
- _.touchObject.swipeLength = Math.round(Math.sqrt(
2389
- Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
2390
-
2391
- if (_.options.verticalSwiping === true) {
2392
- _.touchObject.swipeLength = Math.round(Math.sqrt(
2393
- Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
2394
- }
2395
-
2396
- swipeDirection = _.swipeDirection();
2397
-
2398
- if (swipeDirection === 'vertical') {
2399
- return;
2400
- }
2401
-
2402
- if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
2403
- event.preventDefault();
2404
- }
2405
-
2406
- positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
2407
- if (_.options.verticalSwiping === true) {
2408
- positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
2409
- }
2410
-
2411
-
2412
- swipeLength = _.touchObject.swipeLength;
2413
-
2414
- _.touchObject.edgeHit = false;
2415
-
2416
- if (_.options.infinite === false) {
2417
- if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
2418
- swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
2419
- _.touchObject.edgeHit = true;
2420
- }
2421
- }
2422
-
2423
- if (_.options.vertical === false) {
2424
- _.swipeLeft = curLeft + swipeLength * positionOffset;
2425
- } else {
2426
- _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2427
- }
2428
- if (_.options.verticalSwiping === true) {
2429
- _.swipeLeft = curLeft + swipeLength * positionOffset;
2430
- }
2431
-
2432
- if (_.options.fade === true || _.options.touchMove === false) {
2433
- return false;
2434
- }
2435
-
2436
- if (_.animating === true) {
2437
- _.swipeLeft = null;
2438
- return false;
2439
- }
2440
-
2441
- _.setCSS(_.swipeLeft);
2442
-
2443
- };
2444
-
2445
- Slick.prototype.swipeStart = function(event) {
2446
-
2447
- var _ = this,
2448
- touches;
2449
-
2450
- if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2451
- _.touchObject = {};
2452
- return false;
2453
- }
2454
-
2455
- if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2456
- touches = event.originalEvent.touches[0];
2457
- }
2458
-
2459
- _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2460
- _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2461
-
2462
- _.dragging = true;
2463
-
2464
- };
2465
-
2466
- Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2467
-
2468
- var _ = this;
2469
-
2470
- if (_.$slidesCache !== null) {
2471
-
2472
- _.unload();
2473
-
2474
- _.$slideTrack.children(this.options.slide).detach();
2475
-
2476
- _.$slidesCache.appendTo(_.$slideTrack);
2477
-
2478
- _.reinit();
2479
-
2480
- }
2481
-
2482
- };
2483
-
2484
- Slick.prototype.unload = function() {
2485
-
2486
- var _ = this;
2487
-
2488
- $('.slick-cloned', _.$slider).remove();
2489
-
2490
- if (_.$dots) {
2491
- _.$dots.remove();
2492
- }
2493
-
2494
- if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
2495
- _.$prevArrow.remove();
2496
- }
2497
-
2498
- if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
2499
- _.$nextArrow.remove();
2500
- }
2501
-
2502
- _.$slides
2503
- .removeClass('slick-slide slick-active slick-visible slick-current')
2504
- .attr('aria-hidden', 'true')
2505
- .css('width', '');
2506
-
2507
- };
2508
-
2509
- Slick.prototype.unslick = function(fromBreakpoint) {
2510
-
2511
- var _ = this;
2512
- _.$slider.trigger('unslick', [_, fromBreakpoint]);
2513
- _.destroy();
2514
-
2515
- };
2516
-
2517
- Slick.prototype.updateArrows = function() {
2518
-
2519
- var _ = this,
2520
- centerOffset;
2521
-
2522
- centerOffset = Math.floor(_.options.slidesToShow / 2);
2523
-
2524
- if ( _.options.arrows === true &&
2525
- _.slideCount > _.options.slidesToShow &&
2526
- !_.options.infinite ) {
2527
-
2528
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2529
- _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2530
-
2531
- if (_.currentSlide === 0) {
2532
-
2533
- _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2534
- _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2535
-
2536
- } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2537
-
2538
- _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2539
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2540
-
2541
- } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2542
-
2543
- _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2544
- _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2545
-
2546
- }
2547
-
2548
- }
2549
-
2550
- };
2551
-
2552
- Slick.prototype.updateDots = function() {
2553
-
2554
- var _ = this;
2555
-
2556
- if (_.$dots !== null) {
2557
-
2558
- _.$dots
2559
- .find('li')
2560
- .removeClass('slick-active')
2561
- .attr('aria-hidden', 'true');
2562
-
2563
- _.$dots
2564
- .find('li')
2565
- .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
2566
- .addClass('slick-active')
2567
- .attr('aria-hidden', 'false');
2568
-
2569
- }
2570
-
2571
- };
2572
-
2573
- Slick.prototype.visibility = function() {
2574
-
2575
- var _ = this;
2576
-
2577
- if (document[_.hidden]) {
2578
- _.paused = true;
2579
- _.autoPlayClear();
2580
- } else {
2581
- if (_.options.autoplay === true) {
2582
- _.paused = false;
2583
- _.autoPlay();
2584
- }
2585
- }
2586
-
2587
- };
2588
- Slick.prototype.initADA = function() {
2589
- var _ = this;
2590
- _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
2591
- 'aria-hidden': 'true',
2592
- 'tabindex': '-1'
2593
- }).find('a, input, button, select').attr({
2594
- 'tabindex': '-1'
2595
- });
2596
-
2597
- _.$slideTrack.attr('role', 'listbox');
2598
-
2599
- _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
2600
- $(this).attr({
2601
- 'role': 'option',
2602
- 'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
2603
- });
2604
- });
2605
-
2606
- if (_.$dots !== null) {
2607
- _.$dots.attr('role', 'tablist').find('li').each(function(i) {
2608
- $(this).attr({
2609
- 'role': 'presentation',
2610
- 'aria-selected': 'false',
2611
- 'aria-controls': 'navigation' + _.instanceUid + i + '',
2612
- 'id': 'slick-slide' + _.instanceUid + i + ''
2613
- });
2614
- })
2615
- .first().attr('aria-selected', 'true').end()
2616
- .find('button').attr('role', 'button').end()
2617
- .closest('div').attr('role', 'toolbar');
2618
- }
2619
- _.activateADA();
2620
-
2621
- };
2622
-
2623
- Slick.prototype.activateADA = function() {
2624
- var _ = this;
2625
-
2626
- _.$slideTrack.find('.slick-active').attr({
2627
- 'aria-hidden': 'false'
2628
- }).find('a, input, button, select').attr({
2629
- 'tabindex': '0'
2630
- });
2631
-
2632
- };
2633
-
2634
- Slick.prototype.focusHandler = function() {
2635
- var _ = this;
2636
- _.$slider.on('focus.slick blur.slick', '*', function(event) {
2637
- event.stopImmediatePropagation();
2638
- var sf = $(this);
2639
- setTimeout(function() {
2640
- if (_.isPlay) {
2641
- if (sf.is(':focus')) {
2642
- _.autoPlayClear();
2643
- _.paused = true;
2644
- } else {
2645
- _.paused = false;
2646
- _.autoPlay();
2647
- }
2648
- }
2649
- }, 0);
2650
- });
2651
- };
2652
-
2653
- $.fn.slick = function() {
2654
- var _ = this,
2655
- opt = arguments[0],
2656
- args = Array.prototype.slice.call(arguments, 1),
2657
- l = _.length,
2658
- i,
2659
- ret;
2660
- for (i = 0; i < l; i++) {
2661
- if (typeof opt == 'object' || typeof opt == 'undefined')
2662
- _[i].slick = new Slick(_[i], opt);
2663
- else
2664
- ret = _[i].slick[opt].apply(_[i].slick, args);
2665
- if (typeof ret != 'undefined') return ret;
2666
- }
2667
- return _;
2668
- };
2669
-
2670
- }));
1
+ /*
2
+ _ _ _ _
3
+ ___| (_) ___| | __ (_)___
4
+ / __| | |/ __| |/ / | / __|
5
+ \__ \ | | (__| < _ | \__ \
6
+ |___/_|_|\___|_|\_(_)/ |___/
7
+ |__/
8
+
9
+ Version: 1.5.9
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 type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
48
+ nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="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" data-role="none" role="button" aria-required="false" tabindex="0">' + (i + 1) + '</button>';
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
+ infinite: true,
65
+ initialSlide: 0,
66
+ lazyLoad: 'ondemand',
67
+ mobileFirst: false,
68
+ pauseOnHover: true,
69
+ pauseOnDotsHover: false,
70
+ respondTo: 'window',
71
+ responsive: null,
72
+ rows: 1,
73
+ rtl: false,
74
+ slide: '',
75
+ slidesPerRow: 1,
76
+ slidesToShow: 1,
77
+ slidesToScroll: 1,
78
+ speed: 500,
79
+ swipe: true,
80
+ swipeToSlide: false,
81
+ touchMove: true,
82
+ touchThreshold: 5,
83
+ useCSS: true,
84
+ useTransform: false,
85
+ variableWidth: false,
86
+ vertical: false,
87
+ verticalSwiping: false,
88
+ waitForAnimate: true,
89
+ zIndex: 1000
90
+ };
91
+
92
+ _.initials = {
93
+ animating: false,
94
+ dragging: false,
95
+ autoPlayTimer: null,
96
+ currentDirection: 0,
97
+ currentLeft: null,
98
+ currentSlide: 0,
99
+ direction: 1,
100
+ $dots: null,
101
+ listWidth: null,
102
+ listHeight: null,
103
+ loadIndex: 0,
104
+ $nextArrow: null,
105
+ $prevArrow: null,
106
+ slideCount: null,
107
+ slideWidth: null,
108
+ $slideTrack: null,
109
+ $slides: null,
110
+ sliding: false,
111
+ slideOffset: 0,
112
+ swipeLeft: null,
113
+ $list: null,
114
+ touchObject: {},
115
+ transformsEnabled: false,
116
+ unslicked: false
117
+ };
118
+
119
+ $.extend(_, _.initials);
120
+
121
+ _.activeBreakpoint = null;
122
+ _.animType = null;
123
+ _.animProp = null;
124
+ _.breakpoints = [];
125
+ _.breakpointSettings = [];
126
+ _.cssTransitions = false;
127
+ _.hidden = 'hidden';
128
+ _.paused = false;
129
+ _.positionProp = null;
130
+ _.respondTo = null;
131
+ _.rowCount = 1;
132
+ _.shouldClick = true;
133
+ _.$slider = $(element);
134
+ _.$slidesCache = null;
135
+ _.transformType = null;
136
+ _.transitionType = null;
137
+ _.visibilityChange = 'visibilitychange';
138
+ _.windowWidth = 0;
139
+ _.windowTimer = null;
140
+
141
+ dataSettings = $(element).data('slick') || {};
142
+
143
+ _.options = $.extend({}, _.defaults, dataSettings, settings);
144
+
145
+ _.currentSlide = _.options.initialSlide;
146
+
147
+ _.originalSettings = _.options;
148
+
149
+ if (typeof document.mozHidden !== 'undefined') {
150
+ _.hidden = 'mozHidden';
151
+ _.visibilityChange = 'mozvisibilitychange';
152
+ } else if (typeof document.webkitHidden !== 'undefined') {
153
+ _.hidden = 'webkitHidden';
154
+ _.visibilityChange = 'webkitvisibilitychange';
155
+ }
156
+
157
+ _.autoPlay = $.proxy(_.autoPlay, _);
158
+ _.autoPlayClear = $.proxy(_.autoPlayClear, _);
159
+ _.changeSlide = $.proxy(_.changeSlide, _);
160
+ _.clickHandler = $.proxy(_.clickHandler, _);
161
+ _.selectHandler = $.proxy(_.selectHandler, _);
162
+ _.setPosition = $.proxy(_.setPosition, _);
163
+ _.swipeHandler = $.proxy(_.swipeHandler, _);
164
+ _.dragHandler = $.proxy(_.dragHandler, _);
165
+ _.keyHandler = $.proxy(_.keyHandler, _);
166
+ _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
167
+
168
+ _.instanceUid = instanceUid++;
169
+
170
+ // A simple way to check for HTML strings
171
+ // Strict HTML recognition (must start with <)
172
+ // Extracted from jQuery v1.11 source
173
+ _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
174
+
175
+
176
+ _.registerBreakpoints();
177
+ _.init(true);
178
+ _.checkResponsive(true);
179
+
180
+ }
181
+
182
+ return Slick;
183
+
184
+ }());
185
+
186
+ Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
187
+
188
+ var _ = this;
189
+
190
+ if (typeof(index) === 'boolean') {
191
+ addBefore = index;
192
+ index = null;
193
+ } else if (index < 0 || (index >= _.slideCount)) {
194
+ return false;
195
+ }
196
+
197
+ _.unload();
198
+
199
+ if (typeof(index) === 'number') {
200
+ if (index === 0 && _.$slides.length === 0) {
201
+ $(markup).appendTo(_.$slideTrack);
202
+ } else if (addBefore) {
203
+ $(markup).insertBefore(_.$slides.eq(index));
204
+ } else {
205
+ $(markup).insertAfter(_.$slides.eq(index));
206
+ }
207
+ } else {
208
+ if (addBefore === true) {
209
+ $(markup).prependTo(_.$slideTrack);
210
+ } else {
211
+ $(markup).appendTo(_.$slideTrack);
212
+ }
213
+ }
214
+
215
+ _.$slides = _.$slideTrack.children(this.options.slide);
216
+
217
+ _.$slideTrack.children(this.options.slide).detach();
218
+
219
+ _.$slideTrack.append(_.$slides);
220
+
221
+ _.$slides.each(function(index, element) {
222
+ $(element).attr('data-slick-index', index);
223
+ });
224
+
225
+ _.$slidesCache = _.$slides;
226
+
227
+ _.reinit();
228
+
229
+ };
230
+
231
+ Slick.prototype.animateHeight = function() {
232
+ var _ = this;
233
+ if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
234
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
235
+ _.$list.animate({
236
+ height: targetHeight
237
+ }, _.options.speed);
238
+ }
239
+ };
240
+
241
+ Slick.prototype.animateSlide = function(targetLeft, callback) {
242
+
243
+ var animProps = {},
244
+ _ = this;
245
+
246
+ _.animateHeight();
247
+
248
+ if (_.options.rtl === true && _.options.vertical === false) {
249
+ targetLeft = -targetLeft;
250
+ }
251
+ if (_.transformsEnabled === false) {
252
+ if (_.options.vertical === false) {
253
+ _.$slideTrack.animate({
254
+ left: targetLeft
255
+ }, _.options.speed, _.options.easing, callback);
256
+ } else {
257
+ _.$slideTrack.animate({
258
+ top: targetLeft
259
+ }, _.options.speed, _.options.easing, callback);
260
+ }
261
+
262
+ } else {
263
+
264
+ if (_.cssTransitions === false) {
265
+ if (_.options.rtl === true) {
266
+ _.currentLeft = -(_.currentLeft);
267
+ }
268
+ $({
269
+ animStart: _.currentLeft
270
+ }).animate({
271
+ animStart: targetLeft
272
+ }, {
273
+ duration: _.options.speed,
274
+ easing: _.options.easing,
275
+ step: function(now) {
276
+ now = Math.ceil(now);
277
+ if (_.options.vertical === false) {
278
+ animProps[_.animType] = 'translate(' +
279
+ now + 'px, 0px)';
280
+ _.$slideTrack.css(animProps);
281
+ } else {
282
+ animProps[_.animType] = 'translate(0px,' +
283
+ now + 'px)';
284
+ _.$slideTrack.css(animProps);
285
+ }
286
+ },
287
+ complete: function() {
288
+ if (callback) {
289
+ callback.call();
290
+ }
291
+ }
292
+ });
293
+
294
+ } else {
295
+
296
+ _.applyTransition();
297
+ targetLeft = Math.ceil(targetLeft);
298
+
299
+ if (_.options.vertical === false) {
300
+ animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
301
+ } else {
302
+ animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
303
+ }
304
+ _.$slideTrack.css(animProps);
305
+
306
+ if (callback) {
307
+ setTimeout(function() {
308
+
309
+ _.disableTransition();
310
+
311
+ callback.call();
312
+ }, _.options.speed);
313
+ }
314
+
315
+ }
316
+
317
+ }
318
+
319
+ };
320
+
321
+ Slick.prototype.asNavFor = function(index) {
322
+
323
+ var _ = this,
324
+ asNavFor = _.options.asNavFor;
325
+
326
+ if ( asNavFor && asNavFor !== null ) {
327
+ asNavFor = $(asNavFor).not(_.$slider);
328
+ }
329
+
330
+ if ( asNavFor !== null && typeof asNavFor === 'object' ) {
331
+ asNavFor.each(function() {
332
+ var target = $(this).slick('getSlick');
333
+ if(!target.unslicked) {
334
+ target.slideHandler(index, true);
335
+ }
336
+ });
337
+ }
338
+
339
+ };
340
+
341
+ Slick.prototype.applyTransition = function(slide) {
342
+
343
+ var _ = this,
344
+ transition = {};
345
+
346
+ if (_.options.fade === false) {
347
+ transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
348
+ } else {
349
+ transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
350
+ }
351
+
352
+ if (_.options.fade === false) {
353
+ _.$slideTrack.css(transition);
354
+ } else {
355
+ _.$slides.eq(slide).css(transition);
356
+ }
357
+
358
+ };
359
+
360
+ Slick.prototype.autoPlay = function() {
361
+
362
+ var _ = this;
363
+
364
+ if (_.autoPlayTimer) {
365
+ clearInterval(_.autoPlayTimer);
366
+ }
367
+
368
+ if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
369
+ _.autoPlayTimer = setInterval(_.autoPlayIterator,
370
+ _.options.autoplaySpeed);
371
+ }
372
+
373
+ };
374
+
375
+ Slick.prototype.autoPlayClear = function() {
376
+
377
+ var _ = this;
378
+ if (_.autoPlayTimer) {
379
+ clearInterval(_.autoPlayTimer);
380
+ }
381
+
382
+ };
383
+
384
+ Slick.prototype.autoPlayIterator = function() {
385
+
386
+ var _ = this;
387
+
388
+ if (_.options.infinite === false) {
389
+
390
+ if (_.direction === 1) {
391
+
392
+ if ((_.currentSlide + 1) === _.slideCount -
393
+ 1) {
394
+ _.direction = 0;
395
+ }
396
+
397
+ _.slideHandler(_.currentSlide + _.options.slidesToScroll);
398
+
399
+ } else {
400
+
401
+ if ((_.currentSlide - 1 === 0)) {
402
+
403
+ _.direction = 1;
404
+
405
+ }
406
+
407
+ _.slideHandler(_.currentSlide - _.options.slidesToScroll);
408
+
409
+ }
410
+
411
+ } else {
412
+
413
+ _.slideHandler(_.currentSlide + _.options.slidesToScroll);
414
+
415
+ }
416
+
417
+ };
418
+
419
+ Slick.prototype.buildArrows = function() {
420
+
421
+ var _ = this;
422
+
423
+ if (_.options.arrows === true ) {
424
+
425
+ _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
426
+ _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
427
+
428
+ if( _.slideCount > _.options.slidesToShow ) {
429
+
430
+ _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
431
+ _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
432
+
433
+ if (_.htmlExpr.test(_.options.prevArrow)) {
434
+ _.$prevArrow.prependTo(_.options.appendArrows);
435
+ }
436
+
437
+ if (_.htmlExpr.test(_.options.nextArrow)) {
438
+ _.$nextArrow.appendTo(_.options.appendArrows);
439
+ }
440
+
441
+ if (_.options.infinite !== true) {
442
+ _.$prevArrow
443
+ .addClass('slick-disabled')
444
+ .attr('aria-disabled', 'true');
445
+ }
446
+
447
+ } else {
448
+
449
+ _.$prevArrow.add( _.$nextArrow )
450
+
451
+ .addClass('slick-hidden')
452
+ .attr({
453
+ 'aria-disabled': 'true',
454
+ 'tabindex': '-1'
455
+ });
456
+
457
+ }
458
+
459
+ }
460
+
461
+ };
462
+
463
+ Slick.prototype.buildDots = function() {
464
+
465
+ var _ = this,
466
+ i, dotString;
467
+
468
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
469
+
470
+ dotString = '<ul class="' + _.options.dotsClass + '">';
471
+
472
+ for (i = 0; i <= _.getDotCount(); i += 1) {
473
+ dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
474
+ }
475
+
476
+ dotString += '</ul>';
477
+
478
+ _.$dots = $(dotString).appendTo(
479
+ _.options.appendDots);
480
+
481
+ _.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
482
+
483
+ }
484
+
485
+ };
486
+
487
+ Slick.prototype.buildOut = function() {
488
+
489
+ var _ = this;
490
+
491
+ _.$slides =
492
+ _.$slider
493
+ .children( _.options.slide + ':not(.slick-cloned)')
494
+ .addClass('slick-slide');
495
+
496
+ _.slideCount = _.$slides.length;
497
+
498
+ _.$slides.each(function(index, element) {
499
+ $(element)
500
+ .attr('data-slick-index', index)
501
+ .data('originalStyling', $(element).attr('style') || '');
502
+ });
503
+
504
+ _.$slider.addClass('slick-slider');
505
+
506
+ _.$slideTrack = (_.slideCount === 0) ?
507
+ $('<div class="slick-track"/>').appendTo(_.$slider) :
508
+ _.$slides.wrapAll('<div class="slick-track"/>').parent();
509
+
510
+ _.$list = _.$slideTrack.wrap(
511
+ '<div aria-live="polite" class="slick-list"/>').parent();
512
+ _.$slideTrack.css('opacity', 0);
513
+
514
+ if (_.options.centerMode === true || _.options.swipeToSlide === true) {
515
+ _.options.slidesToScroll = 1;
516
+ }
517
+
518
+ $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
519
+
520
+ _.setupInfinite();
521
+
522
+ _.buildArrows();
523
+
524
+ _.buildDots();
525
+
526
+ _.updateDots();
527
+
528
+
529
+ _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
530
+
531
+ if (_.options.draggable === true) {
532
+ _.$list.addClass('draggable');
533
+ }
534
+
535
+ };
536
+
537
+ Slick.prototype.buildRows = function() {
538
+
539
+ var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
540
+
541
+ newSlides = document.createDocumentFragment();
542
+ originalSlides = _.$slider.children();
543
+
544
+ if(_.options.rows > 1) {
545
+
546
+ slidesPerSection = _.options.slidesPerRow * _.options.rows;
547
+ numOfSlides = Math.ceil(
548
+ originalSlides.length / slidesPerSection
549
+ );
550
+
551
+ for(a = 0; a < numOfSlides; a++){
552
+ var slide = document.createElement('div');
553
+ for(b = 0; b < _.options.rows; b++) {
554
+ var row = document.createElement('div');
555
+ for(c = 0; c < _.options.slidesPerRow; c++) {
556
+ var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
557
+ if (originalSlides.get(target)) {
558
+ row.appendChild(originalSlides.get(target));
559
+ }
560
+ }
561
+ slide.appendChild(row);
562
+ }
563
+ newSlides.appendChild(slide);
564
+ }
565
+
566
+ _.$slider.html(newSlides);
567
+ _.$slider.children().children().children()
568
+ .css({
569
+ 'width':(100 / _.options.slidesPerRow) + '%',
570
+ 'display': 'inline-block'
571
+ });
572
+
573
+ }
574
+
575
+ };
576
+
577
+ Slick.prototype.checkResponsive = function(initial, forceUpdate) {
578
+
579
+ var _ = this,
580
+ breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
581
+ var sliderWidth = _.$slider.width();
582
+ var windowWidth = window.innerWidth || $(window).width();
583
+
584
+ if (_.respondTo === 'window') {
585
+ respondToWidth = windowWidth;
586
+ } else if (_.respondTo === 'slider') {
587
+ respondToWidth = sliderWidth;
588
+ } else if (_.respondTo === 'min') {
589
+ respondToWidth = Math.min(windowWidth, sliderWidth);
590
+ }
591
+
592
+ if ( _.options.responsive &&
593
+ _.options.responsive.length &&
594
+ _.options.responsive !== null) {
595
+
596
+ targetBreakpoint = null;
597
+
598
+ for (breakpoint in _.breakpoints) {
599
+ if (_.breakpoints.hasOwnProperty(breakpoint)) {
600
+ if (_.originalSettings.mobileFirst === false) {
601
+ if (respondToWidth < _.breakpoints[breakpoint]) {
602
+ targetBreakpoint = _.breakpoints[breakpoint];
603
+ }
604
+ } else {
605
+ if (respondToWidth > _.breakpoints[breakpoint]) {
606
+ targetBreakpoint = _.breakpoints[breakpoint];
607
+ }
608
+ }
609
+ }
610
+ }
611
+
612
+ if (targetBreakpoint !== null) {
613
+ if (_.activeBreakpoint !== null) {
614
+ if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
615
+ _.activeBreakpoint =
616
+ targetBreakpoint;
617
+ if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
618
+ _.unslick(targetBreakpoint);
619
+ } else {
620
+ _.options = $.extend({}, _.originalSettings,
621
+ _.breakpointSettings[
622
+ targetBreakpoint]);
623
+ if (initial === true) {
624
+ _.currentSlide = _.options.initialSlide;
625
+ }
626
+ _.refresh(initial);
627
+ }
628
+ triggerBreakpoint = targetBreakpoint;
629
+ }
630
+ } else {
631
+ _.activeBreakpoint = targetBreakpoint;
632
+ if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
633
+ _.unslick(targetBreakpoint);
634
+ } else {
635
+ _.options = $.extend({}, _.originalSettings,
636
+ _.breakpointSettings[
637
+ targetBreakpoint]);
638
+ if (initial === true) {
639
+ _.currentSlide = _.options.initialSlide;
640
+ }
641
+ _.refresh(initial);
642
+ }
643
+ triggerBreakpoint = targetBreakpoint;
644
+ }
645
+ } else {
646
+ if (_.activeBreakpoint !== null) {
647
+ _.activeBreakpoint = null;
648
+ _.options = _.originalSettings;
649
+ if (initial === true) {
650
+ _.currentSlide = _.options.initialSlide;
651
+ }
652
+ _.refresh(initial);
653
+ triggerBreakpoint = targetBreakpoint;
654
+ }
655
+ }
656
+
657
+ // only trigger breakpoints during an actual break. not on initialize.
658
+ if( !initial && triggerBreakpoint !== false ) {
659
+ _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
660
+ }
661
+ }
662
+
663
+ };
664
+
665
+ Slick.prototype.changeSlide = function(event, dontAnimate) {
666
+
667
+ var _ = this,
668
+ $target = $(event.target),
669
+ indexOffset, slideOffset, unevenOffset;
670
+
671
+ // If target is a link, prevent default action.
672
+ if($target.is('a')) {
673
+ event.preventDefault();
674
+ }
675
+
676
+ // If target is not the <li> element (ie: a child), find the <li>.
677
+ if(!$target.is('li')) {
678
+ $target = $target.closest('li');
679
+ }
680
+
681
+ unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
682
+ indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
683
+
684
+ switch (event.data.message) {
685
+
686
+ case 'previous':
687
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
688
+ if (_.slideCount > _.options.slidesToShow) {
689
+ _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
690
+ }
691
+ break;
692
+
693
+ case 'next':
694
+ slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
695
+ if (_.slideCount > _.options.slidesToShow) {
696
+ _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
697
+ }
698
+ break;
699
+
700
+ case 'index':
701
+ var index = event.data.index === 0 ? 0 :
702
+ event.data.index || $target.index() * _.options.slidesToScroll;
703
+
704
+ _.slideHandler(_.checkNavigable(index), false, dontAnimate);
705
+ $target.children().trigger('focus');
706
+ break;
707
+
708
+ default:
709
+ return;
710
+ }
711
+
712
+ };
713
+
714
+ Slick.prototype.checkNavigable = function(index) {
715
+
716
+ var _ = this,
717
+ navigables, prevNavigable;
718
+
719
+ navigables = _.getNavigableIndexes();
720
+ prevNavigable = 0;
721
+ if (index > navigables[navigables.length - 1]) {
722
+ index = navigables[navigables.length - 1];
723
+ } else {
724
+ for (var n in navigables) {
725
+ if (index < navigables[n]) {
726
+ index = prevNavigable;
727
+ break;
728
+ }
729
+ prevNavigable = navigables[n];
730
+ }
731
+ }
732
+
733
+ return index;
734
+ };
735
+
736
+ Slick.prototype.cleanUpEvents = function() {
737
+
738
+ var _ = this;
739
+
740
+ if (_.options.dots && _.$dots !== null) {
741
+
742
+ $('li', _.$dots).off('click.slick', _.changeSlide);
743
+
744
+ if (_.options.pauseOnDotsHover === true && _.options.autoplay === true) {
745
+
746
+ $('li', _.$dots)
747
+ .off('mouseenter.slick', $.proxy(_.setPaused, _, true))
748
+ .off('mouseleave.slick', $.proxy(_.setPaused, _, false));
749
+
750
+ }
751
+
752
+ }
753
+
754
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
755
+ _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
756
+ _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
757
+ }
758
+
759
+ _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
760
+ _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
761
+ _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
762
+ _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
763
+
764
+ _.$list.off('click.slick', _.clickHandler);
765
+
766
+ $(document).off(_.visibilityChange, _.visibility);
767
+
768
+ _.$list.off('mouseenter.slick', $.proxy(_.setPaused, _, true));
769
+ _.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false));
770
+
771
+ if (_.options.accessibility === true) {
772
+ _.$list.off('keydown.slick', _.keyHandler);
773
+ }
774
+
775
+ if (_.options.focusOnSelect === true) {
776
+ $(_.$slideTrack).children().off('click.slick', _.selectHandler);
777
+ }
778
+
779
+ $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
780
+
781
+ $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
782
+
783
+ $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
784
+
785
+ $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
786
+ $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
787
+ };
788
+
789
+ Slick.prototype.cleanUpRows = function() {
790
+
791
+ var _ = this, originalSlides;
792
+
793
+ if(_.options.rows > 1) {
794
+ originalSlides = _.$slides.children().children();
795
+ originalSlides.removeAttr('style');
796
+ _.$slider.html(originalSlides);
797
+ }
798
+
799
+ };
800
+
801
+ Slick.prototype.clickHandler = function(event) {
802
+
803
+ var _ = this;
804
+
805
+ if (_.shouldClick === false) {
806
+ event.stopImmediatePropagation();
807
+ event.stopPropagation();
808
+ event.preventDefault();
809
+ }
810
+
811
+ };
812
+
813
+ Slick.prototype.destroy = function(refresh) {
814
+
815
+ var _ = this;
816
+
817
+ _.autoPlayClear();
818
+
819
+ _.touchObject = {};
820
+
821
+ _.cleanUpEvents();
822
+
823
+ $('.slick-cloned', _.$slider).detach();
824
+
825
+ if (_.$dots) {
826
+ _.$dots.remove();
827
+ }
828
+
829
+
830
+ if ( _.$prevArrow && _.$prevArrow.length ) {
831
+
832
+ _.$prevArrow
833
+ .removeClass('slick-disabled slick-arrow slick-hidden')
834
+ .removeAttr('aria-hidden aria-disabled tabindex')
835
+ .css("display","");
836
+
837
+ if ( _.htmlExpr.test( _.options.prevArrow )) {
838
+ _.$prevArrow.remove();
839
+ }
840
+ }
841
+
842
+ if ( _.$nextArrow && _.$nextArrow.length ) {
843
+
844
+ _.$nextArrow
845
+ .removeClass('slick-disabled slick-arrow slick-hidden')
846
+ .removeAttr('aria-hidden aria-disabled tabindex')
847
+ .css("display","");
848
+
849
+ if ( _.htmlExpr.test( _.options.nextArrow )) {
850
+ _.$nextArrow.remove();
851
+ }
852
+
853
+ }
854
+
855
+
856
+ if (_.$slides) {
857
+
858
+ _.$slides
859
+ .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
860
+ .removeAttr('aria-hidden')
861
+ .removeAttr('data-slick-index')
862
+ .each(function(){
863
+ $(this).attr('style', $(this).data('originalStyling'));
864
+ });
865
+
866
+ _.$slideTrack.children(this.options.slide).detach();
867
+
868
+ _.$slideTrack.detach();
869
+
870
+ _.$list.detach();
871
+
872
+ _.$slider.append(_.$slides);
873
+ }
874
+
875
+ _.cleanUpRows();
876
+
877
+ _.$slider.removeClass('slick-slider');
878
+ _.$slider.removeClass('slick-initialized');
879
+
880
+ _.unslicked = true;
881
+
882
+ if(!refresh) {
883
+ _.$slider.trigger('destroy', [_]);
884
+ }
885
+
886
+ };
887
+
888
+ Slick.prototype.disableTransition = function(slide) {
889
+
890
+ var _ = this,
891
+ transition = {};
892
+
893
+ transition[_.transitionType] = '';
894
+
895
+ if (_.options.fade === false) {
896
+ _.$slideTrack.css(transition);
897
+ } else {
898
+ _.$slides.eq(slide).css(transition);
899
+ }
900
+
901
+ };
902
+
903
+ Slick.prototype.fadeSlide = function(slideIndex, callback) {
904
+
905
+ var _ = this;
906
+
907
+ if (_.cssTransitions === false) {
908
+
909
+ _.$slides.eq(slideIndex).css({
910
+ zIndex: _.options.zIndex
911
+ });
912
+
913
+ _.$slides.eq(slideIndex).animate({
914
+ opacity: 1
915
+ }, _.options.speed, _.options.easing, callback);
916
+
917
+ } else {
918
+
919
+ _.applyTransition(slideIndex);
920
+
921
+ _.$slides.eq(slideIndex).css({
922
+ opacity: 1,
923
+ zIndex: _.options.zIndex
924
+ });
925
+
926
+ if (callback) {
927
+ setTimeout(function() {
928
+
929
+ _.disableTransition(slideIndex);
930
+
931
+ callback.call();
932
+ }, _.options.speed);
933
+ }
934
+
935
+ }
936
+
937
+ };
938
+
939
+ Slick.prototype.fadeSlideOut = function(slideIndex) {
940
+
941
+ var _ = this;
942
+
943
+ if (_.cssTransitions === false) {
944
+
945
+ _.$slides.eq(slideIndex).animate({
946
+ opacity: 0,
947
+ zIndex: _.options.zIndex - 2
948
+ }, _.options.speed, _.options.easing);
949
+
950
+ } else {
951
+
952
+ _.applyTransition(slideIndex);
953
+
954
+ _.$slides.eq(slideIndex).css({
955
+ opacity: 0,
956
+ zIndex: _.options.zIndex - 2
957
+ });
958
+
959
+ }
960
+
961
+ };
962
+
963
+ Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
964
+
965
+ var _ = this;
966
+
967
+ if (filter !== null) {
968
+
969
+ _.$slidesCache = _.$slides;
970
+
971
+ _.unload();
972
+
973
+ _.$slideTrack.children(this.options.slide).detach();
974
+
975
+ _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
976
+
977
+ _.reinit();
978
+
979
+ }
980
+
981
+ };
982
+
983
+ Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
984
+
985
+ var _ = this;
986
+ return _.currentSlide;
987
+
988
+ };
989
+
990
+ Slick.prototype.getDotCount = function() {
991
+
992
+ var _ = this;
993
+
994
+ var breakPoint = 0;
995
+ var counter = 0;
996
+ var pagerQty = 0;
997
+
998
+ if (_.options.infinite === true) {
999
+ while (breakPoint < _.slideCount) {
1000
+ ++pagerQty;
1001
+ breakPoint = counter + _.options.slidesToScroll;
1002
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1003
+ }
1004
+ } else if (_.options.centerMode === true) {
1005
+ pagerQty = _.slideCount;
1006
+ } else {
1007
+ while (breakPoint < _.slideCount) {
1008
+ ++pagerQty;
1009
+ breakPoint = counter + _.options.slidesToScroll;
1010
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1011
+ }
1012
+ }
1013
+
1014
+ return pagerQty - 1;
1015
+
1016
+ };
1017
+
1018
+ Slick.prototype.getLeft = function(slideIndex) {
1019
+
1020
+ var _ = this,
1021
+ targetLeft,
1022
+ verticalHeight,
1023
+ verticalOffset = 0,
1024
+ targetSlide;
1025
+
1026
+ _.slideOffset = 0;
1027
+ verticalHeight = _.$slides.first().outerHeight(true);
1028
+
1029
+ if (_.options.infinite === true) {
1030
+ if (_.slideCount > _.options.slidesToShow) {
1031
+ _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
1032
+ verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
1033
+ }
1034
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
1035
+ if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
1036
+ if (slideIndex > _.slideCount) {
1037
+ _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
1038
+ verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
1039
+ } else {
1040
+ _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
1041
+ verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
1042
+ }
1043
+ }
1044
+ }
1045
+ } else {
1046
+ if (slideIndex + _.options.slidesToShow > _.slideCount) {
1047
+ _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
1048
+ verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
1049
+ }
1050
+ }
1051
+
1052
+ if (_.slideCount <= _.options.slidesToShow) {
1053
+ _.slideOffset = 0;
1054
+ verticalOffset = 0;
1055
+ }
1056
+
1057
+ if (_.options.centerMode === true && _.options.infinite === true) {
1058
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
1059
+ } else if (_.options.centerMode === true) {
1060
+ _.slideOffset = 0;
1061
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
1062
+ }
1063
+
1064
+ if (_.options.vertical === false) {
1065
+ targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
1066
+ } else {
1067
+ targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
1068
+ }
1069
+
1070
+ if (_.options.variableWidth === true) {
1071
+
1072
+ if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1073
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1074
+ } else {
1075
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
1076
+ }
1077
+
1078
+ if (_.options.rtl === true) {
1079
+ if (targetSlide[0]) {
1080
+ targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1081
+ } else {
1082
+ targetLeft = 0;
1083
+ }
1084
+ } else {
1085
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1086
+ }
1087
+
1088
+ if (_.options.centerMode === true) {
1089
+ if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
1090
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
1091
+ } else {
1092
+ targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
1093
+ }
1094
+
1095
+ if (_.options.rtl === true) {
1096
+ if (targetSlide[0]) {
1097
+ targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
1098
+ } else {
1099
+ targetLeft = 0;
1100
+ }
1101
+ } else {
1102
+ targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
1103
+ }
1104
+
1105
+ targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
1106
+ }
1107
+ }
1108
+
1109
+ return targetLeft;
1110
+
1111
+ };
1112
+
1113
+ Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
1114
+
1115
+ var _ = this;
1116
+
1117
+ return _.options[option];
1118
+
1119
+ };
1120
+
1121
+ Slick.prototype.getNavigableIndexes = function() {
1122
+
1123
+ var _ = this,
1124
+ breakPoint = 0,
1125
+ counter = 0,
1126
+ indexes = [],
1127
+ max;
1128
+
1129
+ if (_.options.infinite === false) {
1130
+ max = _.slideCount;
1131
+ } else {
1132
+ breakPoint = _.options.slidesToScroll * -1;
1133
+ counter = _.options.slidesToScroll * -1;
1134
+ max = _.slideCount * 2;
1135
+ }
1136
+
1137
+ while (breakPoint < max) {
1138
+ indexes.push(breakPoint);
1139
+ breakPoint = counter + _.options.slidesToScroll;
1140
+ counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
1141
+ }
1142
+
1143
+ return indexes;
1144
+
1145
+ };
1146
+
1147
+ Slick.prototype.getSlick = function() {
1148
+
1149
+ return this;
1150
+
1151
+ };
1152
+
1153
+ Slick.prototype.getSlideCount = function() {
1154
+
1155
+ var _ = this,
1156
+ slidesTraversed, swipedSlide, centerOffset;
1157
+
1158
+ centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
1159
+
1160
+ if (_.options.swipeToSlide === true) {
1161
+ _.$slideTrack.find('.slick-slide').each(function(index, slide) {
1162
+ if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
1163
+ swipedSlide = slide;
1164
+ return false;
1165
+ }
1166
+ });
1167
+
1168
+ slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
1169
+
1170
+ return slidesTraversed;
1171
+
1172
+ } else {
1173
+ return _.options.slidesToScroll;
1174
+ }
1175
+
1176
+ };
1177
+
1178
+ Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
1179
+
1180
+ var _ = this;
1181
+
1182
+ _.changeSlide({
1183
+ data: {
1184
+ message: 'index',
1185
+ index: parseInt(slide)
1186
+ }
1187
+ }, dontAnimate);
1188
+
1189
+ };
1190
+
1191
+ Slick.prototype.init = function(creation) {
1192
+
1193
+ var _ = this;
1194
+
1195
+ if (!$(_.$slider).hasClass('slick-initialized')) {
1196
+
1197
+ $(_.$slider).addClass('slick-initialized');
1198
+
1199
+ _.buildRows();
1200
+ _.buildOut();
1201
+ _.setProps();
1202
+ _.startLoad();
1203
+ _.loadSlider();
1204
+ _.initializeEvents();
1205
+ _.updateArrows();
1206
+ _.updateDots();
1207
+
1208
+ }
1209
+
1210
+ if (creation) {
1211
+ _.$slider.trigger('init', [_]);
1212
+ }
1213
+
1214
+ if (_.options.accessibility === true) {
1215
+ _.initADA();
1216
+ }
1217
+
1218
+ };
1219
+
1220
+ Slick.prototype.initArrowEvents = function() {
1221
+
1222
+ var _ = this;
1223
+
1224
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1225
+ _.$prevArrow.on('click.slick', {
1226
+ message: 'previous'
1227
+ }, _.changeSlide);
1228
+ _.$nextArrow.on('click.slick', {
1229
+ message: 'next'
1230
+ }, _.changeSlide);
1231
+ }
1232
+
1233
+ };
1234
+
1235
+ Slick.prototype.initDotEvents = function() {
1236
+
1237
+ var _ = this;
1238
+
1239
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1240
+ $('li', _.$dots).on('click.slick', {
1241
+ message: 'index'
1242
+ }, _.changeSlide);
1243
+ }
1244
+
1245
+ if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
1246
+ $('li', _.$dots)
1247
+ .on('mouseenter.slick', $.proxy(_.setPaused, _, true))
1248
+ .on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1249
+ }
1250
+
1251
+ };
1252
+
1253
+ Slick.prototype.initializeEvents = function() {
1254
+
1255
+ var _ = this;
1256
+
1257
+ _.initArrowEvents();
1258
+
1259
+ _.initDotEvents();
1260
+
1261
+ _.$list.on('touchstart.slick mousedown.slick', {
1262
+ action: 'start'
1263
+ }, _.swipeHandler);
1264
+ _.$list.on('touchmove.slick mousemove.slick', {
1265
+ action: 'move'
1266
+ }, _.swipeHandler);
1267
+ _.$list.on('touchend.slick mouseup.slick', {
1268
+ action: 'end'
1269
+ }, _.swipeHandler);
1270
+ _.$list.on('touchcancel.slick mouseleave.slick', {
1271
+ action: 'end'
1272
+ }, _.swipeHandler);
1273
+
1274
+ _.$list.on('click.slick', _.clickHandler);
1275
+
1276
+ $(document).on(_.visibilityChange, $.proxy(_.visibility, _));
1277
+
1278
+ _.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true));
1279
+ _.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false));
1280
+
1281
+ if (_.options.accessibility === true) {
1282
+ _.$list.on('keydown.slick', _.keyHandler);
1283
+ }
1284
+
1285
+ if (_.options.focusOnSelect === true) {
1286
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1287
+ }
1288
+
1289
+ $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
1290
+
1291
+ $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
1292
+
1293
+ $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
1294
+
1295
+ $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
1296
+ $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
1297
+
1298
+ };
1299
+
1300
+ Slick.prototype.initUI = function() {
1301
+
1302
+ var _ = this;
1303
+
1304
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1305
+
1306
+ _.$prevArrow.show();
1307
+ _.$nextArrow.show();
1308
+
1309
+ }
1310
+
1311
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1312
+
1313
+ _.$dots.show();
1314
+
1315
+ }
1316
+
1317
+ if (_.options.autoplay === true) {
1318
+
1319
+ _.autoPlay();
1320
+
1321
+ }
1322
+
1323
+ };
1324
+
1325
+ Slick.prototype.keyHandler = function(event) {
1326
+
1327
+ var _ = this;
1328
+ //Dont slide if the cursor is inside the form fields and arrow keys are pressed
1329
+ if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
1330
+ if (event.keyCode === 37 && _.options.accessibility === true) {
1331
+ _.changeSlide({
1332
+ data: {
1333
+ message: 'previous'
1334
+ }
1335
+ });
1336
+ } else if (event.keyCode === 39 && _.options.accessibility === true) {
1337
+ _.changeSlide({
1338
+ data: {
1339
+ message: 'next'
1340
+ }
1341
+ });
1342
+ }
1343
+ }
1344
+
1345
+ };
1346
+
1347
+ Slick.prototype.lazyLoad = function() {
1348
+
1349
+ var _ = this,
1350
+ loadRange, cloneRange, rangeStart, rangeEnd;
1351
+
1352
+ function loadImages(imagesScope) {
1353
+ $('img[data-lazy]', imagesScope).each(function() {
1354
+
1355
+ var image = $(this),
1356
+ imageSource = $(this).attr('data-lazy'),
1357
+ imageToLoad = document.createElement('img');
1358
+
1359
+ imageToLoad.onload = function() {
1360
+ image
1361
+ .animate({ opacity: 0 }, 100, function() {
1362
+ image
1363
+ .attr('src', imageSource)
1364
+ .animate({ opacity: 1 }, 200, function() {
1365
+ image
1366
+ .removeAttr('data-lazy')
1367
+ .removeClass('slick-loading');
1368
+ });
1369
+ });
1370
+ };
1371
+
1372
+ imageToLoad.src = imageSource;
1373
+
1374
+ });
1375
+ }
1376
+
1377
+ if (_.options.centerMode === true) {
1378
+ if (_.options.infinite === true) {
1379
+ rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
1380
+ rangeEnd = rangeStart + _.options.slidesToShow + 2;
1381
+ } else {
1382
+ rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
1383
+ rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
1384
+ }
1385
+ } else {
1386
+ rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
1387
+ rangeEnd = rangeStart + _.options.slidesToShow;
1388
+ if (_.options.fade === true) {
1389
+ if (rangeStart > 0) rangeStart--;
1390
+ if (rangeEnd <= _.slideCount) rangeEnd++;
1391
+ }
1392
+ }
1393
+
1394
+ loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
1395
+ loadImages(loadRange);
1396
+
1397
+ if (_.slideCount <= _.options.slidesToShow) {
1398
+ cloneRange = _.$slider.find('.slick-slide');
1399
+ loadImages(cloneRange);
1400
+ } else
1401
+ if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1402
+ cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
1403
+ loadImages(cloneRange);
1404
+ } else if (_.currentSlide === 0) {
1405
+ cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
1406
+ loadImages(cloneRange);
1407
+ }
1408
+
1409
+ };
1410
+
1411
+ Slick.prototype.loadSlider = function() {
1412
+
1413
+ var _ = this;
1414
+
1415
+ _.setPosition();
1416
+
1417
+ _.$slideTrack.css({
1418
+ opacity: 1
1419
+ });
1420
+
1421
+ _.$slider.removeClass('slick-loading');
1422
+
1423
+ _.initUI();
1424
+
1425
+ if (_.options.lazyLoad === 'progressive') {
1426
+ _.progressiveLazyLoad();
1427
+ }
1428
+
1429
+ };
1430
+
1431
+ Slick.prototype.next = Slick.prototype.slickNext = function() {
1432
+
1433
+ var _ = this;
1434
+
1435
+ _.changeSlide({
1436
+ data: {
1437
+ message: 'next'
1438
+ }
1439
+ });
1440
+
1441
+ };
1442
+
1443
+ Slick.prototype.orientationChange = function() {
1444
+
1445
+ var _ = this;
1446
+
1447
+ _.checkResponsive();
1448
+ _.setPosition();
1449
+
1450
+ };
1451
+
1452
+ Slick.prototype.pause = Slick.prototype.slickPause = function() {
1453
+
1454
+ var _ = this;
1455
+
1456
+ _.autoPlayClear();
1457
+ _.paused = true;
1458
+
1459
+ };
1460
+
1461
+ Slick.prototype.play = Slick.prototype.slickPlay = function() {
1462
+
1463
+ var _ = this;
1464
+
1465
+ _.paused = false;
1466
+ _.autoPlay();
1467
+
1468
+ };
1469
+
1470
+ Slick.prototype.postSlide = function(index) {
1471
+
1472
+ var _ = this;
1473
+
1474
+ _.$slider.trigger('afterChange', [_, index]);
1475
+
1476
+ _.animating = false;
1477
+
1478
+ _.setPosition();
1479
+
1480
+ _.swipeLeft = null;
1481
+
1482
+ if (_.options.autoplay === true && _.paused === false) {
1483
+ _.autoPlay();
1484
+ }
1485
+ if (_.options.accessibility === true) {
1486
+ _.initADA();
1487
+ }
1488
+
1489
+ };
1490
+
1491
+ Slick.prototype.prev = Slick.prototype.slickPrev = function() {
1492
+
1493
+ var _ = this;
1494
+
1495
+ _.changeSlide({
1496
+ data: {
1497
+ message: 'previous'
1498
+ }
1499
+ });
1500
+
1501
+ };
1502
+
1503
+ Slick.prototype.preventDefault = function(event) {
1504
+ event.preventDefault();
1505
+ };
1506
+
1507
+ Slick.prototype.progressiveLazyLoad = function() {
1508
+
1509
+ var _ = this,
1510
+ imgCount, targetImage;
1511
+
1512
+ imgCount = $('img[data-lazy]', _.$slider).length;
1513
+
1514
+ if (imgCount > 0) {
1515
+ targetImage = $('img[data-lazy]', _.$slider).first();
1516
+ targetImage.attr('src', null);
1517
+ targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
1518
+ targetImage.removeAttr('data-lazy');
1519
+ _.progressiveLazyLoad();
1520
+
1521
+ if (_.options.adaptiveHeight === true) {
1522
+ _.setPosition();
1523
+ }
1524
+ })
1525
+ .error(function() {
1526
+ targetImage.removeAttr('data-lazy');
1527
+ _.progressiveLazyLoad();
1528
+ });
1529
+ }
1530
+
1531
+ };
1532
+
1533
+ Slick.prototype.refresh = function( initializing ) {
1534
+
1535
+ var _ = this, currentSlide, firstVisible;
1536
+
1537
+ firstVisible = _.slideCount - _.options.slidesToShow;
1538
+
1539
+ // check that the new breakpoint can actually accept the
1540
+ // "current slide" as the current slide, otherwise we need
1541
+ // to set it to the closest possible value.
1542
+ if ( !_.options.infinite ) {
1543
+ if ( _.slideCount <= _.options.slidesToShow ) {
1544
+ _.currentSlide = 0;
1545
+ } else if ( _.currentSlide > firstVisible ) {
1546
+ _.currentSlide = firstVisible;
1547
+ }
1548
+ }
1549
+
1550
+ currentSlide = _.currentSlide;
1551
+
1552
+ _.destroy(true);
1553
+
1554
+ $.extend(_, _.initials, { currentSlide: currentSlide });
1555
+
1556
+ _.init();
1557
+
1558
+ if( !initializing ) {
1559
+
1560
+ _.changeSlide({
1561
+ data: {
1562
+ message: 'index',
1563
+ index: currentSlide
1564
+ }
1565
+ }, false);
1566
+
1567
+ }
1568
+
1569
+ };
1570
+
1571
+ Slick.prototype.registerBreakpoints = function() {
1572
+
1573
+ var _ = this, breakpoint, currentBreakpoint, l,
1574
+ responsiveSettings = _.options.responsive || null;
1575
+
1576
+ if ( $.type(responsiveSettings) === "array" && responsiveSettings.length ) {
1577
+
1578
+ _.respondTo = _.options.respondTo || 'window';
1579
+
1580
+ for ( breakpoint in responsiveSettings ) {
1581
+
1582
+ l = _.breakpoints.length-1;
1583
+ currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
1584
+
1585
+ if (responsiveSettings.hasOwnProperty(breakpoint)) {
1586
+
1587
+ // loop through the breakpoints and cut out any existing
1588
+ // ones with the same breakpoint number, we don't want dupes.
1589
+ while( l >= 0 ) {
1590
+ if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
1591
+ _.breakpoints.splice(l,1);
1592
+ }
1593
+ l--;
1594
+ }
1595
+
1596
+ _.breakpoints.push(currentBreakpoint);
1597
+ _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
1598
+
1599
+ }
1600
+
1601
+ }
1602
+
1603
+ _.breakpoints.sort(function(a, b) {
1604
+ return ( _.options.mobileFirst ) ? a-b : b-a;
1605
+ });
1606
+
1607
+ }
1608
+
1609
+ };
1610
+
1611
+ Slick.prototype.reinit = function() {
1612
+
1613
+ var _ = this;
1614
+
1615
+ _.$slides =
1616
+ _.$slideTrack
1617
+ .children(_.options.slide)
1618
+ .addClass('slick-slide');
1619
+
1620
+ _.slideCount = _.$slides.length;
1621
+
1622
+ if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
1623
+ _.currentSlide = _.currentSlide - _.options.slidesToScroll;
1624
+ }
1625
+
1626
+ if (_.slideCount <= _.options.slidesToShow) {
1627
+ _.currentSlide = 0;
1628
+ }
1629
+
1630
+ _.registerBreakpoints();
1631
+
1632
+ _.setProps();
1633
+ _.setupInfinite();
1634
+ _.buildArrows();
1635
+ _.updateArrows();
1636
+ _.initArrowEvents();
1637
+ _.buildDots();
1638
+ _.updateDots();
1639
+ _.initDotEvents();
1640
+
1641
+ _.checkResponsive(false, true);
1642
+
1643
+ if (_.options.focusOnSelect === true) {
1644
+ $(_.$slideTrack).children().on('click.slick', _.selectHandler);
1645
+ }
1646
+
1647
+ _.setSlideClasses(0);
1648
+
1649
+ _.setPosition();
1650
+
1651
+ _.$slider.trigger('reInit', [_]);
1652
+
1653
+ if (_.options.autoplay === true) {
1654
+ _.focusHandler();
1655
+ }
1656
+
1657
+ };
1658
+
1659
+ Slick.prototype.resize = function() {
1660
+
1661
+ var _ = this;
1662
+
1663
+ if ($(window).width() !== _.windowWidth) {
1664
+ clearTimeout(_.windowDelay);
1665
+ _.windowDelay = window.setTimeout(function() {
1666
+ _.windowWidth = $(window).width();
1667
+ _.checkResponsive();
1668
+ if( !_.unslicked ) { _.setPosition(); }
1669
+ }, 50);
1670
+ }
1671
+ };
1672
+
1673
+ Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
1674
+
1675
+ var _ = this;
1676
+
1677
+ if (typeof(index) === 'boolean') {
1678
+ removeBefore = index;
1679
+ index = removeBefore === true ? 0 : _.slideCount - 1;
1680
+ } else {
1681
+ index = removeBefore === true ? --index : index;
1682
+ }
1683
+
1684
+ if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
1685
+ return false;
1686
+ }
1687
+
1688
+ _.unload();
1689
+
1690
+ if (removeAll === true) {
1691
+ _.$slideTrack.children().remove();
1692
+ } else {
1693
+ _.$slideTrack.children(this.options.slide).eq(index).remove();
1694
+ }
1695
+
1696
+ _.$slides = _.$slideTrack.children(this.options.slide);
1697
+
1698
+ _.$slideTrack.children(this.options.slide).detach();
1699
+
1700
+ _.$slideTrack.append(_.$slides);
1701
+
1702
+ _.$slidesCache = _.$slides;
1703
+
1704
+ _.reinit();
1705
+
1706
+ };
1707
+
1708
+ Slick.prototype.setCSS = function(position) {
1709
+
1710
+ var _ = this,
1711
+ positionProps = {},
1712
+ x, y;
1713
+
1714
+ if (_.options.rtl === true) {
1715
+ position = -position;
1716
+ }
1717
+ x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
1718
+ y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
1719
+
1720
+ positionProps[_.positionProp] = position;
1721
+
1722
+ if (_.transformsEnabled === false) {
1723
+ _.$slideTrack.css(positionProps);
1724
+ } else {
1725
+ positionProps = {};
1726
+ if (_.cssTransitions === false) {
1727
+ positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1728
+ _.$slideTrack.css(positionProps);
1729
+ } else {
1730
+ positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1731
+ _.$slideTrack.css(positionProps);
1732
+ }
1733
+ }
1734
+
1735
+ };
1736
+
1737
+ Slick.prototype.setDimensions = function() {
1738
+
1739
+ var _ = this;
1740
+
1741
+ if (_.options.vertical === false) {
1742
+ if (_.options.centerMode === true) {
1743
+ _.$list.css({
1744
+ padding: ('0px ' + _.options.centerPadding)
1745
+ });
1746
+ }
1747
+ } else {
1748
+ _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
1749
+ if (_.options.centerMode === true) {
1750
+ _.$list.css({
1751
+ padding: (_.options.centerPadding + ' 0px')
1752
+ });
1753
+ }
1754
+ }
1755
+
1756
+ _.listWidth = _.$list.width();
1757
+ _.listHeight = _.$list.height();
1758
+
1759
+
1760
+ if (_.options.vertical === false && _.options.variableWidth === false) {
1761
+ _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
1762
+ _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
1763
+
1764
+ } else if (_.options.variableWidth === true) {
1765
+ _.$slideTrack.width(5000 * _.slideCount);
1766
+ } else {
1767
+ _.slideWidth = Math.ceil(_.listWidth);
1768
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
1769
+ }
1770
+
1771
+ var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
1772
+ if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
1773
+
1774
+ };
1775
+
1776
+ Slick.prototype.setFade = function() {
1777
+
1778
+ var _ = this,
1779
+ targetLeft;
1780
+
1781
+ _.$slides.each(function(index, element) {
1782
+ targetLeft = (_.slideWidth * index) * -1;
1783
+ if (_.options.rtl === true) {
1784
+ $(element).css({
1785
+ position: 'relative',
1786
+ right: targetLeft,
1787
+ top: 0,
1788
+ zIndex: _.options.zIndex - 2,
1789
+ opacity: 0
1790
+ });
1791
+ } else {
1792
+ $(element).css({
1793
+ position: 'relative',
1794
+ left: targetLeft,
1795
+ top: 0,
1796
+ zIndex: _.options.zIndex - 2,
1797
+ opacity: 0
1798
+ });
1799
+ }
1800
+ });
1801
+
1802
+ _.$slides.eq(_.currentSlide).css({
1803
+ zIndex: _.options.zIndex - 1,
1804
+ opacity: 1
1805
+ });
1806
+
1807
+ };
1808
+
1809
+ Slick.prototype.setHeight = function() {
1810
+
1811
+ var _ = this;
1812
+
1813
+ if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
1814
+ var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
1815
+ _.$list.css('height', targetHeight);
1816
+ }
1817
+
1818
+ };
1819
+
1820
+ Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) {
1821
+
1822
+ var _ = this, l, item;
1823
+
1824
+ if( option === "responsive" && $.type(value) === "array" ) {
1825
+ for ( item in value ) {
1826
+ if( $.type( _.options.responsive ) !== "array" ) {
1827
+ _.options.responsive = [ value[item] ];
1828
+ } else {
1829
+ l = _.options.responsive.length-1;
1830
+ // loop through the responsive object and splice out duplicates.
1831
+ while( l >= 0 ) {
1832
+ if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
1833
+ _.options.responsive.splice(l,1);
1834
+ }
1835
+ l--;
1836
+ }
1837
+ _.options.responsive.push( value[item] );
1838
+ }
1839
+ }
1840
+ } else {
1841
+ _.options[option] = value;
1842
+ }
1843
+
1844
+ if (refresh === true) {
1845
+ _.unload();
1846
+ _.reinit();
1847
+ }
1848
+
1849
+ };
1850
+
1851
+ Slick.prototype.setPosition = function() {
1852
+
1853
+ var _ = this;
1854
+
1855
+ _.setDimensions();
1856
+
1857
+ _.setHeight();
1858
+
1859
+ if (_.options.fade === false) {
1860
+ _.setCSS(_.getLeft(_.currentSlide));
1861
+ } else {
1862
+ _.setFade();
1863
+ }
1864
+
1865
+ _.$slider.trigger('setPosition', [_]);
1866
+
1867
+ };
1868
+
1869
+ Slick.prototype.setProps = function() {
1870
+
1871
+ var _ = this,
1872
+ bodyStyle = document.body.style;
1873
+
1874
+ _.positionProp = _.options.vertical === true ? 'top' : 'left';
1875
+
1876
+ if (_.positionProp === 'top') {
1877
+ _.$slider.addClass('slick-vertical');
1878
+ } else {
1879
+ _.$slider.removeClass('slick-vertical');
1880
+ }
1881
+
1882
+ if (bodyStyle.WebkitTransition !== undefined ||
1883
+ bodyStyle.MozTransition !== undefined ||
1884
+ bodyStyle.msTransition !== undefined) {
1885
+ if (_.options.useCSS === true) {
1886
+ _.cssTransitions = true;
1887
+ }
1888
+ }
1889
+
1890
+ if ( _.options.fade ) {
1891
+ if ( typeof _.options.zIndex === 'number' ) {
1892
+ if( _.options.zIndex < 3 ) {
1893
+ _.options.zIndex = 3;
1894
+ }
1895
+ } else {
1896
+ _.options.zIndex = _.defaults.zIndex;
1897
+ }
1898
+ }
1899
+
1900
+ if (bodyStyle.OTransform !== undefined) {
1901
+ _.animType = 'OTransform';
1902
+ _.transformType = '-o-transform';
1903
+ _.transitionType = 'OTransition';
1904
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1905
+ }
1906
+ if (bodyStyle.MozTransform !== undefined) {
1907
+ _.animType = 'MozTransform';
1908
+ _.transformType = '-moz-transform';
1909
+ _.transitionType = 'MozTransition';
1910
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
1911
+ }
1912
+ if (bodyStyle.webkitTransform !== undefined) {
1913
+ _.animType = 'webkitTransform';
1914
+ _.transformType = '-webkit-transform';
1915
+ _.transitionType = 'webkitTransition';
1916
+ if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
1917
+ }
1918
+ if (bodyStyle.msTransform !== undefined) {
1919
+ _.animType = 'msTransform';
1920
+ _.transformType = '-ms-transform';
1921
+ _.transitionType = 'msTransition';
1922
+ if (bodyStyle.msTransform === undefined) _.animType = false;
1923
+ }
1924
+ if (bodyStyle.transform !== undefined && _.animType !== false) {
1925
+ _.animType = 'transform';
1926
+ _.transformType = 'transform';
1927
+ _.transitionType = 'transition';
1928
+ }
1929
+ _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
1930
+ };
1931
+
1932
+
1933
+ Slick.prototype.setSlideClasses = function(index) {
1934
+
1935
+ var _ = this,
1936
+ centerOffset, allSlides, indexOffset, remainder;
1937
+
1938
+ allSlides = _.$slider
1939
+ .find('.slick-slide')
1940
+ .removeClass('slick-active slick-center slick-current')
1941
+ .attr('aria-hidden', 'true');
1942
+
1943
+ _.$slides
1944
+ .eq(index)
1945
+ .addClass('slick-current');
1946
+
1947
+ if (_.options.centerMode === true) {
1948
+
1949
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
1950
+
1951
+ if (_.options.infinite === true) {
1952
+
1953
+ if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
1954
+
1955
+ _.$slides
1956
+ .slice(index - centerOffset, index + centerOffset + 1)
1957
+ .addClass('slick-active')
1958
+ .attr('aria-hidden', 'false');
1959
+
1960
+ } else {
1961
+
1962
+ indexOffset = _.options.slidesToShow + index;
1963
+ allSlides
1964
+ .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
1965
+ .addClass('slick-active')
1966
+ .attr('aria-hidden', 'false');
1967
+
1968
+ }
1969
+
1970
+ if (index === 0) {
1971
+
1972
+ allSlides
1973
+ .eq(allSlides.length - 1 - _.options.slidesToShow)
1974
+ .addClass('slick-center');
1975
+
1976
+ } else if (index === _.slideCount - 1) {
1977
+
1978
+ allSlides
1979
+ .eq(_.options.slidesToShow)
1980
+ .addClass('slick-center');
1981
+
1982
+ }
1983
+
1984
+ }
1985
+
1986
+ _.$slides
1987
+ .eq(index)
1988
+ .addClass('slick-center');
1989
+
1990
+ } else {
1991
+
1992
+ if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
1993
+
1994
+ _.$slides
1995
+ .slice(index, index + _.options.slidesToShow)
1996
+ .addClass('slick-active')
1997
+ .attr('aria-hidden', 'false');
1998
+
1999
+ } else if (allSlides.length <= _.options.slidesToShow) {
2000
+
2001
+ allSlides
2002
+ .addClass('slick-active')
2003
+ .attr('aria-hidden', 'false');
2004
+
2005
+ } else {
2006
+
2007
+ remainder = _.slideCount % _.options.slidesToShow;
2008
+ indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
2009
+
2010
+ if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
2011
+
2012
+ allSlides
2013
+ .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
2014
+ .addClass('slick-active')
2015
+ .attr('aria-hidden', 'false');
2016
+
2017
+ } else {
2018
+
2019
+ allSlides
2020
+ .slice(indexOffset, indexOffset + _.options.slidesToShow)
2021
+ .addClass('slick-active')
2022
+ .attr('aria-hidden', 'false');
2023
+
2024
+ }
2025
+
2026
+ }
2027
+
2028
+ }
2029
+
2030
+ if (_.options.lazyLoad === 'ondemand') {
2031
+ _.lazyLoad();
2032
+ }
2033
+
2034
+ };
2035
+
2036
+ Slick.prototype.setupInfinite = function() {
2037
+
2038
+ var _ = this,
2039
+ i, slideIndex, infiniteCount;
2040
+
2041
+ if (_.options.fade === true) {
2042
+ _.options.centerMode = false;
2043
+ }
2044
+
2045
+ if (_.options.infinite === true && _.options.fade === false) {
2046
+
2047
+ slideIndex = null;
2048
+
2049
+ if (_.slideCount > _.options.slidesToShow) {
2050
+
2051
+ if (_.options.centerMode === true) {
2052
+ infiniteCount = _.options.slidesToShow + 1;
2053
+ } else {
2054
+ infiniteCount = _.options.slidesToShow;
2055
+ }
2056
+
2057
+ for (i = _.slideCount; i > (_.slideCount -
2058
+ infiniteCount); i -= 1) {
2059
+ slideIndex = i - 1;
2060
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
2061
+ .attr('data-slick-index', slideIndex - _.slideCount)
2062
+ .prependTo(_.$slideTrack).addClass('slick-cloned');
2063
+ }
2064
+ for (i = 0; i < infiniteCount; i += 1) {
2065
+ slideIndex = i;
2066
+ $(_.$slides[slideIndex]).clone(true).attr('id', '')
2067
+ .attr('data-slick-index', slideIndex + _.slideCount)
2068
+ .appendTo(_.$slideTrack).addClass('slick-cloned');
2069
+ }
2070
+ _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
2071
+ $(this).attr('id', '');
2072
+ });
2073
+
2074
+ }
2075
+
2076
+ }
2077
+
2078
+ };
2079
+
2080
+ Slick.prototype.setPaused = function(paused) {
2081
+
2082
+ var _ = this;
2083
+
2084
+ if (_.options.autoplay === true && _.options.pauseOnHover === true) {
2085
+ _.paused = paused;
2086
+ if (!paused) {
2087
+ _.autoPlay();
2088
+ } else {
2089
+ _.autoPlayClear();
2090
+ }
2091
+ }
2092
+ };
2093
+
2094
+ Slick.prototype.selectHandler = function(event) {
2095
+
2096
+ var _ = this;
2097
+
2098
+ var targetElement =
2099
+ $(event.target).is('.slick-slide') ?
2100
+ $(event.target) :
2101
+ $(event.target).parents('.slick-slide');
2102
+
2103
+ var index = parseInt(targetElement.attr('data-slick-index'));
2104
+
2105
+ if (!index) index = 0;
2106
+
2107
+ if (_.slideCount <= _.options.slidesToShow) {
2108
+
2109
+ _.setSlideClasses(index);
2110
+ _.asNavFor(index);
2111
+ return;
2112
+
2113
+ }
2114
+
2115
+ _.slideHandler(index);
2116
+
2117
+ };
2118
+
2119
+ Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
2120
+
2121
+ var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
2122
+ _ = this;
2123
+
2124
+ sync = sync || false;
2125
+
2126
+ if (_.animating === true && _.options.waitForAnimate === true) {
2127
+ return;
2128
+ }
2129
+
2130
+ if (_.options.fade === true && _.currentSlide === index) {
2131
+ return;
2132
+ }
2133
+
2134
+ if (_.slideCount <= _.options.slidesToShow) {
2135
+ return;
2136
+ }
2137
+
2138
+ if (sync === false) {
2139
+ _.asNavFor(index);
2140
+ }
2141
+
2142
+ targetSlide = index;
2143
+ targetLeft = _.getLeft(targetSlide);
2144
+ slideLeft = _.getLeft(_.currentSlide);
2145
+
2146
+ _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
2147
+
2148
+ if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
2149
+ if (_.options.fade === false) {
2150
+ targetSlide = _.currentSlide;
2151
+ if (dontAnimate !== true) {
2152
+ _.animateSlide(slideLeft, function() {
2153
+ _.postSlide(targetSlide);
2154
+ });
2155
+ } else {
2156
+ _.postSlide(targetSlide);
2157
+ }
2158
+ }
2159
+ return;
2160
+ } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
2161
+ if (_.options.fade === false) {
2162
+ targetSlide = _.currentSlide;
2163
+ if (dontAnimate !== true) {
2164
+ _.animateSlide(slideLeft, function() {
2165
+ _.postSlide(targetSlide);
2166
+ });
2167
+ } else {
2168
+ _.postSlide(targetSlide);
2169
+ }
2170
+ }
2171
+ return;
2172
+ }
2173
+
2174
+ if (_.options.autoplay === true) {
2175
+ clearInterval(_.autoPlayTimer);
2176
+ }
2177
+
2178
+ if (targetSlide < 0) {
2179
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
2180
+ animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
2181
+ } else {
2182
+ animSlide = _.slideCount + targetSlide;
2183
+ }
2184
+ } else if (targetSlide >= _.slideCount) {
2185
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
2186
+ animSlide = 0;
2187
+ } else {
2188
+ animSlide = targetSlide - _.slideCount;
2189
+ }
2190
+ } else {
2191
+ animSlide = targetSlide;
2192
+ }
2193
+
2194
+ _.animating = true;
2195
+
2196
+ _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
2197
+
2198
+ oldSlide = _.currentSlide;
2199
+ _.currentSlide = animSlide;
2200
+
2201
+ _.setSlideClasses(_.currentSlide);
2202
+
2203
+ _.updateDots();
2204
+ _.updateArrows();
2205
+
2206
+ if (_.options.fade === true) {
2207
+ if (dontAnimate !== true) {
2208
+
2209
+ _.fadeSlideOut(oldSlide);
2210
+
2211
+ _.fadeSlide(animSlide, function() {
2212
+ _.postSlide(animSlide);
2213
+ });
2214
+
2215
+ } else {
2216
+ _.postSlide(animSlide);
2217
+ }
2218
+ _.animateHeight();
2219
+ return;
2220
+ }
2221
+
2222
+ if (dontAnimate !== true) {
2223
+ _.animateSlide(targetLeft, function() {
2224
+ _.postSlide(animSlide);
2225
+ });
2226
+ } else {
2227
+ _.postSlide(animSlide);
2228
+ }
2229
+
2230
+ };
2231
+
2232
+ Slick.prototype.startLoad = function() {
2233
+
2234
+ var _ = this;
2235
+
2236
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
2237
+
2238
+ _.$prevArrow.hide();
2239
+ _.$nextArrow.hide();
2240
+
2241
+ }
2242
+
2243
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
2244
+
2245
+ _.$dots.hide();
2246
+
2247
+ }
2248
+
2249
+ _.$slider.addClass('slick-loading');
2250
+
2251
+ };
2252
+
2253
+ Slick.prototype.swipeDirection = function() {
2254
+
2255
+ var xDist, yDist, r, swipeAngle, _ = this;
2256
+
2257
+ xDist = _.touchObject.startX - _.touchObject.curX;
2258
+ yDist = _.touchObject.startY - _.touchObject.curY;
2259
+ r = Math.atan2(yDist, xDist);
2260
+
2261
+ swipeAngle = Math.round(r * 180 / Math.PI);
2262
+ if (swipeAngle < 0) {
2263
+ swipeAngle = 360 - Math.abs(swipeAngle);
2264
+ }
2265
+
2266
+ if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
2267
+ return (_.options.rtl === false ? 'left' : 'right');
2268
+ }
2269
+ if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
2270
+ return (_.options.rtl === false ? 'left' : 'right');
2271
+ }
2272
+ if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
2273
+ return (_.options.rtl === false ? 'right' : 'left');
2274
+ }
2275
+ if (_.options.verticalSwiping === true) {
2276
+ if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
2277
+ return 'left';
2278
+ } else {
2279
+ return 'right';
2280
+ }
2281
+ }
2282
+
2283
+ return 'vertical';
2284
+
2285
+ };
2286
+
2287
+ Slick.prototype.swipeEnd = function(event) {
2288
+
2289
+ var _ = this,
2290
+ slideCount;
2291
+
2292
+ _.dragging = false;
2293
+
2294
+ _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true;
2295
+
2296
+ if (_.touchObject.curX === undefined) {
2297
+ return false;
2298
+ }
2299
+
2300
+ if (_.touchObject.edgeHit === true) {
2301
+ _.$slider.trigger('edge', [_, _.swipeDirection()]);
2302
+ }
2303
+
2304
+ if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
2305
+
2306
+ switch (_.swipeDirection()) {
2307
+ case 'left':
2308
+ slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
2309
+ _.slideHandler(slideCount);
2310
+ _.currentDirection = 0;
2311
+ _.touchObject = {};
2312
+ _.$slider.trigger('swipe', [_, 'left']);
2313
+ break;
2314
+
2315
+ case 'right':
2316
+ slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
2317
+ _.slideHandler(slideCount);
2318
+ _.currentDirection = 1;
2319
+ _.touchObject = {};
2320
+ _.$slider.trigger('swipe', [_, 'right']);
2321
+ break;
2322
+ }
2323
+ } else {
2324
+ if (_.touchObject.startX !== _.touchObject.curX) {
2325
+ _.slideHandler(_.currentSlide);
2326
+ _.touchObject = {};
2327
+ }
2328
+ }
2329
+
2330
+ };
2331
+
2332
+ Slick.prototype.swipeHandler = function(event) {
2333
+
2334
+ var _ = this;
2335
+
2336
+ if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
2337
+ return;
2338
+ } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
2339
+ return;
2340
+ }
2341
+
2342
+ _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
2343
+ event.originalEvent.touches.length : 1;
2344
+
2345
+ _.touchObject.minSwipe = _.listWidth / _.options
2346
+ .touchThreshold;
2347
+
2348
+ if (_.options.verticalSwiping === true) {
2349
+ _.touchObject.minSwipe = _.listHeight / _.options
2350
+ .touchThreshold;
2351
+ }
2352
+
2353
+ switch (event.data.action) {
2354
+
2355
+ case 'start':
2356
+ _.swipeStart(event);
2357
+ break;
2358
+
2359
+ case 'move':
2360
+ _.swipeMove(event);
2361
+ break;
2362
+
2363
+ case 'end':
2364
+ _.swipeEnd(event);
2365
+ break;
2366
+
2367
+ }
2368
+
2369
+ };
2370
+
2371
+ Slick.prototype.swipeMove = function(event) {
2372
+
2373
+ var _ = this,
2374
+ edgeWasHit = false,
2375
+ curLeft, swipeDirection, swipeLength, positionOffset, touches;
2376
+
2377
+ touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
2378
+
2379
+ if (!_.dragging || touches && touches.length !== 1) {
2380
+ return false;
2381
+ }
2382
+
2383
+ curLeft = _.getLeft(_.currentSlide);
2384
+
2385
+ _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
2386
+ _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
2387
+
2388
+ _.touchObject.swipeLength = Math.round(Math.sqrt(
2389
+ Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
2390
+
2391
+ if (_.options.verticalSwiping === true) {
2392
+ _.touchObject.swipeLength = Math.round(Math.sqrt(
2393
+ Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
2394
+ }
2395
+
2396
+ swipeDirection = _.swipeDirection();
2397
+
2398
+ if (swipeDirection === 'vertical') {
2399
+ return;
2400
+ }
2401
+
2402
+ if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
2403
+ event.preventDefault();
2404
+ }
2405
+
2406
+ positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
2407
+ if (_.options.verticalSwiping === true) {
2408
+ positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
2409
+ }
2410
+
2411
+
2412
+ swipeLength = _.touchObject.swipeLength;
2413
+
2414
+ _.touchObject.edgeHit = false;
2415
+
2416
+ if (_.options.infinite === false) {
2417
+ if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
2418
+ swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
2419
+ _.touchObject.edgeHit = true;
2420
+ }
2421
+ }
2422
+
2423
+ if (_.options.vertical === false) {
2424
+ _.swipeLeft = curLeft + swipeLength * positionOffset;
2425
+ } else {
2426
+ _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
2427
+ }
2428
+ if (_.options.verticalSwiping === true) {
2429
+ _.swipeLeft = curLeft + swipeLength * positionOffset;
2430
+ }
2431
+
2432
+ if (_.options.fade === true || _.options.touchMove === false) {
2433
+ return false;
2434
+ }
2435
+
2436
+ if (_.animating === true) {
2437
+ _.swipeLeft = null;
2438
+ return false;
2439
+ }
2440
+
2441
+ _.setCSS(_.swipeLeft);
2442
+
2443
+ };
2444
+
2445
+ Slick.prototype.swipeStart = function(event) {
2446
+
2447
+ var _ = this,
2448
+ touches;
2449
+
2450
+ if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
2451
+ _.touchObject = {};
2452
+ return false;
2453
+ }
2454
+
2455
+ if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
2456
+ touches = event.originalEvent.touches[0];
2457
+ }
2458
+
2459
+ _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
2460
+ _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
2461
+
2462
+ _.dragging = true;
2463
+
2464
+ };
2465
+
2466
+ Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
2467
+
2468
+ var _ = this;
2469
+
2470
+ if (_.$slidesCache !== null) {
2471
+
2472
+ _.unload();
2473
+
2474
+ _.$slideTrack.children(this.options.slide).detach();
2475
+
2476
+ _.$slidesCache.appendTo(_.$slideTrack);
2477
+
2478
+ _.reinit();
2479
+
2480
+ }
2481
+
2482
+ };
2483
+
2484
+ Slick.prototype.unload = function() {
2485
+
2486
+ var _ = this;
2487
+
2488
+ $('.slick-cloned', _.$slider).remove();
2489
+
2490
+ if (_.$dots) {
2491
+ _.$dots.remove();
2492
+ }
2493
+
2494
+ if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
2495
+ _.$prevArrow.remove();
2496
+ }
2497
+
2498
+ if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
2499
+ _.$nextArrow.remove();
2500
+ }
2501
+
2502
+ _.$slides
2503
+ .removeClass('slick-slide slick-active slick-visible slick-current')
2504
+ .attr('aria-hidden', 'true')
2505
+ .css('width', '');
2506
+
2507
+ };
2508
+
2509
+ Slick.prototype.unslick = function(fromBreakpoint) {
2510
+
2511
+ var _ = this;
2512
+ _.$slider.trigger('unslick', [_, fromBreakpoint]);
2513
+ _.destroy();
2514
+
2515
+ };
2516
+
2517
+ Slick.prototype.updateArrows = function() {
2518
+
2519
+ var _ = this,
2520
+ centerOffset;
2521
+
2522
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
2523
+
2524
+ if ( _.options.arrows === true &&
2525
+ _.slideCount > _.options.slidesToShow &&
2526
+ !_.options.infinite ) {
2527
+
2528
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2529
+ _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2530
+
2531
+ if (_.currentSlide === 0) {
2532
+
2533
+ _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2534
+ _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2535
+
2536
+ } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
2537
+
2538
+ _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2539
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2540
+
2541
+ } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
2542
+
2543
+ _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
2544
+ _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
2545
+
2546
+ }
2547
+
2548
+ }
2549
+
2550
+ };
2551
+
2552
+ Slick.prototype.updateDots = function() {
2553
+
2554
+ var _ = this;
2555
+
2556
+ if (_.$dots !== null) {
2557
+
2558
+ _.$dots
2559
+ .find('li')
2560
+ .removeClass('slick-active')
2561
+ .attr('aria-hidden', 'true');
2562
+
2563
+ _.$dots
2564
+ .find('li')
2565
+ .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
2566
+ .addClass('slick-active')
2567
+ .attr('aria-hidden', 'false');
2568
+
2569
+ }
2570
+
2571
+ };
2572
+
2573
+ Slick.prototype.visibility = function() {
2574
+
2575
+ var _ = this;
2576
+
2577
+ if (document[_.hidden]) {
2578
+ _.paused = true;
2579
+ _.autoPlayClear();
2580
+ } else {
2581
+ if (_.options.autoplay === true) {
2582
+ _.paused = false;
2583
+ _.autoPlay();
2584
+ }
2585
+ }
2586
+
2587
+ };
2588
+ Slick.prototype.initADA = function() {
2589
+ var _ = this;
2590
+ _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
2591
+ 'aria-hidden': 'true',
2592
+ 'tabindex': '-1'
2593
+ }).find('a, input, button, select').attr({
2594
+ 'tabindex': '-1'
2595
+ });
2596
+
2597
+ _.$slideTrack.attr('role', 'listbox');
2598
+
2599
+ _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
2600
+ $(this).attr({
2601
+ 'role': 'option',
2602
+ 'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
2603
+ });
2604
+ });
2605
+
2606
+ if (_.$dots !== null) {
2607
+ _.$dots.attr('role', 'tablist').find('li').each(function(i) {
2608
+ $(this).attr({
2609
+ 'role': 'presentation',
2610
+ 'aria-selected': 'false',
2611
+ 'aria-controls': 'navigation' + _.instanceUid + i + '',
2612
+ 'id': 'slick-slide' + _.instanceUid + i + ''
2613
+ });
2614
+ })
2615
+ .first().attr('aria-selected', 'true').end()
2616
+ .find('button').attr('role', 'button').end()
2617
+ .closest('div').attr('role', 'toolbar');
2618
+ }
2619
+ _.activateADA();
2620
+
2621
+ };
2622
+
2623
+ Slick.prototype.activateADA = function() {
2624
+ var _ = this;
2625
+
2626
+ _.$slideTrack.find('.slick-active').attr({
2627
+ 'aria-hidden': 'false'
2628
+ }).find('a, input, button, select').attr({
2629
+ 'tabindex': '0'
2630
+ });
2631
+
2632
+ };
2633
+
2634
+ Slick.prototype.focusHandler = function() {
2635
+ var _ = this;
2636
+ _.$slider.on('focus.slick blur.slick', '*', function(event) {
2637
+ event.stopImmediatePropagation();
2638
+ var sf = $(this);
2639
+ setTimeout(function() {
2640
+ if (_.isPlay) {
2641
+ if (sf.is(':focus')) {
2642
+ _.autoPlayClear();
2643
+ _.paused = true;
2644
+ } else {
2645
+ _.paused = false;
2646
+ _.autoPlay();
2647
+ }
2648
+ }
2649
+ }, 0);
2650
+ });
2651
+ };
2652
+
2653
+ $.fn.slick = function() {
2654
+ var _ = this,
2655
+ opt = arguments[0],
2656
+ args = Array.prototype.slice.call(arguments, 1),
2657
+ l = _.length,
2658
+ i,
2659
+ ret;
2660
+ for (i = 0; i < l; i++) {
2661
+ if (typeof opt == 'object' || typeof opt == 'undefined')
2662
+ _[i].slick = new Slick(_[i], opt);
2663
+ else
2664
+ ret = _[i].slick[opt].apply(_[i].slick, args);
2665
+ if (typeof ret != 'undefined') return ret;
2666
+ }
2667
+ return _;
2668
+ };
2669
+
2670
+ }));
assets/js/slick/slick.less CHANGED
@@ -1,99 +1,99 @@
1
- /* Slider */
2
-
3
- .slick-slider {
4
- position: relative;
5
- display: block;
6
- -moz-box-sizing: border-box;
7
- box-sizing: border-box;
8
- -webkit-touch-callout: none;
9
- -webkit-user-select: none;
10
- -khtml-user-select: none;
11
- -moz-user-select: none;
12
- -ms-user-select: none;
13
- user-select: none;
14
- -ms-touch-action: pan-y;
15
- touch-action: pan-y;
16
- -webkit-tap-highlight-color: transparent;
17
- }
18
- .slick-list {
19
- position: relative;
20
- overflow: hidden;
21
- display: block;
22
- margin: 0;
23
- padding: 0;
24
-
25
- &:focus {
26
- outline: none;
27
- }
28
-
29
- &.dragging {
30
- cursor: pointer;
31
- cursor: hand;
32
- }
33
- }
34
- .slick-slider .slick-track,
35
- .slick-slider .slick-list {
36
- -webkit-transform: translate3d(0, 0, 0);
37
- -moz-transform: translate3d(0, 0, 0);
38
- -ms-transform: translate3d(0, 0, 0);
39
- -o-transform: translate3d(0, 0, 0);
40
- transform: translate3d(0, 0, 0);
41
- }
42
-
43
- .slick-track {
44
- position: relative;
45
- left: 0;
46
- top: 0;
47
- display: block;
48
-
49
- &:before,
50
- &:after {
51
- content: "";
52
- display: table;
53
- }
54
-
55
- &:after {
56
- clear: both;
57
- }
58
-
59
- .slick-loading & {
60
- visibility: hidden;
61
- }
62
- }
63
- .slick-slide {
64
- float: left;
65
- height: 100%;
66
- min-height: 1px;
67
- [dir="rtl"] & {
68
- float: right;
69
- }
70
- img {
71
- display: block;
72
- }
73
- &.slick-loading img {
74
- display: none;
75
- }
76
-
77
- display: none;
78
-
79
- &.dragging img {
80
- pointer-events: none;
81
- }
82
-
83
- .slick-initialized & {
84
- display: block;
85
- }
86
-
87
- .slick-loading & {
88
- visibility: hidden;
89
- }
90
-
91
- .slick-vertical & {
92
- display: block;
93
- height: auto;
94
- border: 1px solid transparent;
95
- }
96
- }
97
- .slick-arrow.slick-hidden {
98
- display: none;
99
- }
1
+ /* Slider */
2
+
3
+ .slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ -moz-box-sizing: border-box;
7
+ box-sizing: border-box;
8
+ -webkit-touch-callout: none;
9
+ -webkit-user-select: none;
10
+ -khtml-user-select: none;
11
+ -moz-user-select: none;
12
+ -ms-user-select: none;
13
+ user-select: none;
14
+ -ms-touch-action: pan-y;
15
+ touch-action: pan-y;
16
+ -webkit-tap-highlight-color: transparent;
17
+ }
18
+ .slick-list {
19
+ position: relative;
20
+ overflow: hidden;
21
+ display: block;
22
+ margin: 0;
23
+ padding: 0;
24
+
25
+ &:focus {
26
+ outline: none;
27
+ }
28
+
29
+ &.dragging {
30
+ cursor: pointer;
31
+ cursor: hand;
32
+ }
33
+ }
34
+ .slick-slider .slick-track,
35
+ .slick-slider .slick-list {
36
+ -webkit-transform: translate3d(0, 0, 0);
37
+ -moz-transform: translate3d(0, 0, 0);
38
+ -ms-transform: translate3d(0, 0, 0);
39
+ -o-transform: translate3d(0, 0, 0);
40
+ transform: translate3d(0, 0, 0);
41
+ }
42
+
43
+ .slick-track {
44
+ position: relative;
45
+ left: 0;
46
+ top: 0;
47
+ display: block;
48
+
49
+ &:before,
50
+ &:after {
51
+ content: "";
52
+ display: table;
53
+ }
54
+
55
+ &:after {
56
+ clear: both;
57
+ }
58
+
59
+ .slick-loading & {
60
+ visibility: hidden;
61
+ }
62
+ }
63
+ .slick-slide {
64
+ float: left;
65
+ height: 100%;
66
+ min-height: 1px;
67
+ [dir="rtl"] & {
68
+ float: right;
69
+ }
70
+ img {
71
+ display: block;
72
+ }
73
+ &.slick-loading img {
74
+ display: none;
75
+ }
76
+
77
+ display: none;
78
+
79
+ &.dragging img {
80
+ pointer-events: none;
81
+ }
82
+
83
+ .slick-initialized & {
84
+ display: block;
85
+ }
86
+
87
+ .slick-loading & {
88
+ visibility: hidden;
89
+ }
90
+
91
+ .slick-vertical & {
92
+ display: block;
93
+ height: auto;
94
+ border: 1px solid transparent;
95
+ }
96
+ }
97
+ .slick-arrow.slick-hidden {
98
+ display: none;
99
+ }
assets/js/slick/slick.min.js CHANGED
@@ -1,18 +1,18 @@
1
- /*
2
- _ _ _ _
3
- ___| (_) ___| | __ (_)___
4
- / __| | |/ __| |/ / | / __|
5
- \__ \ | | (__| < _ | \__ \
6
- |___/_|_|\___|_|\_(_)/ |___/
7
- |__/
8
-
9
- Version: 1.5.9
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
- !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">'+(b+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!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:!1,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.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,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(a.currentSlide-1===0&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="'+b.options.dotsClass+'">',c=0;c<=b.getDotCount();c+=1)d+="<li>"+b.options.customPaging.call(this,b,c)+"</li>";d+="</ul>",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.html(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&(a("li",b.$dots).off("click.slick",b.changeSlide),b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).off("mouseenter.slick",a.proxy(b.setPaused,b,!0)).off("mouseleave.slick",a.proxy(b.setPaused,b,!1))),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",null),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,c.options.infinite||(c.slideCount<=c.options.slidesToShow?c.currentSlide=0:c.currentSlide>e&&(c.currentSlide=e)),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d);
18
  }):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(a){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});
1
+ /*
2
+ _ _ _ _
3
+ ___| (_) ___| | __ (_)___
4
+ / __| | |/ __| |/ / | / __|
5
+ \__ \ | | (__| < _ | \__ \
6
+ |___/_|_|\___|_|\_(_)/ |___/
7
+ |__/
8
+
9
+ Version: 1.5.9
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
+ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">'+(b+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!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:!1,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.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,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),e.options.vertical===!1?d[e.animType]="translate3d("+b+"px, 0px, 0px)":d[e.animType]="translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};b.options.fade===!1?c[b.transitionType]=b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:c[b.transitionType]="opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(a.currentSlide-1===0&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="'+b.options.dotsClass+'">',c=0;c<=b.getDotCount();c+=1)d+="<li>"+b.options.customPaging.call(this,b,c)+"</li>";d+="</ul>",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.html(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=d.slideCount%d.options.slidesToScroll!==0,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&(a("li",b.$dots).off("click.slick",b.changeSlide),b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).off("mouseenter.slick",a.proxy(b.setPaused,b,!0)).off("mouseleave.slick",a.proxy(b.setPaused,b,!1))),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.$slidesCache=b.$slides,b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else for(;b<a.slideCount;)++d,b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=b.slideWidth*b.options.slidesToShow*-1,e=d*b.options.slidesToShow*-1),b.slideCount%b.options.slidesToScroll!==0&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth*-1,e=(b.options.slidesToShow-(a-b.slideCount))*d*-1):(b.slideOffset=b.slideCount%b.options.slidesToScroll*b.slideWidth*-1,e=b.slideCount%b.options.slidesToScroll*d*-1))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?a*b.slideWidth*-1+b.slideOffset:a*d*-1+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=b.options.rtl===!0?f[0]?-1*(b.$slideTrack.width()-f[0].offsetLeft-f.width()):0:f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",null),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var d,e,c=this;e=c.slideCount-c.options.slidesToShow,c.options.infinite||(c.slideCount<=c.options.slidesToShow?c.currentSlide=0:c.currentSlide>e&&(c.currentSlide=e)),d=c.currentSlide,c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,void d.reinit())},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=b.slideWidth*d*-1,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=a.options.useTransform&&null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),void c.asNavFor(e)):void c.slideHandler(e)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d);
18
  }):i.postSlide(d))):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?void(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d))):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?i.slideCount%i.options.slidesToScroll!==0?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?i.slideCount%i.options.slidesToScroll!==0?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)})):i.postSlide(e),void i.animateHeight()):void(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e))))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(a){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.options.vertical===!1?b.swipeLeft=d+f*g:b.swipeLeft=d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):void b.setCSS(b.swipeLeft)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,void(b.dragging=!0))},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this;a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var f,g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length;for(f=0;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});
assets/js/slick/slick.scss CHANGED
@@ -1,99 +1,99 @@
1
- /* Slider */
2
-
3
- .slick-slider {
4
- position: relative;
5
- display: block;
6
- -moz-box-sizing: border-box;
7
- box-sizing: border-box;
8
- -webkit-touch-callout: none;
9
- -webkit-user-select: none;
10
- -khtml-user-select: none;
11
- -moz-user-select: none;
12
- -ms-user-select: none;
13
- user-select: none;
14
- -ms-touch-action: pan-y;
15
- touch-action: pan-y;
16
- -webkit-tap-highlight-color: transparent;
17
- }
18
- .slick-list {
19
- position: relative;
20
- overflow: hidden;
21
- display: block;
22
- margin: 0;
23
- padding: 0;
24
-
25
- &:focus {
26
- outline: none;
27
- }
28
-
29
- &.dragging {
30
- cursor: pointer;
31
- cursor: hand;
32
- }
33
- }
34
- .slick-slider .slick-track,
35
- .slick-slider .slick-list {
36
- -webkit-transform: translate3d(0, 0, 0);
37
- -moz-transform: translate3d(0, 0, 0);
38
- -ms-transform: translate3d(0, 0, 0);
39
- -o-transform: translate3d(0, 0, 0);
40
- transform: translate3d(0, 0, 0);
41
- }
42
-
43
- .slick-track {
44
- position: relative;
45
- left: 0;
46
- top: 0;
47
- display: block;
48
-
49
- &:before,
50
- &:after {
51
- content: "";
52
- display: table;
53
- }
54
-
55
- &:after {
56
- clear: both;
57
- }
58
-
59
- .slick-loading & {
60
- visibility: hidden;
61
- }
62
- }
63
- .slick-slide {
64
- float: left;
65
- height: 100%;
66
- min-height: 1px;
67
- [dir="rtl"] & {
68
- float: right;
69
- }
70
- img {
71
- display: block;
72
- }
73
- &.slick-loading img {
74
- display: none;
75
- }
76
-
77
- display: none;
78
-
79
- &.dragging img {
80
- pointer-events: none;
81
- }
82
-
83
- .slick-initialized & {
84
- display: block;
85
- }
86
-
87
- .slick-loading & {
88
- visibility: hidden;
89
- }
90
-
91
- .slick-vertical & {
92
- display: block;
93
- height: auto;
94
- border: 1px solid transparent;
95
- }
96
- }
97
- .slick-arrow.slick-hidden {
98
- display: none;
99
- }
1
+ /* Slider */
2
+
3
+ .slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ -moz-box-sizing: border-box;
7
+ box-sizing: border-box;
8
+ -webkit-touch-callout: none;
9
+ -webkit-user-select: none;
10
+ -khtml-user-select: none;
11
+ -moz-user-select: none;
12
+ -ms-user-select: none;
13
+ user-select: none;
14
+ -ms-touch-action: pan-y;
15
+ touch-action: pan-y;
16
+ -webkit-tap-highlight-color: transparent;
17
+ }
18
+ .slick-list {
19
+ position: relative;
20
+ overflow: hidden;
21
+ display: block;
22
+ margin: 0;
23
+ padding: 0;
24
+
25
+ &:focus {
26
+ outline: none;
27
+ }
28
+
29
+ &.dragging {
30
+ cursor: pointer;
31
+ cursor: hand;
32
+ }
33
+ }
34
+ .slick-slider .slick-track,
35
+ .slick-slider .slick-list {
36
+ -webkit-transform: translate3d(0, 0, 0);
37
+ -moz-transform: translate3d(0, 0, 0);
38
+ -ms-transform: translate3d(0, 0, 0);
39
+ -o-transform: translate3d(0, 0, 0);
40
+ transform: translate3d(0, 0, 0);
41
+ }
42
+
43
+ .slick-track {
44
+ position: relative;
45
+ left: 0;
46
+ top: 0;
47
+ display: block;
48
+
49
+ &:before,
50
+ &:after {
51
+ content: "";
52
+ display: table;
53
+ }
54
+
55
+ &:after {
56
+ clear: both;
57
+ }
58
+
59
+ .slick-loading & {
60
+ visibility: hidden;
61
+ }
62
+ }
63
+ .slick-slide {
64
+ float: left;
65
+ height: 100%;
66
+ min-height: 1px;
67
+ [dir="rtl"] & {
68
+ float: right;
69
+ }
70
+ img {
71
+ display: block;
72
+ }
73
+ &.slick-loading img {
74
+ display: none;
75
+ }
76
+
77
+ display: none;
78
+
79
+ &.dragging img {
80
+ pointer-events: none;
81
+ }
82
+
83
+ .slick-initialized & {
84
+ display: block;
85
+ }
86
+
87
+ .slick-loading & {
88
+ visibility: hidden;
89
+ }
90
+
91
+ .slick-vertical & {
92
+ display: block;
93
+ height: auto;
94
+ border: 1px solid transparent;
95
+ }
96
+ }
97
+ .slick-arrow.slick-hidden {
98
+ display: none;
99
+ }
classes/admin/class-pwb-admin-tab.php CHANGED
@@ -1,204 +1,204 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Admin;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class Pwb_Admin_Tab {
7
-
8
- public static function init() {
9
- add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::add_settings_tab', 50 );
10
- add_action( 'woocommerce_settings_tabs_pwb_admin_tab', __CLASS__ . '::settings_tab' );
11
- add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
- }
13
-
14
- /**
15
- * Add a new settings tab to the WooCommerce settings tabs array.
16
- *
17
- * @param array $settings_tabs Array of WooCommerce setting tabs & their labels, excluding the Subscription tab.
18
- * @return array $settings_tabs Array of WooCommerce setting tabs & their labels, including the Subscription tab.
19
- */
20
- public static function add_settings_tab( $settings_tabs ) {
21
- $settings_tabs['pwb_admin_tab'] = __( 'Brands', 'perfect-woocommerce-brands' );
22
- return $settings_tabs;
23
- }
24
-
25
-
26
- /**
27
- * Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
28
- *
29
- * @uses woocommerce_admin_fields()
30
- * @uses self::get_settings()
31
- */
32
- public static function settings_tab() {
33
- woocommerce_admin_fields( self::get_settings() );
34
- woocommerce_admin_fields( self::get_tools() );
35
- }
36
-
37
-
38
- /**
39
- * Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
40
- *
41
- * @uses woocommerce_update_options()
42
- * @uses self::get_settings()
43
- */
44
- public static function update_settings() {
45
- update_option( 'old_wc_pwb_admin_tab_slug', get_taxonomy('pwb-brand')->rewrite['slug'] );
46
-
47
- if(isset($_POST['wc_pwb_admin_tab_slug'])){
48
- $_POST['wc_pwb_admin_tab_slug'] = sanitize_title($_POST['wc_pwb_admin_tab_slug']);
49
- }
50
-
51
- woocommerce_update_options( self::get_settings() );
52
-
53
- }
54
-
55
-
56
- /**
57
- * Get all the settings for this plugin for @see woocommerce_admin_fields() function.
58
- *
59
- * @return array Array of settings for @see woocommerce_admin_fields() function.
60
- */
61
- public static function get_settings() {
62
-
63
- $available_image_sizes_adapted = array();
64
- $available_image_sizes = get_intermediate_image_sizes();
65
-
66
- foreach($available_image_sizes as $image_size){
67
- $available_image_sizes_adapted[$image_size] = $image_size;
68
- }
69
-
70
- $settings = array(
71
- 'section_title' => array(
72
- 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
73
- 'type' => 'title',
74
- 'desc' => '',
75
- 'id' => 'wc_pwb_admin_tab_section_title'
76
- ),
77
- 'slug' => array(
78
- 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
79
- 'type' => 'text',
80
- 'css' => 'min-width:350px;display:block;',
81
- 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
82
- 'id' => 'wc_pwb_admin_tab_slug',
83
- 'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
84
- ),
85
- 'brand_description' => array(
86
- 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
87
- 'type' => 'checkbox',
88
- 'default' => 'yes',
89
- 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
90
- 'id' => 'wc_pwb_admin_tab_brand_desc'
91
- ),
92
- 'show_brand_on_loop' => array(
93
- 'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
94
- 'type' => 'select',
95
- 'css' => 'min-width:350px;display:block;',
96
- 'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
97
- 'id' => 'wc_pwb_admin_tab_brands_in_loop',
98
- 'options' => array(
99
- 'no' => __( 'No', 'perfect-woocommerce-brands' ),
100
- 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
101
- 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
102
- )
103
- ),
104
- 'show_brand_in_single' => array(
105
- 'name' => __( 'Show brands in single product', 'perfect-woocommerce-brands' ),
106
- 'type' => 'select',
107
- 'css' => 'min-width:350px;display:block;',
108
- 'desc' => __( 'Show brand logo (or name) in single product', 'perfect-woocommerce-brands' ),
109
- 'default' => 'brand_image',
110
- 'id' => 'wc_pwb_admin_tab_brands_in_single',
111
- 'options' => array(
112
- 'no' => __( 'No', 'perfect-woocommerce-brands' ),
113
- 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
114
- 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
115
- )
116
- ),
117
- 'brand_logo_size' => array(
118
- 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
119
- 'type' => 'select',
120
- 'css' => 'min-width:350px;display:block;',
121
- 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
122
- 'id' => 'wc_pwb_admin_tab_brand_logo_size',
123
- 'options' => $available_image_sizes_adapted
124
- ),
125
- 'brand_single_position' => array(
126
- 'name' => __( 'Brand position', 'perfect-woocommerce-brands' ),
127
- 'type' => 'select',
128
- 'css' => 'min-width:350px;display:block;',
129
- 'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
130
- 'id' => 'wc_pwb_admin_tab_brand_single_position',
131
- 'options' => array(
132
- 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
133
- 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
134
- 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
135
- 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
136
- 'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
137
- 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
138
- 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
139
- )
140
- ),
141
- 'section_end' => array(
142
- 'type' => 'sectionend',
143
- 'id' => 'wc_pwb_admin_tab_section_end'
144
- )
145
- );
146
-
147
- return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
148
-
149
- }
150
-
151
- public static function get_tools() {
152
-
153
- $tools = array(
154
- 'section_title' => array(
155
- 'name' => __( 'Tools', 'perfect-woocommerce-brands' ),
156
- 'type' => 'title',
157
- 'desc' => '',
158
- 'id' => 'wc_pwb_admin_tab_section_tools_title'
159
- ),
160
- 'brand_import' => array(
161
- 'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
162
- 'type' => 'select',
163
- 'css' => 'min-width:350px;display:block;',
164
- 'desc' => sprintf(
165
- __( 'Import brands from other brand plugin. <a href="%s" target="_blank">Click here for more details</a>', 'perfect-woocommerce-brands' ),
166
- 'https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin'
167
- ),
168
- 'id' => 'wc_pwb_admin_tab_tools_migrate',
169
- 'options' => array(
170
- '-' => __( '-', 'perfect-woocommerce-brands' ),
171
- 'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' ),
172
- 'ultimate' => __( 'Ultimate WooCommerce Brands', 'perfect-woocommerce-brands' )
173
- )
174
- ),
175
- 'brand_dummy_data' => array(
176
- 'name' => __( 'Dummy data', 'perfect-woocommerce-brands' ),
177
- 'type' => 'select',
178
- 'css' => 'min-width:350px;display:block;',
179
- 'desc' => __( 'Import generic brands and assign it to products randomly', 'perfect-woocommerce-brands' ),
180
- 'id' => 'wc_pwb_admin_tab_tools_dummy_data',
181
- 'options' => array(
182
- '-' => __( '-', 'perfect-woocommerce-brands' ),
183
- 'start_import' => __( 'Start import', 'perfect-woocommerce-brands' )
184
- )
185
- ),
186
- 'brands_system_status' => array(
187
- 'name' => __( 'System status', 'perfect-woocommerce-brands' ),
188
- 'type' => 'textarea',
189
- 'desc' => __( 'Show system status', 'perfect-woocommerce-brands' ),
190
- 'id' => 'wc_pwb_admin_tab_tools_system_status'
191
- ),
192
- 'section_end' => array(
193
- 'type' => 'sectionend',
194
- 'id' => 'wc_pwb_admin_tab_section_tools_end'
195
- )
196
- );
197
-
198
- return apply_filters( 'wc_pwb_admin_tab_tools_settings', $tools );
199
-
200
- }
201
-
202
- }
203
-
204
- Pwb_Admin_Tab::init();
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class Pwb_Admin_Tab {
7
+
8
+ public static function init() {
9
+ add_filter( 'woocommerce_settings_tabs_array', __CLASS__ . '::add_settings_tab', 50 );
10
+ add_action( 'woocommerce_settings_tabs_pwb_admin_tab', __CLASS__ . '::settings_tab' );
11
+ add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
+ }
13
+
14
+ /**
15
+ * Add a new settings tab to the WooCommerce settings tabs array.
16
+ *
17
+ * @param array $settings_tabs Array of WooCommerce setting tabs & their labels, excluding the Subscription tab.
18
+ * @return array $settings_tabs Array of WooCommerce setting tabs & their labels, including the Subscription tab.
19
+ */
20
+ public static function add_settings_tab( $settings_tabs ) {
21
+ $settings_tabs['pwb_admin_tab'] = __( 'Brands', 'perfect-woocommerce-brands' );
22
+ return $settings_tabs;
23
+ }
24
+
25
+
26
+ /**
27
+ * Uses the WooCommerce admin fields API to output settings via the @see woocommerce_admin_fields() function.
28
+ *
29
+ * @uses woocommerce_admin_fields()
30
+ * @uses self::get_settings()
31
+ */
32
+ public static function settings_tab() {
33
+ woocommerce_admin_fields( self::get_settings() );
34
+ woocommerce_admin_fields( self::get_tools() );
35
+ }
36
+
37
+
38
+ /**
39
+ * Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
40
+ *
41
+ * @uses woocommerce_update_options()
42
+ * @uses self::get_settings()
43
+ */
44
+ public static function update_settings() {
45
+ update_option( 'old_wc_pwb_admin_tab_slug', get_taxonomy('pwb-brand')->rewrite['slug'] );
46
+
47
+ if(isset($_POST['wc_pwb_admin_tab_slug'])){
48
+ $_POST['wc_pwb_admin_tab_slug'] = sanitize_title($_POST['wc_pwb_admin_tab_slug']);
49
+ }
50
+
51
+ woocommerce_update_options( self::get_settings() );
52
+
53
+ }
54
+
55
+
56
+ /**
57
+ * Get all the settings for this plugin for @see woocommerce_admin_fields() function.
58
+ *
59
+ * @return array Array of settings for @see woocommerce_admin_fields() function.
60
+ */
61
+ public static function get_settings() {
62
+
63
+ $available_image_sizes_adapted = array();
64
+ $available_image_sizes = get_intermediate_image_sizes();
65
+
66
+ foreach($available_image_sizes as $image_size){
67
+ $available_image_sizes_adapted[$image_size] = $image_size;
68
+ }
69
+
70
+ $settings = array(
71
+ 'section_title' => array(
72
+ 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
73
+ 'type' => 'title',
74
+ 'desc' => '',
75
+ 'id' => 'wc_pwb_admin_tab_section_title'
76
+ ),
77
+ 'slug' => array(
78
+ 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
79
+ 'type' => 'text',
80
+ 'css' => 'min-width:350px;display:block;',
81
+ 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
82
+ 'id' => 'wc_pwb_admin_tab_slug',
83
+ 'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
84
+ ),
85
+ 'brand_description' => array(
86
+ 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
87
+ 'type' => 'checkbox',
88
+ 'default' => 'yes',
89
+ 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
90
+ 'id' => 'wc_pwb_admin_tab_brand_desc'
91
+ ),
92
+ 'show_brand_on_loop' => array(
93
+ 'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
94
+ 'type' => 'select',
95
+ 'css' => 'min-width:350px;display:block;',
96
+ 'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
97
+ 'id' => 'wc_pwb_admin_tab_brands_in_loop',
98
+ 'options' => array(
99
+ 'no' => __( 'No', 'perfect-woocommerce-brands' ),
100
+ 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
101
+ 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
102
+ )
103
+ ),
104
+ 'show_brand_in_single' => array(
105
+ 'name' => __( 'Show brands in single product', 'perfect-woocommerce-brands' ),
106
+ 'type' => 'select',
107
+ 'css' => 'min-width:350px;display:block;',
108
+ 'desc' => __( 'Show brand logo (or name) in single product', 'perfect-woocommerce-brands' ),
109
+ 'default' => 'brand_image',
110
+ 'id' => 'wc_pwb_admin_tab_brands_in_single',
111
+ 'options' => array(
112
+ 'no' => __( 'No', 'perfect-woocommerce-brands' ),
113
+ 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
114
+ 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
115
+ )
116
+ ),
117
+ 'brand_logo_size' => array(
118
+ 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
119
+ 'type' => 'select',
120
+ 'css' => 'min-width:350px;display:block;',
121
+ 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
122
+ 'id' => 'wc_pwb_admin_tab_brand_logo_size',
123
+ 'options' => $available_image_sizes_adapted
124
+ ),
125
+ 'brand_single_position' => array(
126
+ 'name' => __( 'Brand position', 'perfect-woocommerce-brands' ),
127
+ 'type' => 'select',
128
+ 'css' => 'min-width:350px;display:block;',
129
+ 'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
130
+ 'id' => 'wc_pwb_admin_tab_brand_single_position',
131
+ 'options' => array(
132
+ 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
133
+ 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
134
+ 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
135
+ 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
136
+ 'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
137
+ 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
138
+ 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
139
+ )
140
+ ),
141
+ 'section_end' => array(
142
+ 'type' => 'sectionend',
143
+ 'id' => 'wc_pwb_admin_tab_section_end'
144
+ )
145
+ );
146
+
147
+ return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
148
+
149
+ }
150
+
151
+ public static function get_tools() {
152
+
153
+ $tools = array(
154
+ 'section_title' => array(
155
+ 'name' => __( 'Tools', 'perfect-woocommerce-brands' ),
156
+ 'type' => 'title',
157
+ 'desc' => '',
158
+ 'id' => 'wc_pwb_admin_tab_section_tools_title'
159
+ ),
160
+ 'brand_import' => array(
161
+ 'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
162
+ 'type' => 'select',
163
+ 'css' => 'min-width:350px;display:block;',
164
+ 'desc' => sprintf(
165
+ __( 'Import brands from other brand plugin. <a href="%s" target="_blank">Click here for more details</a>', 'perfect-woocommerce-brands' ),
166
+ 'https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin'
167
+ ),
168
+ 'id' => 'wc_pwb_admin_tab_tools_migrate',
169
+ 'options' => array(
170
+ '-' => __( '-', 'perfect-woocommerce-brands' ),
171
+ 'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' ),
172
+ 'ultimate' => __( 'Ultimate WooCommerce Brands', 'perfect-woocommerce-brands' )
173
+ )
174
+ ),
175
+ 'brand_dummy_data' => array(
176
+ 'name' => __( 'Dummy data', 'perfect-woocommerce-brands' ),
177
+ 'type' => 'select',
178
+ 'css' => 'min-width:350px;display:block;',
179
+ 'desc' => __( 'Import generic brands and assign it to products randomly', 'perfect-woocommerce-brands' ),
180
+ 'id' => 'wc_pwb_admin_tab_tools_dummy_data',
181
+ 'options' => array(
182
+ '-' => __( '-', 'perfect-woocommerce-brands' ),
183
+ 'start_import' => __( 'Start import', 'perfect-woocommerce-brands' )
184
+ )
185
+ ),
186
+ 'brands_system_status' => array(
187
+ 'name' => __( 'System status', 'perfect-woocommerce-brands' ),
188
+ 'type' => 'textarea',
189
+ 'desc' => __( 'Show system status', 'perfect-woocommerce-brands' ),
190
+ 'id' => 'wc_pwb_admin_tab_tools_system_status'
191
+ ),
192
+ 'section_end' => array(
193
+ 'type' => 'sectionend',
194
+ 'id' => 'wc_pwb_admin_tab_section_tools_end'
195
+ )
196
+ );
197
+
198
+ return apply_filters( 'wc_pwb_admin_tab_tools_settings', $tools );
199
+
200
+ }
201
+
202
+ }
203
+
204
+ Pwb_Admin_Tab::init();
classes/admin/class-pwb-dummy-data.php CHANGED
@@ -1,83 +1,83 @@
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
- public function dummy_data(){
53
-
54
- for( $i=1; $i<11; $i++ ) {
55
- $brand_name = 'brand'.$i;
56
- $attachment_id = self::upload_image( false, PWB_PLUGIN . '/assets/img/dummy-data/'.$brand_name.'.png' );
57
- $inserted_brand = wp_insert_term( ucfirst( $brand_name ), 'pwb-brand' );
58
- if( !is_wp_error( $inserted_brand ) && isset( $inserted_brand['term_id'] ) ){
59
- add_term_meta( $inserted_brand['term_id'], 'pwb_brand_image', $attachment_id );
60
- }
61
- }
62
-
63
- $this->set_brands_randomly();
64
-
65
- wp_die();
66
-
67
- }
68
-
69
- public function set_brands_randomly(){
70
-
71
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands_array();
72
-
73
- $the_query = new \WP_Query( array( 'posts_per_page' => -1 , 'post_type' => 'product' ) );
74
-
75
- while ( $the_query->have_posts() ) {
76
- $the_query->the_post();
77
- wp_set_object_terms( get_the_ID(), array_rand( $brands ), 'pwb-brand' );
78
- }
79
- wp_reset_postdata();
80
-
81
- }
82
-
83
- }
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
+ public function dummy_data(){
53
+
54
+ for( $i=1; $i<11; $i++ ) {
55
+ $brand_name = 'brand'.$i;
56
+ $attachment_id = self::upload_image( false, PWB_PLUGIN . '/assets/img/dummy-data/'.$brand_name.'.png' );
57
+ $inserted_brand = wp_insert_term( ucfirst( $brand_name ), 'pwb-brand' );
58
+ if( !is_wp_error( $inserted_brand ) && isset( $inserted_brand['term_id'] ) ){
59
+ add_term_meta( $inserted_brand['term_id'], 'pwb_brand_image', $attachment_id );
60
+ }
61
+ }
62
+
63
+ $this->set_brands_randomly();
64
+
65
+ wp_die();
66
+
67
+ }
68
+
69
+ public function set_brands_randomly(){
70
+
71
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands_array();
72
+
73
+ $the_query = new \WP_Query( array( 'posts_per_page' => -1 , 'post_type' => 'product' ) );
74
+
75
+ while ( $the_query->have_posts() ) {
76
+ $the_query->the_post();
77
+ wp_set_object_terms( get_the_ID(), array_rand( $brands ), 'pwb-brand' );
78
+ }
79
+ wp_reset_postdata();
80
+
81
+ }
82
+
83
+ }
classes/admin/class-pwb-migrate.php CHANGED
@@ -1,95 +1,95 @@
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
- }
24
-
25
-
26
- }
27
-
28
- wp_die();
29
- }
30
-
31
- public function migrate_from_yith(){
32
-
33
- global $wpdb;
34
- $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "yith_product_brand"' );
35
-
36
- foreach( $terms as $term_id ) {
37
-
38
- //change taxonomy
39
- $wpdb->update(
40
- $wpdb->prefix . 'term_taxonomy',
41
- array(
42
- 'taxonomy' => 'pwb-brand'
43
- ),
44
- array(
45
- 'term_id' => $term_id
46
- )
47
- );
48
-
49
- //update term meta
50
- $wpdb->update(
51
- $wpdb->prefix . 'termmeta',
52
- array(
53
- 'meta_key' => 'pwb_brand_image'
54
- ),
55
- array(
56
- 'meta_key' => 'thumbnail_id',
57
- 'term_id' => $term_id
58
- )
59
- );
60
-
61
- }
62
-
63
- }
64
-
65
- public function migrate_from_ultimate(){
66
-
67
- global $wpdb;
68
- $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
69
-
70
- foreach( $terms as $term_id ) {
71
-
72
- //change taxonomy
73
- $wpdb->update(
74
- $wpdb->prefix . 'term_taxonomy',
75
- array(
76
- 'taxonomy' => 'pwb-brand'
77
- ),
78
- array(
79
- 'term_id' => $term_id
80
- )
81
- );
82
-
83
- /**
84
- * Ultimate WooCommerce Brands uses tax-meta-class, tax meta are really options
85
- * @link https://github.com/bainternet/Tax-Meta-Class
86
- */
87
- $term_meta = get_option('tax_meta_'.$term_id);
88
- if( isset( $term_meta['mgwb_image_brand_thumb']['id'] ) )
89
- add_term_meta( $term_id, 'pwb_brand_image', $term_meta['mgwb_image_brand_thumb']['id'] );
90
-
91
- }
92
-
93
- }
94
-
95
- }
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
+ }
24
+
25
+
26
+ }
27
+
28
+ wp_die();
29
+ }
30
+
31
+ public function migrate_from_yith(){
32
+
33
+ global $wpdb;
34
+ $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "yith_product_brand"' );
35
+
36
+ foreach( $terms as $term_id ) {
37
+
38
+ //change taxonomy
39
+ $wpdb->update(
40
+ $wpdb->prefix . 'term_taxonomy',
41
+ array(
42
+ 'taxonomy' => 'pwb-brand'
43
+ ),
44
+ array(
45
+ 'term_id' => $term_id
46
+ )
47
+ );
48
+
49
+ //update term meta
50
+ $wpdb->update(
51
+ $wpdb->prefix . 'termmeta',
52
+ array(
53
+ 'meta_key' => 'pwb_brand_image'
54
+ ),
55
+ array(
56
+ 'meta_key' => 'thumbnail_id',
57
+ 'term_id' => $term_id
58
+ )
59
+ );
60
+
61
+ }
62
+
63
+ }
64
+
65
+ public function migrate_from_ultimate(){
66
+
67
+ global $wpdb;
68
+ $terms = $wpdb->get_col( 'SELECT term_id FROM '.$wpdb->prefix.'term_taxonomy WHERE taxonomy LIKE "product_brand"' );
69
+
70
+ foreach( $terms as $term_id ) {
71
+
72
+ //change taxonomy
73
+ $wpdb->update(
74
+ $wpdb->prefix . 'term_taxonomy',
75
+ array(
76
+ 'taxonomy' => 'pwb-brand'
77
+ ),
78
+ array(
79
+ 'term_id' => $term_id
80
+ )
81
+ );
82
+
83
+ /**
84
+ * Ultimate WooCommerce Brands uses tax-meta-class, tax meta are really options
85
+ * @link https://github.com/bainternet/Tax-Meta-Class
86
+ */
87
+ $term_meta = get_option('tax_meta_'.$term_id);
88
+ if( isset( $term_meta['mgwb_image_brand_thumb']['id'] ) )
89
+ add_term_meta( $term_id, 'pwb_brand_image', $term_meta['mgwb_image_brand_thumb']['id'] );
90
+
91
+ }
92
+
93
+ }
94
+
95
+ }
classes/admin/class-pwb-system-status.php CHANGED
@@ -1,59 +1,59 @@
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
- 'wc_pwb_admin_tab_brand_single_position' => get_option( 'wc_pwb_admin_tab_brand_single_position' ),
49
- 'old_wc_pwb_admin_tab_slug' => get_option( 'old_wc_pwb_admin_tab_slug' ),
50
- 'wc_pwb_notice_plugin_review' => get_option( 'wc_pwb_notice_plugin_review' ),
51
- 'wc_pwb_admin_tab_slug' => get_option( 'wc_pwb_admin_tab_slug' ),
52
- 'wc_pwb_admin_tab_brand_desc' => get_option( 'wc_pwb_admin_tab_brand_desc' ),
53
- 'wc_pwb_admin_tab_brands_in_loop' => get_option( 'wc_pwb_admin_tab_brands_in_loop' ),
54
- 'wc_pwb_admin_tab_brands_in_single' => get_option( 'wc_pwb_admin_tab_brands_in_single' ),
55
- 'wc_pwb_admin_tab_brand_logo_size' => get_option( 'wc_pwb_admin_tab_brand_logo_size' )
56
- );
57
- }
58
-
59
- }
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
+ 'wc_pwb_admin_tab_brand_single_position' => get_option( 'wc_pwb_admin_tab_brand_single_position' ),
49
+ 'old_wc_pwb_admin_tab_slug' => get_option( 'old_wc_pwb_admin_tab_slug' ),
50
+ 'wc_pwb_notice_plugin_review' => get_option( 'wc_pwb_notice_plugin_review' ),
51
+ 'wc_pwb_admin_tab_slug' => get_option( 'wc_pwb_admin_tab_slug' ),
52
+ 'wc_pwb_admin_tab_brand_desc' => get_option( 'wc_pwb_admin_tab_brand_desc' ),
53
+ 'wc_pwb_admin_tab_brands_in_loop' => get_option( 'wc_pwb_admin_tab_brands_in_loop' ),
54
+ 'wc_pwb_admin_tab_brands_in_single' => get_option( 'wc_pwb_admin_tab_brands_in_single' ),
55
+ 'wc_pwb_admin_tab_brand_logo_size' => get_option( 'wc_pwb_admin_tab_brand_logo_size' )
56
+ );
57
+ }
58
+
59
+ }
classes/class-perfect-woocommerce-brands.php CHANGED
@@ -1,911 +1,907 @@
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
-
10
- add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
11
- add_action( 'init', array( $this, 'add_brands_metafields' ) );
12
- add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
13
- add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
14
- add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
15
- add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
16
- add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
17
- add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
18
- add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
19
- $this->brand_logo_position();
20
- add_action( 'woocommerce_before_shop_loop', array( $this, 'archive_page_banner' ), 9);
21
- add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
22
-
23
- if ( !is_admin() ) {
24
- add_action( 'init', array( $this, 'register_frontend_scripts' ) );
25
- }
26
-
27
- $this->add_shortcodes();
28
-
29
- if(is_plugin_active('js_composer/js_composer.php')){
30
- add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
31
- }
32
-
33
- add_action( 'widgets_init', array( $this, 'register_widgets' ) );
34
- add_action( 'woocommerce_after_single_product_summary' , array( $this, 'product_microdata' ), 40 );
35
- add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
36
- add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
37
- add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
38
- add_action( 'admin_notices', array( $this, 'review_notice' ) );
39
- add_filter( 'term_description', array( $this, 'filter_default_brand_desc' ), 10, 1 );
40
-
41
- }
42
-
43
- public function review_notice(){
44
- if ( get_option('wc_pwb_notice_plugin_review', true ) ) {
45
- ?>
46
- <div class="notice notice-info pwb-notice-dismissible is-dismissible" data-notice="wc_pwb_notice_plugin_review">
47
- <p><?php echo __('We are offering you maybe the best WooCommerce brands plugin completely free. You can help us making Perfect WooCommerce Brands a bit better. Thanks!', 'perfect-woocommerce-brands' ); ?><span class="dashicons dashicons-heart"></span></p>
48
- <p>
49
- <?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' ); ?>
50
- <?php _e( '<a href="https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands" target="_blank">Translate the plugin</a>', 'perfect-woocommerce-brands' ); ?>
51
- <?php _e( '<a href="https://github.com/titodevera/perfect-woocommerce-brands" target="_blank">View on GitHub</a>', 'perfect-woocommerce-brands' ); ?>
52
- </p>
53
- </div>
54
- <?php
55
- }
56
- }
57
-
58
- public function dismiss_pwb_notice(){
59
- $notice_name_whitelist = array( 'wc_pwb_notice_plugin_review' );
60
- if( isset( $_POST['notice_name'] ) && in_array( $_POST['notice_name'], $notice_name_whitelist ) ){
61
- update_option( $_POST['notice_name'], 0 );
62
- echo 'ok';
63
- }else{
64
- echo 'error';
65
- }
66
- wp_die();
67
- }
68
-
69
- /**
70
- * Adds a settings shortcut to plugin´s actions on plugins list
71
- */
72
- public function plugin_action_links( $links ) {
73
- $settings_url = esc_url( admin_url( 'admin.php?page=wc-settings&tab=pwb_admin_tab' ) );
74
- $links[] = '<a href="'. $settings_url .'">'.__('Settings','perfect-woocommerce-brands').'</a>';
75
- return $links;
76
- }
77
-
78
- public function pwb_brand_filter( $query ){
79
-
80
- if( !empty($_GET['pwb-brand-filter']) ){
81
-
82
- $terms_array = explode(',',$_GET['pwb-brand-filter']);
83
-
84
- //remove invalid terms (security)
85
- for($i=0; $i < count($terms_array); $i++) {
86
- if( !term_exists( $terms_array[$i], 'pwb-brand' ) ) unset($terms_array[$i]);
87
- }
88
-
89
- $filterable_product = false;
90
- if( is_product_category() || is_post_type_archive( 'product' ) )
91
- $filterable_product = true;
92
-
93
- if( $filterable_product && $query->is_main_query() ) {
94
-
95
- $query->set('tax_query', array(
96
- array (
97
- 'taxonomy' => 'pwb-brand',
98
- 'field' => 'slug',
99
- 'terms' => $terms_array
100
- )
101
- ));
102
-
103
- }
104
-
105
- }
106
-
107
- }
108
-
109
- /*
110
- * Adds microdata (brands) to single products
111
- */
112
- public function product_microdata(){
113
- global $product;
114
- $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand');
115
-
116
- foreach ($brands as $brand) {
117
- echo '<meta itemprop="brand" content="'.$brand->name.'">';
118
- }
119
-
120
- }
121
-
122
- public function add_shortcodes(){
123
- add_shortcode( 'pwb-carousel', array(
124
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
125
- 'carousel_shortcode'
126
- ) );
127
- add_shortcode( 'pwb-product-carousel', array(
128
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
129
- 'product_carousel_shortcode'
130
- ) );
131
- add_shortcode( 'pwb-all-brands', array(
132
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
133
- 'all_brands_shortcode'
134
- ) );
135
- add_shortcode( 'pwb-brand', array(
136
- '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
137
- 'brand_shortcode'
138
- ) );
139
- }
140
-
141
- public function register_widgets(){
142
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
143
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
144
- register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
145
- }
146
-
147
- public function show_brands_in_loop(){
148
-
149
- $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
150
-
151
- if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
152
-
153
- global $product;
154
- $product_id = $product->get_id();
155
- $product_brands = wp_get_post_terms($product_id, 'pwb-brand');
156
- if(!empty($product_brands)){
157
- echo '<div class="pwb-brands-in-loop">';
158
- foreach ($product_brands as $brand) {
159
-
160
- echo '<span>';
161
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
162
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
163
-
164
- $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
165
- if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
166
- echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
167
- }else{
168
- echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
169
- }
170
- echo '</span>';
171
-
172
- }
173
- echo '</div>';
174
- }
175
-
176
- }
177
-
178
- }
179
-
180
- /**
181
- * woocommerce_single_product_summary hook.
182
- *
183
- * @hooked woocommerce_template_single_title - 5
184
- * @hooked woocommerce_template_single_rating - 10
185
- * @hooked woocommerce_template_single_price - 10
186
- * @hooked woocommerce_template_single_excerpt - 20
187
- * @hooked woocommerce_template_single_add_to_cart - 30
188
- * @hooked woocommerce_template_single_meta - 40
189
- * @hooked woocommerce_template_single_sharing - 50
190
- */
191
- private function brand_logo_position(){
192
- $position = 41;
193
- $position_selected = get_option('wc_pwb_admin_tab_brand_single_position');
194
- if(!$position_selected){
195
- update_option('wc_pwb_admin_tab_brand_single_position','after_meta');
196
- }
197
- switch ($position_selected) {
198
- case 'before_title':
199
- $position = 4;
200
- break;
201
- case 'after_title':
202
- $position = 6;
203
- break;
204
- case 'after_price':
205
- $position = 11;
206
- break;
207
- case 'after_excerpt':
208
- $position = 21;
209
- break;
210
- case 'after_add_to_cart':
211
- $position = 31;
212
- break;
213
- case 'after_meta':
214
- $position = 41;
215
- break;
216
- case 'after_sharing':
217
- $position = 51;
218
- break;
219
- }
220
- add_action('woocommerce_single_product_summary', array($this,'action_woocommerce_single_product_summary'), $position);
221
- }
222
-
223
-
224
- /*
225
- * Maps shortcode (for visual composer plugin)
226
- *
227
- * @since 1.0
228
- * @link https://vc.wpbakery.com/
229
- * @return mixed
230
- */
231
- public function vc_map_shortcodes(){
232
- $available_image_sizes_adapted = array();
233
- $available_image_sizes = get_intermediate_image_sizes();
234
-
235
- foreach($available_image_sizes as $image_size){
236
- $available_image_sizes_adapted[$image_size] = $image_size;
237
- }
238
-
239
- vc_map(array(
240
- "name" => __( "PWB Product carousel", "perfect-woocommerce-brands" ),
241
- "description" => __( "Product carousel by brand or by category", "perfect-woocommerce-brands" ),
242
- "base" => "pwb-product-carousel",
243
- "class" => "",
244
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
245
- "category" => "WooCommerce",
246
- "params" => array(
247
- array(
248
- "type" => "dropdown",
249
- "heading" => __( "Brand", "perfect-woocommerce-brands" ),
250
- "param_name" => "brand",
251
- "admin_label" => true,
252
- "value" => self::get_brands_array( true )
253
- ),
254
- array(
255
- "type" => "textfield",
256
- "holder" => "div",
257
- "heading" => __( "Products", "perfect-woocommerce-brands" ),
258
- "param_name" => "products",
259
- "value" => "10",
260
- "description" => __( "Number of products to load", "perfect-woocommerce-brands" )
261
- ),
262
- array(
263
- "type" => "textfield",
264
- "holder" => "div",
265
- "heading" => __( "Products to show", "perfect-woocommerce-brands" ),
266
- "param_name" => "products_to_show",
267
- "value" => "5",
268
- "description" => __( "Number of products to show", "perfect-woocommerce-brands" )
269
- ),
270
- array(
271
- "type" => "textfield",
272
- "holder" => "div",
273
- "heading" => __( "Products to scroll", "perfect-woocommerce-brands" ),
274
- "param_name" => "products_to_scroll",
275
- "value" => "1",
276
- "description" => __( "Number of products to scroll", "perfect-woocommerce-brands" )
277
- ),
278
- array(
279
- "type" => "checkbox",
280
- "holder" => "div",
281
- "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
282
- "param_name" => "autoplay",
283
- "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
284
- ),
285
- array(
286
- "type" => "checkbox",
287
- "holder" => "div",
288
- "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
289
- "param_name" => "arrows",
290
- "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
291
- )
292
- )
293
- ));
294
-
295
- vc_map(array(
296
- "name" => __( "PWB Brands carousel", "perfect-woocommerce-brands" ),
297
- "description" => __( "Brands carousel", "perfect-woocommerce-brands" ),
298
- "base" => "pwb-carousel",
299
- "class" => "",
300
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
301
- "category" => "WooCommerce",
302
- "params" => array(
303
- array(
304
- "type" => "textfield",
305
- "holder" => "div",
306
- "heading" => __( "Items", "perfect-woocommerce-brands" ),
307
- "param_name" => "items",
308
- "value" => "10",
309
- "description" => __( "Number of items to load", "perfect-woocommerce-brands" )
310
- ),
311
- array(
312
- "type" => "textfield",
313
- "holder" => "div",
314
- "heading" => __( "Items to show", "perfect-woocommerce-brands" ),
315
- "param_name" => "items_to_show",
316
- "value" => "5",
317
- "description" => __( "Number of items to show", "perfect-woocommerce-brands" )
318
- ),
319
- array(
320
- "type" => "textfield",
321
- "holder" => "div",
322
- "heading" => __( "Items to scroll", "perfect-woocommerce-brands" ),
323
- "param_name" => "items_to_scroll",
324
- "value" => "1",
325
- "description" => __( "Number of items to scroll", "perfect-woocommerce-brands" )
326
- ),
327
- array(
328
- "type" => "checkbox",
329
- "holder" => "div",
330
- "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
331
- "param_name" => "autoplay",
332
- "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
333
- ),
334
- array(
335
- "type" => "checkbox",
336
- "holder" => "div",
337
- "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
338
- "param_name" => "arrows",
339
- "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
340
- ),
341
- array(
342
- "type" => "dropdown",
343
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
344
- "param_name" => "image_size",
345
- "admin_label" => true,
346
- "value" => $available_image_sizes_adapted
347
- )
348
- )
349
-
350
-
351
- ));
352
-
353
- vc_map(array(
354
- "name" => __( "PWB All brands", "perfect-woocommerce-brands" ),
355
- "description" => __( "Show all brands", "perfect-woocommerce-brands" ),
356
- "base" => "pwb-all-brands",
357
- "class" => "",
358
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
359
- "category" => "WooCommerce",
360
- "params" => array(
361
- array(
362
- "type" => "textfield",
363
- "holder" => "div",
364
- "heading" => __( "Brands per page", "perfect-woocommerce-brands" ),
365
- "param_name" => "per_page",
366
- "value" => "10",
367
- "description" => __( "Show x brands per page", "perfect-woocommerce-brands" )
368
- ),
369
- array(
370
- "type" => "dropdown",
371
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
372
- "param_name" => "image_size",
373
- "admin_label" => true,
374
- "value" => $available_image_sizes_adapted
375
- ),
376
- array(
377
- "type" => "dropdown",
378
- "heading" => __( "Order by", "perfect-woocommerce-brands" ),
379
- "param_name" => "order_by",
380
- "admin_label" => true,
381
- "value" => array(
382
- 'name' => 'name',
383
- 'slug' => 'slug',
384
- 'term_id' => 'term_id',
385
- 'id' => 'id',
386
- 'description' => 'description',
387
- 'rand' => 'rand'
388
- )
389
- ),
390
- array(
391
- "type" => "dropdown",
392
- "heading" => __( "Order", "perfect-woocommerce-brands" ),
393
- "param_name" => "order",
394
- "admin_label" => true,
395
- "value" => array(
396
- 'ASC' => 'ASC',
397
- 'DSC' => 'DSC'
398
- )
399
- ),
400
- array(
401
- "type" => "dropdown",
402
- "heading" => __( "Title position", "perfect-woocommerce-brands" ),
403
- "param_name" => "title_position",
404
- "admin_label" => true,
405
- "value" => array(
406
- __( "Before image", "perfect-woocommerce-brands" ) => 'before',
407
- __( "After image", "perfect-woocommerce-brands" ) => 'after'
408
- )
409
- ),
410
- array(
411
- "type" => "checkbox",
412
- "holder" => "div",
413
- "heading" => __( "Hide empty", "perfect-woocommerce-brands" ),
414
- "param_name" => "hide_empty",
415
- "description" => __( "Hide brands that have not been assigned to any product", "perfect-woocommerce-brands" )
416
- )
417
- )
418
-
419
-
420
- ));
421
-
422
- vc_map(array(
423
- "name" => __( "PWB brand", "perfect-woocommerce-brands" ),
424
- "description" => __( "Show brand for a specific product", "perfect-woocommerce-brands" ),
425
- "base" => "pwb-brand",
426
- "class" => "",
427
- "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
428
- "category" => "WooCommerce",
429
-
430
- "params" => array(
431
- array(
432
- "type" => "textfield",
433
- "holder" => "div",
434
- "heading" => __( "Product id", "perfect-woocommerce-brands" ),
435
- "param_name" => "product_id",
436
- "value" => null,
437
- "description" => __( "Product id (post id)", "perfect-woocommerce-brands" )
438
- ),
439
- array(
440
- "type" => "dropdown",
441
- "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
442
- "param_name" => "image_size",
443
- "admin_label" => true,
444
- "value" => $available_image_sizes_adapted
445
- )
446
-
447
- )
448
-
449
-
450
- ));
451
- }
452
-
453
- public function action_woocommerce_single_product_summary() {
454
- $brands = wp_get_post_terms( get_the_ID(), 'pwb-brand');
455
-
456
- if( !is_wp_error( $brands ) ){
457
-
458
- if( sizeof( $brands>0 ) ){
459
-
460
- $show_as = get_option( 'wc_pwb_admin_tab_brands_in_single' );
461
-
462
- if( $show_as!='no' ){
463
-
464
- do_action( 'pwb_before_single_product_brands', $brands );
465
-
466
- echo '<div class="pwb-single-product-brands pwb-clearfix">';
467
- foreach( $brands as $brand ){
468
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
469
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
470
-
471
- $image_size = 'thumbnail';
472
- $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size');
473
- if($image_size_selected!=false){
474
- $image_size = $image_size_selected;
475
- }
476
-
477
- $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
478
-
479
- if( !empty($attachment_html) && $show_as=='brand_image' || !empty($attachment_html) && !$show_as ){
480
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
481
- }else{
482
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
483
- }
484
- }
485
- echo '</div>';
486
-
487
- do_action( 'pwb_after_single_product_brands', $brands );
488
-
489
- }
490
-
491
- }
492
-
493
- }
494
-
495
- }
496
-
497
- public function register_frontend_scripts(){
498
-
499
- wp_register_script(
500
- 'pwb_slick_lib',
501
- PWB_PLUGIN . '/assets/js/slick/slick.min.js',
502
- array('jquery'),
503
- '1.5.9',
504
- true
505
- );
506
- wp_enqueue_script('pwb_frontend_functions');
507
-
508
- wp_enqueue_style (
509
- 'pwb_slick_lib',
510
- PWB_PLUGIN . '/assets/js/slick/slick.css',
511
- array(),
512
- '1.5.9',
513
- 'all'
514
- );
515
-
516
- wp_enqueue_style (
517
- 'pwb_frontend_styles',
518
- PWB_PLUGIN . '/assets/css/styles-frontend.css',
519
- array('pwb_slick_lib'),
520
- PWB_PLUGIN_VERSION,
521
- 'all'
522
- );
523
-
524
- wp_register_script(
525
- 'pwb_frontend_functions',
526
- PWB_PLUGIN . '/assets/js/pwb_frontend_functions.js',
527
- array('jquery','pwb_slick_lib'),
528
- PWB_PLUGIN_VERSION,
529
- true
530
- );
531
- wp_enqueue_script('pwb_frontend_functions');
532
-
533
- }
534
-
535
- public function register_admin_scripts($hook){
536
- $screen = get_current_screen();
537
-
538
- wp_register_style('pwb_styles_brands', PWB_PLUGIN . '/assets/css/styles-admin.css', array(), PWB_PLUGIN_VERSION);
539
- wp_register_script('pwb_brands_js', PWB_PLUGIN . '/assets/js/pwb_admin_functions.js', array('jquery'), PWB_PLUGIN_VERSION, true);
540
-
541
- if ($hook == 'edit-tags.php' && $screen->taxonomy == 'pwb-brand' || $hook == 'term.php' && $screen->taxonomy == 'pwb-brand') {
542
- wp_enqueue_media();
543
- }
544
-
545
- wp_enqueue_style( 'pwb_styles_brands' );
546
- wp_enqueue_script( 'pwb_brands_js' );
547
- wp_localize_script( 'pwb_brands_js', 'ajax_object', array(
548
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
549
- 'site_url' => site_url(),
550
- 'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
551
- 'translations' => array(
552
- 'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
553
- 'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands'),
554
- 'dummy_data_notice' => __('¿Start loading dummy data?','perfect-woocommerce-brands'),
555
- 'dummy_data' => __('We are importing the dummy data. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
556
- )
557
- ) );
558
-
559
- }
560
-
561
- public function register_brands_taxonomy(){
562
- $labels = array(
563
- 'name' => __( 'Brands', 'perfect-woocommerce-brands' ),
564
- 'singular_name' => __( 'Brand', 'perfect-woocommerce-brands' ),
565
- 'menu_name' => __( 'Brands', 'perfect-woocommerce-brands' ),
566
- 'all_items' => __( 'All Brands', 'perfect-woocommerce-brands' ),
567
- 'edit_item' => __( 'Edit Brand', 'perfect-woocommerce-brands' ),
568
- 'view_item' => __( 'View Brand', 'perfect-woocommerce-brands' ),
569
- 'update_item' => __( 'Update Brand', 'perfect-woocommerce-brands' ),
570
- 'add_new_item' => __( 'Add New Brand', 'perfect-woocommerce-brands' ),
571
- 'new_item_name' => __( 'New Brand Name', 'perfect-woocommerce-brands' ),
572
- 'parent_item' => __( 'Parent Brand', 'perfect-woocommerce-brands' ),
573
- 'parent_item_colon' => __( 'Parent Brand:', 'perfect-woocommerce-brands' ),
574
- 'search_items' => __( 'Search Brands', 'perfect-woocommerce-brands' ),
575
- 'popular_items' => __( 'Popular Brands', 'perfect-woocommerce-brands' ),
576
- 'separate_items_with_commas' => __( 'Separate brands with commas', 'perfect-woocommerce-brands' ),
577
- 'add_or_remove_items' => __( 'Add or remove brands', 'perfect-woocommerce-brands' ),
578
- 'choose_from_most_used' => __( 'Choose from the most used brands', 'perfect-woocommerce-brands' ),
579
- 'not_found' => __( 'No brands found', 'perfect-woocommerce-brands' )
580
- );
581
-
582
- $new_slug = get_option('wc_pwb_admin_tab_slug');
583
- $old_slug = get_option('old_wc_pwb_admin_tab_slug');
584
-
585
- $new_slug = ($new_slug!=false) ? $new_slug : 'brand';
586
- $old_slug = ($old_slug!=false) ? $old_slug : 'null';
587
-
588
- $args = array(
589
- 'hierarchical' => true,
590
- 'labels' => $labels,
591
- 'show_ui' => true,
592
- 'query_var' => true,
593
- 'public' => true,
594
- 'show_admin_column' => true,
595
- 'rewrite' => array(
596
- 'slug' => $new_slug,
597
- 'hierarchical' => true,
598
- 'ep_mask' => EP_PERMALINK
599
- )
600
- );
601
-
602
- register_taxonomy( 'pwb-brand', array( 'product' ), $args );
603
-
604
- if($new_slug != false && $old_slug!= false && $new_slug != $old_slug){
605
- flush_rewrite_rules();
606
- update_option( 'old_wc_pwb_admin_tab_slug', $new_slug );
607
- }
608
-
609
- }
610
-
611
- public function add_brands_metafields(){
612
- register_meta( 'term', 'pwb_brand_image', array($this,'add_brands_metafields_sanitize') );
613
- }
614
-
615
- public function add_brands_metafields_sanitize($brand_img){
616
- return $brand_img;
617
- }
618
-
619
- public function add_brands_metafields_form(){
620
- ob_start();
621
- ?>
622
- <div class="form-field pwb_brand_cont">
623
- <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
624
- <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
625
- <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
626
- </div>
627
-
628
- <div class="form-field pwb_brand_cont">
629
- <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
630
- <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
631
- <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
632
- <p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
633
- </div>
634
-
635
- <div class="form-field pwb_brand_cont">
636
- <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
637
- <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
638
- <p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
639
- </div>
640
-
641
- <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
642
-
643
- <?php
644
- echo ob_get_clean();
645
- }
646
-
647
- public function add_brands_metafields_form_edit($term){
648
- $term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
649
- $term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
650
- $term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
651
- ob_start();
652
- ?>
653
- <table class="form-table pwb_brand_cont">
654
- <tr class="form-field">
655
- <th>
656
- <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
657
- </th>
658
- <td>
659
- <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
660
- <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
661
-
662
- <?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
663
- <?php if( !empty($current_image) ): ?>
664
- <div class="pwb_brand_image_selected">
665
- <span>
666
- <?php echo $current_image;?>
667
- <a href="#" class="pwb_brand_image_selected_remove">X</a>
668
- </span>
669
- </div>
670
- <?php endif; ?>
671
-
672
- </td>
673
- </tr>
674
- <tr class="form-field">
675
- <th>
676
- <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
677
- </th>
678
- <td>
679
- <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
680
- <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
681
-
682
- <?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
683
- <?php if( !empty($current_image) ): ?>
684
- <div class="pwb_brand_image_selected">
685
- <span>
686
- <?php echo $current_image;?>
687
- <a href="#" class="pwb_brand_image_selected_remove">X</a>
688
- </span>
689
- </div>
690
- <?php endif; ?>
691
-
692
- </td>
693
- </tr>
694
- <tr class="form-field">
695
- <th>
696
- <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
697
- </th>
698
- <td>
699
- <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
700
- <p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
701
- <div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
702
- </td>
703
- </tr>
704
- </table>
705
-
706
- <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
707
-
708
- <?php
709
- echo ob_get_clean();
710
- }
711
-
712
- public function add_brands_metafields_save( $term_id ){
713
-
714
- if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
715
- return;
716
-
717
- /* ·············· Brand image ·············· */
718
- $old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
719
- $new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
720
-
721
- if ( $old_img && '' === $new_img )
722
- delete_term_meta( $term_id, 'pwb_brand_image' );
723
-
724
- else if ( $old_img !== $new_img )
725
- update_term_meta( $term_id, 'pwb_brand_image', $new_img );
726
- /* ·············· /Brand image ·············· */
727
-
728
- /* ·············· Brand banner ·············· */
729
- $old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
730
- $new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
731
-
732
- if ( $old_img && '' === $new_img )
733
- delete_term_meta( $term_id, 'pwb_brand_banner' );
734
-
735
- else if ( $old_img !== $new_img )
736
- update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
737
- /* ·············· /Brand banner ·············· */
738
-
739
- /* ·············· Brand banner link ·············· */
740
- $old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
741
- $new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
742
-
743
- if ( $old_img && '' === $new_img )
744
- delete_term_meta( $term_id, 'pwb_brand_banner_link' );
745
-
746
- else if ( $old_img !== $new_img )
747
- update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
748
- /* ·············· /Brand banner link ·············· */
749
- }
750
-
751
- public function brand_taxonomy_columns_head($defaults) {
752
- $newColumns = array(
753
- 'cb' => $defaults['cb'],
754
- 'logo' => __( 'Logo', 'perfect-woocommerce-brands' )
755
- );
756
-
757
- unset($defaults['description']);
758
- unset($defaults['cb']);
759
-
760
- return array_merge($newColumns,$defaults);
761
- }
762
-
763
- public function brand_taxonomy_columns($c, $column_name, $term_id){
764
- $image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('60','60') );
765
- if($image){
766
- return $image;
767
- }else{
768
- return "-";
769
- }
770
- }
771
-
772
- public static function get_brands( $hide_empty = false, $order_by = 'name', $order = 'ASC' ){
773
- $result = array();
774
-
775
- $brands = get_terms('pwb-brand',array(
776
- 'hide_empty' => $hide_empty,
777
- 'order_by' => $order_by,
778
- 'order' => $order
779
- ));
780
-
781
- if(is_array($brands) && count($brands)>0){
782
- $result = $brands;
783
- }
784
-
785
- return $result;
786
-
787
- }
788
-
789
- public static function get_brands_array( $is_select = false ){
790
- $result = array();
791
-
792
- //if is for select input adds default value
793
- if( $is_select )
794
- $result[0] = __( 'All', 'perfect-woocommerce-brands' );
795
-
796
- $brands = get_terms('pwb-brand',array(
797
- 'hide_empty' => false
798
- ));
799
-
800
- foreach ($brands as $brand) {
801
- $result[$brand->term_id] = $brand->slug;
802
- }
803
-
804
- return $result;
805
-
806
- }
807
-
808
- public static function get_products_by_brand($brand_id, $count){
809
-
810
- if($brand_id === 'all'){
811
- $args = array(
812
- 'post_type' => 'product',
813
- 'posts_per_page' => $count,
814
- 'paged' => false
815
- );
816
- }else{
817
- $args = array(
818
- 'post_type' => 'product',
819
- 'tax_query' => array(
820
- array(
821
- 'taxonomy' => 'pwb-brand',
822
- 'field' => 'slug',
823
- 'terms' => $brand_id,
824
- )
825
- ),
826
- 'posts_per_page' => $count,
827
- 'paged' => false
828
- );
829
- }
830
-
831
- ob_start();
832
-
833
- $loop = new \WP_Query( $args );
834
- if ( $loop->have_posts() && function_exists('wc_get_product') && function_exists('woocommerce_template_loop_add_to_cart') && function_exists('woocommerce_get_product_thumbnail') ) {
835
- while ( $loop->have_posts() ) : $loop->the_post();
836
- $product = wc_get_product( get_the_ID() );
837
-
838
- echo '<div>';
839
- echo '<a href="'.get_the_permalink().'">';
840
- echo woocommerce_get_product_thumbnail();
841
- echo '<h3>'.$product->get_title().'</h3>';
842
- echo '<span class="pwb-amount">'.$product->get_price_html().'</span>';
843
- woocommerce_template_loop_add_to_cart();
844
- echo '</a>';
845
- echo '</div>';
846
-
847
- endwhile;
848
- } else {
849
- echo __( 'No products found', 'perfect-woocommerce-brands' );
850
- }
851
- wp_reset_postdata();
852
-
853
- return ob_get_clean();
854
-
855
- }
856
-
857
- public function archive_page_banner(){
858
- $queried_object = get_queried_object();
859
-
860
- if( self::is_brand_archive_page() ){
861
-
862
- $brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
863
- $brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
864
- $show_desc = get_option('wc_pwb_admin_tab_brand_desc');
865
-
866
- if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
867
- echo '<div class="pwb-brand-banner-cont">';
868
- }
869
-
870
- //pwb-brand archive
871
- if( $brand_banner!='' ){
872
- echo '<div class="pwb-brand-banner pwb-clearfix">';
873
- if($brand_banner_link!=''){
874
- echo '<a href="'.site_url($brand_banner_link).'">'.wp_get_attachment_image ( $brand_banner, 'full', false ).'</a>';
875
- }else{
876
- echo wp_get_attachment_image ( $brand_banner, 'full', false );
877
- }
878
- echo '</div>';
879
- }
880
-
881
- //show brand description
882
- if( $queried_object->description != '' && $show_desc !== 'no' ){
883
- echo '<div class="pwb-brand-description">';
884
- echo $queried_object->description;
885
- echo '</div>';
886
- }
887
-
888
- if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
889
- echo '</div>';
890
- }
891
-
892
- }
893
-
894
- }
895
-
896
- public function filter_default_brand_desc( $desc_kses ){
897
- if( self::is_brand_archive_page() ){
898
- return false;
899
- }
900
- return $desc_kses;
901
- }
902
-
903
- public static function is_brand_archive_page(){
904
- $queried_object = get_queried_object();
905
- if( is_a( $queried_object,'WP_Term' ) && $queried_object->taxonomy == 'pwb-brand' ){
906
- return true;
907
- }
908
- return false;
909
- }
910
-
911
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class Perfect_Woocommerce_Brands{
7
+
8
+ function __construct(){
9
+ add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
10
+ add_action( 'init', array( $this, 'add_brands_metafields' ) );
11
+ add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
12
+ add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
13
+ add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
14
+ add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
15
+ add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
16
+ add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
17
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
18
+ $this->brand_logo_position();
19
+ add_action( 'woocommerce_before_shop_loop', array( $this, 'archive_page_banner' ), 9);
20
+ add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
21
+ if( !is_admin() ) add_action( 'init', array( $this, 'register_frontend_scripts' ) );
22
+ $this->add_shortcodes();
23
+ if( is_plugin_active('js_composer/js_composer.php') ) add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
24
+ add_action( 'widgets_init', array( $this, 'register_widgets' ) );
25
+ add_action( 'woocommerce_after_single_product_summary' , array( $this, 'product_microdata' ), 40 );
26
+ add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
27
+ add_filter( 'plugin_action_links_' . PWB_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
28
+ add_action( 'wp_ajax_dismiss_pwb_notice', array( $this, 'dismiss_pwb_notice' ) );
29
+ add_action( 'admin_notices', array( $this, 'review_notice' ) );
30
+ add_filter( 'term_description', array( $this, 'filter_default_brand_desc' ), 10, 1 );
31
+ }
32
+
33
+ public function review_notice(){
34
+ $show_notice = get_option('wc_pwb_notice_plugin_review', true);
35
+ $activate_on = get_option('pwb_activate_on', time());
36
+ $now = time();
37
+ $one_month = 2592000;
38
+ $date_diff = $now - $activate_on;
39
+
40
+ if ( $show_notice && $date_diff > $one_month ) {
41
+ ?>
42
+ <div class="notice notice-info pwb-notice-dismissible is-dismissible" data-notice="wc_pwb_notice_plugin_review">
43
+ <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>
44
+ <p>
45
+ <?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' ); ?>
46
+ <?php _e( '<a href="https://translate.wordpress.org/projects/wp-plugins/perfect-woocommerce-brands" target="_blank">Translate the plugin</a>', 'perfect-woocommerce-brands' ); ?>
47
+ <?php _e( '<a href="https://github.com/titodevera/perfect-woocommerce-brands" target="_blank">View on GitHub</a>', 'perfect-woocommerce-brands' ); ?>
48
+ </p>
49
+ </div>
50
+ <?php
51
+ }
52
+ }
53
+
54
+ public function dismiss_pwb_notice(){
55
+ $notice_name_whitelist = array( 'wc_pwb_notice_plugin_review' );
56
+ if( isset( $_POST['notice_name'] ) && in_array( $_POST['notice_name'], $notice_name_whitelist ) ){
57
+ update_option( $_POST['notice_name'], 0 );
58
+ echo 'ok';
59
+ }else{
60
+ echo 'error';
61
+ }
62
+ wp_die();
63
+ }
64
+
65
+ /**
66
+ * Adds a settings shortcut to plugin´s actions on plugins list
67
+ */
68
+ public function plugin_action_links( $links ) {
69
+ $settings_url = esc_url( admin_url( 'admin.php?page=wc-settings&tab=pwb_admin_tab' ) );
70
+ $links[] = '<a href="'. $settings_url .'">'.__('Settings','perfect-woocommerce-brands').'</a>';
71
+ return $links;
72
+ }
73
+
74
+ public function pwb_brand_filter( $query ){
75
+
76
+ if( !empty($_GET['pwb-brand-filter']) ){
77
+
78
+ $terms_array = explode(',',$_GET['pwb-brand-filter']);
79
+
80
+ //remove invalid terms (security)
81
+ for($i=0; $i < count($terms_array); $i++) {
82
+ if( !term_exists( $terms_array[$i], 'pwb-brand' ) ) unset($terms_array[$i]);
83
+ }
84
+
85
+ $filterable_product = false;
86
+ if( is_product_category() || is_post_type_archive( 'product' ) )
87
+ $filterable_product = true;
88
+
89
+ if( $filterable_product && $query->is_main_query() ) {
90
+
91
+ $query->set('tax_query', array(
92
+ array (
93
+ 'taxonomy' => 'pwb-brand',
94
+ 'field' => 'slug',
95
+ 'terms' => $terms_array
96
+ )
97
+ ));
98
+
99
+ }
100
+
101
+ }
102
+
103
+ }
104
+
105
+ /*
106
+ * Adds microdata (brands) to single products
107
+ */
108
+ public function product_microdata(){
109
+ global $product;
110
+ $brands = wp_get_post_terms( $product->get_id(), 'pwb-brand');
111
+
112
+ foreach ($brands as $brand) {
113
+ echo '<meta itemprop="brand" content="'.$brand->name.'">';
114
+ }
115
+
116
+ }
117
+
118
+ public function add_shortcodes(){
119
+ add_shortcode( 'pwb-carousel', array(
120
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
121
+ 'carousel_shortcode'
122
+ ) );
123
+ add_shortcode( 'pwb-product-carousel', array(
124
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
125
+ 'product_carousel_shortcode'
126
+ ) );
127
+ add_shortcode( 'pwb-all-brands', array(
128
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
129
+ 'all_brands_shortcode'
130
+ ) );
131
+ add_shortcode( 'pwb-brand', array(
132
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
133
+ 'brand_shortcode'
134
+ ) );
135
+ }
136
+
137
+ public function register_widgets(){
138
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
139
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
140
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
141
+ }
142
+
143
+ public function show_brands_in_loop(){
144
+
145
+ $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
146
+
147
+ if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
148
+
149
+ global $product;
150
+ $product_id = $product->get_id();
151
+ $product_brands = wp_get_post_terms($product_id, 'pwb-brand');
152
+ if(!empty($product_brands)){
153
+ echo '<div class="pwb-brands-in-loop">';
154
+ foreach ($product_brands as $brand) {
155
+
156
+ echo '<span>';
157
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
158
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
159
+
160
+ $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
161
+ if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
162
+ echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
163
+ }else{
164
+ echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
165
+ }
166
+ echo '</span>';
167
+
168
+ }
169
+ echo '</div>';
170
+ }
171
+
172
+ }
173
+
174
+ }
175
+
176
+ /**
177
+ * woocommerce_single_product_summary hook.
178
+ *
179
+ * @hooked woocommerce_template_single_title - 5
180
+ * @hooked woocommerce_template_single_rating - 10
181
+ * @hooked woocommerce_template_single_price - 10
182
+ * @hooked woocommerce_template_single_excerpt - 20
183
+ * @hooked woocommerce_template_single_add_to_cart - 30
184
+ * @hooked woocommerce_template_single_meta - 40
185
+ * @hooked woocommerce_template_single_sharing - 50
186
+ */
187
+ private function brand_logo_position(){
188
+ $position = 41;
189
+ $position_selected = get_option('wc_pwb_admin_tab_brand_single_position');
190
+ if(!$position_selected){
191
+ update_option('wc_pwb_admin_tab_brand_single_position','after_meta');
192
+ }
193
+ switch ($position_selected) {
194
+ case 'before_title':
195
+ $position = 4;
196
+ break;
197
+ case 'after_title':
198
+ $position = 6;
199
+ break;
200
+ case 'after_price':
201
+ $position = 11;
202
+ break;
203
+ case 'after_excerpt':
204
+ $position = 21;
205
+ break;
206
+ case 'after_add_to_cart':
207
+ $position = 31;
208
+ break;
209
+ case 'after_meta':
210
+ $position = 41;
211
+ break;
212
+ case 'after_sharing':
213
+ $position = 51;
214
+ break;
215
+ }
216
+ add_action('woocommerce_single_product_summary', array($this,'action_woocommerce_single_product_summary'), $position);
217
+ }
218
+
219
+
220
+ /*
221
+ * Maps shortcode (for visual composer plugin)
222
+ *
223
+ * @since 1.0
224
+ * @link https://vc.wpbakery.com/
225
+ * @return mixed
226
+ */
227
+ public function vc_map_shortcodes(){
228
+ $available_image_sizes_adapted = array();
229
+ $available_image_sizes = get_intermediate_image_sizes();
230
+
231
+ foreach($available_image_sizes as $image_size){
232
+ $available_image_sizes_adapted[$image_size] = $image_size;
233
+ }
234
+
235
+ vc_map(array(
236
+ "name" => __( "PWB Product carousel", "perfect-woocommerce-brands" ),
237
+ "description" => __( "Product carousel by brand or by category", "perfect-woocommerce-brands" ),
238
+ "base" => "pwb-product-carousel",
239
+ "class" => "",
240
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
241
+ "category" => "WooCommerce",
242
+ "params" => array(
243
+ array(
244
+ "type" => "dropdown",
245
+ "heading" => __( "Brand", "perfect-woocommerce-brands" ),
246
+ "param_name" => "brand",
247
+ "admin_label" => true,
248
+ "value" => self::get_brands_array( true )
249
+ ),
250
+ array(
251
+ "type" => "textfield",
252
+ "holder" => "div",
253
+ "heading" => __( "Products", "perfect-woocommerce-brands" ),
254
+ "param_name" => "products",
255
+ "value" => "10",
256
+ "description" => __( "Number of products to load", "perfect-woocommerce-brands" )
257
+ ),
258
+ array(
259
+ "type" => "textfield",
260
+ "holder" => "div",
261
+ "heading" => __( "Products to show", "perfect-woocommerce-brands" ),
262
+ "param_name" => "products_to_show",
263
+ "value" => "5",
264
+ "description" => __( "Number of products to show", "perfect-woocommerce-brands" )
265
+ ),
266
+ array(
267
+ "type" => "textfield",
268
+ "holder" => "div",
269
+ "heading" => __( "Products to scroll", "perfect-woocommerce-brands" ),
270
+ "param_name" => "products_to_scroll",
271
+ "value" => "1",
272
+ "description" => __( "Number of products to scroll", "perfect-woocommerce-brands" )
273
+ ),
274
+ array(
275
+ "type" => "checkbox",
276
+ "holder" => "div",
277
+ "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
278
+ "param_name" => "autoplay",
279
+ "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
280
+ ),
281
+ array(
282
+ "type" => "checkbox",
283
+ "holder" => "div",
284
+ "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
285
+ "param_name" => "arrows",
286
+ "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
287
+ )
288
+ )
289
+ ));
290
+
291
+ vc_map(array(
292
+ "name" => __( "PWB Brands carousel", "perfect-woocommerce-brands" ),
293
+ "description" => __( "Brands carousel", "perfect-woocommerce-brands" ),
294
+ "base" => "pwb-carousel",
295
+ "class" => "",
296
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
297
+ "category" => "WooCommerce",
298
+ "params" => array(
299
+ array(
300
+ "type" => "textfield",
301
+ "holder" => "div",
302
+ "heading" => __( "Items", "perfect-woocommerce-brands" ),
303
+ "param_name" => "items",
304
+ "value" => "10",
305
+ "description" => __( "Number of items to load", "perfect-woocommerce-brands" )
306
+ ),
307
+ array(
308
+ "type" => "textfield",
309
+ "holder" => "div",
310
+ "heading" => __( "Items to show", "perfect-woocommerce-brands" ),
311
+ "param_name" => "items_to_show",
312
+ "value" => "5",
313
+ "description" => __( "Number of items to show", "perfect-woocommerce-brands" )
314
+ ),
315
+ array(
316
+ "type" => "textfield",
317
+ "holder" => "div",
318
+ "heading" => __( "Items to scroll", "perfect-woocommerce-brands" ),
319
+ "param_name" => "items_to_scroll",
320
+ "value" => "1",
321
+ "description" => __( "Number of items to scroll", "perfect-woocommerce-brands" )
322
+ ),
323
+ array(
324
+ "type" => "checkbox",
325
+ "holder" => "div",
326
+ "heading" => __( "Autoplay", "perfect-woocommerce-brands" ),
327
+ "param_name" => "autoplay",
328
+ "description" => __( "Autoplay carousel", "perfect-woocommerce-brands" )
329
+ ),
330
+ array(
331
+ "type" => "checkbox",
332
+ "holder" => "div",
333
+ "heading" => __( "Arrows", "perfect-woocommerce-brands" ),
334
+ "param_name" => "arrows",
335
+ "description" => __( "Display prev and next arrows", "perfect-woocommerce-brands" )
336
+ ),
337
+ array(
338
+ "type" => "dropdown",
339
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
340
+ "param_name" => "image_size",
341
+ "admin_label" => true,
342
+ "value" => $available_image_sizes_adapted
343
+ )
344
+ )
345
+
346
+
347
+ ));
348
+
349
+ vc_map(array(
350
+ "name" => __( "PWB All brands", "perfect-woocommerce-brands" ),
351
+ "description" => __( "Show all brands", "perfect-woocommerce-brands" ),
352
+ "base" => "pwb-all-brands",
353
+ "class" => "",
354
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
355
+ "category" => "WooCommerce",
356
+ "params" => array(
357
+ array(
358
+ "type" => "textfield",
359
+ "holder" => "div",
360
+ "heading" => __( "Brands per page", "perfect-woocommerce-brands" ),
361
+ "param_name" => "per_page",
362
+ "value" => "10",
363
+ "description" => __( "Show x brands per page", "perfect-woocommerce-brands" )
364
+ ),
365
+ array(
366
+ "type" => "dropdown",
367
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
368
+ "param_name" => "image_size",
369
+ "admin_label" => true,
370
+ "value" => $available_image_sizes_adapted
371
+ ),
372
+ array(
373
+ "type" => "dropdown",
374
+ "heading" => __( "Order by", "perfect-woocommerce-brands" ),
375
+ "param_name" => "order_by",
376
+ "admin_label" => true,
377
+ "value" => array(
378
+ 'name' => 'name',
379
+ 'slug' => 'slug',
380
+ 'term_id' => 'term_id',
381
+ 'id' => 'id',
382
+ 'description' => 'description',
383
+ 'rand' => 'rand'
384
+ )
385
+ ),
386
+ array(
387
+ "type" => "dropdown",
388
+ "heading" => __( "Order", "perfect-woocommerce-brands" ),
389
+ "param_name" => "order",
390
+ "admin_label" => true,
391
+ "value" => array(
392
+ 'ASC' => 'ASC',
393
+ 'DSC' => 'DSC'
394
+ )
395
+ ),
396
+ array(
397
+ "type" => "dropdown",
398
+ "heading" => __( "Title position", "perfect-woocommerce-brands" ),
399
+ "param_name" => "title_position",
400
+ "admin_label" => true,
401
+ "value" => array(
402
+ __( "Before image", "perfect-woocommerce-brands" ) => 'before',
403
+ __( "After image", "perfect-woocommerce-brands" ) => 'after'
404
+ )
405
+ ),
406
+ array(
407
+ "type" => "checkbox",
408
+ "holder" => "div",
409
+ "heading" => __( "Hide empty", "perfect-woocommerce-brands" ),
410
+ "param_name" => "hide_empty",
411
+ "description" => __( "Hide brands that have not been assigned to any product", "perfect-woocommerce-brands" )
412
+ )
413
+ )
414
+
415
+
416
+ ));
417
+
418
+ vc_map(array(
419
+ "name" => __( "PWB brand", "perfect-woocommerce-brands" ),
420
+ "description" => __( "Show brand for a specific product", "perfect-woocommerce-brands" ),
421
+ "base" => "pwb-brand",
422
+ "class" => "",
423
+ "icon" => PWB_PLUGIN.'/assets/img/icon_pwb.jpg',
424
+ "category" => "WooCommerce",
425
+
426
+ "params" => array(
427
+ array(
428
+ "type" => "textfield",
429
+ "holder" => "div",
430
+ "heading" => __( "Product id", "perfect-woocommerce-brands" ),
431
+ "param_name" => "product_id",
432
+ "value" => null,
433
+ "description" => __( "Product id (post id)", "perfect-woocommerce-brands" )
434
+ ),
435
+ array(
436
+ "type" => "dropdown",
437
+ "heading" => __( "Brand logo size", "perfect-woocommerce-brands" ),
438
+ "param_name" => "image_size",
439
+ "admin_label" => true,
440
+ "value" => $available_image_sizes_adapted
441
+ )
442
+
443
+ )
444
+
445
+
446
+ ));
447
+ }
448
+
449
+ public function action_woocommerce_single_product_summary() {
450
+ $brands = wp_get_post_terms( get_the_ID(), 'pwb-brand');
451
+
452
+ if( !is_wp_error( $brands ) ){
453
+
454
+ if( sizeof( $brands>0 ) ){
455
+
456
+ $show_as = get_option( 'wc_pwb_admin_tab_brands_in_single' );
457
+
458
+ if( $show_as!='no' ){
459
+
460
+ do_action( 'pwb_before_single_product_brands', $brands );
461
+
462
+ echo '<div class="pwb-single-product-brands pwb-clearfix">';
463
+ foreach( $brands as $brand ){
464
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
465
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
466
+
467
+ $image_size = 'thumbnail';
468
+ $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size');
469
+ if($image_size_selected!=false){
470
+ $image_size = $image_size_selected;
471
+ }
472
+
473
+ $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
474
+
475
+ if( !empty($attachment_html) && $show_as=='brand_image' || !empty($attachment_html) && !$show_as ){
476
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
477
+ }else{
478
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
479
+ }
480
+ }
481
+ echo '</div>';
482
+
483
+ do_action( 'pwb_after_single_product_brands', $brands );
484
+
485
+ }
486
+
487
+ }
488
+
489
+ }
490
+
491
+ }
492
+
493
+ public function register_frontend_scripts(){
494
+
495
+ wp_register_script(
496
+ 'pwb_slick_lib',
497
+ PWB_PLUGIN . '/assets/js/slick/slick.min.js',
498
+ array('jquery'),
499
+ '1.5.9',
500
+ true
501
+ );
502
+ wp_enqueue_script('pwb_frontend_functions');
503
+
504
+ wp_enqueue_style (
505
+ 'pwb_slick_lib',
506
+ PWB_PLUGIN . '/assets/js/slick/slick.css',
507
+ array(),
508
+ '1.5.9',
509
+ 'all'
510
+ );
511
+
512
+ wp_enqueue_style (
513
+ 'pwb_frontend_styles',
514
+ PWB_PLUGIN . '/assets/css/styles-frontend.css',
515
+ array('pwb_slick_lib'),
516
+ PWB_PLUGIN_VERSION,
517
+ 'all'
518
+ );
519
+
520
+ wp_register_script(
521
+ 'pwb_frontend_functions',
522
+ PWB_PLUGIN . '/assets/js/pwb_frontend_functions.js',
523
+ array('jquery','pwb_slick_lib'),
524
+ PWB_PLUGIN_VERSION,
525
+ true
526
+ );
527
+ wp_enqueue_script('pwb_frontend_functions');
528
+
529
+ }
530
+
531
+ public function register_admin_scripts($hook){
532
+ $screen = get_current_screen();
533
+
534
+ wp_register_style('pwb_styles_brands', PWB_PLUGIN . '/assets/css/styles-admin.css', array(), PWB_PLUGIN_VERSION);
535
+ wp_register_script('pwb_brands_js', PWB_PLUGIN . '/assets/js/pwb_admin_functions.js', array('jquery'), PWB_PLUGIN_VERSION, true);
536
+
537
+ if ($hook == 'edit-tags.php' && $screen->taxonomy == 'pwb-brand' || $hook == 'term.php' && $screen->taxonomy == 'pwb-brand') {
538
+ wp_enqueue_media();
539
+ }
540
+
541
+ wp_enqueue_style( 'pwb_styles_brands' );
542
+ wp_enqueue_script( 'pwb_brands_js' );
543
+ wp_localize_script( 'pwb_brands_js', 'ajax_object', array(
544
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
545
+ 'site_url' => site_url(),
546
+ 'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
547
+ 'translations' => array(
548
+ 'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
549
+ 'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands'),
550
+ 'dummy_data_notice' => __('¿Start loading dummy data?','perfect-woocommerce-brands'),
551
+ 'dummy_data' => __('We are importing the dummy data. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
552
+ )
553
+ ) );
554
+
555
+ }
556
+
557
+ public function register_brands_taxonomy(){
558
+ $labels = array(
559
+ 'name' => __( 'Brands', 'perfect-woocommerce-brands' ),
560
+ 'singular_name' => __( 'Brand', 'perfect-woocommerce-brands' ),
561
+ 'menu_name' => __( 'Brands', 'perfect-woocommerce-brands' ),
562
+ 'all_items' => __( 'All Brands', 'perfect-woocommerce-brands' ),
563
+ 'edit_item' => __( 'Edit Brand', 'perfect-woocommerce-brands' ),
564
+ 'view_item' => __( 'View Brand', 'perfect-woocommerce-brands' ),
565
+ 'update_item' => __( 'Update Brand', 'perfect-woocommerce-brands' ),
566
+ 'add_new_item' => __( 'Add New Brand', 'perfect-woocommerce-brands' ),
567
+ 'new_item_name' => __( 'New Brand Name', 'perfect-woocommerce-brands' ),
568
+ 'parent_item' => __( 'Parent Brand', 'perfect-woocommerce-brands' ),
569
+ 'parent_item_colon' => __( 'Parent Brand:', 'perfect-woocommerce-brands' ),
570
+ 'search_items' => __( 'Search Brands', 'perfect-woocommerce-brands' ),
571
+ 'popular_items' => __( 'Popular Brands', 'perfect-woocommerce-brands' ),
572
+ 'separate_items_with_commas' => __( 'Separate brands with commas', 'perfect-woocommerce-brands' ),
573
+ 'add_or_remove_items' => __( 'Add or remove brands', 'perfect-woocommerce-brands' ),
574
+ 'choose_from_most_used' => __( 'Choose from the most used brands', 'perfect-woocommerce-brands' ),
575
+ 'not_found' => __( 'No brands found', 'perfect-woocommerce-brands' )
576
+ );
577
+
578
+ $new_slug = get_option('wc_pwb_admin_tab_slug');
579
+ $old_slug = get_option('old_wc_pwb_admin_tab_slug');
580
+
581
+ $new_slug = ($new_slug!=false) ? $new_slug : 'brand';
582
+ $old_slug = ($old_slug!=false) ? $old_slug : 'null';
583
+
584
+ $args = array(
585
+ 'hierarchical' => true,
586
+ 'labels' => $labels,
587
+ 'show_ui' => true,
588
+ 'query_var' => true,
589
+ 'public' => true,
590
+ 'show_admin_column' => true,
591
+ 'rewrite' => array(
592
+ 'slug' => $new_slug,
593
+ 'hierarchical' => true,
594
+ 'ep_mask' => EP_PERMALINK
595
+ )
596
+ );
597
+
598
+ register_taxonomy( 'pwb-brand', array( 'product' ), $args );
599
+
600
+ if($new_slug != false && $old_slug!= false && $new_slug != $old_slug){
601
+ flush_rewrite_rules();
602
+ update_option( 'old_wc_pwb_admin_tab_slug', $new_slug );
603
+ }
604
+
605
+ }
606
+
607
+ public function add_brands_metafields(){
608
+ register_meta( 'term', 'pwb_brand_image', array($this,'add_brands_metafields_sanitize') );
609
+ }
610
+
611
+ public function add_brands_metafields_sanitize($brand_img){
612
+ return $brand_img;
613
+ }
614
+
615
+ public function add_brands_metafields_form(){
616
+ ob_start();
617
+ ?>
618
+ <div class="form-field pwb_brand_cont">
619
+ <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
620
+ <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="" >
621
+ <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
622
+ </div>
623
+
624
+ <div class="form-field pwb_brand_cont">
625
+ <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
626
+ <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="" >
627
+ <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
628
+ <p><?php _e( 'This image will be shown on brand page', 'perfect-woocommerce-brands' ); ?></p>
629
+ </div>
630
+
631
+ <div class="form-field pwb_brand_cont">
632
+ <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
633
+ <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="" >
634
+ <p><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
635
+ </div>
636
+
637
+ <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' ); ?>
638
+
639
+ <?php
640
+ echo ob_get_clean();
641
+ }
642
+
643
+ public function add_brands_metafields_form_edit($term){
644
+ $term_value_image = get_term_meta( $term->term_id, 'pwb_brand_image', true );
645
+ $term_value_banner = get_term_meta( $term->term_id, 'pwb_brand_banner', true );
646
+ $term_value_banner_link = get_term_meta( $term->term_id, 'pwb_brand_banner_link', true );
647
+ ob_start();
648
+ ?>
649
+ <table class="form-table pwb_brand_cont">
650
+ <tr class="form-field">
651
+ <th>
652
+ <label for="pwb_brand_image"><?php _e( 'Brand logo', 'perfect-woocommerce-brands' ); ?></label>
653
+ </th>
654
+ <td>
655
+ <input type="text" name="pwb_brand_image" id="pwb_brand_image" value="<?php echo $term_value_image;?>" >
656
+ <a href="#" id="pwb_brand_image_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
657
+
658
+ <?php $current_image = wp_get_attachment_image ( $term_value_image, array('90','90'), false ); ?>
659
+ <?php if( !empty($current_image) ): ?>
660
+ <div class="pwb_brand_image_selected">
661
+ <span>
662
+ <?php echo $current_image;?>
663
+ <a href="#" class="pwb_brand_image_selected_remove">X</a>
664
+ </span>
665
+ </div>
666
+ <?php endif; ?>
667
+
668
+ </td>
669
+ </tr>
670
+ <tr class="form-field">
671
+ <th>
672
+ <label for="pwb_brand_banner"><?php _e( 'Brand banner', 'perfect-woocommerce-brands' ); ?></label>
673
+ </th>
674
+ <td>
675
+ <input type="text" name="pwb_brand_banner" id="pwb_brand_banner" value="<?php echo $term_value_banner;?>" >
676
+ <a href="#" id="pwb_brand_banner_select" class="button"><?php _e('Select image','perfect-woocommerce-brands');?></a>
677
+
678
+ <?php $current_image = wp_get_attachment_image ( $term_value_banner, array('90','90'), false ); ?>
679
+ <?php if( !empty($current_image) ): ?>
680
+ <div class="pwb_brand_image_selected">
681
+ <span>
682
+ <?php echo $current_image;?>
683
+ <a href="#" class="pwb_brand_image_selected_remove">X</a>
684
+ </span>
685
+ </div>
686
+ <?php endif; ?>
687
+
688
+ </td>
689
+ </tr>
690
+ <tr class="form-field">
691
+ <th>
692
+ <label for="pwb_brand_banner_link"><?php _e( 'Brand banner link', 'perfect-woocommerce-brands' ); ?></label>
693
+ </th>
694
+ <td>
695
+ <input type="text" name="pwb_brand_banner_link" id="pwb_brand_banner_link" value="<?php echo $term_value_banner_link;?>" >
696
+ <p class="description"><?php _e( 'This link should be relative to site url. Example: product/product-name', 'perfect-woocommerce-brands' ); ?></p>
697
+ <div id="pwb_brand_banner_link_result"><?php echo wp_get_attachment_image ( $term_value_banner_link, array('90','90'), false );?></div>
698
+ </td>
699
+ </tr>
700
+ </table>
701
+
702
+ <?php echo wp_nonce_field( basename( __FILE__ ), 'pwb_nonce' );?>
703
+
704
+ <?php
705
+ echo ob_get_clean();
706
+ }
707
+
708
+ public function add_brands_metafields_save( $term_id ){
709
+
710
+ if ( ! isset( $_POST['pwb_nonce'] ) || ! wp_verify_nonce( $_POST['pwb_nonce'], basename( __FILE__ ) ) )
711
+ return;
712
+
713
+ /* ·············· Brand image ·············· */
714
+ $old_img = get_term_meta( $term_id, 'pwb_brand_image', true );
715
+ $new_img = isset( $_POST['pwb_brand_image'] ) ? $_POST['pwb_brand_image'] : '';
716
+
717
+ if ( $old_img && '' === $new_img )
718
+ delete_term_meta( $term_id, 'pwb_brand_image' );
719
+
720
+ else if ( $old_img !== $new_img )
721
+ update_term_meta( $term_id, 'pwb_brand_image', $new_img );
722
+ /* ·············· /Brand image ·············· */
723
+
724
+ /* ·············· Brand banner ·············· */
725
+ $old_img = get_term_meta( $term_id, 'pwb_brand_banner', true );
726
+ $new_img = isset( $_POST['pwb_brand_banner'] ) ? $_POST['pwb_brand_banner'] : '';
727
+
728
+ if ( $old_img && '' === $new_img )
729
+ delete_term_meta( $term_id, 'pwb_brand_banner' );
730
+
731
+ else if ( $old_img !== $new_img )
732
+ update_term_meta( $term_id, 'pwb_brand_banner', $new_img );
733
+ /* ·············· /Brand banner ·············· */
734
+
735
+ /* ·············· Brand banner link ·············· */
736
+ $old_img = get_term_meta( $term_id, 'pwb_brand_banner_link', true );
737
+ $new_img = isset( $_POST['pwb_brand_banner_link'] ) ? $_POST['pwb_brand_banner_link'] : '';
738
+
739
+ if ( $old_img && '' === $new_img )
740
+ delete_term_meta( $term_id, 'pwb_brand_banner_link' );
741
+
742
+ else if ( $old_img !== $new_img )
743
+ update_term_meta( $term_id, 'pwb_brand_banner_link', $new_img );
744
+ /* ·············· /Brand banner link ·············· */
745
+ }
746
+
747
+ public function brand_taxonomy_columns_head($defaults) {
748
+ $newColumns = array(
749
+ 'cb' => $defaults['cb'],
750
+ 'logo' => __( 'Logo', 'perfect-woocommerce-brands' )
751
+ );
752
+
753
+ unset($defaults['description']);
754
+ unset($defaults['cb']);
755
+
756
+ return array_merge($newColumns,$defaults);
757
+ }
758
+
759
+ public function brand_taxonomy_columns($c, $column_name, $term_id){
760
+ $image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('60','60') );
761
+ if($image){
762
+ return $image;
763
+ }else{
764
+ return "-";
765
+ }
766
+ }
767
+
768
+ public static function get_brands( $hide_empty = false, $order_by = 'name', $order = 'ASC' ){
769
+ $result = array();
770
+
771
+ $brands = get_terms('pwb-brand',array(
772
+ 'hide_empty' => $hide_empty,
773
+ 'order_by' => $order_by,
774
+ 'order' => $order
775
+ ));
776
+
777
+ if(is_array($brands) && count($brands)>0){
778
+ $result = $brands;
779
+ }
780
+
781
+ return $result;
782
+
783
+ }
784
+
785
+ public static function get_brands_array( $is_select = false ){
786
+ $result = array();
787
+
788
+ //if is for select input adds default value
789
+ if( $is_select )
790
+ $result[0] = __( 'All', 'perfect-woocommerce-brands' );
791
+
792
+ $brands = get_terms('pwb-brand',array(
793
+ 'hide_empty' => false
794
+ ));
795
+
796
+ foreach ($brands as $brand) {
797
+ $result[$brand->term_id] = $brand->slug;
798
+ }
799
+
800
+ return $result;
801
+
802
+ }
803
+
804
+ public static function get_products_by_brand($brand_id, $count){
805
+
806
+ if($brand_id === 'all'){
807
+ $args = array(
808
+ 'post_type' => 'product',
809
+ 'posts_per_page' => $count,
810
+ 'paged' => false
811
+ );
812
+ }else{
813
+ $args = array(
814
+ 'post_type' => 'product',
815
+ 'tax_query' => array(
816
+ array(
817
+ 'taxonomy' => 'pwb-brand',
818
+ 'field' => 'slug',
819
+ 'terms' => $brand_id,
820
+ )
821
+ ),
822
+ 'posts_per_page' => $count,
823
+ 'paged' => false
824
+ );
825
+ }
826
+
827
+ ob_start();
828
+
829
+ $loop = new \WP_Query( $args );
830
+ if ( $loop->have_posts() && function_exists('wc_get_product') && function_exists('woocommerce_template_loop_add_to_cart') && function_exists('woocommerce_get_product_thumbnail') ) {
831
+ while ( $loop->have_posts() ) : $loop->the_post();
832
+ $product = wc_get_product( get_the_ID() );
833
+
834
+ echo '<div>';
835
+ echo '<a href="'.get_the_permalink().'">';
836
+ echo woocommerce_get_product_thumbnail();
837
+ echo '<h3>'.$product->get_title().'</h3>';
838
+ echo '<span class="pwb-amount">'.$product->get_price_html().'</span>';
839
+ woocommerce_template_loop_add_to_cart();
840
+ echo '</a>';
841
+ echo '</div>';
842
+
843
+ endwhile;
844
+ } else {
845
+ echo __( 'No products found', 'perfect-woocommerce-brands' );
846
+ }
847
+ wp_reset_postdata();
848
+
849
+ return ob_get_clean();
850
+
851
+ }
852
+
853
+ public function archive_page_banner(){
854
+ $queried_object = get_queried_object();
855
+
856
+ if( self::is_brand_archive_page() ){
857
+
858
+ $brand_banner = get_term_meta( $queried_object->term_id, 'pwb_brand_banner', true );
859
+ $brand_banner_link = get_term_meta( $queried_object->term_id, 'pwb_brand_banner_link', true );
860
+ $show_desc = get_option('wc_pwb_admin_tab_brand_desc');
861
+
862
+ if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
863
+ echo '<div class="pwb-brand-banner-cont">';
864
+ }
865
+
866
+ //pwb-brand archive
867
+ if( $brand_banner!='' ){
868
+ echo '<div class="pwb-brand-banner pwb-clearfix">';
869
+ if($brand_banner_link!=''){
870
+ echo '<a href="'.site_url($brand_banner_link).'">'.wp_get_attachment_image ( $brand_banner, 'full', false ).'</a>';
871
+ }else{
872
+ echo wp_get_attachment_image ( $brand_banner, 'full', false );
873
+ }
874
+ echo '</div>';
875
+ }
876
+
877
+ //show brand description
878
+ if( $queried_object->description != '' && $show_desc !== 'no' ){
879
+ echo '<div class="pwb-brand-description">';
880
+ echo $queried_object->description;
881
+ echo '</div>';
882
+ }
883
+
884
+ if( $brand_banner!='' || $queried_object->description != '' && $show_desc !== 'no' ){
885
+ echo '</div>';
886
+ }
887
+
888
+ }
889
+
890
+ }
891
+
892
+ public function filter_default_brand_desc( $desc_kses ){
893
+ if( self::is_brand_archive_page() ){
894
+ return false;
895
+ }
896
+ return $desc_kses;
897
+ }
898
+
899
+ public static function is_brand_archive_page(){
900
+ $queried_object = get_queried_object();
901
+ if( is_a( $queried_object,'WP_Term' ) && $queried_object->taxonomy == 'pwb-brand' ){
902
+ return true;
903
+ }
904
+ return false;
905
+ }
906
+
907
+ }
 
 
 
 
classes/class-pwb-api-support.php CHANGED
@@ -1,53 +1,121 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_API_Support{
7
-
8
- function __construct(){
9
- add_action( 'rest_api_init', array( $this, 'register_endpoints' ) );
10
-
11
- /**
12
- * register_rest_field() was introduced in WordPress 4.7.0
13
- */
14
- if( version_compare( PWB_WP_VERSION, '4.7.0', '>=' ) ){
15
- add_action( 'rest_api_init', array( $this, 'register_fields' ) );
16
- }
17
-
18
- }
19
-
20
- public function register_endpoints(){
21
-
22
- register_rest_route( 'wc/v1', '/brands', array(
23
- // By using this constant we ensure that when the WP_REST_Server changes our readable endpoints will work as intended.
24
- 'methods' => \WP_REST_Server::READABLE,
25
- 'callback' => function(){
26
- return rest_ensure_response(
27
- \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands()
28
- );
29
- }
30
- ) );
31
-
32
- }
33
-
34
- public function register_fields(){
35
-
36
- register_rest_field( 'product', 'brands', array(
37
- 'get_callback' => function( $product ) {
38
- $result_brands_array = array();
39
- $brands = wp_get_post_terms($product['id'], 'pwb-brand' );
40
- foreach($brands as $brand) {
41
- $result_brands_array[$brand->term_id] = $brand->name;
42
- }
43
- return $result_brands_array;
44
- },
45
- 'schema' => array(
46
- 'description' => __( 'Product brands' , 'perfect-woocommerce-brands' ),
47
- 'type' => 'text'
48
- )
49
- ) );
50
-
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_API_Support{
8
+
9
+ private $namespaces = array(
10
+ "wc/v1",
11
+ "wc/v2",
12
+ );
13
+
14
+ function __construct(){
15
+ add_action('rest_api_init', array($this, 'register_endpoints'));
16
+
17
+ /**
18
+ * register_rest_field() was introduced in WordPress 4.7.0
19
+ */
20
+ if (version_compare(PWB_WP_VERSION, '4.7.0', '>=')) {
21
+ add_action('rest_api_init', array($this, 'register_fields'));
22
+ }
23
+
24
+ }
25
+
26
+ /**
27
+ * Registers the endpoint for all possible $namespaces
28
+ */
29
+ public function register_endpoints(){
30
+ foreach ($this->namespaces as $namespace) {
31
+ register_rest_route($namespace, '/brands', array(
32
+ // By using this constant we ensure that when the WP_REST_Server changes our readable endpoints will work as intended.
33
+ 'methods' => \WP_REST_Server::READABLE,
34
+ 'callback' => function () {
35
+ return rest_ensure_response(
36
+ Perfect_Woocommerce_Brands::get_brands()
37
+ );
38
+ }
39
+ ));
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Entry point for all rest field settings
45
+ */
46
+ public function register_fields(){
47
+ register_rest_field('product', 'brands', array(
48
+ 'get_callback' => array($this, "get_callback"),
49
+ 'update_callback' => array($this, "update_callback"),
50
+ 'schema' => $this->get_schema(),
51
+ ));
52
+ }
53
+
54
+ /**
55
+ * Returns the schema of the "brands" field on the /product route
56
+ * To attach a brand to a product just append a "brands" key containing an array of brand id's
57
+ * An empty array wil detach all brands.
58
+ * @return array
59
+ */
60
+ public function get_schema(){
61
+ return array(
62
+ 'description' => __('Product brands', 'perfect-woocommerce-brands'),
63
+ 'type' => 'array',
64
+ 'items' => array(
65
+ "type" => "integer"
66
+ ),
67
+ 'context' => array("view", "edit")
68
+ );
69
+ }
70
+
71
+ /**
72
+ * Returns all attached brands to a GET request to /products(/id)
73
+ * @param $product
74
+ * @return array|\WP_Error
75
+ */
76
+ public function get_callback($product){
77
+ $brands = wp_get_post_terms($product['id'], 'pwb-brand');
78
+
79
+ $result_brands_array = array();
80
+ foreach ($brands as $brand) {
81
+ $result_brands_array[$brand->term_id] = $brand->name;
82
+ }
83
+
84
+ return $result_brands_array;
85
+ }
86
+
87
+ /**
88
+ * Entry point for an update call
89
+ * @param $brands
90
+ * @param $product
91
+ */
92
+ public function update_callback($brands, $product){
93
+ if (empty($brands)) {
94
+ $this->removeBrands($product);
95
+ return; //done
96
+ }
97
+ $this->addBrands($brands, $product);
98
+ }
99
+
100
+
101
+ /**
102
+ * Detaches all brands from a product
103
+ * @param \WC_Product $product
104
+ */
105
+ private function removeBrands($product){
106
+ $brands = wp_get_post_terms($product->get_id(), 'pwb-brand');
107
+ if (!empty($brands)) {
108
+ wp_set_post_terms($product->get_id(), array(), 'pwb-brand');
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Attaches the given brands to a product. Earlier attached brands, not in this array, will be removed
114
+ * @param array $brands
115
+ * @param \WC_Product $product
116
+ */
117
+ private function addBrands($brands, $product){
118
+ wp_set_post_terms($product->get_id(), $brands, "pwb-brand");
119
+ }
120
+
121
+ }
classes/shortcodes/class-pwb-all-brands.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_All_Brands_Shortcode{
7
-
8
- public static function all_brands_shortcode( $atts ) {
9
-
10
- $atts = shortcode_atts( array(
11
- 'per_page' => "10",
12
- 'image_size' => "thumbnail",
13
- 'hide_empty' => false,
14
- 'order_by' => 'name',
15
- 'order' => 'ASC',
16
- 'title_position' => 'before'
17
- ), $atts, 'pwb-all-brands' );
18
-
19
- $hide_empty = true;
20
- if( $atts['hide_empty'] != 'true' ){
21
- $hide_empty = false;
22
- }
23
-
24
- ob_start();
25
-
26
- $brands = array();
27
- if( $atts['order_by'] == 'rand' ){
28
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
29
- shuffle( $brands );
30
- }else{
31
- $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
32
- }
33
-
34
- ?>
35
- <div class="pwb-all-brands">
36
- <?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
37
- </div>
38
- <?php
39
-
40
- return ob_get_clean();
41
- }
42
-
43
- public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
44
- $page = 1;
45
-
46
- if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
47
- $page = $_GET['pwb-page'];
48
- }
49
-
50
- $page = $page < 1 ? 1 : $page;
51
-
52
- // start position in the $display_array
53
- // +1 is to account for total values.
54
- $start = ($page - 1) * ($show_per_page);
55
- $offset = $show_per_page;
56
-
57
- $outArray = array_slice($display_array, $start, $offset);
58
-
59
- //pagination links
60
- $total_elements = count($display_array);
61
- $pages = ((int)$total_elements / (int)$show_per_page);
62
- $pages = ceil($pages);
63
- if($pages>=1 && $page <= $pages){
64
-
65
- ?>
66
- <div class="pwb-brands-cols-outer">
67
- <?php
68
- foreach($outArray as $brand){
69
- $brand_id = $brand->term_id;
70
- $brand_name = $brand->name;
71
- $brand_link = get_term_link($brand_id);
72
-
73
- $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
74
- $attachment_html = $brand_name;
75
- if($attachment_id!=''){
76
- $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
77
- }
78
-
79
- ?>
80
- <div class="pwb-brands-col3">
81
-
82
- <?php if( $title_position != 'after' ): ?>
83
- <p>
84
- <?php echo $brand_name;?>
85
- <small>(<?php echo $brand->count;?>)</small>
86
- </p>
87
- <?php endif; ?>
88
-
89
- <div>
90
- <a href="<?php echo $brand_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>"><?php echo $attachment_html;?></a>
91
- </div>
92
-
93
- <?php if( $title_position == 'after' ): ?>
94
- <p>
95
- <?php echo $brand_name;?>
96
- <small>(<?php echo $brand->count;?>)</small>
97
- </p>
98
- <?php endif; ?>
99
-
100
- </div>
101
- <?php
102
- }
103
- ?>
104
- </div>
105
- <?php
106
- $next = $page + 1;
107
- $prev = $page - 1;
108
-
109
- echo '<div class="pwb-pagination-wrapper">';
110
- if($prev>1){
111
- echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">&laquo;</a>';
112
- }
113
- if($prev>0){
114
- echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">&lsaquo;</a>';
115
- }
116
-
117
- if($next<=$pages){
118
- echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">&rsaquo;</a>';
119
- }
120
- if($next<$pages){
121
- echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">&raquo;</a>';
122
- }
123
- echo '</div>';
124
-
125
- }else{
126
- echo __('No results','perfect-woocommerce-brands');
127
- }
128
-
129
- }
130
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_All_Brands_Shortcode{
7
+
8
+ public static function all_brands_shortcode( $atts ) {
9
+
10
+ $atts = shortcode_atts( array(
11
+ 'per_page' => "10",
12
+ 'image_size' => "thumbnail",
13
+ 'hide_empty' => false,
14
+ 'order_by' => 'name',
15
+ 'order' => 'ASC',
16
+ 'title_position' => 'before'
17
+ ), $atts, 'pwb-all-brands' );
18
+
19
+ $hide_empty = true;
20
+ if( $atts['hide_empty'] != 'true' ){
21
+ $hide_empty = false;
22
+ }
23
+
24
+ ob_start();
25
+
26
+ $brands = array();
27
+ if( $atts['order_by'] == 'rand' ){
28
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty );
29
+ shuffle( $brands );
30
+ }else{
31
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands( $hide_empty, $atts['order_by'], $atts['order'] );
32
+ }
33
+
34
+ ?>
35
+ <div class="pwb-all-brands">
36
+ <?php static::pagination( $brands, $atts['per_page'], $atts['image_size'], $atts['title_position'] );?>
37
+ </div>
38
+ <?php
39
+
40
+ return ob_get_clean();
41
+ }
42
+
43
+ public static function pagination( $display_array, $show_per_page, $image_size, $title_position ) {
44
+ $page = 1;
45
+
46
+ if( isset( $_GET['pwb-page'] ) && filter_var( $_GET['pwb-page'], FILTER_VALIDATE_INT ) == true ){
47
+ $page = $_GET['pwb-page'];
48
+ }
49
+
50
+ $page = $page < 1 ? 1 : $page;
51
+
52
+ // start position in the $display_array
53
+ // +1 is to account for total values.
54
+ $start = ($page - 1) * ($show_per_page);
55
+ $offset = $show_per_page;
56
+
57
+ $outArray = array_slice($display_array, $start, $offset);
58
+
59
+ //pagination links
60
+ $total_elements = count($display_array);
61
+ $pages = ((int)$total_elements / (int)$show_per_page);
62
+ $pages = ceil($pages);
63
+ if($pages>=1 && $page <= $pages){
64
+
65
+ ?>
66
+ <div class="pwb-brands-cols-outer">
67
+ <?php
68
+ foreach($outArray as $brand){
69
+ $brand_id = $brand->term_id;
70
+ $brand_name = $brand->name;
71
+ $brand_link = get_term_link($brand_id);
72
+
73
+ $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
74
+ $attachment_html = $brand_name;
75
+ if($attachment_id!=''){
76
+ $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
77
+ }
78
+
79
+ ?>
80
+ <div class="pwb-brands-col3">
81
+
82
+ <?php if( $title_position != 'after' ): ?>
83
+ <p>
84
+ <?php echo $brand_name;?>
85
+ <small>(<?php echo $brand->count;?>)</small>
86
+ </p>
87
+ <?php endif; ?>
88
+
89
+ <div>
90
+ <a href="<?php echo $brand_link;?>" title="<?php _e( 'View brand', 'perfect-woocommerce-brands' );?>"><?php echo $attachment_html;?></a>
91
+ </div>
92
+
93
+ <?php if( $title_position == 'after' ): ?>
94
+ <p>
95
+ <?php echo $brand_name;?>
96
+ <small>(<?php echo $brand->count;?>)</small>
97
+ </p>
98
+ <?php endif; ?>
99
+
100
+ </div>
101
+ <?php
102
+ }
103
+ ?>
104
+ </div>
105
+ <?php
106
+ $next = $page + 1;
107
+ $prev = $page - 1;
108
+
109
+ echo '<div class="pwb-pagination-wrapper">';
110
+ if($prev>1){
111
+ echo '<a href="'.get_the_permalink().'" class="pwb-pagination prev" title="'.__('First page','perfect-woocommerce-brands').'">&laquo;</a>';
112
+ }
113
+ if($prev>0){
114
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$prev.'" class="pwb-pagination last" title="'.__('Previous page','perfect-woocommerce-brands').'">&lsaquo;</a>';
115
+ }
116
+
117
+ if($next<=$pages){
118
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$next.'" class="pwb-pagination first" title="'.__('Next page','perfect-woocommerce-brands').'">&rsaquo;</a>';
119
+ }
120
+ if($next<$pages){
121
+ echo '<a href="'.get_the_permalink().'?pwb-page='.$pages.'" class="pwb-pagination next" title="'.__('Last page','perfect-woocommerce-brands').'">&raquo;</a>';
122
+ }
123
+ echo '</div>';
124
+
125
+ }else{
126
+ echo __('No results','perfect-woocommerce-brands');
127
+ }
128
+
129
+ }
130
+ }
classes/shortcodes/class-pwb-brand.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Shortcodes;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Brand_Shortcode{
7
-
8
- public static function brand_shortcode( $atts ) {
9
- $atts = shortcode_atts( array(
10
- 'product_id' => null,
11
- 'image_size' => 'thumbnail'
12
- ), $atts, 'pwb-brand' );
13
-
14
- ob_start();
15
-
16
- $brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
17
-
18
- if(is_array($brands) && count($brands)>0){
19
-
20
- echo '<div class="pwb-brand-shortcode">';
21
-
22
- foreach($brands as $brand){
23
- $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
24
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
25
-
26
- $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
27
-
28
- if(!empty($attachment_html)){
29
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
30
- }else{
31
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
32
- }
33
- }
34
-
35
- echo '</div>';
36
-
37
- }
38
-
39
- return ob_get_clean();
40
-
41
- }
42
-
43
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Brand_Shortcode{
7
+
8
+ public static function brand_shortcode( $atts ) {
9
+ $atts = shortcode_atts( array(
10
+ 'product_id' => null,
11
+ 'image_size' => 'thumbnail'
12
+ ), $atts, 'pwb-brand' );
13
+
14
+ ob_start();
15
+
16
+ $brands = wp_get_post_terms( $atts['product_id'], 'pwb-brand');
17
+
18
+ if(is_array($brands) && count($brands)>0){
19
+
20
+ echo '<div class="pwb-brand-shortcode">';
21
+
22
+ foreach($brands as $brand){
23
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
24
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
25
+
26
+ $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
27
+
28
+ if(!empty($attachment_html)){
29
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
30
+ }else{
31
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>';
32
+ }
33
+ }
34
+
35
+ echo '</div>';
36
+
37
+ }
38
+
39
+ return ob_get_clean();
40
+
41
+ }
42
+
43
+ }
classes/shortcodes/class-pwb-carousel.php CHANGED
@@ -1,60 +1,60 @@
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
- public static function carousel_shortcode( $atts ) {
9
- $atts = shortcode_atts( array(
10
- 'items' => "10",
11
- 'items_to_show' => "5",
12
- 'items_to_scroll' => "1",
13
- 'image_size' => "thumbnail",
14
- 'autoplay' => "false",
15
- 'arrows' => "false"
16
- ), $atts, 'pwb-carousel' );
17
-
18
- $foreach_iterator = 0;
19
-
20
- $atts['autoplay'] = ( $atts['autoplay'] === 'true' ) ? true: false;
21
- $atts['arrows'] = ( $atts['arrows'] === 'true' ) ? true: false;
22
-
23
- $slick_settings = array(
24
- 'slidesToShow' => (int)$atts['items_to_show'],
25
- 'slidesToScroll' => (int)$atts['items_to_scroll'],
26
- 'autoplay' => (bool)$atts['autoplay'],
27
- 'arrows' => (bool)$atts['arrows']
28
- );
29
-
30
- ob_start();
31
- ?>
32
-
33
- <div class="pwb-carousel" data-slick='<?php echo json_encode($slick_settings); ?>'>
34
- <?php
35
- foreach(\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands() as $brand){
36
- if($foreach_iterator>=(int)$atts['items']){
37
- break;
38
- }
39
-
40
- $brand_id = $brand->term_id;
41
- $brand_link = get_term_link($brand_id);
42
-
43
- $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
44
- $attachment_html = $brand->name;
45
- if($attachment_id!=''){
46
- $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
47
- }
48
-
49
- echo '<div>';
50
- echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
51
- echo '</div>';
52
-
53
- $foreach_iterator++;
54
- }
55
- echo '</div>';
56
-
57
- return ob_get_clean();
58
- }
59
-
60
- }
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
+ public static function carousel_shortcode( $atts ) {
9
+ $atts = shortcode_atts( array(
10
+ 'items' => "10",
11
+ 'items_to_show' => "5",
12
+ 'items_to_scroll' => "1",
13
+ 'image_size' => "thumbnail",
14
+ 'autoplay' => "false",
15
+ 'arrows' => "false"
16
+ ), $atts, 'pwb-carousel' );
17
+
18
+ $foreach_iterator = 0;
19
+
20
+ $atts['autoplay'] = ( $atts['autoplay'] === 'true' ) ? true: false;
21
+ $atts['arrows'] = ( $atts['arrows'] === 'true' ) ? true: false;
22
+
23
+ $slick_settings = array(
24
+ 'slidesToShow' => (int)$atts['items_to_show'],
25
+ 'slidesToScroll' => (int)$atts['items_to_scroll'],
26
+ 'autoplay' => (bool)$atts['autoplay'],
27
+ 'arrows' => (bool)$atts['arrows']
28
+ );
29
+
30
+ ob_start();
31
+ ?>
32
+
33
+ <div class="pwb-carousel" data-slick='<?php echo json_encode($slick_settings); ?>'>
34
+ <?php
35
+ foreach(\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands() as $brand){
36
+ if($foreach_iterator>=(int)$atts['items']){
37
+ break;
38
+ }
39
+
40
+ $brand_id = $brand->term_id;
41
+ $brand_link = get_term_link($brand_id);
42
+
43
+ $attachment_id = get_term_meta( $brand_id, 'pwb_brand_image', 1 );
44
+ $attachment_html = $brand->name;
45
+ if($attachment_id!=''){
46
+ $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']);
47
+ }
48
+
49
+ echo '<div>';
50
+ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>';
51
+ echo '</div>';
52
+
53
+ $foreach_iterator++;
54
+ }
55
+ echo '</div>';
56
+
57
+ return ob_get_clean();
58
+ }
59
+
60
+ }
classes/shortcodes/class-pwb-product-carousel.php CHANGED
@@ -1,39 +1,39 @@
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
- public static function product_carousel_shortcode( $atts ) {
9
- $atts = shortcode_atts( array(
10
- 'brand' => "all",
11
- 'products' => "10",
12
- 'products_to_show' => "5",
13
- 'products_to_scroll' => "1",
14
- 'autoplay' => "false",
15
- 'arrows' => "false"
16
- ), $atts, 'pwb-product-carousel' );
17
-
18
- $atts['autoplay'] = ( $atts['autoplay'] === 'true' ) ? true: false;
19
- $atts['arrows'] = ( $atts['arrows'] === 'true' ) ? true: false;
20
-
21
- $slick_settings = array(
22
- 'slidesToShow' => (int)$atts['products_to_show'],
23
- 'slidesToScroll' => (int)$atts['products_to_scroll'],
24
- 'autoplay' => (bool)$atts['autoplay'],
25
- 'arrows' => (bool)$atts['arrows']
26
- );
27
-
28
- ob_start();
29
- ?>
30
-
31
- <div class="pwb-product-carousel" data-slick='<?php echo json_encode($slick_settings); ?>'>
32
- <?php echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_products_by_brand($atts['brand'], (int)$atts['products']); ?>
33
- </div>
34
-
35
- <?php
36
- return ob_get_clean();
37
- }
38
-
39
- }
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
+ public static function product_carousel_shortcode( $atts ) {
9
+ $atts = shortcode_atts( array(
10
+ 'brand' => "all",
11
+ 'products' => "10",
12
+ 'products_to_show' => "5",
13
+ 'products_to_scroll' => "1",
14
+ 'autoplay' => "false",
15
+ 'arrows' => "false"
16
+ ), $atts, 'pwb-product-carousel' );
17
+
18
+ $atts['autoplay'] = ( $atts['autoplay'] === 'true' ) ? true: false;
19
+ $atts['arrows'] = ( $atts['arrows'] === 'true' ) ? true: false;
20
+
21
+ $slick_settings = array(
22
+ 'slidesToShow' => (int)$atts['products_to_show'],
23
+ 'slidesToScroll' => (int)$atts['products_to_scroll'],
24
+ 'autoplay' => (bool)$atts['autoplay'],
25
+ 'arrows' => (bool)$atts['arrows']
26
+ );
27
+
28
+ ob_start();
29
+ ?>
30
+
31
+ <div class="pwb-product-carousel" data-slick='<?php echo json_encode($slick_settings); ?>'>
32
+ <?php echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_products_by_brand($atts['brand'], (int)$atts['products']); ?>
33
+ </div>
34
+
35
+ <?php
36
+ return ob_get_clean();
37
+ }
38
+
39
+ }
classes/widgets/class-pwb-dropdown.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Dropdown_Widget extends \WP_Widget {
7
-
8
- function __construct(){
9
- $params = array(
10
- 'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_Dropdown_Widget', '', $params);
14
- }
15
-
16
- public function form($instance){
17
- extract($instance);
18
- ?>
19
-
20
- <p>
21
- <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title', 'perfect-woocommerce-brands' );?></label>
22
- <input
23
- class="widefat"
24
- type="text"
25
- id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
- name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
- value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
- </p>
29
-
30
- <?php
31
- }
32
-
33
- public function widget($args, $instance){
34
- extract($args);
35
- extract($instance);
36
-
37
- echo $before_widget;
38
-
39
- if(!empty($title)){
40
- echo $before_title . $title . $after_title;
41
- }
42
-
43
- $this->get_brands();
44
-
45
- echo $after_widget;
46
-
47
- }
48
-
49
- private function get_brands(){
50
- $brands = get_terms('pwb-brand',array(
51
- 'hide_empty' => false
52
- ));
53
-
54
- if(is_array($brands) && count($brands)>0){
55
- echo '<select class="pwb-dropdown-widget">';
56
- echo '<option selected="true" disabled="disabled">'.__( 'Brands', 'perfect-woocommerce-brands' ).'</option>';
57
- foreach ($brands as $brand) {
58
- $brand_name = $brand->name;
59
- $brand_link = get_term_link($brand->term_id);
60
- echo '<option value="'.$brand_link.'">'.$brand->name.'</option>';
61
- }
62
- echo '</select>';
63
- }else{
64
- echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
65
- }
66
-
67
- }
68
-
69
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Dropdown_Widget extends \WP_Widget {
7
+
8
+ function __construct(){
9
+ $params = array(
10
+ 'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_Dropdown_Widget', '', $params);
14
+ }
15
+
16
+ public function form($instance){
17
+ extract($instance);
18
+ ?>
19
+
20
+ <p>
21
+ <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title', 'perfect-woocommerce-brands' );?></label>
22
+ <input
23
+ class="widefat"
24
+ type="text"
25
+ id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
+ name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
+ value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
+ </p>
29
+
30
+ <?php
31
+ }
32
+
33
+ public function widget($args, $instance){
34
+ extract($args);
35
+ extract($instance);
36
+
37
+ echo $before_widget;
38
+
39
+ if(!empty($title)){
40
+ echo $before_title . $title . $after_title;
41
+ }
42
+
43
+ $this->get_brands();
44
+
45
+ echo $after_widget;
46
+
47
+ }
48
+
49
+ private function get_brands(){
50
+ $brands = get_terms('pwb-brand',array(
51
+ 'hide_empty' => false
52
+ ));
53
+
54
+ if(is_array($brands) && count($brands)>0){
55
+ echo '<select class="pwb-dropdown-widget">';
56
+ echo '<option selected="true" disabled="disabled">'.__( 'Brands', 'perfect-woocommerce-brands' ).'</option>';
57
+ foreach ($brands as $brand) {
58
+ $brand_name = $brand->name;
59
+ $brand_link = get_term_link($brand->term_id);
60
+ echo '<option value="'.$brand_link.'">'.$brand->name.'</option>';
61
+ }
62
+ echo '</select>';
63
+ }else{
64
+ echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
65
+ }
66
+
67
+ }
68
+
69
+ }
classes/widgets/class-pwb-filter-by-brand.php CHANGED
@@ -1,119 +1,119 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_Filter_By_Brand_Widget extends \WP_Widget {
7
-
8
- function __construct() {
9
- $params = array(
10
- 'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Filter products by brand', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
14
- }
15
-
16
- public function form( $instance ) {
17
- $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
18
- ?>
19
- <p>
20
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
21
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
22
- </p>
23
- <?php
24
- }
25
-
26
- public function widget( $args, $instance ) {
27
-
28
- $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
29
- $title = apply_filters( 'widget_title', $title );
30
-
31
- echo $args['before_widget'];
32
- if ( ! empty( $title ) )
33
- echo $args['before_title'] . $title . $args['after_title'];
34
- $this->render_widget();
35
- echo $args['after_widget'];
36
-
37
- }
38
-
39
- public function render_widget(){
40
-
41
- $brands = get_terms('pwb-brand',array(
42
- 'hide_empty' => false
43
- ));
44
- $brands_ids = array();
45
- foreach ($brands as $brand) {
46
- $brands_ids[] = $brand->term_id;
47
- }
48
-
49
- $cat = get_queried_object();
50
-
51
- if( is_product_category() ){
52
-
53
- $cat_id = $cat->term_taxonomy_id;
54
- $cat_id_array = get_term_children( $cat_id, 'product_cat' );
55
- $cat_id_array[] = $cat_id;
56
-
57
- $result_brands = array();
58
- $args = array(
59
- 'posts_per_page' => -1,
60
- 'post_type' => 'product',
61
- 'tax_query' => array(
62
- 'relation' => 'AND',
63
- array(
64
- 'taxonomy' => 'product_cat',
65
- 'field' => 'term_id',
66
- 'terms' => $cat_id_array
67
- ),
68
- array(
69
- 'taxonomy' => 'pwb-brand',
70
- 'field' => 'term_id',
71
- 'terms' => $brands_ids
72
- )
73
- )
74
- );
75
-
76
- $the_query = new \WP_Query($args);
77
- if ( $the_query->have_posts() ) {
78
- while ( $the_query->have_posts() ) {
79
- $the_query->the_post();
80
-
81
- $product_brands = wp_get_post_terms(get_the_ID(), 'pwb-brand');
82
-
83
- foreach ($product_brands as $brand) {
84
- $result_brands[] = $brand->term_id;
85
- }
86
-
87
- }
88
- } else {
89
- // no posts found
90
- }
91
- wp_reset_postdata();
92
-
93
- $cate = get_queried_object();
94
- $cateID = $cate->term_id;
95
- $cate_url = get_term_link($cateID);
96
-
97
- }else{
98
- //no product category
99
- $cate_url = get_permalink( wc_get_page_id( 'shop' ));
100
- shuffle($brands_ids);
101
- $result_brands = array_slice($brands_ids, 0, 20);
102
- }
103
-
104
- global $wp;
105
- $current_url = home_url(add_query_arg(array(),$wp->request));
106
-
107
- echo '<div class="pwb-filter-products" data-cat-url="'.$cate_url.'">';
108
- echo '<ul>';
109
- foreach (array_unique($result_brands) as $brand) {
110
- $term = get_term($brand);
111
- echo '<li><input type="checkbox" data-brand="'.$brand.'" value="'.$term->slug.'">' . $term->name . '</li>';
112
- }
113
- echo '</ul>';
114
- echo '<button>'.__('Apply filter','perfect-woocommerce-brands').'</button>';
115
- echo '</div>';
116
-
117
- }
118
-
119
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Filter_By_Brand_Widget extends \WP_Widget {
7
+
8
+ function __construct() {
9
+ $params = array(
10
+ 'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Filter products by brand', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
14
+ }
15
+
16
+ public function form( $instance ) {
17
+ $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
18
+ ?>
19
+ <p>
20
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
21
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
22
+ </p>
23
+ <?php
24
+ }
25
+
26
+ public function widget( $args, $instance ) {
27
+
28
+ $title = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : __('Brands', 'perfect-woocommerce-brands');
29
+ $title = apply_filters( 'widget_title', $title );
30
+
31
+ echo $args['before_widget'];
32
+ if ( ! empty( $title ) )
33
+ echo $args['before_title'] . $title . $args['after_title'];
34
+ $this->render_widget();
35
+ echo $args['after_widget'];
36
+
37
+ }
38
+
39
+ public function render_widget(){
40
+
41
+ $brands = get_terms('pwb-brand',array(
42
+ 'hide_empty' => false
43
+ ));
44
+ $brands_ids = array();
45
+ foreach ($brands as $brand) {
46
+ $brands_ids[] = $brand->term_id;
47
+ }
48
+
49
+ $cat = get_queried_object();
50
+
51
+ if( is_product_category() ){
52
+
53
+ $cat_id = $cat->term_taxonomy_id;
54
+ $cat_id_array = get_term_children( $cat_id, 'product_cat' );
55
+ $cat_id_array[] = $cat_id;
56
+
57
+ $result_brands = array();
58
+ $args = array(
59
+ 'posts_per_page' => -1,
60
+ 'post_type' => 'product',
61
+ 'tax_query' => array(
62
+ 'relation' => 'AND',
63
+ array(
64
+ 'taxonomy' => 'product_cat',
65
+ 'field' => 'term_id',
66
+ 'terms' => $cat_id_array
67
+ ),
68
+ array(
69
+ 'taxonomy' => 'pwb-brand',
70
+ 'field' => 'term_id',
71
+ 'terms' => $brands_ids
72
+ )
73
+ )
74
+ );
75
+
76
+ $the_query = new \WP_Query($args);
77
+ if ( $the_query->have_posts() ) {
78
+ while ( $the_query->have_posts() ) {
79
+ $the_query->the_post();
80
+
81
+ $product_brands = wp_get_post_terms(get_the_ID(), 'pwb-brand');
82
+
83
+ foreach ($product_brands as $brand) {
84
+ $result_brands[] = $brand->term_id;
85
+ }
86
+
87
+ }
88
+ } else {
89
+ // no posts found
90
+ }
91
+ wp_reset_postdata();
92
+
93
+ $cate = get_queried_object();
94
+ $cateID = $cate->term_id;
95
+ $cate_url = get_term_link($cateID);
96
+
97
+ }else{
98
+ //no product category
99
+ $cate_url = get_permalink( wc_get_page_id( 'shop' ));
100
+ shuffle($brands_ids);
101
+ $result_brands = array_slice($brands_ids, 0, 20);
102
+ }
103
+
104
+ global $wp;
105
+ $current_url = home_url(add_query_arg(array(),$wp->request));
106
+
107
+ echo '<div class="pwb-filter-products" data-cat-url="'.$cate_url.'">';
108
+ echo '<ul>';
109
+ foreach (array_unique($result_brands) as $brand) {
110
+ $term = get_term($brand);
111
+ echo '<li><input type="checkbox" data-brand="'.$brand.'" value="'.$term->slug.'">' . $term->name . '</li>';
112
+ }
113
+ echo '</ul>';
114
+ echo '<button>'.__('Apply filter','perfect-woocommerce-brands').'</button>';
115
+ echo '</div>';
116
+
117
+ }
118
+
119
+ }
classes/widgets/class-pwb-list.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
- namespace Perfect_Woocommerce_Brands\Widgets;
3
-
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
-
6
- class PWB_List_Widget extends \WP_Widget {
7
-
8
- function __construct(){
9
- $params = array(
10
- 'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
- 'name' => 'PWB: '.__( 'Brands list', 'perfect-woocommerce-brands' )
12
- );
13
- parent::__construct('PWB_List_Widget', '', $params);
14
- }
15
-
16
- public function form($instance){
17
- extract($instance);
18
-
19
- if( !isset( $display_as ) ) $display_as = 'brand_logo';
20
- if( !isset( $columns ) ) $columns = '2';
21
- ?>
22
-
23
- <p>
24
- <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
25
- <input
26
- class="widefat"
27
- type="text"
28
- id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
29
- name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
30
- value="<?php if(isset($title)) echo esc_attr($title); ?>">
31
- </p>
32
- <p>
33
- <label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
34
- <select
35
- class="widefat pwb-select-display-as"
36
- id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
37
- name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
38
- <option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
39
- <option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
40
- </select>
41
- </p>
42
- <div class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
43
- <p>
44
- <label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
45
- <select
46
- class="widefat"
47
- id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
48
- name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
49
- <option value="1" <?php selected( $columns, '1' ); ?>>1</option>
50
- <option value="2" <?php selected( $columns, '2' ); ?>>2</option>
51
- <option value="3" <?php selected( $columns, '3' ); ?>>3</option>
52
- <option value="4" <?php selected( $columns, '4' ); ?>>4</option>
53
- </select>
54
- </p>
55
- </div>
56
-
57
- <?php
58
-
59
- }
60
-
61
- public function widget($args, $instance){
62
- extract( $args );
63
- extract( $instance );
64
-
65
- echo $before_widget;
66
-
67
- if( !empty( $title ) ){
68
- echo $before_title . $title . $after_title;
69
- }
70
-
71
- if( !isset( $display_as ) ) $display_as = 'brand_logo';
72
- if( !isset( $columns ) ) $columns = '2';
73
- PWB_List_Widget::get_brands( $display_as, $columns );
74
-
75
- echo $after_widget;
76
-
77
- }
78
-
79
- private static function get_brands( $display_as, $columns ){
80
-
81
- $brands = get_terms('pwb-brand',array(
82
- 'hide_empty' => false
83
- ));
84
-
85
- if(is_array($brands) && count($brands)>0){
86
- echo '<ul class="pwb-row">';
87
- foreach ($brands as $brand) {
88
- $brand_name = $brand->name;
89
- $brand_link = get_term_link( $brand->term_id );
90
-
91
- $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
92
- $brand_logo = wp_get_attachment_image( $attachment_id, 'full' );
93
-
94
- $li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
95
- echo '<li class="'. $li_class .'">';
96
- if( $display_as == 'brand_logo' && !empty( $brand_logo ) ){
97
- echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand_logo.'</a>';
98
- }else{
99
- echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand->name.'</a>';
100
- }
101
- echo '</li>';
102
- }
103
- echo '</ul>';
104
- }else{
105
- echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
106
- }
107
-
108
- }
109
-
110
- }
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_List_Widget extends \WP_Widget {
7
+
8
+ function __construct(){
9
+ $params = array(
10
+ 'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
+ 'name' => 'PWB: '.__( 'Brands list', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_List_Widget', '', $params);
14
+ }
15
+
16
+ public function form($instance){
17
+ extract($instance);
18
+
19
+ if( !isset( $display_as ) ) $display_as = 'brand_logo';
20
+ if( !isset( $columns ) ) $columns = '2';
21
+ ?>
22
+
23
+ <p>
24
+ <label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>"><?php echo __( 'Title:', 'perfect-woocommerce-brands' );?></label>
25
+ <input
26
+ class="widefat"
27
+ type="text"
28
+ id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
29
+ name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
30
+ value="<?php if(isset($title)) echo esc_attr($title); ?>">
31
+ </p>
32
+ <p>
33
+ <label for="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"><?php echo __( 'Display as:', 'perfect-woocommerce-brands' );?></label>
34
+ <select
35
+ class="widefat pwb-select-display-as"
36
+ id="<?php echo esc_attr( $this->get_field_id('display_as') ); ?>"
37
+ name="<?php echo esc_attr( $this->get_field_name('display_as') ); ?>">
38
+ <option value="brand_name" <?php selected( $display_as, 'brand_name' ); ?>><?php _e( 'Brand name', 'perfect-woocommerce-brands' );?></option>
39
+ <option value="brand_logo" <?php selected( $display_as, 'brand_logo' ); ?>><?php _e( 'Brand logo', 'perfect-woocommerce-brands' );?></option>
40
+ </select>
41
+ </p>
42
+ <div class="pwb-display-as-logo<?php echo ($display_as=='brand_logo') ? ' show' : '' ;?>">
43
+ <p>
44
+ <label for="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"><?php echo __( 'Columns:', 'perfect-woocommerce-brands' );?></label>
45
+ <select
46
+ class="widefat"
47
+ id="<?php echo esc_attr( $this->get_field_id('columns') ); ?>"
48
+ name="<?php echo esc_attr( $this->get_field_name('columns') ); ?>">
49
+ <option value="1" <?php selected( $columns, '1' ); ?>>1</option>
50
+ <option value="2" <?php selected( $columns, '2' ); ?>>2</option>
51
+ <option value="3" <?php selected( $columns, '3' ); ?>>3</option>
52
+ <option value="4" <?php selected( $columns, '4' ); ?>>4</option>
53
+ </select>
54
+ </p>
55
+ </div>
56
+
57
+ <?php
58
+
59
+ }
60
+
61
+ public function widget($args, $instance){
62
+ extract( $args );
63
+ extract( $instance );
64
+
65
+ echo $before_widget;
66
+
67
+ if( !empty( $title ) ){
68
+ echo $before_title . $title . $after_title;
69
+ }
70
+
71
+ if( !isset( $display_as ) ) $display_as = 'brand_logo';
72
+ if( !isset( $columns ) ) $columns = '2';
73
+ PWB_List_Widget::get_brands( $display_as, $columns );
74
+
75
+ echo $after_widget;
76
+
77
+ }
78
+
79
+ private static function get_brands( $display_as, $columns ){
80
+
81
+ $brands = get_terms('pwb-brand',array(
82
+ 'hide_empty' => false
83
+ ));
84
+
85
+ if(is_array($brands) && count($brands)>0){
86
+ echo '<ul class="pwb-row">';
87
+ foreach ($brands as $brand) {
88
+ $brand_name = $brand->name;
89
+ $brand_link = get_term_link( $brand->term_id );
90
+
91
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
92
+ $brand_logo = wp_get_attachment_image( $attachment_id, 'full' );
93
+
94
+ $li_class = ( $display_as == 'brand_logo' ) ? "pwb-columns pwb-columns-".$columns : "";
95
+ echo '<li class="'. $li_class .'">';
96
+ if( $display_as == 'brand_logo' && !empty( $brand_logo ) ){
97
+ echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand_logo.'</a>';
98
+ }else{
99
+ echo '<a href="'.$brand_link.'" title="'.__( 'Go to', 'perfect-woocommerce-brands' ).' '.$brand->name.'">'.$brand->name.'</a>';
100
+ }
101
+ echo '</li>';
102
+ }
103
+ echo '</ul>';
104
+ }else{
105
+ echo __( 'There is not available brands', 'perfect-woocommerce-brands' );
106
+ }
107
+
108
+ }
109
+
110
+ }
lang/perfect-woocommerce-brands-es_ES.mo CHANGED
Binary file
lang/perfect-woocommerce-brands-es_ES.po CHANGED
@@ -1,662 +1,670 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Perfect WooCommerce Brands\n"
4
- "POT-Creation-Date: 2017-06-28 20:51+0200\n"
5
- "PO-Revision-Date: 2017-06-28 20:53+0200\n"
6
- "Last-Translator: \n"
7
- "Language-Team: \n"
8
- "Language: es_ES\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Generator: Poedit 2.0.1\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-WPHeader: main.php\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
-
23
- #: classes/admin/class-pwb-admin-tab.php:21
24
- #: classes/class-perfect-woocommerce-brands.php:563
25
- #: classes/class-perfect-woocommerce-brands.php:565
26
- #: classes/widgets/class-pwb-dropdown.php:56
27
- #: classes/widgets/class-pwb-filter-by-brand.php:17
28
- #: classes/widgets/class-pwb-filter-by-brand.php:28
29
- msgid "Brands"
30
- msgstr "Marcas"
31
-
32
- #: classes/admin/class-pwb-admin-tab.php:72
33
- msgid "Brands settings"
34
- msgstr "Ajustes de las marcas"
35
-
36
- #: classes/admin/class-pwb-admin-tab.php:78
37
- msgid "Slug"
38
- msgstr "Slug"
39
-
40
- #: classes/admin/class-pwb-admin-tab.php:81
41
- msgid "Brands taxonomy slug"
42
- msgstr "Slug de la taxonomía marcas"
43
-
44
- #: classes/admin/class-pwb-admin-tab.php:86
45
- msgid "Show brand description"
46
- msgstr "Mostrar descripción de la marca"
47
-
48
- #: classes/admin/class-pwb-admin-tab.php:89
49
- msgid "Show brand description (if is set) on brand archive page"
50
- msgstr "Mostrar descripción de la marca en la página de archivo"
51
-
52
- #: classes/admin/class-pwb-admin-tab.php:93
53
- msgid "Show brands in loop"
54
- msgstr "Mostrar marcas en el loop"
55
-
56
- #: classes/admin/class-pwb-admin-tab.php:96
57
- msgid "Show brand logo (or name) in product loop"
58
- msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
59
-
60
- #: classes/admin/class-pwb-admin-tab.php:99
61
- #: classes/admin/class-pwb-admin-tab.php:112
62
- msgid "No"
63
- msgstr "No"
64
-
65
- #: classes/admin/class-pwb-admin-tab.php:100
66
- #: classes/admin/class-pwb-admin-tab.php:113
67
- msgid "Show brand link"
68
- msgstr "Mostrar el link de la marca"
69
-
70
- #: classes/admin/class-pwb-admin-tab.php:101
71
- #: classes/admin/class-pwb-admin-tab.php:114
72
- msgid "Show brand image (if is set)"
73
- msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
74
-
75
- #: classes/admin/class-pwb-admin-tab.php:105
76
- msgid "Show brands in single product"
77
- msgstr "Mostrar marcas en la página del producto"
78
-
79
- #: classes/admin/class-pwb-admin-tab.php:108
80
- msgid "Show brand logo (or name) in single product"
81
- msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
82
-
83
- #: classes/admin/class-pwb-admin-tab.php:118
84
- #: classes/class-perfect-woocommerce-brands.php:343
85
- #: classes/class-perfect-woocommerce-brands.php:371
86
- #: classes/class-perfect-woocommerce-brands.php:441
87
- msgid "Brand logo size"
88
- msgstr "Tamaño del logo de la marca"
89
-
90
- #: classes/admin/class-pwb-admin-tab.php:121
91
- msgid "Brand logo size for single product view"
92
- msgstr "Tamaño del logo para la vista individual de producto"
93
-
94
- #: classes/admin/class-pwb-admin-tab.php:126
95
- msgid "Brand position"
96
- msgstr "Posición de la marca"
97
-
98
- #: classes/admin/class-pwb-admin-tab.php:129
99
- msgid "For single product"
100
- msgstr "En la página individual de cada producto"
101
-
102
- #: classes/admin/class-pwb-admin-tab.php:132
103
- msgid "Before title"
104
- msgstr "Antes del título"
105
-
106
- #: classes/admin/class-pwb-admin-tab.php:133
107
- msgid "After title"
108
- msgstr "Después del título"
109
-
110
- #: classes/admin/class-pwb-admin-tab.php:134
111
- msgid "After price"
112
- msgstr "Después del precio"
113
-
114
- #: classes/admin/class-pwb-admin-tab.php:135
115
- msgid "After excerpt"
116
- msgstr "Después de la descripción corta"
117
-
118
- #: classes/admin/class-pwb-admin-tab.php:136
119
- msgid "After add to cart"
120
- msgstr "Después del botón de comprar"
121
-
122
- #: classes/admin/class-pwb-admin-tab.php:137
123
- msgid "After meta"
124
- msgstr "Después del meta"
125
-
126
- #: classes/admin/class-pwb-admin-tab.php:138
127
- msgid "After sharing"
128
- msgstr "Después de compartir"
129
-
130
- #: classes/admin/class-pwb-admin-tab.php:155
131
- msgid "Tools"
132
- msgstr "Herramientas"
133
-
134
- #: classes/admin/class-pwb-admin-tab.php:161
135
- msgid "Import brands"
136
- msgstr "Importar marcas"
137
-
138
- #: classes/admin/class-pwb-admin-tab.php:165
139
- #, php-format
140
- msgid ""
141
- "Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
142
- "\">Click here for more details</a>"
143
- msgstr ""
144
- "Importar marcas de producto de otro plugin de marcas. <a href=\"%s\" target="
145
- "\"_blank\">Pulsa aquí para ver la documentación</a>"
146
-
147
- #: classes/admin/class-pwb-admin-tab.php:170
148
- #: classes/admin/class-pwb-admin-tab.php:182
149
- msgid "-"
150
- msgstr "-"
151
-
152
- #: classes/admin/class-pwb-admin-tab.php:171
153
- msgid "YITH WooCommerce Brands Add-On"
154
- msgstr "YITH WooCommerce Brands Add-On"
155
-
156
- #: classes/admin/class-pwb-admin-tab.php:172
157
- msgid "Ultimate WooCommerce Brands"
158
- msgstr "Ultimate WooCommerce Brands"
159
-
160
- #: classes/admin/class-pwb-admin-tab.php:176
161
- msgid "Dummy data"
162
- msgstr "Datos ficticios"
163
-
164
- #: classes/admin/class-pwb-admin-tab.php:179
165
- msgid "Import generic brands and assign it to products randomly"
166
- msgstr ""
167
- "Importar marcas genéricas y asignarlas a los productos existentes de forma "
168
- "aleatoria"
169
-
170
- #: classes/admin/class-pwb-admin-tab.php:183
171
- msgid "Start import"
172
- msgstr "Comenzar importación"
173
-
174
- #: classes/admin/class-pwb-admin-tab.php:187
175
- msgid "System status"
176
- msgstr "Estado del sistema"
177
-
178
- #: classes/admin/class-pwb-admin-tab.php:189
179
- msgid "Show system status"
180
- msgstr "Ver estado del sistema"
181
-
182
- #: classes/admin/class-pwb-coupon.php:22
183
- msgid "Brands restriction"
184
- msgstr "Restricciones de marca"
185
-
186
- #: classes/admin/class-pwb-coupon.php:23
187
- msgid "Any brand"
188
- msgstr "Cualquier marca"
189
-
190
- #: classes/admin/class-pwb-coupon.php:32
191
- msgid ""
192
- "Coupon will be valid if there are at least one product of this brands in the "
193
- "cart"
194
- msgstr ""
195
- "El cupón será válido si existe al menos un producto de la marca señalada en "
196
- "el carrito"
197
-
198
- #: classes/class-perfect-woocommerce-brands.php:47
199
- msgid ""
200
- "We are offering you maybe the best WooCommerce brands plugin completely "
201
- "free. You can help us making Perfect WooCommerce Brands a bit better. Thanks!"
202
- msgstr ""
203
- "Estamos ofreciendo de forma completamente gratuita el que probablemente sea "
204
- "el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
205
- "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
206
-
207
- #: classes/class-perfect-woocommerce-brands.php:49
208
- msgid ""
209
- "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
210
- "reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
211
- msgstr ""
212
- "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
213
- "reviews/?rate=5#new-post\" target=\"_blank\">Dejar una review</a>"
214
-
215
- #: classes/class-perfect-woocommerce-brands.php:50
216
- msgid ""
217
- "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
218
- "woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
219
- msgstr ""
220
- "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
221
- "woocommerce-brands\" target=\"_blank\">Traducir el plugin</a>"
222
-
223
- #: classes/class-perfect-woocommerce-brands.php:51
224
- msgid ""
225
- "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
226
- "\"_blank\">View on GitHub</a>"
227
- msgstr ""
228
- "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
229
- "\"_blank\">Ver en GitHub</a>"
230
-
231
- #: classes/class-perfect-woocommerce-brands.php:74
232
- msgid "Settings"
233
- msgstr "Ajustes"
234
-
235
- #: classes/class-perfect-woocommerce-brands.php:240
236
- msgid "PWB Product carousel"
237
- msgstr "PWB Carrusel de productos"
238
-
239
- #: classes/class-perfect-woocommerce-brands.php:241
240
- msgid "Product carousel by brand or by category"
241
- msgstr "Carrusel de productos por marca o categoría"
242
-
243
- #: classes/class-perfect-woocommerce-brands.php:249
244
- #: classes/class-perfect-woocommerce-brands.php:564
245
- msgid "Brand"
246
- msgstr "Marca"
247
-
248
- #: classes/class-perfect-woocommerce-brands.php:257
249
- msgid "Products"
250
- msgstr "Productos"
251
-
252
- #: classes/class-perfect-woocommerce-brands.php:260
253
- msgid "Number of products to load"
254
- msgstr "Número de productos que cargar"
255
-
256
- #: classes/class-perfect-woocommerce-brands.php:265
257
- msgid "Products to show"
258
- msgstr "Productos a mostrar"
259
-
260
- #: classes/class-perfect-woocommerce-brands.php:268
261
- msgid "Number of products to show"
262
- msgstr "Número de productos que mostrar"
263
-
264
- #: classes/class-perfect-woocommerce-brands.php:273
265
- msgid "Products to scroll"
266
- msgstr "Número de productos por scroll"
267
-
268
- #: classes/class-perfect-woocommerce-brands.php:276
269
- msgid "Number of products to scroll"
270
- msgstr "Número de productos por cada scroll"
271
-
272
- #: classes/class-perfect-woocommerce-brands.php:281
273
- #: classes/class-perfect-woocommerce-brands.php:330
274
- msgid "Autoplay"
275
- msgstr "Modo automático"
276
-
277
- #: classes/class-perfect-woocommerce-brands.php:283
278
- #: classes/class-perfect-woocommerce-brands.php:332
279
- msgid "Autoplay carousel"
280
- msgstr "Modo automático para el carrusel"
281
-
282
- #: classes/class-perfect-woocommerce-brands.php:288
283
- #: classes/class-perfect-woocommerce-brands.php:337
284
- msgid "Arrows"
285
- msgstr "Flechas de navegación"
286
-
287
- #: classes/class-perfect-woocommerce-brands.php:290
288
- #: classes/class-perfect-woocommerce-brands.php:339
289
- msgid "Display prev and next arrows"
290
- msgstr "Mostrar flechas de navegación"
291
-
292
- #: classes/class-perfect-woocommerce-brands.php:296
293
- msgid "PWB Brands carousel"
294
- msgstr "PWB Carrusel de marcas"
295
-
296
- #: classes/class-perfect-woocommerce-brands.php:297
297
- msgid "Brands carousel"
298
- msgstr "Carrusel de marcas"
299
-
300
- #: classes/class-perfect-woocommerce-brands.php:306
301
- msgid "Items"
302
- msgstr "Elementos"
303
-
304
- #: classes/class-perfect-woocommerce-brands.php:309
305
- msgid "Number of items to load"
306
- msgstr "Número de elementos que cargar"
307
-
308
- #: classes/class-perfect-woocommerce-brands.php:314
309
- msgid "Items to show"
310
- msgstr "Elementos a mostrar"
311
-
312
- #: classes/class-perfect-woocommerce-brands.php:317
313
- msgid "Number of items to show"
314
- msgstr "Número de elementos a mostrar"
315
-
316
- #: classes/class-perfect-woocommerce-brands.php:322
317
- msgid "Items to scroll"
318
- msgstr "Número de elementos por scroll"
319
-
320
- #: classes/class-perfect-woocommerce-brands.php:325
321
- msgid "Number of items to scroll"
322
- msgstr "Número de elementos por cada scroll"
323
-
324
- #: classes/class-perfect-woocommerce-brands.php:354
325
- msgid "PWB All brands"
326
- msgstr "PWB Todas las marcas"
327
-
328
- #: classes/class-perfect-woocommerce-brands.php:355
329
- msgid "Show all brands"
330
- msgstr "Mostrar todas las marcas"
331
-
332
- #: classes/class-perfect-woocommerce-brands.php:364
333
- msgid "Brands per page"
334
- msgstr "Marcas por página"
335
-
336
- #: classes/class-perfect-woocommerce-brands.php:367
337
- msgid "Show x brands per page"
338
- msgstr "Mostrar x marcas por página"
339
-
340
- #: classes/class-perfect-woocommerce-brands.php:378
341
- msgid "Order by"
342
- msgstr "Ordenar por"
343
-
344
- #: classes/class-perfect-woocommerce-brands.php:392
345
- msgid "Order"
346
- msgstr "Orden"
347
-
348
- #: classes/class-perfect-woocommerce-brands.php:402
349
- msgid "Title position"
350
- msgstr "Posición del título"
351
-
352
- #: classes/class-perfect-woocommerce-brands.php:406
353
- msgid "Before image"
354
- msgstr "Antes de la imagen"
355
-
356
- #: classes/class-perfect-woocommerce-brands.php:407
357
- msgid "After image"
358
- msgstr "Después de la imagen"
359
-
360
- #: classes/class-perfect-woocommerce-brands.php:413
361
- msgid "Hide empty"
362
- msgstr "Ocultar vacías"
363
-
364
- #: classes/class-perfect-woocommerce-brands.php:415
365
- msgid "Hide brands that have not been assigned to any product"
366
- msgstr "Ocultar marcas que no han sido asignadas a ningún producto"
367
-
368
- #: classes/class-perfect-woocommerce-brands.php:423
369
- msgid "PWB brand"
370
- msgstr "PWB Marca"
371
-
372
- #: classes/class-perfect-woocommerce-brands.php:424
373
- msgid "Show brand for a specific product"
374
- msgstr "Ver marcas de un producto específico"
375
-
376
- #: classes/class-perfect-woocommerce-brands.php:434
377
- msgid "Product id"
378
- msgstr "Id del producto"
379
-
380
- #: classes/class-perfect-woocommerce-brands.php:437
381
- msgid "Product id (post id)"
382
- msgstr "Id del producto (id del post)"
383
-
384
- #: classes/class-perfect-woocommerce-brands.php:480
385
- #: classes/class-perfect-woocommerce-brands.php:482
386
- #: classes/shortcodes/class-pwb-all-brands.php:90
387
- #: classes/shortcodes/class-pwb-brand.php:29
388
- #: classes/shortcodes/class-pwb-brand.php:31
389
- #: classes/shortcodes/class-pwb-carousel.php:50
390
- msgid "View brand"
391
- msgstr "Ver marca"
392
-
393
- #: classes/class-perfect-woocommerce-brands.php:552
394
- msgid "¿Start migration?"
395
- msgstr "¿Comenzar la migración?"
396
-
397
- #: classes/class-perfect-woocommerce-brands.php:553
398
- msgid ""
399
- "We are migrating the product brands. ¡Don´t close this window until the "
400
- "process is finished!"
401
- msgstr ""
402
- "Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
403
- "el proceso finalice!"
404
-
405
- #: classes/class-perfect-woocommerce-brands.php:554
406
- msgid "¿Start loading dummy data?"
407
- msgstr "¿Comenzar con la importación?"
408
-
409
- #: classes/class-perfect-woocommerce-brands.php:555
410
- msgid ""
411
- "We are importing the dummy data. ¡Don´t close this window until the process "
412
- "is finished!"
413
- msgstr ""
414
- "En este momento estamos importando las marcas ficticias. ¡No cierre esta "
415
- "ventana hasta que termine el proceso!"
416
-
417
- #: classes/class-perfect-woocommerce-brands.php:566
418
- msgid "All Brands"
419
- msgstr "Todas las marcas"
420
-
421
- #: classes/class-perfect-woocommerce-brands.php:567
422
- msgid "Edit Brand"
423
- msgstr "Editar marca"
424
-
425
- #: classes/class-perfect-woocommerce-brands.php:568
426
- msgid "View Brand"
427
- msgstr "Ver marca"
428
-
429
- #: classes/class-perfect-woocommerce-brands.php:569
430
- msgid "Update Brand"
431
- msgstr "Actualizar marca"
432
-
433
- #: classes/class-perfect-woocommerce-brands.php:570
434
- msgid "Add New Brand"
435
- msgstr "Añadir nueva marca"
436
-
437
- #: classes/class-perfect-woocommerce-brands.php:571
438
- msgid "New Brand Name"
439
- msgstr "Nuevo nombre de marca"
440
-
441
- #: classes/class-perfect-woocommerce-brands.php:572
442
- msgid "Parent Brand"
443
- msgstr "Marca Padre"
444
-
445
- #: classes/class-perfect-woocommerce-brands.php:573
446
- msgid "Parent Brand:"
447
- msgstr "Marca Padre:"
448
-
449
- #: classes/class-perfect-woocommerce-brands.php:574
450
- msgid "Search Brands"
451
- msgstr "Buscar Marcas"
452
-
453
- #: classes/class-perfect-woocommerce-brands.php:575
454
- msgid "Popular Brands"
455
- msgstr "Marcas Populares"
456
-
457
- #: classes/class-perfect-woocommerce-brands.php:576
458
- msgid "Separate brands with commas"
459
- msgstr "Separar marcas con comas"
460
-
461
- #: classes/class-perfect-woocommerce-brands.php:577
462
- msgid "Add or remove brands"
463
- msgstr "Añadir o eliminar marcas"
464
-
465
- #: classes/class-perfect-woocommerce-brands.php:578
466
- msgid "Choose from the most used brands"
467
- msgstr "Seleccionar de las marcas más utilizadas"
468
-
469
- #: classes/class-perfect-woocommerce-brands.php:579
470
- msgid "No brands found"
471
- msgstr "No se han encontrado marcas"
472
-
473
- #: classes/class-perfect-woocommerce-brands.php:623
474
- #: classes/class-perfect-woocommerce-brands.php:656
475
- #: classes/widgets/class-pwb-list.php:39
476
- msgid "Brand logo"
477
- msgstr "Logo de la marca"
478
-
479
- #: classes/class-perfect-woocommerce-brands.php:625
480
- #: classes/class-perfect-woocommerce-brands.php:631
481
- #: classes/class-perfect-woocommerce-brands.php:660
482
- #: classes/class-perfect-woocommerce-brands.php:680
483
- msgid "Select image"
484
- msgstr "Seleccionar imagen"
485
-
486
- #: classes/class-perfect-woocommerce-brands.php:629
487
- #: classes/class-perfect-woocommerce-brands.php:676
488
- msgid "Brand banner"
489
- msgstr "Banner de la marca"
490
-
491
- #: classes/class-perfect-woocommerce-brands.php:632
492
- msgid "This image will be shown on brand page"
493
- msgstr "Esta imagen se mostrará en la página de la marca"
494
-
495
- #: classes/class-perfect-woocommerce-brands.php:636
496
- #: classes/class-perfect-woocommerce-brands.php:696
497
- msgid "Brand banner link"
498
- msgstr "Enlace para el banner de la marca"
499
-
500
- #: classes/class-perfect-woocommerce-brands.php:638
501
- #: classes/class-perfect-woocommerce-brands.php:700
502
- msgid "This link should be relative to site url. Example: product/product-name"
503
- msgstr ""
504
- "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
505
- "nombre-del-producto"
506
-
507
- #: classes/class-perfect-woocommerce-brands.php:754
508
- msgid "Logo"
509
- msgstr "Logo"
510
-
511
- #: classes/class-perfect-woocommerce-brands.php:794
512
- msgid "All"
513
- msgstr "Todas"
514
-
515
- #: classes/class-perfect-woocommerce-brands.php:849
516
- msgid "No products found"
517
- msgstr "No se han encontrado productos"
518
-
519
- #: classes/class-pwb-api-support.php:46
520
- msgid "Product brands"
521
- msgstr "Marcas del producto"
522
-
523
- #: classes/shortcodes/class-pwb-all-brands.php:111
524
- msgid "First page"
525
- msgstr "Primera página"
526
-
527
- #: classes/shortcodes/class-pwb-all-brands.php:114
528
- msgid "Previous page"
529
- msgstr "Página anterior"
530
-
531
- #: classes/shortcodes/class-pwb-all-brands.php:118
532
- msgid "Next page"
533
- msgstr "Siguiente página"
534
-
535
- #: classes/shortcodes/class-pwb-all-brands.php:121
536
- msgid "Last page"
537
- msgstr "Última página"
538
-
539
- #: classes/shortcodes/class-pwb-all-brands.php:126
540
- msgid "No results"
541
- msgstr "No se han encontrado resultados"
542
-
543
- #: classes/widgets/class-pwb-dropdown.php:10
544
- msgid "Adds a brands dropdown to your site"
545
- msgstr "Añade un desplegable con las marcas a tu sitio"
546
-
547
- #: classes/widgets/class-pwb-dropdown.php:11
548
- msgid "Brands dropdown"
549
- msgstr "Desplegable de marcas"
550
-
551
- #: classes/widgets/class-pwb-dropdown.php:21
552
- msgid "Title"
553
- msgstr "Título"
554
-
555
- #: classes/widgets/class-pwb-dropdown.php:64
556
- #: classes/widgets/class-pwb-list.php:105
557
- msgid "There is not available brands"
558
- msgstr "No se encuentran marcas disponibles"
559
-
560
- #: classes/widgets/class-pwb-filter-by-brand.php:10
561
- msgid "Recommended for product categories or shop page"
562
- msgstr "Recomendado para las categorías de producto y la página de la tienda"
563
-
564
- #: classes/widgets/class-pwb-filter-by-brand.php:11
565
- msgid "Filter products by brand"
566
- msgstr "Filtrar productos por marca"
567
-
568
- #: classes/widgets/class-pwb-filter-by-brand.php:20
569
- #: classes/widgets/class-pwb-list.php:24
570
- msgid "Title:"
571
- msgstr "Título:"
572
-
573
- #: classes/widgets/class-pwb-filter-by-brand.php:114
574
- msgid "Apply filter"
575
- msgstr "Filtrar"
576
-
577
- #: classes/widgets/class-pwb-list.php:10
578
- msgid "Adds a brands list to your site"
579
- msgstr "Añade una lista de marcas a tu sitio"
580
-
581
- #: classes/widgets/class-pwb-list.php:11
582
- msgid "Brands list"
583
- msgstr "Lista de marcas"
584
-
585
- #: classes/widgets/class-pwb-list.php:33
586
- msgid "Display as:"
587
- msgstr "Mostrar como:"
588
-
589
- #: classes/widgets/class-pwb-list.php:38
590
- msgid "Brand name"
591
- msgstr "Nombre de la marca"
592
-
593
- #: classes/widgets/class-pwb-list.php:44
594
- msgid "Columns:"
595
- msgstr "Columnas:"
596
-
597
- #: classes/widgets/class-pwb-list.php:97 classes/widgets/class-pwb-list.php:99
598
- msgid "Go to"
599
- msgstr "Ir a"
600
-
601
- #: main.php:87
602
- msgid ""
603
- "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
604
- "active WooCommerce plugin."
605
- msgstr ""
606
- "Perfect WooCommerce Brands necesita WooCommerce para funcionar. Por favor, "
607
- "instala y activa WooCommerce."
608
-
609
- #. Plugin Name of the plugin/theme
610
- msgid "Perfect WooCommerce Brands"
611
- msgstr "Perfect WooCommerce Brands"
612
-
613
- #. Plugin URI of the plugin/theme
614
- msgid "https://wordpress.org/plugins/perfect-woocommerce-brands/"
615
- msgstr "https://wordpress.org/plugins/perfect-woocommerce-brands/"
616
-
617
- #. Description of the plugin/theme
618
- msgid ""
619
- "Perfect WooCommerce Brands allows you to show product brands in your "
620
- "WooCommerce based store."
621
- msgstr ""
622
- "Perfect WooCommerce Brands te permite trabajar con marcas de producto en tu "
623
- "tienda online basada en WooCommerce."
624
-
625
- #. Author of the plugin/theme
626
- msgid "Alberto de Vera Sevilla"
627
- msgstr "Alberto de Vera Sevilla"
628
-
629
- #. Author URI of the plugin/theme
630
- msgid "https://profiles.wordpress.org/titodevera/"
631
- msgstr "https://profiles.wordpress.org/titodevera/"
632
-
633
- #~ msgid ""
634
- #~ "Import brands from other brand plugin. <strong>Both plugins should be "
635
- #~ "installed and active</strong>"
636
- #~ msgstr ""
637
- #~ "Importar marcas de otro plugin. <strong>Ambos plugins han de encontrarse "
638
- #~ "instalados y activados</strong>"
639
-
640
- #~ msgid ""
641
- #~ "We are offering you maybe the best WooCommerce brands plugin completly "
642
- #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
643
- #~ "Thanks!"
644
- #~ msgstr ""
645
- #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
646
- #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
647
- #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
648
-
649
- #~ msgid "Import brands from old plugin installation"
650
- #~ msgstr "Importar marcas de otro plugin"
651
-
652
- #~ msgid "Brands metabox"
653
- #~ msgstr "Marcas metabox"
654
-
655
- #~ msgid "image for this brand"
656
- #~ msgstr "imagen para esta marca"
657
-
658
- #~ msgid "Select an image"
659
- #~ msgstr "Seleccione una imagen"
660
-
661
- #~ msgid "Show a specific brand"
662
- #~ msgstr "Mostrar marcas de un producto en concreto"
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Perfect WooCommerce Brands\n"
4
+ "POT-Creation-Date: 2017-07-24 23:20+0200\n"
5
+ "PO-Revision-Date: 2017-07-24 23:20+0200\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: es_ES\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Generator: Poedit 2.0.1\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: main.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
22
+
23
+ #: classes/admin/class-pwb-admin-tab.php:21
24
+ #: classes/class-perfect-woocommerce-brands.php:559
25
+ #: classes/class-perfect-woocommerce-brands.php:561
26
+ #: classes/widgets/class-pwb-dropdown.php:56
27
+ #: classes/widgets/class-pwb-filter-by-brand.php:17
28
+ #: classes/widgets/class-pwb-filter-by-brand.php:28
29
+ msgid "Brands"
30
+ msgstr "Marcas"
31
+
32
+ #: classes/admin/class-pwb-admin-tab.php:72
33
+ msgid "Brands settings"
34
+ msgstr "Ajustes de las marcas"
35
+
36
+ #: classes/admin/class-pwb-admin-tab.php:78
37
+ msgid "Slug"
38
+ msgstr "Slug"
39
+
40
+ #: classes/admin/class-pwb-admin-tab.php:81
41
+ msgid "Brands taxonomy slug"
42
+ msgstr "Slug de la taxonomía marcas"
43
+
44
+ #: classes/admin/class-pwb-admin-tab.php:86
45
+ msgid "Show brand description"
46
+ msgstr "Mostrar descripción de la marca"
47
+
48
+ #: classes/admin/class-pwb-admin-tab.php:89
49
+ msgid "Show brand description (if is set) on brand archive page"
50
+ msgstr "Mostrar descripción de la marca en la página de archivo"
51
+
52
+ #: classes/admin/class-pwb-admin-tab.php:93
53
+ msgid "Show brands in loop"
54
+ msgstr "Mostrar marcas en el loop"
55
+
56
+ #: classes/admin/class-pwb-admin-tab.php:96
57
+ msgid "Show brand logo (or name) in product loop"
58
+ msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
59
+
60
+ #: classes/admin/class-pwb-admin-tab.php:99
61
+ #: classes/admin/class-pwb-admin-tab.php:112
62
+ msgid "No"
63
+ msgstr "No"
64
+
65
+ #: classes/admin/class-pwb-admin-tab.php:100
66
+ #: classes/admin/class-pwb-admin-tab.php:113
67
+ msgid "Show brand link"
68
+ msgstr "Mostrar el link de la marca"
69
+
70
+ #: classes/admin/class-pwb-admin-tab.php:101
71
+ #: classes/admin/class-pwb-admin-tab.php:114
72
+ msgid "Show brand image (if is set)"
73
+ msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
74
+
75
+ #: classes/admin/class-pwb-admin-tab.php:105
76
+ msgid "Show brands in single product"
77
+ msgstr "Mostrar marcas en la página del producto"
78
+
79
+ #: classes/admin/class-pwb-admin-tab.php:108
80
+ msgid "Show brand logo (or name) in single product"
81
+ msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
82
+
83
+ #: classes/admin/class-pwb-admin-tab.php:118
84
+ #: classes/class-perfect-woocommerce-brands.php:339
85
+ #: classes/class-perfect-woocommerce-brands.php:367
86
+ #: classes/class-perfect-woocommerce-brands.php:437
87
+ msgid "Brand logo size"
88
+ msgstr "Tamaño del logo de la marca"
89
+
90
+ #: classes/admin/class-pwb-admin-tab.php:121
91
+ msgid "Brand logo size for single product view"
92
+ msgstr "Tamaño del logo para la vista individual de producto"
93
+
94
+ #: classes/admin/class-pwb-admin-tab.php:126
95
+ msgid "Brand position"
96
+ msgstr "Posición de la marca"
97
+
98
+ #: classes/admin/class-pwb-admin-tab.php:129
99
+ msgid "For single product"
100
+ msgstr "En la página individual de cada producto"
101
+
102
+ #: classes/admin/class-pwb-admin-tab.php:132
103
+ msgid "Before title"
104
+ msgstr "Antes del título"
105
+
106
+ #: classes/admin/class-pwb-admin-tab.php:133
107
+ msgid "After title"
108
+ msgstr "Después del título"
109
+
110
+ #: classes/admin/class-pwb-admin-tab.php:134
111
+ msgid "After price"
112
+ msgstr "Después del precio"
113
+
114
+ #: classes/admin/class-pwb-admin-tab.php:135
115
+ msgid "After excerpt"
116
+ msgstr "Después de la descripción corta"
117
+
118
+ #: classes/admin/class-pwb-admin-tab.php:136
119
+ msgid "After add to cart"
120
+ msgstr "Después del botón de comprar"
121
+
122
+ #: classes/admin/class-pwb-admin-tab.php:137
123
+ msgid "After meta"
124
+ msgstr "Después del meta"
125
+
126
+ #: classes/admin/class-pwb-admin-tab.php:138
127
+ msgid "After sharing"
128
+ msgstr "Después de compartir"
129
+
130
+ #: classes/admin/class-pwb-admin-tab.php:155
131
+ msgid "Tools"
132
+ msgstr "Herramientas"
133
+
134
+ #: classes/admin/class-pwb-admin-tab.php:161
135
+ msgid "Import brands"
136
+ msgstr "Importar marcas"
137
+
138
+ #: classes/admin/class-pwb-admin-tab.php:165
139
+ #, php-format
140
+ msgid ""
141
+ "Import brands from other brand plugin. <a href=\"%s\" target=\"_blank"
142
+ "\">Click here for more details</a>"
143
+ msgstr ""
144
+ "Importar marcas de producto de otro plugin de marcas. <a href=\"%s\" target="
145
+ "\"_blank\">Pulsa aquí para ver la documentación</a>"
146
+
147
+ #: classes/admin/class-pwb-admin-tab.php:170
148
+ #: classes/admin/class-pwb-admin-tab.php:182
149
+ msgid "-"
150
+ msgstr "-"
151
+
152
+ #: classes/admin/class-pwb-admin-tab.php:171
153
+ msgid "YITH WooCommerce Brands Add-On"
154
+ msgstr "YITH WooCommerce Brands Add-On"
155
+
156
+ #: classes/admin/class-pwb-admin-tab.php:172
157
+ msgid "Ultimate WooCommerce Brands"
158
+ msgstr "Ultimate WooCommerce Brands"
159
+
160
+ #: classes/admin/class-pwb-admin-tab.php:176
161
+ msgid "Dummy data"
162
+ msgstr "Datos ficticios"
163
+
164
+ #: classes/admin/class-pwb-admin-tab.php:179
165
+ msgid "Import generic brands and assign it to products randomly"
166
+ msgstr ""
167
+ "Importar marcas genéricas y asignarlas a los productos existentes de forma "
168
+ "aleatoria"
169
+
170
+ #: classes/admin/class-pwb-admin-tab.php:183
171
+ msgid "Start import"
172
+ msgstr "Comenzar importación"
173
+
174
+ #: classes/admin/class-pwb-admin-tab.php:187
175
+ msgid "System status"
176
+ msgstr "Estado del sistema"
177
+
178
+ #: classes/admin/class-pwb-admin-tab.php:189
179
+ msgid "Show system status"
180
+ msgstr "Ver estado del sistema"
181
+
182
+ #: classes/admin/class-pwb-coupon.php:22
183
+ msgid "Brands restriction"
184
+ msgstr "Restricciones de marca"
185
+
186
+ #: classes/admin/class-pwb-coupon.php:23
187
+ msgid "Any brand"
188
+ msgstr "Cualquier marca"
189
+
190
+ #: classes/admin/class-pwb-coupon.php:32
191
+ msgid ""
192
+ "Coupon will be valid if there are at least one product of this brands in the "
193
+ "cart"
194
+ msgstr ""
195
+ "El cupón será válido si existe al menos un producto de la marca señalada en "
196
+ "el carrito"
197
+
198
+ #: classes/class-perfect-woocommerce-brands.php:43
199
+ msgid ""
200
+ "We know that you´re in love with Perfect WooCommerce Brands, you can help us "
201
+ "making it a bit better. Thanks a lot!"
202
+ msgstr ""
203
+ "Sabemos que Perfect WooCommerce Brands te encanta, puedes ayudarnos a "
204
+ "hacerlo un poco mejor. ¡Muchas gracias!"
205
+
206
+ #: classes/class-perfect-woocommerce-brands.php:45
207
+ msgid ""
208
+ "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
209
+ "reviews/?rate=5#new-post\" target=\"_blank\">Leave a review</a>"
210
+ msgstr ""
211
+ "<a href=\"https://wordpress.org/support/plugin/perfect-woocommerce-brands/"
212
+ "reviews/?rate=5#new-post\" target=\"_blank\">Dejar una review</a>"
213
+
214
+ #: classes/class-perfect-woocommerce-brands.php:46
215
+ msgid ""
216
+ "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
217
+ "woocommerce-brands\" target=\"_blank\">Translate the plugin</a>"
218
+ msgstr ""
219
+ "<a href=\"https://translate.wordpress.org/projects/wp-plugins/perfect-"
220
+ "woocommerce-brands\" target=\"_blank\">Traducir el plugin</a>"
221
+
222
+ #: classes/class-perfect-woocommerce-brands.php:47
223
+ msgid ""
224
+ "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
225
+ "\"_blank\">View on GitHub</a>"
226
+ msgstr ""
227
+ "<a href=\"https://github.com/titodevera/perfect-woocommerce-brands\" target="
228
+ "\"_blank\">Ver en GitHub</a>"
229
+
230
+ #: classes/class-perfect-woocommerce-brands.php:70
231
+ msgid "Settings"
232
+ msgstr "Ajustes"
233
+
234
+ #: classes/class-perfect-woocommerce-brands.php:236
235
+ msgid "PWB Product carousel"
236
+ msgstr "PWB Carrusel de productos"
237
+
238
+ #: classes/class-perfect-woocommerce-brands.php:237
239
+ msgid "Product carousel by brand or by category"
240
+ msgstr "Carrusel de productos por marca o categoría"
241
+
242
+ #: classes/class-perfect-woocommerce-brands.php:245
243
+ #: classes/class-perfect-woocommerce-brands.php:560
244
+ msgid "Brand"
245
+ msgstr "Marca"
246
+
247
+ #: classes/class-perfect-woocommerce-brands.php:253
248
+ msgid "Products"
249
+ msgstr "Productos"
250
+
251
+ #: classes/class-perfect-woocommerce-brands.php:256
252
+ msgid "Number of products to load"
253
+ msgstr "Número de productos que cargar"
254
+
255
+ #: classes/class-perfect-woocommerce-brands.php:261
256
+ msgid "Products to show"
257
+ msgstr "Productos a mostrar"
258
+
259
+ #: classes/class-perfect-woocommerce-brands.php:264
260
+ msgid "Number of products to show"
261
+ msgstr "Número de productos que mostrar"
262
+
263
+ #: classes/class-perfect-woocommerce-brands.php:269
264
+ msgid "Products to scroll"
265
+ msgstr "Número de productos por scroll"
266
+
267
+ #: classes/class-perfect-woocommerce-brands.php:272
268
+ msgid "Number of products to scroll"
269
+ msgstr "Número de productos por cada scroll"
270
+
271
+ #: classes/class-perfect-woocommerce-brands.php:277
272
+ #: classes/class-perfect-woocommerce-brands.php:326
273
+ msgid "Autoplay"
274
+ msgstr "Modo automático"
275
+
276
+ #: classes/class-perfect-woocommerce-brands.php:279
277
+ #: classes/class-perfect-woocommerce-brands.php:328
278
+ msgid "Autoplay carousel"
279
+ msgstr "Modo automático para el carrusel"
280
+
281
+ #: classes/class-perfect-woocommerce-brands.php:284
282
+ #: classes/class-perfect-woocommerce-brands.php:333
283
+ msgid "Arrows"
284
+ msgstr "Flechas de navegación"
285
+
286
+ #: classes/class-perfect-woocommerce-brands.php:286
287
+ #: classes/class-perfect-woocommerce-brands.php:335
288
+ msgid "Display prev and next arrows"
289
+ msgstr "Mostrar flechas de navegación"
290
+
291
+ #: classes/class-perfect-woocommerce-brands.php:292
292
+ msgid "PWB Brands carousel"
293
+ msgstr "PWB Carrusel de marcas"
294
+
295
+ #: classes/class-perfect-woocommerce-brands.php:293
296
+ msgid "Brands carousel"
297
+ msgstr "Carrusel de marcas"
298
+
299
+ #: classes/class-perfect-woocommerce-brands.php:302
300
+ msgid "Items"
301
+ msgstr "Elementos"
302
+
303
+ #: classes/class-perfect-woocommerce-brands.php:305
304
+ msgid "Number of items to load"
305
+ msgstr "Número de elementos que cargar"
306
+
307
+ #: classes/class-perfect-woocommerce-brands.php:310
308
+ msgid "Items to show"
309
+ msgstr "Elementos a mostrar"
310
+
311
+ #: classes/class-perfect-woocommerce-brands.php:313
312
+ msgid "Number of items to show"
313
+ msgstr "Número de elementos a mostrar"
314
+
315
+ #: classes/class-perfect-woocommerce-brands.php:318
316
+ msgid "Items to scroll"
317
+ msgstr "Número de elementos por scroll"
318
+
319
+ #: classes/class-perfect-woocommerce-brands.php:321
320
+ msgid "Number of items to scroll"
321
+ msgstr "Número de elementos por cada scroll"
322
+
323
+ #: classes/class-perfect-woocommerce-brands.php:350
324
+ msgid "PWB All brands"
325
+ msgstr "PWB Todas las marcas"
326
+
327
+ #: classes/class-perfect-woocommerce-brands.php:351
328
+ msgid "Show all brands"
329
+ msgstr "Mostrar todas las marcas"
330
+
331
+ #: classes/class-perfect-woocommerce-brands.php:360
332
+ msgid "Brands per page"
333
+ msgstr "Marcas por página"
334
+
335
+ #: classes/class-perfect-woocommerce-brands.php:363
336
+ msgid "Show x brands per page"
337
+ msgstr "Mostrar x marcas por página"
338
+
339
+ #: classes/class-perfect-woocommerce-brands.php:374
340
+ msgid "Order by"
341
+ msgstr "Ordenar por"
342
+
343
+ #: classes/class-perfect-woocommerce-brands.php:388
344
+ msgid "Order"
345
+ msgstr "Orden"
346
+
347
+ #: classes/class-perfect-woocommerce-brands.php:398
348
+ msgid "Title position"
349
+ msgstr "Posición del título"
350
+
351
+ #: classes/class-perfect-woocommerce-brands.php:402
352
+ msgid "Before image"
353
+ msgstr "Antes de la imagen"
354
+
355
+ #: classes/class-perfect-woocommerce-brands.php:403
356
+ msgid "After image"
357
+ msgstr "Después de la imagen"
358
+
359
+ #: classes/class-perfect-woocommerce-brands.php:409
360
+ msgid "Hide empty"
361
+ msgstr "Ocultar vacías"
362
+
363
+ #: classes/class-perfect-woocommerce-brands.php:411
364
+ msgid "Hide brands that have not been assigned to any product"
365
+ msgstr "Ocultar marcas que no han sido asignadas a ningún producto"
366
+
367
+ #: classes/class-perfect-woocommerce-brands.php:419
368
+ msgid "PWB brand"
369
+ msgstr "PWB Marca"
370
+
371
+ #: classes/class-perfect-woocommerce-brands.php:420
372
+ msgid "Show brand for a specific product"
373
+ msgstr "Ver marcas de un producto específico"
374
+
375
+ #: classes/class-perfect-woocommerce-brands.php:430
376
+ msgid "Product id"
377
+ msgstr "Id del producto"
378
+
379
+ #: classes/class-perfect-woocommerce-brands.php:433
380
+ msgid "Product id (post id)"
381
+ msgstr "Id del producto (id del post)"
382
+
383
+ #: classes/class-perfect-woocommerce-brands.php:476
384
+ #: classes/class-perfect-woocommerce-brands.php:478
385
+ #: classes/shortcodes/class-pwb-all-brands.php:90
386
+ #: classes/shortcodes/class-pwb-brand.php:29
387
+ #: classes/shortcodes/class-pwb-brand.php:31
388
+ #: classes/shortcodes/class-pwb-carousel.php:50
389
+ msgid "View brand"
390
+ msgstr "Ver marca"
391
+
392
+ #: classes/class-perfect-woocommerce-brands.php:548
393
+ msgid "¿Start migration?"
394
+ msgstr "¿Comenzar la migración?"
395
+
396
+ #: classes/class-perfect-woocommerce-brands.php:549
397
+ msgid ""
398
+ "We are migrating the product brands. ¡Don´t close this window until the "
399
+ "process is finished!"
400
+ msgstr ""
401
+ "Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
402
+ "el proceso finalice!"
403
+
404
+ #: classes/class-perfect-woocommerce-brands.php:550
405
+ msgid "¿Start loading dummy data?"
406
+ msgstr "¿Comenzar con la importación?"
407
+
408
+ #: classes/class-perfect-woocommerce-brands.php:551
409
+ msgid ""
410
+ "We are importing the dummy data. ¡Don´t close this window until the process "
411
+ "is finished!"
412
+ msgstr ""
413
+ "En este momento estamos importando las marcas ficticias. ¡No cierre esta "
414
+ "ventana hasta que termine el proceso!"
415
+
416
+ #: classes/class-perfect-woocommerce-brands.php:562
417
+ msgid "All Brands"
418
+ msgstr "Todas las marcas"
419
+
420
+ #: classes/class-perfect-woocommerce-brands.php:563
421
+ msgid "Edit Brand"
422
+ msgstr "Editar marca"
423
+
424
+ #: classes/class-perfect-woocommerce-brands.php:564
425
+ msgid "View Brand"
426
+ msgstr "Ver marca"
427
+
428
+ #: classes/class-perfect-woocommerce-brands.php:565
429
+ msgid "Update Brand"
430
+ msgstr "Actualizar marca"
431
+
432
+ #: classes/class-perfect-woocommerce-brands.php:566
433
+ msgid "Add New Brand"
434
+ msgstr "Añadir nueva marca"
435
+
436
+ #: classes/class-perfect-woocommerce-brands.php:567
437
+ msgid "New Brand Name"
438
+ msgstr "Nuevo nombre de marca"
439
+
440
+ #: classes/class-perfect-woocommerce-brands.php:568
441
+ msgid "Parent Brand"
442
+ msgstr "Marca Padre"
443
+
444
+ #: classes/class-perfect-woocommerce-brands.php:569
445
+ msgid "Parent Brand:"
446
+ msgstr "Marca Padre:"
447
+
448
+ #: classes/class-perfect-woocommerce-brands.php:570
449
+ msgid "Search Brands"
450
+ msgstr "Buscar Marcas"
451
+
452
+ #: classes/class-perfect-woocommerce-brands.php:571
453
+ msgid "Popular Brands"
454
+ msgstr "Marcas Populares"
455
+
456
+ #: classes/class-perfect-woocommerce-brands.php:572
457
+ msgid "Separate brands with commas"
458
+ msgstr "Separar marcas con comas"
459
+
460
+ #: classes/class-perfect-woocommerce-brands.php:573
461
+ msgid "Add or remove brands"
462
+ msgstr "Añadir o eliminar marcas"
463
+
464
+ #: classes/class-perfect-woocommerce-brands.php:574
465
+ msgid "Choose from the most used brands"
466
+ msgstr "Seleccionar de las marcas más utilizadas"
467
+
468
+ #: classes/class-perfect-woocommerce-brands.php:575
469
+ msgid "No brands found"
470
+ msgstr "No se han encontrado marcas"
471
+
472
+ #: classes/class-perfect-woocommerce-brands.php:619
473
+ #: classes/class-perfect-woocommerce-brands.php:652
474
+ #: classes/widgets/class-pwb-list.php:39
475
+ msgid "Brand logo"
476
+ msgstr "Logo de la marca"
477
+
478
+ #: classes/class-perfect-woocommerce-brands.php:621
479
+ #: classes/class-perfect-woocommerce-brands.php:627
480
+ #: classes/class-perfect-woocommerce-brands.php:656
481
+ #: classes/class-perfect-woocommerce-brands.php:676
482
+ msgid "Select image"
483
+ msgstr "Seleccionar imagen"
484
+
485
+ #: classes/class-perfect-woocommerce-brands.php:625
486
+ #: classes/class-perfect-woocommerce-brands.php:672
487
+ msgid "Brand banner"
488
+ msgstr "Banner de la marca"
489
+
490
+ #: classes/class-perfect-woocommerce-brands.php:628
491
+ msgid "This image will be shown on brand page"
492
+ msgstr "Esta imagen se mostrará en la página de la marca"
493
+
494
+ #: classes/class-perfect-woocommerce-brands.php:632
495
+ #: classes/class-perfect-woocommerce-brands.php:692
496
+ msgid "Brand banner link"
497
+ msgstr "Enlace para el banner de la marca"
498
+
499
+ #: classes/class-perfect-woocommerce-brands.php:634
500
+ #: classes/class-perfect-woocommerce-brands.php:696
501
+ msgid "This link should be relative to site url. Example: product/product-name"
502
+ msgstr ""
503
+ "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
504
+ "nombre-del-producto"
505
+
506
+ #: classes/class-perfect-woocommerce-brands.php:750
507
+ msgid "Logo"
508
+ msgstr "Logo"
509
+
510
+ #: classes/class-perfect-woocommerce-brands.php:790
511
+ msgid "All"
512
+ msgstr "Todas"
513
+
514
+ #: classes/class-perfect-woocommerce-brands.php:845
515
+ msgid "No products found"
516
+ msgstr "No se han encontrado productos"
517
+
518
+ #: classes/class-pwb-api-support.php:67
519
+ msgid "Product brands"
520
+ msgstr "Marcas del producto"
521
+
522
+ #: classes/shortcodes/class-pwb-all-brands.php:111
523
+ msgid "First page"
524
+ msgstr "Primera página"
525
+
526
+ #: classes/shortcodes/class-pwb-all-brands.php:114
527
+ msgid "Previous page"
528
+ msgstr "Página anterior"
529
+
530
+ #: classes/shortcodes/class-pwb-all-brands.php:118
531
+ msgid "Next page"
532
+ msgstr "Siguiente página"
533
+
534
+ #: classes/shortcodes/class-pwb-all-brands.php:121
535
+ msgid "Last page"
536
+ msgstr "Última página"
537
+
538
+ #: classes/shortcodes/class-pwb-all-brands.php:126
539
+ msgid "No results"
540
+ msgstr "No se han encontrado resultados"
541
+
542
+ #: classes/widgets/class-pwb-dropdown.php:10
543
+ msgid "Adds a brands dropdown to your site"
544
+ msgstr "Añade un desplegable con las marcas a tu sitio"
545
+
546
+ #: classes/widgets/class-pwb-dropdown.php:11
547
+ msgid "Brands dropdown"
548
+ msgstr "Desplegable de marcas"
549
+
550
+ #: classes/widgets/class-pwb-dropdown.php:21
551
+ msgid "Title"
552
+ msgstr "Título"
553
+
554
+ #: classes/widgets/class-pwb-dropdown.php:64
555
+ #: classes/widgets/class-pwb-list.php:105
556
+ msgid "There is not available brands"
557
+ msgstr "No se encuentran marcas disponibles"
558
+
559
+ #: classes/widgets/class-pwb-filter-by-brand.php:10
560
+ msgid "Recommended for product categories or shop page"
561
+ msgstr "Recomendado para las categorías de producto y la página de la tienda"
562
+
563
+ #: classes/widgets/class-pwb-filter-by-brand.php:11
564
+ msgid "Filter products by brand"
565
+ msgstr "Filtrar productos por marca"
566
+
567
+ #: classes/widgets/class-pwb-filter-by-brand.php:20
568
+ #: classes/widgets/class-pwb-list.php:24
569
+ msgid "Title:"
570
+ msgstr "Título:"
571
+
572
+ #: classes/widgets/class-pwb-filter-by-brand.php:114
573
+ msgid "Apply filter"
574
+ msgstr "Filtrar"
575
+
576
+ #: classes/widgets/class-pwb-list.php:10
577
+ msgid "Adds a brands list to your site"
578
+ msgstr "Añade una lista de marcas a tu sitio"
579
+
580
+ #: classes/widgets/class-pwb-list.php:11
581
+ msgid "Brands list"
582
+ msgstr "Lista de marcas"
583
+
584
+ #: classes/widgets/class-pwb-list.php:33
585
+ msgid "Display as:"
586
+ msgstr "Mostrar como:"
587
+
588
+ #: classes/widgets/class-pwb-list.php:38
589
+ msgid "Brand name"
590
+ msgstr "Nombre de la marca"
591
+
592
+ #: classes/widgets/class-pwb-list.php:44
593
+ msgid "Columns:"
594
+ msgstr "Columnas:"
595
+
596
+ #: classes/widgets/class-pwb-list.php:97 classes/widgets/class-pwb-list.php:99
597
+ msgid "Go to"
598
+ msgstr "Ir a"
599
+
600
+ #: main.php:90
601
+ msgid ""
602
+ "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
603
+ "active WooCommerce plugin."
604
+ msgstr ""
605
+ "Perfect WooCommerce Brands necesita WooCommerce para funcionar. Por favor, "
606
+ "instala y activa WooCommerce."
607
+
608
+ #. Plugin Name of the plugin/theme
609
+ msgid "Perfect WooCommerce Brands"
610
+ msgstr "Perfect WooCommerce Brands"
611
+
612
+ #. Plugin URI of the plugin/theme
613
+ msgid "https://wordpress.org/plugins/perfect-woocommerce-brands/"
614
+ msgstr "https://wordpress.org/plugins/perfect-woocommerce-brands/"
615
+
616
+ #. Description of the plugin/theme
617
+ msgid ""
618
+ "Perfect WooCommerce Brands allows you to show product brands in your "
619
+ "WooCommerce based store."
620
+ msgstr ""
621
+ "Perfect WooCommerce Brands te permite trabajar con marcas de producto en tu "
622
+ "tienda online basada en WooCommerce."
623
+
624
+ #. Author of the plugin/theme
625
+ msgid "Alberto de Vera Sevilla"
626
+ msgstr "Alberto de Vera Sevilla"
627
+
628
+ #. Author URI of the plugin/theme
629
+ msgid "https://profiles.wordpress.org/titodevera/"
630
+ msgstr "https://profiles.wordpress.org/titodevera/"
631
+
632
+ #~ msgid ""
633
+ #~ "We are offering you maybe the best WooCommerce brands plugin completely "
634
+ #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
635
+ #~ "Thanks!"
636
+ #~ msgstr ""
637
+ #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
638
+ #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
639
+ #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
640
+
641
+ #~ msgid ""
642
+ #~ "Import brands from other brand plugin. <strong>Both plugins should be "
643
+ #~ "installed and active</strong>"
644
+ #~ msgstr ""
645
+ #~ "Importar marcas de otro plugin. <strong>Ambos plugins han de encontrarse "
646
+ #~ "instalados y activados</strong>"
647
+
648
+ #~ msgid ""
649
+ #~ "We are offering you maybe the best WooCommerce brands plugin completly "
650
+ #~ "free. You can help us making Perfect WooCommerce Brands a bit better. "
651
+ #~ "Thanks!"
652
+ #~ msgstr ""
653
+ #~ "Estamos ofreciendo de forma completamente gratuita el que probablemente "
654
+ #~ "sea el mejor plugin de marcas para WooCommerce. Puedes ayudarnos haciendo "
655
+ #~ "Perfect WooCommerce Brands un poco mejor. ¡Gracias!"
656
+
657
+ #~ msgid "Import brands from old plugin installation"
658
+ #~ msgstr "Importar marcas de otro plugin"
659
+
660
+ #~ msgid "Brands metabox"
661
+ #~ msgstr "Marcas metabox"
662
+
663
+ #~ msgid "image for this brand"
664
+ #~ msgstr "imagen para esta marca"
665
+
666
+ #~ msgid "Select an image"
667
+ #~ msgstr "Seleccione una imagen"
668
+
669
+ #~ msgid "Show a specific brand"
670
+ #~ msgstr "Mostrar marcas de un producto en concreto"
main.php CHANGED
@@ -1,91 +1,94 @@
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.5.1
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
-
13
- Perfect WooCommerce Brands version 1.5.1, Copyright (C) 2016 Alberto de Vera Sevilla
14
-
15
- Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation, either version 3 of the License, or
18
- (at your option) any later version.
19
-
20
- Perfect WooCommerce Brands is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with Perfect WooCommerce Brands. If not, see <http://www.gnu.org/licenses/>.
27
-
28
- */
29
-
30
- namespace Perfect_Woocommerce_Brands;
31
-
32
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
33
-
34
- //plugin constants
35
- define( 'PWB_PLUGIN', plugins_url( '', __FILE__ ) );
36
- define( 'PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ) );
37
- define( 'PWB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
38
- define( 'PWB_PLUGIN_VERSION', '1.5.1' );
39
- define( 'PWB_WP_VERSION', get_bloginfo( 'version' ) );
40
- define( 'PWB_WC_VERSION', get_option( 'woocommerce_version' ) );
41
-
42
- //clean brands slug on plugin deactivation
43
- register_deactivation_hook( __FILE__, function(){
44
- update_option( 'old_wc_pwb_admin_tab_slug', 'null' );
45
- } );
46
-
47
- //loads textdomain for the translations
48
- add_action( 'plugins_loaded', function(){
49
- load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
50
- } );
51
-
52
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
53
- if( is_plugin_active( 'woocommerce/woocommerce.php' ) ){
54
-
55
- require 'classes/widgets/class-pwb-dropdown.php';
56
- require 'classes/widgets/class-pwb-list.php';
57
- require 'classes/widgets/class-pwb-filter-by-brand.php';
58
- require 'classes/shortcodes/class-pwb-product-carousel.php';
59
- require 'classes/shortcodes/class-pwb-carousel.php';
60
- require 'classes/shortcodes/class-pwb-all-brands.php';
61
- require 'classes/shortcodes/class-pwb-brand.php';
62
- require 'classes/class-perfect-woocommerce-brands.php';
63
-
64
- if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '2.6', '>=' ) ){
65
- require 'classes/class-pwb-api-support.php';
66
- new PWB_API_Support();
67
- require 'classes/admin/class-pwb-coupon.php';
68
- new Admin\PWB_Coupon();
69
- }
70
-
71
- if( is_admin() ){
72
- require 'classes/admin/class-pwb-system-status.php';
73
- new Admin\PWB_System_Status();
74
- require 'classes/admin/class-pwb-admin-tab.php';
75
- require 'classes/admin/class-pwb-migrate.php';
76
- new Admin\PWB_Migrate();
77
- require 'classes/admin/class-pwb-dummy-data.php';
78
- new Admin\PWB_Dummy_Data();
79
- }
80
-
81
- new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
82
-
83
-
84
- }elseif( is_admin() ){
85
-
86
- add_action( 'admin_notices', function() {
87
- $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
88
- printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
89
- });
90
-
91
- }
 
 
 
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.5.2
7
+ Author: Alberto de Vera Sevilla
8
+ Author URI: https://profiles.wordpress.org/titodevera/
9
+ Text Domain: perfect-woocommerce-brands
10
+ Domain Path: /lang
11
+ License: GPL3
12
+
13
+ Perfect WooCommerce Brands version 1.5.2, Copyright (C) 2016 Alberto de Vera Sevilla
14
+
15
+ Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation, either version 3 of the License, or
18
+ (at your option) any later version.
19
+
20
+ Perfect WooCommerce Brands is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with Perfect WooCommerce Brands. If not, see <http://www.gnu.org/licenses/>.
27
+
28
+ */
29
+
30
+ namespace Perfect_Woocommerce_Brands;
31
+
32
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
33
+
34
+ //plugin constants
35
+ define( 'PWB_PLUGIN', plugins_url( '', __FILE__ ) );
36
+ define( 'PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ) );
37
+ define( 'PWB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
38
+ define( 'PWB_PLUGIN_VERSION', '1.5.2' );
39
+ define( 'PWB_WP_VERSION', get_bloginfo( 'version' ) );
40
+ define( 'PWB_WC_VERSION', get_option( 'woocommerce_version' ) );
41
+
42
+ register_activation_hook( __FILE__, function(){
43
+ update_option( 'pwb_activate_on', time() );
44
+ } );
45
+
46
+ //clean brands slug on plugin deactivation
47
+ register_deactivation_hook( __FILE__, function(){
48
+ update_option( 'old_wc_pwb_admin_tab_slug', 'null' );
49
+ } );
50
+
51
+ //loads textdomain for the translations
52
+ add_action( 'plugins_loaded', function(){
53
+ load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
54
+ } );
55
+
56
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
57
+ if( is_plugin_active( 'woocommerce/woocommerce.php' ) ){
58
+
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-brand.php';
66
+ require 'classes/class-perfect-woocommerce-brands.php';
67
+
68
+ if( defined('PWB_WC_VERSION') && version_compare( PWB_WC_VERSION, '2.6', '>=' ) ){
69
+ require 'classes/class-pwb-api-support.php';
70
+ new PWB_API_Support();
71
+ require 'classes/admin/class-pwb-coupon.php';
72
+ new Admin\PWB_Coupon();
73
+ }
74
+
75
+ if( is_admin() ){
76
+ require 'classes/admin/class-pwb-system-status.php';
77
+ new Admin\PWB_System_Status();
78
+ require 'classes/admin/class-pwb-admin-tab.php';
79
+ require 'classes/admin/class-pwb-migrate.php';
80
+ new Admin\PWB_Migrate();
81
+ require 'classes/admin/class-pwb-dummy-data.php';
82
+ new Admin\PWB_Dummy_Data();
83
+ }
84
+
85
+ new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
86
+
87
+ }elseif( is_admin() ){
88
+
89
+ add_action( 'admin_notices', function() {
90
+ $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
91
+ printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
92
+ });
93
+
94
+ }
readme.txt CHANGED
@@ -1,131 +1,134 @@
1
- === Perfect WooCommerce Brands ===
2
- Contributors: titodevera
3
- Donate link: mailto:hola@albertodevera.es
4
- Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
- Requires at least: 4.4
6
- Tested up to: 4.8
7
- Stable tag: 1.5.1
8
- License: GPL3
9
- License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
-
11
- Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
12
-
13
- == Description ==
14
- Whether we like to admit it or not, we are all influenced by brands. Brands are a guarantee for quality, they assure product recognition in customers.
15
- Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
16
- With this extension you can add product brands to your WooCommerce site.
17
-
18
- = Requirements =
19
- > * PHP 5.3 or higher (tested on PHP7 too)
20
- > * WordPress 4.4 or higher
21
- > * WooCommerce 2.4.0 or higher
22
- > * Visual Composer (recommended)
23
-
24
- = Features =
25
- > * Very easy to use, 100% free, no ads, no premium version exists
26
- > * Assign brands to products
27
- > * Associate a banner and a link to each brand
28
- > * Translation-ready (English and Spanish included)
29
- > * Visual Composer support
30
- > * Minimalist design and fully responsive
31
- > * Very lightweight
32
- > * Shortcode: Display all brands
33
- > * Shortcode: Display brands carousel
34
- > * Shortcode: Display product carousel by brand
35
- > * Shortcode: Display brands for a specific product
36
- > * Widget: Display brands as dropdown
37
- > * Widget: Display brands as list (brand names or brand logos)
38
- > * Widget: Filter products by brand
39
- > * Customizable brands slug
40
- > * Show the brands in products loop
41
- > * Import brands (migrate) from other brands plugins
42
- > * Dummy data installer (logos by heroturko)
43
- > * And much more!
44
-
45
-
46
- == Installation ==
47
- 1. Upload the plugin to the '/wp-content/plugins/' directory.
48
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
49
-
50
-
51
- == Frequently Asked Questions ==
52
- = Is Perfect WooCommerce Brands free? =
53
- Yes, of course. This plugin is 100% free. No ads, no premium version exists.
54
-
55
- = Where are plugin settings? =
56
- Go to `WooCommerce/Settings/` and click on `Brands` tab
57
-
58
- = How can i use the available shortcodes without Visual Composer? =
59
- [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-can-i-use-the-available-shortcodes-without-Visual-Composer%3F)
60
-
61
- = How to import brands from other brands plugin? =
62
- [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin)
63
-
64
-
65
- == Screenshots ==
66
- 1. Brands carousel
67
- 2. Brands page
68
- 3. Brands taxonomy
69
- 4. Brands shortcodes (with Visual Composer)
70
- 5. Product carousel by brand
71
-
72
-
73
- == Changelog ==
74
- = 1.5.1 =
75
- * Fix: Fatal error on old php versions (< 5.5)
76
- = 1.5 =
77
- * Feature (Tool): Install dummy data (generate generic brands and assigns them to available products randomly)
78
- * Feature: Restrict coupon by brands
79
- * Feature: Get system status details for a better plugin support
80
- * Feature: Import brands from "Ultimate WooCommerce Brands"
81
- * Dev: 'pwb_before_single_product_brands' and 'pwb_after_single_product_brands' hooks added
82
- * Dev: Basic WordPress REST API support
83
- * Enhancement: Better HTML markup for the brand banner and the brand description for the archive product page
84
- * Enhancement: Brands importer improvements
85
- * Enhancement: New params for "pwb-all-brands" shortcode
86
- * Fix: The brand description is appearing twice
87
- * Fix: Product filter widget does not seems to work in product category page (thanks hassandad)
88
- * Fix: Support for php 5.3 again
89
- * Fix: Removed ES6 code from admin for better browser support
90
- * Other minor bug fixes and code improvements
91
- = 1.4.5 =
92
- * Fix carousel shortcodes bugs
93
- * WooCommerce 2.7 support
94
- = 1.4.4 =
95
- * Important improvement of the user experience when assigning images to a brand
96
- * Feature (Option): Hide brands in single product, show as image or show as link
97
- * Feature: Hide prev/next arrows on carousel shortcodes
98
- * Feature: Hide empty brands option for "Display all brands" shortcode
99
- * Feature: New options for "Display brands as list" widget
100
- * Fix: Autoplay bug on carousel shortcodes
101
- * Tested on PHP7
102
- * Shortcut to the plugin settings added to the plugin list page
103
- * "Help us" notice added
104
- * Minor code improvements
105
- = 1.4.3 =
106
- * Feature (Widget): Filter products by brand
107
- * Feature (Option): Show brand logo in product loop
108
- * Feature: Brand microdata added to product page
109
- * Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
110
- = 1.4.2 =
111
- * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
112
- * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned
113
- = 1.4.1 =
114
- * Feature (Option): Hide brand's description in archive page
115
- * Fix: "pwb-all-brands" and "pwb-brand" show the content before they should
116
- * Clean database on uninstallation
117
- * Minor code improvements and fixes
118
- = 1.4 =
119
- * Feature: Product carousel by brand added
120
- * Minor bug fixes
121
- = 1.3 =
122
- * Feature: If is set, show brand description in brand page
123
- * Feature: Change brands position in single product
124
- = 1.2 =
125
- * Feature: Associate a banner and a link to each brand
126
- * Minor tweaks
127
- * Fully tested on WooCommerce 2.6
128
- = 1.1 =
129
- * Minor bug fixes
130
- = 1.0 =
131
- * Initial release
 
 
 
1
+ === Perfect WooCommerce Brands ===
2
+ Contributors: titodevera
3
+ Donate link: mailto:hola@albertodevera.es
4
+ Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
+ Requires at least: 4.4
6
+ Tested up to: 4.8
7
+ Stable tag: 1.5.2
8
+ License: GPL3
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
+
11
+ Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store
12
+
13
+ == Description ==
14
+ Whether we like to admit it or not, we are all influenced by brands. Brands are a guarantee for quality, they assure product recognition in customers.
15
+ Is essential to work with product brands for increase sales and generate reliability on your e-commerce site.
16
+ With this extension you can add product brands to your WooCommerce site.
17
+
18
+ = Requirements =
19
+ > * PHP 5.3 or higher (tested on PHP7 too)
20
+ > * WordPress 4.4 or higher
21
+ > * WooCommerce 2.4.0 or higher
22
+ > * Visual Composer (recommended)
23
+
24
+ = Features =
25
+ > * Very easy to use, 100% free, no ads, no premium version exists
26
+ > * Assign brands to products
27
+ > * Associate a banner and a link to each brand
28
+ > * Translation-ready (English and Spanish included)
29
+ > * Visual Composer support
30
+ > * Minimalist design and fully responsive
31
+ > * Very lightweight
32
+ > * Shortcode: Display all brands
33
+ > * Shortcode: Display brands carousel
34
+ > * Shortcode: Display product carousel by brand
35
+ > * Shortcode: Display brands for a specific product
36
+ > * Widget: Display brands as dropdown
37
+ > * Widget: Display brands as list (brand names or brand logos)
38
+ > * Widget: Filter products by brand
39
+ > * Customizable brands slug
40
+ > * Show the brands in products loop
41
+ > * Import brands (migrate) from other brands plugins
42
+ > * Dummy data installer (logos by heroturko)
43
+ > * WooCommerce REST API support
44
+ > * And much more!
45
+
46
+
47
+ == Installation ==
48
+ 1. Upload the plugin to the '/wp-content/plugins/' directory.
49
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
50
+
51
+
52
+ == Frequently Asked Questions ==
53
+ = Is Perfect WooCommerce Brands free? =
54
+ Yes, of course. This plugin is 100% free. No ads, no premium version exists.
55
+
56
+ = Where are plugin settings? =
57
+ Go to `WooCommerce/Settings/` and click on `Brands` tab
58
+
59
+ = How can i use the available shortcodes without Visual Composer? =
60
+ [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-can-i-use-the-available-shortcodes-without-Visual-Composer%3F)
61
+
62
+ = How to import brands from other brands plugin? =
63
+ [Click here](https://github.com/titodevera/perfect-woocommerce-brands/wiki/How-to-import-brands-from-other-brands-plugin)
64
+
65
+
66
+ == Screenshots ==
67
+ 1. Brands carousel
68
+ 2. Brands page
69
+ 3. Brands taxonomy
70
+ 4. Brands shortcodes (with Visual Composer)
71
+ 5. Product carousel by brand
72
+
73
+
74
+ == Changelog ==
75
+ = 1.5.2 =
76
+ * Dev: Adding brands to a products via the REST API + updating namespaces to include v2 (pull request, thanks doekenorg)
77
+ = 1.5.1 =
78
+ * Fix: Fatal error on old php versions (< 5.5)
79
+ = 1.5 =
80
+ * Feature (Tool): Install dummy data (generate generic brands and assigns them to available products randomly)
81
+ * Feature: Restrict coupon by brands
82
+ * Feature: Get system status details for a better plugin support
83
+ * Feature: Import brands from "Ultimate WooCommerce Brands"
84
+ * Dev: 'pwb_before_single_product_brands' and 'pwb_after_single_product_brands' hooks added
85
+ * Dev: Basic WordPress REST API support
86
+ * Enhancement: Better HTML markup for the brand banner and the brand description for the archive product page
87
+ * Enhancement: Brands importer improvements
88
+ * Enhancement: New params for "pwb-all-brands" shortcode
89
+ * Fix: The brand description is appearing twice
90
+ * Fix: Product filter widget does not seems to work in product category page (thanks hassandad)
91
+ * Fix: Support for php 5.3 again
92
+ * Fix: Removed ES6 code from admin for better browser support
93
+ * Other minor bug fixes and code improvements
94
+ = 1.4.5 =
95
+ * Fix carousel shortcodes bugs
96
+ * WooCommerce 2.7 support
97
+ = 1.4.4 =
98
+ * Important improvement of the user experience when assigning images to a brand
99
+ * Feature (Option): Hide brands in single product, show as image or show as link
100
+ * Feature: Hide prev/next arrows on carousel shortcodes
101
+ * Feature: Hide empty brands option for "Display all brands" shortcode
102
+ * Feature: New options for "Display brands as list" widget
103
+ * Fix: Autoplay bug on carousel shortcodes
104
+ * Tested on PHP7
105
+ * Shortcut to the plugin settings added to the plugin list page
106
+ * "Help us" notice added
107
+ * Minor code improvements
108
+ = 1.4.3 =
109
+ * Feature (Widget): Filter products by brand
110
+ * Feature (Option): Show brand logo in product loop
111
+ * Feature: Brand microdata added to product page
112
+ * Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
113
+ = 1.4.2 =
114
+ * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
115
+ * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned
116
+ = 1.4.1 =
117
+ * Feature (Option): Hide brand's description in archive page
118
+ * Fix: "pwb-all-brands" and "pwb-brand" show the content before they should
119
+ * Clean database on uninstallation
120
+ * Minor code improvements and fixes
121
+ = 1.4 =
122
+ * Feature: Product carousel by brand added
123
+ * Minor bug fixes
124
+ = 1.3 =
125
+ * Feature: If is set, show brand description in brand page
126
+ * Feature: Change brands position in single product
127
+ = 1.2 =
128
+ * Feature: Associate a banner and a link to each brand
129
+ * Minor tweaks
130
+ * Fully tested on WooCommerce 2.6
131
+ = 1.1 =
132
+ * Minor bug fixes
133
+ = 1.0 =
134
+ * Initial release
uninstall.php CHANGED
@@ -1,16 +1,16 @@
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_desc');
11
- delete_option('wc_pwb_admin_tab_section_end');
12
- delete_option('wc_pwb_notice_plugin_review');
13
-
14
- //update permalinks and clean cache
15
- flush_rewrite_rules();
16
- 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_desc');
11
+ delete_option('wc_pwb_admin_tab_section_end');
12
+ delete_option('wc_pwb_notice_plugin_review');
13
+
14
+ //update permalinks and clean cache
15
+ flush_rewrite_rules();
16
+ wp_cache_flush();