index.js 1.7 KB

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