module ApplicationHelper
require 'rexml/document'
- def sanitize(text)
- Sanitize.clean(text, Sanitize::Config::OSM).html_safe
- end
-
- def htmlize(text)
- return linkify(sanitize(simple_format(text)))
- end
-
def linkify(text)
if text.html_safe?
Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")).html_safe
end
end
+ def scale_to_zoom(scale)
+ Math.log(360.0 / (scale.to_f * 512.0)) / Math.log(2.0)
+ end
+
private
def javascript_strings_for_key(key)