mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
This adds a new realm setting: default_code_block_language. This PR also adds a new widget to specify a language, which behaves somewhat differently from other widgets of the same kind; instead of exposing methods to the whole module, we just create a single IIFE that handles all the interactions with the DOM for the widget. We also move the code for remapping languages to format_code function since we want to preserve the original language to decide if we override it using default_code_clock_language. Fixes #14404.
22 lines
1.2 KiB
Handlebars
22 lines
1.2 KiB
Handlebars
<div class="input-group" id="realm_default_code_block_language_widget">
|
|
<label for="realm_default_code_block_language" id="realm_default_code_block_language_label" class="inline-block">
|
|
{{ label }}
|
|
<span class="realm_default_code_block_language_setting dropup actual-dropdown-menu prop-element" id="id_realm_default_code_block_language"
|
|
name="realm_default_code_block_language" aria-labelledby="realm_default_code_block_language_label">
|
|
<button class="button small rounded dropdown-toggle" data-toggle="dropdown">
|
|
<span id="realm_default_code_block_language_name"></span>
|
|
<i class="fa fa-pencil"></i>
|
|
</button>
|
|
<ul class="dropdown-menu modal-bg" role="menu">
|
|
<li class="dropdown-search" role="presentation">
|
|
<input class="no-input-change-detection" type="text" role="menuitem" placeholder="{{t 'Filter languages' }}" autofocus/>
|
|
</li>
|
|
<span class="dropdown-list-body" data-simplebar></span>
|
|
</ul>
|
|
</span>
|
|
</label>
|
|
{{#if is_admin }}
|
|
<a class="default_code_block_language_unset" id="default_code_block_language_unset">{{t "[Unset]" }}</a>
|
|
{{/if}}
|
|
</div>
|