Line # Revision Author
1 58 ahitrov@rambler.ru <input <% $prop->{readonly} ? 'readonly ' : '' %> type="text" name="<% $name %>" id="<% $name%>_text" size="60" value="" style="width: 95%;" onkeyup="<% $name %>_changed();">
2 3 ahitrov@rambler.ru
3 <table id="<% $name %>_prev_table" style="width: 95%; display: none;" cellspacing="0" cellpadding="0" border="0">
4 <tr>
5 58 ahitrov@rambler.ru <td width="100%" class="bb undo" style="padding: 3px;">�������� ��������� ������</td>
6 3 ahitrov@rambler.ru <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>
7 </tr>
8 </table>
9
10 58 ahitrov@rambler.ru <textarea id="<% $name %>_prev_value" style="display: none;"></textarea>
11 3 ahitrov@rambler.ru
12 <script type="text/javascript">
13 function <% $name %>_changed() {
14 var t = document.getElementById('<% $name %>_prev_table');
15 58 ahitrov@rambler.ru if ( document.getElementById('<% $name %>_text').value == '') {
16 3 ahitrov@rambler.ru if (t.style.display!='none') {
17 t.style.display = 'none';
18 }
19 return;
20 }
21 if (t.style.display=='none') {
22 t.style.display = '';
23 }
24 }
25
26 function <% $name %>_undo() {
27 document.getElementById('<% $name %>_text').value = document.getElementById('<% $name %>_prev_value').value;
28 <% $name %>_changed();
29 return false;
30 }
31 </script>
32
33 <%args>
34 $name => undef
35 $check => undef
36 $prop => {}
37 </%args>