-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-73891] Extract inline JS in
ConfigFilesUI/edit.jelly
and `…
…ConfigFilesUI/show.jelly` (#342)
- Loading branch information
1 parent
4554bc6
commit 88956aa
Showing
3 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/resources/org/jenkinsci/plugins/configfiles/ConfigFilesUI/setup-codemirror.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
document.addEventListener("DOMContentLoaded", function () { | ||
const textarea = document.getElementById("config.content"); | ||
const contentTypeElement = document.querySelector(".content-type-config"); | ||
|
||
const contentType = contentTypeElement.dataset.contentType; | ||
const readOnly = contentTypeElement.dataset.readOnly === "true"; | ||
|
||
CodeMirror.fromTextArea(textarea, { | ||
lineNumbers: true, | ||
matchBrackets: true, | ||
mode: contentType, | ||
readOnly: readOnly, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters