1/*! DataTables Bootstrap 4 integration 2 * © SpryMedia Ltd - datatables.net/license 3 */ 4 5(function( factory ){ 6 if ( typeof define === 'function' && define.amd ) { 7 // AMD 8 define( ['jquery', 'datatables.net'], function ( $ ) { 9 return factory( $, window, document ); 10 } ); 11 } 12 else if ( typeof exports === 'object' ) { 13 // CommonJS 14 var jq = require('jquery'); 15 var cjsRequires = function (root, $) { 16 if ( ! $.fn.dataTable ) { 17 require('datatables.net')(root, $); 18 } 19 }; 20 21 if (typeof window === 'undefined') { 22 module.exports = function (root, $) { 23 if ( ! root ) { 24 // CommonJS environments without a window global must pass a 25 // root. This will give an error otherwise 26 root = window; 27 } 28 29 if ( ! $ ) { 30 $ = jq( root ); 31 } 32 33 cjsRequires( root, $ ); 34 return factory( $, root, root.document ); 35 }; 36 } 37 else { 38 cjsRequires( window, jq ); 39 module.exports = factory( jq, window, window.document ); 40 } 41 } 42 else { 43 // Browser 44 factory( jQuery, window, document ); 45 } 46}(function( $, window, document ) { 47'use strict'; 48var DataTable = $.fn.dataTable; 49 50 51 52/** 53 * DataTables integration for Bootstrap 4. 54 * 55 * This file sets the defaults and adds options to DataTables to style its 56 * controls using Bootstrap. See https://datatables.net/manual/styling/bootstrap 57 * for further information. 58 */ 59 60/* Set the defaults for DataTables initialisation */ 61$.extend( true, DataTable.defaults, { 62 renderer: 'bootstrap' 63} ); 64 65 66/* Default class modification */ 67$.extend( true, DataTable.ext.classes, { 68 container: "dt-container dt-bootstrap4", 69 search: { 70 input: "form-control form-control-sm" 71 }, 72 length: { 73 select: "custom-select custom-select-sm form-control form-control-sm" 74 }, 75 processing: { 76 container: "dt-processing card" 77 }, 78 layout: { 79 row: 'row justify-content-between', 80 cell: 'd-md-flex justify-content-between align-items-center', 81 tableCell: 'col-12', 82 start: 'dt-layout-start col-md-auto mr-auto', 83 end: 'dt-layout-end col-md-auto ml-auto', 84 full: 'dt-layout-full col-md' 85 } 86} ); 87 88 89/* Bootstrap paging button renderer */ 90DataTable.ext.renderer.pagingButton.bootstrap = function (settings, buttonType, content, active, disabled) { 91 var btnClasses = ['dt-paging-button', 'page-item']; 92 93 if (active) { 94 btnClasses.push('active'); 95 } 96 97 if (disabled) { 98 btnClasses.push('disabled') 99 } 100 101 var li = $('<li>').addClass(btnClasses.join(' ')); 102 var a = $('<a>', { 103 'href': disabled ? null : '#', 104 'class': 'page-link' 105 }) 106 .html(content) 107 .appendTo(li); 108 109 return { 110 display: li, 111 clicker: a 112 }; 113}; 114 115DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls) { 116 return $('<ul/>').addClass('pagination').append(buttonEls); 117}; 118 119 120return DataTable; 121}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.