mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@607 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
15756c2579
commit
799d22b4bd
4 changed files with 241 additions and 68 deletions
|
|
@ -5,15 +5,21 @@
|
|||
* @brief 위지윅에디터(editor) 모듈 > 테이블 생성(table_maker) 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->table = "테이블 추가";
|
||||
$lang->table_title = "테이블 관리";
|
||||
$lang->table_attribute = "테이블 속성 변경";
|
||||
$lang->cell_attribute = "셀 속성 변경";
|
||||
|
||||
$lang->table_width = "가로크기";
|
||||
$lang->table_cols_count = "가로열 갯수";
|
||||
$lang->table_rows_count = "가로열 갯수";
|
||||
$lang->table_rows_count = "세로열 갯수";
|
||||
$lang->table_cellspacing = "셀간 간격";
|
||||
$lang->table_cellpadding = "셀내 여백";
|
||||
$lang->table_border = "외곽선 굵기";
|
||||
$lang->table_inner_border = "구분선 굵기";
|
||||
|
||||
$lang->cell_width = "셀 가로크기 ";
|
||||
$lang->cell_height = "셀 세로 크기 ";
|
||||
|
||||
$lang->table_border_color = "외곽선 색";
|
||||
$lang->table_bg_color = "배경 색";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,12 @@
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_option {
|
||||
width:620px;
|
||||
height:30px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.item_area {
|
||||
clear:left;
|
||||
}
|
||||
|
|
@ -37,6 +43,13 @@
|
|||
font-size:9pt;
|
||||
}
|
||||
|
||||
.wide_body {
|
||||
width:380px;
|
||||
float:left;
|
||||
text-align:left;
|
||||
margin:5px 10px 5px 5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
.table_input {
|
||||
width:40px;
|
||||
height:13px;
|
||||
|
|
|
|||
|
|
@ -4,36 +4,57 @@
|
|||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div class="editor_window">
|
||||
<div class="editor_title">{$lang->table}</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->table_cols_count} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cols_count" value="3" /></div>
|
||||
<div class="editor_title">{$lang->table_title}</div>
|
||||
|
||||
<div class="header">{$lang->table_rows_count} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="rows_count" value="3" /></div>
|
||||
|
||||
<div class="header">{$lang->table_width} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="width" value="600" />px</div>
|
||||
<div class="editor_option" id="table_option" style="display:none">
|
||||
<input name="attr" type="radio" value="table" id="table_attribute_select" onchange="doSelectOption('table');return false;"/> <label for="table_attribute_select">{$lang->table_attribute}</label>
|
||||
<input name="attr" type="radio" value="cell" id="cell_attribute_select" onchange="doSelectOption('cell');return false;"/> <label for="cell_attribute_select">{$lang->cell_attribute}</label>
|
||||
</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->table_border} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="border" value="1" />px</div>
|
||||
<div id="table_attribute" style="display:none">
|
||||
|
||||
<div class="item_area" id="col_row_area" style="display:none" >
|
||||
<div class="header">{$lang->table_cols_count} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cols_count" value="3" /></div>
|
||||
|
||||
<div class="header">{$lang->table_rows_count} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="rows_count" value="3" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->table_width} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="width" value="600" />px</div>
|
||||
|
||||
<div class="header">{$lang->table_cellspacing} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cellspacing" value="0" />px</div>
|
||||
|
||||
<div class="header">{$lang->table_cellpadding} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cellpadding" value="1" />px</div>
|
||||
</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->table_border} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="border" value="1" />px</div>
|
||||
|
||||
<div class="header">{$lang->table_inner_border} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="inner_border" value="0" />px</div>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->table_inner_border} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="inner_border" value="0" />px</div>
|
||||
</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->table_cellspacing} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cellspacing" value="0" />px</div>
|
||||
<div id="cell_attribute" style="display:none">
|
||||
|
||||
<div class="header">{$lang->table_cellpadding} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cellpadding" value="2" />px</div>
|
||||
<div class="item_area">
|
||||
<div class="header">{$lang->cell_width} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cell_width" value="0" />px</div>
|
||||
|
||||
<div class="header">{$lang->cell_height} :</div>
|
||||
<div class="body"><input type="text" class="table_input" id="cell_height" value="0" />px</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item_area">
|
||||
<div class="item_area" id="border_color_area" style="display:none">
|
||||
<div class="header">{$lang->table_border_color} :</div>
|
||||
<div class="body">
|
||||
<div class="editor_color_box">
|
||||
|
|
@ -50,8 +71,10 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item_area">
|
||||
|
||||
<div class="item_area" id="bg_color_area" style="display:none">
|
||||
<div class="header">{$lang->table_bg_color} :</div>
|
||||
<div class="body">
|
||||
<div class="editor_color_box">
|
||||
|
|
@ -70,10 +93,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertTable()" />
|
||||
<input type="button" value="{$lang->cmd_close}" class="editor_button" onclick="window.close();" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -7,52 +7,189 @@ function getTable() {
|
|||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var node = opener.editorPrevNode;
|
||||
selected_node = node;
|
||||
|
||||
// 선택된 객체가 없으면 테이블 새로 추가
|
||||
if(!selected_node) {
|
||||
doSelectOption('table');
|
||||
} else {
|
||||
doSelectOption('cell');
|
||||
}
|
||||
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
/* 테이블, 셀 선택 옵션의 처리 */
|
||||
function doSelectOption(type) {
|
||||
|
||||
// 셀 변경
|
||||
if(selected_node && type == "cell") {
|
||||
xGetElementById("table_option").style.display = "block";
|
||||
xGetElementById("cell_attribute").style.display = "block";
|
||||
|
||||
var cell_width = selected_node.style.width.replace(/px$/,'');
|
||||
var cell_height = selected_node.style.height.replace(/px$/,'');
|
||||
|
||||
var border_color = selected_node.style.borderColor.replace(/^#/,'');
|
||||
if(border_color.indexOf('rgb')>-1) {
|
||||
var tmp_color = border_color.replace(/([a-z\(\) ]*)/ig,'').split(',');
|
||||
border_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, '');
|
||||
}
|
||||
|
||||
var bg_color = selected_node.style.backgroundColor.replace(/^#/,'');
|
||||
if(bg_color.indexOf('rgb')>-1) {
|
||||
var tmp_color = bg_color.replace(/([a-z\(\) ]*)/ig,'').split(',');
|
||||
bg_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, '');
|
||||
}
|
||||
if(!bg_color) bg_color = "FFFFFF";
|
||||
|
||||
xGetElementById("cell_width").value = cell_width?cell_width:0;
|
||||
xGetElementById("cell_height").value = cell_height?cell_height:0;
|
||||
|
||||
xGetElementById("border_color_input").value = border_color;
|
||||
manual_select_color("border", xGetElementById("border_color_input"))
|
||||
xGetElementById("bg_color_input").value = bg_color;
|
||||
manual_select_color("bg", xGetElementById("bg_color_input"))
|
||||
|
||||
xGetElementById("table_attribute").style.display = "none";
|
||||
xGetElementById("cell_attribute").style.display = "block";
|
||||
xGetElementById("cell_attribute_select").checked = true;
|
||||
xGetElementById("border_color_area").style.display = "none";
|
||||
xGetElementById("bg_color_area").style.display = "block";
|
||||
|
||||
// 테이블 변경
|
||||
} else {
|
||||
var table_obj = xParent(selected_node);
|
||||
while(table_obj && table_obj.nodeName != "TABLE") { table_obj = xParent(table_obj); }
|
||||
if(!table_obj) xGetElementById("col_row_area").style.display = "block";
|
||||
else {
|
||||
xGetElementById("col_row_area").style.display = "none";
|
||||
|
||||
var width = xWidth(table_obj);
|
||||
var border = table_obj.style.borderLeftWidth.replace(/px$/,'');
|
||||
if(!border) border = 0;
|
||||
var inner_border = table_obj.getAttribute("border");
|
||||
if(!inner_border) inner_border = 0;
|
||||
var cellspacing = table_obj.getAttribute("cellspacing");
|
||||
if(!cellspacing) cellspacing = 0;
|
||||
var cellpadding = table_obj.getAttribute("cellpadding");
|
||||
if(!cellpadding) cellpadding = 1;
|
||||
|
||||
var border_color = table_obj.style.backgroundColor.replace(/^#/,'');
|
||||
if(border_color.indexOf('rgb')>-1) {
|
||||
var tmp_color = border_color.replace(/([a-z\(\) ]*)/ig,'').split(',');
|
||||
border_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, '');
|
||||
}
|
||||
|
||||
var bg_color = table_obj.style.backgroundColor.replace(/^#/,'');
|
||||
if(bg_color.indexOf('rgb')>-1) {
|
||||
var tmp_color = bg_color.replace(/([a-z\(\) ]*)/ig,'').split(',');
|
||||
bg_color = xHex(tmp_color[0], 2, '')+xHex(tmp_color[1], 2, '')+xHex(tmp_color[2], 2, '');
|
||||
}
|
||||
|
||||
xGetElementById("border_color_input").value = border_color;
|
||||
manual_select_color("border", xGetElementById("border_color_input"))
|
||||
xGetElementById("bg_color_input").value = bg_color;
|
||||
manual_select_color("bg", xGetElementById("bg_color_input"))
|
||||
|
||||
xGetElementById("width").value = width;
|
||||
xGetElementById("border").value = border;
|
||||
xGetElementById("inner_border").value = inner_border;
|
||||
xGetElementById("cellspacing").value = cellspacing;
|
||||
xGetElementById("cellpadding").value = cellpadding
|
||||
}
|
||||
xGetElementById("table_attribute").style.display = "block";
|
||||
xGetElementById("cell_attribute").style.display = "none";
|
||||
xGetElementById("table_attribute_select").checked = true;
|
||||
xGetElementById("border_color_area").style.display = "block";
|
||||
xGetElementById("bg_color_area").style.display = "block";
|
||||
}
|
||||
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
/* 추가 버튼 클릭시 부모창의 위지윅 에디터에 인용구 추가 */
|
||||
function insertTable() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var cols_count = parseInt(xGetElementById("cols_count").value,10);
|
||||
if(!cols_count) cols_count = 1;
|
||||
var table_obj = null;
|
||||
|
||||
var rows_count = parseInt(xGetElementById("rows_count").value,10);
|
||||
if(!rows_count) rows_count = 1;
|
||||
|
||||
var width = parseInt(xGetElementById("width").value,10);
|
||||
|
||||
var border = parseInt(xGetElementById("border").value,10);
|
||||
|
||||
var inner_border = parseInt(xGetElementById("inner_border").value,10);
|
||||
|
||||
var cellspacing = parseInt(xGetElementById("cellspacing").value,10);
|
||||
|
||||
var cellpadding = parseInt(xGetElementById("cellpadding").value,10);
|
||||
|
||||
var border_color = xGetElementById("border_color_input").value;
|
||||
if(border_color.length!=6) border_color = "000000";
|
||||
|
||||
var bg_color = xGetElementById("bg_color_input").value;
|
||||
if(bg_color.length!=6) bg_color = "FFFFFF";
|
||||
|
||||
var text = "";
|
||||
text += "<table width=\""+width+"\" border=\""+inner_border+"\" cellspacing=\""+cellspacing+"\" cellpadding=\""+cellpadding+"\" ";
|
||||
if(border>0) text += " style=\"border:"+border+"px solid #"+border_color+";background-color:#"+bg_color+"\" ";
|
||||
text +=">";
|
||||
|
||||
for(var row=0; row<rows_count;row++) {
|
||||
text += "<tr>";
|
||||
for(var col=0; col<cols_count;col++) {
|
||||
text += "<td> </td>";
|
||||
}
|
||||
text += "</tr>";
|
||||
if(selected_node) {
|
||||
table_obj = xParent(selected_node);
|
||||
while(table_obj && table_obj.nodeName != "TABLE") { table_obj = xParent(table_obj); }
|
||||
}
|
||||
text += "</table>\n<br />";
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
// 테이블 생성일 경우
|
||||
if(xGetElementById("table_attribute_select").checked && !table_obj) {
|
||||
var cols_count = parseInt(xGetElementById("cols_count").value,10);
|
||||
if(!cols_count) cols_count = 1;
|
||||
|
||||
var rows_count = parseInt(xGetElementById("rows_count").value,10);
|
||||
if(!rows_count) rows_count = 1;
|
||||
|
||||
var width = parseInt(xGetElementById("width").value,10);
|
||||
var border = parseInt(xGetElementById("border").value,10);
|
||||
var inner_border = parseInt(xGetElementById("inner_border").value,10);
|
||||
var cellspacing = parseInt(xGetElementById("cellspacing").value,10);
|
||||
var cellpadding = parseInt(xGetElementById("cellpadding").value,10);
|
||||
var border_color = xGetElementById("border_color_input").value;
|
||||
if(border_color.length!=6) border_color = "000000";
|
||||
|
||||
var bg_color = xGetElementById("bg_color_input").value;
|
||||
if(bg_color.length!=6) bg_color = "FFFFFF";
|
||||
|
||||
var text = "";
|
||||
text += "<table width=\""+width+"\" border=\""+inner_border+"\" cellspacing=\""+cellspacing+"\" cellpadding=\""+cellpadding+"\" ";
|
||||
if(border>0) text += " style=\"border:"+border+"px solid #"+border_color+";background-color:#"+bg_color+"\" ";
|
||||
text +=">";
|
||||
|
||||
for(var row=0; row<rows_count;row++) {
|
||||
text += "<tr>";
|
||||
for(var col=0; col<cols_count;col++) {
|
||||
text += "<td> </td>";
|
||||
}
|
||||
text += "</tr>";
|
||||
}
|
||||
text += "</table>\n<br />";
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
// 테이블 수정일 경우
|
||||
} else if(xGetElementById("table_attribute_select").checked && table_obj) {
|
||||
var width = parseInt(xGetElementById("width").value,10);
|
||||
var border = parseInt(xGetElementById("border").value,10);
|
||||
var inner_border = parseInt(xGetElementById("inner_border").value,10);
|
||||
var cellspacing = parseInt(xGetElementById("cellspacing").value,10);
|
||||
var cellpadding = parseInt(xGetElementById("cellpadding").value,10);
|
||||
var border_color = xGetElementById("border_color_input").value;
|
||||
if(border_color.length!=6) border_color = "000000";
|
||||
|
||||
var bg_color = xGetElementById("bg_color_input").value;
|
||||
if(bg_color.length!=6) bg_color = "FFFFFF";
|
||||
|
||||
table_obj.style.width = width+"px";
|
||||
table_obj.setAttribute("border", inner_border);
|
||||
table_obj.setAttribute("cellspacing", cellspacing);
|
||||
table_obj.setAttribute("cellpadding", cellpadding);
|
||||
table_obj.style.border = border+"px solid #"+border_color;
|
||||
table_obj.style.backgroundColor = "#"+bg_color;
|
||||
|
||||
// cell의 수정일 경우
|
||||
} if(xGetElementById("cell_attribute_select").checked && selected_node) {
|
||||
var cell_width = parseInt(xGetElementById("cell_width").value,10);
|
||||
var cell_height = parseInt(xGetElementById("cell_height").value,10);
|
||||
|
||||
var bg_color = xGetElementById("bg_color_input").value;
|
||||
if(bg_color.length!=6) bg_color = "FFFFFF";
|
||||
|
||||
selected_node.style.width = cell_width+"px";
|
||||
selected_node.style.height = cell_height+"px";
|
||||
selected_node.style.backgroundColor = "#"+bg_color;
|
||||
}
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
|
@ -68,13 +205,6 @@ function manual_select_color(type, obj) {
|
|||
if(obj.value.length!=6) return;
|
||||
code = obj.value;
|
||||
xGetElementById(type+"_preview_color").style.backgroundColor = "#"+code;
|
||||
|
||||
if(type=="border") {
|
||||
xGetElementById("border_style_solid_icon").style.backgroundColor = "#"+code;
|
||||
xGetElementById("border_style_dotted_icon").style.backgroundColor = "#"+code;
|
||||
xGetElementById("border_style_left_solid_icon").style.backgroundColor = "#"+code;
|
||||
xGetElementById("border_style_left_dotted_icon").style.backgroundColor = "#"+code;
|
||||
}
|
||||
}
|
||||
|
||||
/* 색상표를 출력 */
|
||||
|
|
@ -108,3 +238,4 @@ function printColorBlock(type, code, blank_img_src) {
|
|||
}
|
||||
|
||||
xAddEventListener(window, "load", getTable);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue