why wouldn't we want to hide the whole thing rather than leave a big blank gap?
[freeside.git] / httemplate / elements / htmlarea.html
1 <%doc>
2
3 Example:
4
5   include('/elements/htmlarea.html',
6             'field'      => 'fieldname',
7             'curr_value' => $curr_value,
8             'height'     => 800,
9             'config'     => { extraPlugins => 'blockprotect' },
10          );
11
12 </%doc>
13
14 % #init
15 <SCRIPT TYPE="text/javascript" src="<% $p %>elements/ckeditor/ckeditor.js">
16 </SCRIPT>
17
18 % #editor
19 <textarea name="<% $opt{'field'} %>"><% $opt{'curr_value'} |h %></textarea>
20
21 <SCRIPT TYPE="text/javascript">
22
23   CKEDITOR.replace('<% $opt{'field'} %>',
24                    <% encode_json($config) %>
25   );
26
27 </SCRIPT>
28
29 <%init>
30
31 my %opt = @_;
32 my $config = {
33   'height'              => ($opt{height} || 420),
34   'startupFocus'        => JSON::true,
35   'skin'                => 'kama',
36   'toolbarCanCollapse'  => JSON::true,
37   'basePath'            => $p.'elements/ckeditor/',
38   'enterMode'           => 2,
39   %{ $opt{config} || {} },
40 };
41 $config->{width} = $opt{width} if defined($opt{width});
42
43 </%init>