ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Pod.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Pod.pm (file contents):
Revision 1.8 by root, Sun Aug 13 19:47:05 2006 UTC vs.
Revision 1.9 by root, Sun Aug 13 21:46:10 2006 UTC

5 5
6use Storable; 6use Storable;
7 7
8our $VERSION = 1; 8our $VERSION = 1;
9 9
10our $on_link = sub { }; 10our $goto_document = sub { };
11our %wiki; 11our %wiki;
12 12
13my $MA_BEG = "\x{fcd0}"; 13my $MA_BEG = "\x{fcd0}";
14my $MA_SEP = "\x{fcd1}"; 14my $MA_SEP = "\x{fcd1}";
15my $MA_END = "\x{fcd2}"; 15my $MA_END = "\x{fcd2}";
16 16
17*wiki = Storable::retrieve CFPlus::find_rcfile "docwiki.pst"; 17*wiki = Storable::retrieve CFPlus::find_rcfile "docwiki.pst";
18
19sub goto_document($) {
20 $goto_document->(split /\//, $_[0]);
21}
18 22
19sub is_prefix_of($@) { 23sub is_prefix_of($@) {
20 my ($node, @path) = @_; 24 my ($node, @path) = @_;
21 25
22 return 1 unless @path; 26 return 1 unless @path;
45} 49}
46 50
47sub full_path_of($) { 51sub full_path_of($) {
48 my ($node) = @_; 52 my ($node) = @_;
49 53
50 my $path = $node->{kw}[0]; 54 my @path;
51 $path = "$node->{kw}[0]/$path" while $node = $node->{parent}; 55
56 # skip toplevel hierarchy pod/, because its not a document
57 while ($node->{parent}) {
58 unshift @path, $node;
59 $node = $node->{parent};
60 }
61
52 $path 62 @path
63}
64
65sub full_path($) {
66 join "/", map $_->{kw}[0], &full_path_of
53} 67}
54 68
55sub section_of($) { 69sub section_of($) {
56 my ($node) = @_; 70 my ($node) = @_;
57 71
136 size => 0.8, 150 size => 0.8,
137 can_hover => 1, 151 can_hover => 1,
138 can_events => 1, 152 can_events => 1,
139 padding_x => 0, 153 padding_x => 0,
140 padding_y => 0, 154 padding_y => 0,
155 tooltip => "Go to <i>" . (CFPlus::asxml $link) . "</i>",
141 on_button_up => sub { 156 on_button_up => sub {
142 $on_link->(split /\//, $link); 157 goto_document $link;
143 }; 158 };
144 159
145 "\x{fffc}" 160 "\x{fffc}"
146 }, 161 },
147); 162);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines