TUWF-0.2 released + added external icon in menu

This commit is contained in:
Yorhel 2012-01-19 11:04:27 +01:00
parent d96a273672
commit 91863fab76
8 changed files with 39 additions and 8 deletions

View file

@ -14,15 +14,16 @@ TUWF::register(
qr{} => sub { podpage(shift, 'home', '', '', "Yorhel's Projects") },
qr{ncdu} => sub { podpage(shift, 'ncdu', 'ncdu', '', 'NCurses Disk Usage') },
qr{ncdu/man} => sub { podpage(shift, 'ncdu-man', 'ncdu', 'man', 'Ncdu Manual') },
qr{ncdu/changes} => sub { changelog(shift, 'ncdu-changelog', 'ncdu', 'changes', 'Ncdu Changelog') },
qr{ncdu/changes} => sub { changelog(shift, 'ncdu-changelog', 'ncdu', 'ncdu', 'changes', 'Ncdu Changelog') },
qr{ncdu/scr} => sub { podpage(shift, 'ncdu-scr', 'ncdu', 'scr', 'Ncdu Screenshots') },
qr{ncdc} => sub { podpage(shift, 'ncdc', 'ncdc', '', 'NCurses Direct Connect') },
qr{ncdc/faq} => sub { podpage(shift, 'ncdc-faq', 'ncdc', 'faq', 'Ncdc Q&A', 1) },
qr{ncdc/scr} => sub { podpage(shift, 'ncdc-scr', 'ncdc', 'scr', 'Ncdc Screenshots') },
qr{ncdc/man} => sub { podpage(shift, 'ncdc-man', 'ncdc', 'man', 'Ncdc Manual', 1) },
qr{ncdc/changes} => sub { changelog(shift, 'ncdc-changelog', 'ncdc', 'changes', 'Ncdc Changelog') },
qr{ncdc/changes} => sub { changelog(shift, 'ncdc-changelog', 'ncdc', 'ncdc', 'changes', 'Ncdc Changelog') },
qr{tuwf} => sub { podpage(shift, 'tuwf', 'tuwf', '', 'The Ultimate Website Framework') },
qr{tuwf/man(?:/(db|misc|request|response|xml))?} => \&tuwfmanual,
qr{tuwf/changes} => sub { changelog(shift, 'tuwf-changelog', 'TUWF', 'tuwf', 'changes', 'TUWF Changelog') },
qr{doc} => sub { podpage(shift, 'doc', 'doc', '', 'Articles') },
qr{doc/sqlaccess} => sub { podpage(shift, 'sqlaccess', 'doc', '', 'Multi-threaded Access to an SQLite3 Database', 1) },
qr{dump} => sub { podpage(shift, 'dump', 'dump', '', 'Code dump') },
@ -51,7 +52,7 @@ sub podpage {
sub changelog {
my($s, $f, $p, $se, $t) = @_;
my($s, $f, $pr, $p, $se, $t) = @_;
$s->htmlHeader(title => $t, page => $p, sec => $se);
open my $F, '<', "$ROOT/dat/$f" or die $!;
ul;
@ -60,7 +61,7 @@ sub changelog {
li style => 'list-style-type: none; margin: 0';
b $1;
txt " - $2 - ";
lit $s->genDLLink("$p-$1.tar.gz");
lit $s->genDLLink("$pr-$1.tar.gz");
br;
ul;
for (split(/\r?\n\s+-\s+/, $v)) {
@ -213,7 +214,7 @@ sub htmlMenu {
my($s, %o) = @_;
my $m = sub {
li;
a href => $_[0], $_[2]?(class=>'menusel'):(), $_[1];
a href => $_[0], $_[0]!~/^\//?(class=>'external'):$_[2]?(class=>'menusel'):(), $_[1];
if($_[2] && $_[3]) {
ul;
$_[3]->();
@ -228,7 +229,7 @@ sub htmlMenu {
$m->('/ncdu/man', 'Manual', $o{sec} eq 'man');
$m->('/ncdu/changes', 'Changelog', $o{sec} eq 'changes');
$m->('/ncdu/scr', 'Screenshots', $o{sec} eq 'scr');
$m->('http://sourceforge.net/tracker/?group_id=200175', 'Bug tracker (ext)'); # TODO: wikipedia-style extern image or something
$m->('http://sourceforge.net/tracker/?group_id=200175', 'Bug tracker ');
});
$m->('/ncdc', 'Ncdc', $o{page} eq 'ncdc', sub {
$m->('/ncdc', 'Info', !$o{sec});
@ -237,7 +238,7 @@ sub htmlMenu {
$m->('/ncdc/changes', 'Changelog', $o{sec} eq 'changes');
$m->('/ncdc/scr', 'Screenshots', $o{sec} eq 'scr');
});
$m->('/tuwf', 'TUWF', $o{page} eq 'tuwf', sub {
$m->('/tuwf', 'Tuwf', $o{page} eq 'tuwf', sub {
$m->('/tuwf', 'Info', !$o{sec});
$m->('/tuwf/man', 'Manual', $o{sec} eq 'man', sub {
$m->('/tuwf/man', 'Main', !$o{sec2});
@ -247,6 +248,7 @@ sub htmlMenu {
$m->('/tuwf/man/response', '::Response', $o{sec2} eq 'response');
$m->('/tuwf/man/xml', '::XML', $o{sec2} eq 'xml');
});
$m->('/tuwf/changes', 'Changelog', $o{sec} eq 'changes');
});
$m->('/doc', 'Articles', $o{page} eq 'doc');
$m->('/dump', 'Code dump', $o{page} eq 'dump', sub {
@ -300,6 +302,7 @@ sub printCSS {
.indexgroup li { list-style-type: none; margin-left: 0px }
.indexgroup li li { margin-left: 20px }
.indexgroup + .dummyTopAnchor + p { margin-top: 20px }
a.external:after { content: url(/img/external.gif) }
b { font-weight: bold }
h1.title { margin-top: 0; font-size: 25px }
h1 { margin-top: 50px; }