b2evolution PHP Cross Reference Blogging Systems

Source: /rsc/js/jquery/jquery.hintbox.min.js - 1 lines - 7178 bytes - Text - Print

   1  (function(a){a.fn.hintbox=function(g){inputs=this;var c={ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32,PAGEDOWN:34};var f={STARTS_WITH:"S",ENDS_WITH:"E",CONTAINS:"C"};var n={backgroundColor:"#3369F9",color:"#FFF",autoDimentions:false,minChars:1,immediateList:false,width:"120px",separator:"\n",delay:400,slideDownTime:0,slideUpTime:0,inputClass:"hintbox_input",inputLoadingClass:"hintbox_loading",hintboxContainerClass:"hintbox_list_container",zIndex:100,url:"",params:{},extraParams:"",json:false,useCache:true,matchHint:false,matchRule:f.STARTS_WITH,sort:false,limit:0,onBeforeListLoad:function(){},onListRetrieved:function(){},onListLoaded:function(){},onItemSelected:function(){}};if(g.matchRule!=undefined){g.matchRule=g.matchRule.toUpperCase();if(g.matchRule!=f.STARTS_WITH&&g.matchRule!=f.ENDS_WITH&&g.matchRule!=f.CONTAINS){g.matchRule=n.matchRule}}var g=jQuery.extend(n,g);var A=function(F,E){var H;var G;var J;var I=new Array();if(F.length==0){return E.length}if(E.length==0){return F.length}for(H=0;H<=F.length;H++){I[H]=new Array();I[H][0]=H}for(G=0;G<=E.length;G++){I[0][G]=G}for(H=1;H<=F.length;H++){for(G=1;G<=E.length;G++){J=(F.charAt(H-1)==E.charAt(G-1))?0:1;I[H][G]=Math.min(I[H-1][G]+1,I[H][G-1]+1,I[H-1][G-1]+J);if(H>1&&G>1&&F.charAt(H-1)==E.charAt(G-2)&&F.charAt(H-2)==E.charAt(G-1)){I[H][G]=Math.min(I[H][G],I[H-2][G-2]+J)}}}return I[F.length][E.length]};var k=function(E){jQuery(document).bind("keydown",function(F){m(F,E)})};var d=function(){jQuery(document).unbind("keydown")};var z=function(E){d();k(E)};var r=function(E){return q(E).find("ul")};var q=function(E){return E.next("."+g.hintboxContainerClass)};var D=function(E){return q(E).get()!=""};var t=function(E){E.attr("autocomplete","off");var G="";var F="";E.keyup(function(I){if(I.keyCode!=c.UP&&I.keyCode!=c.DOWN&&I.keyCode!=c.ENTER&&I.keyCode!=c.LEFT&&I.keyCode!=c.RIGHT&&I.keyCode!=c.PAGEDOWN){F=jQuery.trim(E.val());if(F==""){q(E).slideUp(g.slideUpTime)}else{if(F!=G){if(F.length>=g.minChars){setTimeout(function(){x(E,F)},g.delay)}else{q(E).slideUp(g.slideUpTime)}}}G=F}if(I.keyCode==c.ENTER){G="";F="";var H=q(E);if(H.get()!=""){h(E)}}if(g.immediateList){if(I.keyCode==c.PAGEDOWN){F=jQuery.trim(E.val());if(F==""){x(E,F)}}}})};var s=function(E){if(D(E)){var F=r(E);F.find("li").click(function(){var G=jQuery(this);E.val(G.text());h(E);g.onItemSelected(G)})}};var m=function(E,J){if(D(J)){var G=jQuery.data(J,"cssBackup");var H=r(J);var K=H.find("li:first");var M=H.find("li:last");var F=H.find(".selected");if(E.keyCode==c.ENTER||E.keyCode==c.UP||E.keyCode==c.DOWN){E.preventDefault()}if(E.keyCode==c.ESCAPE){h(J);return}if(F.get()==""){if(E.keyCode==c.DOWN){F=K}else{if(E.keyCode==c.UP){F=M}}b(F);return}if(E.keyCode==c.DOWN){B(F,G);var L=F.next("li");if(L.get()==""){L=K;J.focus();H.find(".selected").removeClass("selected")}else{F=L;b(F)}}else{if(E.keyCode==c.UP){B(F,G);var I=F.prev("li");if(I.get()==""){I=M;J.focus();H.find(".selected").removeClass("selected")}else{b(I);F=I}}else{if(E.keyCode==c.ENTER){if(F.get()!=""){J.val(F.text())}h(J);g.onItemSelected(F)}}}}};var l=function(G){var E=g.url;E.indexOf("?")!=-1?E+="&":E+="?";E+="q="+escape(G);for(i in g.params){E+="&"+i+"="+escape(jQuery.trim(g.params[i]))}var F=jQuery.trim(g.extraParams);if(F.length>0){if(F.indexOf("&")>0){E+="&"+F}else{E+=F}}return E};var C=function(){var E=jQuery(document).data("hintbox_cache");if(E==undefined){var E=new Array();E.getItem=function(F){return this[F]};E.putItem=function(F,G){this[F]=G};E.hasItem=function(F){if(this[F]==undefined){return false}return true};jQuery(document).data("hintbox_cache",E)}return E};var p=function(G,I,H){G.removeClass(g.inputLoadingClass);if(H.length>0){var E=(typeof H=="object"?H:H.split(g.separator));g.onListRetrieved(E);if(g.useCache){var F=C();if(!F.hasItem(I)){F.putItem(I,E)}}e(G,E);var J={backgroundColor:r(G).find("li").css("background-color"),color:r(G).find("li").css("color")};jQuery.data(G,"cssBackup",J);o(G);u(G);j(G);z(G);s(G);g.onListLoaded(r(G))}};var x=function(G,I){if(g.immediateList||I.length>=g.minChars){var H=l(I);G.addClass(g.inputLoadingClass);g.onBeforeListLoad();var E=null;if(g.useCache){var F=C();if(F.hasItem(H)){E=F.getItem(H)}}if(E==null){if(!g.json){jQuery.ajax({url:H,success:function(J){p(G,H,jQuery.trim(J))}})}else{jQuery.getJSON(H,function(M){var N="";var L=jQuery(M.list);var K=L.size();var J=1;L.each(function(){N+=this;if(J<K){N+=g.separator}J++});p(G,H,N)})}}else{p(G,H,E)}}};var v=function(F){var H=F.offset();var E=q(F);var G=r(F);E.css({display:"block",position:"absolute",top:H.top+F.outerHeight()-parseInt(F.css("border-bottom-width")),left:H.left-parseInt(G.css("border-left-width"))+parseInt(F.css("border-left-width"))})};var y=function(H,E){var K=jQuery.trim(H.val());var G=new Array();var J=0;jQuery.each(E,function(){var M=A(K,jQuery.trim(this));if(G[J]==undefined){G[J]=new Array()}G[J]=new Array(M,jQuery.trim(this));J++});var L=function(O,N){if(parseInt(G[N])<parseInt(G[O])){var M=G[O];G[O]=G[N];G[N]=M;if(O>0){L(O-1,O)}}};for(var I=0;I<G.length-1;I++){L(I,I+1)}E=new Array();for(var I=0;I<G.length;I++){var F=G[I];E.push(F[1])}return E};var w=function(G,F){var H=jQuery.trim(G.val());var E=new Array();jQuery.each(F,function(){var I=jQuery.trim(this).toLowerCase();var J=H.toLowerCase();if(g.matchRule==f.STARTS_WITH){if(I.match("^"+J)==J){E.push(jQuery.trim(this))}}else{if(g.matchRule==f.ENDS_WITH){if(I.match(J+"$")==J){E.push(jQuery.trim(this))}}else{if(I.match(J)==J){E.push(jQuery.trim(this))}}}});return E};var e=function(G,E){var F=q(G);if(F.get()==""){F=jQuery("<div></div>").addClass(g.hintboxContainerClass).css({margin:0,padding:0,display:"none","z-index":g.zIndex})}else{F.empty()}var H=jQuery("<ul></ul>").css({cursor:"default"});if(g.matchHint){E=w(G,E)}if(g.sort){E=y(G,E)}if(g.limit>0){E=E.slice(0,g.limit)}jQuery.each(E,function(){H.append(jQuery("<li></li>").text(jQuery.trim(this)))});F.append(H);G.after(F);v(G);F.slideDown(g.slideDownTime)};var o=function(H){var I=r(H);if(I.find("li").length>0){if(g.autoDimentions){var F=parseInt(H.css("border-left-width"));var G=parseInt(H.css("border-right-width"));var E=H.outerWidth();g.width=(E-F-G)+"px";I.find("li").css({"line-height":H.outerHeight()+"px"})}I.css({width:g.width,"overflow-x":"hidden"})}else{I.remove()}};var h=function(F){d();var E=q(F);E.slideUp(g.slideUpTime,function(){jQuery(this).remove()})};var j=function(E){var F=r(E);var G=jQuery.data(E,"cssBackup");F.find("li").hover(function(){B(F.find(".selected"),G);b(jQuery(this))},function(){B(jQuery(this),G)})};var b=function(E){E.css({"background-color":g.backgroundColor,color:g.color});E.addClass("selected")};var B=function(E,F){E.css({"background-color":F.backgroundColor,color:F.color});E.removeClass("selected")};var u=function(E){if(!jQuery.support.boxModel){r(E).css({width:(parseInt(g.width)+parseInt(E.css("border-left-width"))*2)+"px"}).find("li").css({width:(parseInt(g.width)+parseInt(E.css("border-left-width"))*2)+"px"})}};jQuery(inputs).each(function(){var E=jQuery(this);if(!E.hasClass(g.inputClass)){E.addClass(g.inputClass)}t(E);E.click(function(){z(E)});E.focus(function(){z(E)});E.blur(function(){z(E)})});return inputs}})(jQuery);

title

Description

title

Description

title

Description

title

title

Body