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
Boxiang Sun
gitlab-ce
Commits
4c954a5c
Commit
4c954a5c
authored
Jul 03, 2019
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark images as binary on init
parent
de6c2f70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app/assets/javascripts/ide/lib/files.js
app/assets/javascripts/ide/lib/files.js
+3
-2
app/assets/javascripts/vue_shared/components/content_viewer/lib/viewer_utils.js
.../vue_shared/components/content_viewer/lib/viewer_utils.js
+1
-0
spec/frontend/ide/lib/files_spec.js
spec/frontend/ide/lib/files_spec.js
+3
-1
No files found.
app/assets/javascripts/ide/lib/files.js
View file @
4c954a5c
...
...
@@ -77,6 +77,7 @@ export const decorateFiles = ({
const
fileFolder
=
parent
&&
insertParent
(
parent
);
if
(
name
)
{
const
previewMode
=
viewerInformationForPath
(
name
);
parentPath
=
fileFolder
&&
fileFolder
.
path
;
file
=
decorateData
({
...
...
@@ -92,9 +93,9 @@ export const decorateFiles = ({
changed
:
tempFile
,
content
,
base64
,
binary
,
binary
:
(
previewMode
&&
previewMode
.
binary
)
||
binary
,
rawPath
,
previewMode
:
viewerInformationForPath
(
name
)
,
previewMode
,
parentPath
,
});
...
...
app/assets/javascripts/vue_shared/components/content_viewer/lib/viewer_utils.js
View file @
4c954a5c
...
...
@@ -3,6 +3,7 @@ import { __ } from '~/locale';
const
viewers
=
{
image
:
{
id
:
'
image
'
,
binary
:
true
,
},
markdown
:
{
id
:
'
markdown
'
,
...
...
spec/frontend/ide/lib/files_spec.js
View file @
4c954a5c
...
...
@@ -12,6 +12,7 @@ const createEntries = paths => {
const
{
name
,
parent
}
=
splitParent
(
path
);
const
parentEntry
=
acc
[
parent
];
const
previewMode
=
viewerInformationForPath
(
name
);
acc
[
path
]
=
{
...
decorateData
({
...
...
@@ -22,7 +23,8 @@ const createEntries = paths => {
path
,
url
:
createUrl
(
`/
${
TEST_PROJECT_ID
}
/
${
type
}
/
${
TEST_BRANCH_ID
}
/-/
${
escapeFileUrl
(
path
)}
`
),
type
,
previewMode
:
viewerInformationForPath
(
path
),
previewMode
,
binary
:
(
previewMode
&&
previewMode
.
binary
)
||
false
,
parentPath
:
parent
,
parentTreeUrl
:
parentEntry
?
parentEntry
.
url
...
...
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