Rename userinfo_popover -> actions_popover

(imported from commit fab5a44af1acaf93640a2f57ffc25b3e97f55d2e)
This commit is contained in:
Keegan McAllister 2013-02-08 17:03:33 -05:00
parent 73331f1e18
commit 520d7b1f97
9 changed files with 36 additions and 36 deletions

View File

@ -24,11 +24,11 @@
{% rawjstemplate "invite_subscription" %} {% rawjstemplate "invite_subscription" %}
</script> </script>
<script id="template_userinfo_popover_title" type="text/x-handlebars-template"> <script id="template_actions_popover_title" type="text/x-handlebars-template">
{% rawjstemplate "userinfo_popover_title" %} {% rawjstemplate "actions_popover_title" %}
</script> </script>
<script id="template_userinfo_popover_content" type="text/x-handlebars-template"> <script id="template_actions_popover_content" type="text/x-handlebars-template">
{% rawjstemplate "userinfo_popover_content" %} {% rawjstemplate "actions_popover_content" %}
</script> </script>
<script id="template_timeinfo_popover_content" type="text/x-handlebars-template"> <script id="template_timeinfo_popover_content" type="text/x-handlebars-template">
{% rawjstemplate "timeinfo_popover_content" %} {% rawjstemplate "timeinfo_popover_content" %}

View File

