widgets.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  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. /*
  6. * Cell widgets
  7. */
  8. class Widgets {
  9. constructor() {
  10. console.log("widget constructor")
  11. }
  12. get divider(){
  13. return {
  14. $cell: true,
  15. $type: "hr",
  16. class: "mdc-list-divider"
  17. }
  18. }
  19. get emptyDiv(){
  20. return {
  21. $type: "div",
  22. style: "padding-bottom: 30px;"
  23. }
  24. }
  25. inputTextFieldOutlined(obj){
  26. function initFunc() {
  27. new mdc.textField.MDCTextField.attachTo(this);
  28. }
  29. let inputType = obj.type ? obj.type: 'text';
  30. let init = obj.init ? obj.init: initFunc;
  31. let style = obj.style ? obj.style: "";
  32. return {
  33. $cell: true,
  34. $type: "div",
  35. class: "mdc-text-field mdc-text-field--outlined mdc-text-field--dense",
  36. style: style,
  37. $init: init,
  38. $components:[
  39. {
  40. $type: "input",
  41. type: inputType,
  42. id: obj.id,
  43. class: "mdc-text-field__input",
  44. value: obj.value,
  45. onchange: obj.change
  46. },
  47. {
  48. $type: "div",
  49. class: "mdc-notched-outline",
  50. $components:[
  51. {
  52. $type: "div",
  53. class: "mdc-notched-outline__leading"
  54. },
  55. {
  56. $type: "div",
  57. class: "mdc-notched-outline__notch",
  58. $components:[
  59. {
  60. $type: "label",
  61. class: "mdc-floating-label",
  62. for: obj.id,
  63. $text: obj.label
  64. }
  65. ]
  66. },
  67. {
  68. $type: "div",
  69. class: "mdc-notched-outline__trailing"
  70. }
  71. ]
  72. }
  73. ]
  74. //onclick: obj.onclick
  75. }
  76. }
  77. inputTextFieldStandart(obj){
  78. var propValue = obj.value;
  79. if (_app.helpers.testJSON(obj.value)){
  80. propValue = JSON.parse(obj.value);
  81. } else {
  82. propValue = obj.value;
  83. }
  84. return {
  85. $cell: true,
  86. $type: "div",
  87. class: "mdc-text-field text-field mdc-ripple-upgraded",
  88. _mdc: null,
  89. $init: function(){
  90. //new mdc.mdc.notchedOutline.MDCNotchedOutline(document.querySelector('.mdc-notched-outline'));
  91. this._mdc = new mdc.textField.MDCTextField.attachTo(this);
  92. },
  93. $components:[
  94. {
  95. $type: "input",
  96. type: "text",
  97. id: obj.id,
  98. class: "mdc-text-field__input",
  99. value: propValue,
  100. onchange: obj.change
  101. },
  102. {
  103. $type: "label",
  104. class: "mdc-floating-label",
  105. for: obj.id,
  106. $text: obj.label
  107. },
  108. {
  109. $type: "div",
  110. class: "mdc-line-ripple"
  111. }
  112. ]
  113. //onclick: obj.onclick
  114. }
  115. }
  116. headerH3(headertype, label, cssclass) {
  117. return {
  118. $cell: true,
  119. $type: headertype,
  120. class: cssclass,
  121. $text: label
  122. }
  123. }
  124. simpleCard(obj){
  125. let style = 'background-image: url(' + obj.imgSrc + '); background-size: cover; background-repeat: no-repeat; height:' + obj.imgHeight + ';';
  126. var addonClass = obj.addonClass;
  127. if (!addonClass){
  128. addonClass = ''
  129. }
  130. return {
  131. $cell: true,
  132. $type: "div",
  133. $components:[
  134. {
  135. $cell: true,
  136. $type: "div",
  137. class: "mdc-card" +' '+ addonClass,
  138. onclick: obj.onclickfunc,
  139. $components:[
  140. {
  141. $cell: true,
  142. $type: "section",
  143. class: "mdc-card__media",
  144. style: style
  145. },
  146. {
  147. $cell: true,
  148. $type: "section",
  149. class: "mdc-card__supporting-text",
  150. $text: obj.text
  151. }
  152. ]
  153. }
  154. ]
  155. }
  156. }
  157. listDivider() {
  158. return {
  159. $cell: true,
  160. $type: "hr",
  161. class: "mdc-list-divider mdc-list-divider--inset"
  162. }
  163. }
  164. createListItem(obj) {
  165. return {
  166. $cell: true,
  167. $type: "li",
  168. class: "mdc-list-item",
  169. $components: [
  170. {
  171. $cell: true,
  172. $type: "span",
  173. class: "mdc-list-item__graphic",
  174. $components: [
  175. {
  176. $cell: true,
  177. class: "createItems",
  178. $type: "img",
  179. src: obj.imgSrc,
  180. onclick: obj.onclickfunc
  181. }
  182. ]
  183. },
  184. {
  185. $cell: true,
  186. $type: "span",
  187. class: "mdc-list-item__text",
  188. $text: obj.title
  189. // $components: [
  190. // {
  191. // $text: obj.title
  192. // },
  193. // {
  194. // $cell: true,
  195. // $type: "span",
  196. // class: "mdc-list-item__secondary-text",
  197. // $text: obj.subTitle
  198. // }
  199. // ]
  200. }
  201. ]
  202. }
  203. }
  204. createCard(obj){
  205. return {
  206. $cell: true,
  207. $type: "div",
  208. $components:[
  209. {
  210. $cell: true,
  211. $type: "div",
  212. class: "mdc-card",
  213. $components:[
  214. {
  215. $cell: true,
  216. $type: "div",
  217. class: "mdc-card__horizontal-block",
  218. $components:[
  219. {
  220. $cell: true,
  221. $type: "section",
  222. class: "mdc-card__primary",
  223. $components:[
  224. {
  225. $cell: true,
  226. $type: "h1",
  227. class: "mdc-card__title mdc-card__title--large",
  228. $text: obj.title
  229. },
  230. {
  231. $cell: true,
  232. $type: "h2",
  233. class: "mdc-card__subtitle",
  234. $text: obj.subTitle
  235. }
  236. ]
  237. },
  238. {
  239. $cell: true,
  240. $type: "img",
  241. class: "",
  242. src: obj.imgSrc
  243. }
  244. ]
  245. },
  246. {
  247. $cell: true,
  248. $type: "section",
  249. class: "mdc-card__actions",
  250. $components:[
  251. {
  252. $cell: true,
  253. $type: "button",
  254. class: "mdc-button mdc-button--compact mdc-card__action",
  255. $text: obj.actionLabel
  256. }
  257. ]
  258. }
  259. ]
  260. }
  261. ]
  262. }
  263. }
  264. buttonStroked(obj){
  265. return {
  266. $cell: true,
  267. $type: "button",
  268. class: "mdc-button mdc-button--outlined",
  269. $text: obj.label,
  270. onclick: obj.onclick
  271. }
  272. }
  273. buttonRaised(obj){
  274. return {
  275. $cell: true,
  276. $type: "button",
  277. class: "mdc-button mdc-button--raised mdc-ripple-upgraded",
  278. $text: obj.label,
  279. onclick: obj.onclick
  280. }
  281. }
  282. buttonSimple(obj){
  283. return {
  284. $cell: true,
  285. $type: "button",
  286. class: "mdc-button",
  287. $components: [
  288. {
  289. $type: "span",
  290. class: "mdc-button__label",
  291. $text: obj.label
  292. }
  293. ],
  294. onclick: obj.onclick
  295. }
  296. }
  297. sliderDiscrete(obj) {
  298. return {
  299. $cell: true,
  300. $type: "div",
  301. class: "mdc-slider mdc-slider--discrete",
  302. role: "slider",
  303. 'aria-valuemin': obj.min,
  304. 'aria-valuemax': obj.max,
  305. 'aria-label': obj.label,
  306. $init: obj.init,
  307. $components: [
  308. {
  309. $cell: true,
  310. $type: "div",
  311. class: "mdc-slider__track-container",
  312. $components: [
  313. {
  314. $cell: true,
  315. $type: "div",
  316. class: "mdc-slider__track",
  317. }
  318. ]
  319. },
  320. {
  321. $cell: true,
  322. $type: "div",
  323. class: "mdc-slider__thumb-container",
  324. $components: [
  325. {
  326. $cell: true,
  327. $type: "div",
  328. class: "mdc-slider__pin",
  329. $components: [
  330. {
  331. $cell: true,
  332. $type: "span",
  333. class: "mdc-slider__pin-value-marker",
  334. }
  335. ]
  336. },
  337. {
  338. $cell: true,
  339. $type: "svg",
  340. class: "mdc-slider__thumb",
  341. width: 21,
  342. height: 21,
  343. $components: [
  344. {
  345. $cell: true,
  346. $type: "circle",
  347. cx: 10.5,
  348. cy: 10.5,
  349. r: 7.875
  350. }
  351. ]
  352. },
  353. {
  354. $cell: true,
  355. $type: "div",
  356. class: "mdc-slider__focus-ring"
  357. }
  358. ]
  359. }
  360. ]
  361. }
  362. }
  363. sliderContinuous(obj) {
  364. return {
  365. $cell: true,
  366. $type: "div",
  367. class: "mdc-slider",
  368. role: "slider",
  369. tabindex: 0,
  370. 'id': obj.id,
  371. 'aria-valuemin': obj.min,
  372. 'aria-valuemax': obj.max,
  373. 'aria-label': obj.label,
  374. 'aria-valuenow': obj.value,
  375. 'data-step': obj.step,
  376. $init: obj.init,
  377. $components: [
  378. {
  379. $cell: true,
  380. $type: "div",
  381. class: "mdc-slider__track-container",
  382. $components: [
  383. {
  384. $cell: true,
  385. $type: "div",
  386. class: "mdc-slider__track",
  387. }
  388. ]
  389. },
  390. {
  391. $cell: true,
  392. $type: "div",
  393. class: "mdc-slider__thumb-container",
  394. $components: [
  395. {
  396. $cell: true,
  397. $type: "svg",
  398. class: "mdc-slider__thumb",
  399. width: 21,
  400. height: 21,
  401. $components: [
  402. {
  403. $cell: true,
  404. $type: "circle",
  405. cx: 10.5,
  406. cy: 10.5,
  407. r: 7.875
  408. }
  409. ]
  410. },
  411. {
  412. $cell: true,
  413. $type: "div",
  414. class: "mdc-slider__focus-ring"
  415. }
  416. ]
  417. }
  418. ]
  419. }
  420. }
  421. textField(obj) {
  422. return {
  423. class: "mdc-text-field",
  424. style: "width: 100%",
  425. $cell: true,
  426. $type: "div",
  427. $components: [
  428. {
  429. class: "mdc-text-field__input prop-text-field-input",
  430. id: obj.id,
  431. $cell: true,
  432. $type: "input",
  433. type: "text",
  434. value: obj.value,
  435. onchange: obj.funconchange
  436. }
  437. ]
  438. }
  439. }
  440. icontoggle(obj) {
  441. var addClass = "";
  442. if (obj.styleClass){
  443. addClass = obj.styleClass;
  444. }
  445. return {
  446. $type: "button",
  447. class: addClass + " mdc-icon-button",
  448. //$text: obj.label,
  449. id: obj.id,
  450. //'data-toggle-on': obj.on,
  451. // 'data-toggle-off': obj.off,
  452. 'aria-pressed': obj.state,
  453. 'aria-hidden': true,
  454. $init: obj.init,
  455. $components:[
  456. {
  457. $type: "i",
  458. class: "material-icons mdc-icon-button__icon mdc-icon-button__icon--on",
  459. $text: JSON.parse(obj.on).content
  460. },
  461. {
  462. $type: "i",
  463. class: "material-icons mdc-icon-button__icon",
  464. $text: JSON.parse(obj.off).content
  465. },
  466. ]
  467. }
  468. }
  469. floatActionButton(obj) {
  470. var addClass = "";
  471. if (obj.styleClass){
  472. addClass = obj.styleClass;
  473. }
  474. return {
  475. $cell: true,
  476. $type: "button",
  477. class: "mdc-fab material-icons " + addClass,
  478. onclick: obj.onclickfunc,
  479. $components:[
  480. {
  481. $cell: true,
  482. $type: "span",
  483. class: "mdc-fab__icon",
  484. $text: obj.label
  485. }
  486. ]
  487. }
  488. }
  489. iconButton(obj) {
  490. var addClass = "";
  491. if (obj.styleClass){
  492. addClass = obj.styleClass;
  493. }
  494. return {
  495. $cell: true,
  496. $type: "button",
  497. class: "mdc-button " + addClass,
  498. onclick: obj.onclick,
  499. $components:[
  500. {
  501. $cell: true,
  502. $type: "i",
  503. class: "material-icons mdc-button__icon",
  504. $text: obj.label
  505. }
  506. ]
  507. }
  508. }
  509. imageButton(obj){
  510. return {
  511. $cell: true,
  512. $type: "button",
  513. class: "mdc-button mdc-button--compact",
  514. onclick: obj.onclickfunc,
  515. $components:[
  516. {
  517. $cell: true,
  518. class: obj.styleClass,
  519. $type: "img",
  520. src: obj.imgSrc
  521. }
  522. ]
  523. }
  524. }
  525. gridListItem(obj) {
  526. return {
  527. $cell: true,
  528. $type: "li",
  529. class: "mdc-grid-tile " + obj.styleClass,
  530. $components:[
  531. {
  532. $cell: true,
  533. class: "mdc-grid-tile__primary",
  534. $type: "div",
  535. style: "background-color: transparent;",
  536. $components:[
  537. {
  538. $cell: true,
  539. class: "mdc-grid-tile__primary-content tooltip",
  540. $type: "div",
  541. 'aria-label': obj.title,
  542. alt: obj.title,
  543. style: "background-image: url("+ obj.imgSrc + ");",
  544. onclick: obj.onclickfunc,
  545. $components:[
  546. {
  547. $cell: true,
  548. class: "tooltiptext",
  549. $type: "span",
  550. $text: obj.title
  551. }
  552. ]
  553. }
  554. ]
  555. }
  556. ]
  557. }
  558. }
  559. switch(obj) {
  560. return {
  561. $cell: true,
  562. $type: "div",
  563. class: "mdc-switch",
  564. _switch: null,
  565. id: obj.id,
  566. $init: obj.init,
  567. //function(){
  568. // new mdc.switchControl.MDCSwitch(this);
  569. // },
  570. $components: [
  571. {
  572. $type: "div",
  573. class: "mdc-switch__track",
  574. },
  575. {
  576. $type: "div",
  577. class: "mdc-switch__thumb-underlay",
  578. $components:[
  579. {
  580. $type: "div",
  581. class: "mdc-switch__thumb",
  582. $components:[
  583. {
  584. $type: "input",
  585. type: "checkbox",
  586. class: "mdc-switch__native-control",
  587. id: 'input-' + obj.id,
  588. //$init: obj.init,
  589. //id: "basic-switch",
  590. onchange: obj.onchange,
  591. role: "switch"
  592. }
  593. ]
  594. }
  595. ]
  596. }
  597. // {
  598. // $type: "div",
  599. // class: "mdc-switch__background",
  600. // $components: [
  601. // {
  602. // $type: "div",
  603. // class: "mdc-switch__knob"
  604. // }
  605. // ]
  606. // }
  607. ]
  608. }
  609. }
  610. reflectorGUI() {
  611. let luminaryGlobalHB = {
  612. $cell: true,
  613. _luminarySwitch: null,
  614. $components: [
  615. {
  616. $type: "p",
  617. class: "mdc-typography--headline5",
  618. $text: "Use Global Heartbeat"
  619. },
  620. {
  621. $type: 'p'
  622. },
  623. _app.widgets.switch({
  624. 'id': 'forceLuminary',
  625. 'init': function () {
  626. this._switch = new mdc.switchControl.MDCSwitch(this);
  627. let config = localStorage.getItem('lcs_config');
  628. this._switch.checked = JSON.parse(config).luminaryGlobalHB;
  629. // this._replaceSwitch = this._switch;
  630. },
  631. 'onchange': function (e) {
  632. if (this._switch) {
  633. let chkAttr = this._switch.checked;//this.getAttribute('checked');
  634. if (chkAttr) {
  635. let config = JSON.parse(localStorage.getItem('lcs_config'));
  636. config.luminaryGlobalHB = true;
  637. localStorage.setItem('lcs_config', JSON.stringify(config));
  638. //this._switch.checked = false;
  639. } else {
  640. let config = JSON.parse(localStorage.getItem('lcs_config'));
  641. config.luminaryGlobalHB = false;
  642. localStorage.setItem('lcs_config', JSON.stringify(config));
  643. }
  644. }
  645. }
  646. }
  647. ),
  648. {
  649. $type: 'label',
  650. for: 'input-forceLuminary',
  651. $text: 'On / Off'
  652. }
  653. ]
  654. }
  655. let reflectorGUI =
  656. {
  657. $type: "div",
  658. id: "reflectorGUI",
  659. //style:"background-color: #efefef",
  660. class: "mdc-layout-grid mdc-layout-grid--align-left",
  661. _reflectorHost: null,
  662. _dbHost: null,
  663. _refHostField: null,
  664. _dbHostField: null,
  665. _lpath: null,
  666. _lpathField: null,
  667. _hbpath: null,
  668. _hbpathField: null,
  669. _initData: function () {
  670. this._reflectorHost = '';
  671. this._dbHost = '';
  672. let config = JSON.parse(localStorage.getItem('lcs_config'));
  673. if (config.reflector) {
  674. this._reflectorHost = config.reflector
  675. }
  676. if (config.dbhost) {
  677. this._dbHost =config.dbhost
  678. }
  679. if (config.luminaryPath) {
  680. this._lpath = config.luminaryPath
  681. }
  682. if (config.luminaryGlobalHBPath) {
  683. this._hbpath = config.luminaryGlobalHBPath
  684. }
  685. },
  686. $init: function () {
  687. this._initData();
  688. },
  689. $update: function () {
  690. this.$components = [
  691. {
  692. $type: "div",
  693. class: "mdc-layout-grid__inner",
  694. $components: [
  695. {
  696. $type: "div",
  697. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  698. $components: [
  699. {
  700. $type: "h4",
  701. class: "mdc-typography--headline4",
  702. $text: "Gun DB settings"
  703. }
  704. ]
  705. },
  706. {
  707. $type: "div",
  708. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  709. $components: [
  710. {
  711. $type: "span",
  712. class: "mdc-typography--headline5",
  713. $text: "DB Host: "
  714. },
  715. window._app.widgets.inputTextFieldOutlined({
  716. "id": 'dbhostInput',
  717. "label": "DB Host",
  718. "value": this._dbHost,
  719. "type": "text",
  720. "init": function() {
  721. this._dbHostField = new mdc.textField.MDCTextField(this);
  722. },
  723. "style": 'width: 400px;'
  724. }),
  725. ]
  726. },
  727. {
  728. $type: "div",
  729. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  730. $components: [
  731. {
  732. $type: "h4",
  733. class: "mdc-typography--headline4",
  734. $text: "Reflector settings"
  735. }
  736. ]
  737. },
  738. {
  739. $type: "div",
  740. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  741. $components: [
  742. {
  743. $type: "span",
  744. class: "mdc-typography--headline5",
  745. $text: "Reflector: "
  746. },
  747. window._app.widgets.inputTextFieldOutlined({
  748. "id": 'reflectorInput',
  749. "label": "Reflector",
  750. "value": this._reflectorHost,
  751. "type": "text",
  752. "init": function() {
  753. this._refHostField = new mdc.textField.MDCTextField(this);
  754. },
  755. "style": 'width: 400px;'
  756. }),
  757. ]
  758. },
  759. {
  760. $type: "div",
  761. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  762. $components: [
  763. {
  764. $type: "h4",
  765. class: "mdc-typography--headline4",
  766. $text: "Krestianstvo Luminary settings (experimental)"
  767. }
  768. ]
  769. },
  770. {
  771. $type: "div",
  772. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  773. $components: [
  774. {
  775. $type: "span",
  776. class: "mdc-typography--headline5",
  777. $text: "Luminary Path: "
  778. },
  779. window._app.widgets.inputTextFieldOutlined({
  780. "id": 'lpathInput',
  781. "label": "Luminary Path",
  782. "value": this._lpath,
  783. "type": "text",
  784. "init": function() {
  785. this._lpathField = new mdc.textField.MDCTextField(this);
  786. },
  787. "style": 'width: 400px;'
  788. }),
  789. ]
  790. },
  791. {
  792. $type: "div",
  793. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  794. $components: [
  795. {
  796. $type: "span",
  797. class: "mdc-typography--headline5",
  798. $text: "Global Heartbeat Path: "
  799. },
  800. window._app.widgets.inputTextFieldOutlined({
  801. "id": 'hbpathInput',
  802. "label": "Global Heartbeat Path",
  803. "value": this._hbpath,
  804. "type": "text",
  805. "init": function() {
  806. this._hbpathField = new mdc.textField.MDCTextField(this);
  807. },
  808. "style": 'width: 400px;'
  809. }),
  810. ]
  811. },
  812. {
  813. $type: "div",
  814. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  815. $components: [luminaryGlobalHB ]
  816. },
  817. {
  818. $type: "div",
  819. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  820. $components: [
  821. window._app.widgets.buttonRaised(
  822. {
  823. "label": 'Update',
  824. "onclick": function (e) {
  825. e.preventDefault();
  826. let config = JSON.parse(localStorage.getItem('lcs_config'));
  827. config.reflector = this._refHostField.value;
  828. config.dbhost = this._dbHostField.value;
  829. config.luminaryPath = this._lpathField.value;
  830. config.luminaryGlobalHBPath = this._hbpathField.value;
  831. localStorage.setItem('lcs_config', JSON.stringify(config));
  832. window.location.reload(true);
  833. }
  834. }),
  835. {
  836. $type: 'span',
  837. $text: " "
  838. },
  839. {
  840. $type: "button",
  841. class: "mdc-button mdc-button--raised",
  842. $text: "Close",
  843. onclick: function (e) {
  844. window.location.pathname = '/'
  845. }
  846. }
  847. ]
  848. }
  849. ]
  850. }
  851. ]
  852. }
  853. }
  854. document.querySelector("#appGUI").$cell({
  855. id: "appGUI",
  856. $cell: true,
  857. $type: "div",
  858. $components: [reflectorGUI]
  859. }
  860. );
  861. }
  862. }
  863. export { Widgets }