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
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
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
20 deletions
+45
-20
app/assets/javascripts/repo/components/repo_edit_button.vue
app/assets/javascripts/repo/components/repo_edit_button.vue
+14
-0
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+10
-14
app/assets/javascripts/repo/components/repo_preview.vue
app/assets/javascripts/repo/components/repo_preview.vue
+5
-5
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
+2
-1
app/assets/javascripts/repo/stores/repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+1
-0
app/assets/stylesheets/pages/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 {
...
@@ -24,6 +24,20 @@ export default {
Store
.
toggleBlobView
();
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
>
</
script
>
...
...
app/assets/javascripts/repo/components/repo_editor.vue
View file @
074b24c6
...
@@ -7,6 +7,13 @@ import Helper from '../helpers/repo_helper';
...
@@ -7,6 +7,13 @@ import Helper from '../helpers/repo_helper';
const
RepoEditor
=
{
const
RepoEditor
=
{
data
:
()
=>
Store
,
data
:
()
=>
Store
,
destroyed
()
{
// this.monacoInstance.getModels().forEach((m) => {
// m.dispose();
// });
this
.
monacoInstance
.
destroy
();
},
mounted
()
{
mounted
()
{
Service
.
getRaw
(
this
.
activeFile
.
raw_path
)
Service
.
getRaw
(
this
.
activeFile
.
raw_path
)
.
then
((
rawResponse
)
=>
{
.
then
((
rawResponse
)
=>
{
...
@@ -67,26 +74,15 @@ const RepoEditor = {
...
@@ -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
()
{
activeFileLabel
()
{
this
.
showHide
();
this
.
showHide
();
},
},
dialog
:
{
dialog
:
{
handler
(
obj
)
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
let
newObj
=
obj
;
obj
.
status
=
false
;
// eslint-disable-line no-param-reassign
if
(
newObj
.
status
)
{
newObj
.
status
=
false
;
this
.
openedFiles
.
map
((
file
)
=>
{
this
.
openedFiles
.
map
((
file
)
=>
{
const
f
=
file
;
const
f
=
file
;
if
(
f
.
active
)
{
if
(
f
.
active
)
{
...
...
app/assets/javascripts/repo/components/repo_preview.vue
View file @
074b24c6
<
script
>
<
script
>
import
Repo
Store
from
'
../stores/repo_store
'
;
import
Store
from
'
../stores/repo_store
'
;
export
default
{
export
default
{
data
:
()
=>
RepoStore
,
data
:
()
=>
Store
,
mounted
()
{
$
(
this
.
$el
).
find
(
'
.file-content
'
).
syntaxHighlight
();
},
computed
:
{
computed
:
{
html
()
{
html
()
{
return
this
.
activeFile
.
html
;
return
this
.
activeFile
.
html
;
...
@@ -11,13 +13,11 @@ export default {
...
@@ -11,13 +13,11 @@ export default {
},
},
watch
:
{
watch
:
{
html
()
{
html
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
$
(
this
.
$el
).
find
(
'
.file-content
'
).
syntaxHighlight
();
$
(
this
.
$el
).
find
(
'
.file-content
'
).
syntaxHighlight
();
});
});
}
}
}
}
}
}
</
script
>
</
script
>
...
...
app/assets/javascripts/repo/helpers/monaco_loader_helper.js
View file @
074b24c6
...
@@ -4,10 +4,11 @@ import RepoStore from '../stores/repo_store';
...
@@ -4,10 +4,11 @@ import RepoStore from '../stores/repo_store';
import
monacoLoader
from
'
../monaco_loader
'
;
import
monacoLoader
from
'
../monaco_loader
'
;
function
repoEditorLoader
()
{
function
repoEditorLoader
()
{
RepoStore
.
monacoLoading
=
true
;
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
RepoStore
.
monaco
=
monaco
;
RepoStore
.
monaco
=
monaco
;
RepoStore
.
monacoLoading
=
false
;
resolve
(
RepoEditor
);
resolve
(
RepoEditor
);
});
});
});
});
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
074b24c6
...
@@ -5,6 +5,7 @@ import RepoService from '../services/repo_service';
...
@@ -5,6 +5,7 @@ import RepoService from '../services/repo_service';
const
RepoStore
=
{
const
RepoStore
=
{
ideEl
:
{},
ideEl
:
{},
monaco
:
{},
monaco
:
{},
monacoLoading
:
false
,
monacoInstance
:
{},
monacoInstance
:
{},
service
:
''
,
service
:
''
,
editor
:
''
,
editor
:
''
,
...
...
app/assets/stylesheets/pages/repo.scss
View file @
074b24c6
...
@@ -7,6 +7,19 @@
...
@@ -7,6 +7,19 @@
transition
:
opacity
.5s
;
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
{
.modal.popup-dialog
{
display
:
block
;
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