zoukankan      html  css  js  c++  java
  • 百度ueditor改造

    1.如果内容很长ueditor编辑辑器怎么出现滚动条

    ueditor默认是overfolw-y:hidden;内容过长会隐藏,但我们是不希望这样的;

    设置方法:

    在编辑器目录下的config.js文件中,修改autoHeightEnabled: false,,默认是 true 改成false 即可

    2.视频上传---链接上传方法(二次开发)

     (1).先修改链接上传的页面

         在dialogs->video->video.html修改页面;

     (2)修改插入到页面的格式

         在dialogs->video->video.js   

    function insertSingle() {
            var width = $G("videoWidth"),
                height = $G("videoHeight"),
                url = $G('videoUrl').value,//(视频链接&封面图)格式,可以根据自己具体的需求写
                // poster = $G('fengUrl').value,
                align = findFocus("videoFloat", "name");
          //默认的宽高 if (height.value == '') { height.value = '300' } if (width.value == '') { width.value = '300' } phone_html = '
    <video controls src="' + url.split('&')[0] + '" poster="' + url.split('&')[1] + '" width="' + width.value + '" height="' + height.value + '"></video>' // console.log('poster', poster) if (!url) return false; if (!checkNum([width, height])) return false; editor.execCommand('insertHtml', phone_html); console.log('phone', phone_html) // editor.execCommand('insertvideo', { // url: convert_url(url), // poster: poster, // width.value, // height: height.value, // align: align // }, isModifyUploadVideo ? 'upload' : null); }

    3.这个封面图Poster ,ueditor没有定义,需要在配置文件ueditor.config.js中修改,定位 //xss过滤白名单,即,whitList:{ },对video增加poster属性

    4.getContent获取不到video

    配置文件ueditor.config.js中,在 video 标签后新增3给标签,使Ueditor分别能支持embed标签和iframe标签

    source: ['src', 'type'],
                embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play',
                    +  'autoplay', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls', 'preload'],
                iframe: ['src', 'class', 'height', 'width', 'max-width', 'max-height', 'align', 'frameborder', 'allowfullscreen']

     5.ueditor莫名其妙会把div格式化为p

    解决方案: 打开ueditor.config.js,敲入配置:,allowDivTransToP:false

  • 相关阅读:
    奖券数目
    用jQuery和ajax实现搜索框文字自动补全功能
    简单的文件上传功能实现(java)
    示例演示公告通知标题无缝向上滚动,文字段落无缝向上滚动,简单的wangeditor富文本编辑器,简单的音乐播放demo
    SSM框架中注解含义及应用场景小结
    数据库优化以及SQL优化小结
    javaWEB中前后台乱码解决问题小结
    线程同步的方法
    MySQL的简单使用
    springMVC运行流程图及运行原理
  • 原文地址:https://www.cnblogs.com/SunShineM/p/8664605.html
Copyright © 2011-2022 走看看