为了更好的为您提供服务, 云效 邀请您使用持续交付相关功能。云效结合ECS、EDAS等服务为您提供完备的发布、部署、测试全研发流程,大大提升您的研发效率. 了解更多>

提交 c54fd6b0eab380534b010d7f34da16d3b968bf29

作者 kohgylw
1 个父辈 69080575

v1.0.23-release

... ... @@ -77,9 +77,14 @@ _瘜剁ift銝箄砲妍嚗摰蛹kiftd
77 77  
78 78 > 內嚗窈皜瘚蝵蜓憿萎誑蝖桐辣靽嚗撖潸△蝙
79 79  
80   -### 撣貉v1.0.22
81   -_甈⊥銝箇輕抒嚗耨憭鈭歇蝏憸誑隡蝙雿漣
82   -+ 隡蝥輸銋嚗iftd蝥輸銋憭迤蝖格蝷箔蝙TF-8蝻葉RC甇
  80 +### v1.0.23
  81 +_甈⊥鈭隞祆鈭嚗甇亙撩kiftd蝙雿漣
  82 ++ 靽格撖隞砍憭嚗霈曄蔭銝剖霂亙靘踹隞亥悟霈輸銝駁△銝靽格韐行敶
  83 ++ 瘞訾蛹皛∟雲撣iftd雿蛹蝥輯瘙隞亙霈曄蔭銝剖霂亙嚗kiftd撠蛹瘥葵辣銝芣偶銋韏嚗嚗靘輻撠iftd銝剔辣韏銋HTML憿菟蝑隞蔭撘
  84 ++ 瘜典韐行隞砍洵鈭嚗韐行蔭辣銝剜溶砲挽蝵桅★靘踹隞亥悟霈輸iftd銝剛瘜典韐行鈭祕蝏捆霂瑕iftd霂湔﹝
  85 ++ 霈曉P霈輸嚗iftd捂揭蔭辣銝剔霈曄蔭蝳迫捂摰P餈挪iftd
  86 ++ 摰敹縑捆敹捆銝剜憓鈭P扇敶靘踵撖寞★窈瘙皞葵
  87 ++ 銝駁△誨葉憓釣嚗靘踹隞仿蝷箇△皞誨蝥踵iftd鈭
83 88  
84 89 > 閬憭靽⊥嚗窈霈輸嚗 https://kohgylw.gitee.io/News.html
85 90  
... ... @@ -122,4 +127,4 @@ _甈⊥銝箇輕抒嚗耨憭鈭歇蝏憸誑隡
122 127  
123 128 _雿1-3瘚甈⊿蝞梧窈捂隡嚗撩撣准
124 129  
125   -2019-09-02 kohgylw@樴 雿
  130 +2018-2019 kohgylw@樴 雿
