1. 程式人生 > >wordpress ueditor編輯器的使用

wordpress ueditor編輯器的使用

wordpress系統預設的編輯器功能不太完善,就改用百度編輯器ueditor外掛。

要在其他頁面上呼叫這個編輯器,就在當頁加上ueditor相關的js和css。

<script charset="utf-8" src="<?php home_url();?>/wp-content/plugins/wp-ueditor2/ueditor/editor_config.js"></script>
<script charset="utf-8" src="<?php home_url();?>/wp-content/plugins/wp-ueditor2/ueditor/editor_all.js"></script>
<link rel="stylesheet" type="text/css" href="<?php home_url();?>/wp-content/plugins/wp-ueditor2/ueditor/themes/default/ueditor.css"/>

呼叫:
<pre name="code" class="javascript"><script type="text/javascript">
var editor_a = new baidu.editor.ui.Editor({initialFrameWidth:660,initialFrameHeight:250});
editor_a.render('info_content');
</script>

<textarea name="info_content" id="info_content" style="width:660px;font-size:12px;margin-top: 5px;overflow: scroll-y;"></textarea>

獲取內容:getContent();

設定內容:setContent();

//獲取編輯器內容
			var content = editor_a.getContent();


編輯器會自動將<div>轉成<p>,解決:

在ueditor.all.js裡大約在9305行,'allowDivTransToP' : true 改為 false:

 me.setOpt({
        'allowDivTransToP':false,
        'disabledTableInTable':true
    });

在9399行有個case ' div '全部註釋掉。。

禁止編輯器高度自適應:

在ueditor.config.js裡:

 //是否可以拉伸長高,預設true(當開啟時,自動長高失效)
        ,scaleEnabled:true
 ,initialFrameWidth:1081  //初始化編輯器寬度,預設1000
        ,initialFrameHeight:320  //初始化編輯器高度,預設320



相關推薦

wordpress ueditor編輯的使用

wordpress系統預設的編輯器功能不太完善,就改用百度編輯器ueditor外掛。 要在其他頁面上呼叫這個編輯器,就在當頁加上ueditor相關的js和css。 <script charset="utf-8" src="<?php home_url();?&g

UEditor編輯的工具欄上加一行文字

文字 asc ava html blog 編輯 fun 功能 round <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="tex

UEditor編輯第一次賦值失敗的解決方法

var con 方法 方式 定義 tco 初始化 ren 失敗 網上查了很多方式都不是很好用,最後想到了這樣的處理方式 首先在js中定義一個全局變量 var ue = null; 然後在初始化顯示編輯器的時候js這樣寫 if (ue == null) {

頁面插入百度UEditor編輯

height blog 含義 復制 保留 了解 com mat ext 工作中用到了百度的富文本。以下總結記錄一下,UEditor嵌入網頁的方法。 第一步 到百度UEditor官網下載所需版本:http://ueditor.baidu.com/website 本次下載

vue中使用Ueditor編輯

main path 實例化 server 圖片 打開 ttext name file   一、 下載包:     從Ueditor的官網下載1.4.3.3jsp版本的Ueditor編輯器,官網地址為:       http://ueditor.baidu.com/web

解決ueditor編輯圖片在線管理圖片無法顯示

har equal bar fix cati img nbsp set mod 使用ueditor,點擊在線管理,服務器圖片路徑顯示不正確,如下圖所示 查看源碼,如下: 發現圖片src中中間多了一長串的項目跟路徑,解決的辦法是 把 jsp/controller.jsp

百度Ueditor編輯的Html模式自動替換樣式的解決方法

tor tail classname 功能 lai empty als 包含 emp 百度的Ueditor編輯器出於安全性考慮,用戶在html模式下粘貼進去的html文檔會自動被去除樣式和轉義。雖然安全的,但是非常不方便。 做一下修改把這個功能去掉。 一、打開ueditor

ueditor 編輯常用方法

center 行間距 merge nehe 鏈接 排版 raft subscript 圖片 官方文檔http://fex.baidu.com/ueditor/ 簡單實現工具欄調用: //實現方法 ue.getDialog("工具名稱"); //工具名稱可以

UEditor編輯_記一次開發

alt aid tex 一次 .get html asp 初始化 下載 1.UEditor編輯器官網:http://ueditor.baidu.com/website/ 2.下載文件:選擇 1.4.3.3 .Net版本 UTF-8板 3.建一個ueditor文件夾,將下

ueditor 編輯,自定義圖片上傳

action () scree val ech idt tof height 使用 <div> <h1>完整demo</h1> <form method="post" name="form">

ueditor編輯

div bsp conf asc its 編輯器 html style top 將編輯器作為用戶控件 <ty_ctl:UEditor ID="UEditor_Content <%@ Control Language="C#" AutoEventWireup=

.Net Core 使用百度UEditor編輯

緩存配置 fix oid format public 管理器 gui proc cti 一、準備文件 1. 下載UEditor官方版本.刪除其中後端文件。保留後端文件夾中的config.json文件 2. 在NuGet管理器中搜索UEditorNetCore,拿到項目地址

百度ueditor編輯 自動加P最新解決辦法

自動 有時 過時 天發 ueditor min 朋友 tor 百度ueditor 今天有個客戶提出個需求,不讓百度ueditor編輯器在空白文檔自動添加<p><br/><p>,在網上找了一圈,大部分是解決LI裏自動套P,還有一部分也是碰到

帝國cms後臺編輯集成ueditor編輯

title info sku blank box nbsp esp cells con 我更換成百度編輯器的原因有以下幾點:1.使用百度編輯器的圖片粘貼上傳功能,這個功能實在是太有必要了,有開發的過程中或上傳的過程中,通常用qq直接截圖,直接放到文章上面,避免了再放到本地保

UEditor編輯引用跟設定(持續更新)

<!-- 載入編輯器的容器 --> <script id="container" name="content" type="text/plain"> {$res.content} 這裡輸入變數,會出現在編輯框裡

ueditor編輯上傳檔案超時報錯

文章來自:原始碼線上https://www.shengli.me/php/153.html php 超時等待時間太長;   解決:   php.ini中的max_execution_time為0;(http請求等待時間為永久)    

web編輯——百度UEditor編輯使用教程與使用方法

  我們在做網站的時候,網站後臺系統一般都會用到 web 編輯器,今天筆者就給大家推薦一款百度 UEditor 編輯器。關於這款百度 UEditor 編輯器官網上也有簡單的教程,不過看著比較費勁,今天筆者就跟大家分享一下百度 UE

jQuery怎麼獲取到富文字ueditor編輯裡面的文字和圖片內容

1、建立編輯器 UE.getEditor('editor', { initialFrameWidth:"100%" //初始化選項 }) 精簡版 UE.getEditor('editor') 2、刪除編輯器 UE.getEditor('editor').destroy(); 3、

ueditor編輯asp版不能上傳圖片的解決方法(800a0046)

第一步,先去IIS 中,開啟ASP 設定頁面,把錯誤資訊傳送到瀏覽器,有助於找到問題。 使用百度開源ueditor編輯器不能上傳圖片並報伺服器500錯誤 初看是 Uploader.Class 的 fs.CreateFolder( path )&nbs

ueditor編輯的使用

本文介紹如何引入ueditor,並拿到文字框的值 一 首選引入js檔案 如 <script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.config.js"></scri