-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.js
More file actions
33 lines (28 loc) · 767 Bytes
/
plugin.js
File metadata and controls
33 lines (28 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* markText Plugin
*
* @author Peter Neumann
*/
CKEDITOR.plugins.add('markTag', {
icons: 'mark',
lang: [
'en', 'de',
],
init: function (editor) {
var style = new CKEDITOR.style({ element: 'mark' })
// Listen for contextual style activation
editor.attachStyleStateChange(style, function (state) {
!editor.readOnly && editor.getCommand('wrapMark').setState(state)
})
// Adding/Creating command.
editor.addCommand('wrapMark', new CKEDITOR.styleCommand(style))
// Register the button, when the button plugin is enabled
if (editor.ui.addButton) {
editor.ui.addButton('Mark', {
label: editor.lang.markTag.button,
command: 'wrapMark',
toolbar: 'basicstyles',
})
}
},
})