2021-04-14 08:09:25 -04:00
|
|
|
- modifier_key = client_js_flags[:isMac] ? '⌘' : s_('KeyboardKey|Ctrl+')
|
2022-09-21 08:13:58 -04:00
|
|
|
- supports_file_upload = local_assigns.fetch(:supports_file_upload, true)
|
2020-09-11 20:08:44 -04:00
|
|
|
|
2018-12-14 12:56:25 -05:00
|
|
|
.md-header-toolbar.active
|
2020-09-11 20:08:44 -04:00
|
|
|
= markdown_toolbar_button({ icon: "bold",
|
2020-09-16 11:09:32 -04:00
|
|
|
data: { "md-tag" => "**", "md-shortcuts": '["mod+b"]' },
|
2020-09-11 20:08:44 -04:00
|
|
|
title: sprintf(s_("MarkdownEditor|Add bold text (%{modifier_key}B)") % { modifier_key: modifier_key }) })
|
|
|
|
|
|
|
|
= markdown_toolbar_button({ icon: "italic",
|
2020-09-16 11:09:32 -04:00
|
|
|
data: { "md-tag" => "_", "md-shortcuts": '["mod+i"]' },
|
2020-09-11 20:08:44 -04:00
|
|
|
title: sprintf(s_("MarkdownEditor|Add italic text (%{modifier_key}I)") % { modifier_key: modifier_key }) })
|
|
|
|
|
2022-02-23 19:18:13 -05:00
|
|
|
= markdown_toolbar_button({ icon: "strikethrough",
|
|
|
|
data: { "md-tag" => "~~", "md-shortcuts": '["mod+shift+x"]' },
|
|
|
|
title: sprintf(s_("MarkdownEditor|Add strikethrough text (%{modifier_key}⇧X)") % { modifier_key: modifier_key }) })
|
|
|
|
|
2019-02-28 19:44:33 -05:00
|
|
|
= markdown_toolbar_button({ icon: "quote", data: { "md-tag" => "> ", "md-prepend" => true }, title: _("Insert a quote") })
|
|
|
|
= markdown_toolbar_button({ icon: "code", data: { "md-tag" => "`", "md-block" => "```" }, title: _("Insert code") })
|
2020-09-11 20:08:44 -04:00
|
|
|
|
|
|
|
= markdown_toolbar_button({ icon: "link",
|
2020-09-16 11:09:32 -04:00
|
|
|
data: { "md-tag" => "[{text}](url)", "md-select" => "url", "md-shortcuts": '["mod+k"]' },
|
2020-09-11 20:08:44 -04:00
|
|
|
title: sprintf(s_("MarkdownEditor|Add a link (%{modifier_key}K)") % { modifier_key: modifier_key }) })
|
|
|
|
|
2020-06-01 17:08:09 -04:00
|
|
|
= markdown_toolbar_button({ icon: "list-bulleted", data: { "md-tag" => "- ", "md-prepend" => true }, title: _("Add a bullet list") })
|
2019-02-28 19:44:33 -05:00
|
|
|
= markdown_toolbar_button({ icon: "list-numbered", data: { "md-tag" => "1. ", "md-prepend" => true }, title: _("Add a numbered list") })
|
2022-08-10 02:10:51 -04:00
|
|
|
= markdown_toolbar_button({ icon: "list-task", data: { "md-tag" => "- [ ] ", "md-prepend" => true }, title: _("Add a checklist") })
|
2022-09-23 14:12:59 -04:00
|
|
|
= markdown_toolbar_button({ icon: "list-indent",
|
|
|
|
data: { "md-command" => 'indentLines', "md-shortcuts": '["mod+]"]' },
|
|
|
|
css_class: 'gl-display-none',
|
|
|
|
title: sprintf(s_("MarkdownEditor|Indent line (%{modifier_key}])") % { modifier_key: modifier_key }) })
|
|
|
|
= markdown_toolbar_button({ icon: "list-outdent",
|
|
|
|
data: { "md-command" => 'outdentLines', "md-shortcuts": '["mod+["]' },
|
|
|
|
css_class: 'gl-display-none',
|
|
|
|
title: sprintf(s_("MarkdownEditor|Outdent line (%{modifier_key}[)") % { modifier_key: modifier_key }) })
|
2021-05-10 14:10:41 -04:00
|
|
|
= markdown_toolbar_button({ icon: "details-block",
|
|
|
|
data: { "md-tag" => "<details><summary>Click to expand</summary>\n{text}\n</details>", "md-prepend" => true, "md-select" => "Click to expand" },
|
|
|
|
title: _("Add a collapsible section") })
|
2022-10-10 14:10:10 -04:00
|
|
|
= markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| | |\n| | |", "md-prepend" => true }, title: _("Add a table") })
|
2022-09-21 08:13:58 -04:00
|
|
|
- if supports_file_upload
|
2022-10-05 14:08:18 -04:00
|
|
|
= render Pajamas::ButtonComponent.new(icon: 'paperclip', category: :tertiary, button_options: { 'aria-label': _("Attach a file or image"), class: 'has-tooltip js-attach-file-button', data: { testid: 'button-attach-file', container: 'body' } })
|
2018-12-14 12:56:25 -05:00
|
|
|
- if show_fullscreen_button
|
2022-10-05 14:08:18 -04:00
|
|
|
= render Pajamas::ButtonComponent.new(icon: 'maximize', category: :tertiary, button_options: { 'tabindex': -1, 'aria-label': _("Go full screen"), class: 'has-tooltip js-zen-enter', data: { container: 'body' } })
|