mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Added operation counts to categories and ops list with option to hide by default for categories.
This commit is contained in:
parent
bbebba6481
commit
57c8c6dbc6
8 changed files with 45 additions and 2 deletions
|
@ -168,6 +168,10 @@ class OperationsWaiter {
|
|||
*/
|
||||
opListCreate(e) {
|
||||
this.manager.recipe.createSortableSeedList(e.target);
|
||||
|
||||
// Populate ops total
|
||||
document.querySelector("#operations .title .op-count").innerText = Object.keys(this.app.operations).length;
|
||||
|
||||
this.enableOpsListPopovers(e.target);
|
||||
}
|
||||
|
||||
|
@ -293,6 +297,18 @@ class OperationsWaiter {
|
|||
this.app.resetFavourites();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether operation counts are displayed next to a category title
|
||||
*/
|
||||
setCatCount() {
|
||||
if (this.app.options.showCatCount) {
|
||||
document.querySelectorAll(".category-title .op-count").forEach(el => el.classList.remove("hidden"));
|
||||
} else {
|
||||
document.querySelectorAll(".category-title .op-count").forEach(el => el.classList.add("hidden"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default OperationsWaiter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue