je ne sais plus se que contient se commit
This commit is contained in:
parent
c4892e919c
commit
309111c23a
6 changed files with 102 additions and 13 deletions
|
|
@ -29,7 +29,8 @@
|
|||
"php-http/guzzle7-adapter": "^1.1",
|
||||
"mailersend/mailersend": "^0.28.0",
|
||||
"sylvainjule/code-editor": "^1.0",
|
||||
"tobimori/kirby-seo": "^1.1"
|
||||
"tobimori/kirby-seo": "^1.1",
|
||||
"splorp/paperback-export": "^2.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
|
|
|
|||
51
composer.lock
generated
51
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "30f9edc8f90ec79150fffac01e3b80fd",
|
||||
"content-hash": "8ef02ef5b3cde9ff5bc677b8766397a3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "beberlei/assert",
|
||||
|
|
@ -2292,6 +2292,55 @@
|
|||
],
|
||||
"time": "2025-01-31T14:54:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "splorp/paperback-export",
|
||||
"version": "2.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/splorp/kirby-paperback-export.git",
|
||||
"reference": "94a43248af69040f1144700262e35842ce6602ff"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/splorp/kirby-paperback-export/zipball/94a43248af69040f1144700262e35842ce6602ff",
|
||||
"reference": "94a43248af69040f1144700262e35842ce6602ff",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"getkirby/composer-installer": "^1.1"
|
||||
},
|
||||
"type": "kirby-plugin",
|
||||
"extra": {
|
||||
"installer-name": "paperback-export"
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grant Hutchinson",
|
||||
"email": "grant@splorp.com",
|
||||
"homepage": "https://splorp.com/"
|
||||
}
|
||||
],
|
||||
"description": "Export Kirby CMS content for use with the PaperBack Book Maker",
|
||||
"homepage": "https://github.com/splorp/kirby-paperback-export",
|
||||
"keywords": [
|
||||
"kirby",
|
||||
"kirby-cms",
|
||||
"kirby-plugin",
|
||||
"newton-book",
|
||||
"newton-os",
|
||||
"paperback-book-maker"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://github.com/splorp/kirby-paperback-export/blob/master/readme.md",
|
||||
"issues": "https://github.com/splorp/kirby-paperback-export/issues",
|
||||
"source": "https://github.com/splorp/kirby-paperback-export"
|
||||
},
|
||||
"time": "2025-06-25T20:50:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sylvainjule/code-editor",
|
||||
"version": "1.1.0",
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ tabs:
|
|||
contentTab:
|
||||
label: Contenu
|
||||
sections:
|
||||
epub-export:
|
||||
type: epubexport
|
||||
headline: "Exporter cette page"
|
||||
bodySection:
|
||||
label: Corps
|
||||
type: fields
|
||||
fields:
|
||||
epub-export:
|
||||
type: epubexport
|
||||
headline: "Exporter cette page"
|
||||
pdfVersion:
|
||||
label: version pdf
|
||||
help: glisser ici le fichier pdf généré avec `ctrl + p` depuis la page du site
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@ Kirby::plugin('tonnom/epub-export', [
|
|||
'pattern' => 'epub-export/(:any)',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
|
||||
$pageId = get('id');
|
||||
$page = page($pageId);
|
||||
throw new Exception($page);
|
||||
|
||||
throw new Exception($pageId);
|
||||
if (!$page) {
|
||||
throw new Exception("Page introuvable");
|
||||
}
|
||||
|
|
@ -37,14 +39,13 @@ Kirby::plugin('tonnom/epub-export', [
|
|||
]
|
||||
],
|
||||
|
||||
'sections' => [
|
||||
'fields' => [
|
||||
'epubexport' => [
|
||||
'props' => [
|
||||
'computed' => [
|
||||
'pageId' => function () {
|
||||
return $this->model()->id();
|
||||
},
|
||||
],
|
||||
'component' => 'export-button'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</k-box>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<!-- <script>
|
||||
export default {
|
||||
props: {
|
||||
pageId: String
|
||||
|
|
@ -29,8 +29,7 @@
|
|||
async exportEpub() {
|
||||
this.loading = true;
|
||||
this.error = null;
|
||||
|
||||
console.log(this.pageId)
|
||||
|
||||
try {
|
||||
const response = await this.$api.post(`epub-export/${this.pageId}`);
|
||||
const blob = await response.blob()
|
||||
|
|
@ -52,4 +51,42 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
</script> -->
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
// Props
|
||||
const { pageId } = defineProps({
|
||||
pageId: String
|
||||
})
|
||||
|
||||
// State
|
||||
const loading = ref(false)
|
||||
const error = ref(null)
|
||||
|
||||
// Methods
|
||||
async function exportEpub() {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
// Appel API
|
||||
const response = await $api.post(`epub-export/${pageId}`)
|
||||
const blob = await response.blob()
|
||||
|
||||
// Création du téléchargement
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = pageId + '.epub'
|
||||
a.click()
|
||||
|
||||
} catch (e) {
|
||||
error.value = 'Erreur : ' + e.message
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import ExportButton from "./components/ExportButton.vue";
|
||||
|
||||
window.panel.plugin("tonnom/epub-export", {
|
||||
sections: {
|
||||
fields: {
|
||||
epubexport: ExportButton
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue