mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
위젯의 내부여백 기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2993 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
503c57d67c
commit
3144756e6f
13 changed files with 129 additions and 90 deletions
|
|
@ -54,28 +54,28 @@
|
|||
if($widget == 'widgetContent') {
|
||||
$style = $args->style;
|
||||
$body = base64_decode($args->body);
|
||||
$widget_margin_left = $args->widget_margin_left;
|
||||
$widget_margin_right = $args->widget_margin_right;
|
||||
$widget_margin_top = $args->widget_margin_top;
|
||||
$widget_margin_bottom = $args->widget_margin_bottom;
|
||||
$widget_padding_left = $args->widget_padding_left;
|
||||
$widget_padding_right = $args->widget_padding_right;
|
||||
$widget_padding_top = $args->widget_padding_top;
|
||||
$widget_padding_bottom = $args->widget_padding_bottom;
|
||||
if($include_info) {
|
||||
$oWidgetController = &getController('widget');
|
||||
$tpl = $oWidgetController->transEditorContent($body, $args);
|
||||
} else {
|
||||
$tpl = sprintf('<div style="overflow:hidden;%s"><div style="margin:%s %s %s %s;">%s</div></div>', $style, $widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left, $body);
|
||||
$tpl = sprintf('<div style="overflow:hidden;%s"><div style="padding:%s %s %s %s;">%s</div></div>', $style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, $body);
|
||||
}
|
||||
return $tpl;
|
||||
// widget Box일 경우 간단히 변경만 시도함
|
||||
} else if($widget == 'widgetBox') {
|
||||
$style = $args->style;
|
||||
$widget_margin_left = $args->widget_margin_left;
|
||||
$widget_margin_right = $args->widget_margin_right;
|
||||
$widget_margin_top = $args->widget_margin_top;
|
||||
$widget_margin_bottom = $args->widget_margin_bottom;
|
||||
$widget_padding_left = $args->widget_padding_left;
|
||||
$widget_padding_right = $args->widget_padding_right;
|
||||
$widget_padding_top = $args->widget_padding_top;
|
||||
$widget_padding_bottom = $args->widget_padding_bottom;
|
||||
if($include_info) {
|
||||
$tpl = sprintf('<div class="widgetOutput" widget="widgetBox" style="%s;" widget_margin_top="%s" widget_margin_right="%s" widget_margin_bottom="%s" widget_margin_left="%s"><div class="widgetCopy"></div><div class="widgetSize"></div><div class="widgetRemove"></div><div class="widgetResize"></div><div class="widgetResizeLeft"></div><div class="widgetBorder"><div class="nullWidget" style="margin:%s %s %s %s;">', $style, $widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left, $widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left);
|
||||
$tpl = sprintf('<div class="widgetOutput" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s"><div class="widgetCopy"></div><div class="widgetSize"></div><div class="widgetRemove"></div><div class="widgetResize"></div><div class="widgetResizeLeft"></div><div class="widgetBorder"><div class="nullWidget" style="padding:%s %s %s %s;">', $style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left);
|
||||
} else {
|
||||
$tpl = sprintf('<div style="overflow:hidden;%s;"><div style="margin:%s %s %s %s;"><div>%s', $style, $widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left, $body);
|
||||
$tpl = sprintf('<div style="overflow:hidden;%s;"><div style="padding:%s %s %s %s;"><div>%s', $style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left, $body);
|
||||
}
|
||||
return $tpl;
|
||||
}
|
||||
|
|
@ -91,12 +91,12 @@
|
|||
if(!$oWidget) return;
|
||||
|
||||
// 위젯 output을 생성하기 위한 변수 설정
|
||||
$widget_margin_top = $args->widget_margin_top;
|
||||
$widget_margin_bottom = $args->widget_margin_bottom;
|
||||
$widget_margin_left = $args->widget_margin_left;
|
||||
$widget_margin_right = $args->widget_margin_right;
|
||||
$widget_padding_top = $args->widget_padding_top;
|
||||
$widget_padding_bottom = $args->widget_padding_bottom;
|
||||
$widget_padding_left = $args->widget_padding_left;
|
||||
$widget_padding_right = $args->widget_padding_right;
|
||||
|
||||
$inner_style = sprintf("margin:%dpx %dpx %dpx %dpx !important; padding:none !important;", $widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left);
|
||||
$inner_style = sprintf("padding:%dpx %dpx %dpx %dpx !important; padding:none !important;", $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left);
|
||||
|
||||
/**
|
||||
* 출력을 위해 위젯 내용을 div로 꾸밈
|
||||
|
|
@ -143,8 +143,8 @@
|
|||
|
||||
if(!$html) $html = ' ';
|
||||
$output = sprintf(
|
||||
'<style type="text/css">%s</style>'.
|
||||
'<div class="widgetOutput" style="%s" widget_margin_top="%s" widget_margin_right="%s" widget_margin_bottom="%s" widget_margin_left="%s" widget="%s" %s >'.
|
||||
'<div class="widgetClass"><style type="text/css">%s</style></div>'.
|
||||
'<div class="widgetOutput" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'.
|
||||
'<div class="widgetSetup"></div>'.
|
||||
'<div class="widgetCopy"></div>'.
|
||||
'<div class="widgetSize"></div>'.
|
||||
|
|
@ -159,7 +159,7 @@
|
|||
'</div>',
|
||||
$css_header,
|
||||
$args->style,
|
||||
$widget_margin_top, $widget_margin_right, $widget_margin_bottom, $widget_margin_left,
|
||||
$widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,
|
||||
$widget, implode(' ',$attribute),
|
||||
$inner_style,
|
||||
$html
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ function transRGB2Hex(value) {
|
|||
var color = parseInt(value_list[i],10).toString(16);
|
||||
hex += color;
|
||||
}
|
||||
return hex;
|
||||
return '#'+hex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@
|
|||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_margin = "외부 여백";
|
||||
$lang->cmd_widget_padding = "내부 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@
|
|||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_margin = "외부 여백";
|
||||
$lang->cmd_widget_padding = "내부 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@
|
|||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_margin = "외부 여백";
|
||||
$lang->cmd_widget_padding = "내부 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
$lang->widget_position_none = '줄바꿈';
|
||||
$lang->widget_position_left = '왼쪽';
|
||||
$lang->widget_position_right = '오른쪽';
|
||||
$lang->widget_margin = '여백';
|
||||
$lang->widget_margin = '외부 여백';
|
||||
$lang->widget_margin_top = '위';
|
||||
$lang->widget_margin_right = '오른쪽';
|
||||
$lang->widget_margin_bottom = '아래 ';
|
||||
|
|
@ -49,7 +49,8 @@
|
|||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_margin = "외부 여백";
|
||||
$lang->cmd_widget_padding = "내부 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@
|
|||
$lang->cmd_widget_align = "위젯 정렬";
|
||||
$lang->cmd_widget_align_left = "왼쪽";
|
||||
$lang->cmd_widget_align_right = "오른쪽";
|
||||
$lang->cmd_widget_margin = "위젯 여백";
|
||||
$lang->cmd_widget_margin = "외부 여백";
|
||||
$lang->cmd_widget_padding = "내부 여백";
|
||||
$lang->cmd_widget_border = "위젯 테두리";
|
||||
$lang->cmd_widget_border_solid = "실선";
|
||||
$lang->cmd_widget_border_dotted = "점선";
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
<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="" />
|
||||
<input type="hidden" name="widget_padding_left" value="" />
|
||||
<input type="hidden" name="widget_padding_right" value="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" value="" />
|
||||
|
||||
<div class="editor">
|
||||
{$editor}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ function setFloat(obj, fl) {
|
|||
else obj.style.cssFloat = fl;
|
||||
}
|
||||
|
||||
// margin값을 구하는 함수 (없을 경우 0으로 세팅), zbxe의 위젯에서만 사용
|
||||
function getMargin(obj, direct) {
|
||||
var margin = obj.getAttribute("widget_margin_"+direct);
|
||||
if(!margin || margin == null) margin = 0;
|
||||
return margin;
|
||||
// padding값을 구하는 함수 (없을 경우 0으로 세팅), zbxe의 위젯에서만 사용
|
||||
function getPadding(obj, direct) {
|
||||
var padding = obj.getAttribute("widget_padding_"+direct);
|
||||
if(!padding || padding == null) padding = 0;
|
||||
return padding;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ function getContentWidgetCode(childObj, widget) {
|
|||
while(cobj) {
|
||||
if(cobj.nodeName == "DIV" && cobj.className == "widgetContent") {
|
||||
var body = xInnerHtml(cobj);
|
||||
return '<img src="./common/tpl/images/widget_bg.jpg" class="zbxe_widget_output" widget="widgetContent" style="'+getStyle(childObj)+'" body="'+body+'" widget_margin_left="'+getMargin(childObj,'left')+'" widget_margin_right="'+getMargin(childObj, 'right')+'" widget_margin_top="'+getMargin(childObj, 'top')+'" widget_margin_bottom="'+getMargin(childObj,'bottom')+'" />';
|
||||
return '<img src="./common/tpl/images/widget_bg.jpg" class="zbxe_widget_output" widget="widgetContent" style="'+getStyle(childObj)+'" body="'+body+'" widget_padding_left="'+getPadding(childObj,'left')+'" widget_padding_right="'+getPadding(childObj, 'right')+'" widget_padding_top="'+getPadding(childObj, 'top')+'" widget_padding_bottom="'+getPadding(childObj,'bottom')+'" />';
|
||||
}
|
||||
cobj = cobj.nextSibling;
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ function getWidgetBoxCode(childObj, widget) {
|
|||
while(c2obj) {
|
||||
if(c2obj.className == "nullWidget") {
|
||||
var body = getWidgetContent(c2obj);
|
||||
return '<div widget="widgetBox" style="'+getStyle(childObj)+'" widget_margin_left="'+getMargin(childObj,'left')+'" widget_margin_right="'+getMargin(childObj,'right')+'" widget_margin_top="'+getMargin(childObj, 'top')+'" widget_margin_bottom="'+getMargin(childObj, 'bottom')+'"><div><div>'+body+'<div class="clear"></div></div></div></div>';
|
||||
return '<div widget="widgetBox" style="'+getStyle(childObj)+'" widget_padding_left="'+getPadding(childObj,'left')+'" widget_padding_right="'+getPadding(childObj,'right')+'" widget_padding_top="'+getPadding(childObj, 'top')+'" widget_padding_bottom="'+getPadding(childObj, 'bottom')+'"><div><div>'+body+'<div class="clear"></div></div></div></div>';
|
||||
}
|
||||
c2obj = c2obj.nextSibling;
|
||||
}
|
||||
|
|
@ -158,10 +158,10 @@ function doSyncPageContent() {
|
|||
var fo_obj = xGetElementById("content_fo");
|
||||
var sel_obj = opener.selectedWidget;
|
||||
fo_obj.style.value = getStyle(opener.selectedWidget);
|
||||
fo_obj.widget_margin_left.value = getMargin(sel_obj, 'left');
|
||||
fo_obj.widget_margin_right.value = getMargin(sel_obj,'right');
|
||||
fo_obj.widget_margin_bottom.value = getMargin(sel_obj,'bottom');
|
||||
fo_obj.widget_margin_top.value = getMargin(sel_obj,'top');
|
||||
fo_obj.widget_padding_left.value = getPadding(sel_obj, 'left');
|
||||
fo_obj.widget_padding_right.value = getPadding(sel_obj,'right');
|
||||
fo_obj.widget_padding_bottom.value = getPadding(sel_obj,'bottom');
|
||||
fo_obj.widget_padding_top.value = getPadding(sel_obj,'top');
|
||||
|
||||
var obj = sel_obj.firstChild;
|
||||
while(obj && obj.className != "widgetContent") obj = obj.nextSibling;
|
||||
|
|
@ -365,10 +365,14 @@ function doShowWidgetSizeSetup(px, py, obj) {
|
|||
|
||||
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'));
|
||||
formObj.padding_left.value = _getInt(selectedSizeWidget.getAttribute('widget_padding_left'));
|
||||
formObj.padding_right.value = _getInt(selectedSizeWidget.getAttribute('widget_padding_right'));
|
||||
formObj.padding_top.value = _getInt(selectedSizeWidget.getAttribute('widget_padding_top'));
|
||||
formObj.padding_bottom.value = _getInt(selectedSizeWidget.getAttribute('widget_padding_bottom'));
|
||||
formObj.margin_left.value = _getInt(selectedSizeWidget.style.marginLeft);
|
||||
formObj.margin_right.value = _getInt(selectedSizeWidget.style.marginRight);
|
||||
formObj.margin_top.value = _getInt(selectedSizeWidget.style.marginTop);
|
||||
formObj.margin_bottom.value = _getInt(selectedSizeWidget.style.marginBottom);
|
||||
|
||||
var widget_align = getFloat(selectedSizeWidget);
|
||||
if(widget_align == "left") formObj.widget_align.selectedIndex = 0;
|
||||
|
|
@ -431,11 +435,11 @@ function doHideWidgetSizeSetup() {
|
|||
}
|
||||
|
||||
function _getSize(value) {
|
||||
if(!value) return;
|
||||
if(!value) return 0;
|
||||
var type = "px";
|
||||
if(value.lastIndexOf("%")>=0) type = "%";
|
||||
var num = parseInt(value,10);
|
||||
if(num<1) return;
|
||||
if(num<1) return 0;
|
||||
if(type == "%" && num > 100) num = 100;
|
||||
return ""+num+type;
|
||||
}
|
||||
|
|
@ -455,7 +459,7 @@ function _getBorderStyle(fld_color, fld_thick, fld_type) {
|
|||
}
|
||||
|
||||
function _getBGColorStyle(fld_color) {
|
||||
var color = fld_color.value;
|
||||
var color = fld_color.replace(/^#/,'');
|
||||
if(!color) color = '#FFFFFF';
|
||||
else color = '#'+color;
|
||||
return color;
|
||||
|
|
@ -476,9 +480,13 @@ function doApplyWidgetSize(fo_obj) {
|
|||
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);
|
||||
selectedSizeWidget.style.marginTop = _getSize(fo_obj.margin_top.value);
|
||||
selectedSizeWidget.style.marginRight = _getSize(fo_obj.margin_right.value);
|
||||
selectedSizeWidget.style.marginBottom = _getSize(fo_obj.margin_bottom.value);
|
||||
selectedSizeWidget.style.marginLeft = _getSize(fo_obj.margin_left.value);
|
||||
|
||||
if(!fo_obj.background_color.value || fo_obj.background_color.value == 'transparent') selectedSizeWidget.style.backgroundColor = 'transparent';
|
||||
else selectedSizeWidget.style.backgroundColor = _getBGColorStyle(fo_obj.background_color);
|
||||
else selectedSizeWidget.style.backgroundColor = _getBGColorStyle(fo_obj.background_color.value);
|
||||
|
||||
var image_url = fo_obj.background_image_url.value;
|
||||
if(image_url) selectedSizeWidget.style.backgroundImage = "url("+image_url+")";
|
||||
|
|
@ -500,41 +508,41 @@ function doApplyWidgetSize(fo_obj) {
|
|||
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);
|
||||
contentObj.style.padding = "";
|
||||
var paddingLeft = _getSize(fo_obj.padding_left.value);
|
||||
if(paddingLeft) {
|
||||
contentObj.style.paddingLeft = paddingLeft;
|
||||
selectedSizeWidget.setAttribute('widget_padding_left', paddingLeft);
|
||||
} else {
|
||||
contentObj.style.marginLeft = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_left', '');
|
||||
contentObj.style.paddingLeft = '';
|
||||
selectedSizeWidget.setAttribute('widget_padding_left', '');
|
||||
}
|
||||
|
||||
var marginRight = _getSize(fo_obj.margin_right.value);
|
||||
if(marginRight) {
|
||||
contentObj.style.marginRight = marginRight;
|
||||
selectedSizeWidget.setAttribute('widget_margin_right', marginRight);
|
||||
var paddingRight = _getSize(fo_obj.padding_right.value);
|
||||
if(paddingRight) {
|
||||
contentObj.style.paddingRight = paddingRight;
|
||||
selectedSizeWidget.setAttribute('widget_padding_right', paddingRight);
|
||||
} else {
|
||||
contentObj.style.marginRight = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_right', '');
|
||||
contentObj.style.paddingRight = '';
|
||||
selectedSizeWidget.setAttribute('widget_padding_right', '');
|
||||
}
|
||||
|
||||
var marginTop = _getSize(fo_obj.margin_top.value);
|
||||
if(marginTop) {
|
||||
contentObj.style.marginTop = marginTop;
|
||||
selectedSizeWidget.setAttribute('widget_margin_top', marginTop);
|
||||
var paddingTop = _getSize(fo_obj.padding_top.value);
|
||||
if(paddingTop) {
|
||||
contentObj.style.paddingTop = paddingTop;
|
||||
selectedSizeWidget.setAttribute('widget_padding_top', paddingTop);
|
||||
} else {
|
||||
contentObj.style.marginTop = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_top', '');
|
||||
contentObj.style.paddingTop = '';
|
||||
selectedSizeWidget.setAttribute('widget_padding_top', '');
|
||||
}
|
||||
|
||||
var marginBottom = _getSize(fo_obj.margin_bottom.value);
|
||||
if(marginBottom) {
|
||||
contentObj.style.marginBottom = marginBottom;
|
||||
selectedSizeWidget.setAttribute('widget_margin_bottom', marginBottom);
|
||||
var paddingBottom = _getSize(fo_obj.padding_bottom.value);
|
||||
if(paddingBottom) {
|
||||
contentObj.style.paddingBottom = paddingBottom;
|
||||
selectedSizeWidget.setAttribute('widget_padding_bottom', paddingBottom);
|
||||
} else {
|
||||
contentObj.style.marginBottom = '';
|
||||
selectedSizeWidget.setAttribute('widget_margin_bottom', '');
|
||||
contentObj.style.paddingBottom = '';
|
||||
selectedSizeWidget.setAttribute('widget_padding_bottom', '');
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -567,8 +575,8 @@ function widgetCreateTmpObject(obj) {
|
|||
tmpObj.id = id + '_tmp';
|
||||
tmpObj.className = obj.className;
|
||||
tmpObj.style.overflow = 'hidden';
|
||||
tmpObj.style.margin= '0px';
|
||||
tmpObj.style.padding = '0px';
|
||||
tmpObj.style.margin = '0px';
|
||||
tmpObj.style.width = obj.style.width;
|
||||
|
||||
tmpObj.style.display = 'none';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,21 @@ function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) {
|
|||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
var dummy = xCreateElement("DIV");
|
||||
xInnerHtml(dummy, widget_code);
|
||||
|
||||
var cobj = dummy.firstChild;
|
||||
while(cobj) {
|
||||
if(cobj.className == 'widgetClass') {
|
||||
opener.document.body.insertBefore(cobj, opener.document.body.firstChild);
|
||||
break;
|
||||
}
|
||||
cobj = cobj.nextSibling;
|
||||
}
|
||||
|
||||
widget_code = xInnerHtml(dummy);
|
||||
|
||||
if(selected_node && selected_node.getAttribute("widget")) {
|
||||
selected_node = replaceOuterHTML(selected_node, widget_code);
|
||||
if(opener.doFitBorderSize) opener.doFitBorderSize();
|
||||
|
|
@ -88,10 +103,10 @@ function doFillWidgetVars() {
|
|||
if(typeof(style)=="object") style = style["cssText"];
|
||||
fo_obj.style.value = style;
|
||||
|
||||
fo_obj.widget_margin_left.value = selected_node.getAttribute("widget_margin_left");
|
||||
fo_obj.widget_margin_right.value = selected_node.getAttribute("widget_margin_right");
|
||||
fo_obj.widget_margin_bottom.value = selected_node.getAttribute("widget_margin_bottom");
|
||||
fo_obj.widget_margin_top.value = selected_node.getAttribute("widget_margin_top");
|
||||
fo_obj.widget_padding_left.value = selected_node.getAttribute("widget_padding_left");
|
||||
fo_obj.widget_padding_right.value = selected_node.getAttribute("widget_padding_right");
|
||||
fo_obj.widget_padding_bottom.value = selected_node.getAttribute("widget_padding_bottom");
|
||||
fo_obj.widget_padding_top.value = selected_node.getAttribute("widget_padding_top");
|
||||
|
||||
for(var name in fo_obj) {
|
||||
var node = fo_obj[name];
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@
|
|||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="widget_sequence" value="" />
|
||||
<input type="hidden" name="style" value="float:left;width:100%;margin:none;padding:none;" />
|
||||
<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="" />
|
||||
<input type="hidden" name="widget_padding_left" value="" />
|
||||
<input type="hidden" name="widget_padding_right" value="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" value="" />
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$lang->cmd_generate_code}</h3>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,17 @@
|
|||
<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_padding}</th>
|
||||
<td colspan="2" class="line tCenter"><input type="text" name="padding_top" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="padding_left" class="input" value="" /></td>
|
||||
<td class="tRight"><input type="text" name="padding_right" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter"><input type="text" name="padding_bottom" class="input" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_border}</th>
|
||||
<td colspan="2" class="tCenter line">
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
**/
|
||||
function procWidgetAddContent() {
|
||||
$content = Context::get('content');
|
||||
$args = Context::getRequestVars('style','widget_margin_left','widget_margin_right','widget_margin_bottom','widget_margin_top');
|
||||
$args = Context::getRequestVars('style','widget_padding_left','widget_padding_right','widget_padding_bottom','widget_padding_top');
|
||||
|
||||
$tpl = $this->transEditorContent($content, $args);
|
||||
|
||||
|
|
@ -152,8 +152,8 @@
|
|||
$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;
|
||||
$args->style = "float:left;overflow:hidden;padding:none;padding:none";
|
||||
$args->widget_padding_left = $args->widget_padding_top = $args->widget_padding_right = $args->widget_padding_bottom = 0;
|
||||
$none_widget_content = $oPageAdminController->transEditorContent($none_widget_code, $args);
|
||||
}
|
||||
*/
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
|
||||
$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="widgetOutput" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent">'.
|
||||
'<div class="widgetSetup"></div>'.
|
||||
'<div class="widgetCopy"></div>'.
|
||||
'<div class="widgetSize"></div>'.
|
||||
|
|
@ -255,7 +255,7 @@
|
|||
'<div class="widgetResize"></div>'.
|
||||
'<div class="widgetResizeLeft"></div>'.
|
||||
'<div class="widgetBorder">'.
|
||||
'<div style="margin:%s %s %s %s;">'.
|
||||
'<div style="padding:%s %s %s %s;">'.
|
||||
'%s'.
|
||||
'</div><div class="clear"></div>'.
|
||||
'</div>'.
|
||||
|
|
@ -263,8 +263,8 @@
|
|||
'</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,
|
||||
$args->widget_padding_left, $args->widget_padding_right, $args->widget_padding_top, $args->widget_padding_bottom,
|
||||
$args->widget_padding_top, $args->widget_padding_right, $args->widget_padding_bottom, $args->widget_padding_left,
|
||||
$content,
|
||||
base64_encode($code)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue