📄 sugnew.js
字号:
{if (autos[fid]){document.getElementById(autos[fid].autoid).style.visibility="hidden";showHideSelects(fid,true);}}function onBlurHandler( fid, evt ){if(!evt && window.event){evt=window.event;}eval("HideDiv('" + fid + "')");}// We get the following javascript code dynamically returned from the server:// "bill gates", new Array("Bill Gates", "Bill Gates tax"), new Array("Computer Tycoon", "neologisms"), new Array("bill-gates", "bill-gates-tax"),startswithResult=function(partialquery,topicArray,countArray,fid){resultCache[autos[fid].ftype+partialquery]=new Array(topicArray,countArray);autos[fid].topicArray = topicArray;autos[fid].countArray = countArray; // alert(topicArray.length);if (topicArray.length==0){HideDiv(fid);autos[fid].rows=0;autos[fid].rowDivList=null;}else{ ShowDiv(fid); // ShowDiv has to be before displayFoundList if (autos[fid].dir=="up") autos[fid].highlightedSuggestionIndex= topicArray.length; else autos[fid].highlightedSuggestionIndex= -1; displayFoundList(topicArray, countArray, fid); var dir = autos[fid].dir; ForEachKeyPressed(partialquery, fid);}}function displayFoundList(topicArray, countArray, fid){var autoid = autos[fid].autoid;var autoDIV = document.getElementById(autoid);while(autoDIV.childNodes.length > 0)autoDIV.removeChild(autoDIV.childNodes[0]);if (topicArray.length!=0){var pp = document.createElement("DIV");var mm = document.createElement("UL");for(var f = 0; f < topicArray.length; ++f){var u = document.createElement("LI");setStyleForElement(u, "1");u.onmouseover=new Function("mover('" + fid + "',"+f +")");u.onmouseout=new Function("mout('" +fid +"')");if (typeof(document.addEventListener) !="undefined")u.addEventListener("mousedown",mdown ,false);elseu.onmousedown=mdown;var ua = document.createElement("SPAN");u.displaySpan = ua;var text = topicArray[f];var text2 = "";if (countArray[f].length>0){text2= " <span style='float:right;text-decoration:none;color:black;font-size:12px;'>" + addComma(countArray[f]) + "条信息</span>";}ua.innerHTML = "<span style='float:left;color:green;font-size:12px;text-decoration:underline'>" +text +"</span>"+ text2+"<br/>";u.appendChild(ua);mm.appendChild(u);}pp.appendChild(mm);autoDIV.appendChild(pp);}}var mdown=function(event){if (isLeftButton(event)){autos[currfid].inputfield.value=autos[currfid].currTopic;textkeyword=autos[currfid].currTopic;document.getElementById(autos[currfid].autoid).style.visibility="hidden";return submitForm(currfid);}}var mover=function(fid,index){if(autos[fid].highlightedSuggestionIndex!=-1 && index!=autos[fid].highlightedSuggestionIndex){setStyleForElement(autos[fid].highlightedSuggestionDiv,"1");autos[fid].highlightedSuggestionIndex=-1}var autoid = autos[fid].autoid;var autodiv = document.getElementById(autoid);J=autodiv.getElementsByTagName("LI");autos[fid].highlightedSuggestionIndex=index;autos[fid].rowDivList=J;autos[fid].highlightedSuggestionDiv=autos[fid].rowDivList.item(index);autos[fid].currTopic= autos[fid].topicArray[index];autos[fid].currCount= autos[fid].countArray[index];setStyleForElement(autos[fid].highlightedSuggestionDiv,"0");};var mout=function(fid){ autos[fid].currTopic= "";autos[fid].currCount= ""; setStyleForElement(autos[fid].highlightedSuggestionDiv,"1");}function setStyleForElement(c,name){ if (c!= null && typeof(c) !="undefined"){c.className=name;switch(name.charAt(0)){ case "0":c.style.backgroundColor="#3366cc";c.style.color="black"; c.style.cursor= "pointer"; if(c.displaySpan){var linkarray = c.displaySpan.getElementsByTagName("span");if (linkarray.item(0))linkarray.item(0).style.color= "white";if (linkarray.item(1))linkarray.item(1).style.color= "white";}break; case "1":c.style.backgroundColor="white";c.style.color="black";if(c.displaySpan){var linkarray = c.displaySpan.getElementsByTagName("span");if (linkarray.item(0))linkarray.item(0).style.color= "green";if (linkarray.item(1))linkarray.item(1).style.color= "black";}break;case "2":c.style.display="block";c.style.paddingRight="3";c.style.height="15px";c.style.overflow="hidden";break;case "6":c.style.styleFloat = "right";c.style.cssFloat="right";c.style.width=40+"%";c.style.fontSize="11px";c.style.textAlign="right";c.style.whiteSpace="nowrap";break;case "7":c.style.width=60+"%";c.style.cssFloat="left";c.style.textAlign="left";c.style.fontSize="11px";c.style.whiteSpace="nowrap";break;case "8":c.style.textAlign="right";c.style.whiteSpace="nowrap";c.style.fontSize="11px";break;}}}/* In order to fix an IE bug for Incremental search The div is always below the select box, so every time you display the div you should hide the select boxes that overlap*/function showHideSelects(fid,bShow){var selObjects=document.getElementsByTagName("SELECT");var autodiv = document.getElementById(autos[fid].autoid);for(var i=0;i<selObjects.length;i++){if(ObjectOverlap(autodiv, selObjects[i]) || selObjects[i].id=="menu" || selObjects[i].id=="topic" || selObjects[i].id=="categories"){selObjects[i].style.visibility = (bShow == true ? "visible" : "hidden");}}}function ObjectOverlap(obj1, obj2){var obj1TopX = getLeft(obj1);var obj1TopY = getTop(obj1);var obj1BottomX = getLeft(obj1)+obj1.offsetWidth;var obj1BottomY = getTop(obj1)+obj1.offsetHeight;var obj2TopX = getLeft(obj2);var obj2TopY = getTop(obj2);var obj2BottomX = getLeft(obj2)+obj2.offsetWidth;var obj2BottomY = getTop(obj2)+obj2.offsetHeight;var overlapOnX = (obj1TopX < obj2BottomX && obj2TopX < obj1BottomX);var overlapOnY = (obj1TopY < obj2BottomY && obj2TopY < obj1BottomY);return (overlapOnX && overlapOnY);}//Positioning functionsfunction getObjLeft(anObject){return(anObject.offsetParent ? (getObjLeft(anObject.offsetParent) + anObject.offsetLeft) : anObject.offsetLeft);}function getObjTop(anObject){return(anObject.offsetParent ? (getObjTop(anObject.offsetParent) + anObject.offsetTop) : anObject.offsetTop);}function getLeft(anObject){return(getObjLeft(anObject));}function getTop(anObject){return(getObjTop(anObject));}function isSendKey(keycode){var sendkey = true;switch(keycode){//case 8: // back spacecase 10: //shiftcase 11: //ctrlcase 12: //altcase 13: //entercase 27: //esccase 33: //page upcase 34: // page downcase 35: // endcase 36: // homecase 37: // left arrowcase 38: // up arrowcase 39: // right arrowcase 40: // down arrowcase 45: //????//case 46: // deletesendkey=false;break;default:// regular keypress ...break;}return sendkey;}function isShowKey(keycode){// 38 is up cursor key, 40 is down cursor key...if(keycode==40 || keycode==38 || keycode == 33 || keycode== 34 || keycode==13)return false;elsereturn true;}function isCtrlKey(keycode){if(keycode==16 || keycode==17 || keycode == 18)// shift,ctrl,altreturn true;elsereturn false;}function isLeftButton(e){var leftclick;if (!e) var e = window.event;if (e.which) leftclick = (e.which == 1);else if (e.button) leftclick = (e.button == 0 || e.button==1);return leftclick;}function addComma(aCount) { var retStr = ""; var len = aCount.length; var first = true; while(len>3) { retStr=","+aCount.substring(len-3,len)+retStr; aCount = aCount.substring(0,len-3); len = aCount.length; } return (aCount+retStr);}function everytenms(){ var qnowvalue=autos[currfid].inputfield.value; if(qnowvalue==""){ document.getElementById(autos[currfid].autoid).style.visibility="hidden"; } else if (textkeyword==qnowvalue) { } else { SendQuery(currfid); textkeyword=qnowvalue; } if(qnowvalue!=null){ setTimeout("everytenms()",10); //alert(qnowvalue); } return true;}function submitForm(fid){var terms = document.getElementById('seek1').value;var c;var c1;var c2;var d;var citem = document.getElementsByName('c');if(citem==undefined||citem==null){ c="";}else { for(var i=0;i<citem.length;i++) { if(citem[i].checked) { c=citem[i].value; } }}if(c==undefined) c="";var c1item = document.getElementById('c1');if(c1item==undefined||c1item==null){c1="";}else {for(var j=0;j<c1item.length;j++) { if(c1item[j].selected) { c1=c1item[j].value; }}}var c2item = document.getElementById('c2');if(c2item==undefined||c2item==null){c2="";}else { for(var k=0;k<c2item.length;k++) { if(c2item[k].selected) { c2=c2item[k].value; } }}var ditem = document.getElementById('day');if(ditem==undefined||ditem==null){ d="";}else { for(var n=0;n<ditem.length;n++) { if(ditem[n].selected) { d=ditem[n].value; } }} if(document.getElementById("form1").acbb) { var ac_value=document.getElementById("form1").acbb.value; if("comp"==ac_value) document.getElementById(fid).action="http://so.toocle.com/web/comp.htm"; else document.getElementById(fid).action="http://so.toocle.com/web/prod.htm";}var action=document.getElementById(fid).action;var count = action.indexOf("?");if(count>0) { document.getElementById(fid).action=action.substr(0,count)+"?terms="+terms+"&c="+c+"&c1="+c1+"&c2="+c2+"&d="+d;} else { document.getElementById(fid).action=action+"?terms="+terms+"&c="+c+"&c1="+c1+"&c2="+c2+"&d="+d;}document.getElementById(fid).submit();}function changeft(fid,ftype){autos[fid].ftype=ftype;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -