Skip to content
Permalink
Browse files

Merge branch 't/10015' into major

  • Loading branch information...
mlewand committed Sep 28, 2016
2 parents 570f5aa + 90c0db2 commit 320de9490c4c595e3f8024ec3bd1ee1bea8e5dcd
Showing with 1,491 additions and 154 deletions.
  1. +1 −0 CHANGES.md
  2. +10 −0 core/commanddefinition.js
  3. +26 −0 core/editor.js
  4. +61 −0 core/tools.js
  5. +19 −2 lang/af.js
  6. +19 −2 lang/ar.js
  7. +19 −2 lang/bg.js
  8. +19 −2 lang/bn.js
  9. +19 −2 lang/bs.js
  10. +19 −2 lang/ca.js
  11. +19 −2 lang/cs.js
  12. +19 −2 lang/cy.js
  13. +19 −2 lang/da.js
  14. +19 −2 lang/de.js
  15. +19 −2 lang/el.js
  16. +19 −2 lang/en-au.js
  17. +19 −2 lang/en-ca.js
  18. +19 −2 lang/en-gb.js
  19. +19 −2 lang/en.js
  20. +19 −2 lang/eo.js
  21. +19 −2 lang/es.js
  22. +19 −2 lang/et.js
  23. +19 −2 lang/eu.js
  24. +19 −2 lang/fa.js
  25. +19 −2 lang/fi.js
  26. +19 −2 lang/fo.js
  27. +19 −2 lang/fr-ca.js
  28. +19 −2 lang/fr.js
  29. +19 −2 lang/gl.js
  30. +19 −2 lang/gu.js
  31. +19 −2 lang/he.js
  32. +19 −2 lang/hi.js
  33. +19 −2 lang/hr.js
  34. +19 −2 lang/hu.js
  35. +19 −2 lang/id.js
  36. +19 −2 lang/is.js
  37. +19 −2 lang/it.js
  38. +19 −2 lang/ja.js
  39. +19 −2 lang/ka.js
  40. +19 −2 lang/km.js
  41. +19 −2 lang/ko.js
  42. +19 −2 lang/ku.js
  43. +19 −2 lang/lt.js
  44. +19 −2 lang/lv.js
  45. +19 −2 lang/mk.js
  46. +19 −2 lang/mn.js
  47. +19 −2 lang/ms.js
  48. +19 −2 lang/nb.js
  49. +19 −2 lang/nl.js
  50. +19 −2 lang/no.js
  51. +19 −2 lang/pl.js
  52. +19 −2 lang/pt-br.js
  53. +19 −2 lang/pt.js
  54. +19 −2 lang/ro.js
  55. +19 −2 lang/ru.js
  56. +19 −2 lang/si.js
  57. +19 −2 lang/sk.js
  58. +19 −2 lang/sl.js
  59. +19 −2 lang/sq.js
  60. +19 −2 lang/sr-latn.js
  61. +19 −2 lang/sr.js
  62. +19 −2 lang/sv.js
  63. +19 −2 lang/th.js
  64. +19 −2 lang/tr.js
  65. +19 −2 lang/tt.js
  66. +19 −2 lang/ug.js
  67. +19 −2 lang/uk.js
  68. +19 −2 lang/vi.js
  69. +19 −2 lang/zh-cn.js
  70. +19 −2 lang/zh.js
  71. +15 −3 plugins/button/plugin.js
  72. +2 −1 plugins/clipboard/plugin.js
  73. +29 −5 plugins/menu/plugin.js
  74. +8 −0 skins/kama/menu.css
  75. +6 −0 skins/moono-lisa/menu.css
  76. +6 −0 skins/moono/menu.css
  77. +27 −11 tests/core/editor/keystrokehandler.js
  78. +28 −2 tests/core/tools.js
  79. +7 −0 tests/tickets/10015/1.html
  80. +11 −0 tests/tickets/10015/1.md
