mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
Fixed all HTML operations
This commit is contained in:
parent
ab44100312
commit
651ca6cf5d
13 changed files with 62 additions and 52 deletions
|
@ -47,9 +47,10 @@ class Diff extends Operation {
|
|||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "Ignore whitespace (relevant for word and line)",
|
||||
"name": "Ignore whitespace",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
"value": false,
|
||||
"hint": "Relevant for word and line"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ CMYK: ${cmyk}
|
|||
document.getElementById('input-text').value = 'rgba(' +
|
||||
color.r + ', ' + color.g + ', ' + color.b + ', ' + color.a + ')';
|
||||
window.app.autoBake();
|
||||
});
|
||||
}).children(".colorpicker").removeClass('dropdown-menu');
|
||||
</script>`;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
import Operation from "../Operation";
|
||||
import moment from "moment-timezone";
|
||||
import {DATETIME_FORMATS, FORMAT_EXAMPLES} from "../lib/DateTime";
|
||||
import OperationError from "../errors/OperationError";
|
||||
|
||||
/**
|
||||
* Parse DateTime operation
|
||||
|
@ -60,7 +59,7 @@ class ParseDateTime extends Operation {
|
|||
date = moment.tz(input, inputFormat, inputTimezone);
|
||||
if (!date || date.format() === "Invalid date") throw Error;
|
||||
} catch (err) {
|
||||
throw new OperationError(`Invalid format.\n\n${FORMAT_EXAMPLES}`);
|
||||
return `Invalid format.\n\n${FORMAT_EXAMPLES}`;
|
||||
}
|
||||
|
||||
output += "Date: " + date.format("dddd Do MMMM YYYY") +
|
||||
|
|
|
@ -152,7 +152,7 @@ class ToTable extends Operation {
|
|||
// If the first row is a header then put it in <thead> with <th> cells.
|
||||
if (firstRowHeader) {
|
||||
const row = tableData.shift();
|
||||
output += "<thead>";
|
||||
output += "<thead class='thead-light'>";
|
||||
output += outputRow(row, "th");
|
||||
output += "</thead>";
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class TranslateDateTimeFormat extends Operation {
|
|||
date = moment.tz(input, inputFormat, inputTimezone);
|
||||
if (!date || date.format() === "Invalid date") throw Error;
|
||||
} catch (err) {
|
||||
throw new OperationError(`Invalid format.\n\n${FORMAT_EXAMPLES}`);
|
||||
return `Invalid format.\n\n${FORMAT_EXAMPLES}`;
|
||||
}
|
||||
|
||||
return date.tz(outputTimezone).format(outputFormat);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue