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
Labels
Merge Requests
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d1413715
Commit
d1413715
authored
Jan 22, 2024
by
Jérome Perrin
Committed by
Arnaud Fontaine
Jul 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/SourceCodeEditorZMI: fix monaco editor integration on python3
parent
259257ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
product/ERP5Type/patches/SourceCodeEditorZMI.py
product/ERP5Type/patches/SourceCodeEditorZMI.py
+9
-5
No files found.
product/ERP5Type/patches/SourceCodeEditorZMI.py
View file @
d1413715
...
...
@@ -2,6 +2,7 @@ from App.Management import Navigation
from
ZODB.POSException
import
ConflictError
from
Acquisition
import
aq_parent
import
json
import
six
def
manage_page_footer
(
self
):
default
=
'</body></html>'
...
...
@@ -102,13 +103,16 @@ def manage_page_footer(self):
keymap
=
keymap
,
portal_type
=
portal_type
))
elif
editor
==
'monaco'
and
getattr
(
portal
,
'monaco_editor_support'
,
None
)
is
not
None
:
monaco_editor_support
=
portal
.
monaco_editor_support
(
textarea_selector
=
textarea_selector
,
portal_url
=
portal_url
,
bound_names
=
bound_names
,
mode
=
mode
)
if
six
.
PY2
:
monaco_editor_support
=
monaco_editor_support
.
encode
(
'utf-8'
)
return
'''%s
</body>
</html>'''
%
(
portal
.
monaco_editor_support
(
textarea_selector
=
textarea_selector
,
portal_url
=
portal_url
,
bound_names
=
bound_names
,
mode
=
mode
).
encode
(
'utf-8'
))
</html>'''
%
monaco_editor_support
elif
editor
in
(
None
,
'text_area'
)
and
mode
==
'python'
:
# Set Zope4's default ace editor indent size to 2.
return
'''<script type="text/javascript">$(function(){if(typeof ace == "object"){ace.config.$defaultOptions.session.tabSize.initialValue = 2;} if(typeof editor == "object"){editor.getSession().setTabSize(2);}})</script>'''
...
...
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