Class: EmbeddableContent::Images::NodeProcessor
- Inherits:
-
VisualElementNodeProcessor
- Object
- EmbedderBase
- NodeProcessor
- RecordNodeProcessor
- VisualElementNodeProcessor
- EmbeddableContent::Images::NodeProcessor
- Defined in:
- app/services/embeddable_content/images/node_processor.rb
Constant Summary collapse
- TARGETS_THAT_DISPLAY_A_MODAL_DIALOG =
%i[web].freeze
- TARGETS_THAT_USE_DIV_TAGS =
%i[editable].freeze
- TARGETS_THAT_USE_FIGURE_TAGS =
%i[cms print web exported qti cc schoology] .freeze
Constants inherited from VisualElementNodeProcessor
VisualElementNodeProcessor::MISSING_LABEL_TEXT
Constants inherited from NodeProcessor
NodeProcessor::ADDED_CLASSES_BLANK_BY_DEFAULT, NodeProcessor::ALL_TARGETS_PROCESSED_BY_DEFAULT, NodeProcessor::DEFAULT_TEMPLATE_MANAGER_CLASS, NodeProcessor::NODE_CAN_BE_REMOVED_BY_DEFAULT, NodeProcessor::RECORD_BLANK_BY_DEFAULT, NodeProcessor::SELECTOR_CLASS_BLANK_BY_DEFAULT
Instance Attribute Summary
Attributes inherited from NodeProcessor
#doc_processor, #error, #node, #node_index
Attributes inherited from EmbedderBase
Instance Method Summary collapse
- #display_modal_dialog? ⇒ Boolean
- #figure_tag ⇒ Object
- #img_tag_attrs ⇒ Object
- #modal_dialog ⇒ Object
- #node_can_be_removed? ⇒ Boolean
- #node_selector_class ⇒ Object
Methods inherited from VisualElementNodeProcessor
Methods included from TemplateBased
Methods inherited from RecordNodeProcessor
#attached_file, #cms_url, #record, #record_css_id_for, #record_id, #record_model, #s3_ttl_service_url, #s3_url
Methods inherited from NodeProcessor
#initialize, #node_added_classes, #process!, #record
Methods inherited from EmbedderBase
default_s3_bucket, #ed_node, #initialize, #locale, #s3_bucket, #target, #to_s, #tree, #tree_node
Constructor Details
This class inherits a constructor from EmbeddableContent::NodeProcessor
Instance Method Details
#display_modal_dialog? ⇒ Boolean
17 18 19 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 17 def display_modal_dialog? TARGETS_THAT_DISPLAY_A_MODAL_DIALOG.include? target.to_sym end |
#figure_tag ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 24 def figure_tag case target when *TARGETS_THAT_USE_DIV_TAGS then :div when *TARGETS_THAT_USE_FIGURE_TAGS then :figure else raise "Undefined tag for target: #{target}" end end |
#img_tag_attrs ⇒ Object
12 13 14 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 12 def img_tag_attrs @img_tag_attrs ||= ImgTagAttributes.new(self).to_h end |
#modal_dialog ⇒ Object
8 9 10 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 8 def modal_dialog @modal_dialog = ModalDialog.new self end |
#node_can_be_removed? ⇒ Boolean
32 33 34 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 32 def node_can_be_removed? false end |
#node_selector_class ⇒ Object
36 37 38 |
# File 'app/services/embeddable_content/images/node_processor.rb', line 36 def node_selector_class [super, 'embedded-content-image'].join ' ' end |