From 755eec745fa324fdd13078f0147638f8731652ba Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 2 Aug 2014 13:47:33 -0400 Subject: Finish new repo settings page --- public/ng/js/gogs.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'public/ng/js') diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index a861255e3e..37144ce99e 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -174,11 +174,31 @@ function initRepoCreate() { console.log('initRepoCreate'); } +function initRepoSetting() { + // Confirmation of changing repository name. + $('#repo-setting-form').submit(function (e) { + var $reponame = $('#repo_name'); + if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) { + e.preventDefault(); + return true; + } + }); + $('#transfer-button').click(function () { + $('#transfer-form').show(); + }); + $('#delete-button').click(function () { + $('#delete-form').show(); + }); +} + $(document).ready(function () { initCore(); if ($('#repo-create-form').length || $('#repo-migrate-form').length) { initRepoCreate(); } + if ($('#repo-setting').length) { + initRepoSetting(); + } Tabs('#dashboard-sidebar-menu'); -- cgit v1.2.3