From a35f06070aaa561545a26c8da8c520b26d26bb30 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 19 Jan 2026 17:03:05 +0100 Subject: [PATCH] Remove total page count logging after PSPDFKit load Refactored ui.js and ui.min.js to eliminate retrieval and logging of the total page count after loading the PSPDFKit instance. The code now returns the instance directly after setting up the page change event listener, reducing unnecessary logging and simplifying the load process. --- EnvelopeGenerator.Web/wwwroot/js/ui.js | 3 --- EnvelopeGenerator.Web/wwwroot/js/ui.min.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/EnvelopeGenerator.Web/wwwroot/js/ui.js b/EnvelopeGenerator.Web/wwwroot/js/ui.js index cae28f04..c39eba8e 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/ui.js +++ b/EnvelopeGenerator.Web/wwwroot/js/ui.js @@ -21,9 +21,6 @@ console.log('Active page:', pageIndex + 1) }) - const totalPages = instance.totalPageCount || 0 - console.log('All pages loaded, total pages:', totalPages) - return instance }) } diff --git a/EnvelopeGenerator.Web/wwwroot/js/ui.min.js b/EnvelopeGenerator.Web/wwwroot/js/ui.min.js index 06610632..69c1049c 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/ui.min.js +++ b/EnvelopeGenerator.Web/wwwroot/js/ui.min.js @@ -1,4 +1,4 @@ -function loadPSPDFKit(n,t,i,r){return PSPDFKit.load({inlineWorkers:!1,locale:r,licenseKey:i,styleSheets:["/css/site.css"],container:t,document:n,annotationPresets:getPresets(),electronicSignatures:{creationModes:["DRAW","TYPE","IMAGE"]},initialViewState:new PSPDFKit.ViewState({sidebarMode:PSPDFKit.SidebarMode.THUMBNAILS}),isEditableAnnotation:function(n){return!(n.isSignature||n.description==="FRAME")}}).then(n=>{n.addEventListener("viewState.currentPageIndex.change",n=>{console.log("Active page:",n+1)});const t=n.totalPageCount||0;return console.log("All pages loaded, total pages:",t),n})}function addToolbarItems(n,t){var i=n.toolbarItems.filter(n=>allowedToolbarItems.includes(n.type));i=IS_READONLY?i.concat(getReadOnlyItems(t)):i.concat(getWritableItems(t));IS_DESKTOP_SIZE||IS_READONLY||(i=i.concat(getMobileWritableItems(t)));n.setToolbarItems(i)}function getWritableItems(n){return[{type:"custom",id:"button-share",className:"button-share",title:"Teilen",onPress(){n("SHARE")},icon:` +function loadPSPDFKit(n,t,i,r){return PSPDFKit.load({inlineWorkers:!1,locale:r,licenseKey:i,styleSheets:["/css/site.css"],container:t,document:n,annotationPresets:getPresets(),electronicSignatures:{creationModes:["DRAW","TYPE","IMAGE"]},initialViewState:new PSPDFKit.ViewState({sidebarMode:PSPDFKit.SidebarMode.THUMBNAILS}),isEditableAnnotation:function(n){return!(n.isSignature||n.description==="FRAME")}}).then(n=>(n.addEventListener("viewState.currentPageIndex.change",n=>{console.log("Active page:",n+1)}),n))}function addToolbarItems(n,t){var i=n.toolbarItems.filter(n=>allowedToolbarItems.includes(n.type));i=IS_READONLY?i.concat(getReadOnlyItems(t)):i.concat(getWritableItems(t));IS_DESKTOP_SIZE||IS_READONLY||(i=i.concat(getMobileWritableItems(t)));n.setToolbarItems(i)}function getWritableItems(n){return[{type:"custom",id:"button-share",className:"button-share",title:"Teilen",onPress(){n("SHARE")},icon:` `},{type:"custom",id:"button-logout",className:"button-logout",title:"logout",onPress(){n("LOGOUT")},icon:`