diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index c4acb5c06e..10f5c33ee2 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -53,13 +53,13 @@ exports.fetch = function () { }); }; -function add_for_send_success(stream_name, prompt_button) { +function subscribe_for_send_success(stream_name, prompt_button) { add_to_stream_list(stream_name); compose.finish(); prompt_button.stop(true).fadeOut(500); } -exports.add_for_send = function (stream, prompt_button) { +exports.subscribe_for_send = function (stream, prompt_button) { $.ajax({ type: 'POST', url: '/json/subscriptions/add', @@ -67,14 +67,14 @@ exports.add_for_send = function (stream, prompt_button) { dataType: 'json', timeout: 10*60*1000, // 10 minutes in ms success: function (response) { - add_for_send_success(response.data, prompt_button); + subscribe_for_send_success(response.data, prompt_button); }, error: function (xhr, error_type, exn) { if ($.parseJSON(xhr.responseText).msg === "Subscription already exists") { // If we're already subscribed, the issue here was // actually that the client didn't know we were // already subscribed -- so just send the message. - add_for_send_success(stream, prompt_button); + subscribe_for_send_success(stream, prompt_button); } else { report_error("Unable to subscribe", xhr, $("#home-error")); } diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index d12d1dc337..cdd534a694 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -309,12 +309,12 @@ $(function () { // Prepare the click handler for subbing to a new stream to which // you have composed a message. $('#create-it').click(function () { - subs.add_for_send(compose.stream_name(), $('#stream-dne')); + subs.subscribe_for_send(compose.stream_name(), $('#stream-dne')); }); // Prepare the click handler for subbing to an existing stream. $('#sub-it').click(function () { - subs.add_for_send(compose.stream_name(), $('#stream-nosub')); + subs.subscribe_for_send(compose.stream_name(), $('#stream-nosub')); }); var throttled_scrollhandler = $.throttle(50, function(e) {