PageSourceSearch

https://amer.com/wp-content/plugins/woocommerce-products-filter/js/html_types/checkbox.js

js amer.com collected 2026-10-05 19:21:39 UTC 3,262 bytes, 92 lines download raw bytes

1function woof_init_checkboxes() {
2    if (icheck_skin != 'none') {
3        jQuery('.woof_checkbox_term').iCheck('destroy');
4
5        jQuery('.woof_checkbox_term').iCheck({
6            checkboxClass: 'icheckbox_' + icheck_skin.skin + '-' + icheck_skin.color,
7            //checkboxClass: 'icheckbox_square-green'
8        });
9
10
11        jQuery('.woof_checkbox_term').unbind('ifChecked');
12        jQuery('.woof_checkbox_term').on('ifChecked', function (event) {
13            jQuery(this).attr("checked", true);
14            jQuery(".woof_select_radio_check input").attr('disabled','disabled');
15            woof_checkbox_process_data(this, true);
16        });
17
18        jQuery('.woof_checkbox_term').unbind('ifUnchecked');
19        jQuery('.woof_checkbox_term').on('ifUnchecked', function (event) {
20            jQuery(this).attr("checked", false);
21            woof_checkbox_process_data(this, false);
22        });
23
24        //this script should be, because another way wrong way of working if to click on the label
25        jQuery('.woof_checkbox_label').unbind();
26        jQuery('label.woof_checkbox_label').click(function () {
27            if (jQuery(this).prev().find('.woof_checkbox_term').is(':checked')) {
28                jQuery(this).prev().find('.woof_checkbox_term').trigger('ifUnchecked');
29                jQuery(this).prev().removeClass('checked');
30            } else {
31                jQuery(this).prev().find('.woof_checkbox_term').trigger('ifChecked');
32                jQuery(this).prev().addClass('checked');
33            }
34            
35            return false;
36        });
37        //***
38
39    } else {
40        jQuery('.woof_checkbox_term').on('change', function (event) {
41            if (jQuery(this).is(':checked')) {
42                jQuery(this).attr("checked", true);
43                woof_checkbox_process_data(this, true);
44            } else {
45                jQuery(this).attr("checked", false);
46                woof_checkbox_process_data(this, false);
47            }
48        });
49    }
50}
51function woof_checkbox_process_data(_this, is_checked) {
52    var tax = jQuery(_this).data('tax');
53    var name = jQuery(_this).attr('name');
54    var term_id = jQuery(_this).data('term-id');
55    woof_checkbox_direct_search(term_id, name, tax, is_checked);
56}
57function woof_checkbox_direct_search(term_id, name, tax, is_checked) {
58
59    var values = '';
60    var checked = true;
61    if (is_checked) {
62        if (tax in woof_current_values) {
63            woof_current_values[tax] = woof_current_values[tax] + ',' + name;
64        } else {
65            woof_current_values[tax] = name;
66        }
67        checked = true;
68    } else {
69        values = woof_current_values[tax];
70        values = values.split(',');
71        var tmp = [];
72        jQuery.each(values, function (index, value) {
73            if (value != name) {
74                tmp.push(value);
75            }
76        });
77        values = tmp;
78        if (values.length) {
79            woof_current_values[tax] = values.join(',');
80        } else {
81            delete woof_current_values[tax];
82        }
83        checked = false;
84    }
85    jQuery('.woof_checkbox_term_' + term_id).attr('checked', checked);
86    woof_ajax_page_num = 1;
87    if (woof_autosubmit) {
88        woof_submit_link(woof_get_submit_link());
89    }
90}
91
92

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.