|
1 | 1 | @(active: String, |
2 | 2 | gist: gitbucket.gist.model.Gist, |
3 | 3 | repositoryUrl: gitbucket.gist.util.GistUtils.GistRepositoryURL)(implicit context: gitbucket.core.controller.Context) |
4 | | -@import gitbucket.core.view.helpers |
5 | | -@embedScript=@{"<script>"+repositoryUrl.embedUrl+"</script>"} |
6 | 4 | @menuitem(name: String, path: String, label: String, count: Int = 0) = { |
7 | 5 | <li @if(active == name){class="active"}> |
8 | 6 | <a href="@context.path/gist/@path"> |
|
74 | 72 | <script> |
75 | 73 | $(function(){ |
76 | 74 | $('#repository-url-embed').click(function(){ |
77 | | - $('#repository-url').val('@embedScript'.replace(/</g,"<").replace(/>/g,">")); |
| 75 | + $('#repository-url-proto').text('Embed'); |
| 76 | + $('#repository-url').val('<script src="@repositoryUrl.embedUrl\"><\/script>'); |
78 | 77 | $('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val()); |
79 | 78 | }); |
80 | 79 | $('#repository-url-http').click(function(){ |
| 80 | + $('#repository-url-proto').text('HTTP'); |
81 | 81 | $('#repository-url').val('@repositoryUrl.httpUrl'); |
82 | 82 | $('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val()); |
83 | 83 | }); |
84 | 84 | @if(context.settings.ssh && context.loginAccount.isDefined){ |
85 | 85 | $('#repository-url-ssh').click(function(){ |
| 86 | + $('#repository-url-proto').text('SSH'); |
86 | 87 | $('#repository-url').val('@repositoryUrl.sshUrl(context.loginAccount.get.userName)'); |
87 | 88 | $('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val()); |
88 | 89 | }); |
|
0 commit comments