CKEDITOR.dtd.$removeEmpty[
'i'
] =
false
;
CKEDITOR.dtd.$removeEmpty[
'span'
] =
false
;
CKEDITOR.editorConfig =
function
( config ) {
config.keystrokes = [
];
config.fillEmptyBlocks =
false
;
config.basicEntities =
false
;
config.autoParagraph =
true
;
config.pasteFromWordPromptCleanup =
true
;
config.pasteFromWordRemoveFontStyles =
true
;
config.forcePasteAsPlainText =
true
;
config.ignoreEmptyParagraph =
true
;
config.removeFormatAttributes =
true
;
config.toolbar = 'Full
';
config.extraPlugins = '
wordcount,more,emojione,print,oembed,widget,syntaxhighlight,specialchar,mentions,codemirror
';
//config.extraPlugins = '
wordcount,more,oembed,syntaxhighlight,codemirror,emojione
';
config.wordcount = {
// Whether or not you want to show the Paragraphs Count
showParagraphs: true,
// Whether or not you want to show the Word Count
showWordCount: true,
// Whether or not you want to show the Char Count
showCharCount: true,
// Whether or not you want to count Spaces as Chars
countSpacesAsChars: false,
// Whether or not to include Html chars in the Char Count
countHTML: false,
// Maximum allowed Word Count, -1 is default for unlimited
maxWordCount: -1,
// Maximum allowed Char Count, -1 is default for unlimited
maxCharCount: -1,
// Add filter to add or remove element before counting (see CKEDITOR.htmlParser.filter), Default value : null (no filter)
filter: new CKEDITOR.htmlParser.filter({
elements: {
div: function( element ) {
if(element.attributes.class == '
mediaembed
') {
return false;
}
}
}
})
};
CKEDITOR.on( '
dialogDefinition
', function( ev )
{
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we'
re
if
(dialogName ==
'link'
) {
var
protocolField = dialogDefinition.getContents(
'info'
).get(
'protocol'
);
var
items = protocolField[
'items'
];
protocolField[
'items'
] = items.slice(0, 2);
}
});
config.removePlugins =
'contextmenu,tabletools'
;
config.allowedContent =
false
;
config.extraAllowedContent =
'span(*); a[!href, class](*); figure(*); figcaption(*); div(*); h2(*); h3(*); p[data-pullquote]'
;
config.disallowedContent =
'*[on*]'
;
config.scayt_autoStartup =
true
;
config.scayt_sLang =
'auto'
;
var
bodyElement = document.body;
var
langValue = bodyElement.getAttribute(
'data-lang'
);
if
(langValue ===
'ru'
) {
config.scayt_autoStartup =
false
;
config.language =
'ru'
;
}
else
if
(langValue ===
'ua'
) {
config.scayt_sLang =
'uk_UA'
;
config.language =
'uk'
;
}
else
{
config.scayt_sLang =
'en_US'
;
config.language =
'en'
;
}
config.scayt_minWordLength = 5;
config.scayt_handleCheckDirty =
false
;
config.scayt_handleUndoRedo =
false
;
config.scayt_ignoreAllCapsWords =
true
;
config.scayt_ignoreDomainNames =
true
;
config.scayt_ignoreWordsWithMixedCases =
true
;
config.scayt_ignoreWordsWithNumbers =
true
;
config.scayt_uiTabs =
'0,1,0'
;
config.mentions = [
{
marker:
'@'
,
minChars: 4,
feed:
'/index.php?r=autocomplete&cke=1&q={encodedQuery}'
,
itemTemplate:
'<li data-id="{id}"><img src="{avatar}" height="20" width="20" alt="{name}"> {name}</li>'
,
},
{
marker:
'#'
,
minChars: 3,
feed:
'/index.php?r=tags&cke=1&q={encodedQuery}'
,
itemTemplate:
'<li data-id="{id}">{tag}</li>'
,
}
];
config.toolbar_Full =
[
[
'Source'
,
'Maximize'
],
[
'Cut'
,
'Copy'
,
'PasteText'
],
[
'Undo'
,
'Redo'
,
'-'
,
'Find'
,
'Replace'
,
'-'
,
'SelectAll'
,
'RemoveFormat'
],
[
'Image'
,
'HorizontalRule'
],
[
'Print'
,
'Preview'
,
'Scayt'
,
'Table'
,
'oembed'
,
'SpecialChar'
,
'Syntaxhighlight'
],
'/'
,
[
'Bold'
,
'Italic'
,
'Underline'
,
'Strike'
],
[
'NumberedList'
,
'BulletedList'
,
'Blockquote'
],
[
'JustifyLeft'
,
'JustifyCenter'
,
'JustifyRight'
,
'JustifyBlock'
],
[
'Link'
,
'Unlink'
],
[
'Styles'
,
'Format'
],
[
'Emojione'
],
[
'TextColor'
,
'BGColor'
]
];
config.toolbar_Medium = [
[
'Bold'
,
'Italic'
,
'Underline'
,
'Strike'
],
[
'NumberedList'
,
'BulletedList'
,
'-'
,
'Blockquote'
],
[
'JustifyLeft'
,
'JustifyCenter'
,
'JustifyRight'
,
'JustifyBlock'
],
[
'Image'
,
'Link'
,
'Unlink'
,
'HorizontalRule'
],
[
'TextColor'
,
'BGColor'
],
[
'SelectAll'
,
'Cut'
,
'Copy'
,
'PasteText'
],
[
'Undo'
,
'Redo'
],[
'Source'
]
];
config.toolbar_Basic =
[
[
'Bold'
,
'Italic'
,
'Underline'
,
'Strike'
,
'Emojione'
,
'-'
,
'NumberedList'
,
'BulletedList'
],[
'Undo'
,
'Redo'
,
'JustifyLeft'
,
'JustifyCenter'
,
'JustifyRight'
,
'JustifyBlock'
],[
'Link'
,
'Unlink'
],[
'Format'
],[
'HorizontalRule'
,
'Maximize'
]
];
config.toolbar_Comments =
[
[
'Bold'
,
'Italic'
,
'Underline'
,
'Strike'
,
'Emojione'
,
'-'
,
'NumberedList'
,
'BulletedList'
],[
'Source'
,
'Maximize'
]
];
config.format_tags =
'h2;h3;h4;h5'
;
config.removeDialogTabs =
'image:advanced;link:advanced'
;
};