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
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 {
...
@@ -19,8 +19,8 @@ export default class RepoBinaryViewer {
},
},
methods
:
{
methods
:
{
supportedNonBinaryFileType
(
fileExt
)
{
supportedNonBinaryFileType
()
{
switch
(
fileExt
)
{
switch
(
this
.
activeFile
.
extension
)
{
case
'
md
'
:
case
'
md
'
:
this
.
binaryTypes
.
markdown
=
true
;
this
.
binaryTypes
.
markdown
=
true
;
return
true
;
return
true
;
...
@@ -33,12 +33,13 @@ export default class RepoBinaryViewer {
...
@@ -33,12 +33,13 @@ export default class RepoBinaryViewer {
watch
:
{
watch
:
{
blobRaw
()
{
blobRaw
()
{
if
(
!
this
.
binary
)
return
;
let
supported
=
this
.
supportedNonBinaryFileType
();
let
supported
=
supportedNonBinaryFileType
();
if
(
supported
)
{
if
(
supported
)
{
this
.
binaryTypes
.
markdown
=
true
;
this
.
binary
=
true
;
return
;
return
;
}
}
if
(
!
this
.
binary
)
return
;
switch
(
this
.
binaryMimeType
)
{
switch
(
this
.
binaryMimeType
)
{
case
'
image/png
'
:
case
'
image/png
'
:
this
.
binaryTypes
.
png
=
true
;
this
.
binaryTypes
.
png
=
true
;
...
...
app/assets/javascripts/repo/repo_editor.js
View file @
dca28c94
...
@@ -31,6 +31,7 @@ export default class RepoEditor {
...
@@ -31,6 +31,7 @@ export default class RepoEditor {
this
.
vue
=
new
Vue
({
this
.
vue
=
new
Vue
({
data
:
()
=>
Store
,
data
:
()
=>
Store
,
created
()
{
created
()
{
this
.
showHide
();
if
(
this
.
blobRaw
!==
''
){
if
(
this
.
blobRaw
!==
''
){
monacoEditor
.
setModel
(
monacoEditor
.
setModel
(
monaco
.
editor
.
createModel
(
monaco
.
editor
.
createModel
(
...
@@ -41,29 +42,32 @@ export default class RepoEditor {
...
@@ -41,29 +42,32 @@ export default class RepoEditor {
}
}
},
},
watch
:
{
methods
:
{
isTre
e
()
{
showHid
e
()
{
if
(
!
this
.
openedFiles
.
length
)
{
if
(
(
!
this
.
openedFiles
.
length
)
||
this
.
binary
)
{
self
.
el
.
style
.
display
=
'
none
'
;
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
self
.
el
.
style
.
display
=
'
inline-block
'
;
}
}
}
},
watch
:
{
isTree
()
{
this
.
showHide
();
},
},
openedFiles
()
{
openedFiles
()
{
if
((
!
this
.
openedFiles
.
length
)
||
this
.
binary
)
{
this
.
showHide
();
self
.
el
.
style
.
display
=
'
none
'
;
},
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
binary
()
{
}
this
.
showHide
();
},
},
blobRaw
()
{
blobRaw
()
{
if
(
this
.
binary
)
{
this
.
showHide
();
self
.
el
.
style
.
display
=
'
none
'
;
}
else
{
self
.
el
.
style
.
display
=
'
inline-block
'
;
}
if
(
!
this
.
isTree
)
{
if
(
!
this
.
isTree
)
{
self
.
monacoEditor
.
setModel
(
self
.
monacoEditor
.
setModel
(
monaco
.
editor
.
createModel
(
monaco
.
editor
.
createModel
(
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
dca28c94
...
@@ -183,6 +183,7 @@ let RepoHelper = {
...
@@ -183,6 +183,7 @@ let RepoHelper = {
this
.
addToOpenedFiles
(
data
);
this
.
addToOpenedFiles
(
data
);
this
.
setActiveFile
(
data
);
this
.
setActiveFile
(
data
);
}
}
// if the file tree is empty
// if the file tree is empty
if
(
Store
.
files
.
length
===
0
)
{
if
(
Store
.
files
.
length
===
0
)
{
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
dca28c94
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#ide
{
data:
{
url:
repo_url
}
}
#ide
{
data:
{
url:
repo_url
}
}
#binary-viewer
{
"v-if"
=>
"binary"
}
#binary-viewer
{
"v-if"
=>
"binary"
}
%img
{
"v-if"
=>
"binaryTypes.png"
,
":src"
=>
"pngBlobWithDataURI"
}
%img
{
"v-if"
=>
"binaryTypes.png"
,
":src"
=>
"pngBlobWithDataURI"
}
%div
{
"v-if"
=>
"binaryTypes.markdown"
,
"v-html"
=>
"activeFile.html"
}
-
if
can_edit_tree?
-
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/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'
=
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