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

提交 8b4952bb8301b7793dd798dc6304d341f20adeaa

作者 kohgylw
1 个父辈 38eb22c7

update to v1.0.27-release

不能预览此文件类型
... ... @@ -77,9 +77,26 @@ _瘜剁ift銝箄砲妍嚗摰蛹kiftd
77 77  
78 78 > 內嚗窈皜瘚蝵蜓憿萎誑蝖桐辣靽嚗撖潸△蝙
79 79  
80   -### 撣貉v1.0.26
81   -_甈⊥銝箇輕抒嚗耨憭鈭歇蝏憸僎隡蝙雿漣
82   -+ 隡揭蔭辣蝸粉嚗&靽憭犖餈站憒耨撖釣韐行蝑銝揭蔭辣蝒秤
  80 +### v1.0.27
  81 +_甈⊥鈭扯撩嚗甇亙撩kiftd蝙雿漣雿
  82 ++ 憭找蝸漲撌脣嚗砲隞乩蒂摰踝甇W霈輸蒂摰賢說撖潸隞挪迤撣貉挪挽蝵格瘜iftd霂湔﹝葉隞
  83 ++ 憓蜓憿菊銋◤敺餈撌脫迤撘砲隞亙葬撠鈭縑內蝷箇挪誘蝞∠噶
  84 ++ 瘜典韐行隞乩蛹韐行霈曄蔭暺恕
  85 ++ 撅憭扳撌脫255銝迎餈餈辣蝟餌撅摮嚗誑靘踵憟賢摨笆憭扳之雿妖辣摮瘙
  86 ++ 隡辣憭寡蝸閬蝸辣”颲嚗頂蝏挾蝸餈隞△漲
  87 ++ 捂撘箏PXFF閫嚗挪憚FF霂瑟仍撘憚撌梁P
  88 ++ 捂頨怎瘙蝙憓撘箏蝳蝸
  89 ++ 捂頨怎瘙蝙憓撘箏蝳蝥輯圾
  90 ++ 捂銵蝥輯圾雿輻fmpeg撘辣iftd頂蝏fmpeg撘嚗隞亥銵fmpeg銵辣嚗&靽蝥輯圾憭迤撣訾蝙
  91 ++ 銝箸瘛餃之銝颲嚗憭蛹撣行憟賜蝙雿
  92 ++ 靽桀迤撣豢憭找妖GIF憸
  93 ++ 靽桀辣蝞∠撖澆辣憭寞撖潸◤隞颱犖霈輸憸嚗撖澆辣憭孵蝥扳辣憭寧遣&靽蝥扳辣憭寧憭笆撖澆辣憭寡挪
  94 ++ 隡敹銝剔虜霈啣嚗笆撘虜縑扇敶誑靘踹輕鈭箏憭敹縑祕蝏虜靽⊥
  95 ++ 靽桀宏敹扇敶葉EW PATH楝敺★霈啣迤蝖桃憸
  96 ++ 靽桀辣辣憭孵妍銝剖畾泵隡鈭蝷粹憸
  97 ++ 靽桀蜓銝鈭inux蝟餌敶Y銝摰寧憸
  98 ++ 餈甇乩辣蝟餌撩蝔喳批扼
  99 ++ 摰iftd霂湔﹝憓鈭挽蝵桅△遢辣蝟餌隞
83 100  
84 101 > 閬憭靽⊥嚗窈霈輸嚗 https://kohgylw.gitee.io/News.html
85 102  
... ... @@ -122,4 +139,4 @@ _甈⊥銝箇輕抒嚗耨憭鈭歇蝏憸僎隡
122 139  
123 140 _雿1-3瘚甈⊿蝞梧窈捂隡嚗撩撣准
124 141  
125   -2018-2019 kohgylw@樴 雿
  142 +2018-2020 kohgylw@樴 雿
... ...
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
... ... @@ -13,18 +13,35 @@
13 13  
14 14 <select id="queryById" parameterType="java.lang.String"
15 15 resultMap="BaseResultMap">
16   - SELECT * FROM FOLDER WHERE folder_id = #{fid,jdbcType=VARCHAR}
  16 + SELECT * FROM FOLDER WHERE folder_id =
  17 + #{fid,jdbcType=VARCHAR}
17 18 </select>
18 19  
19 20 <select id="queryByParentId" parameterType="java.lang.String"
20 21 resultMap="BaseResultMap">
21   - SELECT * FROM FOLDER WHERE folder_parent = #{pid,jdbcType=VARCHAR}
  22 + SELECT * FROM FOLDER WHERE folder_parent =
  23 + #{pid,jdbcType=VARCHAR} LIMIT 0,2147483647
  24 + </select>
  25 +
  26 + <select id="countByParentId" parameterType="java.lang.String"
  27 + resultType="java.lang.Long">
  28 + SELECT COUNT(folder_id) FROM FOLDER WHERE folder_parent =
  29 + #{pid,jdbcType=VARCHAR}
  30 + </select>
  31 +
  32 + <select id="queryByParentIdSection" parameterType="java.util.Map"
  33 + resultMap="BaseResultMap">
  34 + SELECT * FROM FOLDER WHERE folder_parent =
  35 + #{pid,jdbcType=VARCHAR} LIMIT
  36 + #{offset,jdbcType=INTEGER},#{rows,jdbcType=INTEGER}
22 37 </select>
23 38  
24 39 <select id="queryByParentIdAndFolderName" parameterType="java.util.Map"
25 40 resultMap="BaseResultMap">
26   - SELECT * FROM FOLDER WHERE folder_parent = #{parentId,jdbcType=VARCHAR} AND
27   - folder_name = #{folderName,jdbcType=VARCHAR}
  41 + SELECT * FROM FOLDER WHERE folder_parent =
  42 + #{parentId,jdbcType=VARCHAR} AND
  43 + folder_name =
  44 + #{folderName,jdbcType=VARCHAR}
28 45 </select>
29 46  
30 47 <insert id="insertNewFolder" parameterType="kohgylw.kiftd.server.model.Folder">
... ... @@ -33,19 +50,24 @@
33 50 </insert>
34 51  
35 52 <delete id="deleteById" parameterType="java.lang.String">
36   - DELETE FROM FOLDER WHERE folder_id=#{folderId,jdbcType=VARCHAR}
  53 + DELETE FROM FOLDER WHERE
  54 + folder_id=#{folderId,jdbcType=VARCHAR}
37 55 </delete>
38 56  
39 57 <update id="updateFolderNameById" parameterType="java.util.Map">
40   - UPDATE FOLDER SET folder_name = #{newName,jdbcType=VARCHAR} WHERE folder_id
41   - = #{folderId,jdbcType=VARCHAR}
  58 + UPDATE FOLDER
  59 + SET folder_name = #{newName,jdbcType=VARCHAR} WHERE folder_id
  60 + =
  61 + #{folderId,jdbcType=VARCHAR}
42 62 </update>
43 63  
44 64 <update id="updateFolderConstraintById" parameterType="java.util.Map">
45   - UPDATE FOLDER SET folder_constraint = #{newConstraint,jdbcType=INTEGER} WHERE folder_id
  65 + UPDATE
  66 + FOLDER SET folder_constraint = #{newConstraint,jdbcType=INTEGER} WHERE
  67 + folder_id
46 68 = #{folderId,jdbcType=VARCHAR}
47 69 </update>
48   -
  70 +
49 71 <update id="moveById" parameterType="java.util.Map">
50 72 UPDATE FOLDER SET
51 73 folder_parent = #{locationpath,jdbcType=VARCHAR} WHERE folder_id =
... ...
... ... @@ -16,6 +16,19 @@
16 16 <select id="queryByParentFolderId" parameterType="java.lang.String"
17 17 resultMap="BaseResultMap">
18 18 SELECT * FROM FILE WHERE file_parent_folder =
  19 + #{pfid,jdbcType=VARCHAR} LIMIT 0,2147483647
  20 + </select>
  21 +
  22 + <select id="queryByParentFolderIdSection" parameterType="java.util.Map"
  23 + resultMap="BaseResultMap">
  24 + SELECT * FROM FILE WHERE file_parent_folder =
  25 + #{pfid,jdbcType=VARCHAR} LIMIT
  26 + #{offset,jdbcType=INTEGER},#{rows,jdbcType=INTEGER}
  27 + </select>
  28 +
  29 + <select id="countByParentFolderId" parameterType="java.lang.String"
  30 + resultType="java.lang.Long">
  31 + SELECT COUNT(file_id) FROM FILE WHERE file_parent_folder =
