百度編輯器(Ueditor),百度編輯器ueditor

來源:互聯網
上載者:User

百度編輯器(Ueditor),百度編輯器ueditor

1、下載ue   utf-8版本 ueditor1_3_6-utf8-jsp 

2、解壓後的檔案目錄結構如下所示


3、目錄和檔案說明

dialogs:彈出對話方塊對應的資源和JS檔案

lang:編輯器國際化顯示的檔案

php或jsp或net:涉及到伺服器端操作的後台檔案

themes:樣式圖片和樣式檔案

third-party:第三方外掛程式(包括代碼高亮,源碼編輯等組件)

ueditor.all.js:開發版代碼合并的結果,目錄下所有檔案的打包檔案

ueditor.all.min.js:ueditor.all.js檔案的壓縮版,建議在正式部署時採用

ueditor.config.js:編輯器的設定檔,建議和編輯器執行個體化頁面置於同一目錄

ueditor.parse.js:編輯的內容顯示頁面引用,會自動載入表格、列表、代碼高亮等樣式

ueditor.all.min.js:ueditor.parse.js檔案的壓縮版,建議在內容展示頁正式部署時採用

4、在項目中建個檔案夾用來放解壓後的檔案,可以任意取名


5、建立test頁面,在頁面head內,引用ueditor檔案、設定檔和語言套件檔案。插入下面的代碼,修改引用路檔案的路徑。 

<!-- ue設定檔 -->

<script type="text/javascript"  src="js/ueditor1.3.6/ueditor.config.js"></script>

<!-- 編輯器源碼檔案 -->

<script type="text/javascript" src="js/ueditor1.3.6/ueditor.all.js"></script>

<!-- 語言套件檔案(建議手動載入語言套件,避免在ie下,因為載入語言失敗導致編輯器載入失敗) -->

<script type="text/javascript" src="js/ueditor1.3.6/lang/zh-cn/zh-cn.js"></script>

6、在body裡面設定編輯器內容,執行個體編輯器代碼

<!-- 初始化ue內容  必須寫在body中-->

<script id="container" name="content" type="text/plain">

hello ueditor

</script>

<!-- 執行個體化編輯器 -->

<script type="text/javascript">

    var editor = UE.getEditor('container')

</script>

7、如果看到了下面的編輯器,說明已經部署成功。


8、下面是配置上傳附件和上傳圖片的一些配置。首先把jsp檔案夾下的commons-fileupload-1.2.2.jar,ueditor.jar放到web-inf/lib檔案夾下,並引入到Referenced Libraries中。


9、在項目src下建立ueditor包,講Uploader.java檔案放到ueditor包中。


10、說明


Config.properties中的savePath中的檔案夾 是用來存放圖片的檔案夾,可以手動修改。


Java程式中的savePath 的路徑存放的是上傳附件內容。


以上自己學習的總結 如有什麼不對 還請大神給意見 謝謝

如有轉載 請註明出處 尊重原創!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.