PATH:
home
/
letacommog
/
entrepro
/
wp-content
/
plugins
/
buddypress
/
bp-messages
/
js
/
autocomplete
!function(e){e.fn.extend({autocompletebp:function(t,n){var a="string"==typeof t;return n=e.extend({},e.Autocompleter.defaults,{url:a?t:null,data:a?null:t,delay:a?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function a(){var e=x.selected();if(!e)return!1;var t=e.result;if(b=t,n.multiple){var a=r(C.val());a.length>1&&(t=a.slice(0,a.length-1).join(n.multipleSeparator)+n.multipleSeparator+t),t+=n.multipleSeparator}return C.val(t),u(),C.trigger("result",[e.data,e.value]),!0}function i(e,t){if(g!=v.DEL){var a=C.val();(t||a!=b)&&(b=a,(a=o(a)).length>=n.minChars?(C.addClass(n.loadingClass),jQuery("#send-to-input").addClass("loading"),n.matchCase||(a=a.toLowerCase()),f(a,c,u)):(d(),x.hide()))}else x.hide()}function r(t){if(!t)return[""];var a=t.split(e.trim(n.multipleSeparator)),i=[];return e.each(a,function(t,n){e.trim(n)&&(i[t]=e.trim(n))}),i}function o(e){if(!n.multiple)return e;var t=r(e);return t[t.length-1]}function l(a,i){n.autoFill&&o(C.val()).toLowerCase()==a.toLowerCase()&&8!=g&&(C.val(C.val()+i.substring(o(b).length)),e.Autocompleter.Selection(t,b.length,b.length+i.length))}function s(){clearTimeout(m),m=setTimeout(u,200)}function u(){x.hide(),clearTimeout(m),d(),n.mustMatch&&C.search(function(e){e||C.val("")})}function c(e,t){if(t&&t.length&&T){d(),x.display(t,e);var n=t[0].value.split(";");t.value=n[0],l(e,t.value),x.show()}else u()}function f(a,i,r){n.matchCase||(a=a.toLowerCase());var l=w.load(a);if(l&&l.length)i(a,l);else if("string"==typeof n.url&&n.url.length>0){var s={};e.each(n.extraParams,function(e,t){s[e]="function"==typeof t?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:o(a),limit:n.max,action:"messages_autocomplete_results",cookie:p()},s),success:function(e){var t=n.parse&&n.parse(e)||h(e);w.add(a,t),i(a,t)}})}else r(a)}function h(t){for(var a=[],i=t.split("\n"),r=0;r<i.length;r++){var o=e.trim(i[r]);o&&(o=o.split("|"),a[a.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return a}function d(){C.removeClass(n.loadingClass),jQuery("#send-to-input").removeClass("loading")}function p(){var e,t,n,a,i,r=document.cookie.split(";"),o={};for(e=0;e<r.length;e++)n=(t=r[e]).indexOf("="),a=jq.trim(unescape(t.slice(0,n))),i=unescape(t.slice(n+1)),0===a.indexOf("bp-")&&(o[a]=i);return encodeURIComponent(jq.param(o))}var m,g,v={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},C=e(t).attr("autocomplete","off").addClass(n.inputClass),b="",w=e.Autocompleter.Cache(n),T=0,A={mouseDownOnSelect:!1},x=e.Autocompleter.Select(n,t,a,A);C.keydown(function(t){switch(g=t.keyCode,t.keyCode){case v.UP:t.preventDefault(),x.visible()?x.prev():i(0,!0);break;case v.DOWN:t.preventDefault(),x.visible()?x.next():i(0,!0);break;case v.PAGEUP:t.preventDefault(),x.visible()?x.pageUp():i(0,!0);break;case v.PAGEDOWN:t.preventDefault(),x.visible()?x.pageDown():i(0,!0);break;case n.multiple&&","==e.trim(n.multipleSeparator)&&v.COMMA:case v.TAB:case v.RETURN:a()&&(n.multiple||C.blur(),t.preventDefault(),C.focus());break;case v.ESC:x.hide();break;default:clearTimeout(m),m=setTimeout(i,n.delay)}}).keypress(function(){}).focus(function(){T++}).blur(function(){T=0,A.mouseDownOnSelect||s()}).click(function(){T++>1&&!x.visible()&&i(0,!0)}).bind("search",function(){function t(e,t){var a;if(t&&t.length)for(var i=0;i<t.length;i++)if(t[i].result.toLowerCase()==e.toLowerCase()){a=t[i];break}"function"==typeof n?n(a):C.trigger("result",a&&[a.data,a.value])}var n=arguments.length>1?arguments[1]:null;e.each(r(C.val()),function(e,n){f(n,t,t)})}).bind("flushCache",function(){w.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]),"data"in arguments[1]&&w.populate()}).bind("unautocomplete",function(){x.unbind(),C.unbind()})},e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(e){return e[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},e.Autocompleter.Cache=function(t){function n(e,n){t.matchCase||(e=e.toLowerCase());var a=e.indexOf(n);return-1!=a&&(0==a||t.matchContains)}function a(e,n){l>t.cacheLength&&r(),o[e]||l++,o[e]=n}function i(){if(!t.data)return!1;var n={},i=0;t.url||(t.cacheLength=1),n[""]=[];for(var r=0,o=t.data.length;r<o;r++){var l=t.data[r];l="string"==typeof l?[l]:l;var s=t.formatItem(l,r+1,t.data.length);if(!1!==s){var u=s.charAt(0).toLowerCase();n[u]||(n[u]=[]);var c={value:s,data:l,result:t.formatResult&&t.formatResult(l)||s};n[u].push(c),i++<t.max&&n[""].push(c)}}e.each(n,function(e,n){t.cacheLength++,a(e,n)})}function r(){o={},l=0}var o={},l=0;return setTimeout(i,25),{flush:r,add:a,populate:i,load:function(a){if(!t.cacheLength||!l)return null;if(!t.url&&t.matchContains){u=[];for(var i in o)if(i.length>0){var r=o[i];e.each(r,function(e,t){n(t.value,a)&&u.push(t)})}return u}if(o[a])return o[a];if(t.matchSubset)for(var s=a.length-1;s>=t.minChars;s--)if(r=o[a.substr(0,s)]){var u=[];return e.each(r,function(e,t){n(t.value,a)&&(u[u.length]=t)}),u}return null}}},e.Autocompleter.Select=function(t,n,a,i){function r(){C&&(d=e("<div/>").hide().addClass(t.resultsClass).css("position","absolute").appendTo(t.attachTo),p=e("<ul>").appendTo(d).mouseover(function(t){o(t).nodeName&&"LI"==o(t).nodeName.toUpperCase()&&(g=e("li",p).removeClass(m.ACTIVE).index(o(t)),e(o(t)).addClass(m.ACTIVE))}).click(function(t){return e(o(t)).addClass(m.ACTIVE),a(),n.focus(),!1}).mousedown(function(){i.mouseDownOnSelect=!0}).mouseup(function(){i.mouseDownOnSelect=!1}),t.width>0&&d.css("width",t.width),C=!1)}function o(e){for(var t=e.target;t&&"LI"!=t.tagName;)t=t.parentNode;return t||[]}function l(e){f.slice(g,g+1).removeClass(),s(e);var n=f.slice(g,g+1).addClass(m.ACTIVE);if(t.scroll){var a=0;f.slice(0,g).each(function(){a+=this.offsetHeight}),a+n[0].offsetHeight-p.scrollTop()>p[0].clientHeight?p.scrollTop(a+n[0].offsetHeight-p.innerHeight()):a<p.scrollTop()&&p.scrollTop(a)}}function s(e){(g+=e)<0?g=f.size()-1:g>=f.size()&&(g=0)}function u(e){return t.max&&t.max<e?t.max:e}function c(){p.empty();for(var n=u(h.length),a=0;a<n;a++)if(h[a]){var i=t.formatItem(h[a].data,a+1,n,h[a].value,v);if(!1!==i){var r=e("<li>").html(t.highlight(i,v)).addClass(a%2==0?"ac_event":"ac_odd").appendTo(p)[0];e.data(r,"ac_data",h[a])}}f=p.find("li"),t.selectFirst&&(f.slice(0,1).addClass(m.ACTIVE),g=0),p.bgiframe()}var f,h,d,p,m={ACTIVE:"ac_over"},g=-1,v="",C=!0;return{display:function(e,t){r(),h=e,v=t,c()},next:function(){l(1)},prev:function(){l(-1)},pageUp:function(){l(0!=g&&g-8<0?-g:-8)},pageDown:function(){l(g!=f.size()-1&&g+8>f.size()?f.size()-1-g:8)},hide:function(){d&&d.hide(),g=-1},visible:function(){return d&&d.is(":visible")},current:function(){return this.visible()&&(f.filter("."+m.ACTIVE)[0]||t.selectFirst&&f[0])},show:function(){var a=e(n).offset();if(d.css({width:"string"==typeof t.width||t.width>0?t.width:e(n).width(),top:a.top+n.offsetHeight,left:a.left}).show(),t.scroll&&(p.scrollTop(0),p.css({maxHeight:t.scrollHeight,overflow:"auto"}),e.browser.msie&&void 0===document.body.style.maxHeight)){var i=0;f.each(function(){i+=this.offsetHeight});var r=i>t.scrollHeight;p.css("height",r?t.scrollHeight:i),r||f.width(p.width()-parseInt(f.css("padding-left"))-parseInt(f.css("padding-right")))}},selected:function(){var t=f&&f.filter("."+m.ACTIVE).removeClass(m.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},unbind:function(){d&&d.remove()}}},e.Autocompleter.Selection=function(e,t,n){if(e.createTextRange){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",t),a.moveEnd("character",n),a.select()}else e.setSelectionRange?e.setSelectionRange(t,n):e.selectionStart&&(e.selectionStart=t,e.selectionEnd=n);e.focus()}}(jQuery);
[+]
..
[-] jquery.autocomplete.js
[edit]
[-] jquery.bgiframe.min.js
[edit]
[-] license.bgiframe.txt
[edit]
[-] jquery.autocompletefb.min.js
[edit]
[-] jquery.autocomplete.min.js
[edit]
[-] jquery.autocompletefb.js
[edit]
[-] jquery.dimensions.js
[edit]
[-] jquery.dimensions.min.js
[edit]
[-] jquery.bgiframe.js
[edit]