Änderungen von Dokument Expand

Zuletzt geändert von Daniel Herrmann am 2026/02/04 20:25

Von Version Icon 7.1 Icon
bearbeitet von Daniel Herrmann
am 2025/11/08 02:47
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.28.4]
Auf Version Icon 8.1
bearbeitet von Daniel Herrmann
am 2026/02/04 20:25
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.29.1]

Zusammenfassung

Details

Icon XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -25,6 +25,7 @@
25 25  #macro (executeMacro)
26 26  
27 27   #set ($discard = $xwiki.ssx.use('Confluence.Macros.Expand'))
28 + #set ($discard = $xwiki.jsx.use('Confluence.Macros.Expand'))
28 28   #set ($title = $wikimacro.parameters.title)
29 29   #if ("$!title" == "")
30 30   #set ($title = $services.promacroexpand.getAutoTitle($wikimacro.content, $xwiki.currentContentSyntaxId))
Icon XWiki.JavaScriptExtension[0]
Pufferstrategie
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,29 @@
1 +// The current versions of Safari don't bundle the latest version of WebKit, and because of this it lacks
2 +// a feature from the HTML standard where the details tag automatically expands when the URL fragment
3 +// targets an element inside it. Here is the WebKit bug report: https://bugs.webkit.org/show_bug.cgi?id=228843,
4 +// and we should follow it so we know when the fix reaches Safari. I also opened
5 +// https://github.com/xwikisas/xwiki-pro-macros/issues/682 on our side to keep track of the issue and avoid forgetting it.
6 +require(['jquery'], function ($) {
7 + var isSafari = navigator.vendor && navigator.vendor.includes('Apple');
8 +
9 + function handleFragment() {
10 + let hash = window.location.hash;
11 + if (!hash) return;
12 +
13 + let target = $(hash);
14 + if (target.length === 0) return;
15 +
16 + target.parents("details").each(function () {
17 + this.open = true;
18 + });
19 +
20 + target[0].scrollIntoView({ behavior: "auto", block: "start" });
21 + }
22 + if (isSafari) {
23 + console.log("Applying Safari fragment workaround");
24 + // On initial load
25 + $(document).ready(handleFragment);
26 + // On fragment updates
27 + $(window).on("hashchange", handleFragment);
28 + }
29 +});
Inhalt parsen
... ... @@ -1,0 +1,1 @@
1 +Nein
Benutze diese Erweiterung
... ... @@ -1,0 +1,1 @@
1 +currentPage