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, 10 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.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DragMath Formula Editor</title>

<script type="text/javascript">
// <![CDATA[
function insertAtCursor(doc, myField, myValue) {
		//IE support
		if (doc.selection) {
			myField.focus();
			sel = doc.selection.createRange();
			sel.text = myValue;
		}
		//MOZILLA/NETSCAPE support
		else if (myField.selectionStart || myField.selectionStart == '0') {
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			myField.value = myField.value.substring(0, startPos)
			+ myValue + '\n\n'
			+ myField.value.substring(endPos, myField.value.length);
		} else {
			myField.value += myValue;
		}
	}

function renderLatex() {
  var ans = document.DragMath.getMathExpression();  
  var source = '<m>$'
         + ans
         + '$</m>';


  var doc    = opener.targetDoc
  var target = doc.getElementById(opener.targetEntry);  
  insertAtCursor(doc, target, source);

  window.close();
}
// ]]>
</script>

</head>
<body>

<div id="mainContent" style="text-align:left; font-family:arial,sans-serif; font-size:large; color:#000080"> 
<span style="font-weight:bold;">DragMath Latex Equation Editor</span></div>
<br /><br />

<applet name="DragMath" codebase="applet" code="Display.MainApplet.class" archive="DragMath.jar" width="540" height="333">
<param name="language" value="en" />
<param name="showOutputToolBar" value="false" />
<param name="outputFormat" value="Latex" />
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>
</applet >
<br />

<form action="">
<input type='button' value='Render Latex' onclick='renderLatex(); return true;' />
</form>

</body>
</html>

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