From 7c87073ccaaa055d517b295d41fce4ee93bfa907 Mon Sep 17 00:00:00 2001 From: choj Date: Tue, 12 May 2020 18:57:01 +0200 Subject: [PATCH] =?UTF-8?q?1=20env=20seulement=20pr=20d=C3=A9faut,=20pas?= =?UTF-8?q?=20de=20choix=20d'env=20si=201=20seul=20de=20dispo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/env/envlist.json | 8 ++++---- src/components/Dedediteur.vue | 28 +++++++++++++++++++++++----- src/environments/Environement.js | 13 ++++++++----- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/public/env/envlist.json b/public/env/envlist.json index 4eed498..6bc0612 100644 --- a/public/env/envlist.json +++ b/public/env/envlist.json @@ -3,8 +3,8 @@ window.environments = [ 'name':'typobasic', 'desc': "Environnement de rédaction contenant l'ensemble des élements typographiques de base." }, - { - 'name':'courrier', - 'desc': "Environnement permettant la rédaction d'un courrier." - } +// { +// 'name':'courrier', +// 'desc': "Environnement permettant la rédaction d'un courrier." +// } ]; diff --git a/src/components/Dedediteur.vue b/src/components/Dedediteur.vue index 37af507..a04335a 100644 --- a/src/components/Dedediteur.vue +++ b/src/components/Dedediteur.vue @@ -137,9 +137,22 @@ T4 + + + @@ -186,7 +199,6 @@ MetaEditor }, data() { - console.log(window.environments); return { nbWords: 0, nbParagraphs: 0, @@ -206,6 +218,7 @@ new Heading({levels: [1, 2, 3]}), new ListItem(), new OrderedList(), + new BulletList(), new Link(), new CustomStyle() ], @@ -325,8 +338,13 @@ }, newFile() { - this.isOpeningState = true; - //this.editor.setContent('

'); + console.log(this.environmentList.length) + if(this.environmentList.length > 1) { + this.isOpeningState = true; + } + else{ + this.openEnvFile(this.environmentList[0].name) + } }, htmlExport() { @@ -335,7 +353,6 @@ htmlPreview(){ this.isPreviewMode = ! this.isPreviewMode; - //document.getElementById('preview_button').innerHTML = this.isPreviewMode ? '×' :''; }, openEnvFile(envName){ @@ -370,6 +387,7 @@ font-size: 0.8rem; display: flex; align-items: center; + padding-left: $button-width; div { display: flex; diff --git a/src/environments/Environement.js b/src/environments/Environement.js index 733581a..a51afb8 100644 --- a/src/environments/Environement.js +++ b/src/environments/Environement.js @@ -14,7 +14,9 @@ export default class Environment { T2: true, T3: true, T4: true, - quote: true + quote: true, + ul: true, + ol: true }, characters: [ @@ -78,6 +80,10 @@ export default class Environment { { label: "typo", styles: [ + { + "label": "italique", + "class": "emphasis" + }, { "label": "indice", "class": "subscript" @@ -85,11 +91,8 @@ export default class Environment { { "label": "exposant", "class": "superscript" - }, - { - "label": "emphase", - "class": "emphasis" } + ] } ],