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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7869cbaa
Commit
7869cbaa
authored
Jun 30, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gets syntax highlighting working.
parent
7216a1f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+3
-1
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+6
-1
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-0
No files found.
app/assets/javascripts/repo/repo_editor.js
View file @
7869cbaa
/* global monaco */
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
import
Helper
from
'
./repo_helper
'
export
default
class
RepoEditor
{
constructor
()
{
...
...
@@ -17,6 +18,7 @@ export default class RepoEditor {
model
:
null
}
)
Helper
.
monacoInstance
=
monaco
;
this
.
initVue
();
});
}
...
...
@@ -59,7 +61,7 @@ export default class RepoEditor {
self
.
monacoEditor
.
setModel
(
monaco
.
editor
.
createModel
(
this
.
blobRaw
,
'
plain
'
this
.
activeFile
.
mime_type
)
);
}
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
7869cbaa
...
...
@@ -6,12 +6,14 @@ let RepoHelper = {
return
data
.
hasOwnProperty
(
'
blobs
'
);
},
monacoInstance
:
undefined
,
Time
:
window
.
performance
&&
window
.
performance
.
now
?
window
.
performance
:
Date
,
getLanguagesForMimeType
(
mimetypeNeedle
,
monaco
)
{
getLanguagesForMimeType
(
mimetypeNeedle
)
{
const
langs
=
monaco
.
languages
.
getLanguages
();
let
lang
=
''
;
langs
.
every
((
lang
)
=>
{
...
...
@@ -62,6 +64,9 @@ let RepoHelper = {
setActiveFile
(
file
)
{
Store
.
openedFiles
=
Store
.
openedFiles
.
map
((
openedFile
)
=>
{
openedFile
.
active
=
file
.
url
===
openedFile
.
url
;
if
(
openedFile
.
active
)
{
Store
.
activeFile
=
openedFile
;
}
return
openedFile
;
});
Store
.
blobRaw
=
file
.
plain
;
...
...
app/assets/javascripts/repo/repo_store.js
View file @
7869cbaa
...
...
@@ -10,6 +10,7 @@ let RepoStore = {
blobRaw
:
''
,
blobRendered
:
''
,
openedFiles
:
[],
activeFile
:
''
,
files
:
[]
};
export
default
RepoStore
;
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