|
|
|
@ -50,25 +50,13 @@ var prettyRequestTypes = {
|
|
|
|
|
'xmlhttprequest': 'xhr'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var timeOptions = {
|
|
|
|
|
hour: '2-digit',
|
|
|
|
|
minute: '2-digit',
|
|
|
|
|
second: '2-digit',
|
|
|
|
|
hour12: false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var dateOptions = {
|
|
|
|
|
month: 'short',
|
|
|
|
|
day: '2-digit'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
// Adjust top padding of content table, to match that of toolbar height.
|
|
|
|
|
|
|
|
|
|
document.getElementById('content').style.setProperty(
|
|
|
|
|
'margin-top',
|
|
|
|
|
document.getElementById('toolbar').offsetHeight + 'px'
|
|
|
|
|
document.getElementById('toolbar').clientHeight + 'px'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
@ -220,6 +208,12 @@ var createHiddenTextNode = function(text) {
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
var padTo2 = function(v) {
|
|
|
|
|
return v < 10 ? '0' + v : v;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
var createGap = function(tabId, url) {
|
|
|
|
|
var tr = createRow('1');
|
|
|
|
|
tr.classList.add('doc');
|
|
|
|
@ -276,9 +270,11 @@ var renderLogEntry = function(entry) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fields common to all rows.
|
|
|
|
|
var time = new Date(entry.tstamp);
|
|
|
|
|
tr.cells[0].textContent = time.toLocaleTimeString('fullwide', timeOptions);
|
|
|
|
|
tr.cells[0].title = time.toLocaleDateString('fullwide', dateOptions);
|
|
|
|
|
var time = logDate;
|
|
|
|
|
time.setTime(entry.tstamp - logDateTimezoneOffset);
|
|
|
|
|
tr.cells[0].textContent = padTo2(time.getUTCHours()) + ':' +
|
|
|
|
|
padTo2(time.getUTCMinutes()) + ':' +
|
|
|
|
|
padTo2(time.getSeconds());
|
|
|
|
|
|
|
|
|
|
if ( entry.tab ) {
|
|
|
|
|
tr.classList.add('tab');
|
|
|
|
@ -296,6 +292,10 @@ var renderLogEntry = function(entry) {
|
|
|
|
|
tbody.insertBefore(tr, tbody.firstChild);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Reuse date objects.
|
|
|
|
|
var logDate = new Date(),
|
|
|
|
|
logDateTimezoneOffset = logDate.getTimezoneOffset() * 60000;
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
|
|
var renderLogEntries = function(response) {
|
|
|
|
|