allow timeago to be cast on other elements as well, ex. small

v1.18.x
psychobunny 10 years ago
parent 82ac542f55
commit 412c5360a6

@ -234,7 +234,7 @@ app.cacheBuster = null;
app.processPage = function () {
highlightNavigationLink();
$('span.timeago').timeago();
$('.timeago').timeago();
utils.makeNumbersHumanReadable($('.human-readable-number'));

@ -34,7 +34,7 @@ define('forum/account/favourites', ['forum/account/header', 'forum/infinitescrol
infinitescroll.parseAndTranslate('account/favourites', 'posts', {posts: posts}, function(html) {
$('.user-favourite-posts').append(html);
html.find('img').addClass('img-responsive');
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
callback();

@ -35,7 +35,7 @@ define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll'],
infinitescroll.parseAndTranslate('account/posts', 'posts', {posts: posts}, function(html) {
$('.user-favourite-posts').append(html);
html.find('img').addClass('img-responsive');
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
callback();

@ -116,7 +116,7 @@ define('forum/account/profile', ['forum/account/header', 'forum/infinitescroll']
infinitescroll.parseAndTranslate('account/profile', 'posts', {posts: posts}, function(html) {
$('.user-recent-posts .loading-indicator').before(html);
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
callback();
});

@ -33,7 +33,7 @@ define('forum/account/topics', ['forum/account/header', 'forum/infinitescroll'],
function onTopicsLoaded(topics, callback) {
infinitescroll.parseAndTranslate('account/topics', 'topics', {topics: topics}, function(html) {
$('#topics-container').append(html);
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
$(window).trigger('action:topics.loaded');

@ -31,7 +31,7 @@ define('forum/account/watched', ['forum/account/header', 'forum/infinitescroll']
function onTopicsLoaded(topics, callback) {
infinitescroll.parseAndTranslate('account/watched', 'topics', {topics: topics}, function(html) {
$('#topics-container').append(html);
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
$(window).trigger('action:topics.loaded');

@ -67,7 +67,7 @@ define('forum/categories', function() {
translator.translate(html, function(translatedHTML) {
translatedHTML = $(translatedHTML);
translatedHTML.find('img').addClass('img-responsive');
translatedHTML.find('span.timeago').timeago();
translatedHTML.find('.timeago').timeago();
callback(translatedHTML);
});
});

@ -228,7 +228,7 @@ define('forum/category', [
topic.hide().fadeIn('slow');
topic.find('span.timeago').timeago();
topic.find('.timeago').timeago();
app.createUserTooltips();
updateTopicCount();
@ -304,7 +304,7 @@ define('forum/category', [
if (typeof callback === 'function') {
callback();
}
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
});

@ -122,7 +122,7 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll'], function(S,
function onMessagesParsed(html) {
var newMessage = $(html);
newMessage.insertBefore($('.user-typing'));
newMessage.find('span.timeago').timeago();
newMessage.find('.timeago').timeago();
newMessage.find('img:not(".chat-user-image")').addClass('img-responsive');
Chats.scrollToBottom($('.expanded-chat .chat-content'));
}

@ -16,7 +16,7 @@ define('forum/notifications', function() {
});
});
$('span.timeago').timeago();
$('.timeago').timeago();
$('.notifications .delete').on('click', function() {
socket.emit('notifications.markAllRead', function(err) {

@ -125,7 +125,7 @@ define('forum/recent', ['forum/infinitescroll', 'composer'], function(infinitesc
$('#category-no-topics').remove();
$('#topics-container').append(html);
html.find('span.timeago').timeago();
html.find('.timeago').timeago();
app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
$(window).trigger('action:topics.loaded');

@ -224,7 +224,7 @@ define('forum/topic/posts', [
app.replaceSelfLinks(element.find('a'));
utils.addCommasToNumbers(element.find('.formatted-number'));
utils.makeNumbersHumanReadable(element.find('.human-readable-number'));
element.find('span.timeago').timeago();
element.find('.timeago').timeago();
element.find('.post-content img:not(.emoji)').addClass('img-responsive').each(function() {
var $this = $(this);
if (!$this.parent().is('a')) {

@ -406,7 +406,7 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
Chats.parseMessage(data, function(html) {
var message = $(html);
message.find('img:not(".chat-user-image")').addClass('img-responsive');
message.find('span.timeago').timeago();
message.find('.timeago').timeago();
message.insertBefore(typingNotif);
Chats.scrollToBottom(chatContent);

@ -79,7 +79,7 @@
}
$.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.' + languageCode + '.js').success(function() {
$('span.timeago').timeago();
$('.timeago').timeago();
}).fail(function() {
$.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.en.js');
});

@ -71,7 +71,7 @@
var widgetAreas = $('#content [widget-area]');
widgetAreas.find('img:not(.user-img)').addClass('img-responsive');
widgetAreas.find('span.timeago').timeago();
widgetAreas.find('.timeago').timeago();
widgetAreas.find('img[title].teaser-pic,img[title].user-img').each(function() {
$(this).tooltip({
placement: 'top',

Loading…
Cancel
Save