Commit 0b395b62 authored by Jérome Perrin's avatar Jérome Perrin

monaco: pass script_name to the editor

parent d3d29dbe
......@@ -47,6 +47,7 @@
<script tal:content='python: "var textarea_selector=" + modules["json"].dumps(options.get("textarea_selector"))'>
</script>
<script tal:content='python: "var bound_names=" + modules["json"].dumps(options.get("bound_names"))'></script>
<script tal:content='python: "var script_name=" + modules["json"].dumps(options.get("script_name"))'></script>
<script
tal:content='python: "window.monacoEditorWebPackResourceBaseUrl = " + modules["json"].dumps(options["portal_url"]) + " + \"/monaco-editor/\""'>
......@@ -262,6 +263,7 @@ $script.onload = function() {
};
// ZMI python scripts pass extra parameters to linter
if (bound_names) {
complete_parameters["script_name"] = script_name;
complete_parameters["bound_names"] = JSON.parse(bound_names);
complete_parameters["params"] = document.querySelector(
'input[name="params"]'
......
......@@ -100,6 +100,7 @@ def manage_page_footer(self):
textarea_selector=textarea_selector,
portal_url=portal_url,
bound_names=bound_names,
script_name=document.getId(),
mode=mode).encode('utf-8'))
elif editor == 'ace':
return '''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment