diff --git a/src/core/Utils.js b/src/core/Utils.js
index 9011880f..4fd464cc 100755
--- a/src/core/Utils.js
+++ b/src/core/Utils.js
@@ -942,6 +942,12 @@ const Utils = {
"aria-controls='collapse" + i + "' " +
"title=\"Show/hide contents of '" + Utils.escapeHtml(file.fileName) + "'\">🔍";
+ const hexFileData = Utils.byteArrayToHex(new Uint8Array(file.bytes));
+
+ const switchFileDataToInput = "⇧";
+
const html = "
" +
"
" +
"
" +
@@ -949,6 +955,7 @@ const Utils = {
Utils.escapeHtml(file.fileName) +
" " + expandFileContentsElem +
" " + downloadAnchorElem +
+ " " + switchFileDataToInput +
"" +
// These are for formatting when stripping HTML
"\n" +
diff --git a/src/web/Manager.js b/src/web/Manager.js
index ead3123d..dddeead7 100755
--- a/src/web/Manager.js
+++ b/src/web/Manager.js
@@ -158,6 +158,7 @@ Manager.prototype.initialiseEventListeners = function() {
// Misc
document.getElementById("alert-close").addEventListener("click", this.app.alertCloseClick.bind(this.app));
+ this.addDynamicListener(".file-switch", "click", this.output.fileSwitch, this.output);
};
diff --git a/src/web/OutputWaiter.js b/src/web/OutputWaiter.js
index 98292784..3523db18 100755
--- a/src/web/OutputWaiter.js
+++ b/src/web/OutputWaiter.js
@@ -167,6 +167,16 @@ OutputWaiter.prototype.undoSwitchClick = function() {
document.getElementById("undo-switch").disabled = true;
};
+/**
+ * Handler for file switch click events.
+ * Moves a files data for items created via Utils.displayFilesAsHTML to the input.
+ */
+OutputWaiter.prototype.fileSwitch = function(e) {
+ this.switchOrigData = this.manager.input.get();
+ this.app.setInput(e.target.getAttribute("fileValue"));
+ document.getElementById("undo-switch").disabled = false;
+};
+
/**
* Handler for maximise output click events.