Vorlonjs icon indicating copy to clipboard operation
Vorlonjs copied to clipboard

Feature request: Provide API to trigger selection of HTML elements in vorlon

Open sjoerd222888 opened this issue 9 years ago • 8 comments

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?

sjoerd222888 avatar Sep 04 '15 15:09 sjoerd222888

Hello,

We need to talk a bit about this :)

etiennemargraff avatar Sep 05 '15 07:09 etiennemargraff

Just to better understand, this API would be on the client side, correct?

deltakosh avatar Sep 07 '15 18:09 deltakosh

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.

sjoerd222888 avatar Sep 08 '15 08:09 sjoerd222888

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 ?

etiennemargraff avatar Sep 08 '15 15:09 etiennemargraff

If I understand it correctly and I can use this to select element in the DOM Explorer, then yes.

sjoerd222888 avatar Sep 08 '15 15:09 sjoerd222888

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

gleborgne avatar Sep 08 '15 16:09 gleborgne

But you are working on a more clean solution to do this, right?

sjoerd222888 avatar Sep 08 '15 16:09 sjoerd222888

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.

gleborgne avatar Sep 08 '15 16:09 gleborgne