Sha256: 282e99d16ad226e0fb7fc94cea4444338a237bfdb4b11d5ff47b411ddcd4438f

Contents?: true

Size: 799 Bytes

Versions: 7

Compression:

Stored size: 799 Bytes

Contents

# frozen_string_literal: true

module Onebox
  module Engine
    class SlidesOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/slides\.com\/[\p{Alnum}_\-]+\/[\p{Alnum}_\-]+$/)
      requires_iframe_origins "https://slides.com"

      def to_html
        <<-HTML
          <iframe
            src="https://slides.com#{uri.path}/embed?style=light"
            width="576"
            height="420"
            scrolling="no"
            frameborder="0"
            webkitallowfullscreen
            mozallowfullscreen
            allowfullscreen
          ></iframe>
        HTML
      end

      def placeholder_html
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(raw[:image])
        "<img src='#{escaped_src}'>"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
onebox-2.2.19 lib/onebox/engine/slides_onebox.rb
onebox-2.2.18 lib/onebox/engine/slides_onebox.rb
onebox-2.2.17 lib/onebox/engine/slides_onebox.rb
onebox-2.2.16 lib/onebox/engine/slides_onebox.rb
onebox-2.2.15 lib/onebox/engine/slides_onebox.rb
onebox-2.2.14 lib/onebox/engine/slides_onebox.rb
onebox-2.2.13 lib/onebox/engine/slides_onebox.rb