use strict; package SuikaWiki::Plugin::Registry; our %Info; $Info{q#Downgrade#}->{Name} = q#Downgrade#; $Info{q#Downgrade#}->{q#Version#} = q#2005.0121.1414#; $Info{q#Downgrade#}->{q#InterfaceVersion#} = q#2.9.1#; $Info{q#Downgrade#}->{q#mkpluginVersion#} = q#2.1.21#; $Info{q#Downgrade#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Downgrade1050021141414JtW7#; $Info{q#Downgrade#}->{q#Date.RCS#} = q#$Date: 2010/05/16 23:53:45 $#; $Info{q#Downgrade#}->{Description} = [[q#WikiView output partial downgrade for old clients#, q#en#, q##]]; $Info{q#Downgrade#}->{License} = [[q#%%Perl%%#, q##, q##]]; $Info{q#Downgrade#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]]; package SuikaWiki::Plugin::plugin::Downgrade1050021141414JtW7; sub set_downgrade_flags { #line 1 "(WikiPlugin module source Downgrade.wp2, block Function[Name='set_downgrade_flags']/Main)" my (undef, $wiki) = @_; my $flag = $wiki->{var}->{client}->{downgrade} ||= {}; my $ua_name = $wiki->{var}->{client}->{user_agent_name}; if ($ua_name =~m#\bGecko/([0-9]+)#) { my $geckover = $1; $flag->{media_type_no_rdf_plus_xml} = 1; $flag->{http_no_see_other} = 1 if $geckover > 20030331; $flag->{html_no_table_abbr} = 1; } elsif ($ua_name =~ m#\bOpera/([0-9]\.[0-9]+)#) { $flag->{http_refresh_no_quoted_url} = 1; $flag->{http_regresh_no_semicolon_in_uri} = 1; } elsif ($ua_name =~ m#^Mozilla/([0-4]\.[0-9]+)#) { my $mozver = 0+$1; $flag->{html_no_pi} = 1; $flag->{html_no_id} = 1; $flag->{html_no_table_abbr} = 1; $flag->{media_type_no_xml} = 1; $flag->{html_no_latin1} = 1 if $mozver < 3; $flag->{charset_name_with_x} = 1 if $mozver < 3; $flag->{http_refresh_no_semicolon_in_uri} = 1; if ($mozver >= 4) { $flag->{ua_netscape4} = 1; $flag->{stylesheet_non_standard} = 1; $flag->{html_link_no_media} = 1; } elsif ($mozver < 1) { $flag->{http_no_see_other} = 1; $flag->{media_type_no_parameter} = 1; $flag->{stylesheet_no_css} = 1; } else { $flag->{stylesheet_no_css} = 1; } if ($ua_name =~ /\bMSIE ([2-9]\.[0-9]+)/) { my $iever = 0+$1; if ($iever >= 6) { $flag->{media_type_no_xml} = 0; $flag->{media_type_no_plus_xml} = 1; $flag->{ua_winie60} = 1; } elsif ($iever >= 5) { $flag->{media_type_no_xml} = 0; $flag->{media_type_no_plus_xml} = 1; if ($iever >= 5.5) { $flag->{ua_winie55} = 1; } else { $flag->{ua_winie50} = 1; } } elsif ($iever >= 4) { $flag->{ua_winie40} = 1; } elsif ($iever >= 3) { $flag->{html_no_latin1} = 1; $flag->{ua_winie30} = 1; } else { # WinIE 2 $flag->{html_no_div} = 1; $flag->{stylesheet_no_css} = 1; $flag->{http_refresh_no_quoted_url} = 1; } $flag->{media_type_no_app_js} = 1; $flag->{html_no_table_abbr} = 1; $flag->{stylesheet_non_standard} = 1 if $iever >= 3; $flag->{ua_netscape4} = 0; } } elsif ($ua_name =~ m#^Microsoft Internet Explorer\b#) { $flag->{html_no_id} = 1; $flag->{html_no_div} = 1; $flag->{html_no_table_abbr} = 1; $flag->{http_no_see_other} = 1; $flag->{stylesheet_no_css} = 1; } elsif ($ua_name =~ /^Infomosaic\b/) { $flag->{media_type_no_parameter} = 1; $flag->{html_no_id} = 1; $flag->{html_no_div} = 1; $flag->{html_no_table_abbr} = 1; $flag->{stylesheet_no_css} = 1; } if ($ua_name =~ /[Bb][Oo][Tt]/) { $flag->{is_robot} = 1; } } #line 1 "(WikiPlugin module Downgrade, chunk 1)" package SuikaWiki::Plugin::Registry; $Info{q#Downgrade#}->{provide} = {}; 1;