Sha256: 1f5375c28f680deefcefbbcb42cab225a1e2edc3c544afb8c7e24c31d63d75a0

Contents?: true

Size: 1.93 KB

Versions: 45

Compression:

Stored size: 1.93 KB

Contents

module Pageflow
  module BuiltInFileType
    # Factory methods to decouple Pageflow initializers from concrete
    # file type classes, making more transparent which file types are
    # available as built-ins.
    def self.image
      FileType.new(model: 'Pageflow::ImageFile',
                   partial: 'pageflow/image_files/image_file',
                   editor_partial: 'pageflow/editor/image_files/image_file',
                   collection_name: 'image_files',
                   url_templates: ImageFileUrlTemplates.new,
                   css_background_image_urls: ImageFileCssBackgroundImageUrls.new,
                   css_background_image_class_prefix: 'image',
                   top_level_type: true)
    end

    def self.video
      FileType.new(model: 'Pageflow::VideoFile',
                   partial: 'pageflow/video_files/video_file',
                   editor_partial: 'pageflow/editor/video_files/video_file',
                   collection_name: 'video_files',
                   url_templates: VideoFileUrlTemplates.new,
                   css_background_image_urls: VideoFileCssBackgroundImageUrls.new,
                   css_background_image_class_prefix: 'video_poster',
                   top_level_type: true,
                   nested_file_types: [BuiltInFileType.text_track])
    end

    def self.audio
      FileType.new(model: 'Pageflow::AudioFile',
                   partial: 'pageflow/audio_files/audio_file',
                   editor_partial: 'pageflow/editor/audio_files/audio_file',
                   collection_name: 'audio_files',
                   url_templates: AudioFileUrlTemplates.new,
                   top_level_type: true,
                   nested_file_types: [BuiltInFileType.text_track])
    end

    def self.text_track
      FileType.new(model: 'Pageflow::TextTrackFile',
                   collection_name: 'text_track_files',
                   url_templates: TextTrackFileUrlTemplates.new)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
pageflow-16.0.0 lib/pageflow/built_in_file_type.rb
pageflow-15.8.0 lib/pageflow/built_in_file_type.rb
pageflow-14.5.2 lib/pageflow/built_in_file_type.rb
pageflow-15.7.1 lib/pageflow/built_in_file_type.rb
pageflow-15.7.0 lib/pageflow/built_in_file_type.rb
pageflow-15.6.1 lib/pageflow/built_in_file_type.rb
pageflow-15.6.0 lib/pageflow/built_in_file_type.rb
pageflow-15.5.0 lib/pageflow/built_in_file_type.rb
pageflow-15.4.0 lib/pageflow/built_in_file_type.rb
pageflow-15.3.0 lib/pageflow/built_in_file_type.rb
pageflow-15.2.2 lib/pageflow/built_in_file_type.rb
pageflow-15.2.1 lib/pageflow/built_in_file_type.rb
pageflow-15.2.0 lib/pageflow/built_in_file_type.rb
pageflow-15.1.2 lib/pageflow/built_in_file_type.rb
pageflow-15.1.1 lib/pageflow/built_in_file_type.rb
pageflow-15.1.0 lib/pageflow/built_in_file_type.rb
pageflow-15.1.0.rc0 lib/pageflow/built_in_file_type.rb
pageflow-15.1.0.beta6 lib/pageflow/built_in_file_type.rb
pageflow-15.1.0.beta5 lib/pageflow/built_in_file_type.rb
pageflow-15.1.0.beta4 lib/pageflow/built_in_file_type.rb