bgneal@312
|
1 /**
|
bgneal@312
|
2 * charmap.js
|
bgneal@312
|
3 *
|
bgneal@312
|
4 * Copyright 2009, Moxiecode Systems AB
|
bgneal@312
|
5 * Released under LGPL License.
|
bgneal@312
|
6 *
|
bgneal@312
|
7 * License: http://tinymce.moxiecode.com/license
|
bgneal@312
|
8 * Contributing: http://tinymce.moxiecode.com/contributing
|
bgneal@312
|
9 */
|
bgneal@312
|
10
|
bgneal@312
|
11 tinyMCEPopup.requireLangPack();
|
bgneal@312
|
12
|
bgneal@312
|
13 var charmap = [
|
bgneal@312
|
14 [' ', ' ', true, 'no-break space'],
|
bgneal@312
|
15 ['&', '&', true, 'ampersand'],
|
bgneal@312
|
16 ['"', '"', true, 'quotation mark'],
|
bgneal@312
|
17 // finance
|
bgneal@312
|
18 ['¢', '¢', true, 'cent sign'],
|
bgneal@312
|
19 ['€', '€', true, 'euro sign'],
|
bgneal@312
|
20 ['£', '£', true, 'pound sign'],
|
bgneal@312
|
21 ['¥', '¥', true, 'yen sign'],
|
bgneal@312
|
22 // signs
|
bgneal@312
|
23 ['©', '©', true, 'copyright sign'],
|
bgneal@312
|
24 ['®', '®', true, 'registered sign'],
|
bgneal@312
|
25 ['™', '™', true, 'trade mark sign'],
|
bgneal@312
|
26 ['‰', '‰', true, 'per mille sign'],
|
bgneal@312
|
27 ['µ', 'µ', true, 'micro sign'],
|
bgneal@312
|
28 ['·', '·', true, 'middle dot'],
|
bgneal@312
|
29 ['•', '•', true, 'bullet'],
|
bgneal@312
|
30 ['…', '…', true, 'three dot leader'],
|
bgneal@312
|
31 ['′', '′', true, 'minutes / feet'],
|
bgneal@312
|
32 ['″', '″', true, 'seconds / inches'],
|
bgneal@312
|
33 ['§', '§', true, 'section sign'],
|
bgneal@312
|
34 ['¶', '¶', true, 'paragraph sign'],
|
bgneal@312
|
35 ['ß', 'ß', true, 'sharp s / ess-zed'],
|
bgneal@312
|
36 // quotations
|
bgneal@312
|
37 ['‹', '‹', true, 'single left-pointing angle quotation mark'],
|
bgneal@312
|
38 ['›', '›', true, 'single right-pointing angle quotation mark'],
|
bgneal@312
|
39 ['«', '«', true, 'left pointing guillemet'],
|
bgneal@312
|
40 ['»', '»', true, 'right pointing guillemet'],
|
bgneal@312
|
41 ['‘', '‘', true, 'left single quotation mark'],
|
bgneal@312
|
42 ['’', '’', true, 'right single quotation mark'],
|
bgneal@312
|
43 ['“', '“', true, 'left double quotation mark'],
|
bgneal@312
|
44 ['”', '”', true, 'right double quotation mark'],
|
bgneal@312
|
45 ['‚', '‚', true, 'single low-9 quotation mark'],
|
bgneal@312
|
46 ['„', '„', true, 'double low-9 quotation mark'],
|
bgneal@312
|
47 ['<', '<', true, 'less-than sign'],
|
bgneal@312
|
48 ['>', '>', true, 'greater-than sign'],
|
bgneal@312
|
49 ['≤', '≤', true, 'less-than or equal to'],
|
bgneal@312
|
50 ['≥', '≥', true, 'greater-than or equal to'],
|
bgneal@312
|
51 ['–', '–', true, 'en dash'],
|
bgneal@312
|
52 ['—', '—', true, 'em dash'],
|
bgneal@312
|
53 ['¯', '¯', true, 'macron'],
|
bgneal@312
|
54 ['‾', '‾', true, 'overline'],
|
bgneal@312
|
55 ['¤', '¤', true, 'currency sign'],
|
bgneal@312
|
56 ['¦', '¦', true, 'broken bar'],
|
bgneal@312
|
57 ['¨', '¨', true, 'diaeresis'],
|
bgneal@312
|
58 ['¡', '¡', true, 'inverted exclamation mark'],
|
bgneal@312
|
59 ['¿', '¿', true, 'turned question mark'],
|
bgneal@312
|
60 ['ˆ', 'ˆ', true, 'circumflex accent'],
|
bgneal@312
|
61 ['˜', '˜', true, 'small tilde'],
|
bgneal@312
|
62 ['°', '°', true, 'degree sign'],
|
bgneal@312
|
63 ['−', '−', true, 'minus sign'],
|
bgneal@312
|
64 ['±', '±', true, 'plus-minus sign'],
|
bgneal@312
|
65 ['÷', '÷', true, 'division sign'],
|
bgneal@312
|
66 ['⁄', '⁄', true, 'fraction slash'],
|
bgneal@312
|
67 ['×', '×', true, 'multiplication sign'],
|
bgneal@312
|
68 ['¹', '¹', true, 'superscript one'],
|
bgneal@312
|
69 ['²', '²', true, 'superscript two'],
|
bgneal@312
|
70 ['³', '³', true, 'superscript three'],
|
bgneal@312
|
71 ['¼', '¼', true, 'fraction one quarter'],
|
bgneal@312
|
72 ['½', '½', true, 'fraction one half'],
|
bgneal@312
|
73 ['¾', '¾', true, 'fraction three quarters'],
|
bgneal@312
|
74 // math / logical
|
bgneal@312
|
75 ['ƒ', 'ƒ', true, 'function / florin'],
|
bgneal@312
|
76 ['∫', '∫', true, 'integral'],
|
bgneal@312
|
77 ['∑', '∑', true, 'n-ary sumation'],
|
bgneal@312
|
78 ['∞', '∞', true, 'infinity'],
|
bgneal@312
|
79 ['√', '√', true, 'square root'],
|
bgneal@312
|
80 ['∼', '∼', false,'similar to'],
|
bgneal@312
|
81 ['≅', '≅', false,'approximately equal to'],
|
bgneal@312
|
82 ['≈', '≈', true, 'almost equal to'],
|
bgneal@312
|
83 ['≠', '≠', true, 'not equal to'],
|
bgneal@312
|
84 ['≡', '≡', true, 'identical to'],
|
bgneal@312
|
85 ['∈', '∈', false,'element of'],
|
bgneal@312
|
86 ['∉', '∉', false,'not an element of'],
|
bgneal@312
|
87 ['∋', '∋', false,'contains as member'],
|
bgneal@312
|
88 ['∏', '∏', true, 'n-ary product'],
|
bgneal@312
|
89 ['∧', '∧', false,'logical and'],
|
bgneal@312
|
90 ['∨', '∨', false,'logical or'],
|
bgneal@312
|
91 ['¬', '¬', true, 'not sign'],
|
bgneal@312
|
92 ['∩', '∩', true, 'intersection'],
|
bgneal@312
|
93 ['∪', '∪', false,'union'],
|
bgneal@312
|
94 ['∂', '∂', true, 'partial differential'],
|
bgneal@312
|
95 ['∀', '∀', false,'for all'],
|
bgneal@312
|
96 ['∃', '∃', false,'there exists'],
|
bgneal@312
|
97 ['∅', '∅', false,'diameter'],
|
bgneal@312
|
98 ['∇', '∇', false,'backward difference'],
|
bgneal@312
|
99 ['∗', '∗', false,'asterisk operator'],
|
bgneal@312
|
100 ['∝', '∝', false,'proportional to'],
|
bgneal@312
|
101 ['∠', '∠', false,'angle'],
|
bgneal@312
|
102 // undefined
|
bgneal@312
|
103 ['´', '´', true, 'acute accent'],
|
bgneal@312
|
104 ['¸', '¸', true, 'cedilla'],
|
bgneal@312
|
105 ['ª', 'ª', true, 'feminine ordinal indicator'],
|
bgneal@312
|
106 ['º', 'º', true, 'masculine ordinal indicator'],
|
bgneal@312
|
107 ['†', '†', true, 'dagger'],
|
bgneal@312
|
108 ['‡', '‡', true, 'double dagger'],
|
bgneal@312
|
109 // alphabetical special chars
|
bgneal@312
|
110 ['À', 'À', true, 'A - grave'],
|
bgneal@312
|
111 ['Á', 'Á', true, 'A - acute'],
|
bgneal@312
|
112 ['Â', 'Â', true, 'A - circumflex'],
|
bgneal@312
|
113 ['Ã', 'Ã', true, 'A - tilde'],
|
bgneal@312
|
114 ['Ä', 'Ä', true, 'A - diaeresis'],
|
bgneal@312
|
115 ['Å', 'Å', true, 'A - ring above'],
|
bgneal@312
|
116 ['Æ', 'Æ', true, 'ligature AE'],
|
bgneal@312
|
117 ['Ç', 'Ç', true, 'C - cedilla'],
|
bgneal@312
|
118 ['È', 'È', true, 'E - grave'],
|
bgneal@312
|
119 ['É', 'É', true, 'E - acute'],
|
bgneal@312
|
120 ['Ê', 'Ê', true, 'E - circumflex'],
|
bgneal@312
|
121 ['Ë', 'Ë', true, 'E - diaeresis'],
|
bgneal@312
|
122 ['Ì', 'Ì', true, 'I - grave'],
|
bgneal@312
|
123 ['Í', 'Í', true, 'I - acute'],
|
bgneal@312
|
124 ['Î', 'Î', true, 'I - circumflex'],
|
bgneal@312
|
125 ['Ï', 'Ï', true, 'I - diaeresis'],
|
bgneal@312
|
126 ['Ð', 'Ð', true, 'ETH'],
|
bgneal@312
|
127 ['Ñ', 'Ñ', true, 'N - tilde'],
|
bgneal@312
|
128 ['Ò', 'Ò', true, 'O - grave'],
|
bgneal@312
|
129 ['Ó', 'Ó', true, 'O - acute'],
|
bgneal@312
|
130 ['Ô', 'Ô', true, 'O - circumflex'],
|
bgneal@312
|
131 ['Õ', 'Õ', true, 'O - tilde'],
|
bgneal@312
|
132 ['Ö', 'Ö', true, 'O - diaeresis'],
|
bgneal@312
|
133 ['Ø', 'Ø', true, 'O - slash'],
|
bgneal@312
|
134 ['Œ', 'Œ', true, 'ligature OE'],
|
bgneal@312
|
135 ['Š', 'Š', true, 'S - caron'],
|
bgneal@312
|
136 ['Ù', 'Ù', true, 'U - grave'],
|
bgneal@312
|
137 ['Ú', 'Ú', true, 'U - acute'],
|
bgneal@312
|
138 ['Û', 'Û', true, 'U - circumflex'],
|
bgneal@312
|
139 ['Ü', 'Ü', true, 'U - diaeresis'],
|
bgneal@312
|
140 ['Ý', 'Ý', true, 'Y - acute'],
|
bgneal@312
|
141 ['Ÿ', 'Ÿ', true, 'Y - diaeresis'],
|
bgneal@312
|
142 ['Þ', 'Þ', true, 'THORN'],
|
bgneal@312
|
143 ['à', 'à', true, 'a - grave'],
|
bgneal@312
|
144 ['á', 'á', true, 'a - acute'],
|
bgneal@312
|
145 ['â', 'â', true, 'a - circumflex'],
|
bgneal@312
|
146 ['ã', 'ã', true, 'a - tilde'],
|
bgneal@312
|
147 ['ä', 'ä', true, 'a - diaeresis'],
|
bgneal@312
|
148 ['å', 'å', true, 'a - ring above'],
|
bgneal@312
|
149 ['æ', 'æ', true, 'ligature ae'],
|
bgneal@312
|
150 ['ç', 'ç', true, 'c - cedilla'],
|
bgneal@312
|
151 ['è', 'è', true, 'e - grave'],
|
bgneal@312
|
152 ['é', 'é', true, 'e - acute'],
|
bgneal@312
|
153 ['ê', 'ê', true, 'e - circumflex'],
|
bgneal@312
|
154 ['ë', 'ë', true, 'e - diaeresis'],
|
bgneal@312
|
155 ['ì', 'ì', true, 'i - grave'],
|
bgneal@312
|
156 ['í', 'í', true, 'i - acute'],
|
bgneal@312
|
157 ['î', 'î', true, 'i - circumflex'],
|
bgneal@312
|
158 ['ï', 'ï', true, 'i - diaeresis'],
|
bgneal@312
|
159 ['ð', 'ð', true, 'eth'],
|
bgneal@312
|
160 ['ñ', 'ñ', true, 'n - tilde'],
|
bgneal@312
|
161 ['ò', 'ò', true, 'o - grave'],
|
bgneal@312
|
162 ['ó', 'ó', true, 'o - acute'],
|
bgneal@312
|
163 ['ô', 'ô', true, 'o - circumflex'],
|
bgneal@312
|
164 ['õ', 'õ', true, 'o - tilde'],
|
bgneal@312
|
165 ['ö', 'ö', true, 'o - diaeresis'],
|
bgneal@312
|
166 ['ø', 'ø', true, 'o slash'],
|
bgneal@312
|
167 ['œ', 'œ', true, 'ligature oe'],
|
bgneal@312
|
168 ['š', 'š', true, 's - caron'],
|
bgneal@312
|
169 ['ù', 'ù', true, 'u - grave'],
|
bgneal@312
|
170 ['ú', 'ú', true, 'u - acute'],
|
bgneal@312
|
171 ['û', 'û', true, 'u - circumflex'],
|
bgneal@312
|
172 ['ü', 'ü', true, 'u - diaeresis'],
|
bgneal@312
|
173 ['ý', 'ý', true, 'y - acute'],
|
bgneal@312
|
174 ['þ', 'þ', true, 'thorn'],
|
bgneal@312
|
175 ['ÿ', 'ÿ', true, 'y - diaeresis'],
|
bgneal@442
|
176 ['Α', 'Α', true, 'Alpha'],
|
bgneal@312
|
177 ['Β', 'Β', true, 'Beta'],
|
bgneal@312
|
178 ['Γ', 'Γ', true, 'Gamma'],
|
bgneal@312
|
179 ['Δ', 'Δ', true, 'Delta'],
|
bgneal@312
|
180 ['Ε', 'Ε', true, 'Epsilon'],
|
bgneal@312
|
181 ['Ζ', 'Ζ', true, 'Zeta'],
|
bgneal@312
|
182 ['Η', 'Η', true, 'Eta'],
|
bgneal@312
|
183 ['Θ', 'Θ', true, 'Theta'],
|
bgneal@312
|
184 ['Ι', 'Ι', true, 'Iota'],
|
bgneal@312
|
185 ['Κ', 'Κ', true, 'Kappa'],
|
bgneal@312
|
186 ['Λ', 'Λ', true, 'Lambda'],
|
bgneal@312
|
187 ['Μ', 'Μ', true, 'Mu'],
|
bgneal@312
|
188 ['Ν', 'Ν', true, 'Nu'],
|
bgneal@312
|
189 ['Ξ', 'Ξ', true, 'Xi'],
|
bgneal@312
|
190 ['Ο', 'Ο', true, 'Omicron'],
|
bgneal@312
|
191 ['Π', 'Π', true, 'Pi'],
|
bgneal@312
|
192 ['Ρ', 'Ρ', true, 'Rho'],
|
bgneal@312
|
193 ['Σ', 'Σ', true, 'Sigma'],
|
bgneal@312
|
194 ['Τ', 'Τ', true, 'Tau'],
|
bgneal@312
|
195 ['Υ', 'Υ', true, 'Upsilon'],
|
bgneal@312
|
196 ['Φ', 'Φ', true, 'Phi'],
|
bgneal@312
|
197 ['Χ', 'Χ', true, 'Chi'],
|
bgneal@312
|
198 ['Ψ', 'Ψ', true, 'Psi'],
|
bgneal@312
|
199 ['Ω', 'Ω', true, 'Omega'],
|
bgneal@312
|
200 ['α', 'α', true, 'alpha'],
|
bgneal@312
|
201 ['β', 'β', true, 'beta'],
|
bgneal@312
|
202 ['γ', 'γ', true, 'gamma'],
|
bgneal@312
|
203 ['δ', 'δ', true, 'delta'],
|
bgneal@312
|
204 ['ε', 'ε', true, 'epsilon'],
|
bgneal@312
|
205 ['ζ', 'ζ', true, 'zeta'],
|
bgneal@312
|
206 ['η', 'η', true, 'eta'],
|
bgneal@312
|
207 ['θ', 'θ', true, 'theta'],
|
bgneal@312
|
208 ['ι', 'ι', true, 'iota'],
|
bgneal@312
|
209 ['κ', 'κ', true, 'kappa'],
|
bgneal@312
|
210 ['λ', 'λ', true, 'lambda'],
|
bgneal@312
|
211 ['μ', 'μ', true, 'mu'],
|
bgneal@312
|
212 ['ν', 'ν', true, 'nu'],
|
bgneal@312
|
213 ['ξ', 'ξ', true, 'xi'],
|
bgneal@312
|
214 ['ο', 'ο', true, 'omicron'],
|
bgneal@312
|
215 ['π', 'π', true, 'pi'],
|
bgneal@312
|
216 ['ρ', 'ρ', true, 'rho'],
|
bgneal@312
|
217 ['ς', 'ς', true, 'final sigma'],
|
bgneal@312
|
218 ['σ', 'σ', true, 'sigma'],
|
bgneal@312
|
219 ['τ', 'τ', true, 'tau'],
|
bgneal@312
|
220 ['υ', 'υ', true, 'upsilon'],
|
bgneal@312
|
221 ['φ', 'φ', true, 'phi'],
|
bgneal@312
|
222 ['χ', 'χ', true, 'chi'],
|
bgneal@312
|
223 ['ψ', 'ψ', true, 'psi'],
|
bgneal@312
|
224 ['ω', 'ω', true, 'omega'],
|
bgneal@312
|
225 // symbols
|
bgneal@312
|
226 ['ℵ', 'ℵ', false,'alef symbol'],
|
bgneal@312
|
227 ['ϖ', 'ϖ', false,'pi symbol'],
|
bgneal@312
|
228 ['ℜ', 'ℜ', false,'real part symbol'],
|
bgneal@312
|
229 ['ϑ','ϑ', false,'theta symbol'],
|
bgneal@312
|
230 ['ϒ', 'ϒ', false,'upsilon - hook symbol'],
|
bgneal@312
|
231 ['℘', '℘', false,'Weierstrass p'],
|
bgneal@312
|
232 ['ℑ', 'ℑ', false,'imaginary part'],
|
bgneal@312
|
233 // arrows
|
bgneal@312
|
234 ['←', '←', true, 'leftwards arrow'],
|
bgneal@312
|
235 ['↑', '↑', true, 'upwards arrow'],
|
bgneal@312
|
236 ['→', '→', true, 'rightwards arrow'],
|
bgneal@312
|
237 ['↓', '↓', true, 'downwards arrow'],
|
bgneal@312
|
238 ['↔', '↔', true, 'left right arrow'],
|
bgneal@312
|
239 ['↵', '↵', false,'carriage return'],
|
bgneal@312
|
240 ['⇐', '⇐', false,'leftwards double arrow'],
|
bgneal@312
|
241 ['⇑', '⇑', false,'upwards double arrow'],
|
bgneal@312
|
242 ['⇒', '⇒', false,'rightwards double arrow'],
|
bgneal@312
|
243 ['⇓', '⇓', false,'downwards double arrow'],
|
bgneal@312
|
244 ['⇔', '⇔', false,'left right double arrow'],
|
bgneal@312
|
245 ['∴', '∴', false,'therefore'],
|
bgneal@312
|
246 ['⊂', '⊂', false,'subset of'],
|
bgneal@312
|
247 ['⊃', '⊃', false,'superset of'],
|
bgneal@312
|
248 ['⊄', '⊄', false,'not a subset of'],
|
bgneal@312
|
249 ['⊆', '⊆', false,'subset of or equal to'],
|
bgneal@312
|
250 ['⊇', '⊇', false,'superset of or equal to'],
|
bgneal@312
|
251 ['⊕', '⊕', false,'circled plus'],
|
bgneal@312
|
252 ['⊗', '⊗', false,'circled times'],
|
bgneal@312
|
253 ['⊥', '⊥', false,'perpendicular'],
|
bgneal@312
|
254 ['⋅', '⋅', false,'dot operator'],
|
bgneal@312
|
255 ['⌈', '⌈', false,'left ceiling'],
|
bgneal@312
|
256 ['⌉', '⌉', false,'right ceiling'],
|
bgneal@312
|
257 ['⌊', '⌊', false,'left floor'],
|
bgneal@312
|
258 ['⌋', '⌋', false,'right floor'],
|
bgneal@312
|
259 ['⟨', '〈', false,'left-pointing angle bracket'],
|
bgneal@312
|
260 ['⟩', '〉', false,'right-pointing angle bracket'],
|
bgneal@442
|
261 ['◊', '◊', true, 'lozenge'],
|
bgneal@442
|
262 ['♠', '♠', true, 'black spade suit'],
|
bgneal@312
|
263 ['♣', '♣', true, 'black club suit'],
|
bgneal@312
|
264 ['♥', '♥', true, 'black heart suit'],
|
bgneal@312
|
265 ['♦', '♦', true, 'black diamond suit'],
|
bgneal@312
|
266 [' ', ' ', false,'en space'],
|
bgneal@312
|
267 [' ', ' ', false,'em space'],
|
bgneal@312
|
268 [' ', ' ', false,'thin space'],
|
bgneal@312
|
269 ['‌', '‌', false,'zero width non-joiner'],
|
bgneal@312
|
270 ['‍', '‍', false,'zero width joiner'],
|
bgneal@312
|
271 ['‎', '‎', false,'left-to-right mark'],
|
bgneal@312
|
272 ['‏', '‏', false,'right-to-left mark'],
|
bgneal@312
|
273 ['­', '­', false,'soft hyphen']
|
bgneal@312
|
274 ];
|
bgneal@312
|
275
|
bgneal@312
|
276 tinyMCEPopup.onInit.add(function() {
|
bgneal@312
|
277 tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
|
bgneal@442
|
278 addKeyboardNavigation();
|
bgneal@312
|
279 });
|
bgneal@312
|
280
|
bgneal@442
|
281 function addKeyboardNavigation(){
|
bgneal@442
|
282 var tableElm, cells, settings;
|
bgneal@442
|
283
|
bgneal@442
|
284 cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup");
|
bgneal@442
|
285
|
bgneal@442
|
286 settings ={
|
bgneal@442
|
287 root: "charmapgroup",
|
bgneal@442
|
288 items: cells
|
bgneal@442
|
289 };
|
bgneal@442
|
290
|
bgneal@442
|
291 tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
|
bgneal@442
|
292 }
|
bgneal@442
|
293
|
bgneal@312
|
294 function renderCharMapHTML() {
|
bgneal@312
|
295 var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
|
bgneal@442
|
296 var html = '<div id="charmapgroup" aria-labelledby="charmap_label" tabindex="0" role="listbox">'+
|
bgneal@442
|
297 '<table role="presentation" border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) +
|
bgneal@442
|
298 '"><tr height="' + tdHeight + '">';
|
bgneal@312
|
299 var cols=-1;
|
bgneal@312
|
300
|
bgneal@312
|
301 for (i=0; i<charmap.length; i++) {
|
bgneal@442
|
302 var previewCharFn;
|
bgneal@442
|
303
|
bgneal@312
|
304 if (charmap[i][2]==true) {
|
bgneal@312
|
305 cols++;
|
bgneal@442
|
306 previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
|
bgneal@312
|
307 html += ''
|
bgneal@312
|
308 + '<td class="charmap">'
|
bgneal@442
|
309 + '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
|
bgneal@312
|
310 + charmap[i][1]
|
bgneal@312
|
311 + '</a></td>';
|
bgneal@312
|
312 if ((cols+1) % charsPerRow == 0)
|
bgneal@312
|
313 html += '</tr><tr height="' + tdHeight + '">';
|
bgneal@312
|
314 }
|
bgneal@312
|
315 }
|
bgneal@312
|
316
|
bgneal@312
|
317 if (cols % charsPerRow > 0) {
|
bgneal@312
|
318 var padd = charsPerRow - (cols % charsPerRow);
|
bgneal@312
|
319 for (var i=0; i<padd-1; i++)
|
bgneal@312
|
320 html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';
|
bgneal@312
|
321 }
|
bgneal@312
|
322
|
bgneal@442
|
323 html += '</tr></table></div>';
|
bgneal@442
|
324 html = html.replace(/<tr height="20"><\/tr>/g, '');
|
bgneal@312
|
325
|
bgneal@312
|
326 return html;
|
bgneal@312
|
327 }
|
bgneal@312
|
328
|
bgneal@312
|
329 function insertChar(chr) {
|
bgneal@312
|
330 tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
|
bgneal@312
|
331
|
bgneal@312
|
332 // Refocus in window
|
bgneal@312
|
333 if (tinyMCEPopup.isWindow)
|
bgneal@312
|
334 window.focus();
|
bgneal@312
|
335
|
bgneal@312
|
336 tinyMCEPopup.editor.focus();
|
bgneal@312
|
337 tinyMCEPopup.close();
|
bgneal@312
|
338 }
|
bgneal@312
|
339
|
bgneal@312
|
340 function previewChar(codeA, codeB, codeN) {
|
bgneal@312
|
341 var elmA = document.getElementById('codeA');
|
bgneal@312
|
342 var elmB = document.getElementById('codeB');
|
bgneal@312
|
343 var elmV = document.getElementById('codeV');
|
bgneal@312
|
344 var elmN = document.getElementById('codeN');
|
bgneal@312
|
345
|
bgneal@312
|
346 if (codeA=='#160;') {
|
bgneal@312
|
347 elmV.innerHTML = '__';
|
bgneal@312
|
348 } else {
|
bgneal@312
|
349 elmV.innerHTML = '&' + codeA;
|
bgneal@312
|
350 }
|
bgneal@312
|
351
|
bgneal@312
|
352 elmB.innerHTML = '&' + codeA;
|
bgneal@312
|
353 elmA.innerHTML = '&' + codeB;
|
bgneal@312
|
354 elmN.innerHTML = codeN;
|
bgneal@312
|
355 }
|