First version, grabs recently added movies/tvshows
This commit is contained in:
133
webui/static/lib/datatables/js/FixedHeader.min.js
vendored
Normal file
133
webui/static/lib/datatables/js/FixedHeader.min.js
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* File: FixedHeader.nightly.min.js
|
||||
* Version: 2.1.0.dev
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Info: www.datatables.net
|
||||
*
|
||||
* Copyright 2008-2012 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, available at:
|
||||
* http://datatables.net/license_gpl2
|
||||
* http://datatables.net/license_bsd
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
*/
|
||||
var FixedHeader;(function(b,a,c){FixedHeader=function(e,d){if(typeof this.fnInit!="function"){alert("FixedHeader warning: FixedHeader must be initialised with the 'new' keyword.");
|
||||
return}var f=this;var g={aoCache:[],oSides:{top:true,bottom:false,left:0,right:0},oZIndexes:{top:104,bottom:103,left:102,right:101},oCloneOnDraw:{top:false,bottom:false,left:true,right:true},oMes:{iTableWidth:0,iTableHeight:0,iTableLeft:0,iTableRight:0,iTableTop:0,iTableBottom:0},oOffset:{top:0},nTable:null,bUseAbsPos:false,bFooter:false,bInitComplete:false};
|
||||
this.fnGetSettings=function(){return g};this.fnUpdate=function(){this._fnUpdateClones();
|
||||
this._fnUpdatePositions()};this.fnPosition=function(){this._fnUpdatePositions()};
|
||||
this.fnInit(e,d);if(typeof e.fnSettings=="function"){e._oPluginFixedHeader=this}};
|
||||
FixedHeader.prototype={fnInit:function(e,d){var f=this.fnGetSettings();var g=this;
|
||||
this.fnInitSettings(f,d);if(typeof e.fnSettings=="function"){if(typeof e.fnVersionCheck=="functon"&&e.fnVersionCheck("1.6.0")!==true){alert("FixedHeader 2 required DataTables 1.6.0 or later. Please upgrade your DataTables installation");
|
||||
return}var h=e.fnSettings();if(h.oScroll.sX!=""||h.oScroll.sY!=""){alert("FixedHeader 2 is not supported with DataTables' scrolling mode at this time");
|
||||
return}f.nTable=h.nTable;h.aoDrawCallback.unshift({fn:function(){FixedHeader.fnMeasure();
|
||||
g._fnUpdateClones.call(g);g._fnUpdatePositions.call(g)},sName:"FixedHeader"})}else{f.nTable=e
|
||||
}f.bFooter=(c(">tfoot",f.nTable).length>0)?true:false;f.bUseAbsPos=(c.browser&&c.browser.msie&&(c.browser.version=="6.0"||c.browser.version=="7.0"));
|
||||
if(f.oSides.top){f.aoCache.push(g._fnCloneTable("fixedHeader","FixedHeader_Header",g._fnCloneThead))
|
||||
}if(f.oSides.bottom){f.aoCache.push(g._fnCloneTable("fixedFooter","FixedHeader_Footer",g._fnCloneTfoot))
|
||||
}if(f.oSides.left){f.aoCache.push(g._fnCloneTable("fixedLeft","FixedHeader_Left",g._fnCloneTLeft,f.oSides.left))
|
||||
}if(f.oSides.right){f.aoCache.push(g._fnCloneTable("fixedRight","FixedHeader_Right",g._fnCloneTRight,f.oSides.right))
|
||||
}FixedHeader.afnScroll.push(function(){g._fnUpdatePositions.call(g)});c(b).resize(function(){FixedHeader.fnMeasure();
|
||||
g._fnUpdateClones.call(g);g._fnUpdatePositions.call(g)});FixedHeader.fnMeasure();
|
||||
g._fnUpdateClones();g._fnUpdatePositions();f.bInitComplete=true},fnInitSettings:function(e,d){if(typeof d!="undefined"){if(typeof d.top!="undefined"){e.oSides.top=d.top
|
||||
}if(typeof d.bottom!="undefined"){e.oSides.bottom=d.bottom}if(typeof d.left=="boolean"){e.oSides.left=d.left?1:0
|
||||
}else{if(typeof d.left!="undefined"){e.oSides.left=d.left}}if(typeof d.right=="boolean"){e.oSides.right=d.right?1:0
|
||||
}else{if(typeof d.right!="undefined"){e.oSides.right=d.right}}if(typeof d.zTop!="undefined"){e.oZIndexes.top=d.zTop
|
||||
}if(typeof d.zBottom!="undefined"){e.oZIndexes.bottom=d.zBottom}if(typeof d.zLeft!="undefined"){e.oZIndexes.left=d.zLeft
|
||||
}if(typeof d.zRight!="undefined"){e.oZIndexes.right=d.zRight}if(typeof d.offsetTop!="undefined"){e.oOffset.top=d.offsetTop
|
||||
}if(typeof d.alwaysCloneTop!="undefined"){e.oCloneOnDraw.top=d.alwaysCloneTop}if(typeof d.alwaysCloneBottom!="undefined"){e.oCloneOnDraw.bottom=d.alwaysCloneBottom
|
||||
}if(typeof d.alwaysCloneLeft!="undefined"){e.oCloneOnDraw.left=d.alwaysCloneLeft}if(typeof d.alwaysCloneRight!="undefined"){e.oCloneOnDraw.right=d.alwaysCloneRight
|
||||
}}e.bUseAbsPos=(c.browser&&c.browser.msie&&(c.browser.version=="6.0"||c.browser.version=="7.0"))
|
||||
},_fnCloneTable:function(j,i,h,f){var e=this.fnGetSettings();var d;if(c(e.nTable.parentNode).css("position")!="absolute"){e.nTable.parentNode.style.position="relative"
|
||||
}d=e.nTable.cloneNode(false);d.removeAttribute("id");var g=a.createElement("div");
|
||||
g.style.position="absolute";g.style.top="0px";g.style.left="0px";g.className+=" FixedHeader_Cloned "+j+" "+i;
|
||||
if(j=="fixedHeader"){g.style.zIndex=e.oZIndexes.top}if(j=="fixedFooter"){g.style.zIndex=e.oZIndexes.bottom
|
||||
}if(j=="fixedLeft"){g.style.zIndex=e.oZIndexes.left}else{if(j=="fixedRight"){g.style.zIndex=e.oZIndexes.right
|
||||
}}d.style.margin="0";g.appendChild(d);a.body.appendChild(g);return{nNode:d,nWrapper:g,sType:j,sPosition:"",sTop:"",sLeft:"",fnClone:h,iCells:f}
|
||||
},_fnMeasure:function(){var g=this.fnGetSettings(),d=g.oMes,f=c(g.nTable),e=f.offset(),i=this._fnSumScroll(g.nTable.parentNode,"scrollTop"),h=this._fnSumScroll(g.nTable.parentNode,"scrollLeft");
|
||||
d.iTableWidth=f.outerWidth();d.iTableHeight=f.outerHeight();d.iTableLeft=e.left+g.nTable.parentNode.scrollLeft;
|
||||
d.iTableTop=e.top+i;d.iTableRight=d.iTableLeft+d.iTableWidth;d.iTableRight=FixedHeader.oDoc.iWidth-d.iTableLeft-d.iTableWidth;
|
||||
d.iTableBottom=FixedHeader.oDoc.iHeight-d.iTableTop-d.iTableHeight},_fnSumScroll:function(f,e){var d=f[e];
|
||||
while(f=f.parentNode){if(f.nodeName=="HTML"||f.nodeName=="BODY"){break}d=f[e]}return d
|
||||
},_fnUpdatePositions:function(){var f=this.fnGetSettings();this._fnMeasure();for(var e=0,d=f.aoCache.length;
|
||||
e<d;e++){if(f.aoCache[e].sType=="fixedHeader"){this._fnScrollFixedHeader(f.aoCache[e])
|
||||
}else{if(f.aoCache[e].sType=="fixedFooter"){this._fnScrollFixedFooter(f.aoCache[e])
|
||||
}else{if(f.aoCache[e].sType=="fixedLeft"){this._fnScrollHorizontalLeft(f.aoCache[e])
|
||||
}else{this._fnScrollHorizontalRight(f.aoCache[e])}}}}},_fnUpdateClones:function(){var f=this.fnGetSettings();
|
||||
for(var e=0,d=f.aoCache.length;e<d;e++){f.aoCache[e].fnClone.call(this,f.aoCache[e])
|
||||
}},_fnScrollHorizontalRight:function(j){var h=this.fnGetSettings(),i=h.oMes,e=FixedHeader.oWin,d=FixedHeader.oDoc,g=j.nWrapper,f=c(g).outerWidth();
|
||||
if(e.iScrollRight<i.iTableRight){this._fnUpdateCache(j,"sPosition","absolute","position",g.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",g.style);this._fnUpdateCache(j,"sLeft",(i.iTableLeft+i.iTableWidth-f)+"px","left",g.style)
|
||||
}else{if(i.iTableLeft<d.iWidth-e.iScrollRight-f){if(h.bUseAbsPos){this._fnUpdateCache(j,"sPosition","absolute","position",g.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",g.style);this._fnUpdateCache(j,"sLeft",(d.iWidth-e.iScrollRight-f)+"px","left",g.style)
|
||||
}else{this._fnUpdateCache(j,"sPosition","fixed","position",g.style);this._fnUpdateCache(j,"sTop",(i.iTableTop-e.iScrollTop)+"px","top",g.style);
|
||||
this._fnUpdateCache(j,"sLeft",(e.iWidth-f)+"px","left",g.style)}}else{this._fnUpdateCache(j,"sPosition","absolute","position",g.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",g.style);this._fnUpdateCache(j,"sLeft",i.iTableLeft+"px","left",g.style)
|
||||
}}},_fnScrollHorizontalLeft:function(j){var h=this.fnGetSettings(),i=h.oMes,e=FixedHeader.oWin,d=FixedHeader.oDoc,f=j.nWrapper,g=c(f).outerWidth();
|
||||
if(e.iScrollLeft<i.iTableLeft){this._fnUpdateCache(j,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",f.style);this._fnUpdateCache(j,"sLeft",i.iTableLeft+"px","left",f.style)
|
||||
}else{if(e.iScrollLeft<i.iTableLeft+i.iTableWidth-g){if(h.bUseAbsPos){this._fnUpdateCache(j,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",f.style);this._fnUpdateCache(j,"sLeft",e.iScrollLeft+"px","left",f.style)
|
||||
}else{this._fnUpdateCache(j,"sPosition","fixed","position",f.style);this._fnUpdateCache(j,"sTop",(i.iTableTop-e.iScrollTop)+"px","top",f.style);
|
||||
this._fnUpdateCache(j,"sLeft","0px","left",f.style)}}else{this._fnUpdateCache(j,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(j,"sTop",i.iTableTop+"px","top",f.style);this._fnUpdateCache(j,"sLeft",(i.iTableLeft+i.iTableWidth-g)+"px","left",f.style)
|
||||
}}},_fnScrollFixedFooter:function(k){var i=this.fnGetSettings(),j=i.oMes,e=FixedHeader.oWin,d=FixedHeader.oDoc,f=k.nWrapper,h=c("thead",i.nTable).outerHeight(),g=c(f).outerHeight();
|
||||
if(e.iScrollBottom<j.iTableBottom){this._fnUpdateCache(k,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(k,"sTop",(j.iTableTop+j.iTableHeight-g)+"px","top",f.style);this._fnUpdateCache(k,"sLeft",j.iTableLeft+"px","left",f.style)
|
||||
}else{if(e.iScrollBottom<j.iTableBottom+j.iTableHeight-g-h){if(i.bUseAbsPos){this._fnUpdateCache(k,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(k,"sTop",(d.iHeight-e.iScrollBottom-g)+"px","top",f.style);this._fnUpdateCache(k,"sLeft",j.iTableLeft+"px","left",f.style)
|
||||
}else{this._fnUpdateCache(k,"sPosition","fixed","position",f.style);this._fnUpdateCache(k,"sTop",(e.iHeight-g)+"px","top",f.style);
|
||||
this._fnUpdateCache(k,"sLeft",(j.iTableLeft-e.iScrollLeft)+"px","left",f.style)}}else{this._fnUpdateCache(k,"sPosition","absolute","position",f.style);
|
||||
this._fnUpdateCache(k,"sTop",(j.iTableTop+g)+"px","top",f.style);this._fnUpdateCache(k,"sLeft",j.iTableLeft+"px","left",f.style)
|
||||
}}},_fnScrollFixedHeader:function(j){var m=this.fnGetSettings(),f=m.oMes,g=FixedHeader.oWin,l=FixedHeader.oDoc,e=j.nWrapper,k=0,h=m.nTable.getElementsByTagName("tbody");
|
||||
for(var d=0;d<h.length;++d){k+=h[d].offsetHeight}if(f.iTableTop>g.iScrollTop+m.oOffset.top){this._fnUpdateCache(j,"sPosition","absolute","position",e.style);
|
||||
this._fnUpdateCache(j,"sTop",f.iTableTop+"px","top",e.style);this._fnUpdateCache(j,"sLeft",f.iTableLeft+"px","left",e.style)
|
||||
}else{if(g.iScrollTop+m.oOffset.top>f.iTableTop+k){this._fnUpdateCache(j,"sPosition","absolute","position",e.style);
|
||||
this._fnUpdateCache(j,"sTop",(f.iTableTop+k)+"px","top",e.style);this._fnUpdateCache(j,"sLeft",f.iTableLeft+"px","left",e.style)
|
||||
}else{if(m.bUseAbsPos){this._fnUpdateCache(j,"sPosition","absolute","position",e.style);
|
||||
this._fnUpdateCache(j,"sTop",g.iScrollTop+"px","top",e.style);this._fnUpdateCache(j,"sLeft",f.iTableLeft+"px","left",e.style)
|
||||
}else{this._fnUpdateCache(j,"sPosition","fixed","position",e.style);this._fnUpdateCache(j,"sTop",m.oOffset.top+"px","top",e.style);
|
||||
this._fnUpdateCache(j,"sLeft",(f.iTableLeft-g.iScrollLeft)+"px","left",e.style)}}}},_fnUpdateCache:function(h,f,e,g,d){if(h[f]!=e){d[g]=e;
|
||||
h[f]=e}},_fnClassUpdate:function(f,d){var e=this;if(f.nodeName.toUpperCase()==="TR"||f.nodeName.toUpperCase()==="TH"||f.nodeName.toUpperCase()==="TD"||f.nodeName.toUpperCase()==="SPAN"){d.className=f.className
|
||||
}c(f).children().each(function(g){e._fnClassUpdate(c(f).children()[g],c(d).children()[g])
|
||||
})},_fnCloneThead:function(j){var i=this.fnGetSettings();var f=j.nNode;if(i.bInitComplete&&!i.oCloneOnDraw.top){this._fnClassUpdate(c("thead",i.nTable)[0],c("thead",f)[0]);
|
||||
return}var h=c(i.nTable).outerWidth();j.nWrapper.style.width=h+"px";f.style.width=h+"px";
|
||||
while(f.childNodes.length>0){c("thead th",f).unbind("click");f.removeChild(f.childNodes[0])
|
||||
}var g=c("thead",i.nTable).clone(true)[0];f.appendChild(g);var e=[];var d=[];jQuery("thead>tr th",i.nTable).each(function(k){e.push(jQuery(this).width())
|
||||
});jQuery("thead>tr td",i.nTable).each(function(k){d.push(jQuery(this).width())});
|
||||
jQuery("thead>tr th",i.nTable).each(function(k){jQuery("thead>tr th:eq("+k+")",f).width(e[k]);
|
||||
c(this).width(e[k])});jQuery("thead>tr td",i.nTable).each(function(k){jQuery("thead>tr td:eq("+k+")",f).width(d[k]);
|
||||
c(this).width(d[k])});c("th.sorting, th.sorting_desc, th.sorting_asc",f).bind("click",function(){this.blur()
|
||||
})},_fnCloneTfoot:function(g){var f=this.fnGetSettings();var d=g.nNode;g.nWrapper.style.width=c(f.nTable).outerWidth()+"px";
|
||||
while(d.childNodes.length>0){d.removeChild(d.childNodes[0])}var e=c("tfoot",f.nTable).clone(true)[0];
|
||||
d.appendChild(e);c("tfoot:eq(0)>tr th",f.nTable).each(function(h){c("tfoot:eq(0)>tr th:eq("+h+")",d).width(c(this).width())
|
||||
});c("tfoot:eq(0)>tr td",f.nTable).each(function(h){c("tfoot:eq(0)>tr th:eq("+h+")",d)[0].style.width(c(this).width())
|
||||
})},_fnCloneTLeft:function(k){var g=this.fnGetSettings();var e=k.nNode;var j=c("tbody",g.nTable)[0];
|
||||
var d=(c.browser&&c.browser.msie&&(c.browser.version=="6.0"||c.browser.version=="7.0"));
|
||||
while(e.childNodes.length>0){e.removeChild(e.childNodes[0])}e.appendChild(c("thead",g.nTable).clone(true)[0]);
|
||||
e.appendChild(c("tbody",g.nTable).clone(true)[0]);if(g.bFooter){e.appendChild(c("tfoot",g.nTable).clone(true)[0])
|
||||
}var l="gt("+(k.iCells-1)+")";c("thead tr",e).each(function(i){c("th:"+l,this).remove()
|
||||
});c("tfoot tr",e).each(function(i){c("th:"+l,this).remove()});c("tbody tr",e).each(function(i){c("td:"+l,this).remove()
|
||||
});this.fnEqualiseHeights("thead",j.parentNode,e);this.fnEqualiseHeights("tbody",j.parentNode,e);
|
||||
this.fnEqualiseHeights("tfoot",j.parentNode,e);var h=0;for(var f=0;f<k.iCells;f++){h+=c("thead tr th:eq("+f+")",g.nTable).outerWidth()
|
||||
}e.style.width=h+"px";k.nWrapper.style.width=h+"px"},_fnCloneTRight:function(l){var g=this.fnGetSettings();
|
||||
var k=c("tbody",g.nTable)[0];var e=l.nNode;var j=c("tbody tr:eq(0) td",g.nTable).length;
|
||||
var d=(c.browser&&c.browser.msie&&(c.browser.version=="6.0"||c.browser.version=="7.0"));
|
||||
while(e.childNodes.length>0){e.removeChild(e.childNodes[0])}e.appendChild(c("thead",g.nTable).clone(true)[0]);
|
||||
e.appendChild(c("tbody",g.nTable).clone(true)[0]);if(g.bFooter){e.appendChild(c("tfoot",g.nTable).clone(true)[0])
|
||||
}c("thead tr th:lt("+(j-l.iCells)+")",e).remove();c("tfoot tr th:lt("+(j-l.iCells)+")",e).remove();
|
||||
c("tbody tr",e).each(function(i){c("td:lt("+(j-l.iCells)+")",this).remove()});this.fnEqualiseHeights("thead",k.parentNode,e);
|
||||
this.fnEqualiseHeights("tbody",k.parentNode,e);this.fnEqualiseHeights("tfoot",k.parentNode,e);
|
||||
var h=0;for(var f=0;f<l.iCells;f++){h+=c("thead tr th:eq("+(j-1-f)+")",g.nTable).outerWidth()
|
||||
}e.style.width=h+"px";l.nWrapper.style.width=h+"px"},fnEqualiseHeights:function(h,g,j){var i=this,f=c(h+" tr:eq(0)",g).children(":eq(0)"),e=f.outerHeight()-f.height(),d=(c.browser&&c.browser.msie&&(c.browser.version=="6.0"||c.browser.version=="7.0"));
|
||||
c(h+" tr",j).each(function(l){c(this).children().height(c(h+" tr:eq("+l+")",g).outerHeight());
|
||||
if(!d){c(h+" tr:eq("+l+")",g).height(c(h+" tr:eq("+l+")",g).outerHeight())}})}};FixedHeader.oWin={iScrollTop:0,iScrollRight:0,iScrollBottom:0,iScrollLeft:0,iHeight:0,iWidth:0};
|
||||
FixedHeader.oDoc={iHeight:0,iWidth:0};FixedHeader.afnScroll=[];FixedHeader.fnMeasure=function(){var g=c(b),f=c(a),e=FixedHeader.oWin,d=FixedHeader.oDoc;
|
||||
d.iHeight=f.height();d.iWidth=f.width();e.iHeight=g.height();e.iWidth=g.width();e.iScrollTop=g.scrollTop();
|
||||
e.iScrollLeft=g.scrollLeft();e.iScrollRight=d.iWidth-e.iScrollLeft-e.iWidth;e.iScrollBottom=d.iHeight-e.iScrollTop-e.iHeight
|
||||
};FixedHeader.VERSION="2.1.0.dev";FixedHeader.prototype.VERSION=FixedHeader.VERSION;
|
||||
c(b).scroll(function(){FixedHeader.fnMeasure();for(var e=0,d=FixedHeader.afnScroll.length;
|
||||
e<d;e++){FixedHeader.afnScroll[e]()}})}(window,document,jQuery));
|
||||
Reference in New Issue
Block a user