Bring back preparing a personal when you click on a user.

(imported from commit b9081cb77dafa590605ee3a0892b359cc7ac6d06)
This commit is contained in:
Jessica McKellar 2012-09-11 14:39:33 -04:00
parent 49af4ec000
commit f5e8f025b7
2 changed files with 13 additions and 10 deletions

View File

@ -26,7 +26,7 @@
</td> </td>
<td class="messagebox" onclick="select_zephyr({{id}})"> <td class="messagebox" onclick="select_zephyr({{id}})">
<img class="profile_picture" src="http://www.gravatar.com/avatar/{{gravatar_hash}}?d=identicon"/> <img class="profile_picture" src="http://www.gravatar.com/avatar/{{gravatar_hash}}?d=identicon"/>
<span class="zephyr_label_clickable zephyr_sender" onclick="prepare_personal('{{sender}}')"> <span class="zephyr_label_clickable zephyr_sender" onclick="prepare_huddle('{{sender}}')">
<span class="zephyr_sender_name">{{sender_name}}</span> <span class="zephyr_sender_email">{{sender_email}}</span> <span class="zephyr_sender_name">{{sender_name}}</span> <span class="zephyr_sender_email">{{sender_email}}</span>
<span class="zephyr_sender_username">{{sender}}</span> <span class="zephyr_sender_username">{{sender}}</span>
</span> </span>

View File

@ -210,13 +210,13 @@ function process_hotkey(code) {
return process_hotkey; return process_hotkey;
case 82: // 'r': respond to zephyr case 82: // 'r': respond to zephyr
$('.zephyr_compose').slideToggle('fast');
parent = get_selected_zephyr_row(); parent = get_selected_zephyr_row();
zephyr_class = parent.find("span.zephyr_class").text(); zephyr_class = parent.find("span.zephyr_class").text();
zephyr_huddle = parent.find("span.zephyr_huddle_recipient").text(); zephyr_huddle = parent.find("span.zephyr_huddle_recipient").text();
zephyr_personal = parent.find("span.zephyr_personal_recipient").text(); zephyr_personal = parent.find("span.zephyr_personal_recipient").text();
zephyr_instance = parent.find("span.zephyr_instance").text(); zephyr_instance = parent.find("span.zephyr_instance").text();
if (zephyr_class !== '') { if (zephyr_class !== '') {
$('.zephyr_compose').slideToggle('fast');
$('#zephyr-type-tabs a[href="#class-message"]').tab('show'); $('#zephyr-type-tabs a[href="#class-message"]').tab('show');
$("#class").val(zephyr_class); $("#class").val(zephyr_class);
$("#instance").val(zephyr_instance); $("#instance").val(zephyr_instance);
@ -224,10 +224,7 @@ function process_hotkey(code) {
$("#new_zephyr").select(); $("#new_zephyr").select();
} else if (zephyr_huddle !== '') { } else if (zephyr_huddle !== '') {
var recipients = parent.find("span.zephyr_huddle_recipients_list").text(); var recipients = parent.find("span.zephyr_huddle_recipients_list").text();
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show'); prepare_huddle(recipients);
$("#recipient").val(recipients);
$("#new_personal_zephyr").focus();
$("#new_personal_zephyr").select();
} else if (zephyr_personal !== '') { } else if (zephyr_personal !== '') {
// Until we allow sending zephyrs based on multiple meaningful // Until we allow sending zephyrs based on multiple meaningful
// representations of a user (name, username, email, etc.), just // representations of a user (name, username, email, etc.), just
@ -236,10 +233,7 @@ function process_hotkey(code) {
if (recipient === username) { // that is, we sent the original message if (recipient === username) { // that is, we sent the original message
recipient = parent.find("span.zephyr_personal_recipient").text(); recipient = parent.find("span.zephyr_personal_recipient").text();
} }
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show'); prepare_huddle(recipient);
$("#recipient").val(recipient);
$("#new_personal_zephyr").focus();
$("#new_personal_zephyr").select();
} }
return process_key_in_input; return process_key_in_input;
@ -333,6 +327,15 @@ function apply_view(element) {
} }
} }
function prepare_huddle(recipients) {
// Used for both personals and huddles.
$('.zephyr_compose').slideToggle('fast');
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show');
$("#recipient").val(recipients);
$("#new_personal_zephyr").focus();
$("#new_personal_zephyr").select();
}
function do_narrow(description, filter_function) { function do_narrow(description, filter_function) {
// Hide the messages temporarily, so the browser doesn't waste time // Hide the messages temporarily, so the browser doesn't waste time
// incrementally recalculating the layout. // incrementally recalculating the layout.