index-app.js 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611
  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. import { Header } from '/web/header.js';
  7. class IndexApp {
  8. constructor(entry) {
  9. console.log("index app constructor");
  10. this.entry = entry;
  11. this.worlds = {};
  12. this.instances = {};
  13. if (!_app.isLuminary) {
  14. this.initReflectorConnection();
  15. }
  16. this.initHTML();
  17. }
  18. initReflectorConnection() {
  19. this.options = {
  20. query: 'pathname=' + window.location.pathname.slice(1,
  21. window.location.pathname.lastIndexOf("/")),
  22. secure: window.location.protocol === "https:",
  23. reconnection: false,
  24. path: '',
  25. transports: ['websocket']
  26. }
  27. //window.location.host
  28. var socket = io.connect(window._app.reflectorHost, this.options);
  29. const parse = (msg) => {
  30. this.parseOnlineData(msg)
  31. }
  32. socket.on('getWebAppUpdate', msg => parse.call(this, msg));
  33. socket.on("connect", function () {
  34. let noty = new Noty({
  35. text: 'Connected to Reflector!',
  36. timeout: 2000,
  37. theme: 'mint',
  38. layout: 'bottomRight',
  39. type: 'success'
  40. });
  41. noty.show();
  42. })
  43. socket.on('connect_error', function (err) {
  44. console.log(err);
  45. var errDiv = document.createElement("div");
  46. errDiv.innerHTML = "<div class='vwf-err' style='z-index: 10; position: absolute; top: 80px; right: 50px'>Connection error to Reflector!" + err + "</div>";
  47. document.querySelector('body').appendChild(errDiv);
  48. let noty = new Noty({
  49. text: 'Connection error to Reflector! ' + err,
  50. theme: 'mint',
  51. layout: 'bottomRight',
  52. type: 'error'
  53. });
  54. noty.show();
  55. });
  56. }
  57. initHTML() {
  58. let self = this;
  59. //first init from _app
  60. document.querySelector('head').innerHTML += '<link rel="stylesheet" href="/web/index-app.css">';
  61. let headerGUI = new Header();
  62. headerGUI.init();
  63. //add HTML
  64. let entry = document.createElement("div");
  65. entry.setAttribute("id", 'app');
  66. document.body.appendChild(entry);
  67. let divs = ['appGUI', 'userLobby', 'main', 'worldsGUI', 'lab'];
  68. divs.forEach(el => {
  69. let appEl = document.createElement("div");
  70. appEl.setAttribute("id", el);
  71. entry.appendChild(appEl);
  72. })
  73. document.querySelector("#worldsGUI").$cell({
  74. id: "worldsGUI",
  75. $cell: true,
  76. $type: "div",
  77. _comps: [],
  78. _wcards: {},
  79. $components: [],
  80. _refresh: function (comps) {
  81. //do update;
  82. //this._userAlias = user;
  83. this._comps = comps;
  84. this.$components = this._comps;
  85. },
  86. $init: function () {
  87. console.log('init comp...');
  88. },
  89. $update: function () {
  90. //do update;
  91. console.log('update me');
  92. }
  93. });
  94. //init CELL
  95. let userGUI = {
  96. $type: "div",
  97. id: "userGUI",
  98. // style:"background-color: #ffeb3b",
  99. class: "mdc-layout-grid mdc-layout-grid--align-left",
  100. _status: "Welcome!",
  101. $init: function () {
  102. //this._status = "Welcome!"
  103. //this._status = 'Welcome!';
  104. //userEl.style.backgroundColor = '#e6e6e6';
  105. self.initUser();
  106. this._refresh(); //$update();
  107. },
  108. $update: function () {},
  109. _refresh: function () {
  110. var gui = {};
  111. if (_LCSDB.user().is) {
  112. gui = [
  113. window._app.widgets.buttonRaised(
  114. {
  115. "label": 'Sign OUT',
  116. "onclick": function (e) {
  117. _LCSDB.user().leave();
  118. setTimeout(() => {
  119. //window.sessionStorage.removeItem('alias');
  120. //window.sessionStorage.removeItem('tmp');
  121. window.location.reload(true);
  122. }, 1);
  123. }
  124. }),
  125. {
  126. $type: "p"
  127. },
  128. window._app.widgets.buttonStroked(
  129. {
  130. "label": 'PROFILE',
  131. "onclick": function (e) {
  132. e.preventDefault();
  133. //page("/profile")
  134. window.location.pathname = "/profile"
  135. }
  136. }),
  137. {
  138. $type: "p"
  139. },
  140. window._app.widgets.buttonStroked(
  141. {
  142. "label": 'My World protos',
  143. "onclick": function (e) {
  144. e.preventDefault();
  145. let alias = _LCSDB.user().is.alias;
  146. window.location.pathname = '/' + alias + '/worlds/protos'
  147. //page('/' + alias + '/worlds/protos');
  148. //_app.indexApp.getWorldsProtosFromUserDB(alias);
  149. }
  150. }),
  151. window._app.widgets.buttonStroked(
  152. {
  153. "label": 'My World states',
  154. "onclick": function (e) {
  155. e.preventDefault();
  156. let alias = _LCSDB.user().is.alias;
  157. window.location.pathname = '/' + alias + '/worlds/states'
  158. //page('/' + alias + '/worlds/states');
  159. // page.redirect('/' + alias + '/worlds/states');
  160. //_app.indexApp.getWorldsFromUserDB(alias);
  161. }
  162. })
  163. ]
  164. }
  165. this.$components = [
  166. {
  167. $type: "h1",
  168. class: "mdc-typography--headline3",
  169. $text: this._status
  170. }
  171. ].concat(gui)
  172. }
  173. }
  174. document.querySelector("#userLobby").$cell({
  175. id: "userLobby",
  176. $cell: true,
  177. $type: "div",
  178. $components: [],
  179. _comps: [],
  180. _refresh: function(){
  181. this.$components = this._comps.concat([userGUI, self.getLoginGUI(), _app.widgets.divider, self.getLookWorlds()]);
  182. },
  183. $init: function () {
  184. this._comps = self.initUserGUI()
  185. this._refresh();
  186. },
  187. $update: function () {
  188. }
  189. });
  190. }
  191. async allWorldsProtosForUser(userAlias) {
  192. let userPub = await _app.helpers.getUserPub(userAlias);
  193. //let db = _LCSDB.user(userPub);
  194. let doc = document.querySelector("#worldsGUI");
  195. var worlds = {};
  196. if(userPub) {
  197. worlds = this.createWorldsGUI('proto', userAlias, userPub)
  198. } else {
  199. worlds = {
  200. $type: 'div',
  201. $text: 'Could not find user with name: ' + userAlias,
  202. class: "mdc-typography--headline4"
  203. }
  204. }
  205. let components = [
  206. {
  207. $type: "div",
  208. class: "mdc-layout-grid",
  209. $components: [
  210. {
  211. $type: "div",
  212. class: "mdc-layout-grid__inner",
  213. $components: [
  214. {
  215. $type: "div",
  216. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  217. $components: [
  218. {
  219. $type: "h1",
  220. class: "mdc-typography--headline4",
  221. $text: 'Worlds for user: ' + userAlias
  222. }
  223. ]
  224. },
  225. {
  226. $type: "div",
  227. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  228. $components: [worlds]
  229. }
  230. ]
  231. }
  232. ]
  233. }
  234. ];
  235. doc._refresh(components);
  236. }
  237. async allWorldsStatesForUser(userAlias) {
  238. let userPub = await _app.helpers.getUserPub(userAlias);
  239. //let db = _LCSDB.user(userPub);
  240. let doc = document.querySelector("#worldsGUI");
  241. var worlds = {};
  242. if(userPub) {
  243. worlds = this.createWorldsGUI('state', userAlias, userPub, 'allStates')
  244. } else {
  245. worlds = {
  246. $type: 'div',
  247. $text: 'Could not find user with name: ' + userAlias,
  248. class: "mdc-typography--headline4"
  249. }
  250. }
  251. let components = [
  252. {
  253. $type: "div",
  254. class: "mdc-layout-grid",
  255. $components: [
  256. {
  257. $type: "div",
  258. class: "mdc-layout-grid__inner",
  259. $components: [
  260. {
  261. $type: "div",
  262. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  263. $components: [
  264. {
  265. $type: "h1",
  266. class: "mdc-typography--headline4",
  267. $text: 'States for ' + userAlias
  268. }
  269. ]
  270. },
  271. {
  272. $type: "div",
  273. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  274. $components: [].concat(worlds)
  275. }
  276. ]
  277. }
  278. ]
  279. }
  280. ]
  281. doc._refresh(components);
  282. }
  283. authGUI(){
  284. let alias = _LCSDB.user().is.alias;
  285. let userEl = document.querySelector('#userGUI');
  286. userEl._status = 'Welcome ' + alias + '!';
  287. //userEl.style.backgroundColor = '#e6e6e6';
  288. userEl._refresh(); //$update();
  289. //_LCSDB.user().get('profile').once(function (data) { console.log(data) })
  290. let el = document.getElementById("loginGUI");
  291. if (el) {
  292. el.remove();
  293. }
  294. _LCSDB.user().get('profile').not(function (key) {
  295. let profile = { 'alias': alias };
  296. _LCSDB.user().get('profile').put(profile);
  297. })
  298. // not load proxy by default
  299. // _LCSDB.user().get('proxy').not(res=>{
  300. // console.log('user has no proxy');
  301. // window._app.loadProxyDefaults();
  302. // });
  303. let actionsGUI = document.querySelector('#worldActionsGUI');
  304. if (actionsGUI)
  305. actionsGUI._refresh();
  306. new Noty({
  307. text: alias + ' is succesfully authenticated!',
  308. timeout: 2000,
  309. theme: 'mint',
  310. layout: 'bottomRight',
  311. type: 'success'
  312. }).show();
  313. if(this.entry == 'index'){
  314. //change for LiveCoding.space to 'app'
  315. //this.initWorldsProtosListForUserNew(alias);
  316. this.allWorldsProtosForUser(alias)
  317. }
  318. }
  319. initUser() {
  320. let self = this;
  321. if(_LCSDB.user().is) {
  322. self.authGUI()
  323. } else {
  324. _LCSDB.on('auth', function (ack) {
  325. if (ack.sea.pub) {
  326. self.authGUI();
  327. }
  328. console.log(_LCSDB.user().is);
  329. });
  330. }
  331. }
  332. getLookWorlds(){
  333. let self = this;
  334. let lookWorlds =
  335. {
  336. $type: "div",
  337. id: "lookWorlds",
  338. class: "mdc-layout-grid mdc-layout-grid--align-left",
  339. _status: '',
  340. $init: function () {
  341. this._status = "init";
  342. },
  343. $update: function () {
  344. //change for LiveCoding.space site 'app'
  345. let defaultName = '';
  346. let guiForAll = [
  347. {
  348. $type: "div",
  349. style: "margin-top: 20px;",
  350. _userName: null,
  351. _userNameField: null,
  352. $components:
  353. [
  354. _app.widgets.inputTextFieldOutlined({
  355. "id": 'worldsUserName',
  356. "label": 'Enter user name',
  357. "value": defaultName,
  358. "type": "text",
  359. "init": function () {
  360. this._userNameField = new mdc.textField.MDCTextField(this);
  361. }
  362. }),
  363. _app.widgets.p,
  364. // {
  365. // $type: "a",
  366. // class: "mdc-button mdc-button--raised mdc-card__action actionButton",
  367. // $text: 'World Protos', //self.language.t('set proxy'),//"clone",
  368. // onclick: function (e) {
  369. // //console.log('clone');
  370. // let searchName = this._userNameField.value;
  371. // self.initWorldsProtosListForUser(searchName);
  372. // }
  373. // },
  374. // {
  375. // $type: "a",
  376. // class: "mdc-button mdc-button--raised mdc-card__action actionButton",
  377. // $text: 'World States', //self.language.t('set proxy'),//"clone",
  378. // onclick: function (e) {
  379. // //console.log('clone');
  380. // let searchName = this._userNameField.value;
  381. // self.initWorldsStatesListForUser(searchName);
  382. // }
  383. // }
  384. _app.widgets.buttonRaised(
  385. {
  386. "label": 'World Protos',
  387. "onclick": function (e) {
  388. e.preventDefault();
  389. //page("/app/worlds/protos")
  390. let searchName = this._userNameField.value;
  391. if(searchName !== "")
  392. window.location.pathname = "/"+searchName+"/worlds/protos"
  393. //_app.indexApp.getAppDetailsFromDefaultDB('protos');
  394. }
  395. }),
  396. _app.widgets.space,
  397. _app.widgets.buttonRaised(
  398. {
  399. "label": 'World States',
  400. "onclick": function (e) {
  401. e.preventDefault();
  402. //page("/app/worlds/states")
  403. let searchName = this._userNameField.value;
  404. if(searchName !== "")
  405. window.location.pathname = "/"+searchName+"/worlds/states"
  406. //_app.indexApp.getAppDetailsFromDefaultDB('states');
  407. }
  408. })
  409. ]
  410. },
  411. // window._app.widgets.buttonStroked(
  412. // {
  413. // "label": 'Default World Protos',
  414. // "onclick": function (e) {
  415. // e.preventDefault();
  416. // //page("/app/worlds/protos")
  417. // window.location.pathname = "/app/worlds/protos"
  418. // //_app.indexApp.getAppDetailsFromDefaultDB('protos');
  419. // }
  420. // }),
  421. // window._app.widgets.buttonStroked(
  422. // {
  423. // "label": 'Default World States',
  424. // "onclick": function (e) {
  425. // e.preventDefault();
  426. // //page("/app/worlds/states")
  427. // window.location.pathname = "/app/worlds/states"
  428. // //_app.indexApp.getAppDetailsFromDefaultDB('states');
  429. // }
  430. // })
  431. ];
  432. this.$components = [
  433. {
  434. $type: "h1",
  435. class: "mdc-typography--headline4",
  436. $text: "Looking for Worlds made by other Users!"
  437. }
  438. ].concat(guiForAll, _app.widgets.p, _app.widgets.divider)
  439. }
  440. }
  441. return lookWorlds
  442. }
  443. getLoginGUI(){
  444. let self = this;
  445. let loginGUI =
  446. {
  447. $type: "div",
  448. id: "loginGUI",
  449. //style:"background-color: #efefef",
  450. class: "mdc-layout-grid mdc-layout-grid--align-left",
  451. _alias: null,
  452. _pass: null,
  453. _passField: null,
  454. _aliasField: null,
  455. _initData: function () {
  456. this._alias = '';
  457. this._pass = '';
  458. // if (window.sessionStorage.getItem('alias')) {
  459. // this._alias = window.sessionStorage.getItem('alias')
  460. // }
  461. // if (window.sessionStorage.getItem('tmp')) {
  462. // this._pass = window.sessionStorage.getItem('tmp')
  463. // }
  464. },
  465. $init: function () {
  466. this._initData();
  467. },
  468. $update: function () {
  469. this.$components = [
  470. {
  471. $type: "div",
  472. class: "mdc-layout-grid__inner",
  473. $components: [
  474. {
  475. $type: "div",
  476. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  477. $components: [
  478. {
  479. $type: "span",
  480. class: "mdc-typography--headline5",
  481. $text: "Login: "
  482. },
  483. window._app.widgets.inputTextFieldOutlined({
  484. "id": 'aliasInput',
  485. "label": "Login",
  486. "value": this._alias,
  487. "type": "text",
  488. "init": function () {
  489. this._aliasField = new mdc.textField.MDCTextField(this);
  490. }
  491. }),
  492. ]
  493. },
  494. {
  495. $type: "div",
  496. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  497. $components: [
  498. {
  499. $type: "span",
  500. class: "mdc-typography--headline5",
  501. $text: "Password: "
  502. },
  503. window._app.widgets.inputTextFieldOutlined({
  504. "id": 'passwordInput',
  505. "label": "Password",
  506. "value": this._pass,
  507. "type": "password",
  508. "init": function () {
  509. this._passField = new mdc.textField.MDCTextField(this);
  510. }
  511. }),
  512. ]
  513. },
  514. {
  515. $type: "div",
  516. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  517. $components: [
  518. window._app.widgets.buttonRaised(
  519. {
  520. "label": 'Sign UP',
  521. "onclick": function (e) {
  522. e.preventDefault();
  523. let alias = this._aliasField.value;
  524. let pass = this._passField.value
  525. if (pass.length < 7) {
  526. new Noty({
  527. text: "Your passphrase needs to be longer than 7 letters",
  528. timeout: 2000,
  529. theme: 'mint',
  530. layout: 'bottomRight',
  531. type: 'error'
  532. }).show();
  533. } else {
  534. //
  535. _LCSDB.user().create(alias, pass,
  536. function (ack) {
  537. if (!ack.wait) { }
  538. if (ack.err) {
  539. console.log(ack.err)
  540. return ack.err
  541. };
  542. if (ack.pub) {
  543. let userObj = {
  544. 'alias': alias,
  545. 'pub': ack.pub
  546. };
  547. _LCSDB.get('users').get(alias).put(userObj);
  548. }
  549. _LCSDB.user().auth(alias, pass);
  550. });
  551. }
  552. }
  553. }),
  554. _app.widgets.space,
  555. window._app.widgets.buttonRaised(
  556. {
  557. "label": 'Sign IN',
  558. "onclick": function (e) {
  559. e.preventDefault();
  560. let alias = this._aliasField.value;
  561. let pass = this._passField.value
  562. _app.helpers.authUser(alias, pass);
  563. // _LCSDB.user().auth.call(_LCSDB, alias, pass
  564. // // , function(ack) {
  565. // // if (ack.err) {
  566. // // new Noty({
  567. // // text: ack.err,
  568. // // timeout: 2000,
  569. // // theme: 'mint',
  570. // // layout: 'bottomRight',
  571. // // type: 'error'
  572. // // }).show();
  573. // // }
  574. // //}
  575. // );
  576. }
  577. })
  578. ]
  579. }
  580. ]
  581. }
  582. ]
  583. }
  584. }
  585. return loginGUI
  586. }
  587. initUserGUI() {
  588. let self = this;
  589. let lookWorlds =
  590. {
  591. $type: "div",
  592. id: "lookWorlds",
  593. class: "mdc-layout-grid mdc-layout-grid--align-left",
  594. _status: '',
  595. $init: function () {
  596. this._status = "init";
  597. },
  598. $update: function () {
  599. //change for LiveCoding.space site 'app'
  600. let defaultName = '';
  601. let guiForAll = [
  602. {
  603. $type: "div",
  604. style: "margin-top: 20px;",
  605. _userName: null,
  606. _userNameField: null,
  607. $components:
  608. [
  609. _app.widgets.inputTextFieldOutlined({
  610. "id": 'worldsUserName',
  611. "label": 'Enter user name',
  612. "value": defaultName,
  613. "type": "text",
  614. "init": function () {
  615. this._userNameField = new mdc.textField.MDCTextField(this);
  616. }
  617. }),
  618. _app.widgets.p,
  619. // {
  620. // $type: "a",
  621. // class: "mdc-button mdc-button--raised mdc-card__action actionButton",
  622. // $text: 'World Protos', //self.language.t('set proxy'),//"clone",
  623. // onclick: function (e) {
  624. // //console.log('clone');
  625. // let searchName = this._userNameField.value;
  626. // self.initWorldsProtosListForUser(searchName);
  627. // }
  628. // },
  629. // {
  630. // $type: "a",
  631. // class: "mdc-button mdc-button--raised mdc-card__action actionButton",
  632. // $text: 'World States', //self.language.t('set proxy'),//"clone",
  633. // onclick: function (e) {
  634. // //console.log('clone');
  635. // let searchName = this._userNameField.value;
  636. // self.initWorldsStatesListForUser(searchName);
  637. // }
  638. // }
  639. _app.widgets.buttonRaised(
  640. {
  641. "label": 'World Protos',
  642. "onclick": function (e) {
  643. e.preventDefault();
  644. //page("/app/worlds/protos")
  645. let searchName = this._userNameField.value;
  646. if(searchName !== "")
  647. window.location.pathname = "/"+searchName+"/worlds/protos"
  648. //_app.indexApp.getAppDetailsFromDefaultDB('protos');
  649. }
  650. }),
  651. _app.widgets.space,
  652. _app.widgets.buttonRaised(
  653. {
  654. "label": 'World States',
  655. "onclick": function (e) {
  656. e.preventDefault();
  657. //page("/app/worlds/states")
  658. let searchName = this._userNameField.value;
  659. if(searchName !== "")
  660. window.location.pathname = "/"+searchName+"/worlds/states"
  661. //_app.indexApp.getAppDetailsFromDefaultDB('states');
  662. }
  663. })
  664. ]
  665. },
  666. // window._app.widgets.buttonStroked(
  667. // {
  668. // "label": 'Default World Protos',
  669. // "onclick": function (e) {
  670. // e.preventDefault();
  671. // //page("/app/worlds/protos")
  672. // window.location.pathname = "/app/worlds/protos"
  673. // //_app.indexApp.getAppDetailsFromDefaultDB('protos');
  674. // }
  675. // }),
  676. // window._app.widgets.buttonStroked(
  677. // {
  678. // "label": 'Default World States',
  679. // "onclick": function (e) {
  680. // e.preventDefault();
  681. // //page("/app/worlds/states")
  682. // window.location.pathname = "/app/worlds/states"
  683. // //_app.indexApp.getAppDetailsFromDefaultDB('states');
  684. // }
  685. // })
  686. ];
  687. this.$components = [
  688. {
  689. $type: "h1",
  690. class: "mdc-typography--headline4",
  691. $text: "Looking for Worlds made by other Users!"
  692. }
  693. ].concat(guiForAll, _app.widgets.p, _app.widgets.divider)
  694. }
  695. }
  696. let connectionSettings = {
  697. id: 'connectionSettings',
  698. $type: 'div',
  699. class: "mdc-layout-grid mdc-layout-grid--align-left",
  700. $components: [
  701. _app.widgets.emptyDiv,
  702. window._app.widgets.buttonRaised(
  703. {
  704. "label": 'Connection settings',
  705. "onclick": function (e) {
  706. e.preventDefault();
  707. window.location.pathname = '/settings';
  708. }
  709. }), _app.widgets.emptyDiv
  710. ]
  711. }
  712. let luminaryFeature = {
  713. $cell: true,
  714. $type: 'div',
  715. class: "mdc-layout-grid mdc-layout-grid--align-left",
  716. _luminarySwitch: null,
  717. $components: [
  718. {
  719. $type: "p",
  720. class: "mdc-typography--headline5",
  721. $text: "Use Krestianstvo Luminary (experimental)"
  722. },
  723. {
  724. $type: 'p'
  725. },
  726. _app.widgets.switch({
  727. 'id': 'forceLuminary',
  728. 'init': function () {
  729. this._switch = new mdc.switchControl.MDCSwitch(this);
  730. let config = localStorage.getItem('lcs_config');
  731. this._switch.checked = JSON.parse(config).luminary;
  732. // this._replaceSwitch = this._switch;
  733. },
  734. 'onchange': function (e) {
  735. if (this._switch) {
  736. let chkAttr = this._switch.checked;//this.getAttribute('checked');
  737. if (chkAttr) {
  738. let config = JSON.parse(localStorage.getItem('lcs_config'));
  739. config.luminary = true;
  740. localStorage.setItem('lcs_config', JSON.stringify(config));
  741. window.location.reload(true);
  742. //this._switch.checked = false;
  743. } else {
  744. let config = JSON.parse(localStorage.getItem('lcs_config'));
  745. config.luminary = false;
  746. localStorage.setItem('lcs_config', JSON.stringify(config));
  747. window.location.reload(true);
  748. }
  749. }
  750. }
  751. }
  752. ),
  753. {
  754. $type: 'label',
  755. for: 'input-forceLuminary',
  756. $text: 'Off / On'
  757. }
  758. ]
  759. }
  760. return [luminaryFeature, connectionSettings, _app.widgets.divider]
  761. }
  762. refresh() {
  763. // socket.emit('getWebAppUpdate', "");
  764. }
  765. parseOnlineData(data) {
  766. let parcedData = _app.parseAppInstancesData(data);
  767. //if (Object.entries(parcedData).length !== 0)
  768. let onlineGUIs = document.querySelectorAll('.online');
  769. onlineGUIs.forEach(function (item) {
  770. item._refresh(parcedData)
  771. });
  772. }
  773. createWorldCard(worldType, userAlias, userPub, worldName, id, type, cb) {
  774. let self = this;
  775. let db = _LCSDB.user(userPub);
  776. let onlineGUI = {
  777. $cell: true,
  778. id: "onlineGUI_" + id,
  779. class: "online",
  780. $type: "div",
  781. _instances: {},
  782. _worldListItem: function (m) {
  783. return {
  784. $type: "li",
  785. class: "mdc-list-item",
  786. $components: [
  787. {
  788. $type: "span",
  789. class: "world-link mdc-list-item__text",
  790. $components: [
  791. {
  792. $type: "span",
  793. class: "mdc-list-item__primary-text",
  794. $components: [
  795. {
  796. $type: "a",
  797. $text: m[0],
  798. //target: "_blank",
  799. // href: window.location.protocol + "//" + window.location.host + "/" + m[1].user + m[0],
  800. onclick: function (e) {
  801. self.checkForManualSettings();
  802. window.location.pathname = "/" + m[1].user + m[0];
  803. //self.refresh();
  804. }
  805. },
  806. ]
  807. },
  808. {
  809. $type: "span",
  810. class: "mdc-list-item__secondary-text",
  811. $text: _app.isLuminary ? _LangManager.language.t('users') + Object.keys(m[1].clients).length : _LangManager.language.t('users') + m[1].clients
  812. }
  813. ]
  814. }
  815. ]
  816. }
  817. },
  818. $components: [],
  819. _refresh: function (data) {
  820. if (data) {
  821. if (Object.entries(data).length !== 0) {
  822. if (this._worldInfo) {
  823. let insts = Object.entries(data).filter(el => el[0] == this._worldInfo.worldName);
  824. if (insts.length !== 0)
  825. this._instances = insts[0][1];
  826. }
  827. } else {
  828. this._instances = {}
  829. }
  830. }
  831. },
  832. $init: function () {
  833. if (_app.isLuminary) {
  834. let luminaryPath = _app.luminaryPath;
  835. let ref = _LCSDB.get(luminaryPath);
  836. setInterval(function () {
  837. ref.get('allclients').once().map().once(res => {
  838. if (res) {
  839. if (res.id) {
  840. let clientTime = Gun.state.is(res, 'live');
  841. let now = Gun.time.is();
  842. if (now - clientTime < 10000) {
  843. let instance = res.user + res.instance;
  844. //let data = JSON.stringify({[res.instance]: {instance: instance, clients: {}, user: res.user, loadInfo: {}}});
  845. //console.log(data);
  846. if (!self.instances[res.instance]) {
  847. self.instances[res.instance] = { id: res.instance, instance: instance, clients: { [res.id]: res }, user: res.user, loadInfo: {} }
  848. } else {
  849. self.instances[res.instance].clients[res.id] = res
  850. }
  851. let data = JSON.stringify(self.instances);
  852. self.parseOnlineData(data);
  853. } else {
  854. if (self.instances[res.instance]) {
  855. delete self.instances[res.instance].clients[res.id];
  856. if (Object.keys(self.instances[res.instance].clients).length == 0) {
  857. delete self.instances[res.instance];
  858. self.parseOnlineData(JSON.stringify({}));
  859. }
  860. }
  861. //ref.get('instances').get(res.instance).get(res.id).put(null);
  862. }
  863. }
  864. }
  865. }
  866. )
  867. }, 5000);
  868. }
  869. this._refresh();
  870. },
  871. $update: function () {
  872. if (this._instances) {
  873. let cardListData = Object.entries(this._instances).filter(el => el[1].user == this._worldInfo.userAlias);
  874. this.$components = [
  875. {
  876. $type: "hr",
  877. class: "mdc-list-divider"
  878. }
  879. ].concat(cardListData.map(this._worldListItem))
  880. }
  881. }
  882. }
  883. return {
  884. $cell: true,
  885. id: 'worldCard_' + id,
  886. $type: "div",
  887. _worldName: "",
  888. _worldInfo: {},
  889. _refresh: function (data) {
  890. this._worldInfo = data;
  891. this.$components = [this._updateCard()]
  892. },
  893. $init: function () {
  894. this._worldName = worldName;
  895. if(type == 'min') {
  896. if(worldType == 'proto') {
  897. db.get('worlds').get(this._worldName).path('info_json').on((res)=>{
  898. console.log(res);
  899. let worldDesc = JSON.parse(res);
  900. let root = Object.keys(worldDesc)[0];
  901. var appInfo = worldDesc[root]['en'];
  902. let langID = localStorage.getItem('krestianstvo_locale');
  903. if (langID) {
  904. appInfo = worldDesc[root][langID]
  905. }
  906. let doc = {
  907. 'worldName': this._worldName,
  908. 'created': undefined,
  909. 'modified': undefined,
  910. 'type': 'proto',
  911. 'userAlias': userAlias,
  912. 'info': appInfo
  913. }
  914. this._refresh(doc);
  915. //callback
  916. if(cb)
  917. cb(doc);
  918. })
  919. } else if (worldType == 'state'){
  920. let pathName = 'savestate_/' + this._worldName.protoName+ '/' + this._worldName.stateName + '_info_vwf_json';
  921. db.get('documents').get(this._worldName.protoName).path(pathName).on((res)=>{
  922. console.log(res);
  923. let worldDesc = JSON.parse(res);
  924. let root = Object.keys(worldDesc)[0];
  925. var appInfo = worldDesc[root]['en'];
  926. let langID = localStorage.getItem('krestianstvo_locale');
  927. if (langID) {
  928. appInfo = worldDesc[root][langID]
  929. }
  930. let doc = {
  931. 'worldName': this._worldName.protoName + '/load/' + this._worldName.stateName,
  932. 'created': undefined,
  933. 'modified': undefined,
  934. 'type': 'saveState',
  935. 'userAlias': userAlias,
  936. 'info': appInfo
  937. }
  938. this._refresh(doc);
  939. //callback
  940. if(cb)
  941. cb(doc);
  942. })
  943. }
  944. } else if (type == 'full'){
  945. if(worldType == 'proto') {
  946. db.get('worlds').get(this._worldName).on((res)=>{
  947. console.log(res);
  948. let worldDesc = JSON.parse(res['info_json']);
  949. let root = Object.keys(worldDesc)[0];
  950. var appInfo = worldDesc[root]['en'];
  951. let langID = localStorage.getItem('krestianstvo_locale');
  952. if (langID) {
  953. appInfo = worldDesc[root][langID]
  954. }
  955. let settings = worldDesc[root]['settings'];
  956. let doc = {
  957. 'worldName': this._worldName,
  958. 'created': res.created ? res.created : "",
  959. 'modified': res.modified ? res.modified : "",
  960. 'proxy': res.proxy,
  961. 'type': 'proto',
  962. 'userAlias': userAlias,
  963. 'info': appInfo,
  964. 'settings': settings
  965. }
  966. this._refresh(doc);
  967. //callback
  968. if(cb)
  969. cb(doc);
  970. })
  971. } else if (worldType == 'state') {
  972. let pathNameInfo = 'savestate_/' + this._worldName.protoName+ '/' + this._worldName.stateName + '_info_vwf_json';
  973. db.get('documents').get(this._worldName.protoName).path(pathNameInfo).on((res)=>{
  974. console.log(res);
  975. let worldDesc = JSON.parse(res);
  976. let root = Object.keys(worldDesc)[0];
  977. var appInfo = worldDesc[root]['en'];
  978. let langID = localStorage.getItem('krestianstvo_locale');
  979. if (langID) {
  980. appInfo = worldDesc[root][langID]
  981. }
  982. let settings = worldDesc[root]['settings'];
  983. let doc = {
  984. 'worldName': this._worldName.protoName + '/load/' + this._worldName.stateName,
  985. 'created': undefined,
  986. 'modified': undefined,
  987. 'type': 'saveState',
  988. 'userAlias': userAlias,
  989. 'info': appInfo,
  990. 'settings': settings
  991. }
  992. this._refresh(doc);
  993. //callback
  994. if(cb)
  995. cb(doc);
  996. })
  997. // let pathNameState = 'savestate_/' + this._worldName.protoName+ '/' + this._worldName.stateName + '_vwf_json';
  998. // db.get('documents').get(this._worldName.protoName).path(pathNameState).on((res)=>{
  999. // console.log(res);
  1000. // // let worldDesc = JSON.parse(res);
  1001. // // let root = Object.keys(worldDesc)[0];
  1002. // // var appInfo = worldDesc[root]['en'];
  1003. // // let langID = localStorage.getItem('krestianstvo_locale');
  1004. // // if (langID) {
  1005. // // appInfo = worldDesc[root][langID]
  1006. // // }
  1007. // let settings = worldDesc[root]['settings'];
  1008. // let doc = {
  1009. // 'worldName': this._worldName.protoName + '/load/' + this._worldName.stateName,
  1010. // 'created': res.created,
  1011. // 'modified': res.modified,
  1012. // 'type': 'saveState',
  1013. // 'userAlias': userAlias,
  1014. // 'info': appInfo,
  1015. // 'settings': settings
  1016. // }
  1017. // this._refresh(doc);
  1018. // //callback
  1019. // if(cb)
  1020. // cb(doc);
  1021. // })
  1022. }
  1023. }
  1024. },
  1025. $update: function () {
  1026. //this.$components = [this._updateCard()]
  1027. },
  1028. _updateComps: function () {
  1029. //console.log(this._worldInfo);
  1030. },
  1031. _updateCard: function () {
  1032. let desc = this._worldInfo;
  1033. if (!desc || Object.keys(desc).length == 0) {
  1034. return {
  1035. $type: "h1",
  1036. class: "mdc-typography--headline4",
  1037. $text: "ERROR: NO WORLD!"
  1038. }
  1039. }
  1040. let userGUI = [];
  1041. let online = [];
  1042. let cardInfo = {
  1043. "title": ""
  1044. };
  1045. if (type == "full") {
  1046. } else {
  1047. userGUI.push({
  1048. $type: "a",
  1049. class: "mdc-button mdc-button--compact mdc-card__action mdc-button--outlined",
  1050. $text: "Details",
  1051. onclick: function (e) {
  1052. e.preventDefault();
  1053. window.location.pathname = "/" + desc.userAlias + '/' + desc.worldName + '/about'
  1054. }
  1055. });
  1056. }
  1057. userGUI.push({
  1058. $type: "a",
  1059. class: "mdc-button mdc-button--raised mdc-card__action ",
  1060. $text: _LangManager.language.t('start'),//"Start new",
  1061. //target: "_blank",
  1062. //href: "/" + desc.userAlias + '/' + desc.worldName,
  1063. onclick: function (e) {
  1064. self.checkForManualSettings();
  1065. window.location.pathname = "/" + desc.userAlias + '/' + desc.worldName
  1066. //self.refresh();
  1067. }
  1068. });
  1069. let protoID = {}
  1070. if (desc.type == 'saveState') {
  1071. cardInfo.title = desc.worldName.split('/')[2];
  1072. let protoIDComp = {
  1073. $type: 'div',
  1074. $components: [
  1075. {
  1076. $type: "span",
  1077. class: "mdc-card__subtitle mdc-theme--text-secondary-on-background",
  1078. $text: 'proto: '
  1079. },
  1080. {
  1081. $type: "input",
  1082. type: "text",
  1083. disabled: "",
  1084. style: "font-size:18px",
  1085. value: desc.worldName.split('/')[0]
  1086. }
  1087. ]
  1088. }
  1089. Object.assign(protoID, protoIDComp)
  1090. }
  1091. if (desc.type == 'proto') {
  1092. cardInfo.title = desc.worldName;
  1093. // userGUI.push(
  1094. // {
  1095. // $type: "a",
  1096. // class: "mdc-button mdc-button--compact mdc-card__action",
  1097. // $text: "States",
  1098. // onclick: async function (e) {
  1099. // e.preventDefault();
  1100. // window.location.pathname = "/" + desc.userAlias + '/' + desc.worldName +'/about'
  1101. // //console.log('clone');
  1102. // // document.querySelector('#worldStatesGUI')._refresh({});
  1103. // // let data = await _app.getSaveStates(desc.userAlias, desc.worldName);
  1104. // // document.querySelector('#worldStatesGUI')._refresh(data);
  1105. // }
  1106. // }
  1107. // )
  1108. }
  1109. online.push(onlineGUI);
  1110. if(!desc.info){
  1111. desc.info = {
  1112. imgUrl: "/defaults/worlds/webrtc/webimg.jpg",
  1113. text: "..no text",
  1114. title: "..no title"
  1115. }
  1116. }
  1117. return {
  1118. $type: "div",
  1119. class: "mdc-card world-card",
  1120. $components: [
  1121. {
  1122. $type: "section",
  1123. class: "mdc-card__media world-card__16-9-media",
  1124. $init: function () {
  1125. if (desc.info.imgUrl !== "") {
  1126. this.style.backgroundImage = 'linear-gradient(0deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3) ), url(' + desc.info.imgUrl + ')';
  1127. }
  1128. }
  1129. },
  1130. {
  1131. $type: "section",
  1132. class: "mdc-card__primary",
  1133. $components: [
  1134. {
  1135. $type: "h1",
  1136. class: "mdc-card__title mdc-card__title--large",
  1137. $text: desc.info.title
  1138. },
  1139. {
  1140. $type: "h2",
  1141. class: "mdc-card__subtitle mdc-theme--text-secondary-on-background",
  1142. $text: desc.info.text
  1143. },
  1144. {
  1145. $type: "span",
  1146. class: "mdc-card__subtitle mdc-theme--text-secondary-on-background",
  1147. $text: 'id: '
  1148. },
  1149. {
  1150. $type: "input",
  1151. type: "text",
  1152. disabled: "",
  1153. style: "font-size:18px",
  1154. value: cardInfo.title
  1155. },
  1156. {
  1157. $type: "p",
  1158. },
  1159. protoID,
  1160. {
  1161. $type: "p",
  1162. },
  1163. {
  1164. $type: "span",
  1165. class: "mdc-card__subtitle mdc-theme--text-secondary-on-background",
  1166. $text: desc.created ? 'created: ' + (new Date(desc.created)).toUTCString() : ""
  1167. },
  1168. {
  1169. $type: "p",
  1170. }
  1171. // ,{
  1172. // $type: "span",
  1173. // class: "mdc-card__subtitle mdc-theme--text-secondary-on-background",
  1174. // $text: 'modified: ' + (new Date(desc[5])).toUTCString()
  1175. // }
  1176. ]
  1177. },
  1178. {
  1179. $type: "section",
  1180. class: "mdc-card__actions",
  1181. $components: [
  1182. ].concat(userGUI)
  1183. },
  1184. {
  1185. $type: "section",
  1186. class: "mdc-card__actions",
  1187. $components: [
  1188. {
  1189. $type: 'div',
  1190. $text: 'online now: '
  1191. }
  1192. ].concat(online)
  1193. }
  1194. ]
  1195. }
  1196. }
  1197. }
  1198. }
  1199. createWorldsGUI(worldType, userAlias, userPub, worldName) {
  1200. let self = this;
  1201. let db = _LCSDB.user(userPub);
  1202. let id = worldName ? worldName + '_' + userAlias : "allWorlds_" + userAlias
  1203. let headerText = worldName ? 'States for ' + worldName : 'All Worlds Protos'
  1204. let worldCards = {
  1205. $cell: true,
  1206. id: id,
  1207. $type: "div",
  1208. $components: [],
  1209. _cards: [],
  1210. // _states: {},
  1211. // _refresh: function (data) {
  1212. // this._states = data;
  1213. // },
  1214. $init: function () {
  1215. console.log('init lab...');
  1216. if(worldType == 'proto'){
  1217. db.get('worlds')
  1218. .map()
  1219. .on((res,k)=>{
  1220. console.log('From world: ', k);
  1221. //let doc = document.querySelector('#'+ k);
  1222. let cardID = userAlias + '_' + k;
  1223. let doc = this._cards.filter(el=> el.$components[0].id == 'worldCard_'+ cardID)[0];
  1224. if(!doc) {
  1225. doc = this._makeWorldCard(k, cardID);
  1226. this._cards.push(doc);
  1227. }
  1228. })
  1229. } else if(worldType == 'state') {
  1230. //get states
  1231. console.log('get states');
  1232. db.get('documents')
  1233. .map()
  1234. .on((res,k)=>{
  1235. if( k !== 'id'){
  1236. console.log('From world: ', k);
  1237. let worldStatesInfo = Object.entries(res).filter(el=>el[0].includes('_info_vwf_json'));
  1238. worldStatesInfo.map(el=>{
  1239. let saveName = el[0].split('/')[2].replace('_info_vwf_json', "");
  1240. let cardID = userAlias + '_' + saveName + '_' + k;
  1241. console.log(cardID, ' - ', el);
  1242. let doc = this._cards.filter(el=> el.$components[0].id == 'worldCard_'+ cardID)[0];
  1243. if(!doc) {
  1244. doc = this._makeWorldCard({protoName: k, stateName: saveName}, cardID);
  1245. this._cards.push(doc);
  1246. }
  1247. })
  1248. //let saveName = el.stateName.split('/')[2].replace('_info_vwf_json', "");
  1249. }
  1250. //let doc = document.querySelector('#'+ k);
  1251. // let doc = this._cards.filter(el=> el.$components[0].id == 'worldCard_'+ userAlias + '_' + k)[0];
  1252. // if(!doc) {
  1253. // doc = this._makeWorldCard(k);
  1254. // this._cards.push(doc);
  1255. // }
  1256. })
  1257. }
  1258. //this._refresh();
  1259. },
  1260. _makeWorldCard: function (worldID, cardID) {
  1261. //let cardID = userAlias + '_' + worldID//data[1].userAlias + '_' + data[1].worldName + '_' + data[0];
  1262. let card = self.createWorldCard(worldType, userAlias, userPub, worldID, cardID, 'min');
  1263. //card._refresh(data[1]);
  1264. //card._worldInfo = data[1];
  1265. //card._updateComps();
  1266. return {
  1267. $cell: true,
  1268. $type: "div",
  1269. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-4",
  1270. $components: [card]
  1271. }
  1272. },
  1273. $update: function () {
  1274. // let cards = Object.entries(this._states)
  1275. // .filter(el => Object.keys(el[1]).length !== 0)
  1276. // .sort(function (el1, el2) {
  1277. // return parseInt(el2[1].created) - parseInt(el1[1].created)
  1278. // })
  1279. // .map(this._makeWorldCard);
  1280. this.$components = [
  1281. {
  1282. $type: "div",
  1283. class: "mdc-layout-grid",
  1284. $components: [
  1285. {
  1286. $type: "div",
  1287. class: "mdc-layout-grid__inner",
  1288. $components: [
  1289. {
  1290. $type: "div",
  1291. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  1292. $components: [
  1293. {
  1294. $type: "H3",
  1295. $text: headerText
  1296. }
  1297. ]
  1298. }
  1299. ]
  1300. },
  1301. {
  1302. $type: "div",
  1303. class: "mdc-layout-grid__inner",
  1304. $components: this._cards
  1305. }
  1306. ]
  1307. }
  1308. ]
  1309. }
  1310. }
  1311. return worldCards
  1312. }
  1313. checkForManualSettings() {
  1314. console.log("check for manual settings");
  1315. let manualSettings = localStorage.getItem('lcs_app_manual_settings');
  1316. if (manualSettings) {
  1317. localStorage.removeItem('lcs_app_manual_settings');
  1318. }
  1319. let el = document.querySelector('#runWorldGUI');
  1320. if (el) {
  1321. if (el._arSwitch.checked) {
  1322. let arSettings = {
  1323. model: {
  1324. 'vwf/model/aframe': null
  1325. },
  1326. view: {
  1327. 'vwf/view/aframe': null,
  1328. 'vwf/view/editor-new': null
  1329. }
  1330. }
  1331. localStorage.setItem('lcs_app_manual_settings', JSON.stringify(arSettings));
  1332. }
  1333. if (el._turnArOnSwitch.checked) {
  1334. let arSettings = {
  1335. model: {
  1336. 'vwf/model/aframe': null
  1337. },
  1338. view: {
  1339. 'vwf/view/aframe': null,
  1340. 'vwf/view/aframe-ar-driver': null
  1341. }
  1342. }
  1343. localStorage.setItem('lcs_app_manual_settings', JSON.stringify(arSettings));
  1344. }
  1345. }
  1346. }
  1347. }
  1348. export { IndexApp as default }
  1349. //export {getAppDetails, generateFrontPage, setLanguage, initLocale};