Changeset 84885 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jun 21, 2020 1:35:38 AM (4 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/htdocs/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js
r84621 r84885 234 234 cMinTz = -cMinTz; 235 235 236 return new Date(oDate.getTime() +cMinTz * 60000);236 return new Date(oDate.getTime() - cMinTz * 60000); 237 237 } 238 238 console.assert(false); 239 239 return oDate; 240 } 241 242 /** 243 * @param oDate Date object. 244 */ 245 function formatTimeHHMM(oDate, fNbsp) 246 { 247 var sTime = oDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'} ); 248 if (fNbsp === true) 249 sTime = sTime.replace(' ', '\u00a0'); 250 251 /* Workaround for single digit hours in firefox with en_US (minutes works fine): */ 252 var iHours = oDate.getHours(); 253 if ((iHours % 12) < 10) 254 { 255 var ch1 = sTime.substr(0, 1); 256 var ch2 = sTime.substr(1, 1); 257 if ( ch1 == (iHours % 12).toString() 258 && !(ch2 >= '0' && ch2 <= '9')) 259 sTime = '0' + sTime; 260 } 261 return sTime; 240 262 } 241 263 … … 1027 1049 function tooltipElementOnMouseEnter() 1028 1050 { 1029 console.log('tooltipElementOnMouseEnter: arguments.length='+arguments.length+' [0]='+arguments[0]);1030 console.log('ENT: currentTarget='+arguments[0].currentTarget+' id='+arguments[0].currentTarget.id+' class='+arguments[0].currentTarget.className); 1051 /*console.log('tooltipElementOnMouseEnter: arguments.length='+arguments.length+' [0]='+arguments[0]); 1052 console.log('ENT: currentTarget='+arguments[0].currentTarget+' id='+arguments[0].currentTarget.id+' class='+arguments[0].currentTarget.className); */ 1031 1053 tooltipResetShowTimer(); 1032 1054 tooltipResetHideTimer(); … … 1045 1067 { 1046 1068 var oEvt = arguments[0]; 1047 console.log('tooltipElementOnMouseOut: arguments.length='+arguments.length+' [0]='+oEvt);1048 console.log('OUT: currentTarget='+oEvt.currentTarget+' id='+oEvt.currentTarget.id+' class='+oEvt.currentTarget.className); 1069 /*console.log('tooltipElementOnMouseOut: arguments.length='+arguments.length+' [0]='+oEvt); 1070 console.log('OUT: currentTarget='+oEvt.currentTarget+' id='+oEvt.currentTarget.id+' class='+oEvt.currentTarget.className);*/ 1049 1071 1050 1072 /* Ignore the event if leaving to a child element. */ … … 1206 1228 function svnHistoryTooltipNewOnReadState(oTooltip, oRestReq, oParent) 1207 1229 { 1208 console.log('svnHistoryTooltipNewOnReadState'); 1230 /*console.log('svnHistoryTooltipNewOnReadState: status=' + oRestReq.status + ' readyState=' + oRestReq.readyState);*/ 1231 if (oRestReq.readyState != oRestReq.DONE) 1232 { 1233 oTooltip.oInnerElm.innerHTML = '<p>Loading ...(' + oRestReq.readyState + ')</p>'; 1234 return true; 1235 } 1209 1236 1210 1237 /* … … 1268 1295 sHtml += '<a href="' + oResp.sTracChangesetUrlFmt.replace('%(iRevision)s', oCommit.iRevision.toString()); 1269 1296 sHtml += '" target="_blank">'; 1270 sHtml += '<span class="tmvcstimeline-time">' + escapeElem( tsCreated.toLocaleTimeString()) + '</span>'1297 sHtml += '<span class="tmvcstimeline-time">' + escapeElem(formatTimeHHMM(tsCreated, true)) + '</span>' 1271 1298 sHtml += ' Changeset <span class="tmvcstimeline-rev">[' + oCommit.iRevision + ']</span>'; 1272 1299 sHtml += ' by <span class="tmvcstimeline-author">' + escapeElem(oCommit.sAuthor) + '</span>'; … … 1280 1307 } 1281 1308 1282 console.log('svnHistoryTooltipNewOnReadState: sHtml=' + sHtml);1309 /*console.log('svnHistoryTooltipNewOnReadState: sHtml=' + sHtml);*/ 1283 1310 oTooltip.oInnerElm.innerHTML = sHtml; 1284 1311 … … 1419 1446 1420 1447 var oTooltip = g_dTooltips[sKey]; 1421 console.log('svnHistoryTooltipNewDelayedShow: ' + sRepository + ' ' + oTooltip);1448 /*console.log('svnHistoryTooltipNewDelayedShow: ' + sRepository + ' ' + oTooltip);*/ 1422 1449 if (!oTooltip) 1423 1450 { … … 1425 1452 * Create a new tooltip element. 1426 1453 */ 1427 console.log('creating ' + sKey);1454 /*console.log('creating ' + sKey);*/ 1428 1455 1429 1456 var oElm = document.createElement('div'); -
trunk/src/VBox/ValidationKit/testmanager/htdocs/js/vcsrevisions.js
r84620 r84885 40 40 function vcsRevisionFormatTime(tsDate) 41 41 { 42 var sRet = tsDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'} ); 43 return sRet.replace(' ', '\u00a0'); 42 return formatTimeHHMM(tsDate, true /*fNbsp*/); 44 43 } 45 44
Note:
See TracChangeset
for help on using the changeset viewer.