mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 15:07:11 -04:00
CodeQL again
This commit is contained in:
parent
c9f40928fb
commit
4612a11e32
1 changed files with 9 additions and 9 deletions
|
@ -23,7 +23,7 @@ export class COperationLi extends HTMLElement {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.name = name;
|
this.operationName = name;
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.includeStarIcon = includeStarIcon;
|
this.includeStarIcon = includeStarIcon;
|
||||||
this.charIndicesToHighlight = charIndicesToHighlight;
|
this.charIndicesToHighlight = charIndicesToHighlight;
|
||||||
|
@ -66,7 +66,7 @@ export class COperationLi extends HTMLElement {
|
||||||
handleDoubleClick(e) {
|
handleDoubleClick(e) {
|
||||||
// this span is element holding the operation title
|
// this span is element holding the operation title
|
||||||
if (e.target === this.querySelector("li") || e.target === this.querySelector("span")) {
|
if (e.target === this.querySelector("li") || e.target === this.querySelector("span")) {
|
||||||
this.app.manager.recipe.addOperation(this.name);
|
this.app.manager.recipe.addOperation(this.operationName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ export class COperationLi extends HTMLElement {
|
||||||
*/
|
*/
|
||||||
handleMousedown(e) {
|
handleMousedown(e) {
|
||||||
if (e.target === this.querySelector("i.star-icon")) {
|
if (e.target === this.querySelector("i.star-icon")) {
|
||||||
this.app.addFavourite(this.name);
|
this.app.addFavourite(this.operationName);
|
||||||
}
|
}
|
||||||
// current use case: in the 'Edit favourites' modal, the c-operation-li components have a trashcan icon to the
|
// current use case: in the 'Edit favourites' modal, the c-operation-li components have a trashcan icon to the
|
||||||
// right
|
// right
|
||||||
|
@ -188,7 +188,7 @@ export class COperationLi extends HTMLElement {
|
||||||
|
|
||||||
li.appendChild(this.buildOperationName());
|
li.appendChild(this.buildOperationName());
|
||||||
|
|
||||||
li.setAttribute("data-name", this.name);
|
li.setAttribute("data-name", this.operationName);
|
||||||
li.classList.add("operation");
|
li.classList.add("operation");
|
||||||
|
|
||||||
if (this.isFavourite) {
|
if (this.isFavourite) {
|
||||||
|
@ -235,7 +235,7 @@ export class COperationLi extends HTMLElement {
|
||||||
*/
|
*/
|
||||||
buildStarIcon() {
|
buildStarIcon() {
|
||||||
const icon = document.createElement("i");
|
const icon = document.createElement("i");
|
||||||
icon.setAttribute("title", this.name);
|
icon.setAttribute("title", this.operationName);
|
||||||
|
|
||||||
icon.classList.add("material-icons");
|
icon.classList.add("material-icons");
|
||||||
icon.classList.add("op-icon");
|
icon.classList.add("op-icon");
|
||||||
|
@ -289,18 +289,18 @@ export class COperationLi extends HTMLElement {
|
||||||
const [start, length] = charIndices;
|
const [start, length] = charIndices;
|
||||||
if (typeof start !== "number") return;
|
if (typeof start !== "number") return;
|
||||||
opName +=
|
opName +=
|
||||||
"<span>" + this.name.slice(pos, start) + "</span>" + "<strong>" +
|
"<span>" + this.operationName.slice(pos, start) + "</span>" + "<strong>" +
|
||||||
this.name.slice(start, start + length) + "</strong>";
|
this.operationName.slice(start, start + length) + "</strong>";
|
||||||
pos = start + length;
|
pos = start + length;
|
||||||
});
|
});
|
||||||
opName += "<span>" + this.name.slice(pos, this.name.length) + "</span>";
|
opName += "<span>" + this.operationName.slice(pos, this.operationName.length) + "</span>";
|
||||||
|
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
opName = parser.parseFromString(opName, "text/html");
|
opName = parser.parseFromString(opName, "text/html");
|
||||||
|
|
||||||
span.append(...opName.body.children);
|
span.append(...opName.body.children);
|
||||||
} else {
|
} else {
|
||||||
span.innerText = this.name;
|
span.innerText = this.operationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return span;
|
return span;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue