Advanced AJAX Product Filters - Version 1.3.2.5

Version Description

  • Enhancement - Option to use Standard tax rates for price filter
  • Enhancement - Separate Query Vars addon option to set Default operator for URLs
  • Enhancement - Separate Query Vars addon lower case operator text in URLs
  • Enhancement - Option to set devices where scroll to the top will be used
  • Fix - Attribute slider
  • Fix - PHP notices/errors
Download this release

Release Info

Developer RazyRx
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.3.2.5
Comparing to
See all releases

Code changes from version 1.3.2.4 to 1.3.2.5

addons/separate_link/separate_link.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class BeRocket_aapf_separate_link_addon extends BeRocket_framework_addon_lib {
3
+ public $addon_file = __FILE__;
4
+ public $plugin_name = 'ajax_filters';
5
+ public $php_file_name = 'separate_vars';
6
+ function get_addon_data() {
7
+ $data = parent::get_addon_data();
8
+ return array_merge($data, array(
9
+ 'addon_name' => 'Separate Query Vars (BETA)'
10
+ ));
11
+ }
12
+ }
13
+ new BeRocket_aapf_separate_link_addon();
addons/separate_link/separate_vars.php ADDED
@@ -0,0 +1,447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
3
+ function __construct() {
4
+ parent::__construct();
5
+ if( ! is_admin() ) {
6
+ add_filter('berocket_aapf_is_filtered_page_check', array($this, 'php_parse_inside_test'));
7
+ add_action('wp_footer', array($this, 'js_footer_new_func'));
8
+ }
9
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
10
+ $option = $BeRocket_AAPF->get_option();
11
+ add_filter('brfr_data_ajax_filters', array($this, 'brfr_data'), 50, 1);
12
+ if( ! empty( $option['use_links_filters'] ) ) {
13
+ add_action('plugins_loaded', array($this, 'plugins_loaded'), 50);
14
+ add_action( 'current_screen', array( $this, 'register_permalink_option' ), 50 );
15
+ }
16
+ }
17
+ function register_permalink_option() {
18
+ global $wp_settings_sections;
19
+ if( isset($wp_settings_sections[ 'permalink' ][ 'berocket_permalinks' ]) ) {
20
+ unset($wp_settings_sections[ 'permalink' ][ 'berocket_permalinks' ]);
21
+ }
22
+ }
23
+ function plugins_loaded() {
24
+ global $wp_filter;
25
+ if( isset( $wp_filter['berocket_check_radio_color_filter_term_text'] )
26
+ && is_a($wp_filter['berocket_check_radio_color_filter_term_text'], 'WP_Hook')
27
+ && ! empty($wp_filter['berocket_check_radio_color_filter_term_text']->callbacks[10]) ) {
28
+ foreach($wp_filter['berocket_check_radio_color_filter_term_text']->callbacks[10] as $callback) {
29
+ if( isset($callback['function'][1]) && is_a($callback['function'][0], 'BeRocket_AAPF_paid') && $callback['function'][1] == 'check_radio_color_filter_term_text' ) {
30
+ remove_filter('berocket_check_radio_color_filter_term_text', $callback['function'], 10, 4);
31
+ }
32
+ }
33
+ }
34
+ add_filter('berocket_check_radio_color_filter_term_text', array($this, 'check_radio_color_filter_term_text'), 10, 4);
35
+ }
36
+ function brfr_data($data) {
37
+ if( isset($data['SEO']['nice_urls']) ) {
38
+ unset($data['SEO']['nice_urls']);
39
+ }
40
+ if( isset($data['SEO']['canonicalization']) ) {
41
+ unset($data['SEO']['canonicalization']);
42
+ }
43
+ $data['SEO']['default_operator_and'] = array(
44
+ "label" => __( 'Default operator for URLs', "BeRocket_AJAX_domain" ),
45
+ "name" => "default_operator_and",
46
+ "type" => "selectbox",
47
+ "options" => array(
48
+ array('value' => '', 'text' => __('OR', 'BeRocket_AJAX_domain')),
49
+ array('value' => '1', 'text' => __('AND', 'BeRocket_AJAX_domain')),
50
+ ),
51
+ "value" => '',
52
+ 'label_for' => __('Default operator will be not displayed in URL', 'BeRocket_AJAX_domain'),
53
+ );
54
+ return $data;
55
+ }
56
+ function check_radio_color_filter_term_text($text, $term, $operator, $single) {
57
+ $term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
58
+ if( empty($term_taxonomy_echo) ) {
59
+ $term_taxonomy_echo = berocket_isset($term, 'taxonomy');
60
+ }
61
+ $text = '<a href="'.$this->berocket_add_filter_to_link($term_taxonomy_echo, berocket_isset($term, ($this->using_slug ? 'slug' : 'term_id')), $operator, $single).'">'.$text.'</a>';
62
+ return $text;
63
+ }
64
+ function berocket_add_filter_to_link($attribute = '', $values = array(), $operator = 'OR', $remove_attribute = FALSE) {
65
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
66
+ $options = $BeRocket_AAPF->get_option();
67
+ if( ! is_array($values) ) {
68
+ $values = array($values);
69
+ }
70
+ $current_url = $this->get_query_vars_name_link();
71
+ $link_data = $this->get_query_vars_name($current_url);
72
+ $taxonomy_value = implode(',', $values);
73
+ if( taxonomy_is_product_attribute($attribute) && substr($attribute, 0, 3) == 'pa_' ) {
74
+ $attribute = substr($attribute, 3);
75
+ }
76
+ $get_key = 'pa-'.$attribute;
77
+ foreach($link_data['taxonomy'] as $taxonomy) {
78
+ if( $taxonomy['taxonomy'] == $attribute ) {
79
+ $terms = $taxonomy['data']['terms'] ;
80
+ $terms = explode(',', $terms);
81
+ foreach($values as $value) {
82
+ if( ($position = array_search($value, $terms)) === FALSE ) {
83
+ $terms[] = $value;
84
+ } else {
85
+ unset($terms[$position]);
86
+ }
87
+ }
88
+ $taxonomy_value = implode(',', $terms);
89
+ $get_key = 'pa-'.$taxonomy['get_key'];
90
+ }
91
+ }
92
+ $new_url = $current_url;
93
+ if( empty($taxonomy_value) ) {
94
+ $new_url = add_query_arg(array($get_key => null, $get_key.'_operator' => null), $new_url);
95
+ } else {
96
+ $operator_set = $operator;
97
+ if( $operator == (empty($options['default_operator_and']) ? 'OR' : 'AND') ) {
98
+ $operator_set = null;
99
+ }
100
+ $new_url = add_query_arg(array($get_key => $taxonomy_value, $get_key.'_operator' => $operator_set), $new_url);
101
+ }
102
+ return $new_url;
103
+ }
104
+ function js_parse_inside($data, $args = array()) {
105
+ return $data;
106
+ }
107
+ function js_footer_new_func() {
108
+ echo '<script>function newUpdateLocation( args, pushstate, return_request ){';
109
+ echo $this->js_generate_inside('');
110
+ echo '}</script>';
111
+ }
112
+ function js_generate_inside($data, $args = array()) {
113
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
114
+ $options = $BeRocket_AAPF->get_option();
115
+ ob_start();
116
+ ?>
117
+ if ( typeof return_request == 'undefined' ) return_request = false;
118
+ uri_request_array = [];
119
+ var uri_request = '';
120
+ temp_terms = [];
121
+ var taxonomy_sparator = "|", start_terms = "[", end_terms = "]", variable = 'filters';
122
+
123
+ if (typeof the_ajax_script.nn_url_variable != "undefined" && the_ajax_script.nn_url_variable.length > 0) {
124
+ variable = the_ajax_script.nn_url_variable;
125
+ }
126
+ if (typeof the_ajax_script.nn_url_value_1 != "undefined" && the_ajax_script.nn_url_value_1.length > 0) {
127
+ start_terms = the_ajax_script.nn_url_value_1;
128
+ end_terms = the_ajax_script.nn_url_value_2;
129
+ }
130
+ if (typeof the_ajax_script.nn_url_split != "undefined" && the_ajax_script.nn_url_split.length > 0) {
131
+ taxonomy_sparator = the_ajax_script.nn_url_split;
132
+ }
133
+
134
+ if( the_ajax_script.nice_urls ) {
135
+ taxonomy_sparator = the_ajax_script.nice_url_split;
136
+ start_terms = the_ajax_script.nice_url_value_1;
137
+ end_terms = the_ajax_script.nice_url_value_2;
138
+ variable = the_ajax_script.nice_url_variable;
139
+ }
140
+
141
+ if( args.price ){
142
+ $price_obj = jQuery('.berocket_filter_price_slider');
143
+ if( ( args.price[0] || args.price[0] === 0 ) && ( args.price[1] || args.price[1] === 0 ) && ( args.price[0] != $price_obj.data('min') || args.price[1] != $price_obj.data('max') ) ){
144
+ if( uri_request ) uri_request += taxonomy_sparator;
145
+ uri_request += 'pa-price_from='+args.price[0]+'&pa-price_to='+args.price[1];
146
+ }
147
+ }
148
+
149
+ if( args.limits ){
150
+ jQuery(args.limits).each(function (i,o){
151
+ if( o[0].substring(0, 3) == 'pa_' ) {
152
+ if( !berocket_in_array( o[0].substring(3), temp_terms ) ){
153
+ temp_terms[temp_terms.length] = o[0].substring(3);
154
+ }
155
+ if( typeof uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
156
+ uri_request_array[berocket_in_array(o[0].substring(3), temp_terms)] = [];
157
+ }
158
+ uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )]
159
+ [uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
160
+ } else {
161
+ if( !berocket_in_array( o[0], temp_terms ) ){
162
+ temp_terms[temp_terms.length] = o[0];
163
+ }
164
+ if( typeof uri_request_array[berocket_in_array( o[0], temp_terms )] == 'undefined' ) {
165
+ uri_request_array[berocket_in_array(o[0], temp_terms)] = [];
166
+ }
167
+ uri_request_array[berocket_in_array( o[0], temp_terms )]
168
+ [uri_request_array[berocket_in_array( o[0], temp_terms )].length] = [o[1],o[2]];
169
+ }
170
+ });
171
+ }
172
+ if( args.terms ){
173
+ jQuery(args.terms).each(function (i,o){
174
+ if ( the_ajax_script.slug_urls ) {
175
+ o[1] = o[3];
176
+ }
177
+ if( o[0].substring(0, 3) == 'pa_' ) {
178
+ if( !berocket_in_array( o[0].substring(3), temp_terms ) ){
179
+ temp_terms[temp_terms.length] = o[0].substring(3);
180
+ }
181
+ if( typeof uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
182
+ uri_request_array[berocket_in_array(o[0].substring(3), temp_terms)] = [];
183
+ }
184
+ uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )]
185
+ [uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
186
+ } else {
187
+ if( !berocket_in_array( o[0], temp_terms ) ){
188
+ temp_terms[temp_terms.length] = o[0];
189
+ }
190
+ if( typeof uri_request_array[berocket_in_array( o[0], temp_terms )] == 'undefined' ) {
191
+ uri_request_array[berocket_in_array(o[0], temp_terms)] = [];
192
+ }
193
+ uri_request_array[berocket_in_array( o[0], temp_terms )]
194
+ [uri_request_array[berocket_in_array( o[0], temp_terms )].length] = [o[1],o[2]];
195
+ }
196
+ });
197
+ }
198
+
199
+ if( uri_request_array.length ) {
200
+ jQuery(uri_request_array).each(function (i,o){
201
+ if( uri_request ) uri_request += '&';
202
+
203
+ if( typeof o != 'object' ){
204
+ if( the_ajax_script.seo_uri_decode ) {
205
+ uri_request += encodeURIComponent( o );
206
+ } else {
207
+ uri_request += o;
208
+ }
209
+ }else{
210
+ cnt_oo = false;
211
+ var element_uri_request = '';
212
+ var temp_term_name = temp_terms[i];
213
+ if( the_ajax_script.seo_uri_decode ) {
214
+ temp_term_name = encodeURIComponent( temp_term_name );
215
+ }
216
+ temp_term_name = 'pa-'+temp_term_name;
217
+
218
+ jQuery(o).each(function (ii,oo){
219
+ if( ( oo[1] == 'AND' || oo[1] == 'OR' ) ){
220
+ if (! element_uri_request) {
221
+ if(oo[1] == '<?php echo (empty($options['default_operator_and']) ? 'AND' : 'OR'); ?>'){
222
+ element_uri_request += temp_term_name+'_operator=<?php echo (empty($options['default_operator_and']) ? 'and' : 'or'); ?>&';
223
+ }
224
+ element_uri_request += temp_term_name + '=';
225
+ }
226
+ if( cnt_oo ){
227
+ if( the_ajax_script.seo_uri_decode ) {
228
+ element_uri_request += encodeURIComponent(',');
229
+ } else {
230
+ element_uri_request += ',';
231
+ }
232
+ }
233
+ if( the_ajax_script.seo_uri_decode ) {
234
+ element_uri_request += encodeURIComponent(oo[0]);
235
+ } else {
236
+ element_uri_request += oo[0];
237
+ }
238
+ }else{
239
+ element_uri_request += temp_term_name+'_from='+oo[0]+'&'+temp_term_name+'_to='+oo[1];
240
+ }
241
+ cnt_oo = true;
242
+ });
243
+ uri_request += element_uri_request;
244
+ }
245
+ });
246
+ }
247
+ uri_request = uri_request;
248
+
249
+ if( !pushstate ) {
250
+ return uri_request;
251
+ }
252
+
253
+ var uri = the_ajax_script.current_page_url;
254
+ if ( /\?/.test(uri) ) {
255
+ passed_vars1 = uri.split('?');
256
+ uri = passed_vars1[0];
257
+ }
258
+ if( uri && uri.slice(-1) != '/' && ( the_ajax_script.trailing_slash ) ) {
259
+ uri += '/';
260
+ }
261
+
262
+ var cur_page = jQuery(the_ajax_script.pagination_class).find('.current').first().text();
263
+ var paginate_regex = new RegExp(".+\/"+the_ajax_script.pagination_base+"\/([0-9]+).+", "i");
264
+ if( prev_page = parseInt( location.href.replace(paginate_regex, "$1") ) ) {
265
+ if( ! parseInt( cur_page ) ){
266
+ cur_page = prev_page;
267
+ }
268
+ }
269
+ if(berocket_aapf_widget_first_page_jump && the_ajax_script.first_page) {
270
+ cur_page = 1;
271
+ }
272
+ cur_page = parseInt( cur_page );
273
+ var additional_datas = '';
274
+ something_added = false;
275
+ if( /\?/.test(location.href) ){
276
+ passed_vars1 = location.href;
277
+ if ( /\#/.test(passed_vars1) ) {
278
+ passed_vars1 = passed_vars1.split('#');
279
+ passed_vars1 = passed_vars1[0];
280
+ }
281
+ passed_vars1 = passed_vars1.split('?');
282
+ if( passed_vars1[1] ){
283
+ passed_vars2 = [];
284
+ if( /&/.test(passed_vars1[1]) ) {
285
+ passed_vars2 = passed_vars1[1].split('&');
286
+ } else {
287
+ passed_vars2[0] = passed_vars1[1];
288
+ }
289
+ passed_vars2_length = passed_vars2.length;
290
+ for ( k = 0; k < passed_vars2.length; k++ ) {
291
+ temp = passed_vars2[k].split('=');
292
+ passed_vars2[k] = [];
293
+ passed_vars2[k][0] = temp.shift();
294
+ passed_vars2[k][1] = temp.join("=");
295
+ if( passed_vars2[k][0].substr(0, 3) == 'pa-' || passed_vars2[k][0] == 'page' || passed_vars2[k][0] == 'paged' || passed_vars2[k][0] == 'product-page' ) continue;
296
+
297
+ if( the_ajax_script.control_sorting && passed_vars2[k][0] == 'orderby' ) continue;
298
+
299
+ if( something_added ) {
300
+ additional_datas += '&';
301
+ } else {
302
+ additional_datas += '?';
303
+ }
304
+
305
+ additional_datas += passed_vars2[k][0]+'='+passed_vars2[k][1];
306
+ something_added = true;
307
+ }
308
+ }
309
+ }
310
+ var next_symbol_sep = '?';
311
+ if( something_added ) {
312
+ uri = uri + additional_datas;
313
+ next_symbol_sep = '&';
314
+ }
315
+ if( cur_page > 1 && jQuery(the_ajax_script.pagination_class+' a').last().length && jQuery(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') == -1 ) {
316
+ uri = uri + next_symbol_sep + "paged=" + cur_page;
317
+ next_symbol_sep = '&';
318
+ }
319
+ if( uri_request ) {
320
+ uri = uri + next_symbol_sep + uri_request;
321
+ next_symbol_sep = '&';
322
+ }
323
+
324
+ if( the_ajax_script.control_sorting && args.orderby && the_ajax_script.default_sorting != args.orderby ){
325
+ uri = uri + next_symbol_sep + 'orderby=' + args.orderby;
326
+ next_symbol_sep = '&';
327
+ }
328
+
329
+ if( cur_page > 1 && jQuery(the_ajax_script.pagination_class+' a').last().length && jQuery(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') != -1 ) {
330
+ uri = uri + next_symbol_sep + "product-page=" + cur_page;
331
+ }
332
+ if ( /\#/.test(location.href) ) {
333
+ passed_vars1 = location.href.split('#');
334
+ passed_vars1 = passed_vars1[1];
335
+ uri += '#'+passed_vars1;
336
+ }
337
+
338
+ if( return_request ) {
339
+ return uri;
340
+ } else {
341
+ var stateParameters = { BeRocket: "Rules" };
342
+ history.replaceState(stateParameters, "BeRocket Rules");
343
+ history.pushState(stateParameters, "BeRocket Rules", uri);
344
+ history.pathname = uri;
345
+ }
346
+ <?php
347
+ return ob_get_clean();
348
+ }
349
+ function php_parse_inside_test($isset) {
350
+ $link_data = $this->php_parse(array());
351
+ $filters = array();
352
+ if( ! empty($link_data['taxonomy']) && is_array($link_data['taxonomy']) ) {
353
+ foreach($link_data['taxonomy'] as $taxonomy) {
354
+ if( $taxonomy['type'] == 'single' ) {
355
+ $filters[] = $taxonomy['taxonomy'].'['.implode(($taxonomy['data']['operator'] == 'OR' ? '-' : '+'), explode(',', $taxonomy['data']['terms'])).']';
356
+ } elseif( $taxonomy['type'] == 'from_to' ) {
357
+ $filters[] = $taxonomy['taxonomy'].'['.$taxonomy['data']['from']. '_' . $taxonomy['data']['to'] .']';
358
+ }
359
+ }
360
+ }
361
+ if( count($filters) ) {
362
+ $filters = implode('|', $filters);
363
+ $_GET['filters'] = $filters;
364
+ return true;
365
+ }
366
+ return $isset;
367
+ }
368
+ function php_parse_inside($data, $args = array()) {
369
+ $link_data = $this->get_query_vars_name();
370
+ return $link_data;
371
+ }
372
+ function php_generate_inside($data, $args = array()) {
373
+ return $data;
374
+ }
375
+ function get_query_vars_name($link = false) {
376
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
377
+ $options = $BeRocket_AAPF->get_option();
378
+ $link = $this->get_query_vars_name_link($link);
379
+ $parts = wp_parse_url($link);
380
+ $link_data = array(
381
+ 'var_names' => array(),
382
+ 'taxonomy' => array()
383
+ );
384
+ if( ! empty($parts['query']) ) {
385
+ parse_str($parts['query'], $query_vars);
386
+ if( is_array($query_vars) ) {
387
+ $skip = array();
388
+ foreach($query_vars as $get_key => $get_value) {
389
+ if( substr($get_key, 0, 3) == 'pa-' ) {
390
+ $get_key = substr($get_key, 3);
391
+ } else {
392
+ continue;
393
+ }
394
+ if( in_array($get_key, $link_data['var_names']) ) continue;
395
+ if( ($taxonomy = $this->check_taxonomy($get_key)) !== false ) {
396
+ $link_data['var_names'][] = $get_key;
397
+ $operator = (empty($options['default_operator_and']) ? 'OR' : 'AND');
398
+ $operator_var = 'pa-'.$get_key . '_operator';
399
+ if( ! empty($query_vars[$operator_var]) ) {
400
+ $operator = $query_vars[$operator_var];
401
+ $link_data['var_names'][] = $operator_var;
402
+ }
403
+ $link_data['taxonomy'][] = array(
404
+ 'taxonomy' => $taxonomy,
405
+ 'get_key' => $get_key,
406
+ 'data' => array(
407
+ 'terms' => $get_value,
408
+ 'operator' => strtoupper($operator)
409
+ ),
410
+ 'type' => 'single'
411
+ );
412
+ } elseif( strlen($get_key) > 5 && substr($get_key, -5) == '_from' && ! empty($query_vars['pa-'.substr_replace($get_key, '_to', -5)]) ) {
413
+ if( $taxonomy = $this->check_taxonomy(substr_replace($get_key, '', -5)) ) {
414
+ $link_data['var_names'][] = $get_key;
415
+ $link_data['var_names'][] = substr_replace($get_key, '_to', -5);
416
+ $link_data['taxonomy'][] = array(
417
+ 'taxonomy' => $taxonomy,
418
+ 'get_key' => $get_key,
419
+ 'data' => array(
420
+ 'from' => $get_value,
421
+ 'to' => $query_vars['pa-'.substr_replace($get_key, '_to', -5)]
422
+ ),
423
+ 'type' => 'from_to'
424
+ );
425
+ }
426
+ } elseif( strlen($get_key) > 3 && substr($get_key, -3) == '_to' && ! empty($query_vars['pa-'.substr_replace($get_key, '_from', -3)]) ) {
427
+ if( $taxonomy = $this->check_taxonomy(substr_replace($get_key, '', -3)) ) {
428
+ $link_data['var_names'][] = $get_key;
429
+ $link_data['var_names'][] = substr_replace($get_key, '_from', -3);
430
+ $link_data['taxonomy'][] = array(
431
+ 'taxonomy' => $taxonomy,
432
+ 'get_key' => $get_key,
433
+ 'data' => array(
434
+ 'to' => $get_value,
435
+ 'from' => $query_vars['pa-'.substr_replace($get_key, '_from', -3)]
436
+ ),
437
+ 'type' => 'from_to'
438
+ );
439
+ }
440
+ }
441
+ }
442
+ }
443
+ }
444
+ return $link_data;
445
+ }
446
+ }
447
+ new BeRocket_AAPF_lp_separate_vars();
berocket/assets/css/admin.css CHANGED
@@ -1486,3 +1486,7 @@
1486
  min-width: initial;
