Annotation of loncom/html/adm/dragmath/applet/FCKEditMathPopup.html, revision 1.2

1.2     ! raeburn     1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        !             2: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1.1       foxr        3: <head>
1.2     ! raeburn     4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1.1       foxr        5: 
1.2     ! raeburn     6: <title>DragMath Formula Editor -- for CKeditor</title>
1.1       foxr        7: 
1.2     ! raeburn     8: <script type="text/javascript">
        !             9: // <![CDATA[
1.1       foxr       10: function insertAtCursor(doc, myField, myValue) {
                     11: 		//IE support
                     12: 		if (doc.selection) {
                     13: 			myField.focus();
                     14: 			sel = doc.selection.createRange();
                     15: 			sel.text = myValue;
                     16: 		}
                     17: 		//MOZILLA/NETSCAPE support
                     18: 		else if (myField.selectionStart || myField.selectionStart == '0') {
                     19: 			var startPos = myField.selectionStart;
                     20: 			var endPos = myField.selectionEnd;
                     21: 			myField.value = myField.value.substring(0, startPos)
                     22: 			+ myValue + '\n\n'
                     23: 			+ myField.value.substring(endPos, myField.value.length);
                     24: 		} else {
                     25: 			myField.value += myValue;
                     26: 		}
                     27: 	}
                     28: 
                     29: function renderLatex() {
                     30:   var ans = document.DragMath.getMathExpression();  
                     31:   var source = '$'
                     32:          + ans
                     33:          + '$';
                     34: 
                     35:   var Api    = window.opener.FCKEditorAPI;
                     36:   var FCK    = Api.GetInstance(opener.targetEntry);
                     37:   var doc    = FCK.EditorDocument;
                     38:   var target = FCK.EditorWindow;
                     39: 
                     40:   insertAtCursor(doc, target, source);
                     41: 
                     42:   window.close();
                     43: 
                     44:  
                     45: }
1.2     ! raeburn    46: // ]]>
1.1       foxr       47: </script>
                     48: 
                     49: </head>
                     50: <body>
                     51: 
1.2     ! raeburn    52: <div id="mainContent" style="text-align:left; font-family:arial,sans-serif; font-size:large; color:#000080">
        !            53: <span style="font-weight:bold;">DragMath Latex Equation Editor</span></div>
        !            54: <br /><br />
        !            55: 
        !            56: <applet name="DragMath" codebase="applet" code="Display.MainApplet.class" archive="DragMath.jar" width="540" height="333">
        !            57: <param name="language" value="en" />
        !            58: <param name="showOutputToolBar" value="false" />
        !            59: <param name="outputFormat" value="Latex" />
1.1       foxr       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 >
1.2     ! raeburn    62: <br />
1.1       foxr       63: 
1.2     ! raeburn    64: <form action="">
1.1       foxr       65: <input type='button' value='Render Latex' onclick='renderLatex(); return true;' />
                     66: </form>
                     67: 
                     68: </body>
                     69: </html>

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