Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
ee050b28
U
ueditor
项目概览
qq_14980201
/
ueditor
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
ueditor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ee050b28
编写于
5月 28, 2014
作者:
W
worry12772
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev-1.4.3' of
https://github.com/fex-team/ueditor
into dev-1.4.3
上级
c7744efe
e54a3e40
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
4 deletion
+25
-4
_src/plugins/searchreplace.js
_src/plugins/searchreplace.js
+23
-2
lang/zh-cn/zh-cn.js
lang/zh-cn/zh-cn.js
+2
-2
未找到文件。
_src/plugins/searchreplace.js
浏览文件 @
ee050b28
...
...
@@ -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
;
...
...
lang/zh-cn/zh-cn.js
浏览文件 @
ee050b28
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录