mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 15:07:11 -04:00
implement change requests
This commit is contained in:
parent
e77ded4859
commit
15252ee5c6
7 changed files with 35 additions and 7 deletions
|
@ -881,7 +881,6 @@ class App {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
categoryList.build();
|
|
||||||
document.querySelector("#categories").appendChild(categoryList);
|
document.querySelector("#categories").appendChild(categoryList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class CCategoryLi extends HTMLElement {
|
||||||
/**
|
/**
|
||||||
* @param {App} app - The main view object for CyberChef
|
* @param {App} app - The main view object for CyberChef
|
||||||
* @param {CatConf} category - The category and operations to be populated.
|
* @param {CatConf} category - The category and operations to be populated.
|
||||||
* @param {Object.<string, OpConf>} operations - The list of operation configuration objects.
|
* @param {OpConfig[]} operations - The list of operation configuration objects.
|
||||||
* @param {Boolean} isExpanded - expand the category by default on init or not
|
* @param {Boolean} isExpanded - expand the category by default on init or not
|
||||||
* @param {Boolean} includeOpLiStarIcon - Include the left side 'star' icon to each of the c-category-li >
|
* @param {Boolean} includeOpLiStarIcon - Include the left side 'star' icon to each of the c-category-li >
|
||||||
* c-operation-list > c-operation-li list items in this category
|
* c-operation-list > c-operation-li list items in this category
|
||||||
|
@ -54,6 +54,8 @@ export class CCategoryLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build c-category-li containing a nested c-operation-list ( op-list )
|
* Build c-category-li containing a nested c-operation-list ( op-list )
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
build() {
|
build() {
|
||||||
const li = this.buildListItem();
|
const li = this.buildListItem();
|
||||||
|
@ -72,13 +74,13 @@ export class CCategoryLi extends HTMLElement {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
opList.build();
|
|
||||||
|
|
||||||
div.appendChild(opList);
|
div.appendChild(opList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the li element
|
* Build the li element
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildListItem() {
|
buildListItem() {
|
||||||
const li = document.createElement("li");
|
const li = document.createElement("li");
|
||||||
|
@ -90,6 +92,8 @@ export class CCategoryLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the anchor element
|
* Build the anchor element
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildAnchor() {
|
buildAnchor() {
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
|
@ -123,6 +127,8 @@ export class CCategoryLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the collapsable panel that contains the op-list for this category
|
* Build the collapsable panel that contains the op-list for this category
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildCollapsablePanel() {
|
buildCollapsablePanel() {
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
|
@ -142,6 +148,8 @@ export class CCategoryLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this category is Favourites, build and return the star icon button
|
* If this category is Favourites, build and return the star icon button
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildEditFavouritesButton() {
|
buildEditFavouritesButton() {
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class CCategoryList extends HTMLElement {
|
||||||
/**
|
/**
|
||||||
* @param {App} app - The main view object for CyberChef
|
* @param {App} app - The main view object for CyberChef
|
||||||
* @param {CatConf[]} categories - The list of categories and operations to be populated.
|
* @param {CatConf[]} categories - The list of categories and operations to be populated.
|
||||||
* @param {Object.<string, OpConf>} operations - A list of operation configuration objects.
|
* @param {OpConfig[]} operations - A list of operation configuration objects.
|
||||||
* @param {Boolean} includeOpLiStarIcon - Include the left side 'star' icon to each of the c-category-li >
|
* @param {Boolean} includeOpLiStarIcon - Include the left side 'star' icon to each of the c-category-li >
|
||||||
* c-operation-list > c-operation-li list items in this c-category-list
|
* c-operation-list > c-operation-li list items in this c-category-list
|
||||||
*/
|
*/
|
||||||
|
@ -23,10 +23,14 @@ export class CCategoryList extends HTMLElement {
|
||||||
this.categories = categories;
|
this.categories = categories;
|
||||||
this.operations = operations;
|
this.operations = operations;
|
||||||
this.includeOpLiStarIcon = includeOpLiStarIcon;
|
this.includeOpLiStarIcon = includeOpLiStarIcon;
|
||||||
|
|
||||||
|
this.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build c-category-list
|
* Build c-category-list
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
build() {
|
build() {
|
||||||
const ul = document.createElement("ul");
|
const ul = document.createElement("ul");
|
||||||
|
|
|
@ -104,6 +104,8 @@ export class COperationLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build c-operation-li
|
* Build c-operation-li
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
build() {
|
build() {
|
||||||
const li = this.buildListItem();
|
const li = this.buildListItem();
|
||||||
|
@ -178,6 +180,8 @@ export class COperationLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the li element
|
* Build the li element
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildListItem() {
|
buildListItem() {
|
||||||
const li = document.createElement("li");
|
const li = document.createElement("li");
|
||||||
|
@ -209,6 +213,8 @@ export class COperationLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the operation list item right side icon
|
* Build the operation list item right side icon
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildIcon() {
|
buildIcon() {
|
||||||
const icon = document.createElement("i");
|
const icon = document.createElement("i");
|
||||||
|
@ -224,6 +230,8 @@ export class COperationLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the ( optional ) star icon
|
* Build the ( optional ) star icon
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildStarIcon() {
|
buildStarIcon() {
|
||||||
const icon = document.createElement("i");
|
const icon = document.createElement("i");
|
||||||
|
@ -267,6 +275,8 @@ export class COperationLi extends HTMLElement {
|
||||||
/**
|
/**
|
||||||
* Highlights searched strings ( if applicable ) in the name and description of the operation
|
* Highlights searched strings ( if applicable ) in the name and description of the operation
|
||||||
* or simply sets the name in the span element
|
* or simply sets the name in the span element
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildOperationName() {
|
buildOperationName() {
|
||||||
const span = document.createElement("span");
|
const span = document.createElement("span");
|
||||||
|
@ -283,7 +293,7 @@ export class COperationLi extends HTMLElement {
|
||||||
pos = start + length;
|
pos = start + length;
|
||||||
});
|
});
|
||||||
opName += this.name.slice(pos, this.name.length);
|
opName += this.name.slice(pos, this.name.length);
|
||||||
span.innerHTML = `${opName}`;
|
span.innerHTML = opName;
|
||||||
} else {
|
} else {
|
||||||
span.innerText = this.name;
|
span.innerText = this.name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ export class COperationList extends HTMLElement {
|
||||||
this.isCloneable = isCloneable;
|
this.isCloneable = isCloneable;
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
|
|
||||||
|
this.build();
|
||||||
|
|
||||||
window.addEventListener("operationadd", this.handleChange.bind(this));
|
window.addEventListener("operationadd", this.handleChange.bind(this));
|
||||||
window.addEventListener("operationremove", this.handleChange.bind(this));
|
window.addEventListener("operationremove", this.handleChange.bind(this));
|
||||||
window.addEventListener("favouritesupdate", this.handleChange.bind(this));
|
window.addEventListener("favouritesupdate", this.handleChange.bind(this));
|
||||||
|
@ -56,6 +58,8 @@ export class COperationList extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build c-operation-list
|
* Build c-operation-list
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
build() {
|
build() {
|
||||||
const ul = document.createElement("ul");
|
const ul = document.createElement("ul");
|
||||||
|
|
|
@ -113,6 +113,8 @@ export class CRecipeLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the ingredient list item
|
* Build the ingredient list item
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
build() {
|
build() {
|
||||||
const li = document.createElement("li");
|
const li = document.createElement("li");
|
||||||
|
@ -154,6 +156,8 @@ export class CRecipeLi extends HTMLElement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the icons ( disable and breakpoint / pause )
|
* Build the icons ( disable and breakpoint / pause )
|
||||||
|
*
|
||||||
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
buildIcons() {
|
buildIcons() {
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
|
|
|
@ -204,7 +204,6 @@ class OperationsWaiter {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
opList.build();
|
|
||||||
div.appendChild(opList);
|
div.appendChild(opList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue