Added the ability to save sketches

Implemented by exposing an RPC method to save the sketch and calling
from JS using `frappe.call`. Any logged-in user can create new sketches
and the owner can edit his/her own sketches.
This commit is contained in:
Anand Chitipothu
2021-03-10 12:25:14 +00:00
parent 936a3fcfff
commit 406244ff69
4 changed files with 112 additions and 14 deletions

View File

@@ -25,6 +25,8 @@
{% macro LiveCodeEditorJS(name, code) %}
<script type="text/javascript" src="{{ livecode_url }}/static/livecode.js"></script>
<script type="text/javascript">
var livecodeEditors = [];
$(function() {
$(".canvas-editor").each((i, e) => {
var editor = new LiveCodeEditor(e, {
@@ -32,6 +34,7 @@
base_url: "{{ livecode_url }}",
codemirror: true
})
livecodeEditors.push(editor);
})
})
</script>