Primer Commit
This commit is contained in:
14
assets/libs/footable/dist/footable.all.min.js
vendored
Normal file
14
assets/libs/footable/dist/footable.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/libs/footable/dist/footable.bookmarkable.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.bookmarkable.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(t,e,undefined){function a(t,e){e=e?e:location.hash;var a=RegExp("&"+t+"(?:=([^&]*))?(?=&|$)","i");return(e=e.replace(/^\#/,"&").match(a))?e[1]===undefined?"":decodeURIComponent(e[1]):undefined}function i(e,a){var i=t(e.table).find("tbody").find("tr:not(.footable-row-detail, .footable-filtered)").length;t(e.table).data("status_num_total",i);var o=t(e.table).find("tbody").find("tr:not(.footable-row-detail)").filter(":visible").length;t(e.table).data("status_num_shown",o);var n=t(e.table).data("sorted"),r=t(e.table).find("th")[n],l=t(r).hasClass("footable-sorted-desc");if(t(e.table).data("status_descending",l),e.pageInfo){var s=e.pageInfo.currentPage;t(e.table).data("status_pagenum",s)}var d="",f=t(e.table).data("filter");t(f).length&&(d=t(f).val()),t(e.table).data("status_filter_val",d);var u,p,c;if("footable_row_expanded"==a.type&&(u=a.row,u&&(p=t(e.table).data("expanded_rows"),c=[],p&&(c=p.split(",")),c.push(u.rowIndex),t(e.table).data("expanded_rows",c.join(",")))),"footable_row_collapsed"==a.type&&(u=a.row)){p=t(e.table).data("expanded_rows"),c=[],p&&(c=p.split(","));var g=[];for(var b in c)if(c[b]==u.rowIndex){g=c.splice(b,1);break}t(e.table).data("expanded_rows",g.join(","))}}function o(){var e=this;e.name="Footable LucidBookmarkable",e.init=function(e){e.options.bookmarkable.enabled&&t(e.table).bind({footable_initialized:function(){var i=e.table.id,o=a(i+"_f"),n=a(i+"_p"),r=a(i+"_s"),l=a(i+"_d"),s=a(i+"_e");if(o){var d=t(e.table).data("filter");t(d).val(o),t(e.table).trigger("footable_filter",{filter:o})}if(n&&t(e.table).data("currentPage",n),r!==undefined){var f=t(e.table).data("footable-sort"),u=!0;"true"==l&&(u=!1),f.doSort(r,u)}else t(e.table).trigger("footable_setup_paging");if(s){var p=s.split(",");for(var c in p){var g=t(e.table.rows[p[c]]);g.find("> td:first").trigger("footable_toggle_row")}}e.lucid_bookmark_read=!0},"footable_page_filled footable_redrawn footable_filtered footable_sorted footable_row_expanded footable_row_collapsed":function(a){if(i(e,a),e.lucid_bookmark_read){var o=e.table.id,n=o+"_f",r=o+"_p",l=o+"_s",s=o+"_d",d=o+"_e",f=location.hash.replace(/^\#/,"&"),u=[n,r,l,s,d];for(var p in u){var c=RegExp("&"+u[p]+"=([^&]*)","g");f=f.replace(c,"")}var g={};g[n]=t(e.table).data("status_filter_val"),g[r]=t(e.table).data("status_pagenum"),g[l]=t(e.table).data("sorted"),g[s]=t(e.table).data("status_descending"),g[d]=t(e.table).data("expanded_rows");var b=[];for(var h in g)g[h]!==undefined&&b.push(h+"="+encodeURIComponent(g[h]));f.length&&b.push(f),location.hash=b.join("&")}}})}}if(e.footable===undefined||null===e.foobox)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var n={bookmarkable:{enabled:!1}};e.footable.plugins.register(o,n)})(jQuery,window);
|
||||
1
assets/libs/footable/dist/footable.filter.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.filter.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(t,e,undefined){function a(){var e=this;e.name="Footable Filter",e.init=function(a){if(e.footable=a,a.options.filter.enabled===!0){if(t(a.table).data("filter")===!1)return;a.timers.register("filter"),t(a.table).unbind(".filtering").bind({"footable_initialized.filtering":function(){var i=t(a.table),o={input:i.data("filter")||a.options.filter.input,timeout:i.data("filter-timeout")||a.options.filter.timeout,minimum:i.data("filter-minimum")||a.options.filter.minimum,disableEnter:i.data("filter-disable-enter")||a.options.filter.disableEnter};o.disableEnter&&t(o.input).keypress(function(t){return window.event?13!==window.event.keyCode:13!==t.which}),i.bind("footable_clear_filter",function(){t(o.input).val(""),e.clearFilter()}),i.bind("footable_filter",function(t,a){e.filter(a.filter)}),t(o.input).keyup(function(i){a.timers.filter.stop(),27===i.which&&t(o.input).val(""),a.timers.filter.start(function(){var a=t(o.input).val()||"";e.filter(a)},o.timeout)})},"footable_redrawn.filtering":function(){var i=t(a.table),o=i.data("filter-string");o&&e.filter(o)}}).data("footable-filter",e)}},e.filter=function(a){var i=e.footable,o=t(i.table),n=o.data("filter-minimum")||i.options.filter.minimum,r=!a,l=i.raise("footable_filtering",{filter:a,clear:r});if(!(l&&l.result===!1||l.filter&&n>l.filter.length))if(l.clear)e.clearFilter();else{var d=l.filter.split(" ");o.find("> tbody > tr").hide().addClass("footable-filtered");var s=o.find("> tbody > tr:not(.footable-row-detail)");t.each(d,function(t,e){e&&e.length>0&&(o.data("current-filter",e),s=s.filter(i.options.filter.filterFunction))}),s.each(function(){e.showRow(this,i),t(this).removeClass("footable-filtered")}),o.data("filter-string",l.filter),i.raise("footable_filtered",{filter:l.filter,clear:!1})}},e.clearFilter=function(){var a=e.footable,i=t(a.table);i.find("> tbody > tr:not(.footable-row-detail)").removeClass("footable-filtered").each(function(){e.showRow(this,a)}),i.removeData("filter-string"),a.raise("footable_filtered",{clear:!0})},e.showRow=function(e,a){var i=t(e),o=i.next(),n=t(a.table);i.is(":visible")||(n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(e)):i.show())}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={filter:{enabled:!0,input:".footable-filter",timeout:300,minimum:2,disableEnter:!1,filterFunction:function(){var e=t(this),a=e.parents("table:first"),i=a.data("current-filter").toUpperCase(),o=e.find("td").text();return a.data("filter-text-only")||e.find("td[data-value]").each(function(){o+=t(this).data("value")}),o.toUpperCase().indexOf(i)>=0}}};e.footable.plugins.register(a,i)})(jQuery,window);
|
||||
1
assets/libs/footable/dist/footable.grid.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.grid.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
429
assets/libs/footable/dist/footable.memory.js
vendored
Normal file
429
assets/libs/footable/dist/footable.memory.js
vendored
Normal file
@@ -0,0 +1,429 @@
|
||||
/**
|
||||
* Footable Memory
|
||||
*
|
||||
* Version 1.1.0
|
||||
*
|
||||
* Requires browser support for localStorage. Fallback to cookies using
|
||||
* jQuery Cookie (https://github.com/carhartl/jquery-cookie)
|
||||
*
|
||||
* Stores table state in a cookie and reloads state when page is refreshed.
|
||||
*
|
||||
* Supports common FooTable features:
|
||||
* - Pagination
|
||||
* - Sorting
|
||||
* - Filtering
|
||||
* - Expansion
|
||||
*
|
||||
* Written to be compatible with multiple FooTables per page and with
|
||||
* JavaScript libraries like AngularJS and Ember that use hash based URLs.
|
||||
*
|
||||
* Disabled by default, to enable add the following section to the footable
|
||||
* options:
|
||||
*
|
||||
* $('#table').footable({
|
||||
* memory: {
|
||||
* enabled: true
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Based on FooTable Plugin Bookmarkable by Amy Farrell (https://github.com/akf)
|
||||
*
|
||||
* Created by Chris Laskey (https://github.com/chrislaskey)
|
||||
*/
|
||||
|
||||
(function ($, w, undefined) {
|
||||
|
||||
if (w.footable === undefined || w.foobox === null) {
|
||||
throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
|
||||
}
|
||||
|
||||
var defaults = {
|
||||
memory: {
|
||||
enabled: false
|
||||
}
|
||||
};
|
||||
|
||||
var storage;
|
||||
|
||||
var storage_engines = {};
|
||||
|
||||
storage_engines.local_storage = (function($){
|
||||
|
||||
'use strict';
|
||||
|
||||
var path_page = function(){
|
||||
return location.pathname;
|
||||
};
|
||||
|
||||
var path_subpage = function(){
|
||||
return location.hash || 'root';
|
||||
};
|
||||
|
||||
var storage_key = function(index){
|
||||
return path_page() + '/' + path_subpage() + '/index-' + index;
|
||||
};
|
||||
|
||||
var get = function(index){
|
||||
var key = storage_key(index),
|
||||
as_string = localStorage.getItem(key);
|
||||
|
||||
return as_string ? JSON.parse(as_string) : {};
|
||||
};
|
||||
|
||||
var set = function(index, item){
|
||||
var key = storage_key(index),
|
||||
as_string = JSON.stringify(item);
|
||||
|
||||
localStorage.setItem(key, as_string);
|
||||
};
|
||||
|
||||
return {
|
||||
get: function(index){
|
||||
return get(index);
|
||||
},
|
||||
set: function(index, item){
|
||||
set(index, item);
|
||||
}
|
||||
};
|
||||
|
||||
})($);
|
||||
|
||||
storage_engines.cookie = (function($){
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Stores footable bookmarkable data in a cookie
|
||||
*
|
||||
* By default will store each page in its own cookie.
|
||||
* Supports multiple FooTables per page.
|
||||
* Supports JS frameworks that use hashmap URLs (AngularJS, Ember, etc).
|
||||
*
|
||||
* For example take an example application:
|
||||
*
|
||||
* http://example.com/application-data (2 FooTables on this page)
|
||||
* http://example.com/application-data/#/details (1 FooTable on this page)
|
||||
* http://example.com/other-data (1 FooTable on this page)
|
||||
*
|
||||
* Would be stored like this:
|
||||
*
|
||||
* cookie['/application-data'] = {
|
||||
* '/': {
|
||||
* 1: {
|
||||
* key1: value1,
|
||||
* key2: value2
|
||||
* },
|
||||
* 2: {
|
||||
* key1: value1,
|
||||
* key2: value2
|
||||
* }
|
||||
* },
|
||||
* '#/details': {
|
||||
* 1: {
|
||||
* key1: value1,
|
||||
* key2: value2
|
||||
* }
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* cookie['/other-data'] = {
|
||||
* '/': {
|
||||
* 1: {
|
||||
* key1: value1,
|
||||
* key2: value2
|
||||
* },
|
||||
* }
|
||||
* }
|
||||
*
|
||||
*/
|
||||
|
||||
if( $.cookie ){
|
||||
$.cookie.json = true;
|
||||
}
|
||||
|
||||
var days_to_keep_data = 7;
|
||||
|
||||
var path_page = function(){
|
||||
return location.pathname;
|
||||
};
|
||||
|
||||
var path_subpage = function(){
|
||||
return location.hash || '/';
|
||||
};
|
||||
|
||||
var get_data = function(){
|
||||
var page = path_page(),
|
||||
data = $.cookie(page);
|
||||
|
||||
return data || {};
|
||||
};
|
||||
|
||||
var get_table = function(index){
|
||||
var subpage = path_subpage(),
|
||||
data = get_data();
|
||||
|
||||
if( data[subpage] && data[subpage][index] ){
|
||||
return data[subpage][index];
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
var set = function(index, item){
|
||||
var page = path_page(),
|
||||
subpage = path_subpage(),
|
||||
data = get_data(),
|
||||
options;
|
||||
|
||||
if( !data[subpage] ){
|
||||
data[subpage] = {};
|
||||
}
|
||||
|
||||
data[subpage][index] = item;
|
||||
|
||||
options = {
|
||||
path: page,
|
||||
expires: days_to_keep_data
|
||||
};
|
||||
|
||||
$.cookie(page, data, options);
|
||||
};
|
||||
|
||||
return {
|
||||
get: function(index){
|
||||
return get_table(index);
|
||||
},
|
||||
set: function(index, item){
|
||||
set(index, item);
|
||||
}
|
||||
};
|
||||
|
||||
})($);
|
||||
|
||||
var set_storage_engine = (function(){
|
||||
var test = 'footable-memory-plugin-storage-test';
|
||||
|
||||
try {
|
||||
localStorage.setItem(test, test);
|
||||
localStorage.removeItem(test);
|
||||
storage = storage_engines.local_storage;
|
||||
} catch(e) {
|
||||
try {
|
||||
$.cookie(test, test);
|
||||
storage = storage_engines.cookie;
|
||||
} catch(e) {
|
||||
throw new Error('FooTable Memory requires either localStorage or cookie support via jQuery $.cookie plugin (https://github.com/carhartl/jquery-cookie)');
|
||||
}
|
||||
}
|
||||
})($);
|
||||
|
||||
var state = (function($){
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Gets and sets current table state
|
||||
*/
|
||||
|
||||
var vars = {};
|
||||
|
||||
var get = {};
|
||||
|
||||
var set = {};
|
||||
|
||||
set.vars = function(ft){
|
||||
vars.ft = ft;
|
||||
vars.table = $(ft.table);
|
||||
};
|
||||
|
||||
get.descending = function(){
|
||||
var descending = false;
|
||||
$.each(vars.table.find('th'), function(index){
|
||||
if( $(this).hasClass('footable-sorted-desc') ){
|
||||
descending = true;
|
||||
}
|
||||
});
|
||||
return descending;
|
||||
};
|
||||
|
||||
get.expanded = function(){
|
||||
var indexes = [];
|
||||
$.each(vars.ft.table.rows, function(index, value){
|
||||
if( $(this).hasClass('footable-detail-show') ){
|
||||
indexes.push(index);
|
||||
}
|
||||
});
|
||||
return indexes;
|
||||
};
|
||||
|
||||
set.expanded = function(data){
|
||||
if( data.expanded ){
|
||||
$.each(data.expanded, function(index, value){
|
||||
// var row = $(vars.ft.table.rows[value]);
|
||||
// row.find('> td:first').trigger('footable_toggle_row');
|
||||
|
||||
// Trying to execute the lines above, but the expanded row
|
||||
// shows raw AngularJS template (with {{ values }}) instead
|
||||
// of the fully rendered result.
|
||||
//
|
||||
// Best guess is some things happen after
|
||||
// 'footable_initialized' event and row expanding can not
|
||||
// occur until after those fire.
|
||||
//
|
||||
// A hack to get around this is to wait an interval before
|
||||
// executing the intended commands. Wrapped in an
|
||||
// immediately executing function to ensure ft is the
|
||||
// current value.
|
||||
|
||||
(function(ft){
|
||||
setTimeout(function(){
|
||||
var row = $(ft.table.rows[value]);
|
||||
row.find('> td:first').trigger('footable_toggle_row');
|
||||
}, 150);
|
||||
})(vars.ft);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
get.filter = function(){
|
||||
return vars.table.data('filter') ? $(vars.table.data('filter')).val() : '';
|
||||
};
|
||||
|
||||
set.filter = function(data){
|
||||
if( data.filter ){
|
||||
$(vars.table.data('filter'))
|
||||
.val(data.filter)
|
||||
.trigger('keyup');
|
||||
}
|
||||
};
|
||||
|
||||
get.page = function(){
|
||||
return vars.ft.pageInfo && vars.ft.pageInfo.currentPage !== undefined ? vars.ft.pageInfo.currentPage : 0;
|
||||
};
|
||||
|
||||
set.page = function(data){
|
||||
if( data.page ){
|
||||
vars.table.data('currentPage', data.page);
|
||||
// Delay triggering table until sort is updated, since both effect
|
||||
// pagination.
|
||||
}
|
||||
};
|
||||
|
||||
get.shown = function(){
|
||||
return vars.table
|
||||
.find('tbody')
|
||||
.find('tr:not(.footable-row-detail)')
|
||||
.filter(':visible').length;
|
||||
};
|
||||
|
||||
get.sorted = function(){
|
||||
if( vars.table.data('sorted') !== undefined ){
|
||||
return vars.table.data('sorted');
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
set.sorted = function(data){
|
||||
if( data.sorted >= 0 ) {
|
||||
// vars.table.data('footable-sort').doSort(data.sorted, !data.descending);
|
||||
|
||||
// Trying to execute the line above, but only sort icon on the
|
||||
// <th> element gets set. The rows themselves do not get sorted.
|
||||
//
|
||||
// Best guess is some things happen after 'footable_initialized' event
|
||||
// and sorting can not occur until after those fire.
|
||||
//
|
||||
// A hack to get around this is to wait an interval before executing
|
||||
// the intended commands. Wrapped in an immediately executing
|
||||
// function to ensure ft is the current value.
|
||||
|
||||
(function(ft){
|
||||
setTimeout(function(){
|
||||
$(ft.table).data('footable-sort').doSort(data.sorted, !data.descending);
|
||||
}, 150);
|
||||
})(vars.ft);
|
||||
} else {
|
||||
vars.table.trigger('footable_setup_paging');
|
||||
}
|
||||
};
|
||||
|
||||
get.total = function(){
|
||||
return vars.table
|
||||
.find('tbody')
|
||||
.find('tr:not(.footable-row-detail, .footable-filtered)').length;
|
||||
};
|
||||
|
||||
var get_state = function(){
|
||||
return {
|
||||
descending: get.descending(),
|
||||
expanded: get.expanded(),
|
||||
filter: get.filter(),
|
||||
page: get.page(),
|
||||
shown: get.shown(),
|
||||
sorted: get.sorted(),
|
||||
total: get.total()
|
||||
};
|
||||
};
|
||||
|
||||
var set_state = function(data){
|
||||
set.filter(data);
|
||||
set.page(data);
|
||||
set.sorted(data);
|
||||
set.expanded(data);
|
||||
};
|
||||
|
||||
return {
|
||||
get: function(ft){
|
||||
set.vars(ft);
|
||||
return get_state();
|
||||
},
|
||||
set: function(ft, data){
|
||||
set.vars(ft);
|
||||
return set_state(data);
|
||||
}
|
||||
};
|
||||
|
||||
})($);
|
||||
|
||||
var is_enabled = function(ft){
|
||||
return ft.options.memory.enabled;
|
||||
};
|
||||
|
||||
var update = function(ft, event) {
|
||||
var index = ft.id,
|
||||
data = state.get(ft);
|
||||
|
||||
storage.set(index, data);
|
||||
};
|
||||
|
||||
var load = function(ft){
|
||||
var index = ft.id,
|
||||
data = storage.get(index);
|
||||
|
||||
state.set(ft, data);
|
||||
ft.memory_plugin_loaded = true;
|
||||
};
|
||||
|
||||
function Memory() {
|
||||
var p = this;
|
||||
p.name = 'Footable Memory';
|
||||
p.init = function(ft) {
|
||||
if (is_enabled(ft)) {
|
||||
$(ft.table).bind({
|
||||
'footable_initialized': function(){
|
||||
load(ft);
|
||||
},
|
||||
'footable_page_filled footable_redrawn footable_filtered footable_sorted footable_row_expanded footable_row_collapsed': function(e) {
|
||||
if (ft.memory_plugin_loaded) {
|
||||
update(ft, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
w.footable.plugins.register(Memory, defaults);
|
||||
|
||||
})(jQuery, window);
|
||||
14
assets/libs/footable/dist/footable.min.js
vendored
Normal file
14
assets/libs/footable/dist/footable.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/libs/footable/dist/footable.paginate.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.paginate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44
assets/libs/footable/dist/footable.plugin.template.js
vendored
Normal file
44
assets/libs/footable/dist/footable.plugin.template.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
(function ($, w, undefined) {
|
||||
if (w.footable === undefined || w.foobox === null)
|
||||
throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
|
||||
|
||||
var defaults = {
|
||||
/*
|
||||
Plugin options here, example:
|
||||
|
||||
var defaults = {
|
||||
myPlugin: {
|
||||
enabled: true
|
||||
}
|
||||
};
|
||||
|
||||
This would allow you to access this option using ft.options.myPlugin.enabled
|
||||
*/
|
||||
};
|
||||
|
||||
function MyPlugin() {
|
||||
var p = this;
|
||||
p.name = 'Footable MyPlugin';
|
||||
p.init = function(ft) {
|
||||
$(ft.table).bind({
|
||||
/*
|
||||
Bind to relevant events here to modify/add functionality to Footable, example:
|
||||
|
||||
$(ft.table).bind({
|
||||
'footable_initialized': function(e){
|
||||
if (e.ft.options.myPlugin.enabled === true){
|
||||
alert('Hello World');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
This would listen for the 'footable_initialized' event and when called check if the plugin is enabled
|
||||
and if it is alert 'Hello World' to the user.
|
||||
*/
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
w.footable.plugins.register(MyPlugin, defaults);
|
||||
|
||||
})(jQuery, window);
|
||||
1
assets/libs/footable/dist/footable.sort.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.sort.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(t,e,undefined){function a(){var e=this;e.name="Footable Sortable",e.init=function(a){e.footable=a,a.options.sort===!0&&t(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var i,o,n=t(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){var e=t(this),i=a.columns[e.index()];i.sort.ignore===!0||e.hasClass(r.sortable)||(e.addClass(r.sortable),t("<span />").addClass(r.indicator).appendTo(e))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),o=t(this);var i=!o.hasClass(r.sorted);return e.doSort(o.index(),i),!1});var l=!1;for(var s in a.columns)if(i=a.columns[s],i.sort.initial){var d="descending"!==i.sort.initial;e.doSort(i.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var i=t(a.table),o=a.options.classes.sort;i.data("sorted")>=0&&i.find("> thead > tr:last-child > th").each(function(a){var i=t(this);return i.hasClass(o.sorted)||i.hasClass(o.descending)?(e.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(e){var a=t(e.column.th);e.column.data.sort=e.column.data.sort||{},e.column.data.sort.initial=a.data("sort-initial")||!1,e.column.data.sort.ignore=a.data("sort-ignore")||!1,e.column.data.sort.selector=a.data("sort-selector")||null;var i=a.data("sort-match")||0;i>=e.column.data.matches.length&&(i=0),e.column.data.sort.match=e.column.data.matches[i]}}).data("footable-sort",e)},e.doSort=function(a,i){var o=e.footable;if(t(o.table).data("sort")!==!1){var n=t(o.table),r=n.find("> tbody"),l=o.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=o.options.classes.sort,f=o.options.events.sort;if(i=i===undefined?s.hasClass(d.sorted):"toggle"===i?!s.hasClass(d.sorted):i,l.sort.ignore===!0)return!0;var u=o.raise(f.sorting,{column:l,direction:i?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),i===undefined&&(i=s.hasClass(d.sorted)),i?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),e.sort(o,r,l,i),o.bindToggleSelectors(),o.raise(f.sorted,{column:l,direction:i?"ASC":"DESC"}))}},e.rows=function(e,a,i){var o=[];return a.find("> tr").each(function(){var a=t(this),n=null;if(a.hasClass(e.options.classes.detail))return!0;a.next().hasClass(e.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return i!==undefined&&(r.value=e.parse(this.cells[i.sort.match],i)),o.push(r),!0}).detach(),o},e.sort=function(t,a,i,o){var n=e.rows(t,a,i),r=t.options.sorters[i.type]||t.options.sorters.alpha;n.sort(function(t,e){return o?r(t.value,e.value):r(e.value,t.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={sort:!0,sorters:{alpha:function(t,e){return"string"==typeof t&&(t=t.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),t===e?0:e>t?-1:1},numeric:function(t,e){return t-e}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};e.footable.plugins.register(a,i)})(jQuery,window);
|
||||
1
assets/libs/footable/dist/footable.striping.min.js
vendored
Normal file
1
assets/libs/footable/dist/footable.striping.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(t,e,undefined){function a(){var e=this;e.name="Footable Striping",e.init=function(a){e.footable=a,t(a.table).unbind("striping").bind({"footable_initialized.striping footable_row_removed.striping footable_redrawn.striping footable_sorted.striping footable_filtered.striping":function(){t(this).data("striping")!==!1&&e.setupStriping(a)}})},e.setupStriping=function(e){var a=0;t(e.table).find("> tbody > tr:not(.footable-row-detail)").each(function(){var i=t(this);i.removeClass(e.options.classes.striping.even).removeClass(e.options.classes.striping.odd),0===a%2?i.addClass(e.options.classes.striping.even):i.addClass(e.options.classes.striping.odd),a++})}}if(e.footable===undefined||null===e.foobox)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={striping:{enabled:!0},classes:{striping:{odd:"footable-odd",even:"footable-even"}}};e.footable.plugins.register(a,i)})(jQuery,window);
|
||||
Reference in New Issue
Block a user