1487
  }
1488
  /* ---------- */
 
 
 
 
1486
  min-width: initial;
1487
  }
1488
  /* ---------- */
1489
+ #the-list .fa-bars {
1490
+ padding: 2px 10px;
1491
+ cursor: move;
1492
+ }
berocket/assets/popup/br_popup.js CHANGED
@@ -115,6 +115,7 @@
115
  $popup_html += '</div>';
116
  $popup_html = $($popup_html);
117
  $popup_html.appendTo('body');
 
118
  this.data('br_popup_object', $popup_html);
119
  };
120
  this.add_content = function() {
@@ -161,7 +162,7 @@
161
  $this.hide_popup();
162
  }
163
 
164
- $this.data('br_popup_object').trigger('br_popup-yes_button', $this);
165
  if ( typeof settings.yes_no_buttons.yes_func === 'function' ) {
166
  settings.yes_no_buttons.yes_func();
167
  } else if( settings.yes_no_buttons.yes_func) {
@@ -185,7 +186,7 @@
185
  $this.hide_popup();
186
  }
187
 
188
- $this.data('br_popup_object').trigger('br_popup-no_button', $this);
189
  if ( typeof settings.yes_no_buttons.no_func === 'function' ) {
190
  settings.yes_no_buttons.no_func();
191
  } else if( settings.yes_no_buttons.no_func) {
@@ -218,7 +219,7 @@
218
  $('body').addClass('hide_scroll');
219
  }
220
 
221
- this.data('br_popup_object').trigger('br_popup-show_popup', this);
222
  this.data('br_popup_object').css({display:'block'});
223
  this.animateCss(this.data('br_popup_object'), 'fadeIn');
224
  this.animateCss(this.data('br_popup_object').find('.popup_animation'), 'fadeInDown');
@@ -248,7 +249,8 @@
248
  var popup_data = this.data('br_popup_data');
