CKEDITOR.editorConfig = function( config ) {
//The Skin
config.skin = 'moonocolor';
//Dimensions
config.width = 600;
config.height = 600;
//Toolbar
config.toolbar = [['Source','-','Preview','Templates','-','Cut','Copy','PasteText','-','Undo','Redo','-','Find','Replace','-','SpellChecker','Scayt','-','SelectAll','RemoveFormat','-','Maximize','ShowBlocks'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript','-','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','Link','Unlink','simplebutton','Anchor','-','Image'],'/',['Format','Font','FontSize','lineheight','-','TextColor','BGColor','-','CreateDiv','Table','HorizontalRule','-','SpecialChar','PageBreak','Youtube']]
//File Browser Stuff
config.filebrowserBrowseUrl = '/library/ckeditor/_mms/link_picker.php'
config.filebrowserImageBrowseUrl = '/library/ckeditor/_mms/image_picker.php'
config.filebrowserImageBrowseLinkUrl = '/library/ckeditor/_mms/link_picker.php'
config.filebrowserFlashBrowseUrl = '/library/ckeditor/_mms/link_picker.php'
config.filebrowserUploadUrl = '/library/ckeditor/_mms/link_upload.php'
config.filebrowserImageUploadUrl = '/library/ckeditor/_mms/image_upload2.php'
config.filebrowserFlashUploadUrl = '/library/ckeditor/_mms/link_upload.php'
//Templates
config.templates_files = ['/library/ckeditor_4.5/templates/templates.js'];
config.templates = 'my_templates';
config.templates_replaceContent = false;
config.specialChars = config.specialChars.concat( "⊥", "╔", "═" );
config.entities_additional = "#x22A5,#x2554,#x2550";
//Enable SCAYT
config.disableNativeSpellChecker = true;
config.scayt_autoStartup = true;
config.removePlugins = 'magicline';
config.removePlugins = 'wsc'; // deprecated, see ticket #230834
//Extra Plugins
config.extraPlugins = 'codemirror,widget,lineutils,dialog,youtube,,lineheight,simplebutton';
//Enter mode / tab spacing
config.enterMode = CKEDITOR.ENTER_BR
config.tabSpaces = 4;
//Resize
config.resize_dir = 'both';
};
CKEDITOR.config.allowedContent = {
$1: {
// Use the ability to specify elements as an object.
elements: CKEDITOR.dtd,
attributes: true,
styles: true,
classes: true
}
};
CKEDITOR.config.disallowedContent = 'table[cellspacing,cellpadding]';
CKEDITOR.on('instanceReady', function (ev) {
var editor = ev.editor,
dataProcessor = editor.dataProcessor,
htmlFilter = dataProcessor && dataProcessor.htmlFilter;
htmlFilter.addRules( {
elements : {
$ : function( element ) {
// Output dimensions of images as width and height attributes on src
if ( element.name == 'img' ) {
// var imgClass = element.attributes.class;
// if(imgClass){
// element.attributes.class = imgClass.replace(/(?:^|\s)img-responsive\s*?/i, '')+' img-responsive';
// } else {
// element.attributes.class = 'img-responsive';
// }
var style = element.attributes.style;
if(style){
element.attributes.style = element.attributes.style.replace(/(?:^|\s)height\s*:\s*(\d+)px;?/i, '');
// Get the width from the style.
var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec( style ),
width = match && match[1];
var imgwidth = width;
element.attributes.width = imgwidth;
element.attributes['data-cke-saved-width'] = imgwidth;
}
}
}
}
});
});