X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Fsrc%2Fapi%2Fapi.static.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Fsrc%2Fapi%2Fapi.static.js;h=5000dce481f0fa1bb72a477dfe5028f5bcfe03cb;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/src/api/api.static.js b/webapp/resources/datatables-1.9.4/media/src/api/api.static.js new file mode 100644 index 0000000..5000dce --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/src/api/api.static.js @@ -0,0 +1,98 @@ + + +/** + * Provide a common method for plug-ins to check the version of DataTables being used, in order + * to ensure compatibility. + * @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note that the + * formats "X" and "X.Y" are also acceptable. + * @returns {boolean} true if this version of DataTables is greater or equal to the required + * version, or false if this version of DataTales is not suitable + * @static + * @dtopt API-Static + * + * @example + * alert( $.fn.dataTable.fnVersionCheck( '1.9.0' ) ); + */ +DataTable.fnVersionCheck = function( sVersion ) +{ + /* This is cheap, but effective */ + var fnZPad = function (Zpad, count) + { + while(Zpad.length < count) { + Zpad += '0'; + } + return Zpad; + }; + var aThis = DataTable.ext.sVersion.split('.'); + var aThat = sVersion.split('.'); + var sThis = '', sThat = ''; + + for ( var i=0, iLen=aThat.length ; i= parseInt(sThat, 10); +}; + + +/** + * Check if a TABLE node is a DataTable table already or not. + * @param {node} nTable The TABLE node to check if it is a DataTable or not (note that other + * node types can be passed in, but will always return false). + * @returns {boolean} true the table given is a DataTable, or false otherwise + * @static + * @dtopt API-Static + * + * @example + * var ex = document.getElementById('example'); + * if ( ! $.fn.DataTable.fnIsDataTable( ex ) ) { + * $(ex).dataTable(); + * } + */ +DataTable.fnIsDataTable = function ( nTable ) +{ + var o = DataTable.settings; + + for ( var i=0 ; i 0 ) { + * $(table).dataTable().fnAdjustColumnSizing(); + * } + */ +DataTable.fnTables = function ( bVisible ) +{ + var out = []; + + jQuery.each( DataTable.settings, function (i, o) { + if ( !bVisible || (bVisible === true && $(o.nTable).is(':visible')) ) + { + out.push( o.nTable ); + } + } ); + + return out; +}; +