Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add IndentBlock plugin & make editor config simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
panr committed Mar 25, 2020
1 parent 62da9fa commit 3c75814
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 70 deletions.
29 changes: 28 additions & 1 deletion docs/_snippets/features/build-table-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,37 @@ import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily';
import FontSize from '@ckeditor/ckeditor5-font/src/fontsize';
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';

ClassicEditor.builtinPlugins.push( FontFamily, FontSize, Alignment );
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor.builtinPlugins.push( FontFamily, FontSize, Alignment, IndentBlock );
ClassicEditor.defaultConfig = {
cloudServices: CS_CONFIG,
toolbar: {
items: [
'insertTable',
'|',
'fontFamily', 'fontSize',
'|',
'bold', 'italic',
'|',
'alignment:left', 'alignment:center', 'alignment:right', 'alignment:justify',
'|',
'bulletedList', 'numberedList',
'|',
'indent', 'outdent',
'|',
'link', 'blockQuote',
'|',
'undo', 'redo'
],
viewportTopOffset: window.getViewportTopOffsetConfig()
},
indentBlock: { offset: 30, unit: 'px' }
};

window.ClassicEditor = ClassicEditor;
window.CKEditorPlugins = {
Expand Down
23 changes: 0 additions & 23 deletions docs/_snippets/features/table-styling-colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

/* globals ClassicEditor, CKEditorPlugins, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

const customColorPalette = [
{
color: 'hsl(4, 90%, 58%)',
Expand Down Expand Up @@ -96,27 +94,6 @@ ClassicEditor
CKEditorPlugins.TableProperties,
CKEditorPlugins.TableCellProperties
],
cloudServices: CS_CONFIG,
toolbar: {
items: [
'insertTable',
'|',
'fontFamily', 'fontSize',
'|',
'bold', 'italic',
'|',
'alignment:left', 'alignment:center', 'alignment:right', 'alignment:justify',
'|',
'bulletedList', 'numberedList',
'|',
'indent', 'outdent',
'|',
'link', 'blockQuote',
'|',
'undo', 'redo'
],
viewportTopOffset: window.getViewportTopOffsetConfig()
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ],
tableProperties: {
Expand Down
23 changes: 0 additions & 23 deletions docs/_snippets/features/table-styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

/* globals ClassicEditor, CKEditorPlugins, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

const COLOR_PALETTE = [
{
color: 'hsl(0, 0%, 0%)',
Expand Down Expand Up @@ -97,27 +95,6 @@ ClassicEditor
CKEditorPlugins.TableProperties,
CKEditorPlugins.TableCellProperties
],
cloudServices: CS_CONFIG,
toolbar: {
items: [
'insertTable',
'|',
'fontFamily', 'fontSize',
'|',
'bold', 'italic',
'|',
'alignment:left', 'alignment:center', 'alignment:right', 'alignment:justify',
'|',
'bulletedList', 'numberedList',
'|',
'indent', 'outdent',
'|',
'link', 'blockQuote',
'|',
'undo', 'redo'
],
viewportTopOffset: window.getViewportTopOffsetConfig()
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties' ],
tableProperties: {
Expand Down
23 changes: 0 additions & 23 deletions docs/_snippets/features/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,8 @@

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#snippet-table' ), {
cloudServices: CS_CONFIG,
toolbar: {
items: [
'insertTable',
'|',
'fontFamily', 'fontSize',
'|',
'bold', 'italic',
'|',
'alignment:left', 'alignment:center', 'alignment:right', 'alignment:justify',
'|',
'bulletedList', 'numberedList',
'|',
'indent', 'outdent',
'|',
'link', 'blockQuote',
'|',
'undo', 'redo'
],
viewportTopOffset: window.getViewportTopOffsetConfig()
},
table: {
contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
}
Expand Down

0 comments on commit 3c75814

Please sign in to comment.