Arek Wtykło

arteCode dla CKEditora

@@ -15,10 +15,10 @@ CKEDITOR.plugins.add('artecode', { @@ -15,10 +15,10 @@ CKEDITOR.plugins.add('artecode', {
15 command: 'insertJS', 15 command: 'insertJS',
16 icon: this.path + 'js.png' 16 icon: this.path + 'js.png'
17 }); 17 });
18 - 18 +
19 editor.addCommand('insertHTML', { 19 editor.addCommand('insertHTML', {
20 exec: function (editor) { 20 exec: function (editor) {
21 - editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-html">Amazing HTML5 code</code></pre>'); 21 + editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-twig">Amazing HTML5/TWIG code</code></pre>');
22 } 22 }
23 }); 23 });
24 editor.ui.addButton('insertHTML', { 24 editor.ui.addButton('insertHTML', {
@@ -26,10 +26,10 @@ CKEDITOR.plugins.add('artecode', { @@ -26,10 +26,10 @@ CKEDITOR.plugins.add('artecode', {
26 command: 'insertHTML', 26 command: 'insertHTML',
27 icon: this.path + 'html5.png' 27 icon: this.path + 'html5.png'
28 }); 28 });
29 - 29 +
30 editor.addCommand('insertCSS', { 30 editor.addCommand('insertCSS', {
31 exec: function (editor) { 31 exec: function (editor) {
32 - editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-css">Amazing CSS3 code</code></pre>'); 32 + editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-less">Amazing CSS3/LESS code</code></pre>');
33 } 33 }
34 }); 34 });
35 editor.ui.addButton('insertCSS', { 35 editor.ui.addButton('insertCSS', {
@@ -37,7 +37,7 @@ CKEDITOR.plugins.add('artecode', { @@ -37,7 +37,7 @@ CKEDITOR.plugins.add('artecode', {
37 command: 'insertCSS', 37 command: 'insertCSS',
38 icon: this.path + 'css3.png' 38 icon: this.path + 'css3.png'
39 }); 39 });
40 - 40 +
41 editor.addCommand('insertBash', { 41 editor.addCommand('insertBash', {
42 exec: function (editor) { 42 exec: function (editor) {
43 editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-bash">Amazing Bash code</code></pre>'); 43 editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-bash">Amazing Bash code</code></pre>');
@@ -48,7 +48,7 @@ CKEDITOR.plugins.add('artecode', { @@ -48,7 +48,7 @@ CKEDITOR.plugins.add('artecode', {
48 command: 'insertBash', 48 command: 'insertBash',
49 icon: this.path + 'bash.png' 49 icon: this.path + 'bash.png'
50 }); 50 });
51 - 51 +
52 editor.addCommand('insertPhp', { 52 editor.addCommand('insertPhp', {
53 exec: function (editor) { 53 exec: function (editor) {
54 editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-php">Amazing PHP7 code</code></pre>'); 54 editor.insertHtml('<p><br/></p><pre><code class="line-numbers language-php">Amazing PHP7 code</code></pre>');
@@ -64,6 +64,8 @@ CKEDITOR.plugins.add('artecode', { @@ -64,6 +64,8 @@ CKEDITOR.plugins.add('artecode', {
64 64
65 65
66 CKEDITOR.editorConfig = function (config) { 66 CKEDITOR.editorConfig = function (config) {
  67 + config.extraPlugins = 'artecode';
  68 +
67 config.toolbar = [ 69 config.toolbar = [
68 {name: 'document', groups: ['mode', 'document', 'doctools', 'clipboard', 'undo'], items: ['Source', '-', 'Save', '-', 'Templates', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, 70 {name: 'document', groups: ['mode', 'document', 'doctools', 'clipboard', 'undo'], items: ['Source', '-', 'Save', '-', 'Templates', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
69 {name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']}, 71 {name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},