mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 03:11:54 +00:00
Rename s/class/stream/ in code local to various js files.
(imported from commit c441f9d7d4155ff3c4b171a2a4a3db4ffbb60ac4)
This commit is contained in:
@@ -27,14 +27,14 @@ function compose_button() {
|
|||||||
|
|
||||||
function toggle_compose() {
|
function toggle_compose() {
|
||||||
if ($("#message-type-tabs li.active").find("a[href=#stream-message]").length !== 0) {
|
if ($("#message-type-tabs li.active").find("a[href=#stream-message]").length !== 0) {
|
||||||
// In class tab, switch to personals.
|
// In stream tab, switch to personals.
|
||||||
show_compose('personal', $("#huddle_recipient"));
|
show_compose('personal', $("#huddle_recipient"));
|
||||||
} else {
|
} else {
|
||||||
show_compose('stream', $("#stream"));
|
show_compose('stream', $("#stream"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composing_class_message() {
|
function composing_stream_message() {
|
||||||
return $("#stream-message").is(":visible");
|
return $("#stream-message").is(":visible");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,16 +75,16 @@ function submit_buttons() {
|
|||||||
return $('#compose').find('input[type="submit"]');
|
return $('#compose').find('input[type="submit"]');
|
||||||
}
|
}
|
||||||
|
|
||||||
// *Synchronously* check if a class exists.
|
// *Synchronously* check if a stream exists.
|
||||||
// If not, displays an error and returns false.
|
// If not, displays an error and returns false.
|
||||||
function check_class_for_send(stream_name) {
|
function check_stream_for_send(stream_name) {
|
||||||
var okay = true;
|
var okay = true;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "subscriptions/exists/" + stream_name,
|
url: "subscriptions/exists/" + stream_name,
|
||||||
async: false,
|
async: false,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data === "False") {
|
if (data === "False") {
|
||||||
// The class doesn't exist
|
// The stream doesn't exist
|
||||||
okay = false;
|
okay = false;
|
||||||
$('#send-status').removeClass(status_classes).show();
|
$('#send-status').removeClass(status_classes).show();
|
||||||
$('#stream-dne-name').text(stream_name);
|
$('#stream-dne-name').text(stream_name);
|
||||||
@@ -105,10 +105,10 @@ function check_class_for_send(stream_name) {
|
|||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_class_message() {
|
function validate_stream_message() {
|
||||||
var stream_name = compose_stream_name();
|
var stream_name = compose_stream_name();
|
||||||
if (stream_name === "") {
|
if (stream_name === "") {
|
||||||
compose_error("Please specify a class", $("#stream"));
|
compose_error("Please specify a stream", $("#stream"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,11 +122,11 @@ function validate_class_message() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check_class_for_send(stream_name))
|
if (!check_stream_for_send(stream_name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!subscribed_to(stream_name)) {
|
if (!subscribed_to(stream_name)) {
|
||||||
// You're not subbed to the class
|
// You're not subbed to the stream
|
||||||
$('#send-status').removeClass(status_classes).show();
|
$('#send-status').removeClass(status_classes).show();
|
||||||
$('#stream-nosub-name').text(stream_name);
|
$('#stream-nosub-name').text(stream_name);
|
||||||
$('#stream-nosub').show();
|
$('#stream-nosub').show();
|
||||||
@@ -159,6 +159,6 @@ function validate_message() {
|
|||||||
if (composing_huddle_message()) {
|
if (composing_huddle_message()) {
|
||||||
return validate_huddle_message();
|
return validate_huddle_message();
|
||||||
} else {
|
} else {
|
||||||
return validate_class_message();
|
return validate_stream_message();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function process_key_in_input(code) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function process_compose_hotkey(code) {
|
function process_compose_hotkey(code) {
|
||||||
if (code === 9) { // Tab: toggles between class and huddle compose tabs.
|
if (code === 9) { // Tab: toggles between stream and huddle compose tabs.
|
||||||
toggle_compose();
|
toggle_compose();
|
||||||
return process_compose_hotkey;
|
return process_compose_hotkey;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,13 +131,13 @@ $(function () {
|
|||||||
focus_on("huddle_recipient");
|
focus_on("huddle_recipient");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prepare the click handler for subbing to a new class to which
|
// Prepare the click handler for subbing to a new stream to which
|
||||||
// you have composed a message.
|
// you have composed a message.
|
||||||
$('#create-it').click(function () {
|
$('#create-it').click(function () {
|
||||||
sub_from_home(compose_stream_name(), $('#stream-dne'));
|
sub_from_home(compose_stream_name(), $('#stream-dne'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prepare the click handler for subbing to an existing class.
|
// Prepare the click handler for subbing to an existing stream.
|
||||||
$('#sub-it').click(function () {
|
$('#sub-it').click(function () {
|
||||||
sub_from_home(compose_stream_name(), $('#stream-nosub'));
|
sub_from_home(compose_stream_name(), $('#stream-nosub'));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user