var dialog_tpl_css="",dialog_tpl_html="
{{if has_new}} {{LNG.update_auto_update}} {{else}} {{LNG.update_is_new}} {{/if}}
{{if has_new}}{{LNG.update_ignore}}{{/if}}
{{LNG.update_version_local}}:ver{{ver_local}} | {{LNG.update_version_newest}}:ver {{ver_new}} {{if has_new}}new{{/if}}
ver {{ver_new}} {{LNG.update_whats_new}}:

{{echo LNG.update_info}}

{{LNG.update_readmore}}
";define("app/update/main",[],function(e){var t="2.1",a=G.version,i="http://kalcaddle.com/download.html",s="http://static.kalcaddle.com/download/update/2.0-2.1.zip",o="http://kalcaddle.com/tools/state/index.php",n="kod_user_online",l=function(){var e=new Date;return parseInt(e.getTime()/1e3)},r=function(e,t,a){$.ajax({url:"./index.php?explorer/serverDownload&save_path="+t+"&url="+urlEncode2(e),dataType:"json",success:function(e){"function"==typeof a&&a(e)}})},c=function(e,t,a){$.ajax({url:"index.php?explorer/unzip&path_to="+urlEncode(t)+"&path="+urlEncode(e),success:function(e){"function"==typeof a&&a(e)}})},d=function(e,t){$.ajax({url:"index.php?explorer/pathDelete",type:"POST",dataType:"json",data:e,success:function(e){"function"==typeof t&&t(e)}})},p=function(){if(1==G.is_root){var e="check_version_dialog",t=$("."+e).find(".update_click"),a=$("."+e).find(".progress"),i=$("."+e).find(".ver_tips"),o=s,l=G.basic_path+"data/";G.basic_path,i.removeClass("ignore").html(LNG.update_downloading),t.addClass("hidden"),a.removeClass("hidden").fadeIn(300),r(o,l,function(e){if(e.code){var s=e.info,o='list=[{"type":"file","path":"'+urlEncode(s)+'"}]';return c(s,G.basic_path,function(e){return e.code?(d(o,function(){Cookie.del(n),a.addClass("hidden"),i.html(LNG.update_success),t.removeClass("hidden").unbind("click").removeClass("update_click").addClass("this").html(LNG.update_success),setTimeout(function(){FrameCall.goRefresh()},2e3)}),void 0):(a.addClass("hidden"),i.html(LNG.update_unzip_fail),t.removeClass("hidden").html(LNG.update_auto_update),void 0)}),void 0}a.addClass("hidden"),i.html(LNG.update_download_fail),t.removeClass("hidden").html(LNG.update_auto_update)})}},u=function(){var e="en";"zh_CN"==LNG.config.type&&(e="zh_CN");var t={en:{update_downloading:"Downloading...",update_download_fail:"Download failed",update_unzip_fail:"Unzip update failed",update_doing:"Updating",update_title:"Update",update_success:"Update successful",update_fail:"Update failed",update_auto_update:"Update Now",update_is_new:"Aredy is the newest",update_version_newest:"Newest Version",update_version_local:"Current Version",update_ignore:"Ignore",update_readmore:"Read more",update_whats_new:"What's New",update_info:"1.muti user
2.drag upload
3.zip/unzip
4.all path support
5.New editor
"},zh_CN:{update_downloading:"下载中...",update_download_fail:"下载失败",update_unzip_fail:"解压覆盖失败",update_doing:"更新中...",update_title:"更新提示",update_success:"更新成功!",update_fail:"更新失败!",update_auto_update:"自动更新",update_is_new:"已经是最新版",update_version_newest:"最新版本",update_version_local:"当前版本",update_ignore:"暂时忽略",update_readmore:"查看更多",update_whats_new:"更新说明",update_info:"1.文件夹拖拽完美实现
2.文件夹拖拽上传
3.解压缩优化
4.非服务器路径预览&下载支持
5.树目录中文问题修复
"}};for(var a in t[e])LNG[a]=t[e][a]},f=function(e){var s=parseFloat(t),o=parseFloat(a),n="kod_update_ignore_timeout",r=!1;s>o&&(r=!0);var c=function(){var e="check_version_dialog";if(0==$("."+e).length){u();var s=template.compile(dialog_tpl_html),o=dialog_tpl_css+s({loading_img:G.static_path+"/images/loading_simple.gif",LNG:LNG,has_new:r,readmore_href:i,ver_new:t,ver_local:a});art.dialog.through({id:e,simple:!0,top:"50%",resize:!1,width:330,title:LNG.update_title,padding:"0",fixed:!0,content:o}),$("."+e).hide().fadeIn(600).find(".update_click").unbind("click").bind("click",function(){p(),Cookie.del(n)}),$("."+e).find(".ignore").die("click").live("click",function(){Cookie.set(n,l()+432e3,8760),art.dialog.list[e].close()})}};e&&c(),r&&(void 0==Cookie.get(n)||Cookie.get(n)<=l())&&c()},h=function(){if(void 0==Cookie.get(n)){var t=o+"?is_root="+G.is_root+"&host="+urlEncode(G.app_host)+"&version="+a;e.async(t,function(){Cookie.set(n,"check-at-"+l(),120)})}},m=function(e){switch(e){case void 0:1==G.is_root&&f(!1),h();break;case"check":f(!0);break;default:}};return{todo:m}});