From 2d8683dcf6cb1b193d488d41bec9fea9778d7670 Mon Sep 17 00:00:00 2001 From: Rod Roark Date: Thu, 12 Apr 2012 17:10:55 -0700 Subject: [PATCH] Added DataTables 1.9.0, minus examples and documentation. --- library/js/datatables/Readme.txt | 11 + .../extras/AutoFill/media/css/AutoFill.css | 24 + .../extras/AutoFill/media/images/filler.png | Bin 0 -> 1040 bytes .../extras/AutoFill/media/js/AutoFill.js | 820 ++ .../extras/AutoFill/media/js/AutoFill.min.js | 33 + .../extras/AutoFill/media/js/AutoFill.min.js.gz | Bin 0 -> 3084 bytes .../extras/ColReorder/media/css/ColReorder.css | 21 + .../extras/ColReorder/media/images/insert.png | Bin 0 -> 1885 bytes .../extras/ColReorder/media/js/ColReorder.js | 957 ++ .../extras/ColReorder/media/js/ColReorder.min.js | 33 + .../ColReorder/media/js/ColReorder.min.js.gz | Bin 0 -> 3267 bytes .../datatables/extras/ColVis/media/css/ColVis.css | 76 + .../extras/ColVis/media/css/ColVisAlt.css | 104 + .../extras/ColVis/media/images/button.png | Bin 0 -> 1161 bytes .../js/datatables/extras/ColVis/media/js/ColVis.js | 995 ++ .../extras/ColVis/media/js/ColVis.min.js | 33 + .../extras/ColVis/media/js/ColVis.min.js.gz | Bin 0 -> 3065 bytes .../extras/FixedColumns/media/js/FixedColumns.js | 1185 ++ .../FixedColumns/media/js/FixedColumns.min.js | 47 + .../FixedColumns/media/js/FixedColumns.min.js.gz | Bin 0 -> 3559 bytes .../extras/FixedHeader/js/FixedHeader.js | 916 ++ .../extras/FixedHeader/js/FixedHeader.min.js | 39 + .../extras/FixedHeader/js/FixedHeader.min.js.gz | Bin 0 -> 3016 bytes .../js/datatables/extras/KeyTable/js/KeyTable.js | 1111 ++ .../datatables/extras/KeyTable/js/KeyTable.min.js | 27 + .../extras/KeyTable/js/KeyTable.min.js.gz | Bin 0 -> 2561 bytes .../extras/Scroller/media/js/Scroller.js | 804 ++ .../extras/Scroller/media/js/Scroller.min.js | 38 + .../extras/Scroller/media/js/Scroller.min.js.gz | Bin 0 -> 2466 bytes .../extras/TableTools/media/as3/ZeroClipboard.as | 221 + .../TableTools/media/as3/ZeroClipboardPdf.as | 310 + .../extras/TableTools/media/as3/lib/AlivePDF.swc | Bin 0 -> 131230 bytes .../extras/TableTools/media/css/TableTools.css | 265 + .../extras/TableTools/media/css/TableTools_JUI.css | 183 + .../extras/TableTools/media/images/background.png | Bin 0 -> 944 bytes .../extras/TableTools/media/images/collection.png | Bin 0 -> 1166 bytes .../TableTools/media/images/collection_hover.png | Bin 0 -> 1194 bytes .../extras/TableTools/media/images/copy.png | Bin 0 -> 2184 bytes .../extras/TableTools/media/images/copy_hover.png | Bin 0 -> 2797 bytes .../extras/TableTools/media/images/csv.png | Bin 0 -> 1607 bytes .../extras/TableTools/media/images/csv_hover.png | Bin 0 -> 1854 bytes .../extras/TableTools/media/images/pdf.png | Bin 0 -> 4325 bytes .../extras/TableTools/media/images/pdf_hover.png | Bin 0 -> 2786 bytes .../extras/TableTools/media/images/print.png | Bin 0 -> 2123 bytes .../extras/TableTools/media/images/print_hover.png | Bin 0 -> 2230 bytes .../TableTools/media/images/psd/collection.psd | Bin 0 -> 25792 bytes .../TableTools/media/images/psd/copy document.psd | Bin 0 -> 104729 bytes .../TableTools/media/images/psd/file_types.psd | Bin 0 -> 1090645 bytes .../extras/TableTools/media/images/psd/printer.psd | Bin 0 -> 119952 bytes .../extras/TableTools/media/images/xls.png | Bin 0 -> 1641 bytes .../extras/TableTools/media/images/xls_hover.png | Bin 0 -> 2061 bytes .../extras/TableTools/media/js/TableTools.js | 2569 ++++ .../extras/TableTools/media/js/TableTools.min.js | 81 + .../TableTools/media/js/TableTools.min.js.gz | Bin 0 -> 8635 bytes .../extras/TableTools/media/js/ZeroClipboard.js | 367 + .../extras/TableTools/media/swf/copy_cvs_xls.swf | Bin 0 -> 2126 bytes .../TableTools/media/swf/copy_cvs_xls_pdf.swf | Bin 0 -> 58813 bytes library/js/datatables/license-bsd.txt | 10 + library/js/datatables/license-gpl2.txt | 339 + library/js/datatables/media/css/demo_page.css | 107 + library/js/datatables/media/css/demo_table.css | 575 + library/js/datatables/media/css/demo_table_jui.css | 522 + .../js/datatables/media/css/jquery.dataTables.css | 219 + .../media/css/jquery.dataTables_themeroller.css | 243 + .../js/datatables/media/images/Sorting icons.psd | Bin 0 -> 27490 bytes .../js/datatables/media/images/back_disabled.png | Bin 0 -> 1361 bytes .../js/datatables/media/images/back_enabled.png | Bin 0 -> 1379 bytes .../datatables/media/images/back_enabled_hover.png | Bin 0 -> 1375 bytes library/js/datatables/media/images/favicon.ico | Bin 0 -> 894 bytes .../datatables/media/images/forward_disabled.png | Bin 0 -> 1363 bytes .../js/datatables/media/images/forward_enabled.png | Bin 0 -> 1380 bytes .../media/images/forward_enabled_hover.png | Bin 0 -> 1379 bytes library/js/datatables/media/images/sort_asc.png | Bin 0 -> 1118 bytes .../datatables/media/images/sort_asc_disabled.png | Bin 0 -> 1050 bytes library/js/datatables/media/images/sort_both.png | Bin 0 -> 1136 bytes library/js/datatables/media/images/sort_desc.png | Bin 0 -> 1127 bytes .../datatables/media/images/sort_desc_disabled.png | Bin 0 -> 1045 bytes .../js/datatables/media/js/jquery.dataTables.js | 11612 +++++++++++++++++++ .../datatables/media/js/jquery.dataTables.min.js | 153 + library/js/datatables/media/js/jquery.js | 4 + library/js/datatables/package.json | 34 + 81 files changed, 25088 insertions(+) create mode 100644 library/js/datatables/Readme.txt create mode 100644 library/js/datatables/extras/AutoFill/media/css/AutoFill.css create mode 100644 library/js/datatables/extras/AutoFill/media/images/filler.png create mode 100755 library/js/datatables/extras/AutoFill/media/js/AutoFill.js create mode 100644 library/js/datatables/extras/AutoFill/media/js/AutoFill.min.js create mode 100644 library/js/datatables/extras/AutoFill/media/js/AutoFill.min.js.gz create mode 100644 library/js/datatables/extras/ColReorder/media/css/ColReorder.css create mode 100644 library/js/datatables/extras/ColReorder/media/images/insert.png create mode 100755 library/js/datatables/extras/ColReorder/media/js/ColReorder.js create mode 100644 library/js/datatables/extras/ColReorder/media/js/ColReorder.min.js create mode 100644 library/js/datatables/extras/ColReorder/media/js/ColReorder.min.js.gz create mode 100755 library/js/datatables/extras/ColVis/media/css/ColVis.css create mode 100755 library/js/datatables/extras/ColVis/media/css/ColVisAlt.css create mode 100644 library/js/datatables/extras/ColVis/media/images/button.png create mode 100755 library/js/datatables/extras/ColVis/media/js/ColVis.js create mode 100644 library/js/datatables/extras/ColVis/media/js/ColVis.min.js create mode 100644 library/js/datatables/extras/ColVis/media/js/ColVis.min.js.gz create mode 100644 library/js/datatables/extras/FixedColumns/media/js/FixedColumns.js create mode 100644 library/js/datatables/extras/FixedColumns/media/js/FixedColumns.min.js create mode 100644 library/js/datatables/extras/FixedColumns/media/js/FixedColumns.min.js.gz create mode 100644 library/js/datatables/extras/FixedHeader/js/FixedHeader.js create mode 100644 library/js/datatables/extras/FixedHeader/js/FixedHeader.min.js create mode 100644 library/js/datatables/extras/FixedHeader/js/FixedHeader.min.js.gz create mode 100644 library/js/datatables/extras/KeyTable/js/KeyTable.js create mode 100644 library/js/datatables/extras/KeyTable/js/KeyTable.min.js create mode 100644 library/js/datatables/extras/KeyTable/js/KeyTable.min.js.gz create mode 100644 library/js/datatables/extras/Scroller/media/js/Scroller.js create mode 100644 library/js/datatables/extras/Scroller/media/js/Scroller.min.js create mode 100644 library/js/datatables/extras/Scroller/media/js/Scroller.min.js.gz create mode 100755 library/js/datatables/extras/TableTools/media/as3/ZeroClipboard.as create mode 100755 library/js/datatables/extras/TableTools/media/as3/ZeroClipboardPdf.as create mode 100644 library/js/datatables/extras/TableTools/media/as3/lib/AlivePDF.swc create mode 100755 library/js/datatables/extras/TableTools/media/css/TableTools.css create mode 100755 library/js/datatables/extras/TableTools/media/css/TableTools_JUI.css create mode 100644 library/js/datatables/extras/TableTools/media/images/background.png create mode 100644 library/js/datatables/extras/TableTools/media/images/collection.png create mode 100644 library/js/datatables/extras/TableTools/media/images/collection_hover.png create mode 100755 library/js/datatables/extras/TableTools/media/images/copy.png create mode 100755 library/js/datatables/extras/TableTools/media/images/copy_hover.png create mode 100755 library/js/datatables/extras/TableTools/media/images/csv.png create mode 100755 library/js/datatables/extras/TableTools/media/images/csv_hover.png create mode 100644 library/js/datatables/extras/TableTools/media/images/pdf.png create mode 100644 library/js/datatables/extras/TableTools/media/images/pdf_hover.png create mode 100755 library/js/datatables/extras/TableTools/media/images/print.png create mode 100755 library/js/datatables/extras/TableTools/media/images/print_hover.png create mode 100644 library/js/datatables/extras/TableTools/media/images/psd/collection.psd create mode 100755 library/js/datatables/extras/TableTools/media/images/psd/copy document.psd create mode 100755 library/js/datatables/extras/TableTools/media/images/psd/file_types.psd create mode 100755 library/js/datatables/extras/TableTools/media/images/psd/printer.psd create mode 100755 library/js/datatables/extras/TableTools/media/images/xls.png create mode 100755 library/js/datatables/extras/TableTools/media/images/xls_hover.png create mode 100755 library/js/datatables/extras/TableTools/media/js/TableTools.js create mode 100644 library/js/datatables/extras/TableTools/media/js/TableTools.min.js create mode 100644 library/js/datatables/extras/TableTools/media/js/TableTools.min.js.gz create mode 100755 library/js/datatables/extras/TableTools/media/js/ZeroClipboard.js create mode 100644 library/js/datatables/extras/TableTools/media/swf/copy_cvs_xls.swf create mode 100644 library/js/datatables/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf create mode 100644 library/js/datatables/license-bsd.txt create mode 100644 library/js/datatables/license-gpl2.txt create mode 100644 library/js/datatables/media/css/demo_page.css create mode 100644 library/js/datatables/media/css/demo_table.css create mode 100644 library/js/datatables/media/css/demo_table_jui.css create mode 100644 library/js/datatables/media/css/jquery.dataTables.css create mode 100644 library/js/datatables/media/css/jquery.dataTables_themeroller.css create mode 100644 library/js/datatables/media/images/Sorting icons.psd create mode 100644 library/js/datatables/media/images/back_disabled.png create mode 100644 library/js/datatables/media/images/back_enabled.png create mode 100644 library/js/datatables/media/images/back_enabled_hover.png create mode 100644 library/js/datatables/media/images/favicon.ico create mode 100644 library/js/datatables/media/images/forward_disabled.png create mode 100644 library/js/datatables/media/images/forward_enabled.png create mode 100644 library/js/datatables/media/images/forward_enabled_hover.png create mode 100644 library/js/datatables/media/images/sort_asc.png create mode 100644 library/js/datatables/media/images/sort_asc_disabled.png create mode 100644 library/js/datatables/media/images/sort_both.png create mode 100644 library/js/datatables/media/images/sort_desc.png create mode 100644 library/js/datatables/media/images/sort_desc_disabled.png create mode 100644 library/js/datatables/media/js/jquery.dataTables.js create mode 100644 library/js/datatables/media/js/jquery.dataTables.min.js create mode 100644 library/js/datatables/media/js/jquery.js create mode 100644 library/js/datatables/package.json diff --git a/library/js/datatables/Readme.txt b/library/js/datatables/Readme.txt new file mode 100644 index 000000000..96a47cbde --- /dev/null +++ b/library/js/datatables/Readme.txt @@ -0,0 +1,11 @@ +This DataTables plugin (v1.9.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features. + +For detailed installation, usage and API instructions, please refer to the DataTables web-pages: http://www.datatables.net + +Questions, feature requests and bug reports (etc) can all be asked on the DataTables forums: http://www.datatables.net/forums/ + +The DataTables source can be found in the media/js/ directory of this archive. + +DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). You may select which of the two licenses you wish to use DataTables under. Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain. + +If you discover any bugs in DataTables, have any suggestions for improvements or even if you just like using it, please free to get in touch with me: www.datatables.net/contact \ No newline at end of file diff --git a/library/js/datatables/extras/AutoFill/media/css/AutoFill.css b/library/js/datatables/extras/AutoFill/media/css/AutoFill.css new file mode 100644 index 000000000..cab59b3a0 --- /dev/null +++ b/library/js/datatables/extras/AutoFill/media/css/AutoFill.css @@ -0,0 +1,24 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * AutoFill styles + */ + +div.AutoFill_filler { + display: none; + position: absolute; + height: 14px; + width: 14px; + background: url(../images/filler.png) no-repeat center center; + z-index: 1002; +} + +div.AutoFill_border { + display: none; + position: absolute; + background-color: #0063dc; + z-index: 1001; + + box-shadow: 0px 0px 5px #76b4ff; + -moz-box-shadow: 0px 0px 5px #76b4ff; + -webkit-box-shadow: 0px 0px 5px #76b4ff; +} + diff --git a/library/js/datatables/extras/AutoFill/media/images/filler.png b/library/js/datatables/extras/AutoFill/media/images/filler.png new file mode 100644 index 0000000000000000000000000000000000000000..f2af65d8c38a5b752894dffc224021da92b182c2 GIT binary patch literal 1040 zcwT)|&ubGw6yE-@w1Gk|f>o4ZdlH-7+0E~zF>SM58|l`N2F#&CH@lN$X?JJcoi^K^ zY86qasNltaz=H=7JPMYALVE}Z9u)DQAl^jq;Gqa{Hf^E^>0IW$$M=2n=FK;E^YfR6 zL#IOw!wlzU`&z!g&0T*OQnxQsx~(yFL{G-LhxKAK>d zKGrOjNJ*WObZl{2fZ=@0VS+W0@f}THMg){m)wI*>kC!_vFpV^OHKsz<$)cJ$yWygR zjrpR!v8<;IHgge7_!1Sc5Yd2dt=OLAr`eXSMB|{$v!Deb%W3wosgjxpS?nSZ<6u~a zaR}l9Cq$x&L}DC>P=GuXc|i;d2`M5<5Q3w{($id{A{Aui=q#G0*%~2^#PjufovTMU z>{fXpl}ZH~q8O%#u(xg#%@5n&SX)6xp6;3sF|iGTTr1;Ml4jZV6)dMCYkNmyq66c7 z&EW+O^8Wx;^?0adbgx32Dq{iJk+Lq*2zHAYue7I_uVI3{ z8g@W-AqG@UH|-#A;Z;@2*&fks9p&USODmjd8d7`)!bDPtO$$m~5M(7Oi%>}upD61Q^lRMG!fUYZl^VT2ytdysv%ZATZ+F~1hC Ue246bmEe!&X6EH*(@R@_01K^1Z~y=R literal 0 HcwPel00001 diff --git a/library/js/datatables/extras/AutoFill/media/js/AutoFill.js b/library/js/datatables/extras/AutoFill/media/js/AutoFill.js new file mode 100755 index 000000000..ad0a99988 --- /dev/null +++ b/library/js/datatables/extras/AutoFill/media/js/AutoFill.js @@ -0,0 +1,820 @@ +/* + * File: AutoFill.js + * Version: 1.1.2 + * CVS: $Id$ + * Description: AutoFill for DataTables + * Author: Allan Jardine (www.sprymedia.co.uk) + * Created: Mon 6 Sep 2010 16:54:41 BST + * Modified: $Date$ by $Author$ + * Language: Javascript + * License: GPL v2 or BSD 3 point + * Project: DataTables + * Contact: www.sprymedia.co.uk/contact + * + * Copyright 2010-2011 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 + * + */ + +/* Global scope for AutoFill */ +var AutoFill; + +(function($) { + +/** + * AutoFill provides Excel like auto fill features for a DataTable + * @class AutoFill + * @constructor + * @param {object} DataTables settings object + * @param {object} Configuration object for AutoFill + */ +AutoFill = function( oDT, oConfig ) +{ + /* Santiy check that we are a new instance */ + if ( !this.CLASS || this.CLASS != "AutoFill" ) + { + alert( "Warning: AutoFill must be initialised with the keyword 'new'" ); + return; + } + + if ( !$.fn.dataTableExt.fnVersionCheck('1.7.0') ) + { + alert( "Warning: AutoFill requires DataTables 1.7 or greater - www.datatables.net/download"); + return; + } + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public class variables + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * @namespace Settings object which contains customisable information for AutoFill instance + */ + this.s = { + /** + * @namespace Cached information about the little dragging icon (the filler) + */ + "filler": { + "height": 0, + "width": 0 + }, + + /** + * @namespace Cached information about the border display + */ + "border": { + "width": 2 + }, + + /** + * @namespace Store for live information for the current drag + */ + "drag": { + "startX": -1, + "startY": -1, + "startTd": null, + "endTd": null, + "dragging": false + }, + + /** + * @namespace Data cache for information that we need for scrolling the screen when we near + * the edges + */ + "screen": { + "interval": null, + "y": 0, + "height": 0, + "scrollTop": 0 + }, + + /** + * @namespace Data cache for the position of the DataTables scrolling element (when scrolling + * is enabled) + */ + "scroller": { + "top": 0, + "bottom": 0 + }, + + + /** + * @namespace Information stored for each column. An array of objects + */ + "columns": [] + }; + + + /** + * @namespace Common and useful DOM elements for the class instance + */ + this.dom = { + "table": null, + "filler": null, + "borderTop": null, + "borderRight": null, + "borderBottom": null, + "borderLeft": null, + "currentTarget": null + }; + + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public class methods + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Retreieve the settings object from an instance + * @method fnSettings + * @returns {object} AutoFill settings object + */ + this.fnSettings = function () { + return this.s; + }; + + + /* Constructor logic */ + this._fnInit( oDT, oConfig ); + return this; +}; + + + +AutoFill.prototype = { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private methods (they are of course public in JS, but recommended as private) + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Initialisation + * @method _fnInit + * @param {object} oDT DataTables settings object + * @param {object} oConfig Configuration object for AutoFill + * @returns void + */ + "_fnInit": function ( oDT, oConfig ) + { + var + that = this, + i, iLen; + + /* + * Settings + */ + this.s.dt = oDT.fnSettings(); + + this.dom.table = this.s.dt.nTable; + + /* Add and configure the columns */ + for ( i=0, iLen=this.s.dt.aoColumns.length ; itr>td', this.dom.table).live( 'mouseover mouseout', function (e) { + that._fnFillerDisplay.call( that, e ); + } ); + }, + + + "_fnColumnDefs": function ( aoColumnDefs ) + { + var + i, j, k, iLen, jLen, kLen, + aTargets; + + /* Loop over the column defs array - loop in reverse so first instace has priority */ + for ( i=aoColumnDefs.length-1 ; i>=0 ; i-- ) + { + /* Each column def can target multiple columns, as it is an array */ + aTargets = aoColumnDefs[i].aTargets; + for ( j=0, jLen=aTargets.length ; j= 0 ) + { + /* 0+ integer, left to right column counting. */ + this._fnColumnOptions( aTargets[j], aoColumnDefs[i] ); + } + else if ( typeof aTargets[j] == 'number' && aTargets[j] < 0 ) + { + /* Negative integer, right to left column counting */ + this._fnColumnOptions( this.s.dt.aoColumns.length+aTargets[j], aoColumnDefs[i] ); + } + else if ( typeof aTargets[j] == 'string' ) + { + /* Class name matching on TH element */ + for ( k=0, kLen=this.s.dt.aoColumns.length ; k that.s.scroller.bottom - 50 ) + { + $(that.s.dt.nTable.parentNode).animate( { + "scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() + 50 + }, 240, 'linear' ); + } + else if ( that.s.screen.y < that.s.scroller.top + 50 ) + { + $(that.s.dt.nTable.parentNode).animate( { + "scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() - 50 + }, 240, 'linear' ); + } + } + }, 250 ); + }, + + + /** + * Mouse move event handler for during a move. See if we want to update the display based on the + * new cursor position + * @method _fnFillerDragMove + * @param {Object} e Event object + * @returns void + */ + "_fnFillerDragMove": function (e) + { + if ( e.target && e.target.nodeName.toUpperCase() == "TD" && + e.target != this.s.drag.endTd ) + { + var coords = this._fnTargetCoords( e.target ); + + if ( coords.x != this.s.drag.startX ) + { + e.target = $('tbody>tr:eq('+coords.y+')>td:eq('+this.s.drag.startX+')', this.dom.table)[0]; + coords = this._fnTargetCoords( e.target ); + } + + if ( coords.x == this.s.drag.startX ) + { + var drag = this.s.drag; + drag.endTd = e.target; + + if ( coords.y >= this.s.drag.startY ) + { + this._fnUpdateBorder( drag.startTd, drag.endTd ); + } + else + { + this._fnUpdateBorder( drag.endTd, drag.startTd ); + } + this._fnFillerPosition( e.target ); + } + } + + /* Update the screen information so we can perform scrolling */ + this.s.screen.y = e.pageY; + this.s.screen.scrollTop = $(document).scrollTop(); + + if ( this.s.dt.oScroll.sY !== "" ) + { + this.s.scroller.scrollTop = $(this.s.dt.nTable.parentNode).scrollTop(); + this.s.scroller.top = $(this.s.dt.nTable.parentNode).offset().top; + this.s.scroller.bottom = this.s.scroller.top + $(this.s.dt.nTable.parentNode).height(); + } + }, + + + /** + * Mouse release handler - end the drag and take action to update the cells with the needed values + * @method _fnFillerFinish + * @param {Object} e Event object + * @returns void + */ + "_fnFillerFinish": function (e) + { + var that = this; + + $(document).unbind('mousemove.AutoFill'); + $(document).unbind('mouseup.AutoFill'); + + this.dom.borderTop.style.display = "none"; + this.dom.borderRight.style.display = "none"; + this.dom.borderBottom.style.display = "none"; + this.dom.borderLeft.style.display = "none"; + + this.s.drag.dragging = false; + + clearInterval( this.s.screen.interval ); + + var coordsStart = this._fnTargetCoords( this.s.drag.startTd ); + var coordsEnd = this._fnTargetCoords( this.s.drag.endTd ); + var aTds = []; + var bIncrement; + + if ( coordsStart.y <= coordsEnd.y ) + { + bIncrement = true; + for ( i=coordsStart.y ; i<=coordsEnd.y ; i++ ) + { + aTds.push( $('tbody>tr:eq('+i+')>td:eq('+coordsStart.x+')', this.dom.table)[0] ); + } + } + else + { + bIncrement = false; + for ( i=coordsStart.y ; i>=coordsEnd.y ; i-- ) + { + aTds.push( $('tbody>tr:eq('+i+')>td:eq('+coordsStart.x+')', this.dom.table)[0] ); + } + } + + + var iColumn = coordsStart.x; + var bLast = false; + var aoEdited = []; + var sStart = this.s.columns[iColumn].read.call( this, this.s.drag.startTd ); + var oPrepped = this._fnPrep( sStart ); + + for ( i=0, iLen=aTds.length ; i 0 ) + { + return $(jq).val(); + } + + jq = $('select', nTd); + if ( jq.length > 0 ) + { + return $(jq).val(); + } + + return nTd.innerHTML; + }, + + + /** + * Write informaiton to a cell, possibly using live DOM elements if suitable + * @method _fnWriteCell + * @param {Node} nTd Cell to write + * @param {String} sVal Value to write + * @param {Boolean} bLast Flag to show if this is that last update + * @returns void + */ + "_fnWriteCell": function ( nTd, sVal, bLast ) + { + var jq = $('input', nTd); + if ( jq.length > 0 ) + { + $(jq).val( sVal ); + return; + } + + jq = $('select', nTd); + if ( jq.length > 0 ) + { + $(jq).val( sVal ); + return; + } + + var pos = this.s.dt.oInstance.fnGetPosition( nTd ); + this.s.dt.oInstance.fnUpdate( sVal, pos[0], pos[2], bLast ); + }, + + + /** + * Display the drag handle on mouse over cell + * @method _fnFillerDisplay + * @param {Object} e Event object + * @returns void + */ + "_fnFillerDisplay": function (e) + { + /* Don't display automatically when dragging */ + if ( this.s.drag.dragging) + { + return; + } + + /* Check that we are allowed to AutoFill this column or not */ + var nTd = (e.target.nodeName.toLowerCase() == 'td') ? e.target : $(e.target).parents('td')[0]; + var iX = this._fnTargetCoords(nTd).x; + if ( !this.s.columns[iX].enable ) + { + return; + } + + var filler = this.dom.filler; + if (e.type == 'mouseover') + { + this.dom.currentTarget = nTd; + this._fnFillerPosition( nTd ); + + filler.style.display = "block"; + } + else if ( !e.relatedTarget || !e.relatedTarget.className.match(/AutoFill/) ) + { + filler.style.display = "none"; + } + }, + + + /** + * Position the filler icon over a cell + * @method _fnFillerPosition + * @param {Node} nTd Cell to position filler icon over + * @returns void + */ + "_fnFillerPosition": function ( nTd ) + { + var offset = $(nTd).offset(); + var filler = this.dom.filler; + filler.style.top = (offset.top - (this.s.filler.height / 2)-1 + $(nTd).outerHeight())+"px"; + filler.style.left = (offset.left - (this.s.filler.width / 2)-1 + $(nTd).outerWidth())+"px"; + } +}; + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Constants + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Name of this class + * @constant CLASS + * @type String + * @default AutoFill + */ +AutoFill.prototype.CLASS = "AutoFill"; + + +/** + * AutoFill version + * @constant VERSION + * @type String + * @default 1.1.2 + */ +AutoFill.VERSION = "1.1.2"; +AutoFill.prototype.VERSION = AutoFill.VERSION; + + +})(jQuery); \ No newline at end of file diff --git a/library/js/datatables/extras/AutoFill/media/js/AutoFill.min.js b/library/js/datatables/extras/AutoFill/media/js/AutoFill.min.js new file mode 100644 index 000000000..c91c20ff1 --- /dev/null +++ b/library/js/datatables/extras/AutoFill/media/js/AutoFill.min.js @@ -0,0 +1,33 @@ +/* + * File: AutoFill.min.js + * Version: 1.1.2 + * Author: Allan Jardine (www.sprymedia.co.uk) + * + * Copyright 2010-2011 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD (3 point) style license, as supplied with this software. + * + * 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 AutoFill; +(function(e){AutoFill=function(b,a){if(!this.CLASS||"AutoFill"!=this.CLASS)alert("Warning: AutoFill must be initialised with the keyword 'new'");else{if(e.fn.dataTableExt.fnVersionCheck("1.7.0"))return this.s={filler:{height:0,width:0},border:{width:2},drag:{startX:-1,startY:-1,startTd:null,endTd:null,dragging:!1},screen:{interval:null,y:0,height:0,scrollTop:0},scroller:{top:0,bottom:0},columns:[]},this.dom={table:null,filler:null,borderTop:null,borderRight:null,borderBottom:null,borderLeft:null,currentTarget:null}, +this.fnSettings=function(){return this.s},this._fnInit(b,a),this;alert("Warning: AutoFill requires DataTables 1.7 or greater - www.datatables.net/download")}};AutoFill.prototype={_fnInit:function(b,a){var c=this,d,f;this.s.dt=b.fnSettings();this.dom.table=this.s.dt.nTable;for(d=0,f=this.s.dt.aoColumns.length;dtr>td",this.dom.table).live("mouseover mouseout",function(a){c._fnFillerDisplay.call(c,a)})},_fnColumnDefs:function(b){var a,c,d,e,h,g;for(a= +b.length-1;0<=a;a--){g=b[a].aTargets;for(c=0,e=g.length;cg[c])this._fnColumnOptions(this.s.dt.aoColumns.length+g[c],b[a]);else if("string"==typeof g[c])for(d=0,h=this.s.dt.aoColumns.length;da.s.screen.height-a.s.screen.y+b?e("html, body").animate({scrollTop:b+50},240,"linear"):50>a.s.screen.y- +b&&e("html, body").animate({scrollTop:b-50},240,"linear");""!==a.s.dt.oScroll.sY&&(a.s.screen.y>a.s.scroller.bottom-50?e(a.s.dt.nTable.parentNode).animate({scrollTop:e(a.s.dt.nTable.parentNode).scrollTop()+50},240,"linear"):a.s.screen.ytr:eq("+a.y+")>td:eq("+this.s.drag.startX+")",this.dom.table)[0],a=this._fnTargetCoords(b.target);if(a.x==this.s.drag.startX){var c=this.s.drag;c.endTd=b.target;a.y>=this.s.drag.startY?this._fnUpdateBorder(c.startTd,c.endTd):this._fnUpdateBorder(c.endTd,c.startTd);this._fnFillerPosition(b.target)}}this.s.screen.y=b.pageY;this.s.screen.scrollTop=e(document).scrollTop();if(""!==this.s.dt.oScroll.sY)this.s.scroller.scrollTop=e(this.s.dt.nTable.parentNode).scrollTop(), +this.s.scroller.top=e(this.s.dt.nTable.parentNode).offset().top,this.s.scroller.bottom=this.s.scroller.top+e(this.s.dt.nTable.parentNode).height()},_fnFillerFinish:function(){e(document).unbind("mousemove.AutoFill");e(document).unbind("mouseup.AutoFill");this.dom.borderTop.style.display="none";this.dom.borderRight.style.display="none";this.dom.borderBottom.style.display="none";this.dom.borderLeft.style.display="none";this.s.drag.dragging=!1;clearInterval(this.s.screen.interval);var b=this._fnTargetCoords(this.s.drag.startTd), +a=this._fnTargetCoords(this.s.drag.endTd),c=[],d;if(b.y<=a.y){d=!0;for(i=b.y;i<=a.y;i++)c.push(e("tbody>tr:eq("+i+")>td:eq("+b.x+")",this.dom.table)[0])}else{d=!1;for(i=b.y;i>=a.y;i--)c.push(e("tbody>tr:eq("+i+")>td:eq("+b.x+")",this.dom.table)[0])}var b=b.x,a=!1,f=[],h=this._fnPrep(this.s.columns[b].read.call(this,this.s.drag.startTd));for(i=0,iLen=c.length;i4k>1}U;TVPv>8qN%d!#9uP z9=vTBZ;kUHe#*=vx3`d!9*zUAj@JFXQ9UC+Z4Jncu2~TAMW8Iw4OGGwIL9JJ*!-~w2gP9|Z%nK1)Zphy~4Mr^&9I(Jx*W=Y^q zGng7g(t}Yv;qX8+BgjA z`@oGyKA*)2Gk%Hq>=zR`JWRQ;$ZbEe8O`W`x*@L!bCfUEbtqzt?x5d+d zb)#t*VjeO5C}s@B>h?NIoO+O~QFj432YF3HB{Bz-g>4Xt!*CE!gnjiQJjlcV_>*Pv zSbXu~a5|3C?%n+o%XP4LOct3~xl)=hNg`McdVUpI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kkg-JO*F3#raPK8#;*Td|N+los;`-qwEKU?1i^=%x9}}SoT>t<8 literal 0 HcwPel00001 diff --git a/library/js/datatables/extras/ColReorder/media/js/ColReorder.js b/library/js/datatables/extras/ColReorder/media/js/ColReorder.js new file mode 100755 index 000000000..7c7b728a2 --- /dev/null +++ b/library/js/datatables/extras/ColReorder/media/js/ColReorder.js @@ -0,0 +1,957 @@ +/* + * File: ColReorder.js + * Version: 1.0.5 + * CVS: $Id$ + * Description: Controls for column visiblity in DataTables + * Author: Allan Jardine (www.sprymedia.co.uk) + * Created: Wed Sep 15 18:23:29 BST 2010 + * Modified: $Date$ by $Author$ + * Language: Javascript + * License: GPL v2 or BSD 3 point style + * Project: DataTables + * Contact: www.sprymedia.co.uk/contact + * + * Copyright 2010-2011 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 + * + */ + + +(function($, window, document) { + + +/** + * Switch the key value pairing of an index array to be value key (i.e. the old value is now the + * key). For example consider [ 2, 0, 1 ] this would be returned as [ 1, 2, 0 ]. + * @method fnInvertKeyValues + * @param array aIn Array to switch around + * @returns array + */ +function fnInvertKeyValues( aIn ) +{ + var aRet=[]; + for ( var i=0, iLen=aIn.length ; i= iCols ) + { + this.oApi._fnLog( oSettings, 1, "ColReorder 'from' index is out of bounds: "+iFrom ); + return; + } + + if ( iTo < 0 || iTo >= iCols ) + { + this.oApi._fnLog( oSettings, 1, "ColReorder 'to' index is out of bounds: "+iTo ); + return; + } + + /* + * Calculate the new column array index, so we have a mapping between the old and new + */ + var aiMapping = []; + for ( i=0, iLen=iCols ; i this.s.fixed-1 ) + { + this._fnMouseListener( i, this.s.dt.aoColumns[i].nTh ); + } + + /* Mark the original column order for later reference */ + this.s.dt.aoColumns[i]._ColReorder_iOrigCol = i; + } + + /* State saving */ + this.s.dt.oApi._fnCallbackReg( this.s.dt, 'aoStateSaveParams', function (oS, oData) { + that._fnStateSave.call( that, oData ); + }, "ColReorder_State" ); + + /* An initial column order has been specified */ + var aiOrder = null; + if ( typeof this.s.init.aiOrder != 'undefined' ) + { + aiOrder = this.s.init.aiOrder.slice(); + } + + /* State loading, overrides the column order given */ + if ( this.s.dt.oLoadedState && typeof this.s.dt.oLoadedState.ColReorder != 'undefined' && + this.s.dt.oLoadedState.ColReorder.length == this.s.dt.aoColumns.length ) + { + aiOrder = this.s.dt.oLoadedState.ColReorder; + } + + /* If we have an order to apply - do so */ + if ( aiOrder ) + { + /* We might be called during or after the DataTables initialisation. If before, then we need + * to wait until the draw is done, if after, then do what we need to do right away + */ + if ( !that.s.dt._bInitComplete ) + { + var bDone = false; + this.s.dt.aoDrawCallback.push( { + "fn": function () { + if ( !that.s.dt._bInitComplete && !bDone ) + { + bDone = true; + var resort = fnInvertKeyValues( aiOrder ); + that._fnOrderColumns.call( that, resort ); + } + }, + "sName": "ColReorder_Pre" + } ); + } + else + { + var resort = fnInvertKeyValues( aiOrder ); + that._fnOrderColumns.call( that, resort ); + } + } + }, + + + /** + * Set the column order from an array + * @method _fnOrderColumns + * @param array a An array of integers which dictate the column order that should be applied + * @returns void + * @private + */ + "_fnOrderColumns": function ( a ) + { + if ( a.length != this.s.dt.aoColumns.length ) + { + this.s.dt.oInstance.oApi._fnLog( oDTSettings, 1, "ColReorder - array reorder does not "+ + "match known number of columns. Skipping." ); + return; + } + + for ( var i=0, iLen=a.length ; i 0 ) + { + this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('caption')[0] ); + } + while ( this.dom.drag.getElementsByTagName('tbody').length > 0 ) + { + this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('tbody')[0] ); + } + while ( this.dom.drag.getElementsByTagName('tfoot').length > 0 ) + { + this.dom.drag.removeChild( this.dom.drag.getElementsByTagName('tfoot')[0] ); + } + + $('thead tr:eq(0)', this.dom.drag).each( function () { + $('th:not(:eq('+that.s.mouse.targetIndex+'))', this).remove(); + } ); + $('tr', this.dom.drag).height( $('tr:eq(0)', that.s.dt.nTHead).height() ); + + $('thead tr:gt(0)', this.dom.drag).remove(); + + $('thead th:eq(0)', this.dom.drag).each( function (i) { + this.style.width = $('th:eq('+that.s.mouse.targetIndex+')', that.s.dt.nTHead).width()+"px"; + } ); + + this.dom.drag.style.position = "absolute"; + this.dom.drag.style.top = "0px"; + this.dom.drag.style.left = "0px"; + this.dom.drag.style.width = $('th:eq('+that.s.mouse.targetIndex+')', that.s.dt.nTHead).outerWidth()+"px"; + + + this.dom.pointer = document.createElement( 'div' ); + this.dom.pointer.className = "DTCR_pointer"; + this.dom.pointer.style.position = "absolute"; + + if ( this.s.dt.oScroll.sX === "" && this.s.dt.oScroll.sY === "" ) + { + this.dom.pointer.style.top = $(this.s.dt.nTable).offset().top+"px"; + this.dom.pointer.style.height = $(this.s.dt.nTable).height()+"px"; + } + else + { + this.dom.pointer.style.top = $('div.dataTables_scroll', this.s.dt.nTableWrapper).offset().top+"px"; + this.dom.pointer.style.height = $('div.dataTables_scroll', this.s.dt.nTableWrapper).height()+"px"; + } + + document.body.appendChild( this.dom.pointer ); + document.body.appendChild( this.dom.drag ); + } +}; + + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Static parameters + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Array of all ColReorder instances for later reference + * @property ColReorder.aoInstances + * @type array + * @default [] + * @static + */ +ColReorder.aoInstances = []; + + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Static functions + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Reset the column ordering for a DataTables instance + * @method ColReorder.fnReset + * @param object oTable DataTables instance to consider + * @returns void + * @static + */ +ColReorder.fnReset = function ( oTable ) +{ + for ( var i=0, iLen=ColReorder.aoInstances.length ; ic||c>=k)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+c);else if(0>d|| +d>=k)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+d);else{g=[];for(b=0,e=k;bthis.s.fixed-1&&this._fnMouseListener(c, +this.s.dt.aoColumns[c].nTh),this.s.dt.aoColumns[c]._ColReorder_iOrigCol=c;this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(b,c){a._fnStateSave.call(a,c)},"ColReorder_State");var b=null;"undefined"!=typeof this.s.init.aiOrder&&(b=this.s.init.aiOrder.slice());if(this.s.dt.oLoadedState&&"undefined"!=typeof this.s.dt.oLoadedState.ColReorder&&this.s.dt.oLoadedState.ColReorder.length==this.s.dt.aoColumns.length)b=this.s.dt.oLoadedState.ColReorder;if(b)if(a.s.dt._bInitComplete)c=m(b), +a._fnOrderColumns.call(a,c);else{var e=!1;this.s.dt.aoDrawCallback.push({fn:function(){if(!a.s.dt._bInitComplete&&!e){e=!0;var c=m(b);a._fnOrderColumns.call(a,c)}},sName:"ColReorder_Pre"})}},_fnOrderColumns:function(a){if(a.length!=this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(oDTSettings,1,"ColReorder - array reorder does not match known number of columns. Skipping.");else{for(var c=0,d=a.length;cMath.pow(Math.pow(a.pageX-this.s.mouse.startX,2)+Math.pow(a.pageY-this.s.mouse.startY,2),0.5))return;this._fnCreateDragNode()}this.dom.drag.style.left=a.pageX-this.s.mouse.offsetX+"px";this.dom.drag.style.top=a.pageY-this.s.mouse.offsetY+"px";for(var c=!1,d=1,b=this.s.aoTargets.length;dUYI6X+8ryE$IQHFNq3FRCC#>pp z(TBC77HQf{vuK-a>`og5K|o2gtwa_z5?v>o`rr2)QWwgW-E?-a156{4=f-nClwbVT zvwpKq;)D;a^1ow|TyT*`Ja^}D>fROz@dwX~Sfm>0z#X`+aP?>*XCf~#kCKF?*1uRD z#VNO(<#Op3S^hBRQOw*>xQjc2IQaju$R6@|I+NDR!NK4;{BzJorxr^ROMw(t&I_J@ z=a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w;j;guC})nyErsf|{*nEtNNEd69GjA7U)*u8C% z)XeJMwYs?*(2bok>u#dxI&wcWOKz$z&l(FURZ=O2gO#4N&_$*`Uj5zrL33+zt8PuE zb>3goLch=V_i1o7ZGxlDZ(RZ@NHw#y1le!xETAX<8b@;G5R{OEgo7rVst&A!$-1Hx z9GuOGTah*w-}w_F?UShbB#1P!+N86{oKoruRk$4 zb2G7Y>W3;OIs%QpB>QV{mmP4I07nPzD?)S_1-$c4@ty>1jKybxQt0Ca!1!lo}Izr=WpZW?iDr#Qbt zM~bG#e92lfE5=533DX&6W&E^Y+7V>l9<@Utb^{STxVa*#zY4Sg=q`v-d1Y5u;i&0` zt^*mXyV}3*RM@FtLjMn4A~n_4o`D-O#-h$i>Xw53a)U`XGDP_r-6>GL+ILRo)H1fzLq%d!KbRNBcG@DUnhJt&%~xzDaRiHHKzv+wV-h-}?P+TbFN~ zEeuelJG*TFFskq-0qu*OG%7b$_++?Cgx*A{toc}8+!RW7o37LSn&VgY{I7`k%PiU_ z@XBg!e&ye&);obzoVC7)n0N4aWnk=-SM0voY`1TTwp`_}T`+V*;jKWsdcq8?J{D~O zF2#Y&)%i(4f2;A$k2ogWAMY@t1^;ef>dbO$zhvkA$>2?YHjuRfnVPEx$++`PN;jqhdMAED~6XwA{z zbS?TRUmBmk%x`(L>pEKP$6#fHZpYg2aYcsV&fj@3Dfv9ZpEXHgd~LJj5{6gTI-RB> zho;Udcqr1yu5NfN^@)mxrKX1Vg-wh4#qbsopts{YU(Wwr#Gq;GT^+xcvJC#zX{wSh z-p1l@&(KCvLAWWGFYtyc5e!6H5$E>b3!XpFB{cJ5Nh1+1FkeIe@n6~t_CgOQ000Y} BR$Bl7 literal 0 HcwPel00001 diff --git a/library/js/datatables/extras/ColVis/media/css/ColVis.css b/library/js/datatables/extras/ColVis/media/css/ColVis.css new file mode 100755 index 000000000..a3bf8e209 --- /dev/null +++ b/library/js/datatables/extras/ColVis/media/css/ColVis.css @@ -0,0 +1,76 @@ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * ColVis styles + */ +.ColVis { + float: right; + margin-bottom: 1em; +} + +.ColVis_Button { + position: relative; + float: left; + margin-right: 3px; + padding: 3px 5px; + height: 30px; + background-color: #fff; + border: 1px solid #d0d0d0; + cursor: pointer; + *cursor: hand; +} + +button.ColVis_Button::-moz-focus-inner { + border: none !important; + padding: 0; +} + +.ColVis_text_hover { + border: 1px solid #999; + background-color: #f0f0f0; +} + +div.ColVis_collectionBackground { + background-color: black; + z-index: 1100; +} + +div.ColVis_collection { + position: relative; + width: 150px; + background-color: #f3f3f3; + padding: 3px; + border: 1px solid #ccc; + z-index: 1102; +} + +div.ColVis_collection button.ColVis_Button { + background-color: white; + width: 100%; + float: none; + margin-bottom: 2px; +} + +div.ColVis_catcher { + position: absolute; + z-index: 1101; +} + +.disabled { + color: #999; +} + + + +button.ColVis_Button { + text-align: left; +} + +div.ColVis_collection button.ColVis_Button:hover { + border: 1px solid #999; + background-color: #f0f0f0; +} + +span.ColVis_radio { + display: inline-block; + width: 20px; +} diff --git a/library/js/datatables/extras/ColVis/media/css/ColVisAlt.css b/library/js/datatables/extras/ColVis/media/css/ColVisAlt.css new file mode 100755 index 000000000..93f35b61d --- /dev/null +++ b/library/js/datatables/extras/ColVis/media/css/ColVisAlt.css @@ -0,0 +1,104 @@ +/* + * An alternative styling for ColVis + * Note you will likely have to change the path for the background image used by jQuery UI theming: + * ../../../../examples/examples_support/themes/smoothness + */ + +.ColVis { + position: absolute; + right: 0; + top: 0; + width: 15px; + height: 30px; +} + +.ColVis_MasterButton { + height: 100%; + width: 100%; + border-left-width: 0; + cursor: pointer; + *cursor: hand; + background: url('../images/button.png') no-repeat top left; +} + +button.ColVis_Button::-moz-focus-inner { + border: none !important; + padding: 0; +} + +.ColVis_text_hover { + border: 1px solid #999; + background-color: #f0f0f0; +} + +div.ColVis_collectionBackground { + background-color: black; + z-index: 1100; +} + +div.ColVis_collection { + position: relative; + width: 150px; + background-color: #f9f9f9; + padding: 3px; + border: 1px solid #ccc; + z-index: 1102; +} + +div.ColVis_collection button.ColVis_Button { + height: 30px; + width: 100%; + margin-right: 3px; + margin-bottom: 2px; + padding: 3px 5px; + cursor: pointer; + *cursor: hand; + text-align: left; +} + +div.ColVis_collection button.ColVis_Button:hover { + border: 1px solid #999; + background-color: #f0f0f0; +} + +div.ColVis_catcher { + position: absolute; + z-index: 1101; +} + +span.ColVis_radio { + display: inline-block; + width: 20px; +} + +button.ColVis_Restore { + margin-top: 15px; +} + +button.ColVis_Restore span { + display: inline-block; + padding-left: 10px; + text-align: left; +} + +.disabled { + color: #999; +} + + + +/* + * Styles needed for DataTables scrolling + */ +div.dataTables_scrollHead { + position: relative; + overflow: hidden; +} + +div.dataTables_scrollBody { + overflow-y: scroll; +} + +div.dataTables_scrollFoot { + overflow: hidden; +} diff --git a/library/js/datatables/extras/ColVis/media/images/button.png b/library/js/datatables/extras/ColVis/media/images/button.png new file mode 100644 index 0000000000000000000000000000000000000000..38f032004fc6ccd992278581b9e5a1e6b367acd5 GIT binary patch literal 1161 zcwXxa@N?(olHy`uVBq!ia0vp^{6H+p!N$PAI5W;A3dAXKjVKAuPb(=;EJ|f?Ovz75 zRq)JBOiv9;O-!jQJeg|4z`(4O84^(v;p=0SoS&ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8nUy@&(kzb(T9BiuKo0y!L2jYX(`}$gW z<`tJD<|U_ky4WfKMf5T=Q>+|a4IB+jU7TGF49yG;UECZ^T@2ma3|)+!ogCdvoQ+_5 zUGkGlb5rw5V0u#!dR=hp1tkTD?$n~pveXo}qWoM1u$Qeeal6G4w_6~3Q*gV*38!9t zpkwsWA{r(HOg$hbJlO&{@Pwb52Tbinz+}DkTah0yOZ@e8aSW-rmGtNTe|u($0}?(w z0S8!wSveHkc1URyG#Exa3}RqxS=h$tdq75~L5D-YK_Y5~#0CcTl+Oks4J;4Z42+D7 z1h%m%G#JEo@h#wz*|3vswf2UcT;e;r*D%~wtaMnz_=(NYory&tj@9Rh6`%685AAk0 z%l;iy|0y~DiS?5cZqxrT9y#N1hoRiasEw)cR1?3#0SKGZ_a_0TP>$@O+!L0pEAN3W&*pl=W=5b9`S9;%k$}&pDpTWSZb^X<2LK8uSgQu&X J%Q~loCIE8ud)WX0 literal 0 HcwPel00001 diff --git a/library/js/datatables/extras/ColVis/media/js/ColVis.js b/library/js/datatables/extras/ColVis/media/js/ColVis.js new file mode 100755 index 000000000..19d91d39b --- /dev/null +++ b/library/js/datatables/extras/ColVis/media/js/ColVis.js @@ -0,0 +1,995 @@ +/* + * File: ColVis.js + * Version: 1.0.7 + * CVS: $Id$ + * Description: Controls for column visiblity in DataTables + * Author: Allan Jardine (www.sprymedia.co.uk) + * Created: Wed Sep 15 18:23:29 BST 2010 + * Modified: $Date$ by $Author$ + * Language: Javascript + * License: GPL v2 or BSD 3 point style + * Project: Just a little bit of fun :-) + * Contact: www.sprymedia.co.uk/contact + * + * Copyright 2010-2011 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 + */ + +(function($) { + +/** + * ColVis provides column visiblity control for DataTables + * @class ColVis + * @constructor + * @param {object} DataTables settings object + */ +ColVis = function( oDTSettings, oInit ) +{ + /* Santiy check that we are a new instance */ + if ( !this.CLASS || this.CLASS != "ColVis" ) + { + alert( "Warning: ColVis must be initialised with the keyword 'new'" ); + } + + if ( typeof oInit == 'undefined' ) + { + oInit = {}; + } + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public class variables + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * @namespace Settings object which contains customisable information for ColVis instance + */ + this.s = { + /** + * DataTables settings object + * @property dt + * @type Object + * @default null + */ + "dt": null, + + /** + * Customisation object + * @property oInit + * @type Object + * @default passed in + */ + "oInit": oInit, + + /** + * Callback function to tell the user when the state has changed + * @property fnStateChange + * @type function + * @default null + */ + "fnStateChange": null, + + /** + * Mode of activation. Can be 'click' or 'mouseover' + * @property activate + * @type String + * @default click + */ + "activate": "click", + + /** + * Position of the collection menu when shown - align "left" or "right" + * @property sAlign + * @type String + * @default right + */ + "sAlign": "left", + + /** + * Text used for the button + * @property buttonText + * @type String + * @default Show / hide columns + */ + "buttonText": "Show / hide columns", + + /** + * Flag to say if the collection is hidden + * @property hidden + * @type boolean + * @default true + */ + "hidden": true, + + /** + * List of columns (integers) which should be excluded from the list + * @property aiExclude + * @type Array + * @default [] + */ + "aiExclude": [], + + /** + * Store the original viisbility settings so they could be restored + * @property abOriginal + * @type Array + * @default [] + */ + "abOriginal": [], + + /** + * Show Show-All button + * @property bShowAll + * @type Array + * @default [] + */ + "bShowAll": false, + + /** + * Show All button text + * @property sShowAll + * @type String + * @default Restore original + */ + "sShowAll": "Show All", + + /** + * Show restore button + * @property bRestore + * @type Array + * @default [] + */ + "bRestore": false, + + /** + * Restore button text + * @property sRestore + * @type String + * @default Restore original + */ + "sRestore": "Restore original", + + /** + * Overlay animation duration in mS + * @property iOverlayFade + * @type Integer + * @default 500 + */ + "iOverlayFade": 500, + + /** + * Label callback for column names. Takes three parameters: 1. the column index, 2. the column + * title detected by DataTables and 3. the TH node for the column + * @property fnLabel + * @type Function + * @default null + */ + "fnLabel": null, + + /** + * Indicate if ColVis should automatically calculate the size of buttons or not. The default + * is for it to do so. Set to "css" to disable the automatic sizing + * @property sSize + * @type String + * @default auto + */ + "sSize": "auto", + + /** + * Indicate if the column list should be positioned by Javascript, visually below the button + * or allow CSS to do the positioning + * @property bCssPosition + * @type boolean + * @default false + */ + "bCssPosition": false + }; + + + /** + * @namespace Common and useful DOM elements for the class instance + */ + this.dom = { + /** + * Wrapper for the button - given back to DataTables as the node to insert + * @property wrapper + * @type Node + * @default null + */ + "wrapper": null, + + /** + * Activation button + * @property button + * @type Node + * @default null + */ + "button": null, + + /** + * Collection list node + * @property collection + * @type Node + * @default null + */ + "collection": null, + + /** + * Background node used for shading the display and event capturing + * @property background + * @type Node + * @default null + */ + "background": null, + + /** + * Element to position over the activation button to catch mouse events when using mouseover + * @property catcher + * @type Node + * @default null + */ + "catcher": null, + + /** + * List of button elements + * @property buttons + * @type Array + * @default [] + */ + "buttons": [], + + /** + * Restore button + * @property restore + * @type Node + * @default null + */ + "restore": null + }; + + /* Store global reference */ + ColVis.aInstances.push( this ); + + /* Constructor logic */ + this.s.dt = oDTSettings; + this._fnConstruct(); + return this; +}; + + + +ColVis.prototype = { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public methods + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Rebuild the list of buttons for this instance (i.e. if there is a column header update) + * @method fnRebuild + * @returns void + */ + "fnRebuild": function () + { + /* Remove the old buttons */ + for ( var i=this.dom.buttons.length-1 ; i>=0 ; i-- ) + { + if ( this.dom.buttons[i] !== null ) + { + this.dom.collection.removeChild( this.dom.buttons[i] ); + } + } + this.dom.buttons.splice( 0, this.dom.buttons.length ); + + if ( this.dom.restore ) + { + this.dom.restore.parentNode( this.dom.restore ); + } + + /* Re-add them (this is not the optimal way of doing this, it is fast and effective) */ + this._fnAddButtons(); + + /* Update the checkboxes */ + this._fnDrawCallback(); + }, + + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private methods (they are of course public in JS, but recommended as private) + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Constructor logic + * @method _fnConstruct + * @returns void + * @private + */ + "_fnConstruct": function () + { + this._fnApplyCustomisation(); + + var that = this; + this.dom.wrapper = document.createElement('div'); + this.dom.wrapper.className = "ColVis TableTools"; + + this.dom.button = this._fnDomBaseButton( this.s.buttonText ); + this.dom.button.className += " ColVis_MasterButton"; + this.dom.wrapper.appendChild( this.dom.button ); + + this.dom.catcher = this._fnDomCatcher(); + this.dom.collection = this._fnDomCollection(); + this.dom.background = this._fnDomBackground(); + + this._fnAddButtons(); + + /* Store the original visbility information */ + for ( var i=0, iLen=this.s.dt.aoColumns.length ; i'+this.s.sRestore+'' ); + + $(nButton).click( function (e) { + for ( var i=0, iLen=that.s.abOriginal.length ; i'+this.s.sShowAll+'' ); + + $(nButton).click( function (e) { + for ( var i=0, iLen=that.s.abOriginal.length ; i'+ + ''+sTitle+'' ); + + $(nButton).click( function (e) { + var showHide = !$('input', this).is(":checked"); + if ( e.target.nodeName.toLowerCase() == "input" ) + { + showHide = $('input', this).is(":checked"); + } + + /* Need to consider the case where the initialiser created more than one table - change the + * API index that DataTables is using + */ + var oldIndex = $.fn.dataTableExt.iApiIndex; + $.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that); + + // Optimisation for server-side processing when scrolling - don't do a full redraw + if ( dt.oFeatures.bServerSide && (dt.oScroll.sX !== "" || dt.oScroll.sY !== "" ) ) + { + that.s.dt.oInstance.fnSetColumnVis( i, showHide, false ); + that.s.dt.oInstance.oApi._fnScrollDraw( that.s.dt ); + that._fnDrawCallback(); + } + else + { + that.s.dt.oInstance.fnSetColumnVis( i, showHide ); + } + + $.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */ + + if ( that.s.fnStateChange !== null ) + { + that.s.fnStateChange.call( that, i, showHide ); + } + } ); + + return nButton; + }, + + + /** + * Get the position in the DataTables instance array of the table for this instance of ColVis + * @method _fnDataTablesApiIndex + * @returns {int} Index + * @private + */ + "_fnDataTablesApiIndex": function () + { + for ( var i=0, iLen=this.s.dt.oInstance.length ; i