15 lines
4.2 KiB
JavaScript
15 lines
4.2 KiB
JavaScript
|
/*!
|
||
|
DataTables Bootstrap 3 integration
|
||
|
©2011-2015 SpryMedia Ltd - datatables.net/license
|
||
|
*/
|
||
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var f=a.length,d=0;d<f;d++){var k=a[d];if(b.call(c,k,d,a))return{i:d,v:k}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!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,f){if(b){c=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var d=a[f];d in c||(c[d]={});c=c[d]}a=a[a.length-1];f=c[a];b=b(f);b!=f&&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","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,f){function d(){for(var c=a("table.mdc-data-table__table").children(),b=0;b<c.length;b++)if("THEAD"===c[b].tagName){var d=a(c[b]).children();console.log(d);for(var e=0;e<d.length;e++)if("TR"===
|
||
|
d[e].tagName){a(d[e]).addClass("mdc-data-table__header-row");for(var g=a(d[e]).children(),l=0;l<g.length;l++)"TH"===g[l].tagName&&a(g[l]).addClass("mdc-data-table__header-cell")}}else if("TBODY"===c[b].tagName)for(a(c[b]).addClass("mdc-data-table__content"),d=a(c[b]).children(),e=0;e<d.length;e++)if("TR"===d[e].tagName)for(a(d[e]).addClass("mdc-data-table__row"),g=a(d[e]).children(),l=0;l<g.length;l++)"TD"===g[l].tagName&&a(g[l]).addClass("mdc-data-table__cell");console.log(c)}var k=a.fn.dataTable;
|
||
|
a.extend(!0,k.defaults,{dom:"<'mdc-layout-grid'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-6'l><'mdc-cell mdc-layout-grid__cell--span-6'f>>><'mdc-layout-grid dt-table'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-12'tr>>><'mdc-layout-grid'<'mdc-layout-grid__inner'<'mdc-cell mdc-layout-grid__cell--span-4'i><'mdc-cell mdc-layout-grid__cell--span-8'p>>>",renderer:"material"});a.extend(k.ext.classes,{sTable:"mdc-data-table__table",sHeaderTH:"mdc-data-table__header-row",
|
||
|
sWrapper:"dataTables_wrapper form-inline dt-material mdc-data-table",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});k.ext.renderer.pageButton.material=function(b,d,x,e,g,l){var r=new k.Api(b),p=b.oLanguage.oPaginate,w=b.oLanguage.oAria.paginate||{},m,n,t=0,u=function(c,d){var e,f=function(b){b.preventDefault();a(b.currentTarget).hasClass("disabled")||r.page()==b.data.action||r.page(b.data.action).draw("page")};var k=
|
||
|
0;for(e=d.length;k<e;k++){var h=d[k];if(a.isArray(h))u(c,h);else{m="";var q=!1;switch(h){case "ellipsis":m="…";n="disabled";break;case "first":m=p.sFirst;n=h+(0<g?"":" disabled");break;case "previous":m=p.sPrevious;n=h+(0<g?"":" disabled");break;case "next":m=p.sNext;n=h+(g<l-1?"":" disabled");break;case "last":m=p.sLast;n=h+(g<l-1?"":" disabled");break;default:m=h+1,n="",q=g===h}q&&(n+=" mdc-button--raised mdc-button--colored");m&&(q=a("<button>",{"class":"mdc-button "+n,id:0===x&&"string"===
|
||
|
typeof h?b.sTableId+"_"+h:null,"aria-controls":b.sTableId,"aria-label":w[h],"data-dt-idx":t,tabindex:b.iTabIndex,disabled:-1!==n.indexOf("disabled")}).html(m).appendTo(c),b.oApi._fnBindAction(q,{action:h},f),t++)}}};try{var v=a(d).find(c.activeElement).data("dt-idx")}catch(y){}u(a(d).empty().html('<div class="pagination"/>').children(),e);v!==f&&a(d).find("[data-dt-idx="+v+"]").focus()};a(c).on("init.dt",function(b,c){"dt"===b.namespace&&(new a.fn.dataTable.Api(c),d())});a(c).on("draw.dt",function(b,
|
||
|
c){"dt"===b.namespace&&(new a.fn.dataTable.Api(c),d())});return k});
|