Changes for page Material Collection

Last modified by Judith Steinfeld on 2025/06/03 11:13

From version 55.22
edited by Benjamin Fischer
on 2024/10/28 13:46
Change comment: There is no comment for this version
To version 55.13
edited by Benjamin Fischer
on 2024/10/28 13:31
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -56,25 +56,24 @@
56 56   const b = a.ownerDocument.createElement("b");
57 57   a.replaceWith(b);
58 58   b.appendChild(a);
59 - a.textContent = row.doc_title;
60 60  
61 61   const u = new URL(row.link_value);
62 62   let icon;
63 63   if (u.hostname.includes("github")) icon = "github";
64 - if (u.hostname.includes("github.io")) icon = "book";
65 65   if (u.hostname.includes("gitlab")) icon = "gitlab";
66 66   if (u.hostname.includes("google")) icon = "google";
67 - if (u.hostname.includes("youtube")) icon = "youtube-play";
68 68   if (u.pathname.endsWith(".pdf")) icon = "file-pdf-o";
69 69   if (icon) {
70 70   const s = a.ownerDocument.createElement("span");
71 - s.appendChild(a.ownerDocument.createElement("wbr"));
68 + s.textContent = " ";
72 72   s.setAttribute("class", `fa fa-${icon}`);
73 - s.setAttribute("style", "padding-right: .3em;");
70 + s.setAttribute("style", "padding-right: .3em;word-wrap: nowrap;");
74 74   a.insertBefore(s, a.firstChild);
75 75   }
76 76   a.setAttribute("class", "wikiexternallink");
77 77   a.setAttribute("href", u.href);
75 +
76 + a.parentNode
78 78  
79 79   row.doc_location = ol.outerHTML;
80 80  
... ... @@ -85,7 +85,7 @@
85 85   want[0] === true
86 86   ? Array.from(tags)
87 87   : want.filter(tag => tags.delete(tag))
88 - ).sort().map(tag => `<span class="ltTag" style="cursor:pointer;white-space:nowrap;">${tag}</span>`).join(", ")
87 + ).sort().map(tag => `<span class="ltTag" style="cursor:pointer;">${tag}</span>`).join(", ")
89 89   );
90 90   }
91 91  });