Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Minor documentation fixes and aligned keystrokes notation to the stan…
Browse files Browse the repository at this point in the history
…dard.
  • Loading branch information
Reinmar committed Jun 15, 2017
1 parent 843e7a4 commit 8c6cd2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/editingkeystrokehandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
*
* E.g. an undo plugin would do this:
*
* editor.keystrokes.set( 'ctrl + Z', 'undo' );
* editor.keystrokes.set( 'ctrl + shift + Z', 'redo' );
* editor.keystrokes.set( 'ctrl + Y', 'redo' );
* editor.keystrokes.set( 'Ctrl+Z', 'undo' );
* editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
*
* @extends utils/keystrokehandler~KeystrokeHandler
*/
Expand All @@ -43,15 +43,15 @@ export default class EditingKeystrokeHandler extends KeystrokeHandler {
/**
* Registers a handler for the specified keystroke.
*
* * The handler can be specified as a command name or a callback.
* The handler can be specified as a command name or a callback.
*
* @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
* the {@link module:utils/keyboard~parseKeystroke} function.
* @param {Function} callback If a string is passed, then the keystroke will
* @param {Function|String} callback If a string is passed, then the keystroke will
* {@link module:core/editor/editor~Editor#execute execute a command}.
* If a function, then it will be called with the
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
* a helper to both `preventDefault` and `stopPropagation` of the event.
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
*/
set( keystroke, callback ) {
if ( typeof callback == 'string' ) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mix( Plugin, ObservableMixin );
* static get requires() {
* return [ Image ];
* }
* }
* }
*
* @static
* @readonly
Expand Down
8 changes: 4 additions & 4 deletions tests/editingkeystrokehandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe( 'EditingKeystrokeHandler', () => {
it( 'prevents default when the keystroke was handled', () => {
const keyEvtData = getCtrlA();

keystrokes.set( 'ctrl + A', 'foo' );
keystrokes.set( 'Ctrl+A', 'foo' );
keystrokes.press( keyEvtData );

sinon.assert.calledWithExactly( executeSpy, 'foo' );
Expand All @@ -48,7 +48,7 @@ describe( 'EditingKeystrokeHandler', () => {
const callback = sinon.spy();
const keyEvtData = getCtrlA();

keystrokes.set( 'ctrl + A', callback );
keystrokes.set( 'Ctrl+A', callback );
keystrokes.press( keyEvtData );

sinon.assert.calledOnce( callback );
Expand All @@ -60,7 +60,7 @@ describe( 'EditingKeystrokeHandler', () => {

describe( 'press()', () => {
it( 'executes a command', () => {
keystrokes.set( 'ctrl + A', 'foo' );
keystrokes.set( 'Ctrl+A', 'foo' );

const wasHandled = keystrokes.press( getCtrlA() );

Expand All @@ -72,7 +72,7 @@ describe( 'EditingKeystrokeHandler', () => {
it( 'executes a callback', () => {
const callback = sinon.spy();

keystrokes.set( 'ctrl + A', callback );
keystrokes.set( 'Ctrl+A', callback );

const wasHandled = keystrokes.press( getCtrlA() );

Expand Down

0 comments on commit 8c6cd2f

Please sign in to comment.