Line # Revision Author
1 3 ahitrov@rambler.ru <input <% $prop->{readonly} ? 'readonly ' : '' %>type="text" name="<% $name %>" id="<% $name%>_text" size="10" value="<% defined $check ? html_escape($check) : $prop->{default} %>" style="width:25%;" onkeyup="<% $name %>_changed();">
2
3 <table id="<% $name %>_prev_table" style="width: 95%; display: none;" cellspacing="0" cellpadding="0" border="0">
4 <tr>
5 <td width="100%" class="bb undo" style="padding: 3px;"><% $check || '&nbsp;' %></td>
6 <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 <textarea id="<% $name %>_prev_value" style="display: none;"><% $check %></textarea>
11
12 <script type="text/javascript">
13 function <% $name %>_changed() {
14 var t = document.getElementById('<% $name %>_prev_table');
15 if (document.getElementById('<% $name %>_text').value==document.getElementById('<% $name %>_prev_value').value) {
16 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>
38 <%init>
39 </%init>