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
8 // @downloadURL https://github.com/tsheba/tampermonkeyscripts/raw/master/AzureDevOpsCommentEnhancer.user.js
14 let timerId = undefined;
15 let fixComments = (items) =>
17 if (items === null || items === undefined || items.length === 0)
21 console.info("fixing '" + items.length +"' comments.");
22 for (var i = 0; i < items.length; i++){
24 let html = el.innerHTML;
25 if (html.startsWith("Associated"))
27 html = html.replace(/(Associated with changeset )(\d*):/, "<b>$1<a href='/HeBa/Entwicklung/_versionControl/changeset/$2'>$2</a></b>:<br />");
28 el.innerHTML = html.replace(/\n/gi, "<br />");
34 console.debug("fixit timerreset...");
35 clearTimeout(timerId);
38 observer.disconnect();
39 timerId = setTimeout(function(){
41 let found = document.getElementsByClassName("comment-content");
44 found = document.getElementsByClassName("history-item-comment");
47 console.debug("observe...");
48 observer.observe(document, { subtree: true, childList: true, characterData: true });
52 const observer = new MutationObserver(function() {
53 console.debug('observertriggered...');