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
074b24c6
Commit
074b24c6
authored
Aug 03, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add loader and fix bugs
parent
6708ce25
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
20 deletions
+45
-20
repo_edit_button.vue
app/assets/javascripts/repo/components/repo_edit_button.vue
+14
-0
repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+10
-14
repo_preview.vue
app/assets/javascripts/repo/components/repo_preview.vue
+5
-5
monaco_loader_helper.js
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
+2
-1
repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+1
-0
repo.scss
app/assets/stylesheets/pages/repo.scss
+13
-0
No files found.
app/assets/javascripts/repo/components/repo_edit_button.vue
View file @
074b24c6
...
...
@@ -24,6 +24,20 @@ export default {
Store
.
toggleBlobView
();
},
},
watch
:
{
editMode
()
{
if
(
this
.
editMode
)
{
$
(
'.project-refs-form'
).
addClass
(
'disabled'
);
$
(
'.fa-long-arrow-right'
).
show
();
$
(
'.project-refs-target-form'
).
show
();
}
else
{
$
(
'.project-refs-form'
).
removeClass
(
'disabled'
);
$
(
'.fa-long-arrow-right'
).
hide
();
$
(
'.project-refs-target-form'
).
hide
();
}
},
}
}
</
script
>
...
...
app/assets/javascripts/repo/components/repo_editor.vue
View file @
074b24c6
...
...
@@ -7,6 +7,13 @@ import Helper from '../helpers/repo_helper';
const
RepoEditor
=
{
data
:
()
=>
Store
,
destroyed
()
{
// this.monacoInstance.getModels().forEach((m) => {
// m.dispose();
// });
this
.
monacoInstance
.
destroy
();
},
mounted
()
{
Service
.
getRaw
(
this
.
activeFile
.
raw_path
)
.
then
((
rawResponse
)
=>
{
...
...
@@ -67,26 +74,15 @@ const RepoEditor = {
});
},
editMode
()
{
if
(
this
.
editMode
)
{
$
(
'.project-refs-form'
).
addClass
(
'disabled'
);
$
(
'.fa-long-arrow-right'
).
show
();
$
(
'.project-refs-target-form'
).
show
();
}
else
{
$
(
'.project-refs-form'
).
removeClass
(
'disabled'
);
$
(
'.fa-long-arrow-right'
).
hide
();
$
(
'.project-refs-target-form'
).
hide
();
}
},
activeFileLabel
()
{
this
.
showHide
();
},
dialog
:
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
obj
.
status
=
false
;
// eslint-disable-line no-param-reassign
let
newObj
=
obj
;
if
(
newObj
.
status
)
{
newObj
.
status
=
false
;
this
.
openedFiles
.
map
((
file
)
=>
{
const
f
=
file
;
if
(
f
.
active
)
{
...
...
app/assets/javascripts/repo/components/repo_preview.vue
View file @
074b24c6
<
script
>
import
Repo
Store
from
'../stores/repo_store'
;
import
Store
from
'../stores/repo_store'
;
export
default
{
data
:
()
=>
RepoStore
,
data
:
()
=>
Store
,
mounted
()
{
$
(
this
.
$el
).
find
(
'.file-content'
).
syntaxHighlight
();
},
computed
:
{
html
()
{
return
this
.
activeFile
.
html
;
...
...
@@ -11,13 +13,11 @@ export default {
},
watch
:
{
html
()
{
this
.
$nextTick
(()
=>
{
$
(
this
.
$el
).
find
(
'.file-content'
).
syntaxHighlight
();
});
}
}
}
</
script
>
...
...
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
View file @
074b24c6
...
...
@@ -4,10 +4,11 @@ import RepoStore from '../stores/repo_store';
import
monacoLoader
from
'../monaco_loader'
;
function
repoEditorLoader
()
{
RepoStore
.
monacoLoading
=
true
;
return
new
Promise
((
resolve
)
=>
{
monacoLoader
([
'vs/editor/editor.main'
],
()
=>
{
RepoStore
.
monaco
=
monaco
;
RepoStore
.
monacoLoading
=
false
;
resolve
(
RepoEditor
);
});
});
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
074b24c6
...
...
@@ -5,6 +5,7 @@ import RepoService from '../services/repo_service';
const
RepoStore
=
{
ideEl
:
{},
monaco
:
{},
monacoLoading
:
false
,
monacoInstance
:
{},
service
:
''
,
editor
:
''
,
...
...
app/assets/stylesheets/pages/repo.scss
View file @
074b24c6
...
...
@@ -7,6 +7,19 @@
transition
:
opacity
.5s
;
}
.blob-viewer
{
padding
:
20px
;
}
.monaco-loader
{
position
:
absolute
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0
.2
);
}
.modal.popup-dialog
{
display
:
block
;
...
...
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