249
  if ( popup_data.can_close_popup == true && this.data('br_popup_object').hasClass('br_popup') && this.data('br_popup_object').is(':visible') ) {
250
  var $this = this;
251
- this.data('br_popup_object').trigger('br_popup-hide_popup', this);
 
252
  clearInterval(popup_data.timer_interval);
253
  this.animateCss(this.data('br_popup_object').find('.popup_animation'), 'fadeOutUp');
254
  this.animateCss(this.data('br_popup_object'), 'fadeOut', function (){
115
  $popup_html += '</div>';
116
  $popup_html = $($popup_html);
117
  $popup_html.appendTo('body');
118
+ $popup_html.data('br_popup_main', this);
119
  this.data('br_popup_object', $popup_html);
120
  };
121
  this.add_content = function() {
162
  $this.hide_popup();
163
  }
164
 
165
+ jQuery($this).trigger('br_popup-yes_button', $this);
166
  if ( typeof settings.yes_no_buttons.yes_func === 'function' ) {
167
  settings.yes_no_buttons.yes_func();
168
  } else if( settings.yes_no_buttons.yes_func) {
186
  $this.hide_popup();
187
  }
188
 
189
+ jQuery($this).trigger('br_popup-no_button', $this);
190
  if ( typeof settings.yes_no_buttons.no_func === 'function' ) {
191
  settings.yes_no_buttons.no_func();
192
  } else if( settings.yes_no_buttons.no_func) {
219
  $('body').addClass('hide_scroll');
220
  }
221
 
222
+ jQuery(this).trigger('br_popup-show_popup', this);
223
  this.data('br_popup_object').css({display:'block'});
224
  this.animateCss(this.data('br_popup_object'), 'fadeIn');
225
  this.animateCss(this.data('br_popup_object').find('.popup_animation'), 'fadeInDown');
249
  var popup_data = this.data('br_popup_data');
250
  if ( popup_data.can_close_popup == true && this.data('br_popup_object').hasClass('br_popup') && this.data('br_popup_object').is(':visible') ) {
251
  var $this = this;
252
+
253
+ jQuery(this).trigger('br_popup-hide_popup', this);
254
  clearInterval(popup_data.timer_interval);
255
  this.animateCss(this.data('br_popup_object').find('.popup_animation'), 'fadeOutUp');
256
  this.animateCss(this.data('br_popup_object'), 'fadeOut', function (){
berocket/framework.php CHANGED
@@ -34,7 +34,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
- public static $framework_version = '2.4';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
@@ -81,7 +81,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
81
  if ( ! is_array( $active_site_plugin ) ) {
82
  $active_site_plugin = array();
83
  }
84
- $is_active_plugin = ( empty( $active_plugin[ $this->info['id'] ] ) && empty( $active_site_plugin[ $this->info['id'] ] ) ) ? 0 : 20;
85
  set_transient( 'berocket_framework_plugin_is_active_'.$this->info['id'], $is_active_plugin, 7200 );
86
  }
87
  $this->plugin_version_capability = $is_active_plugin;
@@ -275,7 +275,13 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
275
  __( 'View Plugin Documentation', 'BeRocket_domain' ) .
276
  '" target="_blank">' . __( 'Docs', 'BeRocket_domain' ) . '</a>',
277
  );
278
- if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
 
 
 
 
 
 
279
  $row_meta['premium'] = '<a href="https://berocket.com/support/product/' . $this->cc->values[ 'premium_slug' ] .
280
  '" title="' . __( 'View Premium Support Page', 'BeRocket_domain' ) .
281
  '" target="_blank">' . __( 'Premium Support', 'BeRocket_domain' ) . '</a>';
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
+ public static $framework_version = '2.5';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
81
  if ( ! is_array( $active_site_plugin ) ) {
82
  $active_site_plugin = array();
83
  }
84
+ $is_active_plugin = ( empty( $active_plugin[ $this->info['id'] ] ) && empty( $active_site_plugin[ $this->info['id'] ] ) ) ? 3 : 17;
85
  set_transient( 'berocket_framework_plugin_is_active_'.$this->info['id'], $is_active_plugin, 7200 );
86
  }
87
  $this->plugin_version_capability = $is_active_plugin;
275
  __( 'View Plugin Documentation', 'BeRocket_domain' ) .
276
  '" target="_blank">' . __( 'Docs', 'BeRocket_domain' ) . '</a>',
277
  );
278
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
279
+ if( ! empty($this->cc->values[ 'free_slug' ]) ) {
280
+ $row_meta['support'] = '<a href="https://wordpress.org/support/plugin/' . $this->cc->values[ 'free_slug' ] .
281
+ '/" title="' . __( 'View Support Page', 'BeRocket_domain' ) .
282
+ '" target="_blank">' . __( 'Support', 'BeRocket_domain' ) . '</a>';
283
+ }
284
+ } elseif( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
285
  $row_meta['premium'] = '<a href="https://berocket.com/support/product/' . $this->cc->values[ 'premium_slug' ] .
286
  '" title="' . __( 'View Premium Support Page', 'BeRocket_domain' ) .
287
  '" target="_blank">' . __( 'Premium Support', 'BeRocket_domain' ) . '</a>';
berocket/framework_version.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $framework_version_current = '2.4';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
1
  <?php
2
+ $framework_version_current = '2.5';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
berocket/includes/custom_post.php CHANGED
@@ -465,6 +465,7 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
465
  jQuery("#the-list .column-name").prepend(jQuery("<i class='fa fa-bars'></i>"));
466
  jQuery("#the-list").sortable({
467
  handle:".fa-bars",
 
468
  stop: function() {
469
  jQuery("#the-list .berocket_post_set_new_sortable_input input").each(function(i, o) {
470
  jQuery(o).val(i);
465
  jQuery("#the-list .column-name").prepend(jQuery("<i class='fa fa-bars'></i>"));
466
  jQuery("#the-list").sortable({
467
  handle:".fa-bars",
468
+ axis: "y",
469
  stop: function() {
470
  jQuery("#the-list .berocket_post_set_new_sortable_input input").each(function(i, o) {
471
  jQuery(o).val(i);
berocket/templates/premium.php CHANGED
@@ -38,9 +38,9 @@ if ( isset($this->plugin_version_capability) && $this->plugin_version_capability
38
  }
39
 
40
  $text = str_replace( '%feature_list%', $feature_text, $text );
41
- $text = str_replace( '%link%', $dplugin_link, $text );
42
  $text = str_replace( '%licence%', $dplugin_lic, $text );
43
- $text = str_replace( '%licence_link%', $dplugin_lic_link, $text );
44
  $text = str_replace( '%discount%', $dpdiscount, $text );
45
  $text = str_replace( '%plugin_name%', (empty($plugin_info['Name']) ? '' : $plugin_info['Name']), $text );
46
  $text = str_replace( '%plugin_link%', (empty($plugin_info['PluginURI']) ? '' : $plugin_info['PluginURI']), $text );
38
  }
39
 
40
  $text = str_replace( '%feature_list%', $feature_text, $text );
41
+ $text = str_replace( '%link%', $dplugin_link.'/SAVE15', $text );
42
  $text = str_replace( '%licence%', $dplugin_lic, $text );
43
+ $text = str_replace( '%licence_link%', $dplugin_link.'/SAVE15', $text );
44
  $text = str_replace( '%discount%', $dpdiscount, $text );
45
  $text = str_replace( '%plugin_name%', (empty($plugin_info['Name']) ? '' : $plugin_info['Name']), $text );
46
  $text = str_replace( '%plugin_link%', (empty($plugin_info['PluginURI']) ? '' : $plugin_info['PluginURI']), $text );
berocket/templates/settings_footer.php CHANGED
@@ -1,5 +1,8 @@
1
  <div class="br_settings_footer">
2
- <?php if ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
 
 
 
3
  $text = '<h4>Both <a href="%plugin_link%" target="_blank">Free</a> and <a href="%link%" target="_blank">Paid</a> versions of %plugin_name% developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
4
  } else {
5
  $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
1
  <div class="br_settings_footer">
2
+ <?php
3
+ if ( isset($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
4
+ $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
5
+ } elseif ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
6
  $text = '<h4>Both <a href="%plugin_link%" target="_blank">Free</a> and <a href="%link%" target="_blank">Paid</a> versions of %plugin_name% developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
7
  } else {
8
  $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
css/admin.css CHANGED
@@ -467,4 +467,7 @@ td.colorpicker_field.colorpicker_removed:after {
467
  .berocket_aapf_widget_content {
468
  line-height: 2em;
469
  }
470
- }
 
 
 
467
  .berocket_aapf_widget_content {
468
  line-height: 2em;
469
  }
470
+ }
471
+ .colpick.colpick_hex.colpick_hex_ns {
472
+ z-index: 1000;
473
+ }
css/colpick.css DELETED
@@ -1,421 +0,0 @@
1
- /*
2
- colpick Color Picker / colpick.com
3
- */
4
-
5
- /*Main container*/
6
- .colpick {
7
- position: absolute;
8
- width: 346px;
9
- height: 170px;
10
- overflow: hidden;
11
- display: none;
12
- font-family: Arial, Helvetica, sans-serif;
13
- background:#ebebeb;
14
- border: 1px solid #bbb;
15
- z-index: 900000;
16
- -webkit-border-radius: 5px;
17
- -moz-border-radius: 5px;
18
- border-radius: 5px;
19
-
20
- /*Prevents selecting text when dragging the selectors*/
21
- -webkit-user-select: none;
22
- -moz-user-select: none;
23
- -ms-user-select: none;
24
- -o-user-select: none;
25
- user-select: none;
26
- }
27
- /*Color selection box with gradients*/
28
- .colpick_color {
29
- position: absolute;
30
- left: 7px;
31
- top: 7px;
32
- width: 156px;
33
- height: 156px;
34
- overflow: hidden;
35
- outline: 1px solid #aaa;
36
- cursor: crosshair;
37
- }
38
- .colpick_color_overlay1 {
39
- position: absolute;
40
- left:0;
41
- top:0;
42
- width: 156px;
43
- height: 156px;
44
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; /* IE8 */
45
- background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
46
- background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
47
- background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
48
- background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
49
- background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
50
- background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
51
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */
52
- }
53
- .colpick_color_overlay2 {
54
- position: absolute;
55
- left:0;
56
- top:0;
57
- width: 156px;
58
- height: 156px;
59
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; /* IE8 */
60
- background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
61
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
62
- background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
63
- background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
64
- background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
65
- background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
66
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
67
- }
68
- /*Circular color selector*/
69
- .colpick_selector_outer {
70
- background:none;
71
- position: absolute;
72
- width: 11px;
73
- height: 11px;
74
- margin: -6px 0 0 -6px;
75
- border: 1px solid black;
76
- border-radius: 50%;
77
- }
78
- .colpick_selector_inner{
79
- position: absolute;
80
- width: 9px;
81
- height: 9px;
82
- border: 1px solid white;
83
- border-radius: 50%;
84
- }
85
- /*Vertical hue bar*/
86
- .colpick_hue {
87
- position: absolute;
88
- top: 6px;
89
- left: 175px;
90
- width: 19px;
91
- height: 156px;
92
- border: 1px solid #aaa;
93
- cursor: n-resize;
94
- }
95
- /*Hue bar sliding indicator*/
96
- .colpick_hue_arrs {
97
- position: absolute;
98
- left: -8px;
99
- width: 35px;
100
- height: 7px;
101
- margin: -7px 0 0 0;
102
- }
103
- .colpick_hue_larr {
104
- position:absolute;
105
- width: 0;
106
- height: 0;
107
- border-top: 6px solid transparent;
108
- border-bottom: 6px solid transparent;
109
- border-left: 7px solid #858585;
110
- }
111
- .colpick_hue_rarr {
112
- position:absolute;
113
- right:0;
114
- width: 0;
115
- height: 0;
116
- border-top: 6px solid transparent;
117
- border-bottom: 6px solid transparent;
118
- border-right: 7px solid #858585;
119
- }
120
- /*New color box*/
121
- .colpick_new_color {
122
- position: absolute;
123
- left: 207px;
124
- top: 6px;
125
- width: 60px;
126
- height: 27px;
127
- background: #f00;
128
- border: 1px solid #8f8f8f;
129
- }
130
- /*Current color box*/
131
- .colpick_current_color {
132
- position: absolute;
133
- left: 277px;
134
- top: 6px;
135
- width: 60px;
136
- height: 27px;
137
- background: #f00;
138
- border: 1px solid #8f8f8f;
139
- }
140
- /*Input field containers*/
141
- .colpick_field, .colpick_hex_field {
142
- position: absolute;
143
- height: 20px;
144
- width: 60px;
145
- overflow:hidden;
146
- background:#f3f3f3;
147
- color:#b8b8b8;
148
- font-size:12px;
149
- border:1px solid #bdbdbd;
150
- -webkit-border-radius: 3px;
151
- -moz-border-radius: 3px;
152
- border-radius: 3px;
153
- }
154
- .colpick_rgb_r {
155
- top: 40px;
156
- left: 207px;
157
- }
158
- .colpick_rgb_g {
159
- top: 67px;
160
- left: 207px;
161
- }
162
- .colpick_rgb_b {
163
- top: 94px;
164
- left: 207px;
165
- }
166
- .colpick_hsb_h {
167
- top: 40px;
168
- left: 277px;
169
- }
170
- .colpick_hsb_s {
171
- top: 67px;
172
- left: 277px;
173
- }
174
- .colpick_hsb_b {
175
- top: 94px;
176
- left: 277px;
177
- }
178
- .colpick_hex_field {
179
- width: 68px;
180
- left: 207px;
181
- top: 121px;
182
- }
183
- /*Text field container on focus*/
184
- .colpick_focus {
185
- border-color: #999;
186
- }
187
- /*Field label container*/
188
- .colpick_field_letter {
189
- position: absolute;
190
- width: 12px;
191
- height: 20px;
192
- line-height: 20px;
193
- padding-left: 4px;
194
- background: #efefef;
195
- border-right: 1px solid #bdbdbd;
196
- font-weight: bold;
197
- color:#777;
198
- }
199
- /*Text inputs*/
200
- .colpick_field input, .colpick_hex_field input {
201
- position: absolute;
202
- right: 11px;
203
- margin: 0;
204
- padding: 0;
205
- height: 20px;
206
- line-height: 20px;
207
- background: transparent;
208
- border: none;
209
- font-size: 12px;
210
- font-family: Arial, Helvetica, sans-serif;
211
- color: #555;
212
- text-align: right;
213
- outline: none;
214
- }
215
- .colpick_hex_field input {
216
- right: 4px;
217
- }
218
- /*Field up/down arrows*/
219
- .colpick_field_arrs {
220
- position: absolute;
221
- top: 0;
222
- right: 0;
223
- width: 9px;
224
- height: 21px;
225
- cursor: n-resize;
226
- }
227
- .colpick_field_uarr {
228
- position: absolute;
229
- top: 5px;
230
- width: 0;
231
- height: 0;
232
- border-left: 4px solid transparent;
233
- border-right: 4px solid transparent;
234
- border-bottom: 4px solid #959595;
235
- }
236
- .colpick_field_darr {
237
- position: absolute;
238
- bottom:5px;
239
- width: 0;
240
- height: 0;
241
- border-left: 4px solid transparent;
242
- border-right: 4px solid transparent;
243
- border-top: 4px solid #959595;
244
- }
245
- /*Submit/Select button*/
246
- .colpick_submit {
247
- position: absolute;
248
- left: 207px;
249
- top: 149px;
250
- width: 130px;
251
- height: 22px;
252
- line-height:22px;
253
- background: #efefef;
254
- text-align: center;
255
- color: #555;
256
- font-size: 12px;
257
- font-weight:bold;
258
- border: 1px solid #bdbdbd;
259
- -webkit-border-radius: 3px;
260
- -moz-border-radius: 3px;
261
- border-radius: 3px;
262
- }
263
- .colpick_submit:hover {
264
- background:#f3f3f3;
265
- border-color:#999;
266
- cursor: pointer;
267
- }
268
-
269
- /*full layout with no submit button*/
270
- .colpick_full_ns .colpick_submit, .colpick_full_ns .colpick_current_color{
271
- display:none;
272
- }
273
- .colpick_full_ns .colpick_new_color {
274
- width: 130px;
275
- height: 25px;
276
- }
277
- .colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsb_h {
278
- top: 42px;
279
- }
280
- .colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsb_s {
281
- top: 73px;
282
- }
283
- .colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsb_b {
284
- top: 104px;
285
- }
286
- .colpick_full_ns .colpick_hex_field {
287
- top: 135px;
288
- }
289
-
290
- /*rgbhex layout*/
291
- .colpick_rgbhex .colpick_hsb_h, .colpick_rgbhex .colpick_hsb_s, .colpick_rgbhex .colpick_hsb_b {
292
- display:none;
293
- }
294
- .colpick_rgbhex {
295
- width:282px;
296
- }
297
- .colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit {
298
- width:68px;
299
- }
300
- .colpick_rgbhex .colpick_new_color {
301
- width:34px;
302
- border-right:none;
303
- }
304
- .colpick_rgbhex .colpick_current_color {
305
- width:34px;
306
- left:240px;
307
- border-left:none;
308
- }
309
-
310
- /*rgbhex layout, no submit button*/
311
- .colpick_rgbhex_ns .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{
312
- display:none;
313
- }
314
- .colpick_rgbhex_ns .colpick_new_color{
315
- width:68px;
316
- border: 1px solid #8f8f8f;
317
- }
318
- .colpick_rgbhex_ns .colpick_rgb_r {
319
- top: 42px;
320
- }
321
- .colpick_rgbhex_ns .colpick_rgb_g {
322
- top: 73px;
323
- }
324
- .colpick_rgbhex_ns .colpick_rgb_b {
325
- top: 104px;
326
- }
327
- .colpick_rgbhex_ns .colpick_hex_field {
328
- top: 135px;
329
- }
330
-
331
- /*hex layout*/
332
- .colpick_hex .colpick_hsb_h, .colpick_hex .colpick_hsb_s, .colpick_hex .colpick_hsb_b, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b {
333
- display:none;
334
- }
335
- .colpick_hex {
336
- width:206px;
337
- height:201px;
338
- }
339
- .colpick_hex .colpick_hex_field {
340
- width:72px;
341
- height:25px;
342
- top:168px;
343
- left:80px;
344
- }
345
- .colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input {
346
- height: 25px;
347
- line-height: 25px;
348
- }
349
- .colpick_hex .colpick_new_color {
350
- left:9px;
351
- top:168px;
352
- width:30px;
353
- border-right:none;
354
- }
355
- .colpick_hex .colpick_current_color {
356
- left:39px;
357
- top:168px;
358
- width:30px;
359
- border-left:none;
360
- }
361
- .colpick_hex .colpick_submit {
362
- left:164px;
363
- top: 168px;
364
- width:30px;
365
- height:25px;
366
- line-height: 25px;
367
- }
368
-
369
- /*hex layout, no submit button*/
370
- .colpick_hex_ns .colpick_submit, .colpick_hex_ns .colpick_current_color {
371
- display:none;
372
- }
373
- .colpick_hex_ns .colpick_hex_field {
374
- width:80px;
375
- }
376
- .colpick_hex_ns .colpick_new_color{
377
- width:60px;
378
- border: 1px solid #8f8f8f;
379
- }
380
-
381
- /*Dark color scheme*/
382
- .colpick_dark {
383
- background: #161616;
384
- border-color: #2a2a2a;
385
- }
386
- .colpick_dark .colpick_color {
387
- outline-color: #333;
388
- }
389
- .colpick_dark .colpick_hue {
390
- border-color: #555;
391
- }
392
- .colpick_dark .colpick_field, .colpick_dark .colpick_hex_field {
393
- background: #101010;
394
- border-color: #2d2d2d;
395
- }
396
- .colpick_dark .colpick_field_letter {
397
- background: #131313;
398
- border-color: #2d2d2d;
399
- color: #696969;
400
- }
401
- .colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input {
402
- color: #7a7a7a;
403
- }
404
- .colpick_dark .colpick_field_uarr {
405
- border-bottom-color:#696969;
406
- }
407
- .colpick_dark .colpick_field_darr {
408
- border-top-color:#696969;
409
- }
410
- .colpick_dark .colpick_focus {
411
- border-color:#444;
412
- }
413
- .colpick_dark .colpick_submit {
414
- background: #131313;
415
- border-color:#2d2d2d;
416
- color:#7a7a7a;
417
- }
418
- .colpick_dark .colpick_submit:hover {
419
- background-color:#101010;
420
- border-color:#444;
421
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/global-admin.css DELETED
@@ -1,28 +0,0 @@
1
- #toplevel_page_berocket_account .wp-first-item {
2
- display: none!important;
3
- }
4
- .toplevel_page_berocket_custom_post .dashicons-before img {
5
- max-width: 16px;
6
- max-height: 16px;
7
- }
8
- .berocket_admin_menu_custom_post_submenu {
9
- display: inline-block;
10
- position: relative;
11
- padding-left: 25px;
12
- }
13
- .berocket_admin_menu_custom_post_submenu:before {
14
- content: "";
15
- background: transparent url('../images/submenu-icon.png') top left/cover;
16
- height: 14px;
17
- width: 14px;
18
- display: block;
19
- position: absolute;
20
- left: 7px;
21
- top: -3px;
22
- }
23
- .current .berocket_admin_menu_custom_post_submenu:before {
24
- background: transparent url('../images/submenu-icon-a.png') top left/cover;
25
- }
26
- .berocket_debug_errors {
27
- margin-top: 60px;
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/addons/price_include_tax.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class BeRocket_AAPF_price_use_tax {
3
+ public $tax_rates;
4
+ function __construct() {
5
+ $tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
6
+ if ( wc_tax_enabled()
7
+ && ( ( ! wc_prices_include_tax() && 'incl' === $tax_display_mode )
8
+ || ( wc_prices_include_tax() && 'excl' === $tax_display_mode ) )
9
+ ) {
10
+ $tax_class = apply_filters( 'woocommerce_price_filter_widget_tax_class', '' );
11
+ $this->tax_rates = WC_Tax::get_rates( $tax_class );
12
+ if( $this->tax_rates ) {
13
+ if( ! wc_prices_include_tax() ) {
14
+ $convert_class = array(
15
+ 'to' => 'include_tax',
16
+ 'from' => 'exclude_min_max_filter'
17
+ );
18
+ } else {
19
+ $convert_class = array(
20
+ 'to' => 'exclude_tax',
21
+ 'from' => 'include_min_max_filter'
22
+ );
23
+ }
24
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
25
+ $option = $BeRocket_AAPF->get_option();
26
+ if( $option['use_tax_for_price'] == 'var2' ) {
27
+ add_filter( 'berocket_price_slider_widget_min_amount', array( $this, $convert_class['to'] ), 5 );
28
+ add_filter( 'berocket_price_slider_widget_max_amount', array( $this, $convert_class['to'] ), 5 );
29
+ add_filter('berocket_min_max_filter', array( $this, $convert_class['from'] ), 15 );
30
+ add_filter('berocket_min_max_filter_range', array( $this, $convert_class['from'] ), 15 );
31
+ } else {
32
+ add_filter( 'berocket_price_filter_widget_min_amount', array( $this, $convert_class['to'] ), 5 );
33
+ add_filter( 'berocket_price_filter_widget_max_amount', array( $this, $convert_class['to'] ), 5 );
34
+ add_filter('berocket_min_max_filter', array( $this, $convert_class['from'] ), 15 );
35
+ }
36
+ }
37
+ }
38
+ }
39
+ function include_min_max_filter($price) {
40
+ return $this->min_max_filter($price, 'include_tax');
41
+ }
42
+ function exclude_min_max_filter($price) {
43
+ return $this->min_max_filter($price, 'exclude_tax');
44
+ }
45
+ function min_max_filter($price, $type) {
46
+ if( is_array($price) ) {
47
+ foreach($price as &$prices) {
48
+ $prices = $this->$type($prices);
49
+ }
50
+ } else {
51
+ $price = $this->$type($price);
52
+ }
53
+ return $price;
54
+ }
55
+ function include_tax($price) {
56
+ $price += WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $price, $this->tax_rates ) );
57
+ return $price;
58
+ }
59
+ function exclude_tax($price) {
60
+ $price -= WC_Tax::get_tax_total( WC_Tax::calc_inclusive_tax( $price, $this->tax_rates ) );
61
+ return $price;
62
+ }
63
+ }
64
+ new BeRocket_AAPF_price_use_tax();
includes/ico.png DELETED
Binary file
includes/widget.php CHANGED
@@ -756,11 +756,10 @@ class BeRocket_AAPF_Widget extends WP_Widget {
756
  if ( $custom_taxonomy == 'product_cat' ) {
757
  if( empty($child_parent) || ( $child_parent != 'parent' && $child_parent != 'child' ) ) {
758
  $terms = br_get_cat_hierarchy(array());
 
759
  } else {
760
  $terms = self::get_terms_child_parent ( ( empty($child_parent) ? '' : $child_parent ), $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : null ) );
761
  }
762
-
763
- $terms = self::set_terms_on_same_level( $terms, array(), ($type != 'checkbox' && $type != 'radio') );
764
  } else {
765
  $terms = self::get_terms_child_parent ( $child_parent, $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : 0 ) );
766
  $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
@@ -1008,8 +1007,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
1008
  $slider_value1 = array_search( $_POST['price'][0], $all_terms_name );
1009
  $slider_value2 = array_search( $_POST['price'][1], $all_terms_name );
1010
  } else {
1011
- $slider_value1 = apply_filters('berocket_price_filter_widget_min_amount', apply_filters('woocommerce_price_filter_widget_min_amount', $_POST['price'][0]), $_POST['price'][0]);
1012
- $slider_value2 = apply_filters('berocket_price_filter_widget_max_amount', apply_filters('woocommerce_price_filter_widget_max_amount', $_POST['price'][1]), $_POST['price'][1]);
1013
  }
1014
  }
1015
  if ( $attribute != 'price' and ! empty($_POST['limits']) and is_array($_POST['limits']) ) {
@@ -1267,8 +1266,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
1267
  $price_range = false;
1268
  if ( isset( $query_string->min_price ) && isset( $query_string->max_price ) && $query_string->min_price != $query_string->max_price ) {
1269
  $price_range = array(
1270
- apply_filters('berocket_price_filter_widget_min_amount', apply_filters( 'woocommerce_price_filter_widget_min_amount', $query_string->min_price ), $query_string->min_price),
1271
- apply_filters('berocket_price_filter_widget_max_amount', apply_filters( 'woocommerce_price_filter_widget_max_amount', $query_string->max_price ), $query_string->max_price)
1272
  );
1273
  }
1274
 
@@ -1724,7 +1723,7 @@ if( BeRocket_AAPF::$debug_mode ) {
1724
  if( ! empty($re) && ! is_wp_error($re) ) {
1725
  $term_ids = wp_list_pluck( $re, 'term_id' );
1726
  }
1727
- if( empty($term_ids) || ! is_array($term_ids) ) {
1728
  $terms = array();
1729
  $term_count = array();
1730
  } else {
@@ -1946,7 +1945,7 @@ if( BeRocket_AAPF::$debug_mode ) {
1946
  }
1947
  return $re;
1948
  }
1949
- if( $input_terms !== FALSE && is_array($input_terms) && is_array($re) ) {
1950
  $re2 = array();
1951
  $is_child = false;
1952
  foreach($re as $re_id => $re_term) {
@@ -2032,118 +2031,120 @@ if( BeRocket_AAPF::$debug_mode ) {
2032
  $tax_query = new WP_Tax_Query( $tax_query );
2033
  $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
2034
  $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
2035
- $term_ids = wp_list_pluck( $re, 'term_id' );
2036
-
2037
- // Generate query
2038
- $query = array();
2039
- $query['select'] = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count, GROUP_CONCAT(DISTINCT {$wpdb->posts}.ID SEPARATOR ',') as PID, terms.term_id as term_count_id";
2040
- $query['from'] = "FROM {$wpdb->posts}";
2041
- $query['join'] = "
2042
- INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id
2043
- INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id )
2044
- INNER JOIN {$wpdb->terms} AS terms USING( term_id )
2045
- " . $tax_query_sql['join'] . $meta_query_sql['join'];
2046
- $query['where'] = "
2047
- WHERE {$wpdb->posts}.post_type IN ( 'product' )
2048
- AND " . br_select_post_status() . "
2049
- " . $tax_query_sql['where'] . $meta_query_sql['where'] . "
2050
- AND terms.term_id IN (" . implode( ',', array_map( 'absint', $term_ids ) ) . ")
2051
- ";
2052
- if( defined( 'WCML_VERSION' ) && defined('ICL_LANGUAGE_CODE') ) {
2053
- $query['join'] = $query['join']." INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
2054
- $query['where'] = $query['where']." AND wpml_lang.language_code = '".ICL_LANGUAGE_CODE."' AND wpml_lang.element_type = 'post_product'";
2055
- }
2056
- br_where_search( $query );
2057
- if( ! empty($post__in) ) {
2058
- $query['where'] .= " AND {$wpdb->posts}.ID IN (\"" . implode('","', $post__in) . "\")";
2059
- }
2060
- if( function_exists('wc_get_product_visibility_term_ids') ) {
2061
- $product_visibility_term_ids = wc_get_product_visibility_term_ids();
2062
- $query['where'] .= " AND {$wpdb->posts}.ID NOT IN (\"SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id='" . $product_visibility_term_ids['exclude-from-catalog'] . "'\")";
2063
- }
 
2064
 
2065
- $query['where'] .= $old_join_posts;
2066
- $query['group_by'] = "GROUP BY terms.term_id";
2067
- if( ! empty($br_options['out_of_stock_variable_reload']) ) {
2068
- $new_post_terms = berocket_isset($_POST['terms']);
2069
- $new_post_limits = berocket_isset($_POST['limits_arr']);
2070
- if( is_array($new_post_terms) && count($new_post_terms) ) {
2071
- foreach($new_post_terms as $new_post_terms_i => $new_post_term) {
2072
- if( $new_post_term[0] == $taxonomy ) {
2073
- unset($new_post_terms[$new_post_terms_i]);
 
2074
  }
2075
  }
2076
- }
2077
- $taxonomy_terms = get_terms( array(
2078
- 'taxonomy' => $taxonomy,
2079
- 'hide_empty' => true,
2080
- 'fields' => 'ids'
2081
- ));
2082
- $limit_post__not_in = array();
2083
- foreach($taxonomy_terms as $taxonomy_term_id) {
2084
- $new_post_limits[$taxonomy] = array($taxonomy_term_id);
2085
- $limit_post__not_in[$taxonomy_term_id] = apply_filters('berocket_add_out_of_stock_variable', array(), $new_post_terms, $new_post_limits);
2086
- }
2087
-
2088
- if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
2089
- $limit_post__not_in_where_array = array();
2090
- $limit_post__term_id_without_product = array();
2091
- foreach($limit_post__not_in as $terms_id => $limit_post) {
2092
- if( is_array($limit_post) && count($limit_post) ) {
2093
- $limit_post__not_in_where_array[$terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND terms.term_id = {$terms_id})";
2094
- } else {
2095
- $limit_post__term_id_without_product[] = $terms_id;
2096
  }
 
 
 
 
2097
  }
2098
- if( count($limit_post__term_id_without_product) ) {
2099
- $limit_post__not_in_where_array[] = "(terms.term_id IN (".implode(', ', $limit_post__term_id_without_product)."))";
 
 
 
 
2100
  }
2101
- $limit_post__not_in_where = implode(' OR ', $limit_post__not_in_where_array);
2102
- }
2103
- if( empty($br_options['out_of_stock_variable_single']) && ! empty($limit_post__not_in_where) ) {
2104
- $query['where'] .= " AND ({$limit_post__not_in_where})";
2105
- }
2106
- } else {
2107
- if( ! empty($post__not_in) ) {
2108
- $query['where'] .= " AND {$wpdb->posts}.ID NOT IN (\"" . implode('","', $post__not_in) . "\")";
2109
  }
2110
- }
2111
- $query = apply_filters( 'woocommerce_get_filtered_term_product_counts_query', $query );
2112
-
2113
- $wpdb->query( 'SET SESSION group_concat_max_len = 1000000' );
2114
- if( ! empty($br_options['out_of_stock_variable_reload']) && ! empty($br_options['out_of_stock_variable_single']) ) {
2115
- if( isset($limit_post__not_in_where_array) &&is_array($limit_post__not_in_where_array) && count($limit_post__not_in_where_array) ) {
2116
- $results = array();
2117
- $results_pid = array();
2118
- foreach($limit_post__not_in_where_array as $limit_post) {
2119
- $query_new = $query;
2120
- $query_new['where'] .= " AND ({$limit_post})";
2121
- $query_new = implode( ' ', $query_new );
2122
- $result = $wpdb->get_results( $query_new );
2123
- $results_pid_temp = wp_list_pluck( $result, 'PID', 'term_count_id' );
2124
- $results_temp = wp_list_pluck( $result, 'term_count', 'term_count_id' );
2125
- $results_pid = $results_pid + $results_pid_temp;
2126
- $results = $results + $results_temp;
2127
- unset($results_pid_temp, $results_temp, $result);
2128
  }
 
 
 
 
 
 
 
 
2129
  }
2130
- } else {
2131
- $query = implode( ' ', $query );
2132
- if( BeRocket_AAPF::$debug_mode ) {
2133
- $term_recount_log['query_2'] = $query;
2134
- }
2135
- $results = $wpdb->get_results( $query );
2136
- $results_pid = wp_list_pluck( $results, 'PID', 'term_count_id' );
2137
- $results = wp_list_pluck( $results, 'term_count', 'term_count_id' );
2138
- }
2139
 
2140
- foreach ( $re as &$res_count ) {
2141
- if ( ! empty( $results[ $res_count->term_id ] ) ) {
2142
- $res_count->count = $results[ $res_count->term_id ];
2143
- } else {
2144
- $res_count->count = 0; //this function uses to fix count of term, when count is 0 but term must be displayed
2145
- if( $hide_empty && $taxonomy != 'product_cat' ) {
2146
- unset( $re[ $res_count->term_id ] );
 
2147
  }
2148
  }
2149
  }
@@ -2899,17 +2900,6 @@ if( BeRocket_AAPF::$debug_mode ) {
2899
  }
2900
  $min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
2901
  $max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
2902
- if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) {
2903
- $tax_classes = array_merge( array( '' ), WC_Tax::get_tax_classes() );
2904
- $class_min = $min;
2905
-
2906
- foreach ( $tax_classes as $tax_class ) {
2907
- if ( $tax_rates = WC_Tax::get_rates( $tax_class ) ) {
2908
- $class_min = $min - WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $min, $tax_rates ) );
2909
- }
2910
- }
2911
- $min = $class_min;
2912
- }
2913
 
2914
  $args['meta_query'][] = array(
2915
  'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'widget_2847'),
756
  if ( $custom_taxonomy == 'product_cat' ) {
757
  if( empty($child_parent) || ( $child_parent != 'parent' && $child_parent != 'child' ) ) {
758
  $terms = br_get_cat_hierarchy(array());
759
+ $terms = self::set_terms_on_same_level( $terms, array(), ($type != 'checkbox' && $type != 'radio') );
760
  } else {
761
  $terms = self::get_terms_child_parent ( ( empty($child_parent) ? '' : $child_parent ), $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : null ) );
762
  }
 
 
763
  } else {
764
  $terms = self::get_terms_child_parent ( $child_parent, $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : 0 ) );
765
  $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
1007
  $slider_value1 = array_search( $_POST['price'][0], $all_terms_name );
1008
  $slider_value2 = array_search( $_POST['price'][1], $all_terms_name );
1009
  } else {
1010
+ $slider_value1 = apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters('woocommerce_price_filter_widget_min_amount', $_POST['price'][0])), $_POST['price'][0]);
1011
+ $slider_value2 = apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters('woocommerce_price_filter_widget_max_amount', $_POST['price'][1])), $_POST['price'][1]);
1012
  }
1013
  }
1014
  if ( $attribute != 'price' and ! empty($_POST['limits']) and is_array($_POST['limits']) ) {
1266
  $price_range = false;
1267
  if ( isset( $query_string->min_price ) && isset( $query_string->max_price ) && $query_string->min_price != $query_string->max_price ) {
1268
  $price_range = array(
1269
+ apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters( 'woocommerce_price_filter_widget_min_amount', $query_string->min_price )), $query_string->min_price),
1270
+ apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters( 'woocommerce_price_filter_widget_max_amount', $query_string->max_price )), $query_string->max_price)
1271
  );
