/[pub]/suikawiki/script/misc/plugins/view/stylesheet.pm
Suika

Diff of /suikawiki/script/misc/plugins/view/stylesheet.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun May 16 23:05:50 2010 UTC revision 1.1.2.1 by hero, Sun May 16 23:53:45 2010 UTC
# Line 4  package SuikaWiki::Plugin::Registry; Line 4  package SuikaWiki::Plugin::Registry;
4    
5  our %Info;  our %Info;
6  $Info{q#StyleSheet#}->{Name} = q#StyleSheet#;  $Info{q#StyleSheet#}->{Name} = q#StyleSheet#;
7  $Info{q#StyleSheet#}->{q#Version#} = q#2005.0315.0849#;  $Info{q#StyleSheet#}->{q#Version#} = q#2005.0121.1414#;
8  $Info{q#StyleSheet#}->{q#InterfaceVersion#} = q#2.9.1#;  $Info{q#StyleSheet#}->{q#InterfaceVersion#} = q#2.9.1#;
9  $Info{q#StyleSheet#}->{q#mkpluginVersion#} = q#2.1.21#;  $Info{q#StyleSheet#}->{q#mkpluginVersion#} = q#2.1.21#;
10  $Info{q#StyleSheet#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj#;  $Info{q#StyleSheet#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY#;
11  $Info{q#StyleSheet#}->{q#Date.RCS#} = q#$Date$#;  $Info{q#StyleSheet#}->{q#Date.RCS#} = q#$Date$#;
12  $Info{q#StyleSheet#}->{RequiredPlugin} = [q#Error#, q#HTML#];  $Info{q#StyleSheet#}->{RequiredPlugin} = [q#Error#, q#HTML#];
13  $Info{q#StyleSheet#}->{RequiredModule} = [q#URI#];  $Info{q#StyleSheet#}->{RequiredModule} = [q#URI#];
14  $Info{q#StyleSheet#}->{Description} = [[q#Stylesheet support#, q#en#, q##]];  $Info{q#StyleSheet#}->{Description} = [[q#Stylesheet support#, q#en#, q##]];
15  $Info{q#StyleSheet#}->{License} = [[q#%%Perl%%#, q##, q##]];  $Info{q#StyleSheet#}->{License} = [[q#%%Perl%%#, q##, q##]];
16  $Info{q#StyleSheet#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];  $Info{q#StyleSheet#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];
17  package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj;  package SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY;
18    
19    
20  #line 1 "(WikiPlugin module source stylesheet.wp2, block Plugin/Use)"  #line 1 "(WikiPlugin module source stylesheet.wp2, block Plugin/Use)"
# Line 93  sub prop ($$;%) { my ($self, $name, %opt Line 93  sub prop ($$;%) { my ($self, $name, %opt
93    
94  push @SuikaWiki::View::Implementation::CommonViewDefs, {  push @SuikaWiki::View::Implementation::CommonViewDefs, {
95    condition => {q#mode#, q#css#, q#http_method#, [q#GET#, q#HEAD#, q#POST#]},    condition => {q#mode#, q#css#, q#http_method#, [q#GET#, q#HEAD#, q#POST#]},
96    object_class => q#SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::css105021508491663oY#,    object_class => q#SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::css1050021141420Vkfx#,
97  };  };
98  package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::css105021508491663oY;  package SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::css1050021141420Vkfx;
99    
100    
101  our @ISA = q#SuikaWiki::View::template#;  our @ISA = q#SuikaWiki::View::template#;
# Line 143  when-no-converter => 406);#; Line 143  when-no-converter => 406);#;
143    $self->main_post ($opt, $opt2);    $self->main_post ($opt, $opt2);
144  }  }
145    
146  package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj;  package SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY;
147    
148  {my $def = {q#Parameter#, {}, q#Description#, [[q#Stylesheet list as HTML (link element)#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;  {my $def = {q#Parameter#, {}, q#Description#, [[q#Stylesheet list as HTML (link element)#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;
149    
150  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#]/styles_wiki_html']/Formatting)"  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#]/styles_wiki_html']/Formatting)"
151  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_stylelist_definition_page  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_stylelist_definition_page
152  (page => $o->{wiki}->name  (page => $o->{wiki}->name
153  ($p->{page} ||  ($p->{page} ||
154  $o->{wiki}->{config}->{page}  $o->{wiki}->{config}->{page}
# Line 169  $ua_apply = $dg->{ua_netscape4} ? 'Netsc Line 169  $ua_apply = $dg->{ua_netscape4} ? 'Netsc
169  :                       1;  :                       1;
170  }  }
171  my $mkuri = $o->{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#wikiname-to-uri#} ||  my $mkuri = $o->{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#wikiname-to-uri#} ||
172                 \&SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::generate_uri;                 \&SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::generate_uri;
173  for my $set (@{$list->child_nodes}) {  for my $set (@{$list->child_nodes}) {
174  if ($set->local_name eq 'StyleSet') {  if ($set->local_name eq 'StyleSet') {
175  my $apply = $set->get_attribute_value ('Apply',  my $apply = $set->get_attribute_value ('Apply',
# Line 181  map {$_ => 1} Line 181  map {$_ => 1}
181  };  };
182  next if $ua_apply and not $type->{$ua_apply};  next if $ua_apply and not $type->{$ua_apply};
183  my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet';  my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet';
184  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_styleset_title  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_styleset_title
185  (StyleSet => $set, o => $o,  (StyleSet => $set, o => $o,
186  type => $type);  type => $type);
187  for my $sheet (@{$set->child_nodes}) {  for my $sheet (@{$set->child_nodes}) {
# Line 234  $p->{q#downgrade_html#} = do { my $r = $ Line 234  $p->{q#downgrade_html#} = do { my $r = $
234  if ($p->{downgrade_html}) {  if ($p->{downgrade_html}) {
235  return if $o->{wiki}->{var}->{client}->{downgrade}->{html_no_pi};  return if $o->{wiki}->{var}->{client}->{downgrade}->{html_no_pi};
236  }  }
237  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_stylelist_definition_page  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_stylelist_definition_page
238  (page => $o->{wiki}->name  (page => $o->{wiki}->name
239  ($p->{page} ||  ($p->{page} ||
240  $o->{wiki}->{config}->{page}  $o->{wiki}->{config}->{page}
# Line 244  o => $o, wiki => $o->{wiki}); Line 244  o => $o, wiki => $o->{wiki});
244  return unless $list;  return unless $list;
245  my $parent = $p->{-parent};  my $parent = $p->{-parent};
246  my $mkuri = $o->{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#wikiname-to-uri#} ||  my $mkuri = $o->{wiki}->{config}->{q#http://suika.fam.cx/~wakaba/archive/2004/05/sw-stylesheet\#wikiname-to-uri#} ||
247                 \&SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::generate_uri;                 \&SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::generate_uri;
248  for my $set (@{$list->child_nodes}) {  for my $set (@{$list->child_nodes}) {
249  if ($set->local_name eq 'StyleSet') {  if ($set->local_name eq 'StyleSet') {
250  my $apply = $set->get_attribute_value  my $apply = $set->get_attribute_value
# Line 252  my $apply = $set->get_attribute_value Line 252  my $apply = $set->get_attribute_value
252  as_array => 1);  as_array => 1);
253  my $type = {map {$_ => 1} @$apply};  my $type = {map {$_ => 1} @$apply};
254  my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet';  my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet';
255  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_styleset_title  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_styleset_title
256  (StyleSet => $set, o => $o,  (StyleSet => $set, o => $o,
257  type => $type);  type => $type);
258  for my $sheet (@{$set->child_nodes}) {  for my $sheet (@{$set->child_nodes}) {
# Line 314  with_lm => 1, base => 1); Line 314  with_lm => 1, base => 1);
314    
315  push @SuikaWiki::View::Implementation::CommonViewDefs, {  push @SuikaWiki::View::Implementation::CommonViewDefs, {
316    condition => {q#mode#, q#ss__no_static#, q#http_method#, [q#GET#, q#HEAD#, q#POST#]},    condition => {q#mode#, q#ss__no_static#, q#http_method#, [q#GET#, q#HEAD#, q#POST#]},
317    object_class => q#SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::ss__no_static1050215084916GAk9#,    object_class => q#SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::ss__no_static1050021141420hrFA#,
318  };  };
319  package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj::ss__no_static1050215084916GAk9;  package SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY::ss__no_static1050021141420hrFA;
320    
321    
322  our @ISA = q#SuikaWiki::View::template#;  our @ISA = q#SuikaWiki::View::template#;
# Line 361  $output->output (output => 'http-cgi');} Line 361  $output->output (output => 'http-cgi');}
361    
362  #line 1 "(WikiPlugin module StyleSheet, chunk 13)"  #line 1 "(WikiPlugin module StyleSheet, chunk 13)"
363    
364  package SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj;  package SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY;
365    
366  {my $def = {q#Parameter#, {}, q#Description#, [[q#Select user preferred style#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;  {my $def = {q#Parameter#, {}, q#Description#, [[q#Select user preferred style#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;
367    
368  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#, q#form-input#]/select_user_preferred_style']/Formatting)"  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#, q#form-input#]/select_user_preferred_style']/Formatting)"
369  $p->{q#page#} = do { my $r = $f->parse_attr ($p=>q#page#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};  $p->{q#page#} = do { my $r = $f->parse_attr ($p=>q#page#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};
370  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_stylelist_definition_page  my $list = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_stylelist_definition_page
371  (page => $o->{wiki}->name  (page => $o->{wiki}->name
372  ($p->{page} ||  ($p->{page} ||
373  $o->{wiki}->{config}->{page}  $o->{wiki}->{config}->{page}
# Line 408  my $type = {map {$_ => 1} Line 408  my $type = {map {$_ => 1}
408  $set->get_attribute_value ('Apply', default => ['alternate'])  $set->get_attribute_value ('Apply', default => ['alternate'])
409  }};  }};
410  next unless $type->{preferred} or $type->{alternate};  next unless $type->{preferred} or $type->{alternate};
411  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050215084916LDrj->_get_styleset_title  my $title = SuikaWiki::Plugin::plugin::StyleSheet1050021141420JcOY->_get_styleset_title
412  (StyleSet => $set, o => $o,  (StyleSet => $set, o => $o,
413  type => $type);  type => $type);
414  my $link = $parent->append_new_node  my $link = $parent->append_new_node
# Line 445  o => $o, wiki => $o->{wiki})); Line 445  o => $o, wiki => $o->{wiki}));
445  $_->set_attribute (class => 'reset');  $_->set_attribute (class => 'reset');
446  $_->option (use_EmptyElemTag => 1);  $_->option (use_EmptyElemTag => 1);
447  }  }
 return if $o->{wiki}->{var}->{client}->{downgrade}->{js_no_regex};  
448  $p->{q#expires#} = do { my $r = $f->parse_attr ($p=>q#expires#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};  $p->{q#expires#} = do { my $r = $f->parse_attr ($p=>q#expires#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};
449  my $cookie_path = $o->{wiki}->uri_reference->path;  my $cookie_path = $o->{wiki}->uri_reference->path;
450  for ($div->append_new_node (type => '#element',  for ($div->append_new_node (type => '#element',
# Line 506  $SuikaWiki::Plugin::Rule{form_input}->{s Line 505  $SuikaWiki::Plugin::Rule{form_input}->{s
505  {my $def = {q#Parameter#, {}, q#Description#, [[q#Applying user preferred style#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;  {my $def = {q#Parameter#, {}, q#Description#, [[q#Applying user preferred style#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;
506    
507  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#, q#form-input#]/apply_user_preferred_style']/Formatting)"  #line 1 "(WikiPlugin module source stylesheet.wp2, block FormattingRule[name()='[q#view#, q#view-resource#, q#form-input#]/apply_user_preferred_style']/Formatting)"
 return if $o->{wiki}->{var}->{client}->{downgrade}->{js_no_regex};  
508  for ($p->{-parent}->append_new_node  for ($p->{-parent}->append_new_node
509  (type => '#element',  (type => '#element',
510  namespace_uri => q#http://www.w3.org/1999/xhtml#,  namespace_uri => q#http://www.w3.org/1999/xhtml#,
# Line 694  o => $o, wiki => $o->{wiki})); Line 692  o => $o, wiki => $o->{wiki}));
692  $_->set_attribute (class => 'reset');  $_->set_attribute (class => 'reset');
693  $_->option (use_EmptyElemTag => 1);  $_->option (use_EmptyElemTag => 1);
694  }  }
 return if $o->{wiki}->{var}->{client}->{downgrade}->{js_no_regex};  
695  $p->{q#expires#} = do { my $r = $f->parse_attr ($p=>q#expires#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};  $p->{q#expires#} = do { my $r = $f->parse_attr ($p=>q#expires#, $o, -non_parsed_to_node => 1, %opt); ref $r?$r->inner_text:$r};
696  my $cookie_path = $o->{wiki}->uri_reference->path;  my $cookie_path = $o->{wiki}->uri_reference->path;
697  for ($div->append_new_node (type => '#element',  for ($div->append_new_node (type => '#element',

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24