Index: trunk/phase3/tests/qunit/index.html |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | <script src="suites/resources/jquery/jquery.autoEllipsis.js"></script> |
62 | 62 | <script src="suites/resources/jquery/jquery.colorUtil.js"></script> |
63 | 63 | <script src="suites/resources/jquery/jquery.tabIndex.js"></script> |
64 | | - <script src="suites/resources/jquery/jquery.tablesorter.test.js"></script> |
| 64 | + <script src="suites/resources/jquery/jquery.tablesorter.test.js" charset="UTF-8"></script> |
65 | 65 | <script src="suites/resources/mediawiki/mediawiki.Title.js"></script> |
66 | 66 | |
67 | 67 | <!-- TestSwarm: If a test swarm is running this, |
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | $.each(header, function(i, str) { |
29 | 29 | var $th = $('<th>'); |
30 | 30 | $th.text(str).appendTo($tr); |
31 | | - }) |
| 31 | + }); |
32 | 32 | $tr.appendTo($thead); |
33 | 33 | |
34 | 34 | for (var i = 0; i < data.length; i++) { |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $.each(data[i], function(j, str) { |
37 | 37 | var $td = $('<td>'); |
38 | 38 | $td.text(str).appendTo($tr); |
39 | | - }) |
| 39 | + }); |
40 | 40 | $tr.appendTo($tbody); |
41 | 41 | } |
42 | 42 | return $table; |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | var row = []; |
55 | 55 | $(tr).find('td,th').each(function(i, td) { |
56 | 56 | row.push($(td).text()); |
57 | | - }) |
| 57 | + }); |
58 | 58 | data.push(row); |
59 | 59 | }); |
60 | 60 | return data; |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | // Table sorting is done synchronously; if it ever needs to change back |
84 | 84 | // to asynchronous, we'll need a timeout or a callback here. |
85 | 85 | var extracted = tableExtract( $table ); |
86 | | - deepEqual( extracted, expected, msg ) |
| 86 | + deepEqual( extracted, expected, msg ); |
87 | 87 | }); |
88 | 88 | }; |
89 | 89 | |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | var arr2 = arr.slice(0); |
92 | 92 | arr2.reverse(); |
93 | 93 | return arr2; |
94 | | -} |
| 94 | +}; |
95 | 95 | |
96 | 96 | // Sample data set: some planets! |
97 | 97 | var header = ['Planet', 'Radius (km)'], |
— | — | @@ -255,4 +255,47 @@ |
256 | 256 | } |
257 | 257 | ); |
258 | 258 | |
| 259 | +var umlautWords = [ |
| 260 | + // Some words with Umlauts |
| 261 | + ['Günther'], |
| 262 | + ['Peter'], |
| 263 | + ['Björn'], |
| 264 | + ['Bjorn'], |
| 265 | + ['Apfel'], |
| 266 | + ['Äpfel'], |
| 267 | + ['Strasse'], |
| 268 | + ['Sträßschen'] |
| 269 | +]; |
| 270 | + |
| 271 | +var umlautWordsSorted = [ |
| 272 | + // Some words with Umlauts |
| 273 | + ['Äpfel'], |
| 274 | + ['Apfel'], |
| 275 | + ['Björn'], |
| 276 | + ['Bjorn'], |
| 277 | + ['Günther'], |
| 278 | + ['Peter'], |
| 279 | + ['Sträßschen'], |
| 280 | + ['Strasse'] |
| 281 | +]; |
| 282 | + |
| 283 | +tableTest( |
| 284 | + 'Accented Characters with custom collation', |
| 285 | + ['Name'], |
| 286 | + umlautWords, |
| 287 | + umlautWordsSorted, |
| 288 | + function( $table ) { |
| 289 | + mw.config.set('tableSorterCollation', {'ä':'ae', 'ö' : 'oe', 'ß': 'ss', 'ü':'ue'}); |
| 290 | + $table.tablesorter(); |
| 291 | + $table.find('.headerSort:eq(0)').click(); |
| 292 | + mw.config.set('tableSorterCollation', {}); |
| 293 | + } |
| 294 | +); |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
259 | 302 | })(); |
Index: trunk/phase3/resources/jquery/jquery.tablesorter.js |
— | — | @@ -481,7 +481,7 @@ |
482 | 482 | } |
483 | 483 | } |
484 | 484 | if (keys.length) { |
485 | | - ts.collationRegex = new RegExp( '[' + ts.collationRegex.join('') + ']', 'ig' ); |
| 485 | + ts.collationRegex = new RegExp( '[' + keys.join('') + ']', 'ig' ); |
486 | 486 | } |
487 | 487 | } |
488 | 488 | } |