... ...
不能预览此文件类型
不能预览此文件类型
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="kohgylw.kiftd.server.mapper.PropertiesMapper">
  4 + <resultMap id="BaseResultMap" type="kohgylw.kiftd.server.model.Propertie">
  5 + <id column="propertie_key" jdbcType="VARCHAR" property="propertieKey" />
  6 + <result column="propertie_value" jdbcType="VARCHAR" property="propertieValue" />
  7 + </resultMap>
  8 +
  9 + <insert id="insert" parameterType="kohgylw.kiftd.server.model.Propertie">
  10 + INSERT INTO PROPERTIES
  11 + VALUES(#{propertieKey,jdbcType=VARCHAR},#{propertieValue,jdbcType=VARCHAR})
  12 + </insert>
  13 +
  14 + <update id="update" parameterType="kohgylw.kiftd.server.model.Propertie">
  15 + UPDATE PROPERTIES SET propertie_value =
  16 + #{propertieValue,jdbcType=VARCHAR} WHERE propertie_key =
  17 + #{propertieKey,jdbcType=VARCHAR}
  18 + </update>
  19 +
  20 + <delete id="deleteByKey" parameterType="java.lang.String">
  21 + DELETE FROM PROPERTIES WHERE
  22 + propertie_key = #{propertieKey,jdbcType=VARCHAR}
  23 + </delete>
  24 +
  25 + <select id="selectByKey" parameterType="java.lang.String"
  26 + resultMap="BaseResultMap">
  27 + SELECT * FROM PROPERTIES WHERE propertie_key =
  28 + #{propertieKey,jdbcType=VARCHAR}
  29 + </select>
  30 +</mapper>
0 31 \ No newline at end of file
... ...
1 1 <!doctype html>
2   -<!-- kiftd 主页面 by 青阳龙野 -->
  2 +<!-- 青阳网络文件传输系统 kiftd v1.0.23-RELEASE -->
  3 +<!-- 欢迎访问主界面 -->
  4 +<!-- by 青阳龙野(kohgylw@163.com) -->
3 5 <html>
4 6 <head>
5 7 <base href="/">
... ... @@ -428,9 +430,9 @@
428 430 onclick="checkimportpath()" onfocus="this.blur()"
429 431 placeholder="请点击选择要上传的文件夹……" folderConstraintLevel="0">
430 432 <div class="input-group-btn">
431   - <button id="importFolderLevelBtn" type="button" class="btn btn-default dropdown-toggle"
432   - data-toggle="dropdown" aria-haspopup="true"
433   - aria-expanded="false">
  433 + <button id="importFolderLevelBtn" type="button"
  434 + class="btn btn-default dropdown-toggle" data-toggle="dropdown"
  435 + aria-haspopup="true" aria-expanded="false">
434 436 &nbsp;<span id="importfoldertype">公开的</span>&nbsp;<span
435 437 class="caret"></span>
436 438 </button>
... ... @@ -466,8 +468,7 @@
466 468 </p>
467 469 <p>
468 470 <button id="importcoverbtn" type="button"
469   - class="btn btn-danger btn-sm"
470   - onclick="importAndCover()">覆盖</button>
  471 + class="btn btn-danger btn-sm" onclick="importAndCover()">覆盖</button>
471 472 <button type="button" class="btn btn-default btn-sm"
472 473 onclick="abortImport()">取消上传</button>
473 474 <button type="button" class="btn btn-default btn-sm"
... ... @@ -476,7 +477,8 @@
476 477 </div>
477 478 </div>
478 479 <div class="modal-footer">
479   - <button type="button" class="btn btn-default" onclick='abortImport()'>取消</button>
  480 + <button type="button" class="btn btn-default"
  481 + onclick='abortImport()'>取消</button>
480 482 <button id="importbutton" type='button' class='btn btn-primary'
481 483 onclick='checkImportFolder()'>开始上传</button>
482 484 </div>
... ... @@ -725,6 +727,86 @@
725 727 </div>
726 728 </div>
727 729 <!-- end 文件夹详情模态框 -->
  730 + <!-- 修改密码模态框 -->
  731 + <div class="modal fade bs-example-modal-sm" id="changePasswordModal"
  732 + tabindex="-1" role="dialog" aria-labelledby="changePasswordModelTitle">
  733 + <div class="modal-dialog" role="document">
  734 + <div class="modal-content">
  735 + <div class="modal-header">
  736 + <button type="button" class="close" data-dismiss="modal"
  737 + aria-label="Close">
  738 + <span aria-hidden="true">&times;</span>
  739 + </button>
  740 + <h4 class="modal-title" id="changePasswordModelTitle">
  741 + <span class="glyphicon glyphicon-edit"></span> 修改密码
  742 + </h4>
  743 + </div>
  744 + <div class="modal-body">
  745 + <form class="form-horizontal">
  746 + <div class="form-group" id="changepassword_oldepwdbox">
  747 + <label for="changepassword_oldpwd"
  748 + id="changepassword_oldpwdtitle" class="col-sm-3 control-label">旧密码:</label>
  749 + <div class="col-sm-9">
  750 + <input type="password" class="form-control"
  751 + id="changepassword_oldpwd" placeholder="请输入旧密码确认身份……">
  752 + </div>
  753 + </div>
  754 + <div class="form-group" id="changepassword_newpwdbox">
  755 + <label for="changepassword_newpwd"
  756 + id="changepassword_newpwdtitle" class="col-sm-3 control-label">新密码:</label>
  757 + <div class="col-sm-9">
  758 + <input type="password" class="form-control"
  759 + id="changepassword_newpwd" placeholder="请输入新密码……">
  760 + </div>
  761 + </div>
  762 + <div class="form-group" id="changepassword_reqnewpwdbox">
  763 + <label for="changepassword_reqnewpwd"
  764 + id="changepassword_reqnewpwdtitle"
  765 + class="col-sm-3 control-label">确认新密码:</label>
  766 + <div class="col-sm-9">
  767 + <input type="password" class="form-control"
  768 + id="changepassword_reqnewpwd" placeholder="请再次输入新密码……">
  769 + </div>
  770 + </div>
  771 + <div id="changepassword_vccodebox" class="form-group"></div>
  772 + <div id="changepasswordalertbox" class="alert alert-danger"
  773 + role="alert"></div>
  774 + </form>
  775 + </div>
  776 + <div class="modal-footer">
  777 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  778 + <button type="button" id="changePasswordButton"
  779 + class="btn btn-danger" onclick="doChangePassword()">立即修改</button>
  780 + </div>
  781 + </div>
  782 + </div>
  783 + </div>
  784 + <!-- end 改密 -->
  785 + <!-- 永久资源链接显示模态框 -->
  786 + <div class="modal fade" id="fileChainModal" tabindex="-1" role="dialog"
  787 + aria-labelledby="chainModalLabel">
  788 + <div class="modal-dialog modal-sm" role="document">
  789 + <div class="modal-content">
  790 + <div class="modal-header">
  791 + <button type="button" class="close" data-dismiss="modal"
  792 + aria-label="Close">
  793 + <span aria-hidden="true">&times;</span>
  794 + </button>
  795 + <h4 class="modal-title" id="chainModalLabel">
  796 + <span class="glyphicon glyphicon-link"></span> 资源链接
  797 + </h4>
  798 + </div>
  799 + <div class="modal-body">
  800 + <textarea id="fileChainTextarea" class="form-control" rows="3" readonly></textarea>
  801 + </div>
  802 + <div class="modal-footer">
  803 + <button id="copyChainBtn" type="button" class="btn btn-info" onclick="copyFileChain()">复制链接</button>
  804 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  805 + </div>
  806 + </div>
  807 + </div>
  808 + </div>
  809 + <!-- end 永久资源链接 -->
728 810 <!-- 返回顶部按钮(隐藏式) -->
729 811 <div id="gobacktotopbox" class="gobacktopbox text-center hidden">
730 812 <button type="button" onclick="goBackToTop()" class="gobacktopbutton">
... ...
... ... @@ -16,6 +16,7 @@ var constraintLevel;// 当前文件夹限制等级
16 16 var account;// 用户账户
17 17 var isUpLoading=false;// 是否正在执行上传操作
18 18 var isImporting=false;// 是否正在执行上传文件夹操作
  19 +var isChangingPassword=false;// 是否正在执行修改密码操作
19 20 var importFolderName;// 上传文件夹时保存文件夹名称
20 21 var xhr;// 文件或文件夹上传请求对象
21 22 var viewerPageSize = 15; // 显示图片页的最大长度,注意最好是奇数
... ... @@ -332,6 +333,22 @@ $(function() {
332 333 $('#downloadURLCollapse').on('shown.bs.collapse', function () {
333 334 getDownloadURL();
334 335 });
  336 +
  337 + // 开启修改密码模态框时初始化状态
  338 + $('#changePasswordModal').on('show.bs.modal', function(e) {
  339 + if(!isChangingPassword){
  340 + $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr('disabled', false);
  341 + $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error");
  342 + $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd").val("");
  343 + $("#changepasswordalertbox,#changepassword_vccodebox").hide();
  344 + }
  345 + });
  346 + // 并自动聚焦旧密码输入框
  347 + $('#changePasswordModal').on('shown.bs.modal', function(e) {
  348 + if(!isChangingPassword){
  349 + $("#changepassword_oldpwd").focus();
  350 + }
  351 + });
335 352 });
336 353  
337 354 // 根据屏幕大小增删表格显示内容
... ... @@ -371,13 +388,12 @@ function getServerOS() {
371 388 $.ajax({
372 389 type : "POST",
373 390 dataType : "text",
374   - data : {
375   -
376   - },
  391 + data : {},
377 392 url : "homeController/getServerOS.ajax",
378 393 success : function(result) {
379 394 if (result == "mustLogin") {
380   - window.location.href = "login.html";
  395 + window.location.href = "prv/login.html";
  396 + return;
381 397 }
382 398 $("#serverOS").text(result);
383 399 },
... ... @@ -405,7 +421,7 @@ function showFolderView(fid,targetId) {
405 421 $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
406 422 $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
407 423 } else if (result == "mustLogin") {
408   - window.location.href = "login.html";
  424 + window.location.href = "prv/login.html";
409 425 } else if(result == "NOT_FOUND") {
410 426 document.cookie = "folder_id=" + escape("root");// 归位记忆路径
411 427 window.location.href="/";
... ... @@ -567,7 +583,7 @@ function sendLoginInfo(encrypted) {
567 583 case "error":
568 584 $("#alertbox").addClass("alert");
569 585 $("#alertbox").addClass("alert-danger");
570   - $("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");
  586 + $("#alertbox").text("提示:登录失败,登录请求无法通过加密效验(可能是请求耗时过长导致的)");
571 587 break;
572 588 default:
573 589 $("#alertbox").addClass("alert");
... ... @@ -645,7 +661,7 @@ function showAccountView(folderView) {
645 661 $("#tb,#tb2").html("");
646 662 account=folderView.account;
647 663 if (folderView.account != null) {
648   - // 说明已经等陆,显示注销按钮
  664 + // 说明已经登录,显示注销按钮
649 665 $("#tb")
650 666 .append(
651 667 "<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#logoutModal'>注销 ["
... ... @@ -656,6 +672,14 @@ function showAccountView(folderView) {
656 672 "<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>注销 ["
657 673 + folderView.account
658 674 + "] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>");
  675 + if(folderView.allowChangePassword == 'true'){
  676 + $("#tb")
  677 + .append(
  678 + " <button class='btn btn-link rightbtn' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>");
  679 + $("#tb2")
  680 + .append(
  681 + " <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>");
  682 + }
659 683 } else {
660 684 // 说明用户未登录,显示登录按钮
661 685 $("#tb")
... ... @@ -664,6 +688,14 @@ function showAccountView(folderView) {
664 688 $("#tb2")
665 689 .append(
666 690 "<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>");
  691 + if(folderView.allowSignUp == 'true'){
  692 + $("#tb")
  693 + .append(
  694 + " <button class='btn btn-link rightbtn' onclick='window.location.href = \"/prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>");
  695 + $("#tb2")
  696 + .append(
  697 + " <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>");
  698 + }
667 699 }
668 700 var authList = folderView.authList;
669 701 // 对操作菜单进行初始化,根据权限显示可操作的按钮(并非约束)。
... ... @@ -949,6 +981,16 @@ function showFolderTable(folderView) {
949 981 + '"'
950 982 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
951 983 }
  984 + if (aL && folderView.showFileChain == 'true') {
  985 + fileRow = fileRow
  986 + + "<button onclick='getFileChain("
  987 + + '"'
  988 + + fi.fileId
  989 + + '","'
  990 + + fi.fileName
  991 + + '"'
  992 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>";
  993 + }
952 994 if (!aR && !aD && !aL && !aO) {
953 995 fileRow = fileRow + "--";
954 996 }
... ... @@ -996,7 +1038,7 @@ function createfolder() {
996 1038 url : "homeController/newFolder.ajax",
997 1039 success : function(result) {
998 1040 if (result == "mustLogin") {
999   - window.location.href = "login.html";
  1041 + window.location.href = "prv/login.html";
1000 1042 } else {
1001 1043 if (result == "noAuthorized") {
1002 1044 showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");
... ... @@ -1062,7 +1104,7 @@ function deleteFolder(folderId) {
1062 1104 url : "homeController/deleteFolder.ajax",
1063 1105 success : function(result) {
1064 1106 if (result == "mustLogin") {
1065   - window.location.href = "login.html";
  1107 + window.location.href = "prv/login.html";
1066 1108 } else {
1067 1109 if (result == "noAuthorized") {
1068 1110 $('#deleteFolderMessage').text("提示:您的操作未被授权,删除文件夹失败");
... ... @@ -1130,7 +1172,7 @@ function renameFolder(folderId) {
1130 1172 url : "homeController/renameFolder.ajax",
1131 1173 success : function(result) {
1132 1174 if (result == "mustLogin") {
1133   - window.location.href = "login.html";
  1175 + window.location.href = "prv/login.html";
1134 1176 } else {
1135 1177 if (result == "noAuthorized") {
1136 1178 showRFolderAlert("提示:您的操作未被授权,编辑失败。");
... ... @@ -1245,7 +1287,7 @@ function checkUploadFile() {
1245 1287 url : "homeController/checkUploadFile.ajax",
1246 1288 success : function(result) {
1247 1289 if (result == "mustLogin") {
1248   - window.location.href = "login.html";
  1290 + window.location.href = "prv/login.html";
1249 1291 } else {
1250 1292 if (result == "errorParameter") {
1251 1293 showUploadFileAlert("提示:参数不正确,无法开始上传");
... ... @@ -1499,7 +1541,7 @@ function deleteFile(fileId) {
1499 1541 url : "homeController/deleteFile.ajax",
1500 1542 success : function(result) {
1501 1543 if (result == "mustLogin") {
1502   - window.location.href = "login.html";
  1544 + window.location.href = "prv/login.html";
1503 1545 } else {
1504 1546 if (result == "noAuthorized") {
1505 1547 $('#deleteFileMessage').text("提示:您的操作未被授权,删除失败");
... ... @@ -1556,7 +1598,7 @@ function renameFile(fileId) {
1556 1598 url : "homeController/renameFile.ajax",
1557 1599 success : function(result) {
1558 1600 if (result == "mustLogin") {
1559   - window.location.href = "login.html";
  1601 + window.location.href = "prv/login.html";
1560 1602 } else {
1561 1603 if (result == "cannotRenameFile") {
1562 1604 showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。");
... ... @@ -1950,7 +1992,7 @@ function deleteAllChecked() {
1950 1992 url : "homeController/deleteCheckedFiles.ajax",
1951 1993 success : function(result) {
1952 1994 if (result == "mustLogin") {
1953   - window.location.href = "login.html";
  1995 + window.location.href = "prv/login.html";
1954 1996 } else {
1955 1997 if (result == "noAuthorized") {
1956 1998 $('#deleteFileMessage').text("提示:您的操作未被授权,删除失败");
... ... @@ -2217,7 +2259,7 @@ function doMoveFiles(){
2217 2259 url : "homeController/confirmMoveFiles.ajax",
2218 2260 success : function(result) {
2219 2261 if (result == "mustLogin") {
2220   - window.location.href = "login.html";
  2262 + window.location.href = "prv/login.html";
2221 2263 } else {
2222 2264 if (result == "noAuthorized") {
2223 2265 $('#moveFilesMessage').text("提示:您的操作未被授权,移动失败");
... ... @@ -2311,7 +2353,7 @@ function sendMoveFilesReq(){
2311 2353 url : "homeController/moveCheckedFiles.ajax",
2312 2354 success : function(result) {
2313 2355 if (result == "mustLogin") {
2314   - window.location.href = "login.html";
  2356 + window.location.href = "prv/login.html";
2315 2357 } else {
2316 2358 if (result == "noAuthorized") {
2317 2359 $('#moveFilesMessage').text("提示:您的操作未被授权,移动失败");
... ... @@ -2413,7 +2455,7 @@ function selectInCompletePath(keyworld){
2413 2455 $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
2414 2456 $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
2415 2457 } else if (result == "mustLogin") {
2416   - window.location.href = "login.html";
  2458 + window.location.href = "prv/login.html";
2417 2459 } else if(result == "notAccess"){
2418 2460 document.cookie = "folder_id=" + escape("root");
2419 2461 window.location.href="/";
... ... @@ -2588,7 +2630,7 @@ function checkImportFolder(){
2588 2630 showImportFolderAlert("提示:参数不正确,无法开始上传");
2589 2631 break;
2590 2632 case 'mustLogin':
2591   - window.location.href = "login.html";
  2633 + window.location.href = "prv/login.html";
2592 2634 break;
2593 2635 case 'fileOverSize':
2594 2636 showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");
... ... @@ -2796,4 +2838,175 @@ function abortImport(){
2796 2838 function changeImportFolderType(type){
2797 2839 $("#importfoldertype").text(folderTypes[type]);
2798 2840 $("#folderpath").attr("folderConstraintLevel",type+"");
  2841 +}
  2842 +
  2843 +// 修改密码
  2844 +function doChangePassword(){
  2845 + // 还原提示状态
  2846 + $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error");
  2847 + $("#changepasswordalertbox").hide();
  2848 + var change_oldPassword = $("#changepassword_oldpwd").val();
  2849 + var change_newPassword = $("#changepassword_newpwd").val();
  2850 + var change_reqNewPassword = $("#changepassword_reqnewpwd").val();
  2851 + // 输入非空检查
  2852 + if (change_oldPassword.length == 0) {
  2853 + $("#changepassword_oldepwdbox").addClass("has-error");
  2854 + $("#changepassword_oldpwd").focus();
  2855 + return;
  2856 + }
  2857 + if (change_newPassword.length == 0) {
  2858 + $("#changepassword_newpwdbox").addClass("has-error");
  2859 + $("#changepassword_newpwd").focus();
  2860 + return;
  2861 + }
  2862 + if (change_reqNewPassword.length == 0) {
  2863 + $("#changepassword_reqnewpwdbox").addClass("has-error");
  2864 + $("#changepassword_reqnewpwd").focus();
  2865 + return;
  2866 + }
  2867 + // 确认密码检查
  2868 + isChangingPassword=true;
  2869 + $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr('disabled', true);
  2870 + if (change_newPassword+"" != change_reqNewPassword+"") {
  2871 + showChangePasswordAlert("提示:两次输入的新密码不一致,请检查确认");
  2872 + $("#changepassword_newpwdbox").addClass("has-error");
  2873 + $("#changepassword_reqnewpwdbox").addClass("has-error");
  2874 + return;
  2875 + }
  2876 + // 以加密方式发送修改密码请求
  2877 + $.ajax({
  2878 + url : 'homeController/getPublicKey.ajax',
  2879 + type : 'POST',
  2880 + data : {},
  2881 + dataType : 'text',
  2882 + success : function(result) {
  2883 + // 获取公钥
  2884 + var changepwd_publicKeyInfo=eval("("+result+")");
  2885 + // 生成JSON对象格式的信息
  2886 + var changePasswordInfo = '{oldPwd:"' + change_oldPassword + '",newPwd:"'
  2887 + + change_newPassword + '",time:"' + changepwd_publicKeyInfo.time + '"}';
  2888 + var encrypt = new JSEncrypt();// 加密插件对象
  2889 + encrypt.setPublicKey(changepwd_publicKeyInfo.publicKey);// 设置公钥
  2890 + var encrypted = encrypt.encrypt(changePasswordInfo);// 进行加密
  2891 + sendChangePasswordInfo(encrypted);
  2892 + },
  2893 + error : function() {
  2894 + showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态");
  2895 + }
  2896 + });
  2897 +}
  2898 +
  2899 +// 将加密数据发送至服务器并显示操作结果
  2900 +function sendChangePasswordInfo(encrypted){
  2901 + $.ajax({
  2902 + type : "POST",
  2903 + dataType : "text",
  2904 + url : "homeController/doChangePassword.ajax",
  2905 + data : {
  2906 + encrypted : encrypted,
  2907 + vercode : $("#changepassword_vercode").val()
  2908 + },
  2909 + success : function(result) {
  2910 + $("#changepassword_vccodebox").hide();
  2911 + isChangingPassword=false;
  2912 + switch (result) {
  2913 + case "success":
  2914 + $('#changePasswordModal').modal('hide');
  2915 + break;
  2916 + case "mustlogin":
  2917 + showChangePasswordAlert("提示:登录已失效或尚未登录账户,请刷新并登陆账户");
  2918 + break;
  2919 + case "illegal":
  2920 + showChangePasswordAlert("提示:用户修改密码功能已被禁用,请求被拒绝");
  2921 + break;
  2922 + case "oldpwderror":
  2923 + showChangePasswordAlert("提示:旧密码输入错误,请求被拒绝");
  2924 + $("#changepassword_oldepwdbox").addClass("has-error");
  2925 + break;
  2926 + case "needsubmitvercode":
  2927 + $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton").attr('disabled', false);
  2928 + $("#changepassword_vccodebox").html("<label id='changepassword_vercodetitle' class='col-sm-5'><img id='changepassword_showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date()).getTime()+"' onclick='changePasswordGetNewVerCode()'></label><div class='col-sm-7'><input type='text' class='form-control' id='changepassword_vercode' placeholder='验证码……'></div>");
  2929 + $("#changepassword_vccodebox").show();
  2930 + isChangingPassword=false;
  2931 + break;
  2932 + case "invalidnewpwd":
  2933 + showChangePasswordAlert("提示:密码修改失败,新密码不合法。新密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
  2934 + break;
  2935 + case "error":
  2936 + showChangePasswordAlert("提示:密码修改失败,修改请求无法通过加密效验(可能是请求耗时过长导致的)");
  2937 + break;
  2938 + case "cannotchangepwd":
  2939 + showChangePasswordAlert("提示:密码修改失败,发生意外错误,请稍后重试或联系管理员");
  2940 + break;
  2941 + default:
  2942 + showChangePasswordAlert("提示:密码修改失败,发生未知错误");
  2943 + break;
  2944 + }
  2945 + },
  2946 + error : function() {
  2947 + showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态");
  2948 + }
  2949 + });
  2950 +}
  2951 +
  2952 +// 显示修改密码错误提示
  2953 +function showChangePasswordAlert(txt) {
  2954 + isChangingPassword=false;
  2955 + $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr('disabled', false);
  2956 + $("#changepasswordalertbox").show();
  2957 + $("#changepasswordalertbox").text(txt);
  2958 +}
  2959 +
  2960 +// (修改密码版本的)获取一个新的验证码
  2961 +function changePasswordGetNewVerCode(){
  2962 + $("#changepassword_showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
  2963 +}
  2964 +
  2965 +// 获取永久资源链接
  2966 +function getFileChain(fileId,fileName){
  2967 + $("#fileChainTextarea").text("正在获取……");
  2968 + $("#copyChainBtn").attr('disabled', true);
  2969 + $('#fileChainModal').modal('show');
  2970 + $.ajax({
  2971 + type : "POST",
  2972 + dataType : "text",
  2973 + url : "homeController/getFileChainKey.ajax",
  2974 + data : {
  2975 + fid : fileId
  2976 + },
  2977 + success : function(result) {
  2978 + switch (result) {
  2979 + case "ERROR":
  2980 + $("#fileChainTextarea").text("提示:获取失败,请刷新页面或稍后再试。");
  2981 + break;
  2982 + case "mustlogin":
  2983 + window.location.href = "prv/login.html";
  2984 + break;
  2985 + default:
  2986 + var getChainFileName=fileName.replace("#","%23").replace("%","%25").replace("?","%3F");
  2987 + $("#fileChainTextarea").text(encodeURI(window.location.protocol+"//"+window.location.host+"/externalLinksController/chain/"+getChainFileName+"?ckey=")+encodeURIComponent(result));
  2988 + $("#copyChainBtn").attr('disabled', false);
  2989 + break;
  2990 + }
  2991 + },
  2992 + error : function() {
  2993 + $("#fileChainTextarea").text("提示:获取失败,无法连接服务器。");
  2994 + }
  2995 + });
  2996 +}
  2997 +
  2998 +// 复制链接内容
  2999 +function copyFileChain(){
  3000 + let node = document.getElementById('fileChainTextarea');// input框
  3001 + let issafariBrowser = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
  3002 + if(issafariBrowser){
  3003 + node.setSelectionRange(0, 9999);
  3004 + }else{
  3005 + const range = document.createRange();
  3006 + range.selectNode(node);
  3007 + const selection = window.getSelection();
  3008 + if(selection.rangeCount > 0) selection.removeAllRanges();
  3009 + selection.addRange(range);
  3010 + }
  3011 + document.execCommand('copy');
2799 3012 }
2800 3013 \ No newline at end of file
... ...
1   -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("<a onclick='getServerOS()'>获取失败,点击重试</a>")}})}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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"mustLogin"==result?window.location.href="login.html":"NOT_FOUND"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}})}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("<label id='vercodetitle' class='col-sm-7'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-5'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>"),$("#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("<li><a href='javascript:void(0);' onclick='entryFolder(\""+b.folderId+'"'+")'>"+b.folderName+"</a></li>")}):$("#parentFolderList").html("<li class='disabled'><a>无</a></li>"),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("<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>")):($("#tb").append("<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"));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,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),checkAuth(b,"L")?$("#packageDownloadBox").html("<button class='btn btn-link navbar-btn' onclick='showDownloadAllCheckedModel()'><span class='glyphicon glyphicon-briefcase'></span> 打包下载</button>"):$("#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,g,h,i,j,k,l,m;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("<tr onclick='returnPF()'><td><button onclick='returnPF()' class='btn btn-link btn-xs'>../</button></td><td class='hiddenColumn'>--</td><td>--</td><td class='hiddenColumn'>--</td><td>--</td></tr>"),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],h.folderName=h.folderName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),i="<tr id='"+h.folderId+"' onclick='checkfile(event,"+'"'+h.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+h.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("+'"'+h.folderId+'"'+")' class='btn btn-link btn-xs'>/"+h.folderName+"</button></td><td class='hiddenColumn'>"+h.folderCreationDate+"</td><td>--</td><td class='hiddenColumn'>"+h.folderCreator+"</td><td>",c&&(i=i+"<button onclick='showDeleteFolderModel("+'"'+h.folderId+'","'+h.folderName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(i=i+"<button onclick='showRenameFolderModel("+'"'+h.folderId+'","'+h.folderName+'",'+h.folderConstraint+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>"),f&&(i=i+"<button onclick='showFolderView("+'"'+h.folderParent+'","'+h.folderId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),d||c||f||(i+="--"),i+="</td></tr>",$("#foldertable").append(i);for(j=a.fileList.length;j>0;j--){if(k=a.fileList[j-1],k.fileName=k.fileName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),l="<tr id="+k.fileId+" onclick='checkfile(event,"+'"'+k.fileId+'"'+")' ondblclick='checkConsFile(event,"+'"'+k.fileId+'"'+")' id='"+k.fileId+"' class='filerow'><td>"+k.fileName+"</td><td class='hiddenColumn'>"+k.fileCreationDate+"</td>","0"==k.fileSize?l+="<td>&lt;1MB</td>":l=l+"<td>"+k.fileSize+"MB</td>",l=l+"<td class='hiddenColumn'>"+k.fileCreator+"</td><td>",e)switch(l=l+"<button onclick='showDownloadModel("+'"'+k.fileId+'","'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>",m=getSuffix(k.fileName)){case"mp4":case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":l=l+"<button onclick='playVideo("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"pdf":l=l+"<button onclick='pdfView("+'"'+k.filePath+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":l=l+"<button onclick='showPicture("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";break;case"mp3":case"wav":case"ogg":l=l+"<button onclick='playAudio("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"docx":l=l+"<button onclick='docxView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"txt":l=l+"<button onclick='txtView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"ppt":case"pptx":l=l+"<button onclick='pptView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>"}c&&(l=l+"<button onclick='showDeleteFileModel("+'"'+k.fileId+'","'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(l=l+"<button onclick='showRenameFileModel("+'"'+k.fileId+'"'+","+'"'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),f&&(l=l+"<button onclick='showFolderView("+'"'+k.fileParentFolder+'","'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),d||c||e||f||(l+="--"),l+="</td></tr>",$("#foldertable").append(l)}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('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"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){"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("<button id='dmbutton' type='button' class='btn btn-danger' onclick='deleteFolder(\""+a+'"'+")'>删除</button>"),$("#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("<button type='button' class='btn btn-primary' onclick='renameFolder(\""+a+'"'+")'>修改</button>"),$("#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="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;b<fs.length;b++)a+=fs[b].name,b<fs.length-1&&(a+="、");fs.length<=1?$("#selectcount").text(""):$("#selectcount").text("(共"+fs.length+"个)"),$("#filepath").val(a)}function checkUploadFile(){var filenames,maxSize,maxFileIndex,i,namelist;if(0==isUpLoading&&0==isImporting)if(null!=fs&&fs.length>0){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;i<fs.length;i++)filenames[i]=fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi,"$1"),fs[i].size>maxSize&&(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="login.html";else if("errorParameter"==result)showUploadFileAlert("提示:参数不正确,无法开始上传");else if("noAuthorized"==result)showUploadFileAlert("提示:您的操作未被授权,无法开始上传");else{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;b<repeList.length;b++)repeModelList[repeList[b]]=a;doupload(1)}else repeIndex++,repeIndex<repeList.length?selectFileUpLoadModelStart():doupload(1)}function doupload(a){var c,d,e,b=fs.length;if($("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),c=fs[a-1],null!=c){if(d=c.name,b>1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend("<p>"+d+"<span id='uls_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),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("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<p>未找到要上传的文件<span id='uls_"+a+"'>[失败]</span></p>")}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=!1,null!=xhr&&xhr.abort(),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>"),getDownloadFileId=a,getDownloadFileName=b.replace("#","%23").replace("%","%25").replace("?","%3F"),$("#downloadFileBox").html("<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload(\""+a+'"'+")'>开始下载</button>"),$("#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("<button id='dfmbutton' type='button' class='btn btn-danger' onclick='deleteFile(\""+a+'"'+")'>删除</button>"),$("#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("<button type='button' class='btn btn-primary' onclick='renameFile(\""+a+'"'+")'>修改</button>"),$("#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="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=/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 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<pvl.pictureViewList.length;b++)pvl.pictureViewList[b].filePath.startsWith("homeController")?$(a).append("<li><img src='"+pvl.pictureViewList[b].filePath+"' alt='"+pvl.pictureViewList[b].fileName+"' /></li>"):$(a).append("<li><img src='fileblocks/"+pvl.pictureViewList[b].filePath+"' alt='"+pvl.pictureViewList[b].fileName+"' /></li>");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("<li><img src='css/left.png' alt='上一页' /></li>"),c=0;viewerPageSize>c&&c<pvl.pictureViewList.length-(viewerPageIndex-1)*viewerPageSize;c++)pvl.pictureViewList[b+c].filePath.startsWith("homeController")?$(a).append("<li><img src='"+pvl.pictureViewList[b+c].filePath+"' alt='"+pvl.pictureViewList[b+c].fileName+"' /></li>"):$(a).append("<li><img src='fileblocks/"+pvl.pictureViewList[b+c].filePath+"' alt='"+pvl.pictureViewList[b+c].fileName+"' /></li>");viewerTotal>viewerPageIndex&&$(a).append("<li><img src='css/right.png' alt='下一页' /></li>"),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<d.length;e++)"true"==d[e].getAttribute("iskfolder")?c.push(d[e].id):b.push(d[e].id),a.size++;return a.filesId=JSON.stringify(b),a.foldersId=JSON.stringify(c),a}function checkallfile(){$(".filerow.info").length==$(".filerow").length?$(".filerow").removeClass("info"):$(".filerow").addClass("info")}function showDownloadAllCheckedModel(){$("#downloadAllCheckedBox").html(""),$("#downloadAllCheckedLoad").text("");var a=getCheckedFilesAndFolders();0==a.size?$("#downloadAllCheckedName").html(checkFilesTip):($("#downloadAllCheckedName").text("提示:您确认要打包并下载这"+a.size+"项么?"),$("#downloadAllCheckedBox").html("<button id='dclmbutton' type='button' class='btn btn-primary' onclick='downloadAllChecked()'>开始下载</button>"),$("#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;
2   -"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("<button id='dfmbutton' type='button' class='btn btn-danger' onclick='deleteAllChecked()'>全部删除</button>"),$("#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==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("<span class='glyphicon glyphicon-play' aria-hidden='true'></span>")}),ap.on("play",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-pause' aria-hidden='true'></span>")})),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=0;i<ail.as.length;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;");ap.list.add(ail.as),ap.list.switch(ail.index),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(){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")?($("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")),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)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")?($("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")),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)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByFS").hasClass("glyphicon-triangle-bottom")?($("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize})):($("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileSize-b.fileSize})),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")?($("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")),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)}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("<button id='dmvfbutton' type='button' class='btn btn-danger' onclick='doMoveFiles()'>全部移动</button>"),$("#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+")<span class='pull-right'><span class='glyphicon glyphicon-arrow-up' aria-hidden='true'></span>+V</span>"),$("#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;)repeIndex<repeMap.repeFolders.length?strMoveOptMap[repeMap.repeFolders[repeIndex].folderId]=a:strMoveOptMap[repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileId]=a,repeIndex++;$("#selectFileMoveModelAlert").hide(),sendMoveFilesReq()}repeIndex<repeMap.repeFolders.length?strMoveOptMap[repeMap.repeFolders[repeIndex].folderId]=a:strMoveOptMap[repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileId]=a,repeIndex++,mRepeSize>repeIndex?repeIndex<repeMap.repeFolders.length?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileName):($("#selectFileMoveModelAlert").hide(),sendMoveFilesReq())}function sendMoveFilesReq(){var a=JSON.stringify(strMoveOptMap);$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,strOptMap:a,locationpath:locationpath},url:"homeController/moveCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1)):"errorParameter"==a?($("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"cannotMoveFiles"==a?($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"moveFilesSuccess"==a?($("#moveFilesModal").modal("hide"),showFolderView(locationpath)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").attr("disabled",!1)}})}function doSearchFile(){var a=$("#sreachKeyWordIn").val();0!=a.length?a.startsWith("all:")||a.startsWith("all:")?selectInCompletePath(a.substring(4)):(startLoading(),selectInThisPath(a),endLoading()):null!=folderView.keyWorld?showFolderView(locationpath):(screenedFoldrView=null,showOriginFolderView())}function selectInThisPath(a){var b,c,d;try{for(b=new RegExp(a+"+"),screenedFoldrView=$.extend(!0,{},originFolderView),screenedFoldrView.folderList=[],screenedFoldrView.fileList=[],c=0,d=originFolderView.folderList.length;d>c;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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"mustLogin"==result?window.location.href="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(),showFolderTable(folderView))},error:function(){endLoading(),doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}}),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("<a href='"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"'>"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"</a>")},error:function(){$("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>")}})}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.length;a++)$("#importfoldertypelist").append("<li><a onclick='changeImportFolderType("+a+")'>"+folderTypes[a]+"</a></li>")}else $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType(0)'>"+folderTypes[0]+"</a></li>");$("#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;i<ifs.length;i++)ifs[i].size>maxSize&&(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="login.html";break;case"fileOverSize":showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");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):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("<p>"+f+"<span id='ils_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),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("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("<p>未找到要上传的文件<span id='ils_"+a+"'>[失败]</span></p>"))}function abortImport(){isImporting=!1,null!=xhr&&xhr.abort(),$("#importFolderModal").modal("hide"),showFolderView(locationpath)}function changeImportFolderType(a){$("#importfoldertype").text(folderTypes[a]),$("#folderpath").attr("folderConstraintLevel",a+"")}var ap,zipTimer,folderView,originFolderView,fs,ifs,checkedMovefiles,constraintLevel,account,importFolderName,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,pingInt,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,isImporting=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<br /><br /><kbd>单击</kbd>:选中某一文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>单击</kbd></kbd>:选中多个文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>双击</kbd></kbd>:选中连续的文件<br /><br /><kbd><kbd>Shitf</kbd>+<kbd>A</kbd></kbd>:选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS();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(){$("#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.length;b++)$("#foldertypelist").append("<li><a onclick='changeNewFolderType("+b+")'>"+folderTypes[b]+"</a></li>")}else $("#foldertypelist").append("<li><a onclick='changeNewFolderType(0)'>"+folderTypes[0]+"</a></li>")}),$("#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.length;b++)$("#editfoldertypelist").append("<li><a onclick='changeEditFolderType("+b+")'>"+folderTypes[b]+"</a></li>");else $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType(0)'>"+folderTypes[0]+"</a></li>")}),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;d<b.items.length;d++)e=b.items[d],"file"===e.kind&&e.webkitGetAsEntry().isFile||(c=!1);else for(d=0;d<b.files.length;d++)if(f=df.files[d],f.type);else try{g=new FileReader,g.readAsDataURL(f.slice(0,10)),g.addEventListener("load",function(){},!1),g.addEventListener("error",function(){c=!1},!1)}catch(a){c=!1}c?(fs=a.dataTransfer.files,showUploadFileModel(),showfilepath(),checkUploadFile()):alert("提示:您拖入的文件中包含了一个或多个文件夹,无法进行上传。")}else alert("提示:您不具备上传权限,无法上传文件。");else alert("提示:您不具备上传权限,无法上传文件。")},$(document).keypress(function(a){if(0==$(".modal.shown").length||1==$(".modal.shown").length&&"loadingModal"==$(".modal.shown").attr("id")){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(isShift(a)&&"sreachKeyWordIn"!=document.activeElement.id){switch(b){case 65:checkallfile();break;case 78:$("#createFolderButtonLi a").click();break;case 85:$("#uploadFileButtonLi a").click();break;case 68:$("#deleteSeelectFileButtonLi a").click();break;case 70:$("#uploadFolderButtonLi a").click();break;case 67:$("#cutSignTx").hasClass("cuted")||void 0!=checkedMovefiles||$("#cutFileButtonLi a").click();break;case 86:$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles&&$("#cutFileButtonLi a").click();break;default:return!0}return!1}}}),$("#moveFilesModal").on("hidden.bs.modal",function(){checkedMovefiles=void 0,$("#cutSignTx").html("剪切 <span class='pull-right'><span class='glyphicon glyphicon-arrow-up' aria-hidden='true'></span>+C</span>"),$("#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+" 个文件。"),$("#fim_folderId").text(b.folderId)}),$("#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=["公开的","仅小组","仅创建者"];
3 1 \ No newline at end of file
  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){return"mustLogin"==a?(window.location.href="prv/login.html",void 0):($("#serverOS").text(a),void 0)},error:function(){$("#serverOS").html("<a onclick='getServerOS()'>获取失败,点击重试</a>")}})}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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"mustLogin"==result?window.location.href="prv/login.html":"NOT_FOUND"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}})}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("<label id='vercodetitle' class='col-sm-7'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-5'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>"),$("#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("<li><a href='javascript:void(0);' onclick='entryFolder(\""+b.folderId+'"'+")'>"+b.folderName+"</a></li>")}):$("#parentFolderList").html("<li class='disabled'><a>无</a></li>"),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("<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),"true"==a.allowChangePassword&&($("#tb").append(" <button class='btn btn-link rightbtn' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"))):($("#tb").append("<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),"true"==a.allowSignUp&&($("#tb").append(" <button class='btn btn-link rightbtn' onclick='window.location.href = \"/prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>")));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,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),checkAuth(b,"L")?$("#packageDownloadBox").html("<button class='btn btn-link navbar-btn' onclick='showDownloadAllCheckedModel()'><span class='glyphicon glyphicon-briefcase'></span> 打包下载</button>"):$("#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,g,h,i,j,k,l,m;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("<tr onclick='returnPF()'><td><button onclick='returnPF()' class='btn btn-link btn-xs'>../</button></td><td class='hiddenColumn'>--</td><td>--</td><td class='hiddenColumn'>--</td><td>--</td></tr>"),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],h.folderName=h.folderName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),i="<tr id='"+h.folderId+"' onclick='checkfile(event,"+'"'+h.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+h.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("+'"'+h.folderId+'"'+")' class='btn btn-link btn-xs'>/"+h.folderName+"</button></td><td class='hiddenColumn'>"+h.folderCreationDate+"</td><td>--</td><td class='hiddenColumn'>"+h.folderCreator+"</td><td>",c&&(i=i+"<button onclick='showDeleteFolderModel("+'"'+h.folderId+'","'+h.folderName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(i=i+"<button onclick='showRenameFolderModel("+'"'+h.folderId+'","'+h.folderName+'",'+h.folderConstraint+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>"),f&&(i=i+"<button onclick='showFolderView("+'"'+h.folderParent+'","'+h.folderId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),d||c||f||(i+="--"),i+="</td></tr>",$("#foldertable").append(i);for(j=a.fileList.length;j>0;j--){if(k=a.fileList[j-1],k.fileName=k.fileName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),l="<tr id="+k.fileId+" onclick='checkfile(event,"+'"'+k.fileId+'"'+")' ondblclick='checkConsFile(event,"+'"'+k.fileId+'"'+")' id='"+k.fileId+"' class='filerow'><td>"+k.fileName+"</td><td class='hiddenColumn'>"+k.fileCreationDate+"</td>","0"==k.fileSize?l+="<td>&lt;1MB</td>":l=l+"<td>"+k.fileSize+"MB</td>",l=l+"<td class='hiddenColumn'>"+k.fileCreator+"</td><td>",e)switch(l=l+"<button onclick='showDownloadModel("+'"'+k.fileId+'","'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>",m=getSuffix(k.fileName)){case"mp4":case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":l=l+"<button onclick='playVideo("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"pdf":l=l+"<button onclick='pdfView("+'"'+k.filePath+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"jpg":case"jpeg":case"gif":case"png":case"bmp":l=l+"<button onclick='showPicture("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";break;case"mp3":case"wav":case"ogg":l=l+"<button onclick='playAudio("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"docx":l=l+"<button onclick='docxView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"txt":l=l+"<button onclick='txtView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"ppt":case"pptx":l=l+"<button onclick='pptView("+'"'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>"}c&&(l=l+"<button onclick='showDeleteFileModel("+'"'+k.fileId+'","'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(l=l+"<button onclick='showRenameFileModel("+'"'+k.fileId+'"'+","+'"'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),f&&(l=l+"<button onclick='showFolderView("+'"'+k.fileParentFolder+'","'+k.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),e&&"true"==a.showFileChain&&(l=l+"<button onclick='getFileChain("+'"'+k.fileId+'","'+k.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>"),d||c||e||f||(l+="--"),l+="</td></tr>",$("#foldertable").append(l)}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('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"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){"mustLogin"==a?window.location.href="prv/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("<button id='dmbutton' type='button' class='btn btn-danger' onclick='deleteFolder(\""+a+'"'+")'>删除</button>"),$("#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="prv/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("<button type='button' class='btn btn-primary' onclick='renameFolder(\""+a+'"'+")'>修改</button>"),$("#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;b<fs.length;b++)a+=fs[b].name,b<fs.length-1&&(a+="、");fs.length<=1?$("#selectcount").text(""):$("#selectcount").text("(共"+fs.length+"个)"),$("#filepath").val(a)}function checkUploadFile(){var filenames,maxSize,maxFileIndex,i,namelist;if(0==isUpLoading&&0==isImporting)if(null!=fs&&fs.length>0){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;i<fs.length;i++)filenames[i]=fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi,"$1"),fs[i].size>maxSize&&(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 if("errorParameter"==result)showUploadFileAlert("提示:参数不正确,无法开始上传");else if("noAuthorized"==result)showUploadFileAlert("提示:您的操作未被授权,无法开始上传");else{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;b<repeList.length;b++)repeModelList[repeList[b]]=a;doupload(1)}else repeIndex++,repeIndex<repeList.length?selectFileUpLoadModelStart():doupload(1)}function doupload(a){var c,d,e,b=fs.length;if($("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),c=fs[a-1],null!=c){if(d=c.name,b>1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend("<p>"+d+"<span id='uls_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),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("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<p>未找到要上传的文件<span id='uls_"+a+"'>[失败]</span></p>")}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=!1,null!=xhr&&xhr.abort(),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>"),getDownloadFileId=a,getDownloadFileName=b.replace("#","%23").replace("%","%25").replace("?","%3F"),$("#downloadFileBox").html("<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload(\""+a+'"'+")'>开始下载</button>"),$("#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("<button id='dfmbutton' type='button' class='btn btn-danger' onclick='deleteFile(\""+a+'"'+")'>删除</button>"),$("#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="prv/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("<button type='button' class='btn btn-primary' onclick='renameFile(\""+a+'"'+")'>修改</button>"),$("#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=/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 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<pvl.pictureViewList.length;b++)pvl.pictureViewList[b].filePath.startsWith("homeController")?$(a).append("<li><img src='"+pvl.pictureViewList[b].filePath+"' alt='"+pvl.pictureViewList[b].fileName+"' /></li>"):$(a).append("<li><img src='fileblocks/"+pvl.pictureViewList[b].filePath+"' alt='"+pvl.pictureViewList[b].fileName+"' /></li>");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("<li><img src='css/left.png' alt='上一页' /></li>"),c=0;viewerPageSize>c&&c<pvl.pictureViewList.length-(viewerPageIndex-1)*viewerPageSize;c++)pvl.pictureViewList[b+c].filePath.startsWith("homeController")?$(a).append("<li><img src='"+pvl.pictureViewList[b+c].filePath+"' alt='"+pvl.pictureViewList[b+c].fileName+"' /></li>"):$(a).append("<li><img src='fileblocks/"+pvl.pictureViewList[b+c].filePath+"' alt='"+pvl.pictureViewList[b+c].fileName+"' /></li>");viewerTotal>viewerPageIndex&&$(a).append("<li><img src='css/right.png' alt='下一页' /></li>"),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<d.length;e++)"true"==d[e].getAttribute("iskfolder")?c.push(d[e].id):b.push(d[e].id),a.size++;
  3 +return a.filesId=JSON.stringify(b),a.foldersId=JSON.stringify(c),a}function checkallfile(){$(".filerow.info").length==$(".filerow").length?$(".filerow").removeClass("info"):$(".filerow").addClass("info")}function showDownloadAllCheckedModel(){$("#downloadAllCheckedBox").html(""),$("#downloadAllCheckedLoad").text("");var a=getCheckedFilesAndFolders();0==a.size?$("#downloadAllCheckedName").html(checkFilesTip):($("#downloadAllCheckedName").text("提示:您确认要打包并下载这"+a.size+"项么?"),$("#downloadAllCheckedBox").html("<button id='dclmbutton' type='button' class='btn btn-primary' onclick='downloadAllChecked()'>开始下载</button>"),$("#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("<button id='dfmbutton' type='button' class='btn btn-danger' onclick='deleteAllChecked()'>全部删除</button>"),$("#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="prv/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==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("<span class='glyphicon glyphicon-play' aria-hidden='true'></span>")}),ap.on("play",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-pause' aria-hidden='true'></span>")})),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=0;i<ail.as.length;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;");ap.list.add(ail.as),ap.list.switch(ail.index),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(){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")?($("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")),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)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")?($("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")),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)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByFS").hasClass("glyphicon-triangle-bottom")?($("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize})):($("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileSize-b.fileSize})),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")?($("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"),a=-1):($("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")),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)}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("<button id='dmvfbutton' type='button' class='btn btn-danger' onclick='doMoveFiles()'>全部移动</button>"),$("#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+")<span class='pull-right'><span class='glyphicon glyphicon-arrow-up' aria-hidden='true'></span>+V</span>"),$("#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="prv/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;)repeIndex<repeMap.repeFolders.length?strMoveOptMap[repeMap.repeFolders[repeIndex].folderId]=a:strMoveOptMap[repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileId]=a,repeIndex++;$("#selectFileMoveModelAlert").hide(),sendMoveFilesReq()}repeIndex<repeMap.repeFolders.length?strMoveOptMap[repeMap.repeFolders[repeIndex].folderId]=a:strMoveOptMap[repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileId]=a,repeIndex++,mRepeSize>repeIndex?repeIndex<repeMap.repeFolders.length?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex-repeMap.repeFolders.length].fileName):($("#selectFileMoveModelAlert").hide(),sendMoveFilesReq())}function sendMoveFilesReq(){var a=JSON.stringify(strMoveOptMap);$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,strOptMap:a,locationpath:locationpath},url:"homeController/moveCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1)):"errorParameter"==a?($("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"cannotMoveFiles"==a?($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"moveFilesSuccess"==a?($("#moveFilesModal").modal("hide"),showFolderView(locationpath)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").attr("disabled",!1)}})}function doSearchFile(){var a=$("#sreachKeyWordIn").val();0!=a.length?a.startsWith("all:")||a.startsWith("all:")?selectInCompletePath(a.substring(4)):(startLoading(),selectInThisPath(a),endLoading()):null!=folderView.keyWorld?showFolderView(locationpath):(screenedFoldrView=null,showOriginFolderView())}function selectInThisPath(a){var b,c,d;try{for(b=new RegExp(a+"+"),screenedFoldrView=$.extend(!0,{},originFolderView),screenedFoldrView.folderList=[],screenedFoldrView.fileList=[],c=0,d=originFolderView.folderList.length;d>c;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("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"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(),showFolderTable(folderView))},error:function(){endLoading(),doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}}),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("<a href='"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"'>"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+a+"</a>")},error:function(){$("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>")}})}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.length;a++)$("#importfoldertypelist").append("<li><a onclick='changeImportFolderType("+a+")'>"+folderTypes[a]+"</a></li>")}else $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType(0)'>"+folderTypes[0]+"</a></li>");$("#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;i<ifs.length;i++)ifs[i].size>maxSize&&(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"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):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("<p>"+f+"<span id='ils_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),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("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("<p>未找到要上传的文件<span id='ils_"+a+"'>[失败]</span></p>"))}function abortImport(){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("<label id='changepassword_vercodetitle' class='col-sm-5'><img id='changepassword_showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='changePasswordGetNewVerCode()'></label><div class='col-sm-7'><input type='text' class='form-control' id='changepassword_vercode' placeholder='验证码……'></div>"),$("#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:var c=b.replace("#","%23").replace("%","%25").replace("?","%3F");$("#fileChainTextarea").text(encodeURI(window.location.protocol+"//"+window.location.host+"/externalLinksController/chain/"+c+"?ckey=")+encodeURIComponent(a)),$("#copyChainBtn").attr("disabled",!1)}},error:function(){$("#fileChainTextarea").text("提示:获取失败,无法连接服务器。")}})}function copyFileChain(){if(node=document.getElementById("fileChainTextarea"),issafariBrowser=/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent))node.setSelectionRange(0,9999);else{const a=document.createRange();a.selectNode(node);const b=window.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}document.execCommand("copy")}var ap,zipTimer,folderView,originFolderView,fs,ifs,checkedMovefiles,constraintLevel,account,importFolderName,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,pingInt,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,isImporting=!1,isChangingPassword=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<br /><br /><kbd>单击</kbd>:选中某一文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>单击</kbd></kbd>:选中多个文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>双击</kbd></kbd>:选中连续的文件<br /><br /><kbd><kbd>Shitf</kbd>+<kbd>A</kbd></kbd>:选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS();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(){$("#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.length;b++)$("#foldertypelist").append("<li><a onclick='changeNewFolderType("+b+")'>"+folderTypes[b]+"</a></li>")}else $("#foldertypelist").append("<li><a onclick='changeNewFolderType(0)'>"+folderTypes[0]+"</a></li>")}),$("#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.length;b++)$("#editfoldertypelist").append("<li><a onclick='changeEditFolderType("+b+")'>"+folderTypes[b]+"</a></li>");else $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType(0)'>"+folderTypes[0]+"</a></li>")}),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;d<b.items.length;d++)e=b.items[d],"file"===e.kind&&e.webkitGetAsEntry().isFile||(c=!1);else for(d=0;d<b.files.length;d++)if(f=df.files[d],f.type);else try{g=new FileReader,g.readAsDataURL(f.slice(0,10)),g.addEventListener("load",function(){},!1),g.addEventListener("error",function(){c=!1},!1)}catch(a){c=!1}c?(fs=a.dataTransfer.files,showUploadFileModel(),showfilepath(),checkUploadFile()):alert("提示:您拖入的文件中包含了一个或多个文件夹,无法进行上传。")}else alert("提示:您不具备上传权限,无法上传文件。");else alert("提示:您不具备上传权限,无法上传文件。")},$(document).keypress(function(a){if(0==$(".modal.shown").length||1==$(".modal.shown").length&&"loadingModal"==$(".modal.shown").attr("id")){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(isShift(a)&&"sreachKeyWordIn"!=document.activeElement.id){switch(b){case 65:checkallfile();break;case 78:$("#createFolderButtonLi a").click();break;case 85:$("#uploadFileButtonLi a").click();break;
  4 +case 68:$("#deleteSeelectFileButtonLi a").click();break;case 70:$("#uploadFolderButtonLi a").click();break;case 67:$("#cutSignTx").hasClass("cuted")||void 0!=checkedMovefiles||$("#cutFileButtonLi a").click();break;case 86:$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles&&$("#cutFileButtonLi a").click();break;default:return!0}return!1}}}),$("#moveFilesModal").on("hidden.bs.modal",function(){checkedMovefiles=void 0,$("#cutSignTx").html("剪切 <span class='pull-right'><span class='glyphicon glyphicon-arrow-up' aria-hidden='true'></span>+C</span>"),$("#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+" 个文件。"),$("#fim_folderId").text(b.folderId)}),$("#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()}),$("#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()})}),folderTypes=["公开的","仅小组","仅创建者"];
4 5 \ No newline at end of file
... ...
... ... @@ -16,6 +16,23 @@ $(function() {
16 16 $("#vercodebox").addClass("hidden");
17 17 // 打开页面自动聚焦账户输入框
18 18 $("#accountid").focus();
  19 + // 询问是否可以显示注册按钮
  20 + $.ajax({
  21 + type : "POST",
  22 + dataType : "text",
  23 + data : {},
  24 + url : "homeController/askForAllowSignUpOrNot.ajax",
  25 + success : function(result) {
  26 + if (result == "true") {
  27 + $("#signupBox").removeClass("hidden");
  28 + $("#signupBox").addClass("show");
  29 + return;
  30 + }
  31 + },
  32 + error : function() {
  33 + alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。");
  34 + }
  35 + });
19 36 })
20 37  
21 38 function dologin() {
... ... @@ -78,7 +95,7 @@ function sendLoginInfo(encrypted) {
78 95 case "permitlogin":
79 96 $("#accountidbox").removeClass("has-error");
80 97 $("#accountpwdbox").removeClass("has-error");
81   - window.location.href = "home.html";
  98 + window.location.href = "/home.html";
82 99 break;
83 100 case "accountnotfound":
84 101 $("#accountidbox").addClass("has-error");
... ...
  1 +/**
  2 + * For signup.html
  3 + */
  4 +$(function(){
  5 + // 回车键快捷操作
  6 + $("body").keypress(function(e) {
  7 + var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
  8 + if (keyCode == 13) {
  9 + var g = $("#signupBtn").click();
  10 + return false;
  11 + }
  12 + });
  13 + $("#accountid").focus();//再自动聚焦账户输入框
  14 +})
  15 +
  16 +//获取一个新的验证码
  17 +function getNewVerCode(){
  18 + $("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
  19 +}
  20 +
  21 +//执行注册过程
  22 +function doSignUp(){
  23 + // 还原提示状态
  24 + $("#accountidbox,#accountpwdbox,#repaccountpwdbox").removeClass("has-error");
  25 + $("#alertbox").removeClass("show");
  26 + $("#alertbox").addClass("hidden");
  27 + var accountId = $("#accountid").val();
  28 + var accountPwd = $("#accountpwd").val();
  29 + var repAccountPwd = $("#repaccountpwd").val();
  30 + // 输入非空检查
  31 + if (accountId.length == 0) {
  32 + $("#accountidbox").addClass("has-error");
  33 + $("#accountid").focus();
  34 + return;
  35 + }
  36 + if (accountPwd.length == 0) {
  37 + $("#accountpwdbox").addClass("has-error");
  38 + $("#accountpwd").focus();
  39 + return;
  40 + }
  41 + if (repAccountPwd.length == 0) {
  42 + $("#repaccountpwdbox").addClass("has-error");
  43 + $("#repaccountpwd").focus();
  44 + return;
  45 + }
  46 + // 确认密码检查
  47 + $("#accountid,#accountpwd,#repaccountpwd,#signupBtn,#vercode").attr('disabled', true);
  48 + if (accountPwd+"" != repAccountPwd+"") {
  49 + showAlert("提示:两次输入的新密码不一致,请检查确认");
  50 + $("#accountpwdbox").addClass("has-error");
  51 + $("#repaccountpwdbox").addClass("has-error");
  52 + return;
  53 + }
  54 + // 以加密方式发送修改密码请求
  55 + $.ajax({
  56 + url : 'homeController/getPublicKey.ajax',
  57 + type : 'POST',
  58 + data : {},
  59 + dataType : 'text',
  60 + success : function(result) {
  61 + // 获取公钥
  62 + var signup_publicKeyInfo=eval("("+result+")");
  63 + // 生成JSON对象格式的信息
  64 + var signUpInfo = '{account:"' + accountId + '",pwd:"'
  65 + + accountPwd + '",time:"' + signup_publicKeyInfo.time + '"}';
  66 + var encrypt = new JSEncrypt();// 加密插件对象
  67 + encrypt.setPublicKey(signup_publicKeyInfo.publicKey);// 设置公钥
  68 + var encrypted = encrypt.encrypt(signUpInfo);// 进行加密
  69 + sendSignUpInfo(encrypted);
  70 + },
  71 + error : function() {
  72 + showAlert("提示:注册失败,请检查网络链接或服务器运行状态");
  73 + }
  74 + });
  75 +}
  76 +
  77 +// 将加密数据发送至服务器并显示操作结果
  78 +function sendSignUpInfo(encrypted){
  79 + $.ajax({
  80 + type : "POST",
  81 + dataType : "text",
  82 + url : "homeController/doSigUp.ajax",
  83 + data : {
  84 + encrypted : encrypted,
  85 + vercode : $("#vercode").val()
  86 + },
  87 + success : function(result) {
  88 + switch (result) {
  89 + case "success":
  90 + $("#accountidbox,#accountpwdbox,#repaccountpwdbox").removeClass("has-error");
  91 + window.location.href = "/home.html";
  92 + break;
  93 + case "illegal":
  94 + showAlert("提示:注册功能已被禁用,请求被拒绝");
  95 + break;
  96 + case "accountexists":
  97 + showAlert("提示:该账户名已存在,请使用其他账户名进行注册");
  98 + $("#accountidbox").addClass("has-error");
  99 + break;
  100 + case "needvercode":
  101 + $("#accountid,#accountpwd,#repaccountpwd,#signupBtn,#vercode").attr('disabled', false);
  102 + $("#vercodebox").removeClass("hidden");
  103 + $("#vercodebox").addClass("show");
  104 + getNewVerCode();
  105 + break;
  106 + case "invalidaccount":
  107 + showAlert("提示:注册失败,账户名不合法。账户名的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
  108 + $("#accountidbox").addClass("has-error");
  109 + break;
  110 + case "mustlogout":
  111 + showAlert("提示:您已经登入了一个账户,请先注销后再执行本操作");
  112 + break;
  113 + case "invalidpwd":
  114 + showAlert("提示:注册失败,密码格式不正确。密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
  115 + $("#accountpwdbox").addClass("has-error");
  116 + $("#repaccountpwdbox").addClass("has-error");
  117 + break;
  118 + case "error":
  119 + showAlert("提示:注册失败,注册请求无法通过加密效验(可能是请求耗时过长导致的)");
  120 + break;
  121 + case "cannotsignup":
  122 + showAlert("提示:注册失败,发生意外错误,请稍后重试或联系管理员");
  123 + break;
  124 + default:
  125 + showAlert("提示:注册失败,发生未知错误");
  126 + break;
  127 + }
  128 + },
  129 + error : function() {
  130 + showAlert("提示:注册失败,请检查网络链接或服务器运行状态");
  131 + }
  132 + });
  133 +}
  134 +
  135 +// 显示修改密码错误提示
  136 +function showAlert(txt) {
  137 + $("#accountid,#accountpwd,#repaccountpwd,#signupBtn,#vercode").attr('disabled', false);
  138 + $("#alertbox").removeClass("hidden");
  139 + $("#alertbox").addClass("show");
  140 + $("#alertbox").text(txt);
  141 +}
0 142 \ No newline at end of file
... ...
  1 +<!doctype html>
  2 +<html>
  3 +<head>
  4 +<base href="/">
  5 +<meta charset="UTF-8">
  6 +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7 +<meta name="renderer" content="webkit">
  8 +<meta name="viewport" content="width=device-width, initial-scale=1">
  9 +<title>KIFT</title>
  10 +<link rel="stylesheet" href="css/bootstrap.min.css">
  11 +<link rel="stylesheet" href="css/overrall.min.css">
  12 +<link rel="icon" type="image/x-icon" href="css/icon.png" />
  13 +<!--[if lt IE 9]>
  14 + <script src="js/html5shiv.min.js"></script>
  15 + <script src="js/respond.min.js"></script>
  16 +<![endif]-->
  17 +</head>
  18 +
  19 +<body>
  20 + <div class="container">
  21 +
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <div class="titlebox">
  25 + <span class="titletext"><em> 青阳网络文件传输系统 <small><span
  26 + class="graytext">KIFT</span></small></em></span>
  27 + </div>
  28 + <hr />
  29 + </div>
  30 + </div>
  31 +
  32 + <div class="row">
  33 + <div class="col-md-12">
  34 + <h2 class="centerText">
  35 + <span class="glyphicon glyphicon-exclamation-sign"
  36 + aria-hidden="true"></span>错误:拒绝访问!
  37 + </h2>
  38 + <br />
  39 + <h4 class="centerText">您无权访问该服务器,请求已经被阻止。如有疑问请联系管理员。</h4>
  40 + </div>
  41 + </div>
  42 + </div>
  43 +</body>
  44 +<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
  45 +<script type="text/javascript" src="js/bootstrap.min.js"></script>
  46 +</html>
0 47 \ No newline at end of file
... ...
... ... @@ -66,6 +66,11 @@
66 66 <div id="alertbox" role="alert"></div>
67 67 <input id="loginBtn" class="form-control btn-success"
68 68 type="button" value="登录" onclick="dologin()"> <br />
  69 + <div id="signupBox" class="hidden">
  70 + <input class="form-control btn-info"
  71 + type="button" value="立即注册"
  72 + onclick="window.location.href = '/prv/signup.html'"> <br />
  73 + </div>
69 74 </form>
70 75 </div>
71 76 </div>
... ...
  1 +<!doctype html>
  2 +<html>
  3 +<head>
  4 +<base href="/">
  5 +<meta charset="UTF-8">
  6 +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7 +<meta name="renderer" content="webkit">
  8 +<meta
  9 + content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
  10 + name="viewport" />
  11 +<title>KIFT</title>
  12 +<link rel="stylesheet" href="css/bootstrap.min.css">
  13 +<link rel="stylesheet" href="css/overrall.min.css">
  14 +<link rel="icon" type="image/x-icon" href="css/icon.png" />
  15 +<!--[if lt IE 9]>
  16 + <script src="js/html5shiv.min.js"></script>
  17 + <script src="js/respond.min.js"></script>
  18 +<![endif]-->
  19 +</head>
  20 +
  21 +<body>
  22 + <div class="container">
  23 +
  24 + <div class="row">
  25 + <div class="col-md-12">
  26 + <div class="titlebox">
  27 + <span class="titletext"><em> 青阳网络文件传输系统 <small><span
  28 + class="graytext">KIFT</span></small></em></span>
  29 + </div>
  30 + <hr />
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="row">
  35 + <div class="col-md-6 col-md-offset-3">
  36 + <p class="centerText" style="font-size: 30px; color: #4D4D4D">
  37 + <strong>欢迎注册新账户</strong>
  38 + </p>
  39 + <p class="centerText" style="font-size: 18px; color: #9C9C9C">
  40 + <span class="glyphicon glyphicon-log-in"></span> 请输入以下信息来创建您的新账户
  41 + </p>
  42 + <div class="panel panel-default">
  43 + <div class="panel-heading">
  44 + <h3 class="panel-title">注册新账户</h3>
  45 + </div>
  46 + <div class="panel-body">
  47 + <form class="form-horizontal">
  48 + <div class="form-group" id="accountidbox">
  49 + <label for="accountid" id="accountidtitle"
  50 + class="col-sm-3 control-label">账户名:</label>
  51 + <div class="col-sm-9">
  52 + <input type="text" class="form-control" id="accountid"
  53 + placeholder="请输入要注册的账户名……">
  54 + </div>
  55 + </div>
  56 + <div class="form-group" id="accountpwdbox">
  57 + <label for="accountpwd" id="accountpwdtitle"
  58 + class="col-sm-3 control-label">密码:</label>
  59 + <div class="col-sm-9">
  60 + <input type="password" class="form-control" id="accountpwd"
  61 + placeholder="请输入新账户的密码……">
  62 + </div>
  63 + </div>
  64 + <div class="form-group" id="repaccountpwdbox">
  65 + <label for="accountpwd" id="repaccountpwdtitle"
  66 + class="col-sm-3 control-label">确认密码:</label>
  67 + <div class="col-sm-9">
  68 + <input type="password" class="form-control" id="repaccountpwd"
  69 + placeholder="请再次输入新账户的密码……">
  70 + </div>
  71 + </div>
  72 + <br />
  73 + <div id="vercodebox" class="form-group hidden"><label class='col-sm-5'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='' onclick='getNewVerCode()'></label><div class='col-sm-7'><input type='text' class='form-control' id='vercode' placeholder='请输入验证码进行验证……'></div></div>
  74 + <div id="alertbox" role="alert" class="alert alert-danger hidden"></div>
  75 + <input id="signupBtn" class="form-control btn-primary"
  76 + type="button" value="立即注册" onclick="doSignUp()"> <br />
  77 + <input class="form-control btn-danger" type="button" value="返回"
  78 + onclick="window.location.href = '/home.html'"> <br />
  79 + </form>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </div>
  84 +
  85 + </div>
  86 +</body>
  87 +<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
  88 +<script type="text/javascript" src="js/bootstrap.min.js"></script>
  89 +<script type="text/javascript" src="js/jsencrypt.min.js"></script>
  90 +<script type="text/javascript" src="js/signup.js"></script>
  91 +</html>
0 92 \ No newline at end of file
... ...