mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Add clear all io button.
This commit is contained in:
parent
1f39a922d1
commit
a96cb3f99f
4 changed files with 67 additions and 30 deletions
|
@ -168,6 +168,17 @@ class OutputWaiter {
|
|||
delete (this.outputs[inputNum]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all output tabs
|
||||
*/
|
||||
removeAllOutputs() {
|
||||
this.outputs = {};
|
||||
const tabs = document.getElementById("output-tabs").children;
|
||||
for (let i = tabs.length - 1; i >= 0; i--) {
|
||||
tabs.item(i).remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the output in the output textarea.
|
||||
*
|
||||
|
@ -427,7 +438,7 @@ class OutputWaiter {
|
|||
const tabsWrapper = document.getElementById("output-tabs");
|
||||
const numTabs = tabsWrapper.children.length;
|
||||
|
||||
if (numTabs < this.maxTabs) {
|
||||
if (this.getTabItem(inputNum) === undefined && numTabs < this.maxTabs) {
|
||||
// Create a new tab element
|
||||
const newTab = this.createTabElement(inputNum);
|
||||
|
||||
|
@ -442,6 +453,15 @@ class OutputWaiter {
|
|||
document.getElementById("output-loader").style.height = "calc(100% - var(--tab-height) - var(--title-height))";
|
||||
|
||||
document.getElementById("save-all-to-file").style.display = "inline-block";
|
||||
} else {
|
||||
tabsWrapper.parentElement.style.display = "none";
|
||||
|
||||
document.getElementById("output-wrapper").style.height = "calc(100% - var(--title-height))";
|
||||
document.getElementById("output-highlighter").style.height = "calc(100% - var(--title-height))";
|
||||
document.getElementById("output-file").style.height = "calc(100% - var(--title-height))";
|
||||
document.getElementById("output-loader").style.height = "calc(100% - var(--title-height))";
|
||||
|
||||
document.getElementById("save-all-to-file").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue