-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mateusz Samsel
committed
Jun 27, 2017
1 parent
aff1091
commit 5bb4ad9
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<textarea id="editor1"> | ||
<h1>Hello world!</h1> | ||
<p>I'm an instance of <a href="http://ckeditor.com">CKEditor</a>.</p> | ||
</textarea> | ||
|
||
<button onclick="addCommands();" >Re-create editor</button> | ||
|
||
<script> | ||
if ( bender.tools.env.mobile ) { | ||
bender.ignore(); | ||
} | ||
|
||
var editor = CKEDITOR.replace( 'editor1' ); | ||
|
||
|
||
function addCommands() { | ||
editor.destroy(); | ||
editor =CKEDITOR.replace( 'editor1' ); | ||
|
||
editor.addCommand( 'extra1', { | ||
exec: function() {}, | ||
label: 'Extra command 1' | ||
} ); | ||
editor.addCommand( 'extra2', { | ||
exec: function() {}, | ||
label: 'Extra command 2', | ||
description: 'This command contains some description.' | ||
} ); | ||
editor.addCommand( 'extra3', { | ||
exec: function() {}, | ||
label: 'Extra command 3', | ||
} ); | ||
|
||
editor.setKeystroke( CKEDITOR.SHIFT + CKEDITOR.ALT + 65, 'extra1' ); | ||
editor.setKeystroke( CKEDITOR.SHIFT + CKEDITOR.ALT + 66, 'extra2' ); | ||
editor.setKeystroke( CKEDITOR.SHIFT + CKEDITOR.ALT + 67, 'extra3' ); | ||
|
||
editor.on( 'keystrokeEntry', function( evt ) { | ||
if ( evt.data.commandName === 'extra3' ) { | ||
evt.data.label = 'This label was modified by event.' | ||
} | ||
} ); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@bender-tags: manual, 456, tc, 4.8.0, feature | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea,a11yhelp | ||
|
||
1. Focus editor | ||
1. Press `Alt + 0`, there should be section **Commands table** | ||
1. Table should contain at least one keystroke `Alt + 0` | ||
1. Press `Re-create editor`, this will remake editor and add 3 new keystrokes | ||
1. Press `Alt + 0` | ||
1. Table should contains 3 new keystrokes: | ||
- `Alt + Shift + A` | ||
- `Alt + Shift + B`, with description | ||
- `Alt + Shift + C`, with modify label | ||
|
||
**Unexpected:** Keystrokes are not displayed in accessibility dialog. |