2 // @name Fix ADS checkin comments in discussion and history of workitems
4 // @author Tobias Sachs
5 // ... add match eg https://myazerdevops/*
7 // @updateURL https://github.com/tsheba/tampermonkeyscripts/raw/master/AzureDevOpsCommentEnhancer.user.js
13 let timerId = undefined;
14 let fixComments = (items) =>
16 if (items === null || items === undefined || items.length === 0)
20 console.info("fixing '" + items.length +"' comments.");
21 for (var i = 0; i < items.length; i++){
23 let html = el.innerHTML;
24 if (html.startsWith("Associated"))
26 html = html.replace(/(Associated with changeset )(\d*):/, "<b>$1<a href='/HeBa/Entwicklung/_versionControl/changeset/$2'>$2</a></b>:<br />");
27 el.innerHTML = html.replace(/\n/gi, "<br />");
33 console.debug("fixit timerreset...");
34 clearTimeout(timerId);
37 observer.disconnect();
38 timerId = setTimeout(function(){
40 let found = document.getElementsByClassName("comment-content");
43 found = document.getElementsByClassName("history-item-comment");
46 console.debug("observe...");
47 observer.observe(document, { subtree: true, childList: true, characterData: true });
51 const observer = new MutationObserver(function() {
52 console.debug('observertriggered...');