Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
10b8335e
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,发现更多精彩内容 >>
提交
10b8335e
编写于
2月 17, 2013
作者:
C
campaign
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
by zhanyi
上级
a3f10701
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
3 deletion
+71
-3
_src/plugins/anchor.js
_src/plugins/anchor.js
+29
-2
_src/plugins/basestyle.js
_src/plugins/basestyle.js
+11
-0
_src/plugins/font.js
_src/plugins/font.js
+31
-1
未找到文件。
_src/plugins/anchor.js
浏览文件 @
10b8335e
...
...
@@ -14,9 +14,36 @@ UE.plugins['anchor'] = function (){
me
.
ready
(
function
(){
utils
.
cssRule
(
'
anchor
'
,
'
.anchorclass{background: url(
\'
'
+
me
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/anchor.gif
\'
) no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}
'
,
me
.
document
)
'
.anchorclass{background: url(
\'
'
+
me
.
options
.
UEDITOR_HOME_URL
+
'
themes/default/images/anchor.gif
\'
) no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}
'
,
me
.
document
)
});
me
.
addOutputRule
(
function
(
root
){
utils
.
each
(
root
.
getNodesByTagName
(
'
img
'
),
function
(
a
){
var
val
;
if
(
val
=
a
.
getAttr
(
'
anchorname
'
)){
a
.
tagName
=
'
a
'
;
a
.
setAttr
({
anchorname
:
''
,
name
:
val
,
'
class
'
:
''
})
}
})
});
me
.
addInputRule
(
function
(
root
){
utils
.
each
(
root
.
getNodesByTagName
(
'
a
'
),
function
(
a
){
var
val
;
if
((
val
=
a
.
getAttr
(
'
name
'
))
&&
!
a
.
getAttr
(
'
href
'
)){
a
.
tagName
=
'
img
'
;
a
.
setAttr
({
anchorname
:
a
.
getAttr
(
'
name
'
),
'
class
'
:
'
anchorclass
'
})
}
})
});
me
.
commands
[
'
anchor
'
]
=
{
execCommand
:
function
(
cmd
,
name
)
{
var
range
=
this
.
selection
.
getRange
(),
img
=
range
.
getClosedNode
();
...
...
_src/plugins/basestyle.js
浏览文件 @
10b8335e
...
...
@@ -25,6 +25,17 @@ UE.plugins['basestyle'] = function(){
"
Italic
"
:
"
ctrl+73
"
,
//^I
"
Underline
"
:
"
ctrl+85
"
//^U
});
me
.
addInputRule
(
function
(
root
){
utils
.
each
(
root
.
getNodesByTagName
(
'
b i
'
),
function
(
node
){
switch
(
node
.
tagName
){
case
'
b
'
:
node
.
tagName
=
'
strong
'
;
break
;
case
'
i
'
:
node
.
tagName
=
'
em
'
;
}
});
});
for
(
var
style
in
basestyles
)
{
(
function
(
cmd
,
tagNames
)
{
me
.
commands
[
cmd
]
=
{
...
...
_src/plugins/font.js
浏览文件 @
10b8335e
...
...
@@ -35,7 +35,37 @@ UE.plugins['font'] = function() {
],
'
fontsize
'
:[
10
,
11
,
12
,
14
,
16
,
18
,
20
,
24
,
36
]
});
me
.
addInputRule
(
function
(
root
){
utils
.
each
(
root
.
getNodesByTagName
(
'
u s del font
'
),
function
(
node
){
if
(
node
.
tagName
==
'
font
'
){
var
cssStyle
=
[];
for
(
var
p
in
node
.
attrs
){
switch
(
p
){
case
'
size
'
:
cssStyle
.
push
(
'
font-size:
'
+
node
.
attrs
[
p
]
+
'
px
'
);
break
;
case
'
color
'
:
cssStyle
.
push
(
'
color:
'
+
node
.
attrs
[
p
]);
break
;
case
'
face
'
:
cssStyle
.
push
(
'
font-family:
'
+
node
.
attrs
[
p
]);
break
;
case
'
style
'
:
cssStyle
.
push
(
node
.
attrs
[
p
]);
}
}
node
.
attrs
=
{
'
style
'
:
cssStyle
.
join
(
'
;
'
)
};
}
else
{
var
val
=
node
.
tagName
==
'
u
'
?
'
underline
'
:
'
line-through
'
;
node
.
attrs
=
{
'
style
'
:
(
node
.
getAttr
(
'
style
'
)
||
''
)
+
'
text-decoration:
'
+
val
+
'
;
'
}
}
node
.
tagName
=
'
span
'
;
});
});
for
(
var
p
in
fonts
)
{
(
function
(
cmd
,
style
)
{
UE
.
commands
[
cmd
]
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录