/[suikacvs]/test/html-webhacc/WebHACC/Language/CacheManifest.pm
Suika

Contents of /test/html-webhacc/WebHACC/Language/CacheManifest.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Aug 14 07:19:44 2008 UTC (17 years ago) by wakaba
Branch: MAIN
Changes since 1.3: +6 -4 lines
++ ChangeLog	14 Aug 2008 07:18:47 -0000
2008-08-14  Wakaba  <wakaba@suika.fam.cx>

	* cc-script.js, cc-style.js: Support for tab styling
	of the "input" subsections.  Support for the "details"
	widget.

++ html/WebHACC/Language/ChangeLog	14 Aug 2008 07:19:38 -0000
2008-08-14  Wakaba  <wakaba@suika.fam.cx>

	* CacheManifest.pm: Compile errors fixed.

++ html/WebHACC/ChangeLog	14 Aug 2008 07:19:14 -0000
2008-08-14  Wakaba  <wakaba@suika.fam.cx>

	* Output.pm: Support for inner tabs for "input" subsections.
	Improved support for "details" widget.

1 package WebHACC::Language::CacheManifest;
2 use strict;
3 require WebHACC::Language::Base;
4 push our @ISA, 'WebHACC::Language::Base';
5
6 sub new ($) {
7 my $self = bless {}, shift;
8 return $self;
9 } # new
10
11 sub generate_syntax_error_section ($) {
12 my $self = shift;
13
14 require Whatpm::CacheManifest;
15
16 my $out = $self->output;
17
18 $out->start_section (role => 'parse-errors');
19 $out->start_error_list (role => 'parse-errors');
20
21 my $input = $self->input;
22 my $result = $self->result;
23
24 my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string';
25 $self->{structure} = Whatpm::CacheManifest->$m
26 ($input->{s}, $input->{uri}, $input->{base_uri}, sub {
27 $result->add_error (@_, layer => 'syntax', index_has_link => 1);
28 });
29
30 $out->end_error_list (role => 'parse-errors');
31 $out->end_section;
32 } # generate_syntax_error_section
33
34 sub generate_structure_dump_section ($) {
35 my $self = shift;
36 my $manifest = $self->{structure};
37
38 my $out = $self->output;
39
40 $out->start_section (role => 'structure');
41
42 $out->html (qq[<dl><dt>Explicit entries</dt>]);
43 my $i = 0;
44 for my $uri (@{$manifest->[0]}) {
45 $out->start_tag ('dd', id => 'index-' . $i++);
46 $out->url ($uri);
47 }
48
49 $out->html (qq[<dt>Fallback entries</dt><dd>
50 <table><thead><tr><th scope=row>Oppotunistic Caching Namespace</th>
51 <th scope=row>Fallback Entry</tr><tbody>]);
52 for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) {
53 $out->start_tag ('tr');
54
55 $out->start_tag ('td', id => 'index-' . $i++);
56 $out->url ($uri);
57
58 $out->start_tag ('td', id => 'index-' . $i++);
59 $out->url ($manifest->[1]->{$uri});
60 }
61
62 $out->html (qq[</table><dt>Online whitelist</dt>]);
63 for my $uri (@{$manifest->[2]}) {
64 $out->start_tag ('dd', id => 'index-' . $i++);
65 $out->url ($uri);
66 }
67
68 $out->end_section;
69 } # generate_structure_dump_section
70
71 sub generate_structure_error_section ($) {
72 my $self = shift;
73
74 my $out = $self->output;
75
76 $out->start_section (role => 'structure-errors');
77 $out->start_error_list (role => 'structure-errors');
78
79 my $result = $self->result;
80
81 Whatpm::CacheManifest->check_manifest ($self->{structure}, sub {
82 $result->add_error (@_, layer => 'structure');
83 });
84
85 $out->end_error_list;
86 $out->end_section;
87 } # generate_structure_error_section
88
89 sub source_charset ($) {
90 return 'utf-8';
91 } # source_charset
92
93 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24