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
62303530
Commit
62303530
authored
Jul 29, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move repoEditorLoader to index and change repo_editor to vue comp
parent
6f88402f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+12
-1
app/assets/javascripts/repo/repo_editor.vue
app/assets/javascripts/repo/repo_editor.vue
+6
-16
spec/javascripts/repo/repo_editor_spec.js
spec/javascripts/repo/repo_editor_spec.js
+1
-1
No files found.
app/assets/javascripts/repo/index.js
View file @
62303530
...
...
@@ -9,10 +9,21 @@ import RepoCommitSection from './repo_commit_section.vue';
import
RepoTabs
from
'
./repo_tabs.vue
'
;
import
RepoFileButtons
from
'
./repo_file_buttons.vue
'
;
import
RepoBinaryViewer
from
'
./repo_binary_viewer.vue
'
;
import
{
repoEditorLoader
}
from
'
./repo_editor
'
;
import
RepoEditor
from
'
./repo_editor.vue
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
import
RepoMixin
from
'
./repo_mixin
'
;
import
PopupDialog
from
'
../vue_shared/components/popup_dialog.vue
'
function
repoEditorLoader
()
{
return
new
Promise
((
resolve
)
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
Store
.
monaco
=
monaco
;
resolve
(
RepoEditor
);
});
});
}
function
addEventsForNonVueEls
()
{
$
(
document
).
on
(
'
change
'
,
'
.dropdown
'
,
()
=>
{
Store
.
targetBranch
=
$
(
'
.project-refs-target-form input[name="ref"]
'
).
val
();
...
...
app/assets/javascripts/repo/repo_editor.
js
→
app/assets/javascripts/repo/repo_editor.
vue
View file @
62303530
<
script
>
/* global monaco */
import
Store
from
'
./repo_store
'
;
import
Helper
from
'
./repo_helper
'
;
import
monacoLoader
from
'
./monaco_loader
'
;
const
RepoEditor
=
{
data
:
()
=>
Store
,
template
:
'
<div id="ide"></div>
'
,
mounted
()
{
const
monacoInstance
=
this
.
monaco
.
editor
.
create
(
this
.
$el
,
{
model
:
null
,
...
...
@@ -106,17 +104,9 @@ const RepoEditor = {
},
};
function
repoEditorLoader
()
{
return
new
Promise
((
resolve
)
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
Store
.
monaco
=
monaco
;
export
default
RepoEditor
;
</
script
>
resolve
(
RepoEditor
);
});
});
}
export
{
RepoEditor
as
default
,
repoEditorLoader
,
};
<
template
>
<div
id=
"ide"
></div>
</
template
>
spec/javascripts/repo/repo_editor_spec.js
View file @
62303530
import
Vue
from
'
vue
'
;
import
repoEditor
from
'
~/repo/repo_editor
'
;
import
repoEditor
from
'
~/repo/repo_editor
.vue
'
;
import
RepoStore
from
'
~/repo/repo_store
'
;
describe
(
'
RepoEditor
'
,
()
=>
{
...
...
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