1 |
8 |
ahitrov@rambler.ru |
% if ($prop->{support_images}) { |
2 |
|
|
<& /contenido/components/images_selector.msn, object => $object, name => $name, attrs => $prop->{support_images} &> |
3 |
|
|
% } |
4 |
|
|
|
5 |
|
|
<textarea \ |
6 |
|
|
% if ($request->{images_staff_printed}) { |
7 |
|
|
onclick="storeCaret(this)" onkeyup="storeCaret(this)" onselect="storeCaret(this)" \ |
8 |
|
|
% } |
9 |
|
|
<% $prop->{readonly} ? 'readonly ' : '' %> name="<% $name %>" id="<% $name %>_textarea" rows="<% $prop->{rows} || 8 %>" cols="<% $prop->{cols} || 8 %>" style="width: 95%;" onkeyup="<% $name %>_changed();"><% $check %></textarea> |
10 |
|
|
|
11 |
|
|
<table id="<% $name %>_prev_table" style="width: 95%; display: none;" cellspacing="0" cellpadding="0" border="0"> |
12 |
|
|
<tr> |
13 |
|
|
<td width="100%" id="<% $name %>_prev_text" class="bb undo" style="padding: 3px;"></td> |
14 |
|
|
<td style="padding-left: 3px; vertical-align: top;"><a href="#" onclick="return <% $name %>_show();" title="Показать/спрятать прежнее значение"><img src="/contenido/i/modified-19x19.gif" width="19" height="19" class="bb gb"></a></td> |
15 |
|
|
<td style="padding-left: 3px; vertical-align: top;"><a href="#" onclick="return <% $name %>_undo();" title="Отменить изменения"><img src="/contenido/i/undo-19x19.gif" width="19" height="19" class="bb gb"></a></td> |
16 |
|
|
</tr> |
17 |
|
|
</table> |
18 |
|
|
% if ( exists $prop->{rem} && $prop->{rem} ) { |
19 |
|
|
<div style="color:gray; font-size:85%; padding:4px">» <% $prop->{rem} %></div> |
20 |
|
|
% } |
21 |
|
|
<textarea id="<% $name %>_prev_value" style="display: none;"><% $check %></textarea> |
22 |
|
|
|
23 |
|
|
<script type="text/javascript"> |
24 |
|
|
var <% $name %>_show_modified = false; |
25 |
|
|
var <% $name %>_show_modified_text = "Прежнее значение не показано. Нажмите кнопку '<b>Показать/спрятать</b>' для просмотра."; |
26 |
|
|
|
27 |
|
|
function <% $name %>_changed() { |
28 |
|
|
var t = document.getElementById('<% $name %>_prev_table'); |
29 |
|
|
if (document.getElementById('<% $name %>_textarea').value==document.getElementById('<% $name %>_prev_value').value) { |
30 |
|
|
if (t.style.display!='none') { |
31 |
|
|
t.style.display = 'none'; |
32 |
|
|
} |
33 |
|
|
return; |
34 |
|
|
} |
35 |
|
|
if (t.style.display=='none') { |
36 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text; |
37 |
|
|
t.style.display = ''; |
38 |
|
|
} |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
function <% $name %>_undo() { |
42 |
|
|
document.getElementById('<% $name %>_textarea').value = document.getElementById('<% $name %>_prev_value').value; |
43 |
|
|
<% $name %>_changed(); |
44 |
|
|
return false; |
45 |
|
|
} |
46 |
|
|
|
47 |
|
|
function <% $name %>_show() { |
48 |
|
|
if (<% $name %>_show_modified) { |
49 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text; |
50 |
|
|
} else { |
51 |
|
|
if (document.all) { // IE |
52 |
|
|
document.getElementById('<% $name %>_prev_text').innerText = document.getElementById('<% $name %>_prev_value').innerText || ' '; |
53 |
|
|
} else { |
54 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = document.getElementById('<% $name %>_prev_value').innerHTML || ' '; |
55 |
|
|
} |
56 |
|
|
} |
57 |
|
|
<% $name %>_show_modified = !<% $name %>_show_modified; |
58 |
|
|
return false; |
59 |
|
|
} |
60 |
|
|
</script> |
61 |
|
|
|
62 |
|
|
<%args> |
63 |
|
|
$name => undef |
64 |
|
|
$check => undef |
65 |
|
|
$prop => {} |
66 |
|
|
$object => undef |
67 |
|
|
</%args> |
68 |
|
|
<%init> |
69 |
|
|
$check = html_escape($check) unless $prop->{no_escape}; |
70 |
|
|
</%init> |