")
.attr("id", "MW_BACKOVER")
.css({
"background-color": "#ddd",
"position": "fixed",
"top": "0",
"left": "0",
"width": "100%",
"height": "100%",
"display": "block",
"opacity": 0.5,
'z-index':10
})
);
}
return function(opt){
opt=ST.extend(setting,opt);
//创建窗体容器对象
var w=_createWindow(opt);
if(!w){
return false;
}
windowObj={'obj':w,'subobj':null};
windowObj=_setWindowConstruct(windowObj,opt);
_setBackover(windowObj,opt)
_setWindowSubmitButton(windowObj,opt);
return {
getObject:function(){
return windowObj;
},
close:function(){
$(windowObj['obj']).remove();
$('#MW_BACKOVER').hide();
return this;
},
setContent:function(content){
$('#content_ui_'+opt.ID).html(content);
return this;
},
load:function(url,callback){
$('#content_ui_'+opt.ID).load(url+'&r='+Math.random(),callback);
return this;
}
}
}
}
return function(option){
Controller=construct();
return Controller(option)
}
})(),
//静态对话框
StaticWindow:(function(){
var Controller=null;
function _construct(opt){
setting={
ID:'',
left:0,
top:0,
width:200,
height:100,
css:'bgcfff',
parent:'',
buttonCss:'class03_tank_p',
buttonCssRep:null, //按钮附加参数
button:'sure,cancle',
buttonText:null, //按钮附加文本
layer:null
}
function _createWindow(opt){
if($('#'+opt.ID).length>0)
$('#'+opt.ID).remove();
if(opt.layer!=null){
opt.left=(opt.layer.pageX);
opt.top=(opt.layer.pageY+$(opt.layer.target).height());
}
var box=$('
').addClass(opt.css).css({'position':'absolute','height':opt.height,'width':opt.width,'border':'1px solid #ccc','z-index':100,'left':opt.left,'top':opt.top}).attr('id',opt.ID),
parent=opt.parent!=''?$(opt.parent):$('body');
parent.append(box);
return $('#'+opt.ID);
};
function _setWindowConstruct(obj,opt){
obj.html('')
obj.append($('
').attr('id','static_content_'+opt.ID))
}
function _setButton(obj,opt){
btn=opt.button.split(',');
p=$('
').addClass(opt.buttonCss).css({'position':'absolute','bottom':0,'width':(opt.width-13)})
if(opt.buttonCssRep!=null)
p.css(opt.buttonCssRep);
if(ST.Base.inArray(btn,'sure')>-1){
var sure=$('').addClass('btnqx01').html('确认').click(function(e){
if((opt.surebtn&&opt.surebtn(e)!==false)||opt.surebtn==null){
obj.remove();
}
})
p.append(sure)
}
if(ST.Base.inArray(btn,'cancle')>-1){
cancel=$('').addClass('btnqx01 marlr06').html('取消').click(function(e){
if((opt.cancelbtn&&opt.cancelbtn(e)!==false)||opt.cancelbtn==null){
obj.remove();
}
})
p.append(cancel);
}
if(opt.buttonText!=null)
p.append(opt.buttonText)
obj.append(p)
}
return function(opt){
opt=ST.extend(setting,opt);
var w=_createWindow(opt);
if(!w) return false;
_setWindowConstruct(w,opt);
_setButton(w,opt);
return{
close:function(){
w.remove()
},
setContent:function(content){
$('#static_content_'+opt.ID).html(content);
},
append:function(obj){
$('#static_content_'+opt.ID).append(obj);
},
load:function(url,callback){
$('#static_content_'+opt.ID).load(url,callback)
}
}
}
}
return function(option){
Controller=_construct();
return Controller(option);
}
})()
}
}