Hello,
I have an not wanted behavior. If I use the Macro-Shortcut expression ('{' sign) and select my macro via enter or a mouse click. My macro is directly inserted in my page. But what I want is, that my macro dialog is open first, before my macro is inserted.
Here is an example of my JavaScript file.
AJS.bind("init.rte", function() { ... });
All I needed that my macro is inserted directly is this "simplest" callback function.
I don't even need to call this method
var macroRenderRequest = { contentId: Confluence.Editor.getContentId(), macro: { name: "myMacro", params: currentParams, defaultParameterValue: "", body : "" } }; tinymce.confluence.MacroUtils.insertMacro(macroRenderRequest);
How can I avoid this situation?
Greetings
Community moderators have prevented the ability to post new answers.
I have solve my issue. After debugging the JS-Code.
Internally this method would be called:
var dropdownSelectionMade = function(autoCompleteControl, options) { var macroMetadata = options.presetMacroMetadata; autoCompleteControl.replaceWithSelectedSearchText(); if (!macroMetadata) { tinymce.confluence.macrobrowser.macroBrowserToolbarButtonClicked(options); } else { // only open the macro browser if there are required parameters if (AJS.MacroBrowser.hasRequiredParameters(macroMetadata) || !!macroMetadata.alwaysShowConfig) { tinymce.confluence.macrobrowser.macroBrowserToolbarButtonClicked(options); } else { AJS.Rte.BookmarkManager.storeBookmark(); tinymce.confluence.MacroUtils.insertMacro({ contentId: AJS.Meta.get('content-id') || "0", macro: { name: macroMetadata.macroName, body : "" } }); } } };
There is a commentar, which is very useful.
The macro will be inserted directly if there are no required parameter in the atlassian-plugin.xml defined.
So, you have to do this in your xhtml-macro parameter node.
Hi,
thanks for your question and the answer. Helped me alot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.