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
c7145944
Commit
c7145944
authored
Jul 21, 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
afd9b6fb
5af7d1af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
19 deletions
+28
-19
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+2
-0
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+10
-10
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+15
-8
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+1
-1
No files found.
app/assets/javascripts/repo/repo_editor.js
View file @
c7145944
...
...
@@ -105,7 +105,9 @@ export default class RepoEditor {
this
.
monacoInstance
.
setModel
(
null
);
const
languages
=
monaco
.
languages
.
getLanguages
();
console
.
log
(
languages
)
const
languageID
=
Helper
.
getLanguageIDForFile
(
this
.
activeFile
,
languages
);
console
.
log
(
'
languageID
'
,
languageID
)
const
newModel
=
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
languageID
);
this
.
monacoInstance
.
setModel
(
newModel
);
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
c7145944
...
...
@@ -23,16 +23,16 @@ const RepoHelper = {
},
findLanguage
(
ext
,
langs
)
{
langs
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
`.
${
ext
}
`
)
>
-
1
);
return
langs
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
`.
${
ext
}
`
)
>
-
1
);
},
setDirectoryOpen
(
tree
)
{
if
(
!
tree
)
return
;
let
file
=
tree
;
if
(
!
file
)
return
;
/* eslint-disable no-param-reassign */
tree
.
opened
=
true
;
tree
.
icon
=
'
fa-folder-open
'
;
/* eslint-enable no-param-reassign */
file
.
opened
=
true
;
file
.
icon
=
'
fa-folder-open
'
;
return
file
;
},
getRawURLFromBlobURL
(
url
)
{
...
...
@@ -96,7 +96,7 @@ const RepoHelper = {
getContent
(
treeOrFile
)
{
let
file
=
treeOrFile
;
const
loadingData
=
this
.
setLoading
(
true
);
const
loadingData
=
RepoHelper
.
setLoading
(
true
);
Service
.
getContent
()
.
then
((
response
)
=>
{
...
...
@@ -133,8 +133,8 @@ const RepoHelper = {
}
}
else
{
// it's a tree
RepoHelper
.
setDirectoryOpen
(
file
);
const
newDirectory
=
this
.
dataToListOfFiles
(
data
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
);
const
newDirectory
=
RepoHelper
.
dataToListOfFiles
(
data
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
}
...
...
@@ -217,7 +217,7 @@ const RepoHelper = {
},
loadingError
()
{
new
Flash
(
'
Unable to load the file at this time.
'
);
// eslint-disable-line no-new
Flash
(
'
Unable to load the file at this time.
'
);
},
};
...
...
app/assets/javascripts/repo/repo_store.js
View file @
c7145944
...
...
@@ -98,19 +98,26 @@ const RepoStore = {
removeChildFilesOfTree
(
tree
)
{
let
foundTree
=
false
;
const
newTre
e
=
tree
;
const
treeToClos
e
=
tree
;
let
wereDone
=
false
;
RepoStore
.
files
=
RepoStore
.
files
.
filter
((
file
)
=>
{
if
(
file
.
url
===
newTree
.
url
)
foundTree
=
true
;
const
isItTheTreeWeWant
=
file
.
url
===
treeToClose
.
url
;
// if it's the next tree
if
(
foundTree
&&
file
.
type
===
'
tree
'
&&
!
isItTheTreeWeWant
)
{
wereDone
=
true
;
return
true
;
}
if
(
wereDone
)
return
true
;
if
(
isItTheTreeWeWant
)
foundTree
=
true
;
if
(
foundTree
)
return
file
.
level
<=
newTre
e
.
level
;
if
(
foundTree
)
return
file
.
level
<=
treeToClos
e
.
level
;
return
true
;
});
newTree
.
opened
=
false
;
newTree
.
icon
=
'
fa-folder
'
;
return
newTree
;
treeToClose
.
opened
=
false
;
treeToClose
.
icon
=
'
fa-folder
'
;
return
treeToClose
;
},
removeFromOpenedFiles
(
file
)
{
...
...
app/views/projects/tree/_tree_header.html.haml
View file @
c7145944
...
...
@@ -3,7 +3,7 @@
=
render
'shared/ref_switcher'
,
destination:
'tree'
,
path:
@path
.tree-controls
%a
.btn.btn-default
.btn-grouped
#editable-mode
{
"href"
=>
"#"
,
"@click.prevent"
=>
"editClicked"
,
"v-cloak"
=>
1
}
%a
.btn.btn-default
#editable-mode
{
"href"
=>
"#"
,
"@click.prevent"
=>
"editClicked"
,
"v-cloak"
=>
1
}
%i
{
":class"
=>
"buttonIcon"
}
%span
{{buttonLabel}}
...
...
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