UNPKG

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

41 lines (30 loc) 1.48 kB
<html> <head> <script type="text/javascript" language="javascript" src="jsme/jsme.nocache.js"></script> <script> function atomHighLight(molIndex, atomIndex) { document.getElementById("atomHighLightTextAreaOut").value = atomIndex; } //this function will be called after the JavaScriptApplet code has been loaded. function jsmeOnLoad() { jsmeApplet = new JSApplet.JSME("jsme_container", "180px", "140px", { "options" : "depictAction star" }); jsmeApplet.setNotifyAtomHighLightChangeJSfunction("atomHighLight"); var jme = "16 17 C 7.37 -8.99 C 7.37 -7.59 C 6.16 -6.89 C 4.95 -7.59 C 4.95 -8.99 C 6.16 -9.69 N 8.58 -6.89 C 8.58 -5.49 C 7.37 -4.79 O 6.16 -5.49 C 9.80 -7.59 O 9.80 -8.99 C 11.01 -6.89 Cl 12.22 -7.59 Cl 11.01 -5.49 C 9.80 -4.79 1 2 1 2 3 2 3 4 1 4 5 2 5 6 1 6 1 2 7 8 1 8 9 1 9 10 1 3 10 1 2 7 1 7 11 1 11 12 2 11 13 1 13 14 1 13 15 1 8 16 1"; jsmeApplet.readMolecule(jme); var actionMarked = 105; jsmeApplet.setAction(actionMarked); jsmeApplet.setAfterStructureModifiedCallback(function(event) {event.src.setAction(actionMarked);}); } </script> </head> <body bgcolor="#E6E6FA"> <h2>Depict mode with setNotifyAtomHighLightChangeJSfunction and the star option enabled</h2> <div id="jsme_container"></div> <br> Atom highlighted by mouse over:<textarea id="atomHighLightTextAreaOut" rows="1" cols="3"></textarea> <hr> <br> </body> </html>