BigW Consortium Gitlab

Commit 2041ee57 by Jacob Schatz

Shows plain text editor with contents of blob.

parent c1281fe0
/* global monaco */
import Sidebar from './repo_sidebar' import Sidebar from './repo_sidebar'
import Editor from './repo_editor' import Editor from './repo_editor'
import Service from './repo_service' import Service from './repo_service'
......
/* global monaco */
import Vue from 'vue'; import Vue from 'vue';
import Store from './repo_store' import Store from './repo_store'
...@@ -9,26 +10,30 @@ export default class RepoEditor { ...@@ -9,26 +10,30 @@ export default class RepoEditor {
initMonaco() { initMonaco() {
window.require.config({ paths: { vs: '/monaco-editor/min/vs' } }); window.require.config({ paths: { vs: '/monaco-editor/min/vs' } });
window.require(['vs/editor/editor.main'], () => { window.require(['vs/editor/editor.main'], () => {
this.monaco = monaco. this.monacoEditor = monaco.editor
create( .create(
document.getElementById('ide'), { document.getElementById('ide'), {
model: null model: null
} }
) )
console.log("HELLLOOOO!!!")
this.initVue(); this.initVue();
}); });
} }
initVue() { initVue() {
const editor = this.editor; const monacoEditor = this.monacoEditor;
this.vue = new Vue({ this.vue = new Vue({
el: '#ide',
data: () => Store, data: () => Store,
created () { created () {
if(this.blobRaw !== ''){ if(this.blobRaw !== ''){
console.log('models', this.monaco.getModels()); console.log(monacoEditor)
monacoEditor.setModel(
monaco.editor.createModel(
this.blobRaw,
'plain'
)
);
} }
}, },
...@@ -37,7 +42,7 @@ export default class RepoEditor { ...@@ -37,7 +42,7 @@ export default class RepoEditor {
if(this.isTree) { if(this.isTree) {
} else { } else {
// this.blobRaw // this.blobRaw
console.log('models', editor.getModels()) // console.log('models', editor.getModels())
} }
} }
} }
......
...@@ -24,9 +24,5 @@ export default class RepoSidebar { ...@@ -24,9 +24,5 @@ export default class RepoSidebar {
}); });
} }
initVue() { initVue() {}
this.vue = new Vue({
});
}
} }
\ No newline at end of file
...@@ -8,4 +8,5 @@ ...@@ -8,4 +8,5 @@
= render "projects/blob/auxiliary_viewer", blob: blob = render "projects/blob/auxiliary_viewer", blob: blob
#blob-content-holder.blob-content-holder #blob-content-holder.blob-content-holder
%p hi
#ide{ data: { url: repo_url }, style: "height:400px;" } #ide{ data: { url: repo_url }, style: "height:400px;" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment