From f509c59ac13dffdff6a246572de04150ee295314 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 28 Aug 2015 23:36:13 +0800 Subject: new create webhook event --- public/js/gogs.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index 34bd840606..6827aada84 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -367,6 +367,23 @@ function initRepository() { } }; +function initWebhook() { + if ($('.new.webhook').length == 0) { + return; + } + + $('.events.checkbox input').change(function () { + if ($(this).is(':checked')) { + $('.events.fields').show(); + } + }); + $('.non-events.checkbox input').change(function () { + if ($(this).is(':checked')) { + $('.events.fields').hide(); + } + }); +} + $(document).ready(function () { csrf = $('meta[name=_csrf]').attr("content"); @@ -473,4 +490,5 @@ $(document).ready(function () { initCommentForm(); initInstall(); initRepository(); + initWebhook(); }); \ No newline at end of file -- cgit v1.2.3