Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
1d48b2b8
Commit
1d48b2b8
authored
Mar 04, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monaco_editor: fix typescript errors
parent
2948b0f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
...ortal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
+23
-17
No files found.
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
View file @
1d48b2b8
...
...
@@ -3,6 +3,11 @@
(
function
(
window
,
rJS
,
monaco
)
{
'
use strict
'
;
// globals
const
JSLINT
=
window
[
'
JSLINT
'
];
const
prettier
=
window
[
'
prettier
'
];
const
prettierPlugins
=
window
[
'
prettierPlugins
'
];
rJS
(
window
)
.
declareAcquiredMethod
(
'
notifySubmit
'
,
'
notifySubmit
'
)
.
declareJob
(
'
deferNotifySubmit
'
,
function
()
{
...
...
@@ -14,15 +19,14 @@
// Ensure error will be correctly handled
return
this
.
notifyChange
();
})
.
ready
(
function
()
{
var
context
=
this
,
editor
;
.
ready
(
function
(
context
)
{
let
editor
;
function
deferNotifyChange
()
{
if
(
!
context
.
state
.
ignoredChangeDuringInitialization
)
{
return
context
.
deferNotifyChange
();
}
}
this
.
editor
=
editor
=
monaco
.
editor
.
create
(
context
.
editor
=
editor
=
monaco
.
editor
.
create
(
this
.
element
.
querySelector
(
'
.monaco-container
'
),
{
/* because Alt+Click is LeftClick on ChromeOS */
...
...
@@ -154,18 +158,20 @@
});
// Type mapping for Nexedi libraries
function
addExtraLibrary
(
script_name
,
lib_name
)
{
return
fetch
(
script_name
)
.
then
(
function
(
resp
)
{
return
resp
.
text
();
})
.
then
(
function
(
script_code
)
{
monaco
.
languages
.
typescript
.
javascriptDefaults
.
addExtraLib
(
script_code
,
lib_name
);
});
}
const
addExtraLibrary
=
function
(
script_name
,
lib_name
)
{
return
()
=>
{
return
fetch
(
script_name
)
.
then
(
function
(
resp
)
{
return
resp
.
text
();
})
.
then
(
function
(
script_code
)
{
monaco
.
languages
.
typescript
.
javascriptDefaults
.
addExtraLib
(
script_code
,
lib_name
);
});
};
};
queue
.
push
(
addExtraLibrary
(
'
./monaco-rsvp.d.ts
'
,
'
rsvp
'
))
.
push
(
addExtraLibrary
(
'
./monaco-renderjs.d.ts
'
,
'
renderjs
'
))
...
...
@@ -190,4 +196,4 @@
}
return
form_data
;
});
})(
window
,
rJS
,
monaco
);
})(
window
,
rJS
,
window
[
'
monaco
'
]
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment