mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Add language in config for monaco
This commit is contained in:
6
vendor/monaco/MonacoEditor.js
vendored
6
vendor/monaco/MonacoEditor.js
vendored
@ -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;
|
||||
}
|
||||
|
||||
1
vendor/monaco/example.html
vendored
1
vendor/monaco/example.html
vendored
@ -68,6 +68,7 @@
|
||||
var config = {
|
||||
editorType: 'word',
|
||||
theme: 'light',
|
||||
language: 'javascript',
|
||||
value: '',
|
||||
events: {
|
||||
onChangeValue: onChangeValue,
|
||||
|
||||
Reference in New Issue
Block a user