Add language in config for monaco

This commit is contained in:
Alexey Koshelev
2025-05-05 21:32:19 +03:00
parent 697bdc8f44
commit d7b6450299
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,8 @@
(function(window, document) {
/*
* config = {
* editorType: 'cell'/'slide'/'word'
* editorType: 'cell'/'slide'/'word',
* language: 'javascript'/'vba'
* events: {
* onChangeValue // text in editor is changed
* onEditorReady // editor is ready for use
@ -132,7 +133,8 @@
iframe.frameBorder = 0;
iframe.scrolling = "no";
iframe.src = getBasePath() + 'MonacoEditor.html' + (config.editorType ? '?editorType=' + config.editorType : '')
+ (config.theme ? '&editorTheme=' + config.theme : '');
+ (config.theme ? '&editorTheme=' + config.theme : '')
+ (config.language ? '&language=' + config.language : '');
return iframe;
}

View File

@ -68,6 +68,7 @@
var config = {
editorType: 'word',
theme: 'light',
language: 'javascript',
value: '',
events: {
onChangeValue: onChangeValue,