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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
82292316
Commit
82292316
authored
Aug 03, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change to given paths
parent
03716dd3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
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
-8
No files found.
app/assets/javascripts/repo/components/repo_file_buttons.vue
View file @
82292316
...
...
@@ -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 @
82292316
...
...
@@ -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,8 +159,7 @@ const RepoHelper = {
if
(
data
.
binary
)
{
Store
.
binaryMimeType
=
data
.
mime_type
;
// file might be undefined
const
rawUrl
=
RepoHelper
.
getRawURLFromBlobURL
(
file
.
url
||
Service
.
url
);
RepoHelper
.
setBinaryDataAsBase64
(
rawUrl
,
data
);
RepoHelper
.
setBinaryDataAsBase64
(
data
);
data
.
binary
=
true
;
}
else
{
Service
.
getRaw
(
data
.
raw_path
)
...
...
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