mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 15:07:11 -04:00
rename some vars for readability
This commit is contained in:
parent
4dc4645def
commit
47c8af7284
2 changed files with 17 additions and 17 deletions
|
@ -176,14 +176,14 @@ class OperationsWaiter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for edit favourites click events.
|
* Handler for edit favourites click events.
|
||||||
* Sets up the 'Edit favourites' pane and displays it.
|
* Displays the 'Edit favourites' modal and handles the c-operation-list in the modal
|
||||||
*
|
*
|
||||||
* @param {Event} e
|
* @param {Event} e
|
||||||
*/
|
*/
|
||||||
editFavouritesClick(e) {
|
editFavouritesClick(e) {
|
||||||
const div = document.getElementById("editable-favourites");
|
const div = document.getElementById("editable-favourites");
|
||||||
|
|
||||||
// Remove c-operation-list if there already was one
|
// First remove the existing c-operation-list if there already was one
|
||||||
if (div.querySelector("c-operation-list")) {
|
if (div.querySelector("c-operation-list")) {
|
||||||
div.removeChild(div.querySelector("c-operation-list"));
|
div.removeChild(div.querySelector("c-operation-list"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,31 +168,31 @@ class RecipeWaiter {
|
||||||
*/
|
*/
|
||||||
getConfig() {
|
getConfig() {
|
||||||
const config = [];
|
const config = [];
|
||||||
let ingredients, ingList, disabled, bp, item;
|
let ingredients, args, disableIcon, breakPointIcon, item;
|
||||||
const operations = document.querySelectorAll("#rec-list li.operation");
|
const operations = document.querySelectorAll("#rec-list li.operation");
|
||||||
|
|
||||||
for (let i = 0; i < operations.length; i++) {
|
for (let i = 0; i < operations.length; i++) {
|
||||||
ingredients = [];
|
ingredients = [];
|
||||||
disabled = operations[i].querySelector(".disable-icon");
|
disableIcon = operations[i].querySelector(".disable-icon");
|
||||||
bp = operations[i].querySelector(".breakpoint-icon");
|
breakPointIcon = operations[i].querySelector(".breakpoint-icon");
|
||||||
ingList = operations[i].querySelectorAll(".arg");
|
args = operations[i].querySelectorAll(".arg");
|
||||||
|
|
||||||
for (let j = 0; j < ingList.length; j++) {
|
for (let j = 0; j < args.length; j++) {
|
||||||
if (ingList[j].getAttribute("type") === "checkbox") {
|
if (args[j].getAttribute("type") === "checkbox") {
|
||||||
// checkbox
|
// checkbox
|
||||||
ingredients[j] = ingList[j].checked;
|
ingredients[j] = args[j].checked;
|
||||||
} else if (ingList[j].classList.contains("toggle-string")) {
|
} else if (args[j].classList.contains("toggle-string")) {
|
||||||
// toggleString
|
// toggleString
|
||||||
ingredients[j] = {
|
ingredients[j] = {
|
||||||
option: ingList[j].parentNode.parentNode.querySelector("button").textContent,
|
option: args[j].parentNode.parentNode.querySelector("button").textContent,
|
||||||
string: ingList[j].value
|
string: args[j].value
|
||||||
};
|
};
|
||||||
} else if (ingList[j].getAttribute("type") === "number") {
|
} else if (args[j].getAttribute("type") === "number") {
|
||||||
// number
|
// number
|
||||||
ingredients[j] = parseFloat(ingList[j].value);
|
ingredients[j] = parseFloat(args[j].value);
|
||||||
} else {
|
} else {
|
||||||
// all others
|
// all others
|
||||||
ingredients[j] = ingList[j].value;
|
ingredients[j] = args[j].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,11 +201,11 @@ class RecipeWaiter {
|
||||||
args: ingredients
|
args: ingredients
|
||||||
};
|
};
|
||||||
|
|
||||||
if (disabled && disabled.getAttribute("disabled") === "true") {
|
if (disableIcon && disableIcon.getAttribute("disabled") === "true") {
|
||||||
item.disabled = true;
|
item.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bp && bp.getAttribute("break") === "true") {
|
if (breakPointIcon && breakPointIcon.getAttribute("break") === "true") {
|
||||||
item.breakpoint = true;
|
item.breakpoint = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue