Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
48d30d77
authored
Sep 05, 2017
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Wed IDE加载优化
parent
76cc89bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
92 deletions
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/javascript/javascript.js
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
View file @
48d30d77
...
@@ -109,16 +109,34 @@
...
@@ -109,16 +109,34 @@
</div>
</div>
<
@
netCommon
.
commonScript
/>
<
@
netCommon
.
commonScript
/>
<
#
assign
glueTypeModeSrc =
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
/>
<
#
assign
glueTypeIdeMode =
"text/x-java"
/>
<
#
if
jobInfo
.
glueType =
=
"
GLUE_GROOVY
"
>
<
#
assign
glueTypeModeSrc =
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
/>
<
#
assign
glueTypeIdeMode =
"text/x-java"
/>
<
#
elseif
jobInfo
.
glueType =
=
"
GLUE_SHELL
"
>
<
#
assign
glueTypeModeSrc =
"${request.contextPath}/static/plugins/codemirror/mode/shell/shell.js"
/>
<
#
assign
glueTypeIdeMode =
"text/x-sh"
/>
<
#
elseif
jobInfo
.
glueType =
=
"
GLUE_PYTHON
"
>
<
#
assign
glueTypeModeSrc =
"${request.contextPath}/static/plugins/codemirror/mode/python/python.js"
/>
<
#
assign
glueTypeIdeMode =
"text/x-python"
/>
<
#
elseif
jobInfo
.
glueType =
=
"
GLUE_NODEJS
"
>
<
#
assign
glueTypeModeSrc =
"${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js"
/>
<
#
assign
glueTypeIdeMode =
"text/javascript"
/>
</
#
if>
<script
src=
"${request.contextPath}/static/plugins/codemirror/lib/codemirror.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/lib/codemirror.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/clike/clike.js"
></script>
<script
src=
"${glueTypeModeSrc}"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/shell/shell.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/python/python.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/mode/javascript/javascript.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/show-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script
src=
"${request.contextPath}/static/plugins/codemirror/addon/hint/anyword-hint.js"
></script>
<script>
<script>
var
id
=
'${jobInfo.id}'
;
var
id
=
'${jobInfo.id}'
;
var
glueType
=
'${jobInfo.glueTyp
e}'
;
var
ideMode
=
'${glueTypeIdeMod
e}'
;
</script>
</script>
<script
src=
"${request.contextPath}/static/js/jobcode.index.1.js"
></script>
<script
src=
"${request.contextPath}/static/js/jobcode.index.1.js"
></script>
...
...
xxl-job-admin/src/main/webapp/static/js/jobcode.index.1.js
View file @
48d30d77
...
@@ -8,36 +8,28 @@ $(function() {
...
@@ -8,36 +8,28 @@ $(function() {
});*/
});*/
var
codeEditor
;
var
codeEditor
;
function
initIde
(
glue
Type
,
glue
Source
)
{
function
initIde
(
glueSource
)
{
var
ideMode
=
"text/x-java"
;
if
(
codeEditor
==
null
)
{
if
(
'GLUE_GROOVY'
==
glueType
)
{
codeEditor
=
CodeMirror
(
document
.
getElementById
(
"ideWindow"
),
{
ideMode
=
"text/x-java"
;
mode
:
ideMode
,
}
else
if
(
'GLUE_SHELL'
==
glueType
){
lineNumbers
:
true
,
ideMode
=
"text/x-sh"
;
matchBrackets
:
true
,
}
else
if
(
'GLUE_PYTHON'
==
glueType
){
value
:
glueSource
ideMode
=
"text/x-python"
;
})
;
}
else
if
(
'GLUE_NODEJS'
==
glueType
)
{
}
else
{
ideMode
=
"text/javascript"
codeEditor
.
setValue
(
glueSource
);
}
}
codeEditor
=
CodeMirror
(
document
.
getElementById
(
"ideWindow"
),
{
mode
:
ideMode
,
lineNumbers
:
true
,
matchBrackets
:
true
,
value
:
glueSource
});
}
}
initIde
(
glueType
,
$
(
"#version_now"
).
val
());
initIde
(
$
(
"#version_now"
).
val
());
// code change
// code change
$
(
".source_version"
).
click
(
function
(){
$
(
".source_version"
).
click
(
function
(){
var
glueType
=
$
(
this
).
attr
(
'glueType'
);
var
sourceId
=
$
(
this
).
attr
(
'version'
);
var
sourceId
=
$
(
this
).
attr
(
'version'
);
var
temp
=
$
(
"#"
+
sourceId
).
val
();
var
temp
=
$
(
"#"
+
sourceId
).
val
();
codeEditor
.
setValue
(
''
);
//
codeEditor.setValue('');
initIde
(
glueType
,
temp
);
initIde
(
temp
);
});
});
// code source save
// code source save
...
...
xxl-job-admin/src/main/webapp/static/plugins/codemirror/mode/javascript/javascript.js
100644 → 100755
View file @
48d30d77
This diff is collapsed.
Click to expand it.
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