Line # Revision Author
1 3 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
19 <textarea id="<% $name %>_prev_value" style="display: none;"><% $check %></textarea>
20
21 <script type="text/javascript">
22 var <% $name %>_show_modified = false;
23 var <% $name %>_show_modified_text = "������� �������� �� ��������. ������� ������ '<b>��������/��������</b>' ��� ���������.";
24
25 function <% $name %>_changed() {
26 var t = document.getElementById('<% $name %>_prev_table');
27 if (document.getElementById('<% $name %>_textarea').value==document.getElementById('<% $name %>_prev_value').value) {
28 if (t.style.display!='none') {
29 t.style.display = 'none';
30 }
31 return;
32 }
33 if (t.style.display=='none') {
34 document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text;
35 t.style.display = '';
36 }
37 }
38
39 function <% $name %>_undo() {
40 document.getElementById('<% $name %>_textarea').value = document.getElementById('<% $name %>_prev_value').value;
41 <% $name %>_changed();
42 return false;
43 }
44
45 function <% $name %>_show() {
46 if (<% $name %>_show_modified) {
47 document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text;
48 } else {
49 if (document.all) { // IE
50 document.getElementById('<% $name %>_prev_text').innerText = document.getElementById('<% $name %>_prev_value').innerText || ' ';
51 } else {
52 document.getElementById('<% $name %>_prev_text').innerHTML = document.getElementById('<% $name %>_prev_value').innerHTML || '&nbsp;';
53 }
54 }
55 <% $name %>_show_modified = !<% $name %>_show_modified;
56 return false;
57 }
58 </script>
59
60 <%args>
61 $name => undef
62 $check => undef
63 $prop => {}
64 $object => undef
65 </%args>
66 <%init>
67 $check = html_escape($check) unless $prop->{no_escape};
68 </%init>