Update live timestamps to give a more live feeling

This commit is contained in:
Joas Schilling 2016-08-31 17:33:00 +02:00
parent 4a5cd74fb2
commit ee1c1b39b2
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
2 changed files with 9 additions and 1 deletions

View File

@ -1202,8 +1202,9 @@
}
td = $('<td></td>').attr({ "class": "date" });
td.append($('<span></span>').attr({
"class": "modified",
"class": "modified live-relative-timestamp",
"title": formatted,
"data-timestamp": mtime,
"style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')'
}).text(text)
.tooltip({placement: 'top'})

View File

@ -1660,6 +1660,13 @@ function initCore() {
$('body').delegate('#app-content', 'apprendered appresized', adjustControlsWidth);
}
// Update live timestamps every 30 seconds
setInterval(function() {
$('.live-relative-timestamp').each(function() {
$(this).text(OC.Util.relativeModifiedDate(parseInt($(this).attr('data-timestamp'), 10)));
});
}, 30 * 1000);
}
$(document).ready(initCore);