From 56df8234c7896f4044a45d1d40d569572776048f Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 18 Jun 2024 19:11:07 +0200 Subject: [PATCH] =?UTF-8?q?'this'-Schl=C3=BCsselwort=20in=20'Annotation'?= =?UTF-8?q?=20durch=20'Annotation'=20ersetzt,=20da=20dieser=20Schl=C3=BCss?= =?UTF-8?q?elwort=20statisch=20ist.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EnvelopeGenerator.Web/wwwroot/js/annotation.js | 18 +++++++++--------- EnvelopeGenerator.Web/wwwroot/js/app.js | 4 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index a2b877a8..02330ed7 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -3,7 +3,7 @@ const annotations = [] document.elements.forEach((element) => { - const [annotation, formField] = this.createAnnotationFromElement(element) + const [annotation, formField] = Annotation.createAnnotationFromElement(element) annotations.push(annotation) annotations.push(formField) }) @@ -24,14 +24,14 @@ } static async deleteAnnotations(instance) { - const allAnnotations = await this.getAnnotations(instance) - const pageAnnotations = allAnnotations.filter(this.isSignature) + const allAnnotations = await Annotation.getAnnotations(instance) + const pageAnnotations = allAnnotations.filter(Annotation.isSignature) //deleting all Annotations return await instance.delete(pageAnnotations) } static async validateAnnotations(instance) { - const allAnnotations = await this.getAnnotations(instance) + const allAnnotations = await Annotation.getAnnotations(instance) const pageAnnotations = allAnnotations .map((annotation) => { return annotation @@ -46,12 +46,12 @@ static createAnnotationFromElement(element) { const id = PSPDFKit.generateInstantId() - const width = this.inchToPoint(element.width) - const height = this.inchToPoint(element.height) - const top = this.inchToPoint(element.top) - height / 2 - const left = this.inchToPoint(element.left) - width / 2 + const width = Annotation.inchToPoint(element.width) + const height = Annotation.inchToPoint(element.height) + const top = Annotation.inchToPoint(element.top) - height / 2 + const left = Annotation.inchToPoint(element.left) - width / 2 const page = element.page - 1 - const annotation = this.createSignatureAnnotation( + const annotation = Annotation.createSignatureAnnotation( id, width, height, diff --git a/EnvelopeGenerator.Web/wwwroot/js/app.js b/EnvelopeGenerator.Web/wwwroot/js/app.js index 5f55c732..7e560e5f 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/app.js +++ b/EnvelopeGenerator.Web/wwwroot/js/app.js @@ -70,9 +70,7 @@ class App { // Load annotations into PSPDFKit try { this.signatureCount = this.currentDocument.elements.length - const annotations = Annotation.createAnnotations( - this.currentDocument - ) + const annotations = Annotation.createAnnotations(this.currentDocument) await this.Instance.create(annotations) const openResponse = await this.Network.openDocument(this.envelopeKey)