File:  [LON-CAPA] / loncom / html / adm / dragmath / applet / EditMathPopup.html
Revision 1.4: download - view: text, annotated - select for diffs
Sat Dec 28 23:15:35 2013 UTC (10 years, 8 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_11_X, version_2_11_5_msu, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0, HEAD
- Bug 6685
  - Sign DragMath .jar files with InCommon code-signing cert from MSU
    (expires Dec 4, 2014).
  - Update to DragMath 0.7.9
  - Installation mechanism now removes files from older DragMath version,
    and follows similar mechanism to one used for MathJax etc.
  - xhtml for EditMathPopup.html and MaximaPopup.html
  - codebase changed from classes to applet (DragMath change: 0.72 to 0.7.9).
    - EditMathPopup.html and MaximaPopup.html now installed in:
      /home/httpd/html/adm/dragmath (paths in response.pm and
      lonhtmlcommon.pm updated accordingly.

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

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