@@ -46,26 +46,27 @@ class Plugin extends gitbucket.core.plugin.Plugin {
46
46
)
47
47
48
48
override val globalMenus = Seq (
49
- new GlobalMenu {
50
- override def createLink (context : Context ): Option [(String , String )] = Some (" Snippets" -> " gist" )
51
- }
49
+ (context : Context ) => Some (Link (" snippets" , " Snippets" , " gist" ))
50
+ )
51
+ override val profileTabs = Seq (
52
+ (account : Account , context : Context ) => Some (Link (" snippets" , " Snippets" , s " gist/ ${account.userName}/_profile " ))
52
53
)
53
54
54
- override def javaScripts (registry : PluginRegistry , context : ServletContext , settings : SystemSettings ): Seq [(String , String )] = {
55
- // Add Snippet link to the header
56
- val path = settings.baseUrl.getOrElse(context.getContextPath)
57
- Seq (
58
- " .*" -> s """
59
- |var accountName = $$ ('div.account-username').text();
60
- |if(accountName != ''){
61
- | var active = location.href.endsWith('_profile');
62
- | $$ ('li:has(a:contains(Public Activity))').after(
63
- | $$ ('<li' + (active ? ' class="active"' : '') + '><a href=" ${path}/gist/' + accountName + '/_profile">Snippets</a></li>')
64
- | );
65
- |}
66
- """ .stripMargin
67
- )
68
- }
55
+ // override def javaScripts(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[(String, String)] = {
56
+ // // Add Snippet link to the header
57
+ // val path = settings.baseUrl.getOrElse(context.getContextPath)
58
+ // Seq(
59
+ // ".*" -> s"""
60
+ // |var accountName = $$('div.account-username').text();
61
+ // |if(accountName != ''){
62
+ // | var active = location.href.endsWith('_profile');
63
+ // | $$('li:has(a:contains(Public Activity))').after(
64
+ // | $$('<li' + (active ? ' class="active"' : '') + '><a href="${path}/gist/' + accountName + '/_profile">Snippets</a></li>')
65
+ // | );
66
+ // |}
67
+ // """.stripMargin
68
+ // )
69
+ // }
69
70
}
70
71
71
72
class GistRepositoryFilter extends GitRepositoryFilter with AccountService {
0 commit comments