-
-
Notifications
You must be signed in to change notification settings - Fork 593
XWIKI-23129: Add an end of DOM
UIXP
#4085
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
base: master
Are you sure you want to change the base?
Changes from all commits
d0c17e0
9d63d7b
58fe35e
af1cfdf
71f191b
0659e94
f7ecb47
4309879
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,17 @@ | |
#if ($services.debug.isEnabled()) | ||
#template('debug.vm') | ||
#end | ||
<div class="modal-container"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The class name seems a bit unexpected given the extension point's name. Also, what's the purpose of this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It made sense when doing it, but looking at it again I understand why it's not clear. Technically, the modals are still at the end of the body, even though they are wrapped under a div.
It's a container so that whatever modal added by the extension point is a bit apart from the other elements in the body. This way it should be easier to select modals with CSS or JS and customize them. IMO it can be useful for customizations, it makes it a bit easier to read the HTML and I believe that it won't be a liability on the long term (no real downside to adding this AFAIK). Here's what the HTML view in the Firefox inspector looks like today. It's not easy to figure out that the first thing is the only thing that's shown, and all the others are just misc modals that might appear at some point. Note that in XS, this new class doesn't collide with any existing node (quite close but still different from the quite old There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additional pro: it's easier for technical users to understand where the UIXP aims at exactly, given we give the exact id/class on the UIXP documentation. This one is quite straightforward even without a container though :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd change the class name to reflect the fact that it's the wrapper for the end of DOM UIXP. The fact that we put modals here is then a technical decision that might change in the future (e.g. if we decide to only load them all async), but the UIX would still be included there. So I'd go for something like |
||
#if (($displayAdminMenu || $displayMoreActionsMenu) && $canView) | ||
#template("export_modal.vm") | ||
#exportModal() | ||
#end | ||
## We don't care about order for this extension point, none of the extensions should have 'visible' content. | ||
## The primary use of this extension point is to gather modal elements that did not get loaded asynchronously. | ||
#foreach ($uix in $services.uix.getExtensions('org.xwiki.platform.template.body.end')) | ||
$services.rendering.render($uix.execute(), 'html/5.0') | ||
#end | ||
</div> | ||
</body> | ||
</html> | ||
#else ## Portlet Mode | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3212,3 +3212,35 @@ Recursive title display detected!## | |
#macro (unwrapXPropertyDisplay $displayOutput) | ||
$!stringtool.removeEnd($stringtool.removeStart($displayOutput, '{{html clean="false" wiki="false"}}'), '{{/html}}')## | ||
#end | ||
|
||
#** | ||
* XWiki Standard use only. | ||
* $watchStatus is a WatchedEntityReference.WatchedStatus returned by script services | ||
* similar to $services.notification.watch.getLocationWatchedStatus | ||
* Returns the FA4 class of the icon corresponding to the provided watchStatus in $watchIcon | ||
* AND | ||
* Returns the status label in $watchText | ||
* @since 17.4.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the PR description you said that this won't be backported, why do you indicate 17.4.2 then? |
||
* @since 17.5.0RC1 | ||
*# | ||
#macro (_notificationsWatchStatusIcon $watchedStatus) | ||
## FIXME: the different icons should use the icon service | ||
## They should be added to the XWiki Icon set | ||
#set ($iconWhenWatched = 'fa-bell') | ||
#set ($iconWhenNotSet = 'fa-bell-o') | ||
#set ($iconWhenBlocked = 'fa-bell-slash') | ||
#set ($iconWhenCustom = 'fa-bullhorn') | ||
#if ($watchedStatus == 'NOT_SET') | ||
#set ($watchIcon = $iconWhenNotSet) | ||
#set ($watchText = $services.localization.render('notifications.watch.button.status.notset', 'html/5.0', [])) | ||
#elseif ($watchedStatus.isWatched()) | ||
#set ($watchIcon = $iconWhenWatched) | ||
#set ($watchText = $services.localization.render('notifications.watch.button.status.followed', 'html/5.0', [])) | ||
#elseif ($watchedStatus.isBlocked()) | ||
#set ($watchIcon = $iconWhenBlocked) | ||
#set ($watchText = $services.localization.render('notifications.watch.button.status.blocked', 'html/5.0', [])) | ||
#else | ||
#set ($watchIcon = $iconWhenCustom) | ||
#set ($watchText = $services.localization.render('notifications.watch.button.status.custom', 'html/5.0', [])) | ||
#end | ||
#end |
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.
yes you can compare with the value returned for the default page for a DOCUMENT from the entity default resolver (don't recall the exact component name). We might even have something more elaborate for this as it's common.
I'm sure @tmortagne will know :)
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.
Found an example at
xwiki-platform/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/renameStep1.vm
Line 29 in 382acff