source: tags/0.9beta/plugins/Equation/popups/dialog.html @ 643

Last change on this file since 643 was 643, checked in by ray, 13 years ago

Finally: The first Xinha release! see Ticket #902

File size: 13.9 KB
Line 
1<!DOCTYPE html
2     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6<head>
7  <title>AsciiMath Formula Input</title>
8  <script type="text/javascript" src="../../../popups/popup.js"></script>
9  <script type="text/javascript" src="../ASCIIMathML.js"></script>
10  <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
11
12  <style type="text/css">
13        #outputNode,#inputText {
14                padding:5px;
15                background-color:white;
16                width:230px;
17                height:200px;
18                font-size:1.3em;
19                border: 1px solid darkgrey;
20        }
21        #clickInput {
22                width:100%;
23                border-collapse:collapse;
24                background-color: white;
25                text-align:center;
26        }
27        #clickInput td {
28                border: thin solid gray;
29                cursor:pointer;
30                font-size:1.1em;
31               
32        }
33        h3 {
34                font-size:1.6em;
35        }
36  </style>
37  <script type="text/javascript">
38   window.resizeTo(500, 300);
39var showasciiformulaonhover = false;
40HTMLArea = window.opener.HTMLArea;
41
42function i18n(str) {
43  return (HTMLArea._lc(str, 'Equation'));
44}
45function set (string)
46{
47        var inputField = document.getElementById("inputText");
48        inputField.value += string;
49        preview();
50        inputField.focus();
51        return false;
52}
53function preview() {
54  if (document.getElementById("inputText") != '') {
55      var str = document.getElementById("inputText").value;
56      var outnode = document.getElementById("outputNode");
57      var newnode = AMcreateElementXHTML("div");
58      newnode.setAttribute("id","outputNode");
59      outnode.parentNode.replaceChild(newnode,outnode);
60      outnode = document.getElementById("outputNode");
61      var n = outnode.childNodes.length;
62      for (var i = 0; i < n; i++)
63        outnode.removeChild(outnode.firstChild);
64      outnode.appendChild(document.createComment("`"+str+"`"));
65      AMprocessNode(outnode,true);
66  }
67}
68function Init() {
69        __dlg_translate('Equation');
70        __dlg_init();
71        var param = window.dialogArguments;
72        var cfg = param["editor"].config;
73       
74        mathcolor = cfg.Equation.mathcolor;
75        mathfontfamily = cfg.Equation.mathfontfamily;
76       
77        var inputField = document.getElementById("inputText");
78       
79        if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'span')
80        {
81                var formula = param["editedNode"].getAttribute("title").replace(/^`*(.*?)`*$/m,"$1");;
82                inputField.value = formula;
83                preview();
84        }
85        else inputField.value = '';
86        inputField.focus();
87}
88 
89function onOK() {
90       
91 var param = {
92        "editedNode":window.dialogArguments.editedNode,
93        "formula" : document.getElementById("inputText").value
94 };
95 
96 __dlg_close(param);
97  return false;
98}
99
100function onCancel() {
101  __dlg_close(null);
102  return false;
103}
104
105function translate() {
106  if (!AMtranslated) { // run this only once
107    AMtranslated = true;
108    AMinitSymbols();
109    AMprocessNode(document.getElementById("clickInput"),true);
110    preview();
111  }
112}
113window.onload = Init;
114</script>
115
116</head>
117
118<body class="dialog">
119<div class="title">AsciiMath Formula Input</div>
120<!--
121Table modified from CharacterMap for ASCIIMathML by Peter Jipsen
122HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
123Original Author - Bernhard Pfeifer novocaine@gmx.net
124-->
125<table  id="clickInput">
126<tr>
127<td colspan="3" class="character" title="(x+1)/(x-1)" onclick="set('(x+1)/(x-1)')">`(x+1)/(x-1)`</td>
128<td colspan="2" class="character" title="x^(m+n)" onclick="set('x^(m+n)')">`x^(m+n)`</td>
129<td colspan="2" class="character" title="x_(mn)" onclick="set('x_(mn)')">`x_(mn)`</td>
130<td colspan="2" class="character" title="sqrt(x)" onclick="set('sqrt(x)')">`sqrt(x)`</td>
131<td colspan="3" class="character" title="root(n)(x)" onclick="set('root(n)(x)')">`root(n)(x)`</td>
132<td colspan="2" class="character" title="&quot;text&quot;" onclick="set('&quot;text&quot;')">`&quot;text&quot;`</td>
133<td colspan="2" class="character" style="cursor:default"></td>
134</tr><tr>
135<td colspan="2" class="character" title="dy/dx" onclick="set('dy/dx')">`dy/dx`</td>
136<td colspan="3" class="character" title="lim_(x-&gt;oo)" onclick="set('lim_(x-&gt;oo)')">`lim_(x-&gt;oo)`</td>
137<td colspan="3" class="character" title="sum_(n=1)^oo" onclick="set('sum_(n=1)^oo')">`sum_(n=1)^oo`</td>
138<td colspan="3" class="character" title="int_a^bf(x)dx" onclick="set('int_a^bf(x)dx')">`int_a^bf(x)dx`</td>
139<td colspan="3" class="character" title="[[a,b],[c,d]]" onclick="set('[[a,b],[c,d]]')">`[[a,b],[c,d]]`</td>
140<td colspan="2" class="character" title="((n),(k))" onclick="set('((n),(k))')">`((n),(k))`</td>
141</tr><tr>
142<td class="character" title="*" onclick="set('*')">`*`</td>
143<td class="character" title="**" onclick="set('**')">`**`</td>
144<td class="character" title="//" onclick="set('//')">`//`</td>
145<td class="character" title="\\" onclick="set('\\\\')">`\\`</td>
146<td class="character" title="xx" onclick="set('xx')">`xx`</td>
147<td class="character" title="-:" onclick="set('-:')">`-:`</td>
148<td class="character" title="@" onclick="set('@')">`@`</td>
149<td class="character" title="o+" onclick="set('o+')">`o+`</td>
150<td class="character" title="ox" onclick="set('ox')">`ox`</td>
151<td class="character" title="o." onclick="set('o.')">`o.`</td>
152<td class="character" title="sum" onclick="set('sum')">`sum`</td>
153<td class="character" title="prod" onclick="set('prod')">`prod`</td>
154<td class="character" title="^^" onclick="set('^^')">`^^`</td>
155<td class="character" title="^^^" onclick="set('^^^')"><font size="+1">`&and;`</font></td>
156<td class="character" title="vv" onclick="set('vv')">`vv`</td>
157<td class="character" title="vvv" onclick="set('vvv')"><font size="+1">`&or;`</font></td>
158</tr><tr>
159<td class="character" title="!=" onclick="set('!=')">`!=`</td>
160<td class="character" title="&lt;=" onclick="set('&lt;=')">`&lt;=`</td>
161<td class="character" title="&gt;=" onclick="set('&gt;=')">`&gt;=`</td>
162<td class="character" title="-&lt;" onclick="set('-&lt;')">`-&lt;`</td>
163<td class="character" title="&gt;-" onclick="set('&gt;-')">`&gt;-`</td>
164<td class="character" title="in" onclick="set('in')">`in`</td>
165<td class="character" title="!in" onclick="set('!in')">`!in`</td>
166<td class="character" title="sub" onclick="set('sub')">`sub`</td>
167<td class="character" title="sup" onclick="set('sup')">`sup`</td>
168<td class="character" title="sube" onclick="set('sube')">`sube`</td>
169<td class="character" title="supe" onclick="set('supe')">`supe`</td>
170<td class="character" title="O/" onclick="set('O/')">`O/`</td>
171<td class="character" title="nn" onclick="set('nn')">`nn`</td>
172<td class="character" title="nnn" onclick="set('nnn')"><font size="+1">`&cap;`</font></td>
173<td class="character" title="uu" onclick="set('uu')">`uu`</td>
174<td class="character" title="uuu" onclick="set('uuu')"><font size="+1">`&cup;`</font></td>
175</tr><tr>
176<td class="character" title="and" onclick="set('and')">`and`</td>
177<td class="character" title="or" onclick="set('or')">`or`</td>
178<td class="character" title="not" onclick="set('not')">`not`</td>
179<td class="character" title="=&gt;" onclick="set('==&gt;')">`=&gt;`</td>
180<td class="character" title="if" onclick="set('if')">`if`</td>
181<td class="character" title="&lt;=&gt;" onclick="set('&lt;=&gt;')">`&lt;=&gt;`</td>
182<td class="character" title="AA" onclick="set('AA')">`AA`</td>
183<td class="character" title="EE" onclick="set('EE')">`EE`</td>
184<td class="character" title="_|_" onclick="set('_|_')">`_|_`</td>
185<td class="character" title="TT" onclick="set('TT')">`TT`</td>
186<td class="character" title="|--" onclick="set('|--')">`|--`</td>
187<td class="character" title="|==" onclick="set('|==')">`|==`</td>
188<td class="character" title="-=" onclick="set('-=')">`-=`</td>
189<td class="character" title="~=" onclick="set('~=')">`~=`</td>
190<td class="character" title="~~" onclick="set('~~')">`~~`</td>
191<td class="character" title="prop" onclick="set('prop')">`prop`</td>
192</tr><tr>
193<td class="character" title="int" onclick="set('int')">`int`</td>
194<td class="character" title="oint" onclick="set('oint')">`oint`</td>
195<td class="character" title="del" onclick="set('del')">`del`</td>
196<td class="character" title="grad" onclick="set('grad')">`grad`</td>
197<td class="character" title="+-" onclick="set('+-')">`+-`</td>
198<td class="character" title="oo" onclick="set('oo')">`oo`</td>
199<td class="character" title="aleph" onclick="set('aleph')">`aleph`</td>
200<td class="character" title="quad" onclick="set('quad')">`quad`</td>
201<td class="character" title="diamond" onclick="set('diamond')">`diamond`</td>
202<td class="character" title="square" onclick="set('square')">`square`</td>
203<td class="character" title="|__" onclick="set('|__')">`|__`</td>
204<td class="character" title="__|" onclick="set('__|')">`__|`</td>
205<td class="character" title="|~" onclick="set('|~')">`|~`</td>
206<td class="character" title="~|" onclick="set('~|')">`~|`</td>
207<td class="character" title="&lt;x&gt;" onclick="set('&lt;x&gt;')">`&lt;x&gt;`</td>
208<td class="character" title="/_" onclick="set('/_')">`/_`</td>
209</tr><tr>
210<td class="character" title="uarr" onclick="set('uarr')">`uarr`</td>
211<td class="character" title="darr" onclick="set('darr')">`darr`</td>
212<td class="character" title="larr" onclick="set('larr')">`larr`</td>
213<td class="character" title="-&gt;" onclick="set('-&gt;')">`-&gt;`</td>
214<td class="character" title="|-&gt;" onclick="set('|-&gt;')">`|-&gt;`</td>
215<td class="character" title="harr" onclick="set('harr')">`harr`</td>
216<td class="character" title="lArr" onclick="set('lArr')">`lArr`</td>
217<td class="character" title="rArr" onclick="set('rArr')">`rArr`</td>
218<td class="character" title="hArr" onclick="set('hArr')">`hArr`</td>
219<td class="character" title="hata" onclick="set('hat')">`hata`</td>
220<td class="character" title="ula" onclick="set('ul')">`ula`</td>
221<td class="character" title="dota" onclick="set('dot')">`dota`</td>
222<td class="character" title="ddota" onclick="set('ddot')">`ddota`</td>
223<td class="character" title="veca" onclick="set('vec')">`veca`</td>
224<td class="character" title="bara" onclick="set('bar')">`bara`</td>
225<td class="character" title=":." onclick="set(':.')">`:.`</td>
226</tr><tr>
227<td class="character" title="NN" onclick="set('NN')">`NN`</td>
228<td class="character" title="ZZ" onclick="set('ZZ')">`ZZ`</td>
229<td class="character" title="QQ" onclick="set('QQ')">`QQ`</td>
230<td class="character" title="RR" onclick="set('RR')">`RR`</td>
231<td class="character" title="CC" onclick="set('CC')">`CC`</td>
232<td class="character" title="bba" onclick="set('bb')">`bba`</td>
233<td class="character" title="bbba" onclick="set('bbb')">`bbba`</td>
234<td class="character" title="cca" onclick="set('cc')">`cca`</td>
235<td class="character" title="fra" onclick="set('fr')">`fra`</td>
236<td class="character" title="sfa" onclick="set('sf')">`sfa`</td>
237<td class="character" title="tta" onclick="set('tt')">`tta`</td>
238<td colspan="4" class="character" title="stackrel(-&gt;)(+)" onclick="set('stackrel(-&gt;)(+)')">`stackrel(-&gt;)(+)`</td>
239<td class="character" title="upsilon" onclick="set('upsilon')">`upsilon`</td>
240</tr><tr>
241<td class="character" title="alpha" onclick="set('alpha')">`alpha`</td>
242<td class="character" title="beta" onclick="set('beta')">`beta`</td>
243<td class="character" title="gamma" onclick="set('gamma')">`gamma`</td>
244<td class="character" title="Gamma" onclick="set('Gamma')">`Gamma`</td>
245<td class="character" title="delta" onclick="set('delta')">`delta`</td>
246<td class="character" title="Delta" onclick="set('Delta')">`Delta`</td>
247<td class="character" title="epsi" onclick="set('epsi')">`epsi`</td>
248<td class="character" title="zeta" onclick="set('zeta')">`zeta`</td>
249<td class="character" title="eta" onclick="set('eta')">`eta`</td>
250<td class="character" title="theta" onclick="set('theta')">`theta`</td>
251<td class="character" title="Theta" onclick="set('Theta')">`Theta`</td>
252<td class="character" title="iota" onclick="set('iota')">`iota`</td>
253<td class="character" title="kappa" onclick="set('kappa')">`kappa`</td>
254<td class="character" title="lambda" onclick="set('lambda')">`lambda`</td>
255<td class="character" title="Lambda" onclick="set('Lambda')">`Lambda`</td>
256<td class="character" title="mu" onclick="set('mu')">`mu`</td>
257</tr><tr>
258<td class="character" title="nu" onclick="set('nu')">`nu`</td>
259<td class="character" title="pi" onclick="set('pi')">`pi`</td>
260<td class="character" title="Pi" onclick="set('Pi')">`Pi`</td>
261<td class="character" title="rho" onclick="set('rho')">`rho`</td>
262<td class="character" title="sigma" onclick="set('sigma')">`sigma`</td>
263<td class="character" title="Sigma" onclick="set('Sigma')">`Sigma`</td>
264<td class="character" title="tau" onclick="set('tau')">`tau`</td>
265<td class="character" title="xi" onclick="set('xi')">`xi`</td>
266<td class="character" title="Xi" onclick="set('Xi')">`Xi`</td>
267<td class="character" title="phi" onclick="set('phi')">`phi`</td>
268<td class="character" title="Phi" onclick="set('Phi')">`Phi`</td>
269<td class="character" title="chi" onclick="set('chi')">`chi`</td>
270<td class="character" title="psi" onclick="set('psi')">`psi`</td>
271<td class="character" title="Psi" onclick="set('Psi')">`Psi`</td>
272<td class="character" title="omega" onclick="set('omega')">`omega`</td>
273<td class="character" title="Omega" onclick="set('Omega')">`Omega`</td>
274</tr>
275</table>
276<form action="javascript:void(0);">
277<table style="width: 100%;border:none">
278  <tr>
279    <td>Input</td><td>Preview</td>
280  </tr>
281  <tr>
282    <td>
283    <textarea id="inputText" onkeyup="preview()"></textarea>
284    </td>
285    <td>
286    <div id="outputNode"></div>
287    </td>
288  </tr>
289  <tr><td colspan="2">
290  <span>Based on ASCIIMathML by </span><a href="http://www.chapman.edu/~jipsen" target="new">Peter Jipsen</a>,
291<a href="http://www.chapman.edu" target="new">Chapman University</a><br />
292  <span>For more information on AsciiMathML visit this page: </span><a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html" onclick="window.open(this.href,'_blank','');return false;">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a></td></tr>
293</table>
294
295<div id="buttons">
296<span style="color:red">Attention: Editing the formula in the editor is not possible, please use this dialog!</span>
297  <button type="submit" name="ok" onclick="return onOK();">OK</button>
298  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
299</div>
300</form>
301</body>
302</html>
Note: See TracBrowser for help on using the repository browser.