mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Added argSelector ingredient type and reversed rotors in Enigma and Bombe operations.
This commit is contained in:
parent
4db6199fd9
commit
c005c86c27
7 changed files with 344 additions and 209 deletions
|
@ -393,15 +393,6 @@ class RecipeWaiter {
|
|||
this.buildRecipeOperation(item);
|
||||
document.getElementById("rec-list").appendChild(item);
|
||||
|
||||
// Trigger populateOption events
|
||||
const populateOptions = item.querySelectorAll(".populate-option");
|
||||
const evt = new Event("change", {bubbles: true});
|
||||
if (populateOptions.length) {
|
||||
for (const el of populateOptions) {
|
||||
el.dispatchEvent(evt);
|
||||
}
|
||||
}
|
||||
|
||||
item.dispatchEvent(this.manager.operationadd);
|
||||
return item;
|
||||
}
|
||||
|
@ -439,6 +430,23 @@ class RecipeWaiter {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Triggers various change events for operation arguments that have just been initialised.
|
||||
*
|
||||
* @param {HTMLElement} op
|
||||
*/
|
||||
triggerArgEvents(op) {
|
||||
// Trigger populateOption and argSelector events
|
||||
const triggerableOptions = op.querySelectorAll(".populate-option, .arg-selector");
|
||||
const evt = new Event("change", {bubbles: true});
|
||||
if (triggerableOptions.length) {
|
||||
for (const el of triggerableOptions) {
|
||||
el.dispatchEvent(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handler for operationadd events.
|
||||
*
|
||||
|
@ -448,6 +456,8 @@ class RecipeWaiter {
|
|||
*/
|
||||
opAdd(e) {
|
||||
log.debug(`'${e.target.querySelector(".op-title").textContent}' added to recipe`);
|
||||
|
||||
this.triggerArgEvents(e.target);
|
||||
window.dispatchEvent(this.manager.statechange);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue