index: release v1.18 with only altgr index linked
[sheet.git] / emoji.plp
index 176b339d1c9594b733ae043047c04b7f47070dd8..63572c727c2a97dad467d5d0b528a4d41ac09273 100644 (file)
--- a/emoji.plp
+++ b/emoji.plp
@@ -2,45 +2,50 @@
 
 Html({
        title => 'emoji cheat sheet',
 
 Html({
        title => 'emoji cheat sheet',
-       version => 'v1.0',
+       version => '1.1',
        description => [
        description => [
-               "MSN emoticons",
+               "Emoticons overview and Unicode equivalents"
+               . " of MSN, Y!M, and Gmail icons.",
        ],
        keywords => [qw'
        ],
        keywords => [qw'
-               sheet cheat emoticon smiley emoji msn
+               sheet cheat emoticon smiley emoji unicode
+               chat im messenger msn yahoo ym gmail google
        '],
        '],
-       stylesheet => [qw'light dark red'],
+       stylesheet => [qw'light'],
+       data => ['emoji-gmail.inc.pl'],
 });
 
 :>
 <h1>IM emoticons</h1>
 
 <:
 });
 
 :>
 <h1>IM emoticons</h1>
 
 <:
-my %ICONURL = (
-       msn   => 'http://messenger.msn.com/Resource/emoticons/%s.gif',
-       yahoo => 'http://l.yimg.com/us.yimg.com/i/mesg/emoticons7/%s.gif',
-#      yahoo-web => 'http://l.yimg.com/a/i/us/msg/emoticons/%s.gif',
-);
+say '<div class="section">';
 
 
-print "<ul>\n";
+for my $system (qw'gmail msn yahoo') {
+       my @info = Data("emoji-$system");
+       my $meta = shift @info;
+       ref $meta eq 'HASH' or Abort("Invalid $system definitions", 404);
+       my $title = $meta->{name} // $system;
+       $title = showlink($title, $_) for $meta->{source} || ();
 
 
-for my $system (qw'msn yahoo') {
-       my @info = do "emoji-$system.inc.pl";
-       printf '<div class="section"><h3>%s</h3>'."\n\n", $system;
-       print '<table><tbody>'."\n";
-       for (my $i = 0; $i <= $#info; $i++) {
-               my $name = $info[$i];
-               unless (ref $info[$i+1] eq 'ARRAY') {
-                       printf '</table><table><tbody>'."\n", $name;
+       say sprintf '<div class="section"><h2>%s</h2>', $meta->{name} // $system;
+       say '<table><tbody>';
+       for my $row (@info) {
+               unless (ref $row eq 'ARRAY') {
+                       say '</table><table><tbody>';
                        next;
                }
                        next;
                }
-               my ($input, $attr, $char, $desc) = @{ $info[++$i] };
-               printf('<tr><th><img src="'.$ICONURL{$system}.'"><td><kbd>%s</kbd><td>%s%s'."\n",
-                       $name, EscapeHTML($input), $desc // $name, $char ? '<td>'.chr($char) : '',
+               my ($name, $input, $flags, $char, $desc) = @{$row};
+               say sprintf('<tr><th><img src="%s" alt="%s"><td><kbd>%s</kbd><td>%s%s',
+                       sprintf($meta->{ $flags =~ /\bext\b/ ? 'iconext' : 'icon' } // '%s', $name),
+                       EscapeHTML($name),
+                       EscapeHTML($input),
+                       $desc // $name,
+                       $char ? '<td>'.chr($char) : '',
                );
        }
                );
        }
-       print "</table></div>\n\n";
+       say "</table></div>\n";
 }
 
 }
 
-print "</ul><hr>\n\n";
+say "</div><hr>\n";