Finished Excel Password Remover, Added downloading functionality
Update excel-password-remover.css, excel-password-remover.mjs, and excel-password-remover.jinja
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
.cursor-pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@@ -108,11 +108,19 @@ export function isExcelExtension(fileName) {
|
|||||||
).then(eFragment => {
|
).then(eFragment => {
|
||||||
console.debug(eFragment);
|
console.debug(eFragment);
|
||||||
|
|
||||||
const uuid = crypto.randomUUID();
|
const eFileOutput = eFragment.firstChild;
|
||||||
console.debug(eFragment.children);
|
eFileOutput.addEventListener("click", function() {
|
||||||
eFragment.children.id = uuid;
|
console.debug(123);
|
||||||
|
//processedZipFile
|
||||||
|
downloadProcessedFile(excelFile);
|
||||||
|
});
|
||||||
|
eResultContainer.appendChild(eFileOutput);
|
||||||
|
|
||||||
|
//const uuid = crypto.randomUUID();
|
||||||
|
//console.debug(eFragment.firstChild);
|
||||||
|
//eFragment.firstChild.id = uuid;
|
||||||
|
//eResultContainer.appendChild(eFragment);
|
||||||
|
|
||||||
eResultContainer.appendChild(eFragment);
|
|
||||||
onFileAddedToDom();
|
onFileAddedToDom();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -180,10 +188,28 @@ export function isExcelExtension(fileName) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param excelFile {ExcelFileData}
|
||||||
|
*/
|
||||||
|
function downloadProcessedFile(excelFile) {
|
||||||
|
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 () {
|
window.onload = function () {
|
||||||
|
|
||||||
eFileDownloadAllButton.addEventListener("click", function() {
|
eFileDownloadAllButton.addEventListener("click", function() {
|
||||||
|
eResultContainer.childNodes.forEach(eResultLine => {
|
||||||
|
//console.debug(eResultLine);
|
||||||
|
eResultLine.click();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
eFileClearButton.addEventListener("click", function() {
|
eFileClearButton.addEventListener("click", function() {
|
||||||
|
@@ -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">
|
<div class="bkgd-grid10 w-full r-l border cursor-pointer">
|
||||||
<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">
|
||||||
|
Reference in New Issue
Block a user