URL chooser for a custom action
Posted: Tue Apr 07, 2020 5:51 pm
Hi,
I would like to add a custom action to add a mapref in a ditamap.
So I add this code, but I don't know how to invoke an "URL chooser" to get get link to .ditamap and use the result with ro.sync.ecss.extensions.commons.operations.IFragmentOperation (see "var url = ????").
And just another thing, I put framework.js in a folder shared by 2 frameworks (one for dita topic and another for ditamap).
This file is recognized only by "dita topic" framework (I can see custom actions in toolbar) but not by "ditamap" framework. Do you know why ?
Thanks a lot for your help.
I would like to add a custom action to add a mapref in a ditamap.
So I add this code, but I don't know how to invoke an "URL chooser" to get get link to .ditamap and use the result with ro.sync.ecss.extensions.commons.operations.IFragmentOperation (see "var url = ????").
Code: Select all
MaprefAction = function(editor) {
this.editor = editor;
};
MaprefAction.prototype.getDisplayName = function() {
return 'Insert a mapref element';
};
// The actual action execution.
MaprefAction.prototype.actionPerformed = function(callback) {
var url = ????
if (url) {
this.editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.IFragmentOperation', {
fragment: '<' + 'mapref href="' + url + '"/>'
}, callback);
} else {
callback && callback();
}
};
This file is recognized only by "dita topic" framework (I can see custom actions in toolbar) but not by "ditamap" framework. Do you know why ?
Thanks a lot for your help.