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.

templates: Extract and tweak copy_message_button from message_edit_form.

Sumanth V Rao413df1881eda
diff --git a/static/templates/copy_message_button.hbs b/static/templates/copy_message_button.hbs
new file mode 100644
index 00000000000..43e96232fb5
--- /dev/null
+++ b/static/templates/copy_message_button.hbs
@@ -0,0 +1,5 @@
+<button class="btn pull-right copy_button_base copy_message" data-toggle="tooltip" title="{{t "Copy and close" }}" aria-label="{{t "Copy and close" }}" data-clipboard-target="#message_edit_content_{{message_id}}">
+ <svg height="20" width="18" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" id="clipboard_image">
+ <path fill="#777" d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
+ </svg>
+</button>
diff --git a/static/templates/message_edit_form.hbs b/static/templates/message_edit_form.hbs
index 3bf946aa921..38a078e6c3c 100644
--- a/static/templates/message_edit_form.hbs
+++ b/static/templates/message_edit_form.hbs
@@ -42,11 +42,7 @@
{{/if}}
<div class="control-group no-margin">
<div class="controls edit-controls">
- <button class="btn pull-right copy_button_base copy_message" data-toggle="tooltip" title="{{t "Copy and close" }}" data-clipboard-target="#message_edit_content_{{message_id}}">
- <svg height="20" width="18" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" id="clipboard_image">
- <path fill="#777" d="M128 768h256v64H128v-64z m320-384H128v64h320v-64z m128 192V448L384 640l192 192V704h320V576H576z m-288-64H128v64h160v-64zM128 704h160v-64H128v64z m576 64h64v128c-1 18-7 33-19 45s-27 18-45 19H64c-35 0-64-29-64-64V192c0-35 29-64 64-64h192C256 57 313 0 384 0s128 57 128 128h192c35 0 64 29 64 64v320h-64V320H64v576h640V768zM128 256h512c0-35-29-64-64-64h-64c-35 0-64-29-64-64s-29-64-64-64-64 29-64 64-29 64-64 64h-64c-35 0-64 29-64 64z" />
- </svg>
- </button>
+ {{> copy_message_button message_id=this.message_id}}
<textarea class="message_edit_content" maxlength="10000" id="message_edit_content_{{message_id}}">{{content}}</textarea>
<div class="scrolling_list preview_message_area" id="preview_message_area_{{message_id}}" style="display:none;">
<div id="markdown_preview_spinner_{{message_id}}"></div>