mirror of
https://github.com/gchq/CyberChef
synced 2025-01-13 13:08:48 +00:00
Improved web app title construction
This commit is contained in:
parent
9d60ec22ee
commit
19c54a99cd
1 changed files with 8 additions and 1 deletions
|
@ -676,7 +676,14 @@ App.prototype.stateChange = function(e) {
|
||||||
if (recipeConfig.length === 1) {
|
if (recipeConfig.length === 1) {
|
||||||
title = `${recipeConfig[0].op} - ${title}`;
|
title = `${recipeConfig[0].op} - ${title}`;
|
||||||
} else if (recipeConfig.length > 1) {
|
} else if (recipeConfig.length > 1) {
|
||||||
title = `${recipeConfig.length} operations - ${title}`;
|
// See how long the full recipe is
|
||||||
|
const ops = recipeConfig.map(op => op.op).join(", ");
|
||||||
|
if (ops.length < 45) {
|
||||||
|
title = `${ops} - ${title}`;
|
||||||
|
} else {
|
||||||
|
// If it's too long, just use the first one and say how many more there are
|
||||||
|
title = `${recipeConfig[0].op}, ${recipeConfig.length - 1} more - ${title}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
document.title = title;
|
document.title = title;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue