You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yacy_search_server/htroot/jquery/flexigrid/js/flexigrid.pack.js

1 line
26 KiB

(function($){$.addFlex=function(t,p){if(t.grid)return false;p=$.extend({height:200,width:'auto',striped:true,novstripe:false,minwidth:30,minheight:80,resizable:true,url:false,method:'POST',dataType:'xml',errormsg:'Connection Error',usepager:false,nowrap:true,page:1,total:1,useRp:true,rp:15,rpOptions:[10,15,20,30,50],title:false,pagestat:'Displaying {from} to {to} of {total} items',pagetext:'Page',outof:'of',findtext:'Find',procmsg:'Processing, please wait ...',query:'',qtype:'',nomsg:'No items',minColToggle:1,showToggleBtn:true,hideOnSubmit:true,autoload:true,blockOpacity:0.5,preProcess:false,onDragCol:false,onToggleCol:false,onChangeSort:false,onSuccess:false,onError:false,onSubmit:false},p);$(t).show().attr({cellPadding:0,cellSpacing:0,border:0}).removeAttr('width');var g={hset:{},rePosDrag:function(){var cdleft=0-this.hDiv.scrollLeft;if(this.hDiv.scrollLeft>0)cdleft-=Math.floor(p.cgwidth/2);$(g.cDrag).css({top:g.hDiv.offsetTop+1});var cdpad=this.cdpad;$('div',g.cDrag).hide();$('thead tr:first th:visible',this.hDiv).each(function(){var n=$('thead tr:first th:visible',g.hDiv).index(this);var cdpos=parseInt($('div',this).width());if(cdleft==0)cdleft-=Math.floor(p.cgwidth/2);cdpos=cdpos+cdleft+cdpad;if(isNaN(cdpos)){cdpos=0}$('div:eq('+n+')',g.cDrag).css({'left':cdpos+'px'}).show();cdleft=cdpos})},fixHeight:function(newH){newH=false;if(!newH)newH=$(g.bDiv).height();var hdHeight=$(this.hDiv).height();$('div',this.cDrag).each(function(){$(this).height(newH+hdHeight)});var nd=parseInt($(g.nDiv).height());if(nd>newH)$(g.nDiv).height(newH).width(200);else $(g.nDiv).height('auto').width('auto');$(g.block).css({height:newH,marginBottom:(newH*-1)});var hrH=g.bDiv.offsetTop+newH;if(p.height!='auto'&&p.resizable)hrH=g.vDiv.offsetTop;$(g.rDiv).css({height:hrH})},dragStart:function(dragtype,e,obj){if(dragtype=='colresize'){$(g.nDiv).hide();$(g.nBtn).hide();var n=$('div',this.cDrag).index(obj);var ow=$('th:visible div:eq('+n+')',this.hDiv).width();$(obj).addClass('dragging').siblings().hide();$(obj).prev().addClass('dragging').show();this.colresize={startX:e.pageX,ol:parseInt(obj.style.left),ow:ow,n:n};$('body').css('cursor','col-resize')}else if(dragtype=='vresize'){var hgo=false;$('body').css('cursor','row-resize');if(obj){hgo=true;$('body').css('cursor','col-resize')}this.vresize={h:p.height,sy:e.pageY,w:p.width,sx:e.pageX,hgo:hgo}}else if(dragtype=='colMove'){$(g.nDiv).hide();$(g.nBtn).hide();this.hset=$(this.hDiv).offset();this.hset.right=this.hset.left+$('table',this.hDiv).width();this.hset.bottom=this.hset.top+$('table',this.hDiv).height();this.dcol=obj;this.dcoln=$('th',this.hDiv).index(obj);this.colCopy=document.createElement("div");this.colCopy.className="colCopy";this.colCopy.innerHTML=obj.innerHTML;if($.browser.msie){this.colCopy.className="colCopy ie"}$(this.colCopy).css({position:'absolute',float:'left',display:'none',textAlign:obj.align});$('body').append(this.colCopy);$(this.cDrag).hide()}$('body').noSelect()},dragMove:function(e){if(this.colresize){var n=this.colresize.n;var diff=e.pageX-this.colresize.startX;var nleft=this.colresize.ol+diff;var nw=this.colresize.ow+diff;if(nw>p.minwidth){$('div:eq('+n+')',this.cDrag).css('left',nleft);this.colresize.nw=nw}}else if(this.vresize){var v=this.vresize;var y=e.pageY;var diff=y-v.sy;if(!p.defwidth)p.defwidth=p.width;if(p.width!='auto'&&!p.nohresize&&v.hgo){var x=e.pageX;var xdiff=x-v.sx;var newW=v.w+xdiff;if(newW>p.defwidth){this.gDiv.style.width=newW+'px';p.width=newW}}var newH=v.h+diff;if((newH>p.minheight||p.height<p.minheight)&&!v.hgo){this.bDiv.style.height=newH+'px';p.height=newH;this.fixHeight(newH)}v=null}else if(this.colCopy){$(this.dcol).addClass('thMove').removeClass('thOver');if(e.pageX>this.hset.right||e.pageX<this.hset.left||e.pageY>this.hset.bottom||e.pageY<this.hset.top){$('body').css('cursor','move')}else{$('body').css('cursor','pointer')}$(this.colCopy).css({top:e.pageY+10,left:e.pageX+20,display:'block'})}},dragEnd:function(){if(this.colresize){var n=this.colresize.n;var nw=this.colresize.nw;$('th:visible div:eq('+n+')',this.hDiv).css('width',nw);$('tr',