mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
signature: fix using of window variable
This commit is contained in:
parent
68dcf4dd28
commit
1344b65dd4
@ -70,4 +70,10 @@ export interface SignatureZone {
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
}
|
||||
|
||||
export interface Signature {
|
||||
id: number,
|
||||
storedObject: StoredObject,
|
||||
zones: SignatureZone[],
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, Ref } from "vue";
|
||||
import { SignatureZone } from "../../types";
|
||||
import { Signature, SignatureZone } from "../../types";
|
||||
import * as pdfjsLib from "pdfjs-dist";
|
||||
import {
|
||||
PDFDocumentProxy,
|
||||
@ -44,56 +44,13 @@ let userSignatureZones: Ref<null | SignatureZone> = ref(null);
|
||||
let pdfSource: Ref<string> = ref("");
|
||||
let pdf = {} as PDFDocumentProxy;
|
||||
|
||||
const signature = {
|
||||
id: 1,
|
||||
// storedObject: {
|
||||
// filename: "gj72nCYsiuysZwZMTMVv5mhqmJdA",
|
||||
// keyInfos: {
|
||||
// alg: "A256CBC",
|
||||
// ext: true,
|
||||
// k: "WwEuXQqv5sJFzAM6P5q7Ecvbl2MiA9mE_MTQ1fAhVsY",
|
||||
// key_ops: ["encrypt", "decrypt"],
|
||||
// kty: "oct",
|
||||
// },
|
||||
// iv: [
|
||||
// 50, 124, 210, 52, 177, 145, 165, 156, 90, 186, 155, 252, 241, 54, 194, 79,
|
||||
// ],
|
||||
// },
|
||||
storedObject: {
|
||||
filename: "U2HmWk5MGkUW1vHRA5sMEMkW9fyf",
|
||||
keyInfos: {
|
||||
alg: "A256CBC",
|
||||
ext: true,
|
||||
k: "3GmJ8UBck3WhpmdoQy7cGQho0J9k9Rxhn23UIhqvpVY",
|
||||
key_ops: ["encrypt", "decrypt"],
|
||||
kty: "oct",
|
||||
},
|
||||
iv: [
|
||||
254, 171, 69, 203, 89, 3, 202, 29, 187, 200, 19, 146, 201, 253, 79, 169,
|
||||
],
|
||||
},
|
||||
zones: [
|
||||
{
|
||||
page: 1,
|
||||
pageWidth: 210,
|
||||
pageHeight: 297,
|
||||
x: 21, //from top-left corner
|
||||
y: 50,
|
||||
width: 80,
|
||||
height: 50,
|
||||
},
|
||||
{
|
||||
page: 3,
|
||||
pageWidth: 210,
|
||||
pageHeight: 297,
|
||||
x: 60, //from top-left corner
|
||||
y: 20,
|
||||
width: 80,
|
||||
height: 50,
|
||||
},
|
||||
],
|
||||
};
|
||||
declare global {
|
||||
interface Window {
|
||||
signature: Signature;
|
||||
}
|
||||
}
|
||||
|
||||
const signature = window.signature;
|
||||
const urlInfo = build_download_info_link(signature.storedObject.filename);
|
||||
|
||||
const mount_pdf = async (url: string) => {
|
||||
|
@ -11,11 +11,53 @@
|
||||
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||
<script type="text/javascript">
|
||||
const signature = {
|
||||
id: 1,
|
||||
storedObject: 'pKNlhCrQDCRsAuC8vYHDKa', // filename, should be maybe a full StoredObjectCreated
|
||||
zones: [
|
||||
{page: 1, origin: [0,0], x: 10, y: 10}
|
||||
]
|
||||
id: 1,
|
||||
// // storedObject: {
|
||||
// // filename: "gj72nCYsiuysZwZMTMVv5mhqmJdA",
|
||||
// // keyInfos: {
|
||||
// // alg: "A256CBC",
|
||||
// // ext: true,
|
||||
// // k: "WwEuXQqv5sJFzAM6P5q7Ecvbl2MiA9mE_MTQ1fAhVsY",
|
||||
// // key_ops: ["encrypt", "decrypt"],
|
||||
// // kty: "oct",
|
||||
// // },
|
||||
// // iv: [
|
||||
// // 50, 124, 210, 52, 177, 145, 165, 156, 90, 186, 155, 252, 241, 54, 194, 79,
|
||||
// // ],
|
||||
// // },
|
||||
storedObject: {
|
||||
filename: "U2HmWk5MGkUW1vHRA5sMEMkW9fyf",
|
||||
keyInfos: {
|
||||
alg: "A256CBC",
|
||||
ext: true,
|
||||
k: "3GmJ8UBck3WhpmdoQy7cGQho0J9k9Rxhn23UIhqvpVY",
|
||||
key_ops: ["encrypt", "decrypt"],
|
||||
kty: "oct",
|
||||
},
|
||||
iv: [
|
||||
254, 171, 69, 203, 89, 3, 202, 29, 187, 200, 19, 146, 201, 253, 79, 169,
|
||||
],
|
||||
},
|
||||
zones: [
|
||||
{
|
||||
page: 1,
|
||||
pageWidth: 210,
|
||||
pageHeight: 297,
|
||||
x: 21, //from top-left corner
|
||||
y: 50,
|
||||
width: 80,
|
||||
height: 50,
|
||||
},
|
||||
{
|
||||
page: 3,
|
||||
pageWidth: 210,
|
||||
pageHeight: 297,
|
||||
x: 60, //from top-left corner
|
||||
y: 20,
|
||||
width: 80,
|
||||
height: 50,
|
||||
},
|
||||
],
|
||||
};
|
||||
window.signature = signature;
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user