Sha256: 785132e2907f2735da150eecca3398951567d0dfeded5c97cdf2573df4b69054

Contents?: true

Size: 869 Bytes

Versions: 18

Compression:

Stored size: 869 Bytes

Contents

module Maglove
  module Widgets
    class Youtube < Base
      def identifier
        "youtube"
      end

      def defaults
        {
          youtube_id: "LFYNP40vfmE",
          width: "800",
          height: "600"
        }
      end

      module Helpers
        def youtube_widget(options = {}, &block)
          widget_block(Widgets::Youtube.new(options)) do |widget|
            haml_tag :div, class: "flex-video widescreen", style: style_string(widget.options, :margin, :padding) do
              haml_tag :iframe, src: "https://www.youtube.com/embed/#{widget.options[:youtube_id]}", type: "text/html", style: "max-width: 100%; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;", allowfullscreen: "", frameborder: "0", webkitallowfullscreen: "", mozallowfullscreen: ""
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
maglove-widgets-1.1.9 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.8 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.7 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.6 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.5 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.4 lib/maglove/widgets/youtube.rb
maglove-widgets-1.1.3 lib/maglove/widgets/youtube.rb
maglove-widgets-2.0.1 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.8 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.7 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.6 lib/maglove/widgets/youtube.rb
maglove-widgets-2.0.0 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.5 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.4 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.3 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.2 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.1 lib/maglove/widgets/youtube.rb
maglove-widgets-1.0.0 lib/maglove/widgets/youtube.rb