diff --git a/README.md b/README.md
index 6f15078b8bae7c273959b3e831428c6724825af3..2f3c30c51d5b3c918f0b5111e2c7ff6bc1c52250 100644
--- a/README.md
+++ b/README.md
@@ -77,19 +77,11 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
> 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
-### 新版本v1.0.17
-_本次更新加入了众多用户们一直期待的、较为实用的新功能,同时修复了一些已知问题,进一步增强kiftd的使用体验。推荐所有用户升级。_
-+ 增强在线视频播放——现在,kiftd内置了功能强大的ffmpeg开源多媒体解码引擎。得益于此,所有:mp4、mov、wmv、flv、mkv、webm和avi格式的视频均支持在线播放了。
-+ 全路径搜索——现在,用户除了能够像之前一样直接在本级文件夹内搜索外,还可以通过输入“all:关键字”的方式进行全路径搜索。对于文件数目较多且目录层次较深的用户而言,该功能能够令查找文件变得更加轻松。
-+ 可以分享的“下载链接”——现在,文件的下载链接将动态生成。使用生成的链接进行下载时,可以直接下载指定资源(而无需像之前一样必须登入账户或具备下载权限了)。这样一来,用户便能够将下载链接分享至他人以供下载。
-+ 自定义主界面缩放比例——对于使用高分辨率显示器的用户而言,可以通过自行调整主界面的缩放比例来找到最适合自己操作的显示效果,具体调整方法详见随程序附带的《kiftd说明文档》。
-+ 优化文件列表显示效果——当文件名称过长时会自动换行,避免在窄屏幕上浏览时可能导致的文件列表溢出问题。
-+ 新增了“返回顶部”按钮——当用户浏览得过于“深入”底部(超过2倍屏幕长度)时,该按钮能够将其快速带回页面顶部。
-+ 升级文件和文件夹的命名规则——文件和文件夹的名称不能以“.”开头,且不能包含下列任何字符之一:空格 / \ : * ? " < > | & $ (对于空格,推荐使用“_”代替)。该改进能够令用户更加自由地使用各种语言和字符来命名文件和文件夹。
-+ 修正了搜索框无法输入大写字母的BUG。
-+ 优化了在线播放器页面在移动端的表现效果。
-+ 修复了“打包下载”时,若存在文件夹可能导致文件夹结构压缩不正确的问题。
-+ 其他一些细节优化和问题修复的改进。
+### 新版本v1.0.18
+_本次更新提供更加完善的数据传输保护机制,进一步满足在公共复杂网络环境下的使用需求。推荐所有用户升级体验。_
++ 登录验证码机制——当某一账户发生一次及以上的密码输入错误情况后,该账户的后续密码输入尝试均必须经由随机生成的验证码进行验证,直至该账户的密码输入正确。该设计旨在防止账户的密码被暴力破解,以确保在公共网络环境下使用的安全性。
++ https访问支持——新版本提供了对https协议的支持。这是目前运用最为广泛、技术最为成熟的数据传输安全解决方案,允许用户使用更加安全的https协议进行访问和操作,确保在公共网络环境下用户和服务器之间的数据传输安全,防止数据被窃取或篡改。开启及设置方法请见《kiftd说明文档》。
++ 修复了当文件名称中存在单引号时无法对其进行操作的BUG。
> 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
diff --git a/kiftd-1.0.17-RELEASE.jar b/kiftd-1.0.18-RELEASE.jar
similarity index 77%
rename from kiftd-1.0.17-RELEASE.jar
rename to kiftd-1.0.18-RELEASE.jar
index 48fbc877892e67748d335d6c284af661d580efcc..408d934a35f626c2492abbf074f473e7d9f793a3 100644
Binary files a/kiftd-1.0.17-RELEASE.jar and b/kiftd-1.0.18-RELEASE.jar differ
diff --git "a/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" "b/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf"
index 070648e3ea71e3ee4d4e34ffe6c679f1bc535dab..76940f15ed139821395257cca38f7fbfe407c8c2 100644
Binary files "a/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" and "b/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" differ
diff --git a/webContext/css/overrall.css b/webContext/css/overrall.css
index fb95c91aed34978ad50712ccd69931864d6f262d..4e8e0eb3ec3102dcb037292db544f79d30a81634 100644
--- a/webContext/css/overrall.css
+++ b/webContext/css/overrall.css
@@ -100,3 +100,9 @@ td {
word-break: break-all;
word-wrap: break-all;
}
+
+.vercodeimg {
+ width: 100%;
+ max-height: 35px;
+ cursor: pointer
+}
\ No newline at end of file
diff --git a/webContext/css/overrall.min.css b/webContext/css/overrall.min.css
index 564173702019e4d1303e91fe41a4133ea30f2b2f..3feb3e27c308f289ba95bb5686f01b4130645111 100644
--- a/webContext/css/overrall.min.css
+++ b/webContext/css/overrall.min.css
@@ -1 +1 @@
-@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}.gobacktopbox{width:100%;height:30px;position:fixed;top:0;left:0}.gobacktopbutton{width:150px;height:35px;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70);-moz-opacity:.7;opacity:.7}td{word-break:break-all;word-wrap:break-all}
\ No newline at end of file
+@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}.gobacktopbox{width:100%;height:30px;position:fixed;top:0;left:0}.gobacktopbutton{width:150px;height:35px;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70);-moz-opacity:.7;opacity:.7}td{word-break:break-all;word-wrap:break-all}.vercodeimg{width:100%;max-height:35px;cursor:pointer}
\ No newline at end of file
diff --git a/webContext/home.html b/webContext/home.html
index 65adf2f76104e46b1000e29905432bd7a1a8744c..0b960993167157ec31a3cac0613a8ebeb9461839 100644
--- a/webContext/home.html
+++ b/webContext/home.html
@@ -173,6 +173,7 @@
placeholder="请输入密码……">
+
@@ -645,7 +646,7 @@
diff --git a/webContext/js/home.js b/webContext/js/home.js
index 543abefb1f6acf92f13f64c8764a6c85e8f91045..97ac0d087b663d83328a7f693646dd7c0565cc7a 100644
--- a/webContext/js/home.js
+++ b/webContext/js/home.js
@@ -60,6 +60,14 @@ $(function() {
$('#loginModal').on('hidden.bs.modal', function(e) {
$("#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(e) {
@@ -490,18 +498,23 @@ function dologin() {
// 发送加密文本
function sendLoginInfo(encrypted) {
+
$.ajax({
type : "POST",
dataType : "text",
url : "homeController/doLogin.ajax",
data : {
- encrypted : encrypted
+ encrypted : encrypted,
+ vercode : $("#vercode").val()
},
success : function(result) {
finishLogin();
$("#alertbox").removeClass("alert");
$("#alertbox").removeClass("alert-danger");
$("#alertbox").text("");
+ $("#vercodebox").html("");
+ $("#vercodebox").removeClass("show");
+ $("#vercodebox").addClass("hidden");
switch (result) {
case "permitlogin":
$("#accountidbox").removeClass("has-error");
@@ -523,6 +536,11 @@ function sendLoginInfo(encrypted) {
$("#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");
@@ -544,6 +562,11 @@ function sendLoginInfo(encrypted) {
});
}
+// 获取一个新的验证码
+function getNewVerCode(){
+ $("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
+}
+
// 注销操作
function dologout() {
$('#logoutModal').modal('hide');
diff --git a/webContext/js/home.min.js b/webContext/js/home.min.js
index fd0904a7e48dbe03f22cbfd37bea96e25528ec77..7b4e4be75f320efeab955428c3868ab801368718 100644
--- a/webContext/js/home.min.js
+++ b/webContext/js/home.min.js
@@ -1,2 +1,2 @@
-function changeFilesTableStyle(){var a=$(window).width();800>a?($("#filetableheadera").addClass("filetableheaderstyle"),$(".hiddenColumn").hide(),$(".rightbtn").hide(),$("#vicetbbox").show(),$("#filetableoptmenusreach").hide()):($("#filetableheadera").removeClass("filetableheaderstyle"),$(".hiddenColumn").show(),$(".rightbtn").show(),$("#vicetbbox").hide(),$("#filetableoptmenusreach").show()),768>a?($("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#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){"mustLogin"==a&&(window.location.href="login.html"),$("#serverOS").text(a)},error:function(){$("#serverOS").html("获取失败,点击重试")}})}function showFolderView(fid,targetId){startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")):"mustLogin"==result?window.location.href="login.html":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView),null!=targetId&&targetId.length>0&&($("#"+targetId).addClass("info"),$("html,body").animate({scrollTop:$("#"+targetId).offset().top-$(window).height()/2},"slow")))},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}})}function startLoading(){$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled","disabled"),$("#accountpwd").removeAttr("disabled","disabled"),$("#dologinButton").removeAttr("disabled","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},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),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"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 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("")):($("#tb").append(""),$("#tb2").append(""));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),$("#fileListDropDown li a").attr("href","javascript:void(0);"),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,"L")?$("#packageDownloadBox").html(""):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","startMoveFile()"),void 0!==checkedMovefiles&&checkedMovefiles.length>0&&($("#cutSignTx").text("粘贴("+checkedMovefiles.length+")"),$("#cutSignTx").addClass("cuted"))))}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")}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f;$("#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),$.each(a.folderList,function(a,b){b.folderName=b.folderName.replace("'","'");var e=" | "+b.folderCreationDate+" | -- | "+b.folderCreator+" | ";c&&(e=e+""),d&&(e=e+""),f&&(e=e+""),d||c||f||(e+="--"),e+=" |
",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var g,h;if(b.fileName=b.fileName.replace("'","'"),g=""+b.fileName+" | "+b.fileCreationDate+" | ","0"==b.fileSize?g+="<1MB | ":g=g+""+b.fileSize+"MB | ",g=g+""+b.fileCreator+" | ",e)switch(g=g+"",h=getSuffix(b.fileName)){case"mp4":case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":g=g+"";break;case"pdf":g=g+"";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":g=g+"";break;case"mp3":case"wav":case"ogg":g=g+"";break;case"docx":g=g+"";break;case"txt":g=g+""}c&&(g=g+""),d&&(g=g+""),f&&(g=g+""),d||c||e||f||(g+="--"),g+=" |
",$("#foldertable").append(g)}),changeFilesTableStyle()}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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>20?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){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showFolderAlert("提示:您的操作未被授权,创建文件夹失败。"):"errorParameter"==a?showFolderAlert("提示:参数不正确,创建文件夹失败。"):"cannotCreateFolder"==a?showFolderAlert("提示:出现意外错误,可能未能创建文件夹。"):"nameOccupied"==a?showFolderAlert("提示:该名称已被占用,请选取其他名称。"):"createFolderSuccess"==a?($("#newFolderModal").modal("hide"),showFolderView(locationpath)):($("#newFolderModal").modal("hide"),showFolderView(locationpath))},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),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").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="login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)}})}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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>20?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="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){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#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").text(""),$("#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").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),filenames=new Array,i=0;i1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("folderId",locationpath),e.append("uploadKey",uploadKey),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),xhr.onloadend=function(){if(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("[失败]")):(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").addClass("alert"),$("#uploadFileAlert").addClass("alert-danger"),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}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),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").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="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"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="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 abortUpload(){isUpLoading=!1,null!=xhr&&(xhr.abort(),$("#umbutton").attr("disabled",!1),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#filecount").text("")),$("#uploadfile").val(""),$("#filepath").val(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}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=/fileblocks/"+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 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
"):$(a).append("
");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
"):$(a).append("
");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)),$("#downloadAllCheckedModal").modal("toggle")}function downloadAllChecked(){$("#dclmbutton").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("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"):($("#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("提示:请求失败。无法完成压缩,请重试或告知管理员。")}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").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),$("#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="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),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 ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}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(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html(""),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):($("#cutSignTx").html("粘贴("+checkedMovefiles.size+")+V"),$("#cutSignTx").addClass("cuted")))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="login.html";else if("noAuthorized"==result)$("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1);else if("errorParameter"==result)$("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1);else if("cannotMoveFiles"==result)$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1);else if("confirmMoveFiles"==result)strMoveOptMap={},sendMoveFilesReq();else 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))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").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(),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="login.html":"notAccess"==result?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(),showFolderTable(folderView))},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){$("#downloadHrefBox").html(""+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"")},error:function(){$("#downloadHrefBox").html("获取失败,请检查网络状态或点此重新获取。")}})}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,uploadKey,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:
单击:选中某一文件
Shift+单击:选中多个文件
Shift+双击:选中连续的文件
Shitf+A:选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS(),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())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#accountid").val(""),$("#accountpwd").val("")}),$(".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)&&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").on("hidden.bs.modal",function(){isUpLoading&&($("#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($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").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)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;d+C"),$("#cutSignTx").removeClass("cuted"),$("#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)}),$("#folderInfoModal").on("show.bs.modal",function(){var b=folderView.folder;$("#fim_name").text(b.folderName),$("#fim_creator").text(b.folderCreator),$("#fim_folderCreationDate").text(b.folderCreationDate),$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")}),window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight),$(window).scroll(function(){$(this).scrollTop()>2*winHeight?$("#gobacktotopbox").removeClass("hidden"):$("#gobacktotopbox").addClass("hidden")}),$("#downloadURLCollapse").on("shown.bs.collapse",function(){getDownloadURL()})}),folderTypes=["公开的","仅小组","仅创建者"];
\ No newline at end of file
+function changeFilesTableStyle(){var a=$(window).width();800>a?($("#filetableheadera").addClass("filetableheaderstyle"),$(".hiddenColumn").hide(),$(".rightbtn").hide(),$("#vicetbbox").show(),$("#filetableoptmenusreach").hide()):($("#filetableheadera").removeClass("filetableheaderstyle"),$(".hiddenColumn").show(),$(".rightbtn").show(),$("#vicetbbox").hide(),$("#filetableoptmenusreach").show()),768>a?($("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#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){"mustLogin"==a&&(window.location.href="login.html"),$("#serverOS").text(a)},error:function(){$("#serverOS").html("获取失败,点击重试")}})}function showFolderView(fid,targetId){startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")):"mustLogin"==result?window.location.href="login.html":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView),null!=targetId&&targetId.length>0&&($("#"+targetId).addClass("info"),$("html,body").animate({scrollTop:$("#"+targetId).offset().top-$(window).height()/2},"slow")))},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新"),$("#publishTime").html("获取失败,请尝试刷新"),$("#parentlistbox").html("获取失败,请尝试刷新")}})}function startLoading(){$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled","disabled"),$("#accountpwd").removeAttr("disabled","disabled"),$("#dologinButton").removeAttr("disabled","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("")):($("#tb").append(""),$("#tb2").append(""));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),$("#fileListDropDown li a").attr("href","javascript:void(0);"),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,"L")?$("#packageDownloadBox").html(""):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","startMoveFile()"),void 0!==checkedMovefiles&&checkedMovefiles.length>0&&($("#cutSignTx").text("粘贴("+checkedMovefiles.length+")"),$("#cutSignTx").addClass("cuted"))))}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")}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f;$("#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),$.each(a.folderList,function(a,b){b.folderName=b.folderName.replace("'","'");var e=" | "+b.folderCreationDate+" | -- | "+b.folderCreator+" | ";c&&(e=e+""),d&&(e=e+""),f&&(e=e+""),d||c||f||(e+="--"),e+=" |
",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var g,h;if(b.fileName=b.fileName.replace("'","'"),g=""+b.fileName+" | "+b.fileCreationDate+" | ","0"==b.fileSize?g+="<1MB | ":g=g+""+b.fileSize+"MB | ",g=g+""+b.fileCreator+" | ",e)switch(g=g+"",h=getSuffix(b.fileName)){case"mp4":case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":g=g+"";break;case"pdf":g=g+"";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":g=g+"";break;case"mp3":case"wav":case"ogg":g=g+"";break;case"docx":g=g+"";break;case"txt":g=g+""}c&&(g=g+""),d&&(g=g+""),f&&(g=g+""),d||c||e||f||(g+="--"),g+=" |
",$("#foldertable").append(g)}),changeFilesTableStyle()}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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>20?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){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showFolderAlert("提示:您的操作未被授权,创建文件夹失败。"):"errorParameter"==a?showFolderAlert("提示:参数不正确,创建文件夹失败。"):"cannotCreateFolder"==a?showFolderAlert("提示:出现意外错误,可能未能创建文件夹。"):"nameOccupied"==a?showFolderAlert("提示:该名称已被占用,请选取其他名称。"):"createFolderSuccess"==a?($("#newFolderModal").modal("hide"),showFolderView(locationpath)):($("#newFolderModal").modal("hide"),showFolderView(locationpath))},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),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").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="login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)}})}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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>20?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="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){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#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").text(""),$("#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").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),filenames=new Array,i=0;i1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("folderId",locationpath),e.append("uploadKey",uploadKey),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),xhr.onloadend=function(){if(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("[失败]")):(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").addClass("alert"),$("#uploadFileAlert").addClass("alert-danger"),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}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),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").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="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"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="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 abortUpload(){isUpLoading=!1,null!=xhr&&(xhr.abort(),$("#umbutton").attr("disabled",!1),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#filecount").text("")),$("#uploadfile").val(""),$("#filepath").val(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}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=/fileblocks/"+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 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
"):$(a).append("
");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
"):$(a).append("
");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)),$("#downloadAllCheckedModal").modal("toggle")}function downloadAllChecked(){$("#dclmbutton").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("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"):($("#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("提示:请求失败。无法完成压缩,请重试或告知管理员。")}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").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),$("#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="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),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 ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}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(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html(""),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):($("#cutSignTx").html("粘贴("+checkedMovefiles.size+")+V"),$("#cutSignTx").addClass("cuted")))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="login.html";else if("noAuthorized"==result)$("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1);else if("errorParameter"==result)$("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1);else if("cannotMoveFiles"==result)$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1);else if("confirmMoveFiles"==result)strMoveOptMap={},sendMoveFilesReq();else 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))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").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(),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="login.html":"notAccess"==result?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(),showFolderTable(folderView))},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){$("#downloadHrefBox").html(""+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"")},error:function(){$("#downloadHrefBox").html("获取失败,请检查网络状态或点此重新获取。")}})}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,uploadKey,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:
单击:选中某一文件
Shift+单击:选中多个文件
Shift+双击:选中连续的文件
Shitf+A:选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS(),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())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#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)&&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").on("hidden.bs.modal",function(){isUpLoading&&($("#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($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").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)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;d+C"),$("#cutSignTx").removeClass("cuted"),$("#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)}),$("#folderInfoModal").on("show.bs.modal",function(){var b=folderView.folder;$("#fim_name").text(b.folderName),$("#fim_creator").text(b.folderCreator),$("#fim_folderCreationDate").text(b.folderCreationDate),$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")}),window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight),$(window).scroll(function(){$(this).scrollTop()>2*winHeight?$("#gobacktotopbox").removeClass("hidden"):$("#gobacktotopbox").addClass("hidden")}),$("#downloadURLCollapse").on("shown.bs.collapse",function(){getDownloadURL()})}),folderTypes=["公开的","仅小组","仅创建者"];
\ No newline at end of file
diff --git a/webContext/js/login.js b/webContext/js/login.js
index 2a0f39125db2838acf94d49848c3ef234f396b80..1162746d721911bd3994eefe2874dfea400e257c 100644
--- a/webContext/js/login.js
+++ b/webContext/js/login.js
@@ -11,6 +11,9 @@ $(function() {
return false;
}
});
+ $("#vercodebox").html("");
+ $("#vercodebox").removeClass("show");
+ $("#vercodebox").addClass("hidden");
// 打开页面自动聚焦账户输入框
$("#accountid").focus();
})
@@ -61,32 +64,51 @@ function sendLoginInfo(encrypted) {
dataType : "text",
url : "homeController/doLogin.ajax",
data : {
- encrypted : encrypted
+ encrypted : encrypted,
+ vercode : $("#vercode").val()
},
success : function(result) {
$("#alertbox").removeClass("alert");
$("#alertbox").removeClass("alert-danger");
$("#alertbox").text("");
- if (result == "permitlogin") {
+ $("#vercodebox").html("");
+ $("#vercodebox").removeClass("show");
+ $("#vercodebox").addClass("hidden");
+ switch (result) {
+ case "permitlogin":
$("#accountidbox").removeClass("has-error");
$("#accountpwdbox").removeClass("has-error");
window.location.href = "home.html";
- } else if (result == "accountnotfound") {
+ break;
+ case "accountnotfound":
$("#accountidbox").addClass("has-error");
$("#accountpwdbox").removeClass("has-error");
$("#alertbox").addClass("alert");
$("#alertbox").addClass("alert-danger");
$("#alertbox").text("提示:登录失败,账户不存在或未设置");
- } else if (result == "accountpwderror") {
+ break;
+ case "accountpwderror":
$("#accountpwdbox").addClass("has-error");
$("#accountidbox").removeClass("has-error");
$("#alertbox").addClass("alert");
$("#alertbox").addClass("alert-danger");
$("#alertbox").text("提示:登录失败,密码错误或未设置");
- } else {
+ 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("提示:无法登录,未知错误");
+ break;
}
},
error : function() {
@@ -95,4 +117,9 @@ function sendLoginInfo(encrypted) {
$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态");
}
});
+}
+
+//获取一个新的验证码
+function getNewVerCode(){
+ $("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
}
\ No newline at end of file
diff --git a/webContext/prv/login.html b/webContext/prv/login.html
index 16de8dc716c4ce1e35fef7f76e13480a52169e4b..def70a40a625899b710951d42077ad02b1ad421a 100644
--- a/webContext/prv/login.html
+++ b/webContext/prv/login.html
@@ -5,7 +5,9 @@
-
+
KIFT
@@ -60,9 +62,10 @@
+
-
+