1"use strict"; 2function woof_init_labels() { 3 jQuery('.woof_label_term').on('click', function () { 4 5 var checkbox = jQuery(this).find('input.woof_label_term').eq(0); 6 7 if (jQuery(checkbox).is(':checked')) { 8 jQuery(checkbox).attr("checked", false); 9 jQuery(this).removeClass("checked"); 10 woof_label_process_data(checkbox, false); 11 } else { 12 jQuery(checkbox).attr("checked", true); 13 jQuery(this).addClass("checked"); 14 woof_label_process_data(checkbox, true); 15 } 16 }); 17} 18function woof_label_process_data(_this, is_checked) { 19 var tax = jQuery(_this).data('tax'); 20 var name = jQuery(_this).attr('name'); 21 var term_id = jQuery(_this).data('term-id'); 22 woof_label_direct_search(term_id, name, tax, is_checked); 23} 24function woof_label_direct_search(term_id, name, tax, is_checked) { 25 var values = ''; 26 var checked = true; 27 if (is_checked) { 28 if (tax in woof_current_values) { 29 woof_current_values[tax] = woof_current_values[tax] + ',' + name; 30 } else { 31 woof_current_values[tax] = name; 32 } 33 checked = true; 34 } else { 35 values = woof_current_values[tax]; 36 values = values.split(','); 37 var tmp = []; 38 jQuery.each(values, function (index, value) { 39 if (value != name) { 40 tmp.push(value); 41 } 42 }); 43 values = tmp; 44 if (values.length) { 45 woof_current_values[tax] = values.join(','); 46 } else { 47 delete woof_current_values[tax]; 48 } 49 checked = false; 50 } 51 jQuery('.woof_label_term_' + term_id).attr('checked', checked); 52 woof_ajax_page_num = 1; 53 if (woof_autosubmit) { 54 woof_submit_link(woof_get_submit_link()); 55 } 56} 57 58
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.