Commit a89c05c4 authored by Andrei Paskevich's avatar Andrei Paskevich

trywhy3: editor and task_viewer can have different modes

parent 31d1ddb8
......@@ -14,6 +14,8 @@
var load_embedded_files = false;
var editor_theme = "ace/theme/chrome";
var editor_mode = "ace/mode/why3";
var task_viewer_theme = "ace/theme/chrome";
var task_viewer_mode = "ace/mode/why3";
var library_index = "examples/index.txt";
</script>
<script defer="defer" type="text/javascript"
......
......@@ -179,12 +179,17 @@ module Editor =
let () =
let editor_theme : Js.js_string Js.t = get_global "editor_theme" in
let editor_mode : Js.js_string Js.t = get_global "editor_mode" in
let task_viewer_theme : Js.js_string Js.t = get_global "task_viewer_theme" in
let task_viewer_mode : Js.js_string Js.t = get_global "task_viewer_mode" in
ignore (JSU.(meth_call editor "setTheme" [| inject editor_theme |]));
ignore (JSU.(meth_call (get_session editor) "setMode" [| inject editor_mode |]));
JSU.(set editor (Js.string "$blockScrolling") _Infinity);
ignore (JSU.(meth_call task_viewer "setTheme" [| inject task_viewer_theme |]));
ignore (JSU.(meth_call (get_session task_viewer) "setMode" [| inject task_viewer_mode |]));
JSU.(set task_viewer (Js.string "$blockScrolling") _Infinity);
List.iter (fun e ->
ignore (JSU.(meth_call e "setTheme" [| inject editor_theme |]));
ignore (JSU.(meth_call (get_session e) "setMode" [| inject editor_mode |]));
JSU.(set e (Js.string "$blockScrolling") _Infinity)
) [ editor; task_viewer ];
JSU.(meth_call task_viewer "setReadOnly" [| inject Js._true|])
let undo () =
......
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