Annotation of loncom/html/adm/dragmath/applet/EditMathPopup.html, revision 1.2
1.1 foxr 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html>
3: <head>
4:
1.2 ! foxr 5: <title>DragMath Equation Editor</title>
1.1 foxr 6:
7: <script>
1.2 ! foxr 8: function insertAtCursor(doc, myField, myValue) {
! 9: //IE support
! 10: if (doc.selection) {
! 11: myField.focus();
! 12: sel = doc.selection.createRange();
! 13: sel.text = myValue;
! 14: }
! 15: //MOZILLA/NETSCAPE support
! 16: else if (myField.selectionStart || myField.selectionStart == '0') {
! 17: var startPos = myField.selectionStart;
! 18: var endPos = myField.selectionEnd;
! 19: myField.value = myField.value.substring(0, startPos)
! 20: + myValue + '\n\n'
! 21: + myField.value.substring(endPos, myField.value.length);
! 22: } else {
! 23: myField.value += myValue;
! 24: }
! 25: }
! 26:
1.1 foxr 27: function renderLatex() {
28: var ans = document.DragMath.getMathExpression();
1.2 ! foxr 29: var source = '<m>$'
1.1 foxr 30: + ans
1.2 ! foxr 31: + '$</m>';
! 32:
! 33: // var target = document.getElementById('outputID');
! 34: // var doc = target.contentDocument;
! 35:
! 36: var doc = opener.targetDoc
! 37: var target = doc.getElementById(opener.targetEntry);
! 38: insertAtCursor(doc, target, source);
! 39:
! 40: window.close();
1.1 foxr 41:
42:
43: }
44: </script>
45:
46: </head>
47: <body>
48:
49: <div id="mainContent">
50:
51:
52: <DIV align=left><FONT face=Arial color=#000080
1.2 ! foxr 53: size=6><STRONG>DragMath Latex Equation Editor</STRONG></FONT></DIV>
1.1 foxr 54: <br><br>
55:
56: <applet name="DragMath" codebase="classes" code="Display.MainApplet.class" archive="Project.jar,AbsoluteLayout.jar,swing-layout-1.0.jar,jdom.jar,jep.jar" width=540 height=333>
57: <param name=language value="en">
58: <param name=showOutputToolBar value="false">
59: <param name=outputFormat value="Latex">
60: To use this page you need a Java-enabled browser. Download the latest Java plug-in from <a href="http://www.java.com">Java.com</a>
61: </applet >
62: <br>
63:
64: <form>
65: <input type='button' value='Render Latex' onclick='renderLatex(); return true;' />
66: </form>
67:
68: </body>
69: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>