project/static/jquery/jquery.autoSuggest.js
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 13 Jul 2010 17:00:55 +0530
changeset 106 7ebd3a7e8ccf
parent 97 90b393042297
permissions -rw-r--r--
Revert all leading /2009 from URL Patters since this is now handled in Apache on server.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
97
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
 /*
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
 * AutoSuggest
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
 * Copyright 2009-2010 Drew Wilson
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
 * www.drewwilson.com
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
 * code.drewwilson.com/entry/autosuggest-jquery-plugin
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
 *
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     7
 * Version 1.4   -   Updated: Mar. 23, 2010
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
 *
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     9
 * This Plug-In will auto-complete or auto-suggest completed search queries
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
 * for you as you type. You can add multiple selections and remove them on
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
 * the fly. It supports keybord navigation (UP + DOWN + RETURN), as well
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    12
 * as multiple AutoSuggest fields on the same page.
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
 *
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    14
 * Inspied by the Autocomplete plugin by: Jšrn Zaefferer
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    15
 * and the Facelist plugin by: Ian Tearle (iantearle.com)
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    16
 *
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    17
 * This AutoSuggest jQuery plug-in is dual licensed under the MIT and GPL licenses:
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    18
 *   http://www.opensource.org/licenses/mit-license.php
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    19
 *   http://www.gnu.org/licenses/gpl.html
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    20
 */
90b393042297 Added jQuery autosuggest plugin and its css file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    21
eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('(6($){$.2O.2P=6(7,2f){4 2g={1R:m,1o:"2Q 2H 31",2i:"1Y 2X 2Y",D:{},2h:"1Y 2G 2I 2J 35",Z:"1a",N:"1a",1y:"1a",2B:"q",15:m,2E:"",1e:m,1V:1,1C:2V,2t:G,2d:m,1I:m,20:G,R:6(){},1B:6(1q){},2w:6(1q){},1P:6(1q){1q.36()},1M:m,18:6(h){K h},2z:6(7){K 7},2u:6(7){},2m:6(){}};4 3=$.2q(2g,2f);4 14="26";4 12=0;5(2b 7=="h"){14="h";4 2C=7}s{4 2F=7;O(k 1E 7)5(7.1F(k))12++}5((14=="26"&&12>0)||14=="h"){K d.2W(6(x){5(!3.1R){x=x+""+29.2U(29.2Z()*30);4 1U="c-l-"+x}s{x=3.1R;4 1U=x}3.R.v(d);4 l=$(d);l.1X("34","33").F("c-l").1X("L",1U).b(3.1o);4 C=m;l.25(\'<1g A="c-1W" L="c-1W-\'+x+\'"></1g>\').25(\'<f A="c-1O" L="c-1O-\'+x+\'"></f>\');4 n=$("#c-1W-"+x);4 J=$("#c-1O-"+x);4 j=$(\'<1Z A="c-22" L="c-22-\'+x+\'"></1Z>\').E();4 I=$(\'<1g A="c-2L"></1g>\');4 p=$(\'<l 2S="2M" A="c-2c" 1z="2N\'+x+\'" L="c-2c-\'+x+\'" />\');4 u="";5(2b 3.D=="h"){4 1f=3.D.1t(",");O(4 i=0;i<1f.o;i++){4 1L={};1L[3.N]=1f[i];5(1f[i]!=""){17(1L,"27"+i)}}u=3.D}s{u="";4 1d=0;O(k 1E 3.D)5(3.D.1F(k))1d++;5(1d>0){O(4 i=0;i<1d;i++){4 16=3.D[i][3.N];5(16==37){16=""}u=u+16+",";5(16!=""){17(3.D[i],"27"+i)}}}}5(u!=""){l.b("");4 2e=u.3o(u.o-1);5(2e!=","){u=u+","}p.b(","+u);$("f.c-Q-z",n).F("1i").B("M")}l.28(p);n.1b(6(){C=G;l.1p()}).1v(6(){C=m}).28(j);4 P=3t;4 t="";4 3u=0;4 19=m;l.1p(6(){5($(d).b()==3.1o&&p.b()==""){$(d).b("")}s 5(C){$("f.c-Q-z",n).B("1i");5($(d).b()!=""){I.2k("2l",n.2x());j.1H()}}C=G;K G}).1i(6(){5($(d).b()==""&&p.b()==""&&u==""){$(d).b(3.1o)}s 5(C){$("f.c-Q-z",n).F("1i").B("M");j.E()}}).3m(6(e){1k=e.2a;3d=m;3e(e.2a){T 38:e.1m();1A("3n");V;T 3b:e.1m();1A("1T");V;T 8:5(l.b()==""){4 S=p.b().1t(",");S=S[S.o-2];n.2y().39(J.t()).B("M");5(J.t().3a("M")){p.b(p.b().1c(","+S+",",","));3.1P.v(d,J.t())}s{3.1B.v(d,J.t());J.t().F("M")}}5(l.b().o==1){j.E();t=""}5($(":2D",j).o>0){5(P){21(P)}P=23(6(){1D()},3.1C)}V;T 9:T 3f:19=G;4 U=l.b().1c(/(,)/g,"");5(U!=""&&p.b().1x(","+U+",")<0&&U.o>=3.1V){e.1m();4 1n={};1n[3.Z]=U;1n[3.N]=U;4 W=$("f",n).o;17(1n,"3l"+(W+1));l.b("")}T 13:19=m;4 r=$("f.r:24",j);5(r.o>0){r.1b();j.E()}5(3.2d||r.o>0){e.1m()}V;3k:5(3.20){5(3.1I&&$("f.c-Q-z",n).o>=3.1I){I.10(\'<f A="c-2j">\'+3.2h+\'</f>\');j.1H()}s{5(P){21(P)}P=23(6(){1D()},3.1C)}}V}});6 1D(){5(1k==3h||(1k>8&&1k<32)){K j.E()}4 h=l.b().1c(/[\\\\]+|[\\/]+/g,"");5(h==t)K;t=h;5(h.o>=3.1V){n.F("1N");5(14=="h"){4 1j="";5(3.15){1j="&1j="+2A(3.15)}5(3.18){h=3.18.v(d,h)}$.3i(2C+"?"+3.2B+"="+2A(h)+1j+3.2E,6(7){12=0;4 1l=3.2z.v(d,7);O(k 1E 1l)5(1l.1F(k))12++;1J(1l,h)})}s{5(3.18){h=3.18.v(d,h)}1J(2F,h)}}s{n.B("1N");j.E()}}4 1S=0;6 1J(7,Y){5(!3.1e){Y=Y.2o()}4 1r=0;j.10(I.10("")).E();O(4 i=0;i<12;i++){4 w=i;1S++;4 1w=m;5(3.1y=="1a"){4 H=7[w].1a}s{4 H="";4 1u=3.1y.1t(",");O(4 y=0;y<1u.o;y++){4 1z=$.3c(1u[y]);H=H+7[w][1z]+" "}}5(H){5(!3.1e){H=H.2o()}5(H.1x(Y)!=-1&&p.b().1x(","+7[w][3.N]+",")==-1){1w=G}}5(1w){4 11=$(\'<f A="c-2p-z" L="c-2p-z-\'+w+\'"></f>\').1b(6(){4 1h=$(d).7("7");4 1G=1h.w;5($("#c-Q-"+1G,n).o<=0&&!19){4 7=1h.2s;l.b("").1p();t="";17(7,1G);3.2u.v(d,1h);j.E()}19=m}).1v(6(){C=m}).3r(6(){$("f",I).B("r");$(d).F("r")}).7("7",{2s:7[w],w:1S});4 X=$.2q({},7[w]);5(!3.1e){4 1Q=2r 2n("(?![^&;]+;)(?!<[^<>]*)("+Y+")(?![^<>]*>)(?![^&;]+;)","3w")}s{4 1Q=2r 2n("(?![^&;]+;)(?!<[^<>]*)("+Y+")(?![^<>]*>)(?![^&;]+;)","g")}5(3.2t){X[3.Z]=X[3.Z].1c(1Q,"<2v>$1</2v>")}5(!3.1M){11=11.10(X[3.Z])}s{11=3.1M.v(d,X,11)}I.2K(11);2R X;1r++;5(3.15&&3.15==1r){V}}}n.B("1N");5(1r<=0){I.10(\'<f A="c-2j">\'+3.2i+\'</f>\')}I.2k("2l",n.2x());j.1H();3.2m.v(d)}6 17(7,w){p.b(p.b()+7[3.N]+",");4 z=$(\'<f A="c-Q-z" L="c-Q-\'+w+\'"></f>\').1b(6(){3.1B.v(d,$(d));n.2y().B("M");$(d).F("M")}).1v(6(){C=m});4 1s=$(\'<a A="c-1s">&2T;</a>\').1b(6(){p.b(p.b().1c(","+7[3.N]+",",","));3.1P.v(d,z);C=G;l.1p();K m});J.3q(z.10(7[3.Z]).3v(1s));3.2w.v(d,J.t())}6 1A(1K){5($(":2D",j).o>0){4 W=$("f",j);5(1K=="1T"){4 R=W.3s(0)}s{4 R=W.3j(":S")}4 r=$("f.r:24",j);5(r.o>0){5(1K=="1T"){R=r.3p()}s{R=r.t()}}W.B("r");R.F("r")}}})}}})(3g);',62,219,'|||opts|var|if|function|data||||val|as|this||li||string||results_holder||input|false|selections_holder|length|values_input||active|else|prev|prefill_value|call|num|||item|class|removeClass|input_focus|preFill|hide|addClass|true|str|results_ul|org_li|return|id|selected|selectedValuesProp|for|timeout|selection|start|last|case|i_input|break|lis|this_data|query|selectedItemProp|html|formatted|d_count||d_type|retrieveLimit|new_v|add_selected_item|beforeRetrieve|tab_press|value|click|replace|prefill_count|matchCase|vals|ul|raw_data|blur|limit|lastKeyPressCode|new_data|preventDefault|n_data|startText|focus|elem|matchCount|close|split|names|mousedown|forward|search|searchObjProps|name|moveSelection|selectionClick|keyDelay|keyChange|in|hasOwnProperty|number|show|selectionLimit|processData|direction|v_data|formatList|loading|original|selectionRemoved|regx|asHtmlID|num_count|down|x_id|minChars|selections|attr|No|div|showResultList|clearTimeout|results|setTimeout|first|wrap|object|000|after|Math|keyCode|typeof|values|neverSubmit|lastChar|options|defaults|limitText|emptyText|message|css|width|resultsComplete|RegExp|toLowerCase|result|extend|new|attributes|resultsHighlight|resultClick|em|selectionAdded|outerWidth|children|retrieveComplete|encodeURIComponent|queryParam|req_string|visible|extraParams|org_data|More|Name|Selections|Are|append|list|hidden|as_values_|fn|autoSuggest|Enter|delete|type|times|floor|400|each|Results|Found|random|100|Here||off|autocomplete|Allowed|remove|undefined||not|hasClass|40|trim|first_focus|switch|188|jQuery|46|getJSON|filter|default|00|keydown|up|substring|next|before|mouseover|eq|null|totalSelections|prepend|gi'.split('|'),0,{}))