From 7e44880f93a193a4f0d66aa6067f307539dd1d9e Mon Sep 17 00:00:00 2001
From: "kohgylw@163.com"
Date: Mon, 18 May 2020 08:31:02 +0800
Subject: [PATCH] update to v1.0.32-release
---
kiftd-1.0.32-RELEASE.jar | Bin 358281 -> 358281 bytes
webContext/js/home.js | 15 +++++++++------
webContext/js/home.min.js | 4 ++--
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/kiftd-1.0.32-RELEASE.jar b/kiftd-1.0.32-RELEASE.jar
index 357ccc266306bc53eb0364a734a6ecdeaa8af6bf..e95538b3bbe7ed7147b19e5b8c0167eeb81c1570 100644
GIT binary patch
delta 8292
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
diff --git a/webContext/js/home.js b/webContext/js/home.js
index 2256431..a1fd072 100644
--- a/webContext/js/home.js
+++ b/webContext/js/home.js
@@ -1600,8 +1600,10 @@ function doupload(count) {
$("#filecount").text("(" + count + "/" + fcount + ")");// 显示当前进度
}
$("#uploadstatus").prepend(
- "" + fname + "[正在上传...]
");
+ ""
+ + fname.replace(/\'/g, ''').replace(/
/g, '>') + "[正在上传...]
");
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
var fd = new FormData();// 用于封装文件数据的对象
@@ -3275,10 +3277,11 @@ function iteratorImport(i, newFolderName) {
if (fcount > 1) {
$("#importcount").text("(" + (i + 1) + "/" + fcount + ")");// 显示当前进度
}
- $("#importstatus")
- .prepend(
- "" + fname + "[正在上传...]
");
+ $("#importstatus").prepend(
+ ""
+ + fname.replace(/\'/g, ''').replace(//g, '>') + "[正在上传...]
");
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
var fd = new FormData();// 用于封装文件数据的对象
diff --git a/webContext/js/home.min.js b/webContext/js/home.min.js
index 0eb669e..146d5f3 100644
--- a/webContext/js/home.min.js
+++ b/webContext/js/home.min.js
@@ -1,3 +1,3 @@
-function updateWinHeight(){window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight)}function changeFilesTableStyle(){var a=$(window).width();768>a?($("#filetableheadera").addClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").removeClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){return"mustLogin"==a?(window.location.href="prv/login.html",void 0):($("#serverOS").text(a),void 0)},error:function(){$("#serverOS").html("获取失败,点击重试")}})}function showFolderView(fid,targetId){loadingFolderView||(startLoading(),remainingLoadingRequest&&remainingLoadingRequest.abort(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){switch(endLoading(),result){case"ERROR":doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新");break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,originFolderView=$.extend(!0,{},folderView),totalFoldersOffset=folderView.foldersOffset,totalFilesOffset=folderView.filesOffset,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text(folderView.folder.folderCreator),$("#fim_folderCreationDate").text(folderView.folder.folderCreationDate),$("#fim_folderId").text(folderView.folder.folderId),updateTheFolderInfo(),folderView.foldersOffset>folderView.selectStep||folderView.filesOffset>folderView.selectStep?(showLoadingRemaininngBox(),loadingRemainingFolderView(targetId)):(hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}}))}function startLoading(){loadingFolderView=!0,$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){loadingFolderView=!1,$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled"),$("#vercode").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled"),$("#accountpwd").removeAttr("disabled"),$("#dologinButton").removeAttr("disabled"),$("#vercode").removeAttr("disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a,vercode:$("#vercode").val()},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden"),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"needsubmitvercode":$("#vercodebox").html(""),$("#vercodebox").removeClass("hidden"),$("#vercodebox").addClass("show");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过加密效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function getNewVerCode(){$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append(""+b.folderName+"")}):$("#parentFolderList").html("无"),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-home")):null!=a.keyWorld?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-search")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append(""),$("#tb2").append(""),"true"==a.allowChangePassword&&($("#tb").append(" "),$("#tb2").append(" "))):($("#tb").append(""),$("#tb2").append(""),"true"==a.allowSignUp&&($("#tb").append(" "),$("#tb2").append(" ")));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()"),checkAuth(b,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),a.enableDownloadZip&&checkAuth(b,"L")?$("#packageDownloadBox").html(""):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#stickFileButtonLi").removeClass("disabled"),$("#copyFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","cutFile()"),$("#copyFileButtonLi a").attr("onclick","copyFile()"),$("#stickFileButtonLi a").attr("onclick","stickFile()"),void 0!==checkedMovefiles&&checkedMovefiles.size>0?(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show")):($("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root"),subscribeNotice()}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f,g,h,i,j;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append(" | -- | -- | -- | -- |
"),b=a.authList,c=!1,d=!1,e=!1,f=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),g=a.folderList.length;g>0;g--)h=a.folderList[g-1],$("#foldertable").append(createNewFolderRow(h,c,d,f));for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],$("#foldertable").append(createFileRow(j,e,c,d,f))}function createFileRow(a,b,c,d,e){var f,g;if(a.fileName=a.fileName.replace(/\'/g,"'").replace(//g,">"),f=""+a.fileName+" | "+a.fileCreationDate+" | ","0"==a.fileSize?f+="<1MB | ":f=f+""+a.fileSize+"MB | ",f=f+""+a.fileCreator+" | ",b)switch(f=f+"",g=getSuffix(a.fileName)){case"mp4":f=f+"";break;case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":folderView.enableFFMPEG&&(f=f+"");break;case"pdf":f=f+"";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":f=f+"";break;case"mp3":case"wav":case"ogg":f=f+"";break;case"docx":f=f+"";break;case"txt":f=f+"";break;case"ppt":case"pptx":f=f+""}return c&&(f=f+""),d&&(f=f+""),e&&(f=f+""),b&&"true"==folderView.showFileChain&&(f=f+""),d||c||b||e||(f+="--"),f+=" |
"}function createNewFolderRow(a,b,c,d){a.folderName=a.folderName.replace(/\'/g,"'").replace(//g,">");var e=" | "+a.folderCreationDate+" | -- | "+a.folderCreator+" | ";return b&&(e=e+""),c&&(e=e+""),d&&(e=e+""),c||b||d||(e+="--"),e+=" |
"}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>128?showFolderAlert("提示:文件夹名称太长。"):c.test(a)||0==a.indexOf(".")?showFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");break;case"errorParameter":showFolderAlert("提示:参数不正确,创建文件夹失败。");break;case"cannotCreateFolder":showFolderAlert("提示:出现意外错误,可能未能创建文件夹。");break;case"nameOccupied":showFolderAlert("提示:该名称已被占用,请选取其他名称。");break;case"foldersTotalOutOfLimit":showFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中创建更多文件夹。");break;case"createFolderSuccess":$("#newFolderModal").modal("hide"),showFolderView(locationpath);break;default:showFolderAlert("提示:出现意外错误,可能未能创建文件夹。")}},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}}))}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html(""),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#cancelDeleteFolderBtn").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html(""),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>128?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)||0==b.indexOf(".")?showRFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}}))}function showRFolderAlert(a){$("#editfolderalert").addClass("alert"),$("#editfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#editfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),filenames=new Array,maxSize=0,maxFileIndex=0,i=0;imaxSize&&(maxSize=fs[i].size,maxFileIndex=i);namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist,maxSize:maxSize,maxFileIndex:maxFileIndex},url:"homeController/checkUploadFile.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"errorParameter":showUploadFileAlert("提示:参数不正确,无法开始上传");break;case"noAuthorized":showUploadFileAlert("提示:您的操作未被授权,无法开始上传");break;case"filesTotalOutOfLimit":showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,无法在其中上传更多文件。您可以尝试将其上传至其他文件夹内。");break;default:var resp=eval("("+result+")");"fileTooLarge"==resp.checkResult?showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传"):"hasExistsNames"==resp.checkResult?(repeList=resp.pereFileNameList,repeIndex=0,selectFileUpLoadModelStart()):"permitUpload"==resp.checkResult?doupload(1):showUploadFileAlert("提示:出现意外错误,无法开始上传")}},error:function(){showUploadFileAlert("提示:出现意外错误,无法开始上传")}})}else showUploadFileAlert("提示:您未选择任何文件,无法开始上传");else showUploadFileAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function selectFileUpLoadModelStart(){var a=originFolderView.authList;checkAuth(a,"D")?$("#uploadcoverbtn").show():$("#uploadcoverbtn").hide(),$("#selectFileUpLoadModelAlert").show(),$("#repeFileName").text(repeList[repeIndex])}function selectFileUpLoadModelEnd(a){if(null==repeModelList&&(repeModelList={}),repeModelList[$("#repeFileName").text()]=a,$("#selectFileUpLoadModelAlert").hide(),$("#selectFileUpLoadModelAsAll").prop("checked")){for(var b=repeIndex;b1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("fname",d),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){if(null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+d+"]上传失败。您可以尝试将其上传至其他文件夹内。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("未找到要上传的文件[失败]
")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").show(),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function abortUpload(){isUpLoading&&(isUpLoading=!1,null!=xhr&&xhr.abort()),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("正在生成..."),getDownloadFileId=a,getDownloadFileName=b,$("#downloadFileBox").html(""),$("#dlmbutton").attr("disabled",!1),$("#downloadModal").modal("show")}function dodownload(a){$("#dlmbutton").attr("disabled",!0),$("#downloadFileName").text("提示:准备开始下载,请稍候..."),setTimeout("$('#downloadModal').modal('hide');",800),window.location.href="homeController/downloadFile.do?fileId="+a}function showDeleteFileModel(a,b){$("#deleteFileBox").html(""),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html(""),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getResource/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function txtView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/"+a)}function pptView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getPPTView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)
-}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b");viewer=$(a),viewer.viewer({loop:!1,hidden:function(){viewer.data("viewer").destroy(),viewer=null}})}viewer.viewer("view",pvl.index),viewer.viewer("show",!0)}function createViewListByPage(){var a,b,c;if(null==viewer){for(a=document.createElement("ul"),b=(viewerPageIndex-1)*viewerPageSize,viewerPageIndex>1&&$(a).append(""),c=0;viewerPageSize>c&&c");viewerTotal>viewerPageIndex&&$(a).append(""),viewer=$(a),viewer.viewer({loop:!1,view:function(a){0==a.detail.index&&1!=viewerPageIndex?(viewerPageIndex--,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewerPageIndex>1?viewer.viewer("view",viewerPageSize):viewer.viewer("view",viewerPageSize-1)):(a.detail.index==viewerPageSize+1||a.detail.index==viewerPageSize&&1==viewerPageIndex)&&(viewerPageIndex++,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewer.viewer("view",1))},hidden:function(){viewer.data("viewer").destroy(),viewer.empty(),viewer=null}})}}function isShift(a){var b=window.event||a;return b.shiftKey?!0:!1}function checkfile(a,b){isShift(a)?$("#"+b).hasClass("info")?$("#"+b).removeClass("info"):$("#"+b).addClass("info"):($(".filerow").removeClass("info"),$("#"+b).addClass("info"))}function checkConsFile(a,b){var c,d,e;if(isShift(a)&&(c=$("#"+b),d=c.index(),e=$(".filerow.info:last").index(),-1!=e))if(d>e)for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.prev();else for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.next()}function getCheckedFilesAndFolders(){var b,c,d,e,a=new Object;for(a.size=0,b=new Array,c=new Array,d=$(".info").get(),e=0;e开始下载"),$("#dclmbutton").attr("disabled",!1)),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1),$("#downloadAllCheckedModal").modal("toggle")}}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0),$("#cancelDownloadAllCheckedBtn").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?($("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html(""),$("#deleteFileMessage").text("提示:确定要彻底删除这"+a.size+"项么?该操作不可恢复!")),$("#deleteFileModal").modal("toggle")}function deleteAllChecked(){var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==pingInt&&(pingInt=setInterval("ping()",6e4)),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("")}),ap.on("play",function(){$("#playOrPause").html("")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var i,ail=eval("("+result+")");for(i=ail.index;i",">"),ap.list.add(ail.as[i]);for(i=0;i",">"),ap.list.add(ail.as[i]);audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide")}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){if(loadingComplete&&!$("#sortByCD,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView),$("#sortByFN").removeClass(),-1==a?$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycd(){if(loadingComplete&&!$("#sortByFN,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){var d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),folderView.folderList.sort(function(b,c){var d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),showFolderTable(folderView),$("#sortByCD").removeClass(),-1==a?$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbyfs(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFS").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*(b.fileSize-c.fileSize)}),showFolderTable(folderView),$("#sortByFS").removeClass(),-1==a?$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycn(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByFS,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView),$("#sortByCN").removeClass(),-1==a?$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function showOriginFolderView(){loadingComplete&&($("#sortByFN,#sortByCD,#sortByFS,#sortByCN").hasClass("glyphicon glyphicon-hourglass")||($("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView),$("#sortByOR").removeClass()},0)))}function cutFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!1)}function copyFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!0)}function stickFile(){void 0!==checkedMovefiles&&checkedMovefiles.size>0&&(isCopy?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项复制到当前位置么?"),$("#moveFilesBox").html("")):($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("")),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#cancelMoveFilesBtn").attr("disabled",!1),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show"))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#cancelMoveFilesBtn").attr("disabled",!0);var method="MOVE";isCopy?($("#moveFilesMessage").text("提示:正在复制,请稍候..."),method="COPY"):$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath,method:method},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"confirmMoveFiles":strMoveOptMap={},sendMoveFilesReq();break;default:if(result.startsWith("duplicationFileName:")){repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);var authList=originFolderView.authList;checkAuth(authList,"D")?$("#movecoverbtn").show():$("#movecoverbtn").hide(),$("#selectFileMoveModelAlert").show()}else result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1))}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)repeIndexrepeIndex?repeIndexc;c++)b.test(originFolderView.folderList[c].folderName)&&screenedFoldrView.folderList.push(originFolderView.folderList[c]);for(c=0,d=originFolderView.fileList.length;d>c;c++)b.test(originFolderView.fileList[c].fileName)&&screenedFoldrView.fileList.push(originFolderView.fileList[c]);$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}}function selectInCompletePath(keyworld){return 0==keyworld.length?(showFolderView(locationpath),void 0):(startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:locationpath,keyworld:keyworld},url:"homeController/sreachInCompletePath.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")):"mustLogin"==result?window.location.href="prv/login.html":"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val("all:"+folderView.keyWorld),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text("--"),$("#fim_folderCreationDate").text("--"),$("#fim_folderId").text("--"),updateTheFolderInfo())},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}}),void 0)}function goBackToTop(){$("html,body").animate({scrollTop:0},"slow")}function getDownloadURL(){$.ajax({url:"externalLinksController/getDownloadKey.ajax",type:"POST",dataType:"text",data:{fId:getDownloadFileId},success:function(a){var b=window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+encodeURIComponent(getDownloadFileName.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?dkey="+a;$("#downloadHrefBox").html(""+b+"")},error:function(){$("#downloadHrefBox").html("获取失败,请检查网络状态或点此重新获取。")}})}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)},error:function(){null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}})}function isSupportWebkitdirectory(){var a=document.createElement("input");return"webkitdirectory"in a&&!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?!0:!1}function showUploadFolderModel(){if($("#importFolderAlert").hide(),$("#importFolderAlert").text(""),0==isImporting)if($("#folderpath").val(""),$("#importfolder").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importstatus").html(""),$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importcount").text(""),$("#importbutton").attr("disabled",!1),$("#importfoldertypelist").html(""),$("#selectFolderImportModelAlert").hide(),null!=account){$("#folderpath").attr("folderConstraintLevel",constraintLevel+""),$("#importfoldertype").text(folderTypes[constraintLevel]);for(var a=constraintLevel;a"+folderTypes[a]+"")}else $("#importfoldertypelist").append(""+folderTypes[0]+"");$("#importFolderModal").modal("show")}function checkimportpath(){$("#importfolder").click()}function getInputImport(){ifs=$("#importfolder")[0].files,ifs.length>0&&(importFolderName=ifs[0].webkitRelativePath.substring(0,ifs[0].webkitRelativePath.indexOf("/")),$("#folderpath").val(importFolderName))}function checkImportFolder(){var maxSize,maxFileIndex,i;if(0==isUpLoading&&0==isImporting)if(null!=ifs&&ifs.length>0){for($("#folderpath").attr("disabled",!0),$("#importFolderLevelBtn").attr("disabled",!0),$("#importbutton").attr("disabled",!0),$("#importFolderAlert").hide(),$("#importFolderAlert").text(""),isImporting=!0,maxSize=0,maxFileIndex=0,i=0;imaxSize&&(maxSize=ifs[i].size,maxFileIndex=i);$.ajax({url:"homeController/checkImportFolder.ajax",type:"POST",dataType:"text",data:{folderName:importFolderName,maxSize:maxSize,folderId:locationpath},success:function(result){var resJson=eval("("+result+")");switch(resJson.result){case"noAuthorized":showImportFolderAlert("提示:您的操作未被授权,无法开始上传");break;case"errorParameter":showImportFolderAlert("提示:参数不正确,无法开始上传。必须选择一个文件夹");break;case"mustLogin":window.location.href="prv/login.html";break;case"fileOverSize":showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");break;case"foldersTotalOutOfLimit":showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中上传更多文件夹。您可以尝试将其上传至其他文件夹内。");break;case"repeatFolder_Both":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").hide(),$("#selectFolderImportModelAlert").show();break;case"repeatFolder_coverOrBoth":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").show(),$("#selectFolderImportModelAlert").show();break;case"permitUpload":iteratorImport(0);break;default:showImportFolderAlert("提示:出现意外错误,无法开始上传")}},error:function(){showImportFolderAlert("提示:出现意外错误,无法开始上传")}})}else showImportFolderAlert("提示:您未选择任何文件夹,无法开始上传");else showImportFolderAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function showImportFolderAlert(a){isImporting=!1,$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importFolderAlert").show(),$("#importFolderAlert").text(a),$("#importbutton").attr("disabled",!1)}function importProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#importpros").width(b+"%"),$("#importpros").attr("aria-valuenow",""+b)}}function importAndCover(){$("#selectFolderImportModelAlert").hide(),$.ajax({url:"homeController/deleteFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName},dataType:"text",success:function(a){"deleteSuccess"==a?iteratorImport(0):showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")},error:function(){showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")}})}function importAndBoth(){$("#selectFolderImportModelAlert").hide();var fc=$("#folderpath").attr("folderConstraintLevel");$.ajax({url:"homeController/createNewFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName,folderConstraint:fc},dataType:"text",success:function(result){var resJson=eval("("+result+")");"success"==resJson.result?iteratorImport(0,resJson.newName):"foldersTotalOutOfLimit"==resJson.result?showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法上传同名文件夹并保留两者。您可以尝试将其上传至其他文件夹内。"):showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")},error:function(){showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")}})}function iteratorImport(a,b){var c,d,e,f,g;$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),c=ifs[a],d=ifs.length,e=$("#folderpath").attr("folderConstraintLevel"),null!=c?(f=c.webkitRelativePath,d>1&&$("#importcount").text("("+(a+1)+"/"+d+")"),$("#importstatus").prepend(""+f+"[正在上传...]
"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),g.append("originalFileName",f),b&&g.append("newFolderName",b),xhr.open("POST","homeController/doImportFolder.ajax",!0),xhr.upload.addEventListener("progress",importProgress,!1),xhr.send(g),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){var c,e;null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status?(c=xhr.responseText,"uploadsuccess"==c?($("#ils_"+a).text("[已完成]"),e=a+1,d>e?iteratorImport(e,b):(isImporting=!1,$("#folderpath").removeAttr("disabled"),$("#importFolderLevelBtn").removeAttr("disabled"),$("#importfolder").val(""),$("#folderpath").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importbutton").attr("disabled",!1),$("#importcount").text(""),$("#importstatus").text(""),$("#importFolderModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"foldersTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("未找到要上传的文件[失败]
"))}function abortImport(){isImporting&&(isImporting=!1,null!=xhr&&xhr.abort()),$("#importFolderModal").modal("hide"),showFolderView(locationpath)}function changeImportFolderType(a){$("#importfoldertype").text(folderTypes[a]),$("#folderpath").attr("folderConstraintLevel",a+"")}function doChangePassword(){var change_oldPassword,change_newPassword,change_reqNewPassword;return $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepasswordalertbox").hide(),change_oldPassword=$("#changepassword_oldpwd").val(),change_newPassword=$("#changepassword_newpwd").val(),change_reqNewPassword=$("#changepassword_reqnewpwd").val(),0==change_oldPassword.length?($("#changepassword_oldepwdbox").addClass("has-error"),$("#changepassword_oldpwd").focus(),void 0):0==change_newPassword.length?($("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_newpwd").focus(),void 0):0==change_reqNewPassword.length?($("#changepassword_reqnewpwdbox").addClass("has-error"),$("#changepassword_reqnewpwd").focus(),void 0):(isChangingPassword=!0,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!0),change_newPassword+""!=change_reqNewPassword+""?(showChangePasswordAlert("提示:两次输入的新密码不一致,请检查确认"),$("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_reqnewpwdbox").addClass("has-error"),void 0):($.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,changepwd_publicKeyInfo=eval("("+result+")"),changePasswordInfo='{oldPwd:"'+change_oldPassword+'",newPwd:"'+change_newPassword+'",time:"'+changepwd_publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(changepwd_publicKeyInfo.publicKey),encrypted=encrypt.encrypt(changePasswordInfo),sendChangePasswordInfo(encrypted)},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}}),void 0))}function sendChangePasswordInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doChangePassword.ajax",data:{encrypted:a,vercode:$("#changepassword_vercode").val()},success:function(a){switch($("#changepassword_vccodebox").hide(),isChangingPassword=!1,a){case"success":$("#changePasswordModal").modal("hide");break;case"mustlogin":showChangePasswordAlert("提示:登录已失效或尚未登录账户,请刷新并登陆账户");break;case"illegal":showChangePasswordAlert("提示:用户修改密码功能已被禁用,请求被拒绝");break;case"oldpwderror":showChangePasswordAlert("提示:旧密码输入错误,请求被拒绝"),$("#changepassword_oldepwdbox").addClass("has-error");break;case"needsubmitvercode":$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton").attr("disabled",!1),$("#changepassword_vccodebox").html(""),$("#changepassword_vccodebox").show(),isChangingPassword=!1;break;case"invalidnewpwd":showChangePasswordAlert("提示:密码修改失败,新密码不合法。新密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
+function updateWinHeight(){window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight)}function changeFilesTableStyle(){var a=$(window).width();768>a?($("#filetableheadera").addClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").removeClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){return"mustLogin"==a?(window.location.href="prv/login.html",void 0):($("#serverOS").text(a),void 0)},error:function(){$("#serverOS").html("获取失败,点击重试")}})}function showFolderView(fid,targetId){loadingFolderView||(startLoading(),remainingLoadingRequest&&remainingLoadingRequest.abort(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){switch(endLoading(),result){case"ERROR":doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新");break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,originFolderView=$.extend(!0,{},folderView),totalFoldersOffset=folderView.foldersOffset,totalFilesOffset=folderView.filesOffset,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text(folderView.folder.folderCreator),$("#fim_folderCreationDate").text(folderView.folder.folderCreationDate),$("#fim_folderId").text(folderView.folder.folderId),updateTheFolderInfo(),folderView.foldersOffset>folderView.selectStep||folderView.filesOffset>folderView.selectStep?(showLoadingRemaininngBox(),loadingRemainingFolderView(targetId)):(hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}}))}function startLoading(){loadingFolderView=!0,$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){loadingFolderView=!1,$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled"),$("#vercode").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled"),$("#accountpwd").removeAttr("disabled"),$("#dologinButton").removeAttr("disabled"),$("#vercode").removeAttr("disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a,vercode:$("#vercode").val()},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden"),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"needsubmitvercode":$("#vercodebox").html(""),$("#vercodebox").removeClass("hidden"),$("#vercodebox").addClass("show");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过加密效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function getNewVerCode(){$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append(""+b.folderName+"")}):$("#parentFolderList").html("无"),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-home")):null!=a.keyWorld?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-search")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append(""),$("#tb2").append(""),"true"==a.allowChangePassword&&($("#tb").append(" "),$("#tb2").append(" "))):($("#tb").append(""),$("#tb2").append(""),"true"==a.allowSignUp&&($("#tb").append(" "),$("#tb2").append(" ")));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()"),checkAuth(b,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),a.enableDownloadZip&&checkAuth(b,"L")?$("#packageDownloadBox").html(""):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#stickFileButtonLi").removeClass("disabled"),$("#copyFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","cutFile()"),$("#copyFileButtonLi a").attr("onclick","copyFile()"),$("#stickFileButtonLi a").attr("onclick","stickFile()"),void 0!==checkedMovefiles&&checkedMovefiles.size>0?(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show")):($("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root"),subscribeNotice()}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f,g,h,i,j;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append(" | -- | -- | -- | -- |
"),b=a.authList,c=!1,d=!1,e=!1,f=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),g=a.folderList.length;g>0;g--)h=a.folderList[g-1],$("#foldertable").append(createNewFolderRow(h,c,d,f));for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],$("#foldertable").append(createFileRow(j,e,c,d,f))}function createFileRow(a,b,c,d,e){var f,g;if(a.fileName=a.fileName.replace(/\'/g,"'").replace(//g,">"),f=""+a.fileName+" | "+a.fileCreationDate+" | ","0"==a.fileSize?f+="<1MB | ":f=f+""+a.fileSize+"MB | ",f=f+""+a.fileCreator+" | ",b)switch(f=f+"",g=getSuffix(a.fileName)){case"mp4":f=f+"";break;case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":folderView.enableFFMPEG&&(f=f+"");break;case"pdf":f=f+"";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":f=f+"";break;case"mp3":case"wav":case"ogg":f=f+"";break;case"docx":f=f+"";break;case"txt":f=f+"";break;case"ppt":case"pptx":f=f+""}return c&&(f=f+""),d&&(f=f+""),e&&(f=f+""),b&&"true"==folderView.showFileChain&&(f=f+""),d||c||b||e||(f+="--"),f+=" |
"}function createNewFolderRow(a,b,c,d){a.folderName=a.folderName.replace(/\'/g,"'").replace(//g,">");var e=" | "+a.folderCreationDate+" | -- | "+a.folderCreator+" | ";return b&&(e=e+""),c&&(e=e+""),d&&(e=e+""),c||b||d||(e+="--"),e+=" |
"}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>128?showFolderAlert("提示:文件夹名称太长。"):c.test(a)||0==a.indexOf(".")?showFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");break;case"errorParameter":showFolderAlert("提示:参数不正确,创建文件夹失败。");break;case"cannotCreateFolder":showFolderAlert("提示:出现意外错误,可能未能创建文件夹。");break;case"nameOccupied":showFolderAlert("提示:该名称已被占用,请选取其他名称。");break;case"foldersTotalOutOfLimit":showFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中创建更多文件夹。");break;case"createFolderSuccess":$("#newFolderModal").modal("hide"),showFolderView(locationpath);break;default:showFolderAlert("提示:出现意外错误,可能未能创建文件夹。")}},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}}))}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html(""),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#cancelDeleteFolderBtn").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html(""),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>128?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)||0==b.indexOf(".")?showRFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}}))}function showRFolderAlert(a){$("#editfolderalert").addClass("alert"),$("#editfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#editfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),filenames=new Array,maxSize=0,maxFileIndex=0,i=0;imaxSize&&(maxSize=fs[i].size,maxFileIndex=i);namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist,maxSize:maxSize,maxFileIndex:maxFileIndex},url:"homeController/checkUploadFile.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"errorParameter":showUploadFileAlert("提示:参数不正确,无法开始上传");break;case"noAuthorized":showUploadFileAlert("提示:您的操作未被授权,无法开始上传");break;case"filesTotalOutOfLimit":showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,无法在其中上传更多文件。您可以尝试将其上传至其他文件夹内。");break;default:var resp=eval("("+result+")");"fileTooLarge"==resp.checkResult?showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传"):"hasExistsNames"==resp.checkResult?(repeList=resp.pereFileNameList,repeIndex=0,selectFileUpLoadModelStart()):"permitUpload"==resp.checkResult?doupload(1):showUploadFileAlert("提示:出现意外错误,无法开始上传")}},error:function(){showUploadFileAlert("提示:出现意外错误,无法开始上传")}})}else showUploadFileAlert("提示:您未选择任何文件,无法开始上传");else showUploadFileAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function selectFileUpLoadModelStart(){var a=originFolderView.authList;checkAuth(a,"D")?$("#uploadcoverbtn").show():$("#uploadcoverbtn").hide(),$("#selectFileUpLoadModelAlert").show(),$("#repeFileName").text(repeList[repeIndex])}function selectFileUpLoadModelEnd(a){if(null==repeModelList&&(repeModelList={}),repeModelList[$("#repeFileName").text()]=a,$("#selectFileUpLoadModelAlert").hide(),$("#selectFileUpLoadModelAsAll").prop("checked")){for(var b=repeIndex;b1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d.replace(/\'/g,"'").replace(//g,">")+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("fname",d),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){if(null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+d+"]上传失败。您可以尝试将其上传至其他文件夹内。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("未找到要上传的文件[失败]
")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").show(),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function abortUpload(){isUpLoading&&(isUpLoading=!1,null!=xhr&&xhr.abort()),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("正在生成..."),getDownloadFileId=a,getDownloadFileName=b,$("#downloadFileBox").html(""),$("#dlmbutton").attr("disabled",!1),$("#downloadModal").modal("show")}function dodownload(a){$("#dlmbutton").attr("disabled",!0),$("#downloadFileName").text("提示:准备开始下载,请稍候..."),setTimeout("$('#downloadModal').modal('hide');",800),window.location.href="homeController/downloadFile.do?fileId="+a}function showDeleteFileModel(a,b){$("#deleteFileBox").html(""),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html(""),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getResource/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function txtView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/"+a)}function pptView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getPPTView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)
+}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b");viewer=$(a),viewer.viewer({loop:!1,hidden:function(){viewer.data("viewer").destroy(),viewer=null}})}viewer.viewer("view",pvl.index),viewer.viewer("show",!0)}function createViewListByPage(){var a,b,c;if(null==viewer){for(a=document.createElement("ul"),b=(viewerPageIndex-1)*viewerPageSize,viewerPageIndex>1&&$(a).append(""),c=0;viewerPageSize>c&&c");viewerTotal>viewerPageIndex&&$(a).append(""),viewer=$(a),viewer.viewer({loop:!1,view:function(a){0==a.detail.index&&1!=viewerPageIndex?(viewerPageIndex--,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewerPageIndex>1?viewer.viewer("view",viewerPageSize):viewer.viewer("view",viewerPageSize-1)):(a.detail.index==viewerPageSize+1||a.detail.index==viewerPageSize&&1==viewerPageIndex)&&(viewerPageIndex++,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewer.viewer("view",1))},hidden:function(){viewer.data("viewer").destroy(),viewer.empty(),viewer=null}})}}function isShift(a){var b=window.event||a;return b.shiftKey?!0:!1}function checkfile(a,b){isShift(a)?$("#"+b).hasClass("info")?$("#"+b).removeClass("info"):$("#"+b).addClass("info"):($(".filerow").removeClass("info"),$("#"+b).addClass("info"))}function checkConsFile(a,b){var c,d,e;if(isShift(a)&&(c=$("#"+b),d=c.index(),e=$(".filerow.info:last").index(),-1!=e))if(d>e)for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.prev();else for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.next()}function getCheckedFilesAndFolders(){var b,c,d,e,a=new Object;for(a.size=0,b=new Array,c=new Array,d=$(".info").get(),e=0;e开始下载"),$("#dclmbutton").attr("disabled",!1)),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1),$("#downloadAllCheckedModal").modal("toggle")}}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0),$("#cancelDownloadAllCheckedBtn").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?($("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html(""),$("#deleteFileMessage").text("提示:确定要彻底删除这"+a.size+"项么?该操作不可恢复!")),$("#deleteFileModal").modal("toggle")}function deleteAllChecked(){var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==pingInt&&(pingInt=setInterval("ping()",6e4)),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("")}),ap.on("play",function(){$("#playOrPause").html("")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var i,ail=eval("("+result+")");for(i=ail.index;i",">"),ap.list.add(ail.as[i]);for(i=0;i",">"),ap.list.add(ail.as[i]);audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide")}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){if(loadingComplete&&!$("#sortByCD,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView),$("#sortByFN").removeClass(),-1==a?$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycd(){if(loadingComplete&&!$("#sortByFN,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){var d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),folderView.folderList.sort(function(b,c){var d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),showFolderTable(folderView),$("#sortByCD").removeClass(),-1==a?$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbyfs(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFS").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*(b.fileSize-c.fileSize)}),showFolderTable(folderView),$("#sortByFS").removeClass(),-1==a?$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycn(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByFS,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView),$("#sortByCN").removeClass(),-1==a?$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function showOriginFolderView(){loadingComplete&&($("#sortByFN,#sortByCD,#sortByFS,#sortByCN").hasClass("glyphicon glyphicon-hourglass")||($("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView),$("#sortByOR").removeClass()},0)))}function cutFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!1)}function copyFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!0)}function stickFile(){void 0!==checkedMovefiles&&checkedMovefiles.size>0&&(isCopy?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项复制到当前位置么?"),$("#moveFilesBox").html("")):($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("")),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#cancelMoveFilesBtn").attr("disabled",!1),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show"))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#cancelMoveFilesBtn").attr("disabled",!0);var method="MOVE";isCopy?($("#moveFilesMessage").text("提示:正在复制,请稍候..."),method="COPY"):$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath,method:method},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"confirmMoveFiles":strMoveOptMap={},sendMoveFilesReq();break;default:if(result.startsWith("duplicationFileName:")){repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);var authList=originFolderView.authList;checkAuth(authList,"D")?$("#movecoverbtn").show():$("#movecoverbtn").hide(),$("#selectFileMoveModelAlert").show()}else result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1))}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)repeIndexrepeIndex?repeIndexc;c++)b.test(originFolderView.folderList[c].folderName)&&screenedFoldrView.folderList.push(originFolderView.folderList[c]);for(c=0,d=originFolderView.fileList.length;d>c;c++)b.test(originFolderView.fileList[c].fileName)&&screenedFoldrView.fileList.push(originFolderView.fileList[c]);$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}}function selectInCompletePath(keyworld){return 0==keyworld.length?(showFolderView(locationpath),void 0):(startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:locationpath,keyworld:keyworld},url:"homeController/sreachInCompletePath.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")):"mustLogin"==result?window.location.href="prv/login.html":"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val("all:"+folderView.keyWorld),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text("--"),$("#fim_folderCreationDate").text("--"),$("#fim_folderId").text("--"),updateTheFolderInfo())},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}}),void 0)}function goBackToTop(){$("html,body").animate({scrollTop:0},"slow")}function getDownloadURL(){$.ajax({url:"externalLinksController/getDownloadKey.ajax",type:"POST",dataType:"text",data:{fId:getDownloadFileId},success:function(a){var b=window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+encodeURIComponent(getDownloadFileName.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?dkey="+a;$("#downloadHrefBox").html(""+b+"")},error:function(){$("#downloadHrefBox").html("获取失败,请检查网络状态或点此重新获取。")}})}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)},error:function(){null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}})}function isSupportWebkitdirectory(){var a=document.createElement("input");return"webkitdirectory"in a&&!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?!0:!1}function showUploadFolderModel(){if($("#importFolderAlert").hide(),$("#importFolderAlert").text(""),0==isImporting)if($("#folderpath").val(""),$("#importfolder").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importstatus").html(""),$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importcount").text(""),$("#importbutton").attr("disabled",!1),$("#importfoldertypelist").html(""),$("#selectFolderImportModelAlert").hide(),null!=account){$("#folderpath").attr("folderConstraintLevel",constraintLevel+""),$("#importfoldertype").text(folderTypes[constraintLevel]);for(var a=constraintLevel;a"+folderTypes[a]+"")}else $("#importfoldertypelist").append(""+folderTypes[0]+"");$("#importFolderModal").modal("show")}function checkimportpath(){$("#importfolder").click()}function getInputImport(){ifs=$("#importfolder")[0].files,ifs.length>0&&(importFolderName=ifs[0].webkitRelativePath.substring(0,ifs[0].webkitRelativePath.indexOf("/")),$("#folderpath").val(importFolderName))}function checkImportFolder(){var maxSize,maxFileIndex,i;if(0==isUpLoading&&0==isImporting)if(null!=ifs&&ifs.length>0){for($("#folderpath").attr("disabled",!0),$("#importFolderLevelBtn").attr("disabled",!0),$("#importbutton").attr("disabled",!0),$("#importFolderAlert").hide(),$("#importFolderAlert").text(""),isImporting=!0,maxSize=0,maxFileIndex=0,i=0;imaxSize&&(maxSize=ifs[i].size,maxFileIndex=i);$.ajax({url:"homeController/checkImportFolder.ajax",type:"POST",dataType:"text",data:{folderName:importFolderName,maxSize:maxSize,folderId:locationpath},success:function(result){var resJson=eval("("+result+")");switch(resJson.result){case"noAuthorized":showImportFolderAlert("提示:您的操作未被授权,无法开始上传");break;case"errorParameter":showImportFolderAlert("提示:参数不正确,无法开始上传。必须选择一个文件夹");break;case"mustLogin":window.location.href="prv/login.html";break;case"fileOverSize":showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");break;case"foldersTotalOutOfLimit":showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中上传更多文件夹。您可以尝试将其上传至其他文件夹内。");break;case"repeatFolder_Both":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").hide(),$("#selectFolderImportModelAlert").show();break;case"repeatFolder_coverOrBoth":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").show(),$("#selectFolderImportModelAlert").show();break;case"permitUpload":iteratorImport(0);break;default:showImportFolderAlert("提示:出现意外错误,无法开始上传")}},error:function(){showImportFolderAlert("提示:出现意外错误,无法开始上传")}})}else showImportFolderAlert("提示:您未选择任何文件夹,无法开始上传");else showImportFolderAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function showImportFolderAlert(a){isImporting=!1,$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importFolderAlert").show(),$("#importFolderAlert").text(a),$("#importbutton").attr("disabled",!1)}function importProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#importpros").width(b+"%"),$("#importpros").attr("aria-valuenow",""+b)}}function importAndCover(){$("#selectFolderImportModelAlert").hide(),$.ajax({url:"homeController/deleteFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName},dataType:"text",success:function(a){"deleteSuccess"==a?iteratorImport(0):showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")},error:function(){showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")}})}function importAndBoth(){$("#selectFolderImportModelAlert").hide();var fc=$("#folderpath").attr("folderConstraintLevel");$.ajax({url:"homeController/createNewFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName,folderConstraint:fc},dataType:"text",success:function(result){var resJson=eval("("+result+")");"success"==resJson.result?iteratorImport(0,resJson.newName):"foldersTotalOutOfLimit"==resJson.result?showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法上传同名文件夹并保留两者。您可以尝试将其上传至其他文件夹内。"):showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")},error:function(){showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")}})}function iteratorImport(a,b){var c,d,e,f,g;$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),c=ifs[a],d=ifs.length,e=$("#folderpath").attr("folderConstraintLevel"),null!=c?(f=c.webkitRelativePath,d>1&&$("#importcount").text("("+(a+1)+"/"+d+")"),$("#importstatus").prepend(""+f.replace(/\'/g,"'").replace(//g,">")+"[正在上传...]
"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),g.append("originalFileName",f),b&&g.append("newFolderName",b),xhr.open("POST","homeController/doImportFolder.ajax",!0),xhr.upload.addEventListener("progress",importProgress,!1),xhr.send(g),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){var c,e;null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status?(c=xhr.responseText,"uploadsuccess"==c?($("#ils_"+a).text("[已完成]"),e=a+1,d>e?iteratorImport(e,b):(isImporting=!1,$("#folderpath").removeAttr("disabled"),$("#importFolderLevelBtn").removeAttr("disabled"),$("#importfolder").val(""),$("#folderpath").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importbutton").attr("disabled",!1),$("#importcount").text(""),$("#importstatus").text(""),$("#importFolderModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"foldersTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("未找到要上传的文件[失败]
"))}function abortImport(){isImporting&&(isImporting=!1,null!=xhr&&xhr.abort()),$("#importFolderModal").modal("hide"),showFolderView(locationpath)}function changeImportFolderType(a){$("#importfoldertype").text(folderTypes[a]),$("#folderpath").attr("folderConstraintLevel",a+"")}function doChangePassword(){var change_oldPassword,change_newPassword,change_reqNewPassword;return $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepasswordalertbox").hide(),change_oldPassword=$("#changepassword_oldpwd").val(),change_newPassword=$("#changepassword_newpwd").val(),change_reqNewPassword=$("#changepassword_reqnewpwd").val(),0==change_oldPassword.length?($("#changepassword_oldepwdbox").addClass("has-error"),$("#changepassword_oldpwd").focus(),void 0):0==change_newPassword.length?($("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_newpwd").focus(),void 0):0==change_reqNewPassword.length?($("#changepassword_reqnewpwdbox").addClass("has-error"),$("#changepassword_reqnewpwd").focus(),void 0):(isChangingPassword=!0,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!0),change_newPassword+""!=change_reqNewPassword+""?(showChangePasswordAlert("提示:两次输入的新密码不一致,请检查确认"),$("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_reqnewpwdbox").addClass("has-error"),void 0):($.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,changepwd_publicKeyInfo=eval("("+result+")"),changePasswordInfo='{oldPwd:"'+change_oldPassword+'",newPwd:"'+change_newPassword+'",time:"'+changepwd_publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(changepwd_publicKeyInfo.publicKey),encrypted=encrypt.encrypt(changePasswordInfo),sendChangePasswordInfo(encrypted)},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}}),void 0))}function sendChangePasswordInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doChangePassword.ajax",data:{encrypted:a,vercode:$("#changepassword_vercode").val()},success:function(a){switch($("#changepassword_vccodebox").hide(),isChangingPassword=!1,a){case"success":$("#changePasswordModal").modal("hide");break;case"mustlogin":showChangePasswordAlert("提示:登录已失效或尚未登录账户,请刷新并登陆账户");break;case"illegal":showChangePasswordAlert("提示:用户修改密码功能已被禁用,请求被拒绝");break;case"oldpwderror":showChangePasswordAlert("提示:旧密码输入错误,请求被拒绝"),$("#changepassword_oldepwdbox").addClass("has-error");break;case"needsubmitvercode":$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton").attr("disabled",!1),$("#changepassword_vccodebox").html(""),$("#changepassword_vccodebox").show(),isChangingPassword=!1;break;case"invalidnewpwd":showChangePasswordAlert("提示:密码修改失败,新密码不合法。新密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
break;case"error":showChangePasswordAlert("提示:密码修改失败,修改请求无法通过加密效验(可能是请求耗时过长导致的)");break;case"cannotchangepwd":showChangePasswordAlert("提示:密码修改失败,发生意外错误,请稍后重试或联系管理员");break;default:showChangePasswordAlert("提示:密码修改失败,发生未知错误")}},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}})}function showChangePasswordAlert(a){isChangingPassword=!1,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepasswordalertbox").show(),$("#changepasswordalertbox").text(a)}function changePasswordGetNewVerCode(){$("#changepassword_showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function getFileChain(a,b){$("#fileChainTextarea").text("正在获取……"),$("#copyChainBtn").attr("disabled",!0),$("#fileChainModal").modal("show"),$.ajax({type:"POST",dataType:"text",url:"homeController/getFileChainKey.ajax",data:{fid:a},success:function(a){switch(a){case"ERROR":$("#fileChainTextarea").text("提示:获取失败,请刷新页面或稍后再试。");break;case"mustlogin":window.location.href="prv/login.html";break;default:$("#fileChainTextarea").text(window.location.protocol+"//"+window.location.host+"/externalLinksController/chain/"+encodeURIComponent(b.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?ckey="+encodeURIComponent(a)),$("#copyChainBtn").attr("disabled",!1)}},error:function(){$("#fileChainTextarea").text("提示:获取失败,无法连接服务器。")}})}function copyFileChain(){node=document.getElementById("fileChainTextarea"),node.select(),document.execCommand("copy")}function showNoticeModal(){$("#noticeModal").modal("show")}function initNoticeModal(){$("#noticeModalBody").load("resourceController/getNoticeContext.do",function(){$("#noticeModalBody img").css("max-width","100%"),winHeight>=300?$("#noticeModalBody").css("max-height",winHeight-180+"px"):$("#noticeModalBody").css("max-height","300px"),noticeInited=!0,showNoticeModal(),showNoticeBtn()})}function subscribeNotice(){$.ajax({url:"resourceController/getNoticeMD5.ajax",data:{},type:"POST",dataType:"text",success:function(a){if(""!=a){var b=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)"));if(b){if(a==unescape(b[2]))return showNoticeBtn(),void 0}else if(b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),b&&a==unescape(b[2]))return showNoticeBtn(),void 0;initNoticeModal(),document.cookie="notice_md5="+escape(a)}},error:function(){alert("错误:无法从服务器获取公告信息,请尝试刷新页面。")}})}function showNoticeBtn(){$("#shownoticebox").removeClass("hidden"),$("#shownoticebox").addClass("show")}function showNotice(){noticeInited?showNoticeModal():initNoticeModal()}function loadingRemainingFolderView(targetId){var newfoldersOffset,newfilesOffset,loadingRemainingRate_folders,loadingRemainingRate_files,loadingRemainingRate;if(!remainingLoadingRequest){if(newfoldersOffset=0,newfilesOffset=0,folderView.foldersOffset-folderView.selectStep>0&&(newfoldersOffset=folderView.foldersOffset-folderView.selectStep),folderView.filesOffset-folderView.selectStep>0&&(newfilesOffset=folderView.filesOffset-folderView.selectStep),0>=newfoldersOffset&&0>=newfilesOffset)return originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId),void 0;loadingRemainingRate_folders=1,loadingRemainingRate_files=1,totalFoldersOffset>0&&(loadingRemainingRate_folders=(totalFoldersOffset-newfoldersOffset)/totalFoldersOffset),totalFilesOffset>0&&(loadingRemainingRate_files=(totalFilesOffset-newfilesOffset)/totalFilesOffset),loadingRemainingRate=(loadingRemainingRate_folders+loadingRemainingRate_files)/2,$("#loadingrate").text(parseInt(100*loadingRemainingRate)+"%"),remainingLoadingRequest=$.ajax({url:"homeController/getRemainingFolderView.ajax",data:{fid:locationpath,foldersOffset:newfoldersOffset,filesOffset:newfilesOffset},type:"POST",dataType:"text",success:function(result){switch(remainingLoadingRequest=null,result){case"ERROR":alert("错误:无法加载剩余文件列表,文件数据可能未显示完全,请刷新重试!"),hiddenLoadingRemaininngBox(),doFixedRow();break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView.foldersOffset=newfoldersOffset,folderView.filesOffset=newfilesOffset;var remainingFV=eval("("+result+")");updateFolderTable(remainingFV),updateTheFolderInfo(),folderView.foldersOffset>0||folderView.filesOffset>0?loadingRemainingFolderView(targetId):(originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(a,b){remainingLoadingRequest=null,hiddenLoadingRemaininngBox(),"abort"!=b&&alert("错误:无法连接服务器,文件列表加载被中断。请刷新重试!")}})}}function doFixedRow(a){a&&a.length>0&&($("#"+a).addClass("info"),$("html,body").animate({scrollTop:$("#"+a).offset().top-$(window).height()/2},"slow"))}function showLoadingRemaininngBox(){loadingComplete=!1,$("#loadingremaininngbox").addClass("show"),$("#loadingremaininngbox").removeClass("hidden"),$("#searchbtn").attr("disabled","disabled")}function hiddenLoadingRemaininngBox(){loadingComplete=!0,$("#loadingremaininngbox").removeClass("show"),$("#loadingremaininngbox").addClass("hidden"),$("#searchbtn").removeAttr("disabled")}function updateFolderTable(a){var g,h,i,j,b=folderView.authList,c=!1,d=!1,e=!1,f=!1;if(checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),a.folderList&&a.folderList.length>0)for(g=a.folderList.length;g>0;g--)h=a.folderList[g-1],folderContains(folderView.folderList,h.folderId)||(folderView.folderList.unshift(h),$("[iskfolder=true]:last").after(createNewFolderRow(h,c,d,f)));if(a.fileList&&a.fileList.length>0)for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],fileContains(folderView.fileList,j.fileId)||(folderView.fileList.unshift(j),$("#foldertable").append(createFileRow(j,e,c,d,f)))}function folderContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].folderId==b)return!0;return!1}function fileContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].fileId==b)return!0;return!1}function updateTheFolderInfo(){$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}function replaceAllQuotationMarks(a){return a.replace(/\"/g,'\\"')}var ap,zipTimer,folderView,originFolderView,fs,ifs,checkedMovefiles,isCopy,repeMap,strMoveOptMap,mRepeSize,constraintLevel,account,importFolderName,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,pingInt,loadingComplete,totalFoldersOffset,totalFilesOffset,remainingLoadingRequest,loadingFolderView,folderTypes,repeList,repeIndex,repeModelList,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,isImporting=!1,isChangingPassword=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:
单击:选中某一文件
Shift+单击:选中多个文件
Shift+双击:选中连续的文件
Shitf+A:选中/取消选中所有文件",noticeInited=!1;$(function(){window.onresize=function(){changeFilesTableStyle(),updateWinHeight()},changeFilesTableStyle(),getServerOS(),subscribeNotice();var a=document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)"));null!=a?showFolderView(unescape(a[2])):showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause()),null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){"disabled"!==$("#dologinButton").attr("disabled")&&($("#accountid").val(""),$("#accountpwd").val("")),$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&0==c.prop("disabled")&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b"+folderTypes[b]+"")}else $("#foldertypelist").append(""+folderTypes[0]+"")}),$("#newFolderModal").on("shown.bs.modal",function(){$("#foldername").focus()}),$("#uploadFileModal,#importFolderModal").on("hidden.bs.modal",function(){(isUpLoading||isImporting)&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#editfolderalert").removeClass("alert"),$("#editfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#editfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b"+folderTypes[b]+"");else $("#editfoldertypelist").append(""+folderTypes[0]+"")}),document.ondragover=function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)},document.ondrop=function(a){var b,c,d,e,f,g;if(a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1),null!=folderView.authList)if(checkAuth(folderView.authList,"U"))if(isUpLoading||isImporting)alert("提示:您正在执行另一项上传任务,请在上传完成后再试。");else if(window.ActiveXObject||"ActiveXObject"in window)alert("提示:IE浏览器不支持拖拽上传。您可以使用现代浏览器或将浏览模式切换为“极速模式”来体验该功能。");else{if(b=null!=a.dataTransfer?a.dataTransfer:window.event.dataTransfer,c=!0,void 0!==b.items)for(d=0;d0&&$("#stickFileButtonLi a").click();break;default:return!0}return!1}}}),$("#moveFilesModal").on("hidden.bs.modal",function(){checkedMovefiles=void 0,$("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""),$("#moveFilesBox").html("")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")}),updateWinHeight(),$(window).scroll(function(){$(this).scrollTop()>2*winHeight?$("#gobacktotopbox").removeClass("hidden"):$("#gobacktotopbox").addClass("hidden")}),$("#downloadURLCollapse").on("shown.bs.collapse",function(){getDownloadURL()}),$("#changePasswordModal").on("show.bs.modal",function(){isChangingPassword||($("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd").val(""),$("#changepasswordalertbox,#changepassword_vccodebox").hide())}),$("#changePasswordModal").on("shown.bs.modal",function(){isChangingPassword||$("#changepassword_oldpwd").focus()}),$("#noticeModal").on("show.bs.modal",function(){var b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));b?$("#dontShowSomeNoticeAt30Day").attr("checked","checked"):$("#dontShowSomeNoticeAt30Day").attr("checked",!1)}),$("#noticeModal").on("hidden.bs.modal",function(){var c,d,b=new Date;$("#dontShowSomeNoticeAt30Day").prop("checked")?(b.setTime(b.getTime()+2592e6),c=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)")),c?document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString():(c=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),c&&(document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString()))):(b.setTime(0),d=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),d&&(document.cookie="notice_md5_30=0;expires="+b.toUTCString()))})}),folderTypes=["公开的","仅小组","仅创建者"];
\ No newline at end of file