header.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. The MIT License (MIT)
  3. Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contributors. (https://github.com/NikolaySuslov/livecodingspace/blob/master/LICENSE.md)
  4. */
  5. import page from '/lib/page.mjs';
  6. class Header {
  7. constructor() {
  8. console.log("app constructor");
  9. this.language = _LangManager.language;
  10. }
  11. init(){
  12. let el = document.createElement("div");
  13. el.setAttribute("id", "header");
  14. document.body.appendChild(el);
  15. let headerGUI = {
  16. $type: "a",
  17. class: "mdc-button mdc-button--compact mdc-card__action",
  18. $text: "Back",
  19. //href: "/" + desc[2] + '/worlds/' + desc[0] + '/edit', ///:user/worlds/:name/edit
  20. onclick: function (e) {
  21. window.history.back();
  22. }
  23. }
  24. document.querySelector("#header").$cell({
  25. id: 'header',
  26. $cell: true,
  27. $type: "div",
  28. $components: [
  29. //headerGUI
  30. ]
  31. })
  32. }
  33. }
  34. export { Header }