Class: CKEditor5::Rails::Editor::PropsExternalPlugin
- Inherits:
-
PropsBasePlugin
- Object
- PropsBasePlugin
- CKEditor5::Rails::Editor::PropsExternalPlugin
- Defined in:
- lib/ckeditor5/rails/editor/props_external_plugin.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#js_import_meta ⇒ Object
readonly
Returns the value of attribute js_import_meta.
-
#stylesheets ⇒ Object
readonly
Returns the value of attribute stylesheets.
Attributes inherited from PropsBasePlugin
Instance Method Summary collapse
-
#initialize(name, script:, import_as: nil, window_name: nil, stylesheets: []) ⇒ PropsExternalPlugin
constructor
A new instance of PropsExternalPlugin.
- #preload_assets_bundle ⇒ Object
- #to_h ⇒ Object
Methods inherited from PropsBasePlugin
Constructor Details
#initialize(name, script:, import_as: nil, window_name: nil, stylesheets: []) ⇒ PropsExternalPlugin
Returns a new instance of PropsExternalPlugin.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ckeditor5/rails/editor/props_external_plugin.rb', line 9 def initialize(name, script:, import_as: nil, window_name: nil, stylesheets: []) super(name) @stylesheets = stylesheets @js_import_meta = CKEditor5::Rails::Assets::JSUrlImportMeta.new( script, import_name: script, import_as: import_as, window_name: window_name ) end |
Instance Attribute Details
#js_import_meta ⇒ Object (readonly)
Returns the value of attribute js_import_meta.
7 8 9 |
# File 'lib/ckeditor5/rails/editor/props_external_plugin.rb', line 7 def @js_import_meta end |
#stylesheets ⇒ Object (readonly)
Returns the value of attribute stylesheets.
7 8 9 |
# File 'lib/ckeditor5/rails/editor/props_external_plugin.rb', line 7 def stylesheets @stylesheets end |
Instance Method Details
#preload_assets_bundle ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ckeditor5/rails/editor/props_external_plugin.rb', line 21 def preload_assets_bundle @preload_assets_bundle ||= CKEditor5::Rails::Assets::AssetsBundle.new( scripts: [@js_import_meta], stylesheets: @stylesheets ) end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/ckeditor5/rails/editor/props_external_plugin.rb', line 28 def to_h @js_import_meta.to_h.merge(stylesheets: @stylesheets) end |