1 |
3 |
ahitrov@rambler.ru |
<& "/contenido/components/header.msn", title => 'Rmedia' &> |
2 |
|
|
<div style="width: 100%; height: 200px; padding: 12px;"> |
3 |
|
|
<h1><span style="color: #555">R</span>Media</h1> |
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
<form action="" method="POST" name="forma"> |
8 |
|
|
<textarea rows=12 cols=60 name="text" style="width:100%"><% $textarea_code %></textarea> |
9 |
|
|
|
10 |
|
|
<textarea rows=1 cols=1 name="code" style="visibility:hidden;height:1px;width:1px;"><% $code %></textarea><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td> |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
<input type="checkbox" name="clearn" id="clearn" <% $checked_clearn%>> |
14 |
|
|
<label for="clearn"><b>������</b> ������ �������� �����</label><br> |
15 |
|
|
|
16 |
|
|
<input type="checkbox" name="copy" id="copy" <% $checked_copy %> value="1"> |
17 |
|
|
<label for="copy"><b>����������</b> ��������� � ����� ������</label><br><br> |
18 |
|
|
|
19 |
|
|
<input type="submit" value="����������"> |
20 |
|
|
|
21 |
|
|
</td><td align="right" valign="top"> |
22 |
|
|
</td></tr></table> |
23 |
|
|
|
24 |
|
|
</form> |
25 |
|
|
|
26 |
|
|
% if ($copy){ |
27 |
|
|
<script language="javascript"> |
28 |
|
|
<!-- |
29 |
|
|
document.forma.code.createTextRange().execCommand('Copy') |
30 |
|
|
--> |
31 |
|
|
</script> |
32 |
|
|
% } |
33 |
|
|
|
34 |
|
|
<%args> |
35 |
|
|
|
36 |
|
|
$text => undef |
37 |
|
|
$copy => undef |
38 |
|
|
$clearn => undef |
39 |
|
|
|
40 |
|
|
</%args> |
41 |
|
|
<%init> |
42 |
|
|
|
43 |
|
|
my $arg_code = $text; |
44 |
|
|
my $code = $text; |
45 |
|
|
my $param_clearn = $clearn; |
46 |
|
|
my $textarea_code = $code; |
47 |
|
|
my $checked_copy = $copy ? 'checked' : ''; |
48 |
|
|
my $checked_clearn = $param_clearn? 'checked' : ''; |
49 |
|
|
|
50 |
|
|
</%init> |
51 |
|
|
|
52 |
|
|
<%perl> |
53 |
|
|
|
54 |
|
|
my $initial = $code; |
55 |
|
|
|
56 |
|
|
$textarea_code =~ s/&/&/g; |
57 |
|
|
$textarea_code =~ s/</</g; |
58 |
|
|
$textarea_code =~ s/>/>/g; |
59 |
|
|
$code =~ s/\@{3}/ /g; |
60 |
|
|
$code =~ s/\xB9/N/g; |
61 |
|
|
$code =~ s/№/N/g; |
62 |
|
|
$code =~ s/\xAE/(r)/g; |
63 |
|
|
$code =~ s/®/(r)/g; |
64 |
|
|
$code =~ s/®/(r)/g; |
65 |
|
|
$code =~ s/\xA9/(c)/g; |
66 |
|
|
$code =~ s/©/(c)/g; |
67 |
|
|
$code =~ s/©/(c)/g; |
68 |
|
|
$code =~ s/\x96/-/g; |
69 |
|
|
$code =~ s/–/-/g; |
70 |
|
|
$code =~ s/\x97/-/g; |
71 |
|
|
$code =~ s/—/-/g; |
72 |
|
|
$code =~ s/(«|»|\xAB|\xBB|\x93|\x94)/"/gi; |
73 |
|
|
$code =~ s/\xB6//g; |
74 |
|
|
$code =~ s/\x85/.../g; |
75 |
|
|
$code =~ s/…/.../g; |
76 |
|
|
$code =~ s/…/.../g; |
77 |
|
|
$code =~ s/…/.../g; |
78 |
|
|
$code =~ s/<p[^>]*?>//gi; |
79 |
|
|
$code =~ s/<\/p>/\r\n\r\n/gi; |
80 |
|
|
$code =~ s/<br>/\r\n\r\n/gi; |
81 |
|
|
$code =~ s/\t+/ /g; |
82 |
|
|
if (!$param_clearn){$code =~ s/\r\n/\r\n\r\n/g;} |
83 |
|
|
$code =~ s/\r\n *\r\n/\r\n\r\n/g; |
84 |
|
|
$code =~ s/([^\.\;\:\?\!])\r\n/$1 /g; |
85 |
|
|
$code =~ s/(\r\n){2,}/\r\n/g; |
86 |
|
|
$code =~ s/ +/ /g; |
87 |
|
|
$code =~ s/ \r\n/\r\n/g; |
88 |
|
|
$code =~ s/\r\n /\r\n/g; |
89 |
|
|
$code =~ s/ $//g; |
90 |
|
|
$code =~ s/^/<p>/; |
91 |
|
|
$code =~ s/\r\n/<\/p>\r\n<p>/g; |
92 |
|
|
$code =~ s/$/<\/p>/; |
93 |
|
|
$code =~ s/<p><\/p>\r\n//gi; |
94 |
|
|
$code =~ s/<p><\/p>//gi; |
95 |
|
|
$code =~ s/\(c\)/©/gi; |
96 |
|
|
|
97 |
|
|
if ($code){ |
98 |
|
|
print '<b>��������� (plain text):</b>'; |
99 |
|
|
print '<plaintext>'.$code; |
100 |
|
|
} |
101 |
|
|
|
102 |
|
|
</%perl> |