Commit graph

17 commits

Author SHA1 Message Date
Leo Koppelkamm
debf5bcc4a Revert accidental change from r90630 2011-06-22 23:22:12 +00:00
Brion Vibber
ec84480c18 Followup r86088, r87244, r90612: fix jquery.tablesorter for null collation table on IE
Attempt to build a regex from an empty list failed when calling new RegEx('[]', 'ig') on IE 6/7/8.
Now allowing null for the object, and also not trying to create the regex even if we have an empty object just in case.
2011-06-22 23:19:00 +00:00
Leo Koppelkamm
29976ac11e Tablesorter: Remove not really necessary setTimeout. 2011-06-22 23:03:12 +00:00
Leo Koppelkamm
7a87f58615 Hopefully fix IE6 regex tablesorter issue 2011-06-22 22:21:57 +00:00
Leo Koppelkamm
3993a2d72f Fix tablesorting bug that caused weird interferences between two tables; Make regex more strict to avoid mismatches. All QUnit tests pass now 2011-06-22 21:54:18 +00:00
Derk-Jan Hartman
cc2e49d862 Fix global var leaks in jquery.tablersorter.js 2011-06-22 20:40:00 +00:00
Leo Koppelkamm
abc88c1561 Tablesorter: Add a title attribute to sort arrows ( Bug 21453 ) 2011-05-03 11:44:35 +00:00
Leo Koppelkamm
f925945977 Tablesorter: use mw.config.get() to access globals; force mdy for english contentlang 2011-05-02 11:55:45 +00:00
Leo Koppelkamm
73ea7301ec Make jquery.tablesorter more resilient by checking multiple cells before assuming a type. Fixes Bug 28775 2011-05-02 11:31:45 +00:00
Leo Koppelkamm
507ae6c45e TableSorter: Allow whitespace between digits and percent sign. Fixes Bug 28406 2011-04-27 11:02:59 +00:00
Leo Koppelkamm
5761d25008 Followup to r86854: fix $ object 2011-04-25 13:18:09 +00:00
Leo Koppelkamm
b16efcada2 Followup to r86108: jQuery tries to be too smart and converts the string to a number, which breaks the value parser 2011-04-25 13:15:26 +00:00
Leo Koppelkamm
fdd72f8271 r86088: Get rid of eval by implemting a MergeSort algorithm. It's a few ms slower on very large tables, but is stable-sorting in all browsers 2011-04-18 19:20:02 +00:00
Leo Koppelkamm
77e1e201f6 Followup r86088 per CR: Move month array builder into language; use mw.config.get(); Fix rowspans and some cleanup 2011-04-18 12:54:28 +00:00
Leo Koppelkamm
26b32c426d r86108: Fix var name 2011-04-15 08:31:05 +00:00
Leo Koppelkamm
16760162b1 Followup ro r86088: Use data-sort-type instead of classes to specify the parser-type; add support for data-sort-value; strip legacy code (CR) 2011-04-15 08:23:29 +00:00
Leo Koppelkamm
7d6ddfe836 Completely rewritten table sorting script.
Fixes Bug 8028, Bug 8115, Bug 15406, Bug 17141, Bug 8732

1. Sites can specify custom collations.
The script accepts an object "tableSorterCollation" which contains a lookup
table, how specific characters should be treated.
For example, after setting "tableSorterCollation={'ä':'ae', 'ß':'ss'};" in the
site's common.js any string containing an ä or Ä will be sorted as if it were a
'ae'.

2. Table rows can be forced to use a specific data type.
By setting class="sort-{Parsername}", the row will be parsed with the specified
algorithm. class="sort-date" would force date sorting etc.
The following parsers are available: text, IPAddress, number, url, currency,
date, isoDate, usLongDate, time

3. Execution time is reduced by half or more.

Sorting a 935 row * 8 columns table:

Browser     Before      After
--------    ------      -----
Chrome 10   90ms        42ms
Safari 5    115ms       48ms
Firefox 4   412ms       87ms
IE8         720ms       115ms

4. Based on the content language and the mdy vs dmy preference, the parser can
understand dates such as "17. März '11". wgMonthNames=[] and
wgMonthNamesShort=[] 
in the content language and the mdy vs dmy preference are exported to js; A
table containing the following dates would be sorted correctly:
17. Jan. 01
23 Feb 1992
9.02.05
13 November 2001
14 Oktober '76

Was tested in ie6-8, chrome, safari 5, ff3 & ff4
2011-04-14 21:47:00 +00:00