diff options
author | Wu Cheng-Han | 2017-03-14 18:04:23 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2017-03-14 18:04:23 +0800 |
commit | 506a381eca5e2bdc31d3529ecd3f1f7797551406 (patch) | |
tree | 99e91e926d3a30a2ecba7c5b3ef7af47efd08cfe /public/views/hackmd | |
parent | baf13072c1eedf5bb8ba126059043241d104a99a (diff) |
Add config option for gitlab api scope and auto adapt gitlab snippet feature on it
Diffstat (limited to '')
-rw-r--r-- | public/views/hackmd/header.ejs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/public/views/hackmd/header.ejs b/public/views/hackmd/header.ejs index bb4e3174..24282b07 100644 --- a/public/views/hackmd/header.ejs +++ b/public/views/hackmd/header.ejs @@ -42,7 +42,7 @@ <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank"><i class="fa fa-github fa-fw"></i> Gist</a> </li> <% } %> - <% if(typeof gitlab !== 'undefined' && gitlab) { %> + <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -54,7 +54,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-import-gist" href="#" data-toggle="modal" data-target="#gistImportModal"><i class="fa fa-github fa-fw"></i> Gist</a> </li> - <% if(typeof gitlab !== 'undefined' && gitlab) { %> + <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> <li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -139,7 +139,7 @@ <li role="presentation"><a role="menuitem" class="ui-save-gist" tabindex="-1" href="#" target="_blank"><i class="fa fa-github fa-fw"></i> Gist</a> </li> <% } %> - <% if(typeof gitlab !== 'undefined' && gitlab) { %> + <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> <li role="presentation"><a role="menuitem" class="ui-save-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> @@ -151,7 +151,7 @@ </li> <li role="presentation"><a role="menuitem" class="ui-import-gist" href="#" data-toggle="modal" data-target="#gistImportModal"><i class="fa fa-github fa-fw"></i> Gist</a> </li> - <% if(typeof gitlab !== 'undefined' && gitlab) { %> + <% if(typeof gitlab !== 'undefined' && gitlab && (!gitlab.scope || gitlab.scope === 'api')) { %> <li role="presentation"><a role="menuitem" class="ui-import-snippet" href="#"><i class="fa fa-gitlab fa-fw"></i> Snippet</a> </li> <% } %> |