index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * @author n1474335 [n1474335@gmail.com]
  3. * @copyright Crown Copyright 2016
  4. * @license Apache-2.0
  5. */
  6. // Styles
  7. import "./stylesheets/index.js";
  8. // Libs
  9. import "babel-polyfill";
  10. import "bootstrap";
  11. import "bootstrap-switch";
  12. import "bootstrap-colorpicker";
  13. import moment from "moment-timezone";
  14. import CanvasComponents from "../core/vendor/canvascomponents.js";
  15. // CyberChef
  16. import App from "./App";
  17. import Categories from "../core/config/Categories.json";
  18. import OperationConfig from "../core/config/OperationConfig.json";
  19. /**
  20. * Main function used to build the CyberChef web app.
  21. */
  22. function main() {
  23. const defaultFavourites = [
  24. "To Base64",
  25. "From Base64",
  26. "To Hex",
  27. "From Hex",
  28. "To Hexdump",
  29. "From Hexdump",
  30. "URL Decode",
  31. "Regular expression",
  32. "Entropy",
  33. "Fork"
  34. ];
  35. const defaultOptions = {
  36. updateUrl: true,
  37. showHighlighter: true,
  38. treatAsUtf8: true,
  39. wordWrap: true,
  40. showErrors: true,
  41. errorTimeout: 4000,
  42. attemptHighlight: true,
  43. theme: "classic",
  44. useMetaKey: false,
  45. ioDisplayThreshold: 512,
  46. logLevel: "info"
  47. };
  48. document.removeEventListener("DOMContentLoaded", main, false);
  49. window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
  50. window.app.setup();
  51. }
  52. window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
  53. window.compileMessage = COMPILE_MSG;
  54. // Make libs available to operation outputs
  55. window.CanvasComponents = CanvasComponents;
  56. document.addEventListener("DOMContentLoaded", main, false);