Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
7078dc23
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,发现更多精彩内容 >>
提交
7078dc23
编写于
2月 20, 2013
作者:
T
taoqili
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge remote-tracking branch 'origin/dev-1.2.5' into dev-1.2.5
Conflicts: _src/plugins/table.js
上级
b9006098
变更
26
展开全部
隐藏空白更改
内联
并排
Showing
26 changed file
with
81 addition
and
62 deletion
+81
-62
_src/commands.js
_src/commands.js
+2
-2
_src/plugins/autolink.js
_src/plugins/autolink.js
+1
-1
_src/plugins/catchremoteimage.js
_src/plugins/catchremoteimage.js
+3
-3
_src/plugins/serialize.js
_src/plugins/serialize.js
+8
-8
_src/plugins/snapscreen.js
_src/plugins/snapscreen.js
+1
-1
_src/plugins/wordimage.js
_src/plugins/wordimage.js
+29
-10
_src/ui/editor.js
_src/ui/editor.js
+1
-1
_test/plugins/anchor.js
_test/plugins/anchor.js
+1
-1
_test/plugins/autolink.js
_test/plugins/autolink.js
+3
-3
_test/plugins/autotypeset.js
_test/plugins/autotypeset.js
+3
-3
_test/plugins/basestyle.js
_test/plugins/basestyle.js
+1
-1
_test/plugins/catchremoteimage.js
_test/plugins/catchremoteimage.js
+2
-2
_test/plugins/font.js
_test/plugins/font.js
+2
-2
_test/plugins/image.js
_test/plugins/image.js
+3
-3
_test/plugins/link.js
_test/plugins/link.js
+1
-1
_test/plugins/removeformat.js
_test/plugins/removeformat.js
+2
-2
_test/plugins/serialize.js
_test/plugins/serialize.js
+1
-1
_test/plugins/source.js
_test/plugins/source.js
+2
-2
_test/tools/br/jshintReport.html
_test/tools/br/jshintReport.html
+3
-3
dialogs/attachment/attachment.html
dialogs/attachment/attachment.html
+1
-1
dialogs/background/background.js
dialogs/background/background.js
+1
-1
dialogs/emotion/emotion.js
dialogs/emotion/emotion.js
+1
-1
dialogs/image/image.js
dialogs/image/image.js
+5
-5
dialogs/link/link.html
dialogs/link/link.html
+2
-2
dialogs/scrawl/scrawl.js
dialogs/scrawl/scrawl.js
+1
-1
dialogs/wordimage/wordimage.js
dialogs/wordimage/wordimage.js
+1
-1
未找到文件。
_src/commands.js
浏览文件 @
7078dc23
...
...
@@ -173,7 +173,7 @@
* @example
* editor.execCommand("link",{
* href: "http://ueditor.baidu.com", //超链地址,必选
*
data_ue
_src: "http://ueditor.baidu.com", //UE内部使用参数,与href保持一致即可,可选
* _src: "http://ueditor.baidu.com", //UE内部使用参数,与href保持一致即可,可选
* target: "_self", //目标窗口,可选
* textValue: "UEditor", //链接显示文本,可选
* title: "百度开源富文本编辑器UEditor官网" //标题,可选
...
...
@@ -186,7 +186,7 @@
* @example
* editor.execCommand("insertImage",{
* src: "http://ueditor.baidu.com/logo.jpg", //图片链接地址,必选
*
data_ue
_src: "http://ueditor.baidu.com/logo.jpg", //UE内部使用参数,与src保持一致即可,可选
* _src: "http://ueditor.baidu.com/logo.jpg", //UE内部使用参数,与src保持一致即可,可选
* width: 300, //图片显示宽度,可选
* height: 400, //图片显示高度,可选
* border: 2, //图片边框,可选
...
...
_src/plugins/autolink.js
浏览文件 @
7078dc23
...
...
@@ -88,7 +88,7 @@
a
.
href
=
a
.
innerHTML
=
a
.
innerHTML
.
replace
(
/<
[^
>
]
+>/g
,
''
);
href
=
a
.
getAttribute
(
"
href
"
).
replace
(
new
RegExp
(
domUtils
.
fillChar
,
'
g
'
),
''
);
href
=
/^
(?:
https
?
:
\/\/)
/ig
.
test
(
href
)
?
href
:
"
http://
"
+
href
;
a
.
setAttribute
(
'
data_ue
_src
'
,
utils
.
html
(
href
));
a
.
setAttribute
(
'
_src
'
,
utils
.
html
(
href
));
a
.
href
=
utils
.
html
(
href
);
range
.
insertNode
(
a
);
...
...
_src/plugins/catchremoteimage.js
浏览文件 @
7078dc23
...
...
@@ -51,7 +51,7 @@ UE.plugins['catchremoteimage'] = function () {
if
(
ci
.
getAttribute
(
"
word_img
"
)){
continue
;
}
var
src
=
ci
.
getAttribute
(
"
data_ue
_src
"
)
||
ci
.
src
||
""
;
var
src
=
ci
.
getAttribute
(
"
_src
"
)
||
ci
.
src
||
""
;
if
(
/^
(
https
?
|ftp
)
:/i
.
test
(
src
)
&&
!
test
(
src
,
localDomain
))
{
remoteImages
.
push
(
src
);
}
...
...
@@ -68,7 +68,7 @@ UE.plugins['catchremoteimage'] = function () {
var
srcUrls
=
info
.
srcUrl
.
split
(
separater
),
urls
=
info
.
url
.
split
(
separater
);
for
(
var
i
=
0
,
ci
;
ci
=
imgs
[
i
++
];)
{
var
src
=
ci
.
getAttribute
(
"
data_ue
_src
"
)
||
ci
.
src
||
""
;
var
src
=
ci
.
getAttribute
(
"
_src
"
)
||
ci
.
src
||
""
;
for
(
var
j
=
0
,
cj
;
cj
=
srcUrls
[
j
++
];)
{
var
url
=
urls
[
j
-
1
];
if
(
src
==
cj
&&
url
!=
"
error
"
)
{
//抓取失败时不做替换处理
...
...
@@ -76,7 +76,7 @@ UE.plugins['catchremoteimage'] = function () {
var
newSrc
=
me
.
options
.
catcherPath
+
url
;
domUtils
.
setAttributes
(
ci
,
{
"
src
"
:
newSrc
,
"
data_ue
_src
"
:
newSrc
"
_src
"
:
newSrc
});
break
;
}
...
...
_src/plugins/serialize.js
浏览文件 @
7078dc23
...
...
@@ -458,7 +458,7 @@ UE.plugins['serialize'] = function () {
}
// if(browser.ie && browser.version < 7 )
// node.attributes.orgSrc = node.attributes.src;
// node.attributes.
data_ue_src = node.attributes.data_ue
_src || node.attributes.src;
// node.attributes.
_src = node.attributes.
_src || node.attributes.src;
break
;
// case 'li':
// var child = node.children[0];
...
...
@@ -503,7 +503,7 @@ UE.plugins['serialize'] = function () {
//// };
//// node.closed = 1;
//// }
// node.attributes.href && (node.attributes.
data_ue
_src = node.attributes.href);
// node.attributes.href && (node.attributes._src = node.attributes.href);
// break;
// case 'b':
// node.tag = node.name = 'strong';
...
...
@@ -644,17 +644,17 @@ UE.plugins['serialize'] = function () {
//// };
//// node.closed = null;
// }else{
//// if(node.attributes.
data_ue
_src){
//// node.attributes.src = node.attributes.
data_ue
_src;
//// delete node.attributes.
data_ue
_src;
//// if(node.attributes._src){
//// node.attributes.src = node.attributes._src;
//// delete node.attributes._src;
//// }
// }
// break;
//
// case 'a':
// if(node.attributes.
data_ue
_src){
// node.attributes.href = node.attributes.
data_ue
_src;
// delete node.attributes.
data_ue
_src;
// if(node.attributes._src){
// node.attributes.href = node.attributes._src;
// delete node.attributes._src;
// }
}
...
...
_src/plugins/snapscreen.js
浏览文件 @
7078dc23
...
...
@@ -44,7 +44,7 @@ UE.plugins['snapscreen'] = function(){
me
.
execCommand
(
'
insertimage
'
,
{
src
:
editorOptions
.
snapscreenPath
+
rs
.
url
,
floatStyle
:
editorOptions
.
snapscreenImgAlign
,
data_ue
_src
:
editorOptions
.
snapscreenPath
+
rs
.
url
_src
:
editorOptions
.
snapscreenPath
+
rs
.
url
});
};
var
onStartUpload
=
function
(){
...
...
_src/plugins/wordimage.js
浏览文件 @
7078dc23
...
...
@@ -5,29 +5,48 @@
///commandsDialog dialogs\wordimage
UE
.
plugins
[
"
wordimage
"
]
=
function
()
{
UE
.
plugins
[
"
wordimage
"
]
=
function
()
{
var
me
=
this
,
images
;
me
.
addInputRule
(
function
(
root
)
{
utils
.
each
(
root
.
getNodesByTagName
(
'
img
'
),
function
(
img
)
{
var
attrs
=
img
.
attrs
,
flag
=
parseInt
(
attrs
.
width
)
<
128
||
parseInt
(
attrs
.
height
)
<
43
,
opt
=
me
.
options
,
src
=
opt
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif
'
;
if
(
attrs
[
'
_src
'
])
{
img
.
setAttr
({
width
:
attrs
.
width
,
height
:
attrs
.
height
,
alt
:
attrs
.
alt
,
word_img
:
attrs
.
_src
,
src
:
src
,
'
style
'
:
'
background:url(
'
+
(
flag
?
opt
.
themePath
+
opt
.
theme
+
'
/images/word.gif
'
:
opt
.
langPath
+
opt
.
lang
+
'
/images/localimage.png
'
)
+
'
) no-repeat center center;border:1px solid #ddd
'
})
}
})
});
me
.
commands
[
'
wordimage
'
]
=
{
execCommand
:
function
()
{
images
=
domUtils
.
getElementsByTagName
(
me
.
document
.
body
,
"
img
"
);
execCommand
:
function
()
{
images
=
domUtils
.
getElementsByTagName
(
me
.
document
.
body
,
"
img
"
);
var
urlList
=
[];
for
(
var
i
=
0
,
ci
;
ci
=
images
[
i
++
];)
{
var
url
=
ci
.
getAttribute
(
"
word_img
"
);
for
(
var
i
=
0
,
ci
;
ci
=
images
[
i
++
];)
{
var
url
=
ci
.
getAttribute
(
"
word_img
"
);
url
&&
urlList
.
push
(
url
);
}
if
(
images
.
length
)
{
if
(
images
.
length
)
{
this
[
"
word_img
"
]
=
urlList
;
}
},
queryCommandState
:
function
()
{
images
=
domUtils
.
getElementsByTagName
(
me
.
document
.
body
,
"
img
"
);
for
(
var
i
=
0
,
ci
;
ci
=
images
[
i
++
];)
{
if
(
ci
.
getAttribute
(
"
word_img
"
))
{
queryCommandState
:
function
()
{
images
=
domUtils
.
getElementsByTagName
(
me
.
document
.
body
,
"
img
"
);
for
(
var
i
=
0
,
ci
;
ci
=
images
[
i
++
];)
{
if
(
ci
.
getAttribute
(
"
word_img
"
))
{
return
1
;
}
}
return
-
1
;
}
};
};
\ No newline at end of file
_src/ui/editor.js
浏览文件 @
7078dc23
...
...
@@ -277,7 +277,7 @@
if
(
editor
.
ui
.
_dialogs
.
linkDialog
)
{
var
link
=
editor
.
queryCommandValue
(
'
link
'
);
var
url
;
if
(
link
&&
(
url
=
(
link
.
getAttribute
(
'
data_ue
_src
'
)
||
link
.
getAttribute
(
'
href
'
,
2
))))
{
if
(
link
&&
(
url
=
(
link
.
getAttribute
(
'
_src
'
)
||
link
.
getAttribute
(
'
href
'
,
2
))))
{
var
txt
=
url
;
if
(
url
.
length
>
30
)
{
txt
=
url
.
substring
(
0
,
20
)
+
"
...
"
;
...
...
_test/plugins/anchor.js
浏览文件 @
7078dc23
...
...
@@ -120,7 +120,7 @@ test( '已存在锚点', function() {
range
.
selectNode
(
body
.
firstChild
).
select
();
editor
.
execCommand
(
'
anchor
'
,
'
hello
'
);
var
name
=
body
.
firstChild
.
firstChild
.
getAttribute
(
'
anchorname
'
);
// equal(ua.getChildHTML(editor.body),'<p><img anchorname=\"hello\" class=\"anchorclass\"
data_ue
_src=\"undefined\"></p>','更改name');
// equal(ua.getChildHTML(editor.body),'<p><img anchorname=\"hello\" class=\"anchorclass\" _src=\"undefined\"></p>','更改name');
equal
(
name
,
'
hello
'
,
'
更改name
'
);
editor
.
setContent
(
'
<p><img anchorname="1" class="anchorclass"/></p>
'
);
range
.
selectNode
(
body
.
firstChild
).
select
();
...
...
_test/plugins/autolink.js
浏览文件 @
7078dc23
...
...
@@ -15,7 +15,7 @@ test( '输入超链接后回车', function() {
var
a
=
body
.
firstChild
.
getElementsByTagName
(
'
a
'
)[
0
];
equal
(
ua
.
getChildHTML
(
a
),
'
http://www.baidu.com
'
,
'
检查a的内容
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
href
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的href
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
data_ue_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的data_ue
_src
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的
_src
'
);
start
();
},
20
);
}
,
20
);
...
...
@@ -35,7 +35,7 @@ test( '输入超链接后按空格', function() {
var
a
=
body
.
firstChild
.
getElementsByTagName
(
'
a
'
)[
0
];
equal
(
ua
.
getChildHTML
(
a
),
'
http://www.baidu.com
'
,
'
检查a的内容
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
href
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的href
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
data_ue_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的data_ue
_src
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的
_src
'
);
start
();
},
20
);
},
20
);
...
...
@@ -140,7 +140,7 @@ test( 'trace 2121', function() {
var
a
=
body
.
firstChild
.
getElementsByTagName
(
'
a
'
)[
0
];
equal
(
ua
.
getChildHTML
(
a
),
'
www.baidu.com
'
,
'
检查a的内容
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
href
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的href
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
data_ue_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的data_ue
_src
'
);
ok
(
a
&&
$
(
a
).
attr
(
'
_src
'
).
indexOf
(
'
http://www.baidu.com
'
)
!=
-
1
,
'
检查a的
_src
'
);
start
();
},
20
);
}
,
20
);
...
...
_test/plugins/autotypeset.js
浏览文件 @
7078dc23
...
...
@@ -79,12 +79,12 @@ test('首行缩进',function(){
/*trace 2650*/
test
(
'
图像对齐
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<p><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51"
data_ue
_src="http://img.baidu.com/hi/jx2/j_0001.gif"></p>
'
);
editor
.
setContent
(
'
<p><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51" _src="http://img.baidu.com/hi/jx2/j_0001.gif"></p>
'
);
setTimeout
(
function
(){
editor
.
options
.
autotypeset
.
imageBlockLine
=
'
center
'
;
delete
editor
.
options
.
autotypeset
.
textAlign
;
//imageBlockLine
var
html
=
'
<p style="text-align:center"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51"
data_ue
_src="http://img.baidu.com/hi/jx2/j_0001.gif"/></p>
'
;
var
html1
=
'
<p style="text-align:center"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51"
data_ue
_src="http://img.baidu.com/hi/jx2/j_0001.gif" orgsrc="http://img.baidu.com/hi/jx2/j_0001.gif"/></p>
'
var
html
=
'
<p style="text-align:center"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51" _src="http://img.baidu.com/hi/jx2/j_0001.gif"/></p>
'
;
var
html1
=
'
<p style="text-align:center"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51" _src="http://img.baidu.com/hi/jx2/j_0001.gif" orgsrc="http://img.baidu.com/hi/jx2/j_0001.gif"/></p>
'
editor
.
execCommand
(
'
autotypeset
'
);
if
(
ua
.
browser
.
ie
==
6
)
ua
.
checkHTMLSameStyle
(
html1
,
editor
.
document
,
editor
.
body
,
'
图像对齐
'
);
...
...
_test/plugins/basestyle.js
浏览文件 @
7078dc23
...
...
@@ -73,7 +73,7 @@ test( '不闭合插入上下标', function () {
range
.
setStart
(
body
.
firstChild
.
firstChild
,
0
).
setEnd
(
body
.
firstChild
.
lastChild
,
3
).
select
();
editor
.
execCommand
(
'
superscript
'
);
ua
.
manualDeleteFillData
(
body
);
equal
(
ua
.
getChildHTML
(
body
.
firstChild
),
'
<sup><strong>hello1<em>hello2</em></strong></sup><a href="http://www.baid.com/"
data_ue
_src="http://www.baid.com/"><sup><strong>baidu_link</strong></sup></a><sup>hel</sup>lo3
'
,
'
普通文本添加上标
'
);
equal
(
ua
.
getChildHTML
(
body
.
firstChild
),
'
<sup><strong>hello1<em>hello2</em></strong></sup><a href="http://www.baid.com/" _src="http://www.baid.com/"><sup><strong>baidu_link</strong></sup></a><sup>hel</sup>lo3
'
,
'
普通文本添加上标
'
);
start
();
},
100
)
}
);
...
...
_test/plugins/catchremoteimage.js
浏览文件 @
7078dc23
...
...
@@ -24,8 +24,8 @@ test( '成功远程图片抓取', function () {
if
(
/upload/
.
test
(
src
)
)
{
clearInterval
(
handler
);
ok
(
/upload/
.
test
(
imgs
[
0
].
getAttribute
(
'
src
'
)
),
'
图片已经被转存到本地
'
);
// equal( imgs[0].getAttribute( 'src' ), imgs[0].getAttribute( '
data_ue_src' ), '查看data_ue
_src' );
// equal( imgs[1].getAttribute( 'src' ), imgs[1].getAttribute( '
data_ue_src' ), '查看data_ue
_src' );
// equal( imgs[0].getAttribute( 'src' ), imgs[0].getAttribute( '
_src' ), '查看
_src' );
// equal( imgs[1].getAttribute( 'src' ), imgs[1].getAttribute( '
_src' ), '查看
_src' );
equal
(
imgs
.
length
,
2
,
'
2个图片
'
);
start
();
}
else
if
(
count
>
100
)
{
...
...
_test/plugins/font.js
浏览文件 @
7078dc23
...
...
@@ -33,7 +33,7 @@ test( 'underline and linethrough', function() {
equal
(
editor
.
queryCommandValue
(
'
strikethrough
'
),
'
underline
'
,
'
query command value is not strike
'
);
ok
(
editor
.
queryCommandState
(
'
underline
'
),
'
query underline state
'
);
editor
.
execCommand
(
'
strikethrough
'
);
var
html
=
'
hello<a href="http://www.baidu.com/"
data_ue
_src = "http://www.baidu.com/" style="text-decoration: line-through">baidu</a>test
'
;
var
html
=
'
hello<a href="http://www.baidu.com/" _src = "http://www.baidu.com/" style="text-decoration: line-through">baidu</a>test
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
body
.
firstChild
,
'
check results
'
);
start
();
},
50
);
...
...
@@ -328,7 +328,7 @@ test( '设置超链接前景色再清除颜色', function() {
editor
.
execCommand
(
'
forecolor
'
,
'
rgb(255,0,0)
'
);
editor
.
execCommand
(
'
backcolor
'
,
'
rgb(0,255,0)
'
);
editor
.
execCommand
(
'
forecolor
'
,
'
default
'
);
var
html
=
'
<span style="background-color: rgb(0,255,0)">hello</span><a href="www.baidu.com"
data_ue
_src = "www.baidu.com" style="text-decoration: underline; "><span style="background-color: rgb(0, 255, 0); ">baidu</span></a>
'
;
var
html
=
'
<span style="background-color: rgb(0,255,0)">hello</span><a href="www.baidu.com" _src = "www.baidu.com" style="text-decoration: underline; "><span style="background-color: rgb(0, 255, 0); ">baidu</span></a>
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
.
firstChild
,
'
清除前景色
'
);
start
();
},
50
);
...
...
_test/plugins/image.js
浏览文件 @
7078dc23
...
...
@@ -63,9 +63,9 @@ test( '修改已有图片的属性', function () {
var
body
=
editor
.
body
;
editor
.
setContent
(
'
<p><img src="http://img.baidu.com/hi/jx2/j_0004.gif" >hello<img src="http://img.baidu.com/hi/jx2/j_0053.gif" ></p>
'
);
range
.
selectNode
(
body
.
firstChild
.
firstChild
).
select
();
/*加
data_ue
_src这个参数,否则结果不对,在image.html中也是加了这个参数的*/
editor
.
execCommand
(
'
insertimage
'
,
{
src
:
'
http://img.baidu.com/hi/jx2/j_0018.gif
'
,
data_ue
_src
:
"
http://img.baidu.com/hi/jx2/j_0018.gif
"
}
);
equal
(
ua
.
getChildHTML
(
body
.
firstChild
),
'
<img src="http://img.baidu.com/hi/jx2/j_0018.gif"
data_ue_src=
\
"http://img.baidu.com/hi/jx2/j_0018.gif
\
">hello<img src="http://img.baidu.com/hi/jx2/j_0053.gif" data_ue
_src=
\
"http://img.baidu.com/hi/jx2/j_0053.gif
\
">
'
,
'
检查插入的图像地址
'
);
/*加_src这个参数,否则结果不对,在image.html中也是加了这个参数的*/
editor
.
execCommand
(
'
insertimage
'
,
{
src
:
'
http://img.baidu.com/hi/jx2/j_0018.gif
'
,
_src
:
"
http://img.baidu.com/hi/jx2/j_0018.gif
"
}
);
equal
(
ua
.
getChildHTML
(
body
.
firstChild
),
'
<img src="http://img.baidu.com/hi/jx2/j_0018.gif"
_src=
\
"http://img.baidu.com/hi/jx2/j_0018.gif
\
">hello<img src="http://img.baidu.com/hi/jx2/j_0053.gif"
_src=
\
"http://img.baidu.com/hi/jx2/j_0053.gif
\
">
'
,
'
检查插入的图像地址
'
);
equal
(
body
.
firstChild
.
childNodes
.
length
,
3
,
'
2个img孩子
'
);
}
);
/*trace1491 修改动图的宽高*/
...
...
_test/plugins/link.js
浏览文件 @
7078dc23
...
...
@@ -39,7 +39,7 @@ test( '给图片添加超链接', function () {
editor
.
setContent
(
'
<p><img style="width: 200px;height: 200px" src="http://ueditor.baidu.com/img/logo.png">hello</p>
'
);
range
.
selectNode
(
editor
.
body
.
firstChild
.
firstChild
).
select
();
editor
.
execCommand
(
'
link
'
,
{
href
:
'
http://www.baidu.com/
'
}
);
var
html
=
'
<a href="http://www.baidu.com/" ><img src="http://ueditor.baidu.com/img/logo.png" style="width: 200px;height: 200px"
data_ue
_src="http://ueditor.baidu.com/img/logo.png"></a>hello
'
;
var
html
=
'
<a href="http://www.baidu.com/" ><img src="http://ueditor.baidu.com/img/logo.png" style="width: 200px;height: 200px" _src="http://ueditor.baidu.com/img/logo.png"></a>hello
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
.
firstChild
,
'
给图片添加超链接
'
);
}
);
...
...
_test/plugins/removeformat.js
浏览文件 @
7078dc23
...
...
@@ -18,12 +18,12 @@ test( 'trace 800:清除 超链接的颜色', function () {
editor
.
setContent
(
'
<a href="http://www.baidu.com/">baidu</a>
'
);
range
.
selectNode
(
editor
.
body
.
firstChild
).
select
();
editor
.
execCommand
(
'
forecolor
'
,
'
rgb(255,0,0)
'
);
var
html
=
'
<a href="http://www.baidu.com/"
data_ue
_src = "http://www.baidu.com/" style="color: rgb(255, 0, 0); text-decoration: underline; "><span style="color: rgb(255, 0, 0); ">baidu</span></a>
'
;
var
html
=
'
<a href="http://www.baidu.com/" _src = "http://www.baidu.com/" style="color: rgb(255, 0, 0); text-decoration: underline; "><span style="color: rgb(255, 0, 0); ">baidu</span></a>
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
.
firstChild
,
'
查看加了颜色后超链接的样式
'
)
// ok( ua.haveSameAllChildAttribs( editor.body.firstChild, p1 ), '查看加了颜色后超链接的样式' );
editor
.
execCommand
(
'
removeformat
'
);
var
cl
=
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
==
8
?
'
class=
\
"
\
"
'
:
""
;
html
=
'
<a href="http://www.baidu.com/"
'
+
cl
+
'
data_ue
_src = "http://www.baidu.com/">baidu</a>
'
;
html
=
'
<a href="http://www.baidu.com/"
'
+
cl
+
'
_src = "http://www.baidu.com/">baidu</a>
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
.
firstChild
,
'
查看清除样式后超链接的样式
'
);
}
);
...
...
_test/plugins/serialize.js
浏览文件 @
7078dc23
...
...
@@ -16,7 +16,7 @@ test( '转换img标签', function () {
var
node
=
serialize
.
parseHTML
(
html
);
node
=
serialize
.
transformInput
(
node
);
var
spa
=
ua
.
browser
.
ie
==
6
?
'
orgSrc="
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif"
'
:
''
;
equal
(
serialize
.
toHTML
(
node
).
replace
(
new
RegExp
(
'
[
\r
'
+
domUtils
.
fillChar
+
'
]*
'
,
'
g
'
),
''
),
'
<img src="
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif" width="553" height="275" word_img="file:///C:/DOCUME~1/DONGYA~1/LOCALS~1/Temp/msohtmlclip1/01/clip_image002.jpg" style="background:url(
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
lang/
'
+
editor
.
options
.
lang
+
'
/images/localimage.png) no-repeat center center;border:1px solid #ddd"
'
+
spa
+
'
data_ue
_src="
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif" />
'
,
'
转换img标签
'
);
equal
(
serialize
.
toHTML
(
node
).
replace
(
new
RegExp
(
'
[
\r
'
+
domUtils
.
fillChar
+
'
]*
'
,
'
g
'
),
''
),
'
<img src="
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif" width="553" height="275" word_img="file:///C:/DOCUME~1/DONGYA~1/LOCALS~1/Temp/msohtmlclip1/01/clip_image002.jpg" style="background:url(
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
lang/
'
+
editor
.
options
.
lang
+
'
/images/localimage.png) no-repeat center center;border:1px solid #ddd"
'
+
spa
+
'
_src="
'
+
editor
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/spacer.gif" />
'
,
'
转换img标签
'
);
}
);
test
(
'
转换script标签
'
,
function
()
{
var
serialize
=
te
.
obj
[
0
].
serialize
;
...
...
_test/plugins/source.js
浏览文件 @
7078dc23
...
...
@@ -234,7 +234,7 @@ test( 'trace 1727:插入超链接后再插入空格,空格不能被删除', fu
editor
.
execCommand
(
'
source
'
);
setTimeout
(
function
()
{
editor
.
execCommand
(
'
source
'
);
equal
(
editor
.
body
.
innerHTML
.
toLowerCase
(),
'
<p> <a href="http://www.baidu.com/"
data_ue
_src=
\
"http://www.baidu.com/
\
">绝对路径网址</a> ddd</p>
'
,
'
查看空格是否被删除
'
);
equal
(
editor
.
body
.
innerHTML
.
toLowerCase
(),
'
<p> <a href="http://www.baidu.com/" _src=
\
"http://www.baidu.com/
\
">绝对路径网址</a> ddd</p>
'
,
'
查看空格是否被删除
'
);
start
();
},
100
);
},
100
);
...
...
@@ -251,7 +251,7 @@ test( '关于空格的问题', function () {
editor
.
execCommand
(
'
source
'
);
setTimeout
(
function
()
{
ua
.
manualDeleteFillData
(
editor
.
body
);
equal
(
editor
.
body
.
innerHTML
.
toLowerCase
().
replace
(
/
[\r\n\t]
/g
,
''
),
'
<ol><li><p> dd jj </p></li><li><p> ll kdkd <a href="http://www.baidu.com/"
data_ue
_src="http://www.baidu.com/"> baidu </a> </p></li></ol>
'
);
equal
(
editor
.
body
.
innerHTML
.
toLowerCase
().
replace
(
/
[\r\n\t]
/g
,
''
),
'
<ol><li><p> dd jj </p></li><li><p> ll kdkd <a href="http://www.baidu.com/" _src="http://www.baidu.com/"> baidu </a> </p></li></ol>
'
);
start
();
},
150
);
},
100
);
...
...
_test/tools/br/jshintReport.html
浏览文件 @
7078dc23
此差异已折叠。
点击以展开。
dialogs/attachment/attachment.html
浏览文件 @
7078dc23
...
...
@@ -112,7 +112,7 @@
str
=
""
;
for
(
var
i
=
0
,
ci
;
ci
=
filesList
[
i
++
];){
var
src
=
editor
.
options
.
UEDITOR_HOME_URL
+
"
dialogs/attachment/fileTypeImages/
"
+
(
map
[
ci
.
type
]
||
"
icon_default.png
"
);
str
+=
"
<p style='line-height: 16px;'><img src='
"
+
src
+
"
'
data_ue
_src='
"
+
src
+
"
' />
"
+
str
+=
"
<p style='line-height: 16px;'><img src='
"
+
src
+
"
' _src='
"
+
src
+
"
' />
"
+
"
<a href='
"
+
editor
.
options
.
filePath
+
ci
.
url
+
"
'>
"
+
ci
.
original
+
"
</a></p>
"
;
}
editor
.
execCommand
(
"
insertHTML
"
,
str
);
...
...
dialogs/background/background.js
浏览文件 @
7078dc23
...
...
@@ -77,7 +77,7 @@ var bindClick = function () {
this
.
title
=
lang
.
toggleSelect
+
w
+
"
X
"
+
h
;
};
img
.
setAttribute
(
k
<
35
?
"
src
"
:
"
lazy_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
img
.
setAttribute
(
"
data_ue
_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
img
.
setAttribute
(
"
_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
}
},
...
...
dialogs/emotion/emotion.js
浏览文件 @
7078dc23
...
...
@@ -48,7 +48,7 @@ function InsertSmiley( url, evt ) {
var
obj
=
{
src
:
editor
.
options
.
emotionLocalization
?
editor
.
options
.
UEDITOR_HOME_URL
+
"
dialogs/emotion/
"
+
url
:
url
};
obj
.
data_ue
_src
=
obj
.
src
;
obj
.
_src
=
obj
.
src
;
editor
.
execCommand
(
'
insertimage
'
,
obj
);
if
(
!
evt
.
ctrlKey
)
{
dialog
.
popup
.
hide
();
...
...
dialogs/image/image.js
浏览文件 @
7078dc23
...
...
@@ -204,7 +204,7 @@ var imageUploader = {},
if
(
ci
.
getAttribute
(
"
selected
"
))
{
var
url
=
ci
.
getAttribute
(
"
src
"
,
2
).
replace
(
/
(\s
*$
)
/g
,
""
),
img
=
{};
img
.
src
=
url
;
img
.
data_ue
_src
=
url
;
img
.
_src
=
url
;
imgObjs
.
push
(
img
);
}
}
...
...
@@ -229,7 +229,7 @@ var imageUploader = {},
if
(
!
flagImg
)
return
;
//粘贴地址后如果没有生成对应的预览图,可以认为本次粘贴地址失败
if
(
!
checkNum
([
width
,
height
,
border
,
vhSpace
]))
return
false
;
imgObj
.
src
=
url
.
value
;
imgObj
.
data_ue
_src
=
url
.
value
;
imgObj
.
_src
=
url
.
value
;
imgObj
.
width
=
width
.
value
;
imgObj
.
height
=
height
.
value
;
imgObj
.
border
=
border
.
value
;
...
...
@@ -279,7 +279,7 @@ var imageUploader = {},
tmpObj
.
title
=
ci
.
title
;
tmpObj
.
floatStyle
=
align
;
//修正显示时候的地址数据,如果后台返回的是图片的绝对地址,那么此处无需修正
tmpObj
.
data_ue
_src
=
tmpObj
.
src
=
editor
.
options
.
imagePath
+
ci
.
url
;
tmpObj
.
_src
=
tmpObj
.
src
=
editor
.
options
.
imagePath
+
ci
.
url
;
imgObjs
.
push
(
tmpObj
);
}
insertImage
(
imgObjs
);
...
...
@@ -394,7 +394,7 @@ var imageUploader = {},
function
showImageInfo
(
img
)
{
if
(
!
img
.
getAttribute
(
"
src
"
)
||
!
img
.
src
)
return
;
var
wordImgFlag
=
img
.
getAttribute
(
"
word_img
"
);
g
(
"
url
"
).
value
=
wordImgFlag
?
wordImgFlag
.
replace
(
"
&
"
,
"
&
"
)
:
(
img
.
getAttribute
(
'
data_ue
_src
'
)
||
img
.
getAttribute
(
"
src
"
,
2
).
replace
(
"
&
"
,
"
&
"
));
g
(
"
url
"
).
value
=
wordImgFlag
?
wordImgFlag
.
replace
(
"
&
"
,
"
&
"
)
:
(
img
.
getAttribute
(
'
_src
'
)
||
img
.
getAttribute
(
"
src
"
,
2
).
replace
(
"
&
"
,
"
&
"
));
g
(
"
width
"
).
value
=
img
.
width
||
0
;
g
(
"
height
"
).
value
=
img
.
height
||
0
;
g
(
"
border
"
).
value
=
img
.
getAttribute
(
"
border
"
)
||
0
;
...
...
@@ -617,7 +617,7 @@ var imageUploader = {},
this
.
onload
=
null
;
};
img
.
setAttribute
(
k
<
35
?
"
src
"
:
"
lazy_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
img
.
setAttribute
(
"
data_ue
_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
img
.
setAttribute
(
"
_src
"
,
editor
.
options
.
imageManagerPath
+
ci
.
replace
(
/
\s
+|
\s
+/ig
,
""
));
}
},
...
...
dialogs/link/link.html
浏览文件 @
7078dc23
...
...
@@ -44,7 +44,7 @@
orgText
;
link
=
domUtils
.
findParentByTagName
(
link
,
"
a
"
,
true
);
if
(
link
){
url
=
utils
.
html
(
link
.
getAttribute
(
'
data_ue
_src
'
)
||
link
.
getAttribute
(
'
href
'
,
2
));
url
=
utils
.
html
(
link
.
getAttribute
(
'
_src
'
)
||
link
.
getAttribute
(
'
href
'
,
2
));
if
(
rangeLink
===
link
&&
!
link
.
getElementsByTagName
(
'
img
'
).
length
){
text
.
removeAttribute
(
'
disabled
'
);
...
...
@@ -79,7 +79,7 @@
'
href
'
:
href
,
'
target
'
:
$G
(
"
target
"
).
checked
?
"
_blank
"
:
'
_self
'
,
'
title
'
:
$G
(
"
title
"
).
value
.
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'
data_ue
_src
'
:
href
'
_src
'
:
href
};
//修改链接内容的情况太特殊了,所以先做到这里了
//todo:情况多的时候,做到command里
...
...
dialogs/scrawl/scrawl.js
浏览文件 @
7078dc23
...
...
@@ -633,7 +633,7 @@ function exec(scrawlObj) {
var
imgObj
=
{},
url
=
editor
.
options
.
scrawlPath
+
responseObj
.
url
;
imgObj
.
src
=
url
;
imgObj
.
data_ue
_src
=
url
;
imgObj
.
_src
=
url
;
editor
.
execCommand
(
"
insertImage
"
,
imgObj
);
dialog
.
close
();
}
else
{
...
...
dialogs/wordimage/wordimage.js
浏览文件 @
7078dc23
...
...
@@ -35,7 +35,7 @@ function addOkListener() {
for
(
var
j
=
0
,
url
;
url
=
imageUrls
[
j
++
];)
{
if
(
src
.
indexOf
(
url
.
original
.
replace
(
"
"
,
""
))
!=
-
1
)
{
img
.
src
=
editor
.
options
.
wordImagePath
+
url
.
url
;
img
.
setAttribute
(
"
data_ue_src
"
,
editor
.
options
.
wordImagePath
+
url
.
url
);
//同时修改"data_ue
_src"属性
img
.
setAttribute
(
"
_src
"
,
editor
.
options
.
wordImagePath
+
url
.
url
);
//同时修改"
_src"属性
img
.
setAttribute
(
"
title
"
,
url
.
title
);
parent
.
baidu
.
editor
.
dom
.
domUtils
.
removeAttributes
(
img
,
[
"
word_img
"
,
"
style
"
,
"
width
"
,
"
height
"
]);
editor
.
fireEvent
(
"
selectionchange
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录