提交 2a81d74a510af2aaabf37fcada82b5e32fba3f89

作者 kohgylw
1 个父辈 7e44880f

update to v1.0.33-release

... ... @@ -77,9 +77,9 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
77 77  
78 78 > 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
79 79  
80   -### 常规更新v1.0.32
  80 +### 常规更新v1.0.33
81 81 _本次更新为维护性的更新,修复一些已经发现的问题并优化使用体验,推荐所有用户升级。_
82   -+ 修复了当文件名中含有空格时,Firefox浏览器无法以正确的文件名进行下载的问题
  82 ++ 升级了内置的图片预览插件,并修复了一个存在于“图片预览”功能中的安全性漏洞
83 83 + 进一步完善了文件系统。
84 84  
85 85  
... ...
kiftd-1.0.33-RELEASE.jar renamed from kiftd-1.0.32-RELEASE.jar
不能预览此文件类型
1 1 /*!
2   - * Viewer.js v1.3.0
  2 + * Viewer.js v1.5.0
3 3 * https://fengyuanchen.github.io/viewerjs
4 4 *
5 5 * Copyright 2015-present Chen Fengyuan
6 6 * Released under the MIT license
7 7 *
8   - * Date: 2018-10-25T12:41:52.459Z
9   - */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC");background-repeat:no-repeat;color:rgba(0,0,0,0);display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;-webkit-tap-highlight-color:transparent;top:0;-webkit-touch-callout:none;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container::-moz-selection,.viewer-container ::-moz-selection{background-color:rgba(0,0,0,0)}.viewer-container::selection,.viewer-container ::selection{background-color:rgba(0,0,0,0)}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{-webkit-box-sizing:content-box;box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:rgba(0,0,0,0);cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;-webkit-transition:opacity .15s;transition:opacity .15s;width:30px}.viewer-list>li:hover{opacity:.75}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:3px 0}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;-webkit-transition:background-color .15s;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1;margin:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;-webkit-transition:background-color .15s;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{-webkit-transition:all .3s;transition:all .3s}@-webkit-keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
10 8 \ No newline at end of file
  9 + * Date: 2019-11-23T05:10:21.757Z
  10 + */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;-webkit-tap-highlight-color:transparent;top:0;-ms-touch-action:none;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container::-moz-selection,.viewer-container ::-moz-selection{background-color:transparent}.viewer-container::selection,.viewer-container ::selection{background-color:transparent}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{-webkit-box-sizing:content-box;box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;-webkit-transition:opacity .15s;transition:opacity .15s;width:30px}.viewer-list>li:hover{opacity:.75}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:3px 0}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;-webkit-transition:background-color .15s;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1;margin:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;-webkit-transition:background-color .15s;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{-webkit-transition:all .3s;transition:all .3s}@-webkit-keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
11 11 \ No newline at end of file
... ...
1 1 <!doctype html>
2   -<!-- 青阳网络文件传输系统 kiftd v1.0.32-RELEASE -->
  2 +<!-- 青阳网络文件传输系统 kiftd v1.0.33-RELEASE -->
3 3 <!-- 欢迎访问主界面 -->
4 4 <!-- by 青阳龙野(kohgylw@163.com) -->
5 5 <html>
... ...
... ... @@ -988,8 +988,7 @@ function showFolderTable(folderView) {
988 988  
989 989 // 根据一个文件对象生成对应的文件行的HTML内容
990 990 function createFileRow(fi, aL, aD, aR, aO) {
991   - fi.fileName = fi.fileName.replace(/\'/g, '&#39;').replace(/</g, '&lt;')
992   - .replace(/>/g, '&gt;');
  991 + fi.fileName = html2Escape(fi.fileName);
993 992 var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
994 993 + fi.fileId + '"' + ")' ondblclick='checkConsFile(event," + '"'
995 994 + fi.fileId + '"' + ")' id='" + fi.fileId
... ... @@ -1146,8 +1145,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
1146 1145  
1147 1146 // 根据一个文件夹对象生成对应的文件行的HTML内容
1148 1147 function createNewFolderRow(f, aD, aR, aO) {
1149   - f.folderName = f.folderName.replace(/\'/g, '&#39;').replace(/</g, '&lt;')
1150   - .replace(/>/g, '&gt;');
  1148 + f.folderName = html2Escape(f.folderName);
1151 1149 var folderRow = "<tr id='"
1152 1150 + f.folderId
1153 1151 + "' onclick='checkfile(event,"
... ... @@ -1600,10 +1598,8 @@ function doupload(count) {
1600 1598 $("#filecount").text("(" + count + "/" + fcount + ")");// 显示当前进度
1601 1599 }
1602 1600 $("#uploadstatus").prepend(
1603   - "<p>"
1604   - + fname.replace(/\'/g, '&#39;').replace(/</g, '&lt;')
1605   - .replace(/>/g, '&gt;') + "<span id='uls_"
1606   - + count + "'>[正在上传...]</span></p>");
  1601 + "<p>" + html2Escape(fname) + "<span id='uls_" + count
  1602 + + "'>[正在上传...]</span></p>");
1607 1603 xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
1608 1604  
1609 1605 var fd = new FormData();// 用于封装文件数据的对象
... ... @@ -1970,7 +1966,8 @@ function createViewList() {
1970 1966 for (var i = 0; i < pvl.pictureViewList.length; i++) {
1971 1967 $(images).append(
1972 1968 "<li><img src='" + pvl.pictureViewList[i].url + "' alt='"
1973   - + pvl.pictureViewList[i].fileName + "' /></li>");
  1969 + + html2Escape(pvl.pictureViewList[i].fileName)
  1970 + + "' /></li>");
1974 1971 }
1975 1972 viewer = $(images);
1976 1973 viewer.viewer({
... ... @@ -1997,11 +1994,13 @@ function createViewListByPage() {
1997 1994 for (var i = 0; i < viewerPageSize
1998 1995 && i < (pvl.pictureViewList.length - (viewerPageIndex - 1)
1999 1996 * viewerPageSize); i++) {
2000   - $(images).append(
2001   - "<li><img src='" + pvl.pictureViewList[startIndex + i].url
2002   - + "' alt='"
2003   - + pvl.pictureViewList[startIndex + i].fileName
2004   - + "' /></li>");
  1997 + $(images)
  1998 + .append(
  1999 + "<li><img src='"
  2000 + + pvl.pictureViewList[startIndex + i].url
  2001 + + "' alt='"
  2002 + + html2Escape(pvl.pictureViewList[startIndex
  2003 + + i].fileName) + "' /></li>");
2005 2004 }
2006 2005 if (viewerPageIndex < viewerTotal) {
2007 2006 $(images).append("<li><img src='css/right.png' alt='下一页' /></li>");
... ... @@ -3278,9 +3277,7 @@ function iteratorImport(i, newFolderName) {
3278 3277 $("#importcount").text("(" + (i + 1) + "/" + fcount + ")");// 显示当前进度
3279 3278 }
3280 3279 $("#importstatus").prepend(
3281   - "<p>"
3282   - + fname.replace(/\'/g, '&#39;').replace(/</g, '&lt;')
3283   - .replace(/>/g, '&gt;') + "<span id='ils_" + i
  3280 + "<p>" + html2Escape(fname) + "<span id='ils_" + i
3284 3281 + "'>[正在上传...]</span></p>");
3285 3282 xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
3286 3283  
... ... @@ -3823,4 +3820,16 @@ function updateTheFolderInfo() {
3823 3820 // 替换所有引号,将其进一步转义,主要用于传递带引号的文件名
3824 3821 function replaceAllQuotationMarks(txt) {
3825 3822 return txt.replace(/\"/g, "\\\"");
  3823 +}
  3824 +
  3825 +// 对所有可能进入html的字符串进行转义操作
  3826 +function html2Escape(sHtml) {
  3827 + return sHtml.replace(/[<>&\']/g, function(c) {
  3828 + return {
  3829 + '<' : '&lt;',
  3830 + '>' : '&gt;',
  3831 + '&' : '&amp;',
  3832 + '\'' : '&#39;'
  3833 + }[c];
  3834 + });
3826 3835 }
3827 3836 \ No newline at end of file
... ...
1   -function updateWinHeight(){window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight)}function changeFilesTableStyle(){var a=$(window).width();768>a?($("#filetableheadera").addClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").removeClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){return"mustLogin"==a?(window.location.href="prv/login.html",void 0):($("#serverOS").text(a),void 0)},error:function(){$("#serverOS").html("<a onclick='getServerOS()'>获取失败,点击重试</a>")}})}function showFolderView(fid,targetId){loadingFolderView||(startLoading(),remainingLoadingRequest&&remainingLoadingRequest.abort(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){switch(endLoading(),result){case"ERROR":doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,originFolderView=$.extend(!0,{},folderView),totalFoldersOffset=folderView.foldersOffset,totalFilesOffset=folderView.filesOffset,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text(folderView.folder.folderCreator),$("#fim_folderCreationDate").text(folderView.folder.folderCreationDate),$("#fim_folderId").text(folderView.folder.folderId),updateTheFolderInfo(),folderView.foldersOffset>folderView.selectStep||folderView.filesOffset>folderView.selectStep?(showLoadingRemaininngBox(),loadingRemainingFolderView(targetId)):(hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(){endLoading(),doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}}))}function startLoading(){loadingFolderView=!0,$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){loadingFolderView=!1,$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled"),$("#vercode").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled"),$("#accountpwd").removeAttr("disabled"),$("#dologinButton").removeAttr("disabled"),$("#vercode").removeAttr("disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a,vercode:$("#vercode").val()},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden"),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"needsubmitvercode":$("#vercodebox").html("<label id='vercodetitle' class='col-sm-7'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-5'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>"),$("#vercodebox").removeClass("hidden"),$("#vercodebox").addClass("show");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过加密效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function getNewVerCode(){$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append("<li><a href='javascript:void(0);' onclick='entryFolder(\""+b.folderId+'"'+")'>"+b.folderName+"</a></li>")}):$("#parentFolderList").html("<li class='disabled'><a>无</a></li>"),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-home")):null!=a.keyWorld?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-search")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append("<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),"true"==a.allowChangePassword&&($("#tb").append(" <button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"))):($("#tb").append("<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),"true"==a.allowSignUp&&($("#tb").append(" <button class='btn btn-link rightbtn hidden-xs' onclick='window.location.href = \"/prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>")));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()"),checkAuth(b,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),a.enableDownloadZip&&checkAuth(b,"L")?$("#packageDownloadBox").html("<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"),$("#stickFileButtonLi").removeClass("disabled"),$("#copyFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","cutFile()"),$("#copyFileButtonLi a").attr("onclick","copyFile()"),$("#stickFileButtonLi a").attr("onclick","stickFile()"),void 0!==checkedMovefiles&&checkedMovefiles.size>0?(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show")):($("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root"),subscribeNotice()}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f,g,h,i,j;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("<tr onclick='returnPF()'><td><button onclick='' class='btn btn-link btn-xs'>../</button></td><td class='hidden-xs'>--</td><td>--</td><td class='hidden-xs'>--</td><td>--</td></tr>"),b=a.authList,c=!1,d=!1,e=!1,f=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),g=a.folderList.length;g>0;g--)h=a.folderList[g-1],$("#foldertable").append(createNewFolderRow(h,c,d,f));for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],$("#foldertable").append(createFileRow(j,e,c,d,f))}function createFileRow(a,b,c,d,e){var f,g;if(a.fileName=a.fileName.replace(/\'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),f="<tr id="+a.fileId+" onclick='checkfile(event,"+'"'+a.fileId+'"'+")' ondblclick='checkConsFile(event,"+'"'+a.fileId+'"'+")' id='"+a.fileId+"' class='filerow'><td>"+a.fileName+"</td><td class='hidden-xs'>"+a.fileCreationDate+"</td>","0"==a.fileSize?f+="<td>&lt;1MB</td>":f=f+"<td>"+a.fileSize+"MB</td>",f=f+"<td class='hidden-xs'>"+a.fileCreator+"</td><td>",b)switch(f=f+"<button onclick='showDownloadModel("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>",g=getSuffix(a.fileName)){case"mp4":f=f+"<button onclick='playVideo("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":folderView.enableFFMPEG&&(f=f+"<button onclick='playVideo("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>");break;case"pdf":f=f+"<button onclick='pdfView("+'"'+a.fileId+'"'+")' 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":f=f+"<button onclick='showPicture("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";break;case"mp3":case"wav":case"ogg":f=f+"<button onclick='playAudio("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"docx":f=f+"<button onclick='docxView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"txt":f=f+"<button onclick='txtView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"ppt":case"pptx":f=f+"<button onclick='pptView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>"}return c&&(f=f+"<button onclick='showDeleteFileModel("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(f=f+"<button onclick='showRenameFileModel("+'"'+a.fileId+'"'+","+'"'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),e&&(f=f+"<button onclick='showFolderView("+'"'+a.fileParentFolder+'","'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),b&&"true"==folderView.showFileChain&&(f=f+"<button onclick='getFileChain("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>"),d||c||b||e||(f+="--"),f+="</td></tr>"}function createNewFolderRow(a,b,c,d){a.folderName=a.folderName.replace(/\'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;");var e="<tr id='"+a.folderId+"' onclick='checkfile(event,"+'"'+a.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+a.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("+'"'+a.folderId+'"'+")' class='btn btn-link btn-xs'>/"+a.folderName+"</button></td><td class='hidden-xs'>"+a.folderCreationDate+"</td><td>--</td><td class='hidden-xs'>"+a.folderCreator+"</td><td>";return b&&(e=e+"<button onclick='showDeleteFolderModel("+'"'+a.folderId+'","'+replaceAllQuotationMarks(a.folderName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),c&&(e=e+"<button onclick='showRenameFolderModel("+'"'+a.folderId+'","'+replaceAllQuotationMarks(a.folderName)+'",'+a.folderConstraint+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>"),d&&(e=e+"<button onclick='showFolderView("+'"'+a.folderParent+'","'+a.folderId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),c||b||d||(e+="--"),e+="</td></tr>"}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>128?showFolderAlert("提示:文件夹名称太长。"):c.test(a)||0==a.indexOf(".")?showFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");break;case"errorParameter":showFolderAlert("提示:参数不正确,创建文件夹失败。");break;case"cannotCreateFolder":showFolderAlert("提示:出现意外错误,可能未能创建文件夹。");break;case"nameOccupied":showFolderAlert("提示:该名称已被占用,请选取其他名称。");break;case"foldersTotalOutOfLimit":showFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中创建更多文件夹。");break;case"createFolderSuccess":$("#newFolderModal").modal("hide"),showFolderView(locationpath);break;default:showFolderAlert("提示:出现意外错误,可能未能创建文件夹。")}},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}}))}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html("<button id='dmbutton' type='button' class='btn btn-danger' onclick='deleteFolder(\""+a+'"'+")'>删除</button>"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#cancelDeleteFolderBtn").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html("<button type='button' class='btn btn-primary' onclick='renameFolder(\""+a+'"'+")'>修改</button>"),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>128?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)||0==b.indexOf(".")?showRFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}}))}function showRFolderAlert(a){$("#editfolderalert").addClass("alert"),$("#editfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#editfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b<fs.length;b++)a+=fs[b].name,b<fs.length-1&&(a+="、");fs.length<=1?$("#selectcount").text(""):$("#selectcount").text("(共"+fs.length+"个)"),$("#filepath").val(a)}function checkUploadFile(){var filenames,maxSize,maxFileIndex,i,namelist;if(0==isUpLoading&&0==isImporting)if(null!=fs&&fs.length>0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),filenames=new Array,maxSize=0,maxFileIndex=0,i=0;i<fs.length;i++)filenames[i]=fs[i].name,fs[i].size>maxSize&&(maxSize=fs[i].size,maxFileIndex=i);namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist,maxSize:maxSize,maxFileIndex:maxFileIndex},url:"homeController/checkUploadFile.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"errorParameter":showUploadFileAlert("提示:参数不正确,无法开始上传");break;case"noAuthorized":showUploadFileAlert("提示:您的操作未被授权,无法开始上传");break;case"filesTotalOutOfLimit":showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,无法在其中上传更多文件。您可以尝试将其上传至其他文件夹内。");break;default:var resp=eval("("+result+")");"fileTooLarge"==resp.checkResult?showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传"):"hasExistsNames"==resp.checkResult?(repeList=resp.pereFileNameList,repeIndex=0,selectFileUpLoadModelStart()):"permitUpload"==resp.checkResult?doupload(1):showUploadFileAlert("提示:出现意外错误,无法开始上传")}},error:function(){showUploadFileAlert("提示:出现意外错误,无法开始上传")}})}else showUploadFileAlert("提示:您未选择任何文件,无法开始上传");else showUploadFileAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function selectFileUpLoadModelStart(){var a=originFolderView.authList;checkAuth(a,"D")?$("#uploadcoverbtn").show():$("#uploadcoverbtn").hide(),$("#selectFileUpLoadModelAlert").show(),$("#repeFileName").text(repeList[repeIndex])}function selectFileUpLoadModelEnd(a){if(null==repeModelList&&(repeModelList={}),repeModelList[$("#repeFileName").text()]=a,$("#selectFileUpLoadModelAlert").hide(),$("#selectFileUpLoadModelAsAll").prop("checked")){for(var b=repeIndex;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.replace(/\'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"<span id='uls_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("fname",d),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){if(null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+d+"]上传失败。您可以尝试将其上传至其他文件夹内。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<p>未找到要上传的文件<span id='uls_"+a+"'>[失败]</span></p>")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").show(),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function abortUpload(){isUpLoading&&(isUpLoading=!1,null!=xhr&&xhr.abort()),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>"),getDownloadFileId=a,getDownloadFileName=b,$("#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),$("#cancelDeleteFileBox").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html("<button type='button' class='btn btn-primary' onclick='renameFile(\""+a+'"'+")'>修改</button>"),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getResource/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function txtView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/"+a)}function pptView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getPPTView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)
2   -}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++)$(a).append("<li><img src='"+pvl.pictureViewList[b].url+"' 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++)$(a).append("<li><img src='"+pvl.pictureViewList[b+c].url+"' 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(){if(folderView.enableDownloadZip){$("#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)),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1),$("#downloadAllCheckedModal").modal("toggle")}}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0),$("#cancelDownloadAllCheckedBtn").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?($("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html("<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),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==pingInt&&(pingInt=setInterval("ping()",6e4)),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-play' aria-hidden='true'></span>")}),ap.on("play",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-pause' aria-hidden='true'></span>")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var i,ail=eval("("+result+")");for(i=ail.index;i<ail.as.length;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),ap.list.add(ail.as[i]);for(i=0;i<ail.index;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),ap.list.add(ail.as[i]);audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide")}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){if(loadingComplete&&!$("#sortByCD,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView),$("#sortByFN").removeClass(),-1==a?$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycd(){if(loadingComplete&&!$("#sortByFN,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){var d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),folderView.folderList.sort(function(b,c){var d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),showFolderTable(folderView),$("#sortByCD").removeClass(),-1==a?$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbyfs(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFS").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*(b.fileSize-c.fileSize)}),showFolderTable(folderView),$("#sortByFS").removeClass(),-1==a?$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycn(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByFS,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView),$("#sortByCN").removeClass(),-1==a?$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function showOriginFolderView(){loadingComplete&&($("#sortByFN,#sortByCD,#sortByFS,#sortByCN").hasClass("glyphicon glyphicon-hourglass")||($("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView),$("#sortByOR").removeClass()},0)))}function cutFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!1)}function copyFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!0)}function stickFile(){void 0!==checkedMovefiles&&checkedMovefiles.size>0&&(isCopy?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项复制到当前位置么?"),$("#moveFilesBox").html("<button id='dmvfbutton' type='button' class='btn btn-primary' onclick='doMoveFiles()'>全部复制</button>")):($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("<button id='dmvfbutton' type='button' class='btn btn-danger' onclick='doMoveFiles()'>全部移动</button>")),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#cancelMoveFilesBtn").attr("disabled",!1),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show"))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#cancelMoveFilesBtn").attr("disabled",!0);var method="MOVE";isCopy?($("#moveFilesMessage").text("提示:正在复制,请稍候..."),method="COPY"):$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath,method:method},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"confirmMoveFiles":strMoveOptMap={},sendMoveFilesReq();break;default:if(result.startsWith("duplicationFileName:")){repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);var authList=originFolderView.authList;checkAuth(authList,"D")?$("#movecoverbtn").show():$("#movecoverbtn").hide(),$("#selectFileMoveModelAlert").show()}else result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1))}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)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),b="MOVE";isCopy&&(b="COPY"),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,strOptMap:a,locationpath:locationpath,method:b},url:"homeController/moveCheckedFiles.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"moveFilesSuccess":$("#moveFilesModal").modal("hide"),showFolderView(locationpath);break;default:$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").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(),$("#sortByOR").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}}function selectInCompletePath(keyworld){return 0==keyworld.length?(showFolderView(locationpath),void 0):(startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:locationpath,keyworld:keyworld},url:"homeController/sreachInCompletePath.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"mustLogin"==result?window.location.href="prv/login.html":"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val("all:"+folderView.keyWorld),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text("--"),$("#fim_folderCreationDate").text("--"),$("#fim_folderId").text("--"),updateTheFolderInfo())},error:function(){endLoading(),doAlert(),$("#tb").html("<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){var b=window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+encodeURIComponent(getDownloadFileName.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?dkey="+a;$("#downloadHrefBox").html("<a href='"+b+"'>"+b+"</a>")},error:function(){$("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>")}})}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)},error:function(){null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}})}function isSupportWebkitdirectory(){var a=document.createElement("input");return"webkitdirectory"in a&&!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?!0:!1}function showUploadFolderModel(){if($("#importFolderAlert").hide(),$("#importFolderAlert").text(""),0==isImporting)if($("#folderpath").val(""),$("#importfolder").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importstatus").html(""),$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importcount").text(""),$("#importbutton").attr("disabled",!1),$("#importfoldertypelist").html(""),$("#selectFolderImportModelAlert").hide(),null!=account){$("#folderpath").attr("folderConstraintLevel",constraintLevel+""),$("#importfoldertype").text(folderTypes[constraintLevel]);for(var a=constraintLevel;a<folderTypes.length;a++)$("#importfoldertypelist").append("<li><a onclick='changeImportFolderType("+a+")'>"+folderTypes[a]+"</a></li>")}else $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType(0)'>"+folderTypes[0]+"</a></li>");$("#importFolderModal").modal("show")}function checkimportpath(){$("#importfolder").click()}function getInputImport(){ifs=$("#importfolder")[0].files,ifs.length>0&&(importFolderName=ifs[0].webkitRelativePath.substring(0,ifs[0].webkitRelativePath.indexOf("/")),$("#folderpath").val(importFolderName))}function checkImportFolder(){var maxSize,maxFileIndex,i;if(0==isUpLoading&&0==isImporting)if(null!=ifs&&ifs.length>0){for($("#folderpath").attr("disabled",!0),$("#importFolderLevelBtn").attr("disabled",!0),$("#importbutton").attr("disabled",!0),$("#importFolderAlert").hide(),$("#importFolderAlert").text(""),isImporting=!0,maxSize=0,maxFileIndex=0,i=0;i<ifs.length;i++)ifs[i].size>maxSize&&(maxSize=ifs[i].size,maxFileIndex=i);$.ajax({url:"homeController/checkImportFolder.ajax",type:"POST",dataType:"text",data:{folderName:importFolderName,maxSize:maxSize,folderId:locationpath},success:function(result){var resJson=eval("("+result+")");switch(resJson.result){case"noAuthorized":showImportFolderAlert("提示:您的操作未被授权,无法开始上传");break;case"errorParameter":showImportFolderAlert("提示:参数不正确,无法开始上传。必须选择一个文件夹");break;case"mustLogin":window.location.href="prv/login.html";break;case"fileOverSize":showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");break;case"foldersTotalOutOfLimit":showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中上传更多文件夹。您可以尝试将其上传至其他文件夹内。");break;case"repeatFolder_Both":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").hide(),$("#selectFolderImportModelAlert").show();break;case"repeatFolder_coverOrBoth":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").show(),$("#selectFolderImportModelAlert").show();break;case"permitUpload":iteratorImport(0);break;default:showImportFolderAlert("提示:出现意外错误,无法开始上传")}},error:function(){showImportFolderAlert("提示:出现意外错误,无法开始上传")}})}else showImportFolderAlert("提示:您未选择任何文件夹,无法开始上传");else showImportFolderAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function showImportFolderAlert(a){isImporting=!1,$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importFolderAlert").show(),$("#importFolderAlert").text(a),$("#importbutton").attr("disabled",!1)}function importProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#importpros").width(b+"%"),$("#importpros").attr("aria-valuenow",""+b)}}function importAndCover(){$("#selectFolderImportModelAlert").hide(),$.ajax({url:"homeController/deleteFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName},dataType:"text",success:function(a){"deleteSuccess"==a?iteratorImport(0):showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")},error:function(){showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")}})}function importAndBoth(){$("#selectFolderImportModelAlert").hide();var fc=$("#folderpath").attr("folderConstraintLevel");$.ajax({url:"homeController/createNewFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName,folderConstraint:fc},dataType:"text",success:function(result){var resJson=eval("("+result+")");"success"==resJson.result?iteratorImport(0,resJson.newName):"foldersTotalOutOfLimit"==resJson.result?showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法上传同名文件夹并保留两者。您可以尝试将其上传至其他文件夹内。"):showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")},error:function(){showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")}})}function iteratorImport(a,b){var c,d,e,f,g;$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),c=ifs[a],d=ifs.length,e=$("#folderpath").attr("folderConstraintLevel"),null!=c?(f=c.webkitRelativePath,d>1&&$("#importcount").text("("+(a+1)+"/"+d+")"),$("#importstatus").prepend("<p>"+f.replace(/\'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+"<span id='ils_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),g.append("originalFileName",f),b&&g.append("newFolderName",b),xhr.open("POST","homeController/doImportFolder.ajax",!0),xhr.upload.addEventListener("progress",importProgress,!1),xhr.send(g),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){var c,e;null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status?(c=xhr.responseText,"uploadsuccess"==c?($("#ils_"+a).text("[已完成]"),e=a+1,d>e?iteratorImport(e,b):(isImporting=!1,$("#folderpath").removeAttr("disabled"),$("#importFolderLevelBtn").removeAttr("disabled"),$("#importfolder").val(""),$("#folderpath").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importbutton").attr("disabled",!1),$("#importcount").text(""),$("#importstatus").text(""),$("#importFolderModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"foldersTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("<p>未找到要上传的文件<span id='ils_"+a+"'>[失败]</span></p>"))}function abortImport(){isImporting&&(isImporting=!1,null!=xhr&&xhr.abort()),$("#importFolderModal").modal("hide"),showFolderView(locationpath)}function changeImportFolderType(a){$("#importfoldertype").text(folderTypes[a]),$("#folderpath").attr("folderConstraintLevel",a+"")}function doChangePassword(){var change_oldPassword,change_newPassword,change_reqNewPassword;return $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepasswordalertbox").hide(),change_oldPassword=$("#changepassword_oldpwd").val(),change_newPassword=$("#changepassword_newpwd").val(),change_reqNewPassword=$("#changepassword_reqnewpwd").val(),0==change_oldPassword.length?($("#changepassword_oldepwdbox").addClass("has-error"),$("#changepassword_oldpwd").focus(),void 0):0==change_newPassword.length?($("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_newpwd").focus(),void 0):0==change_reqNewPassword.length?($("#changepassword_reqnewpwdbox").addClass("has-error"),$("#changepassword_reqnewpwd").focus(),void 0):(isChangingPassword=!0,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!0),change_newPassword+""!=change_reqNewPassword+""?(showChangePasswordAlert("提示:两次输入的新密码不一致,请检查确认"),$("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_reqnewpwdbox").addClass("has-error"),void 0):($.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,changepwd_publicKeyInfo=eval("("+result+")"),changePasswordInfo='{oldPwd:"'+change_oldPassword+'",newPwd:"'+change_newPassword+'",time:"'+changepwd_publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(changepwd_publicKeyInfo.publicKey),encrypted=encrypt.encrypt(changePasswordInfo),sendChangePasswordInfo(encrypted)},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}}),void 0))}function sendChangePasswordInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doChangePassword.ajax",data:{encrypted:a,vercode:$("#changepassword_vercode").val()},success:function(a){switch($("#changepassword_vccodebox").hide(),isChangingPassword=!1,a){case"success":$("#changePasswordModal").modal("hide");break;case"mustlogin":showChangePasswordAlert("提示:登录已失效或尚未登录账户,请刷新并登陆账户");break;case"illegal":showChangePasswordAlert("提示:用户修改密码功能已被禁用,请求被拒绝");break;case"oldpwderror":showChangePasswordAlert("提示:旧密码输入错误,请求被拒绝"),$("#changepassword_oldepwdbox").addClass("has-error");break;case"needsubmitvercode":$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton").attr("disabled",!1),$("#changepassword_vccodebox").html("<label id='changepassword_vercodetitle' class='col-sm-5'><img id='changepassword_showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='changePasswordGetNewVerCode()'></label><div class='col-sm-7'><input type='text' class='form-control' id='changepassword_vercode' placeholder='验证码……'></div>"),$("#changepassword_vccodebox").show(),isChangingPassword=!1;break;case"invalidnewpwd":showChangePasswordAlert("提示:密码修改失败,新密码不合法。新密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");
3   -break;case"error":showChangePasswordAlert("提示:密码修改失败,修改请求无法通过加密效验(可能是请求耗时过长导致的)");break;case"cannotchangepwd":showChangePasswordAlert("提示:密码修改失败,发生意外错误,请稍后重试或联系管理员");break;default:showChangePasswordAlert("提示:密码修改失败,发生未知错误")}},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}})}function showChangePasswordAlert(a){isChangingPassword=!1,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepasswordalertbox").show(),$("#changepasswordalertbox").text(a)}function changePasswordGetNewVerCode(){$("#changepassword_showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function getFileChain(a,b){$("#fileChainTextarea").text("正在获取……"),$("#copyChainBtn").attr("disabled",!0),$("#fileChainModal").modal("show"),$.ajax({type:"POST",dataType:"text",url:"homeController/getFileChainKey.ajax",data:{fid:a},success:function(a){switch(a){case"ERROR":$("#fileChainTextarea").text("提示:获取失败,请刷新页面或稍后再试。");break;case"mustlogin":window.location.href="prv/login.html";break;default:$("#fileChainTextarea").text(window.location.protocol+"//"+window.location.host+"/externalLinksController/chain/"+encodeURIComponent(b.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?ckey="+encodeURIComponent(a)),$("#copyChainBtn").attr("disabled",!1)}},error:function(){$("#fileChainTextarea").text("提示:获取失败,无法连接服务器。")}})}function copyFileChain(){node=document.getElementById("fileChainTextarea"),node.select(),document.execCommand("copy")}function showNoticeModal(){$("#noticeModal").modal("show")}function initNoticeModal(){$("#noticeModalBody").load("resourceController/getNoticeContext.do",function(){$("#noticeModalBody img").css("max-width","100%"),winHeight>=300?$("#noticeModalBody").css("max-height",winHeight-180+"px"):$("#noticeModalBody").css("max-height","300px"),noticeInited=!0,showNoticeModal(),showNoticeBtn()})}function subscribeNotice(){$.ajax({url:"resourceController/getNoticeMD5.ajax",data:{},type:"POST",dataType:"text",success:function(a){if(""!=a){var b=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)"));if(b){if(a==unescape(b[2]))return showNoticeBtn(),void 0}else if(b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),b&&a==unescape(b[2]))return showNoticeBtn(),void 0;initNoticeModal(),document.cookie="notice_md5="+escape(a)}},error:function(){alert("错误:无法从服务器获取公告信息,请尝试刷新页面。")}})}function showNoticeBtn(){$("#shownoticebox").removeClass("hidden"),$("#shownoticebox").addClass("show")}function showNotice(){noticeInited?showNoticeModal():initNoticeModal()}function loadingRemainingFolderView(targetId){var newfoldersOffset,newfilesOffset,loadingRemainingRate_folders,loadingRemainingRate_files,loadingRemainingRate;if(!remainingLoadingRequest){if(newfoldersOffset=0,newfilesOffset=0,folderView.foldersOffset-folderView.selectStep>0&&(newfoldersOffset=folderView.foldersOffset-folderView.selectStep),folderView.filesOffset-folderView.selectStep>0&&(newfilesOffset=folderView.filesOffset-folderView.selectStep),0>=newfoldersOffset&&0>=newfilesOffset)return originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId),void 0;loadingRemainingRate_folders=1,loadingRemainingRate_files=1,totalFoldersOffset>0&&(loadingRemainingRate_folders=(totalFoldersOffset-newfoldersOffset)/totalFoldersOffset),totalFilesOffset>0&&(loadingRemainingRate_files=(totalFilesOffset-newfilesOffset)/totalFilesOffset),loadingRemainingRate=(loadingRemainingRate_folders+loadingRemainingRate_files)/2,$("#loadingrate").text(parseInt(100*loadingRemainingRate)+"%"),remainingLoadingRequest=$.ajax({url:"homeController/getRemainingFolderView.ajax",data:{fid:locationpath,foldersOffset:newfoldersOffset,filesOffset:newfilesOffset},type:"POST",dataType:"text",success:function(result){switch(remainingLoadingRequest=null,result){case"ERROR":alert("错误:无法加载剩余文件列表,文件数据可能未显示完全,请刷新重试!"),hiddenLoadingRemaininngBox(),doFixedRow();break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView.foldersOffset=newfoldersOffset,folderView.filesOffset=newfilesOffset;var remainingFV=eval("("+result+")");updateFolderTable(remainingFV),updateTheFolderInfo(),folderView.foldersOffset>0||folderView.filesOffset>0?loadingRemainingFolderView(targetId):(originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(a,b){remainingLoadingRequest=null,hiddenLoadingRemaininngBox(),"abort"!=b&&alert("错误:无法连接服务器,文件列表加载被中断。请刷新重试!")}})}}function doFixedRow(a){a&&a.length>0&&($("#"+a).addClass("info"),$("html,body").animate({scrollTop:$("#"+a).offset().top-$(window).height()/2},"slow"))}function showLoadingRemaininngBox(){loadingComplete=!1,$("#loadingremaininngbox").addClass("show"),$("#loadingremaininngbox").removeClass("hidden"),$("#searchbtn").attr("disabled","disabled")}function hiddenLoadingRemaininngBox(){loadingComplete=!0,$("#loadingremaininngbox").removeClass("show"),$("#loadingremaininngbox").addClass("hidden"),$("#searchbtn").removeAttr("disabled")}function updateFolderTable(a){var g,h,i,j,b=folderView.authList,c=!1,d=!1,e=!1,f=!1;if(checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),a.folderList&&a.folderList.length>0)for(g=a.folderList.length;g>0;g--)h=a.folderList[g-1],folderContains(folderView.folderList,h.folderId)||(folderView.folderList.unshift(h),$("[iskfolder=true]:last").after(createNewFolderRow(h,c,d,f)));if(a.fileList&&a.fileList.length>0)for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],fileContains(folderView.fileList,j.fileId)||(folderView.fileList.unshift(j),$("#foldertable").append(createFileRow(j,e,c,d,f)))}function folderContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].folderId==b)return!0;return!1}function fileContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].fileId==b)return!0;return!1}function updateTheFolderInfo(){$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}function replaceAllQuotationMarks(a){return a.replace(/\"/g,'\\"')}var ap,zipTimer,folderView,originFolderView,fs,ifs,checkedMovefiles,isCopy,repeMap,strMoveOptMap,mRepeSize,constraintLevel,account,importFolderName,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,pingInt,loadingComplete,totalFoldersOffset,totalFilesOffset,remainingLoadingRequest,loadingFolderView,folderTypes,repeList,repeIndex,repeModelList,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,isImporting=!1,isChangingPassword=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<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>:选中/取消选中所有文件",noticeInited=!1;$(function(){window.onresize=function(){changeFilesTableStyle(),updateWinHeight()},changeFilesTableStyle(),getServerOS(),subscribeNotice();var a=document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)"));null!=a?showFolderView(unescape(a[2])):showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause()),null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){"disabled"!==$("#dologinButton").attr("disabled")&&($("#accountid").val(""),$("#accountpwd").val("")),$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&0==c.prop("disabled")&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b<folderTypes.length;b++)$("#foldertypelist").append("<li><a onclick='changeNewFolderType("+b+")'>"+folderTypes[b]+"</a></li>")}else $("#foldertypelist").append("<li><a onclick='changeNewFolderType(0)'>"+folderTypes[0]+"</a></li>")}),$("#newFolderModal").on("shown.bs.modal",function(){$("#foldername").focus()}),$("#uploadFileModal,#importFolderModal").on("hidden.bs.modal",function(){(isUpLoading||isImporting)&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#editfolderalert").removeClass("alert"),$("#editfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#editfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b<folderTypes.length;b++)$("#editfoldertypelist").append("<li><a onclick='changeEditFolderType("+b+")'>"+folderTypes[b]+"</a></li>");else $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType(0)'>"+folderTypes[0]+"</a></li>")}),document.ondragover=function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)},document.ondrop=function(a){var b,c,d,e,f,g;if(a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1),null!=folderView.authList)if(checkAuth(folderView.authList,"U"))if(isUpLoading||isImporting)alert("提示:您正在执行另一项上传任务,请在上传完成后再试。");else if(window.ActiveXObject||"ActiveXObject"in window)alert("提示:IE浏览器不支持拖拽上传。您可以使用现代浏览器或将浏览模式切换为“极速模式”来体验该功能。");else{if(b=null!=a.dataTransfer?a.dataTransfer:window.event.dataTransfer,c=!0,void 0!==b.items)for(d=0;d<b.items.length;d++)e=b.items[d],"file"===e.kind&&e.webkitGetAsEntry().isFile||(c=!1);else for(d=0;d<b.files.length;d++)if(f=df.files[d],f.type);else try{g=new FileReader,g.readAsDataURL(f.slice(0,10)),g.addEventListener("load",function(){},!1),g.addEventListener("error",function(){c=!1},!1)}catch(a){c=!1}c?(fs=a.dataTransfer.files,showUploadFileModel(),showfilepath(),checkUploadFile()):alert("提示:您拖入的文件中包含了一个或多个文件夹,无法进行上传。")}else alert("提示:您不具备上传权限,无法上传文件。");else alert("提示:您不具备上传权限,无法上传文件。")},$(document).keypress(function(a){if(0==$(".modal.shown").length||1==$(".modal.shown").length&&"loadingModal"==$(".modal.shown").attr("id")){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(isShift(a)&&"sreachKeyWordIn"!=document.activeElement.id){switch(b){case 65:checkallfile();break;case 78:$("#createFolderButtonLi a").click();break;case 85:$("#uploadFileButtonLi a").click();break;case 68:$("#deleteSeelectFileButtonLi a").click();break;case 70:$("#uploadFolderButtonLi a").click();break;case 67:(void 0==checkedMovefiles||0==checkedMovefiles.size)&&$("#copyFileButtonLi a").click();break;case 88:(void 0==checkedMovefiles||0==checkedMovefiles.size)&&$("#cutFileButtonLi a").click();break;case 86:void 0!==checkedMovefiles&&checkedMovefiles.size>0&&$("#stickFileButtonLi a").click();break;default:return!0}return!1}}}),$("#moveFilesModal").on("hidden.bs.modal",function(){checkedMovefiles=void 0,$("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""),$("#moveFilesBox").html("")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")}),updateWinHeight(),$(window).scroll(function(){$(this).scrollTop()>2*winHeight?$("#gobacktotopbox").removeClass("hidden"):$("#gobacktotopbox").addClass("hidden")}),$("#downloadURLCollapse").on("shown.bs.collapse",function(){getDownloadURL()}),$("#changePasswordModal").on("show.bs.modal",function(){isChangingPassword||($("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd").val(""),$("#changepasswordalertbox,#changepassword_vccodebox").hide())}),$("#changePasswordModal").on("shown.bs.modal",function(){isChangingPassword||$("#changepassword_oldpwd").focus()}),$("#noticeModal").on("show.bs.modal",function(){var b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));b?$("#dontShowSomeNoticeAt30Day").attr("checked","checked"):$("#dontShowSomeNoticeAt30Day").attr("checked",!1)}),$("#noticeModal").on("hidden.bs.modal",function(){var c,d,b=new Date;$("#dontShowSomeNoticeAt30Day").prop("checked")?(b.setTime(b.getTime()+2592e6),c=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)")),c?document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString():(c=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),c&&(document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString()))):(b.setTime(0),d=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),d&&(document.cookie="notice_md5_30=0;expires="+b.toUTCString()))})}),folderTypes=["公开的","仅小组","仅创建者"];
4 1 \ No newline at end of file
  2 +function updateWinHeight(){window.innerHeight?winHeight=window.innerHeight:document.body&&document.body.clientHeight&&(winHeight=document.body.clientHeight)}function changeFilesTableStyle(){var a=$(window).width();768>a?($("#filetableheadera").addClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").removeClass("filetableheaderstyle"),$("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){return"mustLogin"==a?(window.location.href="prv/login.html",void 0):($("#serverOS").text(a),void 0)},error:function(){$("#serverOS").html("<a onclick='getServerOS()'>获取失败,点击重试</a>")}})}function showFolderView(fid,targetId){loadingFolderView||(startLoading(),remainingLoadingRequest&&remainingLoadingRequest.abort(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){switch(endLoading(),result){case"ERROR":doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,document.cookie="folder_id="+escape(locationpath),parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,originFolderView=$.extend(!0,{},folderView),totalFoldersOffset=folderView.foldersOffset,totalFilesOffset=folderView.filesOffset,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text(folderView.folder.folderCreator),$("#fim_folderCreationDate").text(folderView.folder.folderCreationDate),$("#fim_folderId").text(folderView.folder.folderId),updateTheFolderInfo(),folderView.foldersOffset>folderView.selectStep||folderView.filesOffset>folderView.selectStep?(showLoadingRemaininngBox(),loadingRemainingFolderView(targetId)):(hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(){endLoading(),doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")}}))}function startLoading(){loadingFolderView=!0,$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){loadingFolderView=!1,$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled"),$("#vercode").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled"),$("#accountpwd").removeAttr("disabled"),$("#dologinButton").removeAttr("disabled"),$("#vercode").removeAttr("disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a,vercode:$("#vercode").val()},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden"),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"needsubmitvercode":$("#vercodebox").html("<label id='vercodetitle' class='col-sm-7'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-5'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>"),$("#vercodebox").removeClass("hidden"),$("#vercodebox").addClass("show");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过加密效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function getNewVerCode(){$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append("<li><a href='javascript:void(0);' onclick='entryFolder(\""+b.folderId+'"'+")'>"+b.folderName+"</a></li>")}):$("#parentFolderList").html("<li class='disabled'><a>无</a></li>"),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-home")):null!=a.keyWorld?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-search")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").removeClass("glyphicon-search"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append("<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>注销 ["+a.account+"] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"),"true"==a.allowChangePassword&&($("#tb").append(" <button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"))):($("#tb").append("<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),$("#tb2").append("<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"),"true"==a.allowSignUp&&($("#tb").append(" <button class='btn btn-link rightbtn hidden-xs' onclick='window.location.href = \"/prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>"),$("#tb2").append(" <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>")));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()"),checkAuth(b,"C")&&isSupportWebkitdirectory()&&($("#uploadFolderButtonLi").removeClass("disabled"),$("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"))),a.enableDownloadZip&&checkAuth(b,"L")?$("#packageDownloadBox").html("<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"),$("#stickFileButtonLi").removeClass("disabled"),$("#copyFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","cutFile()"),$("#copyFileButtonLi a").attr("onclick","copyFile()"),$("#stickFileButtonLi a").attr("onclick","stickFile()"),void 0!==checkedMovefiles&&checkedMovefiles.size>0?(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show")):($("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root"),subscribeNotice()}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e,f,g,h,i,j;for($("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("<tr onclick='returnPF()'><td><button onclick='' class='btn btn-link btn-xs'>../</button></td><td class='hidden-xs'>--</td><td>--</td><td class='hidden-xs'>--</td><td>--</td></tr>"),b=a.authList,c=!1,d=!1,e=!1,f=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),g=a.folderList.length;g>0;g--)h=a.folderList[g-1],$("#foldertable").append(createNewFolderRow(h,c,d,f));for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],$("#foldertable").append(createFileRow(j,e,c,d,f))}function createFileRow(a,b,c,d,e){var f,g;if(a.fileName=html2Escape(a.fileName),f="<tr id="+a.fileId+" onclick='checkfile(event,"+'"'+a.fileId+'"'+")' ondblclick='checkConsFile(event,"+'"'+a.fileId+'"'+")' id='"+a.fileId+"' class='filerow'><td>"+a.fileName+"</td><td class='hidden-xs'>"+a.fileCreationDate+"</td>","0"==a.fileSize?f+="<td>&lt;1MB</td>":f=f+"<td>"+a.fileSize+"MB</td>",f=f+"<td class='hidden-xs'>"+a.fileCreator+"</td><td>",b)switch(f=f+"<button onclick='showDownloadModel("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>",g=getSuffix(a.fileName)){case"mp4":f=f+"<button onclick='playVideo("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"webm":case"mov":case"avi":case"wmv":case"mkv":case"flv":folderView.enableFFMPEG&&(f=f+"<button onclick='playVideo("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>");break;case"pdf":f=f+"<button onclick='pdfView("+'"'+a.fileId+'"'+")' 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":f=f+"<button onclick='showPicture("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";break;case"mp3":case"wav":case"ogg":f=f+"<button onclick='playAudio("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";break;case"docx":f=f+"<button onclick='docxView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"txt":f=f+"<button onclick='txtView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";break;case"ppt":case"pptx":f=f+"<button onclick='pptView("+'"'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>"}return c&&(f=f+"<button onclick='showDeleteFileModel("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),d&&(f=f+"<button onclick='showRenameFileModel("+'"'+a.fileId+'"'+","+'"'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>"),e&&(f=f+"<button onclick='showFolderView("+'"'+a.fileParentFolder+'","'+a.fileId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),b&&"true"==folderView.showFileChain&&(f=f+"<button onclick='getFileChain("+'"'+a.fileId+'","'+replaceAllQuotationMarks(a.fileName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>"),d||c||b||e||(f+="--"),f+="</td></tr>"}function createNewFolderRow(a,b,c,d){a.folderName=html2Escape(a.folderName);var e="<tr id='"+a.folderId+"' onclick='checkfile(event,"+'"'+a.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+a.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("+'"'+a.folderId+'"'+")' class='btn btn-link btn-xs'>/"+a.folderName+"</button></td><td class='hidden-xs'>"+a.folderCreationDate+"</td><td>--</td><td class='hidden-xs'>"+a.folderCreator+"</td><td>";return b&&(e=e+"<button onclick='showDeleteFolderModel("+'"'+a.folderId+'","'+replaceAllQuotationMarks(a.folderName)+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>"),c&&(e=e+"<button onclick='showRenameFolderModel("+'"'+a.folderId+'","'+replaceAllQuotationMarks(a.folderName)+'",'+a.folderConstraint+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>"),d&&(e=e+"<button onclick='showFolderView("+'"'+a.folderParent+'","'+a.folderId+'"'+")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>"),c||b||d||(e+="--"),e+="</td></tr>"}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>128?showFolderAlert("提示:文件夹名称太长。"):c.test(a)||0==a.indexOf(".")?showFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");break;case"errorParameter":showFolderAlert("提示:参数不正确,创建文件夹失败。");break;case"cannotCreateFolder":showFolderAlert("提示:出现意外错误,可能未能创建文件夹。");break;case"nameOccupied":showFolderAlert("提示:该名称已被占用,请选取其他名称。");break;case"foldersTotalOutOfLimit":showFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中创建更多文件夹。");break;case"createFolderSuccess":$("#newFolderModal").modal("hide"),showFolderView(locationpath);break;default:showFolderAlert("提示:出现意外错误,可能未能创建文件夹。")}},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}}))}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html("<button id='dmbutton' type='button' class='btn btn-danger' onclick='deleteFolder(\""+a+'"'+")'>删除</button>"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#cancelDeleteFolderBtn").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1),$("#cancelDeleteFolderBtn").attr("disabled",!0)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html("<button type='button' class='btn btn-primary' onclick='renameFolder(\""+a+'"'+")'>修改</button>"),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>128?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)||0==b.indexOf(".")?showRFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}}))}function showRFolderAlert(a){$("#editfolderalert").addClass("alert"),$("#editfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#editfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b<fs.length;b++)a+=fs[b].name,b<fs.length-1&&(a+="、");fs.length<=1?$("#selectcount").text(""):$("#selectcount").text("(共"+fs.length+"个)"),$("#filepath").val(a)}function checkUploadFile(){var filenames,maxSize,maxFileIndex,i,namelist;if(0==isUpLoading&&0==isImporting)if(null!=fs&&fs.length>0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").hide(),$("#uploadFileAlert").text(""),filenames=new Array,maxSize=0,maxFileIndex=0,i=0;i<fs.length;i++)filenames[i]=fs[i].name,fs[i].size>maxSize&&(maxSize=fs[i].size,maxFileIndex=i);namelist=JSON.stringify(filenames),$.ajax({type:"POST",dataType:"text",data:{folderId:locationpath,namelist:namelist,maxSize:maxSize,maxFileIndex:maxFileIndex},url:"homeController/checkUploadFile.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"errorParameter":showUploadFileAlert("提示:参数不正确,无法开始上传");break;case"noAuthorized":showUploadFileAlert("提示:您的操作未被授权,无法开始上传");break;case"filesTotalOutOfLimit":showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,无法在其中上传更多文件。您可以尝试将其上传至其他文件夹内。");break;default:var resp=eval("("+result+")");"fileTooLarge"==resp.checkResult?showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传"):"hasExistsNames"==resp.checkResult?(repeList=resp.pereFileNameList,repeIndex=0,selectFileUpLoadModelStart()):"permitUpload"==resp.checkResult?doupload(1):showUploadFileAlert("提示:出现意外错误,无法开始上传")}},error:function(){showUploadFileAlert("提示:出现意外错误,无法开始上传")}})}else showUploadFileAlert("提示:您未选择任何文件,无法开始上传");else showUploadFileAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function selectFileUpLoadModelStart(){var a=originFolderView.authList;checkAuth(a,"D")?$("#uploadcoverbtn").show():$("#uploadcoverbtn").hide(),$("#selectFileUpLoadModelAlert").show(),$("#repeFileName").text(repeList[repeIndex])}function selectFileUpLoadModelEnd(a){if(null==repeModelList&&(repeModelList={}),repeModelList[$("#repeFileName").text()]=a,$("#selectFileUpLoadModelAlert").hide(),$("#selectFileUpLoadModelAsAll").prop("checked")){for(var b=repeIndex;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>"+html2Escape(d)+"<span id='uls_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("fname",d),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){if(null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+d+"]上传失败。您可以尝试将其上传至其他文件夹内。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("<p>未找到要上传的文件<span id='uls_"+a+"'>[失败]</span></p>")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").show(),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function abortUpload(){isUpLoading&&(isUpLoading=!1,null!=xhr&&xhr.abort()),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function showDownloadModel(a,b){$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>"),getDownloadFileId=a,getDownloadFileName=b,$("#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),$("#cancelDeleteFileBox").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html("<button type='button' class='btn btn-primary' onclick='renameFile(\""+a+'"'+")'>修改</button>"),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\\\*\\<\\>\\?\\:\\&\\$"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getResource/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function txtView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getTxtView/"+a)}function pptView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getPPTView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")
  3 +}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b<pvl.pictureViewList.length;b++)$(a).append("<li><img src='"+pvl.pictureViewList[b].url+"' alt='"+html2Escape(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++)$(a).append("<li><img src='"+pvl.pictureViewList[b+c].url+"' alt='"+html2Escape(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(){if(folderView.enableDownloadZip){$("#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)),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1),$("#downloadAllCheckedModal").modal("toggle")}}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0),$("#cancelDownloadAllCheckedBtn").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?($("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。"),$("#dclmbutton").attr("disabled",!1),$("#cancelDownloadAllCheckedBtn").attr("disabled",!1)}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html("<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),$("#cancelDeleteFileBox").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="prv/login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1),$("#cancelDeleteFileBox").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==pingInt&&(pingInt=setInterval("ping()",6e4)),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-play' aria-hidden='true'></span>")}),ap.on("play",function(){$("#playOrPause").html("<span class='glyphicon glyphicon-pause' aria-hidden='true'></span>")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var i,ail=eval("("+result+")");for(i=ail.index;i<ail.as.length;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),ap.list.add(ail.as[i]);for(i=0;i<ail.index;i++)ail.as[i].name=ail.as[i].name.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;"),ap.list.add(ail.as[i]);audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide")}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){if(loadingComplete&&!$("#sortByCD,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFN").removeClass(),$("#sortByFN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView),$("#sortByFN").removeClass(),-1==a?$("#sortByFN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycd(){if(loadingComplete&&!$("#sortByFN,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCD").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCD").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){var d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),folderView.folderList.sort(function(b,c){var d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=c.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),f=new Date(Date.parse(d)).getTime()-new Date(Date.parse(e)).getTime();return a*f}),showFolderTable(folderView),$("#sortByCD").removeClass(),-1==a?$("#sortByCD").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbyfs(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByFS").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByFS").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*(b.fileSize-c.fileSize)}),showFolderTable(folderView),$("#sortByFS").removeClass(),-1==a?$("#sortByFS").addClass("glyphicon glyphicon-triangle-top"):$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function sortbycn(){if(loadingComplete&&!$("#sortByFN,#sortByCD,#sortByFS,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByOR").removeClass();var a=1;$("#sortByCN").hasClass("glyphicon-triangle-bottom")&&(a=-1),$("#sortByCN").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView.fileList.sort(function(b,c){return a*c.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(b,c){return a*c.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView),$("#sortByCN").removeClass(),-1==a?$("#sortByCN").addClass("glyphicon glyphicon-triangle-top"):$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom")},0)}}function showOriginFolderView(){loadingComplete&&($("#sortByFN,#sortByCD,#sortByFS,#sortByCN").hasClass("glyphicon glyphicon-hourglass")||($("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").addClass("glyphicon glyphicon-hourglass"),setTimeout(function(){folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView),$("#sortByOR").removeClass()},0)))}function cutFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!1)}function copyFile(){checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles.size<100?$("#stickFilesCount").text("("+checkedMovefiles.size+")"):$("#stickFilesCount").text("(99+)"),$("#copyFileButtonLi").removeClass("show"),$("#copyFileButtonLi").addClass("hidden"),$("#cutFileButtonLi").removeClass("show"),$("#cutFileButtonLi").addClass("hidden"),$("#stickFileButtonLi").removeClass("hidden"),$("#stickFileButtonLi").addClass("show"),isCopy=!0)}function stickFile(){void 0!==checkedMovefiles&&checkedMovefiles.size>0&&(isCopy?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项复制到当前位置么?"),$("#moveFilesBox").html("<button id='dmvfbutton' type='button' class='btn btn-primary' onclick='doMoveFiles()'>全部复制</button>")):($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("<button id='dmvfbutton' type='button' class='btn btn-danger' onclick='doMoveFiles()'>全部移动</button>")),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#cancelMoveFilesBtn").attr("disabled",!1),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show"))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#cancelMoveFilesBtn").attr("disabled",!0);var method="MOVE";isCopy?($("#moveFilesMessage").text("提示:正在复制,请稍候..."),method="COPY"):$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath,method:method},url:"homeController/confirmMoveFiles.ajax",success:function(result){if("mustLogin"==result)window.location.href="prv/login.html";else switch(result){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"confirmMoveFiles":strMoveOptMap={},sendMoveFilesReq();break;default:if(result.startsWith("duplicationFileName:")){repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);var authList=originFolderView.authList;checkAuth(authList,"D")?$("#movecoverbtn").show():$("#movecoverbtn").hide(),$("#selectFileMoveModelAlert").show()}else result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1))}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)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),b="MOVE";isCopy&&(b="COPY"),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,strOptMap:a,locationpath:locationpath,method:b},url:"homeController/moveCheckedFiles.ajax",success:function(a){if("mustLogin"==a)window.location.href="prv/login.html";else switch(a){case"noAuthorized":$("#moveFilesMessage").text("提示:您的操作未被授权,操作失败"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"errorParameter":$("#moveFilesMessage").text("提示:参数不正确,无法完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"filesTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件数量已达上限,无法添加更多文件"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"foldersTotalOutOfLimit":$("#moveFilesMessage").text("提示:该文件夹内存储的文件夹数量已达上限,无法添加更多文件夹"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"cannotMoveFiles":$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1);break;case"moveFilesSuccess":$("#moveFilesModal").modal("hide"),showFolderView(locationpath);break;default:$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").attr("disabled",!1)}},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能完成此操作,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1),$("#cancelMoveFilesBtn").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(),$("#sortByOR").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}}function selectInCompletePath(keyworld){return 0==keyworld.length?(showFolderView(locationpath),void 0):(startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:locationpath,keyworld:keyworld},url:"homeController/sreachInCompletePath.ajax",success:function(result){endLoading(),"ERROR"==result?(doAlert(),$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>"),$("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>")):"mustLogin"==result?window.location.href="prv/login.html":"notAccess"==result?(document.cookie="folder_id="+escape("root"),window.location.href="/"):(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val("all:"+folderView.keyWorld),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),$("#sortByOR").removeClass(),showFolderTable(folderView),$("#fim_name").text(folderView.folder.folderName),$("#fim_creator").text("--"),$("#fim_folderCreationDate").text("--"),$("#fim_folderId").text("--"),updateTheFolderInfo())},error:function(){endLoading(),doAlert(),$("#tb").html("<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){var b=window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+encodeURIComponent(getDownloadFileName.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?dkey="+a;$("#downloadHrefBox").html("<a href='"+b+"'>"+b+"</a>")},error:function(){$("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>")}})}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)},error:function(){null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}})}function isSupportWebkitdirectory(){var a=document.createElement("input");return"webkitdirectory"in a&&!/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?!0:!1}function showUploadFolderModel(){if($("#importFolderAlert").hide(),$("#importFolderAlert").text(""),0==isImporting)if($("#folderpath").val(""),$("#importfolder").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importstatus").html(""),$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importcount").text(""),$("#importbutton").attr("disabled",!1),$("#importfoldertypelist").html(""),$("#selectFolderImportModelAlert").hide(),null!=account){$("#folderpath").attr("folderConstraintLevel",constraintLevel+""),$("#importfoldertype").text(folderTypes[constraintLevel]);for(var a=constraintLevel;a<folderTypes.length;a++)$("#importfoldertypelist").append("<li><a onclick='changeImportFolderType("+a+")'>"+folderTypes[a]+"</a></li>")}else $("#importfoldertypelist").append("<li><a onclick='changeImportFolderType(0)'>"+folderTypes[0]+"</a></li>");$("#importFolderModal").modal("show")}function checkimportpath(){$("#importfolder").click()}function getInputImport(){ifs=$("#importfolder")[0].files,ifs.length>0&&(importFolderName=ifs[0].webkitRelativePath.substring(0,ifs[0].webkitRelativePath.indexOf("/")),$("#folderpath").val(importFolderName))}function checkImportFolder(){var maxSize,maxFileIndex,i;if(0==isUpLoading&&0==isImporting)if(null!=ifs&&ifs.length>0){for($("#folderpath").attr("disabled",!0),$("#importFolderLevelBtn").attr("disabled",!0),$("#importbutton").attr("disabled",!0),$("#importFolderAlert").hide(),$("#importFolderAlert").text(""),isImporting=!0,maxSize=0,maxFileIndex=0,i=0;i<ifs.length;i++)ifs[i].size>maxSize&&(maxSize=ifs[i].size,maxFileIndex=i);$.ajax({url:"homeController/checkImportFolder.ajax",type:"POST",dataType:"text",data:{folderName:importFolderName,maxSize:maxSize,folderId:locationpath},success:function(result){var resJson=eval("("+result+")");switch(resJson.result){case"noAuthorized":showImportFolderAlert("提示:您的操作未被授权,无法开始上传");break;case"errorParameter":showImportFolderAlert("提示:参数不正确,无法开始上传。必须选择一个文件夹");break;case"mustLogin":window.location.href="prv/login.html";break;case"fileOverSize":showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");break;case"foldersTotalOutOfLimit":showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中上传更多文件夹。您可以尝试将其上传至其他文件夹内。");break;case"repeatFolder_Both":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").hide(),$("#selectFolderImportModelAlert").show();break;case"repeatFolder_coverOrBoth":$("#repeFolderName").text(importFolderName),$("#importcoverbtn").show(),$("#selectFolderImportModelAlert").show();break;case"permitUpload":iteratorImport(0);break;default:showImportFolderAlert("提示:出现意外错误,无法开始上传")}},error:function(){showImportFolderAlert("提示:出现意外错误,无法开始上传")}})}else showImportFolderAlert("提示:您未选择任何文件夹,无法开始上传");else showImportFolderAlert("提示:另一项上传文件或文件夹的任务尚未完成,无法开始上传")}function showImportFolderAlert(a){isImporting=!1,$("#folderpath").attr("disabled",!1),$("#importFolderLevelBtn").attr("disabled",!1),$("#importFolderAlert").show(),$("#importFolderAlert").text(a),$("#importbutton").attr("disabled",!1)}function importProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#importpros").width(b+"%"),$("#importpros").attr("aria-valuenow",""+b)}}function importAndCover(){$("#selectFolderImportModelAlert").hide(),$.ajax({url:"homeController/deleteFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName},dataType:"text",success:function(a){"deleteSuccess"==a?iteratorImport(0):showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")},error:function(){showImportFolderAlert("提示:无法覆盖原文件夹,上传失败")}})}function importAndBoth(){$("#selectFolderImportModelAlert").hide();var fc=$("#folderpath").attr("folderConstraintLevel");$.ajax({url:"homeController/createNewFolderByName.ajax",type:"POST",data:{parentId:locationpath,folderName:importFolderName,folderConstraint:fc},dataType:"text",success:function(result){var resJson=eval("("+result+")");"success"==resJson.result?iteratorImport(0,resJson.newName):"foldersTotalOutOfLimit"==resJson.result?showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法上传同名文件夹并保留两者。您可以尝试将其上传至其他文件夹内。"):showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")},error:function(){showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传")}})}function iteratorImport(a,b){var c,d,e,f,g;$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),c=ifs[a],d=ifs.length,e=$("#folderpath").attr("folderConstraintLevel"),null!=c?(f=c.webkitRelativePath,d>1&&$("#importcount").text("("+(a+1)+"/"+d+")"),$("#importstatus").prepend("<p>"+html2Escape(f)+"<span id='ils_"+a+"'>[正在上传...]</span></p>"),xhr=new XMLHttpRequest,g=new FormData,g.append("file",c),g.append("folderId",locationpath),g.append("folderConstraint",e),g.append("originalFileName",f),b&&g.append("newFolderName",b),xhr.open("POST","homeController/doImportFolder.ajax",!0),xhr.upload.addEventListener("progress",importProgress,!1),xhr.send(g),null==pingInt&&(pingInt=setInterval("ping()",6e4)),xhr.onloadend=function(){var c,e;null!=pingInt&&(window.clearInterval(pingInt),pingInt=null),200===xhr.status?(c=xhr.responseText,"uploadsuccess"==c?($("#ils_"+a).text("[已完成]"),e=a+1,d>e?iteratorImport(e,b):(isImporting=!1,$("#folderpath").removeAttr("disabled"),$("#importFolderLevelBtn").removeAttr("disabled"),$("#importfolder").val(""),$("#folderpath").val(""),$("#importpros").width("0%"),$("#importpros").attr("aria-valuenow","0"),$("#importbutton").attr("disabled",!1),$("#importcount").text(""),$("#importstatus").text(""),$("#importFolderModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"foldersTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):"filesTotalOutOfLimit"==c?(showImportFolderAlert("提示:该文件夹内存储的文件数量已达上限,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]")):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))):(showImportFolderAlert("提示:出现意外错误,文件:["+f+"]上传失败,上传被中断。"),$("#ils_"+a).text("[失败]"))}):(showImportFolderAlert("提示:要上传的文件不存在。"),$("#importstatus").prepend("<p>未找到要上传的文件<span id='ils_"+a+"'>[失败]</span></p>"))}function abortImport(){isImporting&&(isImporting=!1,null!=xhr&&xhr.abort()),$("#importFolderModal").modal("hide"),showFolderView(locationpath)}function changeImportFolderType(a){$("#importfoldertype").text(folderTypes[a]),$("#folderpath").attr("folderConstraintLevel",a+"")}function doChangePassword(){var change_oldPassword,change_newPassword,change_reqNewPassword;return $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepasswordalertbox").hide(),change_oldPassword=$("#changepassword_oldpwd").val(),change_newPassword=$("#changepassword_newpwd").val(),change_reqNewPassword=$("#changepassword_reqnewpwd").val(),0==change_oldPassword.length?($("#changepassword_oldepwdbox").addClass("has-error"),$("#changepassword_oldpwd").focus(),void 0):0==change_newPassword.length?($("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_newpwd").focus(),void 0):0==change_reqNewPassword.length?($("#changepassword_reqnewpwdbox").addClass("has-error"),$("#changepassword_reqnewpwd").focus(),void 0):(isChangingPassword=!0,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!0),change_newPassword+""!=change_reqNewPassword+""?(showChangePasswordAlert("提示:两次输入的新密码不一致,请检查确认"),$("#changepassword_newpwdbox").addClass("has-error"),$("#changepassword_reqnewpwdbox").addClass("has-error"),void 0):($.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,changepwd_publicKeyInfo=eval("("+result+")"),changePasswordInfo='{oldPwd:"'+change_oldPassword+'",newPwd:"'+change_newPassword+'",time:"'+changepwd_publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(changepwd_publicKeyInfo.publicKey),encrypted=encrypt.encrypt(changePasswordInfo),sendChangePasswordInfo(encrypted)},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}}),void 0))}function sendChangePasswordInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doChangePassword.ajax",data:{encrypted:a,vercode:$("#changepassword_vercode").val()},success:function(a){switch($("#changepassword_vccodebox").hide(),isChangingPassword=!1,a){case"success":$("#changePasswordModal").modal("hide");break;case"mustlogin":showChangePasswordAlert("提示:登录已失效或尚未登录账户,请刷新并登陆账户");break;case"illegal":showChangePasswordAlert("提示:用户修改密码功能已被禁用,请求被拒绝");break;case"oldpwderror":showChangePasswordAlert("提示:旧密码输入错误,请求被拒绝"),$("#changepassword_oldepwdbox").addClass("has-error");break;case"needsubmitvercode":$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton").attr("disabled",!1),$("#changepassword_vccodebox").html("<label id='changepassword_vercodetitle' class='col-sm-5'><img id='changepassword_showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date).getTime()+"' onclick='changePasswordGetNewVerCode()'></label><div class='col-sm-7'><input type='text' class='form-control' id='changepassword_vercode' placeholder='验证码……'></div>"),$("#changepassword_vccodebox").show(),isChangingPassword=!1;break;case"invalidnewpwd":showChangePasswordAlert("提示:密码修改失败,新密码不合法。新密码的长度需为3-32个字符,且仅支持ISO-8859-1中的字符(推荐使用英文字母、英文符号及阿拉伯数字)。");break;case"error":showChangePasswordAlert("提示:密码修改失败,修改请求无法通过加密效验(可能是请求耗时过长导致的)");
  4 +break;case"cannotchangepwd":showChangePasswordAlert("提示:密码修改失败,发生意外错误,请稍后重试或联系管理员");break;default:showChangePasswordAlert("提示:密码修改失败,发生未知错误")}},error:function(){showChangePasswordAlert("提示:密码修改失败,请检查网络链接或服务器运行状态")}})}function showChangePasswordAlert(a){isChangingPassword=!1,$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepasswordalertbox").show(),$("#changepasswordalertbox").text(a)}function changePasswordGetNewVerCode(){$("#changepassword_showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date).getTime())}function getFileChain(a,b){$("#fileChainTextarea").text("正在获取……"),$("#copyChainBtn").attr("disabled",!0),$("#fileChainModal").modal("show"),$.ajax({type:"POST",dataType:"text",url:"homeController/getFileChainKey.ajax",data:{fid:a},success:function(a){switch(a){case"ERROR":$("#fileChainTextarea").text("提示:获取失败,请刷新页面或稍后再试。");break;case"mustlogin":window.location.href="prv/login.html";break;default:$("#fileChainTextarea").text(window.location.protocol+"//"+window.location.host+"/externalLinksController/chain/"+encodeURIComponent(b.replace(/\'/g,"").replace(/\r/g,"").replace(/\n/g,""))+"?ckey="+encodeURIComponent(a)),$("#copyChainBtn").attr("disabled",!1)}},error:function(){$("#fileChainTextarea").text("提示:获取失败,无法连接服务器。")}})}function copyFileChain(){node=document.getElementById("fileChainTextarea"),node.select(),document.execCommand("copy")}function showNoticeModal(){$("#noticeModal").modal("show")}function initNoticeModal(){$("#noticeModalBody").load("resourceController/getNoticeContext.do",function(){$("#noticeModalBody img").css("max-width","100%"),winHeight>=300?$("#noticeModalBody").css("max-height",winHeight-180+"px"):$("#noticeModalBody").css("max-height","300px"),noticeInited=!0,showNoticeModal(),showNoticeBtn()})}function subscribeNotice(){$.ajax({url:"resourceController/getNoticeMD5.ajax",data:{},type:"POST",dataType:"text",success:function(a){if(""!=a){var b=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)"));if(b){if(a==unescape(b[2]))return showNoticeBtn(),void 0}else if(b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),b&&a==unescape(b[2]))return showNoticeBtn(),void 0;initNoticeModal(),document.cookie="notice_md5="+escape(a)}},error:function(){alert("错误:无法从服务器获取公告信息,请尝试刷新页面。")}})}function showNoticeBtn(){$("#shownoticebox").removeClass("hidden"),$("#shownoticebox").addClass("show")}function showNotice(){noticeInited?showNoticeModal():initNoticeModal()}function loadingRemainingFolderView(targetId){var newfoldersOffset,newfilesOffset,loadingRemainingRate_folders,loadingRemainingRate_files,loadingRemainingRate;if(!remainingLoadingRequest){if(newfoldersOffset=0,newfilesOffset=0,folderView.foldersOffset-folderView.selectStep>0&&(newfoldersOffset=folderView.foldersOffset-folderView.selectStep),folderView.filesOffset-folderView.selectStep>0&&(newfilesOffset=folderView.filesOffset-folderView.selectStep),0>=newfoldersOffset&&0>=newfilesOffset)return originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId),void 0;loadingRemainingRate_folders=1,loadingRemainingRate_files=1,totalFoldersOffset>0&&(loadingRemainingRate_folders=(totalFoldersOffset-newfoldersOffset)/totalFoldersOffset),totalFilesOffset>0&&(loadingRemainingRate_files=(totalFilesOffset-newfilesOffset)/totalFilesOffset),loadingRemainingRate=(loadingRemainingRate_folders+loadingRemainingRate_files)/2,$("#loadingrate").text(parseInt(100*loadingRemainingRate)+"%"),remainingLoadingRequest=$.ajax({url:"homeController/getRemainingFolderView.ajax",data:{fid:locationpath,foldersOffset:newfoldersOffset,filesOffset:newfilesOffset},type:"POST",dataType:"text",success:function(result){switch(remainingLoadingRequest=null,result){case"ERROR":alert("错误:无法加载剩余文件列表,文件数据可能未显示完全,请刷新重试!"),hiddenLoadingRemaininngBox(),doFixedRow();break;case"NOT_FOUND":case"notAccess":document.cookie="folder_id="+escape("root");case"mustLogin":window.location.href="/";break;default:folderView.foldersOffset=newfoldersOffset,folderView.filesOffset=newfilesOffset;var remainingFV=eval("("+result+")");updateFolderTable(remainingFV),updateTheFolderInfo(),folderView.foldersOffset>0||folderView.filesOffset>0?loadingRemainingFolderView(targetId):(originFolderView=$.extend(!0,{},folderView),hiddenLoadingRemaininngBox(),doFixedRow(targetId))}},error:function(a,b){remainingLoadingRequest=null,hiddenLoadingRemaininngBox(),"abort"!=b&&alert("错误:无法连接服务器,文件列表加载被中断。请刷新重试!")}})}}function doFixedRow(a){a&&a.length>0&&($("#"+a).addClass("info"),$("html,body").animate({scrollTop:$("#"+a).offset().top-$(window).height()/2},"slow"))}function showLoadingRemaininngBox(){loadingComplete=!1,$("#loadingremaininngbox").addClass("show"),$("#loadingremaininngbox").removeClass("hidden"),$("#searchbtn").attr("disabled","disabled")}function hiddenLoadingRemaininngBox(){loadingComplete=!0,$("#loadingremaininngbox").removeClass("show"),$("#loadingremaininngbox").addClass("hidden"),$("#searchbtn").removeAttr("disabled")}function updateFolderTable(a){var g,h,i,j,b=folderView.authList,c=!1,d=!1,e=!1,f=!1;if(checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),checkAuth(b,"O")&&(f=!0),a.folderList&&a.folderList.length>0)for(g=a.folderList.length;g>0;g--)h=a.folderList[g-1],folderContains(folderView.folderList,h.folderId)||(folderView.folderList.unshift(h),$("[iskfolder=true]:last").after(createNewFolderRow(h,c,d,f)));if(a.fileList&&a.fileList.length>0)for(i=a.fileList.length;i>0;i--)j=a.fileList[i-1],fileContains(folderView.fileList,j.fileId)||(folderView.fileList.unshift(j),$("#foldertable").append(createFileRow(j,e,c,d,f)))}function folderContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].folderId==b)return!0;return!1}function fileContains(a,b){for(var c=a.length;c>0;c--)if(a[c-1].fileId==b)return!0;return!1}function updateTheFolderInfo(){$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}function replaceAllQuotationMarks(a){return a.replace(/\"/g,'\\"')}function html2Escape(a){return a.replace(/[<>&\']/g,function(a){return{"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;"}[a]})}var ap,zipTimer,folderView,originFolderView,fs,ifs,checkedMovefiles,isCopy,repeMap,strMoveOptMap,mRepeSize,constraintLevel,account,importFolderName,xhr,viewer,viewerPageIndex,viewerTotal,pvl,winHeight,pingInt,loadingComplete,totalFoldersOffset,totalFilesOffset,remainingLoadingRequest,loadingFolderView,folderTypes,repeList,repeIndex,repeModelList,screenedFoldrView,getDownloadFileId,getDownloadFileName,locationpath="root",parentpath="null",isUpLoading=!1,isImporting=!1,isChangingPassword=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<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>:选中/取消选中所有文件",noticeInited=!1;$(function(){window.onresize=function(){changeFilesTableStyle(),updateWinHeight()},changeFilesTableStyle(),getServerOS(),subscribeNotice();var a=document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)"));null!=a?showFolderView(unescape(a[2])):showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause()),null!=pingInt&&(window.clearInterval(pingInt),pingInt=null)}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){"disabled"!==$("#dologinButton").attr("disabled")&&($("#accountid").val(""),$("#accountpwd").val("")),$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),$("#vercodebox").html(""),$("#vercodebox").removeClass("show"),$("#vercodebox").addClass("hidden")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&0==c.prop("disabled")&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b<folderTypes.length;b++)$("#foldertypelist").append("<li><a onclick='changeNewFolderType("+b+")'>"+folderTypes[b]+"</a></li>")}else $("#foldertypelist").append("<li><a onclick='changeNewFolderType(0)'>"+folderTypes[0]+"</a></li>")}),$("#newFolderModal").on("shown.bs.modal",function(){$("#foldername").focus()}),$("#uploadFileModal,#importFolderModal").on("hidden.bs.modal",function(){(isUpLoading||isImporting)&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#editfolderalert").removeClass("alert"),$("#editfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#editfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b<folderTypes.length;b++)$("#editfoldertypelist").append("<li><a onclick='changeEditFolderType("+b+")'>"+folderTypes[b]+"</a></li>");else $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType(0)'>"+folderTypes[0]+"</a></li>")}),document.ondragover=function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)},document.ondrop=function(a){var b,c,d,e,f,g;if(a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1),null!=folderView.authList)if(checkAuth(folderView.authList,"U"))if(isUpLoading||isImporting)alert("提示:您正在执行另一项上传任务,请在上传完成后再试。");else if(window.ActiveXObject||"ActiveXObject"in window)alert("提示:IE浏览器不支持拖拽上传。您可以使用现代浏览器或将浏览模式切换为“极速模式”来体验该功能。");else{if(b=null!=a.dataTransfer?a.dataTransfer:window.event.dataTransfer,c=!0,void 0!==b.items)for(d=0;d<b.items.length;d++)e=b.items[d],"file"===e.kind&&e.webkitGetAsEntry().isFile||(c=!1);else for(d=0;d<b.files.length;d++)if(f=df.files[d],f.type);else try{g=new FileReader,g.readAsDataURL(f.slice(0,10)),g.addEventListener("load",function(){},!1),g.addEventListener("error",function(){c=!1},!1)}catch(a){c=!1}c?(fs=a.dataTransfer.files,showUploadFileModel(),showfilepath(),checkUploadFile()):alert("提示:您拖入的文件中包含了一个或多个文件夹,无法进行上传。")}else alert("提示:您不具备上传权限,无法上传文件。");else alert("提示:您不具备上传权限,无法上传文件。")},$(document).keypress(function(a){if(0==$(".modal.shown").length||1==$(".modal.shown").length&&"loadingModal"==$(".modal.shown").attr("id")){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(isShift(a)&&"sreachKeyWordIn"!=document.activeElement.id){switch(b){case 65:checkallfile();break;case 78:$("#createFolderButtonLi a").click();break;case 85:$("#uploadFileButtonLi a").click();break;case 68:$("#deleteSeelectFileButtonLi a").click();break;case 70:$("#uploadFolderButtonLi a").click();break;case 67:(void 0==checkedMovefiles||0==checkedMovefiles.size)&&$("#copyFileButtonLi a").click();break;case 88:(void 0==checkedMovefiles||0==checkedMovefiles.size)&&$("#cutFileButtonLi a").click();break;case 86:void 0!==checkedMovefiles&&checkedMovefiles.size>0&&$("#stickFileButtonLi a").click();break;default:return!0}return!1}}}),$("#moveFilesModal").on("hidden.bs.modal",function(){checkedMovefiles=void 0,$("#copyFileButtonLi").removeClass("hidden"),$("#copyFileButtonLi").addClass("show"),$("#cutFileButtonLi").removeClass("hidden"),$("#cutFileButtonLi").addClass("show"),$("#stickFileButtonLi").removeClass("show"),$("#stickFileButtonLi").addClass("hidden"),$("#stickFilesCount").text(""),$("#moveFilesBox").html("")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")}),updateWinHeight(),$(window).scroll(function(){$(this).scrollTop()>2*winHeight?$("#gobacktotopbox").removeClass("hidden"):$("#gobacktotopbox").addClass("hidden")}),$("#downloadURLCollapse").on("shown.bs.collapse",function(){getDownloadURL()}),$("#changePasswordModal").on("show.bs.modal",function(){isChangingPassword||($("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr("disabled",!1),$("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"),$("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd").val(""),$("#changepasswordalertbox,#changepassword_vccodebox").hide())}),$("#changePasswordModal").on("shown.bs.modal",function(){isChangingPassword||$("#changepassword_oldpwd").focus()}),$("#noticeModal").on("show.bs.modal",function(){var b=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));b?$("#dontShowSomeNoticeAt30Day").attr("checked","checked"):$("#dontShowSomeNoticeAt30Day").attr("checked",!1)}),$("#noticeModal").on("hidden.bs.modal",function(){var c,d,b=new Date;$("#dontShowSomeNoticeAt30Day").prop("checked")?(b.setTime(b.getTime()+2592e6),c=document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)")),c?document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString():(c=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),c&&(document.cookie="notice_md5_30="+escape(unescape(c[2]))+";expires="+b.toUTCString()))):(b.setTime(0),d=document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")),d&&(document.cookie="notice_md5_30=0;expires="+b.toUTCString()))})}),folderTypes=["公开的","仅小组","仅创建者"];
5 5 \ No newline at end of file
... ...
1 1 /*!
2   - * Viewer.js v1.3.0
  2 + * Viewer.js v1.5.0
3 3 * https://fengyuanchen.github.io/viewerjs
4 4 *
5 5 * Copyright 2015-present Chen Fengyuan
6 6 * Released under the MIT license
7 7 *
8   - * Date: 2018-10-25T12:41:54.899Z
  8 + * Date: 2019-11-23T05:10:26.193Z
9 9 */
10   -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.Viewer=i()}(this,function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,zoom:null,zoomed:null},a="undefined"!=typeof window,r=a?window:{},p="viewer",c="move",d="switch",u="zoom",m="".concat(p,"-active"),w="".concat(p,"-close"),b="".concat(p,"-fade"),y="".concat(p,"-fixed"),x="".concat(p,"-fullscreen"),h="".concat(p,"-fullscreen-exit"),z="".concat(p,"-hide"),e="".concat(p,"-hide-md-down"),n="".concat(p,"-hide-sm-down"),l="".concat(p,"-hide-xs-down"),f="".concat(p,"-in"),D="".concat(p,"-invisible"),g="".concat(p,"-loading"),v="".concat(p,"-move"),k="".concat(p,"-open"),E="".concat(p,"-show"),I="".concat(p,"-transition"),S="click",T="dblclick",L="dragstart",N="hidden",M="hide",C="keydown",R="load",Y=r.PointerEvent?"pointerdown":"touchstart mousedown",X=r.PointerEvent?"pointermove":"touchmove mousemove",q=r.PointerEvent?"pointerup pointercancel":"touchend touchcancel mouseup",O="ready",F="resize",W="show",A="shown",P="transitionend",H="view",j="viewed",V="wheel mousewheel DOMMouseScroll",B="zoom",K="zoomed",U="".concat(p,"Action"),Z=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"],$=/\s\s*/;function _(t){return"string"==typeof t}var G=Number.isNaN||r.isNaN;function J(t){return"number"==typeof t&&!G(t)}function Q(t){return void 0===t}function tt(t){return"object"===i(t)&&null!==t}var it=Object.prototype.hasOwnProperty;function et(t){if(!tt(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&it.call(e,"isPrototypeOf")}catch(t){return!1}}function nt(t){return"function"==typeof t}function st(i,e){if(i&&nt(e))if(Array.isArray(i)||J(i.length)){var t,n=i.length;for(t=0;t<n&&!1!==e.call(i,i[t],t,i);t+=1);}else tt(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)});return i}var ot=Object.assign||function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return tt(e)&&0<i.length&&i.forEach(function(i){tt(i)&&Object.keys(i).forEach(function(t){e[t]=i[t]})}),e},at=/^(?:width|height|left|top|marginLeft|marginTop)$/;function rt(t,i){var e=t.style;st(i,function(t,i){at.test(i)&&J(t)&&(t+="px"),e[i]=t})}function ht(t,i){if(i)if(J(t.length))st(t,function(t){ht(t,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className="".concat(e," ").concat(i)):t.className=i}}function lt(t,i){i&&(J(t.length)?st(t,function(t){lt(t,i)}):t.classList?t.classList.remove(i):0<=t.className.indexOf(i)&&(t.className=t.className.replace(i,"")))}function ct(t,i,e){i&&(J(t.length)?st(t,function(t){ct(t,i,e)}):e?ht(t,i):lt(t,i))}var dt=/([a-z\d])([A-Z])/g;function ut(t){return t.replace(dt,"$1-$2").toLowerCase()}function mt(t,i){return tt(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-".concat(ut(i)))}function ft(t,i,e){tt(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-".concat(ut(i)),e)}var gt=function(){var t=!1;if(a){var i=!1,e=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,i},set:function(t){i=t}});r.addEventListener("test",e,n),r.removeEventListener("test",e,n)}return t}();function vt(e,t,n){var s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split($).forEach(function(t){if(!gt){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,s)})}function pt(o,t,a){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},h=a;t.trim().split($).forEach(function(n){if(r.once&&!gt){var t=o.listeners,s=void 0===t?{}:t;h=function(){delete s[n][a],o.removeEventListener(n,h,r);for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];a.apply(o,i)},s[n]||(s[n]={}),s[n][a]&&o.removeEventListener(n,s[n][a],r),s[n][a]=h,o.listeners=s}o.addEventListener(n,h,r)})}function wt(t,i,e){var n;return nt(Event)&&nt(CustomEvent)?n=new CustomEvent(i,{detail:e,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(i,!0,!0,e),t.dispatchEvent(n)}function bt(t){var i=t.rotate,e=t.scaleX,n=t.scaleY,s=t.translateX,o=t.translateY,a=[];J(s)&&0!==s&&a.push("translateX(".concat(s,"px)")),J(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),J(i)&&0!==i&&a.push("rotate(".concat(i,"deg)")),J(e)&&1!==e&&a.push("scaleX(".concat(e,")")),J(n)&&1!==n&&a.push("scaleY(".concat(n,")"));var r=a.length?a.join(" "):"none";return{WebkitTransform:r,msTransform:r,transform:r}}var yt=r.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(r.navigator.userAgent);function xt(t,i){var e=document.createElement("img");if(t.naturalWidth&&!yt)return i(t.naturalWidth,t.naturalHeight),e;var n=document.body||document.documentElement;return e.onload=function(){i(e.width,e.height),yt||n.removeChild(e)},e.src=t.src,yt||(e.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(e)),e}function zt(t){switch(t){case 2:return l;case 3:return n;case 4:return e;default:return""}}function Dt(t,i){var e=t.pageX,n=t.pageY,s={endX:e,endY:n};return i?s:ot({startX:e,startY:n},s)}var t={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,i=this.options,e=this.parent;i.inline&&(t={width:Math.max(e.offsetWidth,i.minWidth),height:Math.max(e.offsetHeight,i.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=ot({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&rt(this.viewer,this.viewerData)},initList:function(){var a=this,t=this.element,r=this.options,i=this.list,h=[];st(this.images,function(t,i){var e,n=t.src,s=t.alt||(_(e=n)?e.replace(/^.*\//,"").replace(/[?&#].*$/,""):""),o=r.url;_(o)?o=t.getAttribute(o):nt(o)&&(o=o.call(a,t)),(n||o)&&h.push("<li><img"+' src="'.concat(n||o,'"')+' role="button" data-viewer-action="view"'+' data-index="'.concat(i,'"')+' data-original-url="'.concat(o||n,'"')+' alt="'.concat(s,'"')+"></li>")}),i.innerHTML=h.join(""),this.items=i.getElementsByTagName("li"),st(this.items,function(i){var t=i.firstElementChild;ft(t,"filled",!0),r.loading&&ht(i,g),pt(t,R,function(t){r.loading&&lt(i,g),a.loadImage(t)},{once:!0})}),r.transition&&pt(t,j,function(){ht(i,I)},{once:!0})},renderList:function(t){var i=t||this.index,e=this.items[i].offsetWidth||30,n=e+1;rt(this.list,ot({width:n*this.length},bt({translateX:(this.viewerData.width-e)/2-n*i})))},resetList:function(){var t=this.list;t.innerHTML="",lt(t,I),rt(t,bt({translateX:0}))},initImage:function(r){var t,h=this,l=this.options,i=this.image,e=this.viewerData,n=this.footer.offsetHeight,c=e.width,d=Math.max(e.height-n,n),u=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=xt(i,function(t,i){var e=t/i,n=c,s=d;h.imageInitializing=!1,c<d*e?s=c/e:n=d*e;var o={naturalWidth:t,naturalHeight:i,aspectRatio:e,ratio:(n=Math.min(.9*n,t))/t,width:n,height:s=Math.min(.9*s,i),left:(c-n)/2,top:(d-s)/2},a=ot({},o);l.rotatable&&(o.rotate=u.rotate||0,a.rotate=0),l.scalable&&(o.scaleX=u.scaleX||1,o.scaleY=u.scaleY||1,a.scaleX=1,a.scaleY=1),h.imageData=o,h.initialImageData=a,r&&r()})},renderImage:function(t){var i=this,e=this.image,n=this.imageData;if(rt(e,ot({width:n.width,height:n.height,marginLeft:n.left,marginTop:n.top},bt(n))),t)if((this.viewing||this.zooming)&&this.options.transition){var s=function(){i.imageRendering=!1,t()};this.imageRendering={abort:function(){vt(e,P,s)}},pt(e,P,s,{once:!0})}else t()},resetImage:function(){if(this.viewing||this.viewed){var t=this.image;this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null}}},kt={bind:function(){var t=this.canvas,i=this.element,e=this.viewer;pt(e,S,this.onClick=this.click.bind(this)),pt(e,V,this.onWheel=this.wheel.bind(this)),pt(e,L,this.onDragStart=this.dragstart.bind(this)),this.options.toggleOnDblclick&&pt(t,T,this.onDblclick=this.dblclick.bind(this)),pt(t,Y,this.onPointerDown=this.pointerdown.bind(this)),pt(i.ownerDocument,X,this.onPointerMove=this.pointermove.bind(this)),pt(i.ownerDocument,q,this.onPointerUp=this.pointerup.bind(this)),pt(i.ownerDocument,C,this.onKeyDown=this.keydown.bind(this)),pt(window,F,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.canvas,i=this.element,e=this.viewer;vt(e,S,this.onClick),vt(e,V,this.onWheel),vt(e,L,this.onDragStart),this.options.toggleOnDblclick&&vt(t,T,this.onDblclick),vt(t,Y,this.onPointerDown),vt(i.ownerDocument,X,this.onPointerMove),vt(i.ownerDocument,q,this.onPointerUp),vt(i.ownerDocument,C,this.onKeyDown),vt(window,F,this.onResize)}},Et={click:function(t){var i=t.target,e=this.options,n=this.imageData;switch(mt(i,U)){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view(mt(i,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-n.scaleX||-1);break;case"flip-vertical":this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.target.parentElement===this.canvas&&this.toggle()},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var i=this.element,e=this.options,n=this.image,s=this.index,o=this.viewerData;lt(n,D),e.loading&&lt(this.canvas,g),n.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:absolute;width:0;",this.initImage(function(){ct(n,v,e.movable),ct(n,I,e.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,nt(e.viewed)&&pt(i,j,e.viewed,{once:!0}),wt(i,j,{originalImage:t.images[s],index:s,image:n})})})},loadImage:function(t){var o=t.target,i=o.parentNode,a=i.offsetWidth||30,r=i.offsetHeight||50,h=!!mt(o,"filled");xt(o,function(t,i){var e=t/i,n=a,s=r;a<r*e?h?n=r*e:s=a/e:h?s=a/e:n=r*e,rt(o,ot({width:n,height:s},bt({translateX:(a-n)/2,translateY:(r-s)/2})))})},keydown:function(t){var i=this.options;if(this.fulled&&i.keyboard)switch(t.keyCode||t.which||t.charCode){case 27:this.played?this.stop():i.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.prev(i.loop);break;case 38:t.preventDefault(),this.zoom(i.zoomRatio,!0);break;case 39:this.next(i.loop);break;case 40:t.preventDefault(),this.zoom(-i.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}},dragstart:function(t){"img"===t.target.tagName.toLowerCase()&&t.preventDefault()},pointerdown:function(t){var i=this.options,e=this.pointers;if(this.viewed&&!this.showing&&!this.viewing&&!this.hiding){t.preventDefault(),t.changedTouches?st(t.changedTouches,function(t){e[t.identifier]=Dt(t)}):e[t.pointerId||0]=Dt(t);var n=!!i.movable&&c;1<Object.keys(e).length?n=u:"touch"!==t.pointerType&&"touchstart"!==t.type||!this.isSwitchable()||(n=d),!i.transition||n!==c&&n!==u||lt(this.image,I),this.action=n}},pointermove:function(t){var i=this.pointers,e=this.action;this.viewed&&e&&(t.preventDefault(),t.changedTouches?st(t.changedTouches,function(t){ot(i[t.identifier]||{},Dt(t,!0))}):ot(i[t.pointerId||0]||{},Dt(t,!0)),this.change(t))},pointerup:function(t){var i=this.action,e=this.pointers;t.changedTouches?st(t.changedTouches,function(t){delete e[t.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),!this.options.transition||i!==c&&i!==u||ht(this.image,I),this.action=!1)},resize:function(){var i=this;if(this.isShown&&!this.hiding&&(this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){i.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement)return void this.stop();st(this.player.getElementsByTagName("img"),function(t){pt(t,R,i.loadImage.bind(i),{once:!0}),wt(t,R)})}},wheel:function(t){var i=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50);var e=Number(this.options.zoomRatio)||.1,n=1;t.deltaY?n=0<t.deltaY?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=0<t.detail?1:-1),this.zoom(-n*e,!0,t)}}},It={show:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=this.element,e=this.options;if(e.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(nt(e.show)&&pt(i,W,e.show,{once:!0}),!1===wt(i,W)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(lt(n,z),e.transition&&!t){var s=this.shown.bind(this);this.transitioning={abort:function(){vt(n,P,s),lt(n,f)}},ht(n,I),n.offsetWidth,pt(n,P,s,{once:!0}),ht(n,f)}else ht(n,f),this.shown();return this},hide:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=this.element,e=this.options;if(e.inline||this.hiding||!this.isShown&&!this.showing)return this;if(nt(e.hide)&&pt(i,M,e.hide,{once:!0}),!1===wt(i,M))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var n=this.viewer;if(e.transition&&!t){var s=this.hidden.bind(this),o=function(){pt(n,P,s,{once:!0}),lt(n,f)};this.transitioning={abort:function(){this.viewed?vt(this.image,P,o):vt(n,P,s)}},this.viewed?(pt(this.image,P,o,{once:!0}),this.zoomTo(0,!1,!1,!0)):o()}else lt(n,f),this.hidden();return this},view:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(t=Number(t)||0,!this.isShown)return this.index=t,this.show();if(this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)return this;this.viewing&&this.viewing.abort();var i=this.element,n=this.options,s=this.title,o=this.canvas,a=this.items[t],r=a.querySelector("img"),h=mt(r,"originalUrl"),l=r.getAttribute("alt"),c=document.createElement("img");if(c.src=h,c.alt=l,nt(n.view)&&pt(i,H,n.view,{once:!0}),!1===wt(i,H,{originalImage:this.images[t],index:t,image:c})||!this.isShown||this.hiding||this.played)return this;this.image=c,lt(this.items[this.index],m),ht(a,m),this.viewed=!1,this.index=t,this.imageData={},ht(c,D),n.loading&&ht(o,g),o.innerHTML="",o.appendChild(c),this.renderList(),s.innerHTML="";var d,u=function(){var t=e.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;s.innerHTML=nt(i)?i.call(e,c,t):"".concat(l," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")")};return pt(i,j,u,{once:!0}),this.viewing={abort:function(){vt(i,j,u),c.complete?this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort():(vt(c,R,d),this.timeout&&clearTimeout(this.timeout))}},c.complete?this.load():(pt(c,R,d=this.load.bind(this),{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){lt(c,D),e.timeout=!1},1e3)),this},prev:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=this.index-1;return i<0&&(i=t?this.length-1:0),this.view(i),this},next:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=this.length-1,e=this.index+1;return i<e&&(e=t?0:i),this.view(e),this},move:function(t,i){var e=this.imageData;return this.moveTo(Q(t)?t:e.left+Number(t),Q(i)?i:e.top+Number(i)),this},moveTo:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,e=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&this.options.movable){var n=!1;J(t)&&(e.left=t,n=!0),J(i)&&(e.top=i,n=!0),n&&this.renderImage()}return this},zoom:function(t){var i=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=this.imageData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,i,e),this},zoomTo:function(t){var n,s,o,i,e,a=this,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],h=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,l=3<arguments.length&&void 0!==arguments[3]&&arguments[3],c=this.element,d=this.options,u=this.pointers,m=this.imageData;if(J(t=Math.max(0,t))&&this.viewed&&!this.played&&(l||d.zoomable)){if(!l){var f=Math.max(.01,d.minZoomRatio),g=Math.min(100,d.maxZoomRatio);t=Math.min(Math.max(t,f),g)}h&&.95<t&&t<1.05&&(t=1);var v=m.naturalWidth*t,p=m.naturalHeight*t,w=m.width/m.naturalWidth;if(nt(d.zoom)&&pt(c,B,d.zoom,{once:!0}),!1===wt(c,B,{ratio:t,oldRatio:w,originalEvent:h}))return this;if(this.zooming=!0,h){var b=(i=this.viewer,{left:(e=i.getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}),y=u&&Object.keys(u).length?(o=s=n=0,st(u,function(t){var i=t.startX,e=t.startY;n+=i,s+=e,o+=1}),{pageX:n/=o,pageY:s/=o}):{pageX:h.pageX,pageY:h.pageY};m.left-=(v-m.width)*((y.pageX-b.left-m.left)/m.width),m.top-=(p-m.height)*((y.pageY-b.top-m.top)/m.height)}else m.left-=(v-m.width)/2,m.top-=(p-m.height)/2;m.width=v,m.height=p,m.ratio=t,this.renderImage(function(){a.zooming=!1,nt(d.zoomed)&&pt(c,K,d.zoomed,{once:!0}),wt(c,K,{ratio:t,oldRatio:w,originalEvent:h})}),r&&this.tooltip()}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var i=this.imageData;return J(t=Number(t))&&this.viewed&&!this.played&&this.options.rotatable&&(i.rotate=t,this.renderImage()),this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,e=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&this.options.scalable){var n=!1;J(t)&&(e.scaleX=t,n=!0),J(i)&&(e.scaleY=i,n=!0),n&&this.renderImage()}return this},play:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var a=this.options,r=this.player,h=this.loadImage.bind(this),l=[],c=0,d=0;if(this.played=!0,this.onLoadWhenPlay=h,t&&this.requestFullscreen(),ht(r,E),st(this.items,function(t,i){var e,n,s=t.querySelector("img"),o=document.createElement("img");o.src=mt(s,"originalUrl"),o.alt=s.getAttribute("alt"),c+=1,ht(o,b),ct(o,I,a.transition),n=m,((e=t).classList?e.classList.contains(n):-1<e.className.indexOf(n))&&(ht(o,f),d=i),l.push(o),pt(o,R,h,{once:!0}),r.appendChild(o)}),J(a.interval)&&0<a.interval){var e=function t(){i.playing=setTimeout(function(){lt(l[d],f),ht(l[d=(d+=1)<c?d:0],f),t()},a.interval)};1<c&&e()}return this},stop:function(){var i=this;if(!this.played)return this;var t=this.player;return this.played=!1,clearTimeout(this.playing),st(t.getElementsByTagName("img"),function(t){vt(t,R,i.onLoadWhenPlay)}),lt(t,E),t.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,i=this.options,e=this.viewer,n=this.image,s=this.list;return!this.isShown||this.played||this.fulled||!i.inline||(this.fulled=!0,this.open(),ht(this.button,h),i.transition&&(lt(s,I),this.viewed&&lt(n,I)),ht(e,y),e.setAttribute("style",""),rt(e,{zIndex:i.zIndex}),this.initContainer(),this.viewerData=ot({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){ht(n,I),ht(s,I)},0)})})),this},exit:function(){var t=this,i=this.options,e=this.viewer,n=this.image,s=this.list;return this.isShown&&!this.played&&this.fulled&&i.inline&&(this.fulled=!1,this.close(),lt(this.button,h),i.transition&&(lt(s,I),this.viewed&&lt(n,I)),lt(e,y),rt(e,{zIndex:i.zIndexInline}),this.viewerData=ot({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){ht(n,I),ht(s,I)},0)})})),this},tooltip:function(){var t=this,i=this.options,e=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&i.tooltip&&(e.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):i.transition?(this.fading&&wt(e,P),ht(e,E),ht(e,b),ht(e,I),e.offsetWidth,ht(e,f)):ht(e,E),this.tooltipping=setTimeout(function(){i.transition?(pt(e,P,function(){lt(e,E),lt(e,b),lt(e,I),t.fading=!1},{once:!0}),lt(e,f),t.fading=!0):lt(e,E),t.tooltipping=!1},1e3)),this},toggle:function(){return 1===this.imageData.ratio?this.zoomTo(this.initialImageData.ratio,!0):this.zoomTo(1,!0),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=ot({},this.initialImageData),this.renderImage()),this},update:function(){var t=this.element,i=this.options,e=this.isImg;if(e&&!t.parentNode)return this.destroy();var s=[];if(st(e?[t]:t.querySelectorAll("img"),function(t){i.filter?i.filter(t)&&s.push(t):s.push(t)}),!s.length)return this;if(this.images=s,this.length=s.length,this.ready){var o=[];if(st(this.items,function(t,i){var e=t.querySelector("img"),n=s[i];n?n.src!==e.src&&o.push(i):o.push(i)}),rt(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var n=o.indexOf(this.index);0<=n?(this.viewed=!1,this.view(Math.max(this.index-(n+1),0))):ht(this.items[this.index],m)}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,i=this.options;return t[p]&&(this.destroyed=!0,this.ready?(this.played&&this.stop(),i.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):i.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),i.inline||vt(t,S,this.onStart),t[p]=void 0),this}},St={open:function(){var t=this.body;ht(t,k),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyPaddingRight)||0),"px")},close:function(){var t=this.body;lt(t,k),t.style.paddingRight=this.initialBodyPaddingRight},shown:function(){var t=this.element,i=this.options;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,nt(i.shown)&&pt(t,A,i.shown,{once:!0}),!1!==wt(t,A)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,i=this.options;this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),ht(this.viewer,z),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(nt(i.hidden)&&pt(t,N,i.hidden,{once:!0}),wt(t,N))},requestFullscreen:function(){var t=this.element.ownerDocument;if(this.fulled&&!t.fullscreenElement&&!t.mozFullScreenElement&&!t.webkitFullscreenElement&&!t.msFullscreenElement){var i=t.documentElement;i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen&&i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}},exitFullscreen:function(){if(this.fulled){var t=this.element.ownerDocument;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}},change:function(t){var i,e,h,n=this.options,s=this.pointers,o=s[Object.keys(s)[0]],a=o.endX-o.startX,r=o.endY-o.startY;switch(this.action){case c:this.move(a,r);break;case u:this.zoom((e=ot({},i=s),h=[],st(i,function(r,t){delete e[t],st(e,function(t){var i=Math.abs(r.startX-t.startX),e=Math.abs(r.startY-t.startY),n=Math.abs(r.endX-t.endX),s=Math.abs(r.endY-t.endY),o=Math.sqrt(i*i+e*e),a=(Math.sqrt(n*n+s*s)-o)/o;h.push(a)})}),h.sort(function(t,i){return Math.abs(t)<Math.abs(i)}),h[0]),!1,t);break;case d:this.action="switched";var l=Math.abs(a);1<l&&l>Math.abs(r)&&(this.pointers={},1<a?this.prev(n.loop):a<-1&&this.next(n.loop))}st(s,function(t){t.startX=t.endX,t.startY=t.endY})},isSwitchable:function(){var t=this.imageData,i=this.viewerData;return 1<this.length&&0<=t.left&&0<=t.top&&t.width<=i.width&&t.height<=i.height}},Tt=r.Viewer,Lt=function(){function e(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,e),!t||1!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=ot({},o,et(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.init()}var t,i,n;return t=e,n=[{key:"noConflict",value:function(){return window.Viewer=Tt,e}},{key:"setDefaults",value:function(t){ot(o,et(t)&&t)}}],(i=[{key:"init",value:function(){var e=this,t=this.element,n=this.options;if(!t[p]){t[p]=this;var i="img"===t.tagName.toLowerCase(),s=[];if(st(i?[t]:t.querySelectorAll("img"),function(t){nt(n.filter)?n.filter.call(e,t)&&s.push(t):s.push(t)}),s.length){this.isImg=i,this.length=s.length,this.images=s;var o=t.ownerDocument,a=o.body||o.documentElement;if(this.body=a,this.scrollbarWidth=window.innerWidth-o.documentElement.clientWidth,this.initialBodyPaddingRight=window.getComputedStyle(a).paddingRight,Q(document.createElement(p).style.transition)&&(n.transition=!1),n.inline){var r=0,h=function(){var t;(r+=1)===e.length&&(e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0))};this.initializing={abort:function(){st(s,function(t){t.complete||vt(t,R,h)})}},st(s,function(t){t.complete?h():pt(t,R,h,{once:!0})})}else pt(t,S,this.onStart=function(t){var i=t.target;"img"!==i.tagName.toLowerCase()||nt(n.filter)&&!n.filter.call(e,i)||e.view(e.images.indexOf(i))})}}}},{key:"build",value:function(){if(!this.ready){var t=this.element,h=this.options,i=t.parentNode,e=document.createElement("div");e.innerHTML='<div class="viewer-container" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list"></ul></div></div><div class="viewer-tooltip"></div><div role="button" class="viewer-button" data-viewer-action="mix"></div><div class="viewer-player"></div></div>';var n=e.querySelector(".".concat(p,"-container")),s=n.querySelector(".".concat(p,"-title")),o=n.querySelector(".".concat(p,"-toolbar")),a=n.querySelector(".".concat(p,"-navbar")),r=n.querySelector(".".concat(p,"-button")),l=n.querySelector(".".concat(p,"-canvas"));if(this.parent=i,this.viewer=n,this.title=s,this.toolbar=o,this.navbar=a,this.button=r,this.canvas=l,this.footer=n.querySelector(".".concat(p,"-footer")),this.tooltipBox=n.querySelector(".".concat(p,"-tooltip")),this.player=n.querySelector(".".concat(p,"-player")),this.list=n.querySelector(".".concat(p,"-list")),ht(s,h.title?zt(Array.isArray(h.title)?h.title[0]:h.title):z),ht(a,h.navbar?zt(h.navbar):z),ct(r,z,!h.button),h.backdrop&&(ht(n,"".concat(p,"-backdrop")),h.inline||!0!==h.backdrop||ft(l,U,"hide")),_(h.className)&&h.className&&h.className.split($).forEach(function(t){ht(n,t)}),h.toolbar){var c=document.createElement("ul"),d=et(h.toolbar),u=Z.slice(0,3),m=Z.slice(7,9),f=Z.slice(9);d||ht(o,zt(h.toolbar)),st(d?h.toolbar:Z,function(t,i){var e=d&&et(t),n=d?ut(i):t,s=e&&!Q(t.show)?t.show:t;if(s&&(h.zoomable||-1===u.indexOf(n))&&(h.rotatable||-1===m.indexOf(n))&&(h.scalable||-1===f.indexOf(n))){var o=e&&!Q(t.size)?t.size:t,a=e&&!Q(t.click)?t.click:t,r=document.createElement("li");r.setAttribute("role","button"),ht(r,"".concat(p,"-").concat(n)),nt(a)||ft(r,U,n),J(s)&&ht(r,zt(s)),-1!==["small","large"].indexOf(o)?ht(r,"".concat(p,"-").concat(o)):"play"===n&&ht(r,"".concat(p,"-large")),nt(a)&&pt(r,S,a),c.appendChild(r)}}),o.appendChild(c)}else ht(o,z);if(!h.rotatable){var g=o.querySelectorAll('li[class*="rotate"]');ht(g,D),st(g,function(t){o.appendChild(t)})}if(h.inline)ht(r,x),rt(n,{zIndex:h.zIndexInline}),"static"===window.getComputedStyle(i).position&&rt(i,{position:"relative"}),i.insertBefore(n,t.nextSibling);else{ht(r,w),ht(n,y),ht(n,b),ht(n,z),rt(n,{zIndex:h.zIndex});var v=h.container;_(v)&&(v=t.ownerDocument.querySelector(v)),v||(v=this.body),v.appendChild(n)}h.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,nt(h.ready)&&pt(t,O,h.ready,{once:!0}),!1!==wt(t,O)?this.ready&&h.inline&&this.view(this.index):this.ready=!1}}}])&&s(t.prototype,i),n&&s(t,n),e}();return ot(Lt.prototype,t,kt,Et,It,St),Lt});
11 10 \ No newline at end of file
  11 +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t=t||self).Viewer=i()}(this,function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),e.push.apply(e,n)}return e}function r(s){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var i,e,n;i=s,n=o[e=t],e in i?Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(t){Object.defineProperty(s,t,Object.getOwnPropertyDescriptor(o,t))})}return s}var s={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,zoom:null,zoomed:null},o="undefined"!=typeof window&&void 0!==window.document,a=o?window:{},h=o&&"ontouchstart"in a.document.documentElement,t=o&&"PointerEvent"in a,p="viewer",l="move",c="switch",u="zoom",f="".concat(p,"-active"),w="".concat(p,"-close"),b="".concat(p,"-fade"),y="".concat(p,"-fixed"),x="".concat(p,"-fullscreen"),d="".concat(p,"-fullscreen-exit"),k="".concat(p,"-hide"),m="".concat(p,"-hide-md-down"),g="".concat(p,"-hide-sm-down"),v="".concat(p,"-hide-xs-down"),z="".concat(p,"-in"),D="".concat(p,"-invisible"),T="".concat(p,"-loading"),E="".concat(p,"-move"),I="".concat(p,"-open"),O="".concat(p,"-show"),S="".concat(p,"-transition"),C="click",L="dblclick",N="dragstart",M="hidden",R="hide",Y="keydown",q="load",X=t?"pointerdown":h?"touchstart":"mousedown",F=t?"pointermove":h?"touchmove":"mousemove",W=t?"pointerup pointercancel":h?"touchend touchcancel":"mouseup",P="ready",A="resize",j="show",H="shown",V="transitionend",B="viewed",K="".concat(p,"Action"),U=/\s\s*/,Z=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function $(t){return"string"==typeof t}var _=Number.isNaN||a.isNaN;function G(t){return"number"==typeof t&&!_(t)}function J(t){return void 0===t}function Q(t){return"object"===i(t)&&null!==t}var tt=Object.prototype.hasOwnProperty;function it(t){if(!Q(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&tt.call(e,"isPrototypeOf")}catch(t){return!1}}function et(t){return"function"==typeof t}function nt(i,e){if(i&&et(e))if(Array.isArray(i)||G(i.length)){var t,n=i.length;for(t=0;t<n&&!1!==e.call(i,i[t],t,i);t+=1);}else Q(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)});return i}var st=Object.assign||function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Q(e)&&0<i.length&&i.forEach(function(i){Q(i)&&Object.keys(i).forEach(function(t){e[t]=i[t]})}),e},ot=/^(?:width|height|left|top|marginLeft|marginTop)$/;function at(t,i){var e=t.style;nt(i,function(t,i){ot.test(i)&&G(t)&&(t+="px"),e[i]=t})}function rt(t,i){return!(!t||!i)&&(t.classList?t.classList.contains(i):-1<t.className.indexOf(i))}function ht(t,i){if(t&&i)if(G(t.length))nt(t,function(t){ht(t,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className="".concat(e," ").concat(i)):t.className=i}}function lt(t,i){t&&i&&(G(t.length)?nt(t,function(t){lt(t,i)}):t.classList?t.classList.remove(i):0<=t.className.indexOf(i)&&(t.className=t.className.replace(i,"")))}function ct(t,i,e){i&&(G(t.length)?nt(t,function(t){ct(t,i,e)}):e?ht(t,i):lt(t,i))}var ut=/([a-z\d])([A-Z])/g;function dt(t){return t.replace(ut,"$1-$2").toLowerCase()}function mt(t,i){return Q(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-".concat(dt(i)))}function ft(t,i,e){Q(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-".concat(dt(i)),e)}var gt=function(){var t=!1;if(o){var i=!1,e=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,i},set:function(t){i=t}});a.addEventListener("test",e,n),a.removeEventListener("test",e,n)}return t}();function vt(e,t,n,i){var s=3<arguments.length&&void 0!==i?i:{},o=n;t.trim().split(U).forEach(function(t){if(!gt){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,s)})}function pt(o,t,a,i){var r=3<arguments.length&&void 0!==i?i:{},h=a;t.trim().split(U).forEach(function(n){if(r.once&&!gt){var t=o.listeners,s=void 0===t?{}:t;h=function(){delete s[n][a],o.removeEventListener(n,h,r);for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];a.apply(o,i)},s[n]||(s[n]={}),s[n][a]&&o.removeEventListener(n,s[n][a],r),s[n][a]=h,o.listeners=s}o.addEventListener(n,h,r)})}function wt(t,i,e){var n;return et(Event)&&et(CustomEvent)?n=new CustomEvent(i,{detail:e,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(i,!0,!0,e),t.dispatchEvent(n)}function bt(t){var i=t.rotate,e=t.scaleX,n=t.scaleY,s=t.translateX,o=t.translateY,a=[];G(s)&&0!==s&&a.push("translateX(".concat(s,"px)")),G(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),G(i)&&0!==i&&a.push("rotate(".concat(i,"deg)")),G(e)&&1!==e&&a.push("scaleX(".concat(e,")")),G(n)&&1!==n&&a.push("scaleY(".concat(n,")"));var r=a.length?a.join(" "):"none";return{WebkitTransform:r,msTransform:r,transform:r}}var yt=a.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(a.navigator.userAgent);function xt(t,i){var e=document.createElement("img");if(t.naturalWidth&&!yt)return i(t.naturalWidth,t.naturalHeight),e;var n=document.body||document.documentElement;return e.onload=function(){i(e.width,e.height),yt||n.removeChild(e)},e.src=t.src,yt||(e.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(e)),e}function kt(t){switch(t){case 2:return v;case 3:return g;case 4:return m;default:return""}}function zt(t,i){var e=t.pageX,n=t.pageY,s={endX:e,endY:n};return i?s:r({timeStamp:Date.now(),startX:e,startY:n},s)}var Dt={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,i=this.options,e=this.parent;i.inline&&(t={width:Math.max(e.offsetWidth,i.minWidth),height:Math.max(e.offsetHeight,i.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=st({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&at(this.viewer,this.viewerData)},initList:function(){var r=this,t=this.element,h=this.options,l=this.list,c=[];l.innerHTML="",nt(this.images,function(t,i){var e=t.src,n=t.alt||function(t){return $(t)?decodeURIComponent(t.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}(e),s=h.url;if($(s)?s=t.getAttribute(s):et(s)&&(s=s.call(r,t)),e||s){var o=document.createElement("li"),a=document.createElement("img");a.src=e||s,a.alt=n,a.setAttribute("data-index",i),a.setAttribute("data-original-url",s||e),a.setAttribute("data-viewer-action","view"),a.setAttribute("role","button"),o.appendChild(a),l.appendChild(o),c.push(o)}}),nt(this.items=c,function(i){var t=i.firstElementChild;ft(t,"filled",!0),h.loading&&ht(i,T),pt(t,q,function(t){h.loading&&lt(i,T),r.loadImage(t)},{once:!0})}),h.transition&&pt(t,B,function(){ht(l,S)},{once:!0})},renderList:function(t){var i=t||this.index,e=this.items[i].offsetWidth||30,n=e+1;at(this.list,st({width:n*this.length},bt({translateX:(this.viewerData.width-e)/2-n*i})))},resetList:function(){var t=this.list;t.innerHTML="",lt(t,S),at(t,bt({translateX:0}))},initImage:function(r){var t,h=this,l=this.options,i=this.image,e=this.viewerData,n=this.footer.offsetHeight,c=e.width,u=Math.max(e.height-n,n),d=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=xt(i,function(t,i){var e=t/i,n=c,s=u;h.imageInitializing=!1,c<u*e?s=c/e:n=u*e;var o={naturalWidth:t,naturalHeight:i,aspectRatio:e,ratio:(n=Math.min(.9*n,t))/t,width:n,height:s=Math.min(.9*s,i),left:(c-n)/2,top:(u-s)/2},a=st({},o);l.rotatable&&(o.rotate=d.rotate||0,a.rotate=0),l.scalable&&(o.scaleX=d.scaleX||1,o.scaleY=d.scaleY||1,a.scaleX=1,a.scaleY=1),h.imageData=o,h.initialImageData=a,r&&r()})},renderImage:function(t){var i=this,e=this.image,n=this.imageData;if(at(e,st({width:n.width,height:n.height,marginLeft:n.left,marginTop:n.top},bt(n))),t)if((this.viewing||this.zooming)&&this.options.transition){var s=function(){i.imageRendering=!1,t()};this.imageRendering={abort:function(){vt(e,V,s)}},pt(e,V,s,{once:!0})}else t()},resetImage:function(){if(this.viewing||this.viewed){var t=this.image;this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null}}},Tt={bind:function(){var t=this.options,i=this.viewer,e=this.canvas,n=this.element.ownerDocument;pt(i,C,this.onClick=this.click.bind(this)),pt(i,N,this.onDragStart=this.dragstart.bind(this)),pt(e,X,this.onPointerDown=this.pointerdown.bind(this)),pt(n,F,this.onPointerMove=this.pointermove.bind(this)),pt(n,W,this.onPointerUp=this.pointerup.bind(this)),pt(n,Y,this.onKeyDown=this.keydown.bind(this)),pt(window,A,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&pt(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&pt(e,L,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,i=this.viewer,e=this.canvas,n=this.element.ownerDocument;vt(i,C,this.onClick),vt(i,N,this.onDragStart),vt(e,X,this.onPointerDown),vt(n,F,this.onPointerMove),vt(n,W,this.onPointerUp),vt(n,Y,this.onKeyDown),vt(window,A,this.onResize),t.zoomable&&t.zoomOnWheel&&vt(i,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&vt(e,L,this.onDblclick)}},Et={click:function(t){var i=t.target,e=this.options,n=this.imageData,s=mt(i,K);switch(h&&t.isTrusted&&i===this.canvas&&clearTimeout(this.clickCanvasTimeout),s){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view(mt(i,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-n.scaleX||-1);break;case"flip-vertical":this.scaleY(-n.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(h&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle())},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var i=this.element,e=this.options,n=this.image,s=this.index,o=this.viewerData;lt(n,D),e.loading&&lt(this.canvas,T),n.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:absolute;width:0;",this.initImage(function(){ct(n,E,e.movable),ct(n,S,e.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,et(e.viewed)&&pt(i,B,e.viewed,{once:!0}),wt(i,B,{originalImage:t.images[s],index:s,image:n})})})},loadImage:function(t){var o=t.target,i=o.parentNode,a=i.offsetWidth||30,r=i.offsetHeight||50,h=!!mt(o,"filled");xt(o,function(t,i){var e=t/i,n=a,s=r;a<r*e?h?n=r*e:s=a/e:h?s=a/e:n=r*e,at(o,st({width:n,height:s},bt({translateX:(a-n)/2,translateY:(r-s)/2})))})},keydown:function(t){var i=this.options;if(this.fulled&&i.keyboard)switch(t.keyCode||t.which||t.charCode){case 27:this.played?this.stop():i.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.prev(i.loop);break;case 38:t.preventDefault(),this.zoom(i.zoomRatio,!0);break;case 39:this.next(i.loop);break;case 40:t.preventDefault(),this.zoom(-i.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}},dragstart:function(t){"img"===t.target.tagName.toLowerCase()&&t.preventDefault()},pointerdown:function(t){var i=this.options,e=this.pointers,n=t.buttons,s=t.button;if(!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(G(n)&&1!==n||G(s)&&0!==s||t.ctrlKey))){t.preventDefault(),t.changedTouches?nt(t.changedTouches,function(t){e[t.identifier]=zt(t)}):e[t.pointerId||0]=zt(t);var o=!!i.movable&&l;i.zoomOnTouch&&i.zoomable&&1<Object.keys(e).length?o=u:i.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(o=c),!i.transition||o!==l&&o!==u||lt(this.image,S),this.action=o}},pointermove:function(t){var i=this.pointers,e=this.action;this.viewed&&e&&(t.preventDefault(),t.changedTouches?nt(t.changedTouches,function(t){st(i[t.identifier]||{},zt(t,!0))}):st(i[t.pointerId||0]||{},zt(t,!0)),this.change(t))},pointerup:function(t){var i,e=this,n=this.options,s=this.action,o=this.pointers;t.changedTouches?nt(t.changedTouches,function(t){i=o[t.identifier],delete o[t.identifier]}):(i=o[t.pointerId||0],delete o[t.pointerId||0]),s&&(t.preventDefault(),!n.transition||s!==l&&s!==u||ht(this.image,S),this.action=!1,h&&s!==u&&i&&Date.now()-i.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){wt(e.image,L)},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){e.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){wt(e.canvas,C)},50)))))},resize:function(){var i=this;if(this.isShown&&!this.hiding&&(this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){i.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();nt(this.player.getElementsByTagName("img"),function(t){pt(t,q,i.loadImage.bind(i),{once:!0}),wt(t,q)})}},wheel:function(t){var i=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50);var e=Number(this.options.zoomRatio)||.1,n=1;t.deltaY?n=0<t.deltaY?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=0<t.detail?1:-1),this.zoom(-n*e,!0,t)}}},It={show:function(t){var i=0<arguments.length&&void 0!==t&&t,e=this.element,n=this.options;if(n.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(i),this;if(et(n.show)&&pt(e,j,n.show,{once:!0}),!1===wt(e,j)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var s=this.viewer;if(lt(s,k),n.transition&&!i){var o=this.shown.bind(this);this.transitioning={abort:function(){vt(s,V,o),lt(s,z)}},ht(s,S),s.initialOffsetWidth=s.offsetWidth,pt(s,V,o,{once:!0}),ht(s,z)}else ht(s,z),this.shown();return this},hide:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=this.element,e=this.options;if(e.inline||this.hiding||!this.isShown&&!this.showing)return this;if(et(e.hide)&&pt(i,R,e.hide,{once:!0}),!1===wt(i,R))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var n=this.viewer;if(e.transition&&!t){var s=this.hidden.bind(this),o=function(){setTimeout(function(){pt(n,V,s,{once:!0}),lt(n,z)},0)};this.transitioning={abort:function(){this.viewed?vt(this.image,V,o):vt(n,V,s)}},this.viewed&&rt(this.image,S)?(pt(this.image,V,o,{once:!0}),this.zoomTo(0,!1,!1,!0)):o()}else lt(n,z),this.hidden();return this},view:function(t){var e=this,i=0<arguments.length&&void 0!==t?t:this.options.initialViewIndex;if(i=Number(i)||0,this.hiding||this.played||i<0||i>=this.length||this.viewed&&i===this.index)return this;if(!this.isShown)return this.index=i,this.show();this.viewing&&this.viewing.abort();var n=this.element,s=this.options,o=this.title,a=this.canvas,r=this.items[i],h=r.querySelector("img"),l=mt(h,"originalUrl"),c=h.getAttribute("alt"),u=document.createElement("img");if(u.src=l,u.alt=c,et(s.view)&&pt(n,"view",s.view,{once:!0}),!1===wt(n,"view",{originalImage:this.images[i],index:i,image:u})||!this.isShown||this.hiding||this.played)return this;this.image=u,lt(this.items[this.index],f),ht(r,f),this.viewed=!1,this.index=i,this.imageData={},ht(u,D),s.loading&&ht(a,T),a.innerHTML="",a.appendChild(u),this.renderList(),o.innerHTML="";function d(){var t=e.imageData,i=Array.isArray(s.title)?s.title[1]:s.title;o.innerHTML=function(t){return $(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}(et(i)?i.call(e,u,t):"".concat(c," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))}var m;return pt(n,B,d,{once:!0}),this.viewing={abort:function(){vt(n,B,d),u.complete?this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort():(u.src="",vt(u,q,m),this.timeout&&clearTimeout(this.timeout))}},u.complete?this.load():(pt(u,q,m=this.load.bind(this),{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){lt(u,D),e.timeout=!1},1e3)),this},prev:function(t){var i=0<arguments.length&&void 0!==t&&t,e=this.index-1;return e<0&&(e=i?this.length-1:0),this.view(e),this},next:function(t){var i=0<arguments.length&&void 0!==t&&t,e=this.length-1,n=this.index+1;return e<n&&(n=i?0:e),this.view(n),this},move:function(t,i){var e=this.imageData;return this.moveTo(J(t)?t:e.left+Number(t),J(i)?i:e.top+Number(i)),this},moveTo:function(t,i){var e=1<arguments.length&&void 0!==i?i:t,n=this.imageData;if(t=Number(t),e=Number(e),this.viewed&&!this.played&&this.options.movable){var s=!1;G(t)&&(n.left=t,s=!0),G(e)&&(n.top=e,s=!0),s&&this.renderImage()}return this},zoom:function(t,i,e){var n=1<arguments.length&&void 0!==i&&i,s=2<arguments.length&&void 0!==e?e:null,o=this.imageData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(o.width*t/o.naturalWidth,n,s),this},zoomTo:function(t,i,e,n){var s=this,o=1<arguments.length&&void 0!==i&&i,a=2<arguments.length&&void 0!==e?e:null,r=3<arguments.length&&void 0!==n&&n,h=this.element,l=this.options,c=this.pointers,u=this.imageData,d=u.width,m=u.height,f=u.left,g=u.top,v=u.naturalWidth,p=u.naturalHeight;if(G(t=Math.max(0,t))&&this.viewed&&!this.played&&(r||l.zoomable)){if(!r){var w=Math.max(.01,l.minZoomRatio),b=Math.min(100,l.maxZoomRatio);t=Math.min(Math.max(t,w),b)}a&&.95<t&&t<1.05&&(t=1);var y=v*t,x=p*t,k=y-d,z=x-m,D=d/v;if(et(l.zoom)&&pt(h,"zoom",l.zoom,{once:!0}),!1===wt(h,"zoom",{ratio:t,oldRatio:D,originalEvent:a}))return this;if(this.zooming=!0,a){var T=function(t){var i=t.getBoundingClientRect();return{left:i.left+(window.pageXOffset-document.documentElement.clientLeft),top:i.top+(window.pageYOffset-document.documentElement.clientTop)}}(this.viewer),E=c&&Object.keys(c).length?function(t){var n=0,s=0,o=0;return nt(t,function(t){var i=t.startX,e=t.startY;n+=i,s+=e,o+=1}),{pageX:n/=o,pageY:s/=o}}(c):{pageX:a.pageX,pageY:a.pageY};u.left-=k*((E.pageX-T.left-f)/d),u.top-=z*((E.pageY-T.top-g)/m)}else u.left-=k/2,u.top-=z/2;u.width=y,u.height=x,u.ratio=t,this.renderImage(function(){s.zooming=!1,et(l.zoomed)&&pt(h,"zoomed",l.zoomed,{once:!0}),wt(h,"zoomed",{ratio:t,oldRatio:D,originalEvent:a})}),o&&this.tooltip()}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var i=this.imageData;return G(t=Number(t))&&this.viewed&&!this.played&&this.options.rotatable&&(i.rotate=t,this.renderImage()),this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t,i){var e=1<arguments.length&&void 0!==i?i:t,n=this.imageData;if(t=Number(t),e=Number(e),this.viewed&&!this.played&&this.options.scalable){var s=!1;G(t)&&(n.scaleX=t,s=!0),G(e)&&(n.scaleY=e,s=!0),s&&this.renderImage()}return this},play:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var s=this.options,o=this.player,a=this.loadImage.bind(this),r=[],h=0,l=0;if(this.played=!0,this.onLoadWhenPlay=a,t&&this.requestFullscreen(),ht(o,O),nt(this.items,function(t,i){var e=t.querySelector("img"),n=document.createElement("img");n.src=mt(e,"originalUrl"),n.alt=e.getAttribute("alt"),h+=1,ht(n,b),ct(n,S,s.transition),rt(t,f)&&(ht(n,z),l=i),r.push(n),pt(n,q,a,{once:!0}),o.appendChild(n)}),G(s.interval)&&0<s.interval){var e=function t(){i.playing=setTimeout(function(){lt(r[l],z),ht(r[l=(l+=1)<h?l:0],z),t()},s.interval)};1<h&&e()}return this},stop:function(){var i=this;if(!this.played)return this;var t=this.player;return this.played=!1,clearTimeout(this.playing),nt(t.getElementsByTagName("img"),function(t){vt(t,q,i.onLoadWhenPlay)}),lt(t,O),t.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,i=this.options,e=this.viewer,n=this.image,s=this.list;return!this.isShown||this.played||this.fulled||!i.inline||(this.fulled=!0,this.open(),ht(this.button,d),i.transition&&(lt(s,S),this.viewed&&lt(n,S)),ht(e,y),e.setAttribute("style",""),at(e,{zIndex:i.zIndex}),this.initContainer(),this.viewerData=st({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){ht(n,S),ht(s,S)},0)})})),this},exit:function(){var t=this,i=this.options,e=this.viewer,n=this.image,s=this.list;return this.isShown&&!this.played&&this.fulled&&i.inline&&(this.fulled=!1,this.close(),lt(this.button,d),i.transition&&(lt(s,S),this.viewed&&lt(n,S)),lt(e,y),at(e,{zIndex:i.zIndexInline}),this.viewerData=st({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){ht(n,S),ht(s,S)},0)})})),this},tooltip:function(){var t=this,i=this.options,e=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&i.tooltip&&(e.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):i.transition?(this.fading&&wt(e,V),ht(e,O),ht(e,b),ht(e,S),e.initialOffsetWidth=e.offsetWidth,ht(e,z)):ht(e,O),this.tooltipping=setTimeout(function(){i.transition?(pt(e,V,function(){lt(e,O),lt(e,b),lt(e,S),t.fading=!1},{once:!0}),lt(e,z),t.fading=!0):lt(e,O),t.tooltipping=!1},1e3)),this},toggle:function(){return 1===this.imageData.ratio?this.zoomTo(this.initialImageData.ratio,!0):this.zoomTo(1,!0),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=st({},this.initialImageData),this.renderImage()),this},update:function(){var t=this.element,i=this.options,e=this.isImg;if(e&&!t.parentNode)return this.destroy();var s=[];if(nt(e?[t]:t.querySelectorAll("img"),function(t){i.filter?i.filter(t)&&s.push(t):s.push(t)}),!s.length)return this;if(this.images=s,this.length=s.length,this.ready){var o=[];if(nt(this.items,function(t,i){var e=t.querySelector("img"),n=s[i];n&&e?n.src!==e.src&&o.push(i):o.push(i)}),at(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var n=o.indexOf(this.index);0<=n?(this.viewed=!1,this.view(Math.max(this.index-(n+1),0))):ht(this.items[this.index],f)}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,i=this.options;return t[p]&&(this.destroyed=!0,this.ready?(this.played&&this.stop(),i.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):i.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),i.inline||vt(t,C,this.onStart),t[p]=void 0),this}},Ot={open:function(){var t=this.body;ht(t,I),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyPaddingRight)||0),"px")},close:function(){var t=this.body;lt(t,I),t.style.paddingRight=this.initialBodyPaddingRight},shown:function(){var t=this.element,i=this.options;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,et(i.shown)&&pt(t,H,i.shown,{once:!0}),!1!==wt(t,H)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,i=this.options;this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),ht(this.viewer,k),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(et(i.hidden)&&pt(t,M,i.hidden,{once:!0}),wt(t,M))},requestFullscreen:function(){var t=this.element.ownerDocument;if(this.fulled&&!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)){var i=t.documentElement;i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen()}},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var i=this.options,e=this.pointers,n=e[Object.keys(e)[0]],s=n.endX-n.startX,o=n.endY-n.startY;switch(this.action){case l:this.move(s,o);break;case u:this.zoom(function(t){var i=r({},t),h=[];return nt(t,function(r,t){delete i[t],nt(i,function(t){var i=Math.abs(r.startX-t.startX),e=Math.abs(r.startY-t.startY),n=Math.abs(r.endX-t.endX),s=Math.abs(r.endY-t.endY),o=Math.sqrt(i*i+e*e),a=(Math.sqrt(n*n+s*s)-o)/o;h.push(a)})}),h.sort(function(t,i){return Math.abs(t)<Math.abs(i)}),h[0]}(e),!1,t);break;case c:this.action="switched";var a=Math.abs(s);1<a&&a>Math.abs(o)&&(this.pointers={},1<s?this.prev(i.loop):s<-1&&this.next(i.loop))}nt(e,function(t){t.startX=t.endX,t.startY=t.endY})},isSwitchable:function(){var t=this.imageData,i=this.viewerData;return 1<this.length&&0<=t.left&&0<=t.top&&t.width<=i.width&&t.height<=i.height}},St=a.Viewer,Ct=function(){function e(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,e),!t||1!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=st({},s,it(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.init()}return function(t,i,e){i&&n(t.prototype,i),e&&n(t,e)}(e,[{key:"init",value:function(){var e=this,t=this.element,n=this.options;if(!t[p]){t[p]=this;var i="img"===t.tagName.toLowerCase(),s=[];nt(i?[t]:t.querySelectorAll("img"),function(t){et(n.filter)?n.filter.call(e,t)&&s.push(t):s.push(t)}),this.isImg=i,this.length=s.length,this.images=s;var o=t.ownerDocument,a=o.body||o.documentElement;if(this.body=a,this.scrollbarWidth=window.innerWidth-o.documentElement.clientWidth,this.initialBodyPaddingRight=window.getComputedStyle(a).paddingRight,J(document.createElement(p).style.transition)&&(n.transition=!1),n.inline){var r=0,h=function(){var t;(r+=1)===e.length&&(e.initializing=!1,e.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){e.delaying=!1,e.build()},0))};this.initializing={abort:function(){nt(s,function(t){t.complete||vt(t,q,h)})}},nt(s,function(t){t.complete?h():pt(t,q,h,{once:!0})})}else pt(t,C,this.onStart=function(t){var i=t.target;"img"!==i.tagName.toLowerCase()||et(n.filter)&&!n.filter.call(e,i)||e.view(e.images.indexOf(i))})}}},{key:"build",value:function(){if(!this.ready){var t=this.element,h=this.options,i=t.parentNode,e=document.createElement("div");e.innerHTML='<div class="viewer-container" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list"></ul></div></div><div class="viewer-tooltip"></div><div role="button" class="viewer-button" data-viewer-action="mix"></div><div class="viewer-player"></div></div>';var n=e.querySelector(".".concat(p,"-container")),s=n.querySelector(".".concat(p,"-title")),o=n.querySelector(".".concat(p,"-toolbar")),a=n.querySelector(".".concat(p,"-navbar")),r=n.querySelector(".".concat(p,"-button")),l=n.querySelector(".".concat(p,"-canvas"));if(this.parent=i,this.viewer=n,this.title=s,this.toolbar=o,this.navbar=a,this.button=r,this.canvas=l,this.footer=n.querySelector(".".concat(p,"-footer")),this.tooltipBox=n.querySelector(".".concat(p,"-tooltip")),this.player=n.querySelector(".".concat(p,"-player")),this.list=n.querySelector(".".concat(p,"-list")),ht(s,h.title?kt(Array.isArray(h.title)?h.title[0]:h.title):k),ht(a,h.navbar?kt(h.navbar):k),ct(r,k,!h.button),h.backdrop&&(ht(n,"".concat(p,"-backdrop")),h.inline||"static"===h.backdrop||ft(l,K,"hide")),$(h.className)&&h.className&&h.className.split(U).forEach(function(t){ht(n,t)}),h.toolbar){var c=document.createElement("ul"),u=it(h.toolbar),d=Z.slice(0,3),m=Z.slice(7,9),f=Z.slice(9);u||ht(o,kt(h.toolbar)),nt(u?h.toolbar:Z,function(t,i){var e=u&&it(t),n=u?dt(i):t,s=e&&!J(t.show)?t.show:t;if(s&&(h.zoomable||-1===d.indexOf(n))&&(h.rotatable||-1===m.indexOf(n))&&(h.scalable||-1===f.indexOf(n))){var o=e&&!J(t.size)?t.size:t,a=e&&!J(t.click)?t.click:t,r=document.createElement("li");r.setAttribute("role","button"),ht(r,"".concat(p,"-").concat(n)),et(a)||ft(r,K,n),G(s)&&ht(r,kt(s)),-1!==["small","large"].indexOf(o)?ht(r,"".concat(p,"-").concat(o)):"play"===n&&ht(r,"".concat(p,"-large")),et(a)&&pt(r,C,a),c.appendChild(r)}}),o.appendChild(c)}else ht(o,k);if(!h.rotatable){var g=o.querySelectorAll('li[class*="rotate"]');ht(g,D),nt(g,function(t){o.appendChild(t)})}if(h.inline)ht(r,x),at(n,{zIndex:h.zIndexInline}),"static"===window.getComputedStyle(i).position&&at(i,{position:"relative"}),i.insertBefore(n,t.nextSibling);else{ht(r,w),ht(n,y),ht(n,b),ht(n,k),at(n,{zIndex:h.zIndex});var v=h.container;$(v)&&(v=t.ownerDocument.querySelector(v)),(v=v||this.body).appendChild(n)}h.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,et(h.ready)&&pt(t,P,h.ready,{once:!0}),!1!==wt(t,P)?this.ready&&h.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=St,e}},{key:"setDefaults",value:function(t){st(s,it(t)&&t)}}]),e}();return st(Ct.prototype,Dt,Tt,Et,It,Ot),Ct});
12 12 \ No newline at end of file
... ...