/[js_locale]/trunk/sort.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/sort.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations)
Sun Oct 24 20:01:27 2004 UTC (19 years, 5 months ago) by dpavlin
File MIME type: text/html
File size: 936 byte(s)
extracted locale support to separate locale.js file

1 dpavlin 2 <html>
2     <head>
3     <title>JavaScript sort which honors static locale settings</title>
4     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
5     </head>
6     <body bgcolor="white">
7    
8     <p>
9     This is a demo of JavaScript sort which honors static locale LC_COLLATE
10     settings, embedded in one JavaScript variable which can be created from
11     local system using attached perl script.
12     </p><p>
13     Script by Dobrica Pavlinu¹iæ, &lt;dpavlin@rot13.org&gt; 2004-10-24
14     </p>
15    
16     <tt>
17    
18     <script type="text/javascript" src="locale.js"> </script>
19     <script type="text/javascript">
20    
21     // test string array of Croatian words
22     var test = [
23     'abrakadabra',
24     'èevap',
25     'ðak',
26     'd¾amija',
27     'æuk',
28     'pero',
29     '¾aba',
30     'Ðakovo',
31     'Zagreb'
32     ];
33    
34     // create some output
35     document.write(
36     "<br>original: ",test.join(" * "),
37     "<br>native: ",test.sort().join(" * "),
38     "<br>locale: ",test.sort(_lc_sort).join(" * ")
39     );
40    
41     </script>
42    
43     </tt>
44    
45     <br>
46     <p>Sorting finished.</p>
47    
48     </body>
49     </html>

  ViewVC Help
Powered by ViewVC 1.1.26