User:Dorumin/seconds.​js

//  // @requires seconds.css importArticle({   type: 'script',    article: 'u:dev:MediaWiki:Chat-js/code.js' });

mw.hook('dev.chat.render').add(function {   function bind_messages(fn) {        mainRoom.model.chats.bind('afteradd', fn);        mainRoom.model.privateUsers.bind('add', function(u) { mainRoom.chats.privates[u.attributes.roomId].model.chats.bind('afteradd', fn); });   }

bind_messages(function(model) {       if (model.attributes.isInlineAlert) return;        var seconds = document.createElement('span');        seconds.className = 'seconds';        seconds.textContent = ':' + new Date(model.attributes.timeStamp).getSeconds.toString.padStart(2, '0');        document            .getElementById('entry-' + model.cid)            .querySelector('.time')                .appendChild(seconds);    }); });