mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Fix stepping again.
Add new getInput function to inputWorker
This commit is contained in:
parent
0bced35931
commit
7528065d4d
6 changed files with 111 additions and 24 deletions
|
@ -102,6 +102,9 @@ self.addEventListener("message", function(e) {
|
|||
case "step":
|
||||
self.autoBake(r.data, true);
|
||||
break;
|
||||
case "getInput":
|
||||
self.getInput(r.data);
|
||||
break;
|
||||
default:
|
||||
log.error(`Unknown action '${r.action}'.`);
|
||||
}
|
||||
|
@ -228,6 +231,34 @@ self.getInputValue = function(inputNum) {
|
|||
return "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the stored value or oobject for a specific inputNum and sends it to the inputWaiter.
|
||||
*
|
||||
* @param {object} inputData - Object containing data about the input to retrieve
|
||||
* @param {number} inputData.inputNum - The inputNum of the input to get
|
||||
* @param {boolean} inputData.getObj - If true, returns the entire input object instead of just the value
|
||||
* @param {number} inputData.id - The callback ID for the callback to run when returned to the inputWaiter
|
||||
*/
|
||||
self.getInput = function(inputData) {
|
||||
if (inputData.getObj) {
|
||||
self.postMessage({
|
||||
action: "getInput",
|
||||
data: {
|
||||
data: self.getInputObj(inputData.inputNum),
|
||||
id: inputData.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.postMessage({
|
||||
action: "getInput",
|
||||
data: {
|
||||
data: self.getInputValue(inputData.inputNum),
|
||||
id: inputData.id
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the load progress for a specific inputNum
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue