/[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.2 - (show annotations) (download)
Fri Jan 16 07:54:22 2004 UTC (20 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +46 -6 lines
Some new downgrade options added

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 @Date.RCS: $Date: 2003/12/26 07:01:21 $
16 @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 ## Gecko Mozilla
34 if ($ua_name =~m#Gecko/([0-9]+)#) {
35 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 ## Classic Mozilla
46 } elsif ($ua_name =~ m#^Mozilla/([0-4]\.[0-9]+)#) {
47 my $mozver = 0+$1;
48 $flag->{html_no_id} = 1;
49 $flag->{media_type_no_xml} = 1;
50 $flag->{html_no_latin1} = 1 if $mozver < 3;
51 ## ISSUE: Is NN3 support latin-1 character on Japanese Windoze?
52 $flag->{charset_name_with_x} = 1 if $mozver < 3;
53 $flag->{http_refresh_no_semicolon_in_uri} = 1;
54 if ($mozver < 1) {
55 $flag->{http_no_see_other} = 1;
56 $flag->{media_type_no_parameter} = 1;
57 }
58
59 ## IE
60 if ($ua_name =~ /MSIE ([2-9]\.[0-9]+)/) {
61 my $iever = 0+$1;
62 $flag->{html_no_div} = 1 if $iever < 3;
63 $flag->{html_no_latin1} = (3 <= $iever and $iever < 4) ? 1 : 0;
64 ## ISSUE: Is WinIE4 support latin-1 character on Japanese Windoze?
65 $flag->{http_refresh_no_quoted_url} = 1 if $iever < 3;
66 if ($iever >= 5) {
67 $flag->{media_type_no_xml} = 0;
68 $flag->{media_type_no_plus_xml} = 1;
69 }
70 }
71 ## WinIE 1.0
72 } elsif ($ua_name =~ m#^Microsoft Internet Explorer#) {
73 $flag->{html_no_id} = 1;
74 $flag->{html_no_div} = 1;
75 $flag->{http_no_see_other} = 1;
76 } elsif ($ua_name =~ /^Infomosaic/) {
77 $flag->{media_type_no_parameter} = 1;
78 $flag->{html_no_id} = 1;
79 $flag->{html_no_div} = 1;
80 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24