preference for the non-default skin to look at something using the default skin.
* (bug 31417) New ID mw-content-text around the actual page text, without categories,
contentSub, ... The same div often also contains the class mw-content-ltr/rtl.
+* (bug 34475) Add support for IP/CIDR notation to tablesorter
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
}
ts.rgx = {
IPAddress: [
- new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/)
+ new RegExp( /^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}(\/\d{1,3})?$/)
],
currency: [
new RegExp( /^[£$€?.]/),
},
format: function( s ) {
var a = s.split( '.' ),
- r = '',
- l = a.length;
- for ( var i = 0; i < l; i++ ) {
+ r = '';
+ if( a.length == 4 ) {
+ var cidr = a[3].split('/');
+ if (cidr.length > 1 ) {
+ a[3] = cidr[0];
+ a[4] = cidr[1];
+ } else a[4] = '000';
+ }
+ for ( var i = 0; i < a.length; i++ ) {
var item = a[i];
if ( item.length == 1 ) {
r += '00' + item;
['204.204.132.158'],
['247.240.82.209']
];
+var ipv4CIDR = [
+ // Some randomly generated fake IPs
+ ['45.238.27.109/36'],
+ ['170.38.91.162/36'],
+ ['247.240.82.209/36'],
+ ['204.204.132.158/24'],
+ ['170.38.91.162/24']
+];
+var ipv4CIDRSorted = [
+ // Sort order should go octet by octet
+ ['45.238.27.109/36'],
+ ['170.38.91.162/24'],
+ ['170.38.91.162/36'],
+ ['204.204.132.158/24'],
+ ['247.240.82.209/36']
+];
+var ipv4Mixed = [
+ // Some randomly generated fake IPs
+ ['45.238.27.109'],
+ ['170.38.91.162'],
+ ['247.240.82.209'],
+ ['204.204.132.158/24'],
+ ['170.38.91.162/24']
+];
+var ipv4MixedSorted = [
+ // Sort order should go octet by octet
+ ['45.238.27.109'],
+ ['170.38.91.162'],
+ ['170.38.91.162/24'],
+ ['204.204.132.158/24'],
+ ['247.240.82.209']
+];
tableTest(
'Bug 17141: IPv4 address sorting',
$table.find( '.headerSort:eq(0)' ).click().click();
}
);
+tableTest(
+ 'Bug 34475: IPv4/CIDR address sorting',
+ ['IP'],
+ ipv4CIDR,
+ ipv4CIDRSorted,
+ function( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+);
+
+tableTest(
+ 'Bug 34475: Mixed IPv4 and IP/CIDR address sorting',
+ ['IP'],
+ ipv4Mixed,
+ ipv4MixedSorted,
+ function( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+);
var umlautWords = [
// Some words with Umlauts