페이지 모듈의 컨텐츠 꾸미는 부분을 위지윅으로 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2957 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-11-12 12:04:01 +00:00
parent 2b1d64f477
commit 7de5dc3a0b
30 changed files with 974 additions and 229 deletions

View file

@ -1,7 +1,9 @@
<filter name="generate_code_in_page" module="widget" act="procWidgetGenerateCode">
<filter name="generate_code_in_page" module="widget" act="procWidgetGenerateCodeInPage">
<response callback_func="completeGenerateCodeInPage">
<tag name="error" />
<tag name="message" />
<tag name="widget_code" />
<tag name="tpl" />
<tag name="css_header" />
</response>
</filter>

View file

@ -15,20 +15,15 @@ function completeGenerateCode(ret_obj) {
/* 생성된 코드를 에디터에 출력 */
function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) {
var widget_code = ret_obj["widget_code"];
var module_srl = fo_obj.module_srl.value;
if(!opener || !widget_code || !module_srl) {
if(!opener || !widget_code) {
window.close();
return;
}
// 부모창에 에디터가 있으면 에디터에 추가
if(opener.editorGetIFrame) {
var iframe_obj = opener.editorGetIFrame(1);
if(iframe_obj) {
opener.editorFocus(1);
opener.editorReplaceHTML(iframe_obj, widget_code);
opener.editorFocus(1);
}
if(selected_node && selected_node.getAttribute("widget")) {
selected_node = replaceOuterHTML(selected_node, widget_code);
} else {
var obj = opener.xGetElementById('zonePageContent');
xInnerHtml(obj, xInnerHtml(obj)+widget_code);
}
window.close();
}
@ -77,9 +72,9 @@ function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) {
/* 페이지 모듈에서 내용의 위젯을 더블클릭하여 수정하려고 할 경우 */
var selected_node = null;
function doFillWidgetVars() {
if(!opener || !opener.editorPrevNode || !opener.editorPrevNode.getAttribute("widget")) return;
if(!opener || !opener.selectedWidget || !opener.selectedWidget.getAttribute("widget")) return;
selected_node = opener.editorPrevNode;
selected_node = opener.selectedWidget;
// 스킨과 컬러셋은 기본
var skin = selected_node.getAttribute("skin");
@ -101,7 +96,7 @@ function doFillWidgetVars() {
case "text" :
case "textarea" :
var val = selected_node.getAttribute(name);
node.value = val;
if(val) node.value = val;
break;
case "checkbox" :
if(selected_node.getAttribute(name)) {
@ -144,9 +139,21 @@ function doFillWidgetVars() {
if(selected_node.style.border) border= parseInt(selected_node.style.boarder.replace(/px$/,''),10);
*/
var width_type = "px";
if(selected_node.getAttribute("widget_width_type")=="%") width_type = "%";
else fo_obj.widget_width.value = xWidth(selected_node);
var width = selected_node.style.width;
if(width) {
var width_type = width.replace(/^([0-9]+)/, '');
if(!width_type) width_type = 'px';
var width_value = width.replace(/([%|px]+)/,'');
fo_obj.widget_width.value = width_value;
if(width_type == '%') fo_obj.widget_width_type.selectedIndex = 0;
else fo_obj.widget_width_type.selectedIndex = 1;
} else {
var width_type = "px";
if(selected_node.getAttribute("widget_width_type")=="%") width_type = "%";
else fo_obj.widget_width.value = xWidth(selected_node);
}
// 컬러셋 설정
if(skin && xGetElementById("widget_colorset").options.length<1 && colorset) {

View file

@ -22,6 +22,35 @@
<th scope="row">{$lang->widget}</th>
<td>{$widget_info->title} ver {$widget_info->version}</td>
</tr>
<tr>
<th scope="row">{$lang->widget_width}</th>
<td>
<input type="text" value="50" name="widget_width" size="3" class="inputTypeText" />
<select name="widget_width_type" onchange="checkFixType(this)">
<option value="%">%</option>
<option value="px">px</option>
</select>
<p>{$lang->about_widget_width}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_margin}</th>
<td>
<table cellspacing="1" class="adminTable">
<tr>
<td colspan="2" class="tCenter">{$lang->widget_margin_top} <input type="text" name="widget_margin_top" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td class="tCenter">{$lang->widget_margin_left} <input type="text" name="widget_margin_left" value="0" size="2" class="inputTypeText"/>px</td>
<td class="tCenter">{$lang->widget_margin_right} <input type="text" name="widget_margin_right" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td colspan="2" class="tCenter">{$lang->widget_margin_bottom} <input type="text" name="widget_margin_bottom" value="0" size="2" class="inputTypeText" />px</td>
</tr>
</table>
<p>{$lang->about_widget_margin}</p>
</td>
</tr>
<!--@if(count($skin_list))-->
<tr>
<th scope="row">{$lang->skin}</th>
@ -84,58 +113,8 @@
</td>
</tr>
<!--@end-->
<tr>
<th scope="row">{$lang->widget_margin}</th>
<td>
<table cellspacing="1" class="adminTable">
<tr>
<td colspan="2" class="tCenter">{$lang->widget_margin_top} <input type="text" name="widget_margin_top" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td class="tCenter">{$lang->widget_margin_left} <input type="text" name="widget_margin_left" value="0" size="2" class="inputTypeText"/>px</td>
<td class="tCenter">{$lang->widget_margin_right} <input type="text" name="widget_margin_right" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td colspan="2" class="tCenter">{$lang->widget_margin_bottom} <input type="text" name="widget_margin_bottom" value="0" size="2" class="inputTypeText" />px</td>
</tr>
</table>
<p>{$lang->about_widget_margin}</p>
</td>
</tr>
</table>
<table cellspacing="0" class="adminTable">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->widget_fix_width}</th>
<td>
<input type="checkbox" value="Y" name="widget_fix_width" /> {$lang->about_widget_fix_width}
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_width}</th>
<td>
<input type="text" value="50" name="widget_width" size="3" class="inputTypeText" />
<select name="widget_width_type" onchange="checkFixType(this)">
<option value="%">%</option>
<option value="px">px</option>
</select>
<p>{$lang->about_widget_width}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_position}</th>
<td>
<select name="widget_position">
<option value="">{$lang->widget_position_none}</option>
<option value="left">{$lang->widget_position_left}</option>
<option value="right">{$lang->widget_position_right}</option>
</select>
<p>{$lang->about_widget_position}</p>
</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter gap1">
<span class="button"><input type="submit" value="{$lang->cmd_generate_code}" /></span>