mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 07:09:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@988 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
aeb1d32bf2
commit
7b5e44ea20
14 changed files with 368 additions and 25 deletions
122
modules/editor/components/poll/tpl/popup.css
Normal file
122
modules/editor/components/poll/tpl/popup.css
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.editor_window {
|
||||
width:500px;
|
||||
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;
|
||||
}
|
||||
|
||||
.survey_header {
|
||||
border:1px solid #888888;
|
||||
background-color:#EFEFEF;
|
||||
margin:5px;
|
||||
padding:5px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.survey_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;
|
||||
}
|
||||
64
modules/editor/components/poll/tpl/popup.html
Normal file
64
modules/editor/components/poll/tpl/popup.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
<div class="editor_window">
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="popopen('./?module=editor&act=dispEditorComponentInfo&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 class="survey_header">
|
||||
{$lang->survey_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"))-->selected="true"<!--@end-->>{$i}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<select name="stop_day">
|
||||
<!--@for($i=1;$i<=31;$i++)-->
|
||||
<option value="{$i}" <!--@if($i==date("d"))-->selected="true"<!--@end-->>{$i}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="survey_source" class="survey_box" style="display:none">
|
||||
|
||||
<div class="title_box">
|
||||
<div class="header">{$lang->survey_title}</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 1</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 2</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 3</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
<div class="sub_button_area">
|
||||
<div><input type="button" value="{$lang->cmd_del_survey}" class="editor_button" onclick="doSurveyDelete(this); return false;" /></div>
|
||||
<div><input type="button" value="{$lang->cmd_add_item}" class="editor_button" onclick="doSurveyAddItem(this); return false;" /></div>
|
||||
<div>
|
||||
- {$lang->survey_chk_count} : <input type="text" name="check_count" value="1" class="editor_small_input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_add_survey}" onclick="doSurveyAdd(); return false;" />
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_insert}" onclick="insertSurvey(); return false;" />
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close(); return false;" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
103
modules/editor/components/poll/tpl/popup.js
Normal file
103
modules/editor/components/poll/tpl/popup.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
var survey_index = 1;
|
||||
function setSurvey() {
|
||||
var obj = xCreateElement("div");
|
||||
var source = xGetElementById("survey_source");
|
||||
xInnerHtml(obj, xInnerHtml(source));
|
||||
obj.id = "survey_"+survey_index;
|
||||
obj.className = "survey_box";
|
||||
obj.style.display = "block";
|
||||
|
||||
source.parentNode.insertBefore(obj, source);
|
||||
}
|
||||
|
||||
/**
|
||||
* 부모창의 위지윅에디터에 데이터를 삽입
|
||||
**/
|
||||
function insertSurvey() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, link);
|
||||
|
||||
opener.focus();
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", setSurvey);
|
||||
|
||||
/**
|
||||
* 새 설문 추가
|
||||
**/
|
||||
function doSurveyAdd() {
|
||||
var obj = xCreateElement("div");
|
||||
var source = xGetElementById("survey_source");
|
||||
if(survey_index+1>3) return null;
|
||||
survey_index++;
|
||||
xInnerHtml(obj, xInnerHtml(source));
|
||||
obj.id = "survey_"+survey_index;
|
||||
obj.className = "survey_box";
|
||||
obj.style.display = "block";
|
||||
|
||||
source.parentNode.insertBefore(obj, source);
|
||||
|
||||
setFixedPopupSize();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목 삭제
|
||||
**/
|
||||
function doSurveyDelete(obj) {
|
||||
var pobj = obj.parentNode.parentNode.parentNode;
|
||||
var tmp_arr = pobj.id.split('_');
|
||||
var index = tmp_arr[1];
|
||||
if(index==1) return;
|
||||
|
||||
pobj.parentNode.removeChild(pobj);
|
||||
|
||||
var obj_list = xGetElementsByClassName('survey_box');
|
||||
for(var i=0;i<obj_list.length;i++) {
|
||||
var nobj = obj_list[i];
|
||||
if(nobj.id == 'survey_source') continue;
|
||||
var tmp_arr = nobj.id.split('_');
|
||||
var index = tmp_arr[1];
|
||||
nobj.id = 'survey_'+(i+1);
|
||||
}
|
||||
survey_index = i-1;
|
||||
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 새 항목 추가
|
||||
**/
|
||||
function doSurveyAddItem(obj) {
|
||||
var pobj = obj.parentNode.parentNode;
|
||||
var source = xPrevSib(pobj);
|
||||
var new_obj = xCreateElement("div");
|
||||
var html = xInnerHtml(source);
|
||||
|
||||
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)+'<');
|
||||
|
||||
xInnerHtml(new_obj, html);
|
||||
new_obj.className = source.className;
|
||||
|
||||
pobj.parentNode.insertBefore(new_obj, pobj);
|
||||
|
||||
var box_obj = pobj.parentNode;
|
||||
var box_height = xHeight(box_obj);
|
||||
xHeight(box_obj, box_height+29);
|
||||
|
||||
setFixedPopupSize();
|
||||
|
||||
return null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue