提交 1319d940 编写于 作者: C campaign

Merge remote-tracking branch 'origin/dev-1.2.4' into dev-1.2.4

......@@ -153,6 +153,16 @@ UE.plugins['contextmenu'] = function () {
cmdName:'averagedistributecol'
},
'-',
{
label:lang.edittd,
cmdName:'edittd',
exec:function () {
if ( UE.ui['edittd'] ) {
new UE.ui['edittd']( this );
}
this.getDialog('edittd').open();
}
},
{
label:lang.edittable,
cmdName:'edittable',
......@@ -171,39 +181,39 @@ UE.plugins['contextmenu'] = function () {
subMenu:[
{
cmdName:'cellalignment',
value:{align:'left',valign:'top'}
value:{align:'left',vAlign:'top'}
},
{
cmdName:'cellalignment',
value:{align:'center',valign:'top'}
value:{align:'center',vAlign:'top'}
},
{
cmdName:'cellalignment',
value:{align:'right',valign:'top'}
value:{align:'right',vAlign:'top'}
},
{
cmdName:'cellalignment',
value:{align:'left',valign:'middle'}
value:{align:'left',vAlign:'middle'}
},
{
cmdName:'cellalignment',
value:{align:'center',valign:'middle'}
value:{align:'center',vAlign:'middle'}
},
{
cmdName:'cellalignment',
value:{align:'right',valign:'middle'}
value:{align:'right',vAlign:'middle'}
},
{
cmdName:'cellalignment',
value:{align:'left',valign:'bottom'}
value:{align:'left',vAlign:'bottom'}
},
{
cmdName:'cellalignment',
value:{align:'center',valign:'bottom'}
value:{align:'center',vAlign:'bottom'}
},
{
cmdName:'cellalignment',
value:{align:'right',valign:'bottom'}
value:{align:'right',vAlign:'bottom'}
}
]
},
......
此差异已折叠。
......@@ -46,6 +46,7 @@
'insertframe':'~/dialogs/insertframe/insertframe.html',
'edittip':'~/dialogs/table/edittip.html',
'edittable':'~/dialogs/table/edittable.html',
'edittd':'~/dialogs/table/edittd.html',
'webapp':'~/dialogs/webapp/webapp.html',
'snapscreen':'~/dialogs/snapscreen/snapscreen.html',
'scrawl':'~/dialogs/scrawl/scrawl.html',
......@@ -175,7 +176,7 @@
var dialogBtns = {
noOk:['searchreplace', 'help', 'spechars', 'webapp'],
ok:['attachment', 'anchor', 'link', 'insertimage', 'map', 'gmap', 'insertframe', 'wordimage',
'insertvideo', 'highlightcode', 'insertframe','edittip','edittable', 'scrawl', 'template','music', 'background']
'insertvideo', 'highlightcode', 'insertframe','edittip','edittable', 'edittd','scrawl', 'template','music', 'background']
};
......
......@@ -36,6 +36,10 @@
float: left;
}
.section .tone{
width: 80px;;
}
.section .preview {
width: 220px;
}
......
......@@ -30,6 +30,15 @@
</li>
</ul>
</div>
<div class="section">
<h3><var id="lang_borderStyle"></var></h3>
<ul>
<li>
<span><var id="lang_color"></var></span>
<input type="text" class="tone" id="J_tone" />
</li>
</ul>
</div>
</div>
<div class="right">
<div class="section">
......
......@@ -10,6 +10,7 @@
caption = $G("J_caption"),
autoSizeContent = $G("J_autoSizeContent"),
autoSizePage = $G("J_autoSizePage"),
tone = $G("J_tone"),
preview = $G("J_preview");
var editTable = function () {
......@@ -17,51 +18,69 @@
};
editTable.prototype = {
init:function () {
var me = this;
var me = this,
colorPiker = new UE.ui.ColorPicker({
editor:editor
}),
colorPop = new UE.ui.Popup({
editor:editor,
content:colorPiker
});
title.checked = editor.queryCommandState("inserttitle") == -1;
caption.checked = editor.queryCommandState("insertcaption") == -1;
me.createTable(title.checked, caption.checked);
me.setAutoSize();
me.setColor();
domUtils.on(title, "click", me.titleHanler);
domUtils.on(caption, "click", me.captionHanler);
domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler);
domUtils.on(autoSizePage, "click", me.autoSizePageHanler);
domUtils.on(tone, "click", function () {
colorPop.showAnchor(tone);
});
domUtils.on(document, 'mousedown', function () {
colorPop.hide();
});
colorPiker.addListener("pickcolor", function () {
tone.value = arguments[1];
colorPop.hide();
});
},
createTable:function (hasCaption, hasTitle) {
var doc = document,
arr = [];
var arr = [];
arr.push("<table id='J_example'>");
if (hasCaption) {
arr.push("<caption>"+lang.captionName+"</caption>")
arr.push("<caption>" + lang.captionName + "</caption>")
}
if (hasTitle) {
arr.push("<tr>");
for(var j=0;j<5;j++){
arr.push("<th>"+lang.titleName+"</th>")
for (var j = 0; j < 5; j++) {
arr.push("<th>" + lang.titleName + "</th>")
}
arr.push("</tr>");
}
for (var i = 0; i < 6; i++) {
arr.push("<tr>");
for(var k=0;k<5;k++){
arr.push("<td>"+lang.cellsName+"</td>")
for (var k = 0; k < 5; k++) {
arr.push("<td>" + lang.cellsName + "</td>")
}
arr.push("</tr>");
}
arr.push("</table>");
$G("J_preview").innerHTML = arr.join("");
preview.innerHTML = arr.join("");
},
titleHanler:function () {
var example = $G("J_example");
if (title.checked) {
var row = document.createElement("tr");
row.innerHTML = "<th>"+lang.titleName+"</th><th>"+lang.titleName+"</th><th>"+lang.titleName+"</th><th>"
+lang.titleName+"</th><th>"+lang.titleName+"</th>";
row.innerHTML = "<th>" + lang.titleName + "</th><th>" + lang.titleName + "</th><th>" + lang.titleName + "</th><th>"
+ lang.titleName + "</th><th>" + lang.titleName + "</th>";
example.insertBefore(row, example.firstChild);
} else {
domUtils.remove(example.rows[0]);
......@@ -89,15 +108,23 @@
});
example.setAttribute('width', '100%');
},
setAutoSize:function(){
var me=this,
setColor:function () {
var start = editor.selection.getStart(),
color = domUtils.findParentByTagName(start, "td", true);
tone.value = domUtils.getComputedStyle(color, "border-color");
},
setAutoSize:function () {
var me = this,
start = editor.selection.getStart(),
flag=!domUtils.findParentByTagName(start, "table",true).width;
if(flag){
autoSizeContent.checked=flag;
wt = domUtils.findParentByTagName(start, "table", true).width,
flag = !wt;
if (wt && !(/%/.test(wt))) return;
if (flag) {
autoSizeContent.checked = flag;
me.autoSizeContentHanler();
}else{
autoSizePage.checked=!flag;
} else {
autoSizePage.checked = !flag;
me.autoSizePageHanler();
}
}
......@@ -105,13 +132,16 @@
new editTable;
function adaptByTextTable(){
function adaptByTextTable() {
editor.execCommand("adaptbywindow");
editor.execCommand('adaptbytext');
}
dialog.onok = function () {
title.checked ? editor.execCommand("inserttitle") : editor.execCommand("deletetitle");
caption.checked ? editor.execCommand("insertcaption") : editor.execCommand("deletecaption");
autoSizeContent.checked ? adaptByTextTable(): editor.execCommand("adaptbywindow");
autoSizeContent.checked ? adaptByTextTable() : "";
autoSizePage.checked ? editor.execCommand("adaptbywindow") : "";
editor.execCommand("edittable", tone.value);
};
})();
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="../internal.js"></script>
<style type="text/css">
.section {
text-align: center;
margin-top: 10px;
}
.section input {
margin-left: 5px;
width: 70px;
}
</style>
</head>
<body>
<div class="section">
<span><var id="lang_tdBkColor"></var></span>
<input type="text" id="J_tone"/>
</div>
<script type="text/javascript">
var tone = $G("J_tone"),
colorPiker = new UE.ui.ColorPicker({
editor:editor
}),
colorPop = new UE.ui.Popup({
editor:editor,
content:colorPiker
});
domUtils.on(tone, "click", function () {
colorPop.showAnchor(tone);
});
domUtils.on(document, 'mousedown', function () {
colorPop.hide();
});
colorPiker.addListener("pickcolor", function () {
tone.value = arguments[1];
colorPop.hide();
});
dialog.onok=function(){
editor.execCommand("edittd",tone.value);
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,7 @@ UE.I18N['en'] = {
'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows',
'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle',
'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable",
'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'insertimage':'Image', 'edittable':'Edit Table', 'link':'Link',
'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'insertimage':'Image', 'edittable':'Edit Table', edittd:'Edit Td','link':'Link',
'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap',
'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL',
......@@ -464,11 +464,13 @@ UE.I18N['en'] = {
'lang_tableSize':'Automatically adjust table size',
'lang_autoSizeContent':'Adaptive by form text',
'lang_autoSizePage':'Page width adaptive',
'lang_example':'Example'
'lang_example':'Example',
'lang_borderStyle':'Table Border',
'lang_color':'Color:'
},
captionName:'Caption',
titleName:'Title',
cellsName:'content'
cellsName:'text'
},
'edittip':{
'static':{
......@@ -476,6 +478,11 @@ UE.I18N['en'] = {
lang_delCol:'Delete entire col'
}
},
'edittd':{
'static':{
lang_tdBkColor:'Background Color:'
}
},
wordimage:{
'static':{
lang_resave:"The re-save step",
......
......@@ -15,7 +15,7 @@ UE.I18N['zh-cn'] = {
'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格',
'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格',
'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",
'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'insertimage':'图片', 'edittable':'表格属性', 'link':'超链接',
'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'insertimage':'图片', 'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接',
'emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图',
'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐',
'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表',
......@@ -447,7 +447,9 @@ UE.I18N['zh-cn'] = {
'lang_tableSize':'自动调整表格尺寸',
'lang_autoSizeContent':'按表格文字自适应',
'lang_autoSizePage':'按页面宽度自适应',
'lang_example':'示例'
'lang_example':'示例',
'lang_borderStyle':'表格边框',
'lang_color':'颜色:'
},
captionName:'表格名称',
titleName:'标题',
......@@ -459,6 +461,11 @@ UE.I18N['zh-cn'] = {
lang_delCol:'删除整列'
}
},
'edittd':{
'static':{
lang_tdBkColor:'背景颜色:'
}
},
'wordimage':{
'static':{
lang_resave:"转存步骤",
......
......@@ -259,6 +259,17 @@
height: 265px;
}
/*edittip-dialog*/
.edui-default .edui-for-edittip .edui-dialog-content {
width: 225px;
height: 60px;
}
/*edittd-dialog*/
.edui-default .edui-for-edittd .edui-dialog-content {
width: 240px;
height: 50px;
}
/*snapscreen-dialog*/
.edui-default .edui-for-snapscreen .edui-dialog-content {
width: 400px;
......@@ -269,9 +280,4 @@
.edui-default .edui-for-music .edui-dialog-content {
width: 515px;
height: 360px;
}
/*edittip-dialog*/
.edui-default .edui-for-edittip .edui-dialog-content {
width: 225px;
height: 60px;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册