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 |
|
|
<textarea id="<% $name %>_prev_value" style="display: none;"><% $check %></textarea> |
19 |
|
|
|
20 |
|
|
<script type="text/javascript"> |
21 |
|
|
var <% $name %>_show_modified = false; |
22 |
|
|
var <% $name %>_show_modified_text = "Прежнее значение не показано. Нажмите кнопку '<b>Показать/спрятать</b>' для просмотра."; |
23 |
|
|
|
24 |
|
|
function <% $name %>_changed() { |
25 |
|
|
var t = document.getElementById('<% $name %>_prev_table'); |
26 |
|
|
if (document.getElementById('<% $name %>_textarea').value==document.getElementById('<% $name %>_prev_value').value) { |
27 |
|
|
if (t.style.display!='none') { |
28 |
|
|
t.style.display = 'none'; |
29 |
|
|
} |
30 |
|
|
return; |
31 |
|
|
} |
32 |
|
|
if (t.style.display=='none') { |
33 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text; |
34 |
|
|
t.style.display = ''; |
35 |
|
|
} |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
function <% $name %>_undo() { |
39 |
|
|
document.getElementById('<% $name %>_textarea').value = document.getElementById('<% $name %>_prev_value').value; |
40 |
|
|
<% $name %>_changed(); |
41 |
|
|
return false; |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
function <% $name %>_show() { |
45 |
|
|
if (<% $name %>_show_modified) { |
46 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = <% $name %>_show_modified_text; |
47 |
|
|
} else { |
48 |
|
|
if (document.all) { // IE |
49 |
|
|
document.getElementById('<% $name %>_prev_text').innerText = document.getElementById('<% $name %>_prev_value').innerText || ' '; |
50 |
|
|
} else { |
51 |
|
|
document.getElementById('<% $name %>_prev_text').innerHTML = document.getElementById('<% $name %>_prev_value').innerHTML || ' '; |
52 |
|
|
} |
53 |
|
|
} |
54 |
|
|
<% $name %>_show_modified = !<% $name %>_show_modified; |
55 |
|
|
return false; |
56 |
|
|
} |
57 |
|
|
</script> |
58 |
|
|
|
59 |
|
|
<%args> |
60 |
|
|
$name => undef |
61 |
|
|
$check => undef |
62 |
|
|
$prop => {} |
63 |
|
|
$object => undef |
64 |
|
|
</%args> |
65 |
|
|
<%init> |
66 |
|
|
$check = html_escape($check) unless $prop->{no_escape}; |
67 |
|
|
</%init> |