1024programmer PHP ue editor php, ZBLOGPHP about the repair method of the latest version of UE editor 1.5 plug-in summary separator that cannot be used normally…

ue editor php, ZBLOGPHP about the repair method of the latest version of UE editor 1.5 plug-in summary separator that cannot be used normally…

Recently, the customer reported that after upgrading the UEditor editor, the summary separator , cannot be used, so he went to check the code. I found that the latest code has changed the original separator from “


” to '


', so I went to find a way.

z.png

1. Find the oldest Version UE Editor , to find that code back and forth. Found the following code in the file ueditor.all.min.js :UE.plugins.horizontal=

function(){this.commands.horizontal={execCommand:function( d){if(-1!==this.queryCommandState(d)){this.execCommand(“insertHtml”,”


“);d=this. selection.getRange();var b=d.startContainer;if(1==b.nodeType&&!b.childNodes[d.startOffset]){var c;(c=b.childNodes [d.startOffset-1])&&1==c.nodeType&&”HR”==c.tagName&&(“p”==this.options.enterTag ?(c=this.document.createElement(“p”),d.insertNode(c),d.setStart(c,0).setCursor()):(c=this.document.createElement(” br”),d.insertNode(c),d.setStartBefore(c).setCursor()))}return!0}},

queryCommandState:function(){return f.filterNodeList(this.selection.getStartElementPath( ),”table”)?-1:0}};this.addListener(“delkeydown”,function(d,b){var c=this.selection.getRange();c.txtToElmBoundary(!0); if(f.isStartInblock(c)){var a=c.startContainer.previousSibling;if(a&&f.isTagNode(a,”hr”)) return f.remove(a),c.select(),f. preventDefault(b),!0}})};

2. Replace the above code with the following code : (in the oldest version : the oldest version I can find . . (Version number 1.4.4.)) UE.plugins.horizontal = function() {

this.commands.horizontal = {

execCommand: function( d) {

if ( – 1 !== this.queryCommandState(d)) {

0 == this.document .getElementsByTagName(“hr”).length ? this.execCommand(“insertHtml”, '


') : this.execCommand(“insertHtml”, “


” );

d = this.selection.getRange();

var c = d.startContainer;

if (1 =& #61; c.nodeType && !c.childNodes[d.startOffset]) {

var b; (b = c.childNodes[d.startOffset – 1]) && 1 &#61 ;= b.nodeType && “HR” == b.tagName && (“p” == this.options.enterTag ? (b = this. document.createElement(“p”), d.insertNode(b), d.setStart(b, 0).setCursor()) : (b = this.document.createElement(“br”), d.insertNode (b), d.setStartBefore(b).setCursor()))

}

return ! 0

}

} ,

queryCommandState: function() {

return f.filterNodeList(this.selection.getStartElementPath(), “table”) ? -1 : 0

}

};

this.addListener(“delkeydown”,

function(d, c) {

var b &# 61; this.selection.getRange();

b.txtToElmBoundary(!0);

if (f.isStartInblock(b)) {

var a = b.startContainer.previousSibling;

if (a && f.isTagNode(a, “hr”)) return f.remove(a),

b. select(),

f.preventDefault(c),

!0

}

})

};

3. After saving,refresh the browser,it can be used.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/ue-editor-php-zblogphp-about-the-repair-method-of-the-latest-version-of-ue-editor-1-5-plug-in-summary-separator-that-cannot-be-used-normally/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索