Home › Forums › Programming › Question about createApp() function
- This topic has 5 replies, 2 voices, and was last updated 1 year, 8 months ago by
David Duperron.
-
AuthorPosts
-
2024-02-13 at 8:48 am #70451
David Duperron
CustomerHi!
I have put in place a solution to secure and user-customize the access to my web application using a Firebase realtime database. Basically it is waiting for the user to properly log in to launch the createApp() function which is located in the app.js file.
I have replaced the “load” eventlistener by a function which is triggered when the user is logged in. This is working perfectly for the web app, but this is causing the puzzles editing page to not load!
Is there a way to have a different behaviour to launch the createApp() function for the web app page and for the puzzles page??
Thanks for the help!David
2024-02-13 at 8:52 am #70452kdv
Participantjust use different app_name.js files for the Puzzle editor and on your web server.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-02-13 at 9:15 am #70454David Duperron
CustomerOk but how?? the puzzle button in the app manager is linking to the app_name.html file, with the visual_logic.xml file as a parameter, and the .js file is called inside the app_name.html file… I don’t see how to make it different for the puzzle editor and the web server.
2024-02-13 at 9:46 am #70455kdv
ParticipantMake changes in .js, upload it to your web server. Remove changes to use in the Puzzles editor. Do not upload it any more.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-02-13 at 11:16 am #70461kdv
ParticipantOr you can check if the Puzzles editor is used
window.addEventListener('load', (e) => { const params = v3d.AppUtils.getPageParams(); if (params.logic) { // check if the Puzzles editor is used createApp({ containerId: 'v3d-container', fsButtonId: 'fullscreen-button', sceneURL: params.load || 'bloom_test.gltf', logicURL: params.logic || 'visual_logic.js' }); } else { // do whatever you want here } });Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-02-13 at 2:36 pm #70479David Duperron
CustomerThanks§ that works perfectly
-
AuthorPosts
- You must be logged in to reply to this topic.
