Move darken() helper method from
wiki_helper.rb to application_helper.rb.
This commit is contained in:
Jacques Distler 2010-01-23 09:07:57 -06:00
parent 979ea7eca0
commit ad2fab42bd
2 changed files with 5 additions and 5 deletions

View file

@ -127,4 +127,9 @@ require 'stringsupport'
end
end
def darken(s)
n=s.length/3
s.scan( %r(\w{#{n},#{n}}) ).collect {|a| (a.hex * 2/3).to_s(16).rjust(n,'0')}.join
end
end

View file

@ -91,9 +91,4 @@ module WikiHelper
{:class => 'navlink', :id => 'rollback', :rel => 'nofollow'})
end
def darken(s)
n=s.length/3
s.scan( %r(\w{#{n},#{n}}) ).collect {|a| (a.hex * 2/3).to_s(16).rjust(n,'0')}.join
end
end