1// var defaultKeywords = ["Phosphoric Acid", "Caustic Soda", "Sodium Tripolyphosphate", "Xanthan Gum", "Sodium Benzoate", "Benzoic acid", "Adipic Acid", "Sodium Nitrite", "Citric Acid Monohydrate", "Pentaerythritol"]; 2 3//Enter13 Shift16 Ctrl17 Alt18 CapsLock20 å·¦37 ä¸38 å³39 ä¸40 4var keyCodes = [13,16,17,18,20,37,38,39,40]; 5 6//æé®æä¸ 7function searchKeywordsOnKeypress(keyCode, associativeKeywordsDivId, callBack) { 8 if (keyCodes.indexOf(keyCode)==-1){ 9 $("#" + associativeKeywordsDivId + ">ul").empty(); 10 }else if (keyCode == 13){ 11 //åè½¦é®æä¸ï¼æç´¢ 12 if (typeof(callBack) != "undefined" && callBack != null && callBack != ""){ 13 callBack(); 14 } 15 } 16} 17 18//æé®æ¾å¼ 19function searchKeywordsOnKeyup(keyCode, associativeKeywordsDivId, searchKeywordsId, searchItemId) { 20 if (keyCodes.indexOf(keyCode)==-1){ 21 $("#" + associativeKeywordsDivId + ">ul").empty(); 22 //è·åæç´¢èæ³è¯ 23 var searchItem = $("#" + searchItemId).val(); 24 getAssociativeKeywords(associativeKeywordsDivId, searchKeywordsId, searchItem); 25 } 26} 27 28//æç´¢æ¡è·å¾ç¦ç¹ 29function searchKeywordsOnFocus(associativeKeywordsDivId, searchKeywordsId, searchItemId) { 30 var associativeKeywordsCount = $("#" + associativeKeywordsDivId + ">ul li").length; 31 if (associativeKeywordsCount > 0) { 32 //èæ³è¯å±ç¤º 33 $("#" + associativeKeywordsDivId).show(); 34 }else{ 35 //è·åæç´¢èæ³è¯ 36 var searchItem = $("#" + searchItemId).val(); 37 getAssociativeKeywords(associativeKeywordsDivId, searchKeywordsId, searchItem); 38 } 39} 40 41//æç´¢æ¡å¤±å»ç¦ç¹ 42function searchKeywordsOnBlur(associativeKeywordsDivId) { 43 setTimeout(function(){ 44 $("#" + associativeKeywordsDivId).hide(); 45 },200) 46} 47 48//è·åæç´¢èæ³è¯ 49function getAssociativeKeywords(associativeKeywordsDivId, searchKeywordsId, searchItem) { 50 var searchKeywords = $("#" + searchKeywordsId).val(); 51 if (searchKeywords!=null && searchKeywords!=""){ 52 $.ajax({ 53 url: webRootAjax + "/common/getAssociativeKeywords.do", 54 type: "post", 55 data: { 56 searchKeywords : searchKeywords, 57 searchItem : searchItem 58 }, 59 dataType: "json", 60 success: function (json) { 61 if(json.success){ 62 $("#" + associativeKeywordsDivId + ">ul").empty(); 63 var result = json.map; 64 var keywordsArray =result.associativeKeywordsList; 65 for (var i=0;i<keywordsArray.length;i++){ 66 $("#" + associativeKeywordsDivId + ">ul").append("<li onclick='doTopSearch(\""+searchItem+"\", \""+keywordsArray[i]+"\");'>" + keywordsArray[i] + "</li>"); 67 } 68 //èæ³è¯å±ç¤º 69 $("#" + associativeKeywordsDivId).show(); 70 71 //åå»ºèæ³è¯ç¹å»äºä»¶ 72 $("#" + associativeKeywordsDivId + ">ul>li").on("click",function(){ 73 var content = $(this).text(); 74 $("#" + searchKeywordsId).val(content); 75 $("#" + associativeKeywordsDivId + ">ul").empty(); 76 $("#" + associativeKeywordsDivId + ">ul").append("<li onclick='doTopSearch(\""+searchItem+"\", \""+keywordsArray[i]+"\");'>" + content + "</li>"); 77 }) 78 } 79 } 80 }); 81 } 82} 83 84//éç¨æ¥è¯¢åè½(页é¢çè¯ç´æ¥åèµ·æç´¢ä½¿ç¨) 85function thisSearch(thisObj, searchItem) { 86 var searchKeywords = $(thisObj).text(); 87 searchKeywords = searchKeywords.replace("<span>", ""); 88 searchKeywords = searchKeywords.replace("</span>", ""); 89 doTopSearch(searchItem, searchKeywords); 90}
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.