diff --git a/hinter.min.js b/hinter.min.js new file mode 100644 index 0000000..6dc757c --- /dev/null +++ b/hinter.min.js @@ -0,0 +1,4 @@ +// (c) Vitaliy Filippov 2011-2013 +// @license MPL 2.0 http://www.mozilla.org/MPL/2.0/ +// http://yourcmc.ru/wiki/SimpleAutocomplete +var SimpleAutocomplete=function(b,a,c){if(typeof(b)=="string"){b=document.getElementById(b)}if(!c){c={}}this.input=b;this.a=a;this.b=c.multipleDelimiter||c.multipleListener;this.c=c.multipleListener;this.d=c.onChangeListener;this.e=c.emptyText;this.f=c.prompt;this.g=c.delay;this.h=c.moreMarker;if(this.h===undefined){this.h="#MORE"}if(this.g===undefined){this.g=300}this.i=0;this.j=null;this.k=[];this.l=[];this.m=0;this.n=-1;this.o=false;this.p()};SimpleAutocomplete.prototype.p=function(){var g=this.input;g.autocomplete="off";var b=SimpleAutocomplete.q;this.r=this.input.id+b.length;b.push(this);var f=getOffset(g);var d=this.s=document.createElement("div");d.className="hintLayer";d.style.display="none";d.style.position="absolute";d.style.top=(f.top+g.offsetHeight)+"px";d.style.zIndex=1000;d.style.left=f.left+"px";document.body.appendChild(d);g.SimpleAutocomplete_input=this;d.SimpleAutocomplete_layer=this;var c=this;var a=navigator.userAgent.match("MSIE")||navigator.userAgent.match("Opera");if(a){this.t("keydown",function(e){return c.u(e)})}else{this.t("keydown",function(e){return c.v(e)});this.t("keypress",function(e){return c.u(e)})}this.t("keyup",function(e){return c.w(e)});this.t("change",function(){return c.onChange()});this.t("focus",function(){return c.x()});this.t("blur",function(){return c.y()});addListener(d,"mousedown",function(e){return c.z(e)});this.onChange()};SimpleAutocomplete.prototype.replaceItems=function(b,e){if(!e){this.s.scrollTop=0;this.n=-1;this.l=[];if(!b||b.length==0){if(this.e){this.s.innerHTML='