Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose: Avoid hardcoding maxlength for stream/topic names.

jai22013853a65a4c93
diff --git a/static/js/ui_init.js b/static/js/ui_init.js
index 6da266f0599..11a0ea92228 100644
--- a/static/js/ui_init.js
+++ b/static/js/ui_init.js
@@ -209,6 +209,8 @@ function initialize_compose_box() {
: "End",
narrow_to_compose_recipients_key_html:
(common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .",
+ max_stream_name_length: page_params.max_stream_name_length,
+ max_topic_length: page_params.max_topic_length,
}),
);
$(`.enter_sends_${user_settings.enter_sends}`).show();
diff --git a/static/templates/compose.hbs b/static/templates/compose.hbs
index 9fb7388df8c..b3e57265819 100644
--- a/static/templates/compose.hbs
+++ b/static/templates/compose.hbs
@@ -79,9 +79,9 @@
</span>
<a role="button" class="narrow_to_compose_recipients zulip-icon zulip-icon-arrow-left-circle order-1" data-tooltip-template-id="narrow_to_compose_recipients_tooltip" tabindex="0">
</a>
- <input type="text" class="recipient_box" name="stream_message_recipient_stream" id="stream_message_recipient_stream" maxlength="30" value="" placeholder="{{t 'Stream' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Stream' }}" />
+ <input type="text" class="recipient_box" name="stream_message_recipient_stream" id="stream_message_recipient_stream" maxlength="{{ max_stream_name_length }}" value="" placeholder="{{t 'Stream' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Stream' }}" />
<i class="fa fa-angle-right" aria-hidden="true"></i>
- <input type="text" class="recipient_box" name="stream_message_recipient_topic" id="stream_message_recipient_topic" maxlength="60" value="" placeholder="{{t 'Topic' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Topic' }}" />
+ <input type="text" class="recipient_box" name="stream_message_recipient_topic" id="stream_message_recipient_topic" maxlength="{{ max_topic_length }}" value="" placeholder="{{t 'Topic' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Topic' }}" />
</div>
</div>
<div id="private-message" class="order-1">