-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from Tchuba/master
Adding Czech language sorting plugin
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$.extend( $.fn.dataTableExt.oSort, { | ||
"czech-pre": function ( a ) { | ||
var special_letters = { | ||
"A": "Aa", "a": "aa", "Á": "Ab", "á": "ab", | ||
"C": "Ca", "c": "ca", "Č": "Cb", "č": "cb", | ||
"D": "Da", "d": "da", "Ď": "db", "ď": "db", | ||
"E": "Ea", "e": "ea", "É": "eb", "é": "eb", "Ě": "Ec", "ě": "ec", | ||
"I": "Ia", "i": "ia", "Í": "Ib", "í": "ib", | ||
"N": "Na", "n": "na", "Ň": "Nb", "ň": "nb", | ||
"O": "Oa", "o": "oa", "Ó": "Ob", "ó": "ob", | ||
"R": "Ra", "r": "ra", "Ř": "Rb", "ř": "rb", | ||
"S": "Sa", "s": "sa", "Š": "Sb", "š": "šb", | ||
"T": "Ta", "t": "ta", "Ť": "Tb", "ť": "tb", | ||
"U": "Ua", "u": "ua", "Ú": "Ub", "ú": "ub", "Ů": "Uc", "ů": "uc", | ||
"Y": "Ya", "y": "ya", "Ý": "Yb", "ý": "yb", | ||
"Z": "Za", "z": "za", "Ž": "Zb", "ž": "zb" | ||
}; | ||
for (var val in special_letters) | ||
a = a.split(val).join(special_letters[val]).toLowerCase(); | ||
return a; | ||
}, | ||
|
||
"czech-asc": function ( a, b ) { | ||
return ((a < b) ? -1 : ((a > b) ? 1 : 0)); | ||
}, | ||
|
||
"czech-desc": function ( a, b ) { | ||
return ((a < b) ? 1 : ((a > b) ? -1 : 0)); | ||
} | ||
} ); |