Files
moodle/lib/editor/common/dragmath/applet/MathML.html
T

65 lines
2.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DragMath MathML Example</title>
<script>
function renderMathML() {
var ans = document.DragMath.getMathExpression();
var source = '<?xml version="1.0"?>'
+ '<!DOCTYPE html PUBLIC'
+ ' "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"'
+ ' "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"'
+ '['
+ ' <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">'
+ ']>'
+ ''
+ '<body>'
+ ans
+ '</body>'
+ '';
var target = document.getElementById('outputID');
target.setAttribute('src','data:text/xml;charset=utf-8,' + escape(source));
}
function resetMathML() {
var source = 'The MathML rendering will appear here.';
var target = document.getElementById('outputID');
target.setAttribute('src','data:text/html,' + escape(source));
}
</script>
</head>
<body>
<div id="mainContent">
<DIV align=left><FONT face=Arial color=#000080
size=6><STRONG>DragMath MathML Example</STRONG></FONT></DIV>
<br><br>
<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>
<param name=language value="en">
<param name=outputFormat value="MathML">
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>
<input type='button' value='Render MathML' onclick='renderMathML(); return true;' />
</form>
<H2>MathML Rendering:</H2>
<iframe id='outputID' src='data:text/html' width='98%' height='150'>
You need a MathML-enabled Gecko-based browser.
</iframe>
</div>
<br>
JavaScript used for rendering from <a href="http://www.mozilla.org/projects/mathml/demo/tester.html">Mozilla website</a>, re-used under <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons License</a>
</body>
</html>