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
138
Merge Requests
138
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
ba29ef62
Commit
ba29ef62
authored
Jan 22, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patches/SourceCodeEditorZMI: fix monaco editor integration on python3
parent
abe071c4
Changes
1
Show 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 @
ba29ef62
...
@@ -2,6 +2,7 @@ from App.Management import Navigation
...
@@ -2,6 +2,7 @@ from App.Management import Navigation
from
ZODB.POSException
import
ConflictError
from
ZODB.POSException
import
ConflictError
from
Acquisition
import
aq_parent
from
Acquisition
import
aq_parent
import
json
import
json
import
six
def
manage_page_footer
(
self
):
def
manage_page_footer
(
self
):
default
=
'</body></html>'
default
=
'</body></html>'
...
@@ -102,13 +103,16 @@ def manage_page_footer(self):
...
@@ -102,13 +103,16 @@ def manage_page_footer(self):
keymap
=
keymap
,
keymap
=
keymap
,
portal_type
=
portal_type
))
portal_type
=
portal_type
))
elif
editor
==
'monaco'
and
getattr
(
portal
,
'monaco_editor_support'
,
None
)
is
not
None
:
elif
editor
==
'monaco'
and
getattr
(
portal
,
'monaco_editor_support'
,
None
)
is
not
None
:
return
'''%s
monaco_editor_support
=
portal
.
monaco_editor_support
(
</body>
</html>'''
%
(
portal
.
monaco_editor_support
(
textarea_selector
=
textarea_selector
,
textarea_selector
=
textarea_selector
,
portal_url
=
portal_url
,
portal_url
=
portal_url
,
bound_names
=
bound_names
,
bound_names
=
bound_names
,
mode
=
mode
).
encode
(
'utf-8'
))
mode
=
mode
)
if
six
.
PY2
:
monaco_editor_support
=
monaco_editor_support
.
encode
(
'utf-8'
)
return
'''%s
</body>
</html>'''
%
monaco_editor_support
elif
editor
in
(
None
,
'text_area'
)
and
mode
==
'python'
:
elif
editor
in
(
None
,
'text_area'
)
and
mode
==
'python'
:
# Set Zope4's default ace editor indent size to 2.
# 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>'''
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