git-svn-id: http://xe-core.googlecode.com/svn/trunk@1766 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-06-26 06:52:54 +00:00
parent 9eaaa2f894
commit 9fb8fb947c
41 changed files with 1016 additions and 1673 deletions

View file

@ -1,123 +1,4 @@
@charset "utf-8";
.editor_window {
width:500px;
height:260px;
clear:both;
}
.editor_title {
font-size:10pt;
font-weight:bold;
clear:both;
height:20px;
background-color:#555555;
color:#EFEFEF;
vertical-align:middle;
padding-top:5px;
border-bottom:1px solid #000000;
text-align:center;
}
.poll_header {
border:1px solid #888888;
background-color:#EFEFEF;
margin:5px;
padding:5px;
font-weight:bold;
}
.poll_box {
border:1px solid #888888;
height:140px;
margin:5px;
padding:5px;
}
.title_box {
background-color:#EFEFEF;
border:1px solid #DDDDDD;
padding-top:4px;
height:22px;
clear:both;
}
.item_box {
height:22px;
clear:both;
padding-top:3px;
margin-bottom:3px;
border-bottom:1px solid #DDDDDD;
}
.header {
float:left;
width:60px;
clear:left;
text-align:left;
font-weight:bold;
font-size:9pt;
padding:2px 0px 0px 20px;
height:20px;
}
.sub_header {
float:left;
width:60px;
clear:left;
text-align:left;
font-size:9pt;
padding:2px 0px 0px 20px;
height:20px;
}
.body {
float:left;
text-align:left;
font-size:9pt;
height:20px;
}
.sub_button_area {
padding:3px 20px 3px 0px;
clear:both;
height:25px;
}
.sub_button_area div {
float:left;
padding-right:10px;
margin-right:10px;
height:20px;
}
.editor_input {
width:335px;
border:1px solid #AAAAAA;
font-size:9pt;
height:13px;
}
.editor_small_input {
width:50px;
border:1px solid #AAAAAA;
font-size:9pt;
height:13px;
}
.editor_button_area {
border-top:1px solid #AAAAAA;
text-align:center;
background-color:#EEEEEE;
padding:10px 0px 2px 0px;
clear:both;
height:25px;
}
.editor_button {
background-color:#FFFFFF;
border:1px solid #AAAAAA;
height:17px;
font-size:9pt;
}
.pollButton { clear:both; margin:.5em 0 0 0; height:20px; }
.pollButton label { vertical-align:middle; color:#888888; }

View file

@ -7,65 +7,95 @@
var msg_poll_cannot_modify = "{$lang->msg_poll_cannot_modify}";
</script>
<div id="popHeadder">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
</div>
<form action="./" method="post" id="fo_component" onSubmit="procFilter(this, insert_poll); return false;">
<input type="hidden" name="component" value="{$component_info->component_name}" />
<input type="hidden" name="method" value="insertPoll" />
<input type="hidden" name="poll_srl" value="" />
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<input type="hidden" name="component" value="{$component_info->component_name}" />
<input type="hidden" name="method" value="insertPoll" />
<input type="hidden" name="poll_srl" value="" />
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<div class="editor_window">
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="popopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
<div id="popBody">
<div class="poll_header">
{$lang->poll_stop_date} :
<select name="stop_year">
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
<option value="{$i}">{$i}</option>
<!--@end-->
</select>
<select name="stop_month">
<!--@for($i=1;$i<=12;$i++)-->
<option value="{$i}" <!--@if($i==date("m", time()+60*60*24*30))-->selected="true"<!--@end-->>{$i}</option>
<!--@end-->
</select>
<select name="stop_day">
<!--@for($i=1;$i<=31;$i++)-->
<option value="{$i}" <!--@if($i==date("d", time()+60*60*24*30))-->selected="true"<!--@end-->>{$i}</option>
<!--@end-->
</select>
<input type="button" class="editor_button" value="{$lang->cmd_add_poll}" onclick="doPollAdd(); return false;" />
</div>
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->poll_stop_date}</th>
<td>
<ul class="buttonLeft nospace">
<li>
<select name="stop_year">
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
<option value="{$i}">{$i}</option>
<!--@end-->
</select>
</li>
<li>
<select name="stop_month">
<!--@for($i=1;$i<=12;$i++)-->
<option value="{$i}" <!--@if($i==date("m", time()+60*60*24*30))-->selected="true"<!--@end-->>{$i}</option>
<!--@end-->
</select>
</li>
<li>
<select name="stop_day">
<!--@for($i=1;$i<=31;$i++)-->
<option value="{$i}" <!--@if($i==date("d", time()+60*60*24*30))-->selected="true"<!--@end-->>{$i}</option>
<!--@end-->
</select>
</li>
<li><a href="#" onclick="doPollAdd(); return false;" class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" />{$lang->cmd_add_poll}<img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></a></li>
</ul>
</td>
</tr>
</table>
<div id="poll_source" class="poll_box" style="display:none">
<div id="poll_source" class="clear" style="display:none">
<div class="title_box">
<div class="header">{$lang->poll_title}</div>
<div class="body"><input type="text" name="title_tidx" class="editor_input" /></div>
<table cellspacing="0" class="tableType5 gap1 clear">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->poll_title}</th>
<td><input type="text" name="title_tidx" class="inputTypeText w100" /></td>
</tr>
<tr>
<th scope="row">{$lang->poll_item} 1</th>
<td><input type="text" name="item_tidx_1" class="inputTypeText w100" /></td>
</tr>
<tr>
<th scope="row">{$lang->poll_item} 2</th>
<td><input type="text" name="item_tidx_2" class="inputTypeText w100" /></td>
</tr>
</table>
<div class="pollButton clear">
<ul class="buttonLeft nospace">
<li><a href="#" onclick="doPollAddItem(this); return false;" class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" />{$lang->cmd_add_item}<img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></a></li>
<li><a href="#" onclick="doPollDelete(this); return false;" class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" />{$lang->cmd_del_poll}<img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></a></li>
</ul>
<ul class="buttonRight nospace">
<li><label>{$lang->poll_chk_count}</label></li>
<li><input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" /></li>
</ul>
</div>
<div class="item_box">
<div class="sub_header">{$lang->poll_item} 1</div>
<div class="body"><input type="text" name="item_tidx_1" class="editor_input" /></div>
</div>
<div class="item_box">
<div class="sub_header">{$lang->poll_item} 2</div>
<div class="body"><input type="text" name="item_tidx_2" class="editor_input" /></div>
</div>
<div class="sub_button_area">
<div><input type="button" value="{$lang->cmd_add_item}" class="editor_button" onclick="doPollAddItem(this); return false;" /></div>
<div>
- {$lang->poll_chk_count} : <input type="text" name="checkcount_tidx" value="1" class="editor_small_input" />
</div>
<div><input type="button" value="{$lang->cmd_del_poll}" class="editor_button" onclick="doPollDelete(this); return false;" /></div>
</div>
</div>
<div class="editor_button_area">
<input type="submit" class="editor_button" value="{$lang->cmd_submit}" />
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close(); return false;" />
</div>
</div>
<div id="popFooter">
<ul class="buttonRight nospace">
<li><span class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" /><input type="submit" value="{$lang->cmd_submit}" /><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></span></li>
<li><a href="#" onclick="window.close(); return false;" class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" />{$lang->cmd_close}<img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></a></li>
<li><a href="#" onclick="winopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="buttonTypeA"><img src="../../../../../admin/tpl/images/blank.gif" alt="" class="leftCap" />{$lang->about_component}<img src="../../../../../admin/tpl/images/blank.gif" alt="" class="rightCap" /></a></li>
</ul>
</div>
</form>

