aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/cke/default-config.js
blob: 5649549aaa5c20ab240e3d8eb2c93e405a7c29dc (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import coreTranslations from 'ckeditor5/translations/de.js';

const customColorPalette = [
    { color: '#000000' },
    { color: '#6c737a' }, //75%
    { color: '#a7abaf' }, //45%
    { color: '#c4c7c9' }, //30%
    { color: '#ffffff', hasBorder: true },

    { color: '#cb1800' }, //red
    { color: '#f26e00' }, //pumpkin
    { color: '#ffbd33' }, //yellow
    { color: '#8bbd40' }, // apple green
    { color: '#00962d' }, //green

    { color: '#41afaa' }, //verdigris
    { color: '#a9b6cb' }, // blue 40%
    { color: '#28497c' }, // blue
    { color: '#bf5796' }, // mulberry
    { color: '#8656a2' }, // royal purple
];

const defaultConfig = {
    fontColor: {
        colors: customColorPalette,
    },
    fontBackgroundColor: {
        colors: customColorPalette,
    },
    image: {
        resizeOptions: [
            {
                name: 'resizeImage:original',
                value: null,
                icon: 'original'
            },
            {
                name: 'resizeImage:25',
                value: '25',
                icon: 'small'
            },
            {
                name: 'resizeImage:50',
                value: '50',
                icon: 'medium'
            },
            {
                name: 'resizeImage:75',
                value: '75',
                icon: 'large'
            }
        ],
        toolbar: [
            'resizeImage:25',
            'resizeImage:50',
            'resizeImage:75',
            'resizeImage:original',
            '|',
            'imageStyle:inline',
            'imageStyle:block',
            'imageStyle:side',
            '|',
            'toggleImageCaption',
            'imageTextAlternative',
        ],
    },
    heading: {
        options: [
            { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
            { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
            { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
            { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
            { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
            { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' },
            { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' },
        ],
    },
    table: {
        contentToolbar: [
            'toggleTableCaption',
            'tableColumn',
            'tableRow',
            'mergeTableCells',
            'tableCellProperties',
            'tableProperties',
        ],
        tableProperties: {
            borderColors: customColorPalette,
            backgroundColors: customColorPalette,
            defaultProperties: {
                alignment: 'left',
                borderStyle: 'solid',
                borderColor: '#666666',
                borderWidth: '1px',
            },
        },
        tableCellProperties: {
            borderColors: customColorPalette,
            backgroundColors: customColorPalette,
            defaultProperties: {
                borderStyle: 'solid',
                borderColor: '#666666',
                borderWidth: '1px',
            },
        },
    },
    typing: {
        transformations: {
            remove: ['quotes'],
        },
    },
    list: {
        properties: {
            styles: true,
            startIndex: true,
            reversed: true,
        },
    },
    math: {
        engine: 'mathjax',
        outputType: 'span',
    },
    link: {
        defaultProtocol: 'https://',
    },
    language: 'de',
    translations: [ coreTranslations ],
    htmlSupport: {
        allow: [
            /* HTML features to allow */
            {
                name: 'div',
                classes: 'author',
            },
            {
                name: 'pre',
                classes: 'usercode',
            },
        ],
        disallow: [
            /* HTML features to disallow */
        ],
    },
};

export { defaultConfig };