Text-Table-HTML-DataTables
view release on metacpan or search on metacpan
share/datatables-1.10.22/datatables.js view on Meta::CPAN
* Destroy event, fired when the DataTable is destroyed by calling fnDestroy
* or passing the bDestroy:true parameter in the initialisation object. This
* can be used to remove bound events, added DOM nodes, etc.
* @name DataTable#destroy.dt
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
/**
* Page length change event, fired when number of records to show on each
* page (the length) is changed.
* @name DataTable#length.dt
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
* @param {integer} len New length
*/
/**
* Column sizing has changed.
* @name DataTable#column-sizing.dt
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
/**
* Column visibility has changed.
* @name DataTable#column-visibility.dt
* @event
* @param {event} e jQuery event object
* @param {object} o DataTables settings object {@link DataTable.models.oSettings}
* @param {int} column Column index
* @param {bool} vis `false` if column now hidden, or `true` if visible
*/
return $.fn.dataTable;
}));
/*! Buttons for DataTables 1.6.5
* ©2016-2020 SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
// Used for namespacing events added to the document by each instance, so they
// can be removed on destroy
var _instCounter = 0;
// Button namespacing counter for namespacing events on individual buttons
var _buttonCounter = 0;
var _dtButtons = DataTable.ext.buttons;
// Allow for jQuery slim
function _fadeIn(el, duration, fn) {
if ($.fn.animate) {
el
.stop()
.fadeIn( duration, fn );
}
else {
el.css('display', 'block');
if (fn) {
fn.call(el);
}
}
}
function _fadeOut(el, duration, fn) {
if ($.fn.animate) {
el
.stop()
.fadeOut( duration, fn );
}
else {
el.css('display', 'none');
if (fn) {
fn.call(el);
}
}
}
/**
* [Buttons description]
* @param {[type]}
* @param {[type]}
*/
var Buttons = function( dt, config )
share/datatables-1.10.22/datatables.js view on Meta::CPAN
// create the buttons instance here so they can be inserted into the document
// using the API. Listen for `init` for compatibility with pre 1.10.10, but to
// be removed in future.
$(document).on( 'init.dt plugin-init.dt', function (e, settings) {
if ( e.namespace !== 'dt' ) {
return;
}
var opts = settings.oInit.buttons || DataTable.defaults.buttons;
if ( opts && ! settings._buttons ) {
new Buttons( settings, opts ).container();
}
} );
function _init ( settings, options ) {
var api = new DataTable.Api( settings );
var opts = options
? options
: api.init().buttons || DataTable.defaults.buttons;
return new Buttons( api, opts ).container();
}
// DataTables `dom` feature option
DataTable.ext.feature.push( {
fnInit: _init,
cFeature: "B"
} );
// DataTables 2 layout feature
if ( DataTable.ext.features ) {
DataTable.ext.features.register( 'buttons', _init );
}
return Buttons;
}));
/*!
* Column visibility buttons for Buttons and DataTables.
* 2016 SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net', 'datatables.net-buttons'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
if ( ! $.fn.dataTable.Buttons ) {
require('datatables.net-buttons')(root, $);
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
$.extend( DataTable.ext.buttons, {
// A collection of column visibility buttons
colvis: function ( dt, conf ) {
return {
extend: 'collection',
text: function ( dt ) {
return dt.i18n( 'buttons.colvis', 'Column visibility' );
},
className: 'buttons-colvis',
buttons: [ {
extend: 'columnsToggle',
columns: conf.columns,
columnText: conf.columnText
} ]
};
},
// Selected columns with individual buttons - toggle column visibility
columnsToggle: function ( dt, conf ) {
var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
return {
extend: 'columnToggle',
columns: idx,
columnText: conf.columnText
};
} ).toArray();
return columns;
},
// Single button to toggle column visibility
columnToggle: function ( dt, conf ) {
return {
extend: 'columnVisibility',
columns: conf.columns,
columnText: conf.columnText
};
},
// Selected columns with individual buttons - set column visibility
columnsVisibility: function ( dt, conf ) {
var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
share/datatables-1.10.22/datatables.js view on Meta::CPAN
conf._visOriginal = dt.columns().indexes().map( function ( idx ) {
return dt.column( idx ).visible();
} ).toArray();
},
action: function ( e, dt, button, conf ) {
dt.columns().every( function ( i ) {
// Take into account that ColReorder might have disrupted our
// indexes
var idx = dt.colReorder && dt.colReorder.transpose ?
dt.colReorder.transpose( i, 'toOriginal' ) :
i;
this.visible( conf._visOriginal[ idx ] );
} );
}
},
colvisGroup: {
className: 'buttons-colvisGroup',
action: function ( e, dt, button, conf ) {
dt.columns( conf.show ).visible( true, false );
dt.columns( conf.hide ).visible( false, false );
dt.columns.adjust();
},
show: [],
hide: []
}
} );
return DataTable.Buttons;
}));
/*!
* Print button for Buttons and DataTables.
* 2016 SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net', 'datatables.net-buttons'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
if ( ! $.fn.dataTable.Buttons ) {
require('datatables.net-buttons')(root, $);
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var _link = document.createElement( 'a' );
/**
* Clone link and style tags, taking into account the need to change the source
* path.
*
* @param {node} el Element to convert
*/
var _styleToAbs = function( el ) {
var url;
var clone = $(el).clone()[0];
var linkHost;
if ( clone.nodeName.toLowerCase() === 'link' ) {
clone.href = _relToAbs( clone.href );
}
return clone.outerHTML;
};
/**
* Convert a URL from a relative to an absolute address so it will work
* correctly in the popup window which has no base URL.
*
* @param {string} href URL
*/
var _relToAbs = function( href ) {
// Assign to a link on the original page so the browser will do all the
// hard work of figuring out where the file actually is
_link.href = href;
var linkHost = _link.host;
// IE doesn't have a trailing slash on the host
// Chrome has it on the pathname
if ( linkHost.indexOf('/') === -1 && _link.pathname.indexOf('/') !== 0) {
linkHost += '/';
}
return _link.protocol+"//"+linkHost+_link.pathname+_link.search;
};
share/datatables-1.10.22/datatables.js view on Meta::CPAN
title: '*',
messageTop: '*',
messageBottom: '*',
exportOptions: {},
header: true,
footer: false,
autoPrint: true,
customize: null
};
return DataTable.Buttons;
}));
/*! ColReorder 1.5.2
* ©2010-2019 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary ColReorder
* @description Provide the ability to reorder columns in a DataTable
* @version 1.5.2
* @file dataTables.colReorder.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2010-2019 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
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
/**
* Switch the key value pairing of an index array to be value key (i.e. the old value is now the
* key). For example consider [ 2, 0, 1 ] this would be returned as [ 1, 2, 0 ].
* @method fnInvertKeyValues
* @param array aIn Array to switch around
* @returns array
*/
function fnInvertKeyValues( aIn )
{
var aRet=[];
for ( var i=0, iLen=aIn.length ; i<iLen ; i++ )
{
aRet[ aIn[i] ] = i;
}
return aRet;
}
/**
* Modify an array by switching the position of two elements
* @method fnArraySwitch
* @param array aArray Array to consider, will be modified by reference (i.e. no return)
* @param int iFrom From point
* @param int iTo Insert point
* @returns void
*/
function fnArraySwitch( aArray, iFrom, iTo )
{
var mStore = aArray.splice( iFrom, 1 )[0];
aArray.splice( iTo, 0, mStore );
}
/**
* Switch the positions of nodes in a parent node (note this is specifically designed for
* table rows). Note this function considers all element nodes under the parent!
* @method fnDomSwitch
* @param string sTag Tag to consider
* @param int iFrom Element to move
* @param int Point to element the element to (before this point), can be null for append
* @returns void
*/
function fnDomSwitch( nParent, iFrom, iTo )
{
var anTags = [];
for ( var i=0, iLen=nParent.childNodes.length ; i<iLen ; i++ )
share/datatables-1.10.22/datatables.js view on Meta::CPAN
} );
$.fn.dataTable.Api.register( 'colReorder.enable()', function( flag ) {
return this.iterator( 'table', function ( ctx ) {
if ( ctx._colReorder ) {
ctx._colReorder.fnEnable( flag );
}
} );
} );
$.fn.dataTable.Api.register( 'colReorder.disable()', function() {
return this.iterator( 'table', function ( ctx ) {
if ( ctx._colReorder ) {
ctx._colReorder.fnDisable();
}
} );
} );
return ColReorder;
}));
/*! FixedColumns 3.3.1
* ©2010-2020 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary FixedColumns
* @description Freeze columns in place on a scrolling DataTable
* @version 3.3.1
* @file dataTables.fixedColumns.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2010-2020 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
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var _firefoxScroll;
/**
* When making use of DataTables' x-axis scrolling feature, you may wish to
* fix the left most column in place. This plug-in for DataTables provides
* exactly this option (note for non-scrolling tables, please use the
* FixedHeader plug-in, which can fix headers and footers). Key
* features include:
*
* * Freezes the left or right most columns to the side of the table
* * Option to freeze two or more columns
* * Full integration with DataTables' scrolling options
* * Speed - FixedColumns is fast in its operation
*
* @class
* @constructor
* @global
* @param {object} dt DataTables instance. With DataTables 1.10 this can also
* be a jQuery collection, a jQuery selector, DataTables API instance or
* settings object.
* @param {object} [init={}] Configuration object for FixedColumns. Options are
* defined by {@link FixedColumns.defaults}
*
* @requires jQuery 1.7+
* @requires DataTables 1.8.0+
*
* @example
* var table = $('#example').dataTable( {
* "scrollX": "100%"
* } );
* new $.fn.dataTable.fixedColumns( table );
*/
var FixedColumns = function ( dt, init ) {
var that = this;
/* Sanity check - you just know it will happen */
if ( ! ( this instanceof FixedColumns ) ) {
alert( "FixedColumns warning: FixedColumns must be initialised with the 'new' keyword." );
return;
}
if ( init === undefined || init === true ) {
init = {};
}
// Use the DataTables Hungarian notation mapping method, if it exists to
// provide forwards compatibility for camel case variables
var camelToHungarian = $.fn.dataTable.camelToHungarian;
share/datatables-1.10.22/datatables.js view on Meta::CPAN
var defaults = DataTable.defaults.fixedColumns;
if ( init || defaults ) {
var opts = $.extend( {}, init, defaults );
if ( init !== false ) {
new FixedColumns( settings, opts );
}
}
} );
// Make FixedColumns accessible from the DataTables instance
$.fn.dataTable.FixedColumns = FixedColumns;
$.fn.DataTable.FixedColumns = FixedColumns;
return FixedColumns;
}));
/*! FixedHeader 3.1.7
* ©2009-2020 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary FixedHeader
* @description Fix a table's header or footer, so it is always visible while
* scrolling
* @version 3.1.7
* @file dataTables.fixedHeader.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2009-2020 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
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var _instCounter = 0;
var FixedHeader = function ( dt, config ) {
// Sanity check - you just know it will happen
if ( ! (this instanceof FixedHeader) ) {
throw "FixedHeader must be initialised with the 'new' keyword.";
}
// Allow a boolean true for defaults
if ( config === true ) {
config = {};
}
dt = new DataTable.Api( dt );
this.c = $.extend( true, {}, FixedHeader.defaults, config );
this.s = {
dt: dt,
position: {
theadTop: 0,
tbodyTop: 0,
tfootTop: 0,
tfootBottom: 0,
width: 0,
left: 0,
tfootHeight: 0,
theadHeight: 0,
windowHeight: $(window).height(),
visible: true
},
headerMode: null,
footerMode: null,
autoWidth: dt.settings()[0].oFeatures.bAutoWidth,
namespace: '.dtfc'+(_instCounter++),
scrollLeft: {
header: -1,
footer: -1
},
enable: true
};
this.dom = {
floatingHeader: null,
thead: $(dt.table().header()),
tbody: $(dt.table().body()),
share/datatables-1.10.22/datatables.js view on Meta::CPAN
if ( offset === undefined ) {
return ctx.length && ctx[0]._fixedHeader ?
ctx[0]._fixedHeader[el +'Offset']() :
undefined;
}
return this.iterator( 'table', function ( ctx ) {
var fh = ctx._fixedHeader;
if ( fh ) {
fh[ el +'Offset' ]( offset );
}
} );
} );
} );
return FixedHeader;
}));
/*! KeyTable 2.5.3
* ©2009-2020 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary KeyTable
* @description Spreadsheet like keyboard navigation for DataTables
* @version 2.5.3
* @file dataTables.keyTable.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2009-2020 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
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net')(root, $).$;
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var namespaceCounter = 0;
var editorNamespaceCounter = 0;
var KeyTable = function ( dt, opts ) {
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.8' ) ) {
throw 'KeyTable requires DataTables 1.10.8 or newer';
}
// User and defaults configuration object
this.c = $.extend( true, {},
DataTable.defaults.keyTable,
KeyTable.defaults,
opts
);
// Internal settings
this.s = {
/** @type {DataTable.Api} DataTables' API instance */
dt: new DataTable.Api( dt ),
enable: true,
/** @type {bool} Flag for if a draw is triggered by focus */
focusDraw: false,
/** @type {bool} Flag to indicate when waiting for a draw to happen.
* Will ignore key presses at this point
*/
waitingForDraw: false,
/** @type {object} Information about the last cell that was focused */
lastFocus: null,
/** @type {string} Unique namespace per instance */
namespace: '.keyTable-'+(namespaceCounter++),
/** @type {Node} Input element for tabbing into the table */
tabInput: null
};
// DOM items
this.dom = {
};
// Check if row reorder has already been initialised on this table
share/datatables-1.10.22/datatables.js view on Meta::CPAN
}
_this.s.dt.draw();
});
$$2(this.s.topGroup.dom.container).on('dtsb-updateTitle', function () {
var count = _this.s.topGroup.count();
_this._updateTitle(count);
// Update the count in the title/button
if (_this.c.filterChanged !== undefined && typeof _this.c.filterChanged === 'function') {
_this.c.filterChanged(count);
}
});
};
/**
* Sets listeners to check whether clearAll should be added or removed
*/
SearchBuilder.prototype._setEmptyListener = function () {
var _this = this;
$$2(this.s.topGroup.dom.add).on('click', function () {
_this._checkClear();
});
$$2(this.s.topGroup.dom.container).on('dtsb-destroy', function () {
$$2(_this.dom.clearAll).remove();
});
};
SearchBuilder.version = '0.0.1';
SearchBuilder.classes = {
button: 'dtsb-button',
clearAll: 'dtsb-clearAll',
container: 'dtsb-searchBuilder',
inputButton: 'dtsb-iptbtn',
title: 'dtsb-title',
titleRow: 'dtsb-titleRow'
};
SearchBuilder.defaults = {
filterChanged: undefined,
preDefined: false
};
return SearchBuilder;
}());
/*! SearchBuilder 1.0.0
* ©2020 SpryMedia Ltd - datatables.net/license/mit
*/
// DataTables extensions common UMD. Note that this allows for AMD, CommonJS
// (with window and jQuery being allowed as parameters to the returned
// function) or just default browser loading.
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'datatables.net'], function ($) {
return factory($, window, document);
});
}
else if (typeof exports === 'object') {
// CommonJS
module.exports = function (root, $) {
if (!root) {
root = window;
}
if (!$ || !$.fn.dataTable) {
$ = require('datatables.net')(root, $).$;
}
return factory($, root, root.document);
};
}
else {
// Browser - assume jQuery has already been loaded
factory(window.jQuery, window, document);
}
}(function ($, window, document) {
setJQuery$2($);
setJQuery$1($);
setJQuery($);
var DataTable = $.fn.dataTable;
$.fn.dataTable.SearchBuilder = SearchBuilder;
$.fn.DataTable.SearchBuilder = SearchBuilder;
$.fn.dataTable.Group = Group;
$.fn.DataTable.Group = Group;
$.fn.dataTable.Criteria = Criteria;
$.fn.DataTable.Criteria = Criteria;
var apiRegister = $.fn.dataTable.Api.register;
// Set up object for plugins
$.fn.dataTable.ext.searchBuilder = {
conditions: {}
};
$.fn.dataTable.ext.buttons.searchBuilder = {
action: function (e, dt, node, config) {
e.stopPropagation();
this.popover(config._searchBuilder.getNode(), {
align: 'dt-container'
});
},
config: {},
init: function (dt, node, config) {
var sb = new $.fn.dataTable.SearchBuilder(dt, $.extend({
filterChanged: function (count) {
dt.button(node).text(dt.i18n('searchBuilder.button', { 0: 'Search Builder', _: 'Search Builder (%d)' }, count));
}
}, config.config));
var message = dt.i18n('searchBuilder.button', 'Search Builder', 0);
dt.button(node).text(message);
config._searchBuilder = sb;
},
text: 'Search Builder'
};
apiRegister('searchBuilder.getDetails()', function () {
var ctx = this.context[0];
return ctx._searchBuilder.getDetails();
});
apiRegister('searchBuilder.rebuild()', function (details) {
var ctx = this.context[0];
ctx._searchBuilder.rebuild(details);
return this;
});
apiRegister('searchBuilder.container()', function () {
var ctx = this.context[0];
return ctx._searchBuilder.getNode();
});
/**
* Init function for SearchBuilder
* @param settings the settings to be applied
* @returns JQUERY<HTMLElement> Returns the node of the SearchBuilder
*/
function _init(settings) {
var api = new DataTable.Api(settings);
var opts = api.init().searchBuilder || DataTable.defaults.searchBuilder;
var searchBuilder = new SearchBuilder(api, opts);
var node = searchBuilder.getNode();
return node;
}
// Attach a listener to the document which listens for DataTables initialisation
// events so we can automatically initialise
$(document).on('preInit.dt.dtsp', function (e, settings, json) {
if (e.namespace !== 'dt') {
return;
}
if (settings.oInit.searchBuilder ||
DataTable.defaults.searchBuilder) {
if (!settings._searchBuilder) {
_init(settings);
}
}
});
// DataTables `dom` feature option
DataTable.ext.feature.push({
cFeature: 'Q',
fnInit: _init
});
// DataTables 2 layout feature
if (DataTable.ext.features) {
DataTable.ext.features.register('searchBuilder', _init);
}
}));
}());
(function () {
'use strict';
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'datatables.net-dt', 'datatables.net-searchbuilder'], function ($) {
return factory($, window, document);
});
}
else if (typeof exports === 'object') {
// CommonJS
module.exports = function (root, $) {
if (!root) {
root = window;
}
if (!$ || !$.fn.dataTable) {
$ = require('datatables.net-dt')(root, $).$;
}
if (!$.fn.dataTable.searchBuilder) {
require('datatables.net-searchbuilder')(root, $);
}
return factory($, root, root.document);
};
}
else {
// Browser
factory(jQuery, window, document);
}
}(function ($, window, document) {
var DataTable = $.fn.dataTable;
return DataTable.searchPanes;
}));
}());
( run in 1.197 second using v1.01-cache-2.11-cpan-e1769b4cff6 )