Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltips for MD editor buttons and add muted class for buttons #23896

Merged
merged 10 commits into from
Apr 11, 2023
14 changes: 14 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ footer = Footer
footer.software = About Software
footer.links = Links

[editor]
header.tooltip = Add heading
bold.tooltip = Add bold text
italic.tooltip = Add italic text
quote.tooltip = Quote text
code.tooltip = Add code/highlighted text
link.tooltip = Add a link
list.unordered.tooltip = Add a bullet list
list.ordered.tooltip = Add a numbered list
list.task.tooltip = Add a list of tasks
mention.tooltip = Mention a user or team
ref.tooltip = Reference an issue or pull request
switch_to_legacy.tooltip = Use the legacy editor instead

[filter]
string.asc = A - Z
string.desc = Z - A
Expand Down
24 changes: 12 additions & 12 deletions templates/shared/combomarkdowneditor.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ Template Attributes:
<div class="ui tab active" data-tab-panel="markdown-writer">
<markdown-toolbar class="gt-df">
<div class="markdown-toolbar-group">
<md-header class="markdown-toolbar-button">{{svg "octicon-heading"}}</md-header>
<md-bold class="markdown-toolbar-button">{{svg "octicon-bold"}}</md-bold>
<md-italic class="markdown-toolbar-button">{{svg "octicon-italic"}}</md-italic>
<md-header class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.header.tooltip"}}">{{svg "octicon-heading"}}</md-header>{{- /*Get rid of spaces between the buttons*/ -}}
<md-bold class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.bold.tooltip"}}">{{svg "octicon-bold"}}</md-bold>{{- /*Get rid of spaces between the buttons*/ -}}
<md-italic class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.italic.tooltip"}}">{{svg "octicon-italic"}}</md-italic>{{- /*Get rid of spaces between the buttons*/ -}}
</div>
<div class="markdown-toolbar-group">
<md-quote class="markdown-toolbar-button">{{svg "octicon-quote"}}</md-quote>
<md-code class="markdown-toolbar-button">{{svg "octicon-code"}}</md-code>
<md-link class="markdown-toolbar-button">{{svg "octicon-link"}}</md-link>
<md-quote class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.quote.tooltip"}}">{{svg "octicon-quote"}}</md-quote>{{- /*Get rid of spaces between the buttons*/ -}}
<md-code class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.code.tooltip"}}">{{svg "octicon-code"}}</md-code>{{- /*Get rid of spaces between the buttons*/ -}}
<md-link class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.link.tooltip"}}">{{svg "octicon-link"}}</md-link>{{- /*Get rid of spaces between the buttons*/ -}}
</div>
<div class="markdown-toolbar-group">
<md-unordered-list class="markdown-toolbar-button">{{svg "octicon-list-unordered"}}</md-unordered-list>
<md-ordered-list class="markdown-toolbar-button">{{svg "octicon-list-ordered"}}</md-ordered-list>
<md-task-list class="markdown-toolbar-button">{{svg "octicon-tasklist"}}</md-task-list>
<md-unordered-list class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.list.unordered.tooltip"}}">{{svg "octicon-list-unordered"}}</md-unordered-list>{{- /*Get rid of spaces between the buttons*/ -}}
<md-ordered-list class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.list.ordered.tooltip"}}">{{svg "octicon-list-ordered"}}</md-ordered-list>{{- /*Get rid of spaces between the buttons*/ -}}
<md-task-list class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.list.task.tooltip"}}">{{svg "octicon-tasklist"}}</md-task-list>{{- /*Get rid of spaces between the buttons*/ -}}
</div>
<div class="markdown-toolbar-group">
<md-mention class="markdown-toolbar-button">{{svg "octicon-mention"}}</md-mention>
<md-ref class="markdown-toolbar-button">{{svg "octicon-cross-reference"}}</md-ref>
<md-mention class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.mention.tooltip"}}">{{svg "octicon-mention"}}</md-mention>{{- /*Get rid of spaces between the buttons*/ -}}
<md-ref class="markdown-toolbar-button" data-tooltip-content="{{.locale.Tr "editor.ref.tooltip"}}">{{svg "octicon-cross-reference"}}</md-ref>{{- /*Get rid of spaces between the buttons*/ -}}
</div>
<div class="markdown-toolbar-group gt-f1"></div>
<div class="markdown-toolbar-group">
<span class="markdown-toolbar-button markdown-switch-easymde">{{svg "octicon-arrow-switch"}}</span>
<button class="markdown-toolbar-button markdown-switch-easymde muted" data-tooltip-content="{{.locale.Tr "editor.switch_to_legacy.tooltip"}}" data-md-button>{{svg "octicon-arrow-switch"}}</button>{{- /*Get rid of spaces between the buttons*/ -}}
</div>
</markdown-toolbar>
<textarea class="markdown-text-editor js-quick-submit" name="{{.TextareaName}}" placeholder="{{.TextareaPlaceholder}}">{{.TextareaContent}}</textarea>
Expand Down
5 changes: 5 additions & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ a.muted,
color: inherit;
}

button.muted {
background: none;
border: none;
}

a:hover,
a.muted:hover,
a.muted:hover [class*="color-text"],
Expand Down