Permalink
Browse files

fix google_map for all country

  • Loading branch information...
1 parent 7bbca5e commit cf0ec9af88990a2d849952365cec3d5401e92a86 @subicura subicura committed Jan 13, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/auto_html/filters/google_map.rb
@@ -1,12 +1,13 @@
# encoding: UTF-8
-AutoHtml.add_filter(:google_map).with(:width => 420, :height => 315, :style => "color:#000;text-align:left", :link_text => "크게 보기") do |text, options|
- regex = /(https?):\/\/maps\.google\.co\.kr\/maps\?(.*)/
+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
- map_query = $2
+ 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.kr/maps?f=q&amp;source=s_q&amp;#{map_query}&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co.kr/maps?f=q&amp;source=embed&amp;#{map_query}" style="#{style}">#{link_text}</a></small>}
+ %{<iframe width="#{width}" height="#{height}" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co#{domain_country}/maps?f=q&amp;source=s_q&amp;#{map_query}&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co#{domain_country}/maps?f=q&amp;source=embed&amp;#{map_query}" style="#{style}">#{link_text}</a></small>}
end
end

0 comments on commit cf0ec9a

Please sign in to comment.