@@ -6,6 +6,7 @@ CKEditor 4 Changelog
New Features:

* [#14569](http://dev.ckeditor.com/ticket/14569): Added new CKEditor skin.
* [#10015](http://dev.ckeditor.com/ticket/10015): Make keyboard controls more discoverable.
* [#12541](http://dev.ckeditor.com/ticket/12541): Added the [Upload File](http://ckeditor.com/addon/uploadfile) plugin.
* [#13794](http://dev.ckeditor.com/ticket/13794): [Upload Image](http://ckeditor.com/addon/uploadimage) Use `uploaded.width/height` if set.
* [#13829](http://dev.ckeditor.com/ticket/13829): Fixed: No class in [Widget](http://ckeditor.com/addon/widget) wrapper that would identify the widget type.
@@ -146,3 +146,13 @@
* @since 4.0
* @property {Boolean} [readOnly=false]
*/

/**
* Property should be set when command has no keystroke assigned by {@link CKEDITOR.editor#setKeystroke}, but
* keystroke is still supported. For example: `cut`, `copy` and `paste` commands are handled that way.
* This property is used when displaying keystroke information in tooltips and context menus. It is used by
* {@link CKEDITOR.editor#getCommandKeystroke}.
*
* @since 4.6.0
* @property {Number} fakeKeystroke
*/
@@ -1323,6 +1323,32 @@
}
},

/**
* Returns keystroke that is assigned to specified {@link CKEDITOR.command}. If there is no keystroke assigned - returns null.
*
* @since 4.6.0
* @param {CKEDITOR.command} command
* @returns {Number} Keystroke assigned to provided command or null if there is no keystroke.
*/
getCommandKeystroke: function( command ) {
var commandName = command.name,
keystrokes = this.keystrokeHandler.keystrokes,
key;

// Some commands have a fake keystroke - for example CUT/COPY/PASTE commands are handled natively.
if ( command.fakeKeystroke ) {
return command.fakeKeystroke;
}

for ( key in keystrokes ) {
if ( keystrokes.hasOwnProperty( key ) && keystrokes[ key ] == commandName ) {
return key;
}
}

return null;
},

/**
* Shorthand for {@link CKEDITOR.filter#addFeature}.
*
@@ -1313,6 +1313,67 @@
return false;
},

/**
* Converts keystroke to its string representation. Returns object with two fields:
*
* * `display` - string that should be used for visible labels,
* for Mac devices uses `⌥` for `ALT`, `⇧` for `SHIFT` and `⌘` for `COMMAND`.
* * `aria` - string that should be used for ARIA descriptions,
* it is not using special characters like `⌥`, `⇧` or `⌘`.
*
* var lang = editor.lang.common.keyboard;
* var shortcut = CKEDITOR.tools.keystrokeToString( lang, CKEDITOR.CTRL + 88 );
* console.log( shortcut.display ); // 'CTRL + X', on Mac '⌘ + X'
* console.log( shortcut.aria ); // 'CTRL + X', on Mac 'COMMAND + X'
*
* @since 4.6.0
* @param {Object} lang Language object with key name translation.
* @param {Number} keystroke Keystroke to convert.
* @returns {{display: String, aria: String}}
*/
keystrokeToString: function( lang, keystroke ) {
var special = keystroke & 0xFF0000,
key = keystroke & 0x00FFFF,
isMac = CKEDITOR.env.mac,
CTRL = 17,
CMD = 224,
ALT = 18,
SHIFT = 16,
display = [],
aria = [];


if ( special & CKEDITOR.CTRL ) {
display.push( isMac ? '' : lang[ CTRL ] );
aria.push( isMac ? lang[ CMD ] : lang[ CTRL ] );
}

if ( special & CKEDITOR.ALT ) {
display.push( isMac ? '' : lang[ ALT ] );
aria.push( lang[ ALT ] );
}

if ( special & CKEDITOR.SHIFT ) {
display.push( isMac ? '' : lang[ SHIFT ] );
aria.push( lang[ SHIFT ] );
}

if ( key ) {
if ( lang[ key ] ) {
display.push( lang[ key ] );
aria.push( lang[ key ] );
} else {
display.push( String.fromCharCode( key ) );
aria.push( String.fromCharCode( key ) );
}
}

return {
display: display.join( '+' ),
aria: aria.join( '+' )
};
},

/**
* The data URI of a transparent image. May be used e.g. in HTML as an image source or in CSS in `url()`.
*
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'af' ] = {
alignMiddle: 'Middel',
alignBottom: 'Onder',
alignNone: 'Geen',
invalidValue : 'Ongeldige waarde',
invalidValue: 'Ongeldige waarde',
invalidHeight: 'Hoogte moet \'n getal wees',
invalidWidth: 'Breedte moet \'n getal wees.',
invalidCssLength: 'Die waarde vir die "%1" veld moet \'n posetiewe getal wees met of sonder \'n geldige CSS eenheid (px, %, in, cm, mm, em, ex, pt, of pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'af' ] = {
cssLengthTooltip: 'Voeg \'n getal wert in pixel in, of \'n waarde met geldige CSS eenheid (px, %, in, cm, mm, em, ex, pt, of pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, nie beskikbaar nie</span>'
unavailable: '%1<span class="cke_accessibility">, nie beskikbaar nie</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'ar' ] = {
alignMiddle: 'وسط',
alignBottom: 'أسفل',
alignNone: 'None', // MISSING
invalidValue : 'قيمة غير مفبولة.',
invalidValue: 'قيمة غير مفبولة.',
invalidHeight: 'الارتفاع يجب أن يكون عدداً.',
invalidWidth: 'العرض يجب أن يكون عدداً.',
invalidCssLength: 'قيمة الخانة المخصصة لـ "%1" يجب أن تكون رقما موجبا، باستخدام أو من غير استخدام وحدة CSS قياس مقبولة (px, %, in, cm, mm, em, ex, pt, or pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'ar' ] = {
cssLengthTooltip: 'أدخل رقما للقيمة بالبكسل أو رقما بوحدة CSS مقبولة (px, %, in, cm, mm, em, ex, pt, or pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, غير متاح</span>'
unavailable: '%1<span class="cke_accessibility">, غير متاح</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'bg' ] = {
alignMiddle: 'По средата',
alignBottom: 'Долу',
alignNone: 'Без подравняване',
invalidValue : 'Невалидна стойност.',
invalidValue: 'Невалидна стойност.',
invalidHeight: 'Височината трябва да е число.',
invalidWidth: 'Ширина требе да е число.',
invalidCssLength: 'Стойността на полето "%1" трябва да бъде положително число с или без валидна CSS измервателна единица (px, %, in, cm, mm, em, ex, pt, или pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'bg' ] = {
cssLengthTooltip: 'Въведете числена стойност в пиксели или друга валидна CSS единица (px, %, in, cm, mm, em, ex, pt, или pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, недостъпно</span>'
unavailable: '%1<span class="cke_accessibility">, недостъпно</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'bn' ] = {
alignMiddle: 'মধ্য',
alignBottom: 'নীচে',
alignNone: 'None', // MISSING
invalidValue : 'Invalid value.', // MISSING
invalidValue: 'Invalid value.', // MISSING
invalidHeight: 'Height must be a number.', // MISSING
invalidWidth: 'Width must be a number.', // MISSING
invalidCssLength: 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'bn' ] = {
cssLengthTooltip: 'Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, unavailable</span>' // MISSING
unavailable: '%1<span class="cke_accessibility">, unavailable</span>', // MISSING

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'bs' ] = {
alignMiddle: 'Sredina',
alignBottom: 'Dno',
alignNone: 'None', // MISSING
invalidValue : 'Invalid value.', // MISSING
invalidValue: 'Invalid value.', // MISSING
invalidHeight: 'Height must be a number.', // MISSING
invalidWidth: 'Width must be a number.', // MISSING
invalidCssLength: 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'bs' ] = {
cssLengthTooltip: 'Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).', // MISSING

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, unavailable</span>' // MISSING
unavailable: '%1<span class="cke_accessibility">, unavailable</span>', // MISSING

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'ca' ] = {
alignMiddle: 'Centre',
alignBottom: 'Inferior',
alignNone: 'None', // MISSING
invalidValue : 'Valor no vàlid.',
invalidValue: 'Valor no vàlid.',
invalidHeight: 'L\'alçada ha de ser un número.',
invalidWidth: 'L\'amplada ha de ser un número.',
invalidCssLength: 'El valor especificat per als "%1" camps ha de ser un número positiu amb o sense unitat de mesura vàlida de CSS (px, %, in, cm, mm, em, ex, pt o pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'ca' ] = {
cssLengthTooltip: 'Introduïu un número per un valor en píxels o un número amb una unitat vàlida de CSS (px, %, in, cm, mm, em, ex, pt o pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, no disponible</span>'
unavailable: '%1<span class="cke_accessibility">, no disponible</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'cs' ] = {
alignMiddle: 'Na střed',
alignBottom: 'Dolů',
alignNone: 'Žádné',
invalidValue : 'Neplatná hodnota.',
invalidValue: 'Neplatná hodnota.',
invalidHeight: 'Zadaná výška musí být číslo.',
invalidWidth: 'Šířka musí být číslo.',
invalidCssLength: 'Hodnota určená pro pole "%1" musí být kladné číslo bez nebo s platnou jednotkou míry CSS (px, %, in, cm, mm, em, ex, pt, nebo pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'cs' ] = {
cssLengthTooltip: 'Zadejte číslo jako hodnotu v pixelech nebo číslo s platnou jednotkou CSS (px, %, v cm, mm, em, ex, pt, nebo pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, nedostupné</span>'
unavailable: '%1<span class="cke_accessibility">, nedostupné</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
@@ -86,7 +86,7 @@ CKEDITOR.lang[ 'cy' ] = {
alignMiddle: 'Canol',
alignBottom: 'Gwaelod',
alignNone: 'None', // MISSING
invalidValue : 'Gwerth annilys.',
invalidValue: 'Gwerth annilys.',
invalidHeight: 'Mae\'n rhaid i\'r uchder fod yn rhif.',
invalidWidth: 'Mae\'n rhaid i\'r lled fod yn rhif.',
invalidCssLength: 'Mae\'n rhaid i\'r gwerth ar gyfer maes "%1" fod yn rhif positif gyda neu heb uned fesuriad CSS dilys (px, %, in, cm, mm, em, ex, pt, neu pc).',
@@ -95,6 +95,23 @@ CKEDITOR.lang[ 'cy' ] = {
cssLengthTooltip: 'Rhowch rif am werth mewn picsel neu rhif gydag uned CSS dilys (px, %, in, cm, mm, em, pt neu pc).',

// Put the voice-only part of the label in the span.
unavailable: '%1<span class="cke_accessibility">, ddim ar gael</span>'
unavailable: '%1<span class="cke_accessibility">, ddim ar gael</span>',

// Keyboard keys translations used for creating shortcuts descriptions in tooltips, context menus and ARIA labels.
keyboard: {
8: 'Backspace', // MISSING
13: 'Enter', // MISSING
16: 'Shift', // MISSING
17: 'Ctrl', // MISSING
18: 'Alt', // MISSING
32: 'Space', // MISSING
35: 'End', // MISSING
36: 'Home', // MISSING
46: 'Delete', // MISSING
224: 'Command' // MISSING
},

// Prepended to ARIA labels with shortcuts.
keyboardShortcut: 'Keyboard shortcut' // MISSING
}
};
Oops, something went wrong.

0 comments on commit 320de94

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