Swapped control symbol for text on Windows (#18420)

Refs https://github.com/TryGhost/Product/issues/3973
This commit is contained in:
Sanne de Vries 2023-10-02 15:03:58 +02:00 committed by GitHub
parent 6acf93c0d2
commit c95da6b2d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

View File

@ -279,7 +279,7 @@
<div class="gh-shortcut"> <div class="gh-shortcut">
<div class="code">Inline code</div> <div class="code">Inline code</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<span class="gh-key" data-tooltip="Shift">&#8679;</span> <span class="gh-key" data-tooltip="Shift">&#8679;</span>
<span class="gh-key mono">K</span> <span class="gh-key mono">K</span>
</div> </div>
@ -287,14 +287,14 @@
<div class="gh-shortcut"> <div class="gh-shortcut">
<div>List</div> <div>List</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<span class="gh-key mono">L</span> <span class="gh-key mono">L</span>
</div> </div>
</div> </div>
<div class="gh-shortcut"> <div class="gh-shortcut">
<div>Ordered list</div> <div>Ordered list</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<GhPostSettingsMenu::OptionOrAlt /> <GhPostSettingsMenu::OptionOrAlt />
<span class="gh-key mono">L</span> <span class="gh-key mono">L</span>
</div> </div>
@ -302,21 +302,21 @@
<div class="gh-shortcut"> <div class="gh-shortcut">
<div>Quote</div> <div>Quote</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<span class="gh-key mono">Q</span> <span class="gh-key mono">Q</span>
</div> </div>
</div> </div>
<div class="gh-shortcut"> <div class="gh-shortcut">
<div>H2</div> <div>H2</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<span class="gh-key mono">H</span> <span class="gh-key mono">H</span>
</div> </div>
</div> </div>
<div class="gh-shortcut"> <div class="gh-shortcut">
<div>H3</div> <div>H3</div>
<div class="gh-keys"> <div class="gh-keys">
<span class="gh-key" data-tooltip="Control">&#8963;</span> <GhPostSettingsMenu::CtrlOrSymbol />
<span class="gh-key mono">H</span> <span class="gh-key mono">H</span>
<span class="gh-key mono clear">2x</span> <span class="gh-key mono clear">2x</span>
</div> </div>

View File

@ -0,0 +1 @@
<span class="gh-key {{this.class}}" data-tooltip={{this.tooltip}}>{{this.character}}</span>

View File

@ -0,0 +1,19 @@
import Component from '@glimmer/component';
import {htmlSafe} from '@ember/template';
const isMac = window.navigator.platform.startsWith('Mac');
export default class CtrlOrCmd extends Component {
get tooltip() {
return isMac ? 'Control' : '';
}
get character() {
const character = isMac ? '&#8963;' : 'Ctrl';
return htmlSafe(character);
}
get class() {
return isMac ? '' : 'mono';
}
}