2 // @name Fix ADS checkin comments in discussion and history of workitems
4 // @author Tobias Sachs
5 // ... add match eg https://myazerdevops/*
12 let timerId = undefined;
13 let fixComments = (items) =>
15 if (items === null || items === undefined || items.length === 0)
19 console.info("fixing '" + items.length +"' comments.");
20 for (var i = 0; i < items.length; i++){
22 let html = el.innerHTML;
23 if (html.startsWith("Associated"))
25 html = html.replace(/(Associated with changeset )(\d*):/, "<b>$1<a href='/HeBa/Entwicklung/_versionControl/changeset/$2'>$2</a></b>:<br />");
26 el.innerHTML = html.replace(/\n/gi, "<br />");
32 console.debug("fixit timerreset...");
33 clearTimeout(timerId);
36 observer.disconnect();
37 timerId = setTimeout(function(){
39 let found = document.getElementsByClassName("comment-content");
42 found = document.getElementsByClassName("history-item-comment");
45 console.debug("observe...");
46 observer.observe(document, { subtree: true, childList: true, characterData: true });
50 const observer = new MutationObserver(function() {
51 console.debug('observertriggered...');