1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-30 13:14:20 +00:00

consolidation

This commit is contained in:
Maxime Moraine 2020-05-22 19:04:27 +02:00
parent dcc6e47645
commit 4cb6e1d07b
5 changed files with 157 additions and 15 deletions

View file

@ -188,7 +188,7 @@ module.exports = {
}
],
themeConfig: {
domain: 'https://staging.heros-et-dragons.fr',
domain: 'https://heros-et-dragons.fr',
repository: 'https://github.com/em-squared/heros-et-dragons-drs',
kofi: 'https://ko-fi.com/S6S410PB8',
forum: 'https://www.black-book-editions.fr/forums.php?board_id=115',

View file

@ -114,7 +114,7 @@ export default {
customAttunement: '',
magicItem: {
custom: true,
pid: 'magicItem',
pid: 'magicitem',
key: null,
title: '',
content: '',

View file

@ -9,15 +9,40 @@
<h1>Mes objets magiques</h1>
<div class="my-4 d-flex flex-wrap d-print-none">
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print" :disabled="$store.state.myMagicItems.magicItems.length <= 0"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download" :disabled="$store.state.myMagicItems.magicItems.length <= 0"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed :loading="isUploading" @click="onUploadClick">
<v-icon left>mdi-file-upload</v-icon> Charger
</v-btn>
<input ref="uploader" class="d-none" type="file" @change="upload">
<v-btn outlined color="error" class="mb-1" depressed @click="$store.commit('myMagicItems/resetMagicItems')"><v-icon>mdi-delete</v-icon> Effacer les objets magiques</v-btn>
<v-btn outlined color="error" class="mb-1" depressed @click.stop="confirmDeleteDialog = true" :disabled="$store.state.myMagicItems.magicItems.length <= 0"><v-icon>mdi-delete</v-icon> Effacer les objets magiques</v-btn>
</div>
<v-dialog v-model="confirmDeleteDialog" max-width="290">
<v-card>
<v-card-title class="headline">Supprimer les objets magiques</v-card-title>
<v-card-text>
Cette action supprimera tous les objets magiques ajoutés à votre bibliothèque, y compris les objets magiques que vous avez créés. Souhaitez vous les supprimer ?
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn depressed @click="confirmDeleteDialog = false">
Annuler
</v-btn>
<v-btn color="error darken-1" depressed @click="confirmDeletion">
Supprimer
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-alert v-model="alertOpen" :type="alertType" dismissible transition="fade-transition">
{{ alertText }}
</v-alert>
<MyMagicItems />
</div>
</template>
@ -37,7 +62,11 @@ export default {
data () {
return {
isUploading: false
isUploading: false,
confirmDeleteDialog: false,
alertOpen: false,
alertText: null,
alertType: "info"
}
},
@ -50,6 +79,10 @@ export default {
upload (e) {
let file = e.target.files[0]
console.log(file)
if (!file) {
return
}
let reader = new FileReader()
let self = this
@ -58,20 +91,30 @@ export default {
let isValid = true
if (result.magicItems && result.magicItems.length >= 1) {
for (var s of result.magicItems) {
if (s.pid !== 'magicItem') {
if (s.pid !== 'magicitem') {
isValid = false
}
}
} else {
isValid = false
}
if (isValid) {
self.$store.commit('myMagicItems/setMagicItems', result.magicItems)
if (result.notPrintedMagicItems) {
self.$store.commit('myMagicItems/setNotPrintedMagicItems', result.notPrintedMagicItems)
}
self.alertText = self.$store.state.myMagicItems.magicItems.length + " objets magiques inscrits dans la bibliothèque."
self.alertType = "success"
self.alertOpen = true
} else {
self.alertText = "Le fichier est invalide."
self.alertType = "error"
self.alertOpen = true
}
}
reader.readAsText(file)
this.$refs.uploader.value = ''
},
onUploadClick () {
@ -85,6 +128,11 @@ export default {
print () {
window.print()
},
confirmDeletion () {
this.$store.commit('myMagicItems/resetMagicItems')
this.confirmDeleteDialog = false
}
},

View file

@ -9,15 +9,40 @@
<h1>Mon bestiaire</h1>
<div class="my-4 d-flex flex-wrap d-print-none">
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print" :disabled="$store.state.myMonsters.monsters.length <= 0"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download" :disabled="$store.state.myMonsters.monsters.length <= 0"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed :loading="isUploading" @click="onUploadClick">
<v-icon left>mdi-file-upload</v-icon> Charger
</v-btn>
<input ref="uploader" class="d-none" type="file" @change="upload">
<v-btn outlined color="error" class="mb-1" depressed @click="$store.commit('myMonsters/resetMonsters')"><v-icon>mdi-delete</v-icon> Effacer le bestiaire</v-btn>
<v-btn outlined color="error" class="mb-1" depressed @click.stop="confirmDeleteDialog = true" :disabled="$store.state.myMonsters.monsters.length <= 0"><v-icon>mdi-delete</v-icon> Effacer le bestiaire</v-btn>
</div>
<v-dialog v-model="confirmDeleteDialog" max-width="290">
<v-card>
<v-card-title class="headline">Supprimer le bestiaire</v-card-title>
<v-card-text>
Cette action supprimera tous les monstres ajoutés à votre bestiaire, y compris les monstres que vous avez créés. Souhaitez vous les supprimer ?
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn depressed @click="confirmDeleteDialog = false">
Annuler
</v-btn>
<v-btn color="error darken-1" depressed @click="confirmDeletion">
Supprimer
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-alert v-model="alertOpen" :type="alertType" dismissible transition="fade-transition">
{{ alertText }}
</v-alert>
<MyMonsters />
</div>
</template>
@ -37,7 +62,11 @@ export default {
data () {
return {
isUploading: false
isUploading: false,
confirmDeleteDialog: false,
alertOpen: false,
alertText: null,
alertType: "info"
}
},
@ -50,6 +79,9 @@ export default {
upload (e) {
let file = e.target.files[0]
if (!file) {
return
}
let reader = new FileReader()
let self = this
@ -62,16 +94,26 @@ export default {
isValid = false
}
}
} else {
isValid = false
}
if (isValid) {
self.$store.commit('myMonsters/setMonsters', result.monsters)
if (result.notPrintedMonsters) {
self.$store.commit('myMonsters/setNotPrintedMonsters', result.notPrintedMonsters)
}
self.alertText = self.$store.state.myMonsters.monsters.length + " monstres inscrits dans le bestiaire."
self.alertType = "success"
self.alertOpen = true
} else {
self.alertText = "Le fichier est invalide."
self.alertType = "error"
self.alertOpen = true
}
}
reader.readAsText(file)
this.$refs.uploader.value = ''
},
onUploadClick () {
@ -85,6 +127,11 @@ export default {
print () {
window.print()
},
confirmDeletion () {
this.$store.commit('myMonsters/resetMonsters')
this.confirmDeleteDialog = false
}
},

View file

@ -11,15 +11,40 @@
<h1>Mon grimoire</h1>
<div class="my-4 d-flex flex-wrap d-print-none">
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="print" :disabled="$store.state.mySpells.spells.length <= 0"><v-icon>mdi-printer</v-icon> Imprimer</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed @click="download" :disabled="$store.state.mySpells.spells.length <= 0"><v-icon>mdi-file-download</v-icon> Sauvegarder</v-btn>
<v-btn outlined color="accent" class="mr-1 mb-1" depressed :loading="isUploading" @click="onUploadClick">
<v-icon left>mdi-file-upload</v-icon> Charger
</v-btn>
<input ref="uploader" class="d-none" type="file" @change="upload">
<v-btn outlined color="error" class="mb-1" depressed @click="$store.commit('mySpells/resetSpells')"><v-icon>mdi-delete</v-icon> Effacer le grimoire</v-btn>
<v-btn outlined color="error" class="mb-1" depressed @click.stop="confirmDeleteDialog = true" :disabled="$store.state.mySpells.spells.length <= 0"><v-icon>mdi-delete</v-icon> Effacer le grimoire</v-btn>
</div>
<v-dialog v-model="confirmDeleteDialog" max-width="290">
<v-card>
<v-card-title class="headline">Supprimer le grimoire</v-card-title>
<v-card-text>
Cette action supprimera tous les sorts ajoutés à votre grimoire, y compris les sorts que vous avez créés. Souhaitez vous les supprimer ?
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn depressed @click="confirmDeleteDialog = false">
Annuler
</v-btn>
<v-btn color="error darken-1" depressed @click="confirmDeletion">
Supprimer
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-alert v-model="alertOpen" :type="alertType" dismissible transition="fade-transition">
{{ alertText }}
</v-alert>
<MySpells />
</div>
</template>
@ -39,7 +64,11 @@ export default {
data () {
return {
isUploading: false
isUploading: false,
confirmDeleteDialog: false,
alertOpen: false,
alertText: null,
alertType: "info"
}
},
@ -52,6 +81,9 @@ export default {
upload (e) {
let file = e.target.files[0]
if (!file) {
return
}
let reader = new FileReader()
let self = this
@ -64,6 +96,8 @@ export default {
isValid = false
}
}
} else {
isValid = false
}
if (isValid) {
self.$store.commit('mySpells/setSpells', result.spells)
@ -73,10 +107,18 @@ export default {
if (result.notPrintedSpells) {
self.$store.commit('mySpells/setNotPrintedSpells', result.notPrintedSpells)
}
self.alertText = self.$store.state.mySpells.spells.length + " sorts inscrits dans le grimoire."
self.alertType = "success"
self.alertOpen = true
} else {
self.alertText = "Le fichier est invalide."
self.alertType = "error"
self.alertOpen = true
}
}
reader.readAsText(file)
this.$refs.uploader.value = ''
},
onUploadClick () {
@ -90,6 +132,11 @@ export default {
print () {
window.print()
},
confirmDeletion () {
this.$store.commit('mySpells/resetSpells')
this.confirmDeleteDialog = false
}
},