Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tools.keystrokeToArray method #856

Closed
mlewand opened this issue Sep 1, 2017 · 3 comments
Closed

Introduce tools.keystrokeToArray method #856

mlewand opened this issue Sep 1, 2017 · 3 comments
Labels
changelog:api A changelog entry should be put in the API section of the changelog. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Milestone

Comments

@mlewand
Copy link
Contributor

mlewand commented Sep 1, 2017

Are you reporting a feature request or a bug?

New feature

Provide detailed reproduction steps (if any)

Currently keystrokeToString method returns the whole keystroke as a string, like so:

{
	display: '⌘ + X',
	aria: 'COMMAND + X'
}

For a better reusability it should return keys as an array, without joining it to a string with a "+" or any other character.

The easiest solution to that is to add CKEDITOR.tools.keystrokeToArray method, that would return an object like the following:

{
	display: [ '⌘', 'X' ],
	aria: [ 'COMMAND', 'X' ]
}

Then keystrokeToString should reuse it (by simply joining array members using +).

As a follow-up ticket I'd like to improve list of keys supported by keystrokeToString/keystrokeToArray methods, as currently it supports very limited amount of keys, compared to a11yhelp dialog.

@mlewand mlewand added the type:feature A feature request. label Sep 1, 2017
@Comandeer
Copy link
Member

As we already have keystrokeToString, maybe it would be better to name the new function keystrokeToArray – just to be coherent?

@mlewand
Copy link
Contributor Author

mlewand commented Sep 1, 2017

Seems like a good idea, I'll update the original report.

@mlewand mlewand changed the title Method keystrokeToString should return parts in a reusable way Introduce tools.keystrokeToArray method Sep 1, 2017
@mlewand mlewand added status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. labels Sep 1, 2017
@mlewand mlewand added this to the 4.8.0 milestone Sep 5, 2017
@mlewand
Copy link
Contributor Author

mlewand commented Sep 5, 2017

Closed with #858.

@mlewand mlewand closed this as completed Sep 5, 2017
@mlewand mlewand added the changelog:api A changelog entry should be put in the API section of the changelog. label Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:api A changelog entry should be put in the API section of the changelog. status:confirmed An issue confirmed by the development team. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

2 participants