提交 ee050b28 编写于 作者: W worry12772

Merge branch 'dev-1.4.3' of https://github.com/fex-team/ueditor into dev-1.4.3

......@@ -10,6 +10,9 @@
UE.plugin.register('searchreplace',function(){
var me = this;
var _blockElm = {'table':1,'tbody':1,'tr':1,'ol':1,'ul':1};
function findTextInString(textContent,opt,currentIndex){
var str = opt.searchStr;
if(opt.dir == -1){
......@@ -44,6 +47,9 @@ UE.plugin.register('searchreplace',function(){
}
}
node = domUtils[methodName](node);
while(node && _blockElm[node.nodeName.toLowerCase()]){
node = domUtils[methodName](node,true);
}
if(node){
currentIndex = opt.dir == -1 ? (node.nodeType == 3 ? node.nodeValue : node[browser.ie ? 'innerText' : 'textContent']).length : 0;
}
......@@ -76,6 +82,7 @@ UE.plugin.register('searchreplace',function(){
}
}
currentNode = domUtils.getNextDomNode(currentNode);
}
}
......@@ -129,10 +136,10 @@ UE.plugin.register('searchreplace',function(){
}
function replaceText(rng,str){
me.fireEvent('saveScene');
str = me.document.createTextNode(str);
rng.deleteContents().insertNode(str);
me.fireEvent('saveScene');
}
return {
commands:{
......@@ -145,6 +152,7 @@ UE.plugin.register('searchreplace',function(){
},true);
var num = 0;
if(opt.all){
var rng = me.selection.getRange(),
first = me.body.firstChild;
if(first && first.nodeType == 1){
......@@ -154,13 +162,26 @@ UE.plugin.register('searchreplace',function(){
rng.setStartBefore(first)
}
rng.collapse(true).select(true);
if(opt.replaceStr !== undefined){
me.fireEvent('saveScene');
}
while(searchReplace(this,opt)){
num++;
}
if(num){
me.fireEvent('saveScene');
}
}else{
if(opt.replaceStr !== undefined){
me.fireEvent('saveScene');
}
if(searchReplace(this,opt)){
num++
}
if(num){
me.fireEvent('saveScene');
}
}
return num;
......
......@@ -73,7 +73,7 @@ UE.I18N['zh-cn'] = {
'jsonEncodeError': '服务器返回格式错误',
'loading':"正在上传...",
'loadError':"上传错误",
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!'
},
'simpleupload':{
'exceedSizeError': '文件大小超出限制',
......@@ -81,7 +81,7 @@ UE.I18N['zh-cn'] = {
'jsonEncodeError': '服务器返回格式错误',
'loading':"正在上传...",
'loadError':"上传错误",
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!'
},
'elementPathTip':"元素路径",
'wordCountTip':"字数统计",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册