Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
00e7f328
Commit
00e7f328
authored
Aug 03, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ide' of gitlab.com:gitlab-org/gitlab-ce into ide
parents
995a8ee2
b1f30151
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
app/assets/javascripts/repo/components/repo_file_buttons.vue
app/assets/javascripts/repo/components/repo_file_buttons.vue
+4
-4
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+3
-6
No files found.
app/assets/javascripts/repo/components/repo_file_buttons.vue
View file @
00e7f328
...
...
@@ -45,12 +45,12 @@ export default RepoFileButtons;
<
template
>
<div
id=
"repo-file-buttons"
v-if=
"isMini"
:style=
"
{'border-bottom': editableBorder}">
<a
:href=
"
rawFileURL
"
target=
"_blank"
class=
"btn btn-default raw"
>
{{
rawDownloadButtonLabel
}}
</a>
<a
:href=
"
activeFile.raw_path
"
target=
"_blank"
class=
"btn btn-default raw"
>
{{
rawDownloadButtonLabel
}}
</a>
<div
class=
"btn-group"
role=
"group"
aria-label=
"File actions"
>
<a
:href=
"
blameFileURL
"
class=
"btn btn-default blame"
>
Blame
</a>
<a
:href=
"
historyFileURL
"
class=
"btn btn-default history"
>
History
</a>
<a
href=
"
#
"
class=
"btn btn-default permalink"
>
Permalink
</a>
<a
:href=
"
activeFile.blame_path
"
class=
"btn btn-default blame"
>
Blame
</a>
<a
:href=
"
activeFile.commits_path
"
class=
"btn btn-default history"
>
History
</a>
<a
href=
"
activeFile.permalink
"
class=
"btn btn-default permalink"
>
Permalink
</a>
</div>
<a
href=
"#"
v-if=
"canPreview"
@
click.prevent=
"rawPreviewToggle"
class=
"btn btn-default preview"
>
{{
activeFileLabel
}}
</a>
...
...
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
00e7f328
...
...
@@ -62,10 +62,6 @@ const RepoHelper = {
return
file
;
},
getRawURLFromBlobURL
(
url
)
{
return
url
.
replace
(
'
blob
'
,
'
raw
'
);
},
isKindaBinary
()
{
const
okExts
=
[
'
md
'
,
'
svg
'
];
return
okExts
.
indexOf
(
Store
.
activeFile
.
extension
)
>
-
1
;
...
...
@@ -79,8 +75,8 @@ const RepoHelper = {
return
url
.
replace
(
'
blob
'
,
'
commits
'
);
},
setBinaryDataAsBase64
(
url
,
file
)
{
Service
.
getBase64Content
(
url
)
setBinaryDataAsBase64
(
file
)
{
Service
.
getBase64Content
(
file
.
raw_path
)
.
then
((
response
)
=>
{
Store
.
blobRaw
=
response
;
file
.
base64
=
response
;
// eslint-disable-line no-param-reassign
...
...
@@ -163,6 +159,7 @@ const RepoHelper = {
if
(
data
.
binary
)
{
Store
.
binaryMimeType
=
data
.
mime_type
;
// file might be undefined
RepoHelper
.
setBinaryDataAsBase64
(
data
);
const
rawUrl
=
RepoHelper
.
getRawURLFromBlobURL
(
file
.
url
||
Service
.
url
);
RepoHelper
.
setBinaryDataAsBase64
(
rawUrl
,
data
);
Store
.
setViewToPreview
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment