var CommonSelectDialog=function(o,i){void 0==i&&alert("Dialog must defined"),this.opt=$.extend({limitMax:100,limitMin:1,dialogWidth:Math.min($(window).width(),940)+"px",dialogHeight:"90%",server:"/path/to/link/choose/dialog",callback:function(o){alert("选择了:"+o.join(","))}},o),this.dialog=i,this.runtime={dialog:null}};CommonSelectDialog.prototype.show=function(){var o=this;window.__commonSelectDialogItems=[],window.__commonSelectDialogItems_=[],this.runtime.dialog=this.dialog.dialog(this.opt.server,{width:this.opt.dialogWidth,height:this.opt.dialogHeight,closeCallback:function(){if(window.__commonSelectDialogItems.length)return window.__commonSelectDialogItems.length>o.opt.limitMax?void o.dialog.tipError("最多只能选择"+o.opt.limitMax+"个链接"):window.__commonSelectDialogItems.length<o.opt.limitMin?void o.dialog.tipError("最少选择"+o.opt.limitMin+"个链接"):void o.opt.callback(window.__commonSelectDialogItems,window.__commonSelectDialogItems_)}})},CommonSelectDialog.prototype.close=function(){this.dialog.dialogClose(this.runtime.dialog)},module.exports=CommonSelectDialog;