Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: embedding 3rd party JS libraries #230

Open
pablocar80 opened this issue Apr 16, 2019 · 2 comments
Open

question: embedding 3rd party JS libraries #230

pablocar80 opened this issue Apr 16, 2019 · 2 comments

Comments

@pablocar80
Copy link

Hello!

I'm really interested into Ooui. For the project I'm considering it, one of the things that I need to do is to embed into the HTML existing 3rd party JavaScript controls, for example a photo gallery component.

Is this something that we should be able to do in Ooui without problems? In the example of the photo gallery, adding a 3rd party control means modifying the HEAD of the HTML document to reference external JS and CSS files, and then executing some JavaScript code on the document. The library will then create new elements inside the document and attach handlers to their events.

Given that all this handling of elements happens in a lower level of abstraction respective to Ooui, is this something that you see feasible? Or is the engine going to compare versions and run over all the 'rogue' elements and their event handlers, that were created with nasty injected JavaScript?

Thank you!!

@Psercom
Copy link

Psercom commented Apr 17, 2019

We are succeeding in using OOUI for a large, involved project. It hasn't had many issues and we resolved these by building the source and making minor modifications (sent to Frank in case he wants to incorporate). From our point of view OOUI is cleverly magnificent with clean code that's easy to work with.
On your question, if you build the sources you will see that JS is inserted via the ui.cs file in OOUI. The JS needed for messaging is inserted at the end of . We have found it useful and easy to also include user js as usertop.js and userbottom.js in the head and at end of body, respectively. With these we can call any js we want by creating those files in wwwroot. We are going to recommend to Frank that he institutionalize some such in a future version to support user js, but for now you would have to modify the sources yourself as we did.
Since the architecture is very clean one would want Frank to tune in to this question and consider if he prefers this approach or some other.
Good luck

@Psercom
Copy link

Psercom commented Apr 17, 2019

textbox modified our text which had an actual tag, it is:
at the end of BODY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants