2016-11-28 10:42:58 +00:00
|
|
|
/**
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2016
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2017-04-09 13:06:59 +00:00
|
|
|
// Styles
|
2017-05-18 22:24:24 +00:00
|
|
|
import "./stylesheets/index.js";
|
2017-03-23 18:41:36 +00:00
|
|
|
|
|
|
|
// Libs
|
|
|
|
import "babel-polyfill";
|
2017-05-13 15:45:19 +00:00
|
|
|
import "bootstrap";
|
2017-03-23 18:41:36 +00:00
|
|
|
import "bootstrap-switch";
|
|
|
|
import "bootstrap-colorpicker";
|
|
|
|
import CanvasComponents from "../core/lib/canvascomponents.js";
|
|
|
|
|
|
|
|
// CyberChef
|
2017-03-23 17:52:20 +00:00
|
|
|
import App from "./App.js";
|
|
|
|
import Categories from "../core/config/Categories.js";
|
2017-09-17 12:47:33 +00:00
|
|
|
import OperationConfig from "../core/config/MetaConfig.js";
|
2017-03-23 18:41:36 +00:00
|
|
|
|
2017-03-21 22:41:44 +00:00
|
|
|
|
2016-11-28 10:42:58 +00:00
|
|
|
/**
|
|
|
|
* Main function used to build the CyberChef web app.
|
|
|
|
*/
|
2017-04-13 17:31:26 +00:00
|
|
|
function main() {
|
2017-04-13 17:08:50 +00:00
|
|
|
const defaultFavourites = [
|
2016-11-28 10:42:58 +00:00
|
|
|
"To Base64",
|
|
|
|
"From Base64",
|
|
|
|
"To Hex",
|
|
|
|
"From Hex",
|
|
|
|
"To Hexdump",
|
|
|
|
"From Hexdump",
|
|
|
|
"URL Decode",
|
|
|
|
"Regular expression",
|
|
|
|
"Entropy",
|
|
|
|
"Fork"
|
|
|
|
];
|
2017-02-09 15:09:33 +00:00
|
|
|
|
2017-04-13 17:08:50 +00:00
|
|
|
const defaultOptions = {
|
2017-12-27 12:29:10 +00:00
|
|
|
updateUrl: true,
|
|
|
|
showHighlighter: true,
|
|
|
|
treatAsUtf8: true,
|
|
|
|
wordWrap: true,
|
|
|
|
showErrors: true,
|
|
|
|
errorTimeout: 4000,
|
|
|
|
attemptHighlight: true,
|
|
|
|
theme: "classic",
|
|
|
|
useMetaKey: false,
|
2017-12-28 18:17:38 +00:00
|
|
|
outputFileThreshold: 1024,
|
|
|
|
logLevel: "info"
|
2016-11-28 10:42:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
document.removeEventListener("DOMContentLoaded", main, false);
|
2017-03-23 17:52:20 +00:00
|
|
|
window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
|
2016-11-28 10:42:58 +00:00
|
|
|
window.app.setup();
|
2017-04-13 17:31:26 +00:00
|
|
|
}
|
2016-11-28 10:42:58 +00:00
|
|
|
|
2017-03-22 16:55:21 +00:00
|
|
|
window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
|
|
|
|
window.compileMessage = COMPILE_MSG;
|
2016-11-28 10:42:58 +00:00
|
|
|
|
2017-03-27 18:43:50 +00:00
|
|
|
// Make libs available to operation outputs
|
|
|
|
window.CanvasComponents = CanvasComponents;
|
|
|
|
|
2016-11-28 10:42:58 +00:00
|
|
|
document.addEventListener("DOMContentLoaded", main, false);
|