Skip to content
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

Merged
merged 5 commits into from
Dec 20, 2022

Conversation

trrenty
Copy link
Contributor

@trrenty trrenty commented Dec 12, 2022

@@ -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');
Copy link
Contributor

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.

Copy link
Contributor

@mflorea mflorea left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants