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 () { app.processPage = function () {
highlightNavigationLink(); highlightNavigationLink();
$('span.timeago').timeago(); $('.timeago').timeago();
utils.makeNumbersHumanReadable($('.human-readable-number')); 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) { infinitescroll.parseAndTranslate('account/favourites', 'posts', {posts: posts}, function(html) {
$('.user-favourite-posts').append(html); $('.user-favourite-posts').append(html);
html.find('img').addClass('img-responsive'); html.find('img').addClass('img-responsive');
html.find('span.timeago').timeago(); html.find('.timeago').timeago();
app.createUserTooltips(); app.createUserTooltips();
utils.makeNumbersHumanReadable(html.find('.human-readable-number')); utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
callback(); callback();

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save