Changeset 334
- Timestamp:
- 05/09/08 04:36:10 (7 months ago)
- Files:
-
- trunk/History.txt (modified) (1 diff)
- trunk/lib/picolena/templates/app/helpers/documents_helper.rb (modified) (1 diff)
- trunk/lib/picolena/templates/public/stylesheets/style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/History.txt
r331 r334 1 1 == 0.1.9 2008-05- 2 3 * 2 minor enhancements: 4 * Multicolor cache highlighting à la Google 5 * More documentation 2 6 3 7 == 0.1.8 2008-05-08 trunk/lib/picolena/templates/app/helpers/documents_helper.rb
r314 r334 77 77 end 78 78 79 # Returns multicolor cache à la Google. 79 80 def highlighted_cache(document, query) 80 h(document.highlighted_cache(query)).gsub(/\n/,'<br/>').gsub(/<<(.*?)>>/,content_tag(:span, '\1', :class=>"matching_content")) 81 # What are the terms related to :content field? 82 content_terms=Query.content_terms(query) 83 # Parses cache for found terms 84 # Replaces linebreak by <br/> 85 # < and > by < and > 86 h(document.highlighted_cache(query)).gsub(/\n/,'<br/>').gsub(/<<(.*?)>>/){|c| term=$1 87 # and affects a span class to each term 88 content_tag(:span, term, :class=>"matching_content_#{content_terms.index(term.downcase)}") 89 } 81 90 end 82 91 trunk/lib/picolena/templates/public/stylesheets/style.css
r283 r334 149 149 } 150 150 151 #results .matching_content {151 #results .matching_content_0{ 152 152 background-color:#ffff66; 153 153 } 154 154 155 #results .matching_content_1{ 156 background-color:#66ffff; 157 } 158 159 #results .matching_content_2{ 160 background-color:#99ff99; 161 } 162 163 #results .matching_content_3{ 164 background-color:#ff9999; 165 } 166 167 #results .matching_content_4{ 168 background-color:#ff66ff; 169 } 170 171 #results .matching_content_5{ 172 background-color:#9999ff; 173 } 174 175 #results .matching_content_6{ 176 background-color:#66ff66; 177 } 155 178 156 179 #results a, #results small{
