Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -236,38 +236,6 @@ |
237 | 237 | ['204.204.132.158'], |
238 | 238 | ['247.240.82.209'] |
239 | 239 | ]; |
240 | | -var ipv4CIDR = [ |
241 | | - // Some randomly generated fake IPs |
242 | | - ['45.238.27.109/36'], |
243 | | - ['170.38.91.162/36'], |
244 | | - ['247.240.82.209/36'], |
245 | | - ['204.204.132.158/24'], |
246 | | - ['170.38.91.162/24'] |
247 | | -]; |
248 | | -var ipv4CIDRSorted = [ |
249 | | - // Sort order should go octet by octet |
250 | | - ['45.238.27.109/36'], |
251 | | - ['170.38.91.162/24'], |
252 | | - ['170.38.91.162/36'], |
253 | | - ['204.204.132.158/24'], |
254 | | - ['247.240.82.209/36'] |
255 | | -]; |
256 | | -var ipv4Mixed = [ |
257 | | - // Some randomly generated fake IPs |
258 | | - ['45.238.27.109'], |
259 | | - ['170.38.91.162'], |
260 | | - ['247.240.82.209'], |
261 | | - ['204.204.132.158/24'], |
262 | | - ['170.38.91.162/24'] |
263 | | -]; |
264 | | -var ipv4MixedSorted = [ |
265 | | - // Sort order should go octet by octet |
266 | | - ['45.238.27.109'], |
267 | | - ['170.38.91.162'], |
268 | | - ['170.38.91.162/24'], |
269 | | - ['204.204.132.158/24'], |
270 | | - ['247.240.82.209'] |
271 | | -]; |
272 | 240 | |
273 | 241 | tableTest( |
274 | 242 | 'Bug 17141: IPv4 address sorting', |
— | — | @@ -289,28 +257,7 @@ |
290 | 258 | $table.find( '.headerSort:eq(0)' ).click().click(); |
291 | 259 | } |
292 | 260 | ); |
293 | | -tableTest( |
294 | | - 'Bug 34475: IPv4/CIDR address sorting', |
295 | | - ['IP'], |
296 | | - ipv4CIDR, |
297 | | - ipv4CIDRSorted, |
298 | | - function( $table ) { |
299 | | - $table.tablesorter(); |
300 | | - $table.find( '.headerSort:eq(0)' ).click(); |
301 | | - } |
302 | | -); |
303 | 261 | |
304 | | -tableTest( |
305 | | - 'Bug 34475: Mixed IPv4 and IP/CIDR address sorting', |
306 | | - ['IP'], |
307 | | - ipv4Mixed, |
308 | | - ipv4MixedSorted, |
309 | | - function( $table ) { |
310 | | - $table.tablesorter(); |
311 | | - $table.find( '.headerSort:eq(0)' ).click(); |
312 | | - } |
313 | | -); |
314 | | - |
315 | 262 | var umlautWords = [ |
316 | 263 | // Some words with Umlauts |
317 | 264 | ['Günther'], |
— | — | @@ -575,47 +522,6 @@ |
576 | 523 | ); |
577 | 524 | // TODO add numbers sorting tests for bug 8115 with a different language |
578 | 525 | |
579 | | -var fractions = [ |
580 | | - [ '56' ], |
581 | | - [ '1 3/8' ], |
582 | | - [ '4 7/8' ], |
583 | | - [ '2,000 1/6' ], |
584 | | - [ '4 1/8' ], |
585 | | - [ '-4 1/8' ], |
586 | | - [ '−5 1/8' ], |
587 | | - [ '56 45/500' ], |
588 | | - [ '56 100/500' ], |
589 | | - [ '100 / 500' ] |
590 | | -]; |
591 | | -var fractionsAsc = [ |
592 | | - [ '−5 1/8' ], |
593 | | - [ '-4 1/8' ], |
594 | | - [ '100 / 500' ], |
595 | | - [ '1 3/8' ], |
596 | | - [ '4 1/8' ], |
597 | | - [ '4 7/8' ], |
598 | | - [ '56' ], |
599 | | - [ '56 45/500' ], |
600 | | - [ '56 100/500' ], |
601 | | - [ '2,000 1/6' ] |
602 | | -]; |
603 | | - |
604 | | -tableTest( 'sort fractional numbers in all sorts and forms (ascending)', |
605 | | - ['Fractional numbers'], fractions, fractionsAsc, |
606 | | - function( $table ) { |
607 | | - $table.tablesorter(); |
608 | | - $table.find( '.headerSort:eq(0)' ).click(); |
609 | | - } |
610 | | -); |
611 | | - |
612 | | -tableTest( 'sort fractional numbers in all sorts and forms (descending)', |
613 | | - ['Fractional numbers'], fractions, reversed(fractionsAsc), |
614 | | - function( $table ) { |
615 | | - $table.tablesorter(); |
616 | | - $table.find( '.headerSort:eq(0)' ).click().click(); |
617 | | - } |
618 | | -); |
619 | | - |
620 | 526 | test( 'bug 32888 - Tables inside a tableheader cell', function() { |
621 | 527 | expect(2); |
622 | 528 | |
Index: trunk/phase3/RELEASE-NOTES-1.20 |
— | — | @@ -19,9 +19,7 @@ |
20 | 20 | preference for the non-default skin to look at something using the default skin. |
21 | 21 | * (bug 31417) New ID mw-content-text around the actual page text, without categories, |
22 | 22 | contentSub, ... The same div often also contains the class mw-content-ltr/rtl. |
23 | | -* (bug 34475) Add support for IP/CIDR notation to tablesorter |
24 | 23 | * (bug 27619) Remove preference option to display broken links as link? |
25 | | -* (bug 15404) Add support for sorting fractions in jquery.tablesorter |
26 | 24 | * (bug 34896) Update jQuery JSON plugin to v2.3 (2011-09-17) |
27 | 25 | |
28 | 26 | === Bug fixes in 1.20 === |
Index: trunk/phase3/resources/jquery/jquery.tablesorter.js |
— | — | @@ -402,13 +402,12 @@ |
403 | 403 | digits.push( $.escapeRE( localised[i] ) ); |
404 | 404 | } |
405 | 405 | } |
406 | | - ts.digitClass = '[' + digits.join( '', digits ) + ']'; |
| 406 | + var digitClass = '[' + digits.join( '', digits ) + ']'; |
407 | 407 | |
408 | 408 | // We allow a trailing percent sign, which we just strip. This works fine |
409 | 409 | // if percents and regular numbers aren't being mixed. |
410 | 410 | ts.numberRegex = new RegExp("^(" + "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific |
411 | | - "|" + "[-+\u2212]?" + ts.digitClass + "+[\\s\\xa0]*%?" + // Generic localised |
412 | | - "|([-+\u2212]?" + ts.digitClass + "+[\\s\\xa0]+)*" + ts.digitClass + "+[\\s\\xa0]*[\\/][\\s\\xa0]*" + ts.digitClass + "+" + // Fractions |
| 411 | + "|" + "[-+\u2212]?" + digitClass + "+[\\s\\xa0]*%?" + // Generic localised |
413 | 412 | ")$", "i"); |
414 | 413 | } |
415 | 414 | |
— | — | @@ -485,7 +484,7 @@ |
486 | 485 | } |
487 | 486 | ts.rgx = { |
488 | 487 | IPAddress: [ |
489 | | - new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}(\/\d{1,3})?$/) |
| 488 | + new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/) |
490 | 489 | ], |
491 | 490 | currency: [ |
492 | 491 | new RegExp( /^[£$€?.]/), |
— | — | @@ -503,9 +502,6 @@ |
504 | 503 | ], |
505 | 504 | time: [ |
506 | 505 | new RegExp( /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/) |
507 | | - ], |
508 | | - fractions: [ |
509 | | - new RegExp( "^(?:([-+\u2212]?" + ts.digitClass + "+)[\\s\\xa0]+)*(" + ts.digitClass + "+)[\\s\\xa0]*[\\/][\\s\\xa0]*(" + ts.digitClass + "+)" ) |
510 | 506 | ] |
511 | 507 | }; |
512 | 508 | } |
— | — | @@ -771,15 +767,9 @@ |
772 | 768 | }, |
773 | 769 | format: function( s ) { |
774 | 770 | var a = s.split( '.' ), |
775 | | - r = ''; |
776 | | - if( a.length == 4 ) { |
777 | | - var cidr = a[3].split('/'); |
778 | | - if (cidr.length > 1 ) { |
779 | | - a[3] = cidr[0]; |
780 | | - a[4] = cidr[1]; |
781 | | - } else a[4] = '000'; |
782 | | - } |
783 | | - for ( var i = 0; i < a.length; i++ ) { |
| 771 | + r = '', |
| 772 | + l = a.length; |
| 773 | + for ( var i = 0; i < l; i++ ) { |
784 | 774 | var item = a[i]; |
785 | 775 | if ( item.length == 1 ) { |
786 | 776 | r += '00' + item; |
— | — | @@ -913,19 +903,6 @@ |
914 | 904 | return $.tablesorter.numberRegex.test( $.trim( s )); |
915 | 905 | }, |
916 | 906 | format: function( s ) { |
917 | | - var values = ts.rgx.fractions[0].exec($.trim(s)); |
918 | | - if( values != null ) { |
919 | | - // A fraction |
920 | | - var retVal = 0; |
921 | | - var decimal = $.tablesorter.formatDigit(values[2]) / $.tablesorter.formatDigit(values[3]); |
922 | | - if( values[1] != undefined ) { |
923 | | - retVal = $.tablesorter.formatDigit(values[1]); |
924 | | - } |
925 | | - if( !isNaN(decimal) && isFinite(decimal) ) { |
926 | | - retVal += decimal; |
927 | | - } |
928 | | - return retVal; |
929 | | - } |
930 | 907 | return $.tablesorter.formatDigit(s); |
931 | 908 | }, |
932 | 909 | type: 'numeric' |