Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite895df8

Browse files
authored
Support GitBucket 4.37.x (#68)
1 parent9a81964 commite895df8

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This is a GitBucket plug-in which provides code snippet repository like Gist.
44

55
Plugin version | GitBucket version
66
:--------------|:--------------------
7+
4.22.x | 4.37.x -
78
4.21.x | 4.36.x -
89
4.20.x | 4.35.x -
910
4.19.x | 4.34.x -

‎build.sbt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
organization:="io.github.gitbucket"
22
name:="gitbucket-gist-plugin"
3-
version:="4.21.0"
4-
scalaVersion:="2.13.5"
5-
gitbucketVersion:="4.36.0"
3+
version:="4.22.0"
4+
scalaVersion:="2.13.7"
5+
gitbucketVersion:="4.37.0"
66

77
scalacOptions:=Seq("-deprecation","-feature","-language:postfixOps")
88
Compile/ javacOptions++=Seq("-target","8","-source","8")

‎project/build.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.5.0
1+
sbt.version = 1.5.6

‎src/main/scala/Plugin.scala‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class Plugin extends gitbucket.core.plugin.Plugin {
4343
newVersion("4.18.0"),
4444
newVersion("4.19.0"),
4545
newVersion("4.20.0"),
46-
newVersion("4.21.0")
46+
newVersion("4.21.0"),
47+
newVersion("4.22.0")
4748
)
4849

4950
overridedefinitialize(registry:PluginRegistry,context:ServletContext,settings:SystemSettings):Unit= {

‎src/main/scala/gitbucket/gist/util/GistUtils.scala‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ object GistUtils {
5555
caseclassGistRepositoryURL(gist:Gist,baseUrl:String,settings:SystemSettings){
5656

5757
defhttpUrl:String=s"${baseUrl}/git/gist/${gist.userName}/${gist.repositoryName}.git"
58-
58+
5959
defembedUrl:String=s"${baseUrl}/gist/${gist.userName}/${gist.repositoryName}.js"
6060

61-
defsshUrl(loginUser:String):String= {
62-
valhost="""^https?://(.+?)(:\d+)?/""".r.findFirstMatchIn(httpUrl).get.group(1)
63-
s"ssh://${loginUser}@${host}:${settings.ssh.sshPort.getOrElse(SystemSettingsService.DefaultSshPort)}/gist/${gist.userName}/${gist.repositoryName}.git"
61+
defsshUrl:Option[String]= {
62+
settings.sshUrl.map { sshUrl=>
63+
s"${sshUrl}/gist/${gist.userName}/${gist.repositoryName}.git"
64+
}
6465
}
65-
6666
}
6767

6868
}

‎src/main/twirl/gitbucket/gist/edit.scala.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ <h1 style="margin: 0px;">New snippet</h1>
3535
<formid="form"method="POST"action="#">
3636
<inputtype="text"name="description"id="description"class="form-control"style="margin-bottom: 8px;"value="@gist.map(_.description)"placeholder="Snippet descriptions..."/>
3737
<divid="editors">
38-
@files.zipWithIndex.map { case ((fileName, content), i) => {
38+
@files.zipWithIndex.map { case ((fileName, content), i) =>
3939
@gitbucket.gist.html.editor(i, fileName, content)
40-
}}
40+
}
4141
</div>
4242
<div>
4343
<inputtype="button"value="Add file"class="btn btn-default"id="add_file">

‎src/main/twirl/gitbucket/gist/menu.scala.html‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@
116116
$('#repository-url').val('@repositoryUrl.httpUrl');
117117
$('#repository-url-copy').attr('data-clipboard-text',$('#repository-url').val());
118118
});
119-
@if(context.settings.ssh.enabled&&context.loginAccount.isDefined){
120-
$('#repository-url-ssh').click(function(){
121-
$('#repository-url-proto').text('SSH');
122-
$('#repository-url').val('@repositoryUrl.sshUrl(context.loginAccount.get.userName)');
123-
$('#repository-url-copy').attr('data-clipboard-text',$('#repository-url').val());
124-
});
125-
}
119+
@if(context.settings.ssh.enabled&&context.loginAccount.isDefined){
120+
@repositoryUrl.sshUrl.map{sshUrl=>
121+
$('#repository-url-ssh').click(function(){
122+
$('#repository-url-proto').text('SSH');
123+
$('#repository-url').val('@sshUrl');
124+
$('#repository-url-copy').attr('data-clipboard-text',$('#repository-url').val());
125+
});
126+
}
127+
}
126128
});
127129
</script>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp