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

提交 a95e8d22470e4878cef84c04bb5baf87c42791ed

作者 kohgylw
1 个父辈 3f90a299

update to v1.0.20

... ... @@ -33,9 +33,9 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
33 33 -------
34 34  
35 35 ## kiftd有哪些优势?
36   - ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 无上传限制——1MB的文档和超过4GB的高清电影资源?均能够随意上传和下载。
  36 + ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 无上传限制——不足1MB的文档和超过5GB的高清电影资源?均能够随意上传和下载。
37 37  
38   - ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 主流商业网盘特有的高级功能甚至需要收费的功能——文件夹访问权限控制、多格式视频在线影院、音乐在线欣赏、图片文件在线预览、Word & PDF & TXT文档在线阅读...kiftd均一一具备,每一份kiftd均是“完全版”。
  38 + ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 主流商业网盘特有的高级功能甚至需要收费的功能——文件夹访问级别控制、视频在线影院、Word/PPT/TXT/PDF文档在线预览、音乐在线欣赏、图片库在线预览...kiftd均一一具备,每一份kiftd均是“完全版”。
39 39  
40 40 ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 操作系统全兼容——无论是Windows、Linux还是Unix(包括Mac OS X),均可运行使用。
41 41  
... ... @@ -77,20 +77,15 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
77 77  
78 78 > 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
79 79  
80   -### 新版本v1.0.19
81   -_本次更新增加了一些用户期待的新功能,并对已知的问题进行了修复,进一步增强kiftd的使用体验。推荐所有用户升级。_
82   -+ 上传文件体积限制功能现已加入!该功能允许您为每个用户(或所有用户)单独设置其上传文件的最大体积限制,从而更加灵活地管理上传配额。设置方法详见随程序附带的《kiftd说明文档》。
83   -+ 可自定义的登录验证码类型。现在,您可以根据需要自由选择登录验证码的类型,包括“标准(较难识别)”、“简化(容易识别)”和“关闭(不需要验证码)”三种,以便适应不同的使用环境和安全性需求。
84   -+ 升级了内置JAVE视频解码引擎的版本:解决了其在Windows 32位操作系统下无法正确运行的BUG,同时降低了解码时的内存占用,并使其能够兼容Java 9+。
85   -+ 放宽文件夹名称的长度限制至128个字符,方便用户使用更长的名称命名文件夹。
86   -+ 增加浏览文件夹路径记忆功能——当您刷新页面或是打开新的kiftd页面时,文件列表将会重新显示您之前正在浏览的文件夹。
87   -+ 进一步完善了文件夹视图系统:当用户试图打开一个不存在的文件夹时,将直接返回根目录。
88   -+ 进一步优化了文件管理界面:当您使用拖拽的方法导入文件时,能够显示导入进度。
89   -+ 优化MySQL配置检查机制:当MySQL连接失败时,系统不再将“mysql.enable”一项的值自动重置为“false”,从而避免用户误操作的情况发生。
90   -+ 修复了当文件名存在特殊符号时,其下载链接无法被服务器正确解析的问题。
91   -+ 修复了上传、视频播放和音乐播放过程中,因用户凭证失效可能导致操作被中断问题。
92   -+ 修复了使用预览功能打开空的Word或TXT文档时无法正确显示的问题。
93   -+ 修复了一个可能导致文件列表被HTML或JS代码注入的漏洞(特别鸣谢:GitHub用户“showuon”)。
  80 +### 新版本v1.0.20
  81 +_本次更新增加了较多用户们一直期待的、实用性较强的新功能,进一步增强kiftd的使用体验。推荐所有用户升级体验。_
  82 ++ 文件夹上传——现在,众多用户期待已久的上传文件夹功能现已上线。当用户同时具备“上传”和“新建文件夹”权限时,便可使用该功能进行文件夹的上传,同时还可以像新建文件夹一样自由设置上传后的文件夹的访问级别。详情请见《kiftd说明文档》。
  83 ++ PPT预览功能——现在,众多用户期待已久的PPT文档在线预览功能正式上线,方便办公使用。PPT预览功能提供ppt和pptx格式的在线打开和预览,且该功能无需额外安装任何插件,可免费用于商业用途。注:在线预览无法显示动画效果,部分复杂内容可能与官方PPT版式有所差异。
  84 ++ 添加扩展存储区——现在,kiftd的文件系统允许用户额外添加最多31个“扩展存储区”路径。这些“扩展存储区”能够设置在不同的硬盘分区中并分担“主文件系统存储区”的存储压力,从而方便用户在不借助硬盘阵列技术的前提下使用多块硬盘来进一步扩展kiftd的可用容量。详情请见《kiftd说明文档》。
  85 ++ 升级了文件列表的排序功能——文件列表现在可以对文件的各项属性进行切换式的双向(升序/降序)排序。
  86 ++ 优化文件列表的显示顺序——文件列表现在将按照上传的时间由新至旧向下排列显示,更加贴合用户的查看习惯。
  87 ++ 优化配置检查机制——当配置出现错误后系统将不再自动还原初配置文件,以便用户根据提示信息进行检查和修改。
  88 ++ 进一步提高了文件系统的安全性和稳定性。
94 89  
95 90 > 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
96 91  
... ...
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
... ... @@ -99,13 +99,16 @@
99 99 class="glyphicon glyphicon-cog"></span> 操作 <span
100 100 class="caret"></span></a>
101 101 <ul class="dropdown-menu" id="fileListDropDown">
102   - <li id="createFolderButtonLi"><a>新建文件夹 <span
103   - class="pull-right"><span
104   - class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+N</span></a></li>
105   - <li role="separator" class="divider"></li>
106 102 <li id="uploadFileButtonLi"><a>上传文件 <span
107 103 class="pull-right"><span
108 104 class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+U</span></a></li>
  105 + <li id="uploadFolderButtonLi"><a>上传文件夹 <span
  106 + class="pull-right"><span
  107 + class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+F</span></a></li>
  108 + <li role="separator" class="divider"></li>
  109 + <li id="createFolderButtonLi"><a>新建文件夹 <span
  110 + class="pull-right"><span
  111 + class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+N</span></a></li>
109 112 <li role="separator" class="divider"></li>
110 113 <li id="cutFileButtonLi"><a><span id='cutSignTx'>剪切
111 114 <span class="pull-right"><span
... ... @@ -322,7 +325,7 @@
322 325 </div>
323 326 </div>
324 327 </div>
325   - <div id="newfolderalert" role="alert"></div>
  328 + <div id="editfolderalert" role="alert"></div>
326 329 </form>
327 330 </div>
328 331 <div class="modal-footer">
... ... @@ -372,7 +375,7 @@
372 375 <div id="uploadstatus" class="uploadstatusbox"></div>
373 376 </div>
374 377 </div>
375   - <div id="uploadFileAlert" role="alert"></div>
  378 + <div id="uploadFileAlert" role="alert" class="alert alert-danger"></div>
