config.js
3.62 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.add('artecode', {
init: function (editor) {
editor.addCommand('insertJS', {
exec: function (editor) {
editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-javascript">Amazing Js code</code></pre>');
}
});
editor.ui.addButton('insertJS', {
label: 'Wstaw JS',
command: 'insertJS',
icon: this.path + 'js.png'
});
editor.addCommand('insertHTML', {
exec: function (editor) {
editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-twig">Amazing HTML5/TWIG code</code></pre>');
}
});
editor.ui.addButton('insertHTML', {
label: 'Wstaw HTML',
command: 'insertHTML',
icon: this.path + 'html5.png'
});
editor.addCommand('insertCSS', {
exec: function (editor) {
editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-less">Amazing CSS3/LESS code</code></pre>');
}
});
editor.ui.addButton('insertCSS', {
label: 'Wstaw CSS3',
command: 'insertCSS',
icon: this.path + 'css3.png'
});
editor.addCommand('insertBash', {
exec: function (editor) {
editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-bash">Amazing Bash code</code></pre>');
}
});
editor.ui.addButton('insertBash', {
label: 'Wstaw Bash',
command: 'insertBash',
icon: this.path + 'bash.png'
});
editor.addCommand('insertPhp', {
exec: function (editor) {
editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-php">Amazing PHP7 code</code></pre>');
}
});
editor.ui.addButton('insertPhp', {
label: 'Wstaw PHP',
command: 'insertPhp',
icon: this.path + 'php7.png'
});
}
});
CKEDITOR.editorConfig = function (config) {
config.extraPlugins = 'artecode';
config.toolbar = [
{name: 'document', groups: ['mode', 'document', 'doctools', 'clipboard', 'undo'], items: ['Source', '-', 'Save', '-', 'Templates', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
{name: 'artecode', items: ['insertPhp', 'insertHTML', 'insertJS', 'insertCSS', 'insertBash']},
{name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi'], items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']},
{name: 'links', items: ['Link', 'Unlink', 'Anchor']},
{name: 'styles', items: ['Format', 'Font', 'FontSize']},
{name: 'colors', items: ['TextColor', 'BGColor']},
{name: 'editing', groups: ['find', 'selection', 'spellchecker'], items: ['Replace']},
{name: 'tools', items: ['Maximize', 'ShowBlocks']},
{name: 'others', items: ['-']},
{name: 'about', items: ['About']}
];
config.disableNativeSpellChecker = false;
};