File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -707,6 +707,7 @@ func GitHooks(ctx *context.Context) {
707
707
func GitHooksEdit (ctx * context.Context ) {
708
708
ctx .Data ["Title" ] = ctx .Tr ("repo.settings.githooks" )
709
709
ctx .Data ["PageIsSettingsGitHooks" ] = true
710
+ ctx .Data ["RequireSimpleMDE" ] = true
710
711
711
712
name := ctx .Params (":name" )
712
713
hook , err := ctx .Repo .GitRepo .GetHook (name )
Original file line number Diff line number Diff line change @@ -1499,6 +1499,17 @@ function initUserSettings() {
1499
1499
}
1500
1500
}
1501
1501
1502
+ function initGithook ( ) {
1503
+ if ( $ ( '.edit.githook' ) . length === 0 ) {
1504
+ return ;
1505
+ }
1506
+
1507
+ CodeMirror . autoLoadMode ( CodeMirror . fromTextArea ( $ ( '#content' ) [ 0 ] , {
1508
+ lineNumbers : true ,
1509
+ mode : 'shell'
1510
+ } ) , 'shell' ) ;
1511
+ }
1512
+
1502
1513
function initWebhook ( ) {
1503
1514
if ( $ ( '.new.webhook' ) . length === 0 ) {
1504
1515
return ;
@@ -2296,6 +2307,7 @@ $(document).ready(() => {
2296
2307
initEditForm ( ) ;
2297
2308
initEditor ( ) ;
2298
2309
initOrganization ( ) ;
2310
+ initGithook ( ) ;
2299
2311
initWebhook ( ) ;
2300
2312
initAdmin ( ) ;
2301
2313
initCodeView ( ) ;
You can’t perform that action at this time.
0 commit comments