//= require ckeditor-jquery //= require_self CKEDITOR.editorConfig = function( config ) { config.resize_enabled = true; config.toolbarStartupExpanded = true; config.extraAllowedContent = 'blockquote table pre code big small img section a i span; *[id](*); *[class](*); *[style](*)'; config.keystrokes = [ [ CKEDITOR.CTRL + 76, null ] // CTRL + L ]; // config.allowedContent = true; config.tabSpaces = 4; config.toolbar_Full = [ ['Bold','Italic','Underline','Strike','NumberedList','BulletedList','Subscript','Superscript','-','Outdent','Indent','Blockquote'], ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor'], ['Image','Table','HorizontalRule','Smiley','SpecialChar','-','Maximize', 'ShowBlocks'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Source','Preview','Templates'] ]; config.toolbar_Extended = [ ['Bold','Italic','Underline','Strike'],['TextColor','BGColor','Link','Unlink'], ['NumberedList','BulletedList'],['Image','PasteFromWord','Table','Source'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Format','Font','FontSize'], ['Table','HorizontalRule'], ['Cut','Copy','Paste','PasteText'] ]; config.toolbar_Basic = [ ['Bold','Italic','Underline','Strike'],['TextColor','BGColor','Link','Unlink'], ['NumberedList','BulletedList'],['Image','PasteFromWord','Table','Source'] ]; }; SymphoniaCKeditor = { insertHtml: function(id) { var inputs = document.querySelectorAll("input.image:checked"); for (var i=(inputs.length - 1); i >= 0; i--){ var input = inputs[i]; var img = document.createElement("img"); img.src = input.dataset.path; img.title = input.title; img.style.maxWidth = "400px"; CKEDITOR.instances[id].insertHtml(img.outerHTML); } return this; } };