jquery-tablesorter 1.20.4 → 1.20.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jquery-tablesorter/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +9 -9
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +65 -46
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +25 -24
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +40 -22
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-huge-numbers.js +21 -0
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js +19 -7
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +34 -16
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +9 -7
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +17 -22
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +9 -9
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +6 -5
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +12 -8
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +2 -2
- metadata +3 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! TableSorter (FORK) v2.25.
|
1
|
+
/*! TableSorter (FORK) v2.25.5 *//*
|
2
2
|
* Client-side table sorting with ease!
|
3
3
|
* @requires jQuery v1.2.6+
|
4
4
|
*
|
@@ -21,7 +21,7 @@
|
|
21
21
|
'use strict';
|
22
22
|
var ts = $.tablesorter = {
|
23
23
|
|
24
|
-
version : '2.25.
|
24
|
+
version : '2.25.5',
|
25
25
|
|
26
26
|
parsers : [],
|
27
27
|
widgets : [],
|
@@ -733,7 +733,7 @@
|
|
733
733
|
}
|
734
734
|
}
|
735
735
|
if ( add ) {
|
736
|
-
ts.parsers.
|
736
|
+
ts.parsers[ ts.parsers.length ] = parser;
|
737
737
|
}
|
738
738
|
},
|
739
739
|
|
@@ -953,7 +953,7 @@
|
|
953
953
|
}
|
954
954
|
// ensure rowData is always in the same location (after the last column)
|
955
955
|
cols[ c.columns ] = rowData;
|
956
|
-
cache.normalized.
|
956
|
+
cache.normalized[ cache.normalized.length ] = cols;
|
957
957
|
}
|
958
958
|
cache.colMax = colMax;
|
959
959
|
// total up rows, not including child rows
|
@@ -1022,9 +1022,9 @@
|
|
1022
1022
|
});
|
1023
1023
|
}
|
1024
1024
|
if ( result !== false ) {
|
1025
|
-
data.parsed.
|
1026
|
-
data.raw.
|
1027
|
-
data.$cell.
|
1025
|
+
data.parsed[ data.parsed.length ] = parsed;
|
1026
|
+
data.raw[ data.raw.length ] = raw;
|
1027
|
+
data.$cell[ data.$cell.length ] = $cell;
|
1028
1028
|
}
|
1029
1029
|
}
|
1030
1030
|
}
|
@@ -1213,7 +1213,7 @@
|
|
1213
1213
|
}
|
1214
1214
|
primary = indx === 0 ? dir : primary;
|
1215
1215
|
group = [ col, parseInt( dir, 10 ) || 0 ];
|
1216
|
-
c.sortList.
|
1216
|
+
c.sortList[ c.sortList.length ] = group;
|
1217
1217
|
dir = $.inArray( group[ 1 ], order ); // fixes issue #167
|
1218
1218
|
c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % ( c.sortReset ? 3 : 2 );
|
1219
1219
|
}
|
@@ -1312,7 +1312,7 @@
|
|
1312
1312
|
},
|
1313
1313
|
|
1314
1314
|
addRows : function( c, $row, resort, callback ) {
|
1315
|
-
var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len,
|
1315
|
+
var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
|
1316
1316
|
cacheIndex, rowData, cells, cell, span,
|
1317
1317
|
// allow passing a row string if only one non-info tbody exists in the table
|
1318
1318
|
valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
|
@@ -1347,12 +1347,13 @@
|
|
1347
1347
|
for ( rowIndex = 0; rowIndex < rows; rowIndex++ ) {
|
1348
1348
|
cacheIndex = 0;
|
1349
1349
|
len = $row[ rowIndex ].cells.length;
|
1350
|
+
order = c.cache[ tbodyIndex ].normalized.length;
|
1350
1351
|
cells = [];
|
1351
1352
|
rowData = {
|
1352
1353
|
child : [],
|
1353
1354
|
raw : [],
|
1354
1355
|
$row : $row.eq( rowIndex ),
|
1355
|
-
order :
|
1356
|
+
order : order
|
1356
1357
|
};
|
1357
1358
|
// add each cell
|
1358
1359
|
for ( cellIndex = 0; cellIndex < len; cellIndex++ ) {
|
@@ -1375,7 +1376,7 @@
|
|
1375
1376
|
// add the row data to the end
|
1376
1377
|
cells[ c.columns ] = rowData;
|
1377
1378
|
// update cache
|
1378
|
-
c.cache[ tbodyIndex ].normalized
|
1379
|
+
c.cache[ tbodyIndex ].normalized[ order ] = cells;
|
1379
1380
|
}
|
1380
1381
|
// resort using current settings
|
1381
1382
|
ts.checkResort( c, resort, callback );
|
@@ -1417,7 +1418,7 @@
|
|
1417
1418
|
parsed = cache[ tbodyIndex ].normalized;
|
1418
1419
|
totalRows = parsed.length;
|
1419
1420
|
for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
|
1420
|
-
rows.
|
1421
|
+
rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
|
1421
1422
|
// removeRows used by the pager plugin; don't render if using ajax - fixes #411
|
1422
1423
|
if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) {
|
1423
1424
|
$curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
|
@@ -1499,18 +1500,18 @@
|
|
1499
1500
|
arry = c.sortForce;
|
1500
1501
|
for ( indx = 0; indx < arry.length; indx++ ) {
|
1501
1502
|
if ( arry[ indx ][ 0 ] !== col ) {
|
1502
|
-
c.sortList.
|
1503
|
+
c.sortList[ c.sortList.length ] = arry[ indx ];
|
1503
1504
|
}
|
1504
1505
|
}
|
1505
1506
|
}
|
1506
1507
|
// add column to sort list
|
1507
1508
|
dir = order[ c.sortVars[ col ].count ];
|
1508
1509
|
if ( dir < 2 ) {
|
1509
|
-
c.sortList.
|
1510
|
+
c.sortList[ c.sortList.length ] = [ col, dir ];
|
1510
1511
|
// add other columns if header spans across multiple
|
1511
1512
|
if ( cell.colSpan > 1 ) {
|
1512
1513
|
for ( indx = 1; indx < cell.colSpan; indx++ ) {
|
1513
|
-
c.sortList.
|
1514
|
+
c.sortList[ c.sortList.length ] = [ col + indx, dir ];
|
1514
1515
|
// update count on columns in colSpan
|
1515
1516
|
c.sortVars[ col + indx ].count = $.inArray( dir, order );
|
1516
1517
|
}
|
@@ -1539,11 +1540,11 @@
|
|
1539
1540
|
// add column to sort list array
|
1540
1541
|
dir = order[ c.sortVars[ col ].count ];
|
1541
1542
|
if ( dir < 2 ) {
|
1542
|
-
c.sortList.
|
1543
|
+
c.sortList[ c.sortList.length ] = [ col, dir ];
|
1543
1544
|
// add other columns if header spans across multiple
|
1544
1545
|
if ( cell.colSpan > 1 ) {
|
1545
1546
|
for ( indx = 1; indx < cell.colSpan; indx++ ) {
|
1546
|
-
c.sortList.
|
1547
|
+
c.sortList[ c.sortList.length ] = [ col + indx, dir ];
|
1547
1548
|
// update count on columns in colSpan
|
1548
1549
|
c.sortVars[ col + indx ].count = $.inArray( dir, order );
|
1549
1550
|
}
|
@@ -1580,7 +1581,7 @@
|
|
1580
1581
|
break;
|
1581
1582
|
}
|
1582
1583
|
}
|
1583
|
-
c.sortList.
|
1584
|
+
c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
|
1584
1585
|
}
|
1585
1586
|
}
|
1586
1587
|
}
|
@@ -1847,7 +1848,7 @@
|
|
1847
1848
|
███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀
|
1848
1849
|
*/
|
1849
1850
|
addWidget : function( widget ) {
|
1850
|
-
ts.widgets.
|
1851
|
+
ts.widgets[ ts.widgets.length ] = widget;
|
1851
1852
|
},
|
1852
1853
|
|
1853
1854
|
hasWidget : function( $table, name ) {
|
@@ -1895,7 +1896,7 @@
|
|
1895
1896
|
len = widgets.length;
|
1896
1897
|
for ( indx = 0; indx < len; indx++ ) {
|
1897
1898
|
if ( widgets[ indx ].match( widgetClass ) ) {
|
1898
|
-
c.widgets.
|
1899
|
+
c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' );
|
1899
1900
|
}
|
1900
1901
|
}
|
1901
1902
|
}
|
@@ -1912,7 +1913,7 @@
|
|
1912
1913
|
applied = false;
|
1913
1914
|
// add widget name to option list so it gets reapplied after sorting, filtering, etc
|
1914
1915
|
if ( $.inArray( name, c.widgets ) < 0 ) {
|
1915
|
-
c.widgets.
|
1916
|
+
c.widgets[ c.widgets.length ] = name;
|
1916
1917
|
}
|
1917
1918
|
if ( c.debug ) { time = new Date(); }
|
1918
1919
|
|
@@ -2022,7 +2023,7 @@
|
|
2022
2023
|
for ( indx = 0; indx < len; indx++ ) {
|
2023
2024
|
widget = ts.widgets[ indx ];
|
2024
2025
|
if ( widget && widget.id ) {
|
2025
|
-
name.
|
2026
|
+
name[ name.length ] = widget.id;
|
2026
2027
|
}
|
2027
2028
|
}
|
2028
2029
|
} else {
|
@@ -2063,7 +2064,7 @@
|
|
2063
2064
|
for ( indx = 0; indx < len; indx++ ) {
|
2064
2065
|
widget = widgets[ indx ];
|
2065
2066
|
if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) {
|
2066
|
-
list.
|
2067
|
+
list[ list.length ] = widget.id;
|
2067
2068
|
}
|
2068
2069
|
}
|
2069
2070
|
ts.removeWidget( table, list.join( ',' ), true );
|
@@ -2450,7 +2451,7 @@
|
|
2450
2451
|
console = {};
|
2451
2452
|
console.log = console.warn = console.error = console.table = function() {
|
2452
2453
|
var arg = arguments.length > 1 ? arguments : arguments[0];
|
2453
|
-
ts.logs.
|
2454
|
+
ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg };
|
2454
2455
|
};
|
2455
2456
|
}
|
2456
2457
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 03-01-2016 (v2.25.5)*/
|
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($) {
|
18
18
|
|
19
|
-
/*! Widget: storage - updated 3/
|
19
|
+
/*! Widget: storage - updated 3/1/2016 (v2.25.5) */
|
20
20
|
/*global JSON:false */
|
21
21
|
;(function ($, window, document) {
|
22
22
|
'use strict';
|
@@ -86,7 +86,7 @@
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
// allow value to be an empty string too
|
89
|
-
if (
|
89
|
+
if (typeof value !== 'undefined' && window.JSON && JSON.hasOwnProperty('stringify')) {
|
90
90
|
// add unique identifiers = url pathname > table ID/index on page > data
|
91
91
|
if (!values[url]) {
|
92
92
|
values[url] = {};
|
@@ -372,7 +372,7 @@
|
|
372
372
|
|
373
373
|
})(jQuery);
|
374
374
|
|
375
|
-
/*! Widget: filter - updated
|
375
|
+
/*! Widget: filter - updated 3/1/2016 (v2.25.5) *//*
|
376
376
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
377
377
|
* by Rob Garrison
|
378
378
|
*/
|
@@ -419,6 +419,7 @@
|
|
419
419
|
filter_hideFilters : false, // collapse filter row when mouse leaves the area
|
420
420
|
filter_ignoreCase : true, // if true, make all searches case-insensitive
|
421
421
|
filter_liveSearch : true, // if true, search column content while the user types ( with a delay )
|
422
|
+
filter_matchType : { 'input': 'exact', 'select': 'exact' }, // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
|
422
423
|
filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available ( visible ) options within the drop down
|
423
424
|
filter_placeholder : { search : '', select : '' }, // default placeholder text ( overridden by any header 'data-placeholder' setting )
|
424
425
|
filter_reset : null, // jQuery selector string of an element used to reset the filters
|
@@ -1345,7 +1346,7 @@
|
|
1345
1346
|
end = c.columns - 1;
|
1346
1347
|
}
|
1347
1348
|
for ( ; start <= end; start++ ) {
|
1348
|
-
columns.
|
1349
|
+
columns[ columns.length ] = start;
|
1349
1350
|
}
|
1350
1351
|
// remove processed range from val
|
1351
1352
|
val = val.replace( ranges[ indx ], '' );
|
@@ -1359,7 +1360,7 @@
|
|
1359
1360
|
if ( singles[ i ] !== '' ) {
|
1360
1361
|
indx = parseInt( singles[ i ], 10 );
|
1361
1362
|
if ( indx < c.columns ) {
|
1362
|
-
columns.
|
1363
|
+
columns[ columns.length ] = indx;
|
1363
1364
|
}
|
1364
1365
|
}
|
1365
1366
|
}
|
@@ -1367,7 +1368,7 @@
|
|
1367
1368
|
// return all columns
|
1368
1369
|
if ( !columns.length ) {
|
1369
1370
|
for ( indx = 0; indx < c.columns; indx++ ) {
|
1370
|
-
columns.
|
1371
|
+
columns[ columns.length ] = indx;
|
1371
1372
|
}
|
1372
1373
|
}
|
1373
1374
|
return columns;
|
@@ -1403,6 +1404,24 @@
|
|
1403
1404
|
}
|
1404
1405
|
return filterMatched;
|
1405
1406
|
},
|
1407
|
+
matchType: function( c, columnIndex ) {
|
1408
|
+
var isMatch,
|
1409
|
+
$el = c.$headerIndexed[ columnIndex ];
|
1410
|
+
// filter-exact > filter-match > filter_matchType for type
|
1411
|
+
if ( $el.hasClass( 'filter-exact' ) ) {
|
1412
|
+
isMatch = false;
|
1413
|
+
} else if ( $el.hasClass( 'filter-match' ) ) {
|
1414
|
+
isMatch = true;
|
1415
|
+
} else {
|
1416
|
+
// filter-select is not applied when filter_functions are used, so look for a select
|
1417
|
+
$el = c.$filters.eq( columnIndex ).find( '.' + tscss.filter );
|
1418
|
+
isMatch = $el.length ?
|
1419
|
+
c.widgetOptions.filter_matchType[ ( $el[ 0 ].nodeName || '' ).toLowerCase() ] === 'match' :
|
1420
|
+
// default to exact, if no inputs found
|
1421
|
+
false;
|
1422
|
+
}
|
1423
|
+
return isMatch;
|
1424
|
+
},
|
1406
1425
|
processRow: function( c, data, vars ) {
|
1407
1426
|
var result, filterMatched,
|
1408
1427
|
fxn, ffxn, txt,
|
@@ -1476,12 +1495,11 @@
|
|
1476
1495
|
// ignore if filter is empty or disabled
|
1477
1496
|
if ( data.filter ) {
|
1478
1497
|
data.cache = data.cacheArray[ columnIndex ];
|
1479
|
-
result = data.rawArray[ columnIndex ] || '';
|
1498
|
+
result = data.parsed[ columnIndex ] ? data.cache : data.rawArray[ columnIndex ] || '';
|
1480
1499
|
data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405
|
1481
1500
|
data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ?
|
1482
1501
|
data.exact.toLowerCase() : data.exact;
|
1483
|
-
|
1484
|
-
data.isMatch = c.$headerIndexed[ data.index ].hasClass( 'filter-match' );
|
1502
|
+
data.isMatch = tsf.matchType( c, columnIndex );
|
1485
1503
|
|
1486
1504
|
result = showRow; // if showRow is true, show that row
|
1487
1505
|
|
@@ -1676,7 +1694,7 @@
|
|
1676
1694
|
!( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) &&
|
1677
1695
|
// if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593
|
1678
1696
|
!( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length &&
|
1679
|
-
!
|
1697
|
+
!tsf.matchType( c, indx ) );
|
1680
1698
|
}
|
1681
1699
|
}
|
1682
1700
|
notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
|
@@ -1865,13 +1883,13 @@
|
|
1865
1883
|
// table cell to the parser format function
|
1866
1884
|
if ( txt.text ) {
|
1867
1885
|
txt.parsed = parsedTxt;
|
1868
|
-
parsed.
|
1886
|
+
parsed[ parsed.length ] = txt;
|
1869
1887
|
} else {
|
1870
|
-
parsed.
|
1888
|
+
parsed[ parsed.length ] = {
|
1871
1889
|
text : txt,
|
1872
1890
|
// check parser length - fixes #934
|
1873
1891
|
parsed : parsedTxt
|
1874
|
-
}
|
1892
|
+
};
|
1875
1893
|
}
|
1876
1894
|
}
|
1877
1895
|
// sort parsed select options
|
@@ -1896,7 +1914,7 @@
|
|
1896
1914
|
arry = [];
|
1897
1915
|
len = parsed.length;
|
1898
1916
|
for ( indx = 0; indx < len; indx++ ) {
|
1899
|
-
arry.
|
1917
|
+
arry[ arry.length ] = parsed[indx];
|
1900
1918
|
}
|
1901
1919
|
return arry;
|
1902
1920
|
}
|
@@ -1925,23 +1943,23 @@
|
|
1925
1943
|
if ( wo.filter_useParsedData ||
|
1926
1944
|
c.parsers[column].parsed ||
|
1927
1945
|
c.$headerIndexed[column].hasClass( 'filter-parsed' ) ) {
|
1928
|
-
arry.
|
1946
|
+
arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ column ];
|
1929
1947
|
// child row parsed data
|
1930
1948
|
if ( wo.filter_childRows && wo.filter_childByColumn ) {
|
1931
1949
|
childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length - 1;
|
1932
1950
|
for ( indx = 0; indx < childLen; indx++ ) {
|
1933
|
-
arry.
|
1951
|
+
arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ c.columns ].child[ indx ][ column ];
|
1934
1952
|
}
|
1935
1953
|
}
|
1936
1954
|
} else {
|
1937
1955
|
// get raw cached data instead of content directly from the cells
|
1938
|
-
arry.
|
1956
|
+
arry[ arry.length ] = cache.normalized[ rowIndex ][ c.columns ].raw[ column ];
|
1939
1957
|
// child row unparsed data
|
1940
1958
|
if ( wo.filter_childRows && wo.filter_childByColumn ) {
|
1941
1959
|
childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length;
|
1942
1960
|
for ( indx = 1; indx < childLen; indx++ ) {
|
1943
1961
|
child = cache.normalized[ rowIndex ][ c.columns ].$row.eq( indx ).children().eq( column );
|
1944
|
-
arry.
|
1962
|
+
arry[ arry.length ] = '' + ts.getElementText( c, child, column );
|
1945
1963
|
}
|
1946
1964
|
}
|
1947
1965
|
}
|
@@ -2161,7 +2179,7 @@
|
|
2161
2179
|
|
2162
2180
|
})( jQuery );
|
2163
2181
|
|
2164
|
-
/*! Widget: stickyHeaders - updated
|
2182
|
+
/*! Widget: stickyHeaders - updated 3/1/2016 (v2.25.5) *//*
|
2165
2183
|
* Requires tablesorter v2.8+ and jQuery 1.4.3+
|
2166
2184
|
* by Rob Garrison
|
2167
2185
|
*/
|
@@ -2206,12 +2224,12 @@
|
|
2206
2224
|
}
|
2207
2225
|
wo.resize_flag = false;
|
2208
2226
|
};
|
2209
|
-
checkSizes( false );
|
2210
2227
|
clearInterval(wo.resize_timer);
|
2211
2228
|
if (disable) {
|
2212
2229
|
wo.resize_flag = false;
|
2213
2230
|
return false;
|
2214
2231
|
}
|
2232
|
+
checkSizes( false );
|
2215
2233
|
wo.resize_timer = setInterval(function() {
|
2216
2234
|
if (wo.resize_flag) { return; }
|
2217
2235
|
checkSizes();
|
@@ -2444,7 +2462,7 @@
|
|
2444
2462
|
.add(wo.stickyHeaders_yScroll)
|
2445
2463
|
.add(wo.stickyHeaders_attachTo)
|
2446
2464
|
.unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') );
|
2447
|
-
ts.addHeaderResizeEvent(table,
|
2465
|
+
ts.addHeaderResizeEvent(table, true);
|
2448
2466
|
}
|
2449
2467
|
});
|
2450
2468
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/*! Parser: hugeNumbers - updated 3/1/2016 (v2.25.5) *//*
|
2
|
+
* See https://github.com/Mottie/tablesorter/issues/1161
|
3
|
+
*/
|
4
|
+
/*jshint jquery:true */
|
5
|
+
;( function( $ ) {
|
6
|
+
'use strict';
|
7
|
+
|
8
|
+
$.tablesorter.addParser({
|
9
|
+
id: 'hugeNumbers',
|
10
|
+
is : function() {
|
11
|
+
return false;
|
12
|
+
},
|
13
|
+
format : function( str ) {
|
14
|
+
// add commas every 12 digits; Number.MAX_SAFE_INTEGER is 16 digits long
|
15
|
+
// regex modified from: http://stackoverflow.com/a/2901298/145346
|
16
|
+
return str.replace(/\B(?=(\d{12})+(?!\d))/g, ',');
|
17
|
+
},
|
18
|
+
type : 'text'
|
19
|
+
});
|
20
|
+
|
21
|
+
})( jQuery );
|
@@ -1,10 +1,10 @@
|
|
1
|
-
/*! Widget: editable - updated
|
1
|
+
/*! Widget: editable - updated 3/1/2016 (v2.25.5) *//*
|
2
2
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
3
|
* by Rob Garrison
|
4
4
|
*/
|
5
5
|
/*jshint browser:true, jquery:true, unused:false */
|
6
6
|
/*global jQuery: false */
|
7
|
-
;( function( $ ){
|
7
|
+
;( function( $ ) {
|
8
8
|
'use strict';
|
9
9
|
|
10
10
|
var tse = $.tablesorter.editable = {
|
@@ -45,7 +45,7 @@
|
|
45
45
|
selection.addRange( range );
|
46
46
|
}
|
47
47
|
}
|
48
|
-
|
48
|
+
// need delay of at least 100ms or last contenteditable will get refocused
|
49
49
|
}, 100 );
|
50
50
|
},
|
51
51
|
|
@@ -165,7 +165,7 @@
|
|
165
165
|
// prevent enter from adding into the content
|
166
166
|
$this
|
167
167
|
.off( 'keydown' + namespace )
|
168
|
-
.on( 'keydown' + namespace, function( e ){
|
168
|
+
.on( 'keydown' + namespace, function( e ) {
|
169
169
|
if ( wo.editable_enterToAccept && e.which === 13 && !e.shiftKey ) {
|
170
170
|
e.preventDefault();
|
171
171
|
}
|
@@ -256,6 +256,18 @@
|
|
256
256
|
// restore original content on blur
|
257
257
|
$this.html( $this.data( 'original' ) );
|
258
258
|
}
|
259
|
+
})
|
260
|
+
// paste plain text from Excel - fixes #994
|
261
|
+
.on('paste' + namespace, '[contenteditable]', function() {
|
262
|
+
var content,
|
263
|
+
$this = $(this);
|
264
|
+
// setTimeout needed to get pasted-in content
|
265
|
+
setTimeout(function() {
|
266
|
+
if ($this.is(':focus')) {
|
267
|
+
content = '<div>' + $this.html() + '</div>';
|
268
|
+
$this.html( $(content).text().trim() );
|
269
|
+
}
|
270
|
+
}, 0);
|
259
271
|
});
|
260
272
|
},
|
261
273
|
destroy : function( c, wo ) {
|
@@ -265,7 +277,7 @@
|
|
265
277
|
tmp = ( 'updateComplete pagerComplete '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' );
|
266
278
|
c.$table.off( tmp );
|
267
279
|
|
268
|
-
tmp = ( 'focus blur focusout keydown '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' );
|
280
|
+
tmp = ( 'focus blur focusout keydown paste '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' );
|
269
281
|
c.$tbodies
|
270
282
|
.off( tmp )
|
271
283
|
.find( cols.join( ',' ) )
|
@@ -284,14 +296,14 @@
|
|
284
296
|
editable_autoResort : false,
|
285
297
|
editable_wrapContent : '<div>', // wrap the cell content... makes this widget work in IE, and with autocomplete
|
286
298
|
editable_trimContent : true, // trim content inside of contenteditable ( remove tabs & carriage returns )
|
287
|
-
editable_validate : null, // function( text, originalText ){ return text; }
|
299
|
+
editable_validate : null, // function( text, originalText ) { return text; }
|
288
300
|
editable_focused : null, // function( text, columnIndex, $element ) {}
|
289
301
|
editable_blur : null, // function( text, columnIndex, $element ) { }
|
290
302
|
editable_selectAll : false, // true/false or function( text, columnIndex, $element ) { return true; }
|
291
303
|
editable_noEdit : 'no-edit',
|
292
304
|
editable_editComplete : 'editComplete'
|
293
305
|
},
|
294
|
-
init: function( table, thisWidget, c, wo ){
|
306
|
+
init: function( table, thisWidget, c, wo ) {
|
295
307
|
if ( !wo.editable_columns.length ) { return; }
|
296
308
|
tse.update( c, wo );
|
297
309
|
tse.bindEvents( c, wo );
|