Sha256: 4951f9cbf2ee30be17b88d4d1502f06276e4e81a46b44bfc49524c54c7f5fd50

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

module Onebox
  module Engine
    class TypeformOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/[a-z0-9]+\.typeform\.com\/to\/[a-zA-Z0-9]+/)
      always_https

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

      def to_html
        og = get_opengraph
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(og[:url])

        <<-HTML
          <iframe src="#{escaped_src}"
                  width="100%"
                  height="600px"
                  scrolling="no"
                  frameborder="0">
          </iframe>
        HTML
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.8.53 lib/onebox/engine/typeform_onebox.rb