Changes for page Home

From version 1.1
edited by superadmin
on 2025/02/21 15:01
Change comment: Install extension [org.xwiki.platform:xwiki-platform-distribution-flavor-common/15.10.11]
To version 2.1
edited by Monika Leung
on 2025/02/21 15:12
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.superadmin
1 +xwiki:XWiki.leung
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,34 @@
1 +// Open external links in new tab
2 +function open_ext_link_in_new_tab() {
3 + var nodes = document.querySelectorAll('.wikiexternallink a');
4 + for(var i=0; i< nodes.length; i++){
5 + var link = nodes[i];
6 + if (link.hasAttribute('target') == false) {
7 + link.setAttribute('target', '_blank');
8 + }
9 + }
10 +}
11 +document.addEventListener("DOMContentLoaded", open_ext_link_in_new_tab);
12 +
13 +require(['jquery'], function($) {
14 + jQuery(document.links).filter(function() {
15 + return this.hostname != window.location.hostname;
16 + }).attr('target', '_blank');
17 +});
18 +
19 +// Style search button
20 +let searchButton = document.querySelector("#globalsearch > button");
21 +searchButton.textContent = "Search";
22 +let searchInput = document.querySelector("#globalsearch > input");
23 +searchInput.placeholder = "";
24 +
25 +// Add class to active page
26 +let sidebarLinks = document.querySelectorAll('.sidebar-nav ul a')
27 +let currentUrl = new URL(window.location.href);
28 +sidebarLinks.forEach(link => {
29 + let linkUrl = new URL(link.href, window.location.origin);
30 + if (linkUrl.pathname === currentUrl.pathname) {
31 + link.classList.add('active-link');
32 + }
33 +});
34 +
Name
... ... @@ -1,0 +1,1 @@
1 +Wiki-wide Customization
Use this extension
... ... @@ -1,0 +1,1 @@
1 +always

Interested in our testing services?

If you are interested and would like to receive more information, please send us an email and sign up for our newsletter to stay up-to-date.