From fbee1415d0d500ca4240fd7002f985013871ee0d Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 28 Mar 2018 15:00:34 +0100 Subject: [PATCH 01/46] Fix #371: Limit search to a per item basis when multi-item searching --- features/searchPane/dataTables.searchPane.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/searchPane/dataTables.searchPane.js b/features/searchPane/dataTables.searchPane.js index 42d5d73..31fffd7 100644 --- a/features/searchPane/dataTables.searchPane.js +++ b/features/searchPane/dataTables.searchPane.js @@ -244,14 +244,14 @@ table .column(pane.data('column')) .search( - '^' + + '^(' + $.map(filters, function(filter) { var d = $(filter) .data('filter') .toString(); return $.fn.dataTable.util.escapeRegex(d); }).join('|') + - '$', + ')$', true, false ) From 220faaf2220b0376956d565be9a7c6090189adef Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 28 Mar 2018 15:01:46 +0100 Subject: [PATCH 02/46] Include scroll resize in minifier --- make.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/make.sh b/make.sh index 017fea6..e318e1d 100644 --- a/make.sh +++ b/make.sh @@ -16,6 +16,7 @@ js_compress $DT_SRC/extensions/Plugins/features/searchHighlight/dataTables.searc js_compress $DT_SRC/extensions/Plugins/features/alphabetSearch/dataTables.alphabetSearch.js js_compress $DT_SRC/extensions/Plugins/features/lengthLinks/dataTables.lengthLinks.js js_compress $DT_SRC/extensions/Plugins/features/pageResize/dataTables.pageResize.js +js_compress $DT_SRC/extensions/Plugins/features/scrollResize/dataTables.scrollResize.js js_compress $DT_SRC/extensions/Plugins/features/deepLink/dataTables.deepLink.js js_compress $DT_SRC/extensions/Plugins/integration/bootstrap/2/dataTables.bootstrap.js From a0a9c23c78b300ba87619de791ee89d0b8704601 Mon Sep 17 00:00:00 2001 From: Colin Marks Date: Mon, 23 Apr 2018 13:53:20 +0100 Subject: [PATCH 03/46] first release of searchFade --- features/searchFade/dataTables.searchFade.css | 3 + features/searchFade/dataTables.searchFade.js | 113 ++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 features/searchFade/dataTables.searchFade.css create mode 100644 features/searchFade/dataTables.searchFade.js diff --git a/features/searchFade/dataTables.searchFade.css b/features/searchFade/dataTables.searchFade.css new file mode 100644 index 0000000..1e6ed13 --- /dev/null +++ b/features/searchFade/dataTables.searchFade.css @@ -0,0 +1,3 @@ +.notMatched td { + opacity: 0.2; +} diff --git a/features/searchFade/dataTables.searchFade.js b/features/searchFade/dataTables.searchFade.js new file mode 100644 index 0000000..16251da --- /dev/null +++ b/features/searchFade/dataTables.searchFade.js @@ -0,0 +1,113 @@ +/*! SearchFade 0.0.1 + * 2018 SpryMedia Ltd - datatables.net/license + */ + +/** + * @summary SearchFade + * @description Search and Fade unmatching rows in a DataTables + * @version 0.0.1 + * @author SpryMedia Ltd (www.sprymedia.co.uk) + * @copyright Copyright 2018 SpryMedia Ltd. + * + * This source file is free software, available under the following license: + * MIT license - http://datatables.net/license/mit + * + * 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. + * + * For details please refer to: http://www.datatables.net + */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery', 'datatables.net'], function($) { + return factory($, window, document); + }); + } else if (typeof exports === 'object') { + // CommonJS + module.exports = function(root, $) { + if (!root) { + root = window; + } + + if (!$ || !$.fn.dataTable) { + $ = require('datatables.net')(root, $).$; + } + + return factory($, root, root.document); + }; + } else { + // Browser + factory(jQuery, window, document); + } +})(function($, window, document, undefined) { + 'use strict'; + + $.fn.dataTable.Api.register('searchFade()', function() { + return this; + }); + + $.fn.dataTable.Api.register('searchFade().node()', function() { + return this.settings()[0].searchFadeNode; + }); + + function _draw(table, searchFade) { + searchFade.empty(); + searchFade.append('Search: '); + + $('').appendTo(searchFade); + } + + $.fn.dataTable.SearchFade = function(settings) { + var table = new $.fn.dataTable.Api(settings); + var searchFade = $('
'); + + table.settings()[0].searchFadeNode = searchFade; + + _draw(table, searchFade); + + // Trigger a search + searchFade.on('keyup redraw', 'input', function() { + table.rows(':visible').every(function(rowIdx, tableLoop, rowLoop) { + var present = true; + if ($('.searchFadeInput' + table.settings()[0].sTableId).val().length) { + present = table + .row(rowIdx) + .data() + .some(function(v) { + return v.match(new RegExp($('.searchFadeInput' + table.settings()[0].sTableId).val(), 'i')) != null; + }); + } + $(table.row(rowIdx).node()).toggleClass('notMatched', !present); + }); + }); + + table.on('draw', function() { + $('.searchFadeInput').trigger('redraw'); + }); + + // API method to get the searchFade container node + this.node = function() { + return searchFade; + }; + }; + + $.fn.DataTable.SearchFade = $.fn.dataTable.SearchFade; + + $.fn.dataTable.ext.feature.push({ + fnInit: function(settings) { + var search = new $.fn.dataTable.SearchFade(settings); + return search.node(); + }, + cFeature: 'F' + }); + + $(document).on('init.dt', function(e, settings, json) { + if (e.namespace === 'dt') { + $.fn.dataTable.SearchFade(settings); + } + + return; + }); +}); From 76894082d3175ac899eb26a064fdfca55791e094 Mon Sep 17 00:00:00 2001 From: auycro Date: Mon, 7 May 2018 16:03:27 +0900 Subject: [PATCH 04/46] =?UTF-8?q?=E0=B9=8AUpdate=20Thai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/Thai.lang | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/i18n/Thai.lang b/i18n/Thai.lang index 4676c68..7417ef7 100644 --- a/i18n/Thai.lang +++ b/i18n/Thai.lang @@ -2,23 +2,29 @@ * Thai translation * @name Thai * @anchor Thai - * @author Thanva Thonglor + * @author Thanva Thonglor , Gumpanat Keardkeawfa */ { - "sProcessing": "กำลังดำเนินการ...", - "sLengthMenu": "แสดง _MENU_ แถว", - "sZeroRecords": "ไม่พบข้อมูล", - "sInfo": "แสดง _START_ ถึง _END_ จาก _TOTAL_ แถว", - "sInfoEmpty": "แสดง 0 ถึง 0 จาก 0 แถว", - "sInfoFiltered": "(กรองข้อมูล _MAX_ ทุกแถว)", - "sInfoPostFix": "", - "sSearch": "ค้นหา: ", - "sUrl": "", - "oPaginate": { - "sFirst": "หน้าแรก", - "sPrevious": "ก่อนหน้า", - "sNext": "ถัดไป", - "sLast": "หน้าสุดท้าย" - } + "sEmptyTable": "ไม่มีข้อมูลในตาราง", + "sInfo": "แสดง _START_ ถึง _END_ จาก _TOTAL_ แถว", + "sInfoEmpty": "แสดง 0 ถึง 0 จาก 0 แถว", + "sInfoFiltered": "(กรองข้อมูล _MAX_ ทุกแถว)", + "sInfoPostFix": "", + "sInfoThousands": ",", + "sLengthMenu": "แสดง _MENU_ แถว", + "sLoadingRecords": "กำลังโหลดข้อมูล...", + "sProcessing": "กำลังดำเนินการ...", + "sSearch": "ค้นหา: ", + "sZeroRecords": "ไม่พบข้อมูล", + "oPaginate": { + "sFirst": "หน้าแรก", + "sPrevious": "ก่อนหน้า", + "sNext": "ถัดไป", + "sLast": "หน้าสุดท้าย" + }, + "oAria": { + "sSortAscending": ": เปิดใช้งานการเรียงข้อมูลจากน้อยไปมาก", + "sSortDescending": ": เปิดใช้งานการเรียงข้อมูลจากมากไปน้อย" + } } From 7a6ff3585fe3aad844b05f9365b149a392ba5c5d Mon Sep 17 00:00:00 2001 From: Colin Marks Date: Wed, 9 May 2018 17:20:50 +0100 Subject: [PATCH 05/46] fixed bug that stopped the page draw trigger from happening (thanks crush123) --- features/searchFade/dataTables.searchFade.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/searchFade/dataTables.searchFade.js b/features/searchFade/dataTables.searchFade.js index 16251da..3d064ea 100644 --- a/features/searchFade/dataTables.searchFade.js +++ b/features/searchFade/dataTables.searchFade.js @@ -84,7 +84,7 @@ }); table.on('draw', function() { - $('.searchFadeInput').trigger('redraw'); + $('input', searchFade).trigger('redraw'); }); // API method to get the searchFade container node From 0050e6c9337d28a5c52d2cdac9fa93f9c5fcd3ac Mon Sep 17 00:00:00 2001 From: Colin Marks Date: Thu, 10 May 2018 07:07:40 +0100 Subject: [PATCH 06/46] New sorting plugin for book chapter numbering --- sorting/chapter.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sorting/chapter.js diff --git a/sorting/chapter.js b/sorting/chapter.js new file mode 100644 index 0000000..30f53ce --- /dev/null +++ b/sorting/chapter.js @@ -0,0 +1,50 @@ +/** + * Sorts a column containing chapter numbers. This can be most useful when + * using DataTables for a book or book reference style application. By + * default, five sections are supported (a.b.c.d.e) with each being upto + * four-digits long. Those defaults are controlled by constMaxSections and + * constMaxSectionDigits respectively, and can be easily changed + * + * @name chapter + * @summary Sort book chapters numerically + * @author Colin Marks + * + * @example + * $('#example').dataTable( { + * columnDefs: [ + * { type: 'chapter', targets: 0 } + * ] + * } ); + */ + +jQuery.extend(jQuery.fn.dataTableExt.oSort, { + 'chapter-pre': function(a) { + function makeFiller(count) { + return count === 0 ? '' : Array(count + 1).join('0'); + } + + var constMaxSections = 5; + var constMaxSectionDigits = 4; + + var filler; + var result = ''; + var sections = a.split('.'); + + for (var i = 0; i < constMaxSections; i++) { + filler = i < sections.length ? constMaxSectionDigits - sections[i].length : constMaxSectionDigits; + + result += filler === 0 ? '' : Array(filler + 1).join('0'); + result += i < sections.length ? sections[i] : ''; + } + + return result; + }, + + 'chapter-asc': function(a, b) { + return a < b ? -1 : a > b ? 1 : 0; + }, + + 'chapter-desc': function(a, b) { + return a < b ? 1 : a > b ? -1 : 0; + } +}); From da67f99c240f1c80a51487e00808a97ea48971cb Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 11 May 2018 09:55:33 +0100 Subject: [PATCH 07/46] Fix: Update for jQuery 3.3 deprecated functions --- .../conditionalPaging/dataTables.conditionalPaging.js | 2 +- type-detection/formatted-num.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/features/conditionalPaging/dataTables.conditionalPaging.js b/features/conditionalPaging/dataTables.conditionalPaging.js index 7326351..4fb7fae 100644 --- a/features/conditionalPaging/dataTables.conditionalPaging.js +++ b/features/conditionalPaging/dataTables.conditionalPaging.js @@ -70,7 +70,7 @@ } }; - if ($.isNumeric(config.speed) || $.type(config.speed) === 'string') { + if ( config.speed !== undefined ) { speed = config.speed; } diff --git a/type-detection/formatted-num.js b/type-detection/formatted-num.js index 24d7349..27ff033 100644 --- a/type-detection/formatted-num.js +++ b/type-detection/formatted-num.js @@ -19,9 +19,10 @@ jQuery.fn.dataTableExt.aTypes.unshift( function ( sData ) { var deformatted = sData.replace(/[^\d\-\.\/a-zA-Z]/g,''); - if ( $.isNumeric( deformatted ) || deformatted === "-" ) { - return 'formatted-num'; - } - return null; + var isNumeric = !isNaN( deformatted - parseFloat( deformatted ) ); + + return isNumeric || deformatted === "-" ? + 'formatted-num' : + null; } ); From a46b1b3331434b773de8fe9a735324c9863c039e Mon Sep 17 00:00:00 2001 From: AnixPasBesoin Date: Sun, 13 May 2018 21:31:48 +0200 Subject: [PATCH 08/46] Added translation for row selection Added missing translation for row selection. https://datatables.net/forums/discussion/35398/i18n-translation-for-n-rows-selected --- i18n/French.lang | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/i18n/French.lang b/i18n/French.lang index e744bd8..a46dbb8 100644 --- a/i18n/French.lang +++ b/i18n/French.lang @@ -25,5 +25,12 @@ "oAria": { "sSortAscending": ": activer pour trier la colonne par ordre croissant", "sSortDescending": ": activer pour trier la colonne par ordre décroissant" + }, + "select": { + "rows": { + _: "%d lignes séléctionnées", + 0: "Aucune ligne séléctionnée", + 1: "1 ligne séléctionnée" + } } } From 18cbcbb5d9673e32912a25ac2eb473f467f56bb9 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 14 May 2018 11:05:48 +0100 Subject: [PATCH 09/46] Fix: Attempt to use the second row in the table to allow for top and bottom borders on rows --- features/pageResize/dataTables.pageResize.js | 3 ++- features/pageResize/dataTables.pageResize.min.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/features/pageResize/dataTables.pageResize.js b/features/pageResize/dataTables.pageResize.js index 52d3015..f5a9496 100644 --- a/features/pageResize/dataTables.pageResize.js +++ b/features/pageResize/dataTables.pageResize.js @@ -69,7 +69,8 @@ PageResize.prototype = { var dt = settings.dt; var t = dt.table(); var offsetTop = $( settings.table ).offset().top; - var rowHeight = $( 'tr', settings.body ).eq(0).height(); + var rows = $( 'tr', settings.body ); + var rowHeight = rows.eq( rows.length > 1 ? 1 : 0 ).height(); // Attempt to use the second row if poss, for top and bottom border var availableHeight = settings.host.height(); var scrolling = t.header().parentNode !== t.body().parentNode; var delta = settings.delta; diff --git a/features/pageResize/dataTables.pageResize.min.js b/features/pageResize/dataTables.pageResize.min.js index 29ff760..ed0ef5d 100644 --- a/features/pageResize/dataTables.pageResize.min.js +++ b/features/pageResize/dataTables.pageResize.min.js @@ -25,6 +25,6 @@ PageResize for DataTables v1.0.0 2015 SpryMedia Ltd - datatables.net/license */ -(function(b){var e=function(a,c){var d=a.table();this.s={dt:a,host:b(d.container()).parent(),header:b(d.header()),footer:b(d.footer()),body:b(d.body()),container:b(d.container()),table:b(d.node()),delta:c};a=this.s.host;"static"===a.css("position")&&a.css("position","relative");this._attach();this._size()};e.prototype={_size:function(){var a=this.s,c=a.dt,d=c.table(),h=b(a.table).offset().top,e=b("tr",a.body).eq(0).height(),f=a.host.height(),k=d.header().parentNode!==d.body().parentNode,g=a.delta; -k||(d.header()&&(f-=a.header.height()),d.footer()&&(f-=a.footer.height()));f=f-h-(a.container.height()-(h+a.table.height()));!isNaN(parseFloat(g))&&isFinite(g)&&(f-=g);a=Math.floor(f/e);Infinity!==a&&-Infinity!==a&&!isNaN(a)&&0").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");c[0].onload=function(){var b=this.contentDocument.body,c=b.offsetHeight;this.contentDocument.defaultView.onresize= -function(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};b.fn.dataTable.PageResize=e;b.fn.DataTable.PageResize=e;b(document).on("init.dt",function(a,c){"dt"===a.namespace&&(a=new b.fn.dataTable.Api(c),(b(a.table().node()).hasClass("pageResize")||c.oInit.pageResize||b.fn.dataTable.defaults.pageResize)&&new e(a,c.oInit.pageResizeManualDelta))})})(jQuery); +(function(b){var e=function(a,c){var d=a.table();this.s={dt:a,host:b(d.container()).parent(),header:b(d.header()),footer:b(d.footer()),body:b(d.body()),container:b(d.container()),table:b(d.node()),delta:c};a=this.s.host;"static"===a.css("position")&&a.css("position","relative");this._attach();this._size()};e.prototype={_size:function(){var a=this.s,c=a.dt,d=c.table(),k=b(a.table).offset().top,g=b("tr",a.body),g=g.eq(1").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");c[0].onload=function(){var b=this.contentDocument.body,c=b.offsetHeight; +this.contentDocument.defaultView.onresize=function(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};b.fn.dataTable.PageResize=e;b.fn.DataTable.PageResize=e;b(document).on("init.dt",function(a,c){"dt"===a.namespace&&(a=new b.fn.dataTable.Api(c),(b(a.table().node()).hasClass("pageResize")||c.oInit.pageResize||b.fn.dataTable.defaults.pageResize)&&new e(a,c.oInit.pageResizeManualDelta))})})(jQuery); From 5695ffe40c238bf3f73074fa57e585b4b0fc3f3a Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 15 May 2018 09:48:26 +0100 Subject: [PATCH 10/46] Features: UMD for pageResize and scrollResize --- features/pageResize/dataTables.pageResize.js | 30 ++++++++++++++++-- .../pageResize/dataTables.pageResize.min.js | 7 +++-- features/pageResize/index.html | 6 ++-- features/pageResize/scrolling.html | 6 ++-- .../scrollResize/dataTables.scrollResize.js | 31 +++++++++++++++++-- .../dataTables.scrollResize.min.js | 7 +++-- .../searchPane/dataTables.searchPane.min.js | 6 ++-- 7 files changed, 73 insertions(+), 20 deletions(-) diff --git a/features/pageResize/dataTables.pageResize.js b/features/pageResize/dataTables.pageResize.js index f5a9496..a63ee24 100644 --- a/features/pageResize/dataTables.pageResize.js +++ b/features/pageResize/dataTables.pageResize.js @@ -34,8 +34,34 @@ * For more detailed information please see: * http://datatables.net/blog/2015-04-10 */ +(function( factory ){ + if ( typeof define === 'function' && define.amd ) { + // AMD + define( ['jquery', 'datatables.net'], function ( $ ) { + return factory( $, window, document ); + } ); + } + else if ( typeof exports === 'object' ) { + // CommonJS + module.exports = function (root, $) { + if ( ! root ) { + root = window; + } + + if ( ! $ || ! $.fn.dataTable ) { + $ = require('datatables.net')(root, $).$; + } + + return factory( $, root, root.document ); + }; + } + else { + // Browser + factory( jQuery, window, document ); + } +}(function( $, window, document, undefined ) { +'use strict'; -(function($){ var PageResize = function ( dt, pageResizeManualDelta ) { @@ -160,5 +186,5 @@ $(document).on( 'init.dt', function ( e, settings ) { } } ); -}(jQuery)); +})); diff --git a/features/pageResize/dataTables.pageResize.min.js b/features/pageResize/dataTables.pageResize.min.js index ed0ef5d..754d86e 100644 --- a/features/pageResize/dataTables.pageResize.min.js +++ b/features/pageResize/dataTables.pageResize.min.js @@ -25,6 +25,7 @@ PageResize for DataTables v1.0.0 2015 SpryMedia Ltd - datatables.net/license */ -(function(b){var e=function(a,c){var d=a.table();this.s={dt:a,host:b(d.container()).parent(),header:b(d.header()),footer:b(d.footer()),body:b(d.body()),container:b(d.container()),table:b(d.node()),delta:c};a=this.s.host;"static"===a.css("position")&&a.css("position","relative");this._attach();this._size()};e.prototype={_size:function(){var a=this.s,c=a.dt,d=c.table(),k=b(a.table).offset().top,g=b("tr",a.body),g=g.eq(1").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");c[0].onload=function(){var b=this.contentDocument.body,c=b.offsetHeight; -this.contentDocument.defaultView.onresize=function(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};b.fn.dataTable.PageResize=e;b.fn.DataTable.PageResize=e;b(document).on("init.dt",function(a,c){"dt"===a.namespace&&(a=new b.fn.dataTable.Api(c),(b(a.table().node()).hasClass("pageResize")||c.oInit.pageResize||b.fn.dataTable.defaults.pageResize)&&new e(a,c.oInit.pageResizeManualDelta))})})(jQuery); +(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(d){return b(d,window,document)}):"object"===typeof exports?module.exports=function(d,c){d||(d=window);c&&c.fn.dataTable||(c=require("datatables.net")(d,c).$);return b(c,d,d.document)}:b(jQuery,window,document)})(function(b,d,c,l){var f=function(a,h){var e=a.table();this.s={dt:a,host:b(e.container()).parent(),header:b(e.header()),footer:b(e.footer()),body:b(e.body()),container:b(e.container()),table:b(e.node()), +delta:h};a=this.s.host;"static"===a.css("position")&&a.css("position","relative");this._attach();this._size()};f.prototype={_size:function(){var a=this.s,h=a.dt,e=h.table(),d=b(a.table).offset().top,c=b("tr",a.body),c=c.eq(1").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");c[0].onload=function(){var b=this.contentDocument.body,c=b.offsetHeight;this.contentDocument.defaultView.onresize=function(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};b.fn.dataTable.PageResize= +f;b.fn.DataTable.PageResize=f;b(c).on("init.dt",function(a,c){"dt"===a.namespace&&(a=new b.fn.dataTable.Api(c),(b(a.table().node()).hasClass("pageResize")||c.oInit.pageResize||b.fn.dataTable.defaults.pageResize)&&new f(a,c.oInit.pageResizeManualDelta))})}); diff --git a/features/pageResize/index.html b/features/pageResize/index.html index d1cadbe..83ab2ff 100644 --- a/features/pageResize/index.html +++ b/features/pageResize/index.html @@ -5,7 +5,7 @@ DataTables page resize example - + - - + + - + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamePositionOfficeAgeStart dateSalary
NamePositionOfficeAgeStart dateSalary
Tiger NixonSystem ArchitectEdinburgh612011/04/25$320,800
Garrett WintersAccountantTokyo632011/07/25$170,750
Ashton CoxJunior Technical AuthorSan Francisco662009/01/12$86,000
Cedric KellySenior Javascript DeveloperEdinburgh222012/03/29$433,060
Airi SatouAccountantTokyo332008/11/28$162,700
Brielle WilliamsonIntegration SpecialistNew York612012/12/02$372,000
Herrod ChandlerSales AssistantSan Francisco592012/08/06$137,500
Rhona DavidsonIntegration SpecialistTokyo552010/10/14$327,900
Colleen HurstJavascript DeveloperSan Francisco392009/09/15$205,500
Sonya FrostSoftware EngineerEdinburgh232008/12/13$103,600
Jena GainesOffice ManagerLondon302008/12/19$90,560
Quinn FlynnSupport LeadEdinburgh222013/03/03$342,000
Charde MarshallRegional DirectorSan Francisco362008/10/16$470,600
Haley KennedySenior Marketing DesignerLondon432012/12/18$313,500
Tatyana FitzpatrickRegional DirectorLondon192010/03/17$385,750
Michael SilvaMarketing DesignerLondon662012/11/27$198,500
Paul ByrdChief Financial Officer (CFO)New York642010/06/09$725,000
Gloria LittleSystems AdministratorNew York592009/04/10$237,500
Bradley GreerSoftware EngineerLondon412012/10/13$132,000
Dai RiosPersonnel LeadEdinburgh352012/09/26$217,500
Jenette CaldwellDevelopment LeadNew York302011/09/03$345,000
Yuri BerryChief Marketing Officer (CMO)New York402009/06/25$675,000
Caesar VancePre-Sales SupportNew York212011/12/12$106,450
Doris WilderSales AssistantSidney232010/09/20$85,600
Angelica RamosChief Executive Officer (CEO)London472009/10/09$1,200,000
Gavin JoyceDeveloperEdinburgh422010/12/22$92,575
Jennifer ChangRegional DirectorSingapore282010/11/14$357,650
Brenden WagnerSoftware EngineerSan Francisco282011/06/07$206,850
Fiona GreenChief Operating Officer (COO)San Francisco482010/03/11$850,000
Shou ItouRegional MarketingTokyo202011/08/14$163,000
Michelle HouseIntegration SpecialistSidney372011/06/02$95,400
Suki BurksDeveloperLondon532009/10/22$114,500
Prescott BartlettTechnical AuthorLondon272011/05/07$145,000
Gavin CortezTeam LeaderSan Francisco222008/10/26$235,500
Martena MccrayPost-Sales supportEdinburgh462011/03/09$324,050
Unity ButlerMarketing DesignerSan Francisco472009/12/09$85,675
Howard HatfieldOffice ManagerSan Francisco512008/12/16$164,500
Hope FuentesSecretarySan Francisco412010/02/12$109,850
Vivian HarrellFinancial ControllerSan Francisco622009/02/14$452,500
Timothy MooneyOffice ManagerLondon372008/12/11$136,200
Jackson BradshawDirectorNew York652008/09/26$645,750
Olivia LiangSupport EngineerSingapore642011/02/03$234,500
Bruno NashSoftware EngineerLondon382011/05/03$163,500
Sakura YamamotoSupport EngineerTokyo372009/08/19$139,575
Thor WaltonDeveloperNew York612013/08/11$98,540
Finn CamachoSupport EngineerSan Francisco472009/07/07$87,500
Serge BaldwinData CoordinatorSingapore642012/04/09$138,575
Zenaida FrankSoftware EngineerNew York632010/01/04$125,250
Zorita SerranoSoftware EngineerSan Francisco562012/06/01$115,000
Jennifer AcostaJunior Javascript DeveloperEdinburgh432013/02/01$75,650
Cara StevensSales AssistantNew York462011/12/06$145,600
Hermione ButlerRegional DirectorLondon472011/03/21$356,250
Lael GreerSystems AdministratorLondon212009/02/27$103,500
Jonas AlexanderDeveloperSan Francisco302010/07/14$86,500
Shad DeckerRegional DirectorEdinburgh512008/11/13$183,000
Michael BruceJavascript DeveloperSingapore292011/06/27$183,000
Donna SniderCustomer SupportNew York272011/01/25$112,000
+ +
+ + \ No newline at end of file From e2db9da4c31ca76f973759e18ca7143f5741e8c0 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 22 Aug 2018 10:41:06 +0100 Subject: [PATCH 42/46] Dev: Build for RowFill --- make.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make.sh b/make.sh index f9b0060..d70df9c 100755 --- a/make.sh +++ b/make.sh @@ -32,6 +32,8 @@ css_compress $DT_SRC/extensions/Plugins/features/searchFade/dataTables.searchFad js_compress $DT_SRC/extensions/Plugins/features/slidingChild/dataTables.slidingChild.js +js_compress $DT_SRC/extensions/Plugins/features/rowFill/dataTables.rowFill.js + # Only copying the integration files rsync -r integration $OUT_DIR From b21102e105906efb54a4a7af6c6bc118329cfe13 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Mon, 27 Aug 2018 12:01:02 +0100 Subject: [PATCH 43/46] New: SearchPane now has a `column().paneOptions()` method that can be used to give it the options that should be displayed in the list, rather than just using the data available in the table. This is useful for server-side processing and more complex data sets. New: SearchPane can have a `columns.searchPane.match` option set for each individual column allowing finer grain control over what gets matched. Currently only full string matching and sub-string matching any where in the original data is supported. New: SearchPane example showing these two features - customOptions.html --- features/searchPane/customOptions.html | 537 ++++++++++++++++++ features/searchPane/dataTables.searchPane.js | 76 ++- .../searchPane/dataTables.searchPane.min.js | 30 +- 3 files changed, 615 insertions(+), 28 deletions(-) create mode 100644 features/searchPane/customOptions.html diff --git a/features/searchPane/customOptions.html b/features/searchPane/customOptions.html new file mode 100644 index 0000000..22c58d5 --- /dev/null +++ b/features/searchPane/customOptions.html @@ -0,0 +1,537 @@ + + + + + + DataTables search pane example + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamePositionOfficeAgeStart dateSalary
NamePositionOfficeAgeStart dateSalary
Tiger NixonSystem ArchitectEdinburgh612011/04/25$320,800
Garrett WintersAccountantTokyo632011/07/25$170,750
Ashton CoxJunior Technical AuthorSan Francisco662009/01/12$86,000
Cedric KellySenior Javascript DeveloperEdinburgh222012/03/29$433,060
Airi SatouAccountantTokyo332008/11/28$162,700
Brielle WilliamsonIntegration SpecialistNew York612012/12/02$372,000
Herrod ChandlerSales AssistantSan Francisco592012/08/06$137,500
Rhona DavidsonIntegration SpecialistTokyo552010/10/14$327,900
Colleen HurstJavascript DeveloperSan Francisco392009/09/15$205,500
Sonya FrostSoftware EngineerEdinburgh232008/12/13$103,600
Jena GainesOffice ManagerLondon302008/12/19$90,560
Quinn FlynnSupport LeadEdinburgh222013/03/03$342,000
Charde MarshallRegional DirectorSan Francisco362008/10/16$470,600
Haley KennedySenior Marketing DesignerLondon432012/12/18$313,500
Tatyana FitzpatrickRegional DirectorLondon192010/03/17$385,750
Michael SilvaMarketing DesignerLondon662012/11/27$198,500
Paul ByrdChief Financial Officer (CFO)New York642010/06/09$725,000
Gloria LittleSystems AdministratorNew York592009/04/10$237,500
Bradley GreerSoftware EngineerLondon412012/10/13$132,000
Dai RiosPersonnel LeadEdinburgh352012/09/26$217,500
Jenette CaldwellDevelopment LeadNew York302011/09/03$345,000
Yuri BerryChief Marketing Officer (CMO)New York402009/06/25$675,000
Caesar VancePre-Sales SupportNew York212011/12/12$106,450
Doris WilderSales AssistantSidney232010/09/20$85,600
Angelica RamosChief Executive Officer (CEO)London472009/10/09$1,200,000
Gavin JoyceDeveloperEdinburgh422010/12/22$92,575
Jennifer ChangRegional DirectorSingapore282010/11/14$357,650
Brenden WagnerSoftware EngineerSan Francisco282011/06/07$206,850
Fiona GreenChief Operating Officer (COO)San Francisco482010/03/11$850,000
Shou ItouRegional MarketingTokyo202011/08/14$163,000
Michelle HouseIntegration SpecialistSidney372011/06/02$95,400
Suki BurksDeveloperLondon532009/10/22$114,500
Prescott BartlettTechnical AuthorLondon272011/05/07$145,000
Gavin CortezTeam LeaderSan Francisco222008/10/26$235,500
Martena MccrayPost-Sales supportEdinburgh462011/03/09$324,050
Unity ButlerMarketing DesignerSan Francisco472009/12/09$85,675
Howard HatfieldOffice ManagerSan Francisco512008/12/16$164,500
Hope FuentesSecretarySan Francisco412010/02/12$109,850
Vivian HarrellFinancial ControllerSan Francisco622009/02/14$452,500
Timothy MooneyOffice ManagerLondon372008/12/11$136,200
Jackson BradshawDirectorNew York652008/09/26$645,750
Olivia LiangSupport EngineerSingapore642011/02/03$234,500
Bruno NashSoftware EngineerLondon382011/05/03$163,500
Sakura YamamotoSupport EngineerTokyo372009/08/19$139,575
Thor WaltonDeveloperNew York612013/08/11$98,540
Finn CamachoSupport EngineerSan Francisco472009/07/07$87,500
Serge BaldwinData CoordinatorSingapore642012/04/09$138,575
Zenaida FrankSoftware EngineerNew York632010/01/04$125,250
Zorita SerranoSoftware EngineerSan Francisco562012/06/01$115,000
Jennifer AcostaJunior Javascript DeveloperEdinburgh432013/02/01$75,650
Cara StevensSales AssistantNew York462011/12/06$145,600
Hermione ButlerRegional DirectorLondon472011/03/21$356,250
Lael GreerSystems AdministratorLondon212009/02/27$103,500
Jonas AlexanderDeveloperSan Francisco302010/07/14$86,500
Shad DeckerRegional DirectorEdinburgh512008/11/13$183,000
Michael BruceJavascript DeveloperSingapore292011/06/27$183,000
Donna SniderCustomer SupportNew York272011/01/25$112,000
+ +
+ + \ No newline at end of file diff --git a/features/searchPane/dataTables.searchPane.js b/features/searchPane/dataTables.searchPane.js index 31fffd7..125c69d 100644 --- a/features/searchPane/dataTables.searchPane.js +++ b/features/searchPane/dataTables.searchPane.js @@ -95,8 +95,7 @@ _attach: function() { var container = this.c.container; - var host = - typeof container === 'function' ? container(this.s.dt) : container; + var host = typeof container === 'function' ? container(this.s.dt) : container; if (this.c.insert === 'prepend') { $(this.dom.container).prependTo(host); @@ -108,7 +107,9 @@ _binData: function(data) { var out = {}; - data.each(function(d) { + for (var i = 0, ien = data.length; i < ien; i++) { + var d = data[i]; + if (!d) { return; } @@ -118,7 +119,7 @@ } else { out[d]++; } - }); + } return out; }, @@ -142,8 +143,10 @@ var paneClasses = classes.pane; var table = this.s.dt; var column = table.column(idx); + var colOpts = this._getOptions(idx); var list = $('
    '); - var bins = this._binData(column.data().flatten()); + var binData = colOpts.options ? new DataTable.Api(null, colOpts.options) : column.data(); + var bins = this._binData(binData.flatten()); // Don't show the pane if there isn't enough variance in the data if (this._variance(bins) < this.c.threshold) { @@ -155,8 +158,7 @@ var search = column.search(); search = search ? search.substr(1, search.length - 2).split('|') : []; - var data = column - .data() + var data = binData .unique() .sort() .toArray(); @@ -164,9 +166,7 @@ for (var i = 0, ien = data.length; i < ien; i++) { if (data[i]) { var li = $('
  • ') - .html( - '' + data[i] + '' - ) + .html('' + data[i] + '') .data('filter', data[i]) .append( $('') @@ -175,9 +175,7 @@ ); if (search.length) { - var escaped = data[i].replace - ? $.fn.dataTable.util.escapeRegex(data[i]) - : data[i]; + var escaped = data[i].replace ? $.fn.dataTable.util.escapeRegex(data[i]) : data[i]; if ($.inArray(escaped, search) !== -1) { li.addClass(itemClasses.selected); @@ -192,11 +190,7 @@ .data('column', idx) .addClass(paneClasses.container) .addClass(search.length ? paneClasses.active : '') - .append( - $('').addClass( - this.classes.clear - ) - ) + .append($('').addClass(this.classes.clear)) .append( $('
    ') .addClass(paneClasses.title) @@ -222,12 +216,20 @@ } }, + _getOptions: function ( colIdx ) { + var table = this.s.dt; + + return table.settings()[0].aoColumns[colIdx].searchPane || {}; + }, + _toggle: function(li) { var classes = this.classes; var itemSelected = classes.item.selected; var table = this.s.dt; var li = $(li); var pane = li.closest('div.' + classes.pane.container); + var columnIdx = pane.data('column'); + var options = this._getOptions(columnIdx); li.toggleClass(itemSelected, !li.hasClass(itemSelected)); @@ -236,13 +238,32 @@ if (filters.length === 0) { pane.removeClass(classes.pane.active); table - .column(pane.data('column')) + .column(columnIdx) .search('') .draw(); + } else if (options.match === 'any') { + // Allow sub-word matching + pane.addClass(classes.pane.active); + table + .column(columnIdx) + .search( + '(' + + $.map(filters, function(filter) { + var d = $(filter) + .data('filter') + .toString(); + return $.fn.dataTable.util.escapeRegex(d); + }).join('|') + + ')', + true, + false + ) + .draw(); } else { + // Only search on the full phrase pane.addClass(classes.pane.active); table - .column(pane.data('column')) + .column(columnIdx) .search( '^(' + $.map(filters, function(filter) { @@ -318,6 +339,21 @@ }); }); + DataTable.Api.register('column().paneOptions()', function(options) { + return this.iterator('column', function(ctx, idx) { + var col = ctx.aoColumns[idx]; + + if (ctx.searchPane) { + if (!col.searchPane) { + col.searchPane = {}; + } + + col.searchPane.options = options; + ctx.searchPane.rebuild(); + } + }); + }); + $(document).on('init.dt', function(e, settings, json) { if (e.namespace !== 'dt') { return; diff --git a/features/searchPane/dataTables.searchPane.min.js b/features/searchPane/dataTables.searchPane.min.js index f84a6fe..e63d60b 100644 --- a/features/searchPane/dataTables.searchPane.min.js +++ b/features/searchPane/dataTables.searchPane.min.js @@ -1,12 +1,26 @@ /*! + Copyright 2017 SpryMedia Ltd. + + This source file is free software, available under the following license: + MIT license - http://datatables.net/license/mit + + 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. + + For details please refer to: http://www.datatables.net SearchPane 0.0.1 2017 SpryMedia Ltd - datatables.net/license */ -(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(d){return b(d,window,document)}):"object"===typeof exports?module.exports=function(d,h){d||(d=window);if(!h||!h.fn.dataTable)h=require("datatables.net")(d,h).$;return b(h,d,d.document)}:b(jQuery,window,document)})(function(b,d,h,k){function f(a,c){var g=this,e=new j.Api(a);this.classes=b.extend(!0,{},f.classes);this.dom={container:b("
    ").addClass(this.classes.container)};this.c=b.extend(!0,{},f.defaults, -c);this.s={dt:e};e.settings()[0].searchPane=this;e.columns(this.c.columns).eq(0).each(function(a){g._pane(a)});b(this.dom.container).on("click","li",function(){g._toggle(this)}).on("click","button."+this.classes.clear,function(){g._clear(b(this).closest("div."+g.classes.pane.container))});this._attach()}var j=b.fn.dataTable;b.extend(f.prototype,{rebuild:function(){var a=this;this.s.dt.columns(this.c.columns).eq(0).each(function(c){a._pane(c)})},_attach:function(){var a=this.c.container,a="function"=== -typeof a?a(this.s.dt):a;"prepend"===this.c.insert?b(this.dom.container).prependTo(a):b(this.dom.container).appendTo(a)},_binData:function(a){var c={};a.each(function(a){a&&(c[a]?c[a]++:c[a]=1)});return c},_clear:function(a){var c=this.classes,b=c.item.selected;a.find("li."+b).removeClass(b);a.removeClass(c.pane.active);this.s.dt.column(a.data("column")).search("").draw()},_pane:function(a){var c=this.classes,g=c.item,c=c.pane,e=this.s.dt.column(a),l=b("
      "),m=this._binData(e.data().flatten()); -if(!(this._variance(m)").html(''+d[i]+"").data("filter",d[i]).append(b("").addClass(g.count).html(m[d[i]]));if(f.length){var k=d[i].replace?b.fn.dataTable.util.escapeRegex(d[i]):d[i];-1!==b.inArray(k,f)&&j.addClass(g.selected)}l.append(j)}g=b("
      ").data("column",a).addClass(c.container).addClass(f.length? -c.active:"").append(b('').addClass(this.classes.clear)).append(b("
      ").addClass(c.title).html(b(e.header()).text())).append(b("
      ").addClass(c.scroller).append(l));c=this.dom.container;e=c.children().map(function(){if(b(this).data("column")==a)return this});e.length?e.replaceWith(g):b(c).append(g)}},_toggle:function(a){var c=this.classes,g=c.item.selected,e=this.s.dt,a=b(a),d=a.closest("div."+c.pane.container);a.toggleClass(g,!a.hasClass(g));a=d.find("li."+ -g);0===a.length?(d.removeClass(c.pane.active),e.column(d.data("column")).search("").draw()):(d.addClass(c.pane.active),e.column(d.data("column")).search("^("+b.map(a,function(a){a=b(a).data("filter").toString();return b.fn.dataTable.util.escapeRegex(a)}).join("|")+")$",!0,!1).draw())},_variance:function(a){for(var a=b.map(a,function(a){return a}),c=a.length,g=0,e=0,d=c;e").addClass(this.classes.container)};this.c=a.extend(!0,{},d.defaults, +h);this.s={dt:b};b.settings()[0].searchPane=this;b.columns(this.c.columns).eq(0).each(function(a){e._pane(a)});a(this.dom.container).on("click","li",function(){e._toggle(this)}).on("click","button."+this.classes.clear,function(){e._clear(a(this).closest("div."+e.classes.pane.container))});this._attach()}var k=a.fn.dataTable;a.extend(d.prototype,{rebuild:function(){var a=this;this.s.dt.columns(this.c.columns).eq(0).each(function(b){a._pane(b)})},_attach:function(){var b=this.c.container,b="function"=== +typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(a){for(var b={},e=0,c=a.length;e"),d=l.options?new k.Api(null,l.options):c.data(),l=this._binData(d.flatten());if(!(this._variance(l)").html(''+d[g]+"").data("filter",d[g]).append(a("").addClass(e.count).html(l[d[g]]));if(m.length){var q=d[g].replace?a.fn.dataTable.util.escapeRegex(d[g]):d[g];-1!==a.inArray(q,m)&&n.addClass(e.selected)}f.append(n)}e= +a("
      ").data("column",b).addClass(h.container).addClass(m.length?h.active:"").append(a('').addClass(this.classes.clear)).append(a("
      ").addClass(h.title).html(a(c.header()).text())).append(a("
      ").addClass(h.scroller).append(f));h=this.dom.container;c=h.children().map(function(){if(a(this).data("column")==b)return this});c.length?c.replaceWith(e):a(h).append(e)}},_getOptions:function(a){return this.s.dt.settings()[0].aoColumns[a].searchPane||{}},_toggle:function(b){var d= +this.classes,e=d.item.selected,c=this.s.dt;b=a(b);var f=b.closest("div."+d.pane.container),g=f.data("column"),k=this._getOptions(g);b.toggleClass(e,!b.hasClass(e));b=f.find("li."+e);0===b.length?(f.removeClass(d.pane.active),c.column(g).search("").draw()):"any"===k.match?(f.addClass(d.pane.active),c.column(g).search("("+a.map(b,function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")",!0,!1).draw()):(f.addClass(d.pane.active),c.column(g).search("^("+a.map(b, +function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")$",!0,!1).draw())},_variance:function(b){b=a.map(b,function(a,b){return a});for(var d=b.length,e=0,c=0,f=d;c Date: Mon, 27 Aug 2018 12:45:49 +0100 Subject: [PATCH 44/46] Fix search pane issues with ajax loading data and daft error for binning --- features/searchPane/dataTables.searchPane.js | 12 ++++++------ features/searchPane/dataTables.searchPane.min.js | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/features/searchPane/dataTables.searchPane.js b/features/searchPane/dataTables.searchPane.js index 125c69d..66af76c 100644 --- a/features/searchPane/dataTables.searchPane.js +++ b/features/searchPane/dataTables.searchPane.js @@ -111,7 +111,7 @@ var d = data[i]; if (!d) { - return; + continue; } if (!out[d]) { @@ -343,12 +343,12 @@ return this.iterator('column', function(ctx, idx) { var col = ctx.aoColumns[idx]; - if (ctx.searchPane) { - if (!col.searchPane) { - col.searchPane = {}; - } + if (!col.searchPane) { + col.searchPane = {}; + } + col.searchPane.options = options; - col.searchPane.options = options; + if (ctx.searchPane) { ctx.searchPane.rebuild(); } }); diff --git a/features/searchPane/dataTables.searchPane.min.js b/features/searchPane/dataTables.searchPane.min.js index e63d60b..82f0d2a 100644 --- a/features/searchPane/dataTables.searchPane.min.js +++ b/features/searchPane/dataTables.searchPane.min.js @@ -17,10 +17,10 @@ $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"un $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3"); (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(f){return a(f,window,document)}):"object"===typeof exports?module.exports=function(f,c){f||(f=window);c&&c.fn.dataTable||(c=require("datatables.net")(f,c).$);return a(c,f,f.document)}:a(jQuery,window,document)})(function(a,f,c,g){function d(b,h){var e=this;b=new k.Api(b);this.classes=a.extend(!0,{},d.classes);this.dom={container:a("
      ").addClass(this.classes.container)};this.c=a.extend(!0,{},d.defaults, h);this.s={dt:b};b.settings()[0].searchPane=this;b.columns(this.c.columns).eq(0).each(function(a){e._pane(a)});a(this.dom.container).on("click","li",function(){e._toggle(this)}).on("click","button."+this.classes.clear,function(){e._clear(a(this).closest("div."+e.classes.pane.container))});this._attach()}var k=a.fn.dataTable;a.extend(d.prototype,{rebuild:function(){var a=this;this.s.dt.columns(this.c.columns).eq(0).each(function(b){a._pane(b)})},_attach:function(){var b=this.c.container,b="function"=== -typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(a){for(var b={},e=0,c=a.length;e"),d=l.options?new k.Api(null,l.options):c.data(),l=this._binData(d.flatten());if(!(this._variance(l)").html(''+d[g]+"").data("filter",d[g]).append(a("").addClass(e.count).html(l[d[g]]));if(m.length){var q=d[g].replace?a.fn.dataTable.util.escapeRegex(d[g]):d[g];-1!==a.inArray(q,m)&&n.addClass(e.selected)}f.append(n)}e= +typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(a){for(var b={},e=0,c=a.length;e"), +d=l.options?new k.Api(null,l.options):c.data(),l=this._binData(d.flatten());if(!(this._variance(l)").html(''+d[g]+"").data("filter",d[g]).append(a("").addClass(e.count).html(l[d[g]]));if(m.length){var q=d[g].replace?a.fn.dataTable.util.escapeRegex(d[g]):d[g];-1!==a.inArray(q,m)&&n.addClass(e.selected)}f.append(n)}e= a("
      ").data("column",b).addClass(h.container).addClass(m.length?h.active:"").append(a('').addClass(this.classes.clear)).append(a("
      ").addClass(h.title).html(a(c.header()).text())).append(a("
      ").addClass(h.scroller).append(f));h=this.dom.container;c=h.children().map(function(){if(a(this).data("column")==b)return this});c.length?c.replaceWith(e):a(h).append(e)}},_getOptions:function(a){return this.s.dt.settings()[0].aoColumns[a].searchPane||{}},_toggle:function(b){var d= this.classes,e=d.item.selected,c=this.s.dt;b=a(b);var f=b.closest("div."+d.pane.container),g=f.data("column"),k=this._getOptions(g);b.toggleClass(e,!b.hasClass(e));b=f.find("li."+e);0===b.length?(f.removeClass(d.pane.active),c.column(g).search("").draw()):"any"===k.match?(f.addClass(d.pane.active),c.column(g).search("("+a.map(b,function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")",!0,!1).draw()):(f.addClass(d.pane.active),c.column(g).search("^("+a.map(b, function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")$",!0,!1).draw())},_variance:function(b){b=a.map(b,function(a,b){return a});for(var d=b.length,e=0,c=0,f=d;c Date: Tue, 18 Sep 2018 09:10:22 +0100 Subject: [PATCH 45/46] Fix: i18n German - Incorrect translation for "copySuccess" - Thank you Sepp9753 - https://datatables.net/forums/discussion/52087/german-json-copysuccess-text#latest --- i18n/German.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/German.lang b/i18n/German.lang index 6d5ab55..b7a429b 100644 --- a/i18n/German.lang +++ b/i18n/German.lang @@ -43,8 +43,8 @@ "copyTitle": "In Zwischenablage kopieren", "copyKeys": "Taste ctrl oder \u2318 + C um Tabelle
      in Zwischenspeicher zu kopieren.

      Um abzubrechen die Nachricht anklicken oder Escape drücken.", "copySuccess": { - "_": "%d Spalten kopiert", - "1": "1 Spalte kopiert" + "_": "%d Zeilen kopiert", + "1": "1 Zeile kopiert" } } } From 1e09b225a56704d31bb8d8f4082ddcdbcb12c80d Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 20 Sep 2018 11:54:54 +0100 Subject: [PATCH 46/46] Renderer: Improve doc comments - DD-621 --- dataRender/datetime.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dataRender/datetime.js b/dataRender/datetime.js index d56a195..9c11a20 100644 --- a/dataRender/datetime.js +++ b/dataRender/datetime.js @@ -14,9 +14,9 @@ * * It accepts one, two or three parameters: * - * $.fn.dataTable.render.moment( to ); - * $.fn.dataTable.render.moment( from, to ); - * $.fn.dataTable.render.moment( from, to, locale ); + * * `$.fn.dataTable.render.moment( to );` + * * `$.fn.dataTable.render.moment( from, to );` + * * `$.fn.dataTable.render.moment( from, to, locale );` * * Where: * @@ -29,7 +29,7 @@ * @name datetime * @summary Convert date / time source data into one suitable for display * @author [Allan Jardine](http://datatables.net) - * @requires DataTables 1.10+ + * @requires DataTables 1.10+, Moment.js 1.7+ * * @example * // Convert ISO8601 dates into a simple human readable format