var LinkSelectDialog=function(i,t){void 0==t&&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(i){alert("选择了:"+i.join(","))}},i),this.dialog=t,this.runtime={dialog:null}};LinkSelectDialog.prototype.show=function(){var i=this;window.__linkSelectDialogPaths=[],this.runtime.dialog=this.dialog.dialog(this.opt.server,{width:this.opt.dialogWidth,height:this.opt.dialogHeight,closeCallback:function(){if(window.__linkSelectDialogPaths.length)return window.__linkSelectDialogPaths.length>i.opt.limitMax?void i.dialog.tipError("最多只能选择"+i.opt.limitMax+"个链接"):window.__linkSelectDialogPaths.length<i.opt.limitMin?void i.dialog.tipError("最少选择"+i.opt.limitMin+"个链接"):void i.opt.callback(window.__linkSelectDialogPaths)}})},LinkSelectDialog.prototype.close=function(){this.dialog.dialogClose(this.runtime.dialog)},module.exports=LinkSelectDialog;