function setUpg(n,t,i){$("#"+t).toggleClass("hide",!n);$("#"+i).toggleClass("hide",n)}function ajaxFileUpload(){return confirm("该操作将会丢失现有数据，建议先备份系统后再进行还原。\n确定要用该备份文件还原系统吗？")?(setUpg(!0,"loading2","upBackup"),ajaxUpload($f("fileToUpload"),"get.aspx?action=upload","\\.(zip|rar)$",function(n){if(n){var t=n.files;t&&t.length>0?PageMethods.SysRestore(t[0],Restore_callback):setUpg(!1,"loading2","upBackup")}else setUpg(!1,"loading2","upBackup")}),!1):!1}function Restore_callback(n){n=eval("("+n+")");n.complete==!0?(winalert(n.msg),parent.location="default.aspx?src=login.aspx"):(alert(n.msg),setUpg(!1,"loading2","upBackup"))}function askRestore(){return confirm("确定用系统App_Data文件夹下的备份文件还原数据库吗？")&&(setUpg(!0,"loading2","upBackup"),__doPostBack("btnRestoreDb","")),!1}function toRestore(n){if(!confirm("该操作将会丢失现有数据，建议先备份系统后再进行还原。\n确定要用该备份文件还原系统吗？"))return!1;setUpg(!0,"loading2","upBackup");HideDialog("baks_popup");HideDialog("ab_popup");PageMethods.SysRestore(n,Restore_callback)}function toZipDb(){return confirm("确定要压缩数据库吗？")?(setUpg(!0,"loading3","btns3"),!0):!1}function dbZipped(){setUpg(!1,"loading3","btns3");alert("已成功压缩数据库！")}function dbRestored(n){setUpg(!1,"loading2","upBackup");n?alert(n):(winalert("数据库原成功！点击确定后重新进入。"),parent.location="default.aspx?src=login.aspx")}function doClean(){return hasSelected("options")?(setUpg(!0,"loading1","options"),!0):(alert("请至少选择一个选项！"),!1)}function doCleanComplete(n,t){alert(n);t&&$("#viewSysLog").hide();setUpg(!1,"loading1","options")}function autoBackupToggled(){var n=$("#ab_cbAutoBackup").prop("checked");$(":text,select,#ab_cbKeep,#ab_cbDbOnly","#ab_Body").prop("disabled",!n)}function preSave(){if($("#ab_cbAutoBackup").prop("checked")){if($("#ab_tbTarget").val()=="")return showAndExit("必须输入备份文件的存储位置（服务器电脑上的路径，或网络共享文件夹路径）！");if($("#ab_tbFqcy").val()=="")return showAndExit("必须输入备份频率的时间量！")}return!0}function makeJsEditor(){CKEDITOR.replace("js_tbJs",{toolbar:[],height:390,autoUpdateElement:!0,resize_enabled:!1,removePlugins:"autogrow,elementspath",startupMode:"source",extraPlugins:"codemirror",codemirror:{lineNumbers:!1,mode:"text/javascript"}})}function makeCssEditor(){CKEDITOR.replace("css_tbCss",{toolbar:[],height:390,autoUpdateElement:!0,resize_enabled:!1,removePlugins:"autogrow,elementspath",startupMode:"source",extraPlugins:"codemirror",codemirror:{lineNumbers:!1,mode:"text/css"}})}function makeApiEditor(){CKEDITOR.replace("apidemo_tbApiDemo",{toolbar:[],height:390,autoUpdateElement:!0,resize_enabled:!1,removePlugins:"autogrow,elementspath",startupMode:"source",extraPlugins:"codemirror",codemirror:{lineNumbers:!1,mode:"text/html"}})}var defTab=0;$(function(){getUrlParam("restarted")=="1"&&(defTab=3,ShowMsgPop("系统已重新启动！"));$("#tabs").tabs({active:defTab,activate:function(){$("#ab_popup").is(":visible")&&HideDialog("ab_popup")}}).fadeIn(250);autoBackupToggled();$(document).keydown(function(n){var i=n.which||n.keyCode,t;return i==83&&n.ctrlKey&&(t=$("#js_btnOK,#css_btnOK").filter(":visible"),t.length>0)?(t.click(),CanelEvent(n)):!0})})