<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "asciimath,asciimathcharmap,asciisvg",
theme_advanced_buttons2 : "",
theme_advanced_toolbar_location : "external",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "none",
plugins : 'safari,asciimath,asciisvg,table,inlinepopups',
AScgiloc : 'http://www.imathas.com/editordemo/php/svgimg.php', //change me
ASdloc : 'http://www.imathas.com/editordemo/jscripts/tiny_mce/plugins/asciisvg/js/d.svg', //change me
content_css : "css/content.css"
});
function displayTextarea()
{
document.getElementById("elm1_parent").style.display = "none";
document.getElementById("elm1").style.display = "block";
}
</script>
<!-- /TinyMCE -->
<style>
.mceExternalToolbar {
position: fixed !important ;
top: 28px !important;
display:none !important;
}
</style>
<body>
<form method="post" action="output.php">
<h3>TinyMCE Math/Graph Plugins Example</h3>
<p>
This page shows some buttons and plugins that are included in the TinyMCE core package, but is intended primarily to
demonstrate ASCIIMath and ASCIIsvg plugins for TinyMCE.
There are more examples on how to use TinyMCE in the <a href="http://wiki.moxiecode.com/examples/tinymce/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="2" cols="80" style="width: 50%">
<p>
Include text along with math equations like <span class="AM">`x=(-b+-sqrt(b^2-4ac))/(2a)`</span> in your documents
</p>
<p>
</textarea>
<div>
<!-- Some integration calls: the first two seem to be having issues with asciimath plugin
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a> -->
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onclick="show();">Show</a>
<a href="javascript:;" onclick="displayTextarea();">displayTextarea</a>
</div>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
</body>
</html>