Arek Wtykło

arteCode dla CKEditora

... ... @@ -3,33 +3,71 @@
* 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-html">Amazing HTML5 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-css">Amazing CSS3 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) {
// alert('df');
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
// config.uiColor = 'fff';
// config.toolbar = [
// {name: 'document', groups: ['mode', 'document', 'doctools'], items: ['Source', '-', 'Save', '-', 'Templates']},
// {name: 'clipboard', groups: ['clipboard', 'undo'], items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
// '/',
// {name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
// {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.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']},
... ...