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