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(':disabled')){ 28 return false; 29 } 30 if (jQuery(this).prev().find('.woof_checkbox_term').is(':checked')) { 31 jQuery(this).prev().find('.woof_checkbox_term').trigger('ifUnchecked'); 32 jQuery(this).prev().removeClass('checked'); 33 } else { 34 jQuery(this).prev().find('.woof_checkbox_term').trigger('ifChecked'); 35 jQuery(this).prev().addClass('checked'); 36 } 37 38 39 }); 40 //*** 41 42 } else { 43 jQuery('.woof_checkbox_term').on('change', function (event) { 44 if (jQuery(this).is(':checked')) { 45 jQuery(this).attr("checked", true); 46 woof_checkbox_process_data(this, true); 47 } else { 48 jQuery(this).attr("checked", false); 49 woof_checkbox_process_data(this, false); 50 } 51 }); 52 } 53} 54function woof_checkbox_process_data(_this, is_checked) { 55 var tax = jQuery(_this).data('tax'); 56 var name = jQuery(_this).attr('name'); 57 var term_id = jQuery(_this).data('term-id'); 58 woof_checkbox_direct_search(term_id, name, tax, is_checked); 59} 60function woof_checkbox_direct_search(term_id, name, tax, is_checked) { 61 62 var values = ''; 63 var checked = true; 64 if (is_checked) { 65 if (tax in woof_current_values) { 66 woof_current_values[tax] = woof_current_values[tax] + ',' + name; 67 } else { 68 woof_current_values[tax] = name; 69 } 70 checked = true; 71 } else { 72 values = woof_current_values[tax]; 73 values = values.split(','); 74 var tmp = []; 75 jQuery.each(values, function (index, value) { 76 if (value != name) { 77 tmp.push(value); 78 } 79 }); 80 values = tmp; 81 if (values.length) { 82 woof_current_values[tax] = values.join(','); 83 } else { 84 delete woof_current_values[tax]; 85 } 86 checked = false; 87 } 88 jQuery('.woof_checkbox_term_' + term_id).attr('checked', checked); 89 woof_ajax_page_num = 1; 90 91 if (woof_autosubmit) { 92 93 woof_submit_link(woof_get_submit_link()); 94 } 95 96} 97 98
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.