PageSourceSearch

https://swiss-qube.com/app/plugins/clever-woocommerce-product-filter/assets/js/html_types/radio.js?ver=1.0.6

js swiss-qube.com collected 2026-10-06 18:53:20 UTC 4,059 bytes, 93 lines download raw bytes

1function cwpf_init_radios() {
2    if (icheck_skin != 'none') {
3        jQuery('.cwpf_radio_term').iCheck('destroy');
4
5        jQuery('.cwpf_radio_term').iCheck({
6            radioClass: 'iradio_' + icheck_skin.skin + '-' + icheck_skin.color,
7            //radioClass: 'iradio_square-green'        
8        });
9
10        jQuery('.cwpf_radio_term').unbind('ifChecked');
11        jQuery('.cwpf_radio_term').on('ifChecked', function (event) {
12            jQuery(this).attr("checked", true);
13            jQuery(this).parents('.cwpf_list').find('.cwpf_radio_term_reset').removeClass('cwpf_radio_term_reset_visible');
14            jQuery(this).parents('.cwpf_list').find('.cwpf_radio_term_reset').hide();
15            jQuery(this).parents('li').eq(0).find('.cwpf_radio_term_reset').eq(0).addClass('cwpf_radio_term_reset_visible');
16            var slug = jQuery(this).data('slug');
17            var name = jQuery(this).attr('name');
18            var term_id = jQuery(this).data('term-id');
19            cwpf_radio_direct_search(term_id, name, slug);
20        });
21        
22
23        //this script should be, because another way wrong way of working if to click on the label - removed
24        /*
25        jQuery('.cwpf_radio_label').unbind();
26        jQuery('label.cwpf_radio_label').click(function () {
27            jQuery(this).prev().find('.cwpf_radio_term').trigger('ifChecked');
28            jQuery(this).parents('.cwpf_list_radio').find('.checked').removeClass('checked');            
29            jQuery(this).prev().addClass('checked');
30            return false;
31        });
32        */
33        //***
34
35  
36         
37    } else {
38        jQuery('.cwpf_radio_term').on('change', function (event) {
39            jQuery(this).attr("checked", true);
40            var slug = jQuery(this).data('slug');
41            var name = jQuery(this).attr('name');
42            var term_id = jQuery(this).data('term-id');
43			
44			jQuery(this).parents('.cwpf_list').find('.cwpf_radio_term_reset').removeClass('cwpf_radio_term_reset_visible');
45            jQuery(this).parents('.cwpf_list').find('.cwpf_radio_term_reset').hide();
46            jQuery(this).parents('li').eq(0).find('.cwpf_radio_term_reset').eq(0).addClass('cwpf_radio_term_reset_visible');
47			
48            cwpf_radio_direct_search(term_id, name, slug);
49        });
50    }
51
52    //***
53
54    jQuery('.cwpf_radio_term_reset').click(function () {
55        cwpf_radio_direct_search(jQuery(this).data('term-id'), jQuery(this).attr('data-name'), 0);
56        jQuery(this).parents('.cwpf_list').find('.checked').removeClass('checked');
57        jQuery(this).parents('.cwpf_list').find('input[type=radio]').removeAttr('checked');
58        //jQuery(this).remove();
59        jQuery(this).removeClass('cwpf_radio_term_reset_visible');
60        return false;
61    });
62}
63
64
65function cwpf_radio_direct_search(term_id, name, slug) {
66
67    jQuery.each(cwpf_current_values, function (index, value) {
68        if (index == name) {
69            delete cwpf_current_values[name];
70            return;
71        }
72    });
73
74    if (slug != 0) {
75        cwpf_current_values[name] = slug;
76        jQuery('a.cwpf_radio_term_reset_' + term_id).hide();
77        jQuery('cwpf_radio_term_' + term_id).filter(':checked').parents('li').find('a.cwpf_radio_term_reset').show();
78        jQuery('cwpf_radio_term_' + term_id).parents('ul.cwpf_list').find('label').css({'fontWeight': 'normal'});
79        jQuery('cwpf_radio_term_' + term_id).filter(':checked').parents('li').find('label.cwpf_radio_label_' + slug).css({'fontWeight': 'bold'});
80    } else {
81        jQuery('a.cwpf_radio_term_reset_' + term_id).hide();
82        jQuery('cwpf_radio_term_' + term_id).attr('checked', false);
83        jQuery('cwpf_radio_term_' + term_id).parent().removeClass('checked');
84        jQuery('cwpf_radio_term_' + term_id).parents('ul.cwpf_list').find('label').css({'fontWeight': 'normal'});
85    }
86
87    cwpf_ajax_page_num = 1;
88    if (cwpf_autosubmit) {
89        cwpf_submit_link(cwpf_get_submit_link());
90    }
91}
92
93

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.