带有 Codeigniter 的 TinyMCE

编程入门 行业动态 更新时间:2024-10-27 11:22:00
本文介绍了带有 Codeigniter 的 TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我希望第二个文本编辑器没有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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 09:28:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1392029.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Codeigniter   TinyMCE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!