zoukankan      html  css  js  c++  java
  • ckeditor+ckfinder实例

    php版本CKEditor 4和CKFinder安装及配置方法图文教程

    下载并解压CKEditor 4和CKFinder

    CKEditor 4下载地址:https://ckeditor.com/cke4/builder,选择自定义的版本,记得加上中文语言包

    CKFinder下载地址:https://download.cksource.com/CKFinder/CKFinder%20for%20PHP/3.4.4/ckfinder_php_3.4.4.zip

    //---------------------第一版本----------------------------------------------------------------------------------

    <div id="editor1"></div>

    <script src="https://cdn.ckeditor.com/4.9.2/standard-all/ckeditor.js"></script>

    <script src="ckfinder/ckfinder.js"></script>
    <script>
    // Note: in this sample we use CKEditor with two extra plugins:
    // - uploadimage to support pasting and dragging images,
    // - image2 (instead of image) to provide images with captions.
    // Additionally, the CSS style for the editing area has been slightly modified to provide responsive images during editing.
    // All these modifications are not required by CKFinder, they just provide better user experience.
    if ( typeof CKEDITOR !== 'undefined' ) {
    CKEDITOR.disableAutoInline = true;
    CKEDITOR.addCss( 'img {max-100%; height: auto;}' );
    var editor = CKEDITOR.replace( 'editor1', {
    extraPlugins: 'uploadimage,image2',
    removePlugins: 'image',
    height:250
    } );
    CKFinder.setupCKEditor( editor );
    } else {
    document.getElementById( 'editor1' ).innerHTML =
    '<div class="tip-a tip-a-alert">This sample requires working Internet connection to load CKEditor 4 from CDN.</div>'
    }

    </script>

    //---------------------第二版本----------------------------------------------------------------------------------

    <script src="ckeditor/ckeditor.js"></script>
    <script src="ckfinder/ckfinder.js"></script>


    <textarea name="editor1" id="editor1"></textarea>


    <script type="text/javascript">

    // 启用 CKEitor 的上传功能,使用了 CKFinder 插件

    CKEDITOR.replace( 'editor1', {

    filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
    filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
    filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
    filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
    filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
    filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'

    });

    </script>

  • 相关阅读:
    使用IDEA创建SpringMVC项目
    Spring基于注解的配置——@Required、@Autowired、@Qualifier示例及与传统注入方法的对比
    Spring基于构造函数和设值函数的依赖注入
    Mysql——通配符和正则表达式的使用
    Spring Bean的生命周期、后置处理器、定义继承
    Spring Bean的定义及作用域
    MySql——使用where子句过滤数据
    MySql——创建数据表,查询数据,排序查询数据
    MySQL的安装+可视化工具+JDBC的增删改查
    slave_master_info和slave_relay_log_info中的Master_log_pos不一致
  • 原文地址:https://www.cnblogs.com/chenjian/p/11336894.html
Copyright © 2011-2022 走看看