zul.fud.FileuploadDlg=zk.$extends(zul.wnd.Window,{getZclass:function(){return null==this._zclass?"z-window":this._zclass},cancel:function(b){var a=this.$f("fileupload");a&&(a._uplder.destroy(),b&&(zAu.send(new zk.Event(this,"onClose")),this.detach()))},submit:function(){this.cancel();zAu.send(new zk.Event(this,"onClose",!0));this.detach()}});
zul.fud.ModalFileViewer=zk.$extends(zk.Object,{updated:null,$init:function(b,a){this._uplder=b;a=a.replace(/\//g,"\\");a=a.substring(a.lastIndexOf("\\")+1,a.length);var c=b.id,h=this,e=b.getWidget(),d=e.$f("uploaded"),f=e.$o().max||0,k=zk.ajaxURI("/web/zk/img/progress2.gif",{resource:!0});a='<div id="'+c+'" style="min-height:16px;background:#F4F8FF;border: 1px solid #99AABD;font-family:arial,sans-serif;font-size: 11px;padding: 2px;color: #0F3B82;"><img style="float: left;" src="'+k+'"/><div id="'+
c+'-cnt"><a id="'+c+'-cancel" style="float: left;padding-left: 2px; color: #0366AC; font-weight: bold;cursor: pointer;">'+msgzul.UPLOAD_CANCEL+" </a>&nbsp;&nbsp;&nbsp;"+a+'</div><div style="padding-left: 24px">'+msgzk.FILE_SIZE+'&nbsp;&nbsp;<span id="'+c+'-sent">0</span> of <span id="'+c+'-total">0</span></div></div>';d.setVisible(!0);jq(d).append(a);0<f&&f<=d.$n().childNodes.length&&d.$f("fileupload").setVisible(!1);this.viewer=jq("#"+c)[0];jq("#"+c+"-cancel").click(function(){e.$f("submit").revert();
if(h._finish){var g=jq("#"+c);g=g.parent().children().index(g[0]);zAu.send(new zk.Event(e.$o(),"onRemove",g));jq(h.viewer).remove()}else b.cancel();0<f&&f>d.$n().childNodes.length&&d.$f("fileupload").setVisible(!0)})},update:function(b,a){jq("#"+this._uplder.id+"-sent").html(Math.round(a/1024*b/100)+msgzk.KBYTES);this.updated||(this.updated=!0,jq("#"+this._uplder.id+"-total").html(Math.round(a/1024)+msgzk.KBYTES))},destroy:function(b){this._finish||((this._finish=b)?(jq("#"+this._uplder.id+"-sent").parent().remove(),
jq("#"+this._uplder.id)[0].firstChild.src=zk.ajaxURI("/web/zk/img/attachment.gif",{resource:!0})):jq(this.viewer).remove())}});
