JavaScript Classes & Documentation...

Started by Mario, March 09, 2017, 06:25:56 PM

Previous topic - Next topic

Mario

Users who plan to write scripts or IMatch 2017 and/or IMWS can use two classes I will include in the product:

1. The IMWS Class

This JavaScript class is a thin wrapper for the IMWS functionality. It reduces the code you have to write, simplifies authentication etc.
This class can be used both in apps running 'in' IMatch or in apps and scripts running in a wen browser.

2. IMatch

This class makes IMatch features easily accessible for JavaScript. It covers the features implemented by IMatch directly, e.g. file system access, dialog boxes, accessing file window contents etc.
This class is mainly designed to be used in apps running 'in' IMatch but it also works when your script or app runs in an external browser.

I have designed it this way to allow you to use the debugger tools in your web browser to debug your script, monitor what it is doing etc. This is a massive help when creating scripts. The debugging tools and other programmer features in modern web browsers are awesome.

You will always use both classes in your code. All sample applications and programming samples included in IMatch use these classes.
When you need to access the database, you use IMWS. When you need too access some IMatch functionality, you use the methods provided by the IMWS class.

Documentation

I will provide a documentation for both the IMWS and IMatch classes. This documentation comes in HTML format and is automatically generated from comments inside the JavaScript code. This ensures that the help is always up-to-date and minimizes the time I have to spend on writing all that stuff.

The documentation looks like this in your browser (click to zoom):



Documentation for IMWS

IMWS documents itself. The /discover endpoint returns a list of all endpoints (methods) supported by IMWS, with all parameters, documentation, examples and ikn the future also links to external tutorials on the photools.com web site. These tutorials allow me to cover more complex topics in greater detail. And since they are on-line, I can update them any time, without having to wait for a new release.

IMatch includes a Doc App that requests the discover data from IMWS and displays it neatly formatted inside the app panel or an external web browser.
This app also serves as a sample for how to use /discover and create HTML tables on-the-fly. Or a neat search function.

This is how the documentation app looks in IMatch 2017:

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

Mario

PS.: As you can see in the 2nd. screen shot, there are already plenty of apps finished for IMatch 2017.

I have also learned how to create usable icons in Affinity Designer. Previously I did them in Ps, but now I create almost everything of that kind in Affinity Designer.
Since all modern browsers can display SVG vector graphics, this makes things scalable and responsive (from small to very large screens).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

Quote from: Mario on March 09, 2017, 06:31:00 PM
I have also learned how to create usable icons in Affinity Designer. Previously I did them in Ps, but now I create almost everything of that kind in Affinity Designer.
Since all modern browsers can display SVG vector graphics, this makes things scalable and responsive (from small to very large screens).

Just curious: I gather it's easier to export SVG vector graphics from Affinity Designer than from PS? Are there other advantages of using Affinity Designer besides this? (Is this a case where Adobe wants you to use another $$$ product, e.g., Illustrator?)
John

Mario

Ps is a pixel editor so the export capabilities for vectors are limited. It may produce SVGs, but these are just bitmaps. I have never used Illustrator - way too expensive for the bit of vector work I do. But I bought Affinity after one day of testing  :)
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

I mainly use Indesign and Photoshop for my business.... so I subscribe to Adobe's "next tier" of applications which includes Illustrator.  I typically use Illustrator to unpack groups of ai or eps files to ungroup and grab certain elements for use in Indesign.... I also immediately downloaded Affinity Designer when it was available and no longer use Illustrator.... highly recommend AD for a lightweight yet robust product that is very cost effective!