Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
16f88b3e
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 搜索 >>
提交
16f88b3e
编写于
1月 05, 2013
作者:
许
许恒
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fixed]by xuheng整理代码
上级
6d4303d3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
14 deletion
+34
-14
.gitignore
.gitignore
+0
-1
_src/plugins/table.js
_src/plugins/table.js
+5
-2
dialogs/table/edittable.css
dialogs/table/edittable.css
+2
-1
dialogs/table/edittable.js
dialogs/table/edittable.js
+27
-10
未找到文件。
.gitignore
浏览文件 @
16f88b3e
...
...
@@ -2,7 +2,6 @@
# folder #
###############
.idea
testDesign
log
upload
...
...
_src/plugins/table.js
浏览文件 @
16f88b3e
...
...
@@ -1811,10 +1811,13 @@ UE.plugins['table'] = function () {
//表格属性
UE
.
commands
[
'
edittable
'
]
=
{
queryCommandState
:
function
()
{
return
getTableItemsByRange
(
this
).
cell
?
0
:
-
1
var
rng
=
this
.
selection
.
getRange
(),
table
=
domUtils
.
findParentByTagName
(
rng
.
startContainer
,
'
table
'
);
return
table
?
1
:
-
1
;
},
execCommand
:
function
(
cmd
,
color
)
{
var
table
=
getTableItemsByRange
(
this
).
table
;
var
rng
=
this
.
selection
.
getRange
(),
table
=
domUtils
.
findParentByTagName
(
rng
.
startContainer
,
'
table
'
);
if
(
table
&&
color
)
{
var
arr
=
domUtils
.
getElementsByTagName
(
table
,
"
td
"
).
concat
(
domUtils
.
getElementsByTagName
(
table
,
"
th
"
),
...
...
dialogs/table/edittable.css
浏览文件 @
16f88b3e
...
...
@@ -55,7 +55,8 @@
}
.section
.preview
td
{
border
:
1px
solid
#DDD
;
border-width
:
1px
;
border-style
:
solid
;
height
:
22px
;
}
...
...
dialogs/table/edittable.js
浏览文件 @
16f88b3e
...
...
@@ -11,15 +11,16 @@
autoSizeContent
=
$G
(
"
J_autoSizeContent
"
),
autoSizePage
=
$G
(
"
J_autoSizePage
"
),
tone
=
$G
(
"
J_tone
"
),
me
,
preview
=
$G
(
"
J_preview
"
);
var
editTable
=
function
()
{
me
=
this
;
this
.
init
();
};
editTable
.
prototype
=
{
init
:
function
()
{
var
me
=
this
,
colorPiker
=
new
UE
.
ui
.
ColorPicker
({
var
colorPiker
=
new
UE
.
ui
.
ColorPicker
({
editor
:
editor
}),
colorPop
=
new
UE
.
ui
.
Popup
({
...
...
@@ -32,7 +33,7 @@
me
.
createTable
(
title
.
checked
,
caption
.
checked
);
me
.
setAutoSize
();
me
.
setColor
();
me
.
setColor
(
me
.
getColor
()
);
domUtils
.
on
(
title
,
"
click
"
,
me
.
titleHanler
);
domUtils
.
on
(
caption
,
"
click
"
,
me
.
captionHanler
);
...
...
@@ -46,7 +47,7 @@
colorPop
.
hide
();
});
colorPiker
.
addListener
(
"
pickcolor
"
,
function
()
{
tone
.
value
=
arguments
[
1
]
;
me
.
setColor
(
arguments
[
1
])
;
colorPop
.
hide
();
});
},
...
...
@@ -76,7 +77,9 @@
},
titleHanler
:
function
()
{
var
example
=
$G
(
"
J_example
"
);
var
example
=
$G
(
"
J_example
"
),
color
=
domUtils
.
getComputedStyle
(
domUtils
.
getElementsByTagName
(
example
,
"
td
"
)[
0
],
"
border-color
"
);
if
(
title
.
checked
)
{
var
row
=
document
.
createElement
(
"
tr
"
);
row
.
innerHTML
=
"
<th>
"
+
lang
.
titleName
+
"
</th><th>
"
+
lang
.
titleName
+
"
</th><th>
"
+
lang
.
titleName
+
"
</th><th>
"
...
...
@@ -85,6 +88,7 @@
}
else
{
domUtils
.
remove
(
example
.
rows
[
0
]);
}
me
.
setColor
(
color
);
},
captionHanler
:
function
()
{
var
example
=
$G
(
"
J_example
"
);
...
...
@@ -109,10 +113,23 @@
example
.
setAttribute
(
'
width
'
,
'
100%
'
);
},
setColor
:
function
()
{
var
start
=
editor
.
selection
.
getStart
(),
color
=
domUtils
.
findParentByTagName
(
start
,
"
td
"
,
true
);
tone
.
value
=
domUtils
.
getComputedStyle
(
color
,
"
border-color
"
);
getColor
:
function
(){
var
start
=
editor
.
selection
.
getStart
(),
color
=
domUtils
.
findParentByTagName
(
start
,
[
"
td
"
,
"
th
"
,
"
caption
"
],
true
);
return
domUtils
.
getComputedStyle
(
color
,
"
border-color
"
);
},
setColor
:
function
(
color
)
{
var
example
=
$G
(
"
J_example
"
),
arr
=
domUtils
.
getElementsByTagName
(
example
,
"
td
"
).
concat
(
domUtils
.
getElementsByTagName
(
example
,
"
th
"
),
domUtils
.
getElementsByTagName
(
example
,
"
caption
"
)
);
tone
.
value
=
color
;
utils
.
each
(
arr
,
function
(
node
)
{
node
.
style
.
borderColor
=
color
;
});
},
setAutoSize
:
function
()
{
var
me
=
this
,
...
...
@@ -140,8 +157,8 @@
dialog
.
onok
=
function
()
{
title
.
checked
?
editor
.
execCommand
(
"
inserttitle
"
)
:
editor
.
execCommand
(
"
deletetitle
"
);
caption
.
checked
?
editor
.
execCommand
(
"
insertcaption
"
)
:
editor
.
execCommand
(
"
deletecaption
"
);
editor
.
execCommand
(
"
edittable
"
,
tone
.
value
);
autoSizeContent
.
checked
?
adaptByTextTable
()
:
""
;
autoSizePage
.
checked
?
editor
.
execCommand
(
"
adaptbywindow
"
)
:
""
;
editor
.
execCommand
(
"
edittable
"
,
tone
.
value
);
};
})();
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录