1
0
mirror of synced 2025-02-04 05:15:30 +01:00
CyberChef/src/web/index.js

71 lines
1.8 KiB
JavaScript
Raw Normal View History

2016-11-28 10:42:58 +00:00
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
// Styles
import "./stylesheets/index.js";
// Libs
import "babel-polyfill";
import "arrive";
import "snackbarjs";
import "bootstrap-material-design";
import "bootstrap-colorpicker";
import moment from "moment-timezone";
2018-05-16 11:39:30 +01:00
import * as CanvasComponents from "../core/lib/CanvasComponents";
// CyberChef
2018-05-15 17:36:45 +00:00
import App from "./App";
import Categories from "../core/config/Categories.json";
2018-03-26 23:14:23 +01:00
import OperationConfig from "../core/config/OperationConfig.json";
2016-11-28 10:42:58 +00:00
/**
* Main function used to build the CyberChef web app.
*/
2017-04-13 18:31:26 +01:00
function main() {
2017-04-13 18:08:50 +01: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",
"Magic"
2016-11-28 10:42:58 +00:00
];
2017-02-09 15:09:33 +00:00
2017-04-13 18:08:50 +01: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",
autoMagic: true,
2016-11-28 10:42:58 +00:00
};
document.removeEventListener("DOMContentLoaded", main, false);
window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
2016-11-28 10:42:58 +00:00
window.app.setup();
2017-04-13 18:31:26 +01:00
}
2016-11-28 10:42:58 +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
// Make libs available to operation outputs
window.CanvasComponents = CanvasComponents;
2016-11-28 10:42:58 +00:00
document.addEventListener("DOMContentLoaded", main, false);