Revision 4d1071ce
Von Sven Schöling vor fast 11 Jahren hinzugefügt
scripts/image_maps.pl | ||
---|---|---|
83 | 83 |
my $name = fileparse($_->{filename}, ".png"); |
84 | 84 |
|
85 | 85 |
# the full grammar for valid css class names is completely bonkers (to put it mildly). |
86 |
# so instead of trying to punch filenames into those class names, we'll just reduce them to a nice minimal set of
|
|
87 |
# a-z _ -
|
|
86 |
# so instead of trying to punch filenames into those class names, we'll |
|
87 |
# just reduce them to a nice minimal set of lower case /[a-z0-9_-]*/
|
|
88 | 88 |
$name = lc $name; |
89 |
$name =~ s/[^a-z_-]/-/g; |
|
89 |
$name =~ s/[^a-z0-9_-]/-/g;
|
|
90 | 90 |
print $file ".$class_for_map.$name { background-position: -$_->{h_offset}px 0px; }\n"; |
91 | 91 |
} |
92 | 92 |
} |
Auch abrufbar als: Unified diff
Und Zahlen auch erlauben in Klassennamen.