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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue Mar 15 08:50:05 2005 UTC (19 years, 7 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, HEAD
Branch point for: helowiki, helowiki-2005
Changes since 1.5: +4 -2 lines
No JavaScript regex literal for old User Agents

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: %%Perl%%
9 @Author:
10 @@Name:
11 @@@@: Wakaba
12 @@@lang:ja
13 @@@script:Latn
14 @@Mail[list]: w@suika.fam.cx
15 @Date.RCS:
16 $Date: 2005/03/15 08:50:05 $
17
18 PluginConst:
19 @NS_XHTML1:
20 http://www.w3.org/1999/xhtml
21
22 Function:
23 @Name: set_downgrade_flags
24 @Description:
25 @@@: Setting value to downgrade flags ($wiki->{var}->{client}->{downgrade})
26 @@lang:en
27 @Main:
28 my (undef, $wiki) = @_;
29 my $flag = $wiki->{var}->{client}->{downgrade} ||= {};
30 my $ua_name = $wiki->{var}->{client}->{user_agent_name};
31
32 ## Gecko Mozilla
33 if ($ua_name =~m#\bGecko/([0-9]+)#) {
34 my $geckover = $1;
35 $flag->{media_type_no_rdf_plus_xml} = 1;
36 $flag->{http_no_see_other} = 1 if $geckover > 20030331;
37 $flag->{html_no_table_abbr} = 1;
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 ## Classic Mozilla
46 } elsif ($ua_name =~ m#^Mozilla/([0-4]\.[0-9]+)#) {
47 my $mozver = 0+$1;
48 $flag->{html_no_pi} = 1;
49 $flag->{html_no_id} = 1;
50 $flag->{html_no_table_abbr} = 1;
51 $flag->{media_type_no_xml} = 1;
52 $flag->{html_no_latin1} = 1 if $mozver < 3;
53 ## ISSUE: Is NN3 support latin-1 character on Japanese Windoze?
54 $flag->{charset_name_with_x} = 1 if $mozver < 3;
55 $flag->{http_refresh_no_semicolon_in_uri} = 1;
56 if ($mozver >= 4) {
57 $flag->{ua_netscape4} = 1;
58 $flag->{stylesheet_non_standard} = 1;
59 $flag->{html_link_no_media} = 1;
60 } elsif ($mozver < 1) {
61 $flag->{http_no_see_other} = 1;
62 $flag->{media_type_no_parameter} = 1;
63 $flag->{stylesheet_no_css} = 1;
64 } else {
65 $flag->{stylesheet_no_css} = 1;
66 }
67
68 ## IE
69 if ($ua_name =~ /\bMSIE ([2-9]\.[0-9]+)/) {
70 my $iever = 0+$1;
71 if ($iever >= 6) {
72 $flag->{media_type_no_xml} = 0;
73 $flag->{media_type_no_plus_xml} = 1;
74 $flag->{ua_winie60} = 1;
75 } elsif ($iever >= 5) {
76 $flag->{media_type_no_xml} = 0;
77 $flag->{media_type_no_plus_xml} = 1;
78 if ($iever >= 5.5) {
79 $flag->{ua_winie55} = 1;
80 } else {
81 $flag->{ua_winie50} = 1;
82 }
83 } elsif ($iever >= 4) {
84 $flag->{ua_winie40} = 1;
85 } elsif ($iever >= 3) {
86 $flag->{html_no_latin1} = 1;
87 ## ISSUE: Does WinIE4 support latin-1 character on Japanese Windoze?
88 $flag->{ua_winie30} = 1;
89 $flag->{js_no_regex} = 1;
90 ## ISSUE: Does WinIE4 support /regex-literal/?
91 } else { # WinIE 2
92 $flag->{html_no_div} = 1;
93 $flag->{stylesheet_no_css} = 1;
94 $flag->{http_refresh_no_quoted_url} = 1;
95 }
96 $flag->{media_type_no_app_js} = 1;
97 $flag->{html_no_table_abbr} = 1;
98 $flag->{stylesheet_non_standard} = 1 if $iever >= 3;
99 $flag->{ua_netscape4} = 0;
100 }
101 ## WinIE 1.0
102 } elsif ($ua_name =~ m#^Microsoft Internet Explorer\b#) {
103 $flag->{html_no_id} = 1;
104 $flag->{html_no_div} = 1;
105 $flag->{html_no_table_abbr} = 1;
106 $flag->{http_no_see_other} = 1;
107 $flag->{stylesheet_no_css} = 1;
108 } elsif ($ua_name =~ /^Infomosaic\b/) {
109 $flag->{media_type_no_parameter} = 1;
110 $flag->{html_no_id} = 1;
111 $flag->{html_no_div} = 1;
112 $flag->{html_no_table_abbr} = 1;
113 $flag->{stylesheet_no_css} = 1;
114 }
115
116 if ($ua_name =~ /[Bb][Oo][Tt]/) {
117 $flag->{is_robot} = 1;
118 }
119

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24