Skip to content

Commit

Permalink
Update topdesk-highlight-summary.user.js
Browse files Browse the repository at this point in the history
Fixed the summary box which dissapeared in the v1.2
  • Loading branch information
magnborn authored and GitHub Enterprise committed Oct 23, 2024
1 parent d02a056 commit b2dd3d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions topdesk-highlight-summary.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name TOPdesk - Highlight Summary
// @namespace http://tampermonkey.net/
// @version 1.2
// @version 1.3
// @description Highlight the summary section in a box with rounded corners and white background
// @author Magnus Børnes (magnborn@ntnu.no)
// @match https://hjelp.ntnu.no/*
Expand All @@ -16,10 +16,10 @@

// Function to highlight the summary
function highlightSummary() {
// Find all div elements with specific class or attribute
const divs = document.querySelectorAll('div[guielement="crt-content-label"]');
// Find the first div element with an ID ending in "_Y7"
const div = document.querySelector('div[id$="_Y7"]');

divs.forEach(div => {
if (div) {
// Get the inner HTML of the div
let html = div.innerHTML;

Expand All @@ -46,11 +46,11 @@
// Update the div's inner HTML
div.innerHTML = html;
}
});
}
}

// Run the function to highlight the summary after the DOM is fully loaded
document.addEventListener('DOMContentLoaded', () => {
// Run the function to highlight the summary after the page has fully loaded
window.addEventListener('load', () => {
highlightSummary();

// Debounce function to limit the frequency of highlightSummary calls
Expand Down

0 comments on commit b2dd3d9

Please sign in to comment.