4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
11 /*global tinymce:true */
13 tinymce.PluginManager.add('charmap', function(editor) {
15 ['160', 'no-break space'],
17 ['34', 'quotation mark'],
20 ['8364', 'euro sign'],
21 ['163', 'pound sign'],
24 ['169', 'copyright sign'],
25 ['174', 'registered sign'],
26 ['8482', 'trade mark sign'],
27 ['8240', 'per mille sign'],
28 ['181', 'micro sign'],
29 ['183', 'middle dot'],
31 ['8230', 'three dot leader'],
32 ['8242', 'minutes / feet'],
33 ['8243', 'seconds / inches'],
34 ['167', 'section sign'],
35 ['182', 'paragraph sign'],
36 ['223', 'sharp s / ess-zed'],
38 ['8249', 'single left-pointing angle quotation mark'],
39 ['8250', 'single right-pointing angle quotation mark'],
40 ['171', 'left pointing guillemet'],
41 ['187', 'right pointing guillemet'],
42 ['8216', 'left single quotation mark'],
43 ['8217', 'right single quotation mark'],
44 ['8220', 'left double quotation mark'],
45 ['8221', 'right double quotation mark'],
46 ['8218', 'single low-9 quotation mark'],
47 ['8222', 'double low-9 quotation mark'],
48 ['60', 'less-than sign'],
49 ['62', 'greater-than sign'],
50 ['8804', 'less-than or equal to'],
51 ['8805', 'greater-than or equal to'],
56 ['164', 'currency sign'],
57 ['166', 'broken bar'],
59 ['161', 'inverted exclamation mark'],
60 ['191', 'turned question mark'],
61 ['710', 'circumflex accent'],
62 ['732', 'small tilde'],
63 ['176', 'degree sign'],
64 ['8722', 'minus sign'],
65 ['177', 'plus-minus sign'],
66 ['247', 'division sign'],
67 ['8260', 'fraction slash'],
68 ['215', 'multiplication sign'],
69 ['185', 'superscript one'],
70 ['178', 'superscript two'],
71 ['179', 'superscript three'],
72 ['188', 'fraction one quarter'],
73 ['189', 'fraction one half'],
74 ['190', 'fraction three quarters'],
76 ['402', 'function / florin'],
78 ['8721', 'n-ary sumation'],
80 ['8730', 'square root'],
81 ['8764', 'similar to'],
82 ['8773', 'approximately equal to'],
83 ['8776', 'almost equal to'],
84 ['8800', 'not equal to'],
85 ['8801', 'identical to'],
86 ['8712', 'element of'],
87 ['8713', 'not an element of'],
88 ['8715', 'contains as member'],
89 ['8719', 'n-ary product'],
90 ['8743', 'logical and'],
91 ['8744', 'logical or'],
93 ['8745', 'intersection'],
95 ['8706', 'partial differential'],
97 ['8707', 'there exists'],
99 ['8711', 'backward difference'],
100 ['8727', 'asterisk operator'],
101 ['8733', 'proportional to'],
104 ['180', 'acute accent'],
106 ['170', 'feminine ordinal indicator'],
107 ['186', 'masculine ordinal indicator'],
109 ['8225', 'double dagger'],
110 // alphabetical special chars
111 ['192', 'A - grave'],
112 ['193', 'A - acute'],
113 ['194', 'A - circumflex'],
114 ['195', 'A - tilde'],
115 ['196', 'A - diaeresis'],
116 ['197', 'A - ring above'],
117 ['198', 'ligature AE'],
118 ['199', 'C - cedilla'],
119 ['200', 'E - grave'],
120 ['201', 'E - acute'],
121 ['202', 'E - circumflex'],
122 ['203', 'E - diaeresis'],
123 ['204', 'I - grave'],
124 ['205', 'I - acute'],
125 ['206', 'I - circumflex'],
126 ['207', 'I - diaeresis'],
128 ['209', 'N - tilde'],
129 ['210', 'O - grave'],
130 ['211', 'O - acute'],
131 ['212', 'O - circumflex'],
132 ['213', 'O - tilde'],
133 ['214', 'O - diaeresis'],
134 ['216', 'O - slash'],
135 ['338', 'ligature OE'],
136 ['352', 'S - caron'],
137 ['217', 'U - grave'],
138 ['218', 'U - acute'],
139 ['219', 'U - circumflex'],
140 ['220', 'U - diaeresis'],
141 ['221', 'Y - acute'],
142 ['376', 'Y - diaeresis'],
144 ['224', 'a - grave'],
145 ['225', 'a - acute'],
146 ['226', 'a - circumflex'],
147 ['227', 'a - tilde'],
148 ['228', 'a - diaeresis'],
149 ['229', 'a - ring above'],
150 ['230', 'ligature ae'],
151 ['231', 'c - cedilla'],
152 ['232', 'e - grave'],
153 ['233', 'e - acute'],
154 ['234', 'e - circumflex'],
155 ['235', 'e - diaeresis'],
156 ['236', 'i - grave'],
157 ['237', 'i - acute'],
158 ['238', 'i - circumflex'],
159 ['239', 'i - diaeresis'],
161 ['241', 'n - tilde'],
162 ['242', 'o - grave'],
163 ['243', 'o - acute'],
164 ['244', 'o - circumflex'],
165 ['245', 'o - tilde'],
166 ['246', 'o - diaeresis'],
168 ['339', 'ligature oe'],
169 ['353', 's - caron'],
170 ['249', 'u - grave'],
171 ['250', 'u - acute'],
172 ['251', 'u - circumflex'],
173 ['252', 'u - diaeresis'],
174 ['253', 'y - acute'],
176 ['255', 'y - diaeresis'],
218 ['962', 'final sigma'],
227 ['8501', 'alef symbol'],
228 ['982', 'pi symbol'],
229 ['8476', 'real part symbol'],
230 ['978', 'upsilon - hook symbol'],
231 ['8472', 'Weierstrass p'],
232 ['8465', 'imaginary part'],
234 ['8592', 'leftwards arrow'],
235 ['8593', 'upwards arrow'],
236 ['8594', 'rightwards arrow'],
237 ['8595', 'downwards arrow'],
238 ['8596', 'left right arrow'],
239 ['8629', 'carriage return'],
240 ['8656', 'leftwards double arrow'],
241 ['8657', 'upwards double arrow'],
242 ['8658', 'rightwards double arrow'],
243 ['8659', 'downwards double arrow'],
244 ['8660', 'left right double arrow'],
245 ['8756', 'therefore'],
246 ['8834', 'subset of'],
247 ['8835', 'superset of'],
248 ['8836', 'not a subset of'],
249 ['8838', 'subset of or equal to'],
250 ['8839', 'superset of or equal to'],
251 ['8853', 'circled plus'],
252 ['8855', 'circled times'],
253 ['8869', 'perpendicular'],
254 ['8901', 'dot operator'],
255 ['8968', 'left ceiling'],
256 ['8969', 'right ceiling'],
257 ['8970', 'left floor'],
258 ['8971', 'right floor'],
259 ['9001', 'left-pointing angle bracket'],
260 ['9002', 'right-pointing angle bracket'],
262 ['9824', 'black spade suit'],
263 ['9827', 'black club suit'],
264 ['9829', 'black heart suit'],
265 ['9830', 'black diamond suit'],
266 ['8194', 'en space'],
267 ['8195', 'em space'],
268 ['8201', 'thin space'],
269 ['8204', 'zero width non-joiner'],
270 ['8205', 'zero width joiner'],
271 ['8206', 'left-to-right mark'],
272 ['8207', 'right-to-left mark'],
273 ['173', 'soft hyphen']
276 function showDialog() {
277 var gridHtml, x, y, win;
279 function getParentTd(elm) {
281 if (elm.nodeName == 'TD') {
285 elm = elm.parentNode;
289 gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
292 for (y = 0; y < 10; y++) {
295 for (x = 0; x < width; x++) {
296 var chr = charmap[y * width + x];
298 gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
299 (chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
305 gridHtml += '</tbody></table>';
310 onclick: function(e) {
311 var target = e.target;
313 if (target.tagName == 'TD') {
314 target = target.firstChild;
317 if (target.tagName == 'DIV') {
318 editor.execCommand('mceInsertContent', false, target.firstChild.data);
325 onmouseover: function(e) {
326 var td = getParentTd(e.target);
329 win.find('#preview').text(td.firstChild.firstChild.data);
334 win = editor.windowManager.open({
335 title: "Special character",
344 style: 'font-size: 40px; text-align: center',
351 {text: "Close", onclick: function() {
358 editor.addButton('charmap', {
360 tooltip: 'Special character',
364 editor.addMenuItem('charmap', {
366 text: 'Special character',