Changes for page Helpers
Last modified by Benjamin Fischer on 2025/06/17 11:57
From version 1.18
edited by Benjamin Fischer
on 2025/05/15 17:00
on 2025/05/15 17:00
Change comment:
There is no comment for this version
To version 1.21
edited by Benjamin Fischer
on 2025/05/15 17:17
on 2025/05/15 17:17
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -121,7 +121,7 @@ 121 121 if (u.hostname.includes("youtube")) icon = "youtube-play"; 122 122 if (u.pathname.endsWith(".pdf")) icon = "file-pdf-o"; 123 123 if (u.pathname.endsWith(".pptx")) icon = "file-powerpoint-o"; 124 - if (u.pathname.endsWith(".ipynb")) icon = " file-text-o";124 + if (u.pathname.endsWith(".ipynb")) icon = "code"; 125 125 if (icon) { 126 126 const s = a.ownerDocument.createElement("span"); 127 127 s.appendChild(a.ownerDocument.createElement("wbr")); ... ... @@ -135,5 +135,21 @@ 135 135 row.doc_location = ol.outerHTML; 136 136 }; 137 137 138 + require(['jquery', 'bootstrap'], function($) { 139 + document.styleSheets[0].insertRule(`#mainContentArea .popover {max-width: 50%;}`); 140 + 141 + const ttApply = ({ memo: { tableId } }) => { 142 + if (tableId) 143 + $(`#${tableId} [data-toggle="popover"]`).popover({ 144 + html: true, 145 + container: `#mainContentArea`, 146 + trigger: "hover", 147 + }); 148 + }; 149 + 150 + document.observe(`xwiki:livetable:displayComplete`, ttApply); 151 + for (const tab of document.querySelectorAll(".xwiki-livetable")) 152 + ttApply({ memo: { tableId: tab.id }}); 153 + }); 138 138 })()); 139 139