1272
  }
1273
 
1723
  if( ! empty($re) && ! is_wp_error($re) ) {
1724
  $term_ids = wp_list_pluck( $re, 'term_id' );
1725
  }
1726
+ if( empty($term_ids) || ! is_array($term_ids) || ! count($term_ids) ) {
1727
  $terms = array();
1728
  $term_count = array();
1729
  } else {
1945
  }
1946
  return $re;
1947
  }
1948
+ if( isset($input_terms) && $input_terms !== FALSE && is_array($input_terms) && is_array($re) ) {
1949
  $re2 = array();
1950
  $is_child = false;
1951
  foreach($re as $re_id => $re_term) {
2031
  $tax_query = new WP_Tax_Query( $tax_query );
2032
  $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
2033
  $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
2034
+ if( ! empty($re) && count($re)) {
2035
+ $term_ids = wp_list_pluck( $re, 'term_id' );
2036
+
2037
+ // Generate query
2038
+ $query = array();
2039
+ $query['select'] = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count, GROUP_CONCAT(DISTINCT {$wpdb->posts}.ID SEPARATOR ',') as PID, terms.term_id as term_count_id";
2040
+ $query['from'] = "FROM {$wpdb->posts}";
2041
+ $query['join'] = "
2042
+ INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id
2043
+ INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id )
2044
+ INNER JOIN {$wpdb->terms} AS terms USING( term_id )
2045
+ " . $tax_query_sql['join'] . $meta_query_sql['join'];
2046
+ $query['where'] = "
2047
+ WHERE {$wpdb->posts}.post_type IN ( 'product' )
2048
+ AND " . br_select_post_status() . "
2049
+ " . $tax_query_sql['where'] . $meta_query_sql['where'] . "
2050
+ AND terms.term_id IN (" . implode( ',', array_map( 'absint', $term_ids ) ) . ")
2051
+ ";
2052
+ if( defined( 'WCML_VERSION' ) && defined('ICL_LANGUAGE_CODE') ) {
2053
+ $query['join'] = $query['join']." INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
2054
+ $query['where'] = $query['where']." AND wpml_lang.language_code = '".ICL_LANGUAGE_CODE."' AND wpml_lang.element_type = 'post_product'";
2055
+ }
2056
+ br_where_search( $query );
2057
+ if( ! empty($post__in) ) {
2058
+ $query['where'] .= " AND {$wpdb->posts}.ID IN (\"" . implode('","', $post__in) . "\")";
2059
+ }
2060
+ if( function_exists('wc_get_product_visibility_term_ids') ) {
2061
+ $product_visibility_term_ids = wc_get_product_visibility_term_ids();
2062
+ $query['where'] .= " AND {$wpdb->posts}.ID NOT IN (\"SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id='" . $product_visibility_term_ids['exclude-from-catalog'] . "'\")";
2063
+ }
2064
 
2065
+ $query['where'] .= $old_join_posts;
2066
+ $query['group_by'] = "GROUP BY terms.term_id";
2067
+ if( ! empty($br_options['out_of_stock_variable_reload']) ) {
2068
+ $new_post_terms = berocket_isset($_POST['terms']);
2069
+ $new_post_limits = berocket_isset($_POST['limits_arr']);
2070
+ if( is_array($new_post_terms) && count($new_post_terms) ) {
2071
+ foreach($new_post_terms as $new_post_terms_i => $new_post_term) {
2072
+ if( $new_post_term[0] == $taxonomy ) {
2073
+ unset($new_post_terms[$new_post_terms_i]);
2074
+ }
2075
  }
2076
  }
2077
+ $taxonomy_terms = get_terms( array(
2078
+ 'taxonomy' => $taxonomy,
2079
+ 'hide_empty' => true,
2080
+ 'fields' => 'ids'
2081
+ ));
2082
+ $limit_post__not_in = array();
2083
+ foreach($taxonomy_terms as $taxonomy_term_id) {
2084
+ $new_post_limits[$taxonomy] = array($taxonomy_term_id);
2085
+ $limit_post__not_in[$taxonomy_term_id] = apply_filters('berocket_add_out_of_stock_variable', array(), $new_post_terms, $new_post_limits);
2086
+ }
2087
+
2088
+ if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
2089
+ $limit_post__not_in_where_array = array();
2090
+ $limit_post__term_id_without_product = array();
2091
+ foreach($limit_post__not_in as $terms_id => $limit_post) {
2092
+ if( is_array($limit_post) && count($limit_post) ) {
2093
+ $limit_post__not_in_where_array[$terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND terms.term_id = {$terms_id})";
2094
+ } else {
2095
+ $limit_post__term_id_without_product[] = $terms_id;
2096
+ }
2097
  }
2098
+ if( count($limit_post__term_id_without_product) ) {
2099
+ $limit_post__not_in_where_array[] = "(terms.term_id IN (".implode(', ', $limit_post__term_id_without_product)."))";
2100
+ }
2101
+ $limit_post__not_in_where = implode(' OR ', $limit_post__not_in_where_array);
2102
  }
2103
+ if( empty($br_options['out_of_stock_variable_single']) && ! empty($limit_post__not_in_where) ) {
2104
+ $query['where'] .= " AND ({$limit_post__not_in_where})";
2105
+ }
2106
+ } else {
2107
+ if( ! empty($post__not_in) ) {
2108
+ $query['where'] .= " AND {$wpdb->posts}.ID NOT IN (\"" . implode('","', $post__not_in) . "\")";
2109
  }
 
 
 
 
 
 
 
 
2110
  }
2111
+ $query = apply_filters( 'woocommerce_get_filtered_term_product_counts_query', $query );
2112
+
2113
+ $wpdb->query( 'SET SESSION group_concat_max_len = 1000000' );
2114
+ if( ! empty($br_options['out_of_stock_variable_reload']) && ! empty($br_options['out_of_stock_variable_single']) ) {
2115
+ if( isset($limit_post__not_in_where_array) &&is_array($limit_post__not_in_where_array) && count($limit_post__not_in_where_array) ) {
2116
+ $results = array();
2117
+ $results_pid = array();
2118
+ foreach($limit_post__not_in_where_array as $limit_post) {
2119
+ $query_new = $query;
2120
+ $query_new['where'] .= " AND ({$limit_post})";
2121
+ $query_new = implode( ' ', $query_new );
2122
+ $result = $wpdb->get_results( $query_new );
2123
+ $results_pid_temp = wp_list_pluck( $result, 'PID', 'term_count_id' );
2124
+ $results_temp = wp_list_pluck( $result, 'term_count', 'term_count_id' );
2125
+ $results_pid = $results_pid + $results_pid_temp;
2126
+ $results = $results + $results_temp;
2127
+ unset($results_pid_temp, $results_temp, $result);
2128
+ }
2129
  }
2130
+ } else {
2131
+ $query = implode( ' ', $query );
2132
+ if( BeRocket_AAPF::$debug_mode ) {
2133
+ $term_recount_log['query_2'] = $query;
2134
+ }
2135
+ $results = $wpdb->get_results( $query );
2136
+ $results_pid = wp_list_pluck( $results, 'PID', 'term_count_id' );
2137
+ $results = wp_list_pluck( $results, 'term_count', 'term_count_id' );
2138
  }
 
 
 
 
 
 
 
 
 
2139
 
2140
+ foreach ( $re as &$res_count ) {
2141
+ if ( ! empty( $results[ $res_count->term_id ] ) ) {
2142
+ $res_count->count = $results[ $res_count->term_id ];
2143
+ } else {
2144
+ $res_count->count = 0; //this function uses to fix count of term, when count is 0 but term must be displayed
2145
+ if( $hide_empty && $taxonomy != 'product_cat' ) {
2146
+ unset( $re[ $res_count->term_id ] );
2147
+ }
2148
  }
2149
  }
2150
  }
