Vorlonjs
Vorlonjs copied to clipboard
Feature request: Provide API to trigger selection of HTML elements in vorlon
Provide an API function where I can trigger selection of elements in the vorlon DOM tree. So that I could create my own debug tools where I can build a feature like right-click/inspect or ctrl-mouse click or whatever I want but the tool can then call a vorlon API function that triggers the selection.
the idea originates from this other issue: https://github.com/MicrosoftDX/Vorlonjs/issues/183
This would not be directly intrusive. With this API everybody could build his own debug feature. A tool like a picker function could be built on top of this.
What are your thoughts?
Hello,
We need to talk a bit about this :)
Just to better understand, this API would be on the client side, correct?
Yes. Questions are how the API should look like exactly. I guess I should be able to pass the a reference to the DOM element directly (I mean the JavaScript representative of the DOM node).
What I could do with this API:
- Add a new context menu entry such that I can do right-click/inspect element
- Create a special debug mode where I can just click on DOM nodes and they get automatically selected in vorlon
- Automatically selected DOM nodes of the element I am currently editing in a CMS system in vorlon? (Do not know if this makes sense/is interesting)
There are a lot of things that can be done with this and regarding the other feature request the consumer of the API can decide how intrusive it should be.
GLeborgne is currently implementing a way to select an element on the client side and be directed to the corresponding element in the dom Explorer. Will this help you ?
If I understand it correctly and I can use this to select element in the DOM Explorer, then yes.
You understand correctly. About using Vorlon intrusively as an API, You could actually do it today. If You use Object explorer you must see a "VORLON" object. Plugins instances are stored in VORLON.Core._clientPlugins. You could look at plugins code to see how to hookup
But you are working on a more clean solution to do this, right?
In the next version you will have the inspect button and the plugin will have a clean "selectElementInDashboard" function but for now, you will have to call it like explained above. We will discuss internally about exposing an API for the following release.