source: trunk/plugins/LocalFilesEditor/editarea/plugins/charmap/jscripts/map.js @ 5160

Last change on this file since 5160 was 5160, checked in by patdenice, 14 years ago

Editor
Update editarea to 0.8.2.
Remove CSS tab.
Fix jQuery path.

File size: 11.6 KB
Line 
1var editArea;
2
3
4/**
5 *  UTF-8 list taken from http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec
6 */ 
7 
8
9/*
10var char_range_list={
11"Basic Latin":"0021,007F",
12"Latin-1 Supplement":"0080,00FF",
13"Latin Extended-A":"0100,017F",
14"Latin Extended-B":"0180,024F",
15"IPA Extensions":"0250,02AF",
16"Spacing Modifier Letters":"02B0,02FF",
17
18"Combining Diacritical Marks":"0300,036F",
19"Greek and Coptic":"0370,03FF",
20"Cyrillic":"0400,04FF",
21"Cyrillic Supplement":"0500,052F",
22"Armenian":"0530,058F",
23"Hebrew":"0590,05FF",
24"Arabic":"0600,06FF",
25"Syriac":"0700,074F",
26"Arabic Supplement":"0750,077F",
27
28"Thaana":"0780,07BF",
29"Devanagari":"0900,097F",
30"Bengali":"0980,09FF",
31"Gurmukhi":"0A00,0A7F",
32"Gujarati":"0A80,0AFF",
33"Oriya":"0B00,0B7F",
34"Tamil":"0B80,0BFF",
35"Telugu":"0C00,0C7F",
36"Kannada":"0C80,0CFF",
37
38"Malayalam":"0D00,0D7F",
39"Sinhala":"0D80,0DFF",
40"Thai":"0E00,0E7F",
41"Lao":"0E80,0EFF",
42"Tibetan":"0F00,0FFF",
43"Myanmar":"1000,109F",
44"Georgian":"10A0,10FF",
45"Hangul Jamo":"1100,11FF",
46"Ethiopic":"1200,137F",
47
48"Ethiopic Supplement":"1380,139F",
49"Cherokee":"13A0,13FF",
50"Unified Canadian Aboriginal Syllabics":"1400,167F",
51"Ogham":"1680,169F",
52"Runic":"16A0,16FF",
53"Tagalog":"1700,171F",
54"Hanunoo":"1720,173F",
55"Buhid":"1740,175F",
56"Tagbanwa":"1760,177F",
57
58"Khmer":"1780,17FF",
59"Mongolian":"1800,18AF",
60"Limbu":"1900,194F",
61"Tai Le":"1950,197F",
62"New Tai Lue":"1980,19DF",
63"Khmer Symbols":"19E0,19FF",
64"Buginese":"1A00,1A1F",
65"Phonetic Extensions":"1D00,1D7F",
66"Phonetic Extensions Supplement":"1D80,1DBF",
67
68"Combining Diacritical Marks Supplement":"1DC0,1DFF",
69"Latin Extended Additional":"1E00,1EFF",
70"Greek Extended":"1F00,1FFF",
71"General Punctuation":"2000,206F",
72"Superscripts and Subscripts":"2070,209F",
73"Currency Symbols":"20A0,20CF",
74"Combining Diacritical Marks for Symbols":"20D0,20FF",
75"Letterlike Symbols":"2100,214F",
76"Number Forms":"2150,218F",
77
78"Arrows":"2190,21FF",
79"Mathematical Operators":"2200,22FF",
80"Miscellaneous Technical":"2300,23FF",
81"Control Pictures":"2400,243F",
82"Optical Character Recognition":"2440,245F",
83"Enclosed Alphanumerics":"2460,24FF",
84"Box Drawing":"2500,257F",
85"Block Elements":"2580,259F",
86"Geometric Shapes":"25A0,25FF",
87
88"Miscellaneous Symbols":"2600,26FF",
89"Dingbats":"2700,27BF",
90"Miscellaneous Mathematical Symbols-A":"27C0,27EF",
91"Supplemental Arrows-A":"27F0,27FF",
92"Braille Patterns":"2800,28FF",
93"Supplemental Arrows-B":"2900,297F",
94"Miscellaneous Mathematical Symbols-B":"2980,29FF",
95"Supplemental Mathematical Operators":"2A00,2AFF",
96"Miscellaneous Symbols and Arrows":"2B00,2BFF",
97
98"Glagolitic":"2C00,2C5F",
99"Coptic":"2C80,2CFF",
100"Georgian Supplement":"2D00,2D2F",
101"Tifinagh":"2D30,2D7F",
102"Ethiopic Extended":"2D80,2DDF",
103"Supplemental Punctuation":"2E00,2E7F",
104"CJK Radicals Supplement":"2E80,2EFF",
105"Kangxi Radicals":"2F00,2FDF",
106"Ideographic Description Characters":"2FF0,2FFF",
107
108"CJK Symbols and Punctuation":"3000,303F",
109"Hiragana":"3040,309F",
110"Katakana":"30A0,30FF",
111"Bopomofo":"3100,312F",
112"Hangul Compatibility Jamo":"3130,318F",
113"Kanbun":"3190,319F",
114"Bopomofo Extended":"31A0,31BF",
115"CJK Strokes":"31C0,31EF",
116"Katakana Phonetic Extensions":"31F0,31FF",
117
118"Enclosed CJK Letters and Months":"3200,32FF",
119"CJK Compatibility":"3300,33FF",
120"CJK Unified Ideographs Extension A":"3400,4DBF",
121"Yijing Hexagram Symbols":"4DC0,4DFF",
122"CJK Unified Ideographs":"4E00,9FFF",
123"Yi Syllables":"A000,A48F",
124"Yi Radicals":"A490,A4CF",
125"Modifier Tone Letters":"A700,A71F",
126"Syloti Nagri":"A800,A82F",
127
128"Hangul Syllables":"AC00,D7AF",
129"High Surrogates":"D800,DB7F",
130"High Private Use Surrogates":"DB80,DBFF",
131"Low Surrogates":"DC00,DFFF",
132"Private Use Area":"E000,F8FF",
133"CJK Compatibility Ideographs":"F900,FAFF",
134"Alphabetic Presentation Forms":"FB00,FB4F",
135"Arabic Presentation Forms-A":"FB50,FDFF",
136"Variation Selectors":"FE00,FE0F",
137
138"Vertical Forms":"FE10,FE1F",
139"Combining Half Marks":"FE20,FE2F",
140"CJK Compatibility Forms":"FE30,FE4F",
141"Small Form Variants":"FE50,FE6F",
142"Arabic Presentation Forms-B":"FE70,FEFF",
143"Halfwidth and Fullwidth Forms":"FF00,FFEF",
144"Specials":"FFF0,FFFF",
145"Linear B Syllabary":"10000,1007F",
146"Linear B Ideograms":"10080,100FF",
147
148"Aegean Numbers":"10100,1013F",
149"Ancient Greek Numbers":"10140,1018F",
150"Old Italic":"10300,1032F",
151"Gothic":"10330,1034F",
152"Ugaritic":"10380,1039F",
153"Old Persian":"103A0,103DF",
154"Deseret":"10400,1044F",
155"Shavian":"10450,1047F",
156"Osmanya":"10480,104AF",
157
158"Cypriot Syllabary":"10800,1083F",
159"Kharoshthi":"10A00,10A5F",
160"Byzantine Musical Symbols":"1D000,1D0FF",
161"Musical Symbols":"1D100,1D1FF",
162"Ancient Greek Musical Notation":"1D200,1D24F",
163"Tai Xuan Jing Symbols":"1D300,1D35F",
164"Mathematical Alphanumeric Symbols":"1D400,1D7FF",
165"CJK Unified Ideographs Extension B":"20000,2A6DF",
166"CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
167"Tags":"E0000,E007F",
168"Variation Selectors Supplement":"E0100,E01EF"
169};
170*/
171var char_range_list={
172"Aegean Numbers":"10100,1013F",
173"Alphabetic Presentation Forms":"FB00,FB4F",
174"Ancient Greek Musical Notation":"1D200,1D24F",
175"Ancient Greek Numbers":"10140,1018F",
176"Arabic":"0600,06FF",
177"Arabic Presentation Forms-A":"FB50,FDFF",
178"Arabic Presentation Forms-B":"FE70,FEFF",
179"Arabic Supplement":"0750,077F",
180"Armenian":"0530,058F",
181"Arrows":"2190,21FF",
182"Basic Latin":"0020,007F",
183"Bengali":"0980,09FF",
184"Block Elements":"2580,259F",
185"Bopomofo Extended":"31A0,31BF",
186"Bopomofo":"3100,312F",
187"Box Drawing":"2500,257F",
188"Braille Patterns":"2800,28FF",
189"Buginese":"1A00,1A1F",
190"Buhid":"1740,175F",
191"Byzantine Musical Symbols":"1D000,1D0FF",
192"CJK Compatibility Forms":"FE30,FE4F",
193"CJK Compatibility Ideographs Supplement":"2F800,2FA1F",
194"CJK Compatibility Ideographs":"F900,FAFF",
195"CJK Compatibility":"3300,33FF",
196"CJK Radicals Supplement":"2E80,2EFF",
197"CJK Strokes":"31C0,31EF",
198"CJK Symbols and Punctuation":"3000,303F",
199"CJK Unified Ideographs Extension A":"3400,4DBF",
200"CJK Unified Ideographs Extension B":"20000,2A6DF",
201"CJK Unified Ideographs":"4E00,9FFF",
202"Cherokee":"13A0,13FF",
203"Combining Diacritical Marks Supplement":"1DC0,1DFF",
204"Combining Diacritical Marks for Symbols":"20D0,20FF",
205"Combining Diacritical Marks":"0300,036F",
206"Combining Half Marks":"FE20,FE2F",
207"Control Pictures":"2400,243F",
208"Coptic":"2C80,2CFF",
209"Currency Symbols":"20A0,20CF",
210"Cypriot Syllabary":"10800,1083F",
211"Cyrillic Supplement":"0500,052F",
212"Cyrillic":"0400,04FF",
213"Deseret":"10400,1044F",
214"Devanagari":"0900,097F",
215"Dingbats":"2700,27BF",
216"Enclosed Alphanumerics":"2460,24FF",
217"Enclosed CJK Letters and Months":"3200,32FF",
218"Ethiopic Extended":"2D80,2DDF",
219"Ethiopic Supplement":"1380,139F",
220"Ethiopic":"1200,137F",
221"General Punctuation":"2000,206F",
222"Geometric Shapes":"25A0,25FF",
223"Georgian Supplement":"2D00,2D2F",
224"Georgian":"10A0,10FF",
225"Glagolitic":"2C00,2C5F",
226"Gothic":"10330,1034F",
227"Greek Extended":"1F00,1FFF",
228"Greek and Coptic":"0370,03FF",
229"Gujarati":"0A80,0AFF",
230"Gurmukhi":"0A00,0A7F",
231"Halfwidth and Fullwidth Forms":"FF00,FFEF",
232"Hangul Compatibility Jamo":"3130,318F",
233"Hangul Jamo":"1100,11FF",
234"Hangul Syllables":"AC00,D7AF",
235"Hanunoo":"1720,173F",
236"Hebrew":"0590,05FF",
237"High Private Use Surrogates":"DB80,DBFF",
238"High Surrogates":"D800,DB7F",
239"Hiragana":"3040,309F",
240"IPA Extensions":"0250,02AF",
241"Ideographic Description Characters":"2FF0,2FFF",
242"Kanbun":"3190,319F",
243"Kangxi Radicals":"2F00,2FDF",
244"Kannada":"0C80,0CFF",
245"Katakana Phonetic Extensions":"31F0,31FF",
246"Katakana":"30A0,30FF",
247"Kharoshthi":"10A00,10A5F",
248"Khmer Symbols":"19E0,19FF",
249"Khmer":"1780,17FF",
250"Lao":"0E80,0EFF",
251"Latin Extended Additional":"1E00,1EFF",
252"Latin Extended-A":"0100,017F",
253"Latin Extended-B":"0180,024F",
254"Latin-1 Supplement":"0080,00FF",
255"Letterlike Symbols":"2100,214F",
256"Limbu":"1900,194F",
257"Linear B Ideograms":"10080,100FF",
258"Linear B Syllabary":"10000,1007F",
259"Low Surrogates":"DC00,DFFF",
260"Malayalam":"0D00,0D7F",
261"Mathematical Alphanumeric Symbols":"1D400,1D7FF",
262"Mathematical Operators":"2200,22FF",
263"Miscellaneous Mathematical Symbols-A":"27C0,27EF",
264"Miscellaneous Mathematical Symbols-B":"2980,29FF",
265"Miscellaneous Symbols and Arrows":"2B00,2BFF",
266"Miscellaneous Symbols":"2600,26FF",
267"Miscellaneous Technical":"2300,23FF",
268"Modifier Tone Letters":"A700,A71F",
269"Mongolian":"1800,18AF",
270"Musical Symbols":"1D100,1D1FF",
271"Myanmar":"1000,109F",
272"New Tai Lue":"1980,19DF",
273"Number Forms":"2150,218F",
274"Ogham":"1680,169F",
275"Old Italic":"10300,1032F",
276"Old Persian":"103A0,103DF",
277"Optical Character Recognition":"2440,245F",
278"Oriya":"0B00,0B7F",
279"Osmanya":"10480,104AF",
280"Phonetic Extensions Supplement":"1D80,1DBF",
281"Phonetic Extensions":"1D00,1D7F",
282"Private Use Area":"E000,F8FF",
283"Runic":"16A0,16FF",
284"Shavian":"10450,1047F",
285"Sinhala":"0D80,0DFF",
286"Small Form Variants":"FE50,FE6F",
287"Spacing Modifier Letters":"02B0,02FF",
288"Specials":"FFF0,FFFF",
289"Superscripts and Subscripts":"2070,209F",
290"Supplemental Arrows-A":"27F0,27FF",
291"Supplemental Arrows-B":"2900,297F",
292"Supplemental Mathematical Operators":"2A00,2AFF",
293"Supplemental Punctuation":"2E00,2E7F",
294"Syloti Nagri":"A800,A82F",
295"Syriac":"0700,074F",
296"Tagalog":"1700,171F",
297"Tagbanwa":"1760,177F",
298"Tags":"E0000,E007F",
299"Tai Le":"1950,197F",
300"Tai Xuan Jing Symbols":"1D300,1D35F",
301"Tamil":"0B80,0BFF",
302"Telugu":"0C00,0C7F",
303"Thaana":"0780,07BF",
304"Thai":"0E00,0E7F",
305"Tibetan":"0F00,0FFF",
306"Tifinagh":"2D30,2D7F",
307"Ugaritic":"10380,1039F",
308"Unified Canadian Aboriginal Syllabics":"1400,167F",
309"Variation Selectors Supplement":"E0100,E01EF",
310"Variation Selectors":"FE00,FE0F",
311"Vertical Forms":"FE10,FE1F",
312"Yi Radicals":"A490,A4CF",
313"Yi Syllables":"A000,A48F",
314"Yijing Hexagram Symbols":"4DC0,4DFF"
315};
316
317var insert="charmap_insert";
318
319function map_load(){
320        editArea=opener.editArea;
321        // translate the document
322        insert= editArea.get_translation(insert, "word");
323        //alert(document.title);
324        document.title= editArea.get_translation(document.title, "template");
325        document.body.innerHTML= editArea.get_translation(document.body.innerHTML, "template");
326        //document.title= editArea.get_translation(document.getElementBytitle, "template");
327       
328        var selected_lang=opener.EditArea_charmap.default_language.toLowerCase();
329        var selected=0;
330       
331        var select= document.getElementById("select_range")
332        for(var i in char_range_list){
333                if(i.toLowerCase()==selected_lang)
334                        selected=select.options.length;
335                select.options[select.options.length]=new Option(i, char_range_list[i]);
336        }
337        select.options[selected].selected=true;
338/*      start=0;
339        end=127;
340        content="";
341        for(var i=start; i<end; i++){
342                content+="&#"+i+"; ";
343        }
344        document.getElementById("char_list").innerHTML=content;*/
345        renderCharMapHTML();
346}
347
348
349function renderCharMapHTML() {
350        range= document.getElementById("select_range").value.split(",");
351
352        start= parseInt(range[0],16);
353        end= parseInt(range[1],16);
354        var charsPerRow = 20, tdWidth=20, tdHeight=20;
355        html="";
356        for (var i=start; i<end; i++) {
357                html+="<a class='char' onmouseover='previewChar(\""+ i + "\");' onclick='insertChar(\""+ i + "\");' title='"+ insert +"'>"+ String.fromCharCode(i) +"</a>";
358        }
359        document.getElementById("char_list").innerHTML= html;
360        document.getElementById("preview_char").innerHTML="";
361}
362
363function previewChar(i){
364        document.getElementById("preview_char").innerHTML= String.fromCharCode(i);
365        document.getElementById("preview_code").innerHTML= "&amp;#"+ i +";";
366}
367
368function insertChar(i){
369        opener.parent.editAreaLoader.setSelectedText(editArea.id, String.fromCharCode( i));
370        range= opener.parent.editAreaLoader.getSelectionRange(editArea.id);
371        opener.parent.editAreaLoader.setSelectionRange(editArea.id, range["end"], range["end"]);
372        window.focus();
373}
Note: See TracBrowser for help on using the repository browser.