1var woof_text_do_submit = false; 2function woof_init_text() { 3 jQuery('.woof_show_text_search').keyup(function (e) { 4 5 var val = jQuery(this).val(); 6 val=val.replace("\'","\'"); 7 val=val.replace("\"","\""); 8 var uid = jQuery(this).data('uid'); 9 if (e.keyCode == 13 /*&& val.length > 0*/) { 10 woof_text_do_submit = true; 11 woof_text_direct_search('woof_text', val); 12 return true; 13 } 14 15 //save new word into woof_current_values 16 if (woof_autosubmit) { 17 woof_current_values['woof_text'] = val; 18 } else { 19 woof_text_direct_search('woof_text', val); 20 } 21 22 23 //if (woof_is_mobile == 1) { 24 if (val.length > 0) { 25 jQuery('.woof_text_search_go.' + uid).show(222); 26 } else { 27 jQuery('.woof_text_search_go.' + uid).hide(); 28 } 29 //} 30 31 //http://easyautocomplete.com/examples 32 if (val.length >= 3 && woof_text_autocomplete) { 33 //http://stackoverflow.com/questions/1574008/how-to-simulate-target-blank-in-javascript 34 jQuery('.easy-autocomplete a').life('click', function () { 35 36 if(!how_to_open_links){ 37 window.open(jQuery(this).attr('href'), '_blank'); 38 return false; 39 } 40 41 return true; 42 }); 43 //*** 44 //http://easyautocomplete.com/examples 45 var input_id = jQuery(this).attr('id'); 46 var options = { 47 url: function (phrase) { 48 return woof_ajaxurl; 49 }, 50 //theme: "square", 51 getValue: function (element) { 52 jQuery("#" + input_id).parents('.woof_show_text_search_container').find('.woof_show_text_search_loader').hide(); 53 jQuery("#" + input_id).parents('.woof_show_text_search_container').find('.woof_text_search_go').show(); 54 return element.name; 55 }, 56 ajaxSettings: { 57 dataType: "json", 58 method: "POST", 59 data: { 60 action: "woof_text_autocomplete", 61 dataType: "json" 62 } 63 }, 64 preparePostData: function (data) { 65 jQuery("#" + input_id).parents('.woof_show_text_search_container').find('.woof_text_search_go').hide(); 66 jQuery("#" + input_id).parents('.woof_show_text_search_container').find('.woof_show_text_search_loader').show(); 67 //*** 68 data.phrase = jQuery("#" + input_id).val(); 69 data.auto_res_count = jQuery("#" + input_id).data('auto_res_count'); 70 data.auto_search_by = jQuery("#" + input_id).data('auto_search_by'); 71 return data; 72 }, 73 template: { 74 type: woof_post_links_in_autocomplete ? 'links' : 'iconRight', 75 fields: { 76 iconSrc: "icon", 77 link: "link" 78 } 79 }, 80 list: { 81 maxNumberOfElements: jQuery("#" + input_id).data('auto_res_count') > 0 ? jQuery("#" + input_id).data('auto_res_count') : woof_text_autocomplete_items, 82 onChooseEvent: function () { 83 woof_text_do_submit = true; 84 85 if (woof_post_links_in_autocomplete) { 86 return false; 87 } else { 88 woof_text_direct_search('woof_text', jQuery("#" + input_id).val()); 89 } 90 91 return true; 92 }, 93 showAnimation: { 94 type: "fade", //normal|slide|fade 95 time: 333, 96 callback: function () { 97 } 98 }, 99 hideAnimation: { 100 type: "slide", //normal|slide|fade 101 time: 333, 102 callback: function () { 103 } 104 } 105 106 }, 107 requestDelay: 400 108 }; 109 try { 110 jQuery("#" + input_id).easyAutocomplete(options); 111 } catch (e) { 112 console.log(e); 113 } 114 jQuery("#" + input_id).focus(); 115 } 116 }); 117 118 //+++ 119 jQuery('.woof_text_search_go').life('click', function () { 120 var uid = jQuery(this).data('uid'); 121 woof_text_do_submit = true; 122 123 var val=jQuery('.woof_show_text_search.' + uid).val(); 124 //var val =jQuery(this).siblings(".woof_show_text_search").val(); 125 val=val.replace("\"","\""); 126 woof_text_direct_search('woof_text', val); 127 }); 128} 129 130function woof_text_direct_search(name, slug) { 131 slug = encodeURIComponent(slug); 132 jQuery.each(woof_current_values, function (index, value) { 133 if (index == name) { 134 delete woof_current_values[name]; 135 return; 136 } 137 }); 138 if (slug != 0) { 139 woof_current_values[name] = slug; 140 } 141 142 woof_ajax_page_num = 1; 143 if (woof_autosubmit || woof_text_do_submit) { 144 woof_text_do_submit = false;
145 woof_submit_link(woof_get_submit_link()); 146 } 147} 148 149
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.