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

Contents of /suikawiki/script/misc/plugins/view/Downgrade.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 16 23:05:49 2010 UTC (14 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, HEAD
Branch point for: helowiki-2005
Error occurred while calculating annotation data.
added latest .pm files

1 use strict;
2 package SuikaWiki::Plugin::Registry;
3
4
5 our %Info;
6 $Info{q#Downgrade#}->{Name} = q#Downgrade#;
7 $Info{q#Downgrade#}->{q#Version#} = q#2005.0315.0839#;
8 $Info{q#Downgrade#}->{q#InterfaceVersion#} = q#2.9.1#;
9 $Info{q#Downgrade#}->{q#mkpluginVersion#} = q#2.1.21#;
10 $Info{q#Downgrade#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::Downgrade1050215083939W7BX#;
11 $Info{q#Downgrade#}->{q#Date.RCS#} = q#$Date: 2004/06/03 06:38:48 $#;
12 $Info{q#Downgrade#}->{Description} = [[q#WikiView output partial downgrade for old clients#, q#en#, q##]];
13 $Info{q#Downgrade#}->{License} = [[q#%%Perl%%#, q##, q##]];
14 $Info{q#Downgrade#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];
15
16 package SuikaWiki::Plugin::plugin::Downgrade1050215083939W7BX;
17
18
19 sub set_downgrade_flags {
20
21 #line 1 "(WikiPlugin module source Downgrade.wp2, block Function[Name='set_downgrade_flags']/Main)"
22 my (undef, $wiki) = @_;
23 my $flag = $wiki->{var}->{client}->{downgrade} ||= {};
24 my $ua_name = $wiki->{var}->{client}->{user_agent_name};
25 if ($ua_name =~m#\bGecko/([0-9]+)#) {
26 my $geckover = $1;
27 $flag->{media_type_no_rdf_plus_xml} = 1;
28 $flag->{http_no_see_other} = 1 if $geckover > 20030331;
29 $flag->{html_no_table_abbr} = 1;
30 } elsif ($ua_name =~ m#\bOpera/([0-9]\.[0-9]+)#) {
31 $flag->{http_refresh_no_quoted_url} = 1;
32 $flag->{http_regresh_no_semicolon_in_uri} = 1;
33 } elsif ($ua_name =~ m#^Mozilla/([0-4]\.[0-9]+)#) {
34 my $mozver = 0+$1;
35 $flag->{html_no_pi} = 1;
36 $flag->{html_no_id} = 1;
37 $flag->{html_no_table_abbr} = 1;
38 $flag->{media_type_no_xml} = 1;
39 $flag->{html_no_latin1} = 1 if $mozver < 3;
40 $flag->{charset_name_with_x} = 1 if $mozver < 3;
41 $flag->{http_refresh_no_semicolon_in_uri} = 1;
42 if ($mozver >= 4) {
43 $flag->{ua_netscape4} = 1;
44 $flag->{stylesheet_non_standard} = 1;
45 $flag->{html_link_no_media} = 1;
46 } elsif ($mozver < 1) {
47 $flag->{http_no_see_other} = 1;
48 $flag->{media_type_no_parameter} = 1;
49 $flag->{stylesheet_no_css} = 1;
50 } else {
51 $flag->{stylesheet_no_css} = 1;
52 }
53 if ($ua_name =~ /\bMSIE ([2-9]\.[0-9]+)/) {
54 my $iever = 0+$1;
55 if ($iever >= 6) {
56 $flag->{media_type_no_xml} = 0;
57 $flag->{media_type_no_plus_xml} = 1;
58 $flag->{ua_winie60} = 1;
59 } elsif ($iever >= 5) {
60 $flag->{media_type_no_xml} = 0;
61 $flag->{media_type_no_plus_xml} = 1;
62 if ($iever >= 5.5) {
63 $flag->{ua_winie55} = 1;
64 } else {
65 $flag->{ua_winie50} = 1;
66 }
67 } elsif ($iever >= 4) {
68 $flag->{ua_winie40} = 1;
69 } elsif ($iever >= 3) {
70 $flag->{html_no_latin1} = 1;
71 $flag->{ua_winie30} = 1;
72 $flag->{js_no_regex} = 1;
73 } else { # WinIE 2
74 $flag->{html_no_div} = 1;
75 $flag->{stylesheet_no_css} = 1;
76 $flag->{http_refresh_no_quoted_url} = 1;
77 }
78 $flag->{media_type_no_app_js} = 1;
79 $flag->{html_no_table_abbr} = 1;
80 $flag->{stylesheet_non_standard} = 1 if $iever >= 3;
81 $flag->{ua_netscape4} = 0;
82 }
83 } elsif ($ua_name =~ m#^Microsoft Internet Explorer\b#) {
84 $flag->{html_no_id} = 1;
85 $flag->{html_no_div} = 1;
86 $flag->{html_no_table_abbr} = 1;
87 $flag->{http_no_see_other} = 1;
88 $flag->{stylesheet_no_css} = 1;
89 } elsif ($ua_name =~ /^Infomosaic\b/) {
90 $flag->{media_type_no_parameter} = 1;
91 $flag->{html_no_id} = 1;
92 $flag->{html_no_div} = 1;
93 $flag->{html_no_table_abbr} = 1;
94 $flag->{stylesheet_no_css} = 1;
95 }
96 if ($ua_name =~ /[Bb][Oo][Tt]/) {
97 $flag->{is_robot} = 1;
98 }
99 }
100
101 #line 1 "(WikiPlugin module Downgrade, chunk 1)"
102
103 package SuikaWiki::Plugin::Registry;
104
105 $Info{q#Downgrade#}->{provide} = {};
106
107 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24