Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit e4fcd39

Browse files
committed
add codetag
1 parent 8357fe3 commit e4fcd39

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Code tag in CKEditor
2+
==============
3+
4+
![](http://imgur.com/LN0MAEZ.png)
5+
6+
Install by placing in ckeditor/plugins/ and add the following to ckeditor/config.js
7+
8+
config.extraPlugins = 'codeTag';
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CKEDITOR.plugins.add( 'codeTag', {
2+
icons: 'code',
3+
init: function( editor ) {
4+
editor.addCommand( 'wrapCode', {
5+
exec: function( editor ) {
6+
editor.insertHtml( '<code>' + editor.getSelection().getSelectedText() + '</code>' );
7+
}
8+
});
9+
editor.ui.addButton( 'Code', {
10+
label: 'Wrap code',
11+
command: 'wrapCode',
12+
toolbar: 'insert'
13+
});
14+
}
15+
});

0 commit comments

Comments
 (0)