|
@@ -6914,7 +6914,7 @@ var fillCharReg = new RegExp(domUtils.fillChar, 'g');
|
|
container.style.zIndex = options.zIndex;
|
|
container.style.zIndex = options.zIndex;
|
|
|
|
|
|
var html = ( ie && browser.version < 9 ? '' : '<!DOCTYPE html>') +
|
|
var html = ( ie && browser.version < 9 ? '' : '<!DOCTYPE html>') +
|
|
- '<html xmlns=\'http://www.w3.org/1999/xhtml\' class=\'view\' style=\'overflow:hidden\'><head>' +
|
|
|
|
|
|
+ '<html xmlns=\'http://www.w3.org/1999/xhtml\' class=\'view\' style=\'overflow:auto\'><head>' +
|
|
'<style type=\'text/css\'>' +
|
|
'<style type=\'text/css\'>' +
|
|
//设置四周的留边
|
|
//设置四周的留边
|
|
'.view{padding:0;word-wrap:break-word;cursor:text;height:90%}\n' +
|
|
'.view{padding:0;word-wrap:break-word;cursor:text;height:90%}\n' +
|
|
@@ -6941,7 +6941,7 @@ var fillCharReg = new RegExp(domUtils.fillChar, 'g');
|
|
'document.write("' + html + '");document.close();}())'
|
|
'document.write("' + html + '");document.close();}())'
|
|
}));
|
|
}));
|
|
container.style.overflow = 'hidden';
|
|
container.style.overflow = 'hidden';
|
|
-
|
|
|
|
|
|
+
|
|
//解决如果是给定的百分比,会导致高度算不对的问题
|
|
//解决如果是给定的百分比,会导致高度算不对的问题
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
if( /%$/.test(options.initialFrameWidth)){
|
|
if( /%$/.test(options.initialFrameWidth)){
|
|
@@ -12667,7 +12667,7 @@ UE.plugins['paragraph'] = function() {
|
|
} );
|
|
} );
|
|
}
|
|
}
|
|
tmpRange.setEndAfter( tmpNode );
|
|
tmpRange.setEndAfter( tmpNode );
|
|
-
|
|
|
|
|
|
+
|
|
para = range.document.createElement( style );
|
|
para = range.document.createElement( style );
|
|
if(attrs){
|
|
if(attrs){
|
|
domUtils.setAttributes(para,attrs);
|
|
domUtils.setAttributes(para,attrs);
|
|
@@ -12679,7 +12679,7 @@ UE.plugins['paragraph'] = function() {
|
|
//需要内容占位
|
|
//需要内容占位
|
|
if(domUtils.isEmptyNode(para)){
|
|
if(domUtils.isEmptyNode(para)){
|
|
domUtils.fillChar(range.document,para);
|
|
domUtils.fillChar(range.document,para);
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
tmpRange.insertNode( para );
|
|
tmpRange.insertNode( para );
|
|
@@ -12803,7 +12803,7 @@ UE.plugins['paragraph'] = function() {
|
|
|
|
|
|
},
|
|
},
|
|
doDirectionality = function(range,editor,forward){
|
|
doDirectionality = function(range,editor,forward){
|
|
-
|
|
|
|
|
|
+
|
|
var bookmark,
|
|
var bookmark,
|
|
filterFn = function( node ) {
|
|
filterFn = function( node ) {
|
|
return node.nodeType == 1 ? !domUtils.isBookmarkNode(node) : !domUtils.isWhitespace(node);
|
|
return node.nodeType == 1 ? !domUtils.isBookmarkNode(node) : !domUtils.isWhitespace(node);
|
|
@@ -17988,6 +17988,9 @@ UE.plugins['video'] = function (){
|
|
UETable.prototype = {
|
|
UETable.prototype = {
|
|
getMaxRows:function () {
|
|
getMaxRows:function () {
|
|
var rows = this.table.rows, maxLen = 1;
|
|
var rows = this.table.rows, maxLen = 1;
|
|
|
|
+ if (rows.length===0) {
|
|
|
|
+ return maxLen;
|
|
|
|
+ }
|
|
for (var i = 0, row; row = rows[i]; i++) {
|
|
for (var i = 0, row; row = rows[i]; i++) {
|
|
var currentMax = 1;
|
|
var currentMax = 1;
|
|
for (var j = 0, cj; cj = row.cells[j++];) {
|
|
for (var j = 0, cj; cj = row.cells[j++];) {
|
|
@@ -20249,10 +20252,10 @@ UE.plugins['table'] = function () {
|
|
// domUtils.removeAttributes(table, ['style', 'border']);
|
|
// domUtils.removeAttributes(table, ['style', 'border']);
|
|
|
|
|
|
//2021-09-30修改 如下 参照https://www.cnblogs.com/xiangsj/p/6244794.html
|
|
//2021-09-30修改 如下 参照https://www.cnblogs.com/xiangsj/p/6244794.html
|
|
-
|
|
|
|
|
|
+
|
|
domUtils.setAttributes(table, {
|
|
domUtils.setAttributes(table, {
|
|
style:'border-left:1px solid #666; border-top:1px solid #666;',
|
|
style:'border-left:1px solid #666; border-top:1px solid #666;',
|
|
- });
|
|
|
|
|
|
+ });
|
|
removeStyleSize(table, true);
|
|
removeStyleSize(table, true);
|
|
|
|
|
|
utils.each(domUtils.getElementsByTagName(table, "td"), function (td) {
|
|
utils.each(domUtils.getElementsByTagName(table, "td"), function (td) {
|
|
@@ -20260,7 +20263,7 @@ UE.plugins['table'] = function () {
|
|
//粘贴进来的表格td定义属性
|
|
//粘贴进来的表格td定义属性
|
|
domUtils.setAttributes(td, {
|
|
domUtils.setAttributes(td, {
|
|
style:'border-bottom:1px solid #666; border-right:1px solid #666; padding:5px;',
|
|
style:'border-bottom:1px solid #666; border-right:1px solid #666; padding:5px;',
|
|
- });
|
|
|
|
|
|
+ });
|
|
if (isEmptyBlock(td)) {
|
|
if (isEmptyBlock(td)) {
|
|
domUtils.fillNode(me.document, td);
|
|
domUtils.fillNode(me.document, td);
|
|
}
|
|
}
|
|
@@ -21132,11 +21135,11 @@ UE.plugins['table'] = function () {
|
|
|
|
|
|
//是否正在等待resize的缓冲中
|
|
//是否正在等待resize的缓冲中
|
|
isInResizeBuffer = true;
|
|
isInResizeBuffer = true;
|
|
|
|
+ tableBorderDrag( evt );
|
|
|
|
|
|
- tableDragTimer = setTimeout(function(){
|
|
|
|
- tableBorderDrag( evt );
|
|
|
|
- }, dblclickTime);
|
|
|
|
-
|
|
|
|
|
|
+ // tableDragTimer = setTimeout(function(){
|
|
|
|
+ // tableBorderDrag( evt );
|
|
|
|
+ // }, dblclickTime);
|
|
}
|
|
}
|
|
|
|
|
|
function extractArray( originArr, key ) {
|
|
function extractArray( originArr, key ) {
|
|
@@ -21195,7 +21198,7 @@ UE.plugins['table'] = function () {
|
|
}
|
|
}
|
|
hideDragLine(me);
|
|
hideDragLine(me);
|
|
getDragLine(me, me.document);
|
|
getDragLine(me, me.document);
|
|
- me.fireEvent('saveScene');
|
|
|
|
|
|
+ // me.fireEvent('saveScene');
|
|
showDragLineAt(state, startTd);
|
|
showDragLineAt(state, startTd);
|
|
mousedown = true;
|
|
mousedown = true;
|
|
//拖动开始
|
|
//拖动开始
|
|
@@ -22744,7 +22747,7 @@ UE.plugins['formatmatch'] = function(){
|
|
});
|
|
});
|
|
|
|
|
|
function addList(type,evt){
|
|
function addList(type,evt){
|
|
-
|
|
|
|
|
|
+
|
|
if(browser.webkit){
|
|
if(browser.webkit){
|
|
var target = evt.target.tagName == 'IMG' ? evt.target : null;
|
|
var target = evt.target.tagName == 'IMG' ? evt.target : null;
|
|
}
|
|
}
|
|
@@ -22810,7 +22813,7 @@ UE.plugins['formatmatch'] = function(){
|
|
|
|
|
|
me.commands['formatmatch'] = {
|
|
me.commands['formatmatch'] = {
|
|
execCommand : function( cmdName ) {
|
|
execCommand : function( cmdName ) {
|
|
-
|
|
|
|
|
|
+
|
|
if(flag){
|
|
if(flag){
|
|
flag = 0;
|
|
flag = 0;
|
|
list = [];
|
|
list = [];
|
|
@@ -22819,7 +22822,7 @@ UE.plugins['formatmatch'] = function(){
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
var range = me.selection.getRange();
|
|
var range = me.selection.getRange();
|
|
img = range.getClosedNode();
|
|
img = range.getClosedNode();
|
|
if(!img || img.tagName != 'IMG'){
|
|
if(!img || img.tagName != 'IMG'){
|
|
@@ -23996,6 +23999,10 @@ UE.plugin.register('autosave', function (){
|
|
|
|
|
|
'contentchange': function () {
|
|
'contentchange': function () {
|
|
|
|
|
|
|
|
+ if (!me.getOpt('enableAutoSave')) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if ( !saveKey ) {
|
|
if ( !saveKey ) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -25294,7 +25301,7 @@ UE.ui = baidu.editor.ui = {};
|
|
domUtils = baidu.editor.dom.domUtils,
|
|
domUtils = baidu.editor.dom.domUtils,
|
|
UIBase = baidu.editor.ui.UIBase,
|
|
UIBase = baidu.editor.ui.UIBase,
|
|
uiUtils = baidu.editor.ui.uiUtils;
|
|
uiUtils = baidu.editor.ui.uiUtils;
|
|
-
|
|
|
|
|
|
+
|
|
var Mask = baidu.editor.ui.Mask = function (options){
|
|
var Mask = baidu.editor.ui.Mask = function (options){
|
|
this.initOptions(options);
|
|
this.initOptions(options);
|
|
this.initUIBase();
|
|
this.initUIBase();
|
|
@@ -25590,7 +25597,7 @@ UE.ui = baidu.editor.ui = {};
|
|
}
|
|
}
|
|
};
|
|
};
|
|
utils.inherits(Popup, UIBase);
|
|
utils.inherits(Popup, UIBase);
|
|
-
|
|
|
|
|
|
+
|
|
domUtils.on( document, 'mousedown', function ( evt ) {
|
|
domUtils.on( document, 'mousedown', function ( evt ) {
|
|
var el = evt.target || evt.srcElement;
|
|
var el = evt.target || evt.srcElement;
|
|
closeAllPopup( evt,el );
|
|
closeAllPopup( evt,el );
|
|
@@ -25686,7 +25693,7 @@ UE.ui = baidu.editor.ui = {};
|
|
var utils = baidu.editor.utils,
|
|
var utils = baidu.editor.utils,
|
|
uiUtils = baidu.editor.ui.uiUtils,
|
|
uiUtils = baidu.editor.ui.uiUtils,
|
|
UIBase = baidu.editor.ui.UIBase;
|
|
UIBase = baidu.editor.ui.UIBase;
|
|
-
|
|
|
|
|
|
+
|
|
var TablePicker = baidu.editor.ui.TablePicker = function (options){
|
|
var TablePicker = baidu.editor.ui.TablePicker = function (options){
|
|
this.initOptions(options);
|
|
this.initOptions(options);
|
|
this.initTablePicker();
|
|
this.initTablePicker();
|
|
@@ -25770,7 +25777,7 @@ UE.ui = baidu.editor.ui = {};
|
|
var browser = baidu.editor.browser,
|
|
var browser = baidu.editor.browser,
|
|
domUtils = baidu.editor.dom.domUtils,
|
|
domUtils = baidu.editor.dom.domUtils,
|
|
uiUtils = baidu.editor.ui.uiUtils;
|
|
uiUtils = baidu.editor.ui.uiUtils;
|
|
-
|
|
|
|
|
|
+
|
|
var TPL_STATEFUL = 'onmousedown="$$.Stateful_onMouseDown(event, this);"' +
|
|
var TPL_STATEFUL = 'onmousedown="$$.Stateful_onMouseDown(event, this);"' +
|
|
' onmouseup="$$.Stateful_onMouseUp(event, this);"' +
|
|
' onmouseup="$$.Stateful_onMouseUp(event, this);"' +
|
|
( browser.ie ? (
|
|
( browser.ie ? (
|
|
@@ -25779,7 +25786,7 @@ UE.ui = baidu.editor.ui = {};
|
|
: (
|
|
: (
|
|
' onmouseover="$$.Stateful_onMouseOver(event, this);"' +
|
|
' onmouseover="$$.Stateful_onMouseOver(event, this);"' +
|
|
' onmouseout="$$.Stateful_onMouseOut(event, this);"' ));
|
|
' onmouseout="$$.Stateful_onMouseOut(event, this);"' ));
|
|
-
|
|
|
|
|
|
+
|
|
baidu.editor.ui.Stateful = {
|
|
baidu.editor.ui.Stateful = {
|
|
alwalysHoverable: false,
|
|
alwalysHoverable: false,
|
|
target:null,//目标元素和this指向dom不一样
|
|
target:null,//目标元素和this指向dom不一样
|
|
@@ -27404,7 +27411,7 @@ UE.ui = baidu.editor.ui = {};
|
|
setValue : function(value){
|
|
setValue : function(value){
|
|
this._value = value;
|
|
this._value = value;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
};
|
|
};
|
|
utils.inherits(MenuButton, SplitButton);
|
|
utils.inherits(MenuButton, SplitButton);
|
|
})();
|
|
})();
|