Very nice! Looking forward to trying this out
cheers 🍻,
-highball
________________________________
Earlier message 81 lines
From: Pas2js on behalf of
Sent: Saturday, May 9, 2020 6:00:01 AM
To:
Subject: Pas2js Digest, Vol 27, Issue 1
Send Pas2js mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Pas2js digest..."
Today's Topics:
1. Improved JS-Object to class demo (Michael Van Canneyt)
----------------------------------------------------------------------
Message: 1
Date: Fri, 8 May 2020 14:48:48 +0200 (CEST)
From: Michael Van Canneyt
To: pas2js discussions
Subject: [Pas2js] Improved JS-Object to class demo
Message-ID: <alpine.DEB.2.21.2005081437190.5483 at home>
Content-Type: text/plain; format=flowed; charset=US-ASCII
Hello,
I have improved the Javascript Object-to-Pascal class demo somewhat.
It no longer requires you to recompile the demo, everything can be done
dynamically.
Check it out:
https://www.freepascal.org/~michael/pas2js-demos/genclass/
You can load scripts dynamically
(every URL you type can be loaded with "Load Script");
You can give:
- a path to an object instance (relative to the window instance).
- a pascal class name for the new external definition.
- an external name for the new external definition.
- the parent name for the new external class (by default TJSObject)
When you hit 'Create class', a skeleton pascal code will be generated for you.
For instance, load the following script:
https://uselooper.com/assets/javascript/theme.min.js
Then enter
Object path: Looper
Pascal external class name: Theme
Pascal Class Name : TJSLooper
Hit "Create class" and observe your new external class definition...
The code is of course not perfect, but will help you getting started.
Code is obviously committed in the demos. Suggestions for improvements welcome.
Enjoy !
Michael.
------------------------------
Subject: Digest Footer
