stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / elements / htmlarea.html
index d0f26e7..dba744e 100644 (file)
@@ -6,12 +6,13 @@ Example:
             'field'      => 'fieldname',
             'curr_value' => $curr_value,
             'height'     => 800,
+            'config'     => { extraPlugins => 'blockprotect' },
          );
 
 </%doc>
 
 % #init
-<SCRIPT TYPE="text/javascript" src="<% $p %>elements/ckeditor/ckeditor.js">
+<SCRIPT TYPE="text/javascript" src="<% $fsurl %>elements/ckeditor/ckeditor.js">
 </SCRIPT>
 
 % #editor
@@ -19,20 +20,26 @@ Example:
 
 <SCRIPT TYPE="text/javascript">
 
-  CKEDITOR.replace('<% $opt{'field'} %>', {
-%   if ( $opt{'width'} ) {
-      width: <% $opt{'width'} %>,
-%   }
-    height: <% $opt{'height'} || 420 %>,
-    startupFocus: true,
-    toolbarCanCollapse: true,
-    enterMode: 2
-  });
+  var <% $opt{'field'} %>_editor =
+    CKEDITOR.replace('<% $opt{'field'} %>',
+                   <% encode_json($config) %>
+  );
 
 </SCRIPT>
 
 <%init>
 
 my %opt = @_;
+my $config = {
+  'height'              => ($opt{height} || 420),
+  'startupFocus'        => Cpanel::JSON::XS::true,
+  'skin'                => 'kama',
+  'toolbarCanCollapse'  => JSON::true,
+  'removePlugins'       => 'elementspath',
+  'basePath'            => $fsurl.'elements/ckeditor/',
+  'enterMode'           => 2,
+  %{ $opt{config} || {} },
+};
+$config->{width} = $opt{width} if defined($opt{width});
 
 </%init>