2900
  }
2901
  $min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
2902
  $max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
 
 
 
 
 
 
 
 
 
 
 
2903
 
2904
  $args['meta_query'][] = array(
2905
  'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'widget_2847'),
js/bootstrap.min.js DELETED
@@ -1,7 +0,0 @@
1
- /*!
2
- * Bootstrap v3.3.2 (http://getbootstrap.com)
3
- * Copyright 2011-2015 Twitter, Inc.
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- */
6
- if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.options.backdrop&&d.adjustBackdrop(),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$element.find(".modal-dialog").one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=this.tip(),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.2",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.2",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()
7
- }var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.2",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
 
 
 
 
 
 
 
js/colpick.js DELETED
@@ -1,520 +0,0 @@
1
- /*
2
- colpick Color Picker
3
- Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
4
-
5
- For usage and examples: colpick.com/plugin
6
- */
7
-
8
- (function ($) {
9
- var colpick = function () {
10
- var
11
- tpl = '<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',
12
- defaults = {
13
- showEvent: 'click',
14
- onShow: function () {},
15
- onBeforeShow: function(){},
16
- onHide: function () {},
17
- onChange: function () {},
18
- onSubmit: function () {},
19
- colorScheme: 'light',
20
- color: '3289c7',
21
- livePreview: true,
22
- flat: false,
23
- layout: 'full',
24
- submit: 1,
25
- submitText: 'OK',
26
- height: 156
27
- },
28
- //Fill the inputs of the plugin
29
- fillRGBFields = function (hsb, cal) {
30
- var rgb = hsbToRgb(hsb);
31
- $(cal).data('colpick').fields
32
- .eq(1).val(rgb.r).end()
33
- .eq(2).val(rgb.g).end()
34
- .eq(3).val(rgb.b).end();
35
- },
36
- fillHSBFields = function (hsb, cal) {
37
- $(cal).data('colpick').fields
38
- .eq(4).val(Math.round(hsb.h)).end()
39
- .eq(5).val(Math.round(hsb.s)).end()
40
- .eq(6).val(Math.round(hsb.b)).end();
41
- },
42
- fillHexFields = function (hsb, cal) {
43
- $(cal).data('colpick').fields.eq(0).val(hsbToHex(hsb));
44
- },
45
- //Set the round selector position
46
- setSelector = function (hsb, cal) {
47
- $(cal).data('colpick').selector.css('backgroundColor', '#' + hsbToHex({h: hsb.h, s: 100, b: 100}));
48
- $(cal).data('colpick').selectorIndic.css({
49
- left: parseInt($(cal).data('colpick').height * hsb.s/100, 10),
50
- top: parseInt($(cal).data('colpick').height * (100-hsb.b)/100, 10)
51
- });
52
- },
53
- //Set the hue selector position
54
- setHue = function (hsb, cal) {
55
- $(cal).data('colpick').hue.css('top', parseInt($(cal).data('colpick').height - $(cal).data('colpick').height * hsb.h/360, 10));
56
- },
57
- //Set current and new colors
58
- setCurrentColor = function (hsb, cal) {
59
- $(cal).data('colpick').currentColor.css('backgroundColor', '#' + hsbToHex(hsb));
60
- },
61
- setNewColor = function (hsb, cal) {
62
- $(cal).data('colpick').newColor.css('backgroundColor', '#' + hsbToHex(hsb));
63
- },
64
- //Called when the new color is changed
65
- change = function (ev) {
66
- var cal = $(this).parent().parent(), col;
67
- if (this.parentNode.className.indexOf('_hex') > 0) {
68
- cal.data('colpick').color = col = hexToHsb(fixHex(this.value));
69
- fillRGBFields(col, cal.get(0));
70
- fillHSBFields(col, cal.get(0));
71
- } else if (this.parentNode.className.indexOf('_hsb') > 0) {
72
- cal.data('colpick').color = col = fixHSB({
73
- h: parseInt(cal.data('colpick').fields.eq(4).val(), 10),
74
- s: parseInt(cal.data('colpick').fields.eq(5).val(), 10),
75
- b: parseInt(cal.data('colpick').fields.eq(6).val(), 10)
76
- });
77
- fillRGBFields(col, cal.get(0));
78
- fillHexFields(col, cal.get(0));
79
- } else {
80
- cal.data('colpick').color = col = rgbToHsb(fixRGB({
81
- r: parseInt(cal.data('colpick').fields.eq(1).val(), 10),
82
- g: parseInt(cal.data('colpick').fields.eq(2).val(), 10),
83
- b: parseInt(cal.data('colpick').fields.eq(3).val(), 10)
84
- }));
85
- fillHexFields(col, cal.get(0));
86
- fillHSBFields(col, cal.get(0));
87
- }
88
- setSelector(col, cal.get(0));
89
- setHue(col, cal.get(0));
90
- setNewColor(col, cal.get(0));
91
- cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 0]);
92
- },
93
- //Change style on blur and on focus of inputs
94
- blur = function (ev) {
95
- $(this).parent().removeClass('colpick_focus');
96
- },
97
- focus = function () {
98
- $(this).parent().parent().data('colpick').fields.parent().removeClass('colpick_focus');
99
- $(this).parent().addClass('colpick_focus');
100
- },
101
- //Increment/decrement arrows functions
102
- downIncrement = function (ev) {
103
- ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
104
- var field = $(this).parent().find('input').focus();
105
- var current = {
106
- el: $(this).parent().addClass('colpick_slider'),
107
- max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
108
- y: ev.pageY,
109
- field: field,
110
- val: parseInt(field.val(), 10),
111
- preview: $(this).parent().parent().data('colpick').livePreview
112
- };
113
- $(document).mouseup(current, upIncrement);
114
- $(document).mousemove(current, moveIncrement);
115
- },
116
- moveIncrement = function (ev) {
117
- ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val - ev.pageY + ev.data.y, 10))));
118
- if (ev.data.preview) {
119
- change.apply(ev.data.field.get(0), [true]);
120
- }
121
- return false;
122
- },
123
- upIncrement = function (ev) {
124
- change.apply(ev.data.field.get(0), [true]);
125
- ev.data.el.removeClass('colpick_slider').find('input').focus();
126
- $(document).off('mouseup', upIncrement);
127
- $(document).off('mousemove', moveIncrement);
128
- return false;
129
- },
130
- //Hue slider functions
131
- downHue = function (ev) {
132
- ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
133
- var current = {
134
- cal: $(this).parent(),
135
- y: $(this).offset().top
136
- };
137
- $(document).on('mouseup touchend',current,upHue);
138
- $(document).on('mousemove touchmove',current,moveHue);
139
-
140
- var pageY = ((ev.type == 'touchstart') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
141
- change.apply(
142
- current.cal.data('colpick')
143
- .fields.eq(4).val(parseInt(360*(current.cal.data('colpick').height - (pageY - current.y))/current.cal.data('colpick').height, 10))
144
- .get(0),
145
- [current.cal.data('colpick').livePreview]
146
- );
147
- return false;
148
- },
149
- moveHue = function (ev) {
150
- var pageY = ((ev.type == 'touchmove') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
151
- change.apply(
152
- ev.data.cal.data('colpick')
153
- .fields.eq(4).val(parseInt(360*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.y))))/ev.data.cal.data('colpick').height, 10))
154
- .get(0),
155
- [ev.data.preview]
156
- );
157
- return false;
158
- },
159
- upHue = function (ev) {
160
- fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
161
- fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
162
- $(document).off('mouseup touchend',upHue);
163
- $(document).off('mousemove touchmove',moveHue);
164
- return false;
165
- },
166
- //Color selector functions
167
- downSelector = function (ev) {
168
- ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
169
- var current = {
170
- cal: $(this).parent(),
171
- pos: $(this).offset()
172
- };
173
- current.preview = current.cal.data('colpick').livePreview;
174
-
175
- $(document).on('mouseup touchend',current,upSelector);
176
- $(document).on('mousemove touchmove',current,moveSelector);
177
-
178
- var payeX,pageY;
179
- if(ev.type == 'touchstart') {
180
- pageX = ev.originalEvent.changedTouches[0].pageX,
181
- pageY = ev.originalEvent.changedTouches[0].pageY;
182
- } else {
183
- pageX = ev.pageX;
184
- pageY = ev.pageY;
185
- }
186
-
187
- change.apply(
188
- current.cal.data('colpick').fields
189
- .eq(6).val(parseInt(100*(current.cal.data('colpick').height - (pageY - current.pos.top))/current.cal.data('colpick').height, 10)).end()
190
- .eq(5).val(parseInt(100*(pageX - current.pos.left)/current.cal.data('colpick').height, 10))
191
- .get(0),
192
- [current.preview]
193
- );
194
- return false;
195
- },
196
- moveSelector = function (ev) {
197
- var payeX,pageY;
198
- if(ev.type == 'touchmove') {
199
- pageX = ev.originalEvent.changedTouches[0].pageX,
200
- pageY = ev.originalEvent.changedTouches[0].pageY;
201
- } else {
202
- pageX = ev.pageX;
203
- pageY = ev.pageY;
204
- }
205
-
206
- change.apply(
207
- ev.data.cal.data('colpick').fields
208
- .eq(6).val(parseInt(100*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.pos.top))))/ev.data.cal.data('colpick').height, 10)).end()
209
- .eq(5).val(parseInt(100*(Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageX - ev.data.pos.left))))/ev.data.cal.data('colpick').height, 10))
210
- .get(0),
211
- [ev.data.preview]
212
- );
213
- return false;
214
- },
215
- upSelector = function (ev) {
216
- fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
217
- fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
218
- $(document).off('mouseup touchend',upSelector);
219
- $(document).off('mousemove touchmove',moveSelector);
220
- return false;
221
- },
222
- //Submit button
223
- clickSubmit = function (ev) {
224
- var cal = $(this).parent();
225
- var col = cal.data('colpick').color;
226
- cal.data('colpick').origColor = col;
227
- setCurrentColor(col, cal.get(0));
228
- cal.data('colpick').onSubmit(col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el);
229
- },
230
- //Show/hide the color picker
231
- show = function (ev) {
232
- // Prevent the trigger of any direct parent
233
- ev.stopPropagation();
234
- var cal = $('#' + $(this).data('colpickId'));
235
- cal.data('colpick').onBeforeShow.apply(this, [cal.get(0)]);
236
- var pos = $(this).offset();
237
- var top = pos.top + this.offsetHeight;
238
- var left = pos.left;
239
- var viewPort = getViewport();
240
- var calW = cal.width();
241
- if (left + calW > viewPort.l + viewPort.w) {
242
- left -= calW;
243
- }
244
- cal.css({left: left + 'px', top: top + 'px'});
245
- if (cal.data('colpick').onShow.apply(this, [cal.get(0)]) != false) {
246
- cal.show();
247
- }
248
- //Hide when user clicks outside
249
- $('html').mousedown({cal:cal}, hide);
250
- cal.mousedown(function(ev){ev.stopPropagation();})
251
- },
252
- hide = function (ev) {
253
- if (ev.data.cal.data('colpick').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
254
- ev.data.cal.hide();
255
- }
256
- $('html').off('mousedown', hide);
257
- },
258
- getViewport = function () {
259
- var m = document.compatMode == 'CSS1Compat';
260
- return {
261
- l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
262
- w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth)
263
- };
264
- },
265
- //Fix the values if the user enters a negative or high value
266
- fixHSB = function (hsb) {
267
- return {
268
- h: Math.min(360, Math.max(0, hsb.h)),
269
- s: Math.min(100, Math.max(0, hsb.s)),
270
- b: Math.min(100, Math.max(0, hsb.b))
271
- };
272
- },
273
- fixRGB = function (rgb) {
274
- return {
275
- r: Math.min(255, Math.max(0, rgb.r)),
276
- g: Math.min(255, Math.max(0, rgb.g)),
277
- b: Math.min(255, Math.max(0, rgb.b))
278
- };
279
- },
280
- fixHex = function (hex) {
281
- var len = 6 - hex.length;
282
- if (len > 0) {
283
- var o = [];
284
- for (var i=0; i<len; i++) {
285
- o.push('0');
286
- }
287
- o.push(hex);
288
- hex = o.join('');
289
- }
290
- return hex;
291
- },
292
- restoreOriginal = function () {
293
- var cal = $(this).parent();
294
- var col = cal.data('colpick').origColor;
295
- cal.data('colpick').color = col;
296
- fillRGBFields(col, cal.get(0));
297
- fillHexFields(col, cal.get(0));
298
- fillHSBFields(col, cal.get(0));
299
- setSelector(col, cal.get(0));
300
- setHue(col, cal.get(0));
301
- setNewColor(col, cal.get(0));
302
- };
303
- return {
304
- init: function (opt) {
305
- opt = $.extend({}, defaults, opt||{});
306
- //Set color
307
- if (typeof opt.color == 'string') {
308
- opt.color = hexToHsb(opt.color);
309
- } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
310
- opt.color = rgbToHsb(opt.color);
311
- } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
312
- opt.color = fixHSB(opt.color);
313
- } else {
314
- return this;
315
- }
316
-
317
- //For each selected DOM element
318
- return this.each(function () {
319
- //If the element does not have an ID
320
- if (!$(this).data('colpickId')) {
321
- var options = $.extend({}, opt);
322
- options.origColor = opt.color;
323
- //Generate and assign a random ID
324
- var id = 'collorpicker_' + parseInt(Math.random() * 1000);
325
- $(this).data('colpickId', id);
326
- //Set the tpl's ID and get the HTML
327
- var cal = $(tpl).attr('id', id);
328
- //Add class according to layout
329
- cal.addClass('colpick_'+options.layout+(options.submit?'':' colpick_'+options.layout+'_ns'));
330
- //Add class if the color scheme is not default
331
- if(options.colorScheme != 'light') {
332
- cal.addClass('colpick_'+options.colorScheme);
333
- }
334
- //Setup submit button
335
- cal.find('div.colpick_submit').html(options.submitText).click(clickSubmit);
336
- //Setup input fields
337
- options.fields = cal.find('input').change(change).blur(blur).focus(focus);
338
- cal.find('div.colpick_field_arrs').mousedown(downIncrement).end().find('div.colpick_current_color').click(restoreOriginal);
339
- //Setup hue selector
340
- options.selector = cal.find('div.colpick_color').on('mousedown touchstart',downSelector);
341
- options.selectorIndic = options.selector.find('div.colpick_selector_outer');
342
- //Store parts of the plugin
343
- options.el = this;
344
- options.hue = cal.find('div.colpick_hue_arrs');
345
- huebar = options.hue.parent();
346
- //Paint the hue bar
347
- var UA = navigator.userAgent.toLowerCase();
348
- var isIE = navigator.appName === 'Microsoft Internet Explorer';
349
- var IEver = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
350
- var ngIE = ( isIE && IEver < 10 );
351
- var stops = ['#ff0000','#ff0080','#ff00ff','#8000ff','#0000ff','#0080ff','#00ffff','#00ff80','#00ff00','#80ff00','#ffff00','#ff8000','#ff0000'];
352
- if(ngIE) {
353
- var i, div;
354
- for(i=0; i<=11; i++) {
355
- div = $('<div></div>').attr('style','height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+')";');
356
- huebar.append(div);
357
- }
358
- } else {
359
- stopList = stops.join(',');
360
- huebar.attr('style','background:-webkit-linear-gradient(top,'+stopList+'); background: -o-linear-gradient(top,'+stopList+'); background: -ms-linear-gradient(top,'+stopList+'); background:-moz-linear-gradient(top,'+stopList+'); -webkit-linear-gradient(top,'+stopList+'); background:linear-gradient(to bottom,'+stopList+'); ');
361
- }
362
- cal.find('div.colpick_hue').on('mousedown touchstart',downHue);
363
- options.newColor = cal.find('div.colpick_new_color');
364
- options.currentColor = cal.find('div.colpick_current_color');
365
- //Store options and fill with default color
366
- cal.data('colpick', options);
367
- fillRGBFields(options.color, cal.get(0));
368
- fillHSBFields(options.color, cal.get(0));
369
- fillHexFields(options.color, cal.get(0));
370
- setHue(options.color, cal.get(0));
371
- setSelector(options.color, cal.get(0));
372
- setCurrentColor(options.color, cal.get(0));
373
- setNewColor(options.color, cal.get(0));
374
- //Append to body if flat=false, else show in place
375
- if (options.flat) {
376
- cal.appendTo(this).show();
377
- cal.css({
378
- position: 'relative',
379
- display: 'block'
380
- });
381
- } else {
382
- cal.appendTo(document.body);
383
- $(this).on(options.showEvent, show);
384
- cal.css({
385
- position:'absolute'
386
- });
387
- }
388
- }
389
- });
390
- },
391
- //Shows the picker
392
- showPicker: function() {
393
- return this.each( function () {
394
- if ($(this).data('colpickId')) {
395
- show.apply(this);
396
- }
397
- });
398
- },
399
- //Hides the picker
400
- hidePicker: function() {
401
- return this.each( function () {
402
- if ($(this).data('colpickId')) {
403
- $('#' + $(this).data('colpickId')).hide();
404
- }
405
- });
406
- },
407
- //Sets a color as new and current (default)
408
- setColor: function(col, setCurrent) {
409
- setCurrent = (typeof setCurrent === "undefined") ? 1 : setCurrent;
410
- if (typeof col == 'string') {
411
- col = hexToHsb(col);
412
- } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
413
- col = rgbToHsb(col);
414
- } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
415
- col = fixHSB(col);
416
- } else {
417
- return this;
418
- }
419
- return this.each(function(){
420
- if ($(this).data('colpickId')) {
421
- var cal = $('#' + $(this).data('colpickId'));
422
- cal.data('colpick').color = col;
423
- cal.data('colpick').origColor = col;
424
- fillRGBFields(col, cal.get(0));
425
- fillHSBFields(col, cal.get(0));
426
- fillHexFields(col, cal.get(0));
427
- setHue(col, cal.get(0));
428
- setSelector(col, cal.get(0));
429
-
430
- setNewColor(col, cal.get(0));
431
- cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 1]);
432
- if(setCurrent) {
433
- setCurrentColor(col, cal.get(0));
434
- }
435
- }
436
- });
437
- }
438
- };
439
- }();
440
- //Color space convertions
441
- var hexToRgb = function (hex) {
442
- var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
443
- return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
444
- };
445
- var hexToHsb = function (hex) {
446
- return rgbToHsb(hexToRgb(hex));
447
- };
448
- var rgbToHsb = function (rgb) {
449
- var hsb = {h: 0, s: 0, b: 0};
450
- var min = Math.min(rgb.r, rgb.g, rgb.b);
451
- var max = Math.max(rgb.r, rgb.g, rgb.b);
452
- var delta = max - min;
453
- hsb.b = max;
454
- hsb.s = max != 0 ? 255 * delta / max : 0;
455
- if (hsb.s != 0) {
456
- if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta;
457
- else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta;
458
- else hsb.h = 4 + (rgb.r - rgb.g) / delta;
459
- } else hsb.h = -1;
460
- hsb.h *= 60;
461
- if (hsb.h < 0) hsb.h += 360;
462
- hsb.s *= 100/255;
463
- hsb.b *= 100/255;
464
- return hsb;
465
- };
466
- var hsbToRgb = function (hsb) {
467
- var rgb = {};
468
- var h = hsb.h;
469
- var s = hsb.s*255/100;
470
- var v = hsb.b*255/100;
471
- if(s == 0) {
472
- rgb.r = rgb.g = rgb.b = v;
473
- } else {
474
- var t1 = v;
475
- var t2 = (255-s)*v/255;
476
- var t3 = (t1-t2)*(h%60)/60;
477
- if(h==360) h = 0;
478
- if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
479
- else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
480
- else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
481
- else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
482
- else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
483
- else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
484
- else {rgb.r=0; rgb.g=0; rgb.b=0}
485
- }
486
- return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
487
- };
488
- var rgbToHex = function (rgb) {
489
- var hex = [
490
- rgb.r.toString(16),
491
- rgb.g.toString(16),
492
- rgb.b.toString(16)
493
- ];
494
- $.each(hex, function (nr, val) {
495
- if (val.length == 1) {
496
- hex[nr] = '0' + val;
497
- }
498
- });
499
- return hex.join('');
500
- };
501
- var hsbToHex = function (hsb) {
502
- return rgbToHex(hsbToRgb(hsb));
503
- };
504
- $.fn.extend({
505
- colpick: colpick.init,
506
- colpickHide: colpick.hidePicker,
507
- colpickShow: colpick.showPicker,
508
- colpickSetColor: colpick.setColor
509
- });
510
- $.extend({
511
- colpick:{
512
- rgbToHex: rgbToHex,
513
- rgbToHsb: rgbToHsb,
514
- hsbToHex: hsbToHex,
515
- hsbToRgb: hsbToRgb,
516
- hexToHsb: hexToHsb,
517
- hexToRgb: hexToRgb
518
- }
519
- });
520
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/widget.min.js CHANGED
@@ -1,5 +1,22 @@
1
  /* packer link http://dean.edwards.name/packer/ */
