@@ -168,6 +169,7 @@
Link
} from 'tiptap-extensions'
+ import OpenPane from './OpenPane';
import MetaEditor from './MetaEditor';
@@ -180,15 +182,18 @@
EditorContent,
EditorMenuBar,
EditorMenuBubble,
+ OpenPane,
MetaEditor
},
data() {
+ console.log(window.environments);
return {
nbWords: 0,
nbParagraphs: 0,
nbSentences: 0,
nbCharacters : 0,
- environmentName: 'typobasic',
+ isOpeningState: false,
+ environmentList : window.environments ? window.environments : [],
cssEnvElement : null,
isMetaEditorVisible: false,
isPreviewMode: false,
@@ -238,9 +243,6 @@
console.warn('Something went wrong.', err);
});
- this.addPrettyBackground();
-
-
},
methods: {
@@ -280,9 +282,9 @@
},
- installEnvironment() {
+ installEnvironment(envName) {
let self = this;
- Environment.getEnvironment(this.environmentName).then(async function (env) {
+ Environment.getEnvironment(envName).then(async function (env) {
if(!env)
alert('À venir.');
else {
@@ -323,7 +325,8 @@
},
newFile() {
- this.editor.setContent('
');
+ this.isOpeningState = true;
+ //this.editor.setContent('
');
},
htmlExport() {
@@ -335,11 +338,16 @@
//document.getElementById('preview_button').innerHTML = this.isPreviewMode ? '×' :'';
},
- addPrettyBackground(){
- let editorElement = document.querySelector('.ProseMirror');
- console.log(editorElement);
+ openEnvFile(envName){
+ this.isOpeningState = false;
+ if(envName){
+ this.installEnvironment(envName);
+ this.editor.setContent('
');
+ }
+
}
+
}
}
diff --git a/src/components/MetaEditor.vue b/src/components/MetaEditor.vue
index 387a81e..e87a0fc 100644
--- a/src/components/MetaEditor.vue
+++ b/src/components/MetaEditor.vue
@@ -1,20 +1,18 @@
-