mathjax.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /**
  2. * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. 'use strict';
  6. CKEDITOR.dialog.add( 'asciimath', function( editor ) {
  7. var preview,
  8. lang = editor.lang.asciimath;
  9. var imagePath = CKEDITOR.plugins.getPath('asciimath') + "images/";
  10. return {
  11. title: lang.title,
  12. minWidth: 350,
  13. minHeight: 100,
  14. contents: [
  15. {
  16. id: 'info',
  17. elements: [
  18. {
  19. id: 'equation',
  20. type: 'textarea',
  21. label: lang.dialogInput,
  22. class: 'asciimath_textarea',
  23. onLoad: function( widget ) {
  24. var that = this;
  25. if ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) {
  26. this.getInputElement().on( 'keyup', function() {
  27. // Add ` and ` for preview.
  28. preview.setValue( '`' + that.getInputElement().getValue() + '`' );
  29. } );
  30. $('.Hand').on('click', function() {
  31. preview.setValue( '`' + that.getInputElement().getValue() + '`' );
  32. });
  33. }
  34. },
  35. setup: function( widget ) {
  36. // Remove ` and `.
  37. this.setValue( CKEDITOR.plugins.asciimath.trim( widget.data.math ) );
  38. },
  39. commit: function( widget ) {
  40. // Add ` and ` to make ASCII be parsed by MathJax by default.
  41. widget.setData( 'math', '`' + this.getValue() + '`' );
  42. }
  43. },
  44. {
  45. id: 'clickInput',
  46. type: 'html',
  47. html:
  48. '<style type="text/css">'+
  49. 'body, td, input, textarea, select, label, button { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; }' +
  50. 'form { padding: 0px; margin: 0px; }' +
  51. 'form p { margin-top: 5px; margin-bottom: 5px; }' +
  52. '#clickInput' +
  53. '{' +
  54. 'width: 100%;' +
  55. 'border-collapse: collapse;' +
  56. 'background-color: white;' +
  57. 'text-align: center;' +
  58. '}' +
  59. '#clickInput td' +
  60. '{' +
  61. 'border: 1px solid gray;' +
  62. 'font-size: 1.1em;' +
  63. '}' +
  64. '#clickInput img' +
  65. '{' +
  66. 'cursor: pointer;' +
  67. '}' +
  68. '.Hand' +
  69. '{' +
  70. 'cursor: pointer;' +
  71. '}' +
  72. '</style>'+
  73. '<table id="clickInput">' +
  74. '<tr>' +
  75. '<td colspan="3" class="Hand" title="(x+1)/(x-1)" onclick="javascript: Set(\'(x+1)/(x-1)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'x1x1.png" /></td>' +
  76. '<td colspan="2" class="Hand" title="x^(m+n)" onclick="javascript: Set(\'x^(m+n)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'xmn.png" /></td>' +
  77. '<td colspan="2" class="Hand" title="x_(mn)" onclick="javascript: Set(\'x_(mn)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'x_mn.png" /></td>' +
  78. '<td colspan="2" class="Hand" title="sqrt(x)" onclick="javascript: Set(\'sqrt(x)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'sqrtx.png" /></td>' +
  79. '<td colspan="3" class="Hand" title="root(n)(x)" onclick="javascript: Set(\'root(n)(x)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rootnx.png" /></td>' +
  80. '<td colspan="3" class="Hand" title="{(1 if x&gt;=0),(0 if x&lt;0):}" onclick="javascript: Set(\'{(1 if x&gt;=0),(0 if x&lt;0):}\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ifx.png" /></td>' +
  81. '<td colspan="2" class="Hand" title="&quot;text&quot;" onclick="javascript: Set(\'&quot;text&quot;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'text.png" /></td>' +
  82. '</tr><tr>' +
  83. '<td colspan="2" class="Hand" title="dy/dx" onclick="javascript: Set(\'dy/dx\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'dydx.png" /></td>' +
  84. '<td colspan="3" class="Hand" title="lim_(x-&gt;oo)" onclick="javascript: Set(\'lim_(x-&gt;oo)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'lim.png" /></td>' +
  85. '<td colspan="3" class="Hand" title="sum_(n=1)^oo" onclick="javascript: Set(\'sum_(n=1)^oo\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'sumn.png" /></td>' +
  86. '<td colspan="3" class="Hand" title="int_a^bf(x)dx" onclick="javascript: Set(\'int_a^bf(x)dx\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'intab.png" /></td>' +
  87. '<td colspan="3" class="Hand" title="[[a,b],[c,d]]" onclick="javascript: Set(\'[[a,b],[c,d]]\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'abcd.png" /></td>' +
  88. '<td colspan="2" class="Hand" title="((n),(k))" onclick="javascript: Set(\'((n),(k))\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'nk.png" /></td>' +
  89. '</tr><tr>' +
  90. '<td class="Hand" title="*" onclick="javascript: Set(\'*\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'dot.png" /></td>' +
  91. '<td class="Hand" title="**" onclick="javascript: Set(\'**\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'star.png" /></td>' +
  92. '<td class="Hand" title="//" onclick="javascript: Set(\'//\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'slash.png" /></td>' +
  93. '<td class="Hand" title="\\" onclick="javascript: Set(\'\\\\\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'backslash.png" /></td>' +
  94. '<td class="Hand" title="xx" onclick="javascript: Set(\'xx\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'times.png" /></td>' +
  95. '<td class="Hand" title="-:" onclick="javascript: Set(\'-:\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'div.png" /></td>' +
  96. '<td class="Hand" title="@" onclick="javascript: Set(\'@\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'circ.png" /></td>' +
  97. '<td class="Hand" title="o+" onclick="javascript: Set(\'o+\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'oplus.png" /></td>' +
  98. '<td class="Hand" title="ox" onclick="javascript: Set(\'ox\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'otimes.png" /></td>' +
  99. '<td class="Hand" title="o." onclick="javascript: Set(\'o.\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'odot.png" /></td>' +
  100. '<td class="Hand" title="sum" onclick="javascript: Set(\'sum\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'sum.png" /></td>' +
  101. '<td class="Hand" title="prod" onclick="javascript: Set(\'prod\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'prod.png" /></td>' +
  102. '<td class="Hand" title="^^" onclick="javascript: Set(\'^^\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'wedge.png" /></td>' +
  103. '<td class="Hand" title="^^^" onclick="javascript: Set(\'^^^\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bigwedge.png" /></td>' +
  104. '<td class="Hand" title="vv" onclick="javascript: Set(\'vv\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'vee.png" /></td>' +
  105. '<td class="Hand" title="vvv" onclick="javascript: Set(\'vvv\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bigvee.png" /></td>' +
  106. '</tr><tr>' +
  107. '<td class="Hand" title="!=" onclick="javascript: Set(\'!=\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ne.png" /></td>' +
  108. '<td class="Hand" title="&lt;=" onclick="javascript: Set(\'&lt;=\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'le.png" /></td>' +
  109. '<td class="Hand" title="&gt;=" onclick="javascript: Set(\'&gt;=\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ge.png" /></td>' +
  110. '<td class="Hand" title="-&lt;" onclick="javascript: Set(\'-&lt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'prec.png" /></td>' +
  111. '<td class="Hand" title="&gt;-" onclick="javascript: Set(\'&gt;-\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'succ.png" /></td>' +
  112. '<td class="Hand" title="in" onclick="javascript: Set(\'in\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'in.png" /></td>' +
  113. '<td class="Hand" title="!in" onclick="javascript: Set(\'!in\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'notin.png" /></td>' +
  114. '<td class="Hand" title="sub" onclick="javascript: Set(\'sub\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'subset.png" /></td>' +
  115. '<td class="Hand" title="sup" onclick="javascript: Set(\'sup\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'supset.png" /></td>' +
  116. '<td class="Hand" title="sube" onclick="javascript: Set(\'sube\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'subseteq.png" /></td>' +
  117. '<td class="Hand" title="supe" onclick="javascript: Set(\'supe\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'supseteq.png" /></td>' +
  118. '<td class="Hand" title="O/" onclick="javascript: Set(\'O/\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'emptyset.png" /></td>' +
  119. '<td class="Hand" title="nn" onclick="javascript: Set(\'nn\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'cap.png" /></td>' +
  120. '<td class="Hand" title="nnn" onclick="javascript: Set(\'nnn\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bigcap.png" /></td>' +
  121. '<td class="Hand" title="uu" onclick="javascript: Set(\'uu\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'cup.png" /></td>' +
  122. '<td class="Hand" title="uuu" onclick="javascript: Set(\'uuu\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bigcup.png" /></td>' +
  123. '</tr><tr>' +
  124. '<td class="Hand" title="and" onclick="javascript: Set(\'and\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'text_and.png" /></td>' +
  125. '<td class="Hand" title="or" onclick="javascript: Set(\'or\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'text_or.png" /></td>' +
  126. '<td class="Hand" title="not" onclick="javascript: Set(\'not\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'not.png" /></td>' +
  127. '<td class="Hand" title="=&gt;" onclick="javascript: Set(\'=&gt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rightarrow.png" /></td>' +
  128. '<td class="Hand" title="if" onclick="javascript: Set(\'if\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'if.png" /></td>' +
  129. '<td class="Hand" title="&lt;=&gt;" onclick="javascript: Set(\'&lt;=&gt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'leftrightarrow.png" /></td>' +
  130. '<td class="Hand" title="AA" onclick="javascript: Set(\'AA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'forall.png" /></td>' +
  131. '<td class="Hand" title="EE" onclick="javascript: Set(\'EE\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'exists.png" /></td>' +
  132. '<td class="Hand" title="_|_" onclick="javascript: Set(\'_|_\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bot.png" /></td>' +
  133. '<td class="Hand" title="TT" onclick="javascript: Set(\'TT\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'top.png" /></td>' +
  134. '<td class="Hand" title="|--" onclick="javascript: Set(\'|--\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'vdash.png" /></td>' +
  135. '<td class="Hand" title="|==" onclick="javascript: Set(\'|==\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'models.png" /></td>' +
  136. '<td class="Hand" title="-=" onclick="javascript: Set(\'-=\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'equiv.png" /></td>' +
  137. '<td class="Hand" title="~=" onclick="javascript: Set(\'~=\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'cong.png" /></td>' +
  138. '<td class="Hand" title="~~" onclick="javascript: Set(\'~~\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'approx.png" /></td>' +
  139. '<td class="Hand" title="prop" onclick="javascript: Set(\'prop\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'propto.png" /></td>' +
  140. '</tr><tr>' +
  141. '<td class="Hand" title="int" onclick="javascript: Set(\'int\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'int.png" /></td>' +
  142. '<td class="Hand" title="oint" onclick="javascript: Set(\'oint\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'oint.png" /></td>' +
  143. '<td class="Hand" title="del" onclick="javascript: Set(\'del\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'partial.png" /></td>' +
  144. '<td class="Hand" title="grad" onclick="javascript: Set(\'grad\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'nabla.png" /></td>' +
  145. '<td class="Hand" title="+-" onclick="javascript: Set(\'+-\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'pm.png" /></td>' +
  146. '<td class="Hand" title="oo" onclick="javascript: Set(\'oo\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'infty.png" /></td>' +
  147. '<td class="Hand" title="A\ B (space between A and B)" onclick="javascript: Set(\'A\\ B\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'space.png" /></td>' +
  148. '<td class="Hand" title="AquadB (double space between A and B)" onclick="javascript: Set(\'AquadB\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'quad.png" /></td>' +
  149. '<td class="Hand" title="diamond" onclick="javascript: Set(\'diamond\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'diamond.png" /></td>' +
  150. '<td class="Hand" title="square" onclick="javascript: Set(\'square\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'square.png" /></td>' +
  151. '<td class="Hand" title="|__" onclick="javascript: Set(\'|__\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'lfloor.png" /></td>' +
  152. '<td class="Hand" title="__|" onclick="javascript: Set(\'__|\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rfloor.png" /></td>' +
  153. '<td class="Hand" title="|~" onclick="javascript: Set(\'|~\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'lceil.png" /></td>' +
  154. '<td class="Hand" title="~|" onclick="javascript: Set(\'~|\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rceil.png" /></td>' +
  155. '<td class="Hand" title="&lt;&lt;x&gt;&gt;" onclick="javascript: Set(\'&lt;&lt;x&gt;&gt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'braxcket.png" /></td>' +
  156. '<td class="Hand" title="/_" onclick="javascript: Set(\'/_\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'angle.png" /></td>' +
  157. '</tr><tr>' +
  158. '<td class="Hand" title="uarr" onclick="javascript: Set(\'uarr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'uarr.png" /></td>' +
  159. '<td class="Hand" title="darr" onclick="javascript: Set(\'darr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'darr.png" /></td>' +
  160. '<td class="Hand" title="larr" onclick="javascript: Set(\'larr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'larr.png" /></td>' +
  161. '<td class="Hand" title="-&gt;" onclick="javascript: Set(\'-&gt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rarr.png" /></td>' +
  162. '<td class="Hand" title="|-&gt;" onclick="javascript: Set(\'|-&gt;\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'mapsto.png" /></td>' +
  163. '<td class="Hand" title="harr" onclick="javascript: Set(\'harr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'harr.png" /></td>' +
  164. '<td class="Hand" title="lArr" onclick="javascript: Set(\'lArr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'llarr.png" /></td>' +
  165. '<td class="Hand" title="rArr" onclick="javascript: Set(\'rArr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rrarr.png" /></td>' +
  166. '<td class="Hand" title="hArr" onclick="javascript: Set(\'hArr\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'hharr.png" /></td>' +
  167. '<td class="Hand" title="hata" onclick="javascript: Set(\'hata\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'hata.png" /></td>' +
  168. '<td class="Hand" title="ula" onclick="javascript: Set(\'ula\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ula.png" /></td>' +
  169. '<td class="Hand" title="dota" onclick="javascript: Set(\'dota\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'dota.png" /></td>' +
  170. '<td class="Hand" title="ddota" onclick="javascript: Set(\'ddota\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ddota.png" /></td>' +
  171. '<td class="Hand" title="veca" onclick="javascript: Set(\'veca\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'veca.png" /></td>' +
  172. '<td class="Hand" title="bara" onclick="javascript: Set(\'bara\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bara.png" /></td>' +
  173. '<td class="Hand" title=":." onclick="javascript: Set(\':.\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'therefore.png" /></td>' +
  174. '</tr><tr>' +
  175. '<td class="Hand" title="NN" onclick="javascript: Set(\'NN\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'nn.png" /></td>' +
  176. '<td class="Hand" title="ZZ" onclick="javascript: Set(\'ZZ\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'zz.png" /></td>' +
  177. '<td class="Hand" title="QQ" onclick="javascript: Set(\'QQ\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'qq.png" /></td>' +
  178. '<td class="Hand" title="RR" onclick="javascript: Set(\'RR\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rr.png" /></td>' +
  179. '<td class="Hand" title="CC" onclick="javascript: Set(\'CC\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'cc.png" /></td>' +
  180. '<td class="Hand" title="bbA" onclick="javascript: Set(\'bbA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bba.png" /></td>' +
  181. '<td class="Hand" title="bbbA" onclick="javascript: Set(\'bbbA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'bbba.png" /></td>' +
  182. '<td class="Hand" title="ccA" onclick="javascript: Set(\'ccA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'cca.png" /></td>' +
  183. '<td class="Hand" title="frA" onclick="javascript: Set(\'frA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'fra.png" /></td>' +
  184. '<td class="Hand" title="sfA" onclick="javascript: Set(\'sfA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'sfa.png" /></td>' +
  185. '<td class="Hand" title="ttA" onclick="javascript: Set(\'ttA\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'tta.png" /></td>' +
  186. '<td colspan="3" class="Hand" title="stackrel(-&gt;)(+)" onclick="javascript: Set(\'stackrel(-&gt;)(+)\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'stackrel.png" /></td>' +
  187. '<td class="Hand" title="aleph" onclick="javascript: Set(\'aleph\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'aleph.png" /></td>' +
  188. '<td class="Hand" title="upsilon" onclick="javascript: Set(\'upsilon\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'upsilon.png" /></td>' +
  189. '</tr><tr>' +
  190. '<td class="Hand" title="alpha" onclick="javascript: Set(\'alpha\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'alpha.png" /></td>' +
  191. '<td class="Hand" title="beta" onclick="javascript: Set(\'beta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'beta.png" /></td>' +
  192. '<td class="Hand" title="gamma" onclick="javascript: Set(\'gamma\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'gamma.png" /></td>' +
  193. '<td class="Hand" title="Gamma" onclick="javascript: Set(\'Gamma\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ggamma.png" /></td>' +
  194. '<td class="Hand" title="delta" onclick="javascript: Set(\'delta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'delta.png" /></td>' +
  195. '<td class="Hand" title="Delta" onclick="javascript: Set(\'Delta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ddelta.png" /></td>' +
  196. '<td class="Hand" title="epsi" onclick="javascript: Set(\'epsi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'epsilon.png" /></td>' +
  197. '<td class="Hand" title="zeta" onclick="javascript: Set(\'zeta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'zeta.png" /></td>' +
  198. '<td class="Hand" title="eta" onclick="javascript: Set(\'eta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'eta.png" /></td>' +
  199. '<td class="Hand" title="theta" onclick="javascript: Set(\'theta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'theta.png" /></td>' +
  200. '<td class="Hand" title="Theta" onclick="javascript: Set(\'Theta\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ttheta.png" /></td>' +
  201. '<td class="Hand" title="iota" onclick="javascript: Set(\'iota\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'iota.png" /></td>' +
  202. '<td class="Hand" title="kappa" onclick="javascript: Set(\'kappa\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'kappa.png" /></td>' +
  203. '<td class="Hand" title="lambda" onclick="javascript: Set(\'lambda\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'lambda.png" /></td>' +
  204. '<td class="Hand" title="Lambda" onclick="javascript: Set(\'Lambda\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'llambda.png" /></td>' +
  205. '<td class="Hand" title="mu" onclick="javascript: Set(\'mu\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'mu.png" /></td>' +
  206. '</tr><tr>' +
  207. '<td class="Hand" title="nu" onclick="javascript: Set(\'nu\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'nu.png" /></td>' +
  208. '<td class="Hand" title="pi" onclick="javascript: Set(\'pi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'pi.png" /></td>' +
  209. '<td class="Hand" title="Pi" onclick="javascript: Set(\'Pi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ppi.png" /></td>' +
  210. '<td class="Hand" title="rho" onclick="javascript: Set(\'rho\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'rho.png" /></td>' +
  211. '<td class="Hand" title="sigma" onclick="javascript: Set(\'sigma\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'sigma.png" /></td>' +
  212. '<td class="Hand" title="Sigma" onclick="javascript: Set(\'Sigma\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ssigma.png" /></td>' +
  213. '<td class="Hand" title="tau" onclick="javascript: Set(\'tau\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'tau.png" /></td>' +
  214. '<td class="Hand" title="xi" onclick="javascript: Set(\'xi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'xi.png" /></td>' +
  215. '<td class="Hand" title="Xi" onclick="javascript: Set(\'Xi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'xxi.png" /></td>' +
  216. '<td class="Hand" title="phi" onclick="javascript: Set(\'phi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'phi.png" /></td>' +
  217. '<td class="Hand" title="Phi" onclick="javascript: Set(\'Phi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'pphi.png" /></td>' +
  218. '<td class="Hand" title="chi" onclick="javascript: Set(\'chi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'chi.png" /></td>' +
  219. '<td class="Hand" title="psi" onclick="javascript: Set(\'psi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'psi.png" /></td>' +
  220. '<td class="Hand" title="Psi" onclick="javascript: Set(\'Psi\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'ppsi.png" /></td>' +
  221. '<td class="Hand" title="omega" onclick="javascript: Set(\'omega\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'omega.png" /></td>' +
  222. '<td class="Hand" title="Omega" onclick="javascript: Set(\'Omega\');" onmouseover="javascript: over(this);" onmouseout="javascript: out(this);"><img src="'+imagePath+'oomega.png" /></td>' +
  223. '</tr>' +
  224. '</table>'
  225. },
  226. {
  227. id: 'documentation',
  228. type: 'html',
  229. html:
  230. '<div style="width:100%;text-align:right;margin:-8px 0 10px">' +
  231. '<a class="cke_mathjax_doc" href="' + lang.docUrl + '" target="_black" style="cursor:pointer;color:#00B2CE;text-decoration:underline">' +
  232. lang.docLabel +
  233. '</a>' +
  234. '</div>'
  235. },
  236. ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) && {
  237. id: 'preview',
  238. type: 'html',
  239. html:
  240. '<div style="width:100%;text-align:center;">' +
  241. '<iframe style="border:0;width:0;height:0;font-size:20px" scrolling="no" frameborder="0" allowTransparency="true" src="' + CKEDITOR.plugins.asciimath.fixSrc + '"></iframe>' +
  242. '</div>',
  243. onLoad: function( widget ) {
  244. var iFrame = CKEDITOR.document.getById( this.domId ).getChild( 0 );
  245. preview = new CKEDITOR.plugins.asciimath.frameWrapper( iFrame, editor );
  246. },
  247. setup: function( widget ) {
  248. preview.setValue( widget.data.math );
  249. }
  250. }
  251. ]
  252. }
  253. ]
  254. };
  255. } );
  256. // Highlighting formulas.
  257. function over(td)
  258. {
  259. td.className = 'LightBackground Hand' ;
  260. }
  261. function out(td)
  262. {
  263. td.className = 'Hand' ;
  264. }
  265. function Set( string )
  266. {
  267. var inputField = document.getElementsByClassName('asciimath_textarea')[0];
  268. inputField.value += string;
  269. return false;
  270. }