mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-06 14:37:11 -04:00
notify user to use escape key on first tab press
This commit is contained in:
parent
c4e7c41a6e
commit
6d5592ffde
4 changed files with 27 additions and 3 deletions
|
@ -176,6 +176,7 @@ class Manager {
|
||||||
document.getElementById("btn-new-tab").addEventListener("click", this.input.addInputClick.bind(this.input));
|
document.getElementById("btn-new-tab").addEventListener("click", this.input.addInputClick.bind(this.input));
|
||||||
document.getElementById("btn-previous-input-tab").addEventListener("mousedown", this.input.previousTabClick.bind(this.input));
|
document.getElementById("btn-previous-input-tab").addEventListener("mousedown", this.input.previousTabClick.bind(this.input));
|
||||||
document.getElementById("btn-next-input-tab").addEventListener("mousedown", this.input.nextTabClick.bind(this.input));
|
document.getElementById("btn-next-input-tab").addEventListener("mousedown", this.input.nextTabClick.bind(this.input));
|
||||||
|
document.getElementById("input-text").addEventListener("keydown", this.input.tabNotification.bind(this.input), false);
|
||||||
this.addListeners("#btn-next-input-tab,#btn-previous-input-tab", "mouseup", this.input.tabMouseUp, this.input);
|
this.addListeners("#btn-next-input-tab,#btn-previous-input-tab", "mouseup", this.input.tabMouseUp, this.input);
|
||||||
this.addListeners("#btn-next-input-tab,#btn-previous-input-tab", "mouseout", this.input.tabMouseUp, this.input);
|
this.addListeners("#btn-next-input-tab,#btn-previous-input-tab", "mouseout", this.input.tabMouseUp, this.input);
|
||||||
document.getElementById("btn-go-to-input-tab").addEventListener("click", this.input.goToTab.bind(this.input));
|
document.getElementById("btn-go-to-input-tab").addEventListener("click", this.input.goToTab.bind(this.input));
|
||||||
|
|
|
@ -238,7 +238,7 @@
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary bmd-btn-icon" id="reset-layout" data-toggle="tooltip" title="Reset pane layout" data-help-title="Resetting the pane layout" data-help="CyberChef's panes can be resized to suit your area of focus. This button will reset the pane sizes to their default configuration.">
|
<button type="button" class="btn btn-primary bmd-btn-icon" id="reset-layout" data-toggle="tooltip" title="Reset pane layout" data-help-title="Resetting the pane layout" data-help="CyberChef's panes can be resized to suit your area of focus. This button will reset the pane sizes to their default configuration.">
|
||||||
<i class="material-icons">view_compact</i>
|
<i class="material-icons" aria-hidden='true'>view_compact</i>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -380,6 +380,16 @@
|
||||||
filter: brightness(98%);
|
filter: brightness(98%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#input-alert {
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
clip-path: inset(50%);
|
||||||
|
height: 1px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Highlighting */
|
/* Highlighting */
|
||||||
.ͼ2.cm-focused .cm-selectionBackground {
|
.ͼ2.cm-focused .cm-selectionBackground {
|
||||||
background-color: var(--hl5);
|
background-color: var(--hl5);
|
||||||
|
|
|
@ -91,7 +91,7 @@ class InputWaiter {
|
||||||
lineWrapping: new Compartment,
|
lineWrapping: new Compartment,
|
||||||
fileDetailsPanel: new Compartment
|
fileDetailsPanel: new Compartment
|
||||||
};
|
};
|
||||||
|
localStorage.setItem("alerted", "no");
|
||||||
const initialState = EditorState.create({
|
const initialState = EditorState.create({
|
||||||
doc: null,
|
doc: null,
|
||||||
extensions: [
|
extensions: [
|
||||||
|
@ -141,7 +141,7 @@ class InputWaiter {
|
||||||
if (e.docChanged && !this.silentInputChange)
|
if (e.docChanged && !this.silentInputChange)
|
||||||
this.inputChange(e);
|
this.inputChange(e);
|
||||||
this.silentInputChange = false;
|
this.silentInputChange = false;
|
||||||
})
|
}),
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -186,7 +186,20 @@ class InputWaiter {
|
||||||
this.inputChrEnc = chrEncVal;
|
this.inputChrEnc = chrEncVal;
|
||||||
this.inputChange();
|
this.inputChange();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Handler for Tab key events within input
|
||||||
|
* Notifies keyboard/screen reader users how to navigate out of input field
|
||||||
|
* @param {event} event
|
||||||
|
*/
|
||||||
|
tabNotification(event) {
|
||||||
|
const alerted = localStorage.getItem("alerted") || "";
|
||||||
|
|
||||||
|
if (event.key === "Tab" && alerted !== "yes") {
|
||||||
|
this.app.alert("Press Escape then Tab to exit the input field.", 7000);
|
||||||
|
localStorage.setItem("alerted", "yes");
|
||||||
|
return $("#snackbar-container").append("<p role='alert' id='input-alert'>Press Escape then Tab to exit the input field.</p>");
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Getter for the input character encoding
|
* Getter for the input character encoding
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue