浏览代码

Minor documentation fixes and aligned keystrokes notation to the standard.

Piotrek Koszuliński 8 年之前
父节点
当前提交
7c1d584e99

+ 6 - 6
packages/ckeditor5-core/src/editingkeystrokehandler.js

@@ -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
  */
@@ -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' ) {

+ 1 - 1
packages/ckeditor5-core/src/plugin.js

@@ -95,7 +95,7 @@ mix( Plugin, ObservableMixin );
  *			static get requires() {
  *				return [ Image ];
  *			}
- *      }
+ *		}
  *
  * @static
  * @readonly

+ 4 - 4
packages/ckeditor5-core/tests/editingkeystrokehandler.js

@@ -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' );
@@ -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 );
@@ -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() );
 
@@ -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() );