百度編輯器初始化參數及自定義工具欄


百度編輯器自定義工具欄

var ue = UE.getEditor('editor', {
        wordCount: true, //開啟字數統計
        elementPathEnabled: false,//是否啟用元素路徑,默認是顯示
        maximumWords: 10000,       //允許的最大字符數
        initialContent: '',    //初始化編輯器的內容,也可以通過textarea/script給值,看官網例子
        autoClearinitialContent: true, //是否自動清除編輯器初始內容,注意:如果focus屬性設置為true,這個也為真,那么編輯器一上來就會觸發導致初始化的內容看不到了
        pasteplain: true,  //是否默認為純文本粘貼。false為不使用純文本粘貼,true為使用純文本粘貼
        imageUrlPrefix: "http://localhost:4176", /* 圖片訪問路徑前綴 */
        imagePathFormat: "/UploadFiles/{yyyy}{mm}{dd}/{time}{rand:6}",/* 上傳保存路徑,可以自定義保存路徑和文件名格式 */
        urlTarget: "Email",
        initialFrameWidth: 860, //初始化寬度
        initialFrameHeight: 420, //初始化高度
        autoHeightEnabled: false //關閉高度自適應
});

 

 

迷你版工具欄

toolbars: [
    [
'undo', //撤銷 'redo', //重做 'bold', //加粗 'indent', //首行縮進 'italic', //斜體 'underline', //下划線 'strikethrough', //刪除線 'subscript', //下標 'fontborder', //字符邊框 'superscript', //上標 'formatmatch', //格式刷 'pasteplain', //純文本粘貼模式 'selectall', //全選 'preview', //預覽 'horizontal', //分隔線 'removeformat', //清除格式 'time', //時間 'date', //日期 'inserttitle', //插入標題 'cleardoc', //清空文檔 'simpleupload', //單圖上傳 'fontfamily', //字體 'fontsize', //字號 'paragraph', //段落格式 'link', //超鏈接 'emotion', //表情 'spechars', //特殊字符 'searchreplace', //查詢替換 'justifyleft', //居左對齊 'justifyright', //居右對齊 'justifycenter', //居中對齊 'justifyjustify', //兩端對齊 'forecolor', //字體顏色 'backcolor', //背景色 'insertorderedlist', //有序列表 'insertunorderedlist', //無序列表 'fullscreen', //全屏 'directionalityltr', //從左向右輸入 'directionalityrtl', //從右向左輸入 'rowspacingtop', //段前距 'rowspacingbottom', //段后距 'imagenone', //默認 'imageleft', //左浮動 'imageright', //右浮動 'imagecenter', //居中 'lineheight', //行間距 'edittip ', //編輯提示 'customstyle', //自定義標題 'autotypeset', //自動排版 'drafts' // 從草稿箱加載 ] ]

 

 完整版的工具欄

toolbars: [  
    [  
        'anchor', //錨點  
        'undo', //撤銷  
        'redo', //重做  
        'bold', //加粗  
        'indent', //首行縮進  
        'snapscreen', //截圖  
        'italic', //斜體  
        'underline', //下划線  
        'strikethrough', //刪除線  
        'subscript', //下標  
        'fontborder', //字符邊框  
        'superscript', //上標  
        'formatmatch', //格式刷  
        'source', //源代碼  
        'blockquote', //引用  
        'pasteplain', //純文本粘貼模式  
        'selectall', //全選  
        'print', //打印  
        'preview', //預覽  
        'horizontal', //分隔線  
        'removeformat', //清除格式  
        'time', //時間  
        'date', //日期  
        'unlink', //取消鏈接  
        'insertrow', //前插入行  
        'insertcol', //前插入列  
        'mergeright', //右合並單元格  
        'mergedown', //下合並單元格  
        'deleterow', //刪除行  
        'deletecol', //刪除列  
        'splittorows', //拆分成行  
        'splittocols', //拆分成列  
        'splittocells', //完全拆分單元格  
        'deletecaption', //刪除表格標題  
        'inserttitle', //插入標題  
        'mergecells', //合並多個單元格  
        'deletetable', //刪除表格  
        'cleardoc', //清空文檔  
        'insertparagraphbeforetable', //"表格前插入行"  
        'insertcode', //代碼語言  
        'fontfamily', //字體  
        'fontsize', //字號  
        'paragraph', //段落格式  
        'simpleupload', //單圖上傳  
        'insertimage', //多圖上傳  
        'edittable', //表格屬性  
        'edittd', //單元格屬性  
        'link', //超鏈接  
        'emotion', //表情  
        'spechars', //特殊字符  
        'searchreplace', //查詢替換  
        'map', //Baidu地圖  
        'gmap', //Google地圖  
        'insertvideo', //視頻  
        'help', //幫助  
        'justifyleft', //居左對齊  
        'justifyright', //居右對齊  
        'justifycenter', //居中對齊  
        'justifyjustify', //兩端對齊  
        'forecolor', //字體顏色  
        'backcolor', //背景色  
        'insertorderedlist', //有序列表  
        'insertunorderedlist', //無序列表  
        'fullscreen', //全屏  
        'directionalityltr', //從左向右輸入  
        'directionalityrtl', //從右向左輸入  
        'rowspacingtop', //段前距  
        'rowspacingbottom', //段后距  
        'pagebreak', //分頁  
        'insertframe', //插入Iframe  
        'imagenone', //默認  
        'imageleft', //左浮動  
        'imageright', //右浮動  
        'attachment', //附件  
        'imagecenter', //居中  
        'wordimage', //圖片轉存  
        'lineheight', //行間距  
        'edittip ', //編輯提示  
        'customstyle', //自定義標題  
        'autotypeset', //自動排版  
        'webapp', //百度應用  
        'touppercase', //字母大寫  
        'tolowercase', //字母小寫  
        'background', //背景  
        'template', //模板  
        'scrawl', //塗鴉  
        'music', //音樂  
        'inserttable', //插入表格  
        'drafts', // 從草稿箱加載  
        'charts', // 圖表  
    ]  
]  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM