-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CKEDITOR-499: Provide the source document to the html displayers of the macro parameters #72
Conversation
…he macro parameters
application-ckeditor-ui/src/main/resources/CKEditor/MacroService.xml
Outdated
Show resolved
Hide resolved
application-ckeditor-plugins/src/main/resources/xwiki-macro/macroEditor.js
Outdated
Show resolved
Hide resolved
@@ -42,10 +42,13 @@ define('macroService', ['jquery', 'xwiki-meta'], function($, xcontext) { | |||
if (macroDescriptor) { | |||
deferred.resolve(macroDescriptor); | |||
} else { | |||
var url = new XWiki.Document('MacroService', 'CKEditor').getURL('get', $.param({ | |||
var sourceDocument = CKEDITOR.currentInstance.element.getAttribute('data-sourceDocumentReference'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I suggested this, but I forgot that the macro wizard (selector and editor) must be independent of the CKEditor. For instance, the macro wizard is used to insert / edit gadgets on the Dashboard, where there's no CKEditor instance. This means the macro wizard can't use the CKEDITOR
API. Instead, we need to pass the source document as an optional parameter to the macro wizard. I mean, the code that starts the macro wizard should pass the source document reference as parameter, if it makes sense, otherwise the current document reference is used.
…he macro parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I'd take the value from the config (where it's already resolved) rather than from the data attribute.
The PR for the issue: https://jira.xwiki.org/browse/CKEDITOR-499