forked from agarzola/jQueryAutocompletePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.autocomplete.pack.js
14 lines (14 loc) · 8.09 KB
/
jquery.autocomplete.pack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
* jQuery Autocomplete plugin 1.2.2
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* With small modifications by Alfonso Gómez-Arzola.
* See changelog for details.
*
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){$.1L.1s({17:4(b,c){5 d=O b=="1t";c=$.1s({},$.P.1M,{W:d?b:F,A:d?F:b,1u:d?$.P.1M.1u:10,X:c&&!c.1v?10:3o},c);c.1w=c.1w||4(a){6 a};c.1x=c.1x||c.1N;6 B.L(4(){1O $.P(B,c)})},Q:4(a){6 B.Y("Q",a)},1c:4(a){6 B.Z("1c",[a])},1P:4(){6 B.Z("1P")},1Q:4(a){6 B.Z("1Q",[a])},1R:4(){6 B.Z("1R")}});$.P=4(h,j){5 k={2k:38,2l:40,2m:46,2n:9,2o:13,2p:27,2q:3p,2r:33,2s:34,2t:8};5 l=F;3(j.1S!=F&&O j.1S=="4"){l=j.1S}5 m=$(h).3q("17","3r").R(j.2u);5 n;5 o="";5 p=$.P.2v(j);5 r=0;5 s;5 t={1d:C};5 u=$.P.2w(j,h,1T,t);5 w;$.1U.2x&&$(h.2y).Y("3s.17",4(){3(w){w=C;6 C}});m.Y(($.1U.2x?"3t":"3u")+".17",4(a){r=1;s=a.2z;3v(a.2z){S k.2k:3(u.G()){a.1e();u.2A()}y{T(0,E)}U;S k.2l:3(u.G()){a.1e();u.2B()}y{T(0,E)}U;S k.2r:3(u.G()){a.1e();u.2C()}y{T(0,E)}U;S k.2s:3(u.G()){a.1e();u.2D()}y{T(0,E)}U;S j.18&&$.1f(j.V)==","&&k.2q:S k.2n:S k.2o:3(1T()){a.1e();w=E;6 C}U;S k.2p:u.11();U;3w:1V(n);n=1W(T,j.1u);U}}).1X(4(){r++}).3x(4(){r=0;3(!t.1d){2E()}}).2F(4(){3(j.2G){3(!u.G()){T(0,E)}}y{3(r++>1&&!u.G()){T(0,E)}}}).Y("1c",4(){5 c=(1y.7>1)?1y[1]:F;4 1Y(q,a){5 b;3(a&&a.7){19(5 i=0;i<a.7;i++){3(a[i].Q.M()==q.M()){b=a[i];U}}}3(O c=="4")c(b);y m.Z("Q",b&&[b.A,b.H])}$.L(12(m.N()),4(i,a){1Z(a,1Y,1Y)})}).Y("1P",4(){p.1g()}).Y("1Q",4(){$.1s(E,j,1y[1]);3("A"2H 1y[1])p.1h()}).Y("1R",4(){u.1z();m.1z();$(h.2y).1z(".17")});4 1T(){5 b=u.2I();3(!b)6 C;5 v=b.Q;o=v;3(j.18){5 c=12(m.N());3(c.7>1){5 d=j.V.7;5 e=$(h).1a().1A;5 f,1B=0;$.L(c,4(i,a){1B+=a.7;3(e<=1B){f=i;6 C}1B+=d});c[f]=v;v=c.2J(j.V)}v+=j.V}m.N(v);1i();m.Z("Q",[b.A,b.H]);6 E}4 T(a,b){3(s==k.2m){u.11();6}5 c=m.N();3(!b&&c==o)6;o=c;c=1j(c);3(c.7>=j.20){m.R(j.21);3(!j.1C)c=c.M();1Z(c,2K,1i)}y{1D();u.11()}};4 12(b){3(!b)6[""];3(!j.18)6[$.1f(b)];6 $.3y(b.22(j.V),4(a){6 $.1f(b).7?$.1f(a):F})}4 1j(a){3(!j.18)6 a;5 b=12(a);3(b.7==1)6 b[0];5 c=$(h).1a().1A;3(c==a.7){b=12(a)}y{b=12(a.23(a.2L(c),""))}6 b[b.7-1]}4 1E(q,a){3(j.1E&&(1j(m.N()).M()==q.M())&&s!=k.2t){m.N(m.N()+a.2L(1j(o).7));$(h).1a(o.7,o.7+a.7)}};4 2E(){1V(n);n=1W(1i,3z)};4 1i(){5 c=u.G();u.11();1V(n);1D();3(j.2M){m.1c(4(a){3(!a){3(j.18){5 b=12(m.N()).1k(0,-1);m.N(b.2J(j.V)+(b.7?j.V:""))}y{m.N("");m.Z("Q",F)}}})}};4 2K(q,a){3(a&&a.7&&r){1D();u.2N(a,q);1E(q,a[0].H);u.24()}y{1i()}};4 1Z(c,d,e){3(!j.1C)c=c.M();5 f=p.2O(c);3(f&&f.7){d(c,f)}y 3((O j.W=="1t")&&(j.W.7>0)){5 g={3A:+1O 3B()};$.L(j.2P,4(a,b){g[a]=O b=="4"?b():b});$.3C({3D:"3E",3F:"17"+h.3G,2Q:j.2Q,W:j.W,A:$.1s({q:1j(c),3H:j.X},g),3I:4(a){5 b=j.1F&&j.1F(a)||1F(a);p.1l(c,b);d(c,b)}})}y{u.2R();3(l!=F){l()}y{e(c)}}};4 1F(a){5 b=[];5 c=a.22("\\n");19(5 i=0;i<c.7;i++){5 d=$.1f(c[i]);3(d){d=d.22("|");b[b.7]={A:d,H:d[0],Q:j.1G&&j.1G(d,d[0])||d[0]}}}6 b};4 1D(){m.1m(j.21)}};$.P.1M={2u:"3J",2S:"3K",21:"3L",20:1,1u:3M,1C:C,1n:E,1H:C,1o:3N,X:3O,2M:C,2P:{},26:E,1N:4(a){6 a[0]},1x:F,1E:C,I:0,18:C,V:" ",2T:E,2G:C,1w:4(a,b){6 a.23(1O 3P("(?![^&;]+;)(?!<[^<>]*)("+b.23(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2U,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2U"),"<2V>$1</2V>")},1v:E,1I:3Q,28:E};$.P.2v=4(g){5 h={};5 j=0;4 1n(s,a){3(!g.1C)s=s.M();5 i=s.2W(a);3(g.1H=="3R"){i=s.M().1c("\\\\b"+a.M())}3(i==-1)6 C;6 i==0||g.1H};4 1l(q,a){3(j>g.1o){1g()}3(!h[q]){j++}h[q]=a}4 1h(){3(!g.A)6 C;5 b={},2X=0;3(!g.W)g.1o=1;b[""]=[];19(5 i=0,2Y=g.A.7;i<2Y;i++){5 c=g.A[i];c=(O c=="1t")?[c]:c;5 d=g.1x(c,i+1,g.A.7);3(O(d)===\'1p\'||d===C)29;5 e=d.3S(0).M();3(!b[e])b[e]=[];5 f={H:d,A:c,Q:g.1G&&g.1G(c)||d};b[e].2a(f);3(2X++<g.X){b[""].2a(f)}};$.L(b,4(i,a){g.1o++;1l(i,a)})}1W(1h,25);4 1g(){h={};j=0}6{1g:1g,1l:1l,1h:1h,2O:4(q){3(!g.1o||!j)6 F;3(!g.W&&g.1H){5 a=[];19(5 k 2H h){3(k.7>0){5 c=h[k];$.L(c,4(i,x){3(1n(x.H,q)){a.2a(x)}})}}6 a}y 3(h[q]){6 h[q]}y 3(g.1n){19(5 i=q.7-1;i>=g.20;i--){5 c=h[q.3T(0,i)];3(c){5 a=[];$.L(c,4(i,x){3(1n(x.H,q)){a[a.7]=x}});6 a}}}6 F}}};$.P.2w=4(e,f,g,h){5 j={J:"3U"};5 k,z=-1,A,1J="",2b=E,K,D;4 2Z(){3(!2b)6;K=$("<3V/>").11().R(e.2S).14("3W","3X").2c(2d.30).3Y(4(a){3($(B).31(":G")){f.1X()}h.1d=C});D=$("<3Z/>").2c(K).41(4(a){3(15(a).32&&15(a).32.42()==\'35\'){z=$("2e",D).1m(j.J).43(15(a));$(15(a)).R(j.J)}}).2F(4(a){$(15(a)).R(j.J);g();3(e.2T)f.1X();6 C}).44(4(){h.1d=E}).45(4(){h.1d=C});3(e.I>0)K.14("I",e.I);2b=C}4 15(a){5 b=a.15;47(b&&b.48!="35")b=b.49;3(!b)6[];6 b}4 16(a){k.1k(z,z+1).1m(j.J);36(a);5 b=k.1k(z,z+1).R(j.J);3(e.1v){5 c=0;k.1k(0,z).L(4(){c+=B.1q});3((c+b[0].1q-D.1r())>D[0].4a){D.1r(c+b[0].1q-D.4b())}y 3(c<D.1r()){D.1r(c)}}};4 36(a){3(e.28||(!e.28&&!((a<0&&z==0)||(a>0&&z==k.1b()-1)))){z+=a;3(z<0){z=k.1b()-1}y 3(z>=k.1b()){z=0}}}4 37(a){6 e.X&&e.X<a?e.X:a}4 39(){D.3a();5 a=37(A.7);19(5 i=0;i<a;i++){3(!A[i])29;5 b=e.1N(A[i].A,i+1,a,A[i].H,1J);3(b===C)29;5 c=$("<2e/>").4c(e.1w(b,1J)).R(i%2==0?"4d":"4e").2c(D)[0];$.A(c,"3b",A[i])}k=D.4f("2e");3(e.26){k.1k(0,1).R(j.J);z=0}3($.1L.3c)D.3c()}6{2N:4(d,q){2Z();A=d;1J=q;39()},2B:4(){16(1)},2A:4(){16(-1)},2C:4(){3(z!=0&&z-8<0){16(-z)}y{16(-8)}},2D:4(){3(z!=k.1b()-1&&z+8>k.1b()){16(k.1b()-1-z)}y{16(8)}},11:4(){K&&K.11();k&&k.1m(j.J);z=-1},G:4(){6 K&&K.31(":G")},4g:4(){6 B.G()&&(k.3d("."+j.J)[0]||e.26&&k[0])},24:4(){5 a=$(f).4h();K.14({I:O e.I=="1t"||e.I>0?e.I:$(f).I(),3e:a.3e+f.1q,2f:a.2f}).24();3(e.1v){D.1r(0);D.14({3f:e.1I,4i:\'4j\'});3($.1U.4k&&O 2d.30.4l.3f==="1p"){5 b=0;k.L(4(){b+=B.1q});5 c=b>e.1I;D.14(\'4m\',c?e.1I:b);3(!c){k.I(D.I()-3g(k.14("3h-2f"))-3g(k.14("3h-4n")))}}}},2I:4(){5 a=k&&k.3d("."+j.J).1m(j.J);6 a&&a.7&&$.A(a[0],"3b")},2R:4(){D&&D.3a()},1z:4(){K&&K.4o()}}};$.1L.1a=4(b,c){3(b!==1p){6 B.L(4(){3(B.2g){5 a=B.2g();3(c===1p||b==c){a.4p("2h",b);a.3i()}y{a.4q(E);a.4r("2h",b);a.4s("2h",c);a.3i()}}y 3(B.3j){B.3j(b,c)}y 3(B.1K){B.1K=b;B.3k=c}})}5 d=B[0];3(d.2g){5 e=2d.1a.4t(),3l=d.H,2i="<->",2j=e.3m.7;e.3m=2i;5 f=d.H.2W(2i);d.H=3l;B.1a(f,f+2j);6{1A:f,3n:f+2j}}y 3(d.1K!==1p){6{1A:d.1K,3n:d.3k}}}})(4u);',62,279,'|||if|function|var|return|length|||||||||||||||||||||||||||else|active|data|this|false|list|true|null|visible|value|width|ACTIVE|element|each|toLowerCase|val|typeof|Autocompleter|result|addClass|case|onChange|break|multipleSeparator|url|max|bind|trigger||hide|trimWords||css|target|moveSelect|autocomplete|multiple|for|selection|size|search|mouseDownOnSelect|preventDefault|trim|flush|populate|hideResultsNow|lastWord|slice|add|removeClass|matchSubset|cacheLength|undefined|offsetHeight|scrollTop|extend|string|delay|scroll|highlight|formatMatch|arguments|unbind|start|progress|matchCase|stopLoading|autoFill|parse|formatResult|matchContains|scrollHeight|term|selectionStart|fn|defaults|formatItem|new|flushCache|setOptions|unautocomplete|failure|selectCurrent|browser|clearTimeout|setTimeout|focus|findValueCallback|request|minChars|loadingClass|split|replace|show||selectFirst||scrollJumpPosition|continue|push|needsInit|appendTo|document|li|left|createTextRange|character|teststring|textLength|UP|DOWN|DEL|TAB|RETURN|ESC|COMMA|PAGEUP|PAGEDOWN|BACKSPACE|inputClass|Cache|Select|opera|form|keyCode|prev|next|pageUp|pageDown|hideResults|click|clickFire|in|selected|join|receiveData|substring|mustMatch|display|load|extraParams|dataType|emptyList|resultsClass|inputFocus|gi|strong|indexOf|nullData|ol|init|body|is|nodeName|||LI|movePosition|limitNumberOfItems||fillList|empty|ac_data|bgiframe|filter|top|maxHeight|parseInt|padding|select|setSelectionRange|selectionEnd|orig|text|end|150|188|attr|off|submit|keypress|keydown|switch|default|blur|map|200|timestamp|Date|ajax|mode|abort|port|name|limit|success|ac_input|ac_results|ac_loading|400|100|1000|RegExp|180|word|charAt|substr|ac_over|div|position|absolute|hover|ul||mouseover|toUpperCase|index|mousedown|mouseup||while|tagName|parentNode|clientHeight|innerHeight|html|ac_even|ac_odd|find|current|offset|overflow|auto|msie|style|height|right|remove|move|collapse|moveStart|moveEnd|createRange|jQuery'.split('|'),0,{}))