This repository was archived by the owner on Nov 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed
static/ckeditor/ckeditor/plugins/codetagstyle Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
- VERSION = (5 , 4 , 0 , 1 )
1
+ VERSION = (5 , 4 , 0 , 4 )
2
2
__version__ = '.' .join (map (str , VERSION ))
Original file line number Diff line number Diff line change
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';
Original file line number Diff line number Diff line change
1
+ CKEDITOR . plugins . add ( 'codetagstyle' , {
2
+ icons : 'code' ,
3
+ init ( editor ) {
4
+ var style = new CKEDITOR . style ( { element : 'code' } ) ,
5
+ forms = [ 'code' ] ;
6
+
7
+ // Put the style as the most important form.
8
+ forms . unshift ( style ) ;
9
+
10
+ // Listen to contextual style activation.
11
+ editor . attachStyleStateChange ( style , function ( state ) {
12
+ ! editor . readOnly && editor . getCommand ( 'wrapCode' ) . setState ( state ) ;
13
+ } ) ;
14
+
15
+ // Create the command that can be used to apply the style.
16
+ editor . addCommand ( 'wrapCode' , new CKEDITOR . styleCommand ( style , {
17
+ contentForms : forms ,
18
+ } ) ) ;
19
+
20
+ // Register the button, if the button plugin is loaded.
21
+ if ( editor . ui . addButton ) {
22
+ editor . ui . addButton ( 'Code' , {
23
+ label : 'Code' ,
24
+ command : 'wrapCode' ,
25
+ toolbar : 'insert' ,
26
+ } ) ;
27
+ }
28
+
29
+ editor . setKeystroke ( [
30
+ [ CKEDITOR . CTRL + 75 , 'wrapCode' ] ,
31
+ ] ) ;
32
+ } ,
33
+ } ) ;
You can’t perform that action at this time.
0 commit comments