[r-cran-dt] 03/07: Fetch source of dataTables.searchHighlight.min.js

Andreas Tille tille at debian.org
Wed Jan 3 14:12:20 UTC 2018


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

tille pushed a commit to branch master
in repository r-cran-dt.

commit cb48f0489d5204b424371708870bde9462b5df9f
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jan 3 14:53:15 2018 +0100

    Fetch source of dataTables.searchHighlight.min.js
---
 .../datatables-plugins_searchHighlight/License.txt | 20 +++++
 .../dataTables.searchHighlight.js                  | 87 ++++++++++++++++++++++
 .../dataTables.searchHighlight.min.js              | 26 +++++++
 .../get-searchHighlight                            |  4 +
 4 files changed, 137 insertions(+)

diff --git a/debian/JS/datatables-plugins_searchHighlight/License.txt b/debian/JS/datatables-plugins_searchHighlight/License.txt
new file mode 100644
index 0000000..9ade2f1
--- /dev/null
+++ b/debian/JS/datatables-plugins_searchHighlight/License.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2010-2015 SpryMedia Limited
+http://datatables.net
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.js b/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.js
new file mode 100644
index 0000000..d814f23
--- /dev/null
+++ b/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.js
@@ -0,0 +1,87 @@
+/*! SearchHighlight for DataTables v1.0.1
+ * 2014 SpryMedia Ltd - datatables.net/license
+ */
+
+/**
+ * @summary     SearchHighlight
+ * @description Search term highlighter for DataTables
+ * @version     1.0.1
+ * @file        dataTables.searchHighlight.js
+ * @author      SpryMedia Ltd (www.sprymedia.co.uk)
+ * @contact     www.sprymedia.co.uk/contact
+ * @copyright   Copyright 2014 SpryMedia Ltd.
+ *
+ * License      MIT - http://datatables.net/license/mit
+ *
+ * This feature plug-in for DataTables will highlight search terms in the
+ * DataTable as they are entered into the main search input element, or via the
+ * `search()` API method.
+ *
+ * It depends upon the jQuery Highlight plug-in by Bartek Szopka:
+ * 	  http://bartaz.github.io/sandbox.js/jquery.highlight.js
+ *
+ * Search highlighting in DataTables can be enabled by:
+ *
+ * * Adding the class `searchHighlight` to the HTML table
+ * * Setting the `searchHighlight` parameter in the DataTables initialisation to
+ *   be true
+ * * Setting the `searchHighlight` parameter to be true in the DataTables
+ *   defaults (thus causing all tables to have this feature) - i.e.
+ *   `$.fn.dataTable.defaults.searchHighlight = true`.
+ *
+ * For more detailed information please see:
+ *     http://datatables.net/blog/2014-10-22
+ */
+
+(function(window, document, $){
+
+
+function highlight( body, table )
+{
+	// Removing the old highlighting first
+	body.unhighlight();
+
+	// Don't highlight the "not found" row, so we get the rows using the api
+	if ( table.rows( { filter: 'applied' } ).data().length ) {
+		table.columns().every( function () {
+				var column = this;
+				column.nodes().flatten().to$().unhighlight({ className: 'column_highlight' });
+				column.nodes().flatten().to$().highlight( $.trim( column.search() ).split(/\s+/), { className: 'column_highlight' } );
+		} );
+		body.highlight( $.trim( table.search() ).split(/\s+/) );
+	}
+}
+
+
+// Listen for DataTables initialisations
+$(document).on( 'init.dt.dth', function (e, settings, json) {
+	if ( e.namespace !== 'dt' ) {
+		return;
+	}
+
+	var table = new $.fn.dataTable.Api( settings );
+	var body = $( table.table().body() );
+
+	if (
+		$( table.table().node() ).hasClass( 'searchHighlight' ) || // table has class
+		settings.oInit.searchHighlight                          || // option specified
+		$.fn.dataTable.defaults.searchHighlight                    // default set
+	) {
+		table
+			.on( 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth', function () {
+				highlight( body, table );
+			} )
+			.on( 'destroy', function () {
+				// Remove event handler
+				table.off( 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth' );
+			} );
+
+		// initial highlight for state saved conditions and initial states
+		if ( table.search() ) {
+			highlight( body, table );
+		}
+	}
+} );
+
+
+})(window, document, jQuery);
diff --git a/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.min.js b/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.min.js
new file mode 100644
index 0000000..a06c4e2
--- /dev/null
+++ b/debian/JS/datatables-plugins_searchHighlight/dataTables.searchHighlight.min.js
@@ -0,0 +1,26 @@
+/*
+   Copyright 2014 SpryMedia Ltd.
+
+ License      MIT - http://datatables.net/license/mit
+
+ This feature plug-in for DataTables will highlight search terms in the
+ DataTable as they are entered into the main search input element, or via the
+ `search()` API method.
+
+ It depends upon the jQuery Highlight plug-in by Bartek Szopka:
+    http://bartaz.github.io/sandbox.js/jquery.highlight.js
+
+ Search highlighting in DataTables can be enabled by:
+
+ Adding the class `searchHighlight` to the HTML table
+ Setting the `searchHighlight` parameter in the DataTables initialisation to
+   be true
+ Setting the `searchHighlight` parameter to be true in the DataTables
+   defaults (thus causing all tables to have this feature) - i.e.
+   `$.fn.dataTable.defaults.searchHighlight = true`.
+
+ For more detailed information please see:
+     http://datatables.net/blog/2014-10-22
+*/
+(function(h,e,a){function f(d,c){d.unhighlight();c.rows({filter:"applied"}).data().length&&(c.columns().every(function(){this.nodes().flatten().to$().unhighlight({className:"column_highlight"});this.nodes().flatten().to$().highlight(a.trim(this.search()).split(/\s+/),{className:"column_highlight"})}),d.highlight(a.trim(c.search()).split(/\s+/)))}a(e).on("init.dt.dth",function(d,c,e){if("dt"===d.namespace){var b=new a.fn.dataTable.Api(c),g=a(b.table().body());if(a(b.table().node()).hasCla [...]
+c.oInit.searchHighlight||a.fn.dataTable.defaults.searchHighlight)b.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){f(g,b)}).on("destroy",function(){b.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}),b.search()&&f(g,b)}})})(window,document,jQuery);
diff --git a/debian/JS/datatables-plugins_searchHighlight/get-searchHighlight b/debian/JS/datatables-plugins_searchHighlight/get-searchHighlight
new file mode 100755
index 0000000..7fd611d
--- /dev/null
+++ b/debian/JS/datatables-plugins_searchHighlight/get-searchHighlight
@@ -0,0 +1,4 @@
+#!/bin/sh
+wget -q -N https://raw.githubusercontent.com/DataTables/Plugins/master/features/searchHighlight/dataTables.searchHighlight.js
+closure-compiler  --charset 'utf-8' --js dataTables.searchHighlight.js --js_output_file dataTables.searchHighlight.min.js
+wget -q -N https://raw.githubusercontent.com/DataTables/Plugins/master/License.txt

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-dt.git



More information about the debian-science-commits mailing list