/* ! Tablesaw - v3.0.3 - 2017-07-13 * https://github.com/filamentgroup/tablesaw * Copyright (c) 2017 Filament Group; Licensed MIT */ (function(win) { 'use strict'; var $; if ('shoestring' in win) { $ = win.shoestring; } else if ('jQuery' in win) { $ = win.jQuery; } else { throw new Error('tablesaw: DOM library not found.'); } // DOM-ready auto-init of plugins. // Many plugins bind to an 'enhance' event to init themselves on dom ready, or when new markup is inserted into the DOM // Use raw DOMContentLoaded instead of shoestring (may have issues in Android 2.3, exhibited by stack table) if ('addEventListener' in document) { document.addEventListener('DOMContentLoaded', function() { $(document).trigger('enhance.tablesaw'); }); } })(typeof window !== 'undefined' ? window : this); ; /* ! Tablesaw - v3.0.3 - 2017-07-13 * https://github.com/filamentgroup/tablesaw * Copyright (c) 2017 Filament Group; Licensed MIT */ // UMD module definition // From: https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js (function (factory) { 'use strict'; var define = ''; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function(root, jQuery) { if (jQuery === 'undefined') { // require('jQuery') returns a factory that requires window to // build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop // if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } }(function ($) { 'use strict'; var win = typeof window !== 'undefined' ? window : this; var TablesawConfig = ''; var Tablesaw = { i18n: { modeStack: 'Stack', modeSwipe: 'Swipe', modeToggle: 'Toggle', modeSwitchColumnsAbbreviated: 'Cols', modeSwitchColumns: 'Columns', columnToggleButton: 'Columns', columnToggleError: 'No eligible columns.', sort: 'Sort', swipePreviousColumn: 'Previous column', swipeNextColumn: 'Next column' }, // cut the mustard mustard: 'head' in document && // IE9+, Firefox 4+, Safari 5.1+, Mobile Safari 4.1+, Opera 11.5+, Android 2.3+ (!window.blackberry || window.WebKitPoint) && // only WebKit Blackberry (OS 6+) !window.operamini }; $(win.document).on('enhance.tablesaw', function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== 'undefined' && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); } Tablesaw.i18n.modes = [ Tablesaw.i18n.modeStack, Tablesaw.i18n.modeSwipe, Tablesaw.i18n.modeToggle ]; }); if (Tablesaw.mustard) { $(document.documentElement).addClass('tablesaw-enhanced'); } (function() { var pluginName = 'tablesaw'; var classes = { toolbar: 'tablesaw-bar' }; var events = { create: 'tablesawcreate', destroy: 'tablesawdestroy', refresh: 'tablesawrefresh', resize: 'tablesawresize' }; var defaultMode = 'stack'; var initSelector = 'table'; var initFilterSelector = '[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]'; var defaultConfig = {}; Tablesaw.events = events; var Table = function(element) { if (!element) { throw new Error('Tablesaw requires an element.'); } this.table = element; this.$table = $(element); // only one and
are allowed, per the specification this.$thead = this.$table.children().filter('thead').eq(0); // multiple are allowed, per the specification this.$tbody = this.$table.children().filter('tbody'); this.mode = this.$table.attr('data-tablesaw-mode') || defaultMode; this.$toolbar = null; this.init(); }; Table.prototype.init = function() { if (!this.$thead.length) { throw new Error('tablesaw: a is required, but none was found.'); } if (!this.$thead.find('th').length) { throw new Error('tablesaw: no header cells found. Are you using