Rename select_zephyr(_by_id) to select_message_*.

(imported from commit 91619adf0e610017fbef52d2796020cb16537653)
This commit is contained in:
Tim Abbott 2012-10-09 17:51:45 -04:00
parent 4b032b8e42
commit f66124cbe2
5 changed files with 14 additions and 14 deletions

View File

@ -40,7 +40,7 @@ var globals =
+ ' message_array message_dict'
+ ' status_classes clear_table add_to_table instance_list'
+ ' keep_pointer_in_view respond_to_zephyr'
+ ' select_zephyr select_zephyr_by_id'
+ ' select_message select_message_by_id'
+ ' scroll_to_selected select_and_show_by_id'
+ ' selected_zephyr selected_zephyr_id'
+ ' at_top_of_viewport at_bottom_of_viewport'

View File

@ -23,23 +23,23 @@
<tr class="recipient_row">
<td colspan="2"
class="message_label_clickable zephyr_newstyle_class"
onclick="select_zephyr_by_id({{id}}); narrow_class();"
onclick="select_message_by_id({{id}}); narrow_class();"
title="{{display_recipient}}">{{display_recipient}}</td>
<td class="message_label_clickable zephyr_newstyle_instance"
onclick="select_zephyr_by_id({{id}}); narrow_instance();"
onclick="select_message_by_id({{id}}); narrow_instance();"
title="{{instance}}">{{instance}}</td>
</tr>
{{else}}
<tr class="recipient_row">
<td colspan="3" class="message_label_clickable zephyr_newstyle_pm"
onclick="select_zephyr_by_id({{id}}); narrow_by_recipient();"
onclick="select_message_by_id({{id}}); narrow_by_recipient();"
title="Huddle with {{display_reply_to}}">Huddle with {{display_reply_to}}</td>
</tr>
{{/if}}
{{/include_recipient}}
<tr zid="{{id}}" id="{{dom_id}}"
class="zephyr_row{{^is_class}} personal-message{{/is_class}}"
onclick="select_zephyr_by_id({{id}});">
onclick="select_message_by_id({{id}});">
<td class="zephyr_picture">
{{#include_sender}}
<img class="img-rounded profile_picture"

View File

@ -38,7 +38,7 @@ function process_hotkey(code) {
if (directional_hotkeys.hasOwnProperty(code)) {
next_message = directional_hotkeys[code](selected_zephyr);
if (next_message.length !== 0) {
select_zephyr(next_message, true);
select_message(next_message, true);
}
if ((next_message.length === 0) && (code === 40 || code === 106)) {
// At the last zephyr, scroll to the bottom so we have
@ -65,13 +65,13 @@ function process_hotkey(code) {
case 33: // Page Up
keep_pointer_in_view();
if (at_top_of_viewport()) {
select_zephyr(get_first_visible(), false);
select_message(get_first_visible(), false);
}
return false; // We want the browser to actually page up and down
case 34: // Page Down
keep_pointer_in_view();
if (at_bottom_of_viewport()) {
select_zephyr(get_last_visible(), false);
select_message(get_last_visible(), false);
}
return false;
case 27: // Esc: hide compose pane

View File

@ -8,7 +8,7 @@ function register_onclick(zephyr_row, zephyr_id) {
zephyr_row.find(".messagebox").click(function (e) {
if (!(clicking && mouse_moved)) {
// Was a click (not a click-and-drag).
select_zephyr_by_id(zephyr_id);
select_message_by_id(zephyr_id);
respond_to_zephyr();
}
mouse_moved = false;

View File

@ -142,18 +142,18 @@ function respond_to_zephyr(reply_type) {
}
// Called by mouseover etc.
function select_zephyr_by_id(zephyr_id) {
function select_message_by_id(zephyr_id) {
if (zephyr_id === selected_zephyr_id) {
return;
}
select_zephyr(get_zephyr_row(zephyr_id), false);
select_message(get_zephyr_row(zephyr_id), false);
}
// Called on page load and when we [un]narrow.
// Forces a call to select_zephyr even if the id has not changed,
// Forces a call to select_message even if the id has not changed,
// because the visible table might have.
function select_and_show_by_id(zephyr_id) {
select_zephyr(get_zephyr_row(zephyr_id), true);
select_message(get_zephyr_row(zephyr_id), true);
}
function update_selected_zephyr(zephyr) {
@ -172,7 +172,7 @@ function update_selected_zephyr(zephyr) {
selected_zephyr = zephyr;
}
function select_zephyr(next_message, scroll_to) {
function select_message(next_message, scroll_to) {
var viewport = $(window);
/* If the zephyr exists but is hidden, try to find the next visible one. */