Sha256: ad3ef4c38429485d7a5b23c1b756a580c1ac2eb68469f06db5167994717cc040
Contents?: true
Size: 745 Bytes
Versions: 4
Compression:
Stored size: 745 Bytes
Contents
# TED talks (http://www.ted.com) AutoHtml.add_filter(:ted).with(:width => 640, :height => 360, :scrolling => "no", :frameborder => 0, :allow_full_screen => false) do |text, options| text.gsub(/https?:\/\/(www.|embed.)?ted\.com\/talks\/([A-Za-z0-9._%-]*)\.html((\?|#)\S+)?/) do ted_page = $2 width = options[:width] height = options[:height] scrolling = options[:scrolling] frameborder = options[:frameborder] allow_full_screen = options[:allow_full_screen] %{<iframe width="#{width}" height="#{height}" frameborder="#{frameborder}" scrolling="#{scrolling}" src="http://embed.ted.com/talks/#{ted_page}.html"#{allow_full_screen ? ' webkitAllowFullScreen mozallowfullscreen allowFullScreen' : ''}></iframe>} end end
Version data entries
4 entries across 4 versions & 2 rubygems