src/ztfy/myams/resources/js/ext/jquery-dataTables-fixedColumns.min.js
changeset 0 8a19e25e39e4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ztfy/myams/resources/js/ext/jquery-dataTables-fixedColumns.min.js	Wed May 07 10:36:24 2014 +0200
@@ -0,0 +1,4 @@
+/* FixedColumns 3.0.0
+ * ©2010-2014 SpryMedia Ltd - datatables.net/license
+ */
+(function(c,a,d){var b=function(g,f){var e=function(i,k){var h=this;if(!this instanceof e){alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.");return}if(typeof k=="undefined"){k={}}if(g.fn.dataTable.camelToHungarian){g.fn.dataTable.camelToHungarian(e.defaults,k)}var j=g.fn.dataTable.Api?new g.fn.dataTable.Api(i).settings()[0]:i.fnSettings();this.s={dt:j,iTableColumns:j.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[]};this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}};j._oFixedColumns=this;if(!j._bInitComplete){j.oApi._fnCallbackReg(j,"aoInitComplete",function(){h._fnConstruct(k)},"FixedColumns")}else{this._fnConstruct(k)}};e.prototype={fnUpdate:function(){this._fnDraw(true)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(h){delete h._DTTC_iHeight;h.style.height="auto"},fnSetRowHeight:function(i,h){i.style.height=h+"px"},fnGetPosition:function(i){var h;var j=this.s.dt.oInstance;if(!g(i).parents(".DTFC_Cloned").length){return j.fnGetPosition(i)}else{if(i.nodeName.toLowerCase()==="tr"){h=g(i).index();return j.fnGetPosition(g("tr",this.s.dt.nTBody)[h])}else{var l=g(i).index();h=g(i.parentNode).index();var k=j.fnGetPosition(g("tr",this.s.dt.nTBody)[h]);return[k,l,j.oApi._fnVisibleToColumnIndex(this.s.dt,l)]}}},_fnConstruct:function(o){var l,j,h,n=this;if(typeof this.s.dt.oInstance.fnVersionCheck!="function"||this.s.dt.oInstance.fnVersionCheck("1.8.0")!==true){alert("FixedColumns "+e.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");return}if(this.s.dt.oScroll.sX===""){this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled");return}this.s=g.extend(true,this.s,e.defaults,o);var k=this.s.dt.oClasses;this.dom.grid.dt=g(this.s.dt.nTable).parents("div."+k.sScrollWrapper)[0];this.dom.scroller=g("div."+k.sScrollBody,this.dom.grid.dt)[0];this._fnColCalc();this._fnGridSetup();var m;g(this.dom.scroller).on("mouseover.DTFC",function(){m="main"}).on("scroll.DTFC",function(){if(m==="main"){if(n.s.iLeftColumns>0){n.dom.grid.left.liner.scrollTop=n.dom.scroller.scrollTop}if(n.s.iRightColumns>0){n.dom.grid.right.liner.scrollTop=n.dom.scroller.scrollTop}}});if(n.s.iLeftColumns>0){g(n.dom.grid.left.liner).on("mouseover.DTFC",function(){m="left"}).on("scroll.DTFC",function(){if(m==="left"){n.dom.scroller.scrollTop=n.dom.grid.left.liner.scrollTop;if(n.s.iRightColumns>0){n.dom.grid.right.liner.scrollTop=n.dom.grid.left.liner.scrollTop}}}).on("wheel.DTFC",function(r){var i=-r.originalEvent.deltaX;n.dom.scroller.scrollLeft-=i})}if(n.s.iRightColumns>0){g(n.dom.grid.right.liner).on("mouseover.DTFC",function(){m="right"}).on("scroll.DTFC",function(){if(m==="right"){n.dom.scroller.scrollTop=n.dom.grid.right.liner.scrollTop;if(n.s.iLeftColumns>0){n.dom.grid.left.liner.scrollTop=n.dom.grid.right.liner.scrollTop}}}).on("wheel.DTFC",function(r){var i=-r.originalEvent.deltaX;n.dom.scroller.scrollLeft-=i})}g(c).on("resize.DTFC",function(){n._fnGridLayout.call(n)});var q=true;var p=g(this.s.dt.nTable);p.on("draw.dt.DTFC",function(){n._fnDraw.call(n,q);q=false}).on("column-sizing.dt.DTFC",function(){n._fnColCalc();n._fnGridLayout(n)}).on("column-visibility.dt.DTFC",function(){n._fnColCalc();n._fnGridLayout(n);n._fnDraw(true)}).on("destroy.dt.DTFC",function(){p.off("column-sizing.dt.DTFC destroy.dt.DTFC draw.dt.DTFC");g(n.dom.scroller).fn("scroll.DTFC mouseover.DTFC");g(c).off("resize.DTFC");g(n.dom.grid.left.liner).on("scroll.DTFC wheel.DTFC mouseover.DTFC");g(n.dom.grid.left.wrapper).remove();g(n.dom.grid.right.liner).on("scroll.DTFC wheel.DTFC mouseover.DTFC");g(n.dom.grid.right.wrapper).remove()});this._fnGridLayout();this.s.dt.oInstance.fnDraw(false)},_fnColCalc:function(){var j=this;var i=0;var h=0;this.s.aiInnerWidths=[];this.s.aiOuterWidths=[];g.each(this.s.dt.aoColumns,function(l,k){var m=g(k.nTh);if(!m.filter(":visible").length){j.s.aiInnerWidths.push(0);j.s.aiOuterWidths.push(0)}else{var n=m.outerWidth();if(j.s.aiOuterWidths.length===0){n+=parseInt(g(j.s.dt.nTable).css("border-left-width"),10)}j.s.aiOuterWidths.push(n);j.s.aiInnerWidths.push(m.width());if(l<j.s.iLeftColumns){i+=n}if(j.s.iTableColumns-j.s.iRightColumns<=l){h+=n}}});this.s.iLeftWidth=i;this.s.iRightWidth=h},_fnGridSetup:function(){var l=this;var h=this._fnDTOverflow();var m;this.dom.body=this.s.dt.nTable;this.dom.header=this.s.dt.nTHead.parentNode;this.dom.header.parentNode.parentNode.style.position="relative";var j=g('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_RightBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightFootBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div></div></div>')[0];var k=j.childNodes[0];var i=j.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(j,this.dom.grid.dt);j.appendChild(this.dom.grid.dt);this.dom.grid.wrapper=j;if(this.s.iLeftColumns>0){this.dom.grid.left.wrapper=k;this.dom.grid.left.head=k.childNodes[0];this.dom.grid.left.body=k.childNodes[1];this.dom.grid.left.liner=g("div.DTFC_LeftBodyLiner",j)[0];j.appendChild(k)}if(this.s.iRightColumns>0){this.dom.grid.right.wrapper=i;this.dom.grid.right.head=i.childNodes[0];this.dom.grid.right.body=i.childNodes[1];this.dom.grid.right.liner=g("div.DTFC_RightBodyLiner",j)[0];m=g("div.DTFC_RightHeadBlocker",j)[0];m.style.width=h.bar+"px";m.style.right=-h.bar+"px";this.dom.grid.right.headBlock=m;m=g("div.DTFC_RightFootBlocker",j)[0];m.style.width=h.bar+"px";m.style.right=-h.bar+"px";this.dom.grid.right.footBlock=m;j.appendChild(i)}if(this.s.dt.nTFoot){this.dom.footer=this.s.dt.nTFoot.parentNode;if(this.s.iLeftColumns>0){this.dom.grid.left.foot=k.childNodes[2]}if(this.s.iRightColumns>0){this.dom.grid.right.foot=i.childNodes[2]}}},_fnGridLayout:function(){var o=this.dom.grid;var n=g(o.wrapper).width();var j=g(this.s.dt.nTable.parentNode).height();var m=g(this.s.dt.nTable.parentNode.parentNode).height();var h=this._fnDTOverflow();var l=this.s.iLeftWidth,i=this.s.iRightWidth,k;if(h.x){j-=h.bar}o.wrapper.style.height=m+"px";if(this.s.iLeftColumns>0){o.left.wrapper.style.width=l+"px";o.left.wrapper.style.height="1px";o.left.body.style.height=j+"px";if(o.left.foot){o.left.foot.style.top=(h.x?h.bar:0)+"px"}o.left.liner.style.width=(l+h.bar)+"px";o.left.liner.style.height=j+"px"}if(this.s.iRightColumns>0){k=n-i;if(h.y){k-=h.bar}o.right.wrapper.style.width=i+"px";o.right.wrapper.style.left=k+"px";o.right.wrapper.style.height="1px";o.right.body.style.height=j+"px";if(o.right.foot){o.right.foot.style.top=(h.x?h.bar:0)+"px"}o.right.liner.style.width=(i+h.bar)+"px";o.right.liner.style.height=j+"px";o.right.headBlock.style.display=h.y?"block":"none";o.right.footBlock.style.display=h.y?"block":"none"}},_fnDTOverflow:function(){var j=this.s.dt.nTable;var h=j.parentNode;var i={x:false,y:false,bar:this.s.dt.oScroll.iBarWidth};if(j.offsetWidth>h.clientWidth){i.x=true}if(j.offsetHeight>h.clientHeight){i.y=true}return i},_fnDraw:function(h){this._fnGridLayout();this._fnCloneLeft(h);this._fnCloneRight(h);if(this.s.fnDrawCallback!==null){this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right)}g(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(j){if(this.s.iRightColumns<=0){return}var l=this,h,m,k=[];for(h=this.s.iTableColumns-this.s.iRightColumns;h<this.s.iTableColumns;h++){if(this.s.dt.aoColumns[h].bVisible){k.push(h)}}this._fnClone(this.dom.clone.right,this.dom.grid.right,k,j)},_fnCloneLeft:function(j){if(this.s.iLeftColumns<=0){return}var l=this,h,m,k=[];for(h=0;h<this.s.iLeftColumns;h++){if(this.s.dt.aoColumns[h].bVisible){k.push(h)}}this._fnClone(this.dom.clone.left,this.dom.grid.left,k,j)},_fnCopyLayout:function(s,u){var r=[];var p=[];var l=[];for(var n=0,k=s.length;n<k;n++){var q=[];q.nTr=g(s[n].nTr).clone(true,true)[0];for(var m=0,t=this.s.iTableColumns;m<t;m++){if(g.inArray(m,u)===-1){continue}var o=g.inArray(s[n][m].cell,l);if(o===-1){var h=g(s[n][m].cell).clone(true,true)[0];p.push(h);l.push(s[n][m].cell);q.push({cell:h,unique:s[n][m].unique})}else{q.push({cell:p[o],unique:s[n][m].unique})}}r.push(q)}return r},_fnClone:function(y,x,l,h){var p=this,A,w,z,E,v,n,B,t,q,m,r,F;if(h){if(y.header!==null){y.header.parentNode.removeChild(y.header)}y.header=g(this.dom.header).clone(true,true)[0];y.header.className+=" DTFC_Cloned";y.header.style.width="100%";x.head.appendChild(y.header);m=this._fnCopyLayout(this.s.dt.aoHeader,l);r=g(">thead",y.header);r.empty();for(A=0,w=m.length;A<w;A++){r[0].appendChild(m[A].nTr)}this.s.dt.oApi._fnDrawHead(this.s.dt,m,true)}else{m=this._fnCopyLayout(this.s.dt.aoHeader,l);F=[];this.s.dt.oApi._fnDetectHeader(F,g(">thead",y.header)[0]);for(A=0,w=m.length;A<w;A++){for(z=0,E=m[A].length;z<E;z++){F[A][z].cell.className=m[A][z].cell.className;g("span.DataTables_sort_icon",F[A][z].cell).each(function(){this.className=g("span.DataTables_sort_icon",m[A][z].cell)[0].className})}}}this._fnEqualiseHeights("thead",this.dom.header,y.header);if(this.s.sHeightMatch=="auto"){g(">tbody>tr",p.dom.body).css("height","auto")}if(y.body!==null){y.body.parentNode.removeChild(y.body);y.body=null}y.body=g(this.dom.body).clone(true)[0];y.body.className+=" DTFC_Cloned";y.body.style.paddingBottom=this.s.dt.oScroll.iBarWidth+"px";y.body.style.marginBottom=(this.s.dt.oScroll.iBarWidth*2)+"px";if(y.body.getAttribute("id")!==null){y.body.removeAttribute("id")}g(">thead>tr",y.body).empty();g(">tfoot",y.body).remove();var s=g("tbody",y.body)[0];g(s).empty();if(this.s.dt.aiDisplay.length>0){var o=g(">thead>tr",y.body)[0];for(q=0;q<l.length;q++){B=l[q];t=g(this.s.dt.aoColumns[B].nTh).clone(true)[0];t.innerHTML="";var u=t.style;u.paddingTop="0";u.paddingBottom="0";u.borderTopWidth="0";u.borderBottomWidth="0";u.height=0;u.width=p.s.aiInnerWidths[B]+"px";o.appendChild(t)}g(">tbody>tr",p.dom.body).each(function(H){var I=this.cloneNode(false);I.removeAttribute("id");var j=p.s.dt.oFeatures.bServerSide===false?p.s.dt.aiDisplay[p.s.dt._iDisplayStart+H]:H;for(q=0;q<l.length;q++){var G=p.s.dt.aoData[j].anCells||p.s.dt.oApi._fnGetTdNodes(p.s.dt,j);B=l[q];if(G.length>0){t=g(G[B]).clone(true,true)[0];I.appendChild(t)}}s.appendChild(I)})}else{g(">tbody>tr",p.dom.body).each(function(i){t=this.cloneNode(true);t.className+=" DTFC_NoData";g("td",t).html("");s.appendChild(t)})}y.body.style.width="100%";y.body.style.margin="0";y.body.style.padding="0";if(h){if(typeof this.s.dt.oScroller!="undefined"){x.liner.appendChild(this.s.dt.oScroller.dom.force.cloneNode(true))}}x.liner.appendChild(y.body);this._fnEqualiseHeights("tbody",p.dom.body,y.body);if(this.s.dt.nTFoot!==null){if(h){if(y.footer!==null){y.footer.parentNode.removeChild(y.footer)}y.footer=g(this.dom.footer).clone(true,true)[0];y.footer.className+=" DTFC_Cloned";y.footer.style.width="100%";x.foot.appendChild(y.footer);m=this._fnCopyLayout(this.s.dt.aoFooter,l);var k=g(">tfoot",y.footer);k.empty();for(A=0,w=m.length;A<w;A++){k[0].appendChild(m[A].nTr)}this.s.dt.oApi._fnDrawHead(this.s.dt,m,true)}else{m=this._fnCopyLayout(this.s.dt.aoFooter,l);var C=[];this.s.dt.oApi._fnDetectHeader(C,g(">tfoot",y.footer)[0]);for(A=0,w=m.length;A<w;A++){for(z=0,E=m[A].length;z<E;z++){C[A][z].cell.className=m[A][z].cell.className}}}this._fnEqualiseHeights("tfoot",this.dom.footer,y.footer)}var D=this.s.dt.oApi._fnGetUniqueThs(this.s.dt,g(">thead",y.header)[0]);g(D).each(function(j){B=l[j];this.style.width=p.s.aiInnerWidths[B]+"px"});if(p.s.dt.nTFoot!==null){D=this.s.dt.oApi._fnGetUniqueThs(this.s.dt,g(">tfoot",y.footer)[0]);g(D).each(function(j){B=l[j];this.style.width=p.s.aiInnerWidths[B]+"px"})}},_fnGetTrNodes:function(j){var l=[];for(var k=0,h=j.childNodes.length;k<h;k++){if(j.childNodes[k].nodeName.toUpperCase()=="TR"){l.push(j.childNodes[k])}}return l},_fnEqualiseHeights:function(u,j,t){if(this.s.sHeightMatch=="none"&&u!=="thead"&&u!=="tfoot"){return}var q=this,n,k,h,m,y,x,p=j.getElementsByTagName(u)[0],r=t.getElementsByTagName(u)[0],l=g(">"+u+">tr:eq(0)",j).children(":first"),w=l.outerHeight()-l.height(),o=this._fnGetTrNodes(p),v=this._fnGetTrNodes(r),s=[];for(n=0,k=v.length;n<k;n++){y=o[n].offsetHeight;x=v[n].offsetHeight;h=x>y?x:y;if(this.s.sHeightMatch=="semiauto"){o[n]._DTTC_iHeight=h}s.push(h)}for(n=0,k=v.length;n<k;n++){v[n].style.height=s[n]+"px";o[n].style.height=s[n]+"px"}}};e.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"};e.version="3.0.0";g.fn.dataTable.FixedColumns=e;g.fn.DataTable.FixedColumns=e;return e};b(jQuery,jQuery.fn.dataTable)})(window,document);
\ No newline at end of file