1/*! ColVis 1.1.1 2* ©2010-2014 SpryMedia Ltd - datatables.net/license 3*/(function(window,document,undefined){var factory=function($,DataTable){"use strict";var ColVis=function(oDTSettings,oInit) 4{if(!this.CLASS||this.CLASS!="ColVis") 5{alert("Warning: ColVis must be initialised with the keyword 'new'");} 6if(typeof oInit=='undefined') 7{oInit={};} 8if($.fn.dataTable.camelToHungarian){$.fn.dataTable.camelToHungarian(ColVis.defaults,oInit);} 9this.s={"dt":null,"oInit":oInit,"hidden":true,"abOriginal":[]};this.dom={"wrapper":null,"button":null,"collection":null,"background":null,"catcher":null,"buttons":[],"groupButtons":[],"restore":null};ColVis.aInstances.push(this);this.s.dt=$.fn.dataTable.Api?new $.fn.dataTable.Api(oDTSettings).settings()[0]:oDTSettings;this._fnConstruct(oInit);return this;};ColVis.prototype={button:function() 10{return this.dom.wrapper;},"fnRebuild":function() 11{this.rebuild();},rebuild:function() 12{for(var i=this.dom.buttons.length-1;i>=0;i--){this.dom.collection.removeChild(this.dom.buttons[i]);} 13this.dom.buttons.splice(0,this.dom.buttons.length);if(this.dom.restore){this.dom.restore.parentNode(this.dom.restore);} 14this._fnAddGroups();this._fnAddButtons();this._fnDrawCallback();},"_fnConstruct":function(init) 15{this._fnApplyCustomisation(init);var that=this;var i,iLen;this.dom.wrapper=document.createElement('div');this.dom.wrapper.className="ColVis";this.dom.button=$('<button />',{'class':!this.s.dt.bJUI?"ColVis_Button ColVis_MasterButton":"ColVis_Button ColVis_MasterButton ui-button ui-state-default"}).append('<span>'+this.s.buttonText+'</span>').bind(this.s.activate=="mouseover"?"mouseover":"click",function(e){e.preventDefault();that.rebuild();that._fnCollectionShow();}).appendTo(this.dom.wrapper)[0];this.dom.catcher=this._fnDomCatcher();this.dom.collection=this._fnDomCollection();this.dom.background=this._fnDomBackground();this._fnAddGroups();this._fnAddButtons();for(i=0,iLen=this.s.dt.aoColumns.length;i<iLen;i++) 16{this.s.abOriginal.push(this.s.dt.aoColumns[i].visible);} 17this.s.dt.aoDrawCallback.push({"fn":function(){that._fnDrawCallback.call(that);},"sName":"ColVis"});$(this.s.dt.oInstance).bind('column-reorder',function(e,oSettings,oReorder){for(i=0,iLen=that.s.aiExclude.length;i<iLen;i++){that.s.aiExclude[i]=oReorder.aiInvertMapping[that.s.aiExclude[i]];} 18var mStore=that.s.abOriginal.splice(oReorder.iFrom,1)[0];that.s.abOriginal.splice(oReorder.iTo,0,mStore);that.fnRebuild();});this._fnDrawCallback();},"_fnApplyCustomisation":function(init) 19{$.extend(true,this.s,ColVis.defaults,init);if(!this.s.showAll&&this.s.bShowAll){this.s.showAll=this.s.sShowAll;} 20if(!this.s.restore&&this.s.bRestore){this.s.restore=this.s.sRestore;} 21var groups=this.s.groups;var hungarianGroups=this.s.aoGroups;if(groups){for(var i=0,ien=groups.length;i<ien;i++){if(groups[i].title){hungarianGroups[i].sTitle=groups[i].title;} 22if(groups[i].columns){hungarianGroups[i].aiColumns=groups[i].columns;}}}},"_fnDrawCallback":function() 23{var columns=this.s.dt.aoColumns;var buttons=this.dom.buttons;var groups=this.s.aoGroups;var button;for(var i=0,ien=buttons.length;i<ien;i++){button=buttons[i];if(button.__columnIdx!==undefined){$('input',button).prop('checked',columns[button.__columnIdx].bVisible);}} 24var allVisible=function(columnIndeces){for(var k=0,kLen=columnIndeces.length;k<kLen;k++) 25{if(columns[columnIndeces[k]].bVisible===false){return false;}} 26return true;};var allHidden=function(columnIndeces){for(var m=0,mLen=columnIndeces.length;m<mLen;m++) 27{if(columns[columnIndeces[m]].bVisible===true){return false;}} 28return true;};for(var j=0,jLen=groups.length;j<jLen;j++) 29{if(allVisible(groups[j].aiColumns)) 30{$('input',this.dom.groupButtons[j]).prop('checked',true);$('input',this.dom.groupButtons[j]).prop('indeterminate',false);} 31else if(allHidden(groups[j].aiColumns)) 32{$('input',this.dom.groupButtons[j]).prop('checked',false);$('input',this.dom.groupButtons[j]).prop('indeterminate',false);} 33else 34{$('input',this.dom.groupButtons[j]).prop('indeterminate',true);}}},"_fnAddGroups":function() 35{var nButton;if(typeof this.s.aoGroups!='undefined') 36{for(var i=0,iLen=this.s.aoGroups.length;i<iLen;i++) 37{nButton=this._fnDomGroupButton(i);this.dom.groupButtons.push(nButton);this.dom.buttons.push(nButton);this.dom.collection.appendChild(nButton);}}},"_fnAddButtons":function() 38{var 39nButton,columns=this.s.dt.aoColumns;if($.inArray('all',this.s.aiExclude)===-1){for(var i=0,iLen=columns.length;i<iLen;i++) 40{if($.inArray(i,this.s.aiExclude)===-1) 41{nButton=this._fnDomColumnButton(i);nButton.__columnIdx=i;this.dom.buttons.push(nButton);}}} 42if(this.s.order==='alpha'){this.dom.buttons.sort(function(a,b){var titleA=columns[a.__columnIdx].sTitle;var titleB=columns[b.__columnIdx].sTitle;return titleA===titleB?0:titleA<titleB?-1:1;});} 43if(this.s.restore) 44{nButton=this._fnDomRestoreButton();nButton.className+=" ColVis_Restore";this.dom.buttons.push(nButton);} 45if(this.s.showAll) 46{nButton=this._fnDomShowXButton(this.s.showAll,true);nButton.className+=" ColVis_ShowAll";this.dom.buttons.push(nButton);} 47if(this.s.showNone) 48{nButton=this._fnDomShowXButton(this.s.showNone,false);nButton.className+=" ColVis_ShowNone";this.dom.buttons.push(nButton);} 49$(this.dom.collection).append(this.dom.buttons);},"_fnDomRestoreButton":function() 50{var 51that=this,dt=this.s.dt;
51return $('<li class="ColVis_Special '+(dt.bJUI?'ui-button ui-state-default':'')+'">'+ 52this.s.restore+ 53'</li>').click(function(e){for(var i=0,iLen=that.s.abOriginal.length;i<iLen;i++) 54{that.s.dt.oInstance.fnSetColumnVis(i,that.s.abOriginal[i],false);} 55that._fnAdjustOpenRows();that.s.dt.oInstance.fnAdjustColumnSizing(false);that.s.dt.oInstance.fnDraw(false);})[0];},"_fnDomShowXButton":function(str,action) 56{var 57that=this,dt=this.s.dt;return $('<li class="ColVis_Special '+(dt.bJUI?'ui-button ui-state-default':'')+'">'+ 58str+ 59'</li>').click(function(e){for(var i=0,iLen=that.s.abOriginal.length;i<iLen;i++) 60{if(that.s.aiExclude.indexOf(i)===-1) 61{that.s.dt.oInstance.fnSetColumnVis(i,action,false);}} 62that._fnAdjustOpenRows();that.s.dt.oInstance.fnAdjustColumnSizing(false);that.s.dt.oInstance.fnDraw(false);})[0];},"_fnDomGroupButton":function(i) 63{var 64that=this,dt=this.s.dt,oGroup=this.s.aoGroups[i];return $('<li class="ColVis_Special '+(dt.bJUI?'ui-button ui-state-default':'')+'">'+ 65'<label>'+ 66'<input type="checkbox" />'+ 67'<span>'+oGroup.sTitle+'</span>'+ 68'</label>'+ 69'</li>').click(function(e){var showHide=!$('input',this).is(":checked");if(e.target.nodeName.toLowerCase()!=="li") 70{showHide=!showHide;} 71for(var j=0;j<oGroup.aiColumns.length;j++) 72{that.s.dt.oInstance.fnSetColumnVis(oGroup.aiColumns[j],showHide);}})[0];},"_fnDomColumnButton":function(i) 73{var 74that=this,column=this.s.dt.aoColumns[i],dt=this.s.dt;var title=this.s.fnLabel===null?column.sTitle:this.s.fnLabel(i,column.sTitle,column.nTh);return $('<li '+(dt.bJUI?'class="ui-button ui-state-default"':'')+'>'+ 75'<label>'+ 76'<input type="checkbox" />'+ 77'<span>'+title+'</span>'+ 78'</label>'+ 79'</li>').click(function(e){var showHide=!$('input',this).is(":checked");if(e.target.nodeName.toLowerCase()!=="li") 80{showHide=!showHide;} 81var oldIndex=$.fn.dataTableExt.iApiIndex;$.fn.dataTableExt.iApiIndex=that._fnDataTablesApiIndex.call(that);if(dt.oFeatures.bServerSide) 82{that.s.dt.oInstance.fnSetColumnVis(i,showHide,false);that.s.dt.oInstance.fnAdjustColumnSizing(false);if(dt.oScroll.sX!==""||dt.oScroll.sY!=="") 83{that.s.dt.oInstance.oApi._fnScrollDraw(that.s.dt);} 84that._fnDrawCallback();} 85else 86{that.s.dt.oInstance.fnSetColumnVis(i,showHide);} 87$.fn.dataTableExt.iApiIndex=oldIndex;if(e.target.nodeName.toLowerCase()==='input'&&that.s.fnStateChange!==null) 88{that.s.fnStateChange.call(that,i,showHide);}})[0];},"_fnDataTablesApiIndex":function() 89{for(var i=0,iLen=this.s.dt.oInstance.length;i<iLen;i++) 90{if(this.s.dt.oInstance[i]==this.s.dt.nTable) 91{return i;}} 92return 0;},"_fnDomCollection":function() 93{return $('<ul />',{'class':!this.s.dt.bJUI?"ColVis_collection":"ColVis_collection ui-buttonset ui-buttonset-multi"}).css({'display':'none','opacity':0,'position':!this.s.bCssPosition?'absolute':''})[0];},"_fnDomCatcher":function() 94{var 95that=this,nCatcher=document.createElement('div');nCatcher.className="ColVis_catcher";$(nCatcher).click(function(){that._fnCollectionHide.call(that,null,null);});return nCatcher;},"_fnDomBackground":function() 96{var that=this;var background=$('<div></div>').addClass('ColVis_collectionBackground').css('opacity',0).click(function(){that._fnCollectionHide.call(that,null,null);});if(this.s.activate=="mouseover") 97{background.mouseover(function(){that.s.overcollection=false;that._fnCollectionHide.call(that,null,null);});} 98return background[0];},"_fnCollectionShow":function() 99{var that=this,i,iLen,iLeft;var oPos=$(this.dom.button).offset();var nHidden=this.dom.collection;var nBackground=this.dom.background;var iDivX=parseInt(oPos.left,10);var iDivY=parseInt(oPos.top+$(this.dom.button).outerHeight(),10);if(!this.s.bCssPosition) 100{nHidden.style.top=iDivY+"px";nHidden.style.left=iDivX+"px";} 101$(nHidden).css({'display':'block','opacity':0});nBackground.style.bottom='0px';nBackground.style.right='0px';var oStyle=this.dom.catcher.style;oStyle.height=$(this.dom.button).outerHeight()+"px";oStyle.width=$(this.dom.button).outerWidth()+"px";oStyle.top=oPos.top+"px";oStyle.left=iDivX+"px";document.body.appendChild(nBackground);document.body.appendChild(nHidden);document.body.appendChild(this.dom.catcher);$(nHidden).animate({"opacity":1},that.s.iOverlayFade);
101$(nBackground).animate({"opacity":0.1},that.s.iOverlayFade,'linear',function(){if($.browser&&$.browser.msie&&$.browser.version=="6.0") 102{that._fnDrawCallback();}});if(!this.s.bCssPosition) 103{iLeft=(this.s.sAlign=="left")?iDivX:iDivX-$(nHidden).outerWidth()+$(this.dom.button).outerWidth();nHidden.style.left=iLeft+"px";var iDivWidth=$(nHidden).outerWidth();var iDivHeight=$(nHidden).outerHeight();var iDocWidth=$(document).width();if(iLeft+iDivWidth>iDocWidth) 104{nHidden.style.left=(iDocWidth-iDivWidth)+"px";}} 105this.s.hidden=false;},"_fnCollectionHide":function() 106{var that=this;if(!this.s.hidden&&this.dom.collection!==null) 107{this.s.hidden=true;$(this.dom.collection).animate({"opacity":0},that.s.iOverlayFade,function(e){this.style.display="none";});$(this.dom.background).animate({"opacity":0},that.s.iOverlayFade,function(e){document.body.removeChild(that.dom.background);document.body.removeChild(that.dom.catcher);});}},"_fnAdjustOpenRows":function() 108{var aoOpen=this.s.dt.aoOpenRows;var iVisible=this.s.dt.oApi._fnVisbleColumns(this.s.dt);for(var i=0,iLen=aoOpen.length;i<iLen;i++){aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan=iVisible;}}};ColVis.fnRebuild=function(oTable) 109{var nTable=null;if(typeof oTable!='undefined') 110{nTable=oTable.fnSettings().nTable;} 111for(var i=0,iLen=ColVis.aInstances.length;i<iLen;i++) 112{if(typeof oTable=='undefined'||nTable==ColVis.aInstances[i].s.dt.nTable) 113{ColVis.aInstances[i].fnRebuild();}}};ColVis.defaults={active:'click',buttonText:'Show / hide columns',aiExclude:[],bRestore:false,sRestore:'Restore original',bShowAll:false,sShowAll:'Show All',sAlign:'left',fnStateChange:null,iOverlayFade:500,fnLabel:null,bCssPosition:false,aoGroups:[],order:'column'};ColVis.aInstances=[];ColVis.prototype.CLASS="ColVis";ColVis.VERSION="1.1.1";ColVis.prototype.VERSION=ColVis.VERSION;if(typeof $.fn.dataTable=="function"&&typeof $.fn.dataTableExt.fnVersionCheck=="function"&&$.fn.dataTableExt.fnVersionCheck('1.7.0')) 114{$.fn.dataTableExt.aoFeatures.push({"fnInit":function(oDTSettings){var init=oDTSettings.oInit;var colvis=new ColVis(oDTSettings,init.colVis||init.oColVis||{});return colvis.button();},"cFeature":"C","sFeature":"ColVis"});} 115else 116{alert("Warning: ColVis requires DataTables 1.7 or greater - www.datatables.net/download");} 117$.fn.dataTable.ColVis=ColVis;$.fn.DataTable.ColVis=ColVis;return ColVis;};if(typeof define==='function'&&define.amd){define(['jquery','datatables'],factory);} 118else if(typeof exports==='object'){factory(require('jquery'),require('datatables'));} 119else if(jQuery&&!jQuery.fn.dataTable.ColVis){factory(jQuery,jQuery.fn.dataTable);}})(window,document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.