Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 24
- Log:
Initial import of Collaboa 0.5.6 from downloaded Tarball. Collaboa is
a Ruby On Rails based bug tracker and SVN repository browsing tool.
- Author:
- adh
- Date:
- Mon Jul 24 21:54:39 +0100 2006
- Size:
- 836 Bytes
1 | module SearchHelper |
2 | # Highlights the +words+ where they is found in the +text+ by surrounding it like |
3 | # <strong class="highlight">I'm a highlight phrase</strong>. The highlighter can be specialized by |
4 | # passing +highlighter+ as single-quoted string with \1 where the phrase is supposed to be inserted. |
5 | # N.B.: The +words+ is sanitized to include only letters, digits, and spaces before use. |
6 | def hilight_search_terms(text, words, highlighter = '<strong class="highlight">\1</strong>') |
7 | if text.nil? || words.nil? then return end |
8 | unless text.nil? |
9 | CGI::unescape(words) # url un-encode the params |
10 | words.gsub!(/[\+\-\*]/, '') # remove +/- as used by search query |
11 | words.split(' ').each do |w| |
12 | text = text.gsub(/(#{Regexp.escape(w)})/i, highlighter) |
13 | end |
14 | return text |
15 | end |
16 | end |
17 | |
18 | end |