Annotation of loncom/html/adm/dragmath/applet/EditMathPopup.html, revision 1.3

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: 
                     34:   var doc    = opener.targetDoc
                     35:   var target = doc.getElementById(opener.targetEntry);  
                     36:   insertAtCursor(doc, target, source);
                     37: 
                     38:   window.close();
1.1       foxr       39: 
                     40:  
                     41: }
                     42: </script>
                     43: 
                     44: </head>
                     45: <body>
                     46: 
                     47: <div id="mainContent">
                     48: 
                     49: 
                     50: <DIV align=left><FONT face=Arial color=#000080 
1.2       foxr       51: size=6><STRONG>DragMath Latex Equation Editor</STRONG></FONT></DIV>
1.1       foxr       52: <br><br>
                     53: 
                     54: <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>
                     55: <param name=language value="en">
                     56: <param name=showOutputToolBar value="false">
                     57: <param name=outputFormat value="Latex">
                     58: 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>
                     59: </applet >
                     60: <br>
                     61: 
                     62: <form>
                     63: <input type='button' value='Render Latex' onclick='renderLatex(); return true;' />
                     64: </form>
                     65: 
                     66: </body>
                     67: </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>