Page 1 of 1

Adding custom dialog from element drop down menu in author v

Posted: Fri Mar 27, 2015 6:49 pm
by easirois
Hi,

Is it possible to launch a dialog add a custom dialog for a specific element in the dropdown list from the author view, something like the current image dialog? I would expect at some point to use the ro.sync.ecss.extensions.commons.operations API to plop down some text after the user has made some selection in the dialog.

Kind regards,
Eric

Re: Adding custom dialog from element drop down menu in auth

Posted: Sun Mar 29, 2015 11:26 pm
by easirois
I see there's a sample code in the SDK but it seems to be available from everywhere. I would like it to be more context specific. So do I need to look at the
InsertElementOperation
to be able to do an action on s specific element.

Re: Adding custom dialog from element drop down menu in auth

Posted: Mon Mar 30, 2015 10:21 am
by alex_jitianu
Hello Eric,

Let's make sure I've fully understood your scenario. You want to contribute an action to the content completion window. When this action is pressed it should present a dialog for user interaction. The action should also be presented only in specific contexts. If these assumptions are correct, here is what you should do:
1. Create a custom Author operation. This operation is Java code and is responsible for presenting the dialog.
2. Create an author action over the previous operation. A specific point of interest here is the field When this XPath expression is true. This XPath expression will give the context in which your action will be active. The action will appear only in these contexts.
3. Contribute this action to content completion window.

Best regards,
Alex