merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -42,23 +42,20 @@ function doStartPageModify(zoneID, module_srl) {
// 위젯 크기/여백 조절 레이어를 가장 밖으로 뺌
jQuery('#tmpPageSizeLayer')
.attr('id', 'pageSizeLayer')
.css({position:'absolute',left:0,top:0})
.hide()
.appendTo('body')
.hide()
.attr('id', 'pageSizeLayer')
.css({position:'fixed'})
.before('<div class="x_modal-backdrop" />')
.find('>form')
.submit(function(){ doApplyWidgetSize(this); return false; });
// 모든 위젯들의 크기를 정해진 크기로 맞춤
doFitBorderSize();
// 드래그와 리사이즈와 관련된 이벤트 리스너 생성
xAddEventListener(document.getElementById('zonePageContent'), "click",doCheckWidget);
xAddEventListener(document.getElementById('zonePageContent'), "mousedown",doCheckWidgetDrag);
xAddEventListener(document.getElementById('zonePageContent'), 'mouseover',widgetSetup);
}
// 내용 모두 삭제
function removeAllWidget() {
if(!confirm(confirm_delete_msg)) return;
@ -213,9 +210,6 @@ function doSyncPageContent() {
}
if(typeof(editorStart)!='undefined') editorStart(1, "module_srl", "content", false, 400 );
//editor_upload_start(1);
//setFixedPopupSize();
}
// 부모창에 위젯을 추가
@ -263,7 +257,7 @@ function addContentWidget(fo_obj) {
'<button type="button" class="widgetResize"></button>'+
'<button type="button" class="widgetResizeLeft"></button>'+
'<div class="widgetBorder">'+
'<div style="padding:'+fo_obj.widget_padding_top.value+'px '+fo_obj.widget_padding_right.value+'px'+fo_obj.widget_padding_bottom.value+'px'+fo_obj.widget_padding_left.value+'px"></div>'+content+
'<div style="padding:'+fo_obj.widget_padding_top.value+'px '+fo_obj.widget_padding_right.value+'px '+fo_obj.widget_padding_bottom.value+'px '+fo_obj.widget_padding_left.value+'px"></div>'+content+
'</div>'+
'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;"></div>'+
'</div>';
@ -294,7 +288,6 @@ function doAddWidgetBox() {
'</div>'+
'</div>';
zonePageObj.innerHTML += tpl;
doFitBorderSize();
}
@ -304,31 +297,11 @@ function doAddWidget(fo) {
var idx = sel.selectedIndex;
var val = sel.options[idx].value;
var module_srl = fo.module_srl.value;
var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget', val).setQuery('module_srl', module_srl);
popopen(url,'GenerateWidgetCode');
}
// widgetBorder에 height를 widgetOutput와 맞춰줌
function doFitBorderSize() {
var obj_list = jQuery('.widgetBorer', zonePageObj).get();
for(var i=0;i<obj_list.length;i++) {
var obj = obj_list[i];
var height = xHeight(obj.parentNode);
if(height<3) height = 20;
xHeight(obj, height);
obj.parentNode.style.clear = '';
}
var obj_list = jQuery('.widgetBoxBorder', zonePageObj).get();
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;
var writedText = null;
var checkDocumentWrite = false;
@ -375,7 +348,7 @@ function doAddWidgetCode(widget_code) {
var cssfile = request_uri+cssfile;
if(typeof(document.createStyleSheet)=='undefined') {
var css ='<link rel="stylesheet" href="'+cssfile+'" type="text/css" charset="UTF-8" />';
var css ='<link rel="stylesheet" href="'+cssfile+'" />';
var dummy = xCreateElement("DIV");
xInnerHtml(dummy , css);
document.body.appendChild(dummy);
@ -432,20 +405,6 @@ function doAddWidgetCode(widget_code) {
}
checkDocumentWrite = false;
selectedWidget = null;
/*
//zoneObj.style.visibility = 'hidden';
zoneObj.style.opacity = 0.2;
zoneObj.style.filter = "alpha(opacity=20)";
// 위젯 추가후 페이지 리로딩
var tpl = getWidgetContent();
var fo_obj = get_by_id('pageFo');
fo_obj.content.value = tpl;
fo_obj.mid.value = current_mid;
fo_obj.submit();
*/
}
// 클릭 이벤트시 위젯의 수정/제거/이벤트 무효화 처리
@ -672,17 +631,43 @@ function doShowWidgetSizeSetup(px, py, obj) {
opts.background_y = pos[1];
}
}
layer.css('top', py+'px').show();
var _zonePageObj = jQuery(zonePageObj)
var zoneOffsetLeft = _zonePageObj.offset().left;
var zoneWidth = _zonePageObj.width();
if (px + layer.width() > zoneOffsetLeft + zoneWidth) px = zoneOffsetLeft + zoneWidth - layer.width() - 5;
layer.css('left', px+'px');
layer.show();
jQuery(function($){
var $psLayer = $('#pageSizeLayer');
var $backdrop = $('.x_modal-backdrop');
var ww = $(window).width();
var wh = $(window).height();
var pw = $psLayer.width();
var ph = $psLayer.height();
if(ww>pw && wh>ph){
$backdrop.show();
$psLayer.css({
position : 'fixed',
top : wh/2 - ph/2 + 'px',
left : ww/2 - pw/2 + 'px',
width : '700px'
});
}else{
$backdrop.hide();
$psLayer.css({
position : 'static',
top : 'auto',
left : 'auto',
width : 'auto'
});
}
});
jQuery.each(opts, function(key, val){
var el = form[0].elements[key];
if (el) el.value = val;
if (el)
{
el.value = val;
if(el.className.match(/\bcolor-indicator\b/))
{
el.style.background = el.value = '#'+el.value;
}
}
if (el.tagName.toLowerCase() == "select")
{
if(el.selectedIndex == -1) {
@ -695,11 +680,22 @@ function doShowWidgetSizeSetup(px, py, obj) {
}
function doHideWidgetSizeSetup() {
jQuery('#pageSizeLayer').hide();
//var layer = get_by_id("pageSizeLayer");
//layer.style.visibility = "hidden";
//layer.style.display = "none";
jQuery('#pageSizeLayer, .x_modal-backdrop, .jPicker.Container').hide();
}
jQuery(function($){
$(document).keydown(function(e){
var $jpicker = $('.jPicker.Container:visible');
if(e.which == 27 && !$jpicker.length){
doHideWidgetSizeSetup();
return false;
}else if(e.which == 27 && $jpicker.length){
$jpicker.hide();
return false;
}else{
return true;
}
});
});
function _getSize(value) {
if(!value) return 0;
@ -877,14 +873,6 @@ function showWidgetButton(name, obj) {
if(!widgetButton) return;
widgetButton.style.visibility = 'visible';
obj.insertBefore(widgetButton, obj.firstChild);
/*
var cobj = obj.firstChild;
while(cobj) {
cobj = cobj.nextSibling;
}
obj.appendChild(widgetButton);
*/
}
function widgetSetup(evt) {
@ -900,12 +888,6 @@ function widgetSetup(evt) {
restoreWidgetButtons();
return;
}
/*
if(!obj || typeof(obj.className)=='undefined' || obj.className != 'widgetOutput') {
restoreWidgetButtons();
return;
}
*/
obj = o.get(0);
var widget = o.attr('widget');
@ -939,7 +921,6 @@ var widgetDisappear = 0;
function widgetCreateTmpObject(obj) {
var id = obj.getAttribute('id');
tmpObj = xCreateElement('DIV');
tmpObj.id = id + '_tmp';
tmpObj.className = obj.className;
@ -947,15 +928,12 @@ function widgetCreateTmpObject(obj) {
tmpObj.style.margin= '0px';
tmpObj.style.padding = '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;
@ -1036,10 +1014,6 @@ function widgetDrag(tobj, dx, dy) {
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);
@ -1056,10 +1030,6 @@ function widgetDrag(tobj, dx, dy) {
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);
@ -1096,7 +1066,6 @@ function widgetDrag(tobj, dx, dy) {
if(next1) next1.parentNode.insertBefore(tobj, next1);
if(next2) next2.parentNode.insertBefore(target_obj, next2);
doFitBorderSize();
widgetList = null;
return;
}
@ -1110,11 +1079,7 @@ function widgetDrag(tobj, dx, dy) {
var ll = parseInt(l,10) + parseInt(xWidth(p_tobj),10);
var tt = parseInt(t,10) + parseInt(xHeight(p_tobj),10);
if( (tobj.xDPX < l || tobj.xDPX > ll) || (tobj.xDPY < t || tobj.xDPY > tt) ) {
// zonePageObj.insertBefore(tobj, tobj.parentNode.parentNode.parentNode);
zonePageObj.insertBefore(tobj, jQuery(tobj).parents('div.widgetOutput[widget=widgetBox]').get(0));
doFitBorderSize();
return;
}
@ -1153,7 +1118,6 @@ function widgetDrag(tobj, dx, dy) {
// 이동을 멈춤
widgetManualEnd();
doFitBorderSize();
boxList = null;
return;
}
@ -1188,7 +1152,6 @@ function widgetDrag(tobj, dx, dy) {
if(next1) next1.parentNode.insertBefore(tobj, next1);
if(next2) next2.parentNode.insertBefore(target_obj, next2);
doFitBorderSize();
widgetList = null;
return;
}
@ -1213,33 +1176,6 @@ function widgetDisapearObject(obj, tobj) {
obj.parentNode.removeChild(obj);
widgetTmpObject[tobj.id] = null;
return;
/*
var it = 5;
var ib = 1;
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');
obj.parentNode.removeChild(obj);
widgetTmpObject[tobj.id] = null;
return;
}
ib -= 5;
x-=ldt;
y-=tdt;
xLeft(obj, x);
xTop(obj, y);
}, it/ib);
*/
}
// 마우스다운 이벤트 발생시 호출됨
@ -1305,10 +1241,7 @@ function widgetDragDisable(id) {
obj.dragStart = null;
obj.drag = null;
obj.dragEnd = null;
//obj.style.backgroundColor = obj.getAttribute('source_color');
xRemoveEventListener(obj, 'mousedown', widgetMouseDown, false);
return;
}