From 9a359c8d05e407f5bf33eb5563177e3daa17e045 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 10 Oct 2012 10:17:58 -0400 Subject: [PATCH] Rename selected_zephyr_* to selected_message_* (imported from commit 04025c4472b893ce12764775e10c1dc89850b639) --- tools/jslint/check-all.js | 2 +- zephyr/static/js/hotkey.js | 2 +- zephyr/static/js/zephyr.js | 20 ++++++++++---------- zephyr/static/styles/zephyr.css | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index b61a156263..7b7bc9f865 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -42,7 +42,7 @@ var globals = + ' keep_pointer_in_view respond_to_zephyr' + ' select_message select_message_by_id' + ' scroll_to_selected select_and_show_by_id' - + ' selected_zephyr selected_message_id' + + ' selected_message selected_message_id' + ' at_top_of_viewport at_bottom_of_viewport' ; diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index b2080a5e7d..fff6c18b31 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -36,7 +36,7 @@ function process_hotkey(code) { } if (directional_hotkeys.hasOwnProperty(code)) { - next_message = directional_hotkeys[code](selected_zephyr); + next_message = directional_hotkeys[code](selected_message); if (next_message.length !== 0) { select_message(next_message, true); } diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 92e814867e..d83784d35d 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -45,7 +45,7 @@ $(function () { }); var selected_message_id = -1; /* to be filled in on document.ready */ -var selected_zephyr; // = get_zephyr_row(selected_message_id) +var selected_message; // = get_zephyr_row(selected_message_id) var received = { first: -1, last: -1, @@ -83,14 +83,14 @@ function recenter_view(zephyr) { // below_view_threshold must also change. var viewport = $(window); if (above_view_threshold(zephyr)) { - viewport.scrollTop(selected_zephyr.offset().top - viewport.height() / 2); + viewport.scrollTop(selected_message.offset().top - viewport.height() / 2); } else if (below_view_threshold(zephyr)) { - viewport.scrollTop(selected_zephyr.offset().top - viewport.height() / 5); + viewport.scrollTop(selected_message.offset().top - viewport.height() / 5); } } function scroll_to_selected() { - recenter_view(selected_zephyr); + recenter_view(selected_message); } function get_huddle_recipient(zephyr) { @@ -156,9 +156,9 @@ function select_and_show_by_id(zephyr_id) { select_message(get_zephyr_row(zephyr_id), true); } -function update_selected_zephyr(zephyr) { - $('.selected_zephyr').removeClass('selected_zephyr'); - zephyr.addClass('selected_zephyr'); +function update_selected_message(zephyr) { + $('.selected_message').removeClass('selected_message'); + zephyr.addClass('selected_message'); var new_selected_id = get_id(zephyr); if (!narrowed && new_selected_id !== selected_message_id) { @@ -169,7 +169,7 @@ function update_selected_zephyr(zephyr) { $.post("update", {pointer: new_selected_id}); } selected_message_id = new_selected_id; - selected_zephyr = zephyr; + selected_message = zephyr; } function select_message(next_message, scroll_to) { @@ -189,7 +189,7 @@ function select_message(next_message, scroll_to) { return false; } - update_selected_zephyr(next_message); + update_selected_message(next_message); if (scroll_to) { recenter_view(next_message); @@ -529,5 +529,5 @@ function keep_pointer_in_view() { // above) next_message = get_next_visible(next_message); } - update_selected_zephyr(next_message); + update_selected_message(next_message); } diff --git a/zephyr/static/styles/zephyr.css b/zephyr/static/styles/zephyr.css index 284ee2e990..f6e2014e67 100644 --- a/zephyr/static/styles/zephyr.css +++ b/zephyr/static/styles/zephyr.css @@ -43,7 +43,7 @@ td.pointer { padding-top: 10px; } -.selected_zephyr .pointer { +.selected_message .pointer { background-color: blue; }