Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251261

Change subject: CommandHelp: Add 'or' separator between shortcuts
......................................................................

CommandHelp: Add 'or' separator between shortcuts

Makes it clear the shortcuts are linked and equivalent.

For sequences the separator is 'or type'.

Change-Id: I8485409996a96dde47c38bf34c7f80ce48c4cf31
---
M i18n/en.json
M i18n/qqq.json
M src/ui/dialogs/ve.ui.CommandHelpDialog.js
M src/ui/styles/dialogs/ve.ui.CommandHelpDialog.css
4 files changed, 28 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/61/251261/1

diff --git a/i18n/en.json b/i18n/en.json
index e6cafcd..21780f1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -108,7 +108,9 @@
        "visualeditor-shortcuts-formatting": "Paragraph formatting",
        "visualeditor-shortcuts-history": "History",
        "visualeditor-shortcuts-other": "Other",
-       "visualeditor-shortcuts-sequence-notice": "Type",
+       "visualeditor-shortcuts-separator": "or",
+       "visualeditor-shortcuts-sequence-notice": "type",
+       "visualeditor-shortcuts-sequence-separator": "or type",
        "visualeditor-shortcuts-text-style": "Text styling",
        "visualeditor-slug-insert": "Insert paragraph",
        "visualeditor-specialcharacter-button-tooltip": "Special character",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 939cc59..3ec95ab 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -116,7 +116,9 @@
        "visualeditor-shortcuts-formatting": "Heading for paragraph formatting 
shortcuts",
        "visualeditor-shortcuts-history": "Heading for history 
shortcuts.\n\nSee also:\n* 
{{msg-mw|Visualeditor-historybutton-redo-tooltip}}\n* 
{{msg-mw|Visualeditor-historybutton-undo-tooltip}}\n{{Identical|History}}",
        "visualeditor-shortcuts-other": "Heading for other 
shortcuts.\n{{Identical|Other}}",
+       "visualeditor-shortcuts-separator": "Separator when listing multiple 
possible keyboard shortcuts.",
        "visualeditor-shortcuts-sequence-notice": "{{Doc-important|This means 
\"type on a keyboard\" - not \"type\" in the sense of \"category\" or 
\"manner\".}}\nNotice before a text-sequence shortcut that it should be typed 
out instead of being several keys to press at once\n{{Identical|Type}}",
+       "visualeditor-shortcuts-sequence-separator": "Separator when listing 
multiple possible keyboard sequences.",
        "visualeditor-shortcuts-text-style": "Heading for text formatting 
shortcuts",
        "visualeditor-slug-insert": "Label for slug to insert paragraph on an 
otherwise unreachable line",
        "visualeditor-specialcharacter-button-tooltip": "Tooltip text for the 
insert character button.\n{{Identical|Special character}}",
diff --git a/src/ui/dialogs/ve.ui.CommandHelpDialog.js 
b/src/ui/dialogs/ve.ui.CommandHelpDialog.js
index 6a07922..6716c1c 100644
--- a/src/ui/dialogs/ve.ui.CommandHelpDialog.js
+++ b/src/ui/dialogs/ve.ui.CommandHelpDialog.js
@@ -118,9 +118,15 @@
                        }
                        $shortcut = $( '<dt>' );
                        for ( k = 0, kLen = triggerList.length; k < kLen; k++ ) 
{
-                               $shortcut.append( $( '<kbd>' ).append(
-                                       triggerList[ k ].getMessage( true 
).map( ve.ui.CommandHelpDialog.static.buildKeyNode )
-                               ).find( 'kbd + kbd' ).before( '+' ).end() );
+                               $shortcut.append( $( '<kbd>' )
+                                       .append(
+                                               triggerList[ k ].getMessage( 
true ).map( ve.ui.CommandHelpDialog.static.buildKeyNode )
+                                       )
+                                       .attr( 'data-separator', ve.msg( 
'visualeditor-shortcuts-separator' ) )
+                                       .find( 'kbd + kbd' )
+                                               .before( '+' )
+                                               .end()
+                               );
                        }
                        if ( commands[ j ].sequences ) {
                                for ( k = 0, kLen = commands[ j 
].sequences.length; k < kLen; k++ ) {
@@ -128,6 +134,7 @@
                                        if ( sequence ) {
                                                $shortcut.append( $( '<kbd 
class="ve-ui-commandHelpDialog-sequence">' )
                                                        .attr( 'data-label', 
ve.msg( 'visualeditor-shortcuts-sequence-notice' ) )
+                                                       .attr( 
'data-separator', ve.msg( 'visualeditor-shortcuts-sequence-separator' ) )
                                                        .append(
                                                                
sequence.getMessage( true ).map( ve.ui.CommandHelpDialog.static.buildKeyNode )
                                                        )
diff --git a/src/ui/styles/dialogs/ve.ui.CommandHelpDialog.css 
b/src/ui/styles/dialogs/ve.ui.CommandHelpDialog.css
index 3e313c3..cde7f34 100644
--- a/src/ui/styles/dialogs/ve.ui.CommandHelpDialog.css
+++ b/src/ui/styles/dialogs/ve.ui.CommandHelpDialog.css
@@ -5,6 +5,7 @@
  */
 
 .ve-ui-commandHelpDialog-container {
+       margin-top: -2em;
        -ms-column-count: 3;
        -moz-column-count: 3;
        -webkit-column-count: 3;
@@ -22,12 +23,8 @@
 
 .ve-ui-commandHelpDialog-section h3 {
        text-align: center;
-       margin: 0;
+       margin: 2em 0 1em 0;
        padding: 0;
-}
-
-.ve-ui-commandHelpDialog-list {
-       margin: 0.5em 0 1.5em 0;
 }
 
 .ve-ui-commandHelpDialog-list dd {
@@ -55,12 +52,13 @@
 }
 
 .ve-ui-commandHelpDialog-list dt > kbd {
+       white-space: nowrap;
        display: block;
        clear: right;
 }
 
 /* Enlarge vertical spacing in a list of shortcuts for one action */
-.ve-ui-commandHelpDialog-list dt kbd ~ kbd {
+.ve-ui-commandHelpDialog-list dt > kbd ~ kbd {
        margin-top: 0.5em;
 }
 
@@ -79,13 +77,20 @@
        text-align: center;
 }
 
-.ve-ui-commandHelpDialog-list dt kbd[ data-label ]::before {
-       content: attr( data-label );
+.ve-ui-commandHelpDialog-list dt > kbd::before {
        font-weight: normal;
        font-style: italic;
        padding-right: 3px;
 }
 
+.ve-ui-commandHelpDialog-list dt > kbd[ data-label ]::before {
+       content: attr( data-label );
+}
+
+.ve-ui-commandHelpDialog-list dt > kbd[ data-separator ] ~ kbd::before {
+       content: attr( data-separator );
+}
+
 .ve-ui-commandHelpDialog-sequence kbd:not( [ data-key="space" ] ) {
        box-shadow: none;
        text-transform: none;

-- 
To view, visit https://gerrit.wikimedia.org/r/251261
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8485409996a96dde47c38bf34c7f80ce48c4cf31
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to