Last build: " +
timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1) + " ago";
@@ -523,7 +523,7 @@ App.prototype.setCompileMessage = function() {
* this.alert("Happy Christmas!", "info", 5000);
*/
App.prototype.alert = function(str, style, timeout, silent) {
- var time = new Date();
+ const time = new Date();
console.log("[" + time.toLocaleString() + "] " + str);
if (silent) return;
@@ -531,7 +531,7 @@ App.prototype.alert = function(str, style, timeout, silent) {
style = style || "danger";
timeout = timeout || 0;
- var alertEl = document.getElementById("alert"),
+ let alertEl = document.getElementById("alert"),
alertContent = document.getElementById("alert-content");
alertEl.classList.remove("alert-danger");
@@ -649,7 +649,7 @@ App.prototype.callApi = function(url, type, data, dataType, contentType) {
dataType = dataType || undefined;
contentType = contentType || "application/json";
- var response = null,
+ let response = null,
success = false;
$.ajax({
diff --git a/src/web/ControlsWaiter.js b/src/web/ControlsWaiter.js
index cf8db3ac..3f22b742 100755
--- a/src/web/ControlsWaiter.js
+++ b/src/web/ControlsWaiter.js
@@ -12,7 +12,7 @@ import Utils from "../core/Utils.js";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var ControlsWaiter = function(app, manager) {
+const ControlsWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
};
@@ -23,7 +23,7 @@ var ControlsWaiter = function(app, manager) {
* without wrapping or overflowing.
*/
ControlsWaiter.prototype.adjustWidth = function() {
- var controls = document.getElementById("controls"),
+ let controls = document.getElementById("controls"),
step = document.getElementById("step"),
clrBreaks = document.getElementById("clr-breaks"),
saveImg = document.querySelector("#save img"),
@@ -66,7 +66,7 @@ ControlsWaiter.prototype.adjustWidth = function() {
* @param {boolean} value - The new value for Auto Bake.
*/
ControlsWaiter.prototype.setAutoBake = function(value) {
- var autoBakeCheckbox = document.getElementById("auto-bake");
+ const autoBakeCheckbox = document.getElementById("auto-bake");
if (autoBakeCheckbox.checked !== value) {
autoBakeCheckbox.click();
@@ -79,7 +79,7 @@ ControlsWaiter.prototype.setAutoBake = function(value) {
*/
ControlsWaiter.prototype.bakeClick = function() {
this.app.bake();
- var outputText = document.getElementById("output-text");
+ const outputText = document.getElementById("output-text");
outputText.focus();
outputText.setSelectionRange(0, 0);
};
@@ -90,7 +90,7 @@ ControlsWaiter.prototype.bakeClick = function() {
*/
ControlsWaiter.prototype.stepClick = function() {
this.app.bake(true);
- var outputText = document.getElementById("output-text");
+ const outputText = document.getElementById("output-text");
outputText.focus();
outputText.setSelectionRange(0, 0);
};
@@ -100,7 +100,7 @@ ControlsWaiter.prototype.stepClick = function() {
* Handler for changes made to the Auto Bake checkbox.
*/
ControlsWaiter.prototype.autoBakeChange = function() {
- var autoBakeLabel = document.getElementById("auto-bake-label"),
+ let autoBakeLabel = document.getElementById("auto-bake-label"),
autoBakeCheckbox = document.getElementById("auto-bake");
this.app.autoBake_ = autoBakeCheckbox.checked;
@@ -128,9 +128,9 @@ ControlsWaiter.prototype.clearRecipeClick = function() {
* recipe.
*/
ControlsWaiter.prototype.clearBreaksClick = function() {
- var bps = document.querySelectorAll("#rec-list li.operation .breakpoint");
+ const bps = document.querySelectorAll("#rec-list li.operation .breakpoint");
- for (var i = 0; i < bps.length; i++) {
+ for (let i = 0; i < bps.length; i++) {
bps[i].setAttribute("break", "false");
bps[i].classList.remove("breakpoint-selected");
}
@@ -145,7 +145,7 @@ ControlsWaiter.prototype.clearBreaksClick = function() {
ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) {
recipeConfig = recipeConfig || this.app.getRecipeConfig();
- var includeRecipe = document.getElementById("save-link-recipe-checkbox").checked,
+ let includeRecipe = document.getElementById("save-link-recipe-checkbox").checked,
includeInput = document.getElementById("save-link-input-checkbox").checked,
saveLinkEl = document.getElementById("save-link"),
saveLink = this.generateStateUrl(includeRecipe, includeInput, recipeConfig);
@@ -167,7 +167,7 @@ ControlsWaiter.prototype.initialiseSaveLink = function(recipeConfig) {
ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput, recipeConfig, baseURL) {
recipeConfig = recipeConfig || this.app.getRecipeConfig();
- var link = baseURL || window.location.protocol + "//" +
+ let link = baseURL || window.location.protocol + "//" +
window.location.host +
window.location.pathname,
recipeStr = JSON.stringify(recipeConfig),
@@ -195,7 +195,7 @@ ControlsWaiter.prototype.generateStateUrl = function(includeRecipe, includeInput
*/
ControlsWaiter.prototype.saveTextChange = function() {
try {
- var recipeConfig = JSON.parse(document.getElementById("save-text").value);
+ const recipeConfig = JSON.parse(document.getElementById("save-text").value);
this.initialiseSaveLink(recipeConfig);
} catch (err) {}
};
@@ -205,7 +205,7 @@ ControlsWaiter.prototype.saveTextChange = function() {
* Handler for the 'Save' command. Pops up the save dialog box.
*/
ControlsWaiter.prototype.saveClick = function() {
- var recipeConfig = this.app.getRecipeConfig(),
+ let recipeConfig = this.app.getRecipeConfig(),
recipeStr = JSON.stringify(recipeConfig).replace(/},{/g, "},\n{");
document.getElementById("save-text").value = recipeStr;
@@ -244,15 +244,15 @@ ControlsWaiter.prototype.loadClick = function() {
* Saves the recipe specified in the save textarea to local storage.
*/
ControlsWaiter.prototype.saveButtonClick = function() {
- var recipeName = Utils.escapeHtml(document.getElementById("save-name").value),
- recipeStr = document.getElementById("save-text").value;
+ let recipeName = Utils.escapeHtml(document.getElementById("save-name").value);
+ let recipeStr = document.getElementById("save-text").value;
if (!recipeName) {
this.app.alert("Please enter a recipe name", "danger", 2000);
return;
}
- var savedRecipes = localStorage.savedRecipes ?
+ let savedRecipes = localStorage.savedRecipes ?
JSON.parse(localStorage.savedRecipes) : [],
recipeId = localStorage.recipeId || 0;
@@ -273,20 +273,20 @@ ControlsWaiter.prototype.saveButtonClick = function() {
* Populates the list of saved recipes in the load dialog box from local storage.
*/
ControlsWaiter.prototype.populateLoadRecipesList = function() {
- var loadNameEl = document.getElementById("load-name");
+ const loadNameEl = document.getElementById("load-name");
// Remove current recipes from select
- var i = loadNameEl.options.length;
+ let i = loadNameEl.options.length;
while (i--) {
loadNameEl.remove(i);
}
// Add recipes to select
- var savedRecipes = localStorage.savedRecipes ?
+ const savedRecipes = localStorage.savedRecipes ?
JSON.parse(localStorage.savedRecipes) : [];
for (i = 0; i < savedRecipes.length; i++) {
- var opt = document.createElement("option");
+ const opt = document.createElement("option");
opt.value = savedRecipes[i].id;
// Unescape then re-escape in case localStorage has been corrupted
opt.innerHTML = Utils.escapeHtml(Utils.unescapeHtml(savedRecipes[i].name));
@@ -303,7 +303,7 @@ ControlsWaiter.prototype.populateLoadRecipesList = function() {
* Removes the currently selected recipe from local storage.
*/
ControlsWaiter.prototype.loadDeleteClick = function() {
- var id = parseInt(document.getElementById("load-name").value, 10),
+ let id = parseInt(document.getElementById("load-name").value, 10),
savedRecipes = localStorage.savedRecipes ?
JSON.parse(localStorage.savedRecipes) : [];
@@ -320,12 +320,12 @@ ControlsWaiter.prototype.loadDeleteClick = function() {
* Displays the selected recipe in the load text box.
*/
ControlsWaiter.prototype.loadNameChange = function(e) {
- var el = e.target,
+ let el = e.target,
savedRecipes = localStorage.savedRecipes ?
JSON.parse(localStorage.savedRecipes) : [],
id = parseInt(el.value, 10);
- var recipe = savedRecipes.filter(function(r) {
+ const recipe = savedRecipes.filter(function(r) {
return r.id === id;
})[0];
@@ -338,7 +338,7 @@ ControlsWaiter.prototype.loadNameChange = function(e) {
*/
ControlsWaiter.prototype.loadButtonClick = function() {
try {
- var recipeConfig = JSON.parse(document.getElementById("load-text").value);
+ const recipeConfig = JSON.parse(document.getElementById("load-text").value);
this.app.setRecipeConfig(recipeConfig);
$("#rec-list [data-toggle=popover]").popover();
@@ -352,7 +352,7 @@ ControlsWaiter.prototype.loadButtonClick = function() {
* Populates the bug report information box with useful technical info.
*/
ControlsWaiter.prototype.supportButtonClick = function() {
- var reportBugInfo = document.getElementById("report-bug-info"),
+ let reportBugInfo = document.getElementById("report-bug-info"),
saveLink = this.generateStateUrl(true, true, null, "https://gchq.github.io/CyberChef/");
reportBugInfo.innerHTML = "* CyberChef compile time: " + COMPILE_TIME + "\n" +
diff --git a/src/web/HTMLCategory.js b/src/web/HTMLCategory.js
index d1120c20..e3a168ba 100755
--- a/src/web/HTMLCategory.js
+++ b/src/web/HTMLCategory.js
@@ -9,7 +9,7 @@
* @param {string} name - The name of the category.
* @param {boolean} selected - Whether this category is pre-selected or not.
*/
-var HTMLCategory = function(name, selected) {
+const HTMLCategory = function(name, selected) {
this.name = name;
this.selected = selected;
this.opList = [];
@@ -32,8 +32,8 @@ HTMLCategory.prototype.addOperation = function(operation) {
* @returns {string}
*/
HTMLCategory.prototype.toHtml = function() {
- var catName = "cat" + this.name.replace(/[\s/-:_]/g, "");
- var html = "\
+ const catName = "cat" + this.name.replace(/[\s/-:_]/g, "");
+ let html = "
\
\
" + this.name + "\
@@ -41,7 +41,7 @@ HTMLCategory.prototype.toHtml = function() {
";
- for (var i = 0; i < this.opList.length; i++) {
+ for (let i = 0; i < this.opList.length; i++) {
html += this.opList[i].toStubHtml();
}
diff --git a/src/web/HTMLIngredient.js b/src/web/HTMLIngredient.js
index 05e98b9c..34bf547b 100755
--- a/src/web/HTMLIngredient.js
+++ b/src/web/HTMLIngredient.js
@@ -10,7 +10,7 @@
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var HTMLIngredient = function(config, app, manager) {
+const HTMLIngredient = function(config, app, manager) {
this.app = app;
this.manager = manager;
@@ -32,7 +32,7 @@ var HTMLIngredient = function(config, app, manager) {
* @returns {string}
*/
HTMLIngredient.prototype.toHtml = function() {
- var inline = (this.type === "boolean" ||
+ let inline = (this.type === "boolean" ||
this.type === "number" ||
this.type === "option" ||
this.type === "shortString" ||
@@ -158,15 +158,15 @@ HTMLIngredient.prototype.toHtml = function() {
* @param {event} e
*/
HTMLIngredient.prototype.toggleDisableArgs = function(e) {
- var el = e.target,
+ let el = e.target,
op = el.parentNode.parentNode,
args = op.querySelectorAll(".arg-group"),
els;
- for (var i = 0; i < this.disableArgs.length; i++) {
+ for (let i = 0; i < this.disableArgs.length; i++) {
els = args[this.disableArgs[i]].querySelectorAll("input, select, button");
- for (var j = 0; j < els.length; j++) {
+ for (let j = 0; j < els.length; j++) {
if (els[j].getAttribute("disabled")) {
els[j].removeAttribute("disabled");
} else {
@@ -186,7 +186,7 @@ HTMLIngredient.prototype.toggleDisableArgs = function(e) {
* @param {event} e
*/
HTMLIngredient.prototype.populateOptionChange = function(e) {
- var el = e.target,
+ let el = e.target,
op = el.parentNode.parentNode,
target = op.querySelectorAll(".arg-group")[this.target].querySelector("input, select, textarea");
@@ -203,7 +203,7 @@ HTMLIngredient.prototype.populateOptionChange = function(e) {
* @param {event} e
*/
HTMLIngredient.prototype.editableOptionChange = function(e) {
- var select = e.target,
+ let select = e.target,
input = select.nextSibling;
input.value = select.childNodes[select.selectedIndex].value;
diff --git a/src/web/HTMLOperation.js b/src/web/HTMLOperation.js
index dd9a8ee1..ea0d4397 100755
--- a/src/web/HTMLOperation.js
+++ b/src/web/HTMLOperation.js
@@ -14,7 +14,7 @@ import HTMLIngredient from "./HTMLIngredient.js";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var HTMLOperation = function(name, config, app, manager) {
+const HTMLOperation = function(name, config, app, manager) {
this.app = app;
this.manager = manager;
@@ -24,8 +24,8 @@ var HTMLOperation = function(name, config, app, manager) {
this.config = config;
this.ingList = [];
- for (var i = 0; i < config.args.length; i++) {
- var ing = new HTMLIngredient(config.args[i], this.app, this.manager);
+ for (let i = 0; i < config.args.length; i++) {
+ const ing = new HTMLIngredient(config.args[i], this.app, this.manager);
this.ingList.push(ing);
}
};
@@ -47,7 +47,7 @@ HTMLOperation.REMOVE_ICON = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABwkl
* @returns {string}
*/
HTMLOperation.prototype.toStubHtml = function(removeIcon) {
- var html = "- ";
+ let html = "
" + this.name + "
";
- for (var i = 0; i < this.ingList.length; i++) {
+ for (let i = 0; i < this.ingList.length; i++) {
html += this.ingList[i].toHtml();
}
diff --git a/src/web/HighlighterWaiter.js b/src/web/HighlighterWaiter.js
index 56e4ae81..94d388c5 100755
--- a/src/web/HighlighterWaiter.js
+++ b/src/web/HighlighterWaiter.js
@@ -11,7 +11,7 @@ import Utils from "../core/Utils.js";
* @constructor
* @param {App} app - The main view object for CyberChef.
*/
-var HighlighterWaiter = function(app) {
+const HighlighterWaiter = function(app) {
this.app = app;
this.mouseButtonDown = false;
@@ -41,11 +41,11 @@ HighlighterWaiter.OUTPUT = 1;
* @returns {boolean}
*/
HighlighterWaiter.prototype._isSelectionBackwards = function() {
- var backwards = false,
+ let backwards = false,
sel = window.getSelection();
if (!sel.isCollapsed) {
- var range = document.createRange();
+ const range = document.createRange();
range.setStart(sel.anchorNode, sel.anchorOffset);
range.setEnd(sel.focusNode, sel.focusOffset);
backwards = range.collapsed;
@@ -64,7 +64,7 @@ HighlighterWaiter.prototype._isSelectionBackwards = function() {
* @returns {number}
*/
HighlighterWaiter.prototype._getOutputHtmlOffset = function(node, offset) {
- var sel = window.getSelection(),
+ let sel = window.getSelection(),
range = document.createRange();
range.selectNodeContents(document.getElementById("output-html"));
@@ -85,7 +85,7 @@ HighlighterWaiter.prototype._getOutputHtmlOffset = function(node, offset) {
* @returns {number} pos.end
*/
HighlighterWaiter.prototype._getOutputHtmlSelectionOffsets = function() {
- var sel = window.getSelection(),
+ let sel = window.getSelection(),
range,
start = 0,
end = 0,
@@ -121,7 +121,7 @@ HighlighterWaiter.prototype._getOutputHtmlSelectionOffsets = function() {
* @param {event} e
*/
HighlighterWaiter.prototype.inputScroll = function(e) {
- var el = e.target;
+ const el = e.target;
document.getElementById("input-highlighter").scrollTop = el.scrollTop;
document.getElementById("input-highlighter").scrollLeft = el.scrollLeft;
};
@@ -134,7 +134,7 @@ HighlighterWaiter.prototype.inputScroll = function(e) {
* @param {event} e
*/
HighlighterWaiter.prototype.outputScroll = function(e) {
- var el = e.target;
+ const el = e.target;
document.getElementById("output-highlighter").scrollTop = el.scrollTop;
document.getElementById("output-highlighter").scrollLeft = el.scrollLeft;
};
@@ -151,7 +151,7 @@ HighlighterWaiter.prototype.inputMousedown = function(e) {
this.mouseTarget = HighlighterWaiter.INPUT;
this.removeHighlights();
- var el = e.target,
+ let el = e.target,
start = el.selectionStart,
end = el.selectionEnd;
@@ -173,7 +173,7 @@ HighlighterWaiter.prototype.outputMousedown = function(e) {
this.mouseTarget = HighlighterWaiter.OUTPUT;
this.removeHighlights();
- var el = e.target,
+ let el = e.target,
start = el.selectionStart,
end = el.selectionEnd;
@@ -194,7 +194,7 @@ HighlighterWaiter.prototype.outputHtmlMousedown = function(e) {
this.mouseButtonDown = true;
this.mouseTarget = HighlighterWaiter.OUTPUT;
- var sel = this._getOutputHtmlSelectionOffsets();
+ const sel = this._getOutputHtmlSelectionOffsets();
if (sel.start !== 0 || sel.end !== 0) {
document.getElementById("output-selection-info").innerHTML = this.selectionInfo(sel.start, sel.end);
}
@@ -244,7 +244,7 @@ HighlighterWaiter.prototype.inputMousemove = function(e) {
this.mouseTarget !== HighlighterWaiter.INPUT)
return;
- var el = e.target,
+ let el = e.target,
start = el.selectionStart,
end = el.selectionEnd;
@@ -268,7 +268,7 @@ HighlighterWaiter.prototype.outputMousemove = function(e) {
this.mouseTarget !== HighlighterWaiter.OUTPUT)
return;
- var el = e.target,
+ let el = e.target,
start = el.selectionStart,
end = el.selectionEnd;
@@ -292,7 +292,7 @@ HighlighterWaiter.prototype.outputHtmlMousemove = function(e) {
this.mouseTarget !== HighlighterWaiter.OUTPUT)
return;
- var sel = this._getOutputHtmlSelectionOffsets();
+ const sel = this._getOutputHtmlSelectionOffsets();
if (sel.start !== 0 || sel.end !== 0) {
document.getElementById("output-selection-info").innerHTML = this.selectionInfo(sel.start, sel.end);
}
@@ -308,9 +308,9 @@ HighlighterWaiter.prototype.outputHtmlMousemove = function(e) {
* @returns {string}
*/
HighlighterWaiter.prototype.selectionInfo = function(start, end) {
- var width = end.toString().length;
+ let width = end.toString().length;
width = width < 2 ? 2 : width;
- var startStr = Utils.pad(start.toString(), width, " ").replace(/ /g, " "),
+ let startStr = Utils.pad(start.toString(), width, " ").replace(/ /g, " "),
endStr = Utils.pad(end.toString(), width, " ").replace(/ /g, " "),
lenStr = Utils.pad((end-start).toString(), width, " ").replace(/ /g, " ");
@@ -339,16 +339,16 @@ HighlighterWaiter.prototype.removeHighlights = function() {
* @returns {Object[]} highlights[].args
*/
HighlighterWaiter.prototype.generateHighlightList = function() {
- var recipeConfig = this.app.getRecipeConfig(),
+ let recipeConfig = this.app.getRecipeConfig(),
highlights = [];
- for (var i = 0; i < recipeConfig.length; i++) {
+ for (let i = 0; i < recipeConfig.length; i++) {
if (recipeConfig[i].disabled) continue;
// If any breakpoints are set, do not attempt to highlight
if (recipeConfig[i].breakpoint) return false;
- var op = this.app.operations[recipeConfig[i].op];
+ const op = this.app.operations[recipeConfig[i].op];
// If any of the operations do not support highlighting, fail immediately.
if (op.highlight === false || op.highlight === undefined) return false;
@@ -376,13 +376,13 @@ HighlighterWaiter.prototype.generateHighlightList = function() {
* @param {number} pos.end - The end offset.
*/
HighlighterWaiter.prototype.highlightOutput = function(pos) {
- var highlights = this.generateHighlightList();
+ const highlights = this.generateHighlightList();
if (!highlights || !this.app.autoBake_) {
return false;
}
- for (var i = 0; i < highlights.length; i++) {
+ for (let i = 0; i < highlights.length; i++) {
// Remove multiple highlights before processing again
pos = [pos[0]];
@@ -411,13 +411,13 @@ HighlighterWaiter.prototype.highlightOutput = function(pos) {
* @param {number} pos.end - The end offset.
*/
HighlighterWaiter.prototype.highlightInput = function(pos) {
- var highlights = this.generateHighlightList();
+ const highlights = this.generateHighlightList();
if (!highlights || !this.app.autoBake_) {
return false;
}
- for (var i = 0; i < highlights.length; i++) {
+ for (let i = 0; i < highlights.length; i++) {
// Remove multiple highlights before processing again
pos = [pos[0]];
@@ -452,7 +452,7 @@ HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) {
// be displayed by the HTML textarea and will mess up highlighting offsets.
if (!this.app.dishStr || this.app.dishStr.indexOf("\r") >= 0) return false;
- var startPlaceholder = "[startHighlight]",
+ let startPlaceholder = "[startHighlight]",
startPlaceholderRegex = /\[startHighlight\]/g,
endPlaceholder = "[endHighlight]",
endPlaceholderRegex = /\[endHighlight\]/g,
@@ -468,11 +468,11 @@ HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) {
text.slice(pos[0].end, text.length);
} else {
// O(n^2) - Can anyone improve this without overwriting placeholders?
- var result = "",
+ let result = "",
endPlaced = true;
- for (var i = 0; i < text.length; i++) {
- for (var j = 1; j < pos.length; j++) {
+ for (let i = 0; i < text.length; i++) {
+ for (let j = 1; j < pos.length; j++) {
if (pos[j].end < pos[j].start) continue;
if (pos[j].start === i) {
result += startPlaceholder;
@@ -489,7 +489,7 @@ HighlighterWaiter.prototype.highlight = function(textarea, highlighter, pos) {
text = result;
}
- var cssClass = "hl1";
+ const cssClass = "hl1";
//if (colour) cssClass += "-"+colour;
// Remove HTML tags
diff --git a/src/web/InputWaiter.js b/src/web/InputWaiter.js
index 158d2b70..f2e8a836 100755
--- a/src/web/InputWaiter.js
+++ b/src/web/InputWaiter.js
@@ -12,7 +12,7 @@ import Utils from "../core/Utils.js";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var InputWaiter = function(app, manager) {
+const InputWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
@@ -66,11 +66,11 @@ InputWaiter.prototype.set = function(input) {
* @param {number} lines - The number of the lines in the current input string
*/
InputWaiter.prototype.setInputInfo = function(length, lines) {
- var width = length.toString().length;
+ let width = length.toString().length;
width = width < 2 ? 2 : width;
- var lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " ");
- var linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " ");
+ const lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " ");
+ const linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " ");
document.getElementById("input-info").innerHTML = "length: " + lengthStr + "
lines: " + linesStr;
};
@@ -92,7 +92,7 @@ InputWaiter.prototype.inputChange = function(e) {
this.app.progress = 0;
// Update the input metadata info
- var inputText = this.get(),
+ let inputText = this.get(),
lines = inputText.count("\n") + 1;
this.setInputInfo(inputText.length, lines);
@@ -149,7 +149,7 @@ InputWaiter.prototype.inputDrop = function(e) {
e.stopPropagation();
e.preventDefault();
- var el = e.target,
+ let el = e.target,
file = e.dataTransfer.files[0],
text = e.dataTransfer.getData("Text"),
reader = new FileReader(),
@@ -157,14 +157,14 @@ InputWaiter.prototype.inputDrop = function(e) {
offset = 0,
CHUNK_SIZE = 20480; // 20KB
- var setInput = function() {
+ const setInput = function() {
if (inputCharcode.length > 100000 && this.app.autoBake_) {
this.manager.controls.setAutoBake(false);
this.app.alert("Turned off Auto Bake as the input is large", "warning", 5000);
}
this.set(inputCharcode);
- var recipeConfig = this.app.getRecipeConfig();
+ const recipeConfig = this.app.getRecipeConfig();
if (!recipeConfig[0] || recipeConfig[0].op !== "From Hex") {
recipeConfig.unshift({op:"From Hex", args:["Space"]});
this.app.setRecipeConfig(recipeConfig);
@@ -173,18 +173,18 @@ InputWaiter.prototype.inputDrop = function(e) {
el.classList.remove("loadingFile");
}.bind(this);
- var seek = function() {
+ const seek = function() {
if (offset >= file.size) {
setInput();
return;
}
el.value = "Processing... " + Math.round(offset / file.size * 100) + "%";
- var slice = file.slice(offset, offset + CHUNK_SIZE);
+ const slice = file.slice(offset, offset + CHUNK_SIZE);
reader.readAsArrayBuffer(slice);
};
reader.onload = function(e) {
- var data = new Uint8Array(reader.result);
+ const data = new Uint8Array(reader.result);
inputCharcode += Utils.toHexFast(data);
offset += CHUNK_SIZE;
seek();
diff --git a/src/web/Manager.js b/src/web/Manager.js
index 28b9f93a..efefc44d 100755
--- a/src/web/Manager.js
+++ b/src/web/Manager.js
@@ -19,7 +19,7 @@ import SeasonalWaiter from "./SeasonalWaiter.js";
* @constructor
* @param {App} app - The main view object for CyberChef.
*/
-var Manager = function(app) {
+const Manager = function(app) {
this.app = app;
// Define custom events
@@ -195,8 +195,8 @@ Manager.prototype.addListeners = function(selector, eventType, callback, scope)
* this.addMultiEventListener("search", "keyup paste search", this.search, this);
*/
Manager.prototype.addMultiEventListener = function(selector, eventTypes, callback, scope) {
- var evs = eventTypes.split(" ");
- for (var i = 0; i < evs.length; i++) {
+ const evs = eventTypes.split(" ");
+ for (let i = 0; i < evs.length; i++) {
document.querySelector(selector).addEventListener(evs[i], callback.bind(scope));
}
};
@@ -216,8 +216,8 @@ Manager.prototype.addMultiEventListener = function(selector, eventTypes, callbac
* this.addMultiEventListener(".saveable", "keyup paste", this.save, this);
*/
Manager.prototype.addMultiEventListeners = function(selector, eventTypes, callback, scope) {
- var evs = eventTypes.split(" ");
- for (var i = 0; i < evs.length; i++) {
+ const evs = eventTypes.split(" ");
+ for (let i = 0; i < evs.length; i++) {
this.addListeners(selector, evs[i], callback, scope);
}
};
@@ -238,7 +238,7 @@ Manager.prototype.addMultiEventListeners = function(selector, eventTypes, callba
* this.addDynamicListener("button", "click", alert, this);
*/
Manager.prototype.addDynamicListener = function(selector, eventType, callback, scope) {
- var eventConfig = {
+ const eventConfig = {
selector: selector,
callback: callback.bind(scope || this)
};
@@ -261,14 +261,14 @@ Manager.prototype.addDynamicListener = function(selector, eventType, callback, s
* @param {Event} e - The event to be handled
*/
Manager.prototype.dynamicListenerHandler = function(e) {
- var handlers = this.dynamicHandlers[e.type],
+ let handlers = this.dynamicHandlers[e.type],
matches = e.target.matches ||
e.target.webkitMatchesSelector ||
e.target.mozMatchesSelector ||
e.target.msMatchesSelector ||
e.target.oMatchesSelector;
- for (var i = 0; i < handlers.length; i++) {
+ for (let i = 0; i < handlers.length; i++) {
if (matches && e.target[matches.name](handlers[i].selector)) {
handlers[i].callback(e);
}
diff --git a/src/web/OperationsWaiter.js b/src/web/OperationsWaiter.js
index 93f6e6af..b53fa35d 100755
--- a/src/web/OperationsWaiter.js
+++ b/src/web/OperationsWaiter.js
@@ -13,7 +13,7 @@ import Sortable from "sortablejs";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var OperationsWaiter = function(app, manager) {
+const OperationsWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
@@ -29,7 +29,7 @@ var OperationsWaiter = function(app, manager) {
* @param {event} e
*/
OperationsWaiter.prototype.searchOperations = function(e) {
- var ops, selected;
+ let ops, selected;
if (e.type === "search") { // Search
e.preventDefault();
@@ -68,7 +68,7 @@ OperationsWaiter.prototype.searchOperations = function(e) {
ops[selected-1].classList.add("selected-op");
}
} else {
- var searchResultsEl = document.getElementById("search-results"),
+ let searchResultsEl = document.getElementById("search-results"),
el = e.target,
str = el.value;
@@ -81,10 +81,10 @@ OperationsWaiter.prototype.searchOperations = function(e) {
$("#categories .in").collapse("hide");
if (str) {
- var matchedOps = this.filterOperations(str, true),
+ let matchedOps = this.filterOperations(str, true),
matchedOpsHtml = "";
- for (var i = 0; i < matchedOps.length; i++) {
+ for (let i = 0; i < matchedOps.length; i++) {
matchedOpsHtml += matchedOps[i].toStubHtml();
}
@@ -104,18 +104,18 @@ OperationsWaiter.prototype.searchOperations = function(e) {
* @returns {string[]}
*/
OperationsWaiter.prototype.filterOperations = function(searchStr, highlight) {
- var matchedOps = [],
+ let matchedOps = [],
matchedDescs = [];
searchStr = searchStr.toLowerCase();
- for (var opName in this.app.operations) {
- var op = this.app.operations[opName],
+ for (const opName in this.app.operations) {
+ let op = this.app.operations[opName],
namePos = opName.toLowerCase().indexOf(searchStr),
descPos = op.description.toLowerCase().indexOf(searchStr);
if (namePos >= 0 || descPos >= 0) {
- var operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
+ const operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
if (highlight) {
operation.highlightSearchString(searchStr, namePos, descPos);
}
@@ -140,7 +140,7 @@ OperationsWaiter.prototype.filterOperations = function(searchStr, highlight) {
* @returns {number}
*/
OperationsWaiter.prototype.getSelectedOp = function(ops) {
- for (var i = 0; i < ops.length; i++) {
+ for (let i = 0; i < ops.length; i++) {
if (ops[i].classList.contains("selected-op")) {
return i;
}
@@ -168,7 +168,7 @@ OperationsWaiter.prototype.opListCreate = function(e) {
* @param {event} e
*/
OperationsWaiter.prototype.operationDblclick = function(e) {
- var li = e.target;
+ const li = e.target;
this.manager.recipe.addOperation(li.textContent);
this.app.autoBake();
@@ -186,25 +186,25 @@ OperationsWaiter.prototype.editFavouritesClick = function(e) {
e.stopPropagation();
// Add favourites to modal
- var favCat = this.app.categories.filter(function(c) {
+ const favCat = this.app.categories.filter(function(c) {
return c.name === "Favourites";
})[0];
- var html = "";
- for (var i = 0; i < favCat.ops.length; i++) {
- var opName = favCat.ops[i];
- var operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
+ let html = "";
+ for (let i = 0; i < favCat.ops.length; i++) {
+ const opName = favCat.ops[i];
+ const operation = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
html += operation.toStubHtml(true);
}
- var editFavouritesList = document.getElementById("edit-favourites-list");
+ const editFavouritesList = document.getElementById("edit-favourites-list");
editFavouritesList.innerHTML = html;
this.removeIntent = false;
var editableList = Sortable.create(editFavouritesList, {
filter: ".remove-icon",
onFilter: function (evt) {
- var el = editableList.closest(evt.item);
+ const el = editableList.closest(evt.item);
if (el) {
$(el).popover("destroy");
el.parentNode.removeChild(el);
@@ -236,10 +236,10 @@ OperationsWaiter.prototype.editFavouritesClick = function(e) {
* Saves the selected favourites and reloads them.
*/
OperationsWaiter.prototype.saveFavouritesClick = function() {
- var favouritesList = [],
+ let favouritesList = [],
favs = document.querySelectorAll("#edit-favourites-list li");
- for (var i = 0; i < favs.length; i++) {
+ for (let i = 0; i < favs.length; i++) {
favouritesList.push(favs[i].textContent);
}
@@ -266,7 +266,7 @@ OperationsWaiter.prototype.resetFavouritesClick = function() {
* @param {event} e
*/
OperationsWaiter.prototype.opIconMouseover = function(e) {
- var opEl = e.target.parentNode;
+ const opEl = e.target.parentNode;
if (e.target.getAttribute("data-toggle") === "popover") {
$(opEl).popover("hide");
}
@@ -281,7 +281,7 @@ OperationsWaiter.prototype.opIconMouseover = function(e) {
* @param {event} e
*/
OperationsWaiter.prototype.opIconMouseleave = function(e) {
- var opEl = e.target.parentNode,
+ let opEl = e.target.parentNode,
toEl = e.toElement || e.relatedElement;
if (e.target.getAttribute("data-toggle") === "popover" && toEl === opEl) {
diff --git a/src/web/OptionsWaiter.js b/src/web/OptionsWaiter.js
index d7c89eb6..5af44be1 100755
--- a/src/web/OptionsWaiter.js
+++ b/src/web/OptionsWaiter.js
@@ -8,7 +8,7 @@
* @constructor
* @param {App} app - The main view object for CyberChef.
*/
-var OptionsWaiter = function(app) {
+const OptionsWaiter = function(app) {
this.app = app;
};
@@ -24,23 +24,23 @@ OptionsWaiter.prototype.load = function(options) {
animate: false,
});
- for (var option in options) {
+ for (const option in options) {
this.app.options[option] = options[option];
}
// Set options to match object
- var cboxes = document.querySelectorAll("#options-body input[type=checkbox]");
+ const cboxes = document.querySelectorAll("#options-body input[type=checkbox]");
for (var i = 0; i < cboxes.length; i++) {
$(cboxes[i]).bootstrapSwitch("state", this.app.options[cboxes[i].getAttribute("option")]);
}
- var nboxes = document.querySelectorAll("#options-body input[type=number]");
+ const nboxes = document.querySelectorAll("#options-body input[type=number]");
for (i = 0; i < nboxes.length; i++) {
nboxes[i].value = this.app.options[nboxes[i].getAttribute("option")];
nboxes[i].dispatchEvent(new CustomEvent("change", {bubbles: true}));
}
- var selects = document.querySelectorAll("#options-body select");
+ const selects = document.querySelectorAll("#options-body select");
for (i = 0; i < selects.length; i++) {
selects[i].value = this.app.options[selects[i].getAttribute("option")];
selects[i].dispatchEvent(new CustomEvent("change", {bubbles: true}));
@@ -74,7 +74,7 @@ OptionsWaiter.prototype.resetOptionsClick = function() {
* @param {boolean} state
*/
OptionsWaiter.prototype.switchChange = function(e, state) {
- var el = e.target,
+ let el = e.target,
option = el.getAttribute("option");
this.app.options[option] = state;
@@ -89,7 +89,7 @@ OptionsWaiter.prototype.switchChange = function(e, state) {
* @param {event} e
*/
OptionsWaiter.prototype.numberChange = function(e) {
- var el = e.target,
+ let el = e.target,
option = el.getAttribute("option");
this.app.options[option] = parseInt(el.value, 10);
@@ -104,7 +104,7 @@ OptionsWaiter.prototype.numberChange = function(e) {
* @param {event} e
*/
OptionsWaiter.prototype.selectChange = function(e) {
- var el = e.target,
+ let el = e.target,
option = el.getAttribute("option");
this.app.options[option] = el.value;
diff --git a/src/web/OutputWaiter.js b/src/web/OutputWaiter.js
index 90f297d3..7ff2cf0b 100755
--- a/src/web/OutputWaiter.js
+++ b/src/web/OutputWaiter.js
@@ -12,7 +12,7 @@ import Utils from "../core/Utils.js";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var OutputWaiter = function(app, manager) {
+const OutputWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
};
@@ -36,7 +36,7 @@ OutputWaiter.prototype.get = function() {
* @param {number} duration - The length of time (ms) it took to generate the output
*/
OutputWaiter.prototype.set = function(dataStr, type, duration) {
- var outputText = document.getElementById("output-text"),
+ let outputText = document.getElementById("output-text"),
outputHtml = document.getElementById("output-html"),
outputHighlighter = document.getElementById("output-highlighter"),
inputHighlighter = document.getElementById("input-highlighter");
@@ -51,8 +51,8 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) {
outputHtml.innerHTML = dataStr;
// Execute script sections
- var scriptElements = outputHtml.querySelectorAll("script");
- for (var i = 0; i < scriptElements.length; i++) {
+ const scriptElements = outputHtml.querySelectorAll("script");
+ for (let i = 0; i < scriptElements.length; i++) {
try {
eval(scriptElements[i].innerHTML); // eslint-disable-line no-eval
} catch (err) {
@@ -70,7 +70,7 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) {
}
this.manager.highlighter.removeHighlights();
- var lines = dataStr.count("\n") + 1;
+ const lines = dataStr.count("\n") + 1;
this.setOutputInfo(dataStr.length, lines, duration);
};
@@ -83,12 +83,12 @@ OutputWaiter.prototype.set = function(dataStr, type, duration) {
* @param {number} duration - The length of time (ms) it took to generate the output
*/
OutputWaiter.prototype.setOutputInfo = function(length, lines, duration) {
- var width = length.toString().length;
+ let width = length.toString().length;
width = width < 4 ? 4 : width;
- var lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " ");
- var linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " ");
- var timeStr = Utils.pad(duration.toString() + "ms", width, " ").replace(/ /g, " ");
+ const lengthStr = Utils.pad(length.toString(), width, " ").replace(/ /g, " ");
+ const linesStr = Utils.pad(lines.toString(), width, " ").replace(/ /g, " ");
+ const timeStr = Utils.pad(duration.toString() + "ms", width, " ").replace(/ /g, " ");
document.getElementById("output-info").innerHTML = "time: " + timeStr +
"
length: " + lengthStr +
@@ -103,7 +103,7 @@ OutputWaiter.prototype.setOutputInfo = function(length, lines, duration) {
* without wrapping or overflowing.
*/
OutputWaiter.prototype.adjustWidth = function() {
- var output = document.getElementById("output"),
+ let output = document.getElementById("output"),
saveToFile = document.getElementById("save-to-file"),
switchIO = document.getElementById("switch"),
undoSwitch = document.getElementById("undo-switch"),
@@ -129,11 +129,11 @@ OutputWaiter.prototype.adjustWidth = function() {
* Saves the current output to a file, downloaded as a URL octet stream.
*/
OutputWaiter.prototype.saveClick = function() {
- var data = Utils.toBase64(this.app.dishStr),
+ let data = Utils.toBase64(this.app.dishStr),
filename = window.prompt("Please enter a filename:", "download.dat");
if (filename) {
- var el = document.createElement("a");
+ const el = document.createElement("a");
el.setAttribute("href", "data:application/octet-stream;base64;charset=utf-8," + data);
el.setAttribute("download", filename);
@@ -173,7 +173,7 @@ OutputWaiter.prototype.undoSwitchClick = function() {
* Resizes the output frame to be as large as possible, or restores it to its original size.
*/
OutputWaiter.prototype.maximiseOutputClick = function(e) {
- var el = e.target.id === "maximise-output" ? e.target : e.target.parentNode;
+ const el = e.target.id === "maximise-output" ? e.target : e.target.parentNode;
if (el.getAttribute("title") === "Maximise") {
this.app.columnSplitter.collapse(0);
diff --git a/src/web/RecipeWaiter.js b/src/web/RecipeWaiter.js
index 17ced77e..57d7b272 100755
--- a/src/web/RecipeWaiter.js
+++ b/src/web/RecipeWaiter.js
@@ -13,7 +13,7 @@ import Sortable from "sortablejs";
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var RecipeWaiter = function(app, manager) {
+const RecipeWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
this.removeIntent = false;
@@ -24,7 +24,7 @@ var RecipeWaiter = function(app, manager) {
* Sets up the drag and drop capability for operations in the operations and recipe areas.
*/
RecipeWaiter.prototype.initialiseOperationDragNDrop = function() {
- var recList = document.getElementById("rec-list");
+ const recList = document.getElementById("rec-list");
// Recipe list
Sortable.create(recList, {
@@ -60,7 +60,7 @@ RecipeWaiter.prototype.initialiseOperationDragNDrop = function() {
}.bind(this));
Sortable.utils.on(recList, "touchend", function(e) {
- var loc = e.changedTouches[0],
+ let loc = e.changedTouches[0],
target = document.elementFromPoint(loc.clientX, loc.clientY);
this.removeIntent = !recList.contains(target);
@@ -182,7 +182,7 @@ RecipeWaiter.prototype.favDrop = function(e) {
e.preventDefault();
e.target.classList.remove("favourites-hover");
- var opName = e.dataTransfer.getData("Text");
+ const opName = e.dataTransfer.getData("Text");
this.app.addFavourite(opName);
};
@@ -205,7 +205,7 @@ RecipeWaiter.prototype.ingChange = function() {
* @param {event} e
*/
RecipeWaiter.prototype.disableClick = function(e) {
- var icon = e.target;
+ const icon = e.target;
if (icon.getAttribute("disabled") === "false") {
icon.setAttribute("disabled", "true");
@@ -230,7 +230,7 @@ RecipeWaiter.prototype.disableClick = function(e) {
* @param {event} e
*/
RecipeWaiter.prototype.breakpointClick = function(e) {
- var bp = e.target;
+ const bp = e.target;
if (bp.getAttribute("break") === "false") {
bp.setAttribute("break", "true");
@@ -276,16 +276,16 @@ RecipeWaiter.prototype.operationChildDblclick = function(e) {
* @returns {recipeConfig}
*/
RecipeWaiter.prototype.getConfig = function() {
- var config = [], ingredients, ingList, disabled, bp, item,
+ let config = [], ingredients, ingList, disabled, bp, item,
operations = document.querySelectorAll("#rec-list li.operation");
- for (var i = 0; i < operations.length; i++) {
+ for (let i = 0; i < operations.length; i++) {
ingredients = [];
disabled = operations[i].querySelector(".disable-icon");
bp = operations[i].querySelector(".breakpoint");
ingList = operations[i].querySelectorAll(".arg");
- for (var j = 0; j < ingList.length; j++) {
+ for (let j = 0; j < ingList.length; j++) {
if (ingList[j].getAttribute("type") === "checkbox") {
// checkbox
ingredients[j] = ingList[j].checked;
@@ -327,8 +327,8 @@ RecipeWaiter.prototype.getConfig = function() {
* @param {number} position
*/
RecipeWaiter.prototype.updateBreakpointIndicator = function(position) {
- var operations = document.querySelectorAll("#rec-list li.operation");
- for (var i = 0; i < operations.length; i++) {
+ const operations = document.querySelectorAll("#rec-list li.operation");
+ for (let i = 0; i < operations.length; i++) {
if (i === position) {
operations[i].classList.add("break");
} else {
@@ -345,8 +345,8 @@ RecipeWaiter.prototype.updateBreakpointIndicator = function(position) {
* @param {element} el - The operation stub element from the operations pane
*/
RecipeWaiter.prototype.buildRecipeOperation = function(el) {
- var opName = el.textContent;
- var op = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
+ const opName = el.textContent;
+ const op = new HTMLOperation(opName, this.app.operations[opName], this.app, this.manager);
el.innerHTML = op.toFullHtml();
if (this.app.operations[opName].flowControl) {
@@ -369,7 +369,7 @@ RecipeWaiter.prototype.buildRecipeOperation = function(el) {
* @returns {element}
*/
RecipeWaiter.prototype.addOperation = function(name) {
- var item = document.createElement("li");
+ const item = document.createElement("li");
item.classList.add("operation");
item.innerHTML = name;
@@ -387,7 +387,7 @@ RecipeWaiter.prototype.addOperation = function(name) {
* @fires Manager#operationremove
*/
RecipeWaiter.prototype.clearRecipe = function() {
- var recList = document.getElementById("rec-list");
+ const recList = document.getElementById("rec-list");
while (recList.firstChild) {
recList.removeChild(recList.firstChild);
}
@@ -402,7 +402,7 @@ RecipeWaiter.prototype.clearRecipe = function() {
* @param {event} e
*/
RecipeWaiter.prototype.dropdownToggleClick = function(e) {
- var el = e.target,
+ let el = e.target,
button = el.parentNode.parentNode.previousSibling;
button.innerHTML = el.textContent + " ";
diff --git a/src/web/SeasonalWaiter.js b/src/web/SeasonalWaiter.js
index ad897b63..b2fae5c8 100755
--- a/src/web/SeasonalWaiter.js
+++ b/src/web/SeasonalWaiter.js
@@ -9,7 +9,7 @@
* @param {App} app - The main view object for CyberChef.
* @param {Manager} manager - The CyberChef event manager.
*/
-var SeasonalWaiter = function(app, manager) {
+const SeasonalWaiter = function(app, manager) {
this.app = app;
this.manager = manager;
};
@@ -38,7 +38,7 @@ SeasonalWaiter.prototype.load = function() {
* #spiderchef
*/
SeasonalWaiter.prototype.insertSpiderIcons = function() {
- var spider16 = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB3UlEQVQ4y2NgGJaAmYGBgVnf0oKJgYGBobWtXamqqoYTn2I4CI+LTzM2NTulpKbu+vPHz2dV5RWlluZmi3j5+KqFJSSEzpw8uQPdAEYYIzo5Kfjrl28rWFlZzjAzMYuEBQao3Lh+g+HGvbsMzExMDN++fWf4/PXLBzY2tqYNK1f2+4eHM2xcuRLigsT09Igf3384MTExbf767etBI319jU8fPsi+//jx/72HDxh5uLkZ7ty7y/Dz1687Avz8n2UUFR3Z2NjOySoqfmdhYGBg+PbtuwI7O8e5H79+8X379t357PnzYo+ePP7y6cuXc9++f69nYGRsvf/w4XdtLS2R799/bBUWFHr57sP7Jbs3b/ZkzswvUP3165fZ7z9//r988WIVAyPDr8tXr576+u3bpb9//7YwMjKeV1dV41NWVGoVEhDgPH761DJREeHaz1+/lqlpafUx6+jrRfz4+fPy+w8fTu/fsf3uw7t3L39+//4cv7DwGQYGhpdPbt9m4BcRFlNWVJC4fuvWASszs4C379792Ldt2xZBUdEdDP5hYSqQ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UvfLCAkfRwoPUtq6l5o5+lZb5SolJo6oT8avTCl+c9OTmat6pKW8mLkvBpGzlvsiGuQr4ZEEwA1EQgoR/gNtxIxKBluz+OtMJiF31jHxqXBiAqAUj4WRxpADFM0DCFlv1khvX7Wol4vF4AIldVVxdZqlrIfiCYQPHDy6bAGv7nKYRVY6JewExZVAP+ey5Rv+Ba97aaUHMW5NauLmMZFkegBb/EP14d6NoS9QLWFSzWBmuZza8CQmSpXsAqmGtVy14VALWuuYWWy+W3OteXa4jwceQX6+BKG6J1/8+2VCNkm2222WabbbbZZpttttlmm22rt38DCdA0vq3bcAkAAAAASUVORK5CYII=";
@@ -89,8 +89,8 @@ SeasonalWaiter.prototype.insertSpiderText = function() {
*/
SeasonalWaiter.prototype.konamiCodeListener = function(e) {
this.kkeys.push(e.keyCode);
- var konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
- for (var i = 0; i < this.kkeys.length; i++) {
+ const konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
+ for (let i = 0; i < this.kkeys.length; i++) {
if (this.kkeys[i] !== konami[i]) {
this.kkeys = [];
break;
@@ -113,13 +113,13 @@ SeasonalWaiter.prototype.konamiCodeListener = function(e) {
*/
SeasonalWaiter.treeWalk = (function() {
// Create closure for constants
- var skipTags = {
+ const skipTags = {
"SCRIPT": true, "IFRAME": true, "OBJECT": true,
"EMBED": true, "STYLE": true, "LINK": true, "META": true
};
return function(parent, fn, allNodes) {
- var node = parent.firstChild;
+ let node = parent.firstChild;
while (node && node !== parent) {
if (allNodes || node.nodeType === 1) {
diff --git a/src/web/WindowWaiter.js b/src/web/WindowWaiter.js
index d85ee6b6..e0d3944c 100755
--- a/src/web/WindowWaiter.js
+++ b/src/web/WindowWaiter.js
@@ -8,7 +8,7 @@
* @constructor
* @param {App} app - The main view object for CyberChef.
*/
-var WindowWaiter = function(app) {
+const WindowWaiter = function(app) {
this.app = app;
};
@@ -45,7 +45,7 @@ WindowWaiter.prototype.windowBlur = function() {
* a long time and the browser has swapped out all its memory.
*/
WindowWaiter.prototype.windowFocus = function() {
- var unfocusedTime = new Date().getTime() - this.windowBlurTime;
+ const unfocusedTime = new Date().getTime() - this.windowBlurTime;
if (unfocusedTime > 60000) {
this.app.silentBake();
}
diff --git a/src/web/index.js b/src/web/index.js
index 8976b4fa..98631ea1 100755
--- a/src/web/index.js
+++ b/src/web/index.js
@@ -24,7 +24,7 @@ import OperationConfig from "../core/config/OperationConfig.js";
* Main function used to build the CyberChef web app.
*/
var main = function() {
- var defaultFavourites = [
+ const defaultFavourites = [
"To Base64",
"From Base64",
"To Hex",
@@ -37,7 +37,7 @@ var main = function() {
"Fork"
];
- var defaultOptions = {
+ const defaultOptions = {
updateUrl : true,
showHighlighter : true,
treatAsUtf8 : true,