parent
7a6ff3585f
commit
6663abad97
@ -1,17 +1,8 @@
|
|||||||
/*!
|
/*!
|
||||||
Copyright 2014 SpryMedia Ltd.
|
|
||||||
|
|
||||||
License MIT - http://datatables.net/license/mit
|
|
||||||
|
|
||||||
For more detailed information please see:
|
|
||||||
http://datatables.net/blog/2014-09-22
|
|
||||||
AlphabetSearch for DataTables v1.0.0
|
AlphabetSearch for DataTables v1.0.0
|
||||||
2014 SpryMedia Ltd - datatables.net/license
|
2014 SpryMedia Ltd - datatables.net/license
|
||||||
*/
|
*/
|
||||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,d,b){a instanceof String&&(a=String(a));for(var c=a.length,e=0;e<c;e++){var g=a[e];if(d.call(b,g,e,a))return{i:e,v:g}}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,d,b){a!=Array.prototype&&a!=Object.prototype&&(a[d]=b.value)};
|
(function(){function f(b,c){c.empty();c.append("Search: ");for(var a=b.column(0).data(),d,e={},g=0,f=a.length;g<f;g++)d=a[g].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase(),e[d]?e[d]++:e[d]=1;$('<span class="clear active"/>').data("letter","").data("match-count",a.length).html("None").appendTo(c);for(a=0;26>a;a++)d=String.fromCharCode(65+a),$("<span/>").data("letter",d).data("match-count",e[d]||0).addClass(!e[d]?"empty":"").html(d).appendTo(c);$('<div class="alphabetInfo"></div>').appendTo(c)}
|
||||||
$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,d,b,c){if(d){b=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var e=a[c];e in b||(b[e]={});b=b[e]}a=a[a.length-1];c=b[a];d=d(c);d!=c&&null!=d&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:d})}};
|
$.fn.dataTable.Api.register("alphabetSearch()",function(b){this.iterator("table",function(c){c.alphabetSearch=b});return this});$.fn.dataTable.Api.register("alphabetSearch.recalc()",function(){this.iterator("table",function(b){f(new $.fn.dataTable.Api(b),$("div.alphabet",this.table().container()))});return this});$.fn.dataTable.ext.search.push(function(b,c){return!b.alphabetSearch||c[0].charAt(0)===b.alphabetSearch?!0:!1});$.fn.dataTable.AlphabetSearch=function(b){var c=new $.fn.dataTable.Api(b),
|
||||||
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6-impl","es3");
|
a=$('<div class="alphabet"/>');f(c,a);a.on("click","span",function(){a.find(".active").removeClass("active");$(this).addClass("active");c.alphabetSearch($(this).data("letter")).draw()});a.on("mouseenter","span",function(){a.find("div.alphabetInfo").css({opacity:1,left:$(this).position().left,width:$(this).width()}).html($(this).data("match-count"))}).on("mouseleave","span",function(){a.find("div.alphabetInfo").css("opacity",0)});this.node=function(){return a}};$.fn.DataTable.AlphabetSearch=$.fn.dataTable.AlphabetSearch;
|
||||||
(function(){function a(a,b){b.empty();b.append("Search: ");var c=a.column(0).data();a={};for(var d=0,g=c.length;d<g;d++){var f=c[d].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase();a[f]?a[f]++:a[f]=1}$('<span class="clear active"/>').data("letter","").data("match-count",c.length).html("None").appendTo(b);for(c=0;26>c;c++)f=String.fromCharCode(65+c),$("<span/>").data("letter",f).data("match-count",a[f]||0).addClass(a[f]?"":"empty").html(f).appendTo(b);$('<div class="alphabetInfo"></div>').appendTo(b)}
|
$.fn.dataTable.ext.feature.push({fnInit:function(b){return(new $.fn.dataTable.AlphabetSearch(b)).node()},cFeature:"A"})})();
|
||||||
$.fn.dataTable.Api.register("alphabetSearch()",function(a){this.iterator("table",function(b){b.alphabetSearch=a});return this});$.fn.dataTable.Api.register("alphabetSearch.recalc()",function(d){this.iterator("table",function(b){a(new $.fn.dataTable.Api(b),$("div.alphabet",this.table().container()))});return this});$.fn.dataTable.ext.search.push(function(a,b){return a.alphabetSearch&&b[0].charAt(0)!==a.alphabetSearch?!1:!0});$.fn.dataTable.AlphabetSearch=function(d){var b=new $.fn.dataTable.Api(d),
|
|
||||||
c=$('<div class="alphabet"/>');a(b,c);c.on("click","span",function(){c.find(".active").removeClass("active");$(this).addClass("active");b.alphabetSearch($(this).data("letter")).draw()});c.on("mouseenter","span",function(){c.find("div.alphabetInfo").css({opacity:1,left:$(this).position().left,width:$(this).width()}).html($(this).data("match-count"))}).on("mouseleave","span",function(){c.find("div.alphabetInfo").css("opacity",0)});this.node=function(){return c}};$.fn.DataTable.AlphabetSearch=$.fn.dataTable.AlphabetSearch;
|
|
||||||
$.fn.dataTable.ext.feature.push({fnInit:function(a){return(new $.fn.dataTable.AlphabetSearch(a)).node()},cFeature:"A"})})();
|
|
||||||
|
@ -1,42 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
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
|
Deep linking options parsing support for DataTables
|
||||||
2017 SpryMedia Ltd - datatables.net/license
|
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);
|
(function(h,k,b){var i=b.fn.dataTable.ext.internal._fnSetObjectDataFn;b.fn.dataTable.ext.deepLink=function(d){for(var e=location.search.replace(/^\?/,"").split("&"),f={},c=0,j=e.length;c<j;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]/)){if(0===a.indexOf("{")||0===a.indexOf("["))try{a=b.parseJSON(a)}catch(h){}}else a*=1;("all"===d||-1!==b.inArray(g,d))&&i(g)(f,a)}return f}})(window,document,jQuery);
|
||||||
|
@ -1,25 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
Copyright 2014 SpryMedia Ltd.
|
|
||||||
|
|
||||||
License MIT - http://datatables.net/license/mit
|
|
||||||
|
|
||||||
This feature plug-in for DataTables adds page length control links to the
|
|
||||||
DataTable. The `dom` option can be used to insert the control using the `L`
|
|
||||||
character option and it uses the `lengthMenu` options of DataTables to
|
|
||||||
determine what to display.
|
|
||||||
|
|
||||||
@example
|
|
||||||
$('#myTable').DataTable( {
|
|
||||||
dom: 'Lfrtip'
|
|
||||||
} );
|
|
||||||
|
|
||||||
@example
|
|
||||||
$('#myTable').DataTable( {
|
|
||||||
lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
|
|
||||||
dom: 'Lfrtip'
|
|
||||||
} );
|
|
||||||
Page length control via links for DataTables
|
Page length control via links for DataTables
|
||||||
2014 SpryMedia Ltd - datatables.net/license
|
2014 SpryMedia Ltd - datatables.net/license
|
||||||
*/
|
*/
|
||||||
(function(k,l,a,m){a.fn.dataTable.LengthLinks=function(d){var c=new a.fn.dataTable.Api(d),f=c.settings()[0],e=a("<div></div>").addClass(f.oClasses.sLength),h=null;this.container=function(){return e[0]};e.on("click.dtll","a",function(b){b.preventDefault();c.page.len(1*a(this).data("length")).draw(!1)});c.on("draw",function(){if(c.page.len()!==h){var b=f.aLengthMenu,d=2===b.length&&a.isArray(b[0])?b[1]:b,g=2===b.length&&a.isArray(b[0])?b[0]:b,b=a.map(g,function(b,a){return b==c.page.len()?'<a class="active" data-length="'+
|
(function(i,j,a){a.fn.dataTable.LengthLinks=function(d){var c=new a.fn.dataTable.Api(d),f=c.settings()[0],e=a("<div></div>").addClass(f.oClasses.sLength),h=null;this.container=function(){return e[0]};e.on("click.dtll","a",function(b){b.preventDefault();c.page.len(1*a(this).data("length")).draw(!1)});c.on("draw",function(){if(c.page.len()!==h){var b=f.aLengthMenu,d=2===b.length&&a.isArray(b[0])?b[1]:b,g=2===b.length&&a.isArray(b[0])?b[0]:b,b=a.map(g,function(b,a){return b==c.page.len()?'<a class="active" data-length="'+
|
||||||
g[a]+'">'+d[a]+"</a>":'<a data-length="'+g[a]+'">'+d[a]+"</a>"});e.html(f.oLanguage.sLengthMenu.replace("_MENU_",b.join(" | ")));h=c.page.len()}});c.on("destroy",function(){e.off("click.dtll","a")})};a.fn.dataTable.ext.feature.push({fnInit:function(d){return(new a.fn.dataTable.LengthLinks(d)).container()},cFeature:"L",sFeature:"LengthLinks"})})(window,document,jQuery);
|
g[a]+'">'+d[a]+"</a>":'<a data-length="'+g[a]+'">'+d[a]+"</a>"});e.html(f.oLanguage.sLengthMenu.replace("_MENU_",b.join(" | ")));h=c.page.len()}});c.on("destroy",function(){e.off("click.dtll","a")})};a.fn.dataTable.ext.feature.push({fnInit:function(d){return(new a.fn.dataTable.LengthLinks(d)).container()},cFeature:"L",sFeature:"LengthLinks"})})(window,document,jQuery);
|
||||||
|
@ -1,30 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
Copyright 2015 SpryMedia Ltd.
|
|
||||||
|
|
||||||
License MIT - http://datatables.net/license/mit
|
|
||||||
|
|
||||||
This feature plug-in for DataTables will automatically change the DataTables
|
|
||||||
page length in order to fit inside its container. This can be particularly
|
|
||||||
useful for control panels and other interfaces which resize dynamically with
|
|
||||||
the user's browser window instead of scrolling.
|
|
||||||
|
|
||||||
Page resizing in DataTables can be enabled by using any one of the following
|
|
||||||
options:
|
|
||||||
|
|
||||||
* Adding the class `pageResize` to the HTML table
|
|
||||||
* Setting the `pageResize` parameter in the DataTables initialisation to
|
|
||||||
be true - i.e. `pageResize: true`
|
|
||||||
* Setting the `pageResize` parameter to be true in the DataTables
|
|
||||||
defaults (thus causing all tables to have this feature) - i.e.
|
|
||||||
`$.fn.dataTable.defaults.pageResize = true`.
|
|
||||||
* Creating a new instance: `new $.fn.dataTable.PageResize( table );` where
|
|
||||||
`table` is a DataTable's API instance.
|
|
||||||
|
|
||||||
For more detailed information please see:
|
|
||||||
http://datatables.net/blog/2015-04-10
|
|
||||||
PageResize for DataTables v1.0.0
|
PageResize for DataTables v1.0.0
|
||||||
2015 SpryMedia Ltd - datatables.net/license
|
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;
|
(function(c){var f=function(a,d){var b=a.table();this.s={dt:a,host:c(b.container()).parent(),header:c(b.header()),footer:c(b.footer()),body:c(b.body()),container:c(b.container()),table:c(b.node()),delta:d};b=this.s.host;"static"===b.css("position")&&b.css("position","relative");this._attach();this._size()};f.prototype={_size:function(){var a=this.s,d=a.dt,b=d.table(),h=c(a.table).offset().top,f=c("tr",a.body).eq(0).height(),e=a.host.height(),i=b.header().parentNode!==b.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<a&&a!==c.page.len()&&c.page.len(a).draw()},_attach:function(){var a=this,c=b("<object/>").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=
|
i||(b.header()&&(e-=a.header.height()),b.footer()&&(e-=a.footer.height()));e=e-h-(a.container.height()-(h+a.table.height()));!isNaN(parseFloat(g))&&isFinite(g)&&(e-=g);a=Math.floor(e/f);Infinity!==a&&(-Infinity!==a&&!isNaN(a)&&0<a&&a!==d.page.len())&&d.page.len(a).draw()},_attach:function(){var a=this,d=c("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");d[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(){var d=b.clientHeight||b.offsetHeight;d!==c&&(c=d,a._size())}};d.appendTo(this.s.host).attr("data","about:blank")}};c.fn.dataTable.PageResize=f;c.fn.DataTable.PageResize=f;c(document).on("init.dt",function(a,d){if("dt"===a.namespace){var b=new c.fn.dataTable.Api(d);(c(b.table().node()).hasClass("pageResize")||d.oInit.pageResize||c.fn.dataTable.defaults.pageResize)&&new f(b,d.oInit.pageResizeManualDelta)}})})(jQuery);
|
||||||
|
@ -1,26 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
Copyright 2015 SpryMedia Ltd.
|
|
||||||
|
|
||||||
License MIT - http://datatables.net/license/mit
|
|
||||||
|
|
||||||
This feature plug-in for DataTables will automatically change the DataTables
|
|
||||||
page length in order to fit inside its container. This can be particularly
|
|
||||||
useful for control panels and other interfaces which resize dynamically with
|
|
||||||
the user's browser window instead of scrolling.
|
|
||||||
|
|
||||||
Page resizing in DataTables can be enabled by using any one of the following
|
|
||||||
options:
|
|
||||||
|
|
||||||
* Setting the `scrollResize` parameter in the DataTables initialisation to
|
|
||||||
be true - i.e. `scrollResize: true`
|
|
||||||
* Setting the `scrollResize` parameter to be true in the DataTables
|
|
||||||
defaults (thus causing all tables to have this feature) - i.e.
|
|
||||||
`$.fn.dataTable.defaults.scrollResize = true`.
|
|
||||||
* Creating a new instance: `new $.fn.dataTable.ScrollResize( table );` where
|
|
||||||
`table` is a DataTable's API instance.
|
|
||||||
ScrollResize for DataTables v1.0.0
|
ScrollResize for DataTables v1.0.0
|
||||||
2015 SpryMedia Ltd - datatables.net/license
|
2015 SpryMedia Ltd - datatables.net/license
|
||||||
*/
|
*/
|
||||||
(function(a){var e=function(d){var c=this,b=d.table();this.s={dt:d,host:a(b.container()).parent(),header:a(b.header()),footer:a(b.footer()),body:a(b.body()),container:a(b.container()),table:a(b.node())};b=this.s.host;"static"===b.css("position")&&b.css("position","relative");d.on("draw",function(){c._size()});this._attach();this._size()};e.prototype={_size:function(){var d=this.s,c=d.dt,b=c.table(),h=a(d.table).offset().top,g=d.host.height(),f=a("div.dataTables_scrollBody",b.container()),g=g-h-(d.container.height()-
|
(function(a){var e=function(d){var c=this,b=d.table();this.s={dt:d,host:a(b.container()).parent(),header:a(b.header()),footer:a(b.footer()),body:a(b.body()),container:a(b.container()),table:a(b.node())};b=this.s.host;"static"===b.css("position")&&b.css("position","relative");d.on("draw",function(){c._size()});this._attach();this._size()};e.prototype={_size:function(){var d=this.s,c=d.dt,b=c.table(),h=a(d.table).offset().top,g=d.host.height(),f=a("div.dataTables_scrollBody",b.container()),g=g-h-(d.container.height()-
|
||||||
(h+f.height()));a("div.dataTables_scrollBody",b.container()).css({maxHeight:g,height:g});c.fixedColumns&&c.fixedColumns().relayout()},_attach:function(){var d=this,c=a("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");c[0].onload=function(){var b=this.contentDocument.body,a=b.offsetHeight,c=this.contentDocument;(c.defaultView||c.parentWindow).onresize=function(){var f=b.clientHeight||b.offsetHeight,
|
(h+f.height()));a("div.dataTables_scrollBody",b.container()).css({maxHeight:g,height:g});c.fixedColumns&&c.fixedColumns().relayout()},_attach:function(){var d=this,c=a("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");c[0].onload=function(){var b=this.contentDocument.body,a=b.offsetHeight,c=this.contentDocument;(c.defaultView||c.parentWindow).onresize=function(){var f=b.clientHeight||b.offsetHeight,
|
||||||
e=c.documentElement.clientHeight;!f&&e&&(f=e);f!==a&&(a=f,d._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=e;a.fn.DataTable.ScrollResize=e;a(document).on("init.dt",function(d,c){"dt"===d.namespace&&(d=new a.fn.dataTable.Api(c),(c.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new e(d))})})(jQuery);
|
e=c.documentElement.clientHeight;!f&&e&&(f=e);f!==a&&(a=f,d._size())}};c.appendTo(this.s.host).attr("data","about:blank")}};a.fn.dataTable.ScrollResize=e;a.fn.DataTable.ScrollResize=e;a(document).on("init.dt",function(d,c){if("dt"===d.namespace){var b=new a.fn.dataTable.Api(c);(c.oInit.scrollResize||a.fn.dataTable.defaults.scrollResize)&&new e(b)}})})(jQuery);
|
||||||
|
@ -1,28 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
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
|
SearchHighlight for DataTables v1.0.1
|
||||||
2014 SpryMedia Ltd - datatables.net/license
|
2014 SpryMedia Ltd - datatables.net/license
|
||||||
*/
|
*/
|
||||||
(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")||
|
(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(){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);
|
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);
|
||||||
|
@ -1,25 +1,12 @@
|
|||||||
/*!
|
/*!
|
||||||
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
|
SearchPane 0.0.1
|
||||||
2017 SpryMedia Ltd - datatables.net/license
|
2017 SpryMedia Ltd - datatables.net/license
|
||||||
*/
|
*/
|
||||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,e,c){a instanceof String&&(a=String(a));for(var g=a.length,d=0;d<g;d++){var l=a[d];if(e.call(c,l,d,a))return{i:d,v:l}}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,e,c){a!=Array.prototype&&a!=Object.prototype&&(a[e]=c.value)};
|
(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("<div/>").addClass(this.classes.container)};this.c=b.extend(!0,{},f.defaults,
|
||||||
$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,e,c,g){if(e){c=$jscomp.global;a=a.split(".");for(g=0;g<a.length-1;g++){var d=a[g];d in c||(c[d]={});c=c[d]}a=a[a.length-1];g=c[a];e=e(g);e!=g&&null!=e&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:e})}};
|
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"===
|
||||||
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3");
|
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("<ul/>"),m=this._binData(e.data().flatten());
|
||||||
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return a(e,window,document)}):"object"===typeof exports?module.exports=function(e,c){e||(e=window);c&&c.fn.dataTable||(c=require("datatables.net")(e,c).$);return a(c,e,e.document)}:a(jQuery,window,document)})(function(a,e,c,g){function d(b,h){var f=this;b=new l.Api(b);this.classes=a.extend(!0,{},d.classes);this.dom={container:a("<div/>").addClass(this.classes.container)};this.c=a.extend(!0,{},d.defaults,
|
if(!(this._variance(m)<this.c.threshold)){for(var f=e.search(),f=f?f.substr(1,f.length-2).split("|"):[],d=e.data().unique().sort().toArray(),i=0,h=d.length;i<h;i++)if(d[i]){var j=b("<li/>").html('<span class="'+g.label+'">'+d[i]+"</span>").data("filter",d[i]).append(b("<span/>").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("<div/>").data("column",a).addClass(c.container).addClass(f.length?
|
||||||
h);this.s={dt:b};b.settings()[0].searchPane=this;b.columns(this.c.columns).eq(0).each(function(a){f._pane(a)});a(this.dom.container).on("click","li",function(){f._toggle(this)}).on("click","button."+this.classes.clear,function(){f._clear(a(this).closest("div."+f.classes.pane.container))});this._attach()}var l=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"===
|
c.active:"").append(b('<button type="button">×</button>').addClass(this.classes.clear)).append(b("<div/>").addClass(c.title).html(b(e.header()).text())).append(b("<div/>").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."+
|
||||||
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){var b={};a.each(function(a){a&&(b[a]?b[a]++:b[a]=1)});return b},_clear:function(a){var b=this.classes,f=b.item.selected;a.find("li."+f).removeClass(f);a.removeClass(b.pane.active);this.s.dt.column(a.data("column")).search("").draw()},_pane:function(b){var h=this.classes,f=h.item,h=h.pane,c=this.s.dt.column(b),e=a("<ul/>"),d=this._binData(c.data().flatten());
|
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<d;e++)g+=a[e];for(var g=g/c,f=0,e=0,d=c;e<d;e++)f+=Math.pow(g-a[e],2);return f/(c-1)}});f.classes={container:"dt-searchPanes",clear:"clear",
|
||||||
if(!(this._variance(d)<this.c.threshold)){for(var g=c.search(),g=g?g.substr(1,g.length-2).split("|"):[],m=c.data().unique().sort().toArray(),k=0,l=m.length;k<l;k++)if(m[k]){var n=a("<li/>").html('<span class="'+f.label+'">'+m[k]+"</span>").data("filter",m[k]).append(a("<span/>").addClass(f.count).html(d[m[k]]));if(g.length){var p=m[k].replace?a.fn.dataTable.util.escapeRegex(m[k]):m[k];-1!==a.inArray(p,g)&&n.addClass(f.selected)}e.append(n)}f=a("<div/>").data("column",b).addClass(h.container).addClass(g.length?
|
pane:{active:"filtering",container:"pane",title:"title",scroller:"scroller"},item:{selected:"selected",label:"label",count:"count"}};f.defaults={container:function(a){return a.table().container()},columns:k,insert:"prepend",threshold:0.5};f.version="0.0.1";b.fn.dataTable.SearchPanes=f;b.fn.DataTable.SearchPanes=f;j.Api.register("searchPanes.rebuild()",function(){return this.iterator("table",function(a){a.searchPane&&a.searchPane.rebuild()})});b(h).on("init.dt",function(a,c){if("dt"===a.namespace){var d=
|
||||||
h.active:"").append(a('<button type="button">×</button>').addClass(this.classes.clear)).append(a("<div/>").addClass(h.title).html(a(c.header()).text())).append(a("<div/>").addClass(h.scroller).append(e));h=this.dom.container;c=h.children().map(function(){if(a(this).data("column")==b)return this});c.length?c.replaceWith(f):a(h).append(f)}},_toggle:function(b){var c=this.classes,f=c.item.selected,e=this.s.dt;b=a(b);var d=b.closest("div."+c.pane.container);b.toggleClass(f,!b.hasClass(f));b=d.find("li."+
|
c.oInit.searchPane,e=j.defaults.searchPane;if(d||e)e=b.extend({},d,e),!1!==d&&new f(c,e)}})});
|
||||||
f);0===b.length?(d.removeClass(c.pane.active),e.column(d.data("column")).search("").draw()):(d.addClass(c.pane.active),e.column(d.data("column")).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 c=b.length,f=0,d=0,e=c;d<e;d++)f+=b[d];for(var f=f/c,g=0,d=0,e=c;d<e;d++)g+=Math.pow(f-b[d],2);return g/(c-1)}});d.classes={container:"dt-searchPanes",clear:"clear",
|
|
||||||
pane:{active:"filtering",container:"pane",title:"title",scroller:"scroller"},item:{selected:"selected",label:"label",count:"count"}};d.defaults={container:function(a){return a.table().container()},columns:g,insert:"prepend",threshold:.5};d.version="0.0.1";a.fn.dataTable.SearchPanes=d;a.fn.DataTable.SearchPanes=d;l.Api.register("searchPanes.rebuild()",function(){return this.iterator("table",function(a){a.searchPane&&a.searchPane.rebuild()})});a(c).on("init.dt",function(b,c,e){"dt"===b.namespace&&(b=
|
|
||||||
c.oInit.searchPane,e=l.defaults.searchPane,b||e)&&(e=a.extend({},b,e),!1!==b&&new d(c,e))})});
|
|
||||||
|
Loading…
Reference in new issue