2
- var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_data, br_reset_all_filters, berocket_filters_first_load;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  (function ($){
4
  $('body').append('<div class="berocket_aapf_widget_loading_preload" style="position:relative; width: 1px; height: 1px;overflow: hidden;">'+the_ajax_script.load_image+'</div>');
5
  $(document).ready(function (){
@@ -18,23 +35,6 @@ var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_d
18
  $date_info.data('value2', value);
19
  }
20
  });
21
- var berocket_aapf_widget_product_filters = [],
22
- berocket_aapf_widget_product_limits = [],
23
- berocket_aapf_widget_product_price_limit = [],
24
- berocket_aapf_attribute_data = {name: [], data: [], jquery: false, loaded: false},
25
- berocket_aapf_child_parent_loaded = true,
26
- woocommerce_pagination_page = 1,
27
- berocket_aapf_widget_wait_for_button = false,
28
- berocket_aapf_widget_selected_filters = [],
29
- berocket_aapf_reset_info = [],
30
- berocket_aapf_404_jump = false,
31
- berocket_aapf_404_jump_fail = false,
32
- berocket_aapf_widget_first_page_jump = true,
33
- $berocket_aapf_last_changed,
34
- berocket_last_ajax_request = null,
35
- berocket_last_ajax_request_id = 1,
36
- berocket_child_no_products = '',
37
- berocket_replace_only_html = false;
38
  if( $(the_ajax_script.products_holder_id).is('.wf-container') ) {
39
  berocket_replace_only_html = true;
40
  }
@@ -534,7 +534,8 @@ var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_d
534
 
535
  update_selected_area();
536
 
537
- if( the_ajax_script.scroll_shop_top ) {
 
538
  var top_scroll_offset = 0;
539
  if( $( the_ajax_script.products_holder_id ).length ) {
540
  top_scroll_offset = $( the_ajax_script.products_holder_id ).offset().top + parseInt(the_ajax_script.scroll_shop_top_px);
@@ -987,6 +988,9 @@ var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_d
987
  }
988
 
989
  function updateLocation( args, pushstate, return_request ){
 
 
 
990
  if ( typeof return_request == 'undefined' ) return_request = false;
991
  uri_request_array = [];
992
  var uri_request = '';
@@ -1291,6 +1295,7 @@ var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_d
1291
  }
1292
  return found;
1293
  }
 
1294
 
1295
  $(document).on("mousedown", ".berocket_aapf_widget input[type=radio]", function(event){
1296
  if ( $(this).prop('checked') ) {
1
  /* packer link http://dean.edwards.name/packer/ */
2
+ var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_data, br_reset_all_filters, berocket_filters_first_load, berocket_in_array;
3
+ var berocket_aapf_widget_product_filters = [],
4
+ berocket_aapf_widget_product_limits = [],
5
+ berocket_aapf_widget_product_price_limit = [],
6
+ berocket_aapf_attribute_data = {name: [], data: [], jquery: false, loaded: false},
7
+ berocket_aapf_child_parent_loaded = true,
8
+ woocommerce_pagination_page = 1,
9
+ berocket_aapf_widget_wait_for_button = false,
10
+ berocket_aapf_widget_selected_filters = [],
11
+ berocket_aapf_reset_info = [],
12
+ berocket_aapf_404_jump = false,
13
+ berocket_aapf_404_jump_fail = false,
14
+ berocket_aapf_widget_first_page_jump = true,
15
+ $berocket_aapf_last_changed,
16
+ berocket_last_ajax_request = null,
17
+ berocket_last_ajax_request_id = 1,
18
+ berocket_child_no_products = '',
19
+ berocket_replace_only_html = false;
20
  (function ($){
21
  $('body').append('<div class="berocket_aapf_widget_loading_preload" style="position:relative; width: 1px; height: 1px;overflow: hidden;">'+the_ajax_script.load_image+'</div>');
22
  $(document).ready(function (){
35
  $date_info.data('value2', value);
36
  }
37
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  if( $(the_ajax_script.products_holder_id).is('.wf-container') ) {
39
  berocket_replace_only_html = true;
40
  }
534
 
535
  update_selected_area();
536
 
537
+ the_ajax_script.scroll_shop_top = parseInt(the_ajax_script.scroll_shop_top);
538
+ if( the_ajax_script.scroll_shop_top == 1 || ( $(window).width() <= 767 && the_ajax_script.scroll_shop_top == 2 ) || ( $(window).width() > 767 && the_ajax_script.scroll_shop_top == 3 ) ) {
539
  var top_scroll_offset = 0;
540
  if( $( the_ajax_script.products_holder_id ).length ) {
541
  top_scroll_offset = $( the_ajax_script.products_holder_id ).offset().top + parseInt(the_ajax_script.scroll_shop_top_px);
988
  }
989
 
990
  function updateLocation( args, pushstate, return_request ){
991
+ if( typeof(newUpdateLocation) == 'function' ) {
992
+ return newUpdateLocation(args, pushstate, return_request);
993
+ }
994
  if ( typeof return_request == 'undefined' ) return_request = false;
995
  uri_request_array = [];
996
  var uri_request = '';
1295
  }
1296
  return found;
1297
  }
1298
+ berocket_in_array = in_array;
1299
 
1300
  $(document).on("mousedown", ".berocket_aapf_widget input[type=radio]", function(event){
1301
  if ( $(this).prop('checked') ) {
libraries/link_parser.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class BeRocket_AAPF_link_parser {
3
+ public $js_parse_result = false;
4
+ public $js_generate_result = false;
5
+ public $php_parse_result = false;
6
+ public $php_generate_result = false;
7
+ public $php_remove_result = false;
8
+ public $using_slug = false;
9
+ public $taxonomy_changer = array();
10
+ function __construct() {
11
+ $BeRocket_AAPF = BeRocket_AAPF::getInstance();
12
+ $option = $BeRocket_AAPF->get_option();
13
+ $this->using_slug = ! empty($option['slug_urls']);
14
+ $this->taxonomy_changer = apply_filters('BR_AAPF_link_parser_taxonomy_changer', array(
15
+ '_stock_status' => array(
16
+ 'taxonomy' => '_stock_status',
17
+ 'terms' => array(
18
+ 0 => '',
19
+ 1 => 'instock',
20
+ 2 => 'outofstock'
21
+ )
22
+ ),
23
+ '_sale' => array(
24
+ 'taxonomy' => '_sale',
25
+ 'terms' => array(
26
+ 0 => '',
27
+ 1 => 'sale',
28
+ 2 => 'notsale'
29
+ )
30
+ ),
31
+ '_rating' => array(
32
+ 'taxonomy' => 'product_visibility',
33
+ ),
34
+ 'price' => array(
35
+ 'taxonomy' => 'price'
36
+ )
37
+ ), $this);
38
+ add_filter('BR_AAPF_link_parser_jsp', array($this, 'js_parse'), 10, 2);
39
+ add_filter('BR_AAPF_link_parser_jsg', array($this, 'js_generate'), 10, 2);
40
+ add_filter('BR_AAPF_link_parser_jsr', array($this, 'js_generate'), 10, 2);
41
+ add_filter('BR_AAPF_link_parser_phpp', array($this, 'php_parse'), 10, 2);
42
+ add_filter('BR_AAPF_link_parser_phpg', array($this, 'php_generate'), 10, 2);
43
+ add_filter('BR_AAPF_link_parser_phpr', array($this, 'php_remove'), 10, 2);
44
+ }
45
+ function js_parse($data, $args = array()) {
46
+ if( $this->js_parse_result === false || ! empty($args['force']) ) {
47
+ if( ! is_array($data) ) {
48
+ $data = array();
49
+ }
50
+ $this->js_parse_result = $this->js_parse_inside($data, $args);
51
+ }
52
+ return $this->js_parse_result;
53
+ }
54
+ function js_generate($data, $args = array()) {
55
+ if( $this->js_generate_result === false || ! empty($args['force']) ) {
56
+ if( ! is_array($data) ) {
57
+ $data = array();
58
+ }
59
+ $this->js_generate_result = $this->js_generate_inside($data, $args);
60
+ }
61
+ return $this->js_generate_result;
62
+ }
63
+ function php_parse($data, $args = array()) {
64
+ if( $this->php_parse_result === false || ! empty($args['force']) ) {
65
+ if( ! is_array($data) ) {
66
+ $data = array();
67
+ }
68
+ $this->php_parse_result = $this->php_parse_inside($data, $args);
69
+ }
70
+ return $this->php_parse_result;
71
+ }
72
+ function php_generate($data, $args = array()) {
73
+ if( ! is_array($data) ) {
74
+ $data = array();
75
+ }
76
+ $this->php_generate_result = $this->php_generate_inside($data, $args);
77
+ return $this->php_generate_result;
78
+ }
79
+ function php_remove($data, $args = array()) {
80
+ if( ! is_array($data) ) {
81
+ $data = array();
82
+ }
83
+ $this->php_remove_result = $this->php_remove_inside($data, $args);
84
+ return $this->php_remove_result;
85
+ }
86
+ function js_parse_inside($data, $args = array()) {
87
+ return $data;
88
+ }
89
+ function js_generate_inside($data, $args = array()) {
90
+ return $data;
91
+ }
92
+ function js_remove_filters($data, $args = array()) {
93
+ return $data;
94
+ }
95
+ function php_parse_inside($data, $args = array()) {
96
+ return $data;
97
+ }
98
+ function php_generate_inside($data, $args = array()) {
99
+ return $data;
100
+ }
101
+ function php_remove_inside($data, $args = array()) {
102
+ $link_data = $this->get_query_vars_name();
103
+ return remove_query_arg($link_data['var_names'], $this->get_query_vars_name_link(br_get_value_from_array($args, array('link'), false)));
104
+ }
105
+ function get_query_vars_name_link($link = false) {
106
+ if( $link === false ) {
107
+ $link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
108
+ }
109
+ return $link;
110
+ }
111
+ function get_query_vars_name($link = false) {
112
+ return array();
113
+ }
114
+ function check_taxonomy($taxonomy) {
115
+ if( taxonomy_exists( 'pa_'.$taxonomy ) ) {
116
+ return 'pa_'.$taxonomy;
117
+ } elseif( taxonomy_exists( $taxonomy ) ) {
118
+ return $taxonomy;
119
+ } elseif ( array_key_exists($taxonomy, $this->taxonomy_changer) ) {
120
+ return $this->taxonomy_changer[$taxonomy]['taxonomy'];
121
+ }
122
+ return false;
123
+ }
124
+ function get_term_taxonomy($taxonomy, $term) {
125
+ if ( array_key_exists($taxonomy, $this->taxonomy_changer) ) {
126
+ $term_data = array(
127
+ 'term_group' => 0,
128
+ 'taxonomy' => $taxonomy,
129
+ 'description' => '',
130
+ 'parent' => 0,
131
+ 'count' => 1
132
+ );
133
+ $terms = $this->taxonomy_changer[$taxonomy]['terms'];
134
+ if( $this->using_slug ) {
135
+ $term_data['slug'] = $term_data['name'] = $term;
136
+ $term_data['term_id'] = $term_data['term_taxonomy_id'] = array_search( $term, $terms );
137
+ } else {
138
+ $term_data['term_id'] = $term_data['term_taxonomy_id'] = $term;
139
+ $term_data['slug'] = $term_data['name'] = $terms[$term];
140
+ }
141
+ $term_data = (object)$term_data;
142
+ } else {
143
+ $term_data = get_term_by( ($this->using_slug ? 'slug' : 'term_id'), $term, $taxonomy, 'OBJECT' );
144
+ }
145
+ return $term_data;
146
+ }
147
+ }
main.php CHANGED
@@ -12,6 +12,7 @@ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
12
  require_once dirname( __FILE__ ) . '/wizard/main.php';
13
  include_once(plugin_dir_path( __FILE__ ) . "includes/compatibility/product-table.php");
14
  $br_aapf_debugs = array();
 
15
  class BeRocket_AAPF extends BeRocket_Framework {
16
  public static $settings_name = 'br_filters_options';
17
  public $info, $defaults, $values, $notice_array, $conditions;
@@ -150,6 +151,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
150
  'tags_custom' => '1',
151
  'ajax_site' => '',
152
  'search_fix' => '1',
 
153
  'disable_font_awesome' => '',
154
  'debug_mode' => '',
155
  'ajax_request_load' => '1',
@@ -315,8 +317,10 @@ class BeRocket_AAPF extends BeRocket_Framework {
315
  }
316
  public function init () {
317
  parent::init();
318
-
319
  $option = $this->get_option();
 
 
 
320
  if( ! empty($option['disable_font_awesome']) ) {
321
  wp_dequeue_style( 'font-awesome' );
322
  }
@@ -451,12 +455,18 @@ class BeRocket_AAPF extends BeRocket_Framework {
451
  'scroll_shop_top' => array(
452
  "label" => __( 'Scroll page to the top', "BeRocket_AJAX_domain" ),
453
  "items" => array(
454
- array(
455
- "type" => "checkbox",
456
- "name" => "scroll_shop_top",
 
457
  "class" => "br_scroll_shop_top",
458
- "value" => '1',
459
- 'label_for' => __("Check if you want scroll page to the top of shop after filters change", 'BeRocket_AJAX_domain') . '<br>',
 
 
 
 
 
460
  ),
461
  array(
462
  "type" => "number",
@@ -596,12 +606,12 @@ class BeRocket_AAPF extends BeRocket_Framework {
596
  ),
597
  'SEO' => array(
598
  'seo_friendly_urls' => array(
599
- "label" => __( 'SEO friendly urls', "BeRocket_AJAX_domain" ),
600
  "type" => "checkbox",
601
  "name" => "seo_friendly_urls",
602
  "value" => '1',
603
  'class' => 'berocket_seo_friendly_urls',
604
- 'label_for' => __("If this option is on url will be changed when filter is selected/changed", 'BeRocket_AJAX_domain'),
605
  ),
606
  'slug_urls' => array(
607
  "label" => __( 'Use slug in URL', "BeRocket_AJAX_domain" ),
@@ -769,6 +779,17 @@ class BeRocket_AAPF extends BeRocket_Framework {
769
  "value" => '1',
770
  'label_for' => __('Try to enable this if widget with tags didn\'t work.', 'BeRocket_AJAX_domain'),
771
  ),
 
 
 
 
 
 
 
 
 
 
 
772
  'global_font_awesome_disable' => array(
773
  "label" => __( 'Disable Font Awesome', "BeRocket_AJAX_domain" ),
774
  "type" => "checkbox",
@@ -1111,7 +1132,7 @@ function load_fix_ajax_request_load() {
1111
  load_fix_ajax_request_load();
1112
  jQuery(document).on('change', '.load_fix_ajax_request_load', load_fix_ajax_request_load);
1113
  function br_scroll_shop_top() {
1114
- if( jQuery('.br_scroll_shop_top').prop('checked') ) {
1115
  jQuery('.br_scroll_shop_top_px').parent().show();
1116
  } else {
1117
  jQuery('.br_scroll_shop_top_px').parent().hide();
@@ -1153,22 +1174,9 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1153
  parent::admin_init();
1154
  add_action('berocket_fix_WC_outofstock', array($this, 'fix_WC_outofstock'), 10, 1);
1155
  $this->create_berocket_term_table();
1156
- if ( is_admin() ) {
1157
- /* BeRocket WordPress Admin menu styles */
1158
- wp_register_style(
1159
- 'berocket_framework_global_admin_style',
1160
- plugins_url( 'css/global-admin.css', __FILE__ ),
1161
- "",
1162
- $this->info[ 'version' ]
1163
- );
1164
- wp_enqueue_style( 'berocket_framework_global_admin_style' );
1165
- }
1166
- wp_register_style( 'berocket_aapf_widget-colorpicker-style', plugins_url( 'css/colpick.css', __FILE__ ) );
1167
  wp_register_style( 'berocket_aapf_widget-admin-style', plugins_url( 'css/admin.css', __FILE__ ), "", BeRocket_AJAX_filters_version );
1168
  wp_register_style( 'brjsf-ui', plugins_url( 'css/brjsf.css', __FILE__ ), "", BeRocket_AJAX_filters_version );
1169
- wp_enqueue_style( 'berocket_aapf_widget-colorpicker-style' );
1170
  wp_enqueue_style( 'berocket_aapf_widget-admin-style' );
1171
- wp_register_script( 'berocket_aapf_widget-colorpicker', plugins_url( 'js/colpick.js', __FILE__ ), array( 'jquery' ) );
1172
  wp_register_script( 'brjsf-ui', plugins_url( 'js/brjsf.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version );
1173
  wp_register_script( 'berocket_aapf_widget-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version, false );
1174
  register_setting( 'br_filters_plugin_options', 'br_filters_options', array( $this, 'sanitize_aapf_option' ) );
@@ -2502,7 +2510,9 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
2502
  )
2503
  );
2504
  foreach($variation_ids as $variation_id) {
2505
- as_schedule_single_action( time(), 'berocket_fix_WC_outofstock', array($variation_id), 'BeRocket' );
 
 
2506
  }
2507
  }
2508
  public function sanitize_option( $input ) {
12
  require_once dirname( __FILE__ ) . '/wizard/main.php';
13
  include_once(plugin_dir_path( __FILE__ ) . "includes/compatibility/product-table.php");
14
  $br_aapf_debugs = array();
15
+ include_once(plugin_dir_path( __FILE__ ) . "libraries/link_parser.php");
16
  class BeRocket_AAPF extends BeRocket_Framework {
17
  public static $settings_name = 'br_filters_options';
18
  public $info, $defaults, $values, $notice_array, $conditions;
151
  'tags_custom' => '1',
152
  'ajax_site' => '',
153
  'search_fix' => '1',
154
+ 'use_tax_for_price' => '',
155
  'disable_font_awesome' => '',
156
  'debug_mode' => '',
157
  'ajax_request_load' => '1',
317
  }
318
  public function init () {
319
  parent::init();
 
320
  $option = $this->get_option();
321
+ if( ! empty($option['use_tax_for_price']) ) {
322
+ include_once(plugin_dir_path( __FILE__ ) . "includes/addons/price_include_tax.php");
323
+ }
324
  if( ! empty($option['disable_font_awesome']) ) {
325
  wp_dequeue_style( 'font-awesome' );
326
  }
455
  'scroll_shop_top' => array(
456
  "label" => __( 'Scroll page to the top', "BeRocket_AJAX_domain" ),
457
  "items" => array(
458
+ 'scroll_shop_top' => array(
459
+ "label" => __( 'Selected filters position', "BeRocket_AJAX_domain" ),
460
+ "name" => "scroll_shop_top",
461
+ "type" => "selectbox",
462
  "class" => "br_scroll_shop_top",
463
+ "options" => array(
464
+ array('value' => '0', 'text' => __('Disable', 'BeRocket_AJAX_domain')),
465
+ array('value' => '1', 'text' => __('Mobile and Desktop', 'BeRocket_AJAX_domain')),
466
+ array('value' => '2', 'text' => __('Mobile', 'BeRocket_AJAX_domain')),
467
+ array('value' => '3', 'text' => __('Desktop', 'BeRocket_AJAX_domain')),
468
+ ),
469
+ "value" => 'woocommerce_archive_description',
470
  ),
471
  array(
472
  "type" => "number",
606
  ),
607
  'SEO' => array(
608
  'seo_friendly_urls' => array(
609
+ "label" => __( 'Update URL on filtering', "BeRocket_AJAX_domain" ),
610
  "type" => "checkbox",
611
  "name" => "seo_friendly_urls",
612
  "value" => '1',
613
  'class' => 'berocket_seo_friendly_urls',
614
+ 'label_for' => __("If this option is on URL will be changed when filter is selected/changed", 'BeRocket_AJAX_domain'),
615
  ),
616
  'slug_urls' => array(
617
  "label" => __( 'Use slug in URL', "BeRocket_AJAX_domain" ),
779
  "value" => '1',
780
  'label_for' => __('Try to enable this if widget with tags didn\'t work.', 'BeRocket_AJAX_domain'),
781
  ),
782
+ 'use_tax_for_price' => array(
783
+ "label" => __( 'Use Tax options for price', "BeRocket_AJAX_domain" ),
784
+ "label_for"=> __( 'Only Standard tax rates will be applied for prices', "BeRocket_AJAX_domain" ),
785
+ "name" => "use_tax_for_price",
786
+ "type" => "selectbox",
787
+ "options" => array(
788
+ array('value' => '', 'text' => __('Do not use (filter price as it is set in products)', 'BeRocket_AJAX_domain')),
789
+ array('value' => 'var1', 'text' => __('Use tax options', 'BeRocket_AJAX_domain')),
790
+ ),
791
+ "value" => '',
792
+ ),
793
  'global_font_awesome_disable' => array(
794
  "label" => __( 'Disable Font Awesome', "BeRocket_AJAX_domain" ),
795
  "type" => "checkbox",
1132
  load_fix_ajax_request_load();
1133
  jQuery(document).on('change', '.load_fix_ajax_request_load', load_fix_ajax_request_load);
1134
  function br_scroll_shop_top() {
1135
+ if( parseInt(jQuery('.br_scroll_shop_top').val()) ) {
1136
  jQuery('.br_scroll_shop_top_px').parent().show();
1137
  } else {
1138
  jQuery('.br_scroll_shop_top_px').parent().hide();
1174
  parent::admin_init();
1175
  add_action('berocket_fix_WC_outofstock', array($this, 'fix_WC_outofstock'), 10, 1);
1176
  $this->create_berocket_term_table();
 
 
 
 
 
 
 
 
 
 
 
1177
  wp_register_style( 'berocket_aapf_widget-admin-style', plugins_url( 'css/admin.css', __FILE__ ), "", BeRocket_AJAX_filters_version );
1178
  wp_register_style( 'brjsf-ui', plugins_url( 'css/brjsf.css', __FILE__ ), "", BeRocket_AJAX_filters_version );
 
1179
  wp_enqueue_style( 'berocket_aapf_widget-admin-style' );
 
1180
  wp_register_script( 'brjsf-ui', plugins_url( 'js/brjsf.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version );
1181
  wp_register_script( 'berocket_aapf_widget-admin', plugins_url( 'js/admin.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version, false );
1182
  register_setting( 'br_filters_plugin_options', 'br_filters_options', array( $this, 'sanitize_aapf_option' ) );
2510
  )
2511
  );
2512
  foreach($variation_ids as $variation_id) {
2513
+ if( function_exists('as_schedule_single_action') ) {
2514
+ as_schedule_single_action( time(), 'berocket_fix_WC_outofstock', array($variation_id), 'BeRocket' );
2515
+ }
2516
  }
2517
  }
2518
  public function sanitize_option( $input ) {
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: dholovnia, berocket
4
  Donate link: http://berocket.com/product/woocommerce-ajax-products-filter
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
- Tested up to: 5.2
8
- Stable tag: 1.3.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -187,6 +187,14 @@ You can try this plugin's admin side [here](http://berocket.com/product/woocomme
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
 
 
 
190
  = 1.3.2.4 =
191
  * Fix - Incorrect description
192
  * Fix - Selected filters area Attribute name
4
  Donate link: http://berocket.com/product/woocommerce-ajax-products-filter
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
+ Tested up to: 5.2.1
8
+ Stable tag: 1.3.2.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
187
 
188
  == Changelog ==
189
 
190
+ = 1.3.2.5 =
191
+ * Enhancement - Option to use Standard tax rates for price filter
192
+ * Enhancement - Separate Query Vars addon option to set Default operator for URLs
193
+ * Enhancement - Separate Query Vars addon lower case operator text in URLs
194
+ * Enhancement - Option to set devices where scroll to the top will be used
195
+ * Fix - Attribute slider
196
+ * Fix - PHP notices/errors
197
+
198
  = 1.3.2.4 =
199
  * Fix - Incorrect description
200
  * Fix - Selected filters area Attribute name
templates/filter_post.php CHANGED
@@ -238,6 +238,23 @@ $custom_taxonomies = array_combine($custom_taxonomies, $custom_taxonomies);
238
  </div> <?php
239
  }
240
  ?><div><a href="#add" class="berocket_add_ranges" data-html='<div class="berocket_ranges"><input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="1"><a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a></div>'><i class="fa fa-plus"></i></a></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  <label>
242
  <input type="checkbox" name="<?php echo $post_name.'[hide_first_last_ranges]'; ?>" <?php if ( ! empty($instance['hide_first_last_ranges']) ) echo 'checked'; ?> value="1" />
243
  <?php _e('Hide first and last ranges without products', 'BeRocket_AJAX_domain') ?>
238
  </div> <?php
239
  }
240
  ?><div><a href="#add" class="berocket_add_ranges" data-html='<div class="berocket_ranges"><input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="1"><a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a></div>'><i class="fa fa-plus"></i></a></div>
241
+ <label>
242
+ <select name="<?php echo $post_name.'[range_display_type]'; ?>">
243
+ <optgroup label="<?php _e('Ranges: 1,100,200,1000', 'BeRocket_AJAX_domain'); ?>">
244
+ <?php
245
+ $range_types = array(
246
+ array('value' => '', 'name' => __('1.00-100.00, 101.00-200.00, 201.00-1000.00', 'BeRocket_AJAX_domain')),
247
+ array('value' => 'same', 'name' => __('1.00-100.00, 100.00-200.00, 200.00-1000.00', 'BeRocket_AJAX_domain')),
248
+ array('value' => 'decimal', 'name' => __('1.00-99.99, 100.00-199.99, 200.00-1000.00', 'BeRocket_AJAX_domain')),
249
+ );
250
+ foreach($range_types as $range_type) {
251
+ echo '<option value="'.$range_type['value'].'"'.(br_get_value_from_array($instance, 'range_display_type') == $range_type['value'] ? ' selected' : '').'>'.$range_type['name'].'</option>';
252
+ }
253
+ ?>
254
+ </optgroup>
255
+ </select>
256
+ </label>
257
+ <br />
258
  <label>
259
  <input type="checkbox" name="<?php echo $post_name.'[hide_first_last_ranges]'; ?>" <?php if ( ! empty($instance['hide_first_last_ranges']) ) echo 'checked'; ?> value="1" />
260
  <?php _e('Hide first and last ranges without products', 'BeRocket_AJAX_domain') ?>
templates/free/free/features.php DELETED
@@ -1,298 +0,0 @@
1
- <div class="row berocket_aapf_features">
2
- <div>
3
- <h4>Choose best layout for your filter</h4>
4
-
5
- <h5>Our WooCommerce AJAX Products Filter offers several layouts including slider, image and color</h5>
6
-
7
- <div class="demo-site">
8
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
9
- </div>
10
- <img alt="Choose best layout for your filter" src="https://berocket.com/images/features/filters/filters-types.jpg" />
11
- </div>
12
-
13
- <div>
14
- <h4>Pagination and Order without page reloading</h4>
15
-
16
- <h5>Users will get next page loaded ordered by their preferences and without page reloading</h5>
17
-
18
- <div class="demo-site">
19
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
20
- </div>
21
-
22
- <img alt="Pagination and Order without page reloading" src="https://berocket.com/images/features/filters/ajax_order_nav.jpg" />
23
- </div>
24
-
25
- <div>
26
- <h4>Show filters above products</h4>
27
-
28
- <h5>Need more space for the products? Say no to sidebars</h5>
29
-
30
- <div class="demo-site">
31
- <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/" target="_blank">[ demo site ]</a>
32
- </div>
33
- <img alt="Show filters above products" src="https://berocket.com/images/features/filters/above_products.jpg" />
34
- </div>
35
-
36
- <div>
37
- <h4>SEO friendly urls</h4>
38
-
39
- <h5>Use Nice URLs with canonicalization and slugs instead of IDs</h5>
40
-
41
- <div class="demo-site">
42
- <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/" target="_blank">[ demo site ]</a>
43
- </div>
44
-
45
- <div>&nbsp;</div>
46
- <img alt="SEO friendly urls" src="https://berocket.com/images/features/filters/urls.jpg" />
47
- </div>
48
-
49
- <div class="premium_buttons">
50
- <span>Read more about</span>
51
- <a class="get_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=block_get_premium" target="_blank">PREMIUM VERSION</a>
52
- <span class="divider">OR</span>
53
- <a class="buy_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter/SAVE15?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=block_buy_premium" target="_blank">BUY NOW</a>
54
- <span>and get <b>15% discount</b></span>
55
- </div>
56
- <div class="clear"></div>
57
-
58
- <div>
59
- <h4>Show results before filtering</h4>
60
-
61
- <h5>Show users what they will get before filters applied. Fast and efficient</h5>
62
-
63
- <div class="demo-site">
64
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
65
- </div>
66
-
67
- <div>&nbsp;</div>
68
-
69
- <img alt="Show results before filtering" src="https://berocket.com/images/features/filters/before_filter.jpg" />
70
- </div>
71
-
72
- <div>
73
- <h4>Include/Exclude values</h4>
74
-
75
- <h5>Show only needed values from the attribute or hide few</h5>
76
-
77
- <div class="demo-site">
78
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
79
- </div>
80
- <img alt="Include/Exclude values" src="https://berocket.com/images/features/filters/include_exclude.jpg" />
81
- </div>
82
-
83
- <div>
84
- <h4>Search Box on any page</h4>
85
-
86
- <h5>Users can pre-fill filters before visiting shop page</h5>
87
-
88
- <div class="demo-site">
89
- <a href="https://woocommerce-products-filter.berocket.com/" target="_blank">[ demo site ]</a>
90
- </div>
91
- <img alt="Search Box on any page" src="https://berocket.com/images/features/filters/searchbox.jpg" />
92
- </div>
93
-
94
- <div>
95
- <h4>Update filters with user needs</h4>
96
-
97
- <h5>Hate &quot;No Products!&quot; message? Hide values without products on the go</h5>
98
-
99
- <div class="demo-site">
100
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
101
- </div>
102
-
103
- <div>&nbsp;</div>
104
- <img alt="Update filters with user needs" src="https://berocket.com/images/features/filters/reload.jpg" />
105
- </div>
106
-
107
-
108
- <div class="premium_buttons">
109
- <span>Read more about</span>
110
- <a class="get_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=single_get_premium" target="_blank">PREMIUM VERSION</a>
111
- </div>
112
- <div class="clear"></div>
113
-
114
-
115
- <div>
116
- <h4>Brands<br />
117
- <small>(require our Brands plugin)</small></h4>
118
-
119
- <h5>Users love brands. Help them find favorite brands faster</h5>
120
-
121
- <div class="demo-site">
122
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/" target="_blank">[ demo site ]</a>
123
- </div>
124
- <img alt="Brands" src="https://berocket.com/images/features/filters/brands.jpg" />
125
- </div>
126
-
127
- <div>
128
- <h4>Price Ranges and Sliders for Attributes</h4>
129
-
130
- <h5>Love sliders? Use them now for the attributes too!</h5>
131
-
132
- <div class="demo-site">
133
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-2/" target="_blank">[ demo site ]</a>
134
- </div>
135
- <img alt="Price Ranges and Sliders for Attributes" src="https://berocket.com/images/features/filters/range_slider.jpg" />
136
- </div>
137
-
138
-
139
- <div class="center">
140
- <h4>WPML and Polylang compatibility</h4>
141
-
142
- <h5>EASILY TRANSLATE THE PLUGIN TO OTHER LANGUAGES WITH THE POWERFUL WPML AND POLYLANG TOOLS</h5>
143
- <img alt="WPML and Polylang compatibility" src="https://berocket.com/img/docs/wpml_polylang.png" />
144
- </div>
145
-
146
-
147
- <div class="premium_buttons">
148
- <a class="buy_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter/SAVE15?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=single_buy_premium" target="_blank">BUY NOW</a>
149
- <span>and get <b>15% discount</b></span>
150
- </div>
151
-
152
- <div class="clear"></div>
153
- </div>
154
- <style>
155
- .berocket_aapf_features {
156
- background-color: white;
157
- }
158
- .berocket_aapf_features > div {
159
- width: 50%;
160
- float: left;
161
- padding: 50px 10px 10px;
162
- box-sizing: border-box;
163
- background-color: white;
164
- }
165
- .berocket_aapf_features > div:nth-child(2n+1) {
166
- clear: left;
167
- }
168
- .berocket_aapf_features > div.center {
169
- margin: 0 auto;
170
- float: none;
171
- clear: both;
172
- }
173
- .berocket_aapf_features img {
174
- max-width: 100%;
175
- margin:auto;
176
- display: block;
177
- }
178
- .berocket_aapf_features h4,
179
- .berocket_aapf_features h5,
180
- .berocket_aapf_features .demo-site {
181
- text-align: center;
182
- line-height: 1.2em;
183
- }
184
- .berocket_aapf_features h5 {
185
- font-size: 17px;
186
- font-weight: 500;
187
- }
188
- .berocket_aapf_features h4 {
189
- font-size: 26px;
190
- font-weight: 700;
191
- text-transform: uppercase;
192
- }
193
- .berocket_aapf_features > div.clear {
194
- float: none;
195
- width: auto;
196
- }
197
-
198
-
199
- .berocket_aapf_features > div.premium_buttons {
200
- margin: 30px auto 20px;
201
- float: none;
202
- width: 600px;
203
- text-align: center;
204
- max-width: 100%;
205
- padding-top: 100px;
206
- }
207
-
208
- .berocket_aapf_features .buy_premium_version,
209
- .berocket_aapf_features .get_premium_version{
210
- margin-top: 30px;
211
- margin-bottom: 20px;
212
- color: #fff;
213
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
214
- text-shadow: none;
215
- border: 0 none;
216
- min-width: 120px;
217
- -moz-user-select: none;
218
- background: #ff5252 none repeat scroll 0 0;
219
- box-sizing: border-box;
220
- cursor: pointer;
221
- display: inline-block;
222
- font-size: 14px;
223
- outline: 0 none;
224
- padding: 8px;
225
- position: relative;
226
- text-align: center;
227
- text-decoration: none;
228
- transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0s, background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0s;
229
- white-space: nowrap;
230
- height: auto;
231
- vertical-align: top;
232
- line-height: 25px;
233
- border-radius: 3px;
234
- font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
235
- font-weight: bold;
236
- }
237
-
238
- .berocket_aapf_features .get_premium_version,
239
- .berocket_aapf_features .buy_premium_version {
240
- width: 90%;
241
- }
242
- .berocket_aapf_features .get_premium_version {
243
- margin: 5px 0;
244
- background: transparent;
245
- border: 2px solid #97b9cf;
246
- color: #7496ad;
247
- }
248
- .berocket_aapf_features .buy_premium_version {
249
- margin: 5px 0 15px;
250
- padding: 10px;
251
- }
252
- .berocket_aapf_features .premium_buttons span {
253
- display: block;
254
- color: #7496ad;
255
- }
256
- .berocket_aapf_features .premium_buttons span.divider {
257
- line-height: 2.4em;
258
- font-size: 20px;
259
- font-weight: bold;
260
- position: relative;
261
- }
262
- .berocket_aapf_features .premium_buttons span.divider:before,
263
- .berocket_aapf_features .premium_buttons span.divider:after{
264
- position: absolute;
265
- top: 50%;
266
- left: 5%;
267
- right: 60%;
268
- height: 1px;
269
- background: #97b9cf;
270
- content: "";
271
- }
272
- .berocket_aapf_features .premium_buttons span.divider:after{
273
- left: 60%;
274
- right: 5%;
275
- }
276
- .berocket_aapf_features .premium_buttons span:last-child b{
277
- font-size: 16px;
278
- }
279
- .berocket_aapf_features .buy_premium_version:hover,
280
- .berocket_aapf_features .buy_premium_version:focus,
281
- .berocket_aapf_features .buy_premium_version:active {
282
- background: #ff6e68 none repeat scroll 0 0;
283
- color: white;
284
- }
285
- .berocket_aapf_features .get_premium_version:hover,
286
- .berocket_aapf_features .get_premium_version:focus,
287
- .berocket_aapf_features .get_premium_version:active{
288
- background: #97b9cf;
289
- color: white;
290
- }
291
-
292
- @media screen and (max-width: 767px){
293
- .berocket_aapf_features > div {
294
- width: 100%;
295
- float: none;
296
- }
297
- }
298
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
woocommerce-filters.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.3.2.4
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
@@ -11,8 +11,8 @@
11
  * License URI: http://berocket.com/license
12
  * Text Domain: BeRocket_AJAX_domain
13
  * Domain Path: /languages/
14
- * WC tested up to: 3.6.2
15
  */
16
- define( "BeRocket_AJAX_filters_version", '1.3.2.4' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.3.2.5
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
11
  * License URI: http://berocket.com/license
12
  * Text Domain: BeRocket_AJAX_domain
13
  * Domain Path: /languages/
14
+ * WC tested up to: 3.6.4
15
  */
16
+ define( "BeRocket_AJAX_filters_version", '1.3.2.5' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');