aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-08-30 00:52:21 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-08-30 00:52:21 +0530
commitfa9a26deb28c8d8ec4f1650183f19ddbd4de4ff6 (patch)
tree280f11b6d415cb563fbb1693e637158cf6fa31b2 /app/templates
parent29798c7351ec3e3c6a13f40b4f80e804ec803006 (diff)
added Molecule Editor
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/home.html1
-rw-r--r--app/templates/molecule_editor.html51
2 files changed, 52 insertions, 0 deletions
diff --git a/app/templates/home.html b/app/templates/home.html
index 43a84cc..bf4cf32 100644
--- a/app/templates/home.html
+++ b/app/templates/home.html
@@ -23,6 +23,7 @@
<h3>Misc.</h3>
<ul>
+ <li><a href="{{url_for('editor')}}">Editor</a> - Simple Molecular Editor powered by Kekule.js</li>
<li><a href="{{ url_for('status')}}">Job Status</a> - Check the job status </li>
<li><a href="{{ url_for('visualise')}}">Visualise</a> - Molecular Viewer </li>
</ul>
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