jquery-tablesorter 1.23.0 → 1.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jquery-tablesorter/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +235 -212
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +65 -10
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +45 -5
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +20 -5
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js +4 -1
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +5 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +4 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +7 -3
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +3 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +13 -6
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +5 -5
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +13 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +12 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c5ec1ea040208bd492a6ddb95fc04d7b567b5d3
|
4
|
+
data.tar.gz: b0d4cc516082b7c9f6141b70bf50479267ef27fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964dcab9c0d02504d586dd7d991b8e257c3eff0b879b2d8104b22d4bcbb512b91b904efe154ea64f3a30009fab0ce921f96e3946545f4e0cf2277ec80c862563
|
7
|
+
data.tar.gz: da9eaf1162c57209531534538c9cd4242ca6aa8a6a74f25495204888bf91cd6064ad1d3f92f489d96792d07988af706c3782a988320117c35ea786db504bb9c5
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* tablesorter (FORK) pager plugin
|
3
|
-
* updated
|
3
|
+
* updated 11/26/2016 (v2.28.0)
|
4
4
|
*/
|
5
5
|
/*jshint browser:true, jquery:true, unused:false */
|
6
6
|
;(function($) {
|
@@ -128,16 +128,25 @@
|
|
128
128
|
|
129
129
|
// hide arrows at extremes
|
130
130
|
pagerArrows = function( table, p, disable ) {
|
131
|
-
var
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
131
|
+
var tmp,
|
132
|
+
a = 'addClass',
|
133
|
+
r = 'removeClass',
|
134
|
+
d = p.cssDisabled,
|
135
|
+
dis = !!disable,
|
136
|
+
first = ( dis || p.page === 0 ),
|
137
|
+
tp = getTotalPages( table, p ),
|
138
|
+
last = ( dis || (p.page === tp - 1) || tp === 0 );
|
138
139
|
if ( p.updateArrows ) {
|
139
|
-
p.$container.find(p.cssFirst + ',' + p.cssPrev)
|
140
|
-
|
140
|
+
tmp = p.$container.find(p.cssFirst + ',' + p.cssPrev);
|
141
|
+
tmp[ first ? a : r ](d); // toggle disabled class
|
142
|
+
tmp.each(function(){
|
143
|
+
this.ariaDisabled = first;
|
144
|
+
});
|
145
|
+
tmp = p.$container.find(p.cssNext + ',' + p.cssLast);
|
146
|
+
tmp[ last ? a : r ](d);
|
147
|
+
tmp.each(function(){
|
148
|
+
this.ariaDisabled = last;
|
149
|
+
});
|
141
150
|
}
|
142
151
|
},
|
143
152
|
|
@@ -689,9 +698,8 @@
|
|
689
698
|
.add( p.$container.find( '.ts-startRow, .ts-page' ) );
|
690
699
|
len = $controls.length;
|
691
700
|
for ( index = 0; index < len; index++ ) {
|
692
|
-
$controls.eq( index )
|
693
|
-
.
|
694
|
-
.addClass( p.cssDisabled )[0].disabled = true;
|
701
|
+
$controls.eq( index ).addClass( p.cssDisabled )[0].disabled = true;
|
702
|
+
$controls[ index ].ariaDisabled = true;
|
695
703
|
}
|
696
704
|
},
|
697
705
|
|
@@ -850,6 +858,12 @@
|
|
850
858
|
updatePageDisplay(table, p);
|
851
859
|
},
|
852
860
|
|
861
|
+
resetState = function(table, p) {
|
862
|
+
var c = table.config;
|
863
|
+
c.pager = $.extend( true, {}, $.tablesorterPager.defaults, p.settings );
|
864
|
+
init(table, p.settings);
|
865
|
+
},
|
866
|
+
|
853
867
|
destroyPager = function(table, p) {
|
854
868
|
var c = table.config,
|
855
869
|
namespace = c.namespace + 'pager',
|
@@ -876,7 +890,9 @@
|
|
876
890
|
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
877
891
|
.removeClass(p.cssDisabled)
|
878
892
|
.removeAttr('disabled')
|
879
|
-
.
|
893
|
+
.each(function(){
|
894
|
+
this.ariaDisabled = false;
|
895
|
+
});
|
880
896
|
p.isDisabled = false;
|
881
897
|
p.page = $.data(table, 'pagerLastPage') || p.page || 0;
|
882
898
|
size = p.$size.find('option[selected]').val();
|
@@ -904,6 +920,210 @@
|
|
904
920
|
console.log('Pager: Enabled');
|
905
921
|
}
|
906
922
|
}
|
923
|
+
},
|
924
|
+
|
925
|
+
init = function(table, settings) {
|
926
|
+
var t, ctrls, fxn, size,
|
927
|
+
c = table.config,
|
928
|
+
wo = c.widgetOptions,
|
929
|
+
p = c.pager = $.extend( true, {}, $.tablesorterPager.defaults, settings ),
|
930
|
+
$t = c.$table,
|
931
|
+
namespace = c.namespace + 'pager',
|
932
|
+
// added in case the pager is reinitialized after being destroyed.
|
933
|
+
pager = p.$container = $(p.container).addClass('tablesorter-pager').show();
|
934
|
+
// save a copy of the original settings
|
935
|
+
p.settings = $.extend( true, {}, $.tablesorterPager.defaults, settings );
|
936
|
+
if (c.debug) {
|
937
|
+
console.log('Pager: Initializing');
|
938
|
+
}
|
939
|
+
p.oldAjaxSuccess = p.oldAjaxSuccess || p.ajaxObject.success;
|
940
|
+
c.appender = $this.appender;
|
941
|
+
p.initializing = true;
|
942
|
+
if (p.savePages && ts.storage) {
|
943
|
+
t = ts.storage(table, p.storageKey) || {}; // fixes #387
|
944
|
+
p.page = isNaN(t.page) ? p.page : t.page;
|
945
|
+
p.size = t.size === 'all' ? t.size : ( isNaN( t.size ) ? p.size : t.size ) || p.setSize || 10;
|
946
|
+
$.data(table, 'pagerLastSize', p.size);
|
947
|
+
pager.find(p.cssPageSize).val(p.size);
|
948
|
+
}
|
949
|
+
// skipped rows
|
950
|
+
p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.slice(1) + '|' + c.cssChildRow + ')');
|
951
|
+
p.regexFiltered = new RegExp(wo.filter_filteredRow || 'filtered');
|
952
|
+
|
953
|
+
$t
|
954
|
+
// .unbind( namespace ) adding in jQuery 1.4.3 ( I think )
|
955
|
+
.unbind( pagerEvents.split(' ').join(namespace + ' ').replace(/\s+/g, ' ') )
|
956
|
+
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
|
957
|
+
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
|
958
|
+
// don't change page if filters are the same (pager updating, etc)
|
959
|
+
if (e.type === 'filterStart' && p.pageReset !== false && (c.lastCombinedFilter || '') !== (p.currentFilters || []).join('')) {
|
960
|
+
p.page = p.pageReset; // fixes #456 & #565
|
961
|
+
}
|
962
|
+
})
|
963
|
+
// update pager after filter widget completes
|
964
|
+
.bind('filterEnd sortEnd '.split(' ').join(namespace + ' '), function() {
|
965
|
+
p.currentFilters = c.$table.data('lastSearch');
|
966
|
+
if (p.initialized || p.initializing) {
|
967
|
+
if (c.delayInit && c.rowsCopy && c.rowsCopy.length === 0) {
|
968
|
+
// make sure we have a copy of all table rows once the cache has been built
|
969
|
+
updateCache(table);
|
970
|
+
}
|
971
|
+
updatePageDisplay(table, p, false);
|
972
|
+
moveToPage(table, p, false);
|
973
|
+
ts.applyWidget( table );
|
974
|
+
}
|
975
|
+
})
|
976
|
+
.bind('disablePager' + namespace, function(e){
|
977
|
+
e.stopPropagation();
|
978
|
+
showAllRows(table, p);
|
979
|
+
})
|
980
|
+
.bind('enablePager' + namespace, function(e){
|
981
|
+
e.stopPropagation();
|
982
|
+
enablePager(table, p, true);
|
983
|
+
})
|
984
|
+
.bind('destroyPager' + namespace, function(e){
|
985
|
+
e.stopPropagation();
|
986
|
+
destroyPager(table, p);
|
987
|
+
})
|
988
|
+
.bind('resetToLoadState' + namespace, function(e){
|
989
|
+
e.stopPropagation();
|
990
|
+
resetState(table, p);
|
991
|
+
})
|
992
|
+
.bind('updateComplete' + namespace, function(e, table, triggered){
|
993
|
+
e.stopPropagation();
|
994
|
+
// table can be unintentionally undefined in tablesorter v2.17.7 and earlier
|
995
|
+
// don't recalculate total rows/pages if using ajax
|
996
|
+
if ( !table || triggered || p.ajax ) { return; }
|
997
|
+
var $rows = c.$tbodies.eq(0).children('tr').not(c.selectorRemove);
|
998
|
+
p.totalRows = $rows.length - ( p.countChildRows ? 0 : $rows.filter('.' + c.cssChildRow).length );
|
999
|
+
p.totalPages = p.size === 'all' ? 1 : Math.ceil( p.totalRows / p.size );
|
1000
|
+
if ($rows.length && c.rowsCopy && c.rowsCopy.length === 0) {
|
1001
|
+
// make a copy of all table rows once the cache has been built
|
1002
|
+
updateCache(table);
|
1003
|
+
}
|
1004
|
+
if ( p.page >= p.totalPages ) {
|
1005
|
+
moveToLastPage(table, p);
|
1006
|
+
}
|
1007
|
+
hideRows(table, p);
|
1008
|
+
changeHeight(table, p);
|
1009
|
+
updatePageDisplay(table, p, true);
|
1010
|
+
})
|
1011
|
+
.bind('pageSize refreshComplete '.split(' ').join(namespace + ' '), function(e, size){
|
1012
|
+
e.stopPropagation();
|
1013
|
+
setPageSize(table, parsePageSize( p, size, 'get' ), p);
|
1014
|
+
hideRows(table, p);
|
1015
|
+
updatePageDisplay(table, p, false);
|
1016
|
+
})
|
1017
|
+
.bind('pageSet pagerUpdate '.split(' ').join(namespace + ' '), function(e, num){
|
1018
|
+
e.stopPropagation();
|
1019
|
+
// force pager refresh
|
1020
|
+
if (e.type === 'pagerUpdate') {
|
1021
|
+
num = typeof num === 'undefined' ? p.page + 1 : num;
|
1022
|
+
p.last.page = true;
|
1023
|
+
}
|
1024
|
+
p.page = (parseInt(num, 10) || 1) - 1;
|
1025
|
+
moveToPage(table, p, true);
|
1026
|
+
updatePageDisplay(table, p, false);
|
1027
|
+
})
|
1028
|
+
.bind('pageAndSize' + namespace, function(e, page, size){
|
1029
|
+
e.stopPropagation();
|
1030
|
+
p.page = (parseInt(page, 10) || 1) - 1;
|
1031
|
+
setPageSize(table, parsePageSize( p, size, 'get' ), p);
|
1032
|
+
moveToPage(table, p, true);
|
1033
|
+
hideRows(table, p);
|
1034
|
+
updatePageDisplay(table, p, false);
|
1035
|
+
});
|
1036
|
+
|
1037
|
+
// clicked controls
|
1038
|
+
ctrls = [ p.cssFirst, p.cssPrev, p.cssNext, p.cssLast ];
|
1039
|
+
fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ];
|
1040
|
+
if (c.debug && !pager.length) {
|
1041
|
+
console.warn('Pager: >> Container not found');
|
1042
|
+
}
|
1043
|
+
pager.find(ctrls.join(','))
|
1044
|
+
.attr('tabindex', 0)
|
1045
|
+
.unbind('click' + namespace)
|
1046
|
+
.bind('click' + namespace, function(e){
|
1047
|
+
e.stopPropagation();
|
1048
|
+
var i, $t = $(this), l = ctrls.length;
|
1049
|
+
if ( !$t.hasClass(p.cssDisabled) ) {
|
1050
|
+
for (i = 0; i < l; i++) {
|
1051
|
+
if ($t.is(ctrls[i])) {
|
1052
|
+
fxn[i](table, p);
|
1053
|
+
break;
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
});
|
1058
|
+
|
1059
|
+
// goto selector
|
1060
|
+
p.$goto = pager.find(p.cssGoto);
|
1061
|
+
if ( p.$goto.length ) {
|
1062
|
+
p.$goto
|
1063
|
+
.unbind('change' + namespace)
|
1064
|
+
.bind('change' + namespace, function(){
|
1065
|
+
p.page = $(this).val() - 1;
|
1066
|
+
moveToPage(table, p, true);
|
1067
|
+
updatePageDisplay(table, p, false);
|
1068
|
+
});
|
1069
|
+
} else if (c.debug) {
|
1070
|
+
console.warn('Pager: >> Goto selector not found');
|
1071
|
+
}
|
1072
|
+
// page size selector
|
1073
|
+
p.$size = pager.find(p.cssPageSize);
|
1074
|
+
if ( p.$size.length ) {
|
1075
|
+
// setting an option as selected appears to cause issues with initial page size
|
1076
|
+
p.$size.find('option').removeAttr('selected');
|
1077
|
+
p.$size.unbind('change' + namespace).bind('change' + namespace, function() {
|
1078
|
+
if ( !$(this).hasClass(p.cssDisabled) ) {
|
1079
|
+
var size = $(this).val();
|
1080
|
+
p.$size.val( size ); // in case there are more than one pagers
|
1081
|
+
setPageSize(table, size, p);
|
1082
|
+
changeHeight(table, p);
|
1083
|
+
}
|
1084
|
+
return false;
|
1085
|
+
});
|
1086
|
+
} else if (c.debug) {
|
1087
|
+
console.warn('Pager: >> Size selector not found');
|
1088
|
+
}
|
1089
|
+
|
1090
|
+
// clear initialized flag
|
1091
|
+
p.initialized = false;
|
1092
|
+
// before initialization event
|
1093
|
+
$t.triggerHandler('pagerBeforeInitialized', p);
|
1094
|
+
|
1095
|
+
enablePager(table, p, false);
|
1096
|
+
if ( typeof p.ajaxUrl === 'string' ) {
|
1097
|
+
// ajax pager; interact with database
|
1098
|
+
p.ajax = true;
|
1099
|
+
// When filtering with ajax, allow only custom filtering function, disable default
|
1100
|
+
// filtering since it will be done server side.
|
1101
|
+
c.widgetOptions.filter_serversideFiltering = true;
|
1102
|
+
c.serverSideSorting = true;
|
1103
|
+
moveToPage(table, p);
|
1104
|
+
} else {
|
1105
|
+
p.ajax = false;
|
1106
|
+
// Regular pager; all rows stored in memory
|
1107
|
+
ts.appendCache( c, true ); // true = don't apply widgets
|
1108
|
+
hideRowsSetup(table, p);
|
1109
|
+
}
|
1110
|
+
|
1111
|
+
// pager initialized
|
1112
|
+
if (!p.ajax && !p.initialized) {
|
1113
|
+
p.initializing = false;
|
1114
|
+
p.initialized = true;
|
1115
|
+
moveToPage(table, p);
|
1116
|
+
if (c.debug) {
|
1117
|
+
console.log('Pager: Triggering pagerInitialized');
|
1118
|
+
}
|
1119
|
+
c.$table.triggerHandler( 'pagerInitialized', p );
|
1120
|
+
if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) {
|
1121
|
+
updatePageDisplay(table, p, false);
|
1122
|
+
}
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
// make the hasWidget function think that the pager widget is being used
|
1126
|
+
c.widgetInit.pager = true;
|
907
1127
|
};
|
908
1128
|
|
909
1129
|
$this.appender = function(table, rows) {
|
@@ -924,204 +1144,7 @@
|
|
924
1144
|
return this.each(function() {
|
925
1145
|
// check if tablesorter has initialized
|
926
1146
|
if (!(this.config && this.hasInitialized)) { return; }
|
927
|
-
|
928
|
-
table = this,
|
929
|
-
c = table.config,
|
930
|
-
wo = c.widgetOptions,
|
931
|
-
p = c.pager = $.extend( true, {}, $.tablesorterPager.defaults, settings ),
|
932
|
-
$t = c.$table,
|
933
|
-
namespace = c.namespace + 'pager',
|
934
|
-
// added in case the pager is reinitialized after being destroyed.
|
935
|
-
pager = p.$container = $(p.container).addClass('tablesorter-pager').show();
|
936
|
-
// save a copy of the original settings
|
937
|
-
p.settings = $.extend( true, {}, $.tablesorterPager.defaults, settings );
|
938
|
-
if (c.debug) {
|
939
|
-
console.log('Pager: Initializing');
|
940
|
-
}
|
941
|
-
p.oldAjaxSuccess = p.oldAjaxSuccess || p.ajaxObject.success;
|
942
|
-
c.appender = $this.appender;
|
943
|
-
p.initializing = true;
|
944
|
-
if (p.savePages && ts.storage) {
|
945
|
-
t = ts.storage(table, p.storageKey) || {}; // fixes #387
|
946
|
-
p.page = isNaN(t.page) ? p.page : t.page;
|
947
|
-
p.size = t.size === 'all' ? t.size : ( isNaN( t.size ) ? p.size : t.size ) || p.setSize || 10;
|
948
|
-
$.data(table, 'pagerLastSize', p.size);
|
949
|
-
pager.find(p.cssPageSize).val(p.size);
|
950
|
-
}
|
951
|
-
// skipped rows
|
952
|
-
p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.slice(1) + '|' + c.cssChildRow + ')');
|
953
|
-
p.regexFiltered = new RegExp(wo.filter_filteredRow || 'filtered');
|
954
|
-
|
955
|
-
$t
|
956
|
-
// .unbind( namespace ) adding in jQuery 1.4.3 ( I think )
|
957
|
-
.unbind( pagerEvents.split(' ').join(namespace + ' ').replace(/\s+/g, ' ') )
|
958
|
-
.bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
|
959
|
-
p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
|
960
|
-
// don't change page if filters are the same (pager updating, etc)
|
961
|
-
if (e.type === 'filterStart' && p.pageReset !== false && (c.lastCombinedFilter || '') !== (p.currentFilters || []).join('')) {
|
962
|
-
p.page = p.pageReset; // fixes #456 & #565
|
963
|
-
}
|
964
|
-
})
|
965
|
-
// update pager after filter widget completes
|
966
|
-
.bind('filterEnd sortEnd '.split(' ').join(namespace + ' '), function() {
|
967
|
-
p.currentFilters = c.$table.data('lastSearch');
|
968
|
-
if (p.initialized || p.initializing) {
|
969
|
-
if (c.delayInit && c.rowsCopy && c.rowsCopy.length === 0) {
|
970
|
-
// make sure we have a copy of all table rows once the cache has been built
|
971
|
-
updateCache(table);
|
972
|
-
}
|
973
|
-
updatePageDisplay(table, p, false);
|
974
|
-
moveToPage(table, p, false);
|
975
|
-
ts.applyWidget( table );
|
976
|
-
}
|
977
|
-
})
|
978
|
-
.bind('disablePager' + namespace, function(e){
|
979
|
-
e.stopPropagation();
|
980
|
-
showAllRows(table, p);
|
981
|
-
})
|
982
|
-
.bind('enablePager' + namespace, function(e){
|
983
|
-
e.stopPropagation();
|
984
|
-
enablePager(table, p, true);
|
985
|
-
})
|
986
|
-
.bind('destroyPager' + namespace, function(e){
|
987
|
-
e.stopPropagation();
|
988
|
-
destroyPager(table, p);
|
989
|
-
})
|
990
|
-
.bind('updateComplete' + namespace, function(e, table, triggered){
|
991
|
-
e.stopPropagation();
|
992
|
-
// table can be unintentionally undefined in tablesorter v2.17.7 and earlier
|
993
|
-
// don't recalculate total rows/pages if using ajax
|
994
|
-
if ( !table || triggered || p.ajax ) { return; }
|
995
|
-
var $rows = c.$tbodies.eq(0).children('tr').not(c.selectorRemove);
|
996
|
-
p.totalRows = $rows.length - ( p.countChildRows ? 0 : $rows.filter('.' + c.cssChildRow).length );
|
997
|
-
p.totalPages = p.size === 'all' ? 1 : Math.ceil( p.totalRows / p.size );
|
998
|
-
if ($rows.length && c.rowsCopy && c.rowsCopy.length === 0) {
|
999
|
-
// make a copy of all table rows once the cache has been built
|
1000
|
-
updateCache(table);
|
1001
|
-
}
|
1002
|
-
if ( p.page >= p.totalPages ) {
|
1003
|
-
moveToLastPage(table, p);
|
1004
|
-
}
|
1005
|
-
hideRows(table, p);
|
1006
|
-
changeHeight(table, p);
|
1007
|
-
updatePageDisplay(table, p, true);
|
1008
|
-
})
|
1009
|
-
.bind('pageSize refreshComplete '.split(' ').join(namespace + ' '), function(e, size){
|
1010
|
-
e.stopPropagation();
|
1011
|
-
setPageSize(table, parsePageSize( p, size, 'get' ), p);
|
1012
|
-
hideRows(table, p);
|
1013
|
-
updatePageDisplay(table, p, false);
|
1014
|
-
})
|
1015
|
-
.bind('pageSet pagerUpdate '.split(' ').join(namespace + ' '), function(e, num){
|
1016
|
-
e.stopPropagation();
|
1017
|
-
// force pager refresh
|
1018
|
-
if (e.type === 'pagerUpdate') {
|
1019
|
-
num = typeof num === 'undefined' ? p.page + 1 : num;
|
1020
|
-
p.last.page = true;
|
1021
|
-
}
|
1022
|
-
p.page = (parseInt(num, 10) || 1) - 1;
|
1023
|
-
moveToPage(table, p, true);
|
1024
|
-
updatePageDisplay(table, p, false);
|
1025
|
-
})
|
1026
|
-
.bind('pageAndSize' + namespace, function(e, page, size){
|
1027
|
-
e.stopPropagation();
|
1028
|
-
p.page = (parseInt(page, 10) || 1) - 1;
|
1029
|
-
setPageSize(table, parsePageSize( p, size, 'get' ), p);
|
1030
|
-
moveToPage(table, p, true);
|
1031
|
-
hideRows(table, p);
|
1032
|
-
updatePageDisplay(table, p, false);
|
1033
|
-
});
|
1034
|
-
|
1035
|
-
// clicked controls
|
1036
|
-
ctrls = [ p.cssFirst, p.cssPrev, p.cssNext, p.cssLast ];
|
1037
|
-
fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ];
|
1038
|
-
if (c.debug && !pager.length) {
|
1039
|
-
console.warn('Pager: >> Container not found');
|
1040
|
-
}
|
1041
|
-
pager.find(ctrls.join(','))
|
1042
|
-
.attr('tabindex', 0)
|
1043
|
-
.unbind('click' + namespace)
|
1044
|
-
.bind('click' + namespace, function(e){
|
1045
|
-
e.stopPropagation();
|
1046
|
-
var i, $t = $(this), l = ctrls.length;
|
1047
|
-
if ( !$t.hasClass(p.cssDisabled) ) {
|
1048
|
-
for (i = 0; i < l; i++) {
|
1049
|
-
if ($t.is(ctrls[i])) {
|
1050
|
-
fxn[i](table, p);
|
1051
|
-
break;
|
1052
|
-
}
|
1053
|
-
}
|
1054
|
-
}
|
1055
|
-
});
|
1056
|
-
|
1057
|
-
// goto selector
|
1058
|
-
p.$goto = pager.find(p.cssGoto);
|
1059
|
-
if ( p.$goto.length ) {
|
1060
|
-
p.$goto
|
1061
|
-
.unbind('change' + namespace)
|
1062
|
-
.bind('change' + namespace, function(){
|
1063
|
-
p.page = $(this).val() - 1;
|
1064
|
-
moveToPage(table, p, true);
|
1065
|
-
updatePageDisplay(table, p, false);
|
1066
|
-
});
|
1067
|
-
} else if (c.debug) {
|
1068
|
-
console.warn('Pager: >> Goto selector not found');
|
1069
|
-
}
|
1070
|
-
// page size selector
|
1071
|
-
p.$size = pager.find(p.cssPageSize);
|
1072
|
-
if ( p.$size.length ) {
|
1073
|
-
// setting an option as selected appears to cause issues with initial page size
|
1074
|
-
p.$size.find('option').removeAttr('selected');
|
1075
|
-
p.$size.unbind('change' + namespace).bind('change' + namespace, function() {
|
1076
|
-
if ( !$(this).hasClass(p.cssDisabled) ) {
|
1077
|
-
var size = $(this).val();
|
1078
|
-
p.$size.val( size ); // in case there are more than one pagers
|
1079
|
-
setPageSize(table, size, p);
|
1080
|
-
changeHeight(table, p);
|
1081
|
-
}
|
1082
|
-
return false;
|
1083
|
-
});
|
1084
|
-
} else if (c.debug) {
|
1085
|
-
console.warn('Pager: >> Size selector not found');
|
1086
|
-
}
|
1087
|
-
|
1088
|
-
// clear initialized flag
|
1089
|
-
p.initialized = false;
|
1090
|
-
// before initialization event
|
1091
|
-
$t.triggerHandler('pagerBeforeInitialized', p);
|
1092
|
-
|
1093
|
-
enablePager(table, p, false);
|
1094
|
-
if ( typeof p.ajaxUrl === 'string' ) {
|
1095
|
-
// ajax pager; interact with database
|
1096
|
-
p.ajax = true;
|
1097
|
-
// When filtering with ajax, allow only custom filtering function, disable default
|
1098
|
-
// filtering since it will be done server side.
|
1099
|
-
c.widgetOptions.filter_serversideFiltering = true;
|
1100
|
-
c.serverSideSorting = true;
|
1101
|
-
moveToPage(table, p);
|
1102
|
-
} else {
|
1103
|
-
p.ajax = false;
|
1104
|
-
// Regular pager; all rows stored in memory
|
1105
|
-
ts.appendCache( c, true ); // true = don't apply widgets
|
1106
|
-
hideRowsSetup(table, p);
|
1107
|
-
}
|
1108
|
-
|
1109
|
-
// pager initialized
|
1110
|
-
if (!p.ajax && !p.initialized) {
|
1111
|
-
p.initializing = false;
|
1112
|
-
p.initialized = true;
|
1113
|
-
moveToPage(table, p);
|
1114
|
-
if (c.debug) {
|
1115
|
-
console.log('Pager: Triggering pagerInitialized');
|
1116
|
-
}
|
1117
|
-
c.$table.triggerHandler( 'pagerInitialized', p );
|
1118
|
-
if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) {
|
1119
|
-
updatePageDisplay(table, p, false);
|
1120
|
-
}
|
1121
|
-
}
|
1122
|
-
|
1123
|
-
// make the hasWidget function think that the pager widget is being used
|
1124
|
-
c.widgetInit.pager = true;
|
1147
|
+
init(this, settings);
|
1125
1148
|
});
|
1126
1149
|
};
|
1127
1150
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 11-26-2016 (v2.28.0)*/
|
8
8
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9
9
|
(function(factory) {
|
10
10
|
if (typeof define === 'function' && define.amd) {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
}(function(jQuery) {
|
18
18
|
|
19
|
-
/*! TableSorter (FORK) v2.
|
19
|
+
/*! TableSorter (FORK) v2.28.0 *//*
|
20
20
|
* Client-side table sorting with ease!
|
21
21
|
* @requires jQuery v1.2.6+
|
22
22
|
*
|
@@ -40,7 +40,7 @@
|
|
40
40
|
'use strict';
|
41
41
|
var ts = $.tablesorter = {
|
42
42
|
|
43
|
-
version : '2.
|
43
|
+
version : '2.28.0',
|
44
44
|
|
45
45
|
parsers : [],
|
46
46
|
widgets : [],
|
@@ -134,7 +134,11 @@
|
|
134
134
|
headerList: [],
|
135
135
|
empties: {},
|
136
136
|
strings: {},
|
137
|
-
parsers: []
|
137
|
+
parsers: [],
|
138
|
+
|
139
|
+
// *** parser options for validator; values must be falsy!
|
140
|
+
globalize: 0,
|
141
|
+
imgAttr: 0
|
138
142
|
|
139
143
|
// removed: widgetZebra: { css: ['even', 'odd'] }
|
140
144
|
|
@@ -308,6 +312,7 @@
|
|
308
312
|
ts.setupParsers( c );
|
309
313
|
// start total row count at zero
|
310
314
|
c.totalRows = 0;
|
315
|
+
ts.validateOptions( c );
|
311
316
|
// build the cache for the tbody cells
|
312
317
|
// delayInit will delay building the cache until the user starts a sort
|
313
318
|
if ( !c.delayInit ) { ts.buildCache( c ); }
|
@@ -441,9 +446,11 @@
|
|
441
446
|
e.stopPropagation();
|
442
447
|
// remove all widgets
|
443
448
|
ts.removeWidget( this, true, false );
|
449
|
+
var tmp = $.extend( true, {}, c.originalSettings );
|
444
450
|
// restore original settings; this clears out current settings, but does not clear
|
445
451
|
// values saved to storage.
|
446
|
-
c = $.extend( true, ts.defaults,
|
452
|
+
c = $.extend( true, ts.defaults, tmp );
|
453
|
+
c.originalSettings = tmp;
|
447
454
|
this.hasInitialized = false;
|
448
455
|
// setup the entire table again
|
449
456
|
ts.setup( this, c );
|
@@ -1086,6 +1093,7 @@
|
|
1086
1093
|
.removeClass( css.join( ' ' ) );
|
1087
1094
|
// remove all header information
|
1088
1095
|
c.$headers
|
1096
|
+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
|
1089
1097
|
.removeClass( css.join( ' ' ) )
|
1090
1098
|
.addClass( none )
|
1091
1099
|
.attr( 'aria-sort', 'none' )
|
@@ -1928,6 +1936,8 @@
|
|
1928
1936
|
widget = ts.getWidgetById( c.widgets[ indx ] );
|
1929
1937
|
if ( widget && widget.options ) {
|
1930
1938
|
c.widgetOptions = $.extend( true, {}, widget.options, c.widgetOptions );
|
1939
|
+
// add widgetOptions to defaults for option validator
|
1940
|
+
$.extend( true, ts.defaults.widgetOptions, widget.options );
|
1931
1941
|
}
|
1932
1942
|
}
|
1933
1943
|
}
|
@@ -2300,7 +2310,9 @@
|
|
2300
2310
|
},
|
2301
2311
|
|
2302
2312
|
getColumnData : function( table, obj, indx, getCell, $headers ) {
|
2303
|
-
if ( typeof obj
|
2313
|
+
if ( typeof obj !== 'object' || obj === null ) {
|
2314
|
+
return obj;
|
2315
|
+
}
|
2304
2316
|
table = $( table )[ 0 ];
|
2305
2317
|
var $header, key,
|
2306
2318
|
c = table.config,
|
@@ -2411,6 +2423,34 @@
|
|
2411
2423
|
return str;
|
2412
2424
|
},
|
2413
2425
|
|
2426
|
+
validateOptions : function( c ) {
|
2427
|
+
var setting, setting2, typ, timer,
|
2428
|
+
// ignore options containing an array
|
2429
|
+
ignore = 'sortForce sortList sortAppend widgets'.split( ' ' ),
|
2430
|
+
orig = c.originalSettings;
|
2431
|
+
if ( orig ) {
|
2432
|
+
if ( c.debug ) {
|
2433
|
+
timer = new Date();
|
2434
|
+
}
|
2435
|
+
for ( setting in orig ) {
|
2436
|
+
typ = typeof ts.defaults[setting];
|
2437
|
+
if ( typ === 'undefined' ) {
|
2438
|
+
console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
|
2439
|
+
} else if ( typ === 'object' ) {
|
2440
|
+
for ( setting2 in orig[setting] ) {
|
2441
|
+
typ = typeof ts.defaults[setting][setting2];
|
2442
|
+
if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
|
2443
|
+
console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
|
2444
|
+
}
|
2445
|
+
}
|
2446
|
+
}
|
2447
|
+
}
|
2448
|
+
if ( c.debug ) {
|
2449
|
+
console.log( 'validate options time:' + ts.benchmark( timer ) );
|
2450
|
+
}
|
2451
|
+
}
|
2452
|
+
},
|
2453
|
+
|
2414
2454
|
// restore headers
|
2415
2455
|
restoreHeaders : function( table ) {
|
2416
2456
|
var index, $cell,
|
@@ -2771,7 +2811,7 @@
|
|
2771
2811
|
|
2772
2812
|
})( jQuery );
|
2773
2813
|
|
2774
|
-
/*! Widget: storage - updated
|
2814
|
+
/*! Widget: storage - updated 11/26/2016 (v2.28.0) */
|
2775
2815
|
/*global JSON:false */
|
2776
2816
|
;(function ($, window, document) {
|
2777
2817
|
'use strict';
|
@@ -2816,6 +2856,17 @@
|
|
2816
2856
|
url = options && options.url ||
|
2817
2857
|
$table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
|
2818
2858
|
wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
|
2859
|
+
// update defaults for validator; these values must be falsy!
|
2860
|
+
$.extend(true, ts.defaults, {
|
2861
|
+
fixedUrl: '',
|
2862
|
+
widgetOptions: {
|
2863
|
+
storage_fixedUrl: '',
|
2864
|
+
storage_group: '',
|
2865
|
+
storage_page: '',
|
2866
|
+
storage_tableId: '',
|
2867
|
+
storage_useSessionStorage: ''
|
2868
|
+
}
|
2869
|
+
});
|
2819
2870
|
// https://gist.github.com/paulirish/5558557
|
2820
2871
|
if (storageType in window) {
|
2821
2872
|
try {
|
@@ -3137,7 +3188,7 @@
|
|
3137
3188
|
|
3138
3189
|
})(jQuery);
|
3139
3190
|
|
3140
|
-
/*! Widget: filter - updated
|
3191
|
+
/*! Widget: filter - updated 11/26/2016 (v2.28.0) *//*
|
3141
3192
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3142
3193
|
* by Rob Garrison
|
3143
3194
|
*/
|
@@ -3966,11 +4017,15 @@
|
|
3966
4017
|
// include change for select - fixes #473
|
3967
4018
|
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
|
3968
4019
|
// don't get cached data, in case data-column changes dynamically
|
3969
|
-
var column = parseInt( $( this ).attr( 'data-column' ), 10 )
|
4020
|
+
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
|
4021
|
+
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
|
4022
|
+
wo.filter_liveSearch :
|
4023
|
+
ts.getColumnData( table, wo.filter_liveSearch, column );
|
3970
4024
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
3971
4025
|
if ( table.config.widgetOptions.filter_initialized &&
|
3972
4026
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
3973
|
-
( event.type === 'change' ||
|
4027
|
+
( event.type === 'change' ||
|
4028
|
+
( event.type === 'input' && liveSearch === true ) ) &&
|
3974
4029
|
this.value !== c.lastSearch[column] )
|
3975
4030
|
) {
|
3976
4031
|
event.preventDefault();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! TableSorter (FORK) v2.
|
1
|
+
/*! TableSorter (FORK) v2.28.0 *//*
|
2
2
|
* Client-side table sorting with ease!
|
3
3
|
* @requires jQuery v1.2.6+
|
4
4
|
*
|
@@ -22,7 +22,7 @@
|
|
22
22
|
'use strict';
|
23
23
|
var ts = $.tablesorter = {
|
24
24
|
|
25
|
-
version : '2.
|
25
|
+
version : '2.28.0',
|
26
26
|
|
27
27
|
parsers : [],
|
28
28
|
widgets : [],
|
@@ -116,7 +116,11 @@
|
|
116
116
|
headerList: [],
|
117
117
|
empties: {},
|
118
118
|
strings: {},
|
119
|
-
parsers: []
|
119
|
+
parsers: [],
|
120
|
+
|
121
|
+
// *** parser options for validator; values must be falsy!
|
122
|
+
globalize: 0,
|
123
|
+
imgAttr: 0
|
120
124
|
|
121
125
|
// removed: widgetZebra: { css: ['even', 'odd'] }
|
122
126
|
|
@@ -290,6 +294,7 @@
|
|
290
294
|
ts.setupParsers( c );
|
291
295
|
// start total row count at zero
|
292
296
|
c.totalRows = 0;
|
297
|
+
ts.validateOptions( c );
|
293
298
|
// build the cache for the tbody cells
|
294
299
|
// delayInit will delay building the cache until the user starts a sort
|
295
300
|
if ( !c.delayInit ) { ts.buildCache( c ); }
|
@@ -423,9 +428,11 @@
|
|
423
428
|
e.stopPropagation();
|
424
429
|
// remove all widgets
|
425
430
|
ts.removeWidget( this, true, false );
|
431
|
+
var tmp = $.extend( true, {}, c.originalSettings );
|
426
432
|
// restore original settings; this clears out current settings, but does not clear
|
427
433
|
// values saved to storage.
|
428
|
-
c = $.extend( true, ts.defaults,
|
434
|
+
c = $.extend( true, ts.defaults, tmp );
|
435
|
+
c.originalSettings = tmp;
|
429
436
|
this.hasInitialized = false;
|
430
437
|
// setup the entire table again
|
431
438
|
ts.setup( this, c );
|
@@ -1068,6 +1075,7 @@
|
|
1068
1075
|
.removeClass( css.join( ' ' ) );
|
1069
1076
|
// remove all header information
|
1070
1077
|
c.$headers
|
1078
|
+
.add( $( 'thead ' + c.namespace + '_extra_headers' ) )
|
1071
1079
|
.removeClass( css.join( ' ' ) )
|
1072
1080
|
.addClass( none )
|
1073
1081
|
.attr( 'aria-sort', 'none' )
|
@@ -1910,6 +1918,8 @@
|
|
1910
1918
|
widget = ts.getWidgetById( c.widgets[ indx ] );
|
1911
1919
|
if ( widget && widget.options ) {
|
1912
1920
|
c.widgetOptions = $.extend( true, {}, widget.options, c.widgetOptions );
|
1921
|
+
// add widgetOptions to defaults for option validator
|
1922
|
+
$.extend( true, ts.defaults.widgetOptions, widget.options );
|
1913
1923
|
}
|
1914
1924
|
}
|
1915
1925
|
}
|
@@ -2282,7 +2292,9 @@
|
|
2282
2292
|
},
|
2283
2293
|
|
2284
2294
|
getColumnData : function( table, obj, indx, getCell, $headers ) {
|
2285
|
-
if ( typeof obj
|
2295
|
+
if ( typeof obj !== 'object' || obj === null ) {
|
2296
|
+
return obj;
|
2297
|
+
}
|
2286
2298
|
table = $( table )[ 0 ];
|
2287
2299
|
var $header, key,
|
2288
2300
|
c = table.config,
|
@@ -2393,6 +2405,34 @@
|
|
2393
2405
|
return str;
|
2394
2406
|
},
|
2395
2407
|
|
2408
|
+
validateOptions : function( c ) {
|
2409
|
+
var setting, setting2, typ, timer,
|
2410
|
+
// ignore options containing an array
|
2411
|
+
ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
|
2412
|
+
orig = c.originalSettings;
|
2413
|
+
if ( orig ) {
|
2414
|
+
if ( c.debug ) {
|
2415
|
+
timer = new Date();
|
2416
|
+
}
|
2417
|
+
for ( setting in orig ) {
|
2418
|
+
typ = typeof ts.defaults[setting];
|
2419
|
+
if ( typ === 'undefined' ) {
|
2420
|
+
console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
|
2421
|
+
} else if ( typ === 'object' ) {
|
2422
|
+
for ( setting2 in orig[setting] ) {
|
2423
|
+
typ = ts.defaults[setting] && typeof ts.defaults[setting][setting2];
|
2424
|
+
if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
|
2425
|
+
console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
|
2426
|
+
}
|
2427
|
+
}
|
2428
|
+
}
|
2429
|
+
}
|
2430
|
+
if ( c.debug ) {
|
2431
|
+
console.log( 'validate options time:' + ts.benchmark( timer ) );
|
2432
|
+
}
|
2433
|
+
}
|
2434
|
+
},
|
2435
|
+
|
2396
2436
|
// restore headers
|
2397
2437
|
restoreHeaders : function( table ) {
|
2398
2438
|
var index, $cell,
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 11-26-2016 (v2.28.0)*/
|
8
8
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9
9
|
(function(factory) {
|
10
10
|
if (typeof define === 'function' && define.amd) {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
}(function(jQuery) {
|
18
18
|
|
19
|
-
/*! Widget: storage - updated
|
19
|
+
/*! Widget: storage - updated 11/26/2016 (v2.28.0) */
|
20
20
|
/*global JSON:false */
|
21
21
|
;(function ($, window, document) {
|
22
22
|
'use strict';
|
@@ -61,6 +61,17 @@
|
|
61
61
|
url = options && options.url ||
|
62
62
|
$table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
|
63
63
|
wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
|
64
|
+
// update defaults for validator; these values must be falsy!
|
65
|
+
$.extend(true, ts.defaults, {
|
66
|
+
fixedUrl: '',
|
67
|
+
widgetOptions: {
|
68
|
+
storage_fixedUrl: '',
|
69
|
+
storage_group: '',
|
70
|
+
storage_page: '',
|
71
|
+
storage_tableId: '',
|
72
|
+
storage_useSessionStorage: ''
|
73
|
+
}
|
74
|
+
});
|
64
75
|
// https://gist.github.com/paulirish/5558557
|
65
76
|
if (storageType in window) {
|
66
77
|
try {
|
@@ -382,7 +393,7 @@
|
|
382
393
|
|
383
394
|
})(jQuery);
|
384
395
|
|
385
|
-
/*! Widget: filter - updated
|
396
|
+
/*! Widget: filter - updated 11/26/2016 (v2.28.0) *//*
|
386
397
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
387
398
|
* by Rob Garrison
|
388
399
|
*/
|
@@ -1211,11 +1222,15 @@
|
|
1211
1222
|
// include change for select - fixes #473
|
1212
1223
|
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
|
1213
1224
|
// don't get cached data, in case data-column changes dynamically
|
1214
|
-
var column = parseInt( $( this ).attr( 'data-column' ), 10 )
|
1225
|
+
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
|
1226
|
+
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
|
1227
|
+
wo.filter_liveSearch :
|
1228
|
+
ts.getColumnData( table, wo.filter_liveSearch, column );
|
1215
1229
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
1216
1230
|
if ( table.config.widgetOptions.filter_initialized &&
|
1217
1231
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
1218
|
-
( event.type === 'change' ||
|
1232
|
+
( event.type === 'change' ||
|
1233
|
+
( event.type === 'input' && liveSearch === true ) ) &&
|
1219
1234
|
this.value !== c.lastSearch[column] )
|
1220
1235
|
) {
|
1221
1236
|
event.preventDefault();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Parser: two digit year - updated 11/
|
1
|
+
/*! Parser: two digit year - updated 11/26/2016 (v2.28.0) */
|
2
2
|
/* Demo: http://mottie.github.io/tablesorter/docs/example-parsers-dates.html */
|
3
3
|
/*jshint jquery:true */
|
4
4
|
;(function($){
|
@@ -13,6 +13,9 @@
|
|
13
13
|
ts = $.tablesorter,
|
14
14
|
now = new Date().getFullYear();
|
15
15
|
|
16
|
+
// add dateRange to defaults for validator; value must be falsy
|
17
|
+
ts.defaults.dataRange = '';
|
18
|
+
|
16
19
|
if ( !ts.dates ) { ts.dates = {}; }
|
17
20
|
ts.dates.regxxxxyy = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{2})/;
|
18
21
|
ts.dates.regyyxxxx = /(\d{2})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Parser: input & select - updated
|
1
|
+
/*! Parser: input & select - updated 11/26/2016 (v2.28.0) *//*
|
2
2
|
* for jQuery 1.7+ & tablesorter 2.7.11+
|
3
3
|
* Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
|
4
4
|
*/
|
@@ -110,6 +110,10 @@
|
|
110
110
|
type : 'text'
|
111
111
|
});
|
112
112
|
|
113
|
+
// update defaults for validator; values must be falsy
|
114
|
+
$.tablesorter.defaults.checkboxClass = '';
|
115
|
+
$.tablesorter.defaults.checkboxVisible = '';
|
116
|
+
|
113
117
|
// update select and all input types in the tablesorter cache when the change event fires.
|
114
118
|
// This method only works with jQuery 1.7+
|
115
119
|
// you can change it to use delegate (v1.4.3+) or live (v1.3+) as desired
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: Build Table - updated
|
1
|
+
/*! Widget: Build Table - updated 11/26/2016 (v2.28.0) *//*
|
2
2
|
* for tableSorter v2.16.0+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -79,6 +79,9 @@
|
|
79
79
|
}
|
80
80
|
};
|
81
81
|
|
82
|
+
// add data to defaults for validator; value must be falsy!
|
83
|
+
ts.defaults.data = '';
|
84
|
+
|
82
85
|
bt.defaults = {
|
83
86
|
// *** build widget core ***
|
84
87
|
build_type : '', // array, csv, object, json, html
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: filter - updated
|
1
|
+
/*! Widget: filter - updated 11/26/2016 (v2.28.0) *//*
|
2
2
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -827,11 +827,15 @@
|
|
827
827
|
// include change for select - fixes #473
|
828
828
|
.bind( 'search change keypress input '.split( ' ' ).join( namespace + ' ' ), function( event ) {
|
829
829
|
// don't get cached data, in case data-column changes dynamically
|
830
|
-
var column = parseInt( $( this ).attr( 'data-column' ), 10 )
|
830
|
+
var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
|
831
|
+
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
|
832
|
+
wo.filter_liveSearch :
|
833
|
+
ts.getColumnData( table, wo.filter_liveSearch, column );
|
831
834
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
832
835
|
if ( table.config.widgetOptions.filter_initialized &&
|
833
836
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
834
|
-
( event.type === 'change' ||
|
837
|
+
( event.type === 'change' ||
|
838
|
+
( event.type === 'input' && liveSearch === true ) ) &&
|
835
839
|
this.value !== c.lastSearch[column] )
|
836
840
|
) {
|
837
841
|
event.preventDefault();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: grouping - updated
|
1
|
+
/*! Widget: grouping - updated 11/26/2016 (v2.28.0) *//*
|
2
2
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -234,7 +234,8 @@
|
|
234
234
|
if ( $.isFunction( wo.group_formatter ) ) {
|
235
235
|
data.currentGroup = wo.group_formatter( ( data.group || '' ).toString(), data.column, c.table, c, wo, data ) || data.group;
|
236
236
|
}
|
237
|
-
|
237
|
+
// add first() for grouping with childRows
|
238
|
+
data.$row.first().before( tsg.groupHeaderHTML( c, wo, data ) );
|
238
239
|
if ( wo.group_saveGroups && !data.savedGroup && wo.group_collapsed && wo.group_collapsible ) {
|
239
240
|
// all groups start collapsed; data.groupIndex is 1 more than the expected index.
|
240
241
|
wo.group_collapsedGroups[ wo.group_collapsedGroup ].push( data.currentGroup + data.groupIndex );
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: math - updated
|
1
|
+
/*! Widget: math - updated 11/26/2016 (v2.28.0) *//*
|
2
2
|
* Requires tablesorter v2.16+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -29,7 +29,15 @@
|
|
29
29
|
.split(' ').join('.tsmath '),
|
30
30
|
|
31
31
|
processText : function( c, $cell ) {
|
32
|
-
var
|
32
|
+
var tmp,
|
33
|
+
txt = ts.getElementText( c, $cell, math.getCellIndex( $cell ) ),
|
34
|
+
prefix = c.widgetOptions.math_prefix;
|
35
|
+
if ( /</.test( prefix ) ) {
|
36
|
+
// prefix contains HTML; remove it & any text before using formatFloat
|
37
|
+
tmp = $( '<div>' + prefix + '</div>' ).text()
|
38
|
+
.replace(/\{content\}/g, '').trim();
|
39
|
+
txt = txt.replace( tmp, '' );
|
40
|
+
}
|
33
41
|
txt = ts.formatFloat( txt.replace( /[^\w,. \-()]/g, '' ), c.table ) || 0;
|
34
42
|
// isNaN('') => false
|
35
43
|
return isNaN( txt ) ? 0 : txt;
|
@@ -352,7 +360,7 @@
|
|
352
360
|
prev = $cell.html(),
|
353
361
|
mask = $cell.attr( 'data-' + wo.math_data + '-mask' ) || wo.math_mask,
|
354
362
|
target = $cell.attr( 'data-' + wo.math_data + '-target' ) || '',
|
355
|
-
result = ts.formatMask( mask, value, wo.
|
363
|
+
result = ts.formatMask( mask, value, wo.math_prefix, wo.math_suffix );
|
356
364
|
if (target) {
|
357
365
|
$el = $cell.find(target);
|
358
366
|
if ($el.length) {
|
@@ -403,8 +411,7 @@
|
|
403
411
|
start = mask.search( /[0-9\-\+#]/ ),
|
404
412
|
tmp = start > 0 ? mask.substring( 0, start ) : '',
|
405
413
|
prefix = tmp;
|
406
|
-
|
407
|
-
if ( start > 0 && tmpPrefix ) {
|
414
|
+
if ( tmpPrefix ) {
|
408
415
|
if ( /\{content\}/.test( tmpPrefix || '' ) ) {
|
409
416
|
prefix = ( tmpPrefix || '' ).replace( /\{content\}/g, tmp || '' );
|
410
417
|
} else {
|
@@ -418,7 +425,7 @@
|
|
418
425
|
index += ( mask.substring( index, index + 1 ) === '.' ) ? 1 : 0;
|
419
426
|
tmp = end > 0 ? mask.substring( index, len ) : '';
|
420
427
|
suffix = tmp;
|
421
|
-
if (
|
428
|
+
if ( tmpSuffix ) {
|
422
429
|
if ( /\{content\}/.test( tmpSuffix || '' ) ) {
|
423
430
|
suffix = ( tmpSuffix || '' ).replace( /\{content\}/g, tmp || '' );
|
424
431
|
} else {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: Pager - updated
|
1
|
+
/*! Widget: Pager - updated 11/26/2016 (v2.28.0) */
|
2
2
|
/* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
@@ -404,11 +404,11 @@
|
|
404
404
|
p.$container
|
405
405
|
.find( s.first + ',' + s.prev )
|
406
406
|
.toggleClass( wo.pager_css.disabled, first )
|
407
|
-
.
|
407
|
+
.prop( 'aria-disabled', first );
|
408
408
|
p.$container
|
409
409
|
.find( s.next + ',' + s.last )
|
410
410
|
.toggleClass( wo.pager_css.disabled, last )
|
411
|
-
.
|
411
|
+
.prop( 'aria-disabled', last );
|
412
412
|
}
|
413
413
|
},
|
414
414
|
|
@@ -451,7 +451,7 @@
|
|
451
451
|
.add( p.$goto )
|
452
452
|
.removeClass( wo.pager_css.disabled )
|
453
453
|
.removeAttr( 'disabled' )
|
454
|
-
.
|
454
|
+
.prop( 'aria-disabled', 'false' );
|
455
455
|
p.totalPages = Math.ceil( p.totalRows / sz ); // needed for 'pageSize' method
|
456
456
|
c.totalRows = p.totalRows;
|
457
457
|
tsp.parsePageNumber( c, p );
|
@@ -1012,7 +1012,7 @@
|
|
1012
1012
|
len = $controls.length;
|
1013
1013
|
for ( index = 0; index < len; index++ ) {
|
1014
1014
|
$controls.eq( index )
|
1015
|
-
.
|
1015
|
+
.prop( 'aria-disabled', 'true' )
|
1016
1016
|
.addClass( wo.pager_css.disabled )[ 0 ].disabled = true;
|
1017
1017
|
}
|
1018
1018
|
},
|
@@ -1,6 +1,7 @@
|
|
1
|
-
/*! tablesorter tbody sorting widget (BETA) - 11/
|
1
|
+
/*! tablesorter tbody sorting widget (BETA) - 11/26/2016 (v2.28.0)
|
2
2
|
* Requires tablesorter v2.22.2+ and jQuery 1.4+
|
3
3
|
* by Rob Garrison
|
4
|
+
* Contributors: Chris Rogers
|
4
5
|
*/
|
5
6
|
/*jshint browser:true, jquery:true, unused:false */
|
6
7
|
/*global jQuery: false */
|
@@ -38,6 +39,15 @@
|
|
38
39
|
// find parsers for each column
|
39
40
|
ts.sortTbodies.setTbodies( c, wo );
|
40
41
|
ts.updateCache( c, null, c.$tbodies );
|
42
|
+
})
|
43
|
+
.bind('sortEnd', function() {
|
44
|
+
// Moves the head row back to the top of the tbody
|
45
|
+
var primaryRow = wo.sortTbody_primaryRow;
|
46
|
+
if ( wo.sortTbody_lockHead && primaryRow ) {
|
47
|
+
c.$table.find( primaryRow ).each( function() {
|
48
|
+
$( this ).parents( 'tbody' ).prepend( this );
|
49
|
+
});
|
50
|
+
}
|
41
51
|
});
|
42
52
|
|
43
53
|
// detect parsers - in case the table contains only info-only tbodies
|
@@ -208,6 +218,8 @@
|
|
208
218
|
// priority < 50 (filter widget), so c.$tbodies has the correct elements
|
209
219
|
priority: 40,
|
210
220
|
options: {
|
221
|
+
// lock primary row as a header when sorting
|
222
|
+
sortTbody_lockHead : false,
|
211
223
|
// point to a row within the tbody that matches the number of header columns
|
212
224
|
sortTbody_primaryRow : null,
|
213
225
|
// sort tbody internal rows
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Widget: storage - updated
|
1
|
+
/*! Widget: storage - updated 11/26/2016 (v2.28.0) */
|
2
2
|
/*global JSON:false */
|
3
3
|
;(function ($, window, document) {
|
4
4
|
'use strict';
|
@@ -43,6 +43,17 @@
|
|
43
43
|
url = options && options.url ||
|
44
44
|
$table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
|
45
45
|
wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
|
46
|
+
// update defaults for validator; these values must be falsy!
|
47
|
+
$.extend(true, ts.defaults, {
|
48
|
+
fixedUrl: '',
|
49
|
+
widgetOptions: {
|
50
|
+
storage_fixedUrl: '',
|
51
|
+
storage_group: '',
|
52
|
+
storage_page: '',
|
53
|
+
storage_tableId: '',
|
54
|
+
storage_useSessionStorage: ''
|
55
|
+
}
|
56
|
+
});
|
46
57
|
// https://gist.github.com/paulirish/5558557
|
47
58
|
if (storageType in window) {
|
48
59
|
try {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-tablesorter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.23.
|
4
|
+
version: 1.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jun Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-11-
|
12
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
180
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.5.
|
181
|
+
rubygems_version: 2.5.2
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Simple integration of jquery-tablesorter (Mottie's fork) into the Rails asset
|