mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-01-19 00:07:17 +01:00
Merge remote-tracking branch 'origin/master' into pipeline
This commit is contained in:
commit
57a0cca595
5
.github/workflows/releaseArtifacts.yml
vendored
5
.github/workflows/releaseArtifacts.yml
vendored
@ -1,8 +1,7 @@
|
|||||||
name: Release Artifacts
|
name: Release Artifacts
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [created]
|
||||||
- '*'
|
|
||||||
jobs:
|
jobs:
|
||||||
push:
|
push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'stirling.software'
|
group = 'stirling.software'
|
||||||
version = '0.10.1'
|
version = '0.10.2'
|
||||||
sourceCompatibility = '17'
|
sourceCompatibility = '17'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -19,18 +19,13 @@ $(document).ready(function() {
|
|||||||
$('#submitBtn').text('Processing...');
|
$('#submitBtn').text('Processing...');
|
||||||
console.log(override);
|
console.log(override);
|
||||||
try {
|
try {
|
||||||
console.log("2");
|
|
||||||
if(remoteCall === true) {
|
if(remoteCall === true) {
|
||||||
console.log("3");
|
|
||||||
if (override === 'multi' || (!multiple && files.length > 1) && override !== 'single' ) {
|
if (override === 'multi' || (!multiple && files.length > 1) && override !== 'single' ) {
|
||||||
console.log("3");
|
|
||||||
await submitMultiPdfForm(url, files);
|
await submitMultiPdfForm(url, files);
|
||||||
} else {
|
} else {
|
||||||
console.log("4");
|
|
||||||
await handleSingleDownload(url, formData);
|
await handleSingleDownload(url, formData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("5");
|
|
||||||
$('#submitBtn').text(originalButtonText);
|
$('#submitBtn').text(originalButtonText);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleDownloadError(error);
|
handleDownloadError(error);
|
||||||
@ -102,15 +97,12 @@ async function handleJsonResponse(response) {
|
|||||||
async function handleResponse(blob, filename, considerViewOptions = false, isZip = false) {
|
async function handleResponse(blob, filename, considerViewOptions = false, isZip = false) {
|
||||||
if (!blob) return;
|
if (!blob) return;
|
||||||
const downloadOption = localStorage.getItem('downloadOption');
|
const downloadOption = localStorage.getItem('downloadOption');
|
||||||
console.log("handleResponse 1");
|
|
||||||
if (considerViewOptions) {
|
if (considerViewOptions) {
|
||||||
if (downloadOption === 'sameWindow') {
|
if (downloadOption === 'sameWindow') {
|
||||||
console.log("handleResponse 2");
|
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
return;
|
return;
|
||||||
} else if (downloadOption === 'newWindow') {
|
} else if (downloadOption === 'newWindow') {
|
||||||
console.log("handleResponse 3");
|
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
return;
|
return;
|
||||||
@ -119,7 +111,6 @@ async function handleResponse(blob, filename, considerViewOptions = false, isZip
|
|||||||
if(!isZip){
|
if(!isZip){
|
||||||
downloadFile(blob, filename);
|
downloadFile(blob, filename);
|
||||||
}
|
}
|
||||||
console.log("handleResponse 5");
|
|
||||||
return { filename, blob };
|
return { filename, blob };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,8 +126,6 @@ function downloadFile(blob, filename) {
|
|||||||
console.error('Invalid blob passed to downloadFile function');
|
console.error('Invalid blob passed to downloadFile function');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("downloadFile 1");
|
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
@ -192,7 +181,6 @@ async function submitMultiPdfForm(url, files) {
|
|||||||
if (zipFiles) {
|
if (zipFiles) {
|
||||||
jszip.file(downloadDetails.filename, downloadDetails.blob);
|
jszip.file(downloadDetails.filename, downloadDetails.blob);
|
||||||
} else {
|
} else {
|
||||||
console.log("downloadFile 198");
|
|
||||||
//downloadFile(downloadDetails.blob, downloadDetails.filename);
|
//downloadFile(downloadDetails.blob, downloadDetails.filename);
|
||||||
}
|
}
|
||||||
updateProgressBar(progressBar, Array.from(files).length);
|
updateProgressBar(progressBar, Array.from(files).length);
|
||||||
@ -208,7 +196,6 @@ async function submitMultiPdfForm(url, files) {
|
|||||||
if (zipFiles) {
|
if (zipFiles) {
|
||||||
try {
|
try {
|
||||||
const content = await jszip.generateAsync({ type: "blob" });
|
const content = await jszip.generateAsync({ type: "blob" });
|
||||||
console.log("downloadFile 213");
|
|
||||||
downloadFile(content, "files.zip");
|
downloadFile(content, "files.zip");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error generating ZIP file: ' + error);
|
console.error('Error generating ZIP file: ' + error);
|
||||||
|
Loading…
Reference in New Issue
Block a user