diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-08-30 00:52:21 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-08-30 00:52:21 +0530 |
commit | fa9a26deb28c8d8ec4f1650183f19ddbd4de4ff6 (patch) | |
tree | 280f11b6d415cb563fbb1693e637158cf6fa31b2 /app/templates/molecule_editor.html | |
parent | 29798c7351ec3e3c6a13f40b4f80e804ec803006 (diff) |
added Molecule Editor
Diffstat (limited to 'app/templates/molecule_editor.html')
-rw-r--r-- | app/templates/molecule_editor.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app/templates/molecule_editor.html b/app/templates/molecule_editor.html new file mode 100644 index 0000000..026b7fe --- /dev/null +++ b/app/templates/molecule_editor.html @@ -0,0 +1,51 @@ +{% extends 'base.html' %} + +{% block main %} + +<h2>Molecule Editor</h2> + +<p>Powered by <a href="https://github.com/partridgejiang/Kekule.js">Kekule.js</a> + +<br> + + +<script src="https://cdn.jsdelivr.net/npm/kekule@0.9.3/dist/kekule.min.js?modules=chemWidget,algorithm&locals=en"></script> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/kekule.css') }}" /> + + <!-- + <script src="../../../src/kekule.js?modules=chemWidget,algorithm&min=false"></script> + <link rel="stylesheet" type="text/css" href="../../../src/widgets/themes/default/kekule.css" /> + --> + + <style> + #chemComposer + { + margin: 0; + } + </style> + +<div id="chemComposer" data-widget="Kekule.Editor.Composer" ></div> + +<script> + var chemEditor; + var chemComposer; + function init() + { + /* + var elem = document.getElementById('chemComposer'); + var chemEditor = new Kekule.Editor.ChemSpaceEditor(document, null, Kekule.Render.RendererType.R2D); + chemComposer = new Kekule.Editor.Composer(elem, chemEditor); + */ + chemComposer = Kekule.Widget.getWidgetById('chemComposer'); + chemComposer + .setEnableDimensionTransform(true) + .setAutoSetMinDimension(true) + .setAutoResizeConstraints({width: 0.75, height: 0.7}) + .autoResizeToClient(); // force a resize to window client + } + Kekule.X.domReady(init); + </script> + +<br> + +{% endblock %}
\ No newline at end of file |