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
dca28c94
Commit
dca28c94
authored
Jul 11, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get README to render.
parent
62ad0113
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
app/assets/javascripts/repo/repo_binary_viewer.js
app/assets/javascripts/repo/repo_binary_viewer.js
+6
-5
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+17
-13
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+1
-0
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-0
No files found.
app/assets/javascripts/repo/repo_binary_viewer.js
View file @
dca28c94
...
...
@@ -19,8 +19,8 @@ export default class RepoBinaryViewer {
},
methods
:
{
supportedNonBinaryFileType
(
fileExt
)
{
switch
(
fileExt
)
{
supportedNonBinaryFileType
()
{
switch
(
this
.
activeFile
.
extension
)
{
case
'
md
'
:
this
.
binaryTypes
.
markdown
=
true
;
return
true
;
...
...
@@ -33,12 +33,13 @@ export default class RepoBinaryViewer {
watch
:
{
blobRaw
()
{
if
(
!
this
.
binary
)
return
;
let
supported
=
supportedNonBinaryFileType
();
let
supported
=
this
.
supportedNonBinaryFileType
();
if
(
supported
)
{
this
.
binaryTypes
.
markdown
=
true
;
this
.
binary
=
true
;
return
;
}
if
(
!
this
.
binary
)
return
;
switch
(
this
.
binaryMimeType
)
{
case
'
image/png
'
:
this
.
binaryTypes
.
png
=
true
;
...
...
app/assets/javascripts/repo/repo_editor.js
View file @
dca28c94
...
...
@@ -31,6 +31,7 @@ export default class RepoEditor {
this
.
vue
=
new
Vue
({
data
:
()
=>
Store
,
created
()
{
this
.
showHide
();
if
(
this
.
blobRaw
!==
''
){
monacoEditor
.
setModel
(
monaco
.
editor
.
createModel
(
...
...
@@ -41,29 +42,32 @@ export default class RepoEditor {
}
},
watch
:
{
isTre
e
()
{
if
(
!
this
.
openedFiles
.
length
)
{
methods
:
{
showHid
e
()
{
if
(
(
!
this
.
openedFiles
.
length
)
||
this
.
binary
)
{
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
}
}
},
watch
:
{
isTree
()
{
this
.
showHide
();
},
openedFiles
()
{
if
((
!
this
.
openedFiles
.
length
)
||
this
.
binary
)
{
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
}
this
.
showHide
();
},
binary
()
{
this
.
showHide
();
},
blobRaw
()
{
if
(
this
.
binary
)
{
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
}
this
.
showHide
();
if
(
!
this
.
isTree
)
{
self
.
monacoEditor
.
setModel
(
monaco
.
editor
.
createModel
(
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
dca28c94
...
...
@@ -183,6 +183,7 @@ let RepoHelper = {
this
.
addToOpenedFiles
(
data
);
this
.
setActiveFile
(
data
);
}
// if the file tree is empty
if
(
Store
.
files
.
length
===
0
)
{
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
dca28c94
...
...
@@ -21,6 +21,7 @@
#ide
{
data:
{
url:
repo_url
}
}
#binary-viewer
{
"v-if"
=>
"binary"
}
%img
{
"v-if"
=>
"binaryTypes.png"
,
":src"
=>
"pngBlobWithDataURI"
}
%div
{
"v-if"
=>
"binaryTypes.markdown"
,
"v-html"
=>
"activeFile.html"
}
-
if
can_edit_tree?
=
render
'projects/blob/upload'
,
title:
_
(
'Upload New File'
),
placeholder:
_
(
'Upload New File'
),
button_title:
_
(
'Upload file'
),
form_path:
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
@id
),
method: :post
=
render
'projects/blob/new_dir'
...
...
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