View file

@ -23,6 +23,8 @@ function setPoll() {
obj.style.display = "block";
source.parentNode.insertBefore(obj, source);
setFixedPopupSize();
}
/**
@ -55,7 +57,7 @@ xAddEventListener(window, "load", setPoll);
function doPollAdd() {
var obj = xCreateElement("div");
var source = xGetElementById("poll_source");
if(poll_index+1>3) return null;
if(poll_index+1>8) return null;
poll_index++;
var html = xInnerHtml(source);
@ -77,7 +79,7 @@ function doPollAdd() {
* 항목 삭제
**/
function doPollDelete(obj) {
var pobj = obj.parentNode.parentNode.parentNode;
var pobj = obj.parentNode.parentNode.parentNode.parentNode;
var tmp_arr = pobj.id.split('_');
var index = tmp_arr[1];
if(index==1) return;
@ -101,27 +103,36 @@ function doPollDelete(obj) {
* 항목 추가
**/
function doPollAddItem(obj) {
var pobj = obj.parentNode.parentNode;
var source = xPrevSib(pobj);
var new_obj = xCreateElement("div");
var html = xInnerHtml(source);
var tbl = xPrevSib(obj.parentNode.parentNode.parentNode);
var tbody = tbl.lastChild;
var tmp = tbody.firstChild;
var source = null;
while(tmp.nextSibling) {
tmp = tmp.nextSibling;
if(tmp.nodeName == "TR") source = tmp;
}
var idx_match = html.match(/ ([0-9]+)</i);
if(!idx_match) return null;
var idx = parseInt(idx_match[1],10);
html = html.replace( / ([0-9]+)</, ' '+(idx+1)+'<');
html = html.replace( /value=("){0,1}([^"^\s]*)"{0,1}/, 'value=""');
html = html.replace( /item_([0-9]+)_([0-9]+)/, 'item_$1_'+(idx+1));
xInnerHtml(new_obj, html);
var new_obj = source.cloneNode(true);
new_obj.className = source.className;
source.parentNode.appendChild(new_obj);
pobj.parentNode.insertBefore(new_obj, pobj);
var html = xInnerHtml(new_obj);
var idx_match = html.match(/ ([0-9]+)</i);
var idx = parseInt(idx_match[1],10);
var box_obj = pobj.parentNode;
var box_height = xHeight(box_obj);
xHeight(box_obj, box_height+29);
var tmp = new_obj.firstChild;
while(tmp) {
if(tmp.nodeName == "TH") {
var html = xInnerHtml(tmp);
html = html.replace(/ ([0-9]+)/, ' '+(idx+1));
xInnerHtml(tmp, html);
} else if(tmp.nodeName == "TD") {
var html = xInnerHtml(tmp);
html = html.replace(/item_([0-9]+)_([0-9]+)/, 'item_$1_'+(idx+1));
xInnerHtml(tmp, html);
}
tmp = tmp.nextSibling;
}
setFixedPopupSize();