diff options
author | Florian Kaiser <florian.kaiser@fnkr.net> | 2016-02-01 16:30:28 +0000 |
---|---|---|
committer | Florian Kaiser <florian.kaiser@fnkr.net> | 2016-02-01 17:04:58 +0000 |
commit | d56801930668597bb8329978e384e61c0bd314ac (patch) | |
tree | f4026b1eb42fc07ca74abd68d4884906e6842dc8 /public | |
parent | 5d192c2ebf0703fa0e7a5af7adbcaaec0d3b7dc9 (diff) | |
download | gitea-d56801930668597bb8329978e384e61c0bd314ac.tar.gz gitea-d56801930668597bb8329978e384e61c0bd314ac.zip |
Remember last selected clone protocol, and establish uniform order (https, ssh)
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index f979df0762..df48c7dbe9 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -434,12 +434,14 @@ function initRepository() { $('#repo-clone-url').val($(this).data('link')); $(this).addClass('blue'); $('#repo-clone-https').removeClass('blue'); + localStorage.setItem('repo-clone-protocol', 'ssh'); }); $('#repo-clone-https').click(function () { $('.clone-url').text($(this).data('link')); $('#repo-clone-url').val($(this).data('link')); $(this).addClass('blue'); $('#repo-clone-ssh').removeClass('blue'); + localStorage.setItem('repo-clone-protocol', 'https'); }); $('#repo-clone-url').click(function () { $(this).select(); @@ -1035,4 +1037,16 @@ $(window).load(function () { } }).trigger('hashchange'); } + + // Repo clone url. + if ($('#repo-clone-url').length > 0) { + switch (localStorage.getItem('repo-clone-protocol')) { + case 'ssh': + $('#repo-clone-ssh').click(); + break; + default: + $('#repo-clone-https').click(); + break; + } + } }); |