Class: CKEditor5::Rails::Plugins::WProofreader

Inherits:
Editor::PropsExternalPlugin show all
Defined in:
lib/ckeditor5/rails/plugins/wproofreader.rb

Constant Summary collapse

DEFAULT_VERSION =
'3.1.2'
DEFAULT_CDN =
'https://cdn.jsdelivr.net/npm/@webspellchecker/wproofreader-ckeditor5'

Instance Attribute Summary

Attributes inherited from Editor::PropsExternalPlugin

#js_import_meta, #stylesheets

Attributes inherited from Editor::PropsBasePlugin

#assets_bundle, #name

Instance Method Summary collapse

Methods inherited from Editor::PropsExternalPlugin

#preload_assets_bundle, #to_h

Methods inherited from Editor::PropsBasePlugin

normalize, #preload_assets_bundle, #to_h

Constructor Details

#initialize(version: nil, cdn: nil) ⇒ WProofreader

Returns a new instance of WProofreader.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ckeditor5/rails/plugins/wproofreader.rb', line 10

def initialize(version: nil, cdn: nil)
  cdn ||= DEFAULT_CDN
  version ||= DEFAULT_VERSION

  script_url = "#{cdn}@#{version}/dist/browser/index.js"
  style_url = "#{cdn}@#{version}/dist/browser/index.css"

  super(
    :WProofreader,
    script: script_url,
    import_as: 'WProofreader',
    stylesheets: [style_url],
  )
end