From d6f8e0a5208a1b010e632a460da45aacff0c4b9d Mon Sep 17 00:00:00 2001 From: n1474335 Date: Fri, 17 Mar 2023 17:46:13 +0000 Subject: [PATCH] Added a contextual help feature and started writing help descriptions --- src/web/App.mjs | 12 ++++- src/web/HTMLIngredient.mjs | 6 +-- src/web/HTMLOperation.mjs | 4 +- src/web/html/index.html | 65 ++++++++++++++++++++------ src/web/stylesheets/utils/_general.css | 5 ++ src/web/utils/statusBar.mjs | 47 +++++++++++++------ src/web/waiters/BindingsWaiter.mjs | 40 ++++++++++++++-- 7 files changed, 142 insertions(+), 37 deletions(-) diff --git a/src/web/App.mjs b/src/web/App.mjs index e7e80a99..cce91b1e 100755 --- a/src/web/App.mjs +++ b/src/web/App.mjs @@ -281,7 +281,15 @@ class App { } // Add edit button to first category (Favourites) - document.querySelector("#categories a").appendChild(document.getElementById("edit-favourites")); + const favCat = document.querySelector("#categories a"); + favCat.appendChild(document.getElementById("edit-favourites")); + favCat.setAttribute("data-help-title", "Favourite operations"); + favCat.setAttribute("data-help", `

This category displays your favourite operations.

+ `); } @@ -656,6 +664,8 @@ class App { const notice = document.getElementById("notice"); notice.innerHTML = compileInfo; notice.setAttribute("title", Utils.stripHtmlTags(window.compileMessage)); + notice.setAttribute("data-help-title", "Last build"); + notice.setAttribute("data-help", "This live version of CyberChef is updated whenever new commits are added to the master branch of the CyberChef repository. It represents the latest, most up-to-date build of CyberChef."); } diff --git a/src/web/HTMLIngredient.mjs b/src/web/HTMLIngredient.mjs index befcbe14..7eddb32c 100755 --- a/src/web/HTMLIngredient.mjs +++ b/src/web/HTMLIngredient.mjs @@ -85,7 +85,7 @@ class HTMLIngredient { `; break; case "toggleString": - html += `
+ html += `