Fixed public timeline posts being loaded into post pages.

parent 22cc58fb
window.addEventListener('load', function(){
// Set: don’t run in Node.
if (typeof this.data !== 'undefined')
{
// console.log("In Node: Not running in-browser code.");
return;
}
setInterval(function(){
// Update all the message clocks
var postDates = document.getElementsByClassName('postDate');
for (var i = 0; i < postDates.length; i++)
{
var postDate = postDates[i];
var timestamp = (postDate.getAttribute('data-timestamp')).replace (/_/g, ':');
var timeOfPost = new Date(timestamp);
var humanTime = moment(timeOfPost).fromNow();
postDate.innerHTML = humanTime + " ";
}
}, 3000);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment