mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
페이지 위젯에 박스 위젯 추가. 각 위젯마다 배경을 지정할 수 있도록 하고 IE에서 메모리 누수 현상이 발생하던 부분을 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2983 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
23ac5b8f54
commit
9124d18a91
31 changed files with 1397 additions and 1001 deletions
|
|
@ -8,15 +8,4 @@
|
|||
$lang->page = "Page";
|
||||
$lang->about_page = "It is a blog module which you can create a complete page.\nUsing latest or other widgets, you can create a dynamic page. Through the editor component, you can also create a great variety of pages.\nIts URL is same as other module's such as mid=module name.\n If it is selected as a default, it will be the main page of the site.";
|
||||
$lang->cmd_page_modify = "Modify";
|
||||
|
||||
$lang->cmd_content_insert = "내용 직접 추가";
|
||||
|
||||
$lang->cmd_widget_size = "위젯 크기";
|
||||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
$lang->page = "Página";
|
||||
$lang->about_page = "Esto es un módulo de blog, lo cual usted puede crear una página completa.\nUsando los últimos u otros widgets, Usted puede crear una página dinámica. A través del componente del editor, también puede crear páginas de gran variedad.\nURL de conección es el mismo que de los otros módulos como mid=Nombre del módulo.\n Si selcciona como predefinido esta página será la página principal del sitio.";
|
||||
$lang->cmd_page_modify = "Modificar";
|
||||
|
||||
$lang->cmd_content_insert = "내용 직접 추가";
|
||||
|
||||
$lang->cmd_widget_size = "위젯 크기";
|
||||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
$lang->page = "ページ";
|
||||
$lang->about_page = "完成されたひとつのページが作成できるブログモジュールです。最近の書き込みやウィジェットを用いて動的なページが作成でき、エディターのコンポネントで様々な形でデザインできます。接続URLは、他のモジュールと同じく、「mid=モジュール名」で接続ができ、デフォルトで選択するとメインページが表示されます。";
|
||||
$lang->cmd_page_modify = "ページ修正";
|
||||
|
||||
$lang->cmd_content_insert = "내용 직접 추가";
|
||||
|
||||
$lang->cmd_widget_size = "위젯 크기";
|
||||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
$lang->page = "페이지";
|
||||
$lang->about_page = "하나의 완성된 페이지를 제작할 수 있는 페이지 모듈입니다.\n최근게시물이나 기타 위젯을 이용해서 동적인 페이지 생성이 가능하고 에디터 컴포넌트를 통해서 다양한 모습으로 꾸밀 수 있습니다.\n접속 URL은 다른 모듈처 mid=모듈이름 으로 접속이 가능하며 기본으로 선택하면 접속시 메인 페이지가 됩니다";
|
||||
$lang->cmd_page_modify = "페이지 수정";
|
||||
|
||||
$lang->cmd_content_insert = "내용 직접 추가";
|
||||
|
||||
$lang->cmd_widget_size = "위젯 크기";
|
||||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,4 @@
|
|||
$lang->page = "页面";
|
||||
$lang->about_page = "可制作完整页面的模块。\n利用最新主题列表或其他控件可以生成动态的页面,且通过网页编辑器做出形式多样的页面。\n连接页面URL同其他模块链接相同。即:mid=模块名称。选择默认选项此页面将变为首页。";
|
||||
$lang->cmd_page_modify = "页面编辑";
|
||||
|
||||
$lang->cmd_content_insert = "내용 직접 추가";
|
||||
|
||||
$lang->cmd_widget_size = "위젯 크기";
|
||||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -195,65 +195,5 @@
|
|||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지에 에디터 컨테츠 추가하기 위한 tpl return
|
||||
**/
|
||||
function procPageAdminAddContent() {
|
||||
$content = Context::get('content');
|
||||
$args = Context::getRequestVars('style','widget_margin_left','widget_margin_right','widget_margin_bottom','widget_margin_top');
|
||||
|
||||
$tpl = $this->transEditorContent($content, $args);
|
||||
|
||||
$this->add('tpl', $tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터에서 생성한 컨텐츠를 페이지 수정시 사용할 수 있도록 코드 생성
|
||||
**/
|
||||
function transEditorContent($content, $args = null) {
|
||||
// 에디터의 내용을 변환하여 visual한 영역과 원본 소스를 가지고 있는 code로 분리
|
||||
$code = $content;
|
||||
|
||||
$oContext = &Context::getInstance();
|
||||
$content = preg_replace_callback('!<div([^\>]*)editor_component=([^\>]*)>(.*?)\<\/div\>!is', array($oContext,'transEditorComponent'), $content);
|
||||
$content = preg_replace_callback('!<img([^\>]*)editor_component=([^\>]*?)\>!is', array($oContext,'transEditorComponent'), $content);
|
||||
|
||||
// 결과물에 있는 css Meta 목록을 구해와서 해당 css를 아예 읽어버림
|
||||
require_once("./classes/optimizer/Optimizer.class.php");
|
||||
$oOptimizer = new Optimizer();
|
||||
preg_match_all('!<\!\-\-Meta:([^\-]*?)\-\->!is', $content, $matches);
|
||||
$css_header = null;
|
||||
for($i=0;$i<count($matches[1]);$i++) {
|
||||
$css_file = $matches[1][$i];
|
||||
$buff = FileHandler::readFile($css_file);
|
||||
$css_header .= $oOptimizer->replaceCssPath($css_file, $buff)."\n";
|
||||
}
|
||||
|
||||
$tpl = sprintf(
|
||||
'<style type="text/css">%s</style>'.
|
||||
'<div class="widgetOutput" style="%s" widget_margin_left="%s" widget_margin_right="%s" widget_margin_top="%s" widget_margin_bottom="%s" widget="widgetContent">'.
|
||||
'<div class="widgetSetup"></div>'.
|
||||
'<div class="widgetSize"></div>'.
|
||||
'<div class="widgetRemove"></div>'.
|
||||
'<div class="widgetResize"></div>'.
|
||||
'<div class="widgetResizeLeft"></div>'.
|
||||
'<div class="widgetBorder">'.
|
||||
'<div style="margin:%s %s %s %s;">'.
|
||||
'%s'.
|
||||
'</div><div class="clear"></div>'.
|
||||
'</div>'.
|
||||
'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;">%s</div>'.
|
||||
'</div>',
|
||||
$css_header,
|
||||
$args->style,
|
||||
$args->widget_margin_left, $args->widget_margin_right, $args->widget_margin_top, $args->widget_margin_bottom,
|
||||
$args->widget_margin_top, $args->widget_margin_right, $args->widget_margin_bottom, $args->widget_margin_left,
|
||||
$content,
|
||||
base64_encode($code)
|
||||
);
|
||||
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -155,22 +155,10 @@
|
|||
// 내용을 세팅
|
||||
$content = $this->module_info->content;
|
||||
|
||||
// 내용중 widget이 아닌 것들을 일단 분리
|
||||
$none_widget_code = preg_replace('!<img([^\>]*)widget=([^\>]*?)\>!is', '', $content);
|
||||
$oPageAdminController = &getAdminController('page');
|
||||
if(trim($none_widget_code)) {
|
||||
$args->style = "float:left;overflow:hidden;padding:none;margin:none";
|
||||
$args->widget_margin_left = $args->widget_margin_top = $args->widget_margin_right = $args->widget_margin_bottom = 0;
|
||||
$none_widget_content = $oPageAdminController->transEditorContent($none_widget_code, $args);
|
||||
}
|
||||
|
||||
// 내용중 위젯을 또다시 구함 (기존 버전에서 페이지 수정해 놓은것과의 호환을 위해서)
|
||||
preg_match_all('!<img([^\>]*)widget=([^\>]*?)\>!is', $content, $matches);
|
||||
$content = '';
|
||||
for($i=0;$i<count($matches[0]);$i++) $content .= $matches[0][$i];
|
||||
$content = preg_replace_callback('!<img([^\>]*)widget=([^\>]*?)\>!is', array($this,'transWidget'), $content);
|
||||
|
||||
Context::set('page_content', $none_widget_content.$content);
|
||||
// 내용중 위젯들을 변환
|
||||
$oWidgetController = &getController('widget');
|
||||
$content = $oWidgetController->transWidgetCode($content, true);
|
||||
Context::set('page_content', $content);
|
||||
|
||||
// 위젯 목록을 세팅
|
||||
$oWidgetModel = &getModel('widget');
|
||||
|
|
@ -181,42 +169,6 @@
|
|||
$this->setTemplateFile('page_content_modify');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지에 에디터 위젯 추가
|
||||
**/
|
||||
function dispPageAdminAddContent() {
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return $this->stop("msg_invalid_request");
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('module_info', $module_info);
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'module_srl';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = true;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = false;
|
||||
$option->height = 400;
|
||||
$option->manual_start = true;
|
||||
$editor = $oEditorModel->getEditor($module_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
$this->setTemplateFile('page_add_content');
|
||||
}
|
||||
|
||||
function transWidget($matches) {
|
||||
$oContext = &Context::getInstance();
|
||||
$tpl = $oContext->transWidget($matches, true);
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지 삭제 화면 출력
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -6,27 +6,3 @@ h3 { margin:0 10px 0 10px; }
|
|||
.button_box { float:right; overflow:hidden; }
|
||||
|
||||
.adminLayer { margin-top:30px; }
|
||||
|
||||
#zonePageContent { overflow:hidden; width:100%; padding:none !important; margin:none !important;}
|
||||
|
||||
.pageAddContent { width:700px; }
|
||||
|
||||
.widgetOutput { float:left; cursor:move; z-index:998; overflow:hidden; position:relative;}
|
||||
.widgetOutput .widgetBorder { border:1px dotted #17DA29; z-index:999; }
|
||||
.widgetOutput .widgetSetup { background:#FFFFFF url("../images/widget_setup.gif") no-repeat left top; width:22px; height:22px; position:absolute; top:1px; right:48px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetSize { background:#FFFFFF url("../images/widget_size.gif") no-repeat left top; width:22px; height:22px; position:absolute; top:1px; right:24px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetRemove { background:#FFFFFF url("../images/widget_remove.gif") no-repeat left top; width:22px; height:22px; position:absolute; top:1px; right:1px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;}
|
||||
|
||||
#pageSizeLayer { width:500px; overflow:hidden; border:1px solid #888888; background:#FFFFFF; z-index:2000; position:absolute; }
|
||||
#pageSizeLayer table { border:0; width:100%; table-layout:fixed; }
|
||||
#pageSizeLayer table th { padding:4px 0 4px 0; background-color:#DEDEDE; text-align:center; color:#888888;}
|
||||
#pageSizeLayer table th.line { border-top:1px dotted #EEEEEE; }
|
||||
#pageSizeLayer table td { padding:4px 10px 4px 10px; background-color:#EFEFEF;}
|
||||
#pageSizeLayer table td.line { border-top:1px dotted #999999; }
|
||||
#pageSizeLayer table td.buttonBox { background-color:#FFFFFF; white-space:nowrap; overflow:hidden; vertical-align:top; text-align:center; border-top:1px solid #888888; color:#DDDDDD;}
|
||||
#pageSizeLayer .input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:60px; }
|
||||
#pageSizeLayer .small_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:20px; }
|
||||
#pageSizeLayer .color_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:50px; }
|
||||
#pageSizeLayer .submit { width:90%; border:1px solid #DEDEDE; background-color:#FFFFFF;}
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
<filter name="add_content" module="page" act="procPageAdminAddContent" confirm_msg_code="confirm_submit">
|
||||
<form />
|
||||
<response callback_func="completeAddContent">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="tpl" />
|
||||
</response>
|
||||
</filter>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 74 B |
Binary file not shown.
|
Before Width: | Height: | Size: 59 B |
Binary file not shown.
|
Before Width: | Height: | Size: 140 B |
Binary file not shown.
|
Before Width: | Height: | Size: 202 B |
Binary file not shown.
|
Before Width: | Height: | Size: 120 B |
Binary file not shown.
|
Before Width: | Height: | Size: 191 B |
|
|
@ -36,57 +36,10 @@ function completeInsertPageContent(ret_obj) {
|
|||
location.href = current_url.setQuery('act','');
|
||||
}
|
||||
|
||||
/* 페이지 컨텐츠 저장 */
|
||||
/* 수정한 페이지 컨텐츠를 저장 */
|
||||
function doSubmitPageContent(fo_obj) {
|
||||
var zoneObj = xGetElementById("zonePageContent");
|
||||
var html = "";
|
||||
var childObj = zoneObj.firstChild;
|
||||
while(childObj) {
|
||||
if(childObj.nodeName == "DIV" && childObj.getAttribute("widget")) {
|
||||
var widget = childObj.getAttribute("widget");
|
||||
if(!widget) continue;
|
||||
|
||||
// 내장 위젯인 에디터 컨텐츠인 경우
|
||||
if(widget == "widgetContent") {
|
||||
var style = childObj.getAttribute("style");
|
||||
if(typeof(style)=="object") style = style["cssText"];
|
||||
var cobj = childObj.firstChild;
|
||||
var code = "";
|
||||
while(cobj && cobj.className != "widgetContent") { cobj = cobj.nextSibling; }
|
||||
if(cobj && cobj.className == "widgetContent") {
|
||||
var body = xInnerHtml(cobj);
|
||||
code = '<img src="./common/tpl/images/widget_bg.jpg" class="zbxe_widget_output" widget="widgetContent" style="'+style+'" body="'+body+'" widget_margin_left="'+childObj.getAttribute("widget_margin_left")+'" widget_margin_right="'+childObj.getAttribute("widget_margin_right")+'" widget_margin_top="'+childObj.getAttribute("widget_margin_top")+'" widget_margin_bottom="'+childObj.getAttribute("widget_margin_bottom")+'" />';
|
||||
}
|
||||
html += code;
|
||||
|
||||
// 위젯의 경우
|
||||
} else {
|
||||
var attrs = "";
|
||||
var code = "";
|
||||
for(var i=0;i<childObj.attributes.length;i++) {
|
||||
if(!childObj.attributes[i].nodeName || !childObj.attributes[i].nodeValue) continue;
|
||||
var name = childObj.attributes[i].nodeName.toLowerCase();
|
||||
if(name == "contenteditable" || name == "id" || name=="style" || name=="src" || name=="widget" || name == "body" || name == "class" || name == "widget_width" || name == "widget_width_type" || name == "xdpx" || name == "xdpy" || name == "height") continue;
|
||||
|
||||
var value = childObj.attributes[i].nodeValue;
|
||||
if(!value) continue;
|
||||
|
||||
if(value && typeof(value)=="string") value = value.replace(/\"/ig,'"');
|
||||
|
||||
attrs += name+'="'+value+'" ';
|
||||
}
|
||||
var style = childObj.getAttribute("style");
|
||||
if(typeof(style)=="object" && style["cssText"]) style = style["cssText"];
|
||||
|
||||
code = '<img class="zbxe_widget_output" style="'+style+'" widget="'+widget+'" '+attrs+' />';
|
||||
html += code;
|
||||
}
|
||||
}
|
||||
childObj = childObj.nextSibling;
|
||||
}
|
||||
|
||||
var html = getWidgetContent();
|
||||
fo_obj.content.value = html;
|
||||
|
||||
return procFilter(fo_obj, insert_page_content);
|
||||
}
|
||||
|
||||
|
|
@ -150,634 +103,3 @@ function doUnSelectAll(obj, key) {
|
|||
if(tobj.name == key) tobj.checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* 컨텐츠 추가 */
|
||||
function doAddContent(module_srl) {
|
||||
popopen("./?module=page&act=dispPageAdminAddContent&module_srl="+module_srl, "addContent");
|
||||
}
|
||||
|
||||
function doSyncPageContent() {
|
||||
if(opener && opener.selectedWidget) {
|
||||
var fo_obj = xGetElementById("content_fo");
|
||||
var style = opener.selectedWidget.getAttribute("style");
|
||||
var sel_obj = opener.selectedWidget;
|
||||
if(typeof(style)=="object") style = style["cssText"];
|
||||
fo_obj.style.value = style;
|
||||
fo_obj.widget_margin_left.value = sel_obj.getAttribute("widget_margin_left");
|
||||
fo_obj.widget_margin_right.value = sel_obj.getAttribute("widget_margin_right");
|
||||
fo_obj.widget_margin_bottom.value = sel_obj.getAttribute("widget_margin_bottom");
|
||||
fo_obj.widget_margin_top.value = sel_obj.getAttribute("widget_margin_top");
|
||||
|
||||
var obj = sel_obj.firstChild;
|
||||
while(obj && obj.className != "widgetContent") obj = obj.nextSibling;
|
||||
if(obj && obj.className == "widgetContent") {
|
||||
var content = Base64.decode(xInnerHtml(obj));
|
||||
xGetElementById("content_fo").content.value = content;
|
||||
}
|
||||
}
|
||||
|
||||
editorStart(1, "module_srl", "content", false, 400 );
|
||||
editor_upload_start(1);
|
||||
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
function completeAddContent(ret_obj) {
|
||||
var tpl = ret_obj["tpl"];
|
||||
|
||||
selected_node = opener.selectedWidget;
|
||||
|
||||
if(selected_node && selected_node.getAttribute("widget")) {
|
||||
selected_node = replaceOuterHTML(selected_node, tpl);
|
||||
} else {
|
||||
var obj = opener.xGetElementById('zonePageContent');
|
||||
xInnerHtml(obj, xInnerHtml(obj)+tpl);
|
||||
}
|
||||
|
||||
if(opener.doFitBorderSize) opener.doFitBorderSize();
|
||||
window.close();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* 위젯 추가 */
|
||||
function doAddWidget(fo) {
|
||||
var sel = fo.widget_list;
|
||||
var idx = sel.selectedIndex;
|
||||
var val = sel.options[idx].value;
|
||||
var module_srl = fo.module_srl.value;
|
||||
|
||||
var url = current_url.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget', val).setQuery('module_srl', module_srl);
|
||||
popopen(url,'GenerateCodeInPage');
|
||||
}
|
||||
|
||||
/* 페이지 수정 시작 */
|
||||
function doStartPageModify() {
|
||||
|
||||
// 위젯 크기/여백 조절 레이어를 가장 밖으로 뺌
|
||||
var obj = xGetElementById("tmpPageSizeLayer");
|
||||
var dummy = xCreateElement("div");
|
||||
xInnerHtml(dummy, xInnerHtml(obj));
|
||||
dummy.id="pageSizeLayer";
|
||||
dummy.style.visibility = "hidden";
|
||||
dummy.style.position = "absolute";
|
||||
dummy.style.left = 0;
|
||||
dummy.style.top = 0;
|
||||
|
||||
var oObj = xGetElementById("waitingforserverresponse");
|
||||
oObj.parentNode.insertBefore(dummy, oObj);
|
||||
|
||||
// 모든 위젯들의 크기를 정해진 크기로 맞춤
|
||||
doFitBorderSize();
|
||||
|
||||
// 드래그와 리사이즈와 관련된 이벤트 리스너 생성
|
||||
xAddEventListener(document,"click",doCheckWidget);
|
||||
xAddEventListener(document,"mousedown",doCheckWidgetDrag);
|
||||
}
|
||||
|
||||
// widgetBorder에 height를 widgetOutput와 맞춰줌
|
||||
function doFitBorderSize() {
|
||||
var obj_list = xGetElementsByClassName('widgetBorder', xGetElementById('zonePageContent'));
|
||||
for(var i=0;i<obj_list.length;i++) {
|
||||
var obj = obj_list[i];
|
||||
xHeight(obj, xHeight(obj.parentNode));
|
||||
obj.parentNode.style.clear = '';
|
||||
}
|
||||
}
|
||||
|
||||
var selectedWidget = null;
|
||||
|
||||
// 클릭 이벤트시 위젯의 수정/제거/이벤트 무효화 처리
|
||||
function doCheckWidget(e) {
|
||||
var evt = new xEvent(e); if(!evt.target) return;
|
||||
var obj = evt.target;
|
||||
|
||||
selectedWidget = null;
|
||||
|
||||
var pObj = obj.parentNode;
|
||||
while(pObj) {
|
||||
if(pObj.id == "pageSizeLayer") return;
|
||||
pObj = pObj.parentNode;
|
||||
}
|
||||
|
||||
doHideWidgetSizeSetup();
|
||||
|
||||
// 위젯 설정
|
||||
if(obj.className == 'widgetSetup') {
|
||||
var p_obj = obj.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(!widget) return;
|
||||
selectedWidget = p_obj;
|
||||
if(widget == 'widgetContent') popopen("./?module=page&act=dispPageAdminAddContent&module_srl="+xGetElementById("pageFo").module_srl.value, "addContent");
|
||||
else popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget,'GenerateCodeInPage');
|
||||
return;
|
||||
// 위젯 사이트/ 여백 조절
|
||||
} else if(obj.className == 'widgetSize') {
|
||||
var p_obj = obj.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(!widget) return;
|
||||
selectedWidget = p_obj;
|
||||
doShowWidgetSizeSetup(evt.pageX, evt.pageY, selectedWidget);
|
||||
return;
|
||||
// 위젯 제거
|
||||
} else if(obj.className == 'widgetRemove') {
|
||||
var p_obj = obj.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(confirm(confirm_delete_msg)) p_obj.parentNode.removeChild(p_obj);
|
||||
return;
|
||||
}
|
||||
|
||||
// 내용 클릭 무효화
|
||||
var p_obj = obj;
|
||||
while(p_obj) {
|
||||
if(p_obj.className == 'widgetOutput') {
|
||||
evt.cancelBubble = true;
|
||||
evt.returnValue = false;
|
||||
xPreventDefault(e);
|
||||
xStopPropagation(e);
|
||||
break;
|
||||
}
|
||||
p_obj = p_obj.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 마우스 다운 이벤트 발생시 위젯의 이동을 처리
|
||||
function doCheckWidgetDrag(e) {
|
||||
var evt = new xEvent(e); if(!evt.target) return;
|
||||
var obj = evt.target;
|
||||
|
||||
var pObj = obj.parentNode;
|
||||
while(pObj) {
|
||||
if(pObj.id == "pageSizeLayer") return;
|
||||
pObj = pObj.parentNode;
|
||||
}
|
||||
|
||||
doHideWidgetSizeSetup();
|
||||
|
||||
if(obj.className == 'widgetSetup' || obj.className == 'widgetSize' || obj.className == 'widgetRemove') return;
|
||||
|
||||
p_obj = obj;
|
||||
while(p_obj) {
|
||||
if(p_obj.className == 'widgetOutput' || p_obj.className == 'widgetResize' || p_obj.className == 'widgetResizeLeft') {
|
||||
widgetDragEnable(p_obj, widgetDragStart, widgetDrag, widgetDragEnd);
|
||||
widgetMouseDown(e);
|
||||
return;
|
||||
}
|
||||
p_obj = p_obj.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
function _getInt(val) {
|
||||
if(!val || val == "null") return 0;
|
||||
if(parseInt(val,10)==NaN) return 0;
|
||||
return parseInt(val,10);
|
||||
}
|
||||
|
||||
// 위젯 크기 조절 레이어를 보여줌
|
||||
var selectedSizeWidget = null;
|
||||
function doShowWidgetSizeSetup(px, py, obj) {
|
||||
var layer = xGetElementById("pageSizeLayer");
|
||||
var formObj = layer.firstChild;
|
||||
while(formObj && formObj.nodeName != "FORM") formObj = formObj.nextSibling;
|
||||
if(!formObj || formObj.nodeName != "FORM") return;
|
||||
|
||||
selectedSizeWidget = obj;
|
||||
|
||||
layer.style.display = "block";
|
||||
|
||||
formObj.width.value = obj.style.width;
|
||||
formObj.height.value = obj.style.height;
|
||||
formObj.margin_left.value = _getInt(selectedSizeWidget.getAttribute('widget_margin_left'));
|
||||
formObj.margin_right.value = _getInt(selectedSizeWidget.getAttribute('widget_margin_right'));
|
||||
formObj.margin_top.value = _getInt(selectedSizeWidget.getAttribute('widget_margin_top'));
|
||||
formObj.margin_bottom.value = _getInt(selectedSizeWidget.getAttribute('widget_margin_bottom'));
|
||||
|
||||
var widget_align = '';
|
||||
if(xIE4Up) widget_align = selectedSizeWidget.style.styleFloat;
|
||||
else widget_align = selectedSizeWidget.style.cssFloat;
|
||||
if(widget_align == "left") formObj.widget_align.selectedIndex = 0;
|
||||
else formObj.widget_align.selectedIndex = 1;
|
||||
|
||||
formObj.border_top_color.value = transRGB2Hex(selectedSizeWidget.style.borderTopColor);
|
||||
formObj.border_top_thick.value = selectedSizeWidget.style.borderTopWidth.replace(/px$/i,'');
|
||||
formObj.border_top_type.selectedIndex = selectedSizeWidget.style.borderTopStyle=='dotted'?1:0;
|
||||
|
||||
formObj.border_bottom_color.value = transRGB2Hex(selectedSizeWidget.style.borderBottomColor);
|
||||
formObj.border_bottom_thick.value = selectedSizeWidget.style.borderBottomWidth.replace(/px$/i,'');
|
||||
formObj.border_bottom_type.selectedIndex = selectedSizeWidget.style.borderBottomStyle=='dotted'?1:0;
|
||||
|
||||
formObj.border_right_color.value = transRGB2Hex(selectedSizeWidget.style.borderRightColor);
|
||||
formObj.border_right_thick.value = selectedSizeWidget.style.borderRightWidth.replace(/px$/i,'');
|
||||
formObj.border_right_type.selectedIndex = selectedSizeWidget.style.borderRightStyle=='dotted'?1:0;
|
||||
|
||||
formObj.border_left_color.value = transRGB2Hex(selectedSizeWidget.style.borderLeftColor);
|
||||
formObj.border_left_thick.value = selectedSizeWidget.style.borderLeftWidth.replace(/px$/i,'');
|
||||
formObj.border_left_type.selectedIndex = selectedSizeWidget.style.borderLeftStyle=='dotted'?1:0;
|
||||
|
||||
if(px+xWidth(layer)>xPageX('zonePageContent')+xWidth('zonePageContent')) px = xPageX('zonePageContent')+xWidth('zonePageContent')-xWidth(layer)-5;
|
||||
xLeft(layer, px);
|
||||
xTop(layer, py);
|
||||
layer.style.visibility = "visible";
|
||||
|
||||
try {
|
||||
formObj.width.focus();
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function doHideWidgetSizeSetup() {
|
||||
var layer = xGetElementById("pageSizeLayer");
|
||||
layer.style.visibility = "hidden";
|
||||
layer.style.display = "none";
|
||||
}
|
||||
|
||||
function _getSize(value) {
|
||||
if(!value) return;
|
||||
var type = "px";
|
||||
if(value.lastIndexOf("%")>=0) type = "%";
|
||||
var num = parseInt(value,10);
|
||||
if(num<1) return;
|
||||
if(type == "%" && num > 100) num = 100;
|
||||
return ""+num+type;
|
||||
}
|
||||
|
||||
function _getBorderStyle(fld_color, fld_thick, fld_type) {
|
||||
var color = fld_color.value;
|
||||
if(!color) color = '#FFFFFF';
|
||||
else color = '#'+color;
|
||||
var width = fld_thick.value;
|
||||
if(!width) width = '0px';
|
||||
else width = parseInt(width,10)+'px';
|
||||
var style = fld_type.value;
|
||||
if(!style) style = 'solid';
|
||||
|
||||
var str = color+' '+width+' '+style;
|
||||
return str;
|
||||
}
|
||||
|
||||
function doApplyWidgetSize(fo_obj) {
|
||||
if(selectedSizeWidget) {
|
||||
if(fo_obj.widget_align.selectedIndex== 1) {
|
||||
if(xIE4Up) selectedSizeWidget.style.styleFloat = 'right';
|
||||
else selectedSizeWidget.style.cssFloat = 'right';
|
||||
} else {
|
||||
if(xIE4Up) selectedSizeWidget.style.styleFloat = 'left';
|
||||
else selectedSizeWidget.style.cssFloat = 'left';
|
||||
}
|
||||
|
||||
var width = _getSize(fo_obj.width.value);
|
||||
if(width) selectedSizeWidget.style.width = width;
|
||||
|
||||
var height = _getSize(fo_obj.height.value);
|
||||
if(height) selectedSizeWidget.style.height = height;
|
||||
|
||||
selectedSizeWidget.style.borderTop = _getBorderStyle(fo_obj.border_top_color, fo_obj.border_top_thick, fo_obj.border_top_type);
|
||||
selectedSizeWidget.style.borderBottom = _getBorderStyle(fo_obj.border_bottom_color, fo_obj.border_bottom_thick, fo_obj.border_bottom_type);
|
||||
selectedSizeWidget.style.borderLeft = _getBorderStyle(fo_obj.border_left_color, fo_obj.border_left_thick, fo_obj.border_left_type);
|
||||
selectedSizeWidget.style.borderRight = _getBorderStyle(fo_obj.border_right_color, fo_obj.border_right_thick, fo_obj.border_right_type);
|
||||
|
||||
|
||||
var borderObj = selectedSizeWidget.firstChild;
|
||||
while(borderObj) {
|
||||
if(borderObj.nodeName == "DIV" && borderObj.className == "widgetBorder") {
|
||||
var contentObj = borderObj.firstChild;
|
||||
while(contentObj) {
|
||||
if(contentObj.nodeName == "DIV") {
|
||||
contentObj.style.margin = "";
|
||||
var marginLeft = _getSize(fo_obj.margin_left.value);
|
||||
if(marginLeft) {
|
||||
contentObj.style.marginLeft = marginLeft;
|
||||
selectedSizeWidget.setAttribute('widget_margin_left', marginLeft);
|
||||
} else {
|
||||
contentObj.style.marginLeft = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_left', '');
|
||||
}
|
||||
|
||||
var marginRight = _getSize(fo_obj.margin_right.value);
|
||||
if(marginRight) {
|
||||
contentObj.style.marginRight = marginRight;
|
||||
selectedSizeWidget.setAttribute('widget_margin_right', marginRight);
|
||||
} else {
|
||||
contentObj.style.marginRight = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_right', '');
|
||||
}
|
||||
|
||||
var marginTop = _getSize(fo_obj.margin_top.value);
|
||||
if(marginTop) {
|
||||
contentObj.style.marginTop = marginTop;
|
||||
selectedSizeWidget.setAttribute('widget_margin_top', marginTop);
|
||||
} else {
|
||||
contentObj.style.marginTop = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_top', '');
|
||||
}
|
||||
|
||||
var marginBottom = _getSize(fo_obj.margin_bottom.value);
|
||||
if(marginBottom) {
|
||||
contentObj.style.marginBottom = marginBottom;
|
||||
selectedSizeWidget.setAttribute('widget_margin_bottom', marginBottom);
|
||||
} else {
|
||||
contentObj.style.marginBottom = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_bottom', '');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
contentObj = contentObj.nextSibling;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
borderObj = borderObj.nextSibling;
|
||||
}
|
||||
|
||||
selectedSizeWidget = null;
|
||||
doFitBorderSize();
|
||||
}
|
||||
|
||||
doHideWidgetSizeSetup();
|
||||
}
|
||||
|
||||
/* 위젯 드래그 */
|
||||
// 드래그 중이라는 상황을 간직할 변수
|
||||
var widgetDragManager = {obj:null, isDrag:false}
|
||||
var widgetTmpObject = new Array();
|
||||
var widgetDisappear = 0;
|
||||
|
||||
function widgetCreateTmpObject(obj) {
|
||||
var id = obj.getAttribute('id');
|
||||
var tmpObj = widgetTmpObject[id];
|
||||
if(tmpObj) return tmpObj;
|
||||
|
||||
tmpObj = xCreateElement('DIV');
|
||||
tmpObj.id = id + '_tmp';
|
||||
tmpObj.className = obj.className;
|
||||
//tmpObj.setAttribute('widget', obj.getAttribute('widget'));
|
||||
tmpObj.style.overflow = 'hidden';
|
||||
tmpObj.style.padding = '0px';
|
||||
tmpObj.style.margin = '0px';
|
||||
tmpObj.style.width = obj.style.width;
|
||||
|
||||
tmpObj.style.display = 'none';
|
||||
tmpObj.style.position = 'absolute';
|
||||
tmpObj.style.opacity = 1;
|
||||
tmpObj.style.filter = 'alpha(opacity=100)';
|
||||
|
||||
xLeft(tmpObj, xPageX(obj));
|
||||
xTop(tmpObj, xPageY(obj));
|
||||
|
||||
document.body.appendChild(tmpObj);
|
||||
widgetTmpObject[obj.id] = tmpObj;
|
||||
return tmpObj;
|
||||
}
|
||||
|
||||
// 기생성된 임시 object를 찾아서 return, 없으면 만들어서 return
|
||||
function widgetGetTmpObject(obj) {
|
||||
var tmpObj = widgetTmpObject[obj.id];
|
||||
if(!tmpObj) tmpObj = widgetCreateTmpObject(obj);
|
||||
return tmpObj;
|
||||
}
|
||||
|
||||
// 메뉴에 마우스 클릭이 일어난 시점에 드래그를 위한 제일 첫 동작 (해당 object에 각종 함수나 상태변수 설정)
|
||||
var id_step = 0;
|
||||
function widgetDragEnable(obj, funcDragStart, funcDrag, funcDragEnd) {
|
||||
var id = obj.getAttribute('id');
|
||||
if(!id) {
|
||||
id = 'zLayer_'+id_step;
|
||||
id_step++;
|
||||
obj.setAttribute('id', id);
|
||||
}
|
||||
|
||||
// 상위 object에 드래그 가능하다는 상태와 각 드래그 관련 함수를 설정
|
||||
obj.draggable = true;
|
||||
obj.dragStart = funcDragStart;
|
||||
obj.drag = funcDrag;
|
||||
obj.dragEnd = funcDragEnd;
|
||||
|
||||
// 드래그 가능하지 않다면 드래그 가능하도록 상태 지정하고 mousemove이벤트 등록
|
||||
if (!widgetDragManager.isDrag) {
|
||||
widgetDragManager.isDrag = true;
|
||||
xAddEventListener(document, 'mousemove', widgetDragMouseMove, false);
|
||||
}
|
||||
}
|
||||
|
||||
// 드래그를 시작할때 호출되는 함수 (이동되는 형태를 보여주기 위한 작업을 함)
|
||||
function widgetDragStart(tobj, px, py) {
|
||||
if(tobj.className == 'widgetResize' || tobj.className == 'widgetResizeLeft' ) return;
|
||||
var obj = widgetGetTmpObject(tobj);
|
||||
|
||||
xInnerHtml(obj, xInnerHtml(tobj));
|
||||
|
||||
tobj.setAttribute('source_color', tobj.style.backgroundColor);
|
||||
tobj.style.backgroundColor = "#BBBBBB";
|
||||
|
||||
xLeft(obj, xPageX(tobj));
|
||||
xTop(obj, xPageY(tobj));
|
||||
xWidth(obj, xWidth(tobj));
|
||||
xHeight(obj, xHeight(tobj));
|
||||
|
||||
xDisplay(obj, 'block');
|
||||
}
|
||||
|
||||
// 드래그 시작후 마우스를 이동할때 발생되는 이벤트에 의해 실행되는 함수
|
||||
function widgetDrag(tobj, dx, dy) {
|
||||
var minWidth = 74;
|
||||
var minHeight = 40;
|
||||
|
||||
var sx = xPageX(tobj.parentNode);
|
||||
var sy = xPageY(tobj.parentNode);
|
||||
|
||||
var nx = tobj.xDPX;
|
||||
var ny = tobj.xDPY;
|
||||
|
||||
var zoneWidth = xWidth('zonePageContent');
|
||||
var zoneLeft = xPageX('zonePageContent');
|
||||
var zoneRight = zoneLeft + zoneWidth;
|
||||
|
||||
var pWidth = xWidth(tobj.parentNode);
|
||||
|
||||
var float = xIE4Up?tobj.parentNode.style.styleFloat:tobj.parentNode.style.cssFloat;
|
||||
if(!float) float = 'left';
|
||||
|
||||
// 위젯 리사이즈 (우측)
|
||||
if(tobj.className == 'widgetResize') {
|
||||
if(nx < sx+minWidth) nx = sx+minWidth;
|
||||
if(nx > zoneRight) nx = zoneRight;
|
||||
|
||||
if(float == 'right') nx = sx + pWidth;
|
||||
|
||||
var new_width = nx - sx;
|
||||
if(new_width < minWidth) new_width = minWidth;
|
||||
|
||||
var new_height = ny - sy;
|
||||
if(new_height < minHeight) new_height = minHeight;
|
||||
|
||||
if( zoneRight < sx+new_width) new_width = zoneRight - sx;
|
||||
|
||||
// 위젯의 크기 조절
|
||||
xWidth(tobj.nextSibling.nextSibling, new_width);
|
||||
xHeight(tobj.nextSibling.nextSibling, new_height);
|
||||
|
||||
xWidth(tobj.parentNode, new_width);
|
||||
xHeight(tobj.parentNode, new_height);
|
||||
|
||||
// 위젯 리사이즈 (좌측)
|
||||
} else if(tobj.className == 'widgetResizeLeft') {
|
||||
|
||||
if(nx < zoneLeft) nx = zoneLeft;
|
||||
|
||||
if(float == 'left') nx = sx;
|
||||
|
||||
var new_width = pWidth + (sx - nx);
|
||||
if(new_width < minWidth) new_width = minWidth;
|
||||
|
||||
var new_height = ny - sy;
|
||||
if(new_height < minHeight) new_height = minHeight;
|
||||
|
||||
// 위젯의 크기 조절
|
||||
xWidth(tobj.nextSibling, new_width);
|
||||
xHeight(tobj.nextSibling, new_height);
|
||||
|
||||
xWidth(tobj.parentNode, new_width);
|
||||
xHeight(tobj.parentNode, new_height);
|
||||
|
||||
// 위젯 드래그
|
||||
} else {
|
||||
var obj = widgetGetTmpObject(tobj);
|
||||
var zoneObj = xGetElementById('zonePageContent');
|
||||
var target_obj = zoneObj.firstChild;
|
||||
|
||||
xLeft(obj, parseInt(xPageX(obj),10) + parseInt(dx,10));
|
||||
xTop(obj, parseInt(xPageY(obj),10) + parseInt(dy,10));
|
||||
|
||||
while(target_obj) {
|
||||
//if(target_obj.nodeName == 'DIV' && target_obj.getAttribute('widget')) {
|
||||
if(target_obj.parentNode.id == "zonePageContent" && target_obj.getAttribute && target_obj.getAttribute("widget") ) {
|
||||
var l = xPageX(target_obj);
|
||||
var t = xPageY(target_obj);
|
||||
var ll = parseInt(l,10) + parseInt(xWidth(target_obj),10);
|
||||
var tt = parseInt(t,10) + parseInt(xHeight(target_obj),10);
|
||||
|
||||
if( tobj != target_obj && tobj.xDPX >= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt) {
|
||||
//target_obj.parentNode.insertBefore(tobj, target_obj.nextSibling);
|
||||
var next1 = target_obj.nextSibling;
|
||||
if(!next1) next1 = target_obj.parentNode.lastChild;
|
||||
var next2 = tobj.nextSibling;
|
||||
if(!next2) next2 = tobj.parentNode.lastChild;
|
||||
|
||||
if(next1) next1.parentNode.insertBefore(tobj, next1);
|
||||
|
||||
if(next2) next2.parentNode.insertBefore(target_obj, next2);
|
||||
}
|
||||
}
|
||||
|
||||
target_obj = target_obj.nextSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 드래그 종료 (이동되는 object가 이동할 곳에 서서히 이동되는 것처럼 보이는 효과)
|
||||
function widgetDragEnd(tobj, px, py) {
|
||||
var obj = widgetGetTmpObject(tobj);
|
||||
widgetDisapear = widgetDisapearObject(obj, tobj);
|
||||
widgetDragDisable(tobj.getAttribute('id'));
|
||||
}
|
||||
|
||||
// 스르르 사라지게 함;;
|
||||
function widgetDisapearObject(obj, tobj) {
|
||||
var it = 150;
|
||||
var ib = 15;
|
||||
|
||||
var x = parseInt(xPageX(obj),10);
|
||||
var y = parseInt(xPageY(obj),10);
|
||||
var ldt = (x - parseInt(xPageX(tobj),10)) / ib;
|
||||
var tdt = (y - parseInt(xPageY(tobj),10)) / ib;
|
||||
|
||||
return setInterval(function() {
|
||||
if(ib < 1) {
|
||||
clearInterval(widgetDisapear);
|
||||
xInnerHtml(tobj,xInnerHtml(obj));
|
||||
xInnerHtml(obj,'');
|
||||
xDisplay(obj, 'none');
|
||||
return;
|
||||
}
|
||||
ib -= 5;
|
||||
x-=ldt;
|
||||
y-=tdt;
|
||||
xLeft(obj, x);
|
||||
xTop(obj, y);
|
||||
}, it/ib);
|
||||
}
|
||||
|
||||
// 마우스다운 이벤트 발생시 호출됨
|
||||
function widgetMouseDown(e) {
|
||||
var evt = new xEvent(e);
|
||||
var obj = evt.target;
|
||||
|
||||
while(obj && !obj.draggable) {
|
||||
obj = xParent(obj, true);
|
||||
}
|
||||
if(obj) {
|
||||
xPreventDefault(e);
|
||||
obj.xDPX = evt.pageX;
|
||||
obj.xDPY = evt.pageY;
|
||||
widgetDragManager.obj = obj;
|
||||
xAddEventListener(document, 'mouseup', widgetMouseUp, false);
|
||||
if (obj.dragStart) obj.dragStart(obj, evt.pageX, evt.pageY);
|
||||
}
|
||||
}
|
||||
|
||||
// 마우스 버튼을 놓았을때 동작될 함수 (각종 이벤트 해제 및 변수 설정 초기화)
|
||||
function widgetMouseUp(e) {
|
||||
if (widgetDragManager.obj) {
|
||||
xPreventDefault(e);
|
||||
xRemoveEventListener(document, 'mouseup', widgetMouseUp, false);
|
||||
|
||||
if (widgetDragManager.obj.dragEnd) {
|
||||
var evt = new xEvent(e);
|
||||
widgetDragManager.obj.dragEnd(widgetDragManager.obj, evt.pageX, evt.pageY);
|
||||
}
|
||||
|
||||
widgetDragManager.obj = null;
|
||||
widgetDragManager.isDrag = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 드래그할때의 object이동등을 담당
|
||||
function widgetDragMouseMove(e) {
|
||||
var evt = new xEvent(e);
|
||||
if(widgetDragManager.obj) {
|
||||
xPreventDefault(e);
|
||||
|
||||
var obj = widgetDragManager.obj;
|
||||
var dx = evt.pageX - obj.xDPX;
|
||||
var dy = evt.pageY - obj.xDPY;
|
||||
|
||||
obj.xDPX = evt.pageX;
|
||||
obj.xDPY = evt.pageY;
|
||||
|
||||
if (obj.drag) {
|
||||
obj.drag(obj, dx, dy);
|
||||
} else {
|
||||
xMoveTo(obj, xLeft(obj) + dx, xTop(obj) + dy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 해당 object 에 더 이상 drag가 되지 않도록 설정
|
||||
function widgetDragDisable(id) {
|
||||
if (!widgetDragManager) return;
|
||||
var obj = xGetElementById(id);
|
||||
obj.draggable = false;
|
||||
obj.dragStart = null;
|
||||
obj.drag = null;
|
||||
obj.dragEnd = null;
|
||||
obj.style.backgroundColor = obj.getAttribute('source_color');
|
||||
|
||||
xRemoveEventListener(obj, 'mousedown', widgetMouseDown, false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
<!--%import("filter/add_content.xml")-->
|
||||
<!--%import("js/page_admin.js")-->
|
||||
<!--%import("css/page.css")-->
|
||||
|
||||
<div class="pageAddContent"></div>
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, add_content);" id="content_fo">
|
||||
<input type="hidden" name="content" value="" />
|
||||
<input type="hidden" name="mid" value="{$module_info->mid}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="style" value="float:left;padding:none;margin:none;width:100%;" />
|
||||
<input type="hidden" name="widget_margin_left" value="" />
|
||||
<input type="hidden" name="widget_margin_right" value="" />
|
||||
<input type="hidden" name="widget_margin_top" value="" />
|
||||
<input type="hidden" name="widget_margin_bottom" value="" />
|
||||
|
||||
<div class="editor">
|
||||
{$editor}
|
||||
</div>
|
||||
|
||||
<div class="tCenter help">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_insert}" class="editor_button" accesskey="s" /></span>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
xAddEventListener(window, 'load', doSyncPageContent);
|
||||
</script>
|
||||
|
|
@ -22,9 +22,13 @@
|
|||
<td class="tCenter">
|
||||
<span class="button"><input type="button" value="{$lang->cmd_content_insert}" onclick="doAddContent('{$module_info->module_srl}'); return false;" /></span>
|
||||
</td>
|
||||
<td class="tCenter">
|
||||
<span class="button"><input type="button" value="{$lang->cmd_box_widget_insert}" onclick="doAddWidgetBox(); return false;" /></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2" class="centerButton">
|
||||
<th colspan="3" class="centerButton">
|
||||
<span class="button"><input type="button" value="{$lang->cmd_remove_all_widgets}" onclick="removeAllWidget();return false;"/></span>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_back}" onclick="location.href=current_url.setQuery('act','');return false;"/></span>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}"/></span>
|
||||
</th>
|
||||
|
|
@ -35,84 +39,6 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
var confirm_delete_msg = "{$lang->confirm_delete}";
|
||||
xAddEventListener(window,"load",doStartPageModify);
|
||||
xAddEventListener(window,"load",function() { doStartPageModify('zonePageContent', '{$module_info->module_srl}'); });
|
||||
</script>
|
||||
|
||||
<div id="tmpPageSizeLayer" style="visibility:hidden;">
|
||||
<form action="./" onsubmit="doApplyWidgetSize(this); return false;">
|
||||
<table cellspacing="0">
|
||||
<col width="120" />
|
||||
<col />
|
||||
<col />
|
||||
<tr>
|
||||
<th>{$lang->cmd_widget_align}</th>
|
||||
<td colspan="2">
|
||||
<select name="widget_align">
|
||||
<option value="left">{$lang->cmd_widget_align_left}</option>
|
||||
<option value="right">{$lang->cmd_widget_align_right}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="line">{$lang->cmd_widget_size}</th>
|
||||
<td colspan="2" class="line"><input type="text" name="width" class="input" value="" /> - <input type="text" class="input" name="height" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_margin}</th>
|
||||
<td colspan="2" class="line tCenter"><input type="text" name="margin_top" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="margin_left" class="input" value="" /></td>
|
||||
<td class="tRight"><input type="text" name="margin_right" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter"><input type="text" name="margin_bottom" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_border}</th>
|
||||
<td colspan="2" class="tCenter line">
|
||||
<input type="text" name="border_top_thick" value="" class="small_input" />px
|
||||
<select name="border_top_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_top_color" value="" class="color_input" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="border_left_thick" value="" class="small_input" />px
|
||||
<select name="border_left_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_left_color" value="" class="color_input" maxlength="6"/>
|
||||
</td>
|
||||
<td class="tRight">
|
||||
<input type="text" name="border_right_thick" value="" class="small_input" />px
|
||||
<select name="border_right_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_right_color" value="" class="color_input" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter">
|
||||
<input type="text" name="border_bottom_thick" value="" class="small_input" />px
|
||||
<select name="border_bottom_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_bottom_color" value="" class="color_input" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="buttonBox">
|
||||
<input type="submit" value="{$lang->cmd_save}" class="submit"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue