mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 16:51:31 -04:00
Input and Output character encodings are now stored in the URL, allowing for accuate deeplinking
This commit is contained in:
parent
a141873db8
commit
a07b8f693b
5 changed files with 51 additions and 30 deletions
|
@ -92,7 +92,7 @@ class OutputWaiter {
|
|||
bakeStats: this.bakeStats,
|
||||
eolHandler: this.eolChange.bind(this),
|
||||
chrEncHandler: this.chrEncChange.bind(this),
|
||||
initialChrEncVal: this.outputChrEnc
|
||||
chrEncGetter: this.getChrEnc.bind(this)
|
||||
}),
|
||||
htmlPlugin(this.htmlOutput),
|
||||
copyOverride(),
|
||||
|
@ -145,9 +145,20 @@ class OutputWaiter {
|
|||
* @param {number} chrEncVal
|
||||
*/
|
||||
chrEncChange(chrEncVal) {
|
||||
if (typeof chrEncVal !== "number") return;
|
||||
this.outputChrEnc = chrEncVal;
|
||||
// Reset the output, forcing it to re-decode the data with the new character encoding
|
||||
this.setOutput(this.currentOutputCache, true);
|
||||
// Update the URL manually since we aren't firing a statechange event
|
||||
this.app.updateURL(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for the input character encoding
|
||||
* @returns {number}
|
||||
*/
|
||||
getChrEnc() {
|
||||
return this.outputChrEnc;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue