From 4628f3ec0da3d62cd9fa8a1cae8e8b67ff2a956e Mon Sep 17 00:00:00 2001 From: Tchuba Date: Mon, 18 Dec 2017 14:26:52 +0100 Subject: [PATCH 1/2] Add Czech language sorting extension file --- sorting/czech-sorting.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sorting/czech-sorting.js diff --git a/sorting/czech-sorting.js b/sorting/czech-sorting.js new file mode 100644 index 00000000..7d62476d --- /dev/null +++ b/sorting/czech-sorting.js @@ -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)); + } +} ); From 709020a2a6d1777e0c91e2cb26517dadf0a2ebe0 Mon Sep 17 00:00:00 2001 From: Tchuba Date: Mon, 18 Dec 2017 14:33:12 +0100 Subject: [PATCH 2/2] Rename czech-sorting.js to czech-string.js --- sorting/{czech-sorting.js => czech-string.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sorting/{czech-sorting.js => czech-string.js} (100%) diff --git a/sorting/czech-sorting.js b/sorting/czech-string.js similarity index 100% rename from sorting/czech-sorting.js rename to sorting/czech-string.js