galetahub / ckeditor

Ckeditor 4.x integration gem for rails
https://ckeditor.com/ckeditor-4/
MIT License
2.22k stars 881 forks source link

Fix documentation for "Install additional plugins" (v5+). Codemirror example. #889

Closed rgalea closed 3 years ago

rgalea commented 4 years ago

Thank you for creating and supporting this gem.

The documentation under "Install additional plugins" is not correct. I am specifically talking about trying to add a plugin not supported by the CDN (in my case codemirror). If I just add a config.extraPlugins line to the config ckeditor.js will try and pull the assets from the CDN which will result in a 404.

My solution was:

  1. Add the plugin assets under /public/ckeditor/plugins/
  2. Add CKEDITOR.plugins.addExternal( 'codemirror', '/ckeditor/plugins/codemirror/' ); to the config.js file
  3. Then add config.extraPlugins = 'codemirror,'; to the config.js file
coorasse commented 4 years ago

What I did:

  1. Add the plugin assets under /assets/javascripts/ckeditor/plugins/
  2. CKEDITOR.plugins.addExternal('youtube', '<%=asset_path 'ckeditor/plugins/youtube/plugin.js'%>'); to the head of the html page
  3. Add to assets.rb Rails.application.config.assets.precompile += ['ckeditor/plugins/youtube/plugin.js']
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.