Revision 5a7adba1
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
bin/mozilla/menuv3.pl | ||
---|---|---|
140 | 140 |
return print_menu($menu); |
141 | 141 |
} |
142 | 142 |
|
143 |
sub my_length { |
|
144 |
my ($s) = @_; |
|
145 |
my $len = 0; |
|
146 |
my $i; |
|
147 |
my $skip = 0; |
|
148 |
|
|
149 |
for ($i = 0; $i < length($s); $i++) { |
|
150 |
my $c = substr($s, $i, 1); |
|
151 |
if ($skip && ($c eq ";")) { |
|
152 |
$skip = 0; |
|
153 |
} elsif ($skip) { |
|
154 |
next; |
|
155 |
} elsif ($c eq "&") { |
|
156 |
$skip = 1; |
|
157 |
$len++; |
|
158 |
} else { |
|
159 |
$len++; |
|
160 |
} |
|
161 |
} |
|
162 |
|
|
163 |
return $len; |
|
164 |
} |
|
165 |
|
|
166 | 143 |
sub print_menu { |
167 | 144 |
my ($menu, $parent, $depth) = @_; |
168 | 145 |
my $html; |
... | ... | |
183 | 160 |
my $menu_title = $locale->text($item); |
184 | 161 |
my $menu_text = $menu_title; |
185 | 162 |
|
186 |
$menu_text =~ s/ /<br>/ if ($parent && (my_length($menu_text) >= 17)); |
|
187 |
|
|
188 | 163 |
my $target = "main_window"; |
189 | 164 |
$target = $menu_item->{"target"} if ($menu_item->{"target"}); |
190 | 165 |
|
Auch abrufbar als: Unified diff
CSS-Menü: keinen Zeilenumbruch mehr erzwingen.