Sha256: ce062ebfe1c3dfe452fa1a43ee85bb038450a0a090d0f39f1be03c5330849497
Contents?: true
Size: 806 Bytes
Versions: 4
Compression:
Stored size: 806 Bytes
Contents
# encoding: UTF-8 AutoHtml.add_filter(:google_map).with(:width => 420, :height => 315, :style => "color:#000;text-align:left", :link_text => "View Larger Map") do |text, options| regex = /(https?):\/\/maps\.google\.co(.*)\/maps\?(.*)/ text.gsub(regex) do domain_country = $2 map_query = $3 width = options[:width] height = options[:height] style = options[:style] link_text = options[:link_text] %{<iframe width="#{width}" height="#{height}" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co#{domain_country}/maps?f=q&source=s_q&#{map_query}&output=embed"></iframe><br /><small><a href="http://maps.google.co#{domain_country}/maps?f=q&source=embed&#{map_query}" style="#{style}">#{link_text}</a></small>} end end
Version data entries
4 entries across 4 versions & 1 rubygems