mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[FIXED JENKINS-23151, JENKINS-23026] Save CodeMirror editor when it loses focus
* Save CM editor when it loses focus to ensure that test is saved back to textarea * Turn on again CM editor for shell scripts
This commit is contained in:
1 parent
e9aeaf11b7
commit
4e48eaa05c
2 files changed
+3
-3
No files matched your search
@@ -25,6 +25,5 @@ package hudson.tasks.Shell;
|
||||
f=namespace(lib.FormTagLib)
|
||||
|
||||
f.entry(title:_("Command"),description:_("description",rootURL)) {
|
||||
// TODO JENKINS-23151 'codemirror-mode': 'shell' is broken
|
||||
f.textarea(name: "command", value: instance?.command, class: "fixed-width")
|
||||
f.textarea(name: "command", value: instance?.command, class: "fixed-width", 'codemirror-mode': 'shell', 'codemirror-config': "mode: 'text/x-sh'")
|
||||
}
|
||||
@@ -10,7 +10,8 @@ Behaviour.specify("TEXTAREA.codemirror", 'textarea', 0, function(e) {
|
||||
}
|
||||
|
||||
var h = e.clientHeight || getTextareaHeight();
|
||||
var config = e.getAttribute("codemirror-config") || "";
|
||||
var config = e.getAttribute("codemirror-config");
|
||||
config += (config ? ", " : " ") + "onBlur: function(editor){editor.save()}";
|
||||
config = eval('({'+config+'})');
|
||||
var codemirror = CodeMirror.fromTextArea(e,config);
|
||||
e.codemirrorObject = codemirror;
|
||||
|
||||
Reference in new issue
Block a user