2016-11-28 10:42:58 +00:00
|
|
|
/**
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2016
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2017-03-23 18:41:36 +00:00
|
|
|
// CSS
|
|
|
|
import "./css/index.js";
|
|
|
|
|
|
|
|
// Libs
|
|
|
|
import "babel-polyfill";
|
|
|
|
import "bootstrap";
|
|
|
|
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";
|
|
|
|
import OperationConfig from "../core/config/OperationConfig.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.
|
|
|
|
*/
|
|
|
|
var main = function() {
|
2017-01-31 18:24:56 +00:00
|
|
|
var 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-01-31 18:24:56 +00:00
|
|
|
var defaultOptions = {
|
|
|
|
updateUrl : true,
|
|
|
|
showHighlighter : true,
|
|
|
|
treatAsUtf8 : true,
|
|
|
|
wordWrap : true,
|
|
|
|
showErrors : true,
|
|
|
|
errorTimeout : 4000,
|
|
|
|
autoBakeThreshold : 200,
|
|
|
|
attemptHighlight : true,
|
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();
|
|
|
|
};
|
|
|
|
|
|
|
|
// Fix issues with browsers that don't support console.log()
|
|
|
|
window.console = console || {log: function() {}, error: function() {}};
|
|
|
|
|
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);
|