function exiting(){var n=Sys.WebForms.PageRequestManager.getInstance();n.abortPostBack()}function gotStats(n){n=eval(n);$("#statis").html(n[0]);$("#spaceUsage").text(n[1])}function reTry(){$("#checking").text("正在联系服务器 ……");$("#btnTrigger").click()}function preOnlineUpdate(){return confirm("警告：\n1. 仅应对官方发行的标准版本应用更新，否则将丢失定制修改的特性；\n2. 建议更新前先备份系统；\n3. 更新后客户端浏览器须清空缓存（临时文件）。\n\n是否继续？")?($("#ddlVers").prop("disabled",!0),$("#btnUpgrade,#upload").hide(),progressEleId="prog_online",showStatus("正在准备 …"),!0):!1}function showStatus(n){$("#"+progressEleId).text(n).show()}function getUpgradeStatus(){$("#ddlVers").prop("disabled",!0);$("#btnUpgrade,#upload").hide();$.get("ajax.aspx",{action:"getDownloadStatus"},function(n){switch(n){case"-2":case"0":showStatus("正在准备 …");setTimeout(getUpgradeStatus,2e3);break;case"-1":resetStatus();alert("获取更新包失败！");break;case"1":showStatus("下载完毕，准备更新 …");PageMethods.doUpgrade(null);setTimeout(CheckUpgradeStatus,1200);break;default:showStatus("已下载 "+n+" …");setTimeout(getUpgradeStatus,2e3)}})}function resetStatus(){$("#ddlVers").prop("disabled",!1);$("#btnUpgrade,#upload,#lastPackage").show();$("#"+progressEleId).hide()}function preOfflineUpdate(){var n=$("#toUpload").val(),t;return n==""?showAndExit("请选择更新文件包！"):(t=new RegExp("\\.(zip|rar)$","i"),!t.test(n))?showAndExit("无效的更新文件包！"):confirm("警告：\n1. 仅应对官方发行的标准版本应用更新，否则将丢失定制修改的特性；\n2. 建议更新前先备份系统；\n3. 更新后客户端浏览器须清空缓存（临时文件）。\n\n确定要使用该更新包更新系统吗？")?(progressEleId="prog_offline",$("#btnUpgrade,#upload,#lastPackage").hide(),showStatus("正在上传文件包 …"),$.ajaxFileUpload({url:"get.aspx?action=upload",secureuri:!1,fileElementId:"toUpload",dataType:"json",success:function(n){if(typeof n.error!="undefined"&&n.error!="")alert(n.error);else{var t=n.files,i=null;typeof t!="undefined"&&t!=null&&t.length>0&&(i=t[0]);i==null?alert("文件上传失败！"):(showStatus("上传完毕，准备更新 …"),PageMethods.doUpgrade(i),setTimeout(CheckUpgradeStatus,1200))}hideLoading()},error:function(n,t,i){hideLoading();alert(i.name+":"+i.description)}}),!1):!1}function CheckUpgradeStatus(){upgraded||(jqxhr=$.ajax({url:"Temp/upgrading.txt",dataType:"text",cache:!1}).done(function(n){upgraded||(n=="1"?(resetStatus(),$("#loading").hide(),jqxhr.abort(),upgraded=!0,winalert("更新完毕！请清空浏览器缓存。现在将重新打开系统。"),parent.location.reload(!0)):showStatus(n+" …"))}),setTimeout(CheckUpgradeStatus,1200))}LoadEditor();var defTab=0,zclipInited=!1,progressEleId,jqxhr,upgraded=!1;$(function(){$("#tabs").tabs({active:defTab,activate:function(){(tryFitParent(),zclipInited||$("#btnCopy").is(":hidden"))||(bindCopy("btnCopy","tbMachineCode"),zclipInited=!0)}}).fadeIn(300);PageMethods.getStatis(gotStats);MakeEditor("textarea.ck","Normal",220,!1,!1);$(".inlineBlock img").hover(function(){$(this).toggleClass("over")});var n=Sys.WebForms.PageRequestManager.getInstance();n.add_initializeRequest(showLoading);n.add_endRequest(hideLoading)})