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
80ae4c54
Commit
80ae4c54
authored
May 22, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code mirror: cancel pending AJAX call to check source code when document is modified again
parent
417c07be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/code_mirror_support.xml
...tem/portal_skins/erp5_code_mirror/code_mirror_support.xml
+24
-18
No files found.
bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/code_mirror_support.xml
View file @
80ae4c54
...
...
@@ -445,30 +445,36 @@
is_maximized = true;\n
}\n
\n
var timer = 0;\n
function checkPythonSourceCode(text, updateLinting, options, cm) {\n
checker_parameters = {code: text};\n
<dtml-if
bound_names
>
\n
checker_parameters[\'bound_names\'] =
<dtml-var
name=
"bound_names"
>
;\n
checker_parameters[\'params\'] = $(\'input[name="params"]\').val();\n
</dtml-if>
\n
$.post(\n
\'
&dtml-portal_url;
/ERP5Site_checkPythonSourceCodeAsJSON\',\n
{\'data\': JSON.stringify(checker_parameters)},\n
function(data){\n
var messages = data.annotations;\n
var found = [];\n
for(var i = 0; i
< messages.length
;
i++)
{\n
message =
messages[i];\n
found.push({\n
from:
CodeMirror.Pos(message.row,
message.column
-
1),\n
to:
CodeMirror.Pos(message.row,
message.column),\n
message:
message.text,\n
severity:
message.type\n
});\n
}\n
\n
updateLinting(cm,
found);\n
});\n
if (timer) {\n
window.clearTimeout(timer);\n
timer = 0;\n
}\n
timer = window.setTimeout(function() {\n
$.post(\n
\'
&dtml-portal_url;
/ERP5Site_checkPythonSourceCodeAsJSON\',\n
{\'data\': JSON.stringify(checker_parameters)},\n
function(data){\n
var messages = data.annotations;\n
var found = [];\n
for(var i = 0; i
< messages.length
;
i++)
{\n
message =
messages[i];\n
found.push({\n
from:
CodeMirror.Pos(message.row,
message.column
-
1),\n
to:
CodeMirror.Pos(message.row,
message.column),\n
message:
message.text,\n
severity:
message.type\n
});\n
}\n
updateLinting(cm,
found);\n
});\n
},
500);\n
}\n
\n
var
mode =
"&dtml-mode;"
;\n
...
...
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