-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Use functions instead of extending CK classes
This reduces plugin size and reduces some issues with transformed classes and babel.
- Loading branch information
Showing
5 changed files
with
63 additions
and
69 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
19 changes: 9 additions & 10 deletions
19
Resources/Private/Scripts/HyphensEditor/src/commands/nbsp.js
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import {Command} from 'ckeditor5-exports'; | ||
|
||
export default class NbspCommand extends Command { | ||
execute() { | ||
const editor = this.editor; | ||
editor.model.change((writer) => { | ||
const insertPosition = editor.model.document.selection.getFirstPosition(); | ||
writer.insertText('\u00A0', insertPosition); | ||
}); | ||
} | ||
export default function NbspCommand(editor) { | ||
return { | ||
execute: () => { | ||
editor.model.change(writer => { | ||
const insertPosition = editor.model.document.selection.getFirstPosition(); | ||
writer.insertText('\u00A0', insertPosition); | ||
}); | ||
} | ||
}; | ||
} |
19 changes: 9 additions & 10 deletions
19
Resources/Private/Scripts/HyphensEditor/src/commands/shy.js
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import {Command} from 'ckeditor5-exports'; | ||
|
||
export default class ShyCommand extends Command { | ||
execute() { | ||
const editor = this.editor; | ||
editor.model.change((writer) => { | ||
const insertPosition = editor.model.document.selection.getFirstPosition(); | ||
writer.insertText('\u00AD', insertPosition); | ||
}); | ||
} | ||
export default function ShyCommand(editor) { | ||
return { | ||
execute: () => { | ||
editor.model.change(writer => { | ||
const insertPosition = editor.model.document.selection.getFirstPosition(); | ||
writer.insertText('\u00AD', insertPosition); | ||
}); | ||
} | ||
}; | ||
} |
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
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
why did we need
pluginName
in the first place :D i mean now its gone, but still working ...