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