You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/features/searchPane/dataTables.searchPane.min.js

9 lines
3.1 KiB
JavaScript

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">&times;</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))})});