19 32 #{pfid,jdbcType=VARCHAR}
20 33 </select>
21 34  
... ... @@ -57,10 +70,6 @@
57 70 #{fileId,jdbcType=VARCHAR}
58 71 </update>
59 72  
60   - <select id="queryAll" resultMap="BaseResultMap">
61   - SELECT * FROM FILE
62   - </select>
63   -
64 73 <select id="queryByPath" parameterType="java.lang.String"
65 74 resultMap="BaseResultMap">
66 75 SELECT * FROM FILE WHERE file_path =
... ... @@ -72,7 +81,7 @@
72 81 SELECT * FROM FILE WHERE file_parent_folder in (SELECT
73 82 file_parent_folder
74 83 FROM FILE WHERE file_id =
75   - #{fileId,jdbcType=VARCHAR})
  84 + #{fileId,jdbcType=VARCHAR}) LIMIT 0,2147483647
76 85 </select>
77 86  
78 87 <update id="moveById" parameterType="java.util.Map">
... ...
... ... @@ -96,6 +96,21 @@ body {
96 96 opacity: 0.7;
97 97 }
98 98  
  99 +.shownoticebox {
  100 + width: 40px;
  101 + height: 75px;
  102 + position: fixed;
  103 + top: 50px;
  104 + right: 0px;
  105 +}
  106 +
  107 +.shownoticebutton {
  108 + width: 100%;
  109 + height: 100%;
  110 + background-color: #FCFCFC;
  111 + color: #104E8B; alpha (Opacity=70);
  112 +}
  113 +
99 114 td {
100 115 word-break: break-all;
101 116 word-wrap: break-all;
... ... @@ -105,4 +120,14 @@ td {
105 120 width: 100%;
106 121 max-height: 35px;
107 122 cursor: pointer
  123 +}
  124 +
  125 +.loadingremaininngbox {
  126 + width: 100%;
  127 + height: 40px;
  128 + position: fixed;
  129 + bottom: 0px;
  130 + left: 0px;
  131 + line-height: 40px;
  132 + color: #104E8B; alpha (Opacity=70);
108 133 }
109 134 \ No newline at end of file
... ...
1   -@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}.gobacktopbox{width:100%;height:30px;position:fixed;top:0;left:0}.gobacktopbutton{width:150px;height:35px;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70);-moz-opacity:.7;opacity:.7}td{word-break:break-all;word-wrap:break-all}.vercodeimg{width:100%;max-height:35px;cursor:pointer}
2 1 \ No newline at end of file
  2 +@charset "UTF-8";.titlebox{height:30px;line-height:30px;padding-top:5px;padding-bottom:5px;padding-left:10px;padding-right:10px;position:relative;bottom:-7px}.titletext{color:#000;font-size:22px}.graytext{color:#8b8b8b}.subtitle{color:#5cacee;text-align:center}.rightbtn{border-right:10px;float:right;margin-left:10px}.heading{margin-top:-10px;margin-bottom:-10px}.centerText{text-align:center}.uploadstatusbox{color:#9c9c9c;height:48px;overflow:auto}html{height:100%}body{height:100%}.loading{line-height:56px;color:#545454;padding-left:60px;font-size:15px;background:#fff url(loading.gif) no-repeat 10px 50%;opacity:.7;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;filter:alpha(opacity=70)}.wordbreak{word-break:break-all}.filetableheaderstyle{height:40px;float:left;height:100%;margin-top:15px;overflow:hidden}.gobacktopbox{width:100%;height:30px;position:fixed;top:0;left:0}.gobacktopbutton{width:150px;height:35px;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70);-moz-opacity:.7;opacity:.7}.shownoticebox{width:40px;height:75px;position:fixed;top:50px;right:0}.shownoticebutton{width:100%;height:100%;background-color:#fcfcfc;color:#104e8b;alpha(Opacity=70)}td{word-break:break-all;word-wrap:break-all}.vercodeimg{width:100%;max-height:35px;cursor:pointer}.loadingremaininngbox{width:100%;height:40px;position:fixed;bottom:0;left:0;line-height:40px;color:#104e8b;alpha(Opacity=70)}
3 3 \ No newline at end of file
... ...
1 1 <!doctype html>
2   -<!-- 青阳网络文件传输系统 kiftd v1.0.26-RELEASE -->
  2 +<!-- 青阳网络文件传输系统 kiftd v1.0.27-RELEASE -->
3 3 <!-- 欢迎访问主界面 -->
4 4 <!-- by 青阳龙野(kohgylw@163.com) -->
5 5 <html>
... ... @@ -40,8 +40,9 @@
40 40 class="graytext">KIFT</span>
41 41 </small>
42 42 </em>
43   - </span> <span id="tb" class="rightbtn"></span>
44   - <button class="btn btn-link rightbtn" onclick="refreshFolderView()">
  43 + </span> <span id="tb" class="rightbtn hidden-xs"></span>
  44 + <button class="btn btn-link rightbtn hidden-xs"
  45 + onclick="refreshFolderView()">
45 46 刷新 <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>
46 47 </button>
47 48 </div>
... ... @@ -51,7 +52,7 @@
51 52 <!-- 信息栏、操作栏与文件列表 -->
52 53 <div class="row">
53 54 <div class="col-md-12">
54   - <p id="vicetbbox" class="subtitle" style="display: none;">
  55 + <p class="subtitle visible-xs-block">
55 56 <span id="tb2"></span>
56 57 <button class="btn btn-link" onclick="refreshFolderView()">
57 58 刷新 <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>
... ... @@ -83,13 +84,12 @@
83 84 class="caret"></span></a>
84 85 <ul class="dropdown-menu" id="parentFolderList"></ul></li>
85 86 </ul>
86   - <form id="filetableoptmenusreach"
87   - class="navbar-form navbar-left">
  87 + <form class="navbar-form navbar-left hidden-xs">
88 88 <div class="form-group">
89 89 <input id="sreachKeyWordIn" type="text" class="form-control"
90 90 placeholder="请输入文件名...">
91 91 </div>
92   - <button type="button" class="btn btn-default"
  92 + <button id="searchbtn" type="button" class="btn btn-default"
93 93 onclick="doSearchFile()">搜索</button>
94 94 </form>
95 95 <ul class="nav navbar-nav navbar-right">
... ... @@ -129,13 +129,14 @@
129 129 <tr>
130 130 <th onclick="sortbyfn()">文件名<span id="sortByFN"
131 131 aria-hidden="true" style="float: right"></span></th>
132   - <th class="hiddenColumn" onclick="sortbycd()">创建日期<span
  132 + <th class="hidden-xs" onclick="sortbycd()">创建日期<span
133 133 id="sortByCD" aria-hidden="true" style="float: right"></span></th>
134 134 <th onclick="sortbyfs()">大小<span id="sortByFS"
135 135 aria-hidden="true" style="float: right"></span></th>
136   - <th class="hiddenColumn" onclick="sortbycn()">创建者<span
  136 + <th class="hidden-xs" onclick="sortbycn()">创建者<span
137 137 id="sortByCN" aria-hidden="true" style="float: right"></span></th>
138   - <th onclick="showOriginFolderView()">操作</th>
  138 + <th onclick="showOriginFolderView()">操作<span id="sortByOR"
  139 + aria-hidden="true" style="float: right"></span></th>
139 140 </tr>
140 141 </thead>
141 142 <tbody id="foldertable"></tbody>
... ... @@ -797,16 +798,49 @@
797 798 </h4>
798 799 </div>
799 800 <div class="modal-body">
800   - <textarea id="fileChainTextarea" class="form-control" rows="3" readonly></textarea>
  801 + <textarea id="fileChainTextarea" class="form-control" rows="3"
  802 + readonly></textarea>
801 803 </div>
802 804 <div class="modal-footer">
803   - <button id="copyChainBtn" type="button" class="btn btn-info" onclick="copyFileChain()">复制链接</button>
  805 + <button id="copyChainBtn" type="button" class="btn btn-info"
  806 + onclick="copyFileChain()">复制链接</button>
804 807 <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
805 808 </div>
806 809 </div>
807 810 </div>
808 811 </div>
809 812 <!-- end 永久资源链接 -->
  813 + <!-- 公告信息栏 -->
  814 + <div class="modal fade" id="noticeModal" tabindex="-1" role="dialog"
  815 + aria-labelledby="noticeModalLabel">
  816 + <div class="modal-dialog modal-lg" role="document">
  817 + <div class="modal-content">
  818 + <div class="modal-header">
  819 + <button type="button" class="close" data-dismiss="modal"
  820 + aria-label="Close">
  821 + <span aria-hidden="true">&times;</span>
  822 + </button>
  823 + <h4 class="modal-title" id="noticeModalLabel">公告信息</h4>
  824 + </div>
  825 + <div class="modal-body" style="overflow: scroll;"
  826 + id="noticeModalBody"></div>
  827 + <div class="modal-footer">
  828 + <label class="text-muted"> <input type="checkbox"
  829 + id="dontShowSomeNoticeAt30Day"> 30天内不再显示相同的公告信息
  830 + </label>
  831 + <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
  832 + </div>
  833 + </div>
  834 + </div>
  835 + </div>
  836 + <!-- end 公告信息栏 -->
  837 + <!-- 显示公告按钮 -->
  838 + <div id="shownoticebox" class="shownoticebox text-center hidden">
  839 + <button type="button" onclick="showNotice()" class="shownoticebutton">
  840 + <span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span><br />公<br />告
  841 + </button>
  842 + </div>
  843 + <!-- end 显示公告按钮 -->
810 844 <!-- 返回顶部按钮(隐藏式) -->
811 845 <div id="gobacktotopbox" class="gobacktopbox text-center hidden">
812 846 <button type="button" onclick="goBackToTop()" class="gobacktopbutton">
... ... @@ -814,6 +848,13 @@
814 848 </button>
815 849 </div>
816 850 <!-- end 返回顶部按钮 -->
  851 + <!-- 加载余下部分的提示 -->
  852 + <div id="loadingremaininngbox"
  853 + class="loadingremaininngbox text-center bg-info hidden">
  854 + 正在加载文件列表:<span id="loadingrate">0%</span>... <span
  855 + class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
  856 + </div>
  857 + <!-- end 加载余下部分的提示 -->
817 858 </body>
818 859 <!-- jquery基本框架 -->
819 860 <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
... ...
... ... @@ -27,14 +27,23 @@ var pvl;// 预览图片列表的JSON格式对象
27 27 var checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:<br /><br /><kbd>单击</kbd>:选中某一文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>单击</kbd></kbd>:选中多个文件<br /><br /><kbd><kbd>Shift</kbd>+<kbd>双击</kbd></kbd>:选中连续的文件<br /><br /><kbd><kbd>Shitf</kbd>+<kbd>A</kbd></kbd>:选中/取消选中所有文件";// 选取文件提示
28 28 var winHeight;// 窗口高度
29 29 var pingInt;// 定时应答器的定时装置
  30 +var noticeInited=false;// 公告信息的md5标识
  31 +var loadingComplete;// 判断文件夹视图是否加载完成
  32 +var totalFoldersOffset;// 记录文件夹原始的查询偏移量,便于计算加载进度
  33 +var totalFilesOffset;// 记录文件原始的查询偏移量,便于计算加载进度
  34 +var remainingLoadingRequest;// 后续数据加载请求的索引,便于中途取消
  35 +var loadingFolderView;// 是否正在加载文件夹视图的判断,避免重复操作
30 36  
31 37 // 界面功能方法定义
32 38 // 页面初始化
33 39 $(function() {
34 40 window.onresize = function(){
35 41 changeFilesTableStyle();
  42 + updateWinHeight();
36 43 }
  44 + changeFilesTableStyle();
37 45 getServerOS();// 得到服务器操作系统信息
  46 + subscribeNotice();// 加载公告MD5,以判断是否需要显示最新公告
38 47 // 查询是否存在记忆路径,若有,则直接显示记忆路径的内容,否则显示ROOT根路径
39 48 var arr = document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)"));
40 49 if (arr != null){
... ... @@ -301,25 +310,12 @@ $(function() {
301 310 return this.indexOf(suffix, this.length - suffix.length) !== -1;
302 311 };
303 312 }
304   - // 开启详细信息模态框自动显示信息内容
305   - $('#folderInfoModal').on('show.bs.modal', function(e) {
306   - var f=folderView.folder;
307   - $("#fim_name").text(f.folderName);
308   - $("#fim_creator").text(f.folderCreator);
309   - $("#fim_folderCreationDate").text(f.folderCreationDate);
310   - $("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。");
311   - $("#fim_folderId").text(f.folderId);
312   - });
313 313 // 关闭下载提示模态框自动隐藏下载链接
314 314 $('#downloadModal').on('hidden.bs.modal', function(e) {
315 315 $('#downloadURLCollapse').collapse('hide');
316 316 });
317 317 // 获取窗口高度
318   - if (window.innerHeight){
319   - winHeight = window.innerHeight;
320   - }else if ((document.body) && (document.body.clientHeight)){
321   - winHeight = document.body.clientHeight;
322   - }
  318 + updateWinHeight();
323 319 // 根据屏幕下拉程度自动显示、隐藏“返回顶部”按钮
324 320 $(window).scroll(function(){
325 321 if($(this).scrollTop() > 2*winHeight){
... ... @@ -349,29 +345,58 @@ $(function() {
349 345 $("#changepassword_oldpwd").focus();
350 346 }
351 347 });
  348 + // 开启公告信息模态框前自动判断是否已经勾选“30天不再显示”
  349 + $('#noticeModal').on('show.bs.modal', function(e) {
  350 + var cookieMd530 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));
  351 + if(cookieMd530){
  352 + $("#dontShowSomeNoticeAt30Day").attr("checked","checked");
  353 + }else{
  354 + $("#dontShowSomeNoticeAt30Day").attr("checked",false);
  355 + }
  356 + });
  357 + // 关闭公告信息模态框后根据是否已经勾选“30天不再显示”设置cookie
  358 + $('#noticeModal').on('hidden.bs.modal', function(e) {
  359 + var noticed = new Date();
  360 + if($("#dontShowSomeNoticeAt30Day").prop("checked")){
  361 + noticed.setTime(noticed.getTime() + (30*24*60*60*1000));
  362 + var cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)"));
  363 + if(cookieMd5){
  364 + document.cookie = "notice_md5_30=" + escape(unescape(cookieMd5[2])) + ";expires=" + noticed.toUTCString();
  365 + }else{
  366 + cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));
  367 + if(cookieMd5){
  368 + document.cookie = "notice_md5_30=" + escape(unescape(cookieMd5[2])) + ";expires=" + noticed.toUTCString();
  369 + }
  370 + }
  371 + }else{
  372 + noticed.setTime(0);
  373 + var cookieMd530 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));
  374 + if(cookieMd530){
  375 + document.cookie = "notice_md5_30=0;expires=" + noticed.toUTCString();
  376 + }
  377 + }
  378 + });
