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