TinyMCE with Codeigniter

*爱你&永不变心* 提交于 2019-12-25 04:07:10

问题


I am hoping the second text editor is without tinymce but the tinymce is still appearing how to delete it?

<!DOCTYPE html>
<html>
<head>

   <script src="<?php echo site_url('assets/tinymce/js/tinymce/tinymce.min.js'); ?>"></script>
  <!-- <script>tinymce.init({ selector:'textarea' });</script> -->

<script>  

tinymce.init({
  selector: 'textarea',
  height: 200,
  width: 600,
  menubar: false,
  plugins: [
    'advlist autolink lists link image charmap print preview anchor',
    'searchreplace visualblocks code fullscreen',
    'insertdatetime media table contextmenu paste code'
  ],
  toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
  content_css: '<?php echo base_url('assets/tinymce/css/codepen.min.css'); ?>',
  file_browser_callback: RoxyFileBrowser
});  

function RoxyFileBrowser(field_name, url, type, win) {
  var roxyFileman = '<?php echo base_url('assets/fileman/index.html'); ?>'
  if (roxyFileman.indexOf("?") < 0) {     
    roxyFileman += "?type=" + type;   
  }
  else {
    roxyFileman += "&type=" + type;
  }
  roxyFileman += '&input=' + field_name + '&value=' + win.document.getElementById(field_name).value;
  if(tinyMCE.activeEditor.settings.language){
    roxyFileman += '&langCode=' + tinyMCE.activeEditor.settings.language;
  }

  tinyMCE.activeEditor.windowManager.open({
     file: roxyFileman,
     title: 'File Manager',
     width: 800, 
     height: 400,
     resizable: "yes",
     plugins: "media",
     inline: "yes",
     close_previous: "no"  
  }, {     window: win,     input: field_name    });
  return false; 
}

</script>   
</head>

<body>

  <textarea>Easy! You should check out MoxieManager!</textarea><br><br>

  <textarea>I am hoping this one without tinymce</textarea>

</body>
</html>

I probably need someone to help me distinguish how to differentiate between the first text editor (with tinymce) and the second one (I am hoping without tinymce).

I place the tinymce declaration or setting on the top.


回答1:


<!DOCTYPE html>
<html>
<head>
   <script src="<?php echo site_url('assets/tinymce/js/tinymce/tinymce.min.js'); ?>"></script>
  <!-- <script>tinymce.init({ selector:'textarea' });</script> -->

<script>  
tinymce.init({
  selector: 'textarea.number1',  
  height: 200,
  width: 600,
  menubar: false,
  plugins: [
    'advlist autolink lists link image charmap print preview anchor',
    'searchreplace visualblocks code fullscreen',
    'insertdatetime media table contextmenu paste code'
  ],
  toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
  content_css: '<?php echo base_url('assets/tinymce/css/codepen.min.css'); ?>',
  file_browser_callback: RoxyFileBrowser
});  

function RoxyFileBrowser(field_name, url, type, win) {
  var roxyFileman = '<?php echo base_url('assets/fileman/index.html'); ?>'
  if (roxyFileman.indexOf("?") < 0) {     
    roxyFileman += "?type=" + type;   
  }
  else {
    roxyFileman += "&type=" + type;
  }
  roxyFileman += '&input=' + field_name + '&value=' + win.document.getElementById(field_name).value;
  if(tinyMCE.activeEditor.settings.language){
    roxyFileman += '&langCode=' + tinyMCE.activeEditor.settings.language;
  }
  tinyMCE.activeEditor.windowManager.open({
     file: roxyFileman,
     title: 'File Manager',
     width: 800, 
     height: 400,
     resizable: "yes",
     plugins: "media",
     inline: "yes",
     close_previous: "no"  
  }, {     window: win,     input: field_name    });
  return false; 
}
</script>   

</head>
<body>
  <textarea class="number1">Easy! You should check out MoxieManager!</textarea><br><br>

  <textarea>I am hoping this one without tinymce</textarea>
</body>
</html>

I finally able to distinguish between the first text message (with tinymce) and the second one (without tinymce).

Now, I wonder why if I use the selector : selector: 'textarea.number1',

and selector: 'textarea' it shows different tiny mce )? The first one without image upload and the second one with image upload.



来源:https://stackoverflow.com/questions/41311906/tinymce-with-codeigniter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!