Is there a way to make the tinymce code editor read-only?
I created this sample: http://codepen.io/costa_b/pen/woRpKO. Source code here for initialization of the tinymce component:
tinymce.init({
  selector: 'textarea',
  height: 500,
  menubar: false,
  plugins: [
    'advlist autolink lists link charmap code ',
    'searchreplace ',
    'insertdatetime paste contextmenu'
  ],
  toolbar: 'undo redo | insert | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | code ',
  //content_css: '//www.tinymce.com/css/codepen.min.css',
  content_style: 'p {margin: 0px; border: 0px solid red; padding: 0px}'
});
When you click on the code button (<>), the editor shows the source code dialog, but it is editable. I want to make it read-only. Is it doable?
Thanks
                        
I had the same need as you recently so I took the
codeplugin source code from the development version on TinyMCE website and modified it to disable source code editing while inReadOnlymode.I advise you to do like me, instead of modifying directly your code plugin, you should create a new one. Create a new folder named
customCodeunder thepluginsdirectory and create a file namedplugin.min.jsif you are callingtinymce.min.jsotherwise your file should be namedplugin.js. Then paste this code insideThen your TinyMCE initialization should become