APP: IMatch Code Tester

Started by Jingo, September 22, 2019, 05:34:56 PM

Previous topic - Next topic

Jingo

Hi Folks.. so here is a little something I whipped up to test a concept... not sure how useful it is - but another neat example of what can be done via APPs with just a few lines of code!  This app will allow you test "code snippets" from within another Imatch APP!  I often need to test some code examples and have a basic app template to do it.. but I thought - wouldn't it be cool to have something similar to VarToy.. but for actual code?  Well.. here it is!

The App provides you with a textarea to include a JS code snippet and will take that snippet, build out another app file and then launch that app to run the code.   Just type the code into the text area like you would normally add to the text file and hit the Test Code button!  Voila!  The temp app will launch and whatever code you have entered (so long as it is valid!) should launch.  Great for Console.log updates to check files or just to test that some code works.... if you want to modify the temp app with display areas, just update the index.html file in the TempApp\template folder... then you will be able to interact with html elements from your JS code... Neat eh?  ;D   

The Main App "Interface":


The ALL IMPORTANT app icon:


The Modal "temp app" that gets built and run:



The Output window that resulted from my test code (see in first screenshot):



To install, just unzip the CodeTester.zip file and place the 2 app folders (an actual app and a "temp" app) into your C:\ProgramData\photools.com\imatch6\webroot\user\ path.  When you launch IMatch, the actual app and the temp app will appear - I'm working to get the temp app hidden but I think there might be something wrong with the "hidden" attribute in the app.json module.  If you want to hide the TempApp in the meantime, just right click it and select to "hide the app" from the popup menu.

As always.. use with caution... not much error checking is built in and the code snippets you run are running against your IMatch database and files..... be sure you know what you are doing!  :P

Enjoy!!

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Quote from: Mario on September 22, 2019, 06:47:41 PM
Thanks for sharing  :)

My pleasure... took me about an hr to come up with the code for this... love IMatch rapid app development!

Jingo

Updated version of the app available with the hidden flag for the temp app set correctly... please use this version if you care to try out the app... might be useful for any app designers out there (or any budding programmers just curious how this was accomplished!).  Enjoy - Andy.