Hi,
I want to extend the CKEditor with an video Function. Unfortunately I fail by adding an extra button. I created a hook plugin with the file
ckconfig.jsp but the toolbar is not changing. Although I noticed that the toolbar view not match to the structure in die config file. Can anybody help me how to extend the ckeditor in liferay?
1
2<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
3<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
4<%String cssPath = ParamUtil.getString(request, "cssPath");%>
5
6[color=#e80c0c][b]
7//Ergänzungen für das Kaltura-Plugin
8CKEDITOR.plugins.add( 'abbr',
9{
10 init: function( ckEditor )
11 {
12 // Plugin logic goes here...
13 }
14} );
15ckEditor.addCommand( 'abbrDialog', new CKEDITOR.dialogCommand( 'abbrDialog' ) );
16ckEditor.ui.addButton( 'Abbr',
17{
18 label: 'Insert Abbreviation',
19 command: 'abbrDialog',
20 icon: this.path + 'images/icon.png'
21} );[/color][/b]
22
23CKEDITOR.addStylesSet(
24 'liferayStyles',
25 [
26
27 // Block Styles
28 {name: 'Normal', element : 'p'},
29 {name: 'Heading 1', element : 'h1'},
30 {name: 'Heading 2', element : 'h2'},
31 {name: 'Heading 3', element : 'h3'},
32 {name: 'Heading 4', element : 'h4'},
33
34 //Special classes
35 {name: 'Preformatted Text', element:'pre'},
36 {name: 'Cited Work', element:'cite'},
37 {name: 'Computer Code', element:'code'},
38
39 //Custom styles
40 {name : 'Info Message', element : 'div', attributes : {'class' : 'portlet-msg-info'}},
41 {name : 'Alert Message', element : 'div', attributes : {'class' : 'portlet-msg-alert'}},
42 {name : 'Error Message', element : 'div', attributes : {'class' : 'portlet-msg-error'}}
43 ]
44);
45
46CKEDITOR.config.contentsCss = '<%= HtmlUtil.escape(cssPath) %>/main.css';
47CKEDITOR.config.entities = false;
48CKEDITOR.config.resize_enabled = false;
49CKEDITOR.config.height = 265;
50CKEDITOR.config.stylesCombo_stylesSet = 'liferayStyles';
51CKEDITOR.config.toolbar_liferay = [
52 ['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
53 ['Bold', 'Italic', 'Underline', 'StrikeThrough'],
54 ['Subscript', 'Superscript'],
55 '/',
56 ['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
57 ['Find', 'Replace', 'SpellCheck'],
58 ['OrderedList', 'UnorderedList', '-', 'Outdent', 'Indent'],
59 ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
60 '/',
61 ['Source'],
62 ['Link', 'Unlink', 'Anchor'],
63 [b][color=#e80c0c]['Abbr'[/color][/b]],'Image', 'Flash', 'Table', '-', 'Smiley', 'SpecialChar']
64];
Por favor, faça login para denunciar.