From 9fd9ef8a546d62660b41c3fe7fbcc0520cb29ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Tue, 21 Apr 2020 11:47:08 +0200 Subject: [PATCH] Explicitly disable not used ckeditor plugins All of these plugins are not used anywhere. Change introduced at ckeditor initializer will ommit unneeded precompilation of plugins assets on production environments. Change introduced at ckeditor config file adresses the problem with assets pipeline fallback on testing environments described here: #2711. Now plugins that are explicitly disabled will not be precomiled when running ckeditor javascript enabled feature specs. --- app/assets/javascripts/ckeditor/config.js | 2 ++ config/initializers/ckeditor.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/ckeditor/config.js b/app/assets/javascripts/ckeditor/config.js index 294c100f0..86c4e0ae6 100644 --- a/app/assets/javascripts/ckeditor/config.js +++ b/app/assets/javascripts/ckeditor/config.js @@ -14,6 +14,8 @@ CKEDITOR.editorConfig = function( config ) config.allowedContent = true; config.format_tags = "p;h2;h3"; + config.removePlugins = "balloonpanel,balloontoolbar,copyformatting,scayt,wsc"; + // Rails CSRF token config.filebrowserParams = function(){ var csrf_token, csrf_param, meta, diff --git a/config/initializers/ckeditor.rb b/config/initializers/ckeditor.rb index f60914e45..cf01ea040 100644 --- a/config/initializers/ckeditor.rb +++ b/config/initializers/ckeditor.rb @@ -8,7 +8,7 @@ Ckeditor.setup do |config| config.authorize_with :cancan config.assets_languages = Rails.application.config.i18n.available_locales.map { |l| l.to_s.downcase } - config.assets_plugins = %w[balloonpanel balloontoolbar copyformatting image - link magicline pastefromword scayt table tableselection wsc] + config.assets_plugins = %w[image link magicline pastefromword + table tableselection] config.assets.reject! { |asset| asset =~ /\Ackeditor\/samples\// } end