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

View File

@@ -35,7 +35,7 @@
</section>
<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">
<tr>
<td rowspan="2" class="br bkgd-green bkgd-grid30 rl-l">