带有 Codeigniter 的 TinyMCE [英] TinyMCE with Codeigniter

查看:22
本文介绍了带有 Codeigniter 的 TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望第二个文本编辑器没有tinymce但tinymce仍然出现如何删除它?

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>

我可能需要有人帮助我区分如何区分第一个文本编辑器(使用 tinymce)和第二个(我希望没有 tinymce).

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).

我将 tinymce 声明或设置放在顶部.

I place the tinymce declaration or setting on the top.

推荐答案

<!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>

我终于能够区分第一条短信(有 tinymce)和第二条短信(没有 tinymce).

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

现在,我想知道为什么要使用选择器 : selector: 'textarea.number1',

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

和选择器:'textarea' 它显示不同的小 mce )?第一个没有图片上传,第二个有图片上传.

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

这篇关于带有 Codeigniter 的 TinyMCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