[Pkg-javascript-commits] [datatables.js] 01/05: Imported Upstream version 1.10.12

Sascha Steinbiss sascha at steinbiss.name
Sun May 22 01:19:59 UTC 2016


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

sascha-guest pushed a commit to branch master
in repository datatables.js.

commit eb0428d3f391566dd0480a9a59446aca2ebf417d
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Sun May 22 01:08:12 2016 +0000

    Imported Upstream version 1.10.12
---
 Issue_template.txt               |  3 ++
 build/examples.php               | 12 ++++----
 build/include.sh                 |  2 +-
 build/lib/DT_Markdown.php        | 55 ++++++++++++++++++++++++++++------
 build/lib/markdown.php           |  1 +
 build/lib/markdown_extended.php  | 13 ++++++++
 css/dataTables.bootstrap.scss    |  3 +-
 css/dataTables.bootstrap4.scss   |  4 +--
 css/dataTables.foundation.scss   |  1 -
 css/dataTables.semanticui.scss   | 64 ++++++++++++++++++++++++++++++++++------
 css/dataTables.uikit.scss        |  1 -
 css/jquery.dataTables.scss       |  1 -
 docs/api/table().node().xml      |  2 +-
 docs/event/column-visibility.xml |  2 ++
 docs/option/dom.xml              | 12 ++++++--
 docs/option/initComplete.xml     |  2 +-
 docs/option/lengthChange.xml     |  2 +-
 docs/option/rowCallback.xml      | 15 ++++++++--
 js/DataTables.js                 | 47 +++++++++++++++--------------
 js/api/api.columns.js            | 32 ++++++++++++--------
 js/api/api.order.js              |  2 +-
 js/api/api.static.js             | 32 --------------------
 js/api/api.util.js               | 59 ++++++++++++++++++++++++++++++++++++
 js/core/core.columns.js          | 11 ++++++-
 js/core/core.filter.js           |  7 +----
 js/core/core.sizing.js           | 27 +----------------
 26 files changed, 268 insertions(+), 144 deletions(-)

diff --git a/Issue_template.txt b/Issue_template.txt
new file mode 100644
index 0000000..2030cdc
--- /dev/null
+++ b/Issue_template.txt
@@ -0,0 +1,3 @@
+Please post support requests and questions in the DataTables forums at https://datatables.net/forums. Support requests posted here will be closed. The intention of this request is to allow all questions to be located in a single, searchable, location.
+
+When you post your question in the DataTables forums, please ensure that you include a link to the page showing the issue so it can be debugged.
diff --git a/build/examples.php b/build/examples.php
index 7e69ab7..f26767f 100644
--- a/build/examples.php
+++ b/build/examples.php
@@ -238,11 +238,11 @@ else {
 }
 
 // Styling libraries
-DT_Example::$lookup_libraries['js' ]['jquery']       = '//code.jquery.com/jquery-1.12.0.min.js';
-DT_Example::$lookup_libraries['js' ]['jqueryui']     = '//code.jquery.com/ui/1.11.3/jquery-ui.js';
-DT_Example::$lookup_libraries['css']['jqueryui']     = '//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css';
-DT_Example::$lookup_libraries['js' ]['bootstrap']    = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js';
-DT_Example::$lookup_libraries['css']['bootstrap']    = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css';
+DT_Example::$lookup_libraries['js' ]['jquery']       = '//code.jquery.com/jquery-1.12.3.min.js';
+DT_Example::$lookup_libraries['js' ]['jqueryui']     = '//code.jquery.com/ui/1.11.4/jquery-ui.js';
+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.6/js/bootstrap.min.js';
+DT_Example::$lookup_libraries['css']['bootstrap']    = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css';
 DT_Example::$lookup_libraries['js']['bootstrap4']    = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/js/bootstrap.min.js';
 DT_Example::$lookup_libraries['css' ]['bootstrap4']  = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.css';
 DT_Example::$lookup_libraries['js' ]['semanticui']   = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.js';
@@ -259,7 +259,7 @@ DT_Example::$lookup_libraries['css']['font-awesome'] = '//cdnjs.cloudflare.com/a
 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.10.6/moment.min.js';
