[Pkg-javascript-commits] [datatables.js] 01/01: New upstream version 1.10.15+dfsg

Sascha Steinbiss satta at debian.org
Fri Apr 21 14:59:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

satta pushed a commit to branch upstream
in repository datatables.js.

commit ee53473bc1c42888909cfe42d63caa5bfa65647d
Author: Sascha Steinbiss <sascha.steinbiss at dcso.de>
Date:   Fri Apr 21 16:50:46 2017 +0200

    New upstream version 1.10.15+dfsg
---
 build/examples.php                        | 26 +++++++----
 build/make.sh                             | 27 +++++++++--
 css/dataTables.bootstrap.scss             | 10 ++--
 css/dataTables.bootstrap4.scss            |  1 +
 css/dataTables.foundation.scss            |  4 +-
 css/jquery.dataTables.scss                | 36 ++++++++-------
 docs/api/filter().xml                     |  4 +-
 docs/api/slice().xml                      | 34 ++++++++++++++
 docs/api/state.save().xml                 |  2 +-
 docs/option/columns.orderData.xml         |  4 +-
 docs/option/language.infoEmpty.xml        |  2 +-
 js/DataTables.js                          | 10 ++--
 js/api/api.base.js                        |  5 ++
 js/core/core.compat.js                    |  2 +-
 js/core/core.internal.js                  | 33 +++++++++++++
 js/core/core.state.js                     |  8 ++--
 js/integration/dataTables.bootstrap4.js   | 14 +++---
 js/integration/dataTables.semanticui.js   |  4 +-
 package.json                              |  1 +
 test/api/rows/rows().js                   | 11 +++--
 test/api/util/slice.js                    | 47 +++++++++++++++++++
 test/api/util/unique.js                   | 43 +++++++++++++++++
 test/karma.conf.js                        |  7 +++
 test/options/columns/columns_orderData.js | 77 ++++++++++++++++++++-----------
 24 files changed, 323 insertions(+), 89 deletions(-)

diff --git a/build/examples.php b/build/examples.php
index 76d4930..cbddb37 100644
--- a/build/examples.php
+++ b/build/examples.php
@@ -182,6 +182,16 @@ DT_Example::$components['responsive'] = [
 	]
 ];
 