376 379 <div id="selectFileUpLoadModelAlert" class="alert alert-danger"
377 380 role="alert">
378 381 <h4>提示:存在同名文件!</h4>
... ... @@ -404,6 +407,83 @@
404 407 </div>
405 408 </div>
406 409 <!-- end 上传文件 -->
  410 + <!-- 上传文件夹框 -->
  411 + <div class="modal fade" id="importFolderModal" tabindex="-1"
  412 + role="dialog" aria-labelledby="importFolderMolderTitle">
  413 + <div class="modal-dialog" role="document">
  414 + <div class="modal-content">
  415 + <div class="modal-header">
  416 + <button type="button" class="close" data-dismiss="modal"
  417 + aria-label="Close">
  418 + <span aria-hidden="true">&times;</span>
  419 + </button>
  420 + <h4 class="modal-title" id="importFolderMolderTitle">
  421 + <span class="glyphicon glyphicon-cloud-upload"></span> 上传文件夹
  422 + </h4>
  423 + </div>
  424 + <div class="modal-body">
  425 + <h5>选择文件夹:</h5>
  426 + <div class="input-group">
  427 + <input type="text" id="folderpath" class="form-control"
  428 + onclick="checkimportpath()" onfocus="this.blur()"
  429 + placeholder="请点击选择要上传的文件夹……" folderConstraintLevel="0">
  430 + <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">
  434 + &nbsp;<span id="importfoldertype">公开的</span>&nbsp;<span
  435 + class="caret"></span>
  436 + </button>
  437 + <ul id="importfoldertypelist"
  438 + class="dropdown-menu dropdown-menu-right">
  439 + </ul>
  440 + </div>
  441 + </div>
  442 + <input type="file" id="importfolder" style="display: none;"
  443 + onchange="getInputImport()" multiple="multiple" webkitdirectory>
  444 + <h5>
  445 + 上传进度:<span id="importcount"></span>
  446 + </h5>
  447 + <div class="progress">
  448 + <div id="importpros" class="progress-bar" role="progressbar"
  449 + aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"
  450 + style="width: 0%;">
  451 + <span class="sr-only"></span>
  452 + </div>
  453 + </div>
  454 + <h5>上传状态:</h5>
  455 + <div class="panel panel-default">
  456 + <div class="panel-body">
  457 + <div id="importstatus" class="uploadstatusbox"></div>
  458 + </div>
  459 + </div>
  460 + <div id="importFolderAlert" class="alert alert-danger" role="alert"></div>
  461 + <div id="selectFolderImportModelAlert" class="alert alert-danger"
  462 + role="alert">
  463 + <h4>提示:存在同名文件夹!</h4>
  464 + <p>
  465 + 您要上传的文件夹“<span id="repeFolderName"></span>”已存在于该路径下,您希望:
  466 + </p>
  467 + <p>
  468 + <button id="importcoverbtn" type="button"
  469 + class="btn btn-danger btn-sm"
  470 + onclick="importAndCover()">覆盖</button>
  471 + <button type="button" class="btn btn-default btn-sm"
  472 + onclick="abortImport()">取消上传</button>
  473 + <button type="button" class="btn btn-default btn-sm"
  474 + onclick="importAndBoth()">保留两者</button>
  475 + </p>
  476 + </div>
  477 + </div>
  478 + <div class="modal-footer">
  479 + <button type="button" class="btn btn-default" onclick='abortImport()'>取消</button>
  480 + <button id="importbutton" type='button' class='btn btn-primary'
  481 + onclick='checkImportFolder()'>开始上传</button>
  482 + </div>
  483 + </div>
  484 + </div>
  485 + </div>
  486 + <!-- end 上传文件夹 -->
407 487 <!-- 下载提示框 -->
408 488 <div class="modal fade" id="downloadModal" tabindex="-1" role="dialog"
409 489 aria-labelledby="downloadModelTitle">
... ...
... ... @@ -10,11 +10,14 @@ var zipTimer;// 打包下载计时器
10 10 var folderView;// 返回的文件系统视图对象
11 11 var originFolderView;// 保存原始的文件视图对象
12 12 var fs;// 选中的要上传的文件列表
  13 +var ifs;// 选中的要上传的文件夹内的文件列表
13 14 var checkedMovefiles;// 移动文件的存储列表
14 15 var constraintLevel;// 当前文件夹限制等级
15 16 var account;// 用户账户
16   -var isUpLoading=false;// 是否正在执行其他上传操作
17   -var xhr;// 文件上传请求对象
  17 +var isUpLoading=false;// 是否正在执行上传操作
  18 +var isImporting=false;// 是否正在执行上传文件夹操作
  19 +var importFolderName;// 上传文件夹时保存文件夹名称
  20 +var xhr;// 文件或文件夹上传请求对象
