jsme
Version:
JSME is a free molecule editor written in JavaScript. JSME is a direct successor of the JME Molecule Editor applet. JSME supports drawing and editing of molecules and reactions on desktop computer, as well as on handheld devices including iPhone, iPad and
52 lines (42 loc) • 1.31 kB
HTML
<html>
<head>
<title>JME Example 2</title>
<script language="JavaScript">
var smiles = "";
var jme = "0 0";
function startEditor() {
window.open('jme_window.html','JME','width=500,height=450,scrollbars=no,resizable=yes');
}
function fromEditor(smiles,jme) {
// this function is called from jme_window
// editor fills variable smiles & jme
if (smiles=="") {
alert ("no molecule submitted");
return;
}
document.form.smiles.value = smiles;
}
function processMolecule() {
smiles = document.form.smiles.value;
if (smiles == "") {alert("Nothing to process!"); return;}
alert('submitting '+smiles+' for processing!');
// in actual application remove line above and add something like this
// document.form.submit();
}
</script>
</head>
<body BGCOLOR="#FFFFFF">
<H2>Example of Structure Input</H2>
<form method="post" name="form" action="http://your_machine/cgi-bin/your_script">
Press the Draw Molecule button, draw molecule and then press Submit Molecule button in the editor window.<P>
<input type="text" size=40 value="" name="smiles">
<INPUT TYPE="RESET" VALUE="Clear">
 
<input type="button" value="Draw Molecule" onClick="startEditor();">
<P>
<input type="button" value="Process Molecule" onClick="processMolecule();">
</form>
<P>
</body>
</html>