aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorKonctantin <gawrilyako@gmail.com>2019-11-15 09:56:06 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2019-11-15 14:56:06 +0800
commitb30d744e0986dcf716d4f57dac8c72a494bb226b (patch)
tree6bd9219fbaad6d6f2ac480031de7e691289caeca /web_src/js
parent896ad1d9cf31dafc82d852a518066ed54678ed65 (diff)
downloadgitea-b30d744e0986dcf716d4f57dac8c72a494bb226b.tar.gz
gitea-b30d744e0986dcf716d4f57dac8c72a494bb226b.zip
Githook highlighter (#8932)
* Add code highlighter to GitHook edit Signed-off-by: Konctantin <gawrilyako@gmail.com> * Fix indentation Signed-off-by: Konctantin <gawrilyako@gmail.com> * Resolve merge conflict Signed-off-by: gawrilyako@gmail.com <Konctantin> * Resolve merge conflict Signed-off-by: gawrilyako@gmail.com <Konctantin> * Fix pre-build drone event Signed-off-by: Konctantin <gawrilyako@gmail.com>
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/index.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 69d2aafcc9..e25568d9b8 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1499,6 +1499,17 @@ function initUserSettings() {
}
}
+function initGithook() {
+ if ($('.edit.githook').length === 0) {
+ return;
+ }
+
+ CodeMirror.autoLoadMode(CodeMirror.fromTextArea($('#content')[0], {
+ lineNumbers: true,
+ mode: 'shell'
+ }), 'shell');
+}
+
function initWebhook() {
if ($('.new.webhook').length === 0) {
return;
@@ -2296,6 +2307,7 @@ $(document).ready(() => {
initEditForm();
initEditor();
initOrganization();
+ initGithook();
initWebhook();
initAdmin();
initCodeView();