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

提交 b06753af238563c378a3938df21e41d5c56364aa

作者 kohgylw
1 个父辈 e9e6ac1f

update to v1.0.17-RELEASE

正在显示 99 个修改的文件 包含 483 行增加169 行删除
... ... @@ -34,7 +34,7 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
34 34 ## kiftd有哪些优势?
35 35 ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 无上传限制——1MB的文档和超过4GB的高清电影资源?均能够随意上传和下载。
36 36  
37   - ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 主流商业网盘特有的高级功能甚至需要收费的功能——文件夹访问权限控制、MP4视频在线影院、MP3音乐在线欣赏、图片文件在线预览、Word & PDF文档在线阅读...kiftd均一一具备,每一份kiftd均是“完全版”。
  37 + ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 主流商业网盘特有的高级功能甚至需要收费的功能——文件夹访问权限控制、多格式视频在线影院、音乐在线欣赏、图片文件在线预览、Word & PDF & TXT文档在线阅读...kiftd均一一具备,每一份kiftd均是“完全版”。
38 38  
39 39 ![mark](https://github.com/KOHGYLW/kiftd-showPicture/blob/master/mark_icon.png?raw=true) 操作系统全兼容——无论是Windows、Linux还是Unix(包括Mac OS X),均可运行使用。
40 40  
... ... @@ -76,12 +76,19 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
76 76  
77 77 > 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
78 78  
79   -### 新版本v1.0.16
80   -_本次更新增加了提高可用性的新功能,同时修复了一些已知问题,推荐所有用户升级。_
81   -+ TXT文档在线预览——众多用户期待已久的TXT文档在线预览功能正式上线。
82   -+ 修正“移动”权限可能导致的越权问题——当用户具备“移动”权限时,可能会恶意移动同名文件并覆盖原文件,从而导致原文件丢失。为避免该漏洞导致的越权现象,现已将其修复为:当用户“粘贴”同名文件时,如仅具备“上传”权限,则能选择“跳过”和“保留两者”;如同时具备“删除”权限,可额外选择“覆盖”,从而避免您的文件丢失。
83   -+ 修正“移动”权限无法被授予全局权限的问题——现在,“移动”也可以被正确设定为全局权限了。
84   -+ 新增MySQL数据库接入时区设置“mysql.timezone”,以解决用户连接MySQL时时区不一致的问题。该问题可能会导致无法接入MySQL,详情请见说明文档中的相关介绍。
  79 +### 新版本v1.0.17
  80 +_本次更新加入了众多用户们一直期待的、较为实用的新功能,同时修复了一些已知问题,进一步增强kiftd的使用体验。推荐所有用户升级。_
  81 ++ 增强在线视频播放——现在,kiftd内置了功能强大的ffmpeg开源多媒体解码引擎。得益于此,所有:mp4、mov、wmv、flv、mkv、webm和avi格式的视频均支持在线播放了。
  82 ++ 全路径搜索——现在,用户除了能够像之前一样直接在本级文件夹内搜索外,还可以通过输入“all:关键字”的方式进行全路径搜索。对于文件数目较多且目录层次较深的用户而言,该功能能够令查找文件变得更加轻松。
  83 ++ 可以分享的“下载链接”——现在,文件的下载链接将动态生成。使用生成的链接进行下载时,可以直接下载指定资源(而无需像之前一样必须登入账户或具备下载权限了)。这样一来,用户便能够将下载链接分享至他人以供下载。
  84 ++ 自定义主界面缩放比例——对于使用高分辨率显示器的用户而言,可以通过自行调整主界面的缩放比例来找到最适合自己操作的显示效果,具体调整方法详见随程序附带的《kiftd说明文档》。
  85 ++ 优化文件列表显示效果——当文件名称过长时会自动换行,避免在窄屏幕上浏览时可能导致的文件列表溢出问题。
  86 ++ 新增了“返回顶部”按钮——当用户浏览得过于“深入”底部(超过2倍屏幕长度)时,该按钮能够将其快速带回页面顶部。
  87 ++ 升级文件和文件夹的命名规则——文件和文件夹的名称不能以“.”开头,且不能包含下列任何字符之一:空格 / \ : * ? " < > | & $ (对于空格,推荐使用“_”代替)。该改进能够令用户更加自由地使用各种语言和字符来命名文件和文件夹。
  88 ++ 修正了搜索框无法输入大写字母的BUG。
  89 ++ 优化了在线播放器页面在移动端的表现效果。
  90 ++ 修复了“打包下载”时,若存在文件夹可能导致文件夹结构压缩不正确的问题。
  91 ++ 其他一些细节优化和问题修复的改进。
85 92  
86 93 > 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
87 94  
... ...
  1 +#<This is the default kiftd account setting file. >
  2 +#Fri Apr 12 17:52:31 CST 2019
  3 +admin.auth=cudrm
  4 +admin.pwd=000000
  5 +authOverall=l
... ...
  1 +#<This is the default kiftd server setting file. >
  2 +#Fri Apr 12 17:52:31 CST 2019
  3 +port=8080
  4 +mustLogin=O
  5 +FS.path=DEFAULT
  6 +log=E
  7 +buff.size=1048576
... ...
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
... ... @@ -77,4 +77,26 @@ body {
77 77 height: 100%;
78 78 margin-top: 15px;
79 79 overflow: hidden;
80   -}
81 80 \ No newline at end of file
  81 +}
  82 +
  83 +.gobacktopbox {
  84 + width: 100%;
  85 + height: 30px;
  86 + position: fixed;
  87 + top: 0;
  88 + left: 0;
  89 +}
  90 +
  91 +.gobacktopbutton {
  92 + width: 150px;
  93 + height: 35px;
  94 + background-color: #FCFCFC;
  95 + color: #104E8B; alpha (Opacity=70);
  96 + -moz-opacity: 0.7;
  97 + opacity: 0.7;
  98 +}
  99 +
  100 +td {
  101 + word-break: break-all;
  102 + word-wrap: break-all;
  103 +}
