BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+3
-1
repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+6
-1
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