help.plugin.js 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const PLUGIN_NAME = "Help / About";
  2. /**
  3. * @type {{plugin: Function, plugin:name: string, markup: string}}
  4. */
  5. module.exports = {
  6. /**
  7. * Plugin init
  8. */
  9. "plugin": function () {},
  10. /**
  11. * Hooks
  12. */
  13. "hooks": {
  14. "markup": fileContent("/../../../static/content/help.content.html"),
  15. "client:js": fileContent("/help.client.js"),
  16. "templates": [
  17. getPath("/help.directive.html")
  18. ],
  19. "page": {
  20. path: "/help",
  21. title: PLUGIN_NAME,
  22. template: "help.html",
  23. controller: "HelpAboutController",
  24. order: 6,
  25. icon: "help"
  26. }
  27. },
  28. /**
  29. * Plugin name
  30. */
  31. "plugin:name": PLUGIN_NAME
  32. };
  33. /**
  34. * @param filepath
  35. * @returns {*}
  36. */
  37. function getPath (filepath) {
  38. return require("path").join(__dirname, filepath);
  39. }
  40. /**
  41. * @param filepath
  42. * @returns {*}
  43. */
  44. function fileContent (filepath) {
  45. return require("fs").readFileSync(getPath(filepath), "utf-8");
  46. }