+DT_Example::$components['rowgroup'] = [
+	'path' => path_simplify( $dir_media.'/../extensions/RowGroup' ),
+	'release' => $versions['RowGroup']['release']['version'],
+	'filename' => 'rowGroup',
+	'framework' => [
+		'css' => true,
+		'js' => false
+	]
+];
+
 DT_Example::$components['rowreorder'] = [
 	'path' => path_simplify( $dir_media.'/../extensions/RowReorder' ),
 	'release' => $versions['RowReorder']['release']['version'],
@@ -245,8 +255,8 @@ DT_Example::$lookup_libraries['js' ]['jqueryui']     = '//code.jquery.com/ui/1.1
 DT_Example::$lookup_libraries['css']['jqueryui']     = '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css';
 DT_Example::$lookup_libraries['js' ]['bootstrap']    = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js';
 DT_Example::$lookup_libraries['css']['bootstrap']    = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css';
-DT_Example::$lookup_libraries['js']['bootstrap4']    = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/js/bootstrap.min.js';
-DT_Example::$lookup_libraries['css' ]['bootstrap4']  = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.css';
+DT_Example::$lookup_libraries['js']['bootstrap4']    = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js';
+DT_Example::$lookup_libraries['css' ]['bootstrap4']  = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.css';
 DT_Example::$lookup_libraries['js' ]['semanticui']   = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js';
 DT_Example::$lookup_libraries['css']['semanticui']   = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.css';
 DT_Example::$lookup_libraries['js' ]['material']     = '//cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.1.0/material.min.js';
@@ -257,11 +267,11 @@ DT_Example::$lookup_libraries['js' ]['foundation']   = '//cdnjs.cloudflare.com/a
 DT_Example::$lookup_libraries['css']['foundation']   = '//cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.min.css';
 DT_Example::$lookup_libraries['js' ]['uikit']        = '//cdnjs.cloudflare.com/ajax/libs/uikit/2.24.3/js/uikit.min.js';
 DT_Example::$lookup_libraries['css']['uikit']        = '//cdnjs.cloudflare.com/ajax/libs/uikit/2.24.3/css/uikit.min.css';
-DT_Example::$lookup_libraries['css']['font-awesome'] = '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css';
-DT_Example::$lookup_libraries['js']['jszip']         = '//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js';
-DT_Example::$lookup_libraries['js']['pdfmake']       = '//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js';
-DT_Example::$lookup_libraries['js']['vfsfonts']      = '//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js';
-DT_Example::$lookup_libraries['js']['moment']        = '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js';
+DT_Example::$lookup_libraries['css']['font-awesome'] = '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css';
+DT_Example::$lookup_libraries['js']['jszip']         = '//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js';
+DT_Example::$lookup_libraries['js']['pdfmake']       = '//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/pdfmake.min.js';
+DT_Example::$lookup_libraries['js']['vfsfonts']      = '//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/vfs_fonts.js';
+DT_Example::$lookup_libraries['js']['moment']        = '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js';
 
 function multiple ( $value, $fn )
 {
@@ -658,7 +668,7 @@ EOD;
 	// Oracle style
 	$str = <<<EOD
 --
--- DataTables Ajax and server-side processing database (SQL Server)
+-- DataTables Ajax and server-side processing database (Oracle)
 --
 BEGIN
 	EditorDelObject('datatables_demo', 'TABLE');
diff --git a/build/make.sh b/build/make.sh
index 3fcf1b2..8be0caf 100755
--- a/build/make.sh
+++ b/build/make.sh
@@ -2,6 +2,8 @@
 
 . include.sh
 
+export DT_BUILD=1
+
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 BASE_DIR="${SCRIPT_DIR}/.."
 BUILD_DIR="${BASE_DIR}/built"
@@ -275,14 +277,14 @@ function build_extension {
 
 	if [ ! -d ${BASE_DIR}/extensions/${EXTENSION} ]; then
 		echo_msg "Cloning $EXTENSION from GitHub" 
-		git clone https at github.com:DataTables/${EXTENSION}.git
+		git clone git at github.com:DataTables/${EXTENSION}.git
 	fi
 
 	if [ -e ${BASE_DIR}/extensions/${EXTENSION}/make.sh ]; then
 		# If there is a make file, then leave it to the extension to do its own
 		# build and copy files into place
 		echo_msg "Running $EXTENSION build script"
-		sh ${BASE_DIR}/extensions/${EXTENSION}/make.sh \
+		bash ${BASE_DIR}/extensions/${EXTENSION}/make.sh \
 			${BUILD_DIR}/DataTables/extensions/${EXTENSION} $DEBUG
 	else
 		# Otherwise, just copy the whole lot over
@@ -314,10 +316,11 @@ function usage {
 
       test     - Build the unit tests
 
+	  all [debug] - Build DataTables core and all extensions
+
       extension <ext> [debug] - Extension to build where <ext> is one of:
         - AutoFill
         - Buttons
-        - ColVis
         - ColReorder
         - FixedColumns
         - FixedHeader
@@ -326,7 +329,6 @@ function usage {
         - Responsive
         - Scroller
         - Select
-        - TableTools
 
     and the optional [debug] parameter can be used to disable JS and CSS
     compression for faster development build times."
@@ -357,6 +359,22 @@ case "$1" in
 		build_repo
 		;;
 
+	"all")
+		build_repo
+		build_extension AutoFill
+		build_extension Buttons
+		build_extension ColReorder
+		build_extension FixedColumns
+		build_extension FixedHeader
+		build_extension KeyTable
+		build_extension Responsive
+		build_extension Scroller
+		build_extension Select
+		if [ -d ../extensions/Editor ]; then
+			build_extension Editor
+		fi
+		;;
+
 	"examples")
 		build_examples
 		;;
@@ -393,6 +411,7 @@ case "$1" in
 esac
 
 
+unset DT_BUILD
 
 echo ""
 echo_section "Done"
diff --git a/css/dataTables.bootstrap.scss b/css/dataTables.bootstrap.scss
index 9d1f72c..fb47286 100644
--- a/css/dataTables.bootstrap.scss
+++ b/css/dataTables.bootstrap.scss
@@ -146,12 +146,12 @@ div.dataTables_scrollHead table.dataTable {
 }
 
 div.dataTables_scrollBody {
-	table {
+	> table {
 		border-top: none;
 		margin-top: 0 !important;
 		margin-bottom: 0 !important;
 
-		thead { // Hide sort icons
+		> thead { // Hide sort icons
 			.sorting:after,
 			.sorting_asc:after,
 			.sorting_desc:after {
@@ -159,14 +159,14 @@ div.dataTables_scrollBody {
 			}
 		}
 
-		tbody tr:first-child th,
-		tbody tr:first-child td {
+		> tbody > tr:first-child > th,
+		> tbody > tr:first-child > td {
 			border-top: none;
 		}
 	}
 }
 
-div.dataTables_scrollFoot table {
+div.dataTables_scrollFoot > table {
 	margin-top: 0 !important;
 	border-top: none;
 }
diff --git a/css/dataTables.bootstrap4.scss b/css/dataTables.bootstrap4.scss
index 141e728..e9e1ec7 100644
--- a/css/dataTables.bootstrap4.scss
+++ b/css/dataTables.bootstrap4.scss
@@ -72,6 +72,7 @@ div.dataTables_wrapper {
 		ul.pagination {
 			margin: 2px 0;
 			white-space: nowrap;
+			justify-content: flex-end;
 		}
 	}
 
diff --git a/css/dataTables.foundation.scss b/css/dataTables.foundation.scss
index 84aab99..5b025a3 100644
--- a/css/dataTables.foundation.scss
+++ b/css/dataTables.foundation.scss
@@ -95,7 +95,9 @@ table.dataTable thead {
 
 	.sorting,
 	.sorting_asc,
-	.sorting_desc {
+	.sorting_desc,
+	.sorting_asc_disabled,
+	.sorting_desc_disabled {
 		cursor: pointer;
 	}
 
diff --git a/css/jquery.dataTables.scss b/css/jquery.dataTables.scss
index 73f5f55..750adfc 100644
--- a/css/jquery.dataTables.scss
+++ b/css/jquery.dataTables.scss
@@ -104,7 +104,9 @@ table.dataTable {
 		thead {
 			.sorting,
 			.sorting_asc,
-			.sorting_desc {
+			.sorting_desc,
+			.sorting_asc_disabled,
+			.sorting_desc_disabled {
 				cursor: pointer;
 				*cursor: hand;
 			}
@@ -530,19 +532,21 @@ table.dataTable td {
 			*margin-top: -1px;
 			-webkit-overflow-scrolling: touch;
 
-			th, td {
-				// Setting v-align baseline can cause the headers to be visible
-				vertical-align: middle;
-			}
-
-			th > div.dataTables_sizing,
-			td > div.dataTables_sizing {
-				// Hide the element used to wrap the content in the header for
-				// the body scrolling table
-				height: 0;
-				overflow: hidden;
-				margin: 0 !important;
-				padding: 0 !important;
+			> table > thead > tr, > table > tbody > tr {
+				> th, > td {
+					// Setting v-align baseline can cause the headers to be visible
+					vertical-align: middle;
+				}
+
+				> th > div.dataTables_sizing,
+				> td > div.dataTables_sizing {
+					// Hide the element used to wrap the content in the header for
+					// the body scrolling table
+					height: 0;
+					overflow: hidden;
+					margin: 0 !important;
+					padding: 0 !important;
+				}
 			}
 		}
 	}
@@ -552,8 +556,8 @@ table.dataTable td {
 			border-bottom: $table-header-border;
 		}
 
-		div.dataTables_scrollHead table,
-		div.dataTables_scrollBody table {
+		div.dataTables_scrollHead > table,
+		div.dataTables_scrollBody > table {
 			border-bottom: none;
 		}
 	}
diff --git a/docs/api/filter().xml b/docs/api/filter().xml
index eb9574e..68d12c3 100644
--- a/docs/api/filter().xml
+++ b/docs/api/filter().xml
@@ -41,13 +41,13 @@ var filteredData = table
 
 ]]></example>
 
-	<example title="Filter data from multiple columns, to just the data that is greater than 20 through use of the `dt-api eq()` method"><![CDATA[
+	<example title="Filter data from multiple columns, getting the data points which are greater than 20 from the cells in both columns"><![CDATA[
 var table = $('#example').DataTable();
 
 var filteredData = table
 	.columns( [0, 1] )
 	.data()
-	.eq( 0 )
+	.flatten()
 	.filter( function ( value, index ) {
 		return value > 20 ? true : false;
 	} );
diff --git a/docs/api/slice().xml b/docs/api/slice().xml
new file mode 100644
index 0000000..2ac9db5
--- /dev/null
+++ b/docs/api/slice().xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dt-api group="utility">
+	<name>slice()</name>
+	<summary>Create an independent copy of the API instance.</summary>
+	<since>1.10.15</since>
+
+	<type type="function">
+		<signature>slice()</signature>
+		<description>Create an independent copy of the API instance.</description>
+		<returns type="DataTable.Api">API instance</returns>
+	</type>
+
+	<description>
+		The DataTables API object is "array like" and inherits many of the same characteristics as a Javascript array. The `-api slice()` method is one of these. It provides the ability to create an independent copy of the instance so it can be manipulated without affecting the original.
+
+		This method is a proxy for the Javascript `Array.prototype.slice` method and is provided as a utility method for the DataTables API. For more information about the original method, please refer to the [Mozilla MDN documentation for `slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice).
+	</description>
+
+	<example title="Modify a copy of an instance without affecting the original."><![CDATA[
+var table = $('#example').DataTable();
+
+var data = table
+	.column( 0 )
+	.data();
+
+var data2 = data.slice();
+
+data2.push( 'Fini' );
+
+// `data` is unaffected
+
+]]></example>
+
+</dt-api>
\ No newline at end of file
diff --git a/docs/api/state.save().xml b/docs/api/state.save().xml
index b9fa33c..f01f7d9 100644
--- a/docs/api/state.save().xml
+++ b/docs/api/state.save().xml
@@ -11,7 +11,7 @@
 	</type>
 
 	<description>
-		This method is primarily made available for plug-in authors who wish to be able to add information to the DataTables state saving object (through `dt-event stateSaveParams`) and want to be able to trigger a save save to save information specific to their plug-in.
+		This method is primarily made available for plug-in authors who wish to be able to add information to the DataTables state saving object (through `dt-event stateSaveParams`) and want to be able to trigger a state save to save information specific to their plug-in.
 
 		As an example, a column filter plug-in might trigger a state save when the input values for the filter are altered by the end user. This enables the author to reliably restore the state of their plug-in when the table is next initialised (`dt-api state.loaded()`).
 	</description>
diff --git a/docs/option/columns.orderData.xml b/docs/option/columns.orderData.xml
index eff8cf4..fccc03e 100644
--- a/docs/option/columns.orderData.xml
+++ b/docs/option/columns.orderData.xml
@@ -15,9 +15,9 @@
 	</default>
 
 	<description>
-		Allows a column's sorting to take multiple columns into account when doing a order.
+		Allows a column's sorting to take either the data from a different (often hidden) column as the data to sort, or data from multiple columns.
 
-		For example with first name / last name columns next to each other, it is intuitive that they would be linked together to multi-column sort.
+		A common example of this is a table which contains first and last name columns next to each other, it is intuitive that they would be linked together to multi-column sort. Another example, with a single column, is the case where the data shown to the end user is not directly sortable itself (a column with images in it), but there is some meta data than can be sorted (e.g. file name) - note that [orthogonal data](/manual/data/orthogonal) is an alternative method that can be used for this.
 	</description>
 
 	<example title="Using `orderData` to define multi-column sorting with `dt-init columnDefs`"><![CDATA[
diff --git a/docs/option/language.infoEmpty.xml b/docs/option/language.infoEmpty.xml
index 158a04c..90cb642 100644
--- a/docs/option/language.infoEmpty.xml
+++ b/docs/option/language.infoEmpty.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <dt-option group="i18n">
 	<name>language.infoEmpty</name>
-	<summary>Table summary information string used when the table is empty or records</summary>
+	<summary>Table summary information string used when the table is empty of records</summary>
 	<since>1.10</since>
 
 	<type type="string" />
diff --git a/js/DataTables.js b/js/DataTables.js
index 86b8f1b..5164237 100644
--- a/js/DataTables.js
+++ b/js/DataTables.js
@@ -1,15 +1,15 @@
-/*! DataTables 1.10.13
- * ©2008-2016 SpryMedia Ltd - datatables.net/license
+/*! DataTables 1.10.15
+ * ©2008-2017 SpryMedia Ltd - datatables.net/license
  */
 
 /**
  * @summary     DataTables
  * @description Paginate, search and order HTML tables
- * @version     1.10.13
+ * @version     1.10.15
  * @file        jquery.dataTables.js
  * @author      SpryMedia Ltd
  * @contact     www.datatables.net
- * @copyright   Copyright 2008-2016 SpryMedia Ltd.
+ * @copyright   Copyright 2008-2017 SpryMedia Ltd.
  *
  * This source file is free software, available under the following license:
  *   MIT license - http://datatables.net/license
@@ -169,7 +169,7 @@
 	 *  @type string
 	 *  @default Version number
 	 */
-	DataTable.version = "1.10.13";
+	DataTable.version = "1.10.15";
 
 	/**
 	 * Private data store, containing all of the settings objects that are
diff --git a/js/api/api.base.js b/js/api/api.base.js
index 65a9ed2..8f337ff 100644
--- a/js/api/api.base.js
+++ b/js/api/api.base.js
@@ -423,6 +423,11 @@ $.extend( _Api.prototype, {
 	shift:   __arrayProto.shift,
 
 
+	slice: function () {
+		return new _Api( this.context, this );
+	},
+
+
 	sort:    __arrayProto.sort, // ? name - order?
 
 
diff --git a/js/core/core.compat.js b/js/core/core.compat.js
index 5fab34e..28a73b7 100644
--- a/js/core/core.compat.js
+++ b/js/core/core.compat.js
@@ -186,7 +186,7 @@ function _fnCompatCols ( init )
 
 	// orderData can be given as an integer
 	var dataSort = init.aDataSort;
-	if ( dataSort && ! $.isArray( dataSort ) ) {
+	if ( typeof dataSort === 'number' && ! $.isArray( dataSort ) ) {
 		init.aDataSort = [ dataSort ];
 	}
 }
diff --git a/js/core/core.internal.js b/js/core/core.internal.js
index de16c8d..8511bf0 100644
--- a/js/core/core.internal.js
+++ b/js/core/core.internal.js
@@ -202,6 +202,35 @@ var _stripHtml = function ( d ) {
 
 
 /**
+ * Determine if all values in the array are unique. This means we can short
+ * cut the _unique method at the cost of a single loop. A sorted array is used
+ * to easily check the values.
+ *
+ * @param  {array} src Source array
+ * @return {boolean} true if all unique, false otherwise
+ * @ignore
+ */
+var _areAllUnique = function ( src ) {
+	if ( src.length < 2 ) {
+		return true;
+	}
+
+	var sorted = src.slice().sort();
+	var last = sorted[0];
+
+	for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
+		if ( sorted[i] === last ) {
+			return false;
+		}
+
+		last = sorted[i];
+	}
+
+	return true;
+};
+
+
+/**
  * Find the unique elements in a source array.
  *
  * @param  {array} src Source array
@@ -210,6 +239,10 @@ var _stripHtml = function ( d ) {
  */
 var _unique = function ( src )
 {
+	if ( _areAllUnique( src ) ) {
+		return src.slice();
+	}
+
 	// A faster unique method is to use object keys to identify used values,
 	// but this doesn't work with arrays or objects, which we must also
 	// consider. See jsperf.com/compare-array-unique-versions/4 for more
diff --git a/js/core/core.state.js b/js/core/core.state.js
index dcafc05..9b27bbc 100644
--- a/js/core/core.state.js
+++ b/js/core/core.state.js
@@ -53,7 +53,7 @@ function _fnLoadState ( settings, oInit, callback )
 
 		// Allow custom and plug-in manipulation functions to alter the saved data set and
 		// cancelling of loading by returning false
-		var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, state] );
+		var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, s] );
 		if ( $.inArray( false, abStateLoad ) !== -1 ) {
 			callback();
 			return;
@@ -73,7 +73,7 @@ function _fnLoadState ( settings, oInit, callback )
 		}
 
 		// Store the saved state so it might be accessed at any time
-		settings.oLoadedState = $.extend( true, {}, state );
+		settings.oLoadedState = $.extend( true, {}, s );
 
 		// Restore key features - todo - for 1.11 this needs to be done by
 		// subscribed events
@@ -102,7 +102,7 @@ function _fnLoadState ( settings, oInit, callback )
 		}
 
 		// Columns
-		// 
+		//
 		if ( s.columns ) {
 			for ( i=0, ien=s.columns.length ; i<ien ; i++ ) {
 				var col = s.columns[i];
@@ -119,7 +119,7 @@ function _fnLoadState ( settings, oInit, callback )
 			}
 		}
 
-		_fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, state] );
+		_fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, s] );
 		callback();
 	}
 
diff --git a/js/integration/dataTables.bootstrap4.js b/js/integration/dataTables.bootstrap4.js
index f213b00..7977fd7 100644
--- a/js/integration/dataTables.bootstrap4.js
+++ b/js/integration/dataTables.bootstrap4.js
@@ -46,19 +46,19 @@ var DataTable = $.fn.dataTable;
 /* Set the defaults for DataTables initialisation */
 $.extend( true, DataTable.defaults, {
 	dom:
-		"<'row'<'col-xs-12 col-md-6'l><'col-xs-12 col-md-6'f>>" +
-		"<'row'<'col-xs-12'tr>>" +
-		"<'row'<'col-xs-12 col-md-5'i><'col-xs-12 col-md-7'p>>",
+		"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>" +
+		"<'row'<'col-sm-12'tr>>" +
+		"<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
 	renderer: 'bootstrap'
 } );
 
 
 /* Default class modification */
 $.extend( DataTable.ext.classes, {
-	sWrapper:      "dataTables_wrapper form-inline dt-bootstrap4",
-	sFilterInput:  "form-control input-sm",
-	sLengthSelect: "form-control input-sm",
-	sProcessing:   "dataTables_processing panel panel-default",
+	sWrapper:      "dataTables_wrapper container-fluid dt-bootstrap4",
+	sFilterInput:  "form-control form-control-sm",
+	sLengthSelect: "form-control form-control-sm",
+	sProcessing:   "dataTables_processing card",
 	sPageButton:   "paginate_button page-item"
 } );
 
diff --git a/js/integration/dataTables.semanticui.js b/js/integration/dataTables.semanticui.js
index 3e0d54e..c19ffe0 100644
--- a/js/integration/dataTables.semanticui.js
+++ b/js/integration/dataTables.semanticui.js
@@ -46,7 +46,7 @@ var DataTable = $.fn.dataTable;
 /* Set the defaults for DataTables initialisation */
 $.extend( true, DataTable.defaults, {
 	dom:
-		"<'ui grid'"+
+		"<'ui stackable grid'"+
 			"<'row'"+
 				"<'eight wide column'l>"+
 				"<'right aligned eight wide column'f>"+
@@ -179,7 +179,7 @@ DataTable.ext.renderer.pageButton.semanticUI = function ( settings, host, idx, b
 	catch (e) {}
 
 	attach(
-		$(host).empty().html('<div class="ui pagination menu"/>').children(),
+		$(host).empty().html('<div class="ui stackable pagination menu"/>').children(),
 		buttons
 	);
 
diff --git a/package.json b/package.json
index bc25178..1dcdc0e 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
     "test-fixedcolumns": "DT_EXTENSION='FixedColumns' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
     "test-fixedheader":  "DT_EXTENSION='FixedHeader' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
     "test-responsive":   "DT_EXTENSION='Responsive' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
+    "test-rowgroup":     "DT_EXTENSION='RowGroup' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
     "test-rowreorder":   "DT_EXTENSION='RowReorder' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
     "test-scroller":     "DT_EXTENSION='Scroller' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run",
     "test-select":       "DT_EXTENSION='Select' ./node_modules/karma/bin/karma start test/karma.conf.js --single-run"
diff --git a/test/api/rows/rows().js b/test/api/rows/rows().js
index 3167364..e412696 100644
--- a/test/api/rows/rows().js
+++ b/test/api/rows/rows().js
@@ -16,17 +16,22 @@ describe( 'rows: rows()', function() {
 	} );
 
 	it ( 'select all rows - undefined selector' , function () {
-		table = $('#example').DataTable()
 		expect( table.rows( undefined ).count() ).toBe( 57 );
 	} );
 
 	it ( 'select all rows - null selector' , function () {
-		table = $('#example').DataTable()
 		expect( table.rows( null ).count() ).toBe( 57 );
 	} );
 
 	it ( 'select one row - 0 selector' , function () {
-		table = $('#example').DataTable()
 		expect( table.rows( 0 ).count() ).toBe( 1 );
 	} );
+
+	it ( 'Select nodes by `tr` selector' , function () {
+		expect( table.rows( 'tr' ).count() ).toBe( 57 );
+	} );
+
+	it ( 'Selector will gather rows uniquely' , function () {
+		expect( table.rows( ['tr', 'tr'] ).count() ).toBe( 57 );
+	} );
 } );
diff --git a/test/api/util/slice.js b/test/api/util/slice.js
new file mode 100644
index 0000000..ab9c71c
--- /dev/null
+++ b/test/api/util/slice.js
@@ -0,0 +1,47 @@
+
+describe( 'slice()', function() {
+	var table;
+	var data, dataSliced;
+
+	dt.libs( {
+		js:  [ 'jquery', 'datatables' ],
+		css: [ 'datatables' ]
+	} );
+
+	dt.html( 'basic' );
+
+	it( 'Create basic DataTable', function () {
+		table = $('#example').DataTable();
+		expect( true ).toBe( true );
+	} );
+
+	it( 'Get data from office column', function () {
+		data = table.column( 2 ).data().unique().sort();
+		expect( data.count() ).toBe( 7 );
+	} );
+
+	it( 'Create copy of instance', function () {
+		dataSliced =  data.slice();
+		expect( dataSliced.count() ).toBe( 7 );
+	} );
+
+	it( 'Push to sliced copy', function () {
+		dataSliced.push( 'Dunfermline' );
+		expect( dataSliced.count() ).toBe( 8 );
+	} );
+
+	it ( 'Does not effect the original', function () {
+		expect( data.count() ).toBe( 7 );
+	} );
+
+	it ( 'Does have data in the new one', function () {
+		expect( dataSliced[0] ).toBe( 'Edinburgh' );
+		expect( dataSliced[1] ).toBe( 'London' );
+		expect( dataSliced[2] ).toBe( 'New York' );
+		expect( dataSliced[3] ).toBe( 'San Francisco' );
+		expect( dataSliced[4] ).toBe( 'Sidney' );
+		expect( dataSliced[5] ).toBe( 'Singapore' );
+		expect( dataSliced[6] ).toBe( 'Tokyo' );
+		expect( dataSliced[7] ).toBe( 'Dunfermline' );
+	} );
+} );
diff --git a/test/api/util/unique.js b/test/api/util/unique.js
new file mode 100644
index 0000000..542c1af
--- /dev/null
+++ b/test/api/util/unique.js
@@ -0,0 +1,43 @@
+
+describe( 'unique()', function() {
+	var table;
+
+	dt.libs( {
+		js:  [ 'jquery', 'datatables' ],
+		css: [ 'datatables' ]
+	} );
+
+	dt.html( 'basic' );
+
+	it( 'Create basic DataTable', function () {
+		table = $('#example').DataTable();
+		expect( true ).toBe( true );
+	} );
+
+	it( 'Get data from office column', function () {
+		var data = table.column( 2 ).data();
+		expect( data.count() ).toBe( 57 );
+	} );
+
+	it( 'Get unique data from office column', function () {
+		var data = table.column( 2 ).data().unique();
+		expect( data.count() ).toBe( 7 );
+	} );
+
+	it( 'Confirm unique data', function () {
+		var data = table.column( 2 ).data().unique().sort();
+
+		expect( data[0] ).toBe( 'Edinburgh' );
+		expect( data[1] ).toBe( 'London' );
+		expect( data[2] ).toBe( 'New York' );
+		expect( data[3] ).toBe( 'San Francisco' );
+		expect( data[4] ).toBe( 'Sidney' );
+		expect( data[5] ).toBe( 'Singapore' );
+		expect( data[6] ).toBe( 'Tokyo' );
+	} );
+
+	it( 'Get unique data from age column', function () {
+		var data = table.column( 3 ).data().unique();
+		expect( data.count() ).toBe( 33 );
+	} );
+} );
diff --git a/test/karma.conf.js b/test/karma.conf.js
index a8eb090..11d4f10 100644
--- a/test/karma.conf.js
+++ b/test/karma.conf.js
@@ -13,6 +13,7 @@ module.exports = function(config) {
         case 'FixedColumns': testFiles = 'extensions/FixedColumns/test/**/*.js'; break;
         case 'FixedHeader':  testFiles = 'extensions/FixedHeader/test/**/*.js';  break;
         case 'Responsive':   testFiles = 'extensions/Responsive/test/**/*.js';   break;
+        case 'RowGroup':     testFiles = 'extensions/RowGroup/test/**/*.js';     break;
         case 'RowReorder':   testFiles = 'extensions/RowReorder/test/**/*.js';   break;
         case 'Scroller':     testFiles = 'extensions/Scroller/test/**/*.js';     break;
         case 'Select':       testFiles = 'extensions/Select/test/**/*.js';       break;
@@ -123,6 +124,12 @@ module.exports = function(config) {
                 js: true,
                 css: true
             },
+            rowgroup:   {
+                pathName: 'RowGroup',
+                fileName: 'rowGroup',
+                js: false,
+                css: true
+            },
             rowreorder:   {
                 pathName: 'RowReorder',
                 fileName: 'rowReorder',
diff --git a/test/options/columns/columns_orderData.js b/test/options/columns/columns_orderData.js
index c81c35f..b0ef5bd 100644
--- a/test/options/columns/columns_orderData.js
+++ b/test/options/columns/columns_orderData.js
@@ -4,35 +4,58 @@ describe( "columns.orderData option", function() {
 		css: [ 'datatables' ]
 	} );
 
-	describe("Check the defaults", function () {
-
-		dt.html( 'basic' );
-		it("Sorting on Column 1 is uneffected", function () {
-			$('#example').dataTable( {
-				"columns": [
-			    null,
-			    null,
-			    { "orderData": [ 2, 3 ] },
-			    null,
-			    null,
-				{ "orderData": [ 0 ] }
-			  ]
-			});
-			expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Airi Satou").toBe(true);
-		});
-		it("Sorting on third column uses 4th column as well as third", function () {
-			$('#example thead th:eq(2)').click();
-			expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Cedric Kelly").toBe(true);
-		});
-		it("Sorting on third column uses 4th column as well as third- reversed", function () {
-			$('#example thead th:eq(2)').click();
-			expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Garrett Winters").toBe(true);
-		});
-		it("Sorting on last column uses data from first", function () {
-			$('#example thead th:eq(5)').click();
-			expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Airi Satou").toBe(true);
+	dt.html( 'basic' );
+
+	it("Sorting on Column 1 is uneffected", function () {
+		$('#example').dataTable( {
+			"columns": [
+			null,
+			null,
+			{ "orderData": [ 2, 3 ] },
+			null,
+			null,
+			{ "orderData": [ 0 ] }
+			]
 		});
+		expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Airi Satou").toBe(true);
+	});
+
+	it("Sorting on third column uses 4th column as well as third", function () {
+		$('#example thead th:eq(2)').click();
+		expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Cedric Kelly").toBe(true);
+	});
+
+	it("Sorting on third column uses 4th column as well as third- reversed", function () {
+		$('#example thead th:eq(2)').click();
+		expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Garrett Winters").toBe(true);
+	});
+
+	it("Sorting on last column uses data from first", function () {
+		$('#example thead th:eq(5)').click();
+		expect($('#example tbody tr:eq(0) td:eq(0)').html() == "Airi Satou").toBe(true);
+	});
+
+	// DataTablesSrc #97
+	dt.html( 'basic' );
 
+	it("Initialise table with data ordering as an integer for column index 0", function () {
+		$('#example').dataTable( {
+			columnDefs: [ {
+				targets: 1,
+				orderData: 0
+			} ]
+		} );
+
+		expect($('#example tbody tr:eq(0) td:eq(0)').html()).toBe("Airi Satou");
+	});
+
+	it("Sort by column index 1", function () {
+		$('#example thead th:eq(1)').click();
+		expect($('#example tbody tr:eq(0) td:eq(0)').html()).toBe("Airi Satou");
 	});
 
+	it("And reverse - still column 0 data being used", function () {
+		$('#example thead th:eq(1)').click();
+		expect($('#example tbody tr:eq(0) td:eq(0)').html()).toBe("Zorita Serrano");
+	});
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/datatables.js.git



More information about the Pkg-javascript-commits mailing list