Activation Xpath on JS Customized Action
Posted: Tue Jun 27, 2017 6:06 pm
Hello,
I seem to have lost Activation Xpath functionality for JS (frameworks.js) customized actions. In example, in the .framework file I have an 'insert.image' action with its Activation Xpath property set to oxy:allows-child-element("*:img") - This works as expected, allowing image action in specified locations in both the desktop and WebAuthor environment when unmodified. However, in the WebAuthor environment I needed to customize this action a bit in the js (code below). When I implement this customization I am able to call the inset image action from anywhere within the document - which is not desired behavior. How can I control the Activiation Xpath after the .js customization?
I seem to have lost Activation Xpath functionality for JS (frameworks.js) customized actions. In example, in the .framework file I have an 'insert.image' action with its Activation Xpath property set to oxy:allows-child-element("*:img") - This works as expected, allowing image action in specified locations in both the desktop and WebAuthor environment when unmodified. However, in the WebAuthor environment I needed to customize this action a bit in the js (code below). When I implement this customization I am able to call the inset image action from anywhere within the document - which is not desired behavior. How can I control the Activiation Xpath after the .js customization?
Code: Select all
sync.xhtml.XhtmlExtension.prototype.editorCreated = function(editor) {
goog.events.listen(editor, sync.api.Editor.EventTypes.ACTIONS_LOADED, function(e) {
var actionsManager = editor.getActionsManager();
var originalInsertImageAction = actionsManager.getActionById('insert.image');
if (originalInsertImageAction) {
var insertImageAction = new sync.actions.InsertImage(
originalInsertImageAction,
"ATPCustEditorUtils.InsertImgOperationWithUUID",
editor);
actionsManager.registerAction('insert.image', insertImageAction);
} ...