--- deliantra/Deliantra-Client/DC/Pod.pm 2006/08/13 21:46:10 1.9 +++ deliantra/Deliantra-Client/DC/Pod.pm 2007/12/26 21:03:21 1.17 @@ -1,11 +1,11 @@ -package CFPlus::Pod; +package DC::Pod; use strict; use utf8; use Storable; -our $VERSION = 1; +our $VERSION = 1.03; our $goto_document = sub { }; our %wiki; @@ -14,7 +14,7 @@ my $MA_SEP = "\x{fcd1}"; my $MA_END = "\x{fcd2}"; -*wiki = Storable::retrieve CFPlus::find_rcfile "docwiki.pst"; +*wiki = Storable::retrieve DC::find_rcfile "docwiki.pst"; sub goto_document($) { $goto_document->(split /\//, $_[0]); @@ -25,7 +25,7 @@ return 1 unless @path; - my $kw = pop @path; + my $kw = lc pop @path; $node = $node->{parent} or return 0; @@ -38,14 +38,14 @@ return unless @path; - my $kw = pop @path; + my $kw = lc pop @path; # TODO: make sure results are unique grep { is_prefix_of $_, @path } map @$_, $kw eq "*" ? @wiki{sort keys %wiki} - : grep $_, $wiki{$kw} + : $wiki{$kw} || () } sub full_path_of($) { @@ -116,7 +116,7 @@ link => sub { my ($par, $text, $link) = @_; - "" . (CFPlus::asxml $text) . "" + "" . (DC::asxml $text) . "" }, ); @@ -136,23 +136,24 @@ my %as_paragraphs = ( image => sub { - my ($par, $path) = @_; + my ($par, $path, $flags) = @_; - push @{ $par->{widget} }, new CFPlus::UI::Image path => $path; + push @{ $par->{widget} }, new DC::UI::Image path => $path, + $flags & 1 ? (max_h => $::FONTSIZE) : (); "\x{fffc}" }, link => sub { my ($par, $text, $link) = @_; - push @{ $par->{widget} }, new CFPlus::UI::Label - markup => "" . (CFPlus::asxml $text) . "", - size => 0.8, + push @{ $par->{widget} }, new DC::UI::Label + markup => "" . (DC::asxml $text) . "", + fontsize => 0.8, can_hover => 1, can_events => 1, padding_x => 0, padding_y => 0, - tooltip => "Go to " . (CFPlus::asxml $link) . "", + tooltip => "Go to " . (DC::asxml $link) . "", on_button_up => sub { goto_document $link; };