index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "arrive";
  11. import "snackbarjs";
  12. import "bootstrap-material-design";
  13. import "bootstrap-colorpicker";
  14. import moment from "moment-timezone";
  15. import * as CanvasComponents from "../core/lib/CanvasComponents";
  16. // CyberChef
  17. import App from "./App";
  18. import Categories from "../core/config/Categories.json";
  19. import OperationConfig from "../core/config/OperationConfig.json";
  20. /**
  21. * Main function used to build the CyberChef web app.
  22. */
  23. function main() {
  24. const defaultFavourites = [
  25. "To Base64",
  26. "From Base64",
  27. "To Hex",
  28. "From Hex",
  29. "To Hexdump",
  30. "From Hexdump",
  31. "URL Decode",
  32. "Regular expression",
  33. "Entropy",
  34. "Fork",
  35. "Magic"
  36. ];
  37. const defaultOptions = {
  38. updateUrl: true,
  39. showHighlighter: true,
  40. treatAsUtf8: true,
  41. wordWrap: true,
  42. showErrors: true,
  43. errorTimeout: 4000,
  44. attemptHighlight: true,
  45. theme: "classic",
  46. useMetaKey: false,
  47. ioDisplayThreshold: 512,
  48. logLevel: "info",
  49. autoMagic: true,
  50. };
  51. document.removeEventListener("DOMContentLoaded", main, false);
  52. window.app = new App(Categories, OperationConfig, defaultFavourites, defaultOptions);
  53. window.app.setup();
  54. }
  55. window.compileTime = moment.tz(COMPILE_TIME, "DD/MM/YYYY HH:mm:ss z", "UTC").valueOf();
  56. window.compileMessage = COMPILE_MSG;
  57. // Make libs available to operation outputs
  58. window.CanvasComponents = CanvasComponents;
  59. document.addEventListener("DOMContentLoaded", main, false);