/[swish]/trunk/html/FormatResult.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/html/FormatResult.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 90 by dpavlin, Wed Sep 1 14:12:57 2004 UTC revision 107 by dpavlin, Sat Jul 9 13:14:25 2005 UTC
# Line 106  sub highlite_words { Line 106  sub highlite_words {
106          my @words = sort { length($b) <=> length($a) } @{$words_ref};          my @words = sort { length($b) <=> length($a) } @{$words_ref};
107    
108          # colors to highlite          # colors to highlite
109          my @colors = qw{#ffff66 #a0ffff #99ff99 #ff9999 #ff66ff};          my @colors = ('#ffff66','#a0ffff','#99ff99','#ff9999','#ff66ff');
110    
111          # color offset          # color offset
112          my $i = 0;          my $i = 0;
# Line 114  sub highlite_words { Line 114  sub highlite_words {
114          foreach my $w (@words) {          foreach my $w (@words) {
115                  if ($w =~ m/ARRAY/) {                  if ($w =~ m/ARRAY/) {
116                          foreach my $ww (sort { length($b) <=> length($a) } @{$w}) {                          foreach my $ww (sort { length($b) <=> length($a) } @{$w}) {
117                                  $$snip_ref =~ s,(\b\Q$ww\E),<span style="background: $colors[$i]; color:black;">$1</span>,gsi;                                  $$snip_ref =~ s,(\b\Q$ww\E\w*),<span style="background: $colors[$i]; color:black;">$1</span>,gsi;
118                          }                          }
119                  } else {                  } else {
120                          $$snip_ref =~ s,(\b\Q$w\E),<span style="background: $colors[$i]; color:black;">$1</span>,gsi;                          $$snip_ref =~ s,(\b\Q$w\E\w*),<span style="background: $colors[$i]; color:black;">$1</span>,gsi;
121                  }                  }
122                  $i++;                  $i++;
123                  $i = 0 if ($i > $#colors);                  $i = 0 if ($i > $#colors);

Legend:
Removed from v.90  
changed lines
  Added in v.107

  ViewVC Help
Powered by ViewVC 1.1.26