utf-8版
gbk版
2、建立乙個專案工程,在jsp檔案中引入ueditor相關的js檔案
3、在ueditor資料夾下配置config.json檔案,其中
1)、上傳:imagepathformat、imageurlprefix
2)、塗鴉上傳:scrawlpathformat、scrawlurlprefix
3)、截圖上傳:
snapscreenpathformat、snapscreenurlprefix
4)、附件上傳:
filepathformat、fileurlprefix
videopathformat、videourlprefix
4、imagepathformat 的介紹
作用:指定檔案上傳路徑和返回路徑,支援格式化。
例如,假設**根目錄是:"c://apache/temp/",以下是 imagepathformat 的配置值以及對應的存放目錄。
"/upload/" --> "c://apache/temp/upload/"
"upload/" --> "c://apache/temp/upload/"
"./upload/" --> "c://apache/temp/upload/"
5、指定檔案儲存目錄:上傳路徑可以使用絕對路徑和相對路徑,推薦使用絕對路徑的配置。
1)、使用「/」開頭的根路徑
imagepathformat引數推薦使用「/」開頭的配置,這樣的值對於**根目錄的位置。
例子:**根目錄是「c://apache/temp」,imagepathformat引數設定為「/upload/image/」,那麼上傳的位置在「c://apache/temp/upload/image/」的目錄下
2)、使用非「/」開頭的相對路徑
imagepathformat引數使用非 「/」開頭的相對路徑時,上傳位置也是相對於**根目錄。
例如:**根目錄是「c://apache/temp/」,imagepathformat 引數設定為 「../upload/」,那麼上傳位置在「c://apache/upload/」目錄下。
6、imageurlprefix 的介紹
作用:指定訪問路徑的字首
1)、使用相對路徑時
"imageurlprefix":「/專案名稱」
2)、使用絕對路徑時
「imageurlprefix」:"http://localhost:8080/專案名稱",其中其中localhost可以修改為對應的伺服器位址
7、修改ueditor-config.js
(function () /",
/* 上傳儲存路徑,可以自定義儲存路徑和檔名格式 */
這樣做,就不會被刪除了。
9、完整的使用例子
例:假設例子情況如下
**根目錄:「c://apache/temp/」
上傳檔名稱是:「.jpg」
上傳日期是:2023年01月10日
配置項imagepathformat和imageurlprefix的值為:
imagepathformat:"/upload/image//"
imageurlprefix:「http://localhost:8080/專案名稱」
那麼上傳的結果可能是這樣的:
上傳檔名為:a.jpg
檔案上傳到:「c://apache/temp/upload/image/20180110/」目錄下
後端返回給前端的鏈結為:
插入到編輯器的鏈結為:
「http://localhost:8080/專案名稱/upload/image/20180110/a.jpg」
百度編輯器ueditor
ue information.autoheightenabled true 自適應高度 ue information.autofloatenabled false 編輯器是否固定導航欄 乙個比較簡單好用的修改辦法,就是直接修改ueditor的原始碼,而且是修改此處即可。1 路徑 editor dia...
頁面插入百度UEditor編輯器
第一步第二步 解壓得到如 件結構 之後開啟jsp lib 將lib下的jar包 匯入專案,注意jar包版本問題,如果專案中有相同的包,刪掉低版本保留高版本的。第三步 瀏覽器開啟index.html會發現這是ueditor的乙個參考demo,已經實現了網頁插入編輯器的等功能,複製整個資料夾到專案下 檢...
百度編輯器 Ueditor 如何增加模板 ?
簡介 下面就告訴大家如何增加模板。查詢模板在源 中的位置 已經知道其它模板的關鍵字,比如有 鍵入文件標題 grep 鍵入文件標題 rdir ueditor 結果 root mreald ueditor grep 鍵入文件標題 r dialogs template config.js html 鍵入文...