1 |
wakaba |
1.1 |
Name: |
2 |
|
|
ScriptTest |
3 |
|
|
FullName: |
4 |
|
|
WWW Scripting Implemention Testing Plugin |
5 |
|
|
URI: |
6 |
|
|
IW:SuikaWiki:ScriptTest |
7 |
|
|
|
8 |
|
|
{ |
9 |
|
|
Name: |
10 |
|
|
wikiform_input/script-test-supported-list |
11 |
|
|
FullName: |
12 |
|
|
ScriptTest: Test whether the User Agent is supporting scripting |
13 |
|
|
with SCRIPT element having given attribute value. |
14 |
|
|
Format: |
15 |
|
|
my @types = split /,/, $o->escape($p->{type}); |
16 |
|
|
my @langs = split /,/, $o->escape($p->{language}); |
17 |
|
|
my @slangs = split /,/, $p->{script_lang}; |
18 |
|
|
my $id = 'wikiform__'.$o->escape ($p->{id}); |
19 |
|
|
my $l = $#types > $#langs ? $#types : $#langs; |
20 |
|
|
$l = $#slangs if $#slangs > $l; |
21 |
|
|
$r = qq(<table class="script-test">\n); |
22 |
|
|
$r .= qq(<caption>@{[$o->escape($p->{caption})]}</caption>\n) if $p->{caption}; |
23 |
|
|
$r .= qq(<thead><tr><th>type</th><th>language</th><th>?</th></tr></thead><tbody>\n); |
24 |
|
|
for my $i (0..$l) { |
25 |
|
|
$r .= qq(<tr><th>$types[$i]</th><th>$langs[$i]</th>\n<td>); |
26 |
|
|
$r .= '<script'; |
27 |
|
|
$r .= qq( type="$types[$i]") if $types[$i]; |
28 |
|
|
$r .= qq( language="$langs[$i]") if $langs[$i]; |
29 |
|
|
$r .= ">\n"; |
30 |
|
|
if ($slangs[$i] eq 'vbscript') { |
31 |
|
|
$r .= qq(call document.write ("VBS: OK!<input type=""hidden"" name=""${id}__$types[$i]_$langs[$i]"" value=""VBS"" />")\n); |
32 |
|
|
} elsif ($slangs[$i] eq 'perlscript') { |
33 |
|
|
$r .= qq(\$window->document->write ('PS('.sprintf('%vd',\$^V).'): OK!<input type="hidden" name="${id}__$types[$i]_$langs[$i]" value="PS('.sprintf('%vd',\$^V).')" />');\n); |
34 |
|
|
} else { |
35 |
|
|
$r .= qq(document.write ('JS: OK!<input type="hidden" name="${id}__$types[$i]_$langs[$i]" value="JS" />');\n); |
36 |
|
|
} |
37 |
|
|
$r .= qq(</script></td></tr>\n); |
38 |
|
|
} |
39 |
|
|
$r .= "</tbody></table>\n"; |
40 |
|
|
} |
41 |
|
|
{ |
42 |
|
|
Name: |
43 |
|
|
wikiform_template/script-test-supported-list |
44 |
|
|
FullName: |
45 |
|
|
ScriptTest: Output the result table of wikiform_input/script-test-supported-list. |
46 |
|
|
Format: |
47 |
|
|
for (sort keys %{$o->{argv}}) { |
48 |
|
|
if (/^wikiform__$p->{source}__([^_]*)_(.*)$/) { |
49 |
|
|
$r .= qq(,$1,$2,$o->{argv}->{$_}\n); |
50 |
|
|
} |
51 |
|
|
} |
52 |
|
|
} |
53 |
|
|
|
54 |
|
|
POD:LICENSE: |
55 |
|
|
Copyright 2003 Wakaba <w@suika.fam.cx> |
56 |
|
|
|
57 |
|
|
%%GNUGPL2%% |