@ -1,5 +1,5 @@
{{! Client-side Mustache template for the contents of the little "userinfo" popup that shows up when you click on a name }} {{! Contents of the "message actions" popup }}
<ul class="nav nav-list userinfo_popover"> <ul class="nav nav-list actions_popover">
<li> <li>
<a onclick="respond_to_message();"> <a onclick="respond_to_message();">
<i class="icon-share-alt"></i> Reply to this {{#if is_stream}}stream{{else}}private message{{/if}} <i class="icon-share-alt"></i> Reply to this {{#if is_stream}}stream{{else}}private message{{/if}}

View File

@ -1,3 +1,3 @@
{{! Client-side Mustache template for the title of the little "userinfo" popup that shows up when you click on a name }} {{! Title of the "message actions" popup }}
<span title="{{sender_full_name}}"><b>{{sender_full_name}}</b></span><br /> <span title="{{sender_full_name}}"><b>{{sender_full_name}}</b></span><br />
<span class='my_email' title="{{sender_email}}">{{sender_email}}</span> <span class='my_email' title="{{sender_email}}">{{sender_email}}</span>

View File

@ -47,20 +47,20 @@
class="message_row{{^is_stream}} private-message{{/is_stream}}{{#include_sender}} include-sender{{/include_sender}}"> class="message_row{{^is_stream}} private-message{{/is_stream}}{{#include_sender}} include-sender{{/include_sender}}">
<td class="message_picture"> <td class="message_picture">
{{#include_sender}} {{#include_sender}}
<img class="img-rounded profile_picture user_info_hover" <img class="img-rounded profile_picture actions_hover"
src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30?stamp={{stamp}}"/> src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30?stamp={{stamp}}"/>
{{/include_sender}} {{/include_sender}}
</td> </td>
<td class="pointer"><p></p></td> <td class="pointer"><p></p></td>
<td class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}"> <td class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}">
{{#include_sender}} {{#include_sender}}
<span class="message_sender user_info_hover"> <span class="message_sender actions_hover">
<img class="inline_profile_picture message_body_gravatar img-rounded" src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30?stamp={{stamp}}"/> <img class="inline_profile_picture message_body_gravatar img-rounded" src="https://secure.gravatar.com/avatar/{{gravatar_hash}}?d=identicon&s=30?stamp={{stamp}}"/>
<span class="sender_name">{{sender_full_name}}</span> <span class="sender_name">{{sender_full_name}}</span>
<span class="sender_email invisible">{{sender_email}}</span> <span class="sender_email invisible">{{sender_email}}</span>
</span> </span>
{{/include_sender}} {{/include_sender}}
<span class="message_time user_info_hover" <span class="message_time actions_hover"
title="{{full_date_str}}">{{{timestr}}}</span> title="{{full_date_str}}">{{{timestr}}}</span>
<div class="message_content">{{{content}}}</div> <div class="message_content">{{{content}}}</div>
</td> </td>

View File

@ -1,7 +1,7 @@
{{! Client-side Mustache template for the contents of the little "timeinfo" popup that shows up when you click on a time }} {{! Client-side Mustache template for the contents of the little "timeinfo" popup that shows up when you click on a time }}
<ul class="nav nav-list userinfo_popover"> <ul class="nav nav-list actions_popover">
<li> <li>
<a onclick="ui.hide_userinfo_popover(); narrow.target({{id}}); narrow.activate([]);"> <a onclick="ui.hide_actions_popover(); narrow.target({{id}}); narrow.activate([]);">
<i class="icon-time"></i> Narrow to messages around this time <i class="icon-time"></i> Narrow to messages around this time
</a> </a>
</li> </li>

View File

@ -103,9 +103,9 @@ function process_hotkey(e) {
select_message(rows.last_visible(), {then_scroll: false}); select_message(rows.last_visible(), {then_scroll: false});
} }
return false; return false;
case 27: // Esc: close userinfo popup, cancel compose, clear a find, or un-narrow case 27: // Esc: close actions popup, cancel compose, clear a find, or un-narrow
if (ui.userinfo_currently_popped()) { if (ui.actions_currently_popped()) {
ui.hide_userinfo_popover(); ui.hide_actions_popover();
} else if (compose.composing()) { } else if (compose.composing()) {
compose.cancel(); compose.cancel();
} else { } else {

View File

@ -12,7 +12,7 @@ $(function () {
// Compile Handlebars templates. // Compile Handlebars templates.
$.each(['message', 'subscription', $.each(['message', 'subscription',
'userinfo_popover_title', 'userinfo_popover_content', 'actions_popover_title', 'actions_popover_content',
'timeinfo_popover_content', 'invite_subscription', 'new_stream_users'], 'timeinfo_popover_content', 'invite_subscription', 'new_stream_users'],
function (index, name) { function (index, name) {
templates[name] = Handlebars.compile($('#template_'+name).html()); templates[name] = Handlebars.compile($('#template_'+name).html());

View File

@ -382,16 +382,16 @@ exports.show_api_key_box = function () {
$("#api_key_button_box").hide(); $("#api_key_button_box").hide();
}; };
var current_userinfo_popover_elem; var current_actions_popover_elem;
function show_userinfo_popover(element, id) { function show_actions_popover(element, id) {
select_message_by_id(id); select_message_by_id(id);
var elt = $(element); var elt = $(element);
if (elt.data('popover') === undefined) { if (elt.data('popover') === undefined) {
var content, message = message_dict[id]; var content, message = message_dict[id];
if (elt.hasClass("message_sender") || elt.hasClass("profile_picture")) { if (elt.hasClass("message_sender") || elt.hasClass("profile_picture")) {
elt.popover({placement: "bottom", elt.popover({placement: "bottom",
title: templates.userinfo_popover_title(message), title: templates.actions_popover_title(message),
content: templates.userinfo_popover_content(message), content: templates.actions_popover_content(message),
trigger: "manual" trigger: "manual"
}); });
} else if (elt.hasClass("message_time")) { } else if (elt.hasClass("message_time")) {
@ -406,19 +406,19 @@ function show_userinfo_popover(element, id) {
}); });
} }
elt.popover("show"); elt.popover("show");
current_userinfo_popover_elem = elt; current_actions_popover_elem = elt;
} }
} }
exports.hide_userinfo_popover = function () { exports.hide_actions_popover = function () {
if (ui.userinfo_currently_popped()) { if (ui.actions_currently_popped()) {
current_userinfo_popover_elem.popover("destroy"); current_actions_popover_elem.popover("destroy");
current_userinfo_popover_elem = undefined; current_actions_popover_elem = undefined;
} }
}; };
exports.userinfo_currently_popped = function () { exports.actions_currently_popped = function () {
return current_userinfo_popover_elem !== undefined; return current_actions_popover_elem !== undefined;
}; };
exports.safari_composebox_workaround = function () { exports.safari_composebox_workaround = function () {
@ -753,7 +753,7 @@ $(function () {
invite.initialize(); invite.initialize();
$("body").bind('click', function () { $("body").bind('click', function () {
ui.hide_userinfo_popover(); ui.hide_actions_popover();
}); });
$("#main_div").on("click", ".messagebox", function (e) { $("#main_div").on("click", ".messagebox", function (e) {
@ -790,32 +790,32 @@ $(function () {
hide_email(); hide_email();
}); });
$("#main_div").on("mouseover", ".user_info_hover", function (e) { $("#main_div").on("mouseover", ".actions_hover", function (e) {
var row = $(this).closest(".message_row"); var row = $(this).closest(".message_row");
show_email(row); show_email(row);
row.find(".sender_name").addClass("sender_hovered"); row.find(".sender_name").addClass("sender_hovered");
}); });
$("#main_div").on("mouseout", ".user_info_hover", function (e) { $("#main_div").on("mouseout", ".actions_hover", function (e) {
var row = $(this).closest(".message_row"); var row = $(this).closest(".message_row");
hide_email(); hide_email();
row.find(".sender_name").removeClass("sender_hovered"); row.find(".sender_name").removeClass("sender_hovered");
}); });
$("#main_div").on("click", ".user_info_hover", function (e) { $("#main_div").on("click", ".actions_hover", function (e) {
var row = $(this).closest(".message_row"); var row = $(this).closest(".message_row");
e.stopPropagation(); e.stopPropagation();
var last_popover_elem = current_userinfo_popover_elem; var last_popover_elem = current_actions_popover_elem;
ui.hide_userinfo_popover(); ui.hide_actions_popover();
if (last_popover_elem === undefined if (last_popover_elem === undefined
|| last_popover_elem.get()[0] !== this) { || last_popover_elem.get()[0] !== this) {
// Only show the popover if either no popover is // Only show the popover if either no popover is
// currently up or if the user has clicked on a different // currently up or if the user has clicked on a different
// user_info_hover element than the one that deployed the // actions_hover element than the one that deployed the
// last popover. That is, we want it to be the case that // last popover. That is, we want it to be the case that
// a user can dismiss a popover by clicking on the same // a user can dismiss a popover by clicking on the same
// element that caused the popover // element that caused the popover
show_userinfo_popover(this, rows.id(row)); show_actions_popover(this, rows.id(row));
} }
}); });

View File

@ -635,7 +635,7 @@ table.floating_recipient {
height: 20px; height: 20px;
} }
.userinfo_popover a { .actions_popover a {
cursor: pointer; cursor: pointer;
} }