Changeset 83440 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Mar 26, 2020 2:20:22 PM (5 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/htdocs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/htdocs/css/common.css
r83410 r83440 1151 1151 border: 0px none; 1152 1152 width: 100%; 1153 overflow: auto; 1153 //overflow: auto; 1154 overflow: hidden; 1154 1155 } 1155 1156 -
trunk/src/VBox/ValidationKit/testmanager/htdocs/css/tooltip.css
r82968 r83440 115 115 116 116 /* This helps highlighting the revision we're showing the tooltip for. */ 117 .tmvcstimeline :target, .tmvcstimeline :target + dd {117 .tmvcstimeline-highlight, .tmvcstimeline :target, .tmvcstimeline :target + dd { 118 118 background-color: #d8e8ff; 119 119 padding-top: 0.2em; -
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
r83360 r83440 32 32 var g_ksParamRedirectTo = 'RedirectTo'; 33 33 34 35 /** 36 * Detects the firefox browser. 37 */ 38 function isBrowserFirefox() 39 { 40 return typeof InstallTrigger !== 'undefined'; 41 } 42 43 /** 44 * Detects the google chrome browser. 45 * @note Might be confused with edge chromium 46 */ 47 function isBrowserChrome() 48 { 49 var oChrome = window.chrome; 50 if (!oChrome) 51 return false; 52 return !!oChrome.runtime || !oChrome.webstore; 53 } 54 55 /** 56 * Detects the chromium-based edge browser. 57 */ 58 function isBrowserEdgeChromium() 59 { 60 if (!isBrowserChrome()) 61 return false; 62 return navigation.userAgent.indexOf('Edg') >= 0 63 } 64 65 /** 66 * Detects the safari browser (v3+). 67 */ 68 function isBrowserSafari() 69 { 70 /* Check if window.HTMLElement is a function named 'HTMLElementConstructor()'? 71 Should work for older safari versions. */ 72 var sStr = window.HTMLElement.toString(); 73 if (/constructor/i.test(sStr)) 74 return true; 75 76 /* Check the class name of window.safari.pushNotification. This works for current. */ 77 var oSafari = window['safari']; 78 if (oSafari) 79 { 80 if (typeof oSafari !== 'undefined') 81 { 82 var oPushNotify = oSafari.pushNotification; 83 if (oPushNotify) 84 { 85 sStr = oPushNotify.toString(); 86 if (/\[object Safari.*Notification\]/.test(sStr)) 87 return true; 88 } 89 } 90 } 91 return false; 92 } 34 93 35 94 /** … … 691 750 function tooltipRepositionOnLoad() 692 751 { 752 //console.log('tooltipRepositionOnLoad'); 693 753 if (g_oCurrentTooltip) 694 754 { … … 784 844 } 785 845 846 oTooltip.oElm.style.position = 'absolute'; 786 847 oTooltip.oElm.style.display = 'block'; 787 oTooltip.oElm.style.position = 'absolute';788 848 oRect = oRelTo.getBoundingClientRect(); 789 849 oTooltip.oRelToRect = oRect; … … 832 892 833 893 /** 894 * Highlights the desired revision. 895 * 896 * This is a WORKAROUND for browser where we cannot use the URL fragment to 897 * do this. 898 */ 899 function svnHistoryTooltipHighligh(oTooltip) 900 { 901 var iRevision = oTooltip.iRevision; 902 if (false && isBrowserFirefox()) 903 { 904 var sDesiredHash = '#r' + iRevision; 905 var sCurrentHash = oTooltip.oIFrame.contentWindow.location.hash; 906 //console.log('before: location.hash=' + sCurrentHash + ' src=' + oTooltip.oIFrame.src); 907 if (sCurrentHash != sDesiredHash) 908 { 909 oTooltip.oIFrame.contentWindow.location.hash = sDesiredHash; 910 oTooltip.oIFrame.contentWindow.location.reload(); 911 //console.log('after: location.hash=' + oTooltip.oIFrame.contentWindow.location.hash + ' src='+oTooltip.oIFrame.src); 912 } 913 return true; 914 } 915 916 /* Clear old selection - not needed as we appear to be reloading the page each time... */ 917 var aoElements = oTooltip.oIFrame.contentDocument.getElementsByTagName('dt'); 918 var i; 919 for (i = 0; i < aoElements.length; i++) 920 aoElements[i].className = ''; 921 aoElements = oTooltip.oIFrame.contentDocument.getElementsByTagName('dd'); 922 for (i = 0; i < aoElements.length; i++) 923 aoElements[i].className = ''; 924 925 /* New selection: */ 926 var oDt = oTooltip.oIFrame.contentDocument.getElementById('r' + iRevision); 927 oDt.className = 'tmvcstimeline-highlight'; 928 oDt.nextElementSibling.className = 'tmvcstimeline-highlight'; 929 930 return true; 931 } 932 933 /** 834 934 * iframe.onload hook that repositions and resizes the tooltip. 835 935 * … … 848 948 { 849 949 var oSubElement = g_oCurrentTooltip.oIFrame; 950 svnHistoryTooltipHighligh(g_oCurrentTooltip); /* do early as it increases the element padding */ 951 850 952 var cxSpace = Math.max(oSubElement.offsetLeft * 2, 0); /* simplified */ 851 953 var cySpace = Math.max(oSubElement.offsetTop * 2, 0); /* simplified */ … … 964 1066 oTooltip.oElm.style.position = 'absolute'; 965 1067 oTooltip.oElm.style.zIndex = 6001; 966 oTooltip.xPos = 0; 967 oTooltip.yPos = 0; 968 oTooltip.cxMax = 0; 969 oTooltip.cyMax = 0; 970 oTooltip.cyMaxUp = 0; 971 oTooltip.xScroll = 0; 972 oTooltip.yScroll = 0; 1068 oTooltip.xPos = 0; 1069 oTooltip.yPos = 0; 1070 oTooltip.cxMax = 0; 1071 oTooltip.cyMax = 0; 1072 oTooltip.cyMaxUp = 0; 1073 oTooltip.xScroll = 0; 1074 oTooltip.yScroll = 0; 1075 oTooltip.iRevision = iRevision; /**< For :target/highlighting */ 973 1076 974 1077 oSubElement = document.createElement('iframe'); 975 1078 oSubElement.setAttribute('id', sKey + '_iframe'); 976 1079 oSubElement.setAttribute('style', 'position: relative;"'); 977 oSubElement.onload = function() {svnHistoryTooltipOnLoad(); setTimeout(svnHistoryTooltipOnLoad,0);};978 1080 oSubElement.onmouseenter = tooltipElementOnMouseEnter; 979 1081 oSubElement.onmouseout = tooltipElementOnMouseOut; … … 983 1085 984 1086 document.body.appendChild(oTooltip.oElm); 1087 1088 oSubElement.onload = function() { tooltipReallyShow(oTooltip, oParent); svnHistoryTooltipOnLoad(); }; 1089 1090 var sUrl = sUrlPrefix + 'index.py?Action=VcsHistoryTooltip&repo=' + sRepository 1091 + '&rev=' + svnHistoryTooltipCalcLastRevision(iRevision) 1092 + '&cEntries=' + g_cTooltipSvnRevisions; 1093 if (false && isBrowserFirefox()) /* The other browsers will scroll the main window when jumping to the revision. */ 1094 sUrl = sUrl + '#r' + iRevision; 1095 oSubElement.setAttribute('src', sUrl); 1096 985 1097 } 986 1098 else 987 1099 { 988 oSubElement = oTooltip.oIFrame; 989 } 990 991 oSubElement.setAttribute('src', sUrlPrefix + 'index.py?Action=VcsHistoryTooltip&repo=' + sRepository 992 + '&rev=' + svnHistoryTooltipCalcLastRevision(iRevision) 993 + '&cEntries=' + g_cTooltipSvnRevisions 994 + '#r' + iRevision); 995 tooltipReallyShow(oTooltip, oParent); 996 /* Resize and repositioning hacks. */ 997 svnHistoryTooltipOnLoad(); 998 setTimeout(svnHistoryTooltipOnLoad, 0); 1100 /* Show the existing one with different :target/highlighting */ 1101 oTooltip.iRevision = iRevision; 1102 if (false && isBrowserFirefox()) /* The other browsers will scroll the main window when jumping to the revision. */ 1103 svnHistoryTooltipHighligh(oTooltip); 1104 tooltipReallyShow(oTooltip, oParent); 1105 svnHistoryTooltipOnLoad(); 1106 } 999 1107 } 1000 1108
Note:
See TracChangeset
for help on using the changeset viewer.