```
/**
* 張躍帥-UEditor完整配置項
* 備注:此文件不熟悉不要隨意修改
*/
/* 初始化加載 */
(function () {
/**
* 配置項主體
*/
window.UEDITOR_CONFIG = {
// 為編輯器實例添加一個路徑,這個不能被注釋
UEDITOR_HOME_URL: "/public/UEditorPlus/",
// 需要能跨域的靜態資源請求,主要用戶彈窗頁面等靜態資源
UEDITOR_CORS_URL: "/public/UEditorPlus/",
// 是否開啟Debug模式
debug: false,
// 服務器統一請求接口路徑
serverUrl: "",
// 服務器統一請求頭信息,會在所有請求中帶上該信息
serverHeaders: {
// 'Authorization': 'Bearer xxx'
},
//工具欄上的所有的功能按鈕和下拉框,可以在new編輯器的實例時選擇自己需要的重新定義
toolbars: [
[
"fullscreen", // 全屏
//"source", // 源代碼
"formatmatch", // 格式刷
"removeformat", // 清除格式
"|",
"undo", // 撤銷
"redo", // 重做
"|",
"bold", // 加粗
"italic", // 斜體
"underline", // 下劃線
"fontborder", // 字符邊框
"strikethrough", // 刪除線
"superscript", // 上標
"subscript", // 下標
"autotypeset", // 自動排版
"blockquote", // 引用
"pasteplain", // 純文本粘貼模式
"|",
"forecolor", // 字體顏色
"backcolor", // 背景色
"insertorderedlist", // 有序列表
"insertunorderedlist", // 無序列表
//"selectall", // 全選
//"cleardoc", // 清空文檔
"|",
"rowspacingtop", // 段前距
"rowspacingbottom", // 段后距
"lineheight", // 行間距
"|",
"customstyle", // 自定義標題
"paragraph", // 段落格式
"fontfamily", // 字體
"fontsize", // 字號
"|",
//"directionalityltr", // 從左向右輸入
//"directionalityrtl", // 從右向左輸入
"indent", // 首行縮進
"|",
"justifyleft", // 居左對齊
"justifycenter", // 居中對齊
"justifyright",
"justifyjustify", // 兩端對齊
"|",
"touppercase", // 字母大寫
"tolowercase", // 字母小寫
"|",
"link", // 超鏈接
"unlink", // 取消鏈接
"anchor", // 錨點
"|",
"imagenone", // 圖片默認
"imageleft", // 圖片左浮動
"imagecenter", // 圖片居中
"imageright", // 圖片右浮動
"|",
"simpleupload", // 單圖上傳
"insertimage", // 多圖上傳
"emotion", // 表情
//"scrawl", // 涂鴉
"insertvideo", // 視頻
//"insertaudio", // 音頻
"attachment", // 附件
//"insertframe", // 插入Iframe
//"insertcode", // 插入代碼
//"pagebreak", // 分頁
//"template", // 模板
//"background", // 背景
//"formula", // 公式
"|",
//"horizontal", // 分隔線
"date", // 日期
"time", // 時間
"spechars", // 特殊字符
//"wordimage", // Word圖片轉存
"|",
"inserttable", // 插入表格
"deletetable", // 刪除表格
"insertparagraphbeforetable", // 表格前插入行
"insertrow", // 前插入行
"deleterow", // 刪除行
"insertcol", // 前插入列
"deletecol", // 刪除列
"mergecells", // 合并多個單元格
"mergeright", // 右合并單元格
"mergedown", // 下合并單元格
"splittocells", // 完全拆分單元格
"splittorows", // 拆分成行
"splittocols", // 拆分成列
"|",
"print", // 打印
"preview", // 預覽
"searchreplace", // 查詢替換
//"|",
//"contentimport", // 導入內容
//"help", // 幫助
]
]
// 自定義工具欄按鈕點擊,返回 true 表示已經處理點擊,會阻止默認事件
, toolbarCallback: function (cmd, editor) {
// console.log('toolbarCallback',cmd, editor);
// switch(cmd){
// case 'insertimage':
// editor.execCommand('insertHtml', '<p><img src="xxxxx" /></p>');
// console.log('toolbarCallback',cmd, editor)
// return true;
// case 'insertvideo':
// editor.execCommand('insertHtml', '<p><iframe src="xxxxx" /></p>');
// console.log('toolbarCallback',cmd, editor)
// return true;
// case 'attachment':
// console.log('toolbarCallback',cmd, editor)
// editor.execCommand('insertHtml', '<p><a href="xxx.zip">下載文件</a></p>');
// return true;
// }
}
// 插入圖片自定義配置
, imageConfig: {
// 禁止本地上傳
disableUpload: false,
// 禁止在線管理
disableOnline: false,
// 自定義選擇按鈕
selectCallback: null,
// selectCallback: function(editor,cb){
// console.log('selectCallback',cb);
// setTimeout(function(){
// cb({
// path:'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png',
// name:'測試圖片'
// });
// },1000);
// }
}
// 插入視頻配置
, videoConfig: {
// 禁止本地上傳,
disableUpload: false,
// 自定義選擇按鈕
selectCallback: null,
// selectCallback: function(editor,cb){
// console.log('selectCallback',cb);
// setTimeout(function(){
// cb({
// path:'https://www.bilibili.com/video/BV1y44y1g7NR?spm_id_from=333.1007.tianma.1-1-1.click',
// name:'測試視頻'
// });
// },1000);
// }
}
// 插入音頻配置
, audioConfig: {
// 禁止本地上傳,
disableUpload: false,
// 自定義選擇按鈕
selectCallback: null,
// selectCallback: function(editor,cb){
// console.log('selectCallback',cb);
// setTimeout(function(){
// cb({
// path:'https://example.com/test.mp3',
// name:'測試音頻'
// });
// },1000);
// }
}
// 公式配置
/*
, formulaConfig: {
// 公式渲染鏈接模板
imageUrlTemplate: 'https://r.latexeasy.com/image.svg?{}',
// 編輯器模式 plain live
editorMode: 'live',
// 編輯器地址
editorLiveServer: 'https://latexeasy.com',
}
*/
// 自動保存
, autoSaveEnable: true
// 瀏覽器初始化時自動恢復上一次的內容
, autoSaveRestore: false
// 自動保存Key,為空時根據網址自動計算
, autoSaveKey: null
//當鼠標放在工具欄上時顯示的tooltip提示,留空支持自動多語言配置,否則以配置值為準
//,labelMap:{
// 'anchor':'', 'undo':''
//}
//語言配置項,默認是zh-cn。有需要的話也可以使用如下這樣的方式來自動多語言切換,當然,前提條件是lang文件夾下存在對應的語言文件:
//lang值也可以通過自動獲取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
//,lang:"zh-cn"
//,langPath:URL +"lang/"
//主題配置項,默認是default。有需要的話也可以使用如下這樣的方式來自動多主題切換,當然,前提條件是themes文件夾下存在對應的主題文件:
//現有如下皮膚:default
//,theme:'default'
//,themePath:URL +"themes/"
,zIndex : 99999999 //編輯器層級的基數,默認是900
//針對getAllHtml方法,會在對應的head標簽中增加該編碼設置。
//,charset:"utf-8"
//若實例化編輯器的頁面手動修改的domain,此處需要設置為true
//,customDomain:false
// 默認顯示編輯器
//,isShow : true
// 提交表單時,服務器獲取編輯器提交內容的所用的參數,多實例時可以給容器name屬性,會將name給定的值最為每個實例的鍵值,不用每次實例化的時候都設置這個值
//,textarea:'editorValue'
// 初始化編輯器的內容,也可以通過 textarea/script 給值
, initialContent: ''
//,autoClearinitialContent:true //是否自動清除編輯器初始內容,注意:如果focus屬性設置為true,這個也為真,那么編輯器一上來就會觸發導致初始化的內容看不到了
// 初始化時,是否讓編輯器獲得焦點
, focus: false
// 編輯區自定義樣式,如果自定義,最好給 p 標簽如下的行高,要不輸入中文時,會有跳動感
, initialStyle: '' // p{line-height:1em}
//,iframeJsUrl: '' //給編輯區域的iframe引入一個js文件
//,iframeCssUrl: URL + '/themes/iframe.css' //給編輯區域的iframe引入一個css文件
// 給編輯器引入更多樣式文件
//,iframeCssUrlsAddition: []
// 首行縮進距離,默認是 2em
, indentValue: '2em'
// 初始化編輯器寬度,默認 1000
// ,initialFrameWidth:1000
// 初始化編輯器高度,默認 320
// ,initialFrameHeight:320
// 編輯器初始化結束后,編輯區域是否是只讀的,默認是false
, readonly: false
// getContent時,是否刪除空的inlineElement節點(包括嵌套的情況)
, autoClearEmptyNode: true
// 啟用拖放上傳
//,enableDragUpload: true
// 啟用粘貼上傳
//,enablePasteUpload: true
// 啟用圖片拉伸縮放
//,imageScaleEnabled: true
// 是否開啟初始化時即全屏,默認關閉
, fullscreen: false
// 圖片操作的浮層開關,默認打開
//,imagePopup:true
// 自動同步編輯器要提交的數據
//,autoSyncData:true
// 是否開啟表情本地化,默認關閉。若要開啟請確保emotion文件夾下包含官網提供的images表情文件夾
//,emotionLocalization:false
// 粘貼只保留標簽,去除標簽所有屬性
//,retainOnlyLabelPasted: false
// 是否默認為純文本粘貼。false為不使用純文本粘貼,true為使用純文本粘貼
//,pasteplain:false
// 純文本粘貼模式下的過濾規則
//'filterTxtRules' : function(){
// function transP(node){
// node.tagName = 'p';
// node.setStyle();
// }
// return {
// //直接刪除及其字節點內容
// '-' : 'script style object iframe embed input select',
// 'p': {$:{}},
// 'br':{$:{}},
// 'div':{'$':{}},
// 'li':{'$':{}},
// 'caption':transP,
// 'th':transP,
// 'tr':transP,
// 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
// 'td':function(node){
// //沒有內容的td直接刪掉
// var txt = !!node.innerText();
// if(txt){
// node.parentNode.insertAfter(UE.uNode.createText(' '),node);
// }
// node.parentNode.removeChild(node,node.innerText())
// }
// }
//}()
// 提交到后臺的數據是否包含整個html字符串
, allHtmlEnabled: false
//有序列表的下拉配置,值留空時支持多語言自動識別,若配置值,則以此值為準
//,'insertorderedlist':{
// 'decimal' : '' , //'1,2,3...'
// 'lower-alpha' : '' , // 'a,b,c...'
// 'lower-roman' : '' , //'i,ii,iii...'
// 'upper-alpha' : '' , lang //'A,B,C'
// 'upper-roman' : '' //'I,II,III...'
//}
//insertunorderedlist
//無序列表的下拉配置,值留空時支持多語言自動識別,若配置值,則以此值為準
//,insertunorderedlist : { //自定的樣式
// 'circle' : '', // '○ 小圓圈'
// 'disc' : '', // '● 小圓點'
// 'square' : '' //'■ 小方塊'
//}
//,listDefaultPaddingLeft : '30'//默認的左邊縮進的基數倍
//,listiconpath : 'http://bs.baidu.com/listicon/'//自定義標號的路徑
//,maxListLevel : 3 //限制可以tab的級數, 設置-1為不限制
//,autoTransWordToList:false //禁止word中粘貼進來的列表自動變成列表標簽
// 字體設置 label 留空支持多語言自動切換,若配置,則以配置值為準
//,'fontfamily':[
// { label:'',name:'songti',val:'宋體,SimSun'},
// { label:'',name:'kaiti',val:'楷體,楷體_GB2312, SimKai'},
// { label:'',name:'yahei',val:'微軟雅黑,Microsoft YaHei'},
// { label:'',name:'heiti',val:'黑體, SimHei'},
// { label:'',name:'lishu',val:'隸書, SimLi'},
// { label:'',name:'andaleMono',val:'andale mono'},
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
// { label:'',name:'arialBlack',val:'arial black,avant garde'},
// { label:'',name:'comicSansMs',val:'comic sans ms'},
// { label:'',name:'impact',val:'impact,chicago'},
// { label:'',name:'timesNewRoman',val:'times new roman'}
//]
// 字號
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
// 段落格式 值留空時支持多語言自動識別,若配置,則以配置值為準
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
// 段間距 值和顯示的名字相同
//,'rowspacingtop':['5', '10', '15', '20', '25']
// 段間距 值和顯示的名字相同
//,'rowspacingbottom':['5', '10', '15', '20', '25']
//行內間距 值和顯示的名字相同
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
// customstyle
//自定義樣式,不支持國際化,此處配置值即可最后顯示值
//block的元素是依據設置段落的邏輯設置的,inline的元素依據BIU的邏輯設置
//盡量使用一些常用的標簽
//參數說明
//tag 使用的標簽名字
//label 顯示的名字也是用來標識不同類型的標識符,注意這個值每個要不同,
//style 添加的樣式
//每一個對象就是一個自定義的樣式
//,'customstyle':[
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
//]
// 打開右鍵菜單功能
, enableContextMenu: true
//右鍵菜單的內容,可以參考plugins/contextmenu.js里邊的默認菜單的例子,label留空支持國際化,否則以此配置為準
//,contextMenu:[
// {
// label:'', //顯示的名稱
// cmdName:'selectall',//執行的command命令,當點擊這個右鍵菜單時
// //exec可選,有了exec就會在點擊時執行這個function,優先級高于cmdName
// exec:function () {
// //this是當前編輯器的實例
// //this.ui._dialogs['inserttableDialog'].open();
// }
// }
//]
// 快捷菜單
, shortcutMenu: [
// "fontfamily", // 字體
// "fontsize", // 字號
"bold", // 加粗
"italic", // 斜體
"underline", // 下劃線
"strikethrough", // 刪除線
"fontborder", // 字符邊框
"forecolor", // 字體顏色
//"shadowcolor", // 字體陰影
"backcolor", // 背景色
"imagenone",
"imageleft",
"imagecenter",
"imageright",
"insertimage",
"formula",
// "justifyleft", // 居左對齊
// "justifycenter", // 居中對齊
// "justifyright", // 居右對齊
// "justifyjustify", // 兩端對齊
// "textindent", // 首行縮進
// "rowspacingtop", // 段前距
// "rowspacingbottom", // 段后距
// "outpadding", // 兩側距離
// "lineheight", // 行間距
// "letterspacing" , // 字間距
// "insertorderedlist", // 有序列表
// "insertunorderedlist", // 無序列表
// "superscript", // 上標
// "subscript", // 下標
// "link", // 超鏈接
// "unlink", // 取消鏈接
// "touppercase", // 字母大寫
// "tolowercase" // 字母小寫
]
// 是否啟用元素路徑,默認是顯示
, elementPathEnabled: false
// 是否開啟字數統計
, wordCount: true
// 允許的最大字符數
, maximumWords: 30000
//字數統計提示,{#count} 代表當前字數,{#leave}代表還可以輸入多少字符數,留空支持多語言自動切換,否則按此配置顯示
//,wordCountMsg:'' //當前已輸入 {#count} 個字符,您還可以輸入{#leave} 個字符
//超出字數限制提示 留空支持多語言自動切換,否則按此配置顯示
//,wordOverFlowMsg:'' //<span style="color:red;">你輸入的字符個數已經超出最大允許值,服務器可能會拒絕保存!</span>
// 點擊tab鍵時移動的距離,tabSize倍數,tabNode什么字符做為單位
//,tabSize:4
//,tabNode:' '
// 清除格式時可以刪除的標簽
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
// 清除格式時可以刪除的屬性
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
// 可以最多撤銷退回的次數,默認20
, maxUndoCount: 20
// 當輸入的字符數超過該值時,保存一次現場
, maxInputCount: 1
// 是否自動長高,默認true
, autoHeightEnabled: true
//scaleEnabled
//是否可以拉伸長高,默認true(當開啟時,自動長高失效)
//,scaleEnabled:false
//,minFrameWidth:800 //編輯器拖動時最小寬度,默認800
//,minFrameHeight:220 //編輯器拖動時最小高度,默認220
//autoFloatEnabled
//是否保持toolbar的位置不動,默認true
//,autoFloatEnabled:true
//浮動時工具欄距離瀏覽器頂部的高度,用于某些具有固定頭部的頁面
//,topOffset:30
//編輯器底部距離工具欄高度(如果參數大于等于編輯器高度,則設置無效)
//,toolbarTopOffset:400
//設置遠程圖片是否抓取到本地保存
, catchRemoteImageEnable: true //設置是否抓取遠程圖片
// pageBreakTag
//分頁標識符,默認是_ueditor_page_break_tag_
//,pageBreakTag:'_ueditor_page_break_tag_'
// 自動排版參數
, autotypeset: {
// 合并空行
mergeEmptyline: true,
// 去掉冗余的class
removeClass: true,
// 去掉空行
removeEmptyline: false,
// 段落的排版方式,可以是 left,right,center,justify 去掉這個屬性表示不執行排版
textAlign: "left",
// 圖片的浮動方式,獨占一行劇中,左右浮動,默認: center,left,right,none 去掉這個屬性表示不執行排版
imageBlockLine: "center",
// 根據規則過濾沒事粘貼進來的內容
pasteFilter: false,
// 去掉所有的內嵌字號,使用編輯器默認的字號
clearFontSize: false,
// 去掉所有的內嵌字體,使用編輯器默認的字體
clearFontFamily: false,
// 去掉空節點
removeEmptyNode: false,
// 可以去掉的標簽
removeTagNames: {div: 1},
// 行首縮進
indent: false,
// 行首縮進的大小
indentValue: "2em",
// 全角轉半角
bdc2sb: false,
// 半角轉全角
tobdc: false
}
//表格是否可以拖拽
//,tableDragable: true
//sourceEditor
//源碼的查看方式,codemirror 是代碼高亮,textarea是文本框,默認是codemirror
//注意默認codemirror只能在ie8+和非ie中使用
//,sourceEditor:"codemirror"
//如果sourceEditor是codemirror,還用配置一下兩個參數
//codeMirrorJsUrl js加載的路徑,默認是 URL + "third-party/codemirror/codemirror.js"
//,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js"
//codeMirrorCssUrl css加載的路徑,默認是 URL + "third-party/codemirror/codemirror.css"
//,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css"
//編輯器初始化完成后是否進入源碼模式,默認為否。
//,sourceEditorFirst:false
//iframeUrlMap
//dialog內容的路徑 ~會被替換成URL,垓屬性一旦打開,將覆蓋所有的dialog的默認路徑
//,iframeUrlMap:{
// 'anchor':'~/dialogs/anchor/anchor.html',
//}
//allowLinkProtocol 允許的鏈接地址,有這些前綴的鏈接地址不會自動添加http
//, allowLinkProtocols: ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:', 'git:', 'svn:']
//默認過濾規則相關配置項目
//,disabledTableInTable:true //禁止表格嵌套
// 允許進入編輯器的 div 標簽自動變成 p 標簽
, allowDivTransToP: true
// 默認產出的數據中的color自動從rgb格式變成16進制格式
, rgb2Hex: true
};
})();
- Jump簡介
- 技術架構
- 代碼規范
- 規范導讀
- JAVA規范
- 數據庫表設計規范
- 集成項目
- JDK1.8-pom.xml
- JDK21-pom.xml
- 項目結構
- 業務模塊-方法名稱規范
- 跨域配置
- License授權配置
- 公共字段自動填充
- 全局異常處理器
- PageOffice配置
- Beetl模板引擎配置
- application.properties
- application-prod.yml
- banner.txt
- logback-spring.xml
- jump-core (核心組件)
- Maven依賴
- 通用枚舉
- 公共數據狀態 - 枚舉
- 公共邏輯刪除 - 枚舉
- 公共操作編碼類型 - 枚舉
- 公共tree父節點 - 枚舉
- 公共是或否 - 枚舉
- 工具Util
- AopTargetUtil
- DownloadUtil
- GenerateNumUtil
- HttpServletUtil
- IpUtil
- JoinPointUtil
- MacUtil
- NetworkUtil
- ParamToUtil
- ResponseUtil
- TimeZoneDateUtil
- UaUtil
- 統一返回
- 結果對象
- 如何使用
- jump-cahche (緩存組件)
- Maven依賴
- Redis配置
- 緩存常量
- 工具Util
- RedisCacheUtil
- jump-idempotent (幕等組件)
- Maven依賴
- Context上下文
- 操作器
- 接口
- 如何實現
- AOP參數
- AOP使用方法
- jump-lock (分布式鎖組件)
- Maven依賴
- 枚舉
- AOP參數
- AOP使用方法
- 工具Util
- RedissonLockUtil
- Util使用方法
- jump-mybatis (mybatis組件)
- Maven依賴
- 基礎Entity
- 枚舉
- 查詢類型 - 枚舉
- 條件查詢
- search
- service
- 分頁結果集
- Mapper
- MyMapper
- 使用方法
- DDL操作
- DML操作
- 工具Util
- EntityUtil
- PageUtil
- TableUtil
- jump-dynamic-datasource (多數據源組件)
- Maven依賴
- Context上下文
- 操作器
- 接口
- 如何實現
- 工具Util
- DatasourceUtil
- 如何使用
- jump-satoken (satoken組件)
- Maven依賴
- Context上下文
- 操作器
- 接口
- 如何實現
- Satoken配置信息
- SatokenUser信息
- Redis緩存操作
- SatokenRedisCache
- SatokenUserRedisCache
- 放行白名單
- jump-oss (OSS組件)
- Maven依賴
- 工具Util
- OssFileUtil
- OssPlatformUtil
- 如何使用
- jump-xss (XSS組件)
- Maven依賴
- 白名單放行
- jump-email (郵件組件)
- Maven依賴
- Email客戶端信息
- Email發送參數
- 工具Util
- jump-websocket (WebSocket組件)
- Maven依賴
- 消息對象
- 工具Util
- 如何使用
- jump-weixin (微信組件)
- Maven依賴
- jump-system (系統管理組件)
- Maven依賴
- AOP
- 系統操作日志AOP
- 系統數據日志AOP
- 系統操作權限AOP
- 字典轉文本AOP
- Redis緩存操作
- SystemConfigRedisCache
- 工具Util
- LoginUserUtil
- SystemAreaUtil
- SystemHomeUtil
- SystemMenuUtil
- SystemOrgAdminUtil
- SystemOrgTypeUtil
- SystemRoleUtil
- SystemUserLoginAreaUtil
- SystemUserUtil
- jump-timer(定時器組件)
- Maven依賴
- 枚舉
- Api接口
- 工具Util
- ActionClassUtil
- TimerTaskUtil
- 如何使用
- jump-ueditor (富文本組件)
- Maven依賴
- 如何使用
- 配置 ueditor.config.js
- 后端 application.properties
- 前端 vue3
- vue-codemirror (代碼編譯器)
- npm依賴
- PageOffice整合
- Maven依賴
- License授權配置
- 枚舉
- 文件來源 - 枚舉
- 預覽文件類型 - 枚舉
- 文件預覽參數
- 下載文件
- 預覽文件
- 工具Util