1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
2 |
|
|
|
3 |
|
|
Plugin: |
4 |
|
|
@Name: Downgrade |
5 |
|
|
@Description: |
6 |
|
|
@@@: WikiView output partial downgrade for old clients |
7 |
|
|
@@lang:en |
8 |
|
|
@License: %%GPL%% |
9 |
|
|
@Author: |
10 |
|
|
@@Name: |
11 |
|
|
@@@@: Wakaba |
12 |
|
|
@@@lang:ja |
13 |
|
|
@@@script:Latn |
14 |
|
|
@@Mail[list]: w@suika.fam.cx |
15 |
wakaba |
1.3 |
@Date.RCS: $Date: 2004/01/16 07:54:22 $ |
16 |
wakaba |
1.1 |
@RequiredModule[list]: |
17 |
|
|
@RequiredPlugin[list]: |
18 |
|
|
|
19 |
|
|
PluginConst: |
20 |
|
|
@NS_XHTML1: |
21 |
|
|
http://www.w3.org/1999/xhtml |
22 |
|
|
|
23 |
|
|
Function: |
24 |
|
|
@Name: set_downgrade_flags |
25 |
|
|
@Description: |
26 |
|
|
@@@: Setting value to downgrade flags ($wiki->{var}->{client}->{downgrade}) |
27 |
|
|
@@lang:en |
28 |
|
|
@Main: |
29 |
|
|
my (undef, $wiki) = @_; |
30 |
|
|
my $flag = $wiki->{var}->{client}->{downgrade} ||= {}; |
31 |
|
|
my $ua_name = $wiki->{var}->{client}->{user_agent_name}; |
32 |
|
|
|
33 |
wakaba |
1.2 |
## Gecko Mozilla |
34 |
wakaba |
1.3 |
if ($ua_name =~m#\bGecko/([0-9]+)#) { |
35 |
wakaba |
1.2 |
my $geckover = $1; |
36 |
|
|
$flag->{media_type_no_rdf_plus_xml} = 1; |
37 |
|
|
$flag->{http_no_see_other} = 1 if $geckover > 20030331; |
38 |
|
|
|
39 |
|
|
## Opera |
40 |
|
|
} elsif ($ua_name =~ m#\bOpera/([0-9]\.[0-9]+)#) { |
41 |
|
|
## At least Opera/6 does not supports: |
42 |
|
|
$flag->{http_refresh_no_quoted_url} = 1; |
43 |
|
|
$flag->{http_regresh_no_semicolon_in_uri} = 1; |
44 |
|
|
|
45 |
wakaba |
1.1 |
## Classic Mozilla |
46 |
wakaba |
1.2 |
} elsif ($ua_name =~ m#^Mozilla/([0-4]\.[0-9]+)#) { |
47 |
|
|
my $mozver = 0+$1; |
48 |
wakaba |
1.3 |
$flag->{html_no_pi} = 1; |
49 |
wakaba |
1.2 |
$flag->{html_no_id} = 1; |
50 |
|
|
$flag->{media_type_no_xml} = 1; |
51 |
|
|
$flag->{html_no_latin1} = 1 if $mozver < 3; |
52 |
|
|
## ISSUE: Is NN3 support latin-1 character on Japanese Windoze? |
53 |
|
|
$flag->{charset_name_with_x} = 1 if $mozver < 3; |
54 |
|
|
$flag->{http_refresh_no_semicolon_in_uri} = 1; |
55 |
wakaba |
1.3 |
if ($mozver >= 4) { |
56 |
|
|
$flag->{ua_netscape4} = 1; |
57 |
|
|
$flag->{stylesheet_non_standard} = 1; |
58 |
|
|
$flag->{html_link_no_media} = 1; |
59 |
|
|
} elsif ($mozver < 1) { |
60 |
wakaba |
1.2 |
$flag->{http_no_see_other} = 1; |
61 |
|
|
$flag->{media_type_no_parameter} = 1; |
62 |
wakaba |
1.3 |
$flag->{stylesheet_no_css} = 1; |
63 |
|
|
} else { |
64 |
|
|
$flag->{stylesheet_no_css} = 1; |
65 |
wakaba |
1.2 |
} |
66 |
|
|
|
67 |
|
|
## IE |
68 |
wakaba |
1.3 |
if ($ua_name =~ /\bMSIE ([2-9]\.[0-9]+)/) { |
69 |
wakaba |
1.2 |
my $iever = 0+$1; |
70 |
wakaba |
1.3 |
if ($iever >= 6) { |
71 |
wakaba |
1.2 |
$flag->{media_type_no_xml} = 0; |
72 |
|
|
$flag->{media_type_no_plus_xml} = 1; |
73 |
wakaba |
1.3 |
$flag->{ua_winie60} = 1; |
74 |
|
|
} elsif ($iever >= 5) { |
75 |
|
|
$flag->{media_type_no_xml} = 0; |
76 |
|
|
$flag->{media_type_no_plus_xml} = 1; |
77 |
|
|
if ($iever >= 5.5) { |
78 |
|
|
$flag->{ua_winie55} = 1; |
79 |
|
|
} else { |
80 |
|
|
$flag->{ua_winie50} = 1; |
81 |
|
|
} |
82 |
|
|
} elsif ($iever >= 4) { |
83 |
|
|
$flag->{ua_winie40} = 1; |
84 |
|
|
} elsif ($iever >= 3) { |
85 |
|
|
$flag->{html_no_latin1} = 1; |
86 |
|
|
## ISSUE: Is WinIE4 support latin-1 character on Japanese Windoze? |
87 |
|
|
$flag->{ua_winie30} = 1; |
88 |
|
|
} else { # WinIE 2 |
89 |
|
|
$flag->{html_no_div} = 1; |
90 |
|
|
$flag->{stylesheet_no_css} = 1; |
91 |
|
|
$flag->{http_refresh_no_quoted_url} = 1; |
92 |
wakaba |
1.2 |
} |
93 |
wakaba |
1.3 |
$flag->{media_type_no_app_js} = 1; |
94 |
|
|
$flag->{stylesheet_non_standard} = 1 if $iever >= 3; |
95 |
|
|
$flag->{ua_netscape4} = 0; |
96 |
wakaba |
1.2 |
} |
97 |
|
|
## WinIE 1.0 |
98 |
wakaba |
1.3 |
} elsif ($ua_name =~ m#^Microsoft Internet Explorer\b#) { |
99 |
wakaba |
1.2 |
$flag->{html_no_id} = 1; |
100 |
|
|
$flag->{html_no_div} = 1; |
101 |
|
|
$flag->{http_no_see_other} = 1; |
102 |
wakaba |
1.3 |
$flag->{stylesheet_no_css} = 1; |
103 |
|
|
} elsif ($ua_name =~ /^Infomosaic\b/) { |
104 |
wakaba |
1.2 |
$flag->{media_type_no_parameter} = 1; |
105 |
wakaba |
1.1 |
$flag->{html_no_id} = 1; |
106 |
wakaba |
1.2 |
$flag->{html_no_div} = 1; |
107 |
wakaba |
1.3 |
$flag->{stylesheet_no_css} = 1; |
108 |
wakaba |
1.1 |
} |