18 21 var viewerPageSize = 15; // 显示图片页的最大长度,注意最好是奇数
19 22 var viewer; // viewer对象,用于预览图片功能
20 23 var viewerPageIndex; // 分页预览图片——已浏览图片页号
... ... @@ -22,7 +25,6 @@ var viewerTotal; // 分页预览图片——总页码数
22 25 var pvl;// 预览图片列表的JSON格式对象
23 26 var 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>:选中/取消选中所有文件";// 选取文件提示
24 27 var winHeight;// 窗口高度
25   -var uploadKey;// 上传所用的一次性密钥
26 28 var pingInt;// 定时应答器的定时装置
27 29  
28 30 // 界面功能方法定义
... ... @@ -128,8 +130,8 @@ $(function() {
128 130 $("#foldername").focus();
129 131 });
130 132 // 关闭上传模态框时自动提示如何查看上传进度
131   - $('#uploadFileModal').on('hidden.bs.modal', function(e) {
132   - if(isUpLoading){
  133 + $('#uploadFileModal,#importFolderModal').on('hidden.bs.modal', function(e) {
  134 + if(isUpLoading || isImporting){
133 135 $('#operationMenuBox').attr("data-placement", "top");
134 136 $('#operationMenuBox').attr("data-trigger", "focus");
135 137 $('#operationMenuBox').attr("data-title", "上传中");
... ... @@ -148,10 +150,10 @@ $(function() {
148 150 });
149 151 // 开启编辑文件夹框自动初始化状态
150 152 $('#renameFolderModal').on('show.bs.modal', function(e) {
151   - $("#newfolderalert").removeClass("alert");
152   - $("#newfolderalert").removeClass("alert-danger");
  153 + $("#editfolderalert").removeClass("alert");
  154 + $("#editfolderalert").removeClass("alert-danger");
153 155 $("#folderrenamebox").removeClass("has-error");
154   - $("#newfolderalert").text("");
  156 + $("#editfolderalert").text("");
155 157 $("#editfoldertypelist").html("");
156 158 if(account!=null){
157 159 for(var i=constraintLevel;i<folderTypes.length;i++){
... ... @@ -181,7 +183,7 @@ $(function() {
181 183 }
182 184 if (folderView.authList != null) {
183 185 if (checkAuth(folderView.authList, "U")) {// 如果有上传权限且未进行其他上传
184   - if(isUpLoading){
  186 + if(isUpLoading || isImporting){
185 187 alert("提示:您正在执行另一项上传任务,请在上传窗口关闭后再试。");
186 188 }else{
187 189 if (!(window.ActiveXObject||"ActiveXObject" in window)){// 判断是否为IE
... ... @@ -241,7 +243,7 @@ $(function() {
241 243 alert("提示:您不具备上传权限,无法上传文件。");
242 244 }
243 245 }
244   - // Shift+A全选文件/反选文件,Shift+N新建文件夹,Shift+U上传文件,Shift+C&V剪切粘贴,Shift+D批量删除
  246 + // Shift+A全选文件/反选文件,Shift+N新建文件夹,Shift+U上传文件,Shift+F导入文件夹,Shift+C&V剪切粘贴,Shift+D批量删除
245 247 $(document).keypress(function (e) {
246 248 if($('.modal.shown').length == 0 || ($('.modal.shown').length == 1 && $('.modal.shown').attr('id') == 'loadingModal')){
247 249 var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
... ... @@ -259,6 +261,9 @@ $(function() {
259 261 case 68:
260 262 $('#deleteSeelectFileButtonLi a').click();
261 263 break;
  264 + case 70:
  265 + $('#uploadFolderButtonLi a').click();
  266 + break;
262 267 case 67:
263 268 if((!$("#cutSignTx").hasClass("cuted"))&&checkedMovefiles==undefined){
264 269 $('#cutFileButtonLi a').click();
... ... @@ -672,6 +677,10 @@ function showAccountView(folderView) {
672 677 if (checkAuth(authList, "U")) {
673 678 $("#uploadFileButtonLi").removeClass("disabled");
674 679 $("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()");
  680 + if(checkAuth(authList, "C") && isSupportWebkitdirectory()){// 若浏览器支持文件夹选择,且具备新建文件夹权限,则允许进行文件夹上传
  681 + $("#uploadFolderButtonLi").removeClass("disabled");
  682 + $("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()");
  683 + }
675 684 }
676 685 if (checkAuth(authList, "L")) {
677 686 $("#packageDownloadBox")
... ... @@ -761,183 +770,190 @@ function showFolderTable(folderView) {
761 770 if (checkAuth(authList, "O")){
762 771 aO = true;
763 772 }
764   - $
765   - .each(
766   - folderView.folderList,
767   - function(n, f) {
768   - f.folderName = f.folderName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
769   - var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("
770   - + '"' + f.folderId + '"'
771   - + ")' class='btn btn-link btn-xs'>/"
772   - + f.folderName + "</button></td><td class='hiddenColumn'>"
773   - + f.folderCreationDate + "</td><td>--</td><td class='hiddenColumn'>"
774   - + f.folderCreator + "</td><td>";
775   - if (aD) {
776   - folderRow = folderRow
777   - + "<button onclick='showDeleteFolderModel("
778   - + '"'
779   - + f.folderId
780   - + '","'
781   - + f.folderName
782   - + '"'
783   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
784   - }
785   - if (aR) {
786   - folderRow = folderRow
787   - + "<button onclick='showRenameFolderModel("
788   - + '"'
789   - + f.folderId
790   - + '","'
791   - + f.folderName
792   - + '",'
793   - + f.folderConstraint
794   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
795   - }
796   - if (aO) {
797   - folderRow = folderRow
798   - + "<button onclick='showFolderView("
799   - + '"'
800   - + f.folderParent
801   - + '","'
802   - + f.folderId
803   - + '"'
804   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
805   - }
806   - if (!aR && !aD && !aO) {
807   - folderRow = folderRow + "--";
808   - }
809   - folderRow = folderRow + "</td></tr>";
810   - $("#foldertable").append(folderRow);
811   - });
812   - $
813   - .each(
814   - folderView.fileList,
815   - function(n, fi) {
816   - fi.fileName = fi.fileName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
817   - var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
818   - + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
819   - + "' class='filerow'><td>" + fi.fileName
820   - + "</td><td class='hiddenColumn'>" + fi.fileCreationDate + "</td>";
821   - if(fi.fileSize=="0"){
822   - fileRow=fileRow+"<td>&lt;1MB</td>";
823   - }else{
824   - fileRow=fileRow+"<td>" + fi.fileSize + "MB</td>";
825   - }
826   - fileRow=fileRow +"<td class='hiddenColumn'>" + fi.fileCreator + "</td><td>";
827   - if (aL) {
828   - fileRow = fileRow
829   - + "<button onclick='showDownloadModel("
830   - + '"'
831   - + fi.fileId
832   - + '","'
833   - + fi.fileName
834   - + '"'
835   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
836   - // 对于各种特殊格式文件提供的预览和播放功能
837   - var suffix=getSuffix(fi.fileName);
838   - switch (suffix) {
839   - case "mp4":
840   - case "webm":
841   - case "mov":
842   - case "avi":
843   - case "wmv":
844   - case "mkv":
845   - case "flv":
846   - fileRow = fileRow
847   - + "<button onclick='playVideo("
848   - + '"'
849   - + fi.fileId
850   - + '"'
851   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
852   - break;
853   - case "pdf":
854   - fileRow = fileRow
855   - + "<button onclick='pdfView("
856   - + '"'
857   - + fi.filePath
858   - + '"'
859   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
860   - break;
861   - case "jpg":
862   - case "jpeg":
863   - case "gif":
864   - case "png":
865   - case "bmp":
866   - fileRow = fileRow
867   - + "<button onclick='showPicture("
868   - + '"'
869   - + fi.fileId
870   - + '"'
871   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
872   - break;
873   - case "mp3":
874   - case "wav":
875   - case "ogg":
876   - fileRow = fileRow
877   - + "<button onclick='playAudio("
878   - + '"'
879   - + fi.fileId
880   - + '"'
881   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
882   - break;
883   - case "docx":
884   - fileRow = fileRow
885   - + "<button onclick='docxView("
886   - + '"'
887   - + fi.fileId
888   - + '"'
889   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
890   - break;
891   - case "txt":
892   - fileRow = fileRow
893   - + "<button onclick='txtView("
894   - + '"'
895   - + fi.fileId
896   - + '"'
897   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
898   - break;
899   - default:
900   - break;
901   - }
902   - }
903   - if (aD) {
904   - fileRow = fileRow
905   - + "<button onclick='showDeleteFileModel("
906   - + '"'
907   - + fi.fileId
908   - + '","'
909   - + fi.fileName
910   - + '"'
911   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
912   - }
913   - if (aR) {
914   - fileRow = fileRow
915   - + "<button onclick='showRenameFileModel("
916   - + '"'
917   - + fi.fileId
918   - + '"'
919   - + ","
920   - + '"'
921   - + fi.fileName
922   - + '"'
923   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
924   - }
925   - if (aO) {
926   - fileRow = fileRow
927   - + "<button onclick='showFolderView("
928   - + '"'
929   - + fi.fileParentFolder
930   - + '","'
931   - + fi.fileId
932   - + '"'
933   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
934   - }
935   - if (!aR && !aD && !aL && !aO) {
936   - fileRow = fileRow + "--";
937   - }
938   - fileRow = fileRow + "</td></tr>";
939   - $("#foldertable").append(fileRow);
940   - });
  773 + // 遍历并倒序显示文件夹列表
  774 + for(var i1=folderView.folderList.length;i1>0;i1--){
  775 + var f=folderView.folderList[i1-1];
  776 + f.folderName = f.folderName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
  777 + var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("
  778 + + '"' + f.folderId + '"'
  779 + + ")' class='btn btn-link btn-xs'>/"
  780 + + f.folderName + "</button></td><td class='hiddenColumn'>"
  781 + + f.folderCreationDate + "</td><td>--</td><td class='hiddenColumn'>"
  782 + + f.folderCreator + "</td><td>";
  783 + if (aD) {
  784 + folderRow = folderRow
  785 + + "<button onclick='showDeleteFolderModel("
  786 + + '"'
  787 + + f.folderId
  788 + + '","'
  789 + + f.folderName
  790 + + '"'
  791 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
  792 + }
  793 + if (aR) {
  794 + folderRow = folderRow
  795 + + "<button onclick='showRenameFolderModel("
  796 + + '"'
  797 + + f.folderId
  798 + + '","'
  799 + + f.folderName
  800 + + '",'
  801 + + f.folderConstraint
  802 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
  803 + }
  804 + if (aO) {
  805 + folderRow = folderRow
  806 + + "<button onclick='showFolderView("
  807 + + '"'
  808 + + f.folderParent
  809 + + '","'
  810 + + f.folderId
  811 + + '"'
  812 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
  813 + }
  814 + if (!aR && !aD && !aO) {
  815 + folderRow = folderRow + "--";
  816 + }
  817 + folderRow = folderRow + "</td></tr>";
  818 + $("#foldertable").append(folderRow);
  819 + }
  820 + // 遍历并倒序显示文件列表
  821 + for(var i2=folderView.fileList.length;i2>0;i2--){
  822 + var fi = folderView.fileList[i2-1];
  823 + fi.fileName = fi.fileName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
  824 + var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
  825 + + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
  826 + + "' class='filerow'><td>" + fi.fileName
  827 + + "</td><td class='hiddenColumn'>" + fi.fileCreationDate + "</td>";
  828 + if(fi.fileSize=="0"){
  829 + fileRow=fileRow+"<td>&lt;1MB</td>";
  830 + }else{
  831 + fileRow=fileRow+"<td>" + fi.fileSize + "MB</td>";
  832 + }
  833 + fileRow=fileRow +"<td class='hiddenColumn'>" + fi.fileCreator + "</td><td>";
  834 + if (aL) {
  835 + fileRow = fileRow
  836 + + "<button onclick='showDownloadModel("
  837 + + '"'
  838 + + fi.fileId
  839 + + '","'
  840 + + fi.fileName
  841 + + '"'
  842 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
  843 + // 对于各种特殊格式文件提供的预览和播放功能
  844 + var suffix=getSuffix(fi.fileName);
  845 + switch (suffix) {
  846 + case "mp4":
  847 + case "webm":
  848 + case "mov":
  849 + case "avi":
  850 + case "wmv":
  851 + case "mkv":
  852 + case "flv":
  853 + fileRow = fileRow
  854 + + "<button onclick='playVideo("
  855 + + '"'
  856 + + fi.fileId
  857 + + '"'
  858 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  859 + break;
  860 + case "pdf":
  861 + fileRow = fileRow
  862 + + "<button onclick='pdfView("
  863 + + '"'
  864 + + fi.filePath
  865 + + '"'
  866 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  867 + break;
  868 + case "jpg":
  869 + case "jpeg":
  870 + case "gif":
  871 + case "png":
  872 + case "bmp":
  873 + fileRow = fileRow
  874 + + "<button onclick='showPicture("
  875 + + '"'
  876 + + fi.fileId
  877 + + '"'
  878 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
  879 + break;
  880 + case "mp3":
  881 + case "wav":
  882 + case "ogg":
  883 + fileRow = fileRow
  884 + + "<button onclick='playAudio("
  885 + + '"'
  886 + + fi.fileId
  887 + + '"'
  888 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  889 + break;
  890 + case "docx":
  891 + fileRow = fileRow
  892 + + "<button onclick='docxView("
  893 + + '"'
  894 + + fi.fileId
  895 + + '"'
  896 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  897 + break;
  898 + case "txt":
  899 + fileRow = fileRow
  900 + + "<button onclick='txtView("
  901 + + '"'
  902 + + fi.fileId
  903 + + '"'
  904 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  905 + break;
  906 + case "ppt":
  907 + case "pptx":
  908 + fileRow = fileRow
  909 + + "<button onclick='pptView("
  910 + + '"'
  911 + + fi.fileId
  912 + + '"'
  913 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  914 + break;
  915 + default:
  916 + break;
  917 + }
  918 + }
  919 + if (aD) {
  920 + fileRow = fileRow
  921 + + "<button onclick='showDeleteFileModel("
  922 + + '"'
  923 + + fi.fileId
  924 + + '","'
  925 + + fi.fileName
  926 + + '"'
  927 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
  928 + }
  929 + if (aR) {
  930 + fileRow = fileRow
  931 + + "<button onclick='showRenameFileModel("
  932 + + '"'
  933 + + fi.fileId
  934 + + '"'
  935 + + ","
  936 + + '"'
  937 + + fi.fileName
  938 + + '"'
  939 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
  940 + }
  941 + if (aO) {
  942 + fileRow = fileRow
  943 + + "<button onclick='showFolderView("
  944 + + '"'
  945 + + fi.fileParentFolder
  946 + + '","'
  947 + + fi.fileId
  948 + + '"'
  949 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
  950 + }
  951 + if (!aR && !aD && !aL && !aO) {
  952 + fileRow = fileRow + "--";
  953 + }
  954 + fileRow = fileRow + "</td></tr>";
  955 + $("#foldertable").append(fileRow);
  956 + }
941 957 changeFilesTableStyle();
942 958 }
943 959  
... ... @@ -1140,16 +1156,15 @@ function renameFolder(folderId) {
1140 1156  
1141 1157 // 显示重命名文件夹状态提示
1142 1158 function showRFolderAlert(txt) {
1143   - $("#newfolderalert").addClass("alert");
1144   - $("#newfolderalert").addClass("alert-danger");
  1159 + $("#editfolderalert").addClass("alert");
  1160 + $("#editfolderalert").addClass("alert-danger");
1145 1161 $("#folderrenamebox").addClass("has-error");
1146   - $("#newfolderalert").text(txt);
  1162 + $("#editfolderalert").text(txt);
1147 1163 }
1148 1164  
1149 1165 // 显示上传文件模态框
1150 1166 function showUploadFileModel() {
1151   - $("#uploadFileAlert").removeClass("alert");
1152   - $("#uploadFileAlert").removeClass("alert-danger");
  1167 + $("#uploadFileAlert").hide();
1153 1168 $("#uploadFileAlert").text("");
1154 1169 if(isUpLoading==false){
1155 1170 $("#filepath").removeAttr("disabled");
... ... @@ -1159,7 +1174,7 @@ function showUploadFileModel() {
1159 1174 $("#pros").attr('aria-valuenow','0');
1160 1175 $("#umbutton").attr('disabled', false);
1161 1176 $("#filecount").text("");
1162   - $("#uploadstatus").text("");
  1177 + $("#uploadstatus").html("");
1163 1178 $("#selectcount").text("");
1164 1179 $("#selectFileUpLoadModelAsAll").removeAttr("checked");
1165 1180 $("#selectFileUpLoadModelAlert").hide();
... ... @@ -1195,16 +1210,15 @@ function showfilepath() {
1195 1210 $("#filepath").val(filename);
1196 1211 }
1197 1212  
1198   -// 检查是否能够上传
  1213 +// 检查文件是否能够上传
1199 1214 function checkUploadFile() {
1200   - if(isUpLoading==false){
  1215 + if(isUpLoading==false && isImporting == false){
1201 1216 if(fs!=null&&fs.length>0){
1202 1217 $("#filepath").attr("disabled","disabled");
1203 1218 $("#umbutton").attr('disabled', true);
1204 1219 isUpLoading=true;
1205 1220 repeModelList=null;
1206   - $("#uploadFileAlert").removeClass("alert");
1207   - $("#uploadFileAlert").removeClass("alert-danger");
  1221 + $("#uploadFileAlert").hide();
1208 1222 $("#uploadFileAlert").text("");
1209 1223 var filenames = new Array();
1210 1224 var maxSize = 0;
... ... @@ -1238,7 +1252,6 @@ function checkUploadFile() {
1238 1252 showUploadFileAlert("提示:您的操作未被授权,无法开始上传");
1239 1253 } else {
1240 1254 var resp=eval("("+result+")");
1241   - uploadKey=resp.uploadKey;
1242 1255 if(resp.checkResult == "fileTooLarge"){
1243 1256 showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传");
1244 1257 }else if(resp.checkResult == "hasExistsNames"){
... ... @@ -1260,6 +1273,8 @@ function checkUploadFile() {
1260 1273 }else{
1261 1274 showUploadFileAlert("提示:您未选择任何文件,无法开始上传");
1262 1275 }
  1276 + }else{
  1277 + showUploadFileAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传");
1263 1278 }
1264 1279 }
1265 1280  
... ... @@ -1279,6 +1294,7 @@ function selectFileUpLoadModelStart(){
1279 1294 $("#repeFileName").text(repeList[repeIndex]);
1280 1295 }
1281 1296  
  1297 +// 设定重名文件的处理方法
1282 1298 function selectFileUpLoadModelEnd(t){
1283 1299 if(repeModelList == null){
1284 1300 repeModelList={};
... ... @@ -1320,7 +1336,6 @@ function doupload(count) {
1320 1336  
1321 1337 fd.append("file", uploadfile);// 将文件对象添加到FormData对象中,字段名为uploadfile
1322 1338 fd.append("folderId", locationpath);
1323   - fd.append("uploadKey", uploadKey);
1324 1339 if(repeModelList != null && repeModelList[fname] != null){
1325 1340 if(repeModelList[fname] == 'skip'){
1326 1341 $("#uls_" + count).text("[已完成]");
... ... @@ -1407,6 +1422,7 @@ function doupload(count) {
1407 1422 }
1408 1423 }
1409 1424  
  1425 +// 显示上传文件进度
1410 1426 function uploadProgress(evt) {
1411 1427 if (evt.lengthComputable) {
1412 1428 // evt.loaded:文件上传的大小 evt.total:文件总的大小
... ... @@ -1421,12 +1437,21 @@ function uploadProgress(evt) {
1421 1437 function showUploadFileAlert(txt) {
1422 1438 isUpLoading=false;
1423 1439 $("#filepath").removeAttr("disabled");
1424   - $("#uploadFileAlert").addClass("alert");
1425   - $("#uploadFileAlert").addClass("alert-danger");
  1440 + $("#uploadFileAlert").show();
1426 1441 $("#uploadFileAlert").text(txt);
1427 1442 $("#umbutton").attr('disabled', false);
1428 1443 }
1429 1444  
  1445 +// 取消上传文件
  1446 +function abortUpload() {
  1447 + isUpLoading=false;
  1448 + if (xhr != null) {
  1449 + xhr.abort();
  1450 + }
  1451 + $('#uploadFileModal').modal('hide');
  1452 + showFolderView(locationpath);
  1453 +}
  1454 +
1430 1455 // 显示下载文件模态框
1431 1456 function showDownloadModel(fileId, fileName) {
1432 1457 $("#downloadFileName").text("提示:您确认要下载文件:[" + fileName + "]么?");
... ... @@ -1571,24 +1596,6 @@ function showRFileAlert(txt) {
1571 1596 $("#newFileNamealert").text(txt);
1572 1597 }
1573 1598  
1574   -// 取消上传
1575   -function abortUpload() {
1576   - isUpLoading=false;
1577   - if (xhr != null) {
1578   - xhr.abort();
1579   - $("#umbutton").attr('disabled', false);
1580   - $("#pros").width("0%");
1581   - $("#pros").attr('aria-valuenow',"0");
1582   - $("#filecount").text("");
1583   - }
1584   - $("#uploadfile").val("");
1585   - $("#filepath").val("");
1586   - $("#uploadstatus").html("");
1587   - $("#selectcount").text("");
1588   - $('#uploadFileModal').modal('hide');
1589   - showFolderView(locationpath);
1590   -}
1591   -
1592 1599 // 获取文件名的后缀名,以小写形式输出
1593 1600 function getSuffix(filename) {
1594 1601 var index1 = filename.lastIndexOf(".");
... ... @@ -1617,6 +1624,11 @@ function txtView(fileId){
1617 1624 window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/" + fileId);
1618 1625 }
1619 1626  
  1627 +// 预览PPT文档
  1628 +function pptView(fileId){
  1629 + window.open("/pdfview/web/viewer.html?file=/resourceController/getPPTView/" + fileId);
  1630 +}
  1631 +
1620 1632 // 查看图片
1621 1633 function showPicture(fileId) {
1622 1634 $.ajax({
... ... @@ -2053,15 +2065,23 @@ function audio_vulome_down(){
2053 2065  
2054 2066 // 按文件名排序
2055 2067 function sortbyfn(){
2056   - $("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom");
2057 2068 $("#sortByCD").removeClass();
2058 2069 $("#sortByFS").removeClass();
2059 2070 $("#sortByCN").removeClass();
  2071 + var order=1;
  2072 + if($("#sortByFN").hasClass('glyphicon-triangle-bottom')){
  2073 + $("#sortByFN").removeClass();
  2074 + $("#sortByFN").addClass("glyphicon glyphicon-triangle-top");
  2075 + order=-1;
  2076 + }else{
  2077 + $("#sortByFN").removeClass();
  2078 + $("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom");
  2079 + }
2060 2080 folderView.fileList.sort(function(v1,v2){
2061   - return v1.fileName.localeCompare(v2.fileName,"zh");
  2081 + return order * v2.fileName.localeCompare(v1.fileName,"zh");
2062 2082 });
2063 2083 folderView.folderList.sort(function(v1,v2){
2064   - return v1.folderName.localeCompare(v2.folderName,"zh");
  2084 + return order * v2.folderName.localeCompare(v1.folderName,"zh");
2065 2085 });
2066 2086 showFolderTable(folderView);
2067 2087 }
... ... @@ -2069,20 +2089,28 @@ function sortbyfn(){
2069 2089 // 按创建日期排序
2070 2090 function sortbycd(){
2071 2091 $("#sortByFN").removeClass();
2072   - $("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom");
2073 2092 $("#sortByFS").removeClass();
2074 2093 $("#sortByCN").removeClass();
  2094 + var order=1;
  2095 + if($("#sortByCD").hasClass('glyphicon-triangle-bottom')){
  2096 + $("#sortByCD").removeClass();
  2097 + $("#sortByCD").addClass("glyphicon glyphicon-triangle-top");
  2098 + order=-1;
  2099 + }else{
  2100 + $("#sortByCD").removeClass();
  2101 + $("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom");
  2102 + }
2075 2103 folderView.fileList.sort(function(v1,v2){
2076 2104 var v1DateStr=v1.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
2077 2105 var v2DateStr=v2.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
2078 2106 var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
2079   - return -1*res;
  2107 + return order * res;
2080 2108 });
2081 2109 folderView.folderList.sort(function(v1,v2){
2082 2110 var v1DateStr=v1.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
2083 2111 var v2DateStr=v2.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
2084 2112 var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
2085   - return -1*res;
  2113 + return order * res;
2086 2114 });
2087 2115 showFolderTable(folderView);
2088 2116 }
... ... @@ -2091,11 +2119,21 @@ function sortbycd(){
2091 2119 function sortbyfs(){
2092 2120 $("#sortByFN").removeClass();
2093 2121 $("#sortByCD").removeClass();
2094   - $("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom");
2095 2122 $("#sortByCN").removeClass();
2096   - folderView.fileList.sort(function(v1,v2){
2097   - return v2.fileSize-v1.fileSize;
2098   - });
  2123 + // 正倒序判断
  2124 + if($("#sortByFS").hasClass("glyphicon-triangle-bottom")){
  2125 + $("#sortByFS").removeClass();
  2126 + $("#sortByFS").addClass("glyphicon glyphicon-triangle-top");
  2127 + folderView.fileList.sort(function(v1,v2){
  2128 + return v2.fileSize - v1.fileSize;
  2129 + });
  2130 + }else{
  2131 + $("#sortByFS").removeClass();
  2132 + $("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom");
  2133 + folderView.fileList.sort(function(v1,v2){
  2134 + return v1.fileSize - v2.fileSize;
  2135 + });
  2136 + }
2099 2137 showFolderTable(folderView);
2100 2138 }
2101 2139  
... ... @@ -2104,12 +2142,20 @@ function sortbycn(){
2104 2142 $("#sortByFN").removeClass();
2105 2143 $("#sortByCD").removeClass();
2106 2144 $("#sortByFS").removeClass();
2107   - $("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom");
  2145 + var order=1;
  2146 + if($("#sortByCN").hasClass('glyphicon-triangle-bottom')){
  2147 + $("#sortByCN").removeClass();
  2148 + $("#sortByCN").addClass("glyphicon glyphicon-triangle-top");
  2149 + order=-1;
  2150 + }else{
  2151 + $("#sortByCN").removeClass();
  2152 + $("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom");
  2153 + }
2108 2154 folderView.fileList.sort(function(v1,v2){
2109   - return v1.fileCreator.localeCompare(v2.fileCreator,"zh");
  2155 + return order * v2.fileCreator.localeCompare(v1.fileCreator,"zh");
2110 2156 });
2111 2157 folderView.folderList.sort(function(v1,v2){
2112   - return v1.folderCreator.localeCompare(v2.folderCreator,"zh");
  2158 + return order * v2.folderCreator.localeCompare(v1.folderCreator,"zh");
2113 2159 });
2114 2160 showFolderTable(folderView);
2115 2161 }
... ... @@ -2447,4 +2493,306 @@ function ping(){
2447 2493 }
2448 2494 }
2449 2495 });
  2496 +}
  2497 +
  2498 +// 判断浏览器是否支持webkitdirectory属性且不为ios系统(判断是否能进行文件夹上传)
  2499 +function isSupportWebkitdirectory() {
  2500 + var testWebkitdirectory = document.createElement("input");
  2501 + if("webkitdirectory" in testWebkitdirectory && !(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent))) {
  2502 + return true;
  2503 + } else {
  2504 + return false;
  2505 + }
  2506 +};
  2507 +
  2508 +// 显示上传文件夹模态框
  2509 +function showUploadFolderModel(){
  2510 + $("#importFolderAlert").hide();
  2511 + $("#importFolderAlert").text("");
  2512 + if(isImporting == false){// 如果未进行上传,则还原上传文件夹的基本状态
  2513 + $("#folderpath").val("");
  2514 + $("#importfolder").val("");
  2515 + $("#importpros").width("0%");
  2516 + $("#importpros").attr('aria-valuenow','0');
  2517 + $("#importstatus").html("");
  2518 + $("#folderpath").attr("disabled",false);
  2519 + $("#importFolderLevelBtn").attr("disabled",false);
  2520 + $("#importcount").text("");
  2521 + $("#importbutton").attr('disabled', false);
  2522 + $("#importfoldertypelist").html("");
  2523 + $("#selectFolderImportModelAlert").hide();
  2524 + if(account!=null){
  2525 + $("#folderpath").attr("folderConstraintLevel",constraintLevel+"");
  2526 + $("#importfoldertype").text(folderTypes[constraintLevel]);
  2527 + for(var i=constraintLevel;i<folderTypes.length;i++){
  2528 + $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType("+i+")'>"+folderTypes[i]+"</a></li>");
  2529 + }
  2530 + }else{
  2531 + $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType(0)'>"+folderTypes[0]+"</a></li>");
  2532 + }
  2533 + }
  2534 + $("#importFolderModal").modal('show');
  2535 +}
  2536 +
  2537 +// 点击上传路径文本框时弹出文件夹选择窗口
  2538 +function checkimportpath(){
  2539 + $('#importfolder').click();
  2540 +}
  2541 +
  2542 +// 用户选择文件夹后回填路径
  2543 +function getInputImport(){
  2544 + ifs = $("#importfolder")[0].files;
  2545 + if(ifs.length > 0) {
  2546 + importFolderName = ifs[0].webkitRelativePath.substring(0, ifs[0].webkitRelativePath.indexOf("/"));
  2547 + $("#folderpath").val(importFolderName);
  2548 + }
  2549 +}
  2550 +
  2551 +// 检查文件夹是否能够上传
  2552 +function checkImportFolder(){
  2553 + if(isUpLoading == false && isImporting ==false){
  2554 + if(ifs != null && ifs.length > 0){// 必须选中文件
  2555 + $("#folderpath").attr("disabled",true);
  2556 + $("#importFolderLevelBtn").attr("disabled",true);
  2557 + $("#importbutton").attr('disabled', true);
  2558 + $("#importFolderAlert").hide();
  2559 + $("#importFolderAlert").text("");
  2560 + isImporting = true;
  2561 + var maxSize = 0;
  2562 + var maxFileIndex = 0;
  2563 + // 找出最大体积的文件避免服务器进行效验
  2564 + for (var i = 0; i < ifs.length; i++) {
  2565 + if(ifs[i].size > maxSize){
  2566 + maxSize = ifs[i].size;
  2567 + maxFileIndex = i;
  2568 + }
  2569 + }
  2570 + // 发送合法性检查请求
  2571 + $.ajax({
  2572 + url:'homeController/checkImportFolder.ajax',
  2573 + type:'POST',
  2574 + dataType:'text',
  2575 + data:{
  2576 + folderName : importFolderName,
  2577 + maxSize : maxSize,
  2578 + folderId : locationpath
  2579 + },
  2580 + success:function(result){
  2581 + var resJson = eval("("+result+")");
  2582 + switch (resJson.result) {
  2583 + case 'noAuthorized':
  2584 + showImportFolderAlert("提示:您的操作未被授权,无法开始上传");
  2585 + break;
  2586 + case 'errorParameter':
  2587 + showImportFolderAlert("提示:参数不正确,无法开始上传");
  2588 + break;
  2589 + case 'mustLogin':
  2590 + window.location.href = "login.html";
  2591 + break;
  2592 + case 'fileOverSize':
  2593 + showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");
  2594 + break;
  2595 + case 'repeatFolder_Both':
  2596 + $("#repeFolderName").text(importFolderName);
  2597 + $("#importcoverbtn").hide();
  2598 + $("#selectFolderImportModelAlert").show();
  2599 + break;
  2600 + case 'repeatFolder_coverOrBoth':
  2601 + $("#repeFolderName").text(importFolderName);
  2602 + $("#importcoverbtn").show();
  2603 + $("#selectFolderImportModelAlert").show();
  2604 + break;
  2605 + case 'permitUpload':
  2606 + iteratorImport(0);// 直接允许上传
  2607 + break;
  2608 + default:
  2609 + showImportFolderAlert("提示:出现意外错误,无法开始上传");
  2610 + break;
  2611 + }
  2612 + },
  2613 + error:function(){
  2614 + showImportFolderAlert("提示:出现意外错误,无法开始上传");
  2615 + }
  2616 + });
  2617 + }else{
  2618 + showImportFolderAlert("提示:您未选择任何文件夹,无法开始上传");
  2619 + }
  2620 + }else{
  2621 + showImportFolderAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传");
  2622 + }
  2623 +}
  2624 +
  2625 +// 显示上传文件夹错误提示
  2626 +function showImportFolderAlert(txt) {
  2627 + isImporting=false;
  2628 + $("#folderpath").attr("disabled",false);
  2629 + $("#importFolderLevelBtn").attr("disabled",false);
  2630 + $("#importFolderAlert").show();
  2631 + $("#importFolderAlert").text(txt);
  2632 + $("#importbutton").attr('disabled', false);
  2633 +}
  2634 +
  2635 +// 显示上传文件夹进度
  2636 +function importProgress(evt) {
  2637 + if (evt.lengthComputable) {
  2638 + // evt.loaded:文件上传的大小 evt.total:文件总的大小
  2639 + var percentComplete = Math.round((evt.loaded) * 100 / evt.total);
  2640 + // 加载进度条,同时显示信息
  2641 + $("#importpros").width(percentComplete + "%");
  2642 + $("#importpros").attr('aria-valuenow',""+percentComplete);
  2643 + }
  2644 +}
  2645 +
  2646 +// 覆盖并上传文件夹
  2647 +function importAndCover() {
  2648 + $("#selectFolderImportModelAlert").hide();
  2649 + $.ajax({
  2650 + url:'homeController/deleteFolderByName.ajax',
  2651 + type:'POST',
  2652 + data:{
  2653 + parentId : locationpath,
  2654 + folderName : importFolderName
  2655 + },
  2656 + dataType:'text',
  2657 + success:function(result){
  2658 + if(result == 'deleteSuccess'){
  2659 + iteratorImport(0);// 若覆盖成功,则开始上传
  2660 + }else{
  2661 + showImportFolderAlert("提示:无法覆盖原文件夹,上传失败");
  2662 + }
  2663 + },
  2664 + error:function(){
  2665 + showImportFolderAlert("提示:无法覆盖原文件夹,上传失败");
  2666 + }
  2667 + });
  2668 +}
  2669 +
  2670 +// 保留两者并上传文件夹
  2671 +function importAndBoth() {
  2672 + $("#selectFolderImportModelAlert").hide();
  2673 + var fc=$("#folderpath").attr("folderConstraintLevel");// 文件夹访问级别
  2674 + $.ajax({
  2675 + url:'homeController/createNewFolderByName.ajax',
  2676 + type:'POST',
  2677 + data:{
  2678 + parentId : locationpath,
  2679 + folderName : importFolderName,
  2680 + folderConstraint : fc
  2681 + },
  2682 + dataType:'text',
  2683 + success:function(result){
  2684 + var resJson = eval("(" + result + ")");
  2685 + if(resJson.result == 'success'){
  2686 + iteratorImport(0,resJson.newName);// 若新建成功,则使用新文件夹名称开始上传
  2687 + }else{
  2688 + showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传");
  2689 + }
  2690 + },
  2691 + error:function(){
  2692 + showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传");
  2693 + }
  2694 + });
  2695 +}
  2696 +
  2697 +// 迭代上传文件夹内的文件(直接上传)
  2698 +function iteratorImport(i,newFolderName){
  2699 + $("#importpros").width("0%");// 先将进度条置0
  2700 + $("#importpros").attr('aria-valuenow',"0");
  2701 + var uploadfile = ifs[i];// 获取要上传的文件
  2702 + var fcount = ifs.length;
  2703 + var fc=$("#folderpath").attr("folderConstraintLevel");// 文件夹访问级别
  2704 + if (uploadfile != null) {
  2705 + var fname = uploadfile.webkitRelativePath;
  2706 + if (fcount > 1) {
  2707 + $("#importcount").text("(" + (i+1) + "/" + fcount + ")");// 显示当前进度
  2708 + }
  2709 + $("#importstatus").prepend(
  2710 + "<p>" + fname + "<span id='ils_" + i
  2711 + + "'>[正在上传...]</span></p>");
  2712 + xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
  2713 +
  2714 + var fd = new FormData();// 用于封装文件数据的对象
  2715 +
  2716 + fd.append("file", uploadfile);// 将文件对象添加到FormData对象中,字段名为uploadfile
  2717 + fd.append("folderId", locationpath);
  2718 + fd.append("folderConstraint",fc);
  2719 + if(!!newFolderName){
  2720 + fd.append("newFolderName",newFolderName);
  2721 + }
  2722 + xhr.open("POST", "homeController/doImportFolder.ajax", true);// 上传目标
  2723 +
  2724 + xhr.upload.addEventListener("progress", importProgress, false);// 这个是对上传进度的监听
  2725 + // 上面的三个参数分别是:事件名(指定名称)、回调函数、是否冒泡(一般是false即可)
  2726 +
  2727 + xhr.send(fd);// 上传FormData对象
  2728 +
  2729 + if(pingInt == null){
  2730 + pingInt = setInterval("ping()",60000);// 上传中开始计时应答
  2731 + }
  2732 +
  2733 + // 上传结束后执行的回调函数
  2734 + xhr.onloadend = function() {
  2735 + // 停止应答计时
  2736 + if(pingInt != null){
  2737 + window.clearInterval(pingInt);
  2738 + pingInt = null;
  2739 + }
  2740 + if (xhr.status === 200) {
  2741 + // TODO 上传成功
  2742 + var result = xhr.responseText;
  2743 + if (result == "uploadsuccess") {
  2744 + $("#ils_" + i).text("[已完成]");
  2745 + var ni=i+1;
  2746 + if(ni < fcount){
  2747 + iteratorImport(ni,newFolderName);
  2748 + }else{
  2749 + // 完成全部上传后,清空所有提示信息,并还原上传窗口
  2750 + isImporting=false;
  2751 + $("#folderpath").removeAttr("disabled");
  2752 + $("#importFolderLevelBtn").removeAttr("disabled");
  2753 + $("#importfolder").val("");
  2754 + $("#folderpath").val("");
  2755 + $("#importpros").width("0%");
  2756 + $("#importpros").attr('aria-valuenow',"0");
  2757 + $("#importbutton").attr('disabled', false);
  2758 + $("#importcount").text("");
  2759 + $("#importstatus").text("");
  2760 + $('#importFolderModal').modal('hide');
  2761 + showFolderView(locationpath);
  2762 + }
  2763 + } else if (result == "uploaderror") {
  2764 + showImportFolderAlert("提示:出现意外错误,文件:[" + fname
  2765 + + "]上传失败,上传被中断。");
  2766 + $("#ils_" + i).text("[失败]");
  2767 + } else {
  2768 + showImportFolderAlert("提示:出现意外错误,文件:[" + fname
  2769 + + "]上传失败,上传被中断。");
  2770 + $("#ils_" + i).text("[失败]");
  2771 + }
  2772 + } else {
  2773 + showImportFolderAlert("提示:出现意外错误,文件:[" + fname + "]上传失败,上传被中断。");
  2774 + $("#ils_" + i).text("[失败]");
  2775 + }
  2776 + };
  2777 + } else {
  2778 + showImportFolderAlert("提示:要上传的文件不存在。");
  2779 + $("#importstatus").prepend(
  2780 + "<p>未找到要上传的文件<span id='ils_" + i + "'>[失败]</span></p>");
  2781 + }
  2782 +}
  2783 +
  2784 +// 取消文件夹上传
  2785 +function abortImport(){
  2786 + isImporting=false;
  2787 + if (xhr != null) {
  2788 + xhr.abort();
  2789 + }
  2790 + $('#importFolderModal').modal('hide');
  2791 + showFolderView(locationpath);
  2792 +}
  2793 +
  2794 +// 修改上传文件夹约束等级
  2795 +function changeImportFolderType(type){
  2796 + $("#importfoldertype").text(folderTypes[type]);
  2797 + $("#folderpath").attr("folderConstraintLevel",type+"");
2450 2798 }
2451 2799 \ 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,"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;$("#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),$.each(a.folderList,function(a,b){b.folderName=b.folderName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;");var e="<tr id='"+b.folderId+"' onclick='checkfile(event,"+'"'+b.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+b.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("+'"'+b.folderId+'"'+")' class='btn btn-link btn-xs'>/"+b.folderName+"</button></td><td class='hiddenColumn'>"+b.folderCreationDate+"</td><td>--</td><td class='hiddenColumn'>"+b.folderCreator+"</td><td>";c&&(e=e+"<button onclick='showDeleteFolderModel("+'"'+b.folderId+'","'+b.folderName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(e=e+"<button onclick='showRenameFolderModel("+'"'+b.folderId+'","'+b.folderName+'",'+b.folderConstraint+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>"),f&&(e=e+"<button onclick='showFolderView("+'"'+b.folderParent+'","'+b.folderId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),d||c||f||(e+="--"),e+="</td></tr>",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var g,h;if(b.fileName=b.fileName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),g="<tr id="+b.fileId+" onclick='checkfile(event,"+'"'+b.fileId+'"'+")' ondblclick='checkConsFile(event,"+'"'+b.fileId+'"'+")' id='"+b.fileId+"' class='filerow'><td>"+b.fileName+"</td><td class='hiddenColumn'>"+b.fileCreationDate+"</td>","0"==b.fileSize?g+="<td>&lt;1MB</td>":g=g+"<td>"+b.fileSize+"MB</td>",g=g+"<td class='hiddenColumn'>"+b.fileCreator+"</td><td>",e)switch(g=g+"<button onclick='showDownloadModel("+'"'+b.fileId+'","'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>",h=getSuffix(b.fileName)){case"mp4":case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":g=g+"<button onclick='playVideo("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"pdf":g=g+"<button onclick='pdfView("+'"'+b.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":g=g+"<button onclick='showPicture("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";break;case"mp3":case"wav":case"ogg":g=g+"<button onclick='playAudio("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"docx":g=g+"<button onclick='docxView("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"txt":g=g+"<button onclick='txtView("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>"}c&&(g=g+"<button onclick='showDeleteFileModel("+'"'+b.fileId+'","'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(g=g+"<button onclick='showRenameFileModel("+'"'+b.fileId+'"'+","+'"'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),f&&(g=g+"<button onclick='showFolderView("+'"'+b.fileParentFolder+'","'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),d||c||e||f||(g+="--"),g+="</td></tr>",$("#foldertable").append(g)}),changeFilesTableStyle()}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"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){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;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)if(null!=fs&&fs.length>0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),filenames=new Array,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+")");uploadKey=resp.uploadKey,"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("提示:您未选择任何文件,无法开始上传")}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),e.append("uploadKey",uploadKey),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),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").addClass("alert"),$("#uploadFileAlert").addClass("alert-danger"),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:空格 引号 / * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function abortUpload(){isUpLoading=!1,null!=xhr&&(xhr.abort(),$("#umbutton").attr("disabled",!1),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#filecount").text("")),$("#uploadfile").val(""),$("#filepath").val(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/fileblocks/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function txtView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b<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;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")
2   -},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(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("<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)}})}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,uploadKey,pingInt,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!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").on("hidden.bs.modal",function(){isUpLoading&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b<folderTypes.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)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 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+" 个文件。")}),$("#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){"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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"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('[/|\\s\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:空格 引号 / * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function 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;
  3 +"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+" 个文件。")}),$("#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=["公开的","仅小组","仅创建者"];
4 4 \ No newline at end of file
... ...
... ... @@ -544,8 +544,12 @@ See https://github.com/adobe-type-tools/cmap-resources
544 544 var modal = document.getElementById('pdf-modal');
545 545 if (url.indexOf("getWordView") >= 0) {
546 546 document.getElementById('doc-type-box').innerHTML="Word";
547   - }else{
  547 + }else if(url.indexOf("getTxtView") >= 0){
548 548 document.getElementById('doc-type-box').innerHTML="TXT";
  549 + }else if(url.indexOf("getPPTView") >= 0){
  550 + document.getElementById('doc-type-box').innerHTML="PPT";
  551 + }else{
  552 + document.getElementById('doc-type-box').innerHTML="未知类型";
549 553 }
550 554 modal.style.display = "block";
551 555 var interval = setInterval(function() {
... ...
1 1 kiftd 使用许可
2 2  
3   -Copyright (c) 2019 青阳龙野 <kohgylw@163.com> (phone:159****3814)
  3 +Copyright © 2019 青阳龙野 <kohgylw@163.com>
4 4  
5   -使用、分发或修改kiftd软件及源代码代表您接受如下条款:
6   -1,任何组织或个人均能够自由、无偿地获得kiftd软件及其源代码的原版拷贝,并对其享有无限制使用的权利——无论是商业的还是非商业的。
7   -2,任何组织或个人均能够自由复制、分发或修改kiftd软件及其源代码,并将其运用于任何用途。修改后的作品之版权由修改者所有。
8   -3,kiftd软件之作者无需为使用该软件及其源代码所造成的任何直接或间接后果承担责任。
9   -4,作者“青阳龙野 kohgylw(E-mail:kohgylw@163.com)”对kiftd的原版java/网页页面源代码、原版java软件程序和页面资源、随发行版程序附带的原版《kiftd说明文档》均具备版权。
10   -5,kiftd软件中涉及的所有第三方软件、工具或插件及其代码,其权利由该资源之作者享有并授予kiftd许可。kiftd作者无需为使用这些资源而造成的直接或间接后果承担责任。
11 5 \ No newline at end of file
  6 +使用、分发或修改kiftd及其程序的源代码均代表您接受如下条款:
  7 +1,任何组织或个人均能够自由、无偿地获得kiftd发行版及其源代码的原版拷贝,并对其享有无限制使用的权利——无论是商业性的还是非商业性的。
  8 +2,任何组织或个人均能够自由复制、分发或修改kiftd发行版及其源代码,并将其用于任何用途。修改后的作品版权由修改者自身享有。
  9 +3,kiftd的作者无需为使用该软件及其源代码所造成的任何直接或间接后果承担责任。
  10 +4,kiftd的作者对kiftd中的全部java源代码、页面文件、js及css文件、jar程序、mybatisResource文件夹内的资源、README.md文件以及随发行版程序附带的原版《kiftd说明文档》享有版权,并作为kiftd软件的版权人。
  11 +5,kiftd软件中涉及的所有第三方软件、工具、图片、插件及其代码,其权利由该资源之作者享有并授予kiftd使用许可。任何单位和个人认为kiftd包含的上述内容可能涉嫌侵犯其合法权益时,应及时向kiftd作者进行书面反馈,并提供其身份证明、权属证明及详细侵权情况的说明,kiftd将会立即移除被控侵权的内容。
  12 +
  13 +版权人信息:
  14 +地址:河北省唐山市路北区兴源里玫瑰庄园6单元602号
  15 +电话:15928143814(此为个人电话,如需对kiftd提出建议或获取支持请发送电子邮件)
  16 +电子邮箱:kohgylw@163.com
12 17 \ No newline at end of file
... ...