... ...
1   -@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}
2 1 \ No newline at end of file
  2 +@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}.gobacktopbox{width:100%;height:30px;position:fixed;top:0;left:0}.gobacktopbutton{width:150px;height:35px;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70);-moz-opacity:.7;opacity:.7}td{word-break:break-all;word-wrap:break-all}
3 3 \ No newline at end of file
... ...
... ... @@ -6,7 +6,8 @@
6 6 <meta charset="UTF-8">
7 7 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8 8 <meta name="renderer" content="webkit">
9   -<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  9 +<meta name="viewport"
  10 + content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
10 11 <title>KIFT</title>
11 12 <!-- Bootstrap基本框架 -->
12 13 <link rel="stylesheet" href="css/bootstrap.min.css">
... ... @@ -382,7 +383,8 @@
382 383 全部应用
383 384 </p>
384 385 <p>
385   - <button id="uploadcoverbtn" type="button" class="btn btn-danger btn-sm"
  386 + <button id="uploadcoverbtn" type="button"
  387 + class="btn btn-danger btn-sm"
386 388 onclick="selectFileUpLoadModelEnd('cover')">覆盖</button>
387 389 <button type="button" class="btn btn-default btn-sm"
388 390 onclick="selectFileUpLoadModelEnd('skip')">跳过</button>
... ... @@ -446,7 +448,7 @@
446 448 </h4>
447 449 </div>
448 450 <div class="modal-body">
449   - <h5 id="deleteFileMessage"></h5>
  451 + <h5 id="deleteFileMessage" class="wordbreak"></h5>
450 452 </div>
451 453 <div class="modal-footer">
452 454 <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
... ... @@ -591,7 +593,8 @@
591 593 全部应用
592 594 </p>
593 595 <p>
594   - <button id="movecoverbtn" type="button" class="btn btn-danger btn-sm"
  596 + <button id="movecoverbtn" type="button"
  597 + class="btn btn-danger btn-sm"
595 598 onclick="selectFileMoveModel('cover')">覆盖</button>
596 599 <button type="button" class="btn btn-default btn-sm"
597 600 onclick="selectFileMoveModel('skip')">跳过</button>
... ... @@ -639,6 +642,13 @@
639 642 </div>
640 643 </div>
641 644 <!-- end 文件夹详情模态框 -->
  645 + <!-- 返回顶部按钮(隐藏式) -->
  646 + <div id="gobacktotopbox" class="gobacktopbox text-center hidden">
  647 + <button type="button" onclick="goBackToTop()" class="gobacktopbutton">
  648 + 返回顶部 <span class="glyphicon glyphicon-eject" aria-hidden="true"></span>
  649 + </button>
  650 + </div>
  651 + <!-- end 返回顶部按钮 -->
642 652 </body>
643 653 <!-- jquery基本框架 -->
644 654 <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
... ...
... ... @@ -21,6 +21,8 @@ var viewerPageIndex; // 分页预览图片——已浏览图片页号
21 21 var viewerTotal; // 分页预览图片——总页码数
22 22 var pvl;// 预览图片列表的JSON格式对象
23 23 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 +var winHeight;// 窗口高度
  25 +var uploadKey;// 上传所用的一次性密钥
