mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Holding down on tab change buttons will scroll.
Hide loading stats when there's only one input
This commit is contained in:
parent
15b5cf7c20
commit
99e9df0211
3 changed files with 99 additions and 9 deletions
|
@ -898,7 +898,13 @@ class InputWaiter {
|
|||
msg += "<br>loading: " + loadingStr;
|
||||
}
|
||||
|
||||
document.getElementById("input-files-info").innerHTML = msg;
|
||||
const inFiles = document.getElementById("input-files-info");
|
||||
if (total > 1) {
|
||||
inFiles.innerHTML = msg;
|
||||
inFiles.style.display = "";
|
||||
} else {
|
||||
inFiles.style.display = "none";
|
||||
}
|
||||
|
||||
this.updateFileProgress(loadedData.activeProgress.inputNum, loadedData.activeProgress.progress);
|
||||
|
||||
|
@ -1238,8 +1244,8 @@ class InputWaiter {
|
|||
*/
|
||||
inputAdded(changeTab, inputNum) {
|
||||
this.addTab(inputNum, changeTab);
|
||||
this.manager.output.addOutput(inputNum, changeTab);
|
||||
|
||||
this.manager.output.addOutput(inputNum, changeTab);
|
||||
this.manager.worker.addChefWorker();
|
||||
}
|
||||
|
||||
|
@ -1345,11 +1351,51 @@ class InputWaiter {
|
|||
} else if (wheelEvent.deltaY < 0) {
|
||||
this.changeTabRight();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for clicking on next tab button
|
||||
* Handler for mouse down on the next tab button
|
||||
*/
|
||||
nextTabClick() {
|
||||
this.mousedown = true;
|
||||
this.changeTabRight();
|
||||
const time = 200;
|
||||
const func = function(time) {
|
||||
if (this.mousedown) {
|
||||
this.changeTabRight();
|
||||
const newTime = (time > 50) ? time = time - 10 : 50;
|
||||
setTimeout(func.bind(this, [newTime]), newTime);
|
||||
}
|
||||
};
|
||||
setTimeout(func.bind(this, [time]), time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for mouse down on the previous tab button
|
||||
*/
|
||||
previousTabClick() {
|
||||
this.mousedown = true;
|
||||
this.changeTabLeft();
|
||||
const time = 200;
|
||||
const func = function(time) {
|
||||
if (this.mousedown) {
|
||||
this.changeTabLeft();
|
||||
const newTime = (time > 50) ? time = time - 10 : 50;
|
||||
setTimeout(func.bind(this, [newTime]), newTime);
|
||||
}
|
||||
};
|
||||
setTimeout(func.bind(this, [time]), time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for mouse up event on the tab buttons
|
||||
*/
|
||||
tabMouseUp() {
|
||||
this.mousedown = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes to the next (right) tab
|
||||
*/
|
||||
changeTabRight() {
|
||||
const activeTab = this.getActiveTab();
|
||||
|
@ -1363,7 +1409,7 @@ class InputWaiter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Handler for clicking on previous tab button
|
||||
* Changes to the previous (left) tab
|
||||
*/
|
||||
changeTabLeft() {
|
||||
const activeTab = this.getActiveTab();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue