Annotate a JS Function with 'WebappRestSafe'
Posted: Fri Nov 08, 2024 9:28 am
Hi !
I have created a custom action and put it in plugin.js file of my web author plugin.
In my plugin.js file I have a code snippet:
My common.js code :
I get the error :
How do I annotate JS code with 'WebappRestSafe' ? I have seen implementations in Java, but I don't know for Javascript.
I have tried couple of approaches but it didn't work.
I have created a custom action and put it in plugin.js file of my web author plugin.
In my plugin.js file I have a code snippet:
Code: Select all
this.editor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.JSOperation',
{
script:'common.js'
});
Code: Select all
class GetCurrentId {
doOperation() {
var currentNode = authorAccess.getEditorAccess().getFullySelectedNode();
var currentNodeId= currentNode("id");
return currentNodeId;
}
}
I have tried couple of approaches but it didn't work.