Closed arunshekher closed 11 years ago
Thanks for the suggestion Arun. Would you mind testing it out and providing some feedback?
I'll. But I don't really have a clear idea now as how to go about with this. On an initial trial I tried integrating it to the chatbox, used theme.php to load the scripts and timeago seems to work okay when normal chatbox style is used (on asynchronous mode it failed to refresh time just after making an async post out of box) but livestamp.js caused some issues with other scripts probably it has some conflicting namespaces for its methods with native e107 scripts, didn't check in detail. I was able to add extra methods in chatbox_shortcodes class to create the format of timestamps these scripts required. Will do more testing and update this thread.
Tested it now again with livestamp.js. Loaded the script via theme.php from e107_web/js/livestamp/ like e107::js('core', "livestamp/moment.min.js"); and e107::js('core', "livestamp/livestamp.min.js"); and it worked pretty well on chatbox, no issues at all (which I encountered in my initial trial).
Nice to see the the relative date format used by e107 v2 in the chatbox, comments, forum etc. I think it would be cool if these timestamp styles can be adapted to match the timestamp styles that is found in sites like Facebook, twitter etc (ie. realtime auto updating ones). These awesome jQuery plugins does it unobtrusively: timeago, Livestamp.js etc.
Devs might want to take a look when they have time for a feature enhancement. Guess these scripts won't poll enough to slow UI down.
timeago - http://timeago.yarp.com/ Livestamp.js - http://mattbradley.github.io/livestampjs/