+DT_Example::$lookup_libraries['js']['moment']        = '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js';
 
 function multiple ( $value, $fn )
 {
diff --git a/build/include.sh b/build/include.sh
index c54051c..5393ccb 100644
--- a/build/include.sh
+++ b/build/include.sh
@@ -8,8 +8,8 @@ JSHINT="/usr/bin/jshint"
 
 # CSS styling frameworks that DataTables supports
 FRAMEWORKS=(
-	'bootstrap'
 	'bootstrap4'
+	'bootstrap'
 	'foundation'
 	'jqueryui'
 	'semanticui'
diff --git a/build/lib/DT_Markdown.php b/build/lib/DT_Markdown.php
index be6fd60..c9534bf 100644
--- a/build/lib/DT_Markdown.php
+++ b/build/lib/DT_Markdown.php
@@ -15,12 +15,44 @@ require_once('markdown_extended.php');// or die('Run ./make.sh thirdparty');
  *      paths)
  */
 
-function DT_Markdown($text, $default_claases = array()){
+function DT_Markdown($text, $default_claases=array(), $truncateWhiteSpace=false){
+	if ( $truncateWhiteSpace ) {
+		$text = DT_Markdown_Parser::truncateWhiteSpace( $text );
+	}
+
 	$parser = new DT_Markdown_Parser($default_claases);
 	return $parser->transform($text);
 }
 
 class DT_Markdown_Parser extends MarkdownExtraExtended_Parser {
+	// If the first line has white space, then remove that amount of white space
+	// from all lines
+	static function truncateWhiteSpace ( $str )
+	{
+		// Remove lines that have white space only
+		while ( preg_match('/^\t*\n/', $str) ) {
+			$str = preg_replace( '/^\t*\n/', '', $str );
+		}
+
+		// Split it up for line by line
+		$a = explode("\n", $str);
+
+		if ( strpos( $a[0], "\t" ) === 0 || strpos( $a[0], " " ) === 0 ) {
+			// How much white space?
+			preg_match("/^\s+/", $a[0], $match);
+
+			// Remove the same amount of white space for each line
+			if ( $match && count($match) ) {
+				for ( $i=0, $ien=count($a) ; $i<$ien ; $i++ ) {
+					$a[$i] = preg_replace( '/'.$match[0].'/', '', $a[$i], 1 );
+				}
+			}
+		}
+
+		return implode("\n", $a);
+	}
+
+
 	function DT_Markdown_Parser( $options )
 	{
 		if ( isset( $options['nohtml'] ) ) {
@@ -265,10 +297,12 @@ class DT_Markdown_Parser extends MarkdownExtraExtended_Parser {
 		$attr  = $this->_doHeaders_attr($id =& $matches[2]);
 
 		$text = $this->runSpanGamut($matches[1]);
-		$anchor = $this->_doHeaderAnchor( $text );
+		$anchor = $this->_doHeaderAnchor( $matches[1] );
 		$block =
-			'<a name="'.$anchor.'"></a>'.
-			"<h$level$attr data-anchor=\"".$anchor."\">".$text."</h$level>";
+			"<h$level$attr data-anchor=\"".$anchor."\">".
+				'<a name="'.$anchor.'"></a>'.
+				$text.
+			"</h$level>";
 		return "\n" . $this->hashBlock($block) . "\n\n";
 	}
 
@@ -279,10 +313,11 @@ class DT_Markdown_Parser extends MarkdownExtraExtended_Parser {
 		$text = $this->runSpanGamut($matches[2]);
 
 		if ( $level <= 3 ) {
-			$anchor = $this->_doHeaderAnchor( $text );
-			$block =
-				'<a name="'.$anchor.'"></a>'.
-				"<h$level$attr data-anchor=\"".$anchor."\">".$text."</h$level>";
+			$anchor = $this->_doHeaderAnchor( $matches[2] );
+			$block = "<h$level$attr data-anchor=\"".$anchor."\">".
+					'<a name="'.$anchor.'"></a>'.
+					$text.
+				"</h$level>";
 		}
 		else {
 			$block = "<h$level$attr>".$text."</h$level>";
@@ -293,7 +328,9 @@ class DT_Markdown_Parser extends MarkdownExtraExtended_Parser {
 
 	function _doHeaderAnchor( $text ) {
 		$text = strip_tags( $text );
-		return str_replace(' ', '-', $text);
+		$text = str_replace(' ', '-', $text);
+		$text = str_replace('`', '', $text);
+		return $text;
 	}
 
 
diff --git a/build/lib/markdown.php b/build/lib/markdown.php
index cc99969..818b22a 100644
--- a/build/lib/markdown.php
+++ b/build/lib/markdown.php
@@ -666,6 +666,7 @@ class Markdown_Parser {
 	
 	function doHardBreaks($text) {
 		# Do hard breaks:
+		// Remove double newlines that remain
 		return preg_replace_callback('/ {2,}\n/', 
 			array(&$this, '_doHardBreaks_callback'), $text);
 	}
diff --git a/build/lib/markdown_extended.php b/build/lib/markdown_extended.php
index cdd56f0..3dd841e 100644
--- a/build/lib/markdown_extended.php
+++ b/build/lib/markdown_extended.php
@@ -28,6 +28,19 @@ class MarkdownExtraExtended_Parser extends MarkdownExtra_Parser {
 	}
 
 
+	function doHardBreaks($text) {
+		# Do hard breaks:
+		# EXTENDED: changed to allow breaks without two spaces and just one new line
+		# original code /* return preg_replace_callback('/ {2,}\n/', */
+		// Remove double newlines that remain
+		$text = preg_replace_callback('/\n\n/',
+			array(&$this, '_doHardBreaks_callback'), $text);
+		
+		return preg_replace_callback('/ *\n/',
+			array(&$this, '_doHardBreaks_callback'), $text);
+	}
+
+
 	function doBlockQuotes($text) {
 		$text = preg_replace_callback('/
 			(?>^[ ]*>[ ]?
diff --git a/css/dataTables.bootstrap.scss b/css/dataTables.bootstrap.scss
index 3d8efeb..999d2c1 100644
--- a/css/dataTables.bootstrap.scss
+++ b/css/dataTables.bootstrap.scss
@@ -4,6 +4,7 @@ table.dataTable {
 	margin-top: 6px !important;
 	margin-bottom: 6px !important;
 	max-width: none !important;
+	border-collapse: separate !important;
 
 	td,
 	th {
@@ -208,8 +209,6 @@ table.dataTable.table-condensed {
 // width calculations when using scrolling impossible to align columns. We have
 // to use `border-collapse: separate`
 table.table-bordered.dataTable {
-	border-collapse: separate !important;
-
 	th,
 	td {
 		border-left-width: 0;
diff --git a/css/dataTables.bootstrap4.scss b/css/dataTables.bootstrap4.scss
index cda540e..141e728 100644
--- a/css/dataTables.bootstrap4.scss
+++ b/css/dataTables.bootstrap4.scss
@@ -5,11 +5,11 @@ table.dataTable {
 	margin-top: 6px !important;
 	margin-bottom: 6px !important;
 	max-width: none !important;
+	border-collapse: separate !important;
 
 	td,
 	th {
 		-webkit-box-sizing: content-box;
-		-moz-box-sizing: content-box;
 		box-sizing: content-box;
 
 		&.dataTables_empty {
@@ -210,8 +210,6 @@ table.dataTable.table-condensed {
 // width calculations when using scrolling impossible to align columns. We have
 // to use `border-collapse: separate`
 table.table-bordered.dataTable {
-	border-collapse: separate !important;
-
 	th,
 	td {
 		border-left-width: 0;
diff --git a/css/dataTables.foundation.scss b/css/dataTables.foundation.scss
index 6a44d58..84aab99 100644
--- a/css/dataTables.foundation.scss
+++ b/css/dataTables.foundation.scss
@@ -8,7 +8,6 @@ table.dataTable {
 	td,
 	th {
 		-webkit-box-sizing: content-box;
-		-moz-box-sizing: content-box;
 		box-sizing: content-box;
 
 		&.dataTables_empty {
diff --git a/css/dataTables.semanticui.scss b/css/dataTables.semanticui.scss
index 59021e7..18228d6 100644
--- a/css/dataTables.semanticui.scss
+++ b/css/dataTables.semanticui.scss
@@ -10,21 +10,24 @@ table.dataTable.table {
 	thead td {
 		position: relative;
 
-		&.sorting:after,
-		&.sorting_asc:after,
-		&.sorting_desc:after {
-			position: absolute;
-			top: 12px;
-			right: 8px;
-			display: block;
-			font-family: Icons;
+		&.sorting,
+		&.sorting_asc,
+		&.sorting_desc {
+			padding-right: 20px;
+
+			&:after {
+				position: absolute;
+				top: 12px;
+				right: 8px;
+				display: block;
+				font-family: Icons;
+			}
 		}
 
 		&.sorting:after {
 			content: "\f0dc";
 			color: #ddd;
 			font-size: 0.8em;
-			padding-top: 0.12em;
 		}
 
 		&.sorting_asc:after {
@@ -62,6 +65,12 @@ table.dataTable.table {
 // DataTables' built in feature elements
 div.dataTables_wrapper {
 	div.dataTables_length {
+		// Match the height of the drop down when Semantic UI JS isn't present
+		select {
+			vertical-align: middle;
+			min-height: 2.7142em;
+		}
+
 		.ui.selection.dropdown {
 			min-width: 0;
 		}
@@ -90,4 +99,41 @@ div.dataTables_wrapper {
 	div.row.dt-table {
 		padding: 0;
 	}
+
+	// Merge the three scrolling tables into one
+	div.dataTables_scrollHead {
+		table.dataTable {
+			border-bottom-right-radius: 0;
+			border-bottom-left-radius: 0;
+			border-bottom: none;
+		}
+	}
+
+	div.dataTables_scrollBody {
+		thead { // Hide sort icons
+			.sorting:after,
+			.sorting_asc:after,
+			.sorting_desc:after {
+				display: none;
+			}
+		}
+
+		table.dataTable {
+			border-radius: 0;
+			border-top: none;
+			border-bottom-width: 0;
+		}
+
+		table.dataTable.no-footer {
+			border-bottom-width: 1px;
+		}
+	}
+
+	div.dataTables_scrollFoot {
+		table.dataTable {
+			border-top-right-radius: 0;
+			border-top-left-radius: 0;
+			border-top: none;
+		}
+	}
 }
diff --git a/css/dataTables.uikit.scss b/css/dataTables.uikit.scss
index 2db18e8..9b1ee45 100644
--- a/css/dataTables.uikit.scss
+++ b/css/dataTables.uikit.scss
@@ -8,7 +8,6 @@ table.dataTable {
 	td,
 	th {
 		-webkit-box-sizing: content-box;
-		-moz-box-sizing: content-box;
 		box-sizing: content-box;
 
 		&.dataTables_empty {
diff --git a/css/jquery.dataTables.scss b/css/jquery.dataTables.scss
index cdf764c..73f5f55 100644
--- a/css/jquery.dataTables.scss
+++ b/css/jquery.dataTables.scss
@@ -392,7 +392,6 @@ table.dataTable,
 table.dataTable th,
 table.dataTable td {
 	-webkit-box-sizing: content-box;
-	   -moz-box-sizing: content-box;
 	        box-sizing: content-box;
 }
 
diff --git a/docs/api/table().node().xml b/docs/api/table().node().xml
index 343a8c1..a6c040d 100644
--- a/docs/api/table().node().xml
+++ b/docs/api/table().node().xml
@@ -19,7 +19,7 @@ var table = $('#example').DataTable( {
 	scrollX: "100%"
 } );
 
-$( tables.table().node() )
+$( table.table().node() )
 	.addClass( 'highlight' );
 ]]></example>
 
diff --git a/docs/event/column-visibility.xml b/docs/event/column-visibility.xml
index d53b5b0..7bc2a94 100644
--- a/docs/event/column-visibility.xml
+++ b/docs/event/column-visibility.xml
@@ -29,6 +29,8 @@
 	<description>
 		This event is fired whenever a column's visibility is altered through the `dt-api column().visible()` method and can be useful for plug-ins which work with columns to identify changes in column visibility state and update their own state to take account of the change.
 
+		**Responsive integration**: If you are using the [Responsive extension for DataTables](//datatables.net/extensions/responsive/) for DataTables, it will effect the visibility of columns, but it does not use the DataTables column visibility options, so this event will not be triggered by Responsive showing or hiding columns. Instead, use the `r-event responsive-resize` event.
+
 		Please note that, as with all DataTables emitted events, this event is triggered with the `dt` namespace. As such, to listen for this event, you must also use the `dt` namespace by simply appending `.dt` to your event name, as shown in the example below.
 	</description>
 
diff --git a/docs/option/dom.xml b/docs/option/dom.xml
index cfb46b6..da83993 100644
--- a/docs/option/dom.xml
+++ b/docs/option/dom.xml
@@ -74,7 +74,14 @@
 
     ### Plug-ins
 
-    DataTables feature plug-ins can be developed to add additional features to DataTables and often will make use of this option, adding new letters to the DataTables core features. For example [TableTools](//datatables.net/extras/tabletools) adds the `T` option to `dt-init dom` to specify where table control buttons should be inserted into the table.
+    DataTables feature plug-ins can be developed to add additional features to DataTables and often will make use of this option, adding new letters to the DataTables core features. For example [Buttons](//datatables.net/extensions/buttons) adds the `B` option to `dt-init dom` to specify where table control buttons should be inserted into the table.
+
+    Currently only a single extension provides its own `dt-init dom` option, while the others can all be configured directly using the options in the DataTables constructor:
+
+    * `B` - [Buttons](/extensions/buttons)
+
+
+    ### Future development
 
     Note, I am aware that this is the most complex option in DataTables and it takes a fair amount of understanding, particularly when using the styling integration options! The plan is to revamp this option in 1.11 to make it easier to use.
     
@@ -151,5 +158,6 @@ $('#example').dataTable( {
 	<related type="option">info</related>
 	<related type="option">ordering</related>
 	<related type="option">processing</related>
-	<related type="option">paging</related>
+  <related type="option">paging</related>
+  <related type="option">lengthChange</related>
 </dt-option>
\ No newline at end of file
diff --git a/docs/option/initComplete.xml b/docs/option/initComplete.xml
index 5f33a76..8ecb54e 100644
--- a/docs/option/initComplete.xml
+++ b/docs/option/initComplete.xml
@@ -30,7 +30,7 @@ $('#example').dataTable( {
 ]]></example>
 
 	<example title="Show a loading message while the table is being initialised (`processing` will do this as well)"><![CDATA[
-$('<div class="loading">Loading</div>').appendTo('body);
+$('<div class="loading">Loading</div>').appendTo('body');
 
 $('#example').dataTable( {
   "initComplete": function( settings, json ) {
diff --git a/docs/option/lengthChange.xml b/docs/option/lengthChange.xml
index f8689a3..b98af07 100644
--- a/docs/option/lengthChange.xml
+++ b/docs/option/lengthChange.xml
@@ -8,7 +8,7 @@
 	<default value="true" />
 
 	<description>
-		When pagination is enabled, this option will control the display an option for the end user to change number of records to be shown per page. The options shown in the list are controlled by the `dt-init lengthMenu` configuration option.
+		When pagination is enabled, this option will control the display of an option for the end user to change number of records to be shown per page. The options shown in the list are controlled by the `dt-init lengthMenu` configuration option.
 
 		Note that by default the control is shown at the top left of the table. That can be controlled using `dt-init dom` and CSS.
 
diff --git a/docs/option/rowCallback.xml b/docs/option/rowCallback.xml
index 80681d9..41f1413 100644
--- a/docs/option/rowCallback.xml
+++ b/docs/option/rowCallback.xml
@@ -10,7 +10,7 @@
 			`tag TR` element being inserted into the document.
 		</parameter>
 		<parameter type="array|object" name="data">
-			Data source for the row (array or object)
+			Data source for the row. **Important**: This parameter is the original data source object that is used for the  row. If you are using objects, then `data` is an object - if you are using arrays, then `data` is an array. Thus how you obtain the data from this parameter will depend on how the DataTable is configured.
 		</parameter>
 		<parameter type="integer" name="index">
 			DataTables' internal index for the row - see `dt-api row().index()`.
@@ -24,10 +24,19 @@
 		This function might be used for setting the row class name or otherwise manipulating the row's `tag TR` element (although note that `dt-init createdRow can often be more efficient).
 	</description>
 
-	<example title="Highlight cells based on their content"><![CDATA[
+	<example title="Highlight cells based on their content (object data source)"><![CDATA[
+$('#example').dataTable( {
+  "rowCallback": function( row, data, index ) {
+    if ( data.grade == "A" ) {
+      $('td:eq(4)', row).html( '<b>A</b>' );
+    }
+  }
+} );
+]]></example>
+
+	<example title="Highlight cells based on their content (array data source)"><![CDATA[
 $('#example').dataTable( {
   "rowCallback": function( row, data, index ) {
-    // Bold the grade for all 'A' grade browsers
     if ( data[4] == "A" ) {
       $('td:eq(4)', row).html( '<b>A</b>' );
     }
diff --git a/js/DataTables.js b/js/DataTables.js
index 7ee7a4d..7ba2029 100644
--- a/js/DataTables.js
+++ b/js/DataTables.js
@@ -1,11 +1,11 @@
-/*! DataTables 1.10.11
+/*! DataTables 1.10.12
  * ©2008-2015 SpryMedia Ltd - datatables.net/license
  */
 
 /**
  * @summary     DataTables
  * @description Paginate, search and order HTML tables
- * @version     1.10.11
+ * @version     1.10.12
  * @file        jquery.dataTables.js
  * @author      SpryMedia Ltd (www.sprymedia.co.uk)
  * @contact     www.sprymedia.co.uk/contact
@@ -91,27 +91,7 @@
 	 *      } );
 	 *    } );
 	 */
-	var DataTable;
-
-	_buildInclude('core.internal.js');
-	_buildInclude('core.compat.js');
-	_buildInclude('core.columns.js');
-	_buildInclude('core.data.js');
-	_buildInclude('core.draw.js');
-	_buildInclude('core.ajax.js');
-	_buildInclude('core.filter.js');
-	_buildInclude('core.info.js');
-	_buildInclude('core.init.js');
-	_buildInclude('core.length.js');
-	_buildInclude('core.page.js');
-	_buildInclude('core.processing.js');
-	_buildInclude('core.scrolling.js');
-	_buildInclude('core.sizing.js');
-	_buildInclude('core.sort.js');
-	_buildInclude('core.state.js');
-	_buildInclude('core.support.js');
-
-	DataTable = function( options )
+	var DataTable = function ( options )
 	{
 		_buildInclude('api.legacy.js');
 
@@ -146,6 +126,25 @@
 		return this;
 	};
 
+	_buildInclude('core.internal.js');
+	_buildInclude('api.util.js');
+	_buildInclude('core.compat.js');
+	_buildInclude('core.columns.js');
+	_buildInclude('core.data.js');
+	_buildInclude('core.draw.js');
+	_buildInclude('core.ajax.js');
+	_buildInclude('core.filter.js');
+	_buildInclude('core.info.js');
+	_buildInclude('core.init.js');
+	_buildInclude('core.length.js');
+	_buildInclude('core.page.js');
+	_buildInclude('core.processing.js');
+	_buildInclude('core.scrolling.js');
+	_buildInclude('core.sizing.js');
+	_buildInclude('core.sort.js');
+	_buildInclude('core.state.js');
+	_buildInclude('core.support.js');
+
 	_buildInclude('api.base.js');
 	_buildInclude('api.table.js');
 	_buildInclude('api.draw.js');
@@ -170,7 +169,7 @@
 	 *  @type string
 	 *  @default Version number
 	 */
-	DataTable.version = "1.10.11";
+	DataTable.version = "1.10.12";
 
 	/**
 	 * Private data store, containing all of the settings objects that are
diff --git a/js/api/api.columns.js b/js/api/api.columns.js
index e01a6fe..9e43735 100644
--- a/js/api/api.columns.js
+++ b/js/api/api.columns.js
@@ -42,7 +42,7 @@ var __column_selector = function ( settings, selector, opts )
 		if ( s === '' ) {
 			return _range( columns.length );
 		}
-		
+
 		// Selector - index
 		if ( selInt !== null ) {
 			return [ selInt >= 0 ?
@@ -50,7 +50,7 @@ var __column_selector = function ( settings, selector, opts )
 				columns.length + selInt // Count from right (+ because its a negative value)
 			];
 		}
-		
+
 		// Selector = function
 		if ( typeof s === 'function' ) {
 			var rows = _selector_row_indexes( settings, opts );
@@ -125,7 +125,7 @@ var __column_selector = function ( settings, selector, opts )
 };
 
 
-var __setColumnVis = function ( settings, column, vis, recalc ) {
+var __setColumnVis = function ( settings, column, vis ) {
 	var
 		cols = settings.aoColumns,
 		col  = cols[ column ],
@@ -168,13 +168,6 @@ var __setColumnVis = function ( settings, column, vis, recalc ) {
 	_fnDrawHead( settings, settings.aoHeader );
 	_fnDrawHead( settings, settings.aoFooter );
 
-	if ( recalc === undefined || recalc ) {
-		// Automatically adjust column sizing
-		_fnAdjustColumnSizing( settings );
-	}
-
-	_fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, recalc] );
-
 	_fnSaveState( settings );
 };
 
@@ -239,12 +232,26 @@ _api_registerPlural( 'columns().nodes()', 'column().nodes()', function () {
 } );
 
 _api_registerPlural( 'columns().visible()', 'column().visible()', function ( vis, calc ) {
-	return this.iterator( 'column', function ( settings, column ) {
+	var ret = this.iterator( 'column', function ( settings, column ) {
 		if ( vis === undefined ) {
 			return settings.aoColumns[ column ].bVisible;
 		} // else
-		__setColumnVis( settings, column, vis, calc );
+		__setColumnVis( settings, column, vis );
 	} );
+
+	// Group the column visibility changes
+	if ( vis !== undefined ) {
+		// Second loop once the first is done for events
+		this.iterator( 'column', function ( settings, column ) {
+			_fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, calc] );
+		} );
+
+		if ( calc === undefined || calc ) {
+			this.columns.adjust();
+		}
+	}
+
+	return ret;
 } );
 
 _api_registerPlural( 'columns().indexes()', 'column().index()', function ( type ) {
@@ -277,4 +284,3 @@ _api_register( 'column.index()', function ( type, idx ) {
 _api_register( 'column()', function ( selector, opts ) {
 	return _selector_first( this.columns( selector, opts ) );
 } );
-
diff --git a/js/api/api.order.js b/js/api/api.order.js
index 67a74d3..ecd928c 100644
--- a/js/api/api.order.js
+++ b/js/api/api.order.js
@@ -43,7 +43,7 @@ _api_register( 'order()', function ( order, dir ) {
 		// Simple column / direction passed in
 		order = [ [ order, dir ] ];
 	}
-	else if ( ! $.isArray( order[0] ) ) {
+	else if ( order.length && ! $.isArray( order[0] ) ) {
 		// Arguments passed in (list of 1D arrays)
 		order = Array.prototype.slice.call( arguments );
 	}
diff --git a/js/api/api.static.js b/js/api/api.static.js
index bfd81c3..b7e608d 100644
--- a/js/api/api.static.js
+++ b/js/api/api.static.js
@@ -109,38 +109,6 @@ DataTable.tables = DataTable.fnTables = function ( visible )
 
 
 /**
- * DataTables utility methods
- * 
- * This namespace provides helper methods that DataTables uses internally to
- * create a DataTable, but which are not exclusively used only for DataTables.
- * These methods can be used by extension authors to save the duplication of
- * code.
- *
- *  @namespace
- */
-DataTable.util = {
-	/**
-	 * Throttle the calls to a function. Arguments and context are maintained
-	 * for the throttled function.
-	 *
-	 * @param {function} fn Function to be called
-	 * @param {integer} freq Call frequency in mS
-	 * @return {function} Wrapped function
-	 */
-	throttle: _fnThrottle,
-
-
-	/**
-	 * Escape a string such that it can be used in a regular expression
-	 *
-	 *  @param {string} sVal string to escape
-	 *  @returns {string} escaped string
-	 */
-	escapeRegex: _fnEscapeRegex
-};
-
-
-/**
  * Convert from camel case parameters to Hungarian notation. This is made public
  * for the extensions to provide the same ability as DataTables core to accept
  * either the 1.9 style Hungarian notation, or the 1.10+ style camelCase
diff --git a/js/api/api.util.js b/js/api/api.util.js
new file mode 100644
index 0000000..41cabc4
--- /dev/null
+++ b/js/api/api.util.js
@@ -0,0 +1,59 @@
+
+/**
+ * DataTables utility methods
+ * 
+ * This namespace provides helper methods that DataTables uses internally to
+ * create a DataTable, but which are not exclusively used only for DataTables.
+ * These methods can be used by extension authors to save the duplication of
+ * code.
+ *
+ *  @namespace
+ */
+DataTable.util = {
+	/**
+	 * Throttle the calls to a function. Arguments and context are maintained
+	 * for the throttled function.
+	 *
+	 * @param {function} fn Function to be called
+	 * @param {integer} freq Call frequency in mS
+	 * @return {function} Wrapped function
+	 */
+	throttle: function ( fn, freq ) {
+		var
+			frequency = freq !== undefined ? freq : 200,
+			last,
+			timer;
+
+		return function () {
+			var
+				that = this,
+				now  = +new Date(),
+				args = arguments;
+
+			if ( last && now < last + frequency ) {
+				clearTimeout( timer );
+
+				timer = setTimeout( function () {
+					last = undefined;
+					fn.apply( that, args );
+				}, frequency );
+			}
+			else {
+				last = now;
+				fn.apply( that, args );
+			}
+		};
+	},
+
+
+	/**
+	 * Escape a string such that it can be used in a regular expression
+	 *
+	 *  @param {string} val string to escape
+	 *  @returns {string} escaped string
+	 */
+	escapeRegex: function ( val ) {
+		return val.replace( _re_escape_regex, '\\$1' );
+	}
+};
+
diff --git a/js/core/core.columns.js b/js/core/core.columns.js
index eb6a242..7c9454b 100644
--- a/js/core/core.columns.js
+++ b/js/core/core.columns.js
@@ -231,7 +231,16 @@ function _fnColumnIndexToVisible( oSettings, iMatch )
  */
 function _fnVisbleColumns( oSettings )
 {
-	return $( _pluck( oSettings.aoColumns, 'nTh' ) ).filter(':visible').length;
+	var vis = 0;
+
+	// No reduce in IE8, use a loop for now
+	$.each( oSettings.aoColumns, function ( i, col ) {
+		if ( col.bVisible && $(col.nTh).css('display') !== 'none' ) {
+			vis++;
+		}
+	} );
+
+	return vis;
 }
 
 
diff --git a/js/core/core.filter.js b/js/core/core.filter.js
index cfd25fa..585dd98 100644
--- a/js/core/core.filter.js
+++ b/js/core/core.filter.js
@@ -301,12 +301,7 @@ function _fnFilterCreateSearch( search, regex, smart, caseInsensitive )
  *  @returns {string} escaped string
  *  @memberof DataTable#oApi
  */
-function _fnEscapeRegex ( sVal )
-{
-	return sVal.replace( _re_escape_regex, '\\$1' );
-}
-
-
+var _fnEscapeRegex = DataTable.util.escapeRegex;
 
 var __filter_div = $('<div>')[0];
 var __filter_div_textContent = __filter_div.textContent !== undefined;
diff --git a/js/core/core.sizing.js b/js/core/core.sizing.js
index c09f162..551af63 100644
--- a/js/core/core.sizing.js
+++ b/js/core/core.sizing.js
@@ -236,32 +236,7 @@ function _fnCalculateColumnWidths ( oSettings )
  *  @returns {function} wrapped function
  *  @memberof DataTable#oApi
  */
-function _fnThrottle( fn, freq ) {
-	var
-		frequency = freq !== undefined ? freq : 200,
-		last,
-		timer;
-
-	return function () {
-		var
-			that = this,
-			now  = +new Date(),
-			args = arguments;
-
-		if ( last && now < last + frequency ) {
-			clearTimeout( timer );
-
-			timer = setTimeout( function () {
-				last = undefined;
-				fn.apply( that, args );
-			}, frequency );
-		}
-		else {
-			last = now;
-			fn.apply( that, args );
-		}
-	};
-}
+var _fnThrottle = DataTable.util.throttle;
 
 
 /**

-- 
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