General approach for integrating external libs (CSS/JS)

Just starting out? Need help? Post your questions and find answers here.
bembulak
Posts: 71
Joined: Wed Feb 26, 2014 9:53 am

General approach for integrating external libs (CSS/JS)

Post by bembulak »

Hello ladies and gentlemen,

Taking a look at the Tricks 'n' Tips section of the forum, I've noticed several helpful libraries and beatiful extensions, that I like to play around with.

These valuable contributions demonstrate that SpiderBasic can be used in various ways. And, of course this triggers the urge to integrate new functionalities or extend existing stuff.

However, with my current skill level in regards of SpiderBasic & JavaScript I don't see myself proficient enough to estimate where possibilities end, or - let's say - the effort cancels out the benefit.


Real world example: currently I'm fascinated by the Shoelace & Bootstrap examples.
Can such things be integrated into a SpiderBasic-Window like the Google-Chart and have interactivity?

To come straight to a point:
Is there any recommended approach on how to integrate certain JS / CSS libs? Best practices, things one must keep in mind? I see, that Modules would make sense here, but at this point I already get stuck.
I don't know how JS variables and SB variables (or functions or objects or references) are mapped. Is there a place, where suche things are documented? I've seen a few sentences on this in the SB help file, but it seems more to be a side note than an overall manual.

Thank you!
User avatar
Peter
Posts: 1093
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: General approach for integrating external libs (CSS/JS)

Post by Peter »

The graphical user interface of SpiderBasic is based on the Dojo toolkit. If you want to use a different interface (like Bootstrap), this means that you have to exchange all relevant window- and gadget-based commands. This is not impossible, but it is quite time-consuming.

As for writing your own components: Maybe you've already had a look at my libraries and can learn something from them.

If something is unclear, you are of course welcome to ask specific questions.
bembulak
Posts: 71
Joined: Wed Feb 26, 2014 9:53 am

Re: General approach for integrating external libs (CSS/JS)

Post by bembulak »

Thank you,
I've seen that already. If I understand corrctly, we have the following mapping (might be incomplete):

MySpiderBasicVarialbe : v_myspiderbasicvariable
*MySBPointer : p_mysbpointer
MyProcedure() : f_myprocedure()
MyModule : mymodule
MyModule::MyModItem : mymodule$mymoditem

Anything else?
Peter wrote: Mon Dec 19, 2022 10:44 am The graphical user interface of SpiderBasic is based on the Dojo toolkit. If you want to use a different interface (like Bootstrap), this means that you have to exchange all relevant window- and gadget-based commands. This is not impossible, but it is quite time-consuming.

As for writing your own components: Maybe you've already had a look at my libraries and can learn something from them.

If something is unclear, you are of course welcome to ask specific questions.
Thank you.

Yes, I'm very aware of your repo and the plenty of stuff you contribute. I do currently take a look at Leaflet, for example, to get a feel for the structure of the Module. However, as said: My current skill level makes it almost impossible to come up with own solutions.

Is it likely that not all JS libs can be wrapped to operate with SB's Dojo implementation (easily)?
I mean: when I look at Leaflet it seems that it was built with 'being embedded' in mind. Therefore it's possible to have it work inside a SB-ContainerGadget. But having Shoelace or Bootstrap Widgets inside a SB container would be very different from that, I guess.

The problems already start with getting the parent IDs and assigning them or have them working together. I've seen there's a GetSelector Macro in your codes that returns the parent/target Gadget. But from there? I don't get it.
Post Reply