24 26  
25 27 // 界面功能方法定义
26 28 // 页面初始化
... ... @@ -224,7 +226,7 @@ $(function() {
224 226 $(document).keypress(function (e) {
225 227 if($('.modal.shown').length == 0 || ($('.modal.shown').length == 1 && $('.modal.shown').attr('id') == 'loadingModal')){
226 228 var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
227   - if (isShift(e)) {
  229 + if (isShift(e) && document.activeElement.id != "sreachKeyWordIn") {
228 230 switch (keyCode) {
229 231 case 65:
230 232 checkallfile();
... ... @@ -250,7 +252,7 @@ $(function() {
250 252 break;
251 253  
252 254 default:
253   - break;
  255 + return true;
254 256 }
255 257 return false;
256 258 }
... ... @@ -286,6 +288,25 @@ $(function() {
286 288 $('#downloadModal').on('hidden.bs.modal', function(e) {
287 289 $('#downloadURLCollapse').collapse('hide');
288 290 });
  291 + // 获取窗口高度
  292 + if (window.innerHeight){
  293 + winHeight = window.innerHeight;
  294 + }else if ((document.body) && (document.body.clientHeight)){
  295 + winHeight = document.body.clientHeight;
  296 + }
  297 + // 根据屏幕下拉程度自动显示、隐藏“返回顶部”按钮
  298 + $(window).scroll(function(){
  299 + if($(this).scrollTop() > 2*winHeight){
  300 + $('#gobacktotopbox').removeClass("hidden");
  301 + }else{
  302 + $('#gobacktotopbox').addClass("hidden");
  303 + }
  304 + });
  305 +
  306 + // 打开查看下载链接时,向后台生成/获取下载链接
  307 + $('#downloadURLCollapse').on('shown.bs.collapse', function () {
  308 + getDownloadURL();
  309 + });
289 310 });
290 311  
291 312 // 根据屏幕大小增删表格显示内容
... ... @@ -342,7 +363,7 @@ function getServerOS() {
342 363 }
343 364  
344 365 // 获取实时文件夹视图
345   -function showFolderView(fid) {
  366 +function showFolderView(fid,targetId) {
346 367 startLoading();
347 368 $.ajax({
348 369 type : 'POST',
... ... @@ -353,9 +374,14 @@ function showFolderView(fid) {
353 374 url : 'homeController/getFolderView.ajax',
354 375 success : function(result) {
355 376 endLoading();
356   - if (result == "mustLogin") {
  377 + if(result == "ERROR"){
  378 + doAlert();
  379 + $("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  380 + $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  381 + $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  382 + } else if (result == "mustLogin") {
357 383 window.location.href = "login.html";
358   - }else if(result == "notAccess"){
  384 + } else if(result == "notAccess"){
359 385 window.location.href="/";
360 386 } else {
361 387 folderView = eval("(" + result + ")");
... ... @@ -373,6 +399,10 @@ function showFolderView(fid) {
373 399 $("#sortByFS").removeClass();
374 400 $("#sortByCN").removeClass();
375 401 showFolderTable(folderView);
  402 + if(targetId != null && targetId.length > 0){
  403 + $("#"+targetId).addClass("info");
  404 + $("html,body").animate({scrollTop:$("#"+targetId).offset().top - $(window).height()/2},'slow');
  405 + }
376 406 }
377 407 },
378 408 error : function() {
... ... @@ -549,11 +579,17 @@ function showParentList(folderView) {
549 579 }else{
550 580 $("#currentFolderName").text(f.folderName);
551 581 }
552   - if(f.folderName=="ROOT"){
  582 + if(f.folderName == "ROOT"){
553 583 $("#folderIconSpan").removeClass("glyphicon-folder-close");
  584 + $("#folderIconSpan").removeClass("glyphicon-search");
554 585 $("#folderIconSpan").addClass("glyphicon-home");
  586 + }else if(folderView.keyWorld != null){
  587 + $("#folderIconSpan").removeClass("glyphicon-folder-close");
  588 + $("#folderIconSpan").removeClass("glyphicon-home");
  589 + $("#folderIconSpan").addClass("glyphicon-search");
555 590 }else{
556 591 $("#folderIconSpan").removeClass("glyphicon-home");
  592 + $("#folderIconSpan").removeClass("glyphicon-search");
557 593 $("#folderIconSpan").addClass("glyphicon-folder-close");
558 594 }
559 595 }
... ... @@ -672,6 +708,7 @@ function showFolderTable(folderView) {
672 708 var aD = false;
673 709 var aR = false;
674 710 var aL = false;
  711 + var aO = false;
675 712 if (checkAuth(authList, "D")) {
676 713 aD = true;
677 714 }
... ... @@ -681,6 +718,9 @@ function showFolderTable(folderView) {
681 718 if (checkAuth(authList, "L")) {
682 719 aL = true;
683 720 }
  721 + if (checkAuth(authList, "O")){
  722 + aO = true;
  723 + }
684 724 $
685 725 .each(
686 726 folderView.folderList,
... ... @@ -712,7 +752,17 @@ function showFolderTable(folderView) {
712 752 + f.folderConstraint
713 753 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
714 754 }
715   - if (!aR && !aD) {
  755 + if (aO) {
  756 + folderRow = folderRow
  757 + + "<button onclick='showFolderView("
  758 + + '"'
  759 + + f.folderParent
  760 + + '","'
  761 + + f.folderId
  762 + + '"'
  763 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
  764 + }
  765 + if (!aR && !aD && !aO) {
716 766 folderRow = folderRow + "--";
717 767 }
718 768 folderRow = folderRow + "</td></tr>";
... ... @@ -722,7 +772,7 @@ function showFolderTable(folderView) {
722 772 .each(
723 773 folderView.fileList,
724 774 function(n, fi) {
725   - var fileRow = "<tr onclick='checkfile(event," + '"'
  775 + var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
726 776 + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
727 777 + "' class='filerow'><td>" + fi.fileName
728 778 + "</td><td class='hiddenColumn'>" + fi.fileCreationDate + "</td>";
... ... @@ -742,55 +792,70 @@ function showFolderTable(folderView) {
742 792 + '"'
743 793 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
744 794 // 对于各种特殊格式文件提供的预览和播放功能
745   - if (getSuffix(fi.fileName) == "mp4"
746   - || getSuffix(fi.fileName) == "webm" || getSuffix(fi.fileName) == "mov") {
  795 + var suffix=getSuffix(fi.fileName);
  796 + switch (suffix) {
  797 + case "mp4":
  798 + case "webm":
  799 + case "mov":
  800 + case "avi":
  801 + case "wmv":
  802 + case "mkv":
  803 + case "flv":
747 804 fileRow = fileRow
748   - + "<button onclick='playVideo("
749   - + '"'
750   - + fi.fileId
751   - + '"'
752   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
753   - } else if (getSuffix(fi.fileName) == "pdf") {
  805 + + "<button onclick='playVideo("
  806 + + '"'
  807 + + fi.fileId
  808 + + '"'
  809 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  810 + break;
  811 + case "pdf":
754 812 fileRow = fileRow
755   - + "<button onclick='pdfView("
756   - + '"'
757   - + fi.filePath
758   - + '"'
759   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
760   - } else if (getSuffix(fi.fileName) == "jpg"
761   - || getSuffix(fi.fileName) == "jpeg"
762   - || getSuffix(fi.fileName) == "gif"
763   - || getSuffix(fi.fileName) == "png"
764   - || getSuffix(fi.fileName) == "bmp") {
  813 + + "<button onclick='pdfView("
  814 + + '"'
  815 + + fi.filePath
  816 + + '"'
  817 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  818 + break;
  819 + case "jpg":
  820 + case "jpeg":
  821 + case "gif":
  822 + case "png":
  823 + case "bmp":
765 824 fileRow = fileRow
766   - + "<button onclick='showPicture("
767   - + '"'
768   - + fi.fileId
769   - + '"'
770   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
771   - } else if (getSuffix(fi.fileName) == "mp3"
772   - || getSuffix(fi.fileName) == "wav"
773   - || getSuffix(fi.fileName) == "ogg") {
  825 + + "<button onclick='showPicture("
  826 + + '"'
  827 + + fi.fileId
  828 + + '"'
  829 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
  830 + break;
  831 + case "mp3":
  832 + case "wav":
  833 + case "ogg":
774 834 fileRow = fileRow
775   - + "<button onclick='playAudio("
776   - + '"'
777   - + fi.fileId
778   - + '"'
779   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
780   - } else if(getSuffix(fi.fileName) == "docx"){
  835 + + "<button onclick='playAudio("
  836 + + '"'
  837 + + fi.fileId
  838 + + '"'
  839 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  840 + break;
  841 + case "docx":
781 842 fileRow = fileRow
782   - + "<button onclick='docxView("
783   - + '"'
784   - + fi.fileId
785   - + '"'
786   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
787   - } else if(getSuffix(fi.fileName) == "txt"){
  843 + + "<button onclick='docxView("
  844 + + '"'
  845 + + fi.fileId
  846 + + '"'
  847 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  848 + break;
  849 + case "txt":
788 850 fileRow = fileRow
789 851 + "<button onclick='txtView("
790 852 + '"'
791 853 + fi.fileId
792 854 + '"'
793 855 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  856 + break;
  857 + default:
  858 + break;
794 859 }
795 860 }
796 861 if (aD) {
... ... @@ -815,7 +880,17 @@ function showFolderTable(folderView) {
815 880 + '"'
816 881 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
817 882 }
818   - if (!aR && !aD && !aL) {
  883 + if (aO) {
  884 + fileRow = fileRow
  885 + + "<button onclick='showFolderView("
  886 + + '"'
  887 + + fi.fileParentFolder
  888 + + '","'
  889 + + fi.fileId
  890 + + '"'
  891 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
  892 + }
  893 + if (!aR && !aD && !aL && !aO) {
819 894 fileRow = fileRow + "--";
820 895 }
821 896 fileRow = fileRow + "</td></tr>";
... ... @@ -841,12 +916,12 @@ function changeNewFolderType(type){
841 916 function createfolder() {
842 917 var fn = $("#foldername").val();
843 918 var fc=$("#foldername").attr("folderConstraintLevel");
844   - var reg = new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$", "g");
  919 + var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g");
845 920 if (fn.length == 0) {
846 921 showFolderAlert("提示:文件夹名称不能为空。");
847 922 } else if (fn.length > 20) {
848 923 showFolderAlert("提示:文件夹名称太长。");
849   - } else if (reg.test(fn)) {
  924 + } else if (!reg.test(fn) && fn.indexOf(".") != 0) {
850 925 $("#folderalert").removeClass("alert");
851 926 $("#folderalert").removeClass("alert-danger");
852 927 $("#foldernamebox").removeClass("has-error");
... ... @@ -886,7 +961,7 @@ function createfolder() {
886 961 }
887 962 });
888 963 } else {
889   - showFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。");
  964 + showFolderAlert("提示:文件夹名中不应含有:空格 引号 / \ * | < > & $ : ? 且不能以“.”开头。");
890 965 }
891 966 }
892 967  
... ... @@ -975,12 +1050,12 @@ function changeEditFolderType(type){
975 1050 function renameFolder(folderId) {
976 1051 var newName = $("#newfoldername").val();
977 1052 var fc=$("#newfoldername").attr("folderConstraintLevel");
978   - var reg = new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$", "g");
  1053 + var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g");
979 1054 if (newName.length == 0) {
980 1055 showRFolderAlert("提示:文件夹名称不能为空。");
981 1056 } else if (newName.length > 20) {
982 1057 showRFolderAlert("提示:文件夹名称太长。");
983   - } else if (reg.test(newName)) {
  1058 + } else if (!reg.test(newName) && newName.indexOf(".") != 0) {
984 1059 $("#newfolderalert").removeClass("alert");
985 1060 $("#newfolderalert").removeClass("alert-danger");
986 1061 $("#folderrenamebox").removeClass("has-error");
... ... @@ -1017,7 +1092,7 @@ function renameFolder(folderId) {
1017 1092 }
1018 1093 });
1019 1094 } else {
1020   - showRFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。");
  1095 + showRFolderAlert("提示:文件夹名中不应含有:空格 引号 / \ * | < > & $ : ? 且不能以“.”开头。");
1021 1096 }
1022 1097 }
1023 1098  
... ... @@ -1111,14 +1186,18 @@ function checkUploadFile() {
1111 1186 showUploadFileAlert("提示:参数不正确,无法开始上传");
1112 1187 } else if (result == "noAuthorized") {
1113 1188 showUploadFileAlert("提示:您的操作未被授权,无法开始上传");
1114   - } else if (result.startsWith("duplicationFileName:")) {
1115   - repeList=eval("("+result.substring(20)+")");
1116   - repeIndex=0;
1117   - selectFileUpLoadModelStart();
1118   - } else if (result == "permitUpload") {
1119   - doupload(1);
1120 1189 } else {
1121   - showUploadFileAlert("提示:出现意外错误,无法开始上传");
  1190 + var resp=eval("("+result+")");
  1191 + uploadKey=resp.uploadKey;
  1192 + if(resp.checkResult == "hasExistsNames"){
  1193 + repeList=resp.pereFileNameList;
  1194 + repeIndex=0;
  1195 + selectFileUpLoadModelStart();
  1196 + }else if(resp.checkResult == "permitUpload"){
  1197 + doupload(1);
  1198 + }else {
  1199 + showUploadFileAlert("提示:出现意外错误,无法开始上传");
  1200 + }
1122 1201 }
1123 1202 }
1124 1203 },
... ... @@ -1189,6 +1268,7 @@ function doupload(count) {
1189 1268  
1190 1269 fd.append("file", uploadfile);// 将文件对象添加到FormData对象中,字段名为uploadfile
1191 1270 fd.append("folderId", locationpath);
  1271 + fd.append("uploadKey", uploadKey);
1192 1272 if(repeModelList != null && repeModelList[fname] != null){
1193 1273 if(repeModelList[fname] == 'skip'){
1194 1274 $("#uls_" + count).text("[已完成]");
... ... @@ -1288,14 +1368,16 @@ function showUploadFileAlert(txt) {
1288 1368  
1289 1369 // 显示下载文件模态框
1290 1370 function showDownloadModel(fileId, fileName) {
1291   - $("#downloadModal").modal('toggle');
1292 1371 $("#downloadFileName").text("提示:您确认要下载文件:[" + fileName + "]么?");
1293   - $("#downloadHrefBox").html("<a href='"+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+fileId+"'>"+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+fileId+"</a>");
  1372 + $("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>");
  1373 + getDownloadFileId=fileId;
  1374 + getDownloadFileName=fileName;
1294 1375 $("#downloadFileBox")
1295 1376 .html(
1296 1377 "<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload("
1297 1378 + '"' + fileId + '"' + ")'>开始下载</button>");
1298 1379 $("#dlmbutton").attr('disabled', false);
  1380 + $("#downloadModal").modal('show');
1299 1381 }
1300 1382  
1301 1383 // 执行下载操作
... ... @@ -1372,7 +1454,7 @@ function showRenameFileModel(fileId, fileName) {
1372 1454  
1373 1455 // 修改文件名
1374 1456 function renameFile(fileId) {
1375   - var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>" + '"' + "]+", "g");
  1457 + var reg = new RegExp("[\/\|\\s\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g");
1376 1458 var newFileName = $("#newfilename").val();
1377 1459 if (newFileName.length > 0) {
1378 1460 if (newFileName.length < 128) {
... ... @@ -1410,7 +1492,7 @@ function renameFile(fileId) {
1410 1492 }
1411 1493 });
1412 1494 } else {
1413   - showRFileAlert("提示:文件名中不应含有:空格 引号 / \ * | < > 且不能以“.”开头。");
  1495 + showRFileAlert("提示:文件名中不应含有:空格 引号 / \ * | < > & $ : ? 且不能以“.”开头。");
1414 1496 }
1415 1497 } else {
1416 1498 showRFileAlert("提示:文件名称太长。");
... ... @@ -1469,6 +1551,7 @@ function docxView(fileId){
1469 1551 window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/" + fileId);
1470 1552 }
1471 1553  
  1554 +// 预览TXT文档
1472 1555 function txtView(fileId){
1473 1556 window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/" + fileId);
1474 1557 }
... ... @@ -2146,36 +2229,131 @@ var screenedFoldrView;// 经过排序的文件视图
2146 2229  
2147 2230 // 执行搜索功能
2148 2231 function doSearchFile(){
2149   - startLoading();
2150   - try{
2151   - var keyworld=$("#sreachKeyWordIn").val();
2152   - if(keyworld.length!=0){
2153   - var reg=new RegExp(keyworld+"+");
2154   - screenedFoldrView=$.extend(true, {}, originFolderView);
2155   - screenedFoldrView.folderList=[];
2156   - screenedFoldrView.fileList=[];
2157   - for(var i=0,j=originFolderView.folderList.length;i<j;i++){
2158   - if(reg.test(originFolderView.folderList[i].folderName)){
2159   - screenedFoldrView.folderList.push(originFolderView.folderList[i]);
2160   - }
2161   - }
2162   - for(var i=0,j=originFolderView.fileList.length;i<j;i++){
2163   - if(reg.test(originFolderView.fileList[i].fileName)){
2164   - screenedFoldrView.fileList.push(originFolderView.fileList[i]);
2165   - }
2166   - }
2167   - $("#sortByFN").removeClass();
2168   - $("#sortByCD").removeClass();
2169   - $("#sortByFS").removeClass();
2170   - $("#sortByCN").removeClass();
2171   - folderView=$.extend(true, {}, screenedFoldrView);
2172   - showFolderTable(folderView);
  2232 + var keyworld=$("#sreachKeyWordIn").val();
  2233 + if(keyworld.length!=0){
  2234 + // 如果用户在搜索字段中声明了全局搜索
  2235 + if(keyworld.startsWith("all:") || keyworld.startsWith("all:")){
  2236 + selectInCompletePath(keyworld.substring(4));
  2237 + }else{
  2238 + startLoading();
  2239 + selectInThisPath(keyworld);// 否则,均在本级下搜索
  2240 + endLoading();
  2241 + }
  2242 + }else{
  2243 + if(folderView.keyWorld != null){
  2244 + showFolderView(locationpath);
2173 2245 }else{
2174 2246 screenedFoldrView=null;
2175 2247 showOriginFolderView();
2176 2248 }
  2249 + }
  2250 +}
  2251 +
  2252 +// 在本级内搜索
  2253 +function selectInThisPath(keyworld){
  2254 + try{
  2255 + var reg=new RegExp(keyworld+"+");
  2256 + screenedFoldrView=$.extend(true, {}, originFolderView);
  2257 + screenedFoldrView.folderList=[];
  2258 + screenedFoldrView.fileList=[];
  2259 + for(var i=0,j=originFolderView.folderList.length;i<j;i++){
  2260 + if(reg.test(originFolderView.folderList[i].folderName)){
  2261 + screenedFoldrView.folderList.push(originFolderView.folderList[i]);
  2262 + }
  2263 + }
  2264 + for(var i=0,j=originFolderView.fileList.length;i<j;i++){
  2265 + if(reg.test(originFolderView.fileList[i].fileName)){
  2266 + screenedFoldrView.fileList.push(originFolderView.fileList[i]);
  2267 + }
  2268 + }
  2269 + $("#sortByFN").removeClass();
  2270 + $("#sortByCD").removeClass();
  2271 + $("#sortByFS").removeClass();
  2272 + $("#sortByCN").removeClass();
  2273 + folderView=$.extend(true, {}, screenedFoldrView);
  2274 + showFolderTable(folderView);
2177 2275 }catch(e){
2178 2276 alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。");
2179 2277 }
2180   - endLoading();
  2278 +}
  2279 +
  2280 +// 全路径查找
  2281 +function selectInCompletePath(keyworld){
  2282 + if(keyworld.length == 0){
  2283 + showFolderView(locationpath);
  2284 + return;
  2285 + }
  2286 + startLoading();
  2287 + $.ajax({
  2288 + type : 'POST',
  2289 + dataType : 'text',
  2290 + data : {
  2291 + fid : locationpath,
  2292 + keyworld : keyworld
  2293 + },
  2294 + url : 'homeController/sreachInCompletePath.ajax',
  2295 + success : function(result) {
  2296 + endLoading();
  2297 + if(result == "ERROR"){
  2298 + doAlert();
  2299 + $("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2300 + $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2301 + $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2302 + } else if (result == "mustLogin") {
  2303 + window.location.href = "login.html";
  2304 + } else if(result == "notAccess"){
  2305 + window.location.href="/";
  2306 + } else {
  2307 + folderView = eval("(" + result + ")");
  2308 + locationpath = folderView.folder.folderId;
  2309 + parentpath = folderView.folder.folderParent;
  2310 + constraintLevel=folderView.folder.folderConstraint;
  2311 + screenedFoldrView=null;
  2312 + $("#sreachKeyWordIn").val("all:" + folderView.keyWorld);
  2313 + showParentList(folderView);
  2314 + showAccountView(folderView);
  2315 + showPublishTime(folderView);
  2316 + originFolderView=$.extend(true, {}, folderView);
  2317 + $("#sortByFN").removeClass();
  2318 + $("#sortByCD").removeClass();
  2319 + $("#sortByFS").removeClass();
  2320 + $("#sortByCN").removeClass();
  2321 + showFolderTable(folderView);
  2322 + }
  2323 + },
  2324 + error : function() {
  2325 + endLoading();
  2326 + doAlert();
  2327 + $("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2328 + $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2329 + $("#parentlistbox")
  2330 + .html("<span class='graytext'>获取失败,请尝试刷新</span>");
  2331 + }
  2332 + });
  2333 +}
  2334 +
  2335 +// 返回顶部实现
  2336 +function goBackToTop(){
  2337 + $('html,body').animate({scrollTop: 0},'slow');
  2338 +}
  2339 +
  2340 +var getDownloadFileId;// 下载链接的文件ID
  2341 +var getDownloadFileName;// 下载链接的文件名(便于下载工具识别)
  2342 +
  2343 +// 获取某一文件的下载链接
  2344 +function getDownloadURL(){
  2345 + $.ajax({
  2346 + url:'externalLinksController/getDownloadKey.ajax',
  2347 + type:'POST',
  2348 + dataType:'text',
  2349 + data:{
  2350 + fId:getDownloadFileId
  2351 + },
  2352 + success:function(result){
  2353 + $("#downloadHrefBox").html("<a href='"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+result+"'>"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+result+"</a>");
  2354 + },
  2355 + error:function(){
  2356 + $("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>");
  2357 + }
  2358 + });
2181 2359 }
2182 2360 \ 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){startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){endLoading(),"mustLogin"==result?window.location.href="login.html":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView))},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},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append("<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").addClass("glyphicon-home")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#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;$("#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,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),$.each(a.folderList,function(a,b){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>"),d||c||(e+="--"),e+="</td></tr>",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var f="<tr 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?f+="<td>&lt;1MB</td>":f=f+"<td>"+b.fileSize+"MB</td>",f=f+"<td class='hiddenColumn'>"+b.fileCreator+"</td><td>",e&&(f=f+"<button onclick='showDownloadModel("+'"'+b.fileId+'","'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>","mp4"==getSuffix(b.fileName)||"webm"==getSuffix(b.fileName)||"mov"==getSuffix(b.fileName)?f=f+"<button onclick='playVideo("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>":"pdf"==getSuffix(b.fileName)?f=f+"<button onclick='pdfView("+'"'+b.filePath+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>":"jpg"==getSuffix(b.fileName)||"jpeg"==getSuffix(b.fileName)||"gif"==getSuffix(b.fileName)||"png"==getSuffix(b.fileName)||"bmp"==getSuffix(b.fileName)?f=f+"<button onclick='showPicture("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>":"mp3"==getSuffix(b.fileName)||"wav"==getSuffix(b.fileName)||"ogg"==getSuffix(b.fileName)?f=f+"<button onclick='playAudio("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>":"docx"==getSuffix(b.fileName)?f=f+"<button onclick='docxView("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>":"txt"==getSuffix(b.fileName)&&(f=f+"<button onclick='txtView("+'"'+b.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>")),c&&(f=f+"<button onclick='showDeleteFileModel("+'"'+b.fileId+'","'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(f=f+"<button onclick='showRenameFileModel("+'"'+b.fileId+'"'+","+'"'+b.fileName+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),d||c||e||(f+="--"),f+="</td></tr>",$("#foldertable").append(f)}),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("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>20?showFolderAlert("提示:文件夹名称太长。"):c.test(a)?($("#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("提示:出现意外错误,可能未能创建文件夹")}})):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("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>20?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)?($("#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("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}})):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,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,i=0;i<fs.length;i++)filenames[i]=fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi,"$1");namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist},url:"homeController/checkUploadFile.ajax",success:function(result){"mustLogin"==result?window.location.href="login.html":"errorParameter"==result?showUploadFileAlert("提示:参数不正确,无法开始上传"):"noAuthorized"==result?showUploadFileAlert("提示:您的操作未被授权,无法开始上传"):result.startsWith("duplicationFileName:")?(repeList=eval("("+result.substring(20)+")"),repeIndex=0,selectFileUpLoadModelStart()):"permitUpload"==result?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),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),xhr.onloadend=function(){if(200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<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){$("#downloadModal").modal("toggle"),$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("<a href='"+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+a+"'>"+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+a+"</a>"),$("#downloadFileBox").html("<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload(\""+a+'"'+")'>开始下载</button>"),$("#dlmbutton").attr("disabled",!1)}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+")")},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)
2   -}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("<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 ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("<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,b,c,d;startLoading();try{if(a=$("#sreachKeyWordIn").val(),0!=a.length){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)}else screenedFoldrView=null,showOriginFolderView()}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}endLoading()}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,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(),showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#accountid").val(""),$("#accountpwd").val("")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b<folderTypes.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)){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()}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")})}),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":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView),null!=targetId&&targetId.length>0&&($("#"+targetId).addClass("info"),$("html,body").animate({scrollTop:$("#"+targetId).offset().top-$(window).height()/2},"slow")))},error:function(){endLoading(),doAlert(),$("#tb").html("<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},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append("<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){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 h,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>";if("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>20?showFolderAlert("提示:文件夹名称太长。"):c.test(a)||0==a.indexOf(".")?showFolderAlert("提示:文件夹名中不应含有:空格 引号 / * | < > & $ : ? 且不能以“.”开头。"):($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showFolderAlert("提示:您的操作未被授权,创建文件夹失败。"):"errorParameter"==a?showFolderAlert("提示:参数不正确,创建文件夹失败。"):"cannotCreateFolder"==a?showFolderAlert("提示:出现意外错误,可能未能创建文件夹。"):"nameOccupied"==a?showFolderAlert("提示:该名称已被占用,请选取其他名称。"):"createFolderSuccess"==a?($("#newFolderModal").modal("hide"),showFolderView(locationpath)):($("#newFolderModal").modal("hide"),showFolderView(locationpath))},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}}))}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html("<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>20?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)||0==b.indexOf(".")?showRFolderAlert("提示:文件夹名中不应含有:空格 引号 / * | < > & $ : ? 且不能以“.”开头。"):($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}}))}function showRFolderAlert(a){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;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,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,i=0;i<fs.length;i++)filenames[i]=fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi,"$1");namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist},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,"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),xhr.onloadend=function(){if(200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<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,$("#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+")")},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")
  3 +}function deleteAllChecked(){var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("<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 ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("<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?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>")}})}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,uploadKey,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<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(),showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#accountid").val(""),$("#accountpwd").val("")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b<folderTypes.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=["公开的","仅小组","仅创建者"];
4 4 \ No newline at end of file
... ...
  1 +/**
  2 + * Kplayer播放器内置功能
  3 + */
  4 +var tReq;
  5 +var tTimer;
  6 +$(function() {
  7 + window.onresize = function(){
  8 + showCloseBtn();
  9 + }
  10 + var fileId = getFileId();
  11 + $
  12 + .ajax({
  13 + url : 'homeController/playVideo.ajax',
  14 + type : 'POST',
  15 + dataType : 'text',
  16 + data : {
  17 + fileId : fileId
  18 + },
  19 + success : function(result) {
  20 + if (result != "ERROR") {
  21 + f = eval("(" + result + ")");
  22 + $("#vname").text(f.fileName);
  23 + $("#vcreator").text(f.fileCreator);
  24 + $("#vcdate").text(f.fileCreationDate);
  25 + $("#vsize").text(f.fileSize);
  26 + if (f.needEncode == "N") {
  27 + playVideo();
  28 + } else {
  29 + $("#playerMassage")
  30 + .html(
  31 + "<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>");
  32 + doTranscode();
  33 + }
  34 + } else {
  35 + alert("错误:无法定位要预览的文件或该操作未被授权。");
  36 + reMainPage();
  37 + }
  38 + },
  39 + error : function() {
  40 + alert("错误:请求失败,请刷新重试。");
  41 + reMainPage();
  42 + }
  43 + });
  44 +});
  45 +// 获取URL上的视频id参数,它必须是第一个参数。
  46 +function getFileId() {
  47 + var url = location.search;
  48 + if (url.indexOf("?") != -1) {
  49 + var str = url.substr(1);
  50 + strs = str.split("=");
  51 + return strs[1];
  52 + }
  53 + return "";
  54 +}
  55 +// 显示视屏信息并播放视频
  56 +function playVideo() {
  57 + $("#playerbox")
  58 + .html(
  59 + "<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'>"
  60 + + "<source src='resourceController/getResource.do?fid="
  61 + + f.fileId + "' type='video/mp4'></video>");
  62 + var player = videojs('kiftplayer');
  63 + player.ready(function() {
  64 + this.play();
  65 + });
  66 +}
  67 +
  68 +// 关闭当前窗口并释放播放器
  69 +function reMainPage() {
  70 + if(tReq != null){
  71 + tReq.abort()
  72 + }
  73 + if(tTimer != null){
  74 + window.clearTimeout(tTimer);
  75 + }
  76 + window.opener = null;
  77 + window.open('', '_self');
  78 + window.close();
  79 +}
  80 +
  81 +// 进行转码请求并监听进度状态(轮询)
  82 +function doTranscode() {
  83 + tReq=$.ajax({
  84 + url : 'resourceController/getVideoTranscodeStatus.ajax',
  85 + type : 'POST',
  86 + dataType : 'text',
  87 + data : {
  88 + fileId : f.fileId
  89 + },
  90 + success : function(result) {
  91 + if (result == "FIN") {
  92 + playVideo();
  93 + } else if (result == "ERROR") {
  94 + alert("错误:请求失败,请刷新重试。");
  95 + reMainPage();
  96 + } else {
  97 + $("#transcodeProgress").text(result);
  98 + tTimer=setTimeout('doTranscode()', 500);// 每隔1秒询问一次进度
  99 + }
  100 + },
  101 + error : function() {
  102 + alert("错误:请求失败,请刷新重试。");
  103 + reMainPage();
  104 + }
  105 + });
  106 +}
  107 +
  108 +function showCloseBtn(){
  109 + var win = $(window).width();
  110 + if(win < 450){
  111 + $("#closeBtn").addClass("hidden");
  112 + }else{
  113 + $("#closeBtn").removeClass("hidden");
  114 + }
  115 +}
0 116 \ No newline at end of file
... ...
  1 +function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource.do?fid="+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer");a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}var tReq,tTimer;$(function(){window.onresize=function(){showCloseBtn()};var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
0 2 \ No newline at end of file
... ...
... ... @@ -16,6 +16,26 @@
16 16 <script src="js/html5shiv.min.js"></script>
17 17 <script src="js/respond.min.js"></script>
18 18 <![endif]-->
  19 +<style type="text/css">
  20 +@media only screen and (max-width: 992px) {
  21 + #kiftplayer {
  22 + width: 100%;
  23 + height: 400px;
  24 + }
  25 +}
  26 +
  27 +@media only screen and (max-width: 768px) {
  28 + #kiftplayer {
  29 + height: 300px;
  30 + }
  31 +}
  32 +
  33 +@media only screen and (max-width: 488px) {
  34 + #kiftplayer {
  35 + height: 230px;
  36 + }
  37 +}
  38 +</style>
19 39 </head>
20 40  
21 41 <body>
... ... @@ -26,7 +46,8 @@
26 46 <div class="titlebox">
27 47 <span class="titletext"><em> 青阳网络视频播放器 <small><span
28 48 class="graytext">KIFT-Player</span></small></em></span>
29   - <button class="btn btn-link rightbtn" onclick="reMainPage()">
  49 + <button id="closeBtn" class="btn btn-link rightbtn"
  50 + onclick="reMainPage()">
30 51 关闭 <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
31 52 </button>
32 53 </div>
... ... @@ -46,7 +67,12 @@
46 67 <br />
47 68 <!-- 播放窗口组件位置 -->
48 69 <div id="playerbox" class="col-md-12">
49   - <p>加载中...</p>
  70 + <div class="text-center">
  71 + <img alt="loading..." src="css/loading.gif">
  72 + </div>
  73 + <div class="text-center" id="playerMassage">
  74 + <h2>加载中...</h2>
  75 + </div>
50 76 </div>
51 77 </div>
52 78 </div>
... ... @@ -57,62 +83,5 @@
57 83 <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
58 84 <script type="text/javascript" src="js/bootstrap.min.js"></script>
59 85 <script type="text/javascript" src="js/video.min.js"></script>
60   -<script type="text/javascript">
61   - $(function() {
62   - var fileId = getFileId();
63   - $.ajax({
64   - url : 'homeController/playVideo.ajax',
65   - type : 'POST',
66   - dataType : 'text',
67   - data : {
68   - fileId : fileId
69   - },
70   - success : function(result) {
71   - if (result != "ERROR") {
72   - var f = eval("(" + result + ")");
73   - playVideo(f);
74   - } else {
75   - alert("错误:无法定位要预览的文件或该操作未被授权。");
76   - reMainPage();
77   - }
78   - },
79   - error : function() {
80   - alert("错误:请求失败,请刷新重试。");
81   - reMainPage();
82   - }
83   - });
84   - });
85   - //获取URL上的图片id参数,它必须是第一个参数。
86   - function getFileId() {
87   - var url = location.search;
88   - if (url.indexOf("?") != -1) {
89   - var str = url.substr(1);
90   - strs = str.split("=");
91   - return strs[1];
92   - }
93   - return "";
94   - }
95   - //显示视屏信息并播放视频
96   - function playVideo(f) {
97   - $("#vname").text(f.fileName);
98   - $("#vcreator").text(f.fileCreator);
99   - $("#vcdate").text(f.fileCreationDate);
100   - $("#vsize").text(f.fileSize);
101   - $("#playerbox")
102   - .html(
103   - "<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'>"
104   - + "<source src='resourceController/getResource.do?fid="+f.fileId+"' type='video/mp4'>"
105   - + "<source src='resourceController/getResource.do?fid="+f.fileId+"' type='video/webm'>"
106   - + "</video>");
107   - var player = videojs('kiftplayer');
108   - player.ready(function() {
109   - this.play();
110   - });
111   - }
112   - function reMainPage() {
113   - window.opener = null;
114   - window.open('', '_self');
115   - window.close();
116   - }
117   -</script>
  86 +<script type="text/javascript" src="quickview/kplayer.min.js"></script>
118 87 </html>
119 88 \ No newline at end of file
... ...
1 1 kiftd 使用许可
2 2  
3   -Copyright (c) 2018 青阳龙野 <kohgylw@163.com> (phone:159****3814)
  3 +Copyright (c) 2019 青阳龙野 <kohgylw@163.com> (phone:159****3814)
4 4  
5   -使用kiftd软件或查看kiftd源代码代表您接收如下条款:
6   -1,任何组织或个人均能够自由、无偿地获得kiftd软件及其源代码的原版拷贝,并对其进行无限制地进行使用——无论是商业的还是非商业的。
  5 +使用、分发或修改kiftd软件及源代码代表您接受如下条款:
  6 +1,任何组织或个人均能够自由、无偿地获得kiftd软件及其源代码的原版拷贝,并对其享有无限制使用的权利——无论是商业的还是非商业的。
7 7 2,任何组织或个人均能够自由复制、分发或修改kiftd软件及其源代码,并将其运用于任何用途。修改后的作品之版权由修改者所有。
8 8 3,kiftd软件之作者无需为使用该软件及其源代码所造成的任何直接或间接后果承担责任。
9   -4,作者“青阳龙野(kohgylw)”对kiftd软件及源代码享有版权并保留其著作权,该软件及其源代码的使用者需承认其原版部分之版权。
10   -5,kiftd软件中所使用的所有第三方软件、工具或插件及其代码,其权利由该资源之作者享有并授予许可。kiftd作者无需为使用这些资源而造成的直接或间接后果承担责任。
11 9 \ No newline at end of file
  10 +4,作者“青阳龙野 kohgylw(E-mail:kohgylw@163.com)”对kiftd的原版java/网页页面源代码、原版java软件程序和页面资源、随发行版程序附带的原版《kiftd说明文档》均具备版权。
  11 +5,kiftd软件中涉及的所有第三方软件、工具或插件及其代码,其权利由该资源之作者享有并授予kiftd许可。kiftd作者无需为使用这些资源而造成的直接或间接后果承担责任。
12 12 \ No newline at end of file
... ...