refactor: s/send-status/compose-send-status.

This commit is contained in:
Tommy Ip 2017-11-26 18:58:36 +00:00 committed by Tim Abbott
parent 19b518c801
commit c0c58f9761
9 changed files with 34 additions and 34 deletions

View File

@ -41,7 +41,7 @@ casper.then(function () {
casper.waitWhileVisible('.compose-all-everyone-confirm', function () {
casper.test.info('Check that error messages are gone.');
casper.test.assertNotVisible('.compose-all-everyone-msg');
casper.test.assertNotVisible('#send-status');
casper.test.assertNotVisible('#compose-send-status');
});
});

View File

@ -228,7 +228,7 @@ people.add(bob);
compose_state.stream_name('social');
assert(compose.validate());
assert(!$("#compose-all-everyone").visible());
assert(!$("#send-status").visible());
assert(!$("#compose-send-status").visible());
stream_data.get_subscriber_count = function (stream_name) {
assert.equal(stream_name, 'social');
@ -251,7 +251,7 @@ people.add(bob);
compose_state.message_content('Hey @all');
assert(!compose.validate());
assert.equal($("#compose-send-button").prop('disabled'), false);
assert(!$("#send-status").visible());
assert(!$("#compose-send-status").visible());
assert.equal(compose_content, 'compose_all_everyone_stub');
assert($("#compose-all-everyone").visible());
}());
@ -261,7 +261,7 @@ people.add(bob);
blueslip.log = noop;
$("#new_message_content").val('foobarfoobar');
$("#new_message_content").blur();
$("#send-status").show();
$("#compose-send-status").show();
$("#compose-send-button").attr('disabled', 'disabled');
$("#sending-indicator").show();
@ -276,7 +276,7 @@ people.add(bob);
assert.equal($("#new_message_content").val(), '');
assert($("#new_message_content").is_focused());
assert(!$("#send-status").visible());
assert(!$("#compose-send-status").visible());
assert.equal($("#compose-send-button").prop('disabled'), false);
assert(!$("#sending-indicator").visible());
@ -348,7 +348,7 @@ people.add(bob);
$("#new_message_content").val('[foobar]' +
'(https://foo.com/user_uploads/123456)');
$("#new_message_content").blur();
$("#send-status").show();
$("#compose-send-status").show();
$("#compose-send-button").attr('disabled', 'disabled');
$("#sending-indicator").show();
@ -363,7 +363,7 @@ people.add(bob);
assert.deepEqual(stub_state, state);
assert.equal($("#new_message_content").val(), '');
assert($("#new_message_content").is_focused());
assert(!$("#send-status").visible());
assert(!$("#compose-send-status").visible());
assert.equal($("#compose-send-button").prop('disabled'), false);
assert(!$("#sending-indicator").visible());
}());
@ -443,7 +443,7 @@ people.add(bob);
stub_state = initialize_state_stub_dict();
$("#new_message_content").val('foobarfoobar');
$("#new_message_content").blur();
$("#send-status").show();
$("#compose-send-status").show();
$("#compose-send-button").attr('disabled', 'disabled');
$("#sending-indicator").show();
$("#new_message_content").select(noop);
@ -477,7 +477,7 @@ people.add(bob);
'Error sending message: Server says 408');
assert.equal($("#new_message_content").val(), 'foobarfoobar');
assert($("#new_message_content").is_focused());
assert($("#send-status").visible());
assert($("#compose-send-status").visible());
assert.equal($("#compose-send-button").prop('disabled'), false);
assert(!$("#sending-indicator").visible());
}());
@ -957,7 +957,7 @@ function test_with_mock_socket(test_params) {
'.compose-all-everyone');
$("#compose-all-everyone").show();
$("#send-status").show();
$("#compose-send-status").show();
var compose_finish_checked = false;
compose.finish = function () {
@ -969,7 +969,7 @@ function test_with_mock_socket(test_params) {
assert(container_removed);
assert(compose_finish_checked);
assert(!$("#compose-all-everyone").visible());
assert(!$("#send-status").visible());
assert(!$("#compose-send-status").visible());
}());
(function test_compose_invite_users_clicked() {

View File

@ -18,7 +18,7 @@ zrequire('upload');
(function test_upload_started() {
$("#compose-send-button").prop('disabled', false);
$("#send-status").removeClass("alert-info").hide();
$("#compose-send-status").removeClass("alert-info").hide();
$(".send-status-close").one = function (ev_name, handler) {
assert.equal(ev_name, 'click');
assert(handler);
@ -35,8 +35,8 @@ zrequire('upload');
upload.uploadStarted();
assert.equal($("#compose-send-button").attr("disabled"), '');
assert($("#send-status").hasClass("alert-info"));
assert($("#send-status").visible());
assert($("#compose-send-status").hasClass("alert-info"));
assert($("#compose-send-status").visible());
assert.equal($("<p>").text(), 'translated: Uploading…');
assert.equal($("#error-msg").html(), 'fake-html');
}());
@ -53,15 +53,15 @@ zrequire('upload');
(function test_upload_error() {
function setup_test() {
$("#send-status").removeClass("alert-error");
$("#send-status").addClass("alert-info");
$("#compose-send-status").removeClass("alert-error");
$("#compose-send-status").addClass("alert-info");
$("#compose-send-button").attr("disabled", 'disabled');
$("#error-msg").text('');
}
function assert_side_effects(msg, check_html=false) {
assert($("#send-status").hasClass("alert-error"));
assert(!$("#send-status").hasClass("alert-info"));
assert($("#compose-send-status").hasClass("alert-error"));
assert(!$("#compose-send-status").hasClass("alert-info"));
assert.equal($("#compose-send-button").prop("disabled"), false);
if (check_html) {
assert.equal($("#error-msg").html(), msg);
@ -119,8 +119,8 @@ zrequire('upload');
},
};
$("#compose-send-button").attr('disabled', 'disabled');
$("#send-status").addClass("alert-info");
$("#send-status").show();
$("#compose-send-status").addClass("alert-info");
$("#compose-send-status").show();
$('#file_input').clone = function (param) {
assert(param);
return $('#file_input');
@ -133,8 +133,8 @@ zrequire('upload');
assert(compose_actions_start_checked);
assert(compose_ui_autosize_textarea_checked);
assert.equal($("#compose-send-button").prop('disabled'), false);
assert(!$('#send-status').hasClass('alert-info'));
assert(!$('#send-status').visible());
assert(!$('#compose-send-status').hasClass('alert-info'));
assert(!$('#compose-send-status').visible());
}
}

View File

@ -421,8 +421,8 @@ $(function () {
// NB: This just binds to current elements, and won't bind to elements
// created after ready() is called.
$('#send-status .send-status-close').click(
function () { $('#send-status').stop(true).fadeOut(500); }
$('#compose-send-status .send-status-close').click(
function () { $('#compose-send-status').stop(true).fadeOut(500); }
);

View File

@ -42,7 +42,7 @@ function show_all_everyone_warnings() {
exports.clear_all_everyone_warnings = function () {
$("#compose-all-everyone").hide();
$("#compose-all-everyone").empty();
$("#send-status").hide();
$("#compose-send-status").hide();
};
exports.clear_invites = function () {
@ -133,7 +133,7 @@ function create_message_object() {
exports.create_message_object = create_message_object;
function compose_error(error_text, bad_input) {
$('#send-status').removeClass(common.status_classes)
$('#compose-send-status').removeClass(common.status_classes)
.addClass('alert-error')
.stop(true).fadeTo(0, 1);
$('#error-msg').html(error_text);
@ -188,7 +188,7 @@ function clear_compose_box() {
$("#new_message_content").val('').focus();
drafts.delete_draft_after_send();
compose_ui.autosize_textarea();
$("#send-status").hide(0);
$("#compose-send-status").hide(0);
$("#compose-send-button").prop('disabled', false);
$("#sending-indicator").hide();
resize.resize_bottom_whitespace();

View File

@ -76,7 +76,7 @@ function show_box(msg_type, opts) {
$("#stream_toggle").removeClass("active");
$("#private_message_toggle").addClass("active");
}
$("#send-status").removeClass(common.status_classes).hide();
$("#compose-send-status").removeClass(common.status_classes).hide();
$('#compose').css({visibility: "visible"});
$(".new_message_textarea").css("min-height", "3em");
@ -98,7 +98,7 @@ function clear_box() {
exports.clear_textarea();
$("#new_message_content").removeData("draft-id");
compose_ui.autosize_textarea();
$("#send-status").hide(0);
$("#compose-send-status").hide(0);
}
exports.autosize_message_content = function () {

View File

@ -23,7 +23,7 @@ function clear_out_file_list(jq_file_list) {
exports.uploadStarted = function () {
$("#compose-send-button").attr("disabled", "");
$("#send-status").addClass("alert-info").show();
$("#compose-send-status").addClass("alert-info").show();
$(".send-status-close").one('click', compose.abort_xhr);
$("#error-msg").html($("<p>").text(i18n.t("Uploading…"))
.after('<div class="progress progress-striped active">' +
@ -37,7 +37,7 @@ exports.progressUpdated = function (i, file, progress) {
exports.uploadError = function (err, file) {
var msg;
$("#send-status").addClass("alert-error")
$("#compose-send-status").addClass("alert-error")
.removeClass("alert-info");
$("#compose-send-button").prop("disabled", false);
switch (err) {
@ -94,7 +94,7 @@ exports.uploadFinished = function (i, file, response) {
}
compose_ui.autosize_textarea();
$("#compose-send-button").prop("disabled", false);
$("#send-status").removeClass("alert-info")
$("#compose-send-status").removeClass("alert-info")
.hide();
// In order to upload the same file twice in a row, we need to clear out

View File

@ -227,7 +227,7 @@ table.compose_table {
}
/* Like .nav-tabs > li > a */
#send-status {
#compose-send-status {
width: calc(100% - 28px);
padding: 8px 14px 8px 14px;
margin-bottom: 8px;

View File

@ -30,7 +30,7 @@
</div>
</div>
<div class="message_comp compose-content">
<div class="alert" id="send-status">
<div class="alert" id="compose-send-status">
<span class="send-status-close">&times;</span>
<span id="error-msg"></span>
</div>