diff options
author | Unknwon <u@gogs.io> | 2016-02-01 15:58:01 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-01 15:58:01 -0500 |
commit | 66d2ba1b4e0427f448190272677efdbaca2ecaae (patch) | |
tree | a9f7d49a57d86472ce2f1a0fc0c6b8b4b26779d2 /public/js/gogs.js | |
parent | 857b3404986eff2881cec75748db8d45707f64b8 (diff) | |
parent | 84749736a81ea768e30aaa312d729c165dc1017d (diff) | |
download | gitea-66d2ba1b4e0427f448190272677efdbaca2ecaae.tar.gz gitea-66d2ba1b4e0427f448190272677efdbaca2ecaae.zip |
Merge pull request #2537 from fnkr/remember-clone-protocol
Remember last selected clone protocol
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r-- | public/js/gogs.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 6c00d27764..71f4859c3c 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -437,12 +437,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(); @@ -1038,4 +1040,18 @@ $(window).load(function () { } }).trigger('hashchange'); } + + // Repo clone url. + if ($('#repo-clone-url').length > 0) { + switch (localStorage.getItem('repo-clone-protocol')) { + case 'ssh': + if ($('#repo-clone-ssh').click().length === 0) { + $('#repo-clone-https').click(); + }; + break; + default: + $('#repo-clone-https').click(); + break; + } + } }); |