/[pub]/suikawiki/script/misc/plugins/form/text-rotate.wp2
Suika

Contents of /suikawiki/script/misc/plugins/form/text-rotate.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Feb 14 10:51:14 2004 UTC (22 years, 2 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, release-3-0-0, HEAD
Branch point for: paragraph-200404, helowiki, helowiki-2005
New

1 #?SuikaWikiConfig/2.0
2
3 ## NOTE: This WikiPlugin module is written in euc-japan.
4
5 Plugin:
6 @Name: TextRotate
7 @FullName:
8 Juliuce encryption
9 @Description:
10 @@@:
11 TextRotate WikiPlugin module implements ROT 13 and TEN 25 (Juliuce
12 encryption for basic latin alphabet and kana.)
13 @@lang: en
14 @License: %%Perl%%
15 @Author[list]:
16 Wakaba <w@suika.fam.cx>
17 @Date.RCS:
18 $Date: 2004/01/16 07:50:17 $
19 @RequiredModule[list]:
20 Jcode
21 @RequiredPlugin[list]:
22 WikiFormCore
23
24 FormattingRule:
25 @Category[list]:
26 form-template
27 @Name: rot
28 @Description:
29 @@@: ROT 13 (for basic latin alphabet) + TEN 25 (for kana)
30 @@lang: en
31 @Parameter:
32 @@Name: rot13
33 @@Type: boolean
34 @@Default: "1"
35 @@Description:
36 @@@@: Whether ROT 13 should be applied.
37 @@@lang: en
38 @Parameter:
39 @@Name: source
40 @@Type: form-id
41 @@Default: (auto)
42 @@Description:
43 @@@@:
44 Form field name from which source text to be encrypted
45 retrived.
46 @@@lang: en
47 @Parameter:
48 @@Name: ten25
49 @@Type: boolean
50 @@Default: "1"
51 @@Description:
52 @@@@: Whether TEN 25 should be applied.
53 @@@lang: en
54 @Parameter:
55 @@Name: text
56 @@Type: text
57 @@Default: (auto)
58 @@Description:
59 @@@@:
60 Source text to be encrypted. "source" parameter is referred
61 if missing.
62 @@@lang:en
63 @After:
64 my $src = $p->{text}
65 || $o->{wiki}->{input}->parameter ('wikiform__'.$p->{source});
66 $src = __FUNCPACK__->rot13 ($src) unless $p->{rot13} && !$p->{rot13};
67 $src = __FUNCPACK__->ten25 ($src) unless $p->{ten25} && !$p->{ten25};
68 $p->{-result} .= $src;
69
70 Function:
71 @Name: ten25
72 @Description:
73 @@@: Encrypting text with TEN 25
74 @@lang: en
75 @Main:
76 my (undef, $s) = @_;
77 ## TODO: This code MUST be fixed after SuikaWiki is utf8'ized.
78 my $tr_f = q{あいうえおかきくけこさしすせそたちつてとなにぬねの}
79 .q{はひふへほまみむめもやゝゆ〜よらりるれろわゐんゑを}
80 .q{アイウエオカキクケコサシスセソタチツテトナニヌネノ}
81 .q{ハヒフヘホマミムメモヤヽユーヨラリルレロワヰンヱヲ};
82 my $tr_t = q{はひふへほまみむめもやゝゆ〜よらりるれろわゐんゑを}
83 .q{あいうえおかきくけこさしすせそたちつてとなにぬねの}
84 .q{ハヒフヘホマミムメモヤヽユーヨラリルレロワヰンヱヲ}
85 .q{アイウエオカキクケコサシスセソタチツテトナニヌネノ};
86 require Jcode;
87 Jcode->new (\$s, 'euc')->tr ($tr_f => $tr_t);
88 $s;
89
90 Function:
91 @Name: rot13
92 @Description:
93 @@@:
94 Encrypting text with ROT 13.
95 @@lang: en
96 @Main:
97 my (undef, $s) = @_;
98 $s =~ tr/A-Za-z/N-ZA-Mn-za-m/;
99 $s;
100

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24