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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
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 @@
...
@@ -3,6 +3,11 @@
(
function
(
window
,
rJS
,
monaco
)
{
(
function
(
window
,
rJS
,
monaco
)
{
'
use strict
'
;
'
use strict
'
;
// globals
const
JSLINT
=
window
[
'
JSLINT
'
];
const
prettier
=
window
[
'
prettier
'
];
const
prettierPlugins
=
window
[
'
prettierPlugins
'
];
rJS
(
window
)
rJS
(
window
)
.
declareAcquiredMethod
(
'
notifySubmit
'
,
'
notifySubmit
'
)
.
declareAcquiredMethod
(
'
notifySubmit
'
,
'
notifySubmit
'
)
.
declareJob
(
'
deferNotifySubmit
'
,
function
()
{
.
declareJob
(
'
deferNotifySubmit
'
,
function
()
{
...
@@ -14,15 +19,14 @@
...
@@ -14,15 +19,14 @@
// Ensure error will be correctly handled
// Ensure error will be correctly handled
return
this
.
notifyChange
();
return
this
.
notifyChange
();
})
})
.
ready
(
function
()
{
.
ready
(
function
(
context
)
{
var
context
=
this
,
let
editor
;
editor
;
function
deferNotifyChange
()
{
function
deferNotifyChange
()
{
if
(
!
context
.
state
.
ignoredChangeDuringInitialization
)
{
if
(
!
context
.
state
.
ignoredChangeDuringInitialization
)
{
return
context
.
deferNotifyChange
();
return
context
.
deferNotifyChange
();
}
}
}
}
this
.
editor
=
editor
=
monaco
.
editor
.
create
(
context
.
editor
=
editor
=
monaco
.
editor
.
create
(
this
.
element
.
querySelector
(
'
.monaco-container
'
),
this
.
element
.
querySelector
(
'
.monaco-container
'
),
{
{
/* because Alt+Click is LeftClick on ChromeOS */
/* because Alt+Click is LeftClick on ChromeOS */
...
@@ -154,18 +158,20 @@
...
@@ -154,18 +158,20 @@
});
});
// Type mapping for Nexedi libraries
// Type mapping for Nexedi libraries
function
addExtraLibrary
(
script_name
,
lib_name
)
{
const
addExtraLibrary
=
function
(
script_name
,
lib_name
)
{
return
fetch
(
script_name
)
return
()
=>
{
.
then
(
function
(
resp
)
{
return
fetch
(
script_name
)
return
resp
.
text
();
.
then
(
function
(
resp
)
{
})
return
resp
.
text
();
.
then
(
function
(
script_code
)
{
})
monaco
.
languages
.
typescript
.
javascriptDefaults
.
addExtraLib
(
.
then
(
function
(
script_code
)
{
script_code
,
monaco
.
languages
.
typescript
.
javascriptDefaults
.
addExtraLib
(
lib_name
script_code
,
);
lib_name
});
);
}
});
};
};
queue
queue
.
push
(
addExtraLibrary
(
'
./monaco-rsvp.d.ts
'
,
'
rsvp
'
))
.
push
(
addExtraLibrary
(
'
./monaco-rsvp.d.ts
'
,
'
rsvp
'
))
.
push
(
addExtraLibrary
(
'
./monaco-renderjs.d.ts
'
,
'
renderjs
'
))
.
push
(
addExtraLibrary
(
'
./monaco-renderjs.d.ts
'
,
'
renderjs
'
))
...
@@ -190,4 +196,4 @@
...
@@ -190,4 +196,4 @@
}
}
return
form_data
;
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