forked from drewwilson/AutoSuggest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.autoSuggest.packed.js
21 lines (21 loc) · 6.15 KB
/
jquery.autoSuggest.packed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* AutoSuggest
* Copyright 2009-2010 Drew Wilson
* www.drewwilson.com
* code.drewwilson.com/entry/autosuggest-jquery-plugin
*
* Version 1.4 - Updated: Mar. 23, 2010
*
* This Plug-In will auto-complete or auto-suggest completed search queries
* for you as you type. You can add multiple selections and remove them on
* the fly. It supports keybord navigation (UP + DOWN + RETURN), as well
* as multiple AutoSuggest fields on the same page.
*
* Inspied by the Autocomplete plugin by: Jšrn Zaefferer
* and the Facelist plugin by: Ian Tearle (iantearle.com)
*
* This AutoSuggest jQuery plug-in is dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
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}('(5(a){a.2F.2C=5(b,c){3 d={1p:I,1e:"2k 2n 2m",1L:"25 2l 2D",O:{},22:"25 2Z 2V 2S 2R",14:"19",Y:"19",1E:"19",2f:"q",18:I,2d:"",1h:I,1x:1,1v:2Y,1K:Q,1J:I,1u:I,1H:Q,1F:5(){},1m:5(a){},26:5(a){},1r:5(a){a.2y()},1q:I,1b:5(a){U a},1Z:5(a){U a},1X:5(a){},1V:5(){}};3 e=a.1T(d,c);3 f="2g";3 g=0;4(1O b=="16"){f="16";3 h=b}J{3 i=b;Z(k 1A b)4(b.1y(k))g++}4(f=="2g"&&g>0||f=="16"){U G.2x(5(b){5 B(){4(1g==2N||1g>8&&1g<32){U n.P()}3 b=d.6().1d(/[\\\\]+|[\\/]+/g,"");4(b==y)U;y=b;4(b.K>=e.1x){l.R("1s");4(f=="16"){3 c="";4(e.18){c="&2B="+1G(e.18)}4(e.1b){b=e.1b.L(G,b)}a.2P(h+"?"+e.2f+"="+1G(b)+c+e.2d,5(a){g=0;3 c=e.1Z.L(G,a);Z(k 1A c)4(c.1y(k))g++;D(c,b)})}J{4(e.1b){b=e.1b.L(G,b)}D(i,b)}}J{l.N("1s");n.P()}}5 D(b,c){4(!e.1h){c=c.1I()}3 f=0;n.11(o.11("")).P();Z(3 h=0;h<g;h++){3 i=h;C++;3 k=I;4(e.1E=="19"){3 m=b[i].19}J{3 m="";3 q=e.1E.1D(",");Z(3 r=0;r<q.K;r++){3 s=a.2r(q[r]);m=m+b[i][s]+" "}}4(m){4(!e.1h){m=m.1I()}4(m.1o(c)!=-1&&p.6().1o(","+b[i][e.Y]+",")==-1){k=Q}}4(k){3 t=a(\'<H M="7-1W-T" 10="7-1W-T-\'+i+\'"></H>\').1a(5(){3 b=a(G).1f("1f");3 c=b.24;4(a("#7-V-"+c,l).K<=0&&!A){3 f=b.2b;d.6("").17();y="";E(f,c);e.1X.L(G,b);n.P()}A=I}).1t(5(){j=I}).2t(5(){a("H",o).N("12");a(G).R("12")}).1f("1f",{2b:b[i],24:C});3 u=a.1T({},b[i]);4(!e.1h){3 v=2j 1M("(?![^&;]+;)(?!<[^<>]*)("+c+")(?![^<>]*>)(?![^&;]+;)","2E")}J{3 v=2j 1M("(?![^&;]+;)(?!<[^<>]*)("+c+")(?![^<>]*>)(?![^&;]+;)","g")}4(e.1K){u[e.14]=u[e.14].1d(v,"<1N>$1</1N>")}4(!e.1q){t=t.11(u[e.14])}J{t=e.1q.L(G,u,t)}o.2G(t);2K u;f++;4(e.18&&e.18==f){S}}}l.N("1s");4(f<=0){o.11(\'<H M="7-1P">\'+e.1L+"</H>")}o.1Q("1R",l.1S());n.1w();e.1V.L(G)}5 E(b,c){p.6(p.6()+b[e.Y]+",");3 f=a(\'<H M="7-V-T" 10="7-V-\'+c+\'"></H>\').1a(5(){e.1m.L(G,a(G));l.1U().N("X");a(G).R("X")}).1t(5(){j=I});3 g=a(\'<a M="7-35">×</a>\').1a(5(){p.6(p.6().1d(","+b[e.Y]+",",","));e.1r.L(G,f);j=Q;d.17();U I});m.36(f.11(b[e.14]).39(g));e.26.L(G,m.W())}5 F(b){4(a(":1Y",n).K>0){3 c=a("H",n);4(b=="1z"){3 d=c.2o(0)}J{3 d=c.2p(":2q")}3 e=a("H.12:20",n);4(e.K>0){4(b=="1z"){d=e.2s()}J{d=e.W()}}c.N("12");d.R("12")}}4(!e.1p){b=b+""+21.2u(21.2v()*2w);3 c="7-1i-"+b}J{b=e.1p;3 c=b}e.1F.L(G);3 d=a(G);d.1j("2z","2A").R("7-1i").1j("10",c).6(e.1e);3 j=I;d.23(\'<1k M="7-1B" 10="7-1B-\'+b+\'"></1k>\').23(\'<H M="7-1C" 10="7-1C-\'+b+\'"></H>\');3 l=a("#7-1B-"+b);3 m=a("#7-1C-"+b);3 n=a(\'<27 M="7-28" 10="7-28-\'+b+\'"></27>\').P();3 o=a(\'<1k M="7-2H"></1k>\');3 p=a(\'<1i 2I="2J" M="7-29" 2L="2M\'+b+\'" 10="7-29-\'+b+\'" />\');3 q="";4(1O e.O=="16"){3 r=e.O.1D(",");Z(3 s=0;s<r.K;s++){3 t={};t[e.Y]=r[s];4(r[s]!=""){E(t,"2a"+s)}}q=e.O}J{q="";3 u=0;Z(k 1A e.O)4(e.O.1y(k))u++;4(u>0){Z(3 s=0;s<u;s++){3 v=e.O[s][e.Y];4(v==2O){v=""}q=q+v+",";4(v!=""){E(e.O[s],"2a"+s)}}}}4(q!=""){d.6("");3 w=q.2Q(q.K-1);4(w!=","){q=q+","}p.6(","+q);a("H.7-V-T",l).R("1l").N("X")}d.2c(p);l.1a(5(){j=Q;d.17()}).1t(5(){j=I}).2c(n);3 x=2T;3 y="";3 z=0;3 A=I;d.17(5(){4(a(G).6()==e.1e&&p.6()==""){a(G).6("")}J 4(j){a("H.7-V-T",l).N("1l");4(a(G).6()!=""){o.1Q("1R",l.1S());n.1w()}}j=Q;U Q}).1l(5(){4(a(G).6()==""&&p.6()==""&&q==""){a(G).6(e.1e)}J 4(j){a("H.7-V-T",l).R("1l").N("X");n.P()}}).2U(5(b){1g=b.2e;2W=I;2X(b.2e){15 38:b.1c();F("30");S;15 31:b.1c();F("1z");S;15 8:4(d.6()==""){3 c=p.6().1D(",");c=c[c.K-2];l.1U().33(m.W()).N("X");4(m.W().34("X")){p.6(p.6().1d(","+c+",",","));e.1r.L(G,m.W())}J{e.1m.L(G,m.W());m.W().R("X")}}4(d.6().K==1){n.P();y=""}4(a(":1Y",n).K>0){4(x){2h(x)}x=2i(5(){B()},e.1v)}S;15 9:15 37:4(!d.6()&&a(G).1j("1n")){3a{3 f=3b(a(G).1j("1n"));4(b.3c){f--}J{f++}b.1c();a(\'1i[1n="\'+f+\'"]\').17()}3d(g){}S}A=Q;3 h=d.6().1d(/(,)/g,"");4(h!=""&&p.6().1o(","+h+",")<0&&h.K>=e.1x){b.1c();3 i={};i[e.14]=h;i[e.Y]=h;3 j=a("H",l).K;E(i,"3e"+(j+1));d.6("")};15 13:A=I;3 k=a("H.12:20",n);4(k.K>0){k.1a();n.P()}4(e.1J||k.K>0){b.1c()}S;3f:4(e.1H){4(e.1u&&a("H.7-V-T",l).K>=e.1u){o.11(\'<H M="7-1P">\'+e.22+"</H>");n.1w()}J{4(x){2h(x)}x=2i(5(){B()},e.1v)}}S}});3 C=0})}}})(3g)',62,203,'|||var|if|function|val|as|||||||||||||||||||||||||||||||||||this|li|false|else|length|call|class|removeClass|preFill|hide|true|addClass|break|item|return|selection|prev|selected|selectedValuesProp|for|id|html|active||selectedItemProp|case|string|focus|retrieveLimit|value|click|beforeRetrieve|preventDefault|replace|startText|data|lastKeyPressCode|matchCase|input|attr|ul|blur|selectionClick|tabindex|search|asHtmlID|formatList|selectionRemoved|loading|mousedown|selectionLimit|keyDelay|show|minChars|hasOwnProperty|down|in|selections|original|split|searchObjProps|start|encodeURIComponent|showResultList|toLowerCase|neverSubmit|resultsHighlight|emptyText|RegExp|em|typeof|message|css|width|outerWidth|extend|children|resultsComplete|result|resultClick|visible|retrieveComplete|first|Math|limitText|wrap|num|No|selectionAdded|div|results|values|000|attributes|after|extraParams|keyCode|queryParam|object|clearTimeout|setTimeout|new|Enter|Results|Here|Name|eq|filter|last|trim|next|mouseover|floor|random|100|each|remove|autocomplete|off|limit|autoSuggest|Found|gi|fn|append|list|type|hidden|delete|name|as_values_|46|undefined|getJSON|substring|Allowed|Are|null|keydown|Selections|first_focus|switch|400|More|up|40||not|hasClass|close|before|188||prepend|try|parseInt|shiftKey|catch|00|default|jQuery'.split('|'),0,{}))