Line # Revision Author
1 271 ahitrov <input <% $prop->{readonly} || $prop->{virtual} ? 'readonly ' : '' %> type="text" name="<% $name %>" id="<% $name%>_text" size="60" value="<% defined $check ? html_escape($check) : $prop->{default} %>" style="width: 95%;" onkeyup="<% $name %>_changed();">
2 8 ahitrov@rambler.ru
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 <input id="<% $name %>_prev_value" style="display: none;" value="<% html_escape($check) || $prop->{default} %>">
10
11 <script type="text/javascript">
12 function <% $name %>_changed() {
13 var t = document.getElementById('<% $name %>_prev_table');
14 if (document.getElementById('<% $name %>_text').value==document.getElementById('<% $name %>_prev_value').value) {
15 if (t.style.display!='none') {
16 t.style.display = 'none';
17 }
18 return;
19 }
20 if (t.style.display=='none') {
21 t.style.display = '';
22 }
23 }
24
25 function <% $name %>_undo() {
26 document.getElementById('<% $name %>_text').value = document.getElementById('<% $name %>_prev_value').value;
27 <% $name %>_changed();
28 return false;
29 }
30 </script>
31
32 <%args>
33 $name => undef
34 $check => undef
35 $prop => {}
36 </%args>