add pdf and html framing in creations

This commit is contained in:
axolotle
2021-10-22 18:32:12 +02:00
parent f53e6c442b
commit eaa6b6ff8a
4 changed files with 25 additions and 4 deletions
+4
View File
@@ -34,6 +34,10 @@ fragment NodePartial on MapItemInterface {
url,
title
}
files: fichiers {
filemime
url
}
}
# For debug
+7 -3
View File
@@ -44,14 +44,18 @@
<b-modal
v-if="creation && creation.piece.url"
v-if="creation && creation.iframeUrl"
:id="'modal-creation' + creation.id"
class="modal-creation"
static hide-footer hide-header
>
<template #default="{ hide }">
<template #default="{ hide, visible }">
<button-expand expanded @click="hide()" />
<iframe :src="creation.piece.url" width="100%" height="100%" />
<iframe
v-if="visible"
:src="creation.iframeUrl"
width="100%" height="100%"
/>
</template>
</b-modal>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="node-view-img-wrapper">
<img :src="node.image.url" :alt="node.image.alt">
<button-expand v-if="node.piece.url" v-b-modal="'modal-creation' + node.id" class="center" />
<button-expand v-if="node.iframeUrl" v-b-modal="'modal-creation' + node.id" class="center" />
<div class="btns-artwork">
<b-button variant="depart" class="btn-shadow btn-artwork mr-2" @click="$emit('view-origin')">
+13
View File
@@ -40,6 +40,19 @@ export default {
if (node.type === 'Creation') {
node.variant = [{ id: 0 }]
if (node.files && node.files.length) {
const mime = node.files[0].filemime
if (mime === 'application/pdf') {
node.iframeUrl = node.files[0].url + '#toolbar=0&navpanes=0&statusbar=0'
} else if (mime === 'text/html') {
node.iframeUrl = node.files[0].url
} else if (node.piece && node.piece.url) {
node.iframeUrl = node.piece.url
}
}
} else if (node.piece && node.piece.url) {
node.iframeUrl = node.piece.url
}
}
if (node.date) {