352 379 });
353 380  
  381 +// 更新页面高度
  382 +function updateWinHeight(){
  383 + if (window.innerHeight){
  384 + winHeight = window.innerHeight;
  385 + }else if ((document.body) && (document.body.clientHeight)){
  386 + winHeight = document.body.clientHeight;
  387 + }
  388 +}
  389 +
354 390 // 根据屏幕大小增删表格显示内容
355 391 function changeFilesTableStyle(){
356 392 var win = $(window).width();
357   - if(win < 800){
358   - $('#filetableheadera').addClass('filetableheaderstyle');
359   - $('.hiddenColumn').hide();
360   - $('.rightbtn').hide();
361   - $('#vicetbbox').show();
362   - $('#filetableoptmenusreach').hide();
363   - }else{
364   - $('#filetableheadera').removeClass('filetableheaderstyle');
365   - $('.hiddenColumn').show();
366   - $('.rightbtn').show();
367   - $('#vicetbbox').hide();
368   - $('#filetableoptmenusreach').show();
369   - }
370 393 if(win < 768){
  394 + $('#filetableheadera').addClass('filetableheaderstyle');
371 395 $('#filetableheadera').attr('data-toggle','collapse');
372 396 $('#filetableheadera').attr('data-target','#filetableoptmenu');
373 397 $('#mdropdownicon').html('(点击展开/折叠菜单)');
374 398 }else{
  399 + $('#filetableheadera').removeClass('filetableheaderstyle');
375 400 $('#filetableheadera').attr('data-toggle','modal');
376 401 $('#filetableheadera').attr('data-target','#folderInfoModal');
377 402 $('#mdropdownicon').html('');
... ... @@ -405,7 +430,14 @@ function getServerOS() {
405 430  
406 431 // 获取实时文件夹视图
407 432 function showFolderView(fid,targetId) {
  433 + // 判断是否正在进行另一个相同的请求,如果是则取消本次操作
  434 + if(loadingFolderView){
  435 + return;
  436 + }
408 437 startLoading();
  438 + if(remainingLoadingRequest){
  439 + remainingLoadingRequest.abort();
  440 + }
409 441 $.ajax({
410 442 type : 'POST',
411 443 dataType : 'text',
... ... @@ -415,56 +447,82 @@ function showFolderView(fid,targetId) {
415 447 url : 'homeController/getFolderView.ajax',
416 448 success : function(result) {
417 449 endLoading();
418   - if(result == "ERROR"){
  450 + switch (result) {
  451 + case "ERROR":
  452 + // 获取错误直接弹出提示框并将相关内容填为提示信息
419 453 doAlert();
420 454 $("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
421 455 $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
422 456 $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
423   - } else if (result == "mustLogin") {
424   - window.location.href = "prv/login.html";
425   - } else if(result == "NOT_FOUND") {
426   - document.cookie = "folder_id=" + escape("root");// 归位记忆路径
427   - window.location.href="/";
428   - } else if(result == "notAccess"){
429   - document.cookie = "folder_id=" + escape("root");// 归位记忆路径
  457 + break;
  458 + case "NOT_FOUND":
  459 + case "notAccess":
  460 + // 对于各种不能访问的情况,要先将记忆路径重置再跳转至根路径下
  461 + document.cookie = "folder_id=" + escape("root");
  462 + case "mustLogin":
  463 + // 如果服务器说必须登录,那么也跳转至根路径下(从而进入登录页面)
430 464 window.location.href="/";
431   - } else {
  465 + break;
  466 + default:
  467 + // 上述情况都不是,则返回的应该是文件夹视图数据,接下来对其进行解析
432 468 folderView = eval("(" + result + ")");
  469 + // 记录当前获取的文件夹视图的ID号,便于其他操作使用
433 470 locationpath = folderView.folder.folderId;
434 471 // 存储打开的文件夹路径至Cookie中,以便下次打开时直接显示
435 472 document.cookie = "folder_id=" + escape(locationpath);
  473 + // 记录上级目录ID,方便返回上一级
436 474 parentpath = folderView.folder.folderParent;
  475 + // 记录本文件夹的访问级别,便于在新建文件夹时判断应该从哪一个级别开始供用户选择
437 476 constraintLevel=folderView.folder.folderConstraint;
438 477 screenedFoldrView=null;
  478 + // 备份一份原始的文件夹视图数据,同时也记录下原始的查询偏移量
  479 + originFolderView=$.extend(true, {}, folderView);
  480 + totalFoldersOffset = folderView.foldersOffset;
  481 + totalFilesOffset = folderView.filesOffset;
  482 + // 搜索输入框重置
439 483 $("#sreachKeyWordIn").val("");
  484 + // 各项基于文件夹视图返回数据的解析操作……
440 485 showParentList(folderView);
441 486 showAccountView(folderView);
442 487 showPublishTime(folderView);
443   - originFolderView=$.extend(true, {}, folderView);
444 488 $("#sortByFN").removeClass();
445 489 $("#sortByCD").removeClass();
446 490 $("#sortByFS").removeClass();
447 491 $("#sortByCN").removeClass();
  492 + $("#sortByOR").removeClass();
448 493 showFolderTable(folderView);
449   - if(targetId != null && targetId.length > 0){
450   - $("#"+targetId).addClass("info");
451   - $("html,body").animate({scrollTop:$("#"+targetId).offset().top - $(window).height()/2},'slow');
  494 + // 更新文件夹信息至信息模态框
  495 + $("#fim_name").text(folderView.folder.folderName);
  496 + $("#fim_creator").text(folderView.folder.folderCreator);
  497 + $("#fim_folderCreationDate").text(folderView.folder.folderCreationDate);
  498 + $("#fim_folderId").text(folderView.folder.folderId);
  499 + updateTheFolderInfo();
  500 + // 判断是否还需要加载后续数据
  501 + if(folderView.foldersOffset > folderView.selectStep || folderView.filesOffset > folderView.selectStep){
  502 + // 如果文件夹偏移量或文件偏移量大于查询步进长度,则说明一定还有后续数据需要加载,那么继续加载后续数据
  503 + showLoadingRemaininngBox();
  504 + loadingRemainingFolderView(targetId);
  505 + }else{
  506 + // 否则,说明文件夹视图加载完成,进行定位工作即可
  507 + hiddenLoadingRemaininngBox();
  508 + doFixedRow(targetId);
452 509 }
  510 + break;
453 511 }
454 512 },
455   - error : function() {
  513 + error : function(XMLHttpRequest, textStatus, errorThrown) {
456 514 endLoading();
457 515 doAlert();
458 516 $("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
459 517 $("#publishTime").html("<span class='graytext'>获取失败,请尝试刷新</span>");
460   - $("#parentlistbox")
461   - .html("<span class='graytext'>获取失败,请尝试刷新</span>");
  518 + $("#parentlistbox").html("<span class='graytext'>获取失败,请尝试刷新</span>");
462 519 }
463 520 });
464 521 }
465 522  
466 523 // 开始文件视图加载动画
467 524 function startLoading(){
  525 + loadingFolderView = true;
468 526 $('#loadingModal').modal({backdrop:'static', keyboard: false});
469 527 $('#loadingModal').modal('show');
470 528 $('#loadingModal').addClass("shown");
... ... @@ -472,6 +530,7 @@ function startLoading(){
472 530  
473 531 // 结束文件视图加载动画
474 532 function endLoading(){
  533 + loadingFolderView = false;
475 534 $('#loadingModal').modal('hide');
476 535 $('#loadingModal').removeClass("shown");
477 536 }
... ... @@ -664,7 +723,7 @@ function showAccountView(folderView) {
664 723 // 说明已经登录,显示注销按钮
665 724 $("#tb")
666 725 .append(
667   - "<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#logoutModal'>注销 ["
  726 + "<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#logoutModal'>注销 ["
668 727 + folderView.account
669 728 + "] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>");
670 729 $("#tb2")
... ... @@ -675,7 +734,7 @@ function showAccountView(folderView) {
675 734 if(folderView.allowChangePassword == 'true'){
676 735 $("#tb")
677 736 .append(
678   - " <button class='btn btn-link rightbtn' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>");
  737 + " <button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>");
679 738 $("#tb2")
680 739 .append(
681 740 " <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>修改密码 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>");
... ... @@ -684,14 +743,14 @@ function showAccountView(folderView) {
684 743 // 说明用户未登录,显示登录按钮
685 744 $("#tb")
686 745 .append(
687   - "<button class='btn btn-link rightbtn' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>");
  746 + "<button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>");
688 747 $("#tb2")
689 748 .append(
690 749 "<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'>登入 <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>");
691 750 if(folderView.allowSignUp == 'true'){
692 751 $("#tb")
693 752 .append(
694   - " <button class='btn btn-link rightbtn' onclick='window.location.href = \"/prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>");
  753 + " <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>");
695 754 $("#tb2")
696 755 .append(
697 756 " <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>立即注册 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>");
... ... @@ -715,7 +774,7 @@ function showAccountView(folderView) {
715 774 $("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()");
716 775 }
717 776 }
718   - if (checkAuth(authList, "L")) {
  777 + if (folderView.enableDownloadZip && checkAuth(authList, "L")) {
719 778 $("#packageDownloadBox")
720 779 .html(
721 780 "<button class='btn btn-link navbar-btn' onclick='showDownloadAllCheckedModel()'><span class='glyphicon glyphicon-briefcase'></span> 打包下载</button>");
... ... @@ -767,6 +826,7 @@ function refreshFolderView() {
767 826 } else {
768 827 showFolderView('root');
769 828 }
  829 + subscribeNotice();// 刷新时也判断是否有新公告需要显示
770 830 }
771 831  
772 832 // 返回上一级文件夹
... ... @@ -784,7 +844,7 @@ function showFolderTable(folderView) {
784 844 if (parentpath != null && parentpath != "null") {
785 845 $("#foldertable")
786 846 .append(
787   - "<tr onclick='returnPF()'><td><button onclick='returnPF()' class='btn btn-link btn-xs'>../</button></td><td class='hiddenColumn'>--</td><td>--</td><td class='hiddenColumn'>--</td><td>--</td></tr>");
  847 + "<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>");
788 848 }
789 849 var authList = folderView.authList;
790 850 var aD = false;
... ... @@ -806,198 +866,216 @@ function showFolderTable(folderView) {
806 866 // 遍历并倒序显示文件夹列表
807 867 for(var i1=folderView.folderList.length;i1>0;i1--){
808 868 var f=folderView.folderList[i1-1];
809   - f.folderName = f.folderName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
810   - var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("
811   - + '"' + f.folderId + '"'
812   - + ")' class='btn btn-link btn-xs'>/"
813   - + f.folderName + "</button></td><td class='hiddenColumn'>"
814   - + f.folderCreationDate + "</td><td>--</td><td class='hiddenColumn'>"
815   - + f.folderCreator + "</td><td>";
816   - if (aD) {
817   - folderRow = folderRow
818   - + "<button onclick='showDeleteFolderModel("
819   - + '"'
820   - + f.folderId
821   - + '","'
822   - + f.folderName
823   - + '"'
824   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
825   - }
826   - if (aR) {
827   - folderRow = folderRow
828   - + "<button onclick='showRenameFolderModel("
829   - + '"'
830   - + f.folderId
831   - + '","'
832   - + f.folderName
833   - + '",'
834   - + f.folderConstraint
835   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
836   - }
837   - if (aO) {
838   - folderRow = folderRow
839   - + "<button onclick='showFolderView("
840   - + '"'
841   - + f.folderParent
842   - + '","'
843   - + f.folderId
844   - + '"'
845   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
846   - }
847   - if (!aR && !aD && !aO) {
848   - folderRow = folderRow + "--";
849   - }
850   - folderRow = folderRow + "</td></tr>";
851   - $("#foldertable").append(folderRow);
  869 + $("#foldertable").append(createNewFolderRow(f,aD,aR,aO));
852 870 }
853 871 // 遍历并倒序显示文件列表
854 872 for(var i2=folderView.fileList.length;i2>0;i2--){
855 873 var fi = folderView.fileList[i2-1];
856   - fi.fileName = fi.fileName.replace('\'','&#39;').replace('<','&lt;').replace('>','&gt;');
857   - var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
858   - + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
859   - + "' class='filerow'><td>" + fi.fileName
860   - + "</td><td class='hiddenColumn'>" + fi.fileCreationDate + "</td>";
861   - if(fi.fileSize=="0"){
862   - fileRow=fileRow+"<td>&lt;1MB</td>";
863   - }else{
864   - fileRow=fileRow+"<td>" + fi.fileSize + "MB</td>";
865   - }
866   - fileRow=fileRow +"<td class='hiddenColumn'>" + fi.fileCreator + "</td><td>";
867   - if (aL) {
  874 + $("#foldertable").append(createFileRow(fi,aL,aD,aR,aO));
  875 + }
  876 +}
  877 +
  878 +// 根据一个文件对象生成对应的文件行的HTML内容
  879 +function createFileRow(fi,aL,aD,aR,aO){
  880 + fi.fileName = fi.fileName.replace(/\'/g,'&#39;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  881 + var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
  882 + + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId
  883 + + "' class='filerow'><td>" + fi.fileName
  884 + + "</td><td class='hidden-xs'>" + fi.fileCreationDate + "</td>";
  885 + if(fi.fileSize=="0"){
  886 + fileRow=fileRow+"<td>&lt;1MB</td>";
  887 + }else{
  888 + fileRow=fileRow+"<td>" + fi.fileSize + "MB</td>";
  889 + }
  890 + fileRow=fileRow +"<td class='hidden-xs'>" + fi.fileCreator + "</td><td>";
  891 + if (aL) {
  892 + fileRow = fileRow
  893 + + "<button onclick='showDownloadModel("
  894 + + '"'
  895 + + fi.fileId
  896 + + '","'
  897 + + fi.fileName
  898 + + '"'
  899 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
  900 + // 对于各种特殊格式文件提供的预览和播放功能
  901 + var suffix=getSuffix(fi.fileName);
  902 + switch (suffix) {
  903 + case "mp4":
868 904 fileRow = fileRow
869   - + "<button onclick='showDownloadModel("
870   - + '"'
871   - + fi.fileId
872   - + '","'
873   - + fi.fileName
874   - + '"'
875   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
876   - // 对于各种特殊格式文件提供的预览和播放功能
877   - var suffix=getSuffix(fi.fileName);
878   - switch (suffix) {
879   - case "mp4":
880   - case "webm":
881   - case "mov":
882   - case "avi":
883   - case "wmv":
884   - case "mkv":
885   - case "flv":
  905 + + "<button onclick='playVideo("
  906 + + '"'
  907 + + fi.fileId
  908 + + '"'
  909 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  910 + break;
  911 + case "webm":
  912 + case "mov":
  913 + case "avi":
  914 + case "wmv":
  915 + case "mkv":
  916 + case "flv":
  917 + if(folderView.enableFFMPEG){
886 918 fileRow = fileRow
887 919 + "<button onclick='playVideo("
888 920 + '"'
889 921 + fi.fileId
890 922 + '"'
891 923 + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
892   - break;
893   - case "pdf":
894   - fileRow = fileRow
895   - + "<button onclick='pdfView("
  924 + }
  925 + break;
  926 + case "pdf":
  927 + fileRow = fileRow
  928 + + "<button onclick='pdfView("
  929 + + '"'
  930 + + fi.filePath
  931 + + '"'
  932 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  933 + break;
  934 + case "jpg":
  935 + case "jpeg":
  936 + case "gif":
  937 + case "png":
  938 + case "bmp":
  939 + fileRow = fileRow
  940 + + "<button onclick='showPicture("
  941 + + '"'
  942 + + fi.fileId
  943 + + '"'
  944 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
  945 + break;
  946 + case "mp3":
  947 + case "wav":
  948 + case "ogg":
  949 + fileRow = fileRow
  950 + + "<button onclick='playAudio("
  951 + + '"'
  952 + + fi.fileId
  953 + + '"'
  954 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
  955 + break;
  956 + case "docx":
  957 + fileRow = fileRow
  958 + + "<button onclick='docxView("
  959 + + '"'
  960 + + fi.fileId
  961 + + '"'
  962 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  963 + break;
  964 + case "txt":
  965 + fileRow = fileRow
  966 + + "<button onclick='txtView("
  967 + + '"'
  968 + + fi.fileId
  969 + + '"'
  970 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  971 + break;
  972 + case "ppt":
  973 + case "pptx":
  974 + fileRow = fileRow
  975 + + "<button onclick='pptView("
  976 + + '"'
  977 + + fi.fileId
  978 + + '"'
  979 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
  980 + break;
  981 + default:
  982 + break;
  983 + }
  984 + }
  985 + if (aD) {
  986 + fileRow = fileRow
  987 + + "<button onclick='showDeleteFileModel("
896 988 + '"'
897   - + fi.filePath
  989 + + fi.fileId
  990 + + '","'
  991 + + fi.fileName
898 992 + '"'
899   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
900   - break;
901   - case "jpg":
902   - case "jpeg":
903   - case "gif":
904   - case "png":
905   - case "bmp":
906   - fileRow = fileRow
907   - + "<button onclick='showPicture("
  993 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
  994 + }
  995 + if (aR) {
  996 + fileRow = fileRow
  997 + + "<button onclick='showRenameFileModel("
908 998 + '"'
909 999 + fi.fileId
910 1000 + '"'
911   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> 查看</button>";
912   - break;
913   - case "mp3":
914   - case "wav":
915   - case "ogg":
916   - fileRow = fileRow
917   - + "<button onclick='playAudio("
  1001 + + ","
918 1002 + '"'
919   - + fi.fileId
  1003 + + fi.fileName
920 1004 + '"'
921   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> 播放</button>";
922   - break;
923   - case "docx":
924   - fileRow = fileRow
925   - + "<button onclick='docxView("
  1005 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
  1006 + }
  1007 + if (aO) {
  1008 + fileRow = fileRow
  1009 + + "<button onclick='showFolderView("
926 1010 + '"'
  1011 + + fi.fileParentFolder
  1012 + + '","'
927 1013 + fi.fileId
928 1014 + '"'
929   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
930   - break;
931   - case "txt":
932   - fileRow = fileRow
933   - + "<button onclick='txtView("
  1015 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
  1016 + }
  1017 + if (aL && folderView.showFileChain == 'true') {
  1018 + fileRow = fileRow
  1019 + + "<button onclick='getFileChain("
  1020 + + '"'
  1021 + + fi.fileId
  1022 + + '","'
  1023 + + fi.fileName
  1024 + + '"'
  1025 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>";
  1026 + }
  1027 + if (!aR && !aD && !aL && !aO) {
  1028 + fileRow = fileRow + "--";
  1029 + }
  1030 + fileRow = fileRow + "</td></tr>";
  1031 + return fileRow;
  1032 +}
  1033 +
  1034 +// 根据一个文件夹对象生成对应的文件行的HTML内容
  1035 +function createNewFolderRow(f,aD,aR,aO){
  1036 + f.folderName = f.folderName.replace(/\'/g,'&#39;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  1037 + var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder("
  1038 + + '"' + f.folderId + '"'
  1039 + + ")' class='btn btn-link btn-xs'>/"
  1040 + + f.folderName + "</button></td><td class='hidden-xs'>"
  1041 + + f.folderCreationDate + "</td><td>--</td><td class='hidden-xs'>"
  1042 + + f.folderCreator + "</td><td>";
  1043 + if (aD) {
  1044 + folderRow = folderRow
  1045 + + "<button onclick='showDeleteFolderModel("
934 1046 + '"'
935   - + fi.fileId
  1047 + + f.folderId
  1048 + + '","'
  1049 + + f.folderName
936 1050 + '"'
937   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
938   - break;
939   - case "ppt":
940   - case "pptx":
941   - fileRow = fileRow
942   - + "<button onclick='pptView("
  1051 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
  1052 + }
  1053 + if (aR) {
  1054 + folderRow = folderRow
  1055 + + "<button onclick='showRenameFolderModel("
943 1056 + '"'
944   - + fi.fileId
  1057 + + f.folderId
  1058 + + '","'
  1059 + + f.folderName
  1060 + + '",'
  1061 + + f.folderConstraint
  1062 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
  1063 + }
  1064 + if (aO) {
  1065 + folderRow = folderRow
  1066 + + "<button onclick='showFolderView("
945 1067 + '"'
946   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 预览</button>";
947   - break;
948   - default:
949   - break;
950   - }
951   - }
952   - if (aD) {
953   - fileRow = fileRow
954   - + "<button onclick='showDeleteFileModel("
955   - + '"'
956   - + fi.fileId
957   - + '","'
958   - + fi.fileName
959   - + '"'
960   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
961   - }
962   - if (aR) {
963   - fileRow = fileRow
964   - + "<button onclick='showRenameFileModel("
965   - + '"'
966   - + fi.fileId
967   - + '"'
968   - + ","
969   - + '"'
970   - + fi.fileName
971   - + '"'
972   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
973   - }
974   - if (aO) {
975   - fileRow = fileRow
976   - + "<button onclick='showFolderView("
977   - + '"'
978   - + fi.fileParentFolder
979   - + '","'
980   - + fi.fileId
981   - + '"'
982   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
983   - }
984   - if (aL && folderView.showFileChain == 'true') {
985   - fileRow = fileRow
986   - + "<button onclick='getFileChain("
987   - + '"'
988   - + fi.fileId
989   - + '","'
990   - + fi.fileName
991   - + '"'
992   - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>";
993   - }
994   - if (!aR && !aD && !aL && !aO) {
995   - fileRow = fileRow + "--";
996   - }
997   - fileRow = fileRow + "</td></tr>";
998   - $("#foldertable").append(fileRow);
  1068 + + f.folderParent
  1069 + + '","'
  1070 + + f.folderId
  1071 + + '"'
  1072 + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-sunglasses'></span> 定位</button>";
999 1073 }
1000   - changeFilesTableStyle();
  1074 + if (!aR && !aD && !aO) {
  1075 + folderRow = folderRow + "--";
  1076 + }
  1077 + folderRow = folderRow + "</td></tr>";
  1078 + return folderRow;
1001 1079 }
1002 1080  
1003 1081 var folderTypes=['公开的','仅小组','仅创建者'];// 文件夹约束条件(由小至大)
... ... @@ -1040,20 +1118,30 @@ function createfolder() {
1040 1118 if (result == "mustLogin") {
1041 1119 window.location.href = "prv/login.html";
1042 1120 } else {
1043   - if (result == "noAuthorized") {
  1121 + switch (result) {
  1122 + case "noAuthorized":
1044 1123 showFolderAlert("提示:您的操作未被授权,创建文件夹失败。");
1045   - } else if (result == "errorParameter") {
  1124 + break;
  1125 + case "errorParameter":
1046 1126 showFolderAlert("提示:参数不正确,创建文件夹失败。");
1047   - } else if (result == "cannotCreateFolder") {
  1127 + break;
  1128 + case "cannotCreateFolder":
1048 1129 showFolderAlert("提示:出现意外错误,可能未能创建文件夹。");
1049   - } else if (result == "nameOccupied") {
  1130 + break;
  1131 + case "nameOccupied":
1050 1132 showFolderAlert("提示:该名称已被占用,请选取其他名称。");
1051   - } else if (result == "createFolderSuccess") {
  1133 + break;
  1134 + case "foldersTotalOutOfLimit":
  1135 + showFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中创建更多文件夹。");
  1136 + break;
  1137 + case "createFolderSuccess":
1052 1138 $('#newFolderModal').modal('hide');
1053 1139 showFolderView(locationpath);
1054   - } else {
  1140 + break;
  1141 + default:
1055 1142 $('#newFolderModal').modal('hide');
1056 1143 showFolderView(locationpath);
  1144 + break;
1057 1145 }
1058 1146 }
1059 1147 },
... ... @@ -1062,7 +1150,7 @@ function createfolder() {
1062 1150 }
1063 1151 });
1064 1152 } else {
1065   - showFolderAlert("提示:文件夹名中不应含有:引号 / \ * | < > & $ : ? 且不能以“.”开头。");
  1153 + showFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。");
1066 1154 }
1067 1155 }
1068 1156  
... ... @@ -1193,7 +1281,7 @@ function renameFolder(folderId) {
1193 1281 }
1194 1282 });
1195 1283 } else {
1196   - showRFolderAlert("提示:文件夹名中不应含有:引号 / \ * | < > & $ : ? 且不能以“.”开头。");
  1284 + showRFolderAlert("提示:文件夹名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。");
1197 1285 }
1198 1286 }
1199 1287  
... ... @@ -1289,11 +1377,17 @@ function checkUploadFile() {
1289 1377 if (result == "mustLogin") {
1290 1378 window.location.href = "prv/login.html";
1291 1379 } else {
1292   - if (result == "errorParameter") {
  1380 + switch (result) {
  1381 + case "errorParameter":
1293 1382 showUploadFileAlert("提示:参数不正确,无法开始上传");
1294   - } else if (result == "noAuthorized") {
  1383 + break;
  1384 + case "noAuthorized":
1295 1385 showUploadFileAlert("提示:您的操作未被授权,无法开始上传");
1296   - } else {
  1386 + break;
  1387 + case "filesTotalOutOfLimit":
  1388 + showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,无法在其中上传更多文件。您可以尝试将其上传至其他文件夹内。");
  1389 + break;
  1390 + default:
1297 1391 var resp=eval("("+result+")");
1298 1392 if(resp.checkResult == "fileTooLarge"){
1299 1393 showUploadFileAlert("提示:文件["+resp.overSizeFile+"]的体积超过最大限制("+resp.maxUploadFileSize+"),无法开始上传");
... ... @@ -1306,6 +1400,7 @@ function checkUploadFile() {
1306 1400 }else {
1307 1401 showUploadFileAlert("提示:出现意外错误,无法开始上传");
1308 1402 }
  1403 + break;
1309 1404 }
1310 1405 }
1311 1406 },
... ... @@ -1448,6 +1543,10 @@ function doupload(count) {
1448 1543 showUploadFileAlert("提示:出现意外错误,文件:[" + fname
1449 1544 + "]上传失败,上传被中断。");
1450 1545 $("#uls_" + count).text("[失败]");
  1546 + } else if(result == 'filesTotalOutOfLimit'){
  1547 + showUploadFileAlert("提示:该文件夹内存储的文件数量已达上限,文件:[" + fname
  1548 + + "]上传失败。您可以尝试将其上传至其他文件夹内。");
  1549 + $("#uls_" + count).text("[失败]");
1451 1550 } else {
1452 1551 showUploadFileAlert("提示:出现意外错误,文件:[" + fname
1453 1552 + "]上传失败,上传被中断。");
... ... @@ -1500,7 +1599,7 @@ function showDownloadModel(fileId, fileName) {
1500 1599 $("#downloadFileName").text("提示:您确认要下载文件:[" + fileName + "]么?");
1501 1600 $("#downloadHrefBox").html("<span class='text-muted'>正在生成...</span>");
1502 1601 getDownloadFileId=fileId;
1503   - getDownloadFileName=fileName.replace("#","%23").replace("%","%25").replace("?","%3F");
  1602 + getDownloadFileName=fileName;
1504 1603 $("#downloadFileBox")
1505 1604 .html(
1506 1605 "<button id='dlmbutton' type='button' class='btn btn-primary' onclick='dodownload("
... ... @@ -1621,7 +1720,7 @@ function renameFile(fileId) {
1621 1720 }
1622 1721 });
1623 1722 } else {
1624   - showRFileAlert("提示:文件名中不应含有:引号 / \ * | < > & $ : ? 且不能以“.”开头。");
  1723 + showRFileAlert("提示:文件名中不应含有:引号 / \\ * | < > & $ : ? 且不能以“.”开头。");
1625 1724 }
1626 1725 } else {
1627 1726 showRFileAlert("提示:文件名称太长。");
... ... @@ -1866,6 +1965,9 @@ function checkallfile() {
1866 1965  
1867 1966 // 显示打包下载模态框
1868 1967 function showDownloadAllCheckedModel() {
  1968 + if(!folderView.enableDownloadZip){
  1969 + return;
  1970 + }
1869 1971 $("#downloadAllCheckedBox").html("");
1870 1972 $("#downloadAllCheckedLoad").text("");
1871 1973 var faf=getCheckedFilesAndFolders();
... ... @@ -2108,113 +2210,170 @@ function audio_vulome_down(){
2108 2210  
2109 2211 // 按文件名排序
2110 2212 function sortbyfn(){
  2213 + if(!loadingComplete){
  2214 + return;
  2215 + }
  2216 + if($("#sortByCD,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){
  2217 + return;
  2218 + }
2111 2219 $("#sortByCD").removeClass();
2112 2220 $("#sortByFS").removeClass();
2113 2221 $("#sortByCN").removeClass();
  2222 + $("#sortByOR").removeClass();
2114 2223 var order=1;
2115 2224 if($("#sortByFN").hasClass('glyphicon-triangle-bottom')){
2116   - $("#sortByFN").removeClass();
2117   - $("#sortByFN").addClass("glyphicon glyphicon-triangle-top");
2118 2225 order=-1;
2119   - }else{
2120   - $("#sortByFN").removeClass();
2121   - $("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom");
2122 2226 }
2123   - folderView.fileList.sort(function(v1,v2){
2124   - return order * v2.fileName.localeCompare(v1.fileName,"zh");
2125   - });
2126   - folderView.folderList.sort(function(v1,v2){
2127   - return order * v2.folderName.localeCompare(v1.folderName,"zh");
2128   - });
2129   - showFolderTable(folderView);
  2227 + $("#sortByFN").removeClass();
  2228 + $("#sortByFN").addClass("glyphicon glyphicon-hourglass");
  2229 + // 另开一个计时器进行排序操作,避免因卡死导致加载动画无法显示
  2230 + setTimeout(function(){
  2231 + folderView.fileList.sort(function(v1,v2){
  2232 + return order * v2.fileName.localeCompare(v1.fileName,"zh");
  2233 + });
  2234 + folderView.folderList.sort(function(v1,v2){
  2235 + return order * v2.folderName.localeCompare(v1.folderName,"zh");
  2236 + });
  2237 + showFolderTable(folderView);
  2238 + $("#sortByFN").removeClass();
  2239 + if(order == -1){
  2240 + $("#sortByFN").addClass("glyphicon glyphicon-triangle-top");
  2241 + }else{
  2242 + $("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom");
  2243 + }
  2244 + }, 0);
2130 2245 }
2131 2246  
2132 2247 // 按创建日期排序
2133 2248 function sortbycd(){
  2249 + if(!loadingComplete){
  2250 + return;
  2251 + }
  2252 + if($("#sortByFN,#sortByFS,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){
  2253 + return;
  2254 + }
2134 2255 $("#sortByFN").removeClass();
2135 2256 $("#sortByFS").removeClass();
2136 2257 $("#sortByCN").removeClass();
  2258 + $("#sortByOR").removeClass();
2137 2259 var order=1;
2138 2260 if($("#sortByCD").hasClass('glyphicon-triangle-bottom')){
2139   - $("#sortByCD").removeClass();
2140   - $("#sortByCD").addClass("glyphicon glyphicon-triangle-top");
2141 2261 order=-1;
2142   - }else{
2143   - $("#sortByCD").removeClass();
2144   - $("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom");
2145 2262 }
2146   - folderView.fileList.sort(function(v1,v2){
2147   - var v1DateStr=v1.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
2148   - var v2DateStr=v2.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
2149   - var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
2150   - return order * res;
2151   - });
2152   - folderView.folderList.sort(function(v1,v2){
2153   - var v1DateStr=v1.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
2154   - var v2DateStr=v2.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
2155   - var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
2156   - return order * res;
2157   - });
2158   - showFolderTable(folderView);
  2263 + $("#sortByCD").removeClass();
  2264 + $("#sortByCD").addClass("glyphicon glyphicon-hourglass");
  2265 + setTimeout(function(){
  2266 + folderView.fileList.sort(function(v1,v2){
  2267 + var v1DateStr=v1.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
  2268 + var v2DateStr=v2.fileCreationDate.replace("年","-").replace("月","-").replace("日","");
  2269 + var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
  2270 + return order * res;
  2271 + });
  2272 + folderView.folderList.sort(function(v1,v2){
  2273 + var v1DateStr=v1.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
  2274 + var v2DateStr=v2.folderCreationDate.replace("年","-").replace("月","-").replace("日","");
  2275 + var res=((new Date(Date.parse(v1DateStr)).getTime())-(new Date(Date.parse(v2DateStr)).getTime()));
  2276 + return order * res;
  2277 + });
  2278 + showFolderTable(folderView);
  2279 + $("#sortByCD").removeClass();
  2280 + if(order == -1){
  2281 + $("#sortByCD").addClass("glyphicon glyphicon-triangle-top");
  2282 + }else{
  2283 + $("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom");
  2284 + }
  2285 + }, 0);
2159 2286 }
2160 2287  
2161 2288 // 按文件大小排序
2162 2289 function sortbyfs(){
  2290 + if(!loadingComplete){
  2291 + return;
  2292 + }
  2293 + if($("#sortByFN,#sortByCD,#sortByCN,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){
  2294 + return;
  2295 + }
2163 2296 $("#sortByFN").removeClass();
2164 2297 $("#sortByCD").removeClass();
2165 2298 $("#sortByCN").removeClass();
2166   - // 正倒序判断
  2299 + $("#sortByOR").removeClass();
  2300 + var order=1;
2167 2301 if($("#sortByFS").hasClass("glyphicon-triangle-bottom")){
2168   - $("#sortByFS").removeClass();
2169   - $("#sortByFS").addClass("glyphicon glyphicon-triangle-top");
  2302 + order=-1;
  2303 + }
  2304 + $("#sortByFS").removeClass();
  2305 + $("#sortByFS").addClass("glyphicon glyphicon-hourglass");
  2306 + setTimeout(function(){
2170 2307 folderView.fileList.sort(function(v1,v2){
2171   - return v2.fileSize - v1.fileSize;
  2308 + return order * (v1.fileSize - v2.fileSize);
2172 2309 });
2173   - }else{
  2310 + showFolderTable(folderView);
2174 2311 $("#sortByFS").removeClass();
2175   - $("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom");
2176   - folderView.fileList.sort(function(v1,v2){
2177   - return v1.fileSize - v2.fileSize;
2178   - });
2179   - }
2180   - showFolderTable(folderView);
  2312 + if(order == -1){
  2313 + $("#sortByFS").addClass("glyphicon glyphicon-triangle-top");
  2314 + }else{
  2315 + $("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom");
  2316 + }
  2317 + }, 0);
2181 2318 }
2182 2319  
2183 2320 // 按创建者排序
2184 2321 function sortbycn(){
  2322 + if(!loadingComplete){
  2323 + return;
  2324 + }
  2325 + if($("#sortByFN,#sortByCD,#sortByFS,#sortByOR").hasClass("glyphicon glyphicon-hourglass")){
  2326 + return;
  2327 + }
2185 2328 $("#sortByFN").removeClass();
2186 2329 $("#sortByCD").removeClass();
2187 2330 $("#sortByFS").removeClass();
  2331 + $("#sortByOR").removeClass();
2188 2332 var order=1;
2189 2333 if($("#sortByCN").hasClass('glyphicon-triangle-bottom')){
2190   - $("#sortByCN").removeClass();
2191   - $("#sortByCN").addClass("glyphicon glyphicon-triangle-top");
2192 2334 order=-1;
2193   - }else{
2194   - $("#sortByCN").removeClass();
2195   - $("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom");
2196 2335 }
2197   - folderView.fileList.sort(function(v1,v2){
2198   - return order * v2.fileCreator.localeCompare(v1.fileCreator,"zh");
2199   - });
2200   - folderView.folderList.sort(function(v1,v2){
2201   - return order * v2.folderCreator.localeCompare(v1.folderCreator,"zh");
2202   - });
2203   - showFolderTable(folderView);
  2336 + $("#sortByCN").removeClass();
  2337 + $("#sortByCN").addClass("glyphicon glyphicon-hourglass");
  2338 + setTimeout(function(){
  2339 + folderView.fileList.sort(function(v1,v2){
  2340 + return order * v2.fileCreator.localeCompare(v1.fileCreator,"zh");
  2341 + });
  2342 + folderView.folderList.sort(function(v1,v2){
  2343 + return order * v2.folderCreator.localeCompare(v1.folderCreator,"zh");
  2344 + });
  2345 + showFolderTable(folderView);
  2346 + $("#sortByCN").removeClass();
  2347 + if(order == -1){
  2348 + $("#sortByCN").addClass("glyphicon glyphicon-triangle-top");
  2349 + }else{
  2350 + $("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom");
  2351 + }
  2352 + }, 0);
2204 2353 }
2205 2354  
2206 2355 // 显示原始的顺序
2207 2356 function showOriginFolderView(){
  2357 + if(!loadingComplete){
  2358 + return;
  2359 + }
  2360 + if($("#sortByFN,#sortByCD,#sortByFS,#sortByCN").hasClass("glyphicon glyphicon-hourglass")){
  2361 + return;
  2362 + }
2208 2363 $("#sortByFN").removeClass();
2209 2364 $("#sortByCD").removeClass();
2210 2365 $("#sortByFS").removeClass();
2211 2366 $("#sortByCN").removeClass();
2212   - if(screenedFoldrView!=null){
2213   - folderView=$.extend(true, {}, screenedFoldrView);
2214   - }else{
2215   - folderView=$.extend(true, {}, originFolderView);
2216   - }
2217   - showFolderTable(folderView);
  2367 + $("#sortByOR").addClass("glyphicon glyphicon-hourglass");
  2368 + setTimeout(function(){
  2369 + if(screenedFoldrView!=null){
  2370 + folderView=$.extend(true, {}, screenedFoldrView);
  2371 + }else{
  2372 + folderView=$.extend(true, {}, originFolderView);
  2373 + }
  2374 + showFolderTable(folderView);
  2375 + $("#sortByOR").removeClass();
  2376 + }, 0);
2218 2377 }
2219 2378  
2220 2379 // 确认文件移动(剪切-粘贴)操作
... ... @@ -2261,40 +2420,56 @@ function doMoveFiles(){
2261 2420 if (result == "mustLogin") {
2262 2421 window.location.href = "prv/login.html";
2263 2422 } else {
2264   - if (result == "noAuthorized") {
  2423 + switch (result) {
  2424 + case "noAuthorized":
2265 2425 $('#moveFilesMessage').text("提示:您的操作未被授权,移动失败");
2266 2426 $("#dmvfbutton").attr('disabled', false);
2267   - } else if (result == "errorParameter") {
  2427 + break;
  2428 + case "errorParameter":
2268 2429 $('#moveFilesMessage').text("提示:参数不正确,未能全部移动文件,请刷新后重试");
2269 2430 $("#dmvfbutton").attr('disabled', false);
2270   - } else if (result == "cannotMoveFiles") {
  2431 + break;
  2432 + case "cannotMoveFiles":
2271 2433 $('#moveFilesMessage').text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试");
2272 2434 $("#dmvfbutton").attr('disabled', false);
2273   - } else if (result == "confirmMoveFiles") {
  2435 + break;
  2436 + case "filesTotalOutOfLimit":
  2437 + $('#moveFilesMessage').text("提示:该文件夹内存储的文件数量已达上限,无法移入更多文件");
  2438 + $("#dmvfbutton").attr('disabled', false);
  2439 + break;
  2440 + case "foldersTotalOutOfLimit":
  2441 + $('#moveFilesMessage').text("提示:该文件夹内存储的文件夹数量已达上限,无法移入更多文件夹");
  2442 + $("#dmvfbutton").attr('disabled', false);
  2443 + break;
  2444 + case "confirmMoveFiles":
2274 2445 strMoveOptMap={};
2275 2446 sendMoveFilesReq();
2276   - } else if(result.startsWith("duplicationFileName:")){
2277   - repeMap=eval("("+result.substring(20)+")");
2278   - repeIndex=0;
2279   - strMoveOptMap={};
2280   - mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length;
2281   - if(repeMap.repeFolders.length>0){
2282   - $("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName);
2283   - }else{
2284   - $("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);
2285   - }
2286   - var authList = originFolderView.authList;
2287   - if(checkAuth(authList, "D")){
2288   - $("#movecoverbtn").show();
2289   - }else{
2290   - $("#movecoverbtn").hide();
  2447 + break;
  2448 + default:
  2449 + if(result.startsWith("duplicationFileName:")){
  2450 + repeMap=eval("("+result.substring(20)+")");
  2451 + repeIndex=0;
  2452 + strMoveOptMap={};
  2453 + mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length;
  2454 + if(repeMap.repeFolders.length>0){
  2455 + $("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName);
  2456 + }else{
  2457 + $("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName);
  2458 + }
  2459 + var authList = originFolderView.authList;
  2460 + if(checkAuth(authList, "D")){
  2461 + $("#movecoverbtn").show();
  2462 + }else{
  2463 + $("#movecoverbtn").hide();
  2464 + }
  2465 + $("#selectFileMoveModelAlert").show();
  2466 + } else if(result.startsWith("CANT_MOVE_TO_INSIDE:")){
  2467 + $('#moveFilesMessage').text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20));
  2468 + } else {
  2469 + $('#moveFilesMessage').text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试");
  2470 + $("#dmvfbutton").attr('disabled', false);
2291 2471 }
2292   - $("#selectFileMoveModelAlert").show();
2293   - } else if(result.startsWith("CANT_MOVE_TO_INSIDE:")){
2294   - $('#moveFilesMessage').text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20));
2295   - } else {
2296   - $('#moveFilesMessage').text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试");
2297   - $("#dmvfbutton").attr('disabled', false);
  2472 + break;
2298 2473 }
2299 2474 }
2300 2475 },
... ... @@ -2355,21 +2530,35 @@ function sendMoveFilesReq(){
2355 2530 if (result == "mustLogin") {
2356 2531 window.location.href = "prv/login.html";
2357 2532 } else {
2358   - if (result == "noAuthorized") {
  2533 + switch (result) {
  2534 + case "noAuthorized":
2359 2535 $('#moveFilesMessage').text("提示:您的操作未被授权,移动失败");
2360 2536 $("#dmvfbutton").attr('disabled', false);
2361   - } else if (result == "errorParameter") {
  2537 + break;
  2538 + case "errorParameter":
2362 2539 $('#moveFilesMessage').text("提示:参数不正确,未能全部移动文件,请刷新后重试");
2363 2540 $("#dmvfbutton").attr('disabled', false);
2364   - } else if (result == "cannotMoveFiles") {
  2541 + break;
  2542 + case "filesTotalOutOfLimit":
  2543 + $('#moveFilesMessage').text("提示:该文件夹内存储的文件数量已达上限,无法移入更多文件。");
  2544 + $("#dmvfbutton").attr('disabled', false);
  2545 + break;
  2546 + case "foldersTotalOutOfLimit":
  2547 + $('#moveFilesMessage').text("提示:该文件夹内存储的文件夹数量已达上限,无法移入更多文件夹。");
  2548 + $("#dmvfbutton").attr('disabled', false);
  2549 + break;
  2550 + case "cannotMoveFiles":
2365 2551 $('#moveFilesMessage').text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试");
2366 2552 $("#dmvfbutton").attr('disabled', false);
2367   - } else if (result == "moveFilesSuccess") {
  2553 + break;
  2554 + case "moveFilesSuccess":
2368 2555 $('#moveFilesModal').modal('hide');
2369 2556 showFolderView(locationpath);
2370   - } else {
  2557 + break;
  2558 + default:
2371 2559 $('#moveFilesMessage').text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试");
2372 2560 $("#dmvfbutton").attr('disabled', false);
  2561 + break;
2373 2562 }
2374 2563 }
2375 2564 },
... ... @@ -2425,6 +2614,7 @@ function selectInThisPath(keyworld){
2425 2614 $("#sortByCD").removeClass();
2426 2615 $("#sortByFS").removeClass();
2427 2616 $("#sortByCN").removeClass();
  2617 + $("#sortByOR").removeClass();
2428 2618 folderView=$.extend(true, {}, screenedFoldrView);
2429 2619 showFolderTable(folderView);
2430 2620 }catch(e){
... ... @@ -2474,6 +2664,7 @@ function selectInCompletePath(keyworld){
2474 2664 $("#sortByCD").removeClass();
2475 2665 $("#sortByFS").removeClass();
2476 2666 $("#sortByCN").removeClass();
  2667 + $("#sortByOR").removeClass();
2477 2668 showFolderTable(folderView);
2478 2669 }
2479 2670 },
... ... @@ -2506,7 +2697,10 @@ function getDownloadURL(){
2506 2697 fId:getDownloadFileId
2507 2698 },
2508 2699 success:function(result){
2509   - $("#downloadHrefBox").html("<a href='"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+result+"'>"+window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+getDownloadFileName+"?dkey="+result+"</a>");
  2700 + // 获取链接
  2701 + var dlurl=window.location.protocol+"//"+window.location.host+"/externalLinksController/downloadFileByKey/"+encodeURIComponent(getDownloadFileName.replace(/\'/g,''))+"?dkey="+result;
  2702 + // 显示链接内容
  2703 + $("#downloadHrefBox").html("<a href='"+dlurl+"'>"+dlurl+"</a>");
2510 2704 },
2511 2705 error:function(){
2512 2706 $("#downloadHrefBox").html("<span class='text-muted'>获取失败,请检查网络状态或<a href='javascript:void(0);' onclick='getDownloadURL()'>点此</a>重新获取。</span>");
... ... @@ -2603,7 +2797,7 @@ function checkImportFolder(){
2603 2797 isImporting = true;
2604 2798 var maxSize = 0;
2605 2799 var maxFileIndex = 0;
2606   - // 找出最大体积的文件避免服务器进行效验
  2800 + // 找出最大体积的文件以便服务器进行效验
2607 2801 for (var i = 0; i < ifs.length; i++) {
2608 2802 if(ifs[i].size > maxSize){
2609 2803 maxSize = ifs[i].size;
... ... @@ -2635,6 +2829,9 @@ function checkImportFolder(){
2635 2829 case 'fileOverSize':
2636 2830 showImportFolderAlert("提示:文件["+ifs[maxFileIndex].webkitRelativePath+"]的体积超过最大限制("+resJson.maxSize+"),无法开始上传");
2637 2831 break;
  2832 + case 'foldersTotalOutOfLimit':
  2833 + showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法在其中上传更多文件夹。您可以尝试将其上传至其他文件夹内。");
  2834 + break;
2638 2835 case 'repeatFolder_Both':
2639 2836 $("#repeFolderName").text(importFolderName);
2640 2837 $("#importcoverbtn").hide();
... ... @@ -2727,7 +2924,9 @@ function importAndBoth() {
2727 2924 var resJson = eval("(" + result + ")");
2728 2925 if(resJson.result == 'success'){
2729 2926 iteratorImport(0,resJson.newName);// 若新建成功,则使用新文件夹名称开始上传
2730   - }else{
  2927 + } else if(resJson.result == 'foldersTotalOutOfLimit') {
  2928 + showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,无法上传同名文件夹并保留两者。您可以尝试将其上传至其他文件夹内。");
  2929 + } else {
2731 2930 showImportFolderAlert("提示:生成新文件夹名称失败,无法开始上传");
2732 2931 }
2733 2932 },
... ... @@ -2807,6 +3006,14 @@ function iteratorImport(i,newFolderName){
2807 3006 showImportFolderAlert("提示:出现意外错误,文件:[" + fname
2808 3007 + "]上传失败,上传被中断。");
2809 3008 $("#ils_" + i).text("[失败]");
  3009 + } else if (result == "foldersTotalOutOfLimit"){
  3010 + showImportFolderAlert("提示:该文件夹内存储的文件夹数量已达上限,文件:[" + fname
  3011 + + "]上传失败,上传被中断。");
  3012 + $("#ils_" + i).text("[失败]");
  3013 + } else if (result == "filesTotalOutOfLimit"){
  3014 + showImportFolderAlert("提示:该文件夹内存储的文件数量已达上限,文件:[" + fname
  3015 + + "]上传失败,上传被中断。");
  3016 + $("#ils_" + i).text("[失败]");
2810 3017 } else {
2811 3018 showImportFolderAlert("提示:出现意外错误,文件:[" + fname
2812 3019 + "]上传失败,上传被中断。");
... ... @@ -3009,4 +3216,245 @@ function copyFileChain(){
3009 3216 selection.addRange(range);
3010 3217 }
3011 3218 document.execCommand('copy');
  3219 +}
  3220 +
  3221 +// 显示公告模态框
  3222 +function showNoticeModal(){
  3223 + $('#noticeModal').modal('show');
  3224 +}
  3225 +
  3226 +// 加载公告内容并初始化公告模态框
  3227 +function initNoticeModal(){
  3228 + $("#noticeModalBody").load("resourceController/getNoticeContext.do",function(){
  3229 + $('#noticeModalBody img').css("max-width","100%");
  3230 + if(winHeight >= 300){
  3231 + $('#noticeModalBody').css("max-height",(winHeight - 180)+"px");
  3232 + }else{
  3233 + $('#noticeModalBody').css("max-height","300px");
  3234 + }
  3235 + noticeInited = true;
  3236 + showNoticeModal();
  3237 + showNoticeBtn();
  3238 + });
  3239 +}
  3240 +
  3241 +// 打开主页时自动订阅未阅读过的公告信息并显示,如果该公告已经阅读过则不会显示。
  3242 +function subscribeNotice(){
  3243 + $.ajax({
  3244 + url:'resourceController/getNoticeMD5.ajax',
  3245 + data:{},
  3246 + type:'POST',
  3247 + dataType:'text',
  3248 + success:function(result){
  3249 + if(result != ""){
  3250 + var cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)"));
  3251 + if(cookieMd5){
  3252 + if(result == unescape(cookieMd5[2])){
  3253 + showNoticeBtn();
  3254 + return;
  3255 + }
  3256 + }else{
  3257 + cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)"));
  3258 + if(cookieMd5){
  3259 + if(result == unescape(cookieMd5[2])){
  3260 + showNoticeBtn();
  3261 + return;
  3262 + }
  3263 + }
  3264 + }
  3265 + initNoticeModal();
  3266 + document.cookie = "notice_md5=" + escape(result);
  3267 + }
  3268 + },
  3269 + error:function(){
  3270 + alert("错误:无法从服务器获取公告信息,请尝试刷新页面。");
  3271 + }
  3272 + });
  3273 +}
  3274 +
  3275 +// 显示“公告”浮动按钮,方便用户手动打开公告
  3276 +function showNoticeBtn() {
  3277 + $("#shownoticebox").removeClass("hidden");
  3278 + $("#shownoticebox").addClass("show");
  3279 +}
  3280 +
  3281 +// 手动显示公告
  3282 +function showNotice() {
  3283 + if(noticeInited) {
  3284 + showNoticeModal();
  3285 + }else{
  3286 + initNoticeModal();
  3287 + }
  3288 +}
  3289 +
  3290 +// 该方法用于请求并继续加载文件夹视图的后续数据(可能会被迭代调用)
  3291 +function loadingRemainingFolderView(targetId){
  3292 + // 判断是否正在执行另一个相同的请求,避免重复操作
  3293 + if(remainingLoadingRequest){
  3294 + return;
  3295 + }
  3296 + // 计算新的查询偏移量
  3297 + var newfoldersOffset=0;
  3298 + var newfilesOffset=0;
  3299 + if((folderView.foldersOffset - folderView.selectStep) > 0){
  3300 + newfoldersOffset = folderView.foldersOffset - folderView.selectStep;
  3301 + }
  3302 + if((folderView.filesOffset - folderView.selectStep) > 0){
  3303 + newfilesOffset = folderView.filesOffset - folderView.selectStep;
  3304 + }
  3305 + if(newfoldersOffset <= 0 && newfilesOffset <= 0){
  3306 + originFolderView=$.extend(true, {}, folderView);
  3307 + hiddenLoadingRemaininngBox();
  3308 + doFixedRow(targetId);
  3309 + return;
  3310 + }
  3311 + var loadingRemainingRate_folders = 1;
  3312 + var loadingRemainingRate_files = 1;
  3313 + if(totalFoldersOffset > 0){
  3314 + loadingRemainingRate_folders = (totalFoldersOffset - newfoldersOffset) / totalFoldersOffset;
  3315 + }
  3316 + if(totalFilesOffset > 0){
  3317 + loadingRemainingRate_files = (totalFilesOffset - newfilesOffset) / totalFilesOffset;
  3318 + }
  3319 + var loadingRemainingRate = (loadingRemainingRate_folders + loadingRemainingRate_files)/2;
  3320 + $("#loadingrate").text(parseInt(loadingRemainingRate * 100) + "%");
  3321 + remainingLoadingRequest = $.ajax({
  3322 + url:'homeController/getRemainingFolderView.ajax',
  3323 + data:{
  3324 + fid:locationpath,
  3325 + foldersOffset:newfoldersOffset,
  3326 + filesOffset:newfilesOffset
  3327 + },
  3328 + type:'POST',