📄 suggestionbox_o.js
字号:
/*******************************************************************//* *//* Copyright (c) 2005-2008 Jasob.com *//* *//* This obfuscated code was created by Jasob 3.1 Trial Version. *//* The code may be used for evaluation purposes only. *//* To obtain full rights to the obfuscated code you have to *//* purchase the license key (http://www.jasob.com/Purchase.html). *//* *//*******************************************************************/var g_OnDemandContent="";var active= -1;var timeout=null;$(function(){$('#inputString').keydown(function(e){if(window.event){var keyCode=window.event.keyCode;}else{var keyCode=e.which;}switch(keyCode){case 38:e.preventDefault();moveSelect(-1);if(timeout)clearTimeout(timeout);timeout=setTimeout("$('#suggestions').hide();",8000);break;case 40:e.preventDefault();moveSelect(1);if(timeout)clearTimeout(timeout);timeout=setTimeout("$('#suggestions').hide();",8000);break;default:active= -1;if(timeout)clearTimeout(timeout);timeout=setTimeout("$('#suggestions').hide();",8000);break;}}).keyup(function(e){if(window.event){var keyCode=window.event.keyCode;}else{var keyCode=e.which;}switch(keyCode){case 38:e.preventDefault();break;case 40:e.preventDefault();break;case 13:e.preventDefault();$('#suggestions').hide();break;default:if($('#inputString').val().length>1)ondemandlookup(this.value);else $('#suggestions').hide();break;}});});function moveSelect(step){var lis=$("#autoSuggestionsList > li");if(!lis)return;active+=step;if(active<0){active=lis.size()-1;}else if(active>=lis.size()){active=0;}lis.removeClass("mousehover");$(lis[active]).addClass("mousehover");$('#inputString').val($(lis[active]).html());};function ondemandlookup(para){var s=document.createElement('SCRIPT');var url='http://im.qq.com/cgi-bin/safe/ondemandsuggestion?func=setDivContent&key='+para;s.src=url;document.body.appendChild(s);};function reportIMQQCOMSearchCount(){var id=51797;var s=document.createElement('SCRIPT');var url='http://im.qq.com/cgi-bin/safe/safe_stat?id='+id;s.src=url;document.body.appendChild(s);};function onSubFunc(){var escHtmlString=$('#inputString').val().escHtml();$('#inputString').val(escHtmlString);document.search_form.submit();};function setDivContent(){if(g_OnDemandContent.length>0){$('#suggestions').show();if(navigator.userAgent.indexOf("Firefox")>0){$('#suggestions').css('margin','22px 0 0 0');}$('#autoSuggestionsList').html(g_OnDemandContent);}else{$('#suggestions').hide();}};function OnDemandListMouseOver(){$('li').mouseover(function(){$(this).addClass("mousehover");if(timeout)clearTimeout(timeout);timeout=setTimeout("$('#suggestions').hide();",8000);});$('li').mouseout(function(){$(this).removeClass("mousehover");});};function lookup(inputString){if(inputString.length==0){$('#suggestions').hide();}else{$.post("http://im.qq.com/cgi-bin/safe/suggestionbox",{para_key_utf8:inputString},function(data){if(data.length>0){$('#suggestions').show();if(navigator.userAgent.indexOf("Firefox")>0){$('#suggestions').css('margin','22px 0 0 0');}$('#autoSuggestionsList').html(data);}OnDemandListMouseOver();});}};function fill(thisValue){$('#inputString').val(thisValue);document.search_form.submit();setTimeout("$('#suggestions').hide();",200);};function fillup(){$('#inputString').val(event.srcElement.innerHTML);document.search_form.submit();setTimeout("$('#suggestions').hide();",200);};String.prototype.escScript=function(){return this.replace(/[\\"']/g,function(r){return "\\"+r;}).replace(/%/g,"\\x25").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\x01/g,"\\x01");};String.prototype.escHtml=function(){return this.replace(/[&'"<>\/\\\-\x00-\x09\x0b-\x0c\x1f\x80-\xff]/g,function(r){return "&#"+r.charCodeAt(0)+";"}).replace(/\r\n/g,"<BR>").replace(/\n/g,"<BR>").replace(/\r/g,"<BR>").replace(/ /g," ");};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -