diff --git a/COPYRIGHT b/COPYRIGHT index cf0dd033af4..4aee8e37939 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -24,7 +24,7 @@ JS libraries: jQuery 1.7.1 GPL and MIT Licence Yes JS library jQuery UI 1.8.17 GPL and MIT Licence Yes JS library plugin UI jQuery Colorpicker 1.1 MIT Licence Yes JS library for color picker for a defined list of colors -jQuery DataTable 1.8.1 BSD Yes JS library for tables output +jQuery DataTables 1.9.1 BSD Yes JS library for tables output jQuery Flot 0.7 MIT Licence Yes JS library to build graph jQuery FileUpload 5.0.3 GPL and MIT Licence Yes JS library to upload files jQuery JCrop 0.9.8 GPL and MIT Licence Yes JS library plugin Crop (to crop images) diff --git a/htdocs/includes/jquery/plugins/datatables/Readme.txt b/htdocs/includes/jquery/plugins/datatables/Readme.txt index b56ab6edb0a..96a47cbde67 100644 --- a/htdocs/includes/jquery/plugins/datatables/Readme.txt +++ b/htdocs/includes/jquery/plugins/datatables/Readme.txt @@ -1,4 +1,4 @@ -This DataTables plugin (v1.8.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features. +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 @@ -6,6 +6,6 @@ Questions, feature requests and bug reports (etc) can all be asked on the DataTa 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). 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. +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/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables.css b/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables.css index 81e7e362d50..83df98ea711 100644 --- a/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables.css +++ b/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables.css @@ -1,41 +1,179 @@ + /* - * File: demo_table.css - * Description: CSS descriptions for DataTables demo pages - * Author: Allan Jardine - * Created: Tue May 12 06:47:22 BST 2009 - * Language: CSS - * Project: DataTables - * - * Copyright 2009 Allan Jardine. All Rights Reserved. - * - * *************************************************************************** - * DESCRIPTION - * - * The styles given here are suitable for the demos that are used with the standard DataTables - * distribution (see www.datatables.net). You will most likely wish to modify these styles to - * meet the layout requirements of your site. - * - * Common issues: - * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is - * no conflict between the two pagination types. If you want to use full_numbers pagination - * ensure that you either have "example_alt_pagination" as a body class name, or better yet, - * modify that selector. - * Note that the path used for Images is relative. All images are by default located in - * ../images/ - relative to this CSS file. + * Table */ - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * DataTables features - */ - -.dataTables_wrapper { - position: relative; - min-height: 302px; +table.dataTable { + margin: 0 auto; clear: both; - _height: 302px; - zoom: 1; /* Feeling sorry for IE */ + width: 100%; } +table.dataTable thead th { + padding: 3px 18px 3px 10px; + border-bottom: 1px solid black; + font-weight: bold; + cursor: pointer; + *cursor: hand; +} + +table.dataTable tfoot th { + padding: 3px 18px 3px 10px; + border-top: 1px solid black; + font-weight: bold; +} + +table.dataTable td { + padding: 3px 10px; +} + +table.dataTable td.center, +table.dataTable td.dataTables_empty { + text-align: center; +} + +table.dataTable tr.odd { background-color: #E2E4FF; } +table.dataTable tr.even { background-color: white; } + +table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; } +table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; } +table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; } +table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; } +table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; } +table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; } + + +/* + * Table wrapper + */ +.dataTables_wrapper { + position: relative; + clear: both; + *zoom: 1; +} + + +/* + * Page length menu + */ +.dataTables_length { + float: left; +} + + +/* + * Filter + */ +.dataTables_filter { + float: right; + text-align: right; +} + + +/* + * Table information + */ +.dataTables_info { + clear: both; + float: left; +} + + +/* + * Pagination + */ +.dataTables_paginate { + float: right; + text-align: right; +} + +/* Two button pagination - previous / next */ +.paginate_disabled_previous, +.paginate_enabled_previous, +.paginate_disabled_next, +.paginate_enabled_next { + height: 19px; + float: left; + cursor: pointer; + *cursor: hand; + color: #111 !important; +} +.paginate_disabled_previous:hover, +.paginate_enabled_previous:hover, +.paginate_disabled_next:hover, +.paginate_enabled_next:hover { + text-decoration: none !important; +} +.paginate_disabled_previous:active, +.paginate_enabled_previous:active, +.paginate_disabled_next:active, +.paginate_enabled_next:active { + outline: none; +} + +.paginate_disabled_previous, +.paginate_disabled_next { + color: #666 !important; +} +.paginate_disabled_previous, +.paginate_enabled_previous { + padding-left: 23px; +} +.paginate_disabled_next, +.paginate_enabled_next { + padding-right: 23px; + margin-left: 10px; +} + +.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } +.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } +.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } + +.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } +.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } +.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } + +/* Full number pagination */ +.paging_full_numbers { + height: 22px; + line-height: 22px; +} +.paging_full_numbers a:active { + outline: none +} +.paging_full_numbers a:hover { + text-decoration: none; +} + +.paging_full_numbers a.paginate_button, +.paging_full_numbers a.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; + color: #333 !important; +} + +.paging_full_numbers a.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers a.paginate_button:hover { + background-color: #ccc; + text-decoration: none !important; +} + +.paging_full_numbers a.paginate_active { + background-color: #99B3FF; +} + + +/* + * Processing indicator + */ .dataTables_processing { position: absolute; top: 50%; @@ -52,183 +190,24 @@ background-color: white; } -.dataTables_length { - width: 40%; - float: left; -} -.dataTables_filter { - width: 50%; - float: right; - text-align: right; -} - -.dataTables_info { - width: 60%; - float: left; -} - -.dataTables_paginate { - width: 44px; - * width: 50px; - float: right; - text-align: right; -} - -/* Pagination nested */ -.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { - height: 19px; - width: 19px; - margin-left: 3px; - float: left; -} - -.paginate_disabled_previous { - background-image: url('../images/back_disabled.jpg'); -} - -.paginate_enabled_previous { - background-image: url('../images/back_enabled.jpg'); -} - -.paginate_disabled_next { - background-image: url('../images/forward_disabled.jpg'); -} - -.paginate_enabled_next { - background-image: url('../images/forward_enabled.jpg'); -} - - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * DataTables display +/* + * Sorting */ -table.display { - margin: 0 auto; - clear: both; - width: 100%; - - /* Note Firefox 3.5 and before have a bug with border-collapse - * ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) - * border-spacing: 0; is one possible option. Conditional-css.com is - * useful for this kind of thing - * - * Further note IE 6/7 has problems when calculating widths with border width. - * It subtracts one px relative to the other browsers from the first column, and - * adds one to the end... - * - * If you want that effect I'd suggest setting a border-top/left on th/td's and - * then filling in the gaps with other borders. - */ -} +.sorting { background: url('../images/sort_both.png') no-repeat center right; } +.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } +.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } -table.display thead th { - padding: 3px 18px 3px 10px; - border-bottom: 1px solid black; - font-weight: bold; - cursor: pointer; - * cursor: hand; -} - -table.display tfoot th { - padding: 3px 18px 3px 10px; - border-top: 1px solid black; - font-weight: bold; -} - -table.display tr.heading2 td { - border-bottom: 1px solid #aaa; -} - -table.display td { - padding: 3px 10px; -} - -table.display td.center { - text-align: center; +.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } +.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } + +table.dataTable th:active { + outline: none; } - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * DataTables sorting - */ - -.sorting_asc { - background: url('../images/sort_asc.png') no-repeat center right; -} - -.sorting_desc { - background: url('../images/sort_desc.png') no-repeat center right; -} - -.sorting { - background: url('../images/sort_both.png') no-repeat center right; -} - -.sorting_asc_disabled { - background: url('../images/sort_asc_disabled.png') no-repeat center right; -} - -.sorting_desc_disabled { - background: url('../images/sort_desc_disabled.png') no-repeat center right; -} - - - - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * DataTables row classes - */ -table.display tr.odd.gradeA { - background-color: #ddffdd; -} - -table.display tr.even.gradeA { - background-color: #eeffee; -} - -table.display tr.odd.gradeC { - background-color: #ddddff; -} - -table.display tr.even.gradeC { - background-color: #eeeeff; -} - -table.display tr.odd.gradeX { - background-color: #ffdddd; -} - -table.display tr.even.gradeX { - background-color: #ffeeee; -} - -table.display tr.odd.gradeU { - background-color: #ddd; -} - -table.display tr.even.gradeU { - background-color: #eee; -} - - -tr.odd { - background-color: #E2E4FF; -} - -tr.even { - background-color: white; -} - - - - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Misc +/* + * Scrolling */ .dataTables_scroll { clear: both; @@ -236,301 +215,6 @@ tr.even { .dataTables_scrollBody { *margin-top: -1px; + -webkit-overflow-scrolling: touch; } -.top, .bottom { - padding: 15px; - background-color: #F5F5F5; - border: 1px solid #CCCCCC; -} - -.top .dataTables_info { - float: none; -} - -.clear { - clear: both; -} - -.dataTables_empty { - text-align: center; -} - -tfoot input { - margin: 0.5em 0; - width: 100%; - color: #444; -} - -tfoot input.search_init { - color: #999; -} - -td.group { - background-color: #d1cfd0; - border-bottom: 2px solid #A19B9E; - border-top: 2px solid #A19B9E; -} - -td.details { - background-color: #d1cfd0; - border: 2px solid #A19B9E; -} - - -.example_alt_pagination div.dataTables_info { - width: 40%; -} - -.paging_full_numbers { - width: 400px; - height: 22px; - line-height: 22px; -} - -.paging_full_numbers span.paginate_button, - .paging_full_numbers span.paginate_active { - border: 1px solid #aaa; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - padding: 2px 5px; - margin: 0 3px; - cursor: pointer; - *cursor: hand; -} - -.paging_full_numbers span.paginate_button { - background-color: #ddd; -} - -.paging_full_numbers span.paginate_button:hover { - background-color: #ccc; -} - -.paging_full_numbers span.paginate_active { - background-color: #99B3FF; -} - -table.display tr.even.row_selected td { - background-color: #B0BED9; -} - -table.display tr.odd.row_selected td { - background-color: #9FAFD1; -} - - -/* - * Sorting classes for columns - */ -/* For the standard odd/even */ -tr.odd td.sorting_1 { - background-color: #D3D6FF; -} - -tr.odd td.sorting_2 { - background-color: #DADCFF; -} - -tr.odd td.sorting_3 { - background-color: #E0E2FF; -} - -tr.even td.sorting_1 { - background-color: #EAEBFF; -} - -tr.even td.sorting_2 { - background-color: #F2F3FF; -} - -tr.even td.sorting_3 { - background-color: #F9F9FF; -} - - -/* For the Conditional-CSS grading rows */ -/* - Colour calculations (based off the main row colours) - Level 1: - dd > c4 - ee > d5 - Level 2: - dd > d1 - ee > e2 - */ -tr.odd.gradeA td.sorting_1 { - background-color: #c4ffc4; -} - -tr.odd.gradeA td.sorting_2 { - background-color: #d1ffd1; -} - -tr.odd.gradeA td.sorting_3 { - background-color: #d1ffd1; -} - -tr.even.gradeA td.sorting_1 { - background-color: #d5ffd5; -} - -tr.even.gradeA td.sorting_2 { - background-color: #e2ffe2; -} - -tr.even.gradeA td.sorting_3 { - background-color: #e2ffe2; -} - -tr.odd.gradeC td.sorting_1 { - background-color: #c4c4ff; -} - -tr.odd.gradeC td.sorting_2 { - background-color: #d1d1ff; -} - -tr.odd.gradeC td.sorting_3 { - background-color: #d1d1ff; -} - -tr.even.gradeC td.sorting_1 { - background-color: #d5d5ff; -} - -tr.even.gradeC td.sorting_2 { - background-color: #e2e2ff; -} - -tr.even.gradeC td.sorting_3 { - background-color: #e2e2ff; -} - -tr.odd.gradeX td.sorting_1 { - background-color: #ffc4c4; -} - -tr.odd.gradeX td.sorting_2 { - background-color: #ffd1d1; -} - -tr.odd.gradeX td.sorting_3 { - background-color: #ffd1d1; -} - -tr.even.gradeX td.sorting_1 { - background-color: #ffd5d5; -} - -tr.even.gradeX td.sorting_2 { - background-color: #ffe2e2; -} - -tr.even.gradeX td.sorting_3 { - background-color: #ffe2e2; -} - -tr.odd.gradeU td.sorting_1 { - background-color: #c4c4c4; -} - -tr.odd.gradeU td.sorting_2 { - background-color: #d1d1d1; -} - -tr.odd.gradeU td.sorting_3 { - background-color: #d1d1d1; -} - -tr.even.gradeU td.sorting_1 { - background-color: #d5d5d5; -} - -tr.even.gradeU td.sorting_2 { - background-color: #e2e2e2; -} - -tr.even.gradeU td.sorting_3 { - background-color: #e2e2e2; -} - - -/* - * Row highlighting example - */ -.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { - background-color: #ECFFB3; -} - -.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { - background-color: #E6FF99; -} - -.ex_highlight_row #example tr.even:hover { - background-color: #ECFFB3; -} - -.ex_highlight_row #example tr.even:hover td.sorting_1 { - background-color: #DDFF75; -} - -.ex_highlight_row #example tr.even:hover td.sorting_2 { - background-color: #E7FF9E; -} - -.ex_highlight_row #example tr.even:hover td.sorting_3 { - background-color: #E2FF89; -} - -.ex_highlight_row #example tr.odd:hover { - background-color: #E6FF99; -} - -.ex_highlight_row #example tr.odd:hover td.sorting_1 { - background-color: #D6FF5C; -} - -.ex_highlight_row #example tr.odd:hover td.sorting_2 { - background-color: #E0FF84; -} - -.ex_highlight_row #example tr.odd:hover td.sorting_3 { - background-color: #DBFF70; -} - - -/* - * KeyTable - */ -table.KeyTable td { - border: 3px solid transparent; -} - -table.KeyTable td.focus { - border: 3px solid #3366FF; -} - -table.display tr.gradeA { - background-color: #eeffee; -} - -table.display tr.gradeC { - background-color: #ddddff; -} - -table.display tr.gradeX { - background-color: #ffdddd; -} - -table.display tr.gradeU { - background-color: #ddd; -} - -div.box { - height: 100px; - padding: 10px; - overflow: auto; - border: 1px solid #8080FF; - background-color: #E5E5FF; -} diff --git a/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css b/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css index 28f424fd1a3..de7c8426105 100644 --- a/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css +++ b/htdocs/includes/jquery/plugins/datatables/css/jquery.dataTables_jui.css @@ -1,8 +1,10 @@ /* * File: demo_table_jui.css + * CVS: $Id$ * Description: CSS descriptions for DataTables demo pages * Author: Allan Jardine * Created: Tue May 12 06:47:22 BST 2009 + * Modified: $Date$ by $Author$ * Language: CSS * Project: DataTables * @@ -40,6 +42,7 @@ margin: 0; cursor: pointer; * cursor: hand; + color: #333 !important; } .dataTables_paginate .ui-button { @@ -107,8 +110,6 @@ table.display thead th div.DataTables_sort_wrapper span { .dataTables_wrapper { position: relative; - min-height: 302px; - _height: 302px; clear: both; } @@ -295,6 +296,10 @@ tr.even { clear: both; } +.dataTables_scrollBody { + -webkit-overflow-scrolling: touch; +} + .top, .bottom { padding: 15px; background-color: #F5F5F5; @@ -339,8 +344,8 @@ td.details { width: 40%; } -.paging_full_numbers span.paginate_button, - .paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_button, + .paging_full_numbers a.paginate_active { border: 1px solid #aaa; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -348,17 +353,19 @@ td.details { margin: 0 3px; cursor: pointer; *cursor: hand; + color: #333 !important; } -.paging_full_numbers span.paginate_button { +.paging_full_numbers a.paginate_button { background-color: #ddd; } -.paging_full_numbers span.paginate_button:hover { +.paging_full_numbers a.paginate_button:hover { background-color: #ccc; + text-decoration: none !important; } -.paging_full_numbers span.paginate_active { +.paging_full_numbers a.paginate_active { background-color: #99B3FF; } diff --git a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.js b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.js index 302fe847e9d..7c7b728a274 100644 --- a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.js +++ b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.js @@ -1,9 +1,11 @@ /* * File: ColReorder.js - * Version: 1.0.2 + * 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 @@ -107,7 +109,7 @@ function fnDomSwitch( nParent, iFrom, iTo ) */ $.fn.dataTableExt.oApi.fnColReorder = function ( oSettings, iFrom, iTo ) { - var i, iLen, j, jLen, iCols=oSettings.aoColumns.length, nTrs; + var i, iLen, j, jLen, iCols=oSettings.aoColumns.length, nTrs, oCol; /* Sanity check in the input */ if ( iFrom == iTo ) @@ -161,7 +163,22 @@ $.fn.dataTableExt.oApi.fnColReorder = function ( oSettings, iFrom, iTo ) /* Data column sorting (the column which the sort for a given column should take place on) */ for ( i=0, iLen=iCols ; 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] ); @@ -903,9 +912,9 @@ ColReorder.prototype.CLASS = "ColReorder"; * ColReorder version * @constant VERSION * @type String - * @default 1.0.2 + * @default As code */ -ColReorder.VERSION = "1.0.2"; +ColReorder.VERSION = "1.0.5"; ColReorder.prototype.VERSION = ColReorder.VERSION; @@ -921,7 +930,7 @@ ColReorder.prototype.VERSION = ColReorder.VERSION; */ if ( typeof $.fn.dataTable == "function" && typeof $.fn.dataTableExt.fnVersionCheck == "function" && - $.fn.dataTableExt.fnVersionCheck('1.8.0') ) + $.fn.dataTableExt.fnVersionCheck('1.9.0') ) { $.fn.dataTableExt.aoFeatures.push( { "fnInit": function( oDTSettings ) { @@ -942,7 +951,7 @@ if ( typeof $.fn.dataTable == "function" && } else { - alert( "Warning: ColReorder requires DataTables 1.8.0 or greater - www.datatables.net/download"); + alert( "Warning: ColReorder requires DataTables 1.9.0 or greater - www.datatables.net/download"); } })(jQuery, window, document); diff --git a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.jgz b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.jgz index e841e2b093b..5790b3785af 100644 Binary files a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.jgz and b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.jgz differ diff --git a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.js b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.js index 7194cda5765..e322c42ce9d 100644 --- a/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.js +++ b/htdocs/includes/jquery/plugins/datatables/extras/ColReorder/js/ColReorder.min.js @@ -1,6 +1,6 @@ /* * File: ColReorder.min.js - * Version: 1.0.2 + * Version: 1.0.5 * Author: Allan Jardine (www.sprymedia.co.uk) * * Copyright 2010-2011 Allan Jardine, all rights reserved. @@ -12,22 +12,22 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. */ -(function(f,o,i){function l(a){for(var c=[],d=0,b=a.length;d=h)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+c);else if(d<0||d>= -h)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+d);else{g=[];b=0;for(e=h;bthis.s.fixed-1&&this._fnMouseListener(c,this.s.dt.aoColumns[c].nTh);this.s.dt.aoColumns[c]._ColReorder_iOrigCol=c}this.s.dt.aoStateSave.push({fn:function(h,g){return a._fnStateSave.call(a,g)},sName:"ColReorder_State"});var b=null;if(typeof this.s.init.aiOrder!="undefined")b=this.s.init.aiOrder.slice();if(this.s.dt.oLoadedState&&typeof this.s.dt.oLoadedState.ColReorder!="undefined"&&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=l(b);a._fnOrderColumns.call(a,c)}else{var e=false;this.s.dt.aoDrawCallback.push({fn:function(){if(!a.s.dt._bInitComplete&&!e){e=true;var h=l(b);a._fnOrderColumns.call(a,h)}},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;c -0;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tbody")[0]);for(;this.dom.drag.getElementsByTagName("tfoot").length>0;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tfoot")[0]);f("thead tr:eq(0)",this.dom.drag).each(function(){f("th:not(:eq("+a.s.mouse.targetIndex+"))",this).remove()});f("tr",this.dom.drag).height(f("tr:eq(0)",a.s.dt.nTHead).height());f("thead tr:gt(0)",this.dom.drag).remove();f("thead th:eq(0)",this.dom.drag).each(function(){this.style.width=f("th:eq("+ -a.s.mouse.targetIndex+")",a.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=f("th:eq("+a.s.mouse.targetIndex+")",a.s.dt.nTHead).outerWidth()+"px";this.dom.pointer=i.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=f(this.s.dt.nTable).offset().top+"px";this.dom.pointer.style.height= -f(this.s.dt.nTable).height()+"px"}else{this.dom.pointer.style.top=f("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top+"px";this.dom.pointer.style.height=f("div.dataTables_scroll",this.s.dt.nTableWrapper).height()+"px"}i.body.appendChild(this.dom.pointer);i.body.appendChild(this.dom.drag)}};ColReorder.aoInstances=[];ColReorder.fnReset=function(a){for(var c=0,d=ColReorder.aoInstances.length;cc||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;d'+this.s.sShowAll+'' ); + + $(nButton).click( function (e) { + for ( var i=0, iLen=that.s.abOriginal.length ; i'+ + ''+ ''+sTitle+'' ); $(nButton).click( function (e) { @@ -503,7 +592,19 @@ ColVis.prototype = { */ var oldIndex = $.fn.dataTableExt.iApiIndex; $.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that); - that.s.dt.oInstance.fnSetColumnVis( i, showHide ); + + // 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 ) @@ -546,8 +647,8 @@ ColVis.prototype = { { var that = this, - nButton = document.createElement('button'), - nSpan = document.createElement('span'), + nButton = document.createElement('button'), + nSpan = document.createElement('span'), sEvent = this.s.activate=="mouseover" ? "mouseover" : "click"; nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" : @@ -577,7 +678,11 @@ ColVis.prototype = { nHidden.style.display = "none"; nHidden.className = !this.s.dt.bJUI ? "ColVis_collection TableTools_collection" : "ColVis_collection TableTools_collection ui-buttonset ui-buttonset-multi"; - nHidden.style.position = "absolute"; + + if ( !this.s.bCssPosition ) + { + nHidden.style.position = "absolute"; + } $(nHidden).css('opacity', 0); return nHidden; @@ -658,8 +763,11 @@ ColVis.prototype = { var iDivX = parseInt(oPos.left, 10); var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10); - nHidden.style.top = iDivY+"px"; - nHidden.style.left = iDivX+"px"; + if ( !this.s.bCssPosition ) + { + nHidden.style.top = iDivY+"px"; + nHidden.style.left = iDivX+"px"; + } nHidden.style.display = "block"; $(nHidden).css('opacity',0); @@ -686,30 +794,38 @@ ColVis.prototype = { this.dom.collection.style.width = "auto"; for ( i=0, iLen=this.dom.buttons.length ; i iDocWidth ) + if ( !this.s.bCssPosition ) { - nHidden.style.left = (iDocWidth-iDivWidth)+"px"; + nHidden.style.left = this.s.sAlign=="left" ? + iDivX+"px" : (iDivX-$(nHidden).outerWidth()+$(this.dom.button).outerWidth())+"px"; + + var iDivWidth = $(nHidden).outerWidth(); + var iDivHeight = $(nHidden).outerHeight(); + + if ( iDivX + iDivWidth > iDocWidth ) + { + nHidden.style.left = (iDocWidth-iDivWidth)+"px"; + } } - /* This results in a very small delay for the end user but it allows the animation to be * much smoother. If you don't want the animation, then the setTimeout can be removed */ @@ -753,6 +869,20 @@ ColVis.prototype = { document.body.removeChild( that.dom.catcher ); } ); } + }, + + + /** + * Alter the colspan on any fnOpen rows + */ + "_fnAdjustOpenRows": function () + { + var aoOpen = this.s.dt.aoOpenRows; + var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt ); + + for ( var i=0, iLen=aoOpen.length ; i=0;a--)this.dom.buttons[a]!==null&&this.dom.collection.removeChild(this.dom.buttons[a]);this.dom.buttons.splice(0,this.dom.buttons.length);this.dom.restore&&this.dom.restore.parentNode(this.dom.restore);this._fnAddButtons();this._fnDrawCallback()},_fnConstruct:function(){this._fnApplyCustomisation();var a=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();for(var b=0,c=this.s.dt.aoColumns.length;b'+this.s.sRestore+"");d(b).click(function(){for(var e=0,f=a.s.abOriginal.length;e'+c+"");d(e).click(function(g){var h=!d("input",this).is(":checked");if(g.target.nodeName.toLowerCase()=="input")h=d("input",this).is(":checked");g=d.fn.dataTableExt.iApiIndex;d.fn.dataTableExt.iApiIndex=b._fnDataTablesApiIndex.call(b);b.s.dt.oInstance.fnSetColumnVis(a,h);d.fn.dataTableExt.iApiIndex=g;b.s.fnStateChange!== -null&&b.s.fnStateChange.call(b,a,h)});return e},_fnDataTablesApiIndex:function(){for(var a=0,b=this.s.dt.oInstance.length;ai?c:i)+"px";f.style.width=(jh)e.style.left=h-b+"px";setTimeout(function(){d(e).animate({opacity:1},a.s.iOverlayFade);d(f).animate({opacity:0.1},a.s.iOverlayFade,"linear",function(){jQuery.browser.msie&&jQuery.browser.version=="6.0"&&a._fnDrawCallback()})},10);this.s.hidden=false},_fnCollectionHide:function(){var a=this;if(!this.s.hidden&&this.dom.collection!==null){this.s.hidden=true;d(this.dom.collection).animate({opacity:0}, -a.s.iOverlayFade,function(){this.style.display="none"});d(this.dom.background).animate({opacity:0},a.s.iOverlayFade,function(){document.body.removeChild(a.dom.background);document.body.removeChild(a.dom.catcher)})}}};ColVis.fnRebuild=function(a){var b=null;if(typeof a!="undefined")b=a.fnSettings().nTable;for(var c=0,e=ColVis.aInstances.length;c'+this.s.sRestore+"");d(b).click(function(){for(var b=0,c=a.s.abOriginal.length;b< +c;b++)a.s.dt.oInstance.fnSetColumnVis(b,a.s.abOriginal[b],!1);a._fnAdjustOpenRows();a.s.dt.oInstance.fnDraw(!1)});return b},_fnDomShowAllButton:function(){var a=this,b=document.createElement("button"),c=document.createElement("span");b.className=!this.s.dt.bJUI?"ColVis_Button TableTools_Button":"ColVis_Button TableTools_Button ui-button ui-state-default";b.appendChild(c);d(c).html(''+this.s.sShowAll+"");d(b).click(function(){for(var b=0,c=a.s.abOriginal.length;b< +c;b++)-1===a.s.aiExclude.indexOf(b)&&a.s.dt.oInstance.fnSetColumnVis(b,!0,!1);a._fnAdjustOpenRows();a.s.dt.oInstance.fnDraw(!1)});return b},_fnDomColumnButton:function(a){var b=this,c=this.s.dt.aoColumns[a],e=document.createElement("button"),g=document.createElement("span"),f=this.s.dt;e.className=!f.bJUI?"ColVis_Button TableTools_Button":"ColVis_Button TableTools_Button ui-button ui-state-default";e.appendChild(g);c=null===this.s.fnLabel?c.sTitle:this.s.fnLabel(a,c.sTitle,c.nTh);d(g).html(''+ +c+"");d(e).click(function(c){var e=!d("input",this).is(":checked");"input"==c.target.nodeName.toLowerCase()&&(e=d("input",this).is(":checked"));c=d.fn.dataTableExt.iApiIndex;d.fn.dataTableExt.iApiIndex=b._fnDataTablesApiIndex.call(b);f.oFeatures.bServerSide&&(""!==f.oScroll.sX||""!==f.oScroll.sY)?(b.s.dt.oInstance.fnSetColumnVis(a,e,!1),b.s.dt.oInstance.oApi._fnScrollDraw(b.s.dt),b._fnDrawCallback()):b.s.dt.oInstance.fnSetColumnVis(a,e);d.fn.dataTableExt.iApiIndex=c;null!==b.s.fnStateChange&& +b.s.fnStateChange.call(b,a,e)});return e},_fnDataTablesApiIndex:function(){for(var a=0,b=this.s.dt.oInstance.length;ai?c:i)+"px";g.style.width=(jh))e.style.left=h-b+"px";setTimeout(function(){d(e).animate({opacity:1},a.s.iOverlayFade);d(g).animate({opacity:0.1},a.s.iOverlayFade,"linear",function(){jQuery.browser.msie&&"6.0"==jQuery.browser.version&&a._fnDrawCallback()})},10);this.s.hidden=!1},_fnCollectionHide:function(){var a=this;if(!this.s.hidden&&null!==this.dom.collection)this.s.hidden= +!0,d(this.dom.collection).animate({opacity:0},a.s.iOverlayFade,function(){this.style.display="none"}),d(this.dom.background).animate({opacity:0},a.s.iOverlayFade,function(){document.body.removeChild(a.dom.background);document.body.removeChild(a.dom.catcher)})},_fnAdjustOpenRows:function(){for(var a=this.s.dt.aoOpenRows,b=this.s.dt.oApi._fnVisbleColumns(this.s.dt),c=0,d=a.length;c