feat: init export html button
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"WFRP4SHEETPRINT.export.pdf": "Export to PDF"
|
"WFRP4SHEETPRINT.export.pdf": "Export to PDF",
|
||||||
|
"WFRP4SHEETPRINT.export.html": "Export to Html"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"WFRP4SHEETPRINT.export.pdf": "Exporter en PDF"
|
"WFRP4SHEETPRINT.export.pdf": "Exporter en PDF",
|
||||||
|
"WFRP4SHEETPRINT.export.html": "Exporter en Html"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
cp -r ./dist/* $LOCAL_FOUNDRY
|
cp -r ./dist/* $LOCAL_FOUNDRY
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
rm -fr dist
|
rm -fr dist
|
||||||
npm run build
|
npm run build
|
||||||
cp -r $MODULE_DIRS dist/
|
cp -r $MODULE_DIRS dist/
|
||||||
|
|||||||
15
src/main.ts
15
src/main.ts
@@ -30,6 +30,17 @@ Hooks.on('getActorDirectoryEntryContext', async (_, options) => {
|
|||||||
);
|
);
|
||||||
await generatePdf(actor);
|
await generatePdf(actor);
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18nLocalize('WFRP4SHEETPRINT.export.html'),
|
||||||
|
condition: isGM(),
|
||||||
|
icon: '<i class="fas fa-file-code"></i>',
|
||||||
|
callback: async (target) => {
|
||||||
|
const actor: Actor & any = (<any>game).actors.get(
|
||||||
|
target.attr('data-document-id')
|
||||||
|
);
|
||||||
|
await generateHtml(actor);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -60,6 +71,10 @@ function addActorSheetActionButton(
|
|||||||
title.after(button);
|
title.after(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function generateHtml(actor: Actor & any) {
|
||||||
|
console.dir(actor);
|
||||||
|
}
|
||||||
|
|
||||||
async function generatePdf(actor: Actor & any) {
|
async function generatePdf(actor: Actor & any) {
|
||||||
const actorData = actor.data;
|
const actorData = actor.data;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user