second fix for broken JS on non-minified versions, Thank you JS...

Update excel-password-remover.mjs and excel-password-remover.jinja
This commit is contained in:
2025-03-04 19:57:09 +01:00
parent b7b1230d2d
commit c4b8a95712
2 changed files with 8 additions and 16 deletions

View File

@@ -1,3 +1,7 @@
// NibblePoker - Excel Password Remover 2.0
// Author: Herwin Bozet (@NibblePoker)
// License: Public Domain (This code)
// Implied Globals: JSZip // Implied Globals: JSZip
if(JSZip == null) { if(JSZip == null) {
alert("JSZip isn't available !"); alert("JSZip isn't available !");
@@ -106,25 +110,15 @@ export function isExcelExtension(fileName) {
}, },
true true
).then(eFragment => { ).then(eFragment => {
console.debug(eFragment);
// Doesn't work on BS4 and RAW, it returns " "... // Doesn't work on BS4 and RAW, it returns " "...
//const eFileOutput = eFragment.firstChild; //const eFileOutput = eFragment.firstChild;
const eFileOutput = eFragment.querySelector("*"); const eFileOutput = eFragment.querySelector("*");
eFileOutput.addEventListener("click", function() { eFileOutput.addEventListener("click", function() {
console.debug(123);
//processedZipFile
downloadProcessedFile(excelFile); downloadProcessedFile(excelFile);
}); });
console.debug(eFileOutput);
eResultContainer.appendChild(eFileOutput); eResultContainer.appendChild(eFileOutput);
//const uuid = crypto.randomUUID();
//console.debug(eFragment.firstChild);
//eFragment.firstChild.id = uuid;
//eResultContainer.appendChild(eFragment);
onFileAddedToDom(); onFileAddedToDom();
}); });
} }
@@ -199,21 +193,19 @@ export function isExcelExtension(fileName) {
excelFile.processedZipFile.generateAsync({type:"base64"}).then(function(b64Data) { excelFile.processedZipFile.generateAsync({type:"base64"}).then(function(b64Data) {
const eLink = document.createElement('a'); const eLink = document.createElement('a');
eLink.download = excelFile.getOutputName(); eLink.download = excelFile.getOutputName();
//console.debug(b64Data);
eLink.href = 'data:application/zip;base64,' + b64Data; eLink.href = 'data:application/zip;base64,' + b64Data;
eLink.click(); eLink.click();
}, function(err) { }, function(err) {
console.error(err); console.error(err);
//handleError("An error has occured while generating your file, please check the console for more info !");
}); });
} }
window.onload = function () { window.onload = function () {
eFileDownloadAllButton.addEventListener("click", function() { eFileDownloadAllButton.addEventListener("click", function() {
eResultContainer.childNodes.forEach(eResultLine => { document.querySelectorAll(".epr-download-all-click").forEach(eResultLine => {
//console.debug(eResultLine); console.debug(eResultLine);
eResultLine.click(); eResultLine.click();
}) });
}); });
eFileClearButton.addEventListener("click", function() { eFileClearButton.addEventListener("click", function() {

View File

@@ -35,7 +35,7 @@
</section> </section>
<template id="tmpl-success-root"> <template id="tmpl-success-root">
<div class="bkgd-grid10 w-full r-l border cursor-pointer"> <div class="bkgd-grid10 w-full r-l border cursor-pointer epr-download-all-click">
<table class="table-p-xxs table-v-center"> <table class="table-p-xxs table-v-center">
<tr> <tr>
<td rowspan="2" class="br bkgd-green bkgd-grid30 rl-l"> <td rowspan="2" class="br bkgd-green bkgd-grid30 rl-l">