commit
389a989060
@ -1,4 +1,42 @@
|
||||
/*! Deep linking options parsing support for DataTables
|
||||
* 2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
/*!
|
||||
Copyright 2017 SpryMedia Ltd.
|
||||
|
||||
License MIT - http://datatables.net/license/mit
|
||||
|
||||
This feature plug-in for DataTables provides a function which will
|
||||
take DataTables options from the browser's URL search string and
|
||||
return an object that can be used to construct a DataTable. This
|
||||
allows deep linking to be easily implemented with DataTables - for
|
||||
example a URL might be `myTable?displayStart=10` which will
|
||||
automatically cause the second page of the DataTable to be displayed.
|
||||
|
||||
This plug-in works on a whitelist basis - you must specify which
|
||||
[initialisation parameters](//datatables.net/reference/option) you
|
||||
want the URL search string to specify. Any parameter given in the
|
||||
URL which is not listed will be ignored (e.g. you are unlikely to
|
||||
want to let the URL search string specify the `ajax` option).
|
||||
|
||||
This specification is done by passing an array of property names
|
||||
to the `$.fn.dataTable.ext.deepLink` function. If you do which to
|
||||
allow _every_ parameter (I wouldn't recommend it) you can use `all`
|
||||
instead of an array.
|
||||
|
||||
@example
|
||||
// Allow a display start point and search string to be specified
|
||||
$('#myTable').DataTable(
|
||||
$.fn.dataTable.ext.deepLink( [ 'displayStart', 'search.search' ] )
|
||||
);
|
||||
|
||||
@example
|
||||
// As above, but with a default search
|
||||
var options = $.fn.dataTable.ext.deepLink(['displayStart', 'search.search']);
|
||||
|
||||
$('#myTable').DataTable(
|
||||
$.extend( true, {
|
||||
search: { search: 'Initial search value' }
|
||||
}, options )
|
||||
);
|
||||
Deep linking options parsing support for DataTables
|
||||
2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(l,m,b,n){var h=b.fn.dataTable.ext.internal._fnSetObjectDataFn;b.fn.dataTable.ext.deepLink=function(d){for(var e=location.search.replace(/^\?/,"").split("&"),f={},c=0,k=e.length;c<k;c++){var a=e[c].split("="),g=decodeURIComponent(a[0]),a=decodeURIComponent(a[1]);if("true"===a)a=!0;else if("false"===a)a=!1;else if(!a.match(/[^\d]/))a*=1;else if(0===a.indexOf("{")||0===a.indexOf("["))try{a=b.parseJSON(a)}catch(p){}"all"!==d&&-1===b.inArray(g,d)||h(g)(f,a)}return f}})(window,document,jQuery);
|
||||
|
@ -1,6 +1,28 @@
|
||||
/*!
|
||||
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
|
||||
SearchHighlight for DataTables v1.0.1
|
||||
2014 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(h,g,a){function e(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(g).on("init.dt.dth",function(d,c){if("dt"===d.namespace){var b=new a.fn.dataTable.Api(c),f=a(b.table().body());if(a(b.table().node()).hasClass("searchHighlight")||
|
||||
c.oInit.searchHighlight||a.fn.dataTable.defaults.searchHighlight)b.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){e(f,b)}).on("destroy",function(){b.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}),b.search()&&e(f,b)}})})(window,document,jQuery);
|
||||
(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()).hasClass("searchHighlight")||
|
||||
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);
|
||||
|
@ -1,5 +1,8 @@
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(c){return b(c,window,document)}):"object"===typeof exports?module.exports=function(c,a){c||(c=window);if(!a||!a.fn.dataTable)a=require("datatables.net")(c,a).$;return b(a,c,c.document)}:b(jQuery,window,document)})(function(b,c,a){function f(c,a){var j=this,d=new k.Api(c),g=b('<div class="dt-searchPane"/>').appendTo(a.container);d.columns(a.columns).eq(0).each(function(l){for(var e=d.column(l),c=b("<ul/>"),
|
||||
a=b(e.header()).hasClass("tags"),n=j._binData(e.data().flatten(),a),h=e.search(),h=h.length&&h[0]?h[0].substr(1,h[0].length-2).split("|"):[],a=a?d.ajax.json().tags:e.data().unique().sort().toArray(),i=0,m=a.length;i<m;i++)if(a[i]){var f=b("<li/>").html('<span class="label">'+a[i]+"</span>").data("filter",a[i]).append(b('<span class="count" />').html(n[a[i]]));-1!==b.inArray(a[i],h)&&f.addClass("selected");c.append(f)}b(g).append(b('<div class="pane"/>').data("column",l).addClass(h.length?"filtering":
|
||||
"").append('<button type="button" class="close">×</button>').append(b('<div class="title"/>').html(b(e.header()).text())).append(b('<div class="scroller"/>').append(c)))});b(g).on("click","li",function(){b(this).hasClass("selected")?b(this).removeClass("selected"):b(this).addClass("selected");var a=b(this).closest("div.pane"),c=a.find("li.selected");0===c.length?(a.removeClass("filtering"),d.column(a.data("column")).search("").draw()):(a.addClass("filtering"),d.column(a.data("column")).search(b.map(c,
|
||||
function(a){return b(a).data("filter")}).join("|"),!0,!1).draw())});b(g).on("click","button.close",function(){var a=b(this).closest("div.pane");a.find("li.selected").removeClass("selected");a.removeClass("filtering");d.column(a.data("column")).search("").draw()})}var k=b.fn.dataTable;b.extend(f.prototype,{_binData:function(a,b){var c={};a.each(function(a){if(a)if(b)for(var a=a.split(","),g=0,f=a.length;g<f;g++){var e=a[g];c[e]?c[e]++:c[e]=1}else c[a]?c[a]++:c[a]=1});return c}});b(a).on("init.dt",
|
||||
function(a,c){if("dt"===a.namespace){var j=c.oInit.searchPane,d=k.defaults.searchPane;if(j||d)d=b.extend({},j,d),!1!==j&&new f(c,d)}})});
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
|
||||
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};
|
||||
$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(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net")(b,c).$);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,d){function e(c,b){var p=this,k=new f.Api(c),e=a('<div class="dt-searchPane"/>').appendTo(b.container);k.columns(b.columns).eq(0).each(function(c){for(var b=k.column(c),m=a("<ul/>"),
|
||||
d=a(b.header()).hasClass("tags"),n=p._binData(b.data().flatten(),d),g=b.search(),g=g.length&&g[0]?g[0].substr(1,g[0].length-2).split("|"):[],d=d?k.ajax.json().tags:b.data().unique().sort().toArray(),h=0,f=d.length;h<f;h++)if(d[h]){var l=a("<li/>").html('<span class="label">'+d[h]+"</span>").data("filter",d[h]).append(a('<span class="count" />').html(n[d[h]]));-1!==a.inArray(d[h],g)&&l.addClass("selected");m.append(l)}a(e).append(a('<div class="pane"/>').data("column",c).addClass(g.length?"filtering":
|
||||
"").append('<button type="button" class="close">×</button>').append(a('<div class="title"/>').html(a(b.header()).text())).append(a('<div class="scroller"/>').append(m)))});a(e).on("click","li",function(){a(this).hasClass("selected")?a(this).removeClass("selected"):a(this).addClass("selected");var b=a(this).closest("div.pane"),c=b.find("li.selected");0===c.length?(b.removeClass("filtering"),k.column(b.data("column")).search("").draw()):(b.addClass("filtering"),k.column(b.data("column")).search(a.map(c,
|
||||
function(b){return a(b).data("filter")}).join("|"),!0,!1).draw())});a(e).on("click","button.close",function(){var b=a(this).closest("div.pane");b.find("li.selected").removeClass("selected");b.removeClass("filtering");k.column(b.data("column")).search("").draw()})}var f=a.fn.dataTable;a.extend(e.prototype,{_binData:function(a,b){var c={};a.each(function(a){if(a)if(b){a=a.split(",");for(var d=0,e=a.length;d<e;d++){var f=a[d];c[f]?c[f]++:c[f]=1}}else c[a]?c[a]++:c[a]=1});return c}});a(c).on("init.dt",
|
||||
function(b,c,d){"dt"===b.namespace&&(b=c.oInit.searchPane,d=f.defaults.searchPane,b||d)&&(d=a.extend({},b,d),!1!==b&&new e(c,d))})});
|
||||
|
Loading…
Reference in new issue