X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Fsrc%2Fcore%2Fcore.constructor.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Fsrc%2Fcore%2Fcore.constructor.js;h=8af48d54f7c4b513d2e65131a767c16ebd116d55;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/src/core/core.constructor.js b/webapp/resources/datatables-1.9.4/media/src/core/core.constructor.js new file mode 100644 index 0000000..8af48d5 --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/src/core/core.constructor.js @@ -0,0 +1,428 @@ +var i=0, iLen, j, jLen, k, kLen; +var sId = this.getAttribute( 'id' ); +var bInitHandedOff = false; +var bUsePassedData = false; + + +/* Sanity check */ +if ( this.nodeName.toLowerCase() != 'table' ) +{ + _fnLog( null, 0, "Attempted to initialise DataTables on a node which is not a "+ + "table: "+this.nodeName ); + return; +} + +/* Check to see if we are re-initialising a table */ +for ( i=0, iLen=DataTable.settings.length ; i= oSettings.aoColumns.length ) + { + oSettings.aaSorting[i][0] = 0; + } + var oColumn = oSettings.aoColumns[ oSettings.aaSorting[i][0] ]; + + /* Add a default sorting index */ + if ( oSettings.aaSorting[i][2] === undefined ) + { + oSettings.aaSorting[i][2] = 0; + } + + /* If aaSorting is not defined, then we use the first indicator in asSorting */ + if ( oInit.aaSorting === undefined && oSettings.saved_aaSorting === undefined ) + { + oSettings.aaSorting[i][1] = oColumn.asSorting[0]; + } + + /* Set the current sorting index based on aoColumns.asSorting */ + for ( j=0, jLen=oColumn.asSorting.length ; j 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") ) +{ + // If we are a scrolling table, and no footer has been given, then we need to create + // a tfoot element for the caption element to be appended to + tfoot = [ document.createElement( 'tfoot' ) ]; + this.appendChild( tfoot[0] ); +} + +if ( tfoot.length > 0 ) +{ + oSettings.nTFoot = tfoot[0]; + _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot ); +} + +/* Check if there is data passing into the constructor */ +if ( bUsePassedData ) +{ + for ( i=0 ; i