Skip to content
Permalink
Browse files

Fixed #413 - Merge pull request #404 from cksource/t/16980

Adding Paste as Plain text keystroke to the help dialog.
  • Loading branch information
mlewand committed May 31, 2017
2 parents 906ecba + 3b46f2b commit 606ced773bcae95ab734727a3bbefae52f7a67f1
Showing with 374 additions and 17 deletions.
  1. +4 −0 CHANGES.md
  2. +3 −0 dev/langtool/meta/ckeditor.plugin-a11yhelp-dialogs/meta.txt
  3. +11 −17 plugins/a11yhelp/dialogs/a11yhelp.js
  4. +5 −0 plugins/a11yhelp/dialogs/lang/af.js
  5. +5 −0 plugins/a11yhelp/dialogs/lang/ar.js
  6. +5 −0 plugins/a11yhelp/dialogs/lang/az.js
  7. +5 −0 plugins/a11yhelp/dialogs/lang/bg.js
  8. +5 −0 plugins/a11yhelp/dialogs/lang/ca.js
  9. +5 −0 plugins/a11yhelp/dialogs/lang/cs.js
  10. +5 −0 plugins/a11yhelp/dialogs/lang/cy.js
  11. +5 −0 plugins/a11yhelp/dialogs/lang/da.js
  12. +5 −0 plugins/a11yhelp/dialogs/lang/de-ch.js
  13. +5 −0 plugins/a11yhelp/dialogs/lang/de.js
  14. +5 −0 plugins/a11yhelp/dialogs/lang/el.js
  15. +5 −0 plugins/a11yhelp/dialogs/lang/en-gb.js
  16. +5 −0 plugins/a11yhelp/dialogs/lang/en.js
  17. +5 −0 plugins/a11yhelp/dialogs/lang/eo.js
  18. +5 −0 plugins/a11yhelp/dialogs/lang/es.js
  19. +5 −0 plugins/a11yhelp/dialogs/lang/et.js
  20. +5 −0 plugins/a11yhelp/dialogs/lang/eu.js
  21. +5 −0 plugins/a11yhelp/dialogs/lang/fa.js
  22. +5 −0 plugins/a11yhelp/dialogs/lang/fi.js
  23. +5 −0 plugins/a11yhelp/dialogs/lang/fo.js
  24. +5 −0 plugins/a11yhelp/dialogs/lang/fr-ca.js
  25. +5 −0 plugins/a11yhelp/dialogs/lang/fr.js
  26. +5 −0 plugins/a11yhelp/dialogs/lang/gl.js
  27. +5 −0 plugins/a11yhelp/dialogs/lang/gu.js
  28. +5 −0 plugins/a11yhelp/dialogs/lang/he.js
  29. +5 −0 plugins/a11yhelp/dialogs/lang/hi.js
  30. +5 −0 plugins/a11yhelp/dialogs/lang/hr.js
  31. +5 −0 plugins/a11yhelp/dialogs/lang/hu.js
  32. +5 −0 plugins/a11yhelp/dialogs/lang/id.js
  33. +5 −0 plugins/a11yhelp/dialogs/lang/it.js
  34. +5 −0 plugins/a11yhelp/dialogs/lang/ja.js
  35. +5 −0 plugins/a11yhelp/dialogs/lang/km.js
  36. +5 −0 plugins/a11yhelp/dialogs/lang/ko.js
  37. +5 −0 plugins/a11yhelp/dialogs/lang/ku.js
  38. +5 −0 plugins/a11yhelp/dialogs/lang/lt.js
  39. +5 −0 plugins/a11yhelp/dialogs/lang/lv.js
  40. +5 −0 plugins/a11yhelp/dialogs/lang/mk.js
  41. +5 −0 plugins/a11yhelp/dialogs/lang/mn.js
  42. +5 −0 plugins/a11yhelp/dialogs/lang/nb.js
  43. +5 −0 plugins/a11yhelp/dialogs/lang/nl.js
  44. +5 −0 plugins/a11yhelp/dialogs/lang/no.js
  45. +5 −0 plugins/a11yhelp/dialogs/lang/oc.js
  46. +5 −0 plugins/a11yhelp/dialogs/lang/pl.js
  47. +5 −0 plugins/a11yhelp/dialogs/lang/pt-br.js
  48. +5 −0 plugins/a11yhelp/dialogs/lang/pt.js
  49. +5 −0 plugins/a11yhelp/dialogs/lang/ro.js
  50. +5 −0 plugins/a11yhelp/dialogs/lang/ru.js
  51. +5 −0 plugins/a11yhelp/dialogs/lang/si.js
  52. +5 −0 plugins/a11yhelp/dialogs/lang/sk.js
  53. +5 −0 plugins/a11yhelp/dialogs/lang/sl.js
  54. +5 −0 plugins/a11yhelp/dialogs/lang/sq.js
  55. +5 −0 plugins/a11yhelp/dialogs/lang/sr-latn.js
  56. +5 −0 plugins/a11yhelp/dialogs/lang/sr.js
  57. +5 −0 plugins/a11yhelp/dialogs/lang/sv.js
  58. +5 −0 plugins/a11yhelp/dialogs/lang/th.js
  59. +5 −0 plugins/a11yhelp/dialogs/lang/tr.js
  60. +5 −0 plugins/a11yhelp/dialogs/lang/tt.js
  61. +5 −0 plugins/a11yhelp/dialogs/lang/ug.js
  62. +5 −0 plugins/a11yhelp/dialogs/lang/uk.js
  63. +5 −0 plugins/a11yhelp/dialogs/lang/vi.js
  64. +5 −0 plugins/a11yhelp/dialogs/lang/zh-cn.js
  65. +5 −0 plugins/a11yhelp/dialogs/lang/zh.js
  66. +8 −0 tests/plugins/a11yhelp/manual/plaintext.html
  67. +38 −0 tests/plugins/a11yhelp/manual/plaintext.md
@@ -3,6 +3,10 @@

## CKEditor 4.7.1

New Features:

* [#413](https://github.com/ckeditor/ckeditor-dev/issues/413): Added Paste as Plain Text hotkey in [Accessibility Help](http://ckeditor.com/addon/a11yhelp) instructions

## CKEditor 4.7

**Important Notes:**
@@ -35,6 +35,9 @@ legend.1.items.8.name = Label for the Access Next Focus Space Command section of
legend.1.items.8.legend = Keyboard shortcut instructions for the Access Next Focus Space command displayed in the Accessibility Instructions dialog window.
legend.1.items.9.name = Label for the Accessibility Help section of the Accessibility Instructions dialog window.
legend.1.items.9.legend = Keyboard shortcut instructions for the Accessibility Help command displayed in the Accessibility Instructions dialog window.
legend.1.items.10.name = Label for the Paste as Plain Text Command section of the Accessibility Instructions dialog window.
legend.1.items.10.legend = Keyboard shortcut instructions for the Paste as Plain Text command displayed in the Accessibility Instructions dialog window.
legend.1.items.10.legendEdge = Paste as Plain Text keyboard shortcut instructions displayed in the Accessibility Instructions dialog window, displayed for Microsoft Edge browser.
backspace = The label for the "Backspace" key.
tab = The label for the "Tab" key.
enter = The label for the "Enter" key.
@@ -77,15 +77,14 @@ CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {
// Modifier keys override.
keyMap[ CKEDITOR.ALT ] = coreLang[ 18 ];
keyMap[ CKEDITOR.SHIFT ] = coreLang[ 16 ];
keyMap[ CKEDITOR.CTRL ] = coreLang[ 17 ];
keyMap[ CKEDITOR.CTRL ] = CKEDITOR.env.mac ? coreLang[ 224 ] : coreLang[ 17 ];

// Sort in desc.
var modifiers = [ CKEDITOR.ALT, CKEDITOR.SHIFT, CKEDITOR.CTRL ];

function representKeyStroke( keystroke ) {
var quotient, modifier,
presentation = [];

for ( var i = 0; i < modifiers.length; i++ ) {
modifier = modifiers[ i ];
quotient = keystroke / modifiers[ i ];
@@ -100,23 +99,14 @@ CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {
return presentation.join( '+' );
}

var variablesPattern = /\$\{(.*?)\}/g;

var replaceVariables = ( function() {
// Swaps keystrokes with their commands in object literal.
// This makes searching keystrokes by command much easier.
var keystrokesByCode = editor.keystrokeHandler.keystrokes,
keystrokesByName = {};

for ( var i in keystrokesByCode )
keystrokesByName[ keystrokesByCode[ i ] ] = i;
var variablesPattern = /\$\{(.*?)\}/g,
replaceVariables = function( match, name ) {
var keystrokeCode = editor.getCommandKeystroke( name );

return function( match, name ) {
// Return the keystroke representation or leave match untouched
// if there's no keystroke for such command.
return keystrokesByName[ name ] ? representKeyStroke( keystrokesByName[ name ] ) : match;
return keystrokeCode ? representKeyStroke( keystrokeCode ) : match;
};
} )();

// Create the help list directly from lang file entries.
function buildHelpContents() {
@@ -137,13 +127,17 @@ CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {

for ( var j = 0; j < itemsLength; j++ ) {
var item = items[ j ],
itemLegend = item.legend.replace( variablesPattern, replaceVariables );
// (#16980) There should be a different hotkey shown in Commands on Edge browser.
itemLegend = CKEDITOR.env.edge && item.legendEdge ? item.legendEdge : item.legend;

itemLegend = itemLegend.replace( variablesPattern, replaceVariables );

// (#9765) If some commands haven't been replaced in the legend,
// most likely their keystrokes are unavailable and we shouldn't include
// them in our help list.
if ( itemLegend.match( variablesPattern ) )
if ( itemLegend.match( variablesPattern ) ) {
continue;
}

sectionHtml.push( itemTpl.replace( '%1', item.name ).replace( '%2', itemLegend ) );
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'af', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'ar', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'az', {
{
name: 'Hərtərəfli Kömək',
legend: '${a11yHelp} basın'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'bg', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'ca', {
{
name: 'Ajuda d\'accessibilitat',
legend: 'Premi ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'cs', {
{
name: ' Nápověda přístupnosti',
legend: 'Stiskněte ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'cy', {
{
name: 'Cymorth Hygyrchedd',
legend: 'Pwyswch ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'da', {
{
name: 'Tilgængelighedshjælp',
legend: 'Kilk ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'de-ch', {
{
name: 'Eingabehilfen',
legend: 'Drücken Sie ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'de', {
{
name: 'Eingabehilfen',
legend: 'Drücken Sie ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'el', {
{
name: 'Βοήθεια Προσβασιμότητας',
legend: 'Πατήστε ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'en-gb', {
{
name: ' Accessibility Help',
legend: 'Press ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -98,6 +98,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'en', {
{
name: ' Accessibility Help',
legend: 'Press ${a11yHelp}'
},
{
name: ' Paste as plain text',
legend: 'Press ${pastetext}',
legendEdge: 'Press ${pastetext}, followed by ${paste}'
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'eo', {
{
name: 'Helpilo pri atingeblo',
legend: 'Premu ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'es', {
{
name: 'Ayuda de Accesibilidad',
legend: 'Presiona ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'et', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'eu', {
{
name: 'Erabilerraztasunaren laguntza',
legend: 'Sakatu ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'fa', {
{
name: 'راهنمای دسترسی',
legend: 'فشردن ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'fi', {
{
name: 'Saavutettavuus ohjeet',
legend: 'Paina ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'fo', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'fr-ca', {
{
name: 'Aide d\'accessibilité',
legend: 'Appuyer sur ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'fr', {
{
name: ' Aide sur l\'accessibilité',
legend: 'Appuyer sur ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'gl', {
{
name: 'Axuda da accesibilidade',
legend: 'Prema ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'gu', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'he', {
{
name: ' הוראות נגישות',
legend: 'לחץ ${a11yHelp}'
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}
@@ -79,6 +79,11 @@ CKEDITOR.plugins.setLang( 'a11yhelp', 'hi', {
{
name: ' Accessibility Help', // MISSING
legend: 'Press ${a11yHelp}' // MISSING
},
{
name: ' Paste as plain text', // MISSING
legend: 'Press ${pastetext}', // MISSING
legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING
}
]
}

0 comments on commit 606ced7

Please sign in to comment.
You can’t perform that action at this time.