diff --git a/static/js/compose.js b/static/js/compose.js index 83b112d904..2729daf8c0 100644 --- a/static/js/compose.js +++ b/static/js/compose.js @@ -252,7 +252,7 @@ exports.start = function (msg_type, opts) { update_fade(); exports.decorate_stream_bar(opts.stream); - $(document).trigger($.Event('compose_started.zephyr', opts)); + $(document).trigger($.Event('compose_started.zulip', opts)); }; function abort_xhr () { @@ -273,7 +273,7 @@ exports.cancel = function () { if (message_snapshot !== undefined) { $('#restore-draft').show(); } - $(document).trigger($.Event('compose_canceled.zephyr')); + $(document).trigger($.Event('compose_canceled.zulip')); respond_to_cursor = false; }; @@ -418,7 +418,7 @@ exports.finish = function () { send_message(); // TODO: Do we want to fire the event even if the send failed due // to a server-side error? - $(document).trigger($.Event('compose_finished.zephyr')); + $(document).trigger($.Event('compose_finished.zulip')); return true; }; diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 9d7cf6111c..6b8b4f1e6d 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -23,7 +23,7 @@ exports.changehash = function (newhash) { if (changing_hash) { return; } - $(document).trigger($.Event('hashchange.zephyr')); + $(document).trigger($.Event('hashchange.zulip')); expected_hash = newhash; // Some browsers reset scrollTop when changing the hash to "", // so we save and restore it. @@ -99,7 +99,7 @@ function do_hashchange() { return false; } - $(document).trigger($.Event('hashchange.zephyr')); + $(document).trigger($.Event('hashchange.zulip')); // NB: In Firefox, window.location.hash is URI-decoded. // Even if the URL bar says #%41%42%43%44, the value here will diff --git a/static/js/message_edit.js b/static/js/message_edit.js index e57c75c725..07a18b259c 100644 --- a/static/js/message_edit.js +++ b/static/js/message_edit.js @@ -104,7 +104,7 @@ exports.maybe_show_edit = function (row, id) { } }; -$(document).on('narrow_deactivated.zephyr', function (event) { +$(document).on('narrow_deactivated.zulip', function (event) { $.each(currently_editing_messages, function (idx, elem) { if (current_msg_list.get(idx) !== undefined) { var row = rows.get(idx, current_msg_list.table_name); diff --git a/static/js/message_list.js b/static/js/message_list.js index eaa4baf1be..a43c6f176a 100644 --- a/static/js/message_list.js +++ b/static/js/message_list.js @@ -137,7 +137,7 @@ MessageList.prototype = { this._maybe_rerender(); } - $(document).trigger($.Event('message_selected.zephyr', opts)); + $(document).trigger($.Event('message_selected.zulip', opts)); }, selected_message: function MessageList_selected_message() { @@ -706,7 +706,7 @@ MessageList.prototype = { // doing something. Be careful, though, if you try to capture // mousemove, then you will have to contend with the autoscroll // itself generating mousemove events. -$(document).on('message_selected.zephyr hashchange.zephyr mousewheel', function (event) { +$(document).on('message_selected.zulip hashchange.zulip mousewheel', function (event) { viewport.stop_auto_scrolling(); }); }()); diff --git a/static/js/metrics.js b/static/js/metrics.js index cb2ff7f20e..0cf0e0d5f6 100644 --- a/static/js/metrics.js +++ b/static/js/metrics.js @@ -24,7 +24,7 @@ mixpanel.register({user: page_params.email, realm: page_params.domain}); send_resize_event(); $(function () { - $(document).on('compose_started.zephyr', function (event) { + $(document).on('compose_started.zulip', function (event) { if (! include_in_sample()) { return; } @@ -32,7 +32,7 @@ $(function () { mixpanel.track('compose started', {type: event.message_type, trigger: event.trigger}); }); - $(document).on('narrow_activated.zephyr', function (event) { + $(document).on('narrow_activated.zulip', function (event) { if (! include_in_sample()) { return; } diff --git a/static/js/narrow.js b/static/js/narrow.js index e01705fae2..1b853ba39f 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -487,7 +487,7 @@ exports.activate = function (operators, opts) { compose.update_recipient_on_narrow(); compose.update_faded_messages(); - $(document).trigger($.Event('narrow_activated.zephyr', {msg_list: narrowed_msg_list, + $(document).trigger($.Event('narrow_activated.zulip', {msg_list: narrowed_msg_list, filter: current_filter, trigger: opts.trigger})); }; @@ -585,7 +585,7 @@ exports.deactivate = function () { hashchange.save_narrow(); compose.update_faded_messages(); - $(document).trigger($.Event('narrow_deactivated.zephyr', {msg_list: current_msg_list})); + $(document).trigger($.Event('narrow_deactivated.zulip', {msg_list: current_msg_list})); }; exports.restore_home_state = function () { diff --git a/static/js/popovers.js b/static/js/popovers.js index e02968e900..10b90fa61d 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -367,7 +367,7 @@ exports.register_click_handlers = function () { if (! $('#subscriptions').hasClass('active')) { // Go to streams page and once it loads, expand the relevant // stream's settings. - $(document).one('subs_page_loaded.zephyr', function (event) { + $(document).one('subs_page_loaded.zulip', function (event) { subs.show_settings_for(stream); }); ui.change_tab_to('#subscriptions'); diff --git a/static/js/reload.js b/static/js/reload.js index ffa2187f78..8a3656d738 100644 --- a/static/js/reload.js +++ b/static/js/reload.js @@ -141,28 +141,28 @@ exports.initiate = function (options) { idle_control.cancel(); idle_control = $(document).idle({'idle': home_timeout, 'onIdle': reload_from_idle}); - $(document).off('compose_canceled.zephyr compose_finished.zephyr', + $(document).off('compose_canceled.zulip compose_finished.zulip', compose_done_handler); - $(document).on('compose_started.zephyr', compose_started_handler); + $(document).on('compose_started.zulip', compose_started_handler); }; compose_started_handler = function () { idle_control.cancel(); idle_control = $(document).idle({'idle': composing_timeout, 'onIdle': reload_from_idle}); - $(document).off('compose_started.zephyr', compose_started_handler); - $(document).on('compose_canceled.zephyr compose_finished.zephyr', + $(document).off('compose_started.zulip', compose_started_handler); + $(document).on('compose_canceled.zulip compose_finished.zulip', compose_done_handler); }; if (compose.composing()) { idle_control = $(document).idle({'idle': composing_timeout, 'onIdle': reload_from_idle}); - $(document).on('compose_canceled.zephyr compose_finished.zephyr', + $(document).on('compose_canceled.zulip compose_finished.zulip', compose_done_handler); } else { idle_control = $(document).idle({'idle': home_timeout, 'onIdle': reload_from_idle}); - $(document).on('compose_started.zephyr', compose_started_handler); + $(document).on('compose_started.zulip', compose_started_handler); } }; diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 3be1aebf6f..826c8bd0b4 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -261,7 +261,7 @@ exports.update_dom_with_unread_counts = function (counts) { }; $(function () { - $(document).on('narrow_activated.zephyr', function (event) { + $(document).on('narrow_activated.zulip', function (event) { $("ul.filters li").removeClass('active-filter active-subject-filter'); $('.expanded_subjects').remove(); @@ -293,13 +293,13 @@ $(function () { } }); - $(document).on('narrow_deactivated.zephyr', function (event) { + $(document).on('narrow_deactivated.zulip', function (event) { $("ul.filters li").removeClass('active-filter active-subject-filter'); $("ul.expanded_subjects").remove(); $("#global_filters li[data-name='home']").addClass('active-filter'); }); - $(document).on('sub_obj_created.zephyr', function (event) { + $(document).on('sub_obj_created.zulip', function (event) { if (event.sub.subscribed) { var stream_name = event.sub.name; var li = add_narrow_filter(stream_name, "stream"); @@ -309,7 +309,7 @@ $(function () { } }); - $(document).on('subscription_add_done.zephyr', function (event) { + $(document).on('subscription_add_done.zulip', function (event) { var stream_name = event.sub.name; var li = add_narrow_filter(stream_name, "stream"); if (li) { @@ -318,7 +318,7 @@ $(function () { exports.sort_narrow_list(); }); - $(document).on('subscription_remove_done.zephyr', function (event) { + $(document).on('subscription_remove_done.zulip', function (event) { var stream_name = event.sub.name; exports.remove_narrow_filter(stream_name, 'stream'); // We need to make sure we resort if the removed sub gets added again diff --git a/static/js/subs.js b/static/js/subs.js index ae3d823612..9f92a1b563 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -317,7 +317,7 @@ function create_sub(stream_name, attrs) { mark_color_used(sub.color); add_sub(stream_name, sub); - $(document).trigger($.Event('sub_obj_created.zephyr', {sub: sub})); + $(document).trigger($.Event('sub_obj_created.zulip', {sub: sub})); return sub; } @@ -398,7 +398,7 @@ function mark_subscribed(stream_name, attrs) { // need its unread counts re-calculated process_loaded_for_unread(all_msg_list.all()); - $(document).trigger($.Event('subscription_add_done.zephyr', {sub: sub})); + $(document).trigger($.Event('subscription_add_done.zulip', {sub: sub})); } function mark_unsubscribed(stream_name) { @@ -435,14 +435,14 @@ function mark_unsubscribed(stream_name) { current_msg_list.update_trailing_bookend(); } - $(document).trigger($.Event('subscription_remove_done.zephyr', {sub: sub})); + $(document).trigger($.Event('subscription_remove_done.zulip', {sub: sub})); } $(function () { - $(document).on('subscription_add.zephyr', function (e) { + $(document).on('subscription_add.zulip', function (e) { mark_subscribed(e.subscription.name, e.subscription); }); - $(document).on('subscription_remove.zephyr', function (e) { + $(document).on('subscription_remove.zulip', function (e) { mark_unsubscribed(e.subscription.name); }); @@ -628,7 +628,7 @@ exports.setup_page = function () { $('#subscriptions_table').append(rendered); util.destroy_loading_indicator($('#subs_page_loading_indicator')); - $(document).trigger($.Event('subs_page_loaded.zephyr')); + $(document).trigger($.Event('subs_page_loaded.zulip')); } function failed_listing(xhr, error) { diff --git a/static/js/tab_bar.js b/static/js/tab_bar.js index 82b05d70ef..7915a7ad30 100644 --- a/static/js/tab_bar.js +++ b/static/js/tab_bar.js @@ -131,10 +131,10 @@ function build_tab_bar() { } $(function () { - $(document).on('narrow_activated.zephyr', function (event) { + $(document).on('narrow_activated.zulip', function (event) { build_tab_bar(); }); - $(document).on('narrow_deactivated.zephyr', function (event) { + $(document).on('narrow_deactivated.zulip', function (event) { build_tab_bar(); }); diff --git a/static/js/ui.js b/static/js/ui.js index 965f09ba3d..7944416ec4 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -829,7 +829,7 @@ $(function () { // If the streams page is shown by clicking directly on the "Streams" // link (in the gear menu), then focus the new stream textbox. subs_link.on('click', function (e) { - $(document).one('subs_page_loaded.zephyr', function (e) { + $(document).one('subs_page_loaded.zulip', function (e) { $('#create_stream_name').focus().select(); }); }); @@ -1117,7 +1117,7 @@ $(function () { $(document.body).removeClass('window_blurred'); }); - $(document).on('message_selected.zephyr', function (event) { + $(document).on('message_selected.zulip', function (event) { if (current_msg_list !== event.msg_list) { return; } diff --git a/static/js/zephyr.js b/static/js/zephyr.js index 4a83ffc699..c759020df1 100644 --- a/static/js/zephyr.js +++ b/static/js/zephyr.js @@ -453,7 +453,7 @@ $(function () { onIdle: send_pointer_update, keepTracking: true}); - $(document).on('message_selected.zephyr', function (event) { + $(document).on('message_selected.zulip', function (event) { // Narrowing is a temporary view on top of the home view and // doesn't affect your pointer in the home view. @@ -836,12 +836,12 @@ function get_updates_success(data) { case 'subscriptions': if (event.op === 'add') { $.each(event.subscriptions, function (index, subscription) { - $(document).trigger($.Event('subscription_add.zephyr', + $(document).trigger($.Event('subscription_add.zulip', {subscription: subscription})); }); } else if (event.op === 'remove') { $.each(event.subscriptions, function (index, subscription) { - $(document).trigger($.Event('subscription_remove.zephyr', + $(document).trigger($.Event('subscription_remove.zulip', {subscription: subscription})); }); } else if (event.op === 'update') {