Fixed timago tooltip in conversations

Fixed timeago errors

Added cucumber stuff to test timeago at inbox

Show localized date/time in tooltip

Remove title attributes
This commit is contained in:
Tamas Laszlo Fabian 2013-06-25 11:42:58 +02:00 committed by Jonne Haß
parent af332b6cab
commit 37505c5ece
5 changed files with 38 additions and 7 deletions

View file

@ -10,11 +10,28 @@ $(document).ready(function(){
$("html").scrollTop($('#first_unread').offset().top-45); $("html").scrollTop($('#first_unread').offset().top-45);
} }
$('time.timeago').each(function(i,e) {
var jqe = $(e);
jqe.attr('data-original-title', new Date(jqe.attr('datetime')).toLocaleString());
jqe.attr('title', '');
});
$('.timeago').tooltip();
$('.timeago').timeago();
$('time.timeago').each(function(i,e) {
var jqe = $(e);
jqe.attr('title', '');
});
$('.conversation-wrapper').live('click', function(){ $('.conversation-wrapper').live('click', function(){
$.getScript($(this).data('conversation-path'), function() { var conversation_path = $(this).data('conversation-path');
$.getScript(conversation_path, function() {
Diaspora.page.directionDetector.updateBinds(); Diaspora.page.directionDetector.updateBinds();
}); });
history.pushState(null, "", this.href);
history.pushState(null, "", conversation_path);
var conv = $(this).children('.stream_element'), var conv = $(this).children('.stream_element'),
cBadge = $("#message_inbox_badge .badge_count"); cBadge = $("#message_inbox_badge .badge_count");
@ -31,7 +48,6 @@ $(document).ready(function(){
}); });
} }
jQuery("abbr.timeago").timeago();
return false; return false;
}); });

View file

@ -15,7 +15,7 @@
:unread_count => unread_counts[conversation.id].to_i }) :unread_count => unread_counts[conversation.id].to_i })
.last_author .last_author
.timestamp %time.timeago.timestamp{:datetime => conversation.updated_at.iso8601}
= t('ago', :time => time_ago_in_words(conversation.updated_at)) = t('ago', :time => time_ago_in_words(conversation.updated_at))
- if authors[conversation.id].present? - if authors[conversation.id].present?

View file

@ -4,6 +4,19 @@ $(".stream_element", "#conversation_inbox").removeClass('selected');
$(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").addClass('selected'); $(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").addClass('selected');
$(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").find(".unread_message_count").remove() $(".stream_element[data-guid='<%= @conversation.id %>']", "#conversation_inbox").find(".unread_message_count").remove()
$("html").scrollTop($('#first_unread').offset().top-45); $('time.timeago').each(function(i,e) {
var jqe = $(e);
jqe.attr('data-original-title', new Date(jqe.attr('datetime')).toLocaleString());
});
Diaspora.page.timeAgo.updateTimeAgo(); if ($('#first_unread') > 0) {
$("html").scrollTop($('#first_unread').offset().top-45);
}
$(".timeago").tooltip();
$("time.timeago").timeago();
$('time.timeago').each(function(i,e) {
var jqe = $(e);
jqe.attr('title', '');
});

View file

@ -8,7 +8,7 @@
= person_image_link(message.author, :size => :thumb_small) = person_image_link(message.author, :size => :thumb_small)
.bd .bd
= person_link(message.author, :class => 'author from') = person_link(message.author, :class => 'author from')
%time.timeago{:datetime => message.created_at} %time.timeago{:datetime => message.created_at.iso8601}
= t('ago', :time => time_ago_in_words(message.created_at)) = t('ago', :time => time_ago_in_words(message.created_at))
%div{ :class => direction_for(message.text) } %div{ :class => direction_for(message.text) }

View file

@ -14,6 +14,8 @@ Feature: private messages
Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome" Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome"
Then I should see "Greetings" within "#conversation_inbox" Then I should see "Greetings" within "#conversation_inbox"
And I should see "Greetings" within "#conversation_show" And I should see "Greetings" within "#conversation_show"
And I should see "less than a minute ago" within "#conversation_inbox"
And I should see "less than a minute ago" within "#conversation_show"
And I click on selector "a.participants_link" And I click on selector "a.participants_link"
Then I should see the participants popover Then I should see the participants popover
And I should see "Alice Awesome" as part of the participants popover And I should see "Alice Awesome" as part of the participants popover