# HG changeset patch # User Madhusudan.C.S # Date 1273530010 -19800 # Node ID 90b3930422971d498138781d884b5a71f3b5b42d # Parent 3ece0de11641eea6e8fac8e0bd9558fc365b3076 Added jQuery autosuggest plugin and its css file. diff -r 3ece0de11641 -r 90b393042297 project/static/css/autoSuggest.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project/static/css/autoSuggest.css Tue May 11 03:50:10 2010 +0530 @@ -0,0 +1,217 @@ +/* AutoSuggest CSS - Version 1.2 */ + +ul.as-selections { + list-style-type: none; + border-top: 1px solid #888; + border-bottom: 1px solid #b6b6b6; + border-left: 1px solid #aaa; + border-right: 1px solid #aaa; + padding: 4px 0 4px 4px; + margin: 0; + overflow: auto; + background-color: #fff; + box-shadow:inset 0 1px 2px #888; + -webkit-box-shadow:inset 0 1px 2px #888; + -moz-box-shadow:inset 0 1px 2px #888; +} + +ul.as-selections.loading { + background-color: #eee; +} + +ul.as-selections li { + float: left; + margin: 1px 4px 1px 0; +} + +ul.as-selections li.as-selection-item { + color: #2b3840; + font-size: 13px; + font-family: "Lucida Grande", arial, sans-serif; + text-shadow: 0 1px 1px #fff; + background-color: #ddeefe; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1)); + border: 1px solid #acc3ec; + border-top-color: #c0d9e9; + padding: 2px 7px 2px 10px; + border-radius: 12px; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + box-shadow: 0 1px 1px #e4edf2; + -webkit-box-shadow: 0 1px 1px #e4edf2; + -moz-box-shadow: 0 1px 1px #e4edf2; +} + +ul.as-selections li.as-selection-item:last-child { + margin-left: 30px; +} + +ul.as-selections li.as-selection-item a.as-close { + float: right; + margin: 1px 0 0 7px; + padding: 0 2px; + cursor: pointer; + color: #5491be; + font-family: "Helvetica", helvetica, arial, sans-serif; + font-size: 14px; + font-weight: bold; + text-shadow: 0 1px 1px #fff; + -webkit-transition: color .1s ease-in; +} + +ul.as-selections li.as-selection-item.blur { + color: #666666; + background-color: #f4f4f4; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f4f4f4), to(#d5d5d5)); + border-color: #bbb; + border-top-color: #ccc; + box-shadow: 0 1px 1px #e9e9e9; + -webkit-box-shadow: 0 1px 1px #e9e9e9; + -moz-box-shadow: 0 1px 1px #e9e9e9; +} + +ul.as-selections li.as-selection-item.blur a.as-close { + color: #999; +} + +ul.as-selections li:hover.as-selection-item { + color: #2b3840; + background-color: #bbd4f1; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#bbd4f1), to(#a3c2e5)); + border-color: #6da0e0; + border-top-color: #8bb7ed; +} + +ul.as-selections li:hover.as-selection-item a.as-close { + color: #4d70b0; +} + +ul.as-selections li.as-selection-item.selected { + border-color: #1f30e4; +} + +ul.as-selections li.as-selection-item a:hover.as-close { + color: #1b3c65; +} + +ul.as-selections li.as-selection-item a:active.as-close { + color: #4d70b0; +} + +ul.as-selections li.as-original { + margin-left: 0; +} + +ul.as-selections li.as-original input { + border: none; + outline: none; + font-size: 13px; + width: 120px; + height: 18px; + padding-top: 3px; +} + +ul.as-list { + position: absolute; + list-style-type: none; + margin: 2px 0 0 0; + padding: 0; + font-size: 14px; + color: #000; + font-family: "Lucida Grande", arial, sans-serif; + background-color: #fff; + background-color: rgba(255,255,255,0.95); + z-index: 2; + box-shadow: 0 2px 12px #222; + -webkit-box-shadow: 0 2px 12px #222; + -moz-box-shadow: 0 2px 12px #222; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +li.as-result-item, li.as-message { + margin: 0 0 0 0; + padding: 5px 12px; + background-color: transparent; + border: 1px solid #fff; + border-bottom: 1px solid #ddd; + cursor: pointer; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +li:first-child.as-result-item { + margin: 0; +} + +li.as-message { + margin: 0; + cursor: default; +} + +li.as-result-item.active { + background-color: #3668d9; + background-image: -webkit-gradient(linear, 0% 0%, 0% 64%, from(rgb(110, 129, 245)), to(rgb(62, 82, 242))); + border-color: #3342e8; + color: #fff; + text-shadow: 0 1px 2px #122042; +} + +li.as-result-item em { + font-style: normal; + background: #444; + padding: 0 2px; + color: #fff; +} + +li.as-result-item.active em { + background: #253f7a; + color: #fff; +} + +/* Webkit Hacks */ +@media screen and (-webkit-min-device-pixel-ratio:0) { + ul.as-selections { + border-top-width: 2px; + } + ul.as-selections li.as-selection-item { + padding-top: 3px; + padding-bottom: 3px; + } + ul.as-selections li.as-selection-item a.as-close { + margin-top: -1px; + } + ul.as-selections li.as-original input { + height: 19px; + } +} + +/* Opera Hacks */ +@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { + ul.as-list { + border: 1px solid #888; + } + ul.as-selections li.as-selection-item a.as-close { + margin-left: 4px; + margin-top: 0; + } +} + +/* IE Hacks */ +ul.as-list { + border: 1px solid #888\9; +} +ul.as-selections li.as-selection-item a.as-close { + margin-left: 4px\9; + margin-top: 0\9; +} + +/* Firefox 3.0 Hacks */ +ul.as-list, x:-moz-any-link, x:default { + border: 1px solid #888; +} +BODY:first-of-type ul.as-list, x:-moz-any-link, x:default { /* Target FF 3.5+ */ + border: none; +} \ No newline at end of file diff -r 3ece0de11641 -r 90b393042297 project/static/jquery/jquery.autoSuggest.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project/static/jquery/jquery.autoSuggest.js Tue May 11 03:50:10 2010 +0530 @@ -0,0 +1,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,d){e=function(c){return(c35?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+\'">\').25(\'\');4 n=$("#c-1W-"+x);4 J=$("#c-1O-"+x);4 j=$(\'<1Z A="c-22" L="c-22-\'+x+\'">\').E();4 I=$(\'<1g A="c-2L">\');4 p=$(\'\');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(\'\'+3.2h+\'\');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=$(\'\').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")}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(\'\'+3.2i+\'\')}I.2k("2l",n.2x());j.1H();3.2m.v(d)}6 17(7,w){p.b(p.b()+7[3.N]+",");4 z=$(\'\').1b(6(){3.1B.v(d,$(d));n.2y().B("M");$(d).F("M")}).1v(6(){C=m});4 1s=$(\'&2T;\').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,{}))