module Rock::HTML

Constants

TEMPLATE_DIR

Public Class Methods

allocate_help_id() click to toggle source
# File lib/rock/html.rb, line 21
def self.allocate_help_id
    @help_id += 1
end
help_tip(doc) click to toggle source
# File lib/rock/html.rb, line 25
def self.help_tip(doc)
    id = allocate_help_id
    "<span class=\"help_trigger\" id=\"#{id}\"><img src=\"{relocatable: /img/help.png}\" /></span><div class=\"help\" id=\"help_#{id}\">#{doc}</div>"
end
obscure_email(email) click to toggle source
# File lib/rock/html.rb, line 9
def self.obscure_email(email)
    return nil if email.nil? #Don't bother if the parameter is nil.
    lower = ('a'..'z').to_a
    upper = ('A'..'Z').to_a
    email.split('').map { |char|
        output = lower.index(char) + 97 if lower.include?(char)
        output = upper.index(char) + 65 if upper.include?(char)
        output ? "&##{output};" : (char == '@' ? '&#0064;' : char)
    }.join
end