CyberChef/src/web/index.js

66 lines
1.7 KiB
JavaScript
Raw Normal View History

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