1jQuery(document).ready(function($){ 2 wdk_dependfields_search_form(); 3}); 4const wdk_dependfields_search_form = ($selector = '.wdk-search', parent_field_selector = '.wdk-field') => { 5 var $ = jQuery; 6 var el_category,el_form, class_hide, hide_fields; 7 class_hide = 'wdk-depend-hidden'; 8 el_form = jQuery($selector); 9 el_category = el_form.find('*[name="search_category"]'); 10 11 el_category.on('change', function(){ 12 hide_fields(); 13 }); 14 15 hide_fields = () => { 16 var value = el_category.val(); 17 el_form.find('.'+class_hide).removeClass(class_hide) 18 if(value && typeof script_dependfields_search.hidden_fields[value] != 'undefined') { 19 el_form.find('*[name *="field_"]').each(function(){ 20 var field_id = $(this).attr('name').substr(6); 21 if(script_dependfields_search.hidden_fields[value].indexOf(','+field_id+',') != -1) { 22 $(this).closest(parent_field_selector).addClass(class_hide); 23 } 24 }); 25 } 26 }; 27 28 /* init hide fields */ 29 hide_fields(); 30 31}
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.