【问题标题】:How to put Code Sample Plugin of TinyMCE in phpfox?如何将 TinyMCE 的代码示例插件放入 phpfox?
【发布时间】:2016-03-11 22:37:39
【问题描述】:

我有一个小型 mce 编辑器,如下图所示:

我想将tinymce编辑器的代码示例插件放在phpfox中,例如:

请告诉我该怎么做。

【问题讨论】:

  • 到目前为止你有什么尝试?
  • 我把微型编辑器放在我的 phpfox 项目中,它可以工作,但它没有代码示例我尝试使用最新版本的微型编辑器是 4.3.1

标签: tinymce phpfox


【解决方案1】:
  1. 如果您没有安装 codesample,您可以从 tinymce.com 下载整个包,并从目录 js/tinymce/plugins/codesample/ 中包含 plugin.min.js

  2. prismjs.com 下载 prism.js 和 prism.css 并包含在您的 HTML 页面中

  3. 修改您的 tinymce_setup.js 并将 codesample 添加到您的 tinymce_setup.js 我的 tinymce_setup.js 看起来像

tinymce.init({
  selector: 'textarea',
  height: 500,
  plugins: [
    'advlist autolink lists link image charmap print preview anchor',
    'searchreplace visualblocks code fullscreen',
    'insertdatetime media table contextmenu paste code codesample'
  ],
  toolbar: ("insertfile undo redo | styleselect | bold italic | " +
            "alignleft aligncenter alignright alignjustify | " +
            "bullist numlist outdent indent | link image table | " +
            "code fullscreen codesample"),
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多