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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
417c07be
Commit
417c07be
authored
May 11, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL hint wip
parent
8ee1f4cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/code_mirror_support.xml
...tem/portal_skins/erp5_code_mirror/code_mirror_support.xml
+10
-0
product/ERP5Type/patches/AceEditorZMI.py
product/ERP5Type/patches/AceEditorZMI.py
+5
-1
No files found.
bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/code_mirror_support.xml
View file @
417c07be
...
...
@@ -78,6 +78,8 @@
<script
type=
"text/javascript"
src=
"&dtml-portal_url;/codemirror/mode/xml/xml.js"
></script>
\n
<script
type=
"text/javascript"
src=
"&dtml-portal_url;/codemirror/mode/javascript/javascript.js"
></script>
\n
<script
type=
"text/javascript"
src=
"&dtml-portal_url;/codemirror/mode/css/css.js"
></script>
\n
<dtml-elif
expr=
"mode == \'sql\'"
>
\n
<script
type=
"text/javascript"
src=
"&dtml-portal_url;/codemirror/addon/hint/sql-hint.js"
></script>
\n
</dtml-if>
\n
\n
<style
type=
"text/css"
>
\n
...
...
@@ -515,6 +517,14 @@
if(parent_height !== undefined
&&
parent_height > (300 * 0.8)) {\n
cm.setSize(undefined, parent_height);\n
}\n
\n
<dtml-if
sql_hint
>
\n
CodeMirror.commands.autocomplete = function(cm) {\n
CodeMirror.showHint(cm, CodeMirror.hint.sql, {\n
tables:
<dtml-var
sql_hint
>
\n
} );\n
}\n
</dtml-if>
\n
\n
updateErrorWarningMessageDivWithJump();\n
\n
...
...
product/ERP5Type/patches/AceEditorZMI.py
View file @
417c07be
...
...
@@ -39,6 +39,7 @@ def manage_page_footer(self):
live_check_python_script
=
0
# Check python scripts on the fly
bound_names
=
'undefined'
sql_hint
=
None
if
document
.
meta_type
in
(
'DTML Document'
,
'DTML Method'
):
if
document
.
getId
().
endswith
(
'.js'
):
...
...
@@ -70,6 +71,8 @@ def manage_page_footer(self):
elif
document
.
meta_type
in
(
'Z SQL Method'
,
):
mode
=
'sql'
textarea_selector
=
'textarea[name="template:text"]'
sql_hint
=
json
.
dumps
({
"catalog"
:
[
"uid"
,
],
"stock"
:
[
"aggregate_uid"
,
"node_uid"
]})
print
sql_hint
elif
document
.
meta_type
in
(
'Z MySQL Database Connection'
,
):
mode
=
'sql'
textarea_selector
=
'textarea[name="query:text"]'
...
...
@@ -94,7 +97,8 @@ def manage_page_footer(self):
portal
.
code_mirror_support
(
textarea_selector
=
textarea_selector
,
portal_url
=
portal_url
,
bound_names
=
bound_names
,
mode
=
mode
))
mode
=
mode
,
sql_hint
=
sql_hint
))
else
:
return
'''
<script type="text/javascript" src="%(portal_url)s/jquery/core/jquery.min.js"></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