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

XWIKI-17664: When adding an annotation the focus should be inside WYSIWYG by default #3694

Merged
merged 12 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
XWIKI-17664: When adding an annotation the focus should be inside WYS…
…IWYG by default

* Fixed codestyle
Sereza7 committed Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 368e04a96e6101673ed68d1d6f073385839bf907
Original file line number Diff line number Diff line change
@@ -357,7 +357,7 @@
#macro(displayAnnotationProperty $annotatedDocument $annotationObject $annotationProperty $mode)
#if ($mode == 'edit' || $mode == 'create')
## This startupFocus parameter is used by the CKEditor WYSIWYG editor.
#set( $startupFocus = true)
#set ($startupFocus = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we shouldn't make his a bit more generic / extensible to prepare the ground for other configuration parameters we may need in the future:

Suggested change
#set ($startupFocus = true)
#set ($wysiwygEditorConfig = {
'startupFocus': true
})

This will make the configuration more explicit, and it will reduce the risk of naming conflicts with other entries from the script context. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍
I added changes related to this in 359f650

Note that using the standard XWiki config for intellij idea, it auto formatted the two xmls into a wrong style. I had to deactivate the feature and fix it by hand in b7d3008 .

## We use displayEdit and not display('edit') because we want the input field name to be just the property name
## (without the "DocumentReference_objectNumber_" prefix).
$annotatedDocument.displayEdit($annotationProperty, '', $annotationObject)
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@
<label for="$name">$services.localization.render('core.viewers.comments.add.comment.label')</label>
#initRequiredSkinExtensions()
## This startupFocus parameter is used by the CKEditor WYSIWYG editor.
#set( $startupFocus = true)
#set ($startupFocus = true)
## display of the comment field
$doc.displayEdit($fieldToDisplay, '', $commentObj)