Commits

Reed O'Brien  committed a568b03

Make readonly_template render TinyMCE read only

Make deform.widget.RichTextWidget render the readonly_template read only when readonly is passed as true in Widget.seralize call.

  • Participants
  • Parent commits 26446d2

Comments (0)

Files changed (1)

File deform/templates/readonly/richtext.pt

+<textarea tal:attributes="class: string:tinymce;"
+          id="${field.oid}"
+          name="${field.name}">${cstruct}</textarea>
 <script language="javascript"
-	type="text/javascript"
-	tal:content="string:
-		     tinyMCE.init({
-		     mode : 'textareas',
-		     theme : 'advanced',
-		     plugins : 'style,layer,table,advhr,advlink,iespell,inlinepopups,searchreplace,contextmenu,paste,directionality,nonbreaking,xhtmlxtras,template,fullscreen',
-		     theme_advanced_buttons1 : ',${view/styles}',
-		     theme_advanced_buttons2 : '',
-		     theme_advanced_buttons3 : '',
-		     theme_advanced_toolbar_location : 'top',
-		     theme_advanced_toolbar_align : 'left',
-		     theme_advanced_resizing : true,
-		     valid_elements : 'h3,h4,em,ul,ol,li,sup,sub,i,br,p,b,-strong'
-		     });">
+	type="text/javascript">
+  tinyMCE.init({
+    height: '${field.widget.height}',
+    mode : 'textareas',
+    readonly : 1,
+    theme : '${field.widget.theme}',
+    theme_advanced_resizing : true,
+    theme_advanced_toolbar_align : 'left',
+    theme_advanced_toolbar_location : 'top',
+    width: '${field.widget.width}'
+  });
 </script>
-