diff --git a/course/templates/course/sandbox-markup.html b/course/templates/course/sandbox-markup.html index c588c6b90..040b2b69c 100644 --- a/course/templates/course/sandbox-markup.html +++ b/course/templates/course/sandbox-markup.html @@ -16,5 +16,41 @@

{% trans "Markup Sandbox" %}

{% crispy form %}
+ + {# {{{ paste from clipboard #} + + + + {# }}} #} + {% endblock %} diff --git a/course/templates/course/sandbox-page.html b/course/templates/course/sandbox-page.html index 65f8fc715..8a00070dd 100644 --- a/course/templates/course/sandbox-page.html +++ b/course/templates/course/sandbox-page.html @@ -85,21 +85,37 @@

{% trans "Page Sandbox" %}

- {# {{{ codemirror save -> preview #} + {# {{{ paste from clipboard #} {# }}} #} @@ -112,11 +128,11 @@

{% trans "Page Sandbox" %}

function force_cm_focus() { - $("div#div_id_content div.CodeMirror").each( - function () - { - this.CodeMirror.focus(); - }); + const editorDom = document.querySelector('#div_id_content .cm-editor'); + if (editorDom) { + const view = rlCodemirror.EditorView.findFromDOM(editorDom); + if (view) { view.focus(); } + } } setTimeout(force_cm_focus, 100);