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