提交 2b5d2152e67f886ceba2b2959af76ba928337033
1 个父辈
54018d6e
update to v1.0.29-release
正在显示
12 个修改的文件
包含
1734 行增加
和
1343 行删除
... | ... | @@ -77,13 +77,19 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_ |
77 | 77 | |
78 | 78 | > 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。 |
79 | 79 | |
80 | -### 常规更新v1.0.28 | |
81 | -_本次更新为维护性的更新,修复一些已经发现的问题并优化使用体验,推荐所有用户升级。_ | |
82 | -+ 修正了部分启动命令提示信息描述不正确的问题。 | |
83 | -+ 优化了系统运行时的终端输出内容,避免输出信息过于杂乱影响命令操作。 | |
84 | -+ 完善了命令模式下“文件管理”功能,进一步优化其命令检验和提示机制,方便使用者进行日常操作。 | |
85 | -+ 进一步完善了文件系统的数据效验机制,更好地保证其“整洁”、稳定和健壮。 | |
86 | -+ 其他一些细节优化。 | |
80 | +### 新版本v1.0.29 | |
81 | +_本次更新加入了新功能,进一步增强kiftd的使用体验,推荐所有用户升级。_ | |
82 | ++ 新增了“复制”功能——这是一项众多用户期待已久的功能,现已正式加入。您可以通过“复制-粘贴”操作来快速复制网盘中的文件和文件夹,并且无需担心该操作会占用额外的存储空间。 | |
83 | ++ 进一步完善了全局搜索功能——全局搜索完成后,您可以在“详细信息”窗口中查看本次搜索的统计信息,包括搜索到的文件和文件夹的数量。 | |
84 | ++ 进一步完善了“永久资源链接”功能中的“复制链接”功能——现在,复制后的链接格式将更加规范、更容易被识别。 | |
85 | ++ 进一步完善了音乐播放功能——解决了在某些情况下播放器无法正常显示列表中第一首歌的歌词的问题。 | |
86 | ++ 修复了在非x86环境下使用自定义ffmpeg视频解码引擎后可能会导致“在线播放”功能出现异常的问题。 | |
87 | ++ 修复了当用户使用上传文件夹功能上传Unix/Linux系统中的隐藏文件夹(以“.”开头)时会导致现操作意外中断的问题,并且该功能现在能够正确上传这些隐藏文件夹了。 | |
88 | ++ 修复了上传文件和上传文件夹功能在取消时可能会引发错误操作的问题。 | |
89 | ++ 修复了“自由注册新账户”功能中存在的一个安全性漏洞。 | |
90 | ++ 修复了上传文件夹功能在Safari浏览器中无法正常使用的问题。 | |
91 | ++ 修复了一些情况下快捷键会失效或出现功能异常的问题。 | |
92 | ++ 其他一些安全性和稳定性优化。 | |
87 | 93 | |
88 | 94 | > 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html |
89 | 95 | ... | ... |
kiftd-1.0.29-RELEASE.jar
renamed from
kiftd-1.0.28-RELEASE.jar
不能预览此文件类型
不能预览此文件类型
... | ... | @@ -74,4 +74,15 @@ |
74 | 74 | #{folderId,jdbcType=VARCHAR} |
75 | 75 | </update> |
76 | 76 | |
77 | + <update id="update" parameterType="kohgylw.kiftd.server.model.Folder"> | |
78 | + UPDATE FOLDER SET folder_name | |
79 | + = | |
80 | + #{folderName,jdbcType=VARCHAR},folder_creation_date = | |
81 | + #{folderCreationDate,jdbcType=VARCHAR},folder_creator = | |
82 | + #{folderCreator,jdbcType=VARCHAR},folder_parent = | |
83 | + #{folderParent,jdbcType=VARCHAR},folder_constraint = | |
84 | + #{folderConstraint,jdbcType=INTEGER} WHERE folder_id = | |
85 | + #{folderId,jdbcType=VARCHAR} | |
86 | + </update> | |
87 | + | |
77 | 88 | </mapper> |
78 | 89 | \ No newline at end of file | ... | ... |
... | ... | @@ -73,7 +73,14 @@ |
73 | 73 | <select id="queryByPath" parameterType="java.lang.String" |
74 | 74 | resultMap="BaseResultMap"> |
75 | 75 | SELECT * FROM FILE WHERE file_path = |
76 | - #{path,jdbcType=VARCHAR} | |
76 | + #{path,jdbcType=VARCHAR} LIMIT 0,2147483647 | |
77 | + </select> | |
78 | + | |
79 | + <select id="queryByPathExcludeById" parameterType="java.util.Map" | |
80 | + resultMap="BaseResultMap"> | |
81 | + SELECT * FROM FILE WHERE file_path = | |
82 | + #{path,jdbcType=VARCHAR} AND file_id <> | |
83 | + #{fileId,jdbcType=VARCHAR} LIMIT 0,2147483647 | |
77 | 84 | </select> |
78 | 85 | |
79 | 86 | <select id="queryBySomeFolder" parameterType="java.lang.String" |
... | ... | @@ -84,10 +91,4 @@ |
84 | 91 | #{fileId,jdbcType=VARCHAR}) LIMIT 0,2147483647 |
85 | 92 | </select> |
86 | 93 | |
87 | - <update id="moveById" parameterType="java.util.Map"> | |
88 | - UPDATE FILE SET | |
89 | - file_parent_folder = #{locationpath,jdbcType=VARCHAR} WHERE file_id = | |
90 | - #{fileId,jdbcType=VARCHAR} | |
91 | - </update> | |
92 | - | |
93 | 94 | </mapper> |
94 | 95 | \ No newline at end of file | ... | ... |
1 | 1 | <!doctype html> |
2 | -<!-- 青阳网络文件传输系统 kiftd v1.0.28-RELEASE --> | |
2 | +<!-- 青阳网络文件传输系统 kiftd v1.0.29-RELEASE --> | |
3 | 3 | <!-- 欢迎访问主界面 --> |
4 | 4 | <!-- by 青阳龙野(kohgylw@163.com) --> |
5 | 5 | <html> |
... | ... | @@ -101,22 +101,31 @@ |
101 | 101 | class="glyphicon glyphicon-cog"></span> 操作 <span |
102 | 102 | class="caret"></span></a> |
103 | 103 | <ul class="dropdown-menu" id="fileListDropDown"> |
104 | - <li id="uploadFileButtonLi"><a>上传文件 <span | |
104 | + <li id="uploadFileButtonLi"><a href="javascript:void(0);">上传文件 <span | |
105 | 105 | class="pull-right"><span |
106 | 106 | class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+U</span></a></li> |
107 | - <li id="uploadFolderButtonLi"><a>上传文件夹 <span | |
107 | + <li id="uploadFolderButtonLi"><a href="javascript:void(0);">上传文件夹 <span | |
108 | 108 | class="pull-right"><span |
109 | 109 | class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+F</span></a></li> |
110 | 110 | <li role="separator" class="divider"></li> |
111 | - <li id="createFolderButtonLi"><a>新建文件夹 <span | |
111 | + <li id="createFolderButtonLi"><a href="javascript:void(0);">新建文件夹 <span | |
112 | 112 | class="pull-right"><span |
113 | 113 | class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+N</span></a></li> |
114 | 114 | <li role="separator" class="divider"></li> |
115 | - <li id="cutFileButtonLi"><a><span id='cutSignTx'>剪切 | |
115 | + <li id="copyFileButtonLi"><a href="javascript:void(0);"><span id='copySignTx'>复制 | |
116 | 116 | <span class="pull-right"><span |
117 | 117 | class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+C</span> |
118 | 118 | </span></a></li> |
119 | - <li id="deleteSeelectFileButtonLi"><a>删除 <span | |
119 | + <li id="cutFileButtonLi"><a href="javascript:void(0);"><span id='cutSignTx'>剪切 | |
120 | + <span class="pull-right"><span | |
121 | + class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+X</span> | |
122 | + </span></a></li> | |
123 | + <li id="stickFileButtonLi" class="hidden"><a href="javascript:void(0);"><span | |
124 | + id='stickSignTx'>粘贴<span id="stickFilesCount"></span> | |
125 | + <span class="pull-right"><span | |
126 | + class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+V</span> | |
127 | + </span></a></li> | |
128 | + <li id="deleteSeelectFileButtonLi"><a href="javascript:void(0);">删除 <span | |
120 | 129 | class="pull-right"><span |
121 | 130 | class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+D</span></a></li> |
122 | 131 | </ul></li> |
... | ... | @@ -284,7 +293,7 @@ |
284 | 293 | <h5 id="deleteFolderMessage"></h5> |
285 | 294 | </div> |
286 | 295 | <div class="modal-footer"> |
287 | - <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
296 | + <button id="cancelDeleteFolderBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
288 | 297 | <span id="deleteFolderBox"></span> |
289 | 298 | </div> |
290 | 299 | </div> |
... | ... | @@ -443,7 +452,8 @@ |
443 | 452 | </div> |
444 | 453 | </div> |
445 | 454 | <input type="file" id="importfolder" style="display: none;" |
446 | - onchange="getInputImport()" multiple="multiple" webkitdirectory> | |
455 | + onchange="getInputImport()" multiple="multiple" | |
456 | + webkitdirectory="true"> | |
447 | 457 | <h5> |
448 | 458 | 上传进度:<span id="importcount"></span> |
449 | 459 | </h5> |
... | ... | @@ -535,7 +545,7 @@ |
535 | 545 | <h5 id="deleteFileMessage" class="wordbreak"></h5> |
536 | 546 | </div> |
537 | 547 | <div class="modal-footer"> |
538 | - <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
548 | + <button id="cancelDeleteFileBox" type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
539 | 549 | <span id="deleteFileBox"></span> |
540 | 550 | </div> |
541 | 551 | </div> |
... | ... | @@ -599,7 +609,7 @@ |
599 | 609 | </h5> |
600 | 610 | </div> |
601 | 611 | <div class="modal-footer"> |
602 | - <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
612 | + <button id="cancelDownloadAllCheckedBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
603 | 613 | <span id="downloadAllCheckedBox"></span> |
604 | 614 | </div> |
605 | 615 | </div> |
... | ... | @@ -688,7 +698,7 @@ |
688 | 698 | </div> |
689 | 699 | </div> |
690 | 700 | <div class="modal-footer"> |
691 | - <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
701 | + <button id="cancelMoveFilesBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button> | |
692 | 702 | <span id="moveFilesBox"></span> |
693 | 703 | </div> |
694 | 704 | </div> | ... | ... |
... | ... | @@ -12,11 +12,15 @@ var originFolderView;// 靽辣閫撖寡情 |
12 | 12 | var fs;// 葉辣” |
13 | 13 | var ifs;// 葉辣憭孵辣” |
14 | 14 | var checkedMovefiles;// 蝘餃辣” |
15 | +var isCopy;// 蝘餃辣銝箏璅∪嚗 | |
16 | +var repeMap;// 蝘餃辣嚗撖寞葵蝒★ | |
17 | +var strMoveOptMap;// 蝘餃嚗嚗紡辣蝒★ | |
18 | +var mRepeSize;// 蝘餃嚗嚗紡辣蝒★ | |
15 | 19 | var constraintLevel;// 敶辣憭寥蝑漣 |
16 | 20 | var account;// 韐行 |
17 | -var isUpLoading=false;// 甇銵 | |
18 | -var isImporting=false;// 甇銵辣憭寞 | |
19 | -var isChangingPassword=false;// 甇銵耨撖 | |
21 | +var isUpLoading = false;// 甇銵 | |
22 | +var isImporting = false;// 甇銵辣憭寞 | |
23 | +var isChangingPassword = false;// 甇銵耨撖 | |
20 | 24 | var importFolderName;// 銝辣憭寞靽辣憭孵妍 |
21 | 25 | var xhr;// 辣辣憭嫣窈瘙笆鞊 |
22 | 26 | var viewerPageSize = 15; // 蝷箏△憭折摨佗釣憟賣憟 |
... | ... | @@ -24,10 +28,10 @@ var viewer; // viewer撖寡情嚗鈭 |
24 | 28 | var viewerPageIndex; // △憸歇瘚△ |
25 | 29 | var viewerTotal; // △憸駁△ |
26 | 30 | var pvl;// 憸”SON撘笆鞊 |
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>嚗葉/葉辣";// 辣內 | |
31 | +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 | 32 | var winHeight;// 蝒擃漲 |
29 | 33 | var pingInt;// 摰摨鋆蔭 |
30 | -var noticeInited=false;// 縑d5 | |
34 | +var noticeInited = false;// 縑d5 | |
31 | 35 | var loadingComplete;// 辣憭寡蝸摰 |
32 | 36 | var totalFoldersOffset;// 霈啣辣憭孵霂W宏噶鈭恣蝞蝸餈漲 |
33 | 37 | var totalFilesOffset;// 霈啣辣霂W宏噶鈭恣蝞蝸餈漲 |
... | ... | @@ -37,20 +41,20 @@ var loadingFolderView;// 甇蝸辣憭寡嚗 |
37 | 41 | // 瘜 |
38 | 42 | // 憿菟 |
39 | 43 | $(function() { |
40 | - window.onresize = function(){ | |
44 | + window.onresize = function() { | |
41 | 45 | changeFilesTableStyle(); |
42 | 46 | updateWinHeight(); |
43 | - } | |
47 | + } | |
44 | 48 | changeFilesTableStyle(); |
45 | 49 | getServerOS();// 敺頂蝏縑 |
46 | 50 | subscribeNotice();// 蝸D5嚗誑閬蝷箸 |
47 | 51 | // 霂X摮霈啣楝敺蝷箄扇敹楝敺捆嚗蝷摧OOT頝臬 |
48 | 52 | var arr = document.cookie.match(new RegExp("(^| )folder_id=([^;]*)(;|$)")); |
49 | - if (arr != null){ | |
50 | - showFolderView(unescape(arr[2]));// 蝷箄扇敹楝敺△閫 | |
51 | - }else{ | |
52 | - showFolderView("root");// 蝷箸憿菟閫 | |
53 | - } | |
53 | + if (arr != null) { | |
54 | + showFolderView(unescape(arr[2]));// 蝷箄扇敹楝敺△閫 | |
55 | + } else { | |
56 | + showFolderView("root");// 蝷箸憿菟閫 | |
57 | + } | |
54 | 58 | // 蝛箇憭葉辣嚗歇撠摰寧窈末雿踹嚗 |
55 | 59 | $(document).click(function(e) { |
56 | 60 | var filetable = $("#filetable")[0]; |
... | ... | @@ -68,20 +72,20 @@ $(function() { |
68 | 72 | ap.seek(0); |
69 | 73 | ap.pause(); |
70 | 74 | } |
71 | - if(pingInt != null){ | |
75 | + if (pingInt != null) { | |
72 | 76 | window.clearInterval(pingInt); |
73 | 77 | pingInt = null; |
74 | 78 | } |
75 | 79 | }); |
76 | 80 | // 蝸璅⊥迫霈⊥ |
77 | 81 | $('#downloadAllCheckedModal').on('hidden.bs.modal', function(e) { |
78 | - if(zipTimer!=null){ | |
82 | + if (zipTimer != null) { | |
79 | 83 | window.clearInterval(zipTimer); |
80 | 84 | } |
81 | 85 | }); |
82 | 86 | // 芋皜征颲 |
83 | 87 | $('#loginModal').on('hidden.bs.modal', function(e) { |
84 | - if($("#dologinButton").attr('disabled') !== 'disabled'){ | |
88 | + if ($("#dologinButton").attr('disabled') !== 'disabled') { | |
85 | 89 | $("#accountid").val(''); |
86 | 90 | $("#accountpwd").val(''); |
87 | 91 | } |
... | ... | @@ -103,12 +107,12 @@ $(function() { |
103 | 107 | }); |
104 | 108 | $("body").keypress(function(e) { |
105 | 109 | var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode; |
106 | - if(keyCode == 13) { | |
107 | - if("sreachKeyWordIn"===document.activeElement.id){ | |
110 | + if (keyCode == 13) { | |
111 | + if ("sreachKeyWordIn" === document.activeElement.id) { | |
108 | 112 | doSearchFile(); |
109 | - }else{ | |
110 | - var g=$(".shown .btn-primary"); | |
111 | - if(g.get(0)!=null){ | |
113 | + } else { | |
114 | + var g = $(".shown .btn-primary"); | |
115 | + if (g.get(0) != null && g.prop("disabled") == false) { | |
112 | 116 | g.click(); |
113 | 117 | } |
114 | 118 | } |
... | ... | @@ -120,194 +124,231 @@ $(function() { |
120 | 124 | $("#accountid").focus(); |
121 | 125 | }); |
122 | 126 | // 撘撱箸辣憭寞 |
123 | - $('#newFolderModal').on('show.bs.modal', function(e) { | |
124 | - $("#folderalert").removeClass("alert"); | |
125 | - $("#folderalert").removeClass("alert-danger"); | |
126 | - $("#foldernamebox").removeClass("has-error"); | |
127 | - $("#folderalert").text(""); | |
128 | - $("#foldername").val(""); | |
129 | - $("#foldertypelist").html(""); | |
130 | - if(account!=null){ | |
131 | - $("#foldername").attr("folderConstraintLevel",constraintLevel+""); | |
132 | - $("#newfoldertype").text(folderTypes[constraintLevel]); | |
133 | - for(var i=constraintLevel;i<folderTypes.length;i++){ | |
134 | - $("#foldertypelist").append("<li><a onclick='changeNewFolderType("+i+")'>"+folderTypes[i]+"</a></li>"); | |
135 | - } | |
136 | - }else{ | |
137 | - $("#foldertypelist").append("<li><a onclick='changeNewFolderType(0)'>"+folderTypes[0]+"</a></li>"); | |
138 | - } | |
139 | - }); | |
127 | + $('#newFolderModal') | |
128 | + .on( | |
129 | + 'show.bs.modal', | |
130 | + function(e) { | |
131 | + $("#folderalert").removeClass("alert"); | |
132 | + $("#folderalert").removeClass("alert-danger"); | |
133 | + $("#foldernamebox").removeClass("has-error"); | |
134 | + $("#folderalert").text(""); | |
135 | + $("#foldername").val(""); | |
136 | + $("#foldertypelist").html(""); | |
137 | + if (account != null) { | |
138 | + $("#foldername").attr("folderConstraintLevel", | |
139 | + constraintLevel + ""); | |
140 | + $("#newfoldertype").text( | |
141 | + folderTypes[constraintLevel]); | |
142 | + for (var i = constraintLevel; i < folderTypes.length; i++) { | |
143 | + $("#foldertypelist").append( | |
144 | + "<li><a onclick='changeNewFolderType(" | |
145 | + + i + ")'>" + folderTypes[i] | |
146 | + + "</a></li>"); | |
147 | + } | |
148 | + } else { | |
149 | + $("#foldertypelist").append( | |
150 | + "<li><a onclick='changeNewFolderType(0)'>" | |
151 | + + folderTypes[0] + "</a></li>"); | |
152 | + } | |
153 | + }); | |
140 | 154 | // 撘撱箸辣憭寞芋辣獢 |
141 | 155 | $('#newFolderModal').on('shown.bs.modal', function(e) { |
142 | 156 | $("#foldername").focus(); |
143 | 157 | }); |
144 | 158 | // 銝芋內憒漲 |
145 | 159 | $('#uploadFileModal,#importFolderModal').on('hidden.bs.modal', function(e) { |
146 | - if(isUpLoading || isImporting){ | |
160 | + if (isUpLoading || isImporting) { | |
147 | 161 | $('#operationMenuBox').attr("data-placement", "top"); |
148 | 162 | $('#operationMenuBox').attr("data-trigger", "focus"); |
149 | 163 | $('#operationMenuBox').attr("data-title", "銝葉"); |
150 | 164 | $('#operationMenuBox').attr("data-content", "隞仿銝漲"); |
151 | 165 | $('#operationMenuBox').popover(); |
152 | 166 | $('#operationMenuBox').popover('show'); |
153 | - // 2蝘仃內獢 | |
154 | - var closeUploadTips = setTimeout( | |
155 | - function () { | |
156 | - $('#operationMenuBox').attr("data-title", ""); | |
157 | - $('#operationMenuBox').attr("data-content", ""); | |
158 | - $('#operationMenuBox').popover('destroy'); | |
159 | - }, 2000 | |
160 | - ); | |
167 | + // 2蝘仃內獢 | |
168 | + var closeUploadTips = setTimeout(function() { | |
169 | + $('#operationMenuBox').attr("data-title", ""); | |
170 | + $('#operationMenuBox').attr("data-content", ""); | |
171 | + $('#operationMenuBox').popover('destroy'); | |
172 | + }, 2000); | |
161 | 173 | } |
162 | 174 | }); |
163 | 175 | // 撘蝻辣憭寞 |
164 | - $('#renameFolderModal').on('show.bs.modal', function(e) { | |
165 | - $("#editfolderalert").removeClass("alert"); | |
166 | - $("#editfolderalert").removeClass("alert-danger"); | |
167 | - $("#folderrenamebox").removeClass("has-error"); | |
168 | - $("#editfolderalert").text(""); | |
169 | - $("#editfoldertypelist").html(""); | |
170 | - if(account!=null){ | |
171 | - for(var i=constraintLevel;i<folderTypes.length;i++){ | |
172 | - $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType("+i+")'>"+folderTypes[i]+"</a></li>"); | |
173 | - } | |
174 | - }else{ | |
175 | - $("#editfoldertypelist").append("<li><a onclick='changeEditFolderType(0)'>"+folderTypes[0]+"</a></li>"); | |
176 | - } | |
177 | - }); | |
176 | + $('#renameFolderModal') | |
177 | + .on( | |
178 | + 'show.bs.modal', | |
179 | + function(e) { | |
180 | + $("#editfolderalert").removeClass("alert"); | |
181 | + $("#editfolderalert").removeClass("alert-danger"); | |
182 | + $("#folderrenamebox").removeClass("has-error"); | |
183 | + $("#editfolderalert").text(""); | |
184 | + $("#editfoldertypelist").html(""); | |
185 | + if (account != null) { | |
186 | + for (var i = constraintLevel; i < folderTypes.length; i++) { | |
187 | + $("#editfoldertypelist").append( | |
188 | + "<li><a onclick='changeEditFolderType(" | |
189 | + + i + ")'>" + folderTypes[i] | |
190 | + + "</a></li>"); | |
191 | + } | |
192 | + } else { | |
193 | + $("#editfoldertypelist").append( | |
194 | + "<li><a onclick='changeEditFolderType(0)'>" | |
195 | + + folderTypes[0] + "</a></li>"); | |
196 | + } | |
197 | + }); | |
178 | 198 | // 銝辣 |
179 | 199 | document.ondragover = function(e) { |
180 | - if(e.preventDefault){ | |
200 | + if (e.preventDefault) { | |
181 | 201 | e.preventDefault(); |
182 | 202 | e.stopPropagation(); |
183 | - }else{ | |
184 | - window.event.cancelBubble=true; | |
185 | - window.event.returnValue=false; | |
203 | + } else { | |
204 | + window.event.cancelBubble = true; | |
205 | + window.event.returnValue = false; | |
186 | 206 | } |
187 | 207 | } |
188 | 208 | document.ondrop = function(e) { |
189 | - if(e.preventDefault){ | |
209 | + if (e.preventDefault) { | |
190 | 210 | e.preventDefault(); |
191 | 211 | e.stopPropagation(); |
192 | - }else{ | |
193 | - window.event.cancelBubble=true; | |
194 | - window.event.returnValue=false; | |
212 | + } else { | |
213 | + window.event.cancelBubble = true; | |
214 | + window.event.returnValue = false; | |
195 | 215 | } |
196 | 216 | if (folderView.authList != null) { |
197 | 217 | if (checkAuth(folderView.authList, "U")) {// 憒餈隞 |
198 | - if(isUpLoading || isImporting){ | |
199 | - alert("內嚗甇銵銝憿嫣遙嚗窈銝"); | |
200 | - }else{ | |
201 | - if (!(window.ActiveXObject||"ActiveXObject" in window)){// 銝截E | |
218 | + if (isUpLoading || isImporting) { | |
219 | + alert("內嚗甇銵銝憿嫣遙嚗窈銝"); | |
220 | + } else { | |
221 | + if (!(window.ActiveXObject || "ActiveXObject" in window)) {// 銝截E | |
202 | 222 | var dt; |
203 | - if(e.dataTransfer != null){ | |
223 | + if (e.dataTransfer != null) { | |
204 | 224 | dt = e.dataTransfer; // 銝辣撖寡情 |
205 | - }else{ | |
225 | + } else { | |
206 | 226 | dt = window.event.dataTransfer; |
207 | 227 | } |
208 | - var testFile=true; | |
209 | - if(dt.items!==undefined){ | |
210 | - for(var i=0;i<dt.items.length;i++){ | |
228 | + var testFile = true; | |
229 | + if (dt.items !== undefined) { | |
230 | + for (var i = 0; i < dt.items.length; i++) { | |
211 | 231 | var item = dt.items[i]; |
212 | - if(item.kind === "file" && item.webkitGetAsEntry().isFile) { | |
213 | - | |
214 | - }else{ | |
215 | - testFile=false; | |
232 | + if (item.kind === "file" | |
233 | + && item.webkitGetAsEntry().isFile) { | |
234 | + | |
235 | + } else { | |
236 | + testFile = false; | |
237 | + } | |
238 | + } | |
239 | + } else { | |
240 | + for (var i = 0; i < dt.files.length; i++) { | |
241 | + var dropFile = df.files[i]; | |
242 | + if (dropFile.type) { | |
243 | + | |
244 | + } else { | |
245 | + try { | |
246 | + var fileReader = new FileReader(); | |
247 | + fileReader.readAsDataURL(dropFile | |
248 | + .slice(0, 10)); | |
249 | + fileReader.addEventListener('load', | |
250 | + function(e) { | |
251 | + | |
252 | + }, false); | |
253 | + fileReader.addEventListener('error', | |
254 | + function(e) { | |
255 | + testFile = false; | |
256 | + }, false); | |
257 | + } catch (e) { | |
258 | + testFile = false; | |
259 | + } | |
216 | 260 | } |
217 | 261 | } |
218 | - }else{ | |
219 | - for(var i = 0; i < dt.files.length; i++){ | |
220 | - var dropFile = df.files[i]; | |
221 | - if ( dropFile.type ) { | |
222 | - | |
223 | - } else { | |
224 | - try { | |
225 | - var fileReader = new FileReader(); | |
226 | - fileReader.readAsDataURL(dropFile.slice(0, 10)); | |
227 | - fileReader.addEventListener('load', function (e) { | |
228 | - | |
229 | - }, false); | |
230 | - fileReader.addEventListener('error', function (e) { | |
231 | - testFile=false; | |
232 | - }, false); | |
233 | - } catch (e) { | |
234 | - testFile=false; | |
235 | - } | |
236 | - } | |
237 | - } | |
238 | 262 | } |
239 | - if(testFile){ | |
263 | + if (testFile) { | |
240 | 264 | fs = e.dataTransfer.files; // 銝辣撖寡情 |
241 | 265 | showUploadFileModel(); |
242 | 266 | showfilepath(); |
243 | 267 | checkUploadFile(); |
244 | - }else{ | |
268 | + } else { | |
245 | 269 | alert("內嚗辣銝剖鈭銝芣葵辣憭對"); |
246 | 270 | } |
247 | - }else{ | |
271 | + } else { | |
248 | 272 | alert("內嚗E瘚銝銝隞乩蝙隞芋撘銝算芋撘雿砲"); |
249 | 273 | } |
250 | 274 | } |
251 | - }else{ | |
275 | + } else { | |
252 | 276 | alert("內嚗銝憭辣"); |
253 | 277 | } |
254 | - }else{ | |
278 | + } else { | |
255 | 279 | alert("內嚗銝憭辣"); |
256 | 280 | } |
257 | 281 | } |
258 | - // Shift+A辣/辣嚗hift+N撱箸辣憭對hift+U銝辣嚗hift+F撖澆辣憭對hift+C&V斐嚗hift+D | |
259 | - $(document).keypress(function (e) { | |
260 | - if($('.modal.shown').length == 0 || ($('.modal.shown').length == 1 && $('.modal.shown').attr('id') == 'loadingModal')){ | |
261 | - var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode; | |
262 | - if (isShift(e) && document.activeElement.id != "sreachKeyWordIn") { | |
263 | - switch (keyCode) { | |
264 | - case 65: | |
265 | - checkallfile(); | |
266 | - break; | |
267 | - case 78: | |
268 | - $('#createFolderButtonLi a').click(); | |
269 | - break; | |
270 | - case 85: | |
271 | - $('#uploadFileButtonLi a').click(); | |
272 | - break; | |
273 | - case 68: | |
274 | - $('#deleteSeelectFileButtonLi a').click(); | |
275 | - break; | |
276 | - case 70: | |
277 | - $('#uploadFolderButtonLi a').click(); | |
278 | - break; | |
279 | - case 67: | |
280 | - if((!$("#cutSignTx").hasClass("cuted"))&&checkedMovefiles==undefined){ | |
281 | - $('#cutFileButtonLi a').click(); | |
282 | - } | |
283 | - break; | |
284 | - case 86: | |
285 | - if($("#cutSignTx").hasClass("cuted")&&checkedMovefiles!==undefined){ | |
286 | - $('#cutFileButtonLi a').click(); | |
282 | + // 翰蝏 | |
283 | + $(document).keypress( | |
284 | + function(e) { | |
285 | + if ($('.modal.shown').length == 0 | |
286 | + || ($('.modal.shown').length == 1 && $('.modal.shown') | |
287 | + .attr('id') == 'loadingModal')) { | |
288 | + var keyCode = e.keyCode ? e.keyCode : e.which ? e.which | |
289 | + : e.charCode; | |
290 | + if (isShift(e) | |
291 | + && document.activeElement.id != "sreachKeyWordIn") {// hift銝色 | |
292 | + switch (keyCode) { | |
293 | + case 65:// shift+a | |
294 | + checkallfile(); | |
295 | + break; | |
296 | + case 78:// shift+n 撱箸辣憭 | |
297 | + $('#createFolderButtonLi a').click(); | |
298 | + break; | |
299 | + case 85:// shift+u 銝辣 | |
300 | + $('#uploadFileButtonLi a').click(); | |
301 | + break; | |
302 | + case 68:// shift+d | |
303 | + $('#deleteSeelectFileButtonLi a').click(); | |
304 | + break; | |
305 | + case 70:// shift+f 銝辣憭 | |
306 | + $('#uploadFolderButtonLi a').click(); | |
307 | + break; | |
308 | + case 67:// shift+c 憭 | |
309 | + if (checkedMovefiles == undefined | |
310 | + || checkedMovefiles.size == 0) { | |
311 | + $('#copyFileButtonLi a').click(); | |
312 | + } | |
313 | + break; | |
314 | + case 88:// shift+x | |
315 | + if (checkedMovefiles == undefined | |
316 | + || checkedMovefiles.size == 0) { | |
317 | + $('#cutFileButtonLi a').click(); | |
318 | + } | |
319 | + break; | |
320 | + case 86:// shift+v 蝎斐 | |
321 | + if (checkedMovefiles !== undefined | |
322 | + && checkedMovefiles.size > 0) { | |
323 | + $('#stickFileButtonLi a').click(); | |
324 | + } | |
325 | + break; | |
326 | + default: | |
327 | + return true; | |
328 | + } | |
329 | + return false; | |
287 | 330 | } |
288 | - break; | |
289 | - | |
290 | - default: | |
291 | - return true; | |
292 | 331 | } |
293 | - return false; | |
294 | - } | |
295 | - } | |
296 | - }); | |
332 | + }); | |
297 | 333 | // 蝘餃內獢宏 |
298 | 334 | $('#moveFilesModal').on('hidden.bs.modal', function(e) { |
299 | - checkedMovefiles=undefined; | |
300 | - $("#cutSignTx").html(" <span class='pull-right'><span class='glyphicon glyphicon-arrow-up' aria-hidden='true'></span>+C</span>"); | |
301 | - $("#cutSignTx").removeClass("cuted"); | |
335 | + checkedMovefiles = undefined; | |
336 | + $("#copyFileButtonLi").removeClass("hidden"); | |
337 | + $("#copyFileButtonLi").addClass("show"); | |
338 | + $("#cutFileButtonLi").removeClass("hidden"); | |
339 | + $("#cutFileButtonLi").addClass("show"); | |
340 | + $("#stickFileButtonLi").removeClass("show"); | |
341 | + $("#stickFileButtonLi").addClass("hidden"); | |
342 | + $("#stickFilesCount").text(""); | |
302 | 343 | $('#moveFilesBox').html(""); |
303 | 344 | }); |
304 | 345 | // IE瘚tartsWith瘜摰 |
305 | - if(typeof String.prototype.startsWith != 'function') { | |
346 | + if (typeof String.prototype.startsWith != 'function') { | |
306 | 347 | String.prototype.startsWith = function(prefix) { |
307 | 348 | return this.slice(0, prefix.length) === prefix; |
308 | 349 | }; |
309 | 350 | } |
310 | - if(typeof String.prototype.endsWith != 'function') { | |
351 | + if (typeof String.prototype.endsWith != 'function') { | |
311 | 352 | String.prototype.endsWith = function(suffix) { |
312 | 353 | return this.indexOf(suffix, this.length - suffix.length) !== -1; |
313 | 354 | }; |
... | ... | @@ -319,94 +360,119 @@ $(function() { |
319 | 360 | // 擃漲 |
320 | 361 | updateWinHeight(); |
321 | 362 | // 撅漲蝷箝▲ |
322 | - $(window).scroll(function(){ | |
323 | - if($(this).scrollTop() > 2*winHeight){ | |
363 | + $(window).scroll(function() { | |
364 | + if ($(this).scrollTop() > 2 * winHeight) { | |
324 | 365 | $('#gobacktotopbox').removeClass("hidden"); |
325 | - }else{ | |
366 | + } else { | |
326 | 367 | $('#gobacktotopbox').addClass("hidden"); |
327 | 368 | } |
328 | 369 | }); |
329 | - | |
370 | + | |
330 | 371 | // 蝸嚗/蝸 |
331 | - $('#downloadURLCollapse').on('shown.bs.collapse', function () { | |
372 | + $('#downloadURLCollapse').on('shown.bs.collapse', function() { | |
332 | 373 | getDownloadURL(); |
333 | 374 | }); |
334 | - | |
375 | + | |
335 | 376 | // 撘靽格撖芋 |
336 | - $('#changePasswordModal').on('show.bs.modal', function(e) { | |
337 | - if(!isChangingPassword){ | |
338 | - $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode").attr('disabled', false); | |
339 | - $("#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox").removeClass("has-error"); | |
340 | - $("#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd").val(""); | |
341 | - $("#changepasswordalertbox,#changepassword_vccodebox").hide(); | |
342 | - } | |
343 | - }); | |
377 | + $('#changePasswordModal') | |
378 | + .on( | |
379 | + 'show.bs.modal', | |
380 | + function(e) { | |
381 | + if (!isChangingPassword) { | |
382 | + $( | |
383 | + "#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd,#changePasswordButton,#changepassword_vercode") | |
384 | + .attr('disabled', false); | |
385 | + $( | |
386 | + "#changepassword_oldepwdbox,#changepassword_newpwdbox,#changepassword_reqnewpwdbox") | |
387 | + .removeClass("has-error"); | |
388 | + $( | |
389 | + "#changepassword_oldpwd,#changepassword_newpwd,#changepassword_reqnewpwd") | |
390 | + .val(""); | |
391 | + $( | |
392 | + "#changepasswordalertbox,#changepassword_vccodebox") | |
393 | + .hide(); | |
394 | + } | |
395 | + }); | |
344 | 396 | // 撟嗉撖獢 |
345 | 397 | $('#changePasswordModal').on('shown.bs.modal', function(e) { |
346 | - if(!isChangingPassword){ | |
398 | + if (!isChangingPassword) { | |
347 | 399 | $("#changepassword_oldpwd").focus(); |
348 | 400 | } |
349 | 401 | }); |
350 | 402 | // 撘縑璅⊥撌脩30憭拐蝷算 |
351 | - $('#noticeModal').on('show.bs.modal', function(e) { | |
352 | - var cookieMd530 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")); | |
353 | - if(cookieMd530){ | |
354 | - $("#dontShowSomeNoticeAt30Day").attr("checked","checked"); | |
355 | - }else{ | |
356 | - $("#dontShowSomeNoticeAt30Day").attr("checked",false); | |
357 | - } | |
358 | - }); | |
403 | + $('#noticeModal').on( | |
404 | + 'show.bs.modal', | |
405 | + function(e) { | |
406 | + var cookieMd530 = document.cookie.match(new RegExp( | |
407 | + "(^| )notice_md5_30=([^;]*)(;|$)")); | |
408 | + if (cookieMd530) { | |
409 | + $("#dontShowSomeNoticeAt30Day").attr("checked", "checked"); | |
410 | + } else { | |
411 | + $("#dontShowSomeNoticeAt30Day").attr("checked", false); | |
412 | + } | |
413 | + }); | |
359 | 414 | // 縑璅⊥撌脩30憭拐蝷算挽蝵宮ookie |
360 | - $('#noticeModal').on('hidden.bs.modal', function(e) { | |
361 | - var noticed = new Date(); | |
362 | - if($("#dontShowSomeNoticeAt30Day").prop("checked")){ | |
363 | - noticed.setTime(noticed.getTime() + (30*24*60*60*1000)); | |
364 | - var cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5=([^;]*)(;|$)")); | |
365 | - if(cookieMd5){ | |
366 | - document.cookie = "notice_md5_30=" + escape(unescape(cookieMd5[2])) + ";expires=" + noticed.toUTCString(); | |
367 | - }else{ | |
368 | - cookieMd5 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")); | |
369 | - if(cookieMd5){ | |
370 | - document.cookie = "notice_md5_30=" + escape(unescape(cookieMd5[2])) + ";expires=" + noticed.toUTCString(); | |
415 | + $('#noticeModal').on( | |
416 | + 'hidden.bs.modal', | |
417 | + function(e) { | |
418 | + var noticed = new Date(); | |
419 | + if ($("#dontShowSomeNoticeAt30Day").prop("checked")) { | |
420 | + noticed.setTime(noticed.getTime() | |
421 | + + (30 * 24 * 60 * 60 * 1000)); | |
422 | + var cookieMd5 = document.cookie.match(new RegExp( | |
423 | + "(^| )notice_md5=([^;]*)(;|$)")); | |
424 | + if (cookieMd5) { | |
425 | + document.cookie = "notice_md5_30=" | |
426 | + + escape(unescape(cookieMd5[2])) + ";expires=" | |
427 | + + noticed.toUTCString(); | |
428 | + } else { | |
429 | + cookieMd5 = document.cookie.match(new RegExp( | |
430 | + "(^| )notice_md5_30=([^;]*)(;|$)")); | |
431 | + if (cookieMd5) { | |
432 | + document.cookie = "notice_md5_30=" | |
433 | + + escape(unescape(cookieMd5[2])) | |
434 | + + ";expires=" + noticed.toUTCString(); | |
435 | + } | |
436 | + } | |
437 | + } else { | |
438 | + noticed.setTime(0); | |
439 | + var cookieMd530 = document.cookie.match(new RegExp( | |
440 | + "(^| )notice_md5_30=([^;]*)(;|$)")); | |
441 | + if (cookieMd530) { | |
442 | + document.cookie = "notice_md5_30=0;expires=" | |
443 | + + noticed.toUTCString(); | |
444 | + } | |
371 | 445 | } |
372 | - } | |
373 | - }else{ | |
374 | - noticed.setTime(0); | |
375 | - var cookieMd530 = document.cookie.match(new RegExp("(^| )notice_md5_30=([^;]*)(;|$)")); | |
376 | - if(cookieMd530){ | |
377 | - document.cookie = "notice_md5_30=0;expires=" + noticed.toUTCString(); | |
378 | - } | |
379 | - } | |
380 | - }); | |
446 | + }); | |
381 | 447 | }); |
382 | 448 | |
383 | 449 | // 憿菟擃漲 |
384 | -function updateWinHeight(){ | |
385 | - if (window.innerHeight){ | |
450 | +function updateWinHeight() { | |
451 | + if (window.innerHeight) { | |
386 | 452 | winHeight = window.innerHeight; |
387 | - }else if ((document.body) && (document.body.clientHeight)){ | |
453 | + } else if ((document.body) && (document.body.clientHeight)) { | |
388 | 454 | winHeight = document.body.clientHeight; |
389 | 455 | } |
390 | 456 | } |
391 | 457 | |
392 | 458 | // 撅之撠”蝷箏捆 |
393 | -function changeFilesTableStyle(){ | |
459 | +function changeFilesTableStyle() { | |
394 | 460 | var win = $(window).width(); |
395 | - if(win < 768){ | |
396 | - $('#filetableheadera').addClass('filetableheaderstyle'); | |
397 | - $('#filetableheadera').attr('data-toggle','collapse'); | |
398 | - $('#filetableheadera').attr('data-target','#filetableoptmenu'); | |
399 | - $('#mdropdownicon').html('嚗撅/'); | |
400 | - }else{ | |
401 | - $('#filetableheadera').removeClass('filetableheaderstyle'); | |
402 | - $('#filetableheadera').attr('data-toggle','modal'); | |
403 | - $('#filetableheadera').attr('data-target','#folderInfoModal'); | |
404 | - $('#mdropdownicon').html(''); | |
405 | - } | |
461 | + if (win < 768) { | |
462 | + $('#filetableheadera').addClass('filetableheaderstyle'); | |
463 | + $('#filetableheadera').attr('data-toggle', 'collapse'); | |
464 | + $('#filetableheadera').attr('data-target', '#filetableoptmenu'); | |
465 | + $('#mdropdownicon').html('嚗撅/'); | |
466 | + } else { | |
467 | + $('#filetableheadera').removeClass('filetableheaderstyle'); | |
468 | + $('#filetableheadera').attr('data-toggle', 'modal'); | |
469 | + $('#filetableheadera').attr('data-target', '#folderInfoModal'); | |
470 | + $('#mdropdownicon').html(''); | |
471 | + } | |
406 | 472 | } |
407 | 473 | |
408 | 474 | // 撅霂瑟仃韐交內 |
409 | -function doAlert(){ | |
475 | +function doAlert() { | |
410 | 476 | alert("秤嚗kiftd嚗窈璉餈"); |
411 | 477 | } |
412 | 478 | |
... | ... | @@ -431,13 +497,13 @@ function getServerOS() { |
431 | 497 | } |
432 | 498 | |
433 | 499 | // 辣憭寡 |
434 | -function showFolderView(fid,targetId) { | |
500 | +function showFolderView(fid, targetId) { | |
435 | 501 | // 甇餈銝銝芰窈瘙甈⊥ |
436 | - if(loadingFolderView){ | |
502 | + if (loadingFolderView) { | |
437 | 503 | return; |
438 | 504 | } |
439 | 505 | startLoading(); |
440 | - if(remainingLoadingRequest){ | |
506 | + if (remainingLoadingRequest) { | |
441 | 507 | remainingLoadingRequest.abort(); |
442 | 508 | } |
443 | 509 | $.ajax({ |
... | ... | @@ -454,8 +520,10 @@ function showFolderView(fid,targetId) { |
454 | 520 | // 秤撘孵內獢僎撠捆憛思蛹內靽⊥ |
455 | 521 | doAlert(); |
456 | 522 | $("#tb").html("<span class='graytext'>仃韐伐窈撠</span>"); |
457 | - $("#publishTime").html("<span class='graytext'>仃韐伐窈撠</span>"); | |
458 | - $("#parentlistbox").html("<span class='graytext'>仃韐伐窈撠</span>"); | |
523 | + $("#publishTime").html( | |
524 | + "<span class='graytext'>仃韐伐窈撠</span>"); | |
525 | + $("#parentlistbox").html( | |
526 | + "<span class='graytext'>仃韐伐窈撠</span>"); | |
459 | 527 | break; |
460 | 528 | case "NOT_FOUND": |
461 | 529 | case "notAccess": |
... | ... | @@ -463,7 +531,7 @@ function showFolderView(fid,targetId) { |
463 | 531 | document.cookie = "folder_id=" + escape("root"); |
464 | 532 | case "mustLogin": |
465 | 533 | // 憒霂游◆敶銋歲頧祈頝臬敶△嚗 |
466 | - window.location.href="/"; | |
534 | + window.location.href = "/"; | |
467 | 535 | break; |
468 | 536 | default: |
469 | 537 | // 銝膩銝嚗砲辣憭寡嚗銝撖孵餈圾 |
... | ... | @@ -475,10 +543,10 @@ function showFolderView(fid,targetId) { |
475 | 543 | // 霈啣漣敶D嚗靘輯蝥 |
476 | 544 | parentpath = folderView.folder.folderParent; |
477 | 545 | // 霈啣辣憭寧挪蝥批嚗噶鈭撱箸辣憭寞摨砲隞銝銝芰漣撘憪 |
478 | - constraintLevel=folderView.folder.folderConstraint; | |
479 | - screenedFoldrView=null; | |
546 | + constraintLevel = folderView.folder.folderConstraint; | |
547 | + screenedFoldrView = null; | |
480 | 548 | // 憭遢銝隞賢辣憭寡嚗銋扇敶霂W宏 |
481 | - originFolderView=$.extend(true, {}, folderView); | |
549 | + originFolderView = $.extend(true, {}, folderView); | |
482 | 550 | totalFoldersOffset = folderView.foldersOffset; |
483 | 551 | totalFilesOffset = folderView.filesOffset; |
484 | 552 | // 揣颲獢蔭 |
... | ... | @@ -496,15 +564,17 @@ function showFolderView(fid,targetId) { |
496 | 564 | // 辣憭嫣縑靽⊥璅⊥ |
497 | 565 | $("#fim_name").text(folderView.folder.folderName); |
498 | 566 | $("#fim_creator").text(folderView.folder.folderCreator); |
499 | - $("#fim_folderCreationDate").text(folderView.folder.folderCreationDate); | |
567 | + $("#fim_folderCreationDate").text( | |
568 | + folderView.folder.folderCreationDate); | |
500 | 569 | $("#fim_folderId").text(folderView.folder.folderId); |
501 | 570 | updateTheFolderInfo(); |
502 | 571 | // 餈閬蝸賒 |
503 | - if(folderView.foldersOffset > folderView.selectStep || folderView.filesOffset > folderView.selectStep){ | |
572 | + if (folderView.foldersOffset > folderView.selectStep | |
573 | + || folderView.filesOffset > folderView.selectStep) { | |
504 | 574 | // 憒辣憭孵宏辣宏之鈭霂X郊餈摨佗秩摰賒閬蝸嚗銋誧蝏剖蝸賒 |
505 | 575 | showLoadingRemaininngBox(); |
506 | 576 | loadingRemainingFolderView(targetId); |
507 | - }else{ | |
577 | + } else { | |
508 | 578 | // 秩辣憭寡蝸摰極雿 |
509 | 579 | hiddenLoadingRemaininngBox(); |
510 | 580 | doFixedRow(targetId); |
... | ... | @@ -517,36 +587,40 @@ function showFolderView(fid,targetId) { |
517 | 587 | doAlert(); |
518 | 588 | $("#tb").html("<span class='graytext'>仃韐伐窈撠</span>"); |
519 | 589 | $("#publishTime").html("<span class='graytext'>仃韐伐窈撠</span>"); |
520 | - $("#parentlistbox").html("<span class='graytext'>仃韐伐窈撠</span>"); | |
590 | + $("#parentlistbox") | |
591 | + .html("<span class='graytext'>仃韐伐窈撠</span>"); | |
521 | 592 | } |
522 | 593 | }); |
523 | 594 | } |
524 | 595 | |
525 | 596 | // 撘憪辣閫蝸 |
526 | -function startLoading(){ | |
597 | +function startLoading() { | |
527 | 598 | loadingFolderView = true; |
528 | - $('#loadingModal').modal({backdrop:'static', keyboard: false}); | |
599 | + $('#loadingModal').modal({ | |
600 | + backdrop : 'static', | |
601 | + keyboard : false | |
602 | + }); | |
529 | 603 | $('#loadingModal').modal('show'); |
530 | 604 | $('#loadingModal').addClass("shown"); |
531 | 605 | } |
532 | 606 | |
533 | 607 | // 蝏辣閫蝸 |
534 | -function endLoading(){ | |
608 | +function endLoading() { | |
535 | 609 | loadingFolderView = false; |
536 | 610 | $('#loadingModal').modal('hide'); |
537 | 611 | $('#loadingModal').removeClass("shown"); |
538 | 612 | } |
539 | 613 | |
540 | 614 | // 撘憪蝸 |
541 | -function startLogin(){ | |
542 | - $("#accountid").attr('disabled','disabled'); | |
543 | - $("#accountpwd").attr('disabled','disabled'); | |
544 | - $("#dologinButton").attr('disabled','disabled'); | |
545 | - $("#vercode").attr('disabled','disabled'); | |
615 | +function startLogin() { | |
616 | + $("#accountid").attr('disabled', 'disabled'); | |
617 | + $("#accountpwd").attr('disabled', 'disabled'); | |
618 | + $("#dologinButton").attr('disabled', 'disabled'); | |
619 | + $("#vercode").attr('disabled', 'disabled'); | |
546 | 620 | } |
547 | 621 | |
548 | 622 | // 蝏蝸 |
549 | -function finishLogin(){ | |
623 | +function finishLogin() { | |
550 | 624 | $("#accountid").removeAttr('disabled'); |
551 | 625 | $("#accountpwd").removeAttr('disabled'); |
552 | 626 | $("#dologinButton").removeAttr('disabled'); |
... | ... | @@ -579,7 +653,7 @@ function dologin() { |
579 | 653 | data : {}, |
580 | 654 | dataType : 'text', |
581 | 655 | success : function(result) { |
582 | - var publicKeyInfo=eval("("+result+")"); | |
656 | + var publicKeyInfo = eval("(" + result + ")"); | |
583 | 657 | var date = new Date();// 餈葵摰X瘚銝 |
584 | 658 | var loginInfo = '{accountId:"' + accountId + '",accountPwd:"' |
585 | 659 | + accountPwd + '",time:"' + publicKeyInfo.time + '"}'; |
... | ... | @@ -600,88 +674,95 @@ function dologin() { |
600 | 674 | |
601 | 675 | // |
602 | 676 | function sendLoginInfo(encrypted) { |
603 | - $.ajax({ | |
604 | - type : "POST", | |
605 | - dataType : "text", | |
606 | - url : "homeController/doLogin.ajax", | |
607 | - data : { | |
608 | - encrypted : encrypted, | |
609 | - vercode : $("#vercode").val() | |
610 | - }, | |
611 | - success : function(result) { | |
612 | - finishLogin(); | |
613 | - $("#alertbox").removeClass("alert"); | |
614 | - $("#alertbox").removeClass("alert-danger"); | |
615 | - $("#alertbox").text(""); | |
616 | - $("#vercodebox").html(""); | |
617 | - $("#vercodebox").removeClass("show"); | |
618 | - $("#vercodebox").addClass("hidden"); | |
619 | - switch (result) { | |
620 | - case "permitlogin": | |
621 | - $("#accountidbox").removeClass("has-error"); | |
622 | - $("#accountpwdbox").removeClass("has-error"); | |
623 | - $('#loginModal').modal('hide'); | |
624 | - showFolderView(locationpath); | |
625 | - break; | |
626 | - case "accountnotfound": | |
627 | - $("#accountidbox").addClass("has-error"); | |
628 | - $("#accountpwdbox").removeClass("has-error"); | |
629 | - $("#alertbox").addClass("alert"); | |
630 | - $("#alertbox").addClass("alert-danger"); | |
631 | - $("#alertbox").text("內嚗敶仃韐伐揭銝霈曄蔭"); | |
632 | - break; | |
633 | - case "accountpwderror": | |
634 | - $("#accountpwdbox").addClass("has-error"); | |
635 | - $("#accountidbox").removeClass("has-error"); | |
636 | - $("#alertbox").addClass("alert"); | |
637 | - $("#alertbox").addClass("alert-danger"); | |
638 | - $("#alertbox").text("內嚗敶仃韐伐秤霈曄蔭"); | |
639 | - break; | |
640 | - case "needsubmitvercode": | |
641 | - $("#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>"); | |
642 | - $("#vercodebox").removeClass("hidden"); | |
643 | - $("#vercodebox").addClass("show"); | |
644 | - break; | |
645 | - case "error": | |
646 | - $("#alertbox").addClass("alert"); | |
647 | - $("#alertbox").addClass("alert-danger"); | |
648 | - $("#alertbox").text("內嚗敶仃韐伐敶窈瘙霂瑟餈撖潸"); | |
649 | - break; | |
650 | - default: | |
651 | - $("#alertbox").addClass("alert"); | |
652 | - $("#alertbox").addClass("alert-danger"); | |
653 | - $("#alertbox").text("內嚗敶秤"); | |
654 | - break; | |
655 | - } | |
656 | - }, | |
657 | - error : function() { | |
658 | - finishLogin(); | |
659 | - $("#alertbox").addClass("alert"); | |
660 | - $("#alertbox").addClass("alert-danger"); | |
661 | - $("#alertbox").text("內嚗敶窈瘙仃韐伐窈璉蝵餈"); | |
662 | - } | |
663 | - }); | |
677 | + $ | |
678 | + .ajax({ | |
679 | + type : "POST", | |
680 | + dataType : "text", | |
681 | + url : "homeController/doLogin.ajax", | |
682 | + data : { | |
683 | + encrypted : encrypted, | |
684 | + vercode : $("#vercode").val() | |
685 | + }, | |
686 | + success : function(result) { | |
687 | + finishLogin(); | |
688 | + $("#alertbox").removeClass("alert"); | |
689 | + $("#alertbox").removeClass("alert-danger"); | |
690 | + $("#alertbox").text(""); | |
691 | + $("#vercodebox").html(""); | |
692 | + $("#vercodebox").removeClass("show"); | |
693 | + $("#vercodebox").addClass("hidden"); | |
694 | + switch (result) { | |
695 | + case "permitlogin": | |
696 | + $("#accountidbox").removeClass("has-error"); | |
697 | + $("#accountpwdbox").removeClass("has-error"); | |
698 | + $('#loginModal').modal('hide'); | |
699 | + showFolderView(locationpath); | |
700 | + break; | |
701 | + case "accountnotfound": | |
702 | + $("#accountidbox").addClass("has-error"); | |
703 | + $("#accountpwdbox").removeClass("has-error"); | |
704 | + $("#alertbox").addClass("alert"); | |
705 | + $("#alertbox").addClass("alert-danger"); | |
706 | + $("#alertbox").text("內嚗敶仃韐伐揭銝霈曄蔭"); | |
707 | + break; | |
708 | + case "accountpwderror": | |
709 | + $("#accountpwdbox").addClass("has-error"); | |
710 | + $("#accountidbox").removeClass("has-error"); | |
711 | + $("#alertbox").addClass("alert"); | |
712 | + $("#alertbox").addClass("alert-danger"); | |
713 | + $("#alertbox").text("內嚗敶仃韐伐秤霈曄蔭"); | |
714 | + break; | |
715 | + case "needsubmitvercode": | |
716 | + $("#vercodebox") | |
717 | + .html( | |
718 | + "<label id='vercodetitle' class='col-sm-7'><img id='showvercode' class='vercodeimg' alt='' src='homeController/getNewVerCode.do?s=" | |
719 | + + (new Date()).getTime() | |
720 | + + "' onclick='getNewVerCode()'></label><div class='col-sm-5'><input type='text' class='form-control' id='vercode' placeholder='撉色'></div>"); | |
721 | + $("#vercodebox").removeClass("hidden"); | |
722 | + $("#vercodebox").addClass("show"); | |
723 | + break; | |
724 | + case "error": | |
725 | + $("#alertbox").addClass("alert"); | |
726 | + $("#alertbox").addClass("alert-danger"); | |
727 | + $("#alertbox").text( | |
728 | + "內嚗敶仃韐伐敶窈瘙霂瑟餈撖潸"); | |
729 | + break; | |
730 | + default: | |
731 | + $("#alertbox").addClass("alert"); | |
732 | + $("#alertbox").addClass("alert-danger"); | |
733 | + $("#alertbox").text("內嚗敶秤"); | |
734 | + break; | |
735 | + } | |
736 | + }, | |
737 | + error : function() { | |
738 | + finishLogin(); | |
739 | + $("#alertbox").addClass("alert"); | |
740 | + $("#alertbox").addClass("alert-danger"); | |
741 | + $("#alertbox").text("內嚗敶窈瘙仃韐伐窈璉蝵餈"); | |
742 | + } | |
743 | + }); | |
664 | 744 | } |
665 | 745 | |
666 | 746 | // 銝芣 |
667 | -function getNewVerCode(){ | |
668 | - $("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime()); | |
747 | +function getNewVerCode() { | |
748 | + $("#showvercode").attr("src", | |
749 | + "homeController/getNewVerCode.do?s=" + (new Date()).getTime()); | |
669 | 750 | } |
670 | 751 | |
671 | 752 | // 瘜券 |
672 | 753 | function dologout() { |
673 | 754 | $('#logoutModal').modal('hide'); |
674 | 755 | $.ajax({ |
675 | - url:'homeController/doLogout.ajax', | |
676 | - type:'POST', | |
677 | - data:{}, | |
678 | - dataType:'text', | |
679 | - success:function(result){ | |
680 | - if(result=="SUCCESS"){ | |
756 | + url : 'homeController/doLogout.ajax', | |
757 | + type : 'POST', | |
758 | + data : {}, | |
759 | + dataType : 'text', | |
760 | + success : function(result) { | |
761 | + if (result == "SUCCESS") { | |
681 | 762 | showFolderView(locationpath); |
682 | 763 | } |
683 | 764 | }, |
684 | - error:function(){ | |
765 | + error : function() { | |
685 | 766 | doAlert(); |
686 | 767 | } |
687 | 768 | }); |
... | ... | @@ -691,27 +772,30 @@ function dologout() { |
691 | 772 | function showParentList(folderView) { |
692 | 773 | $("#parentFolderList").html(""); |
693 | 774 | var f = folderView.folder; |
694 | - if(folderView.parentList.length>0){ | |
775 | + if (folderView.parentList.length > 0) { | |
695 | 776 | $.each(folderView.parentList, function(n, val) { |
696 | - $("#parentFolderList").append("<li><a href='javascript:void(0);' onclick='entryFolder("+'"' + val.folderId +'"'+")'>"+val.folderName+"</a></li>"); | |
777 | + $("#parentFolderList").append( | |
778 | + "<li><a href='javascript:void(0);' onclick='entryFolder(" | |
779 | + + '"' + val.folderId + '"' + ")'>" + val.folderName | |
780 | + + "</a></li>"); | |
697 | 781 | }); |
698 | - }else{ | |
782 | + } else { | |
699 | 783 | $("#parentFolderList").html("<li class='disabled'><a></a></li>"); |
700 | 784 | } |
701 | - if(f.folderName.length>6){ | |
702 | - $("#currentFolderName").text(f.folderName.substr(0,6)+"..."); | |
703 | - }else{ | |
785 | + if (f.folderName.length > 6) { | |
786 | + $("#currentFolderName").text(f.folderName.substr(0, 6) + "..."); | |
787 | + } else { | |
704 | 788 | $("#currentFolderName").text(f.folderName); |
705 | 789 | } |
706 | - if(f.folderName == "ROOT"){ | |
790 | + if (f.folderName == "ROOT") { | |
707 | 791 | $("#folderIconSpan").removeClass("glyphicon-folder-close"); |
708 | 792 | $("#folderIconSpan").removeClass("glyphicon-search"); |
709 | 793 | $("#folderIconSpan").addClass("glyphicon-home"); |
710 | - }else if(folderView.keyWorld != null){ | |
794 | + } else if (folderView.keyWorld != null) { | |
711 | 795 | $("#folderIconSpan").removeClass("glyphicon-folder-close"); |
712 | 796 | $("#folderIconSpan").removeClass("glyphicon-home"); |
713 | 797 | $("#folderIconSpan").addClass("glyphicon-search"); |
714 | - }else{ | |
798 | + } else { | |
715 | 799 | $("#folderIconSpan").removeClass("glyphicon-home"); |
716 | 800 | $("#folderIconSpan").removeClass("glyphicon-search"); |
717 | 801 | $("#folderIconSpan").addClass("glyphicon-folder-close"); |
... | ... | @@ -721,7 +805,7 @@ function showParentList(folderView) { |
721 | 805 | // 蝷箇閫嚗辣”敶縑蝑 |
722 | 806 | function showAccountView(folderView) { |
723 | 807 | $("#tb,#tb2").html(""); |
724 | - account=folderView.account; | |
808 | + account = folderView.account; | |
725 | 809 | if (folderView.account != null) { |
726 | 810 | // 霂湔歇蝏敶蝷箸釣 |
727 | 811 | $("#tb") |
... | ... | @@ -734,13 +818,13 @@ function showAccountView(folderView) { |
734 | 818 | "<button class='btn btn-link' data-toggle='modal' data-target='#logoutModal'>瘜券 [" |
735 | 819 | + folderView.account |
736 | 820 | + "] <span class='glyphicon glyphicon-off' aria-hidden='true'></span></button>"); |
737 | - if(folderView.allowChangePassword == 'true'){ | |
821 | + if (folderView.allowChangePassword == 'true') { | |
738 | 822 | $("#tb") |
739 | - .append( | |
740 | - " <button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#changePasswordModal'>靽格撖 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"); | |
823 | + .append( | |
824 | + " <button class='btn btn-link rightbtn hidden-xs' data-toggle='modal' data-target='#changePasswordModal'>靽格撖 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"); | |
741 | 825 | $("#tb2") |
742 | - .append( | |
743 | - " <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>靽格撖 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"); | |
826 | + .append( | |
827 | + " <button class='btn btn-link' data-toggle='modal' data-target='#changePasswordModal'>靽格撖 <span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button>"); | |
744 | 828 | } |
745 | 829 | } else { |
746 | 830 | // 霂湔敶蝷箇敶 |
... | ... | @@ -750,50 +834,74 @@ function showAccountView(folderView) { |
750 | 834 | $("#tb2") |
751 | 835 | .append( |
752 | 836 | "<button class='btn btn-link' data-toggle='modal' data-target='#loginModal'> <span class='glyphicon glyphicon-user' aria-hidden='true'></span></button>"); |
753 | - if(folderView.allowSignUp == 'true'){ | |
837 | + if (folderView.allowSignUp == 'true') { | |
754 | 838 | $("#tb") |
755 | - .append( | |
756 | - " <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>"); | |
839 | + .append( | |
840 | + " <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>"); | |
757 | 841 | $("#tb2") |
758 | - .append( | |
759 | - " <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>蝡瘜典 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>"); | |
842 | + .append( | |
843 | + " <button class='btn btn-link' onclick='window.location.href = \"prv/signup.html\"'>蝡瘜典 <span class='glyphicon glyphicon-log-in' aria-hidden='true'></span></button>"); | |
760 | 844 | } |
761 | 845 | } |
762 | 846 | var authList = folderView.authList; |
763 | 847 | // 撖寞蝷箏嚗僎漲 |
764 | 848 | $("#fileListDropDown li").addClass("disabled"); |
765 | - $("#fileListDropDown li a").attr("onclick",""); | |
766 | - $("#fileListDropDown li a").attr("href","javascript:void(0);"); | |
849 | + $("#fileListDropDown li a").attr("onclick", ""); | |
767 | 850 | if (authList != null) { |
768 | 851 | if (checkAuth(authList, "C")) { |
769 | 852 | $("#createFolderButtonLi").removeClass("disabled"); |
770 | - $("#createFolderButtonLi a").attr("onclick","showNewFolderModel()"); | |
853 | + $("#createFolderButtonLi a") | |
854 | + .attr("onclick", "showNewFolderModel()"); | |
771 | 855 | } |
772 | 856 | if (checkAuth(authList, "U")) { |
773 | 857 | $("#uploadFileButtonLi").removeClass("disabled"); |
774 | - $("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()"); | |
775 | - if(checkAuth(authList, "C") && isSupportWebkitdirectory()){// 瘚辣憭寥嚗憭撱箸辣憭寞捂餈辣憭嫣 | |
858 | + $("#uploadFileButtonLi a").attr("onclick", "showUploadFileModel()"); | |
859 | + if (checkAuth(authList, "C") && isSupportWebkitdirectory()) {// 瘚辣憭寥嚗憭撱箸辣憭寞捂餈辣憭嫣 | |
776 | 860 | $("#uploadFolderButtonLi").removeClass("disabled"); |
777 | - $("#uploadFolderButtonLi a").attr("onclick","showUploadFolderModel()"); | |
861 | + $("#uploadFolderButtonLi a").attr("onclick", | |
862 | + "showUploadFolderModel()"); | |
778 | 863 | } |
779 | 864 | } |
780 | 865 | if (folderView.enableDownloadZip && checkAuth(authList, "L")) { |
781 | 866 | $("#packageDownloadBox") |
782 | 867 | .html( |
783 | 868 | "<button class='btn btn-link navbar-btn' onclick='showDownloadAllCheckedModel()'><span class='glyphicon glyphicon-briefcase'></span> 蝸</button>"); |
784 | - }else{ | |
869 | + } else { | |
785 | 870 | $("#packageDownloadBox").html(""); |
786 | 871 | } |
787 | 872 | if (checkAuth(authList, "D")) { |
788 | 873 | $("#deleteSeelectFileButtonLi").removeClass("disabled"); |
789 | - $("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()"); | |
874 | + $("#deleteSeelectFileButtonLi a").attr("onclick", | |
875 | + "showDeleteAllCheckedModel()"); | |
790 | 876 | } |
791 | 877 | if (checkAuth(authList, "M")) { |
792 | 878 | $("#cutFileButtonLi").removeClass("disabled"); |
793 | - $("#cutFileButtonLi a").attr("onclick","startMoveFile()"); | |
794 | - if(checkedMovefiles!==undefined&&checkedMovefiles.length>0){ | |
795 | - $("#cutSignTx").text("蝎斐嚗"+checkedMovefiles.length+"嚗"); | |
796 | - $("#cutSignTx").addClass("cuted"); | |
879 | + $("#stickFileButtonLi").removeClass("disabled"); | |
880 | + $("#copyFileButtonLi").removeClass("disabled"); | |
881 | + $("#cutFileButtonLi a").attr("onclick", "cutFile()"); | |
882 | + $("#copyFileButtonLi a").attr("onclick", "copyFile()"); | |
883 | + $("#stickFileButtonLi a").attr("onclick", "stickFile()"); | |
884 | + if (checkedMovefiles !== undefined && checkedMovefiles.size > 0) { | |
885 | + if (checkedMovefiles.size < 100) { | |
886 | + $("#stickFilesCount").text( | |
887 | + "嚗" + checkedMovefiles.size + "嚗"); | |
888 | + } else { | |
889 | + $("#stickFilesCount").text("嚗99+嚗"); | |
890 | + } | |
891 | + $("#copyFileButtonLi").removeClass("show"); | |
892 | + $("#copyFileButtonLi").addClass("hidden"); | |
893 | + $("#cutFileButtonLi").removeClass("show"); | |
894 | + $("#cutFileButtonLi").addClass("hidden"); | |
895 | + $("#stickFileButtonLi").removeClass("hidden"); | |
896 | + $("#stickFileButtonLi").addClass("show"); | |
897 | + } else { | |
898 | + $("#copyFileButtonLi").removeClass("hidden"); | |
899 | + $("#copyFileButtonLi").addClass("show"); | |
900 | + $("#cutFileButtonLi").removeClass("hidden"); | |
901 | + $("#cutFileButtonLi").addClass("show"); | |
902 | + $("#stickFileButtonLi").removeClass("show"); | |
903 | + $("#stickFileButtonLi").addClass("hidden"); | |
904 | + $("#stickFilesCount").text(""); | |
797 | 905 | } |
798 | 906 | } |
799 | 907 | } |
... | ... | @@ -863,34 +971,36 @@ function showFolderTable(folderView) { |
863 | 971 | if (checkAuth(authList, "L")) { |
864 | 972 | aL = true; |
865 | 973 | } |
866 | - if (checkAuth(authList, "O")){ | |
974 | + if (checkAuth(authList, "O")) { | |
867 | 975 | aO = true; |
868 | 976 | } |
869 | 977 | // 僎蝷箸辣憭孵” |
870 | - for(var i1=folderView.folderList.length;i1>0;i1--){ | |
871 | - var f=folderView.folderList[i1-1]; | |
872 | - $("#foldertable").append(createNewFolderRow(f,aD,aR,aO)); | |
978 | + for (var i1 = folderView.folderList.length; i1 > 0; i1--) { | |
979 | + var f = folderView.folderList[i1 - 1]; | |
980 | + $("#foldertable").append(createNewFolderRow(f, aD, aR, aO)); | |
873 | 981 | } |
874 | 982 | // 僎蝷箸辣” |
875 | - for(var i2=folderView.fileList.length;i2>0;i2--){ | |
876 | - var fi = folderView.fileList[i2-1]; | |
877 | - $("#foldertable").append(createFileRow(fi,aL,aD,aR,aO)); | |
983 | + for (var i2 = folderView.fileList.length; i2 > 0; i2--) { | |
984 | + var fi = folderView.fileList[i2 - 1]; | |
985 | + $("#foldertable").append(createFileRow(fi, aL, aD, aR, aO)); | |
878 | 986 | } |
879 | 987 | } |
880 | 988 | |
881 | 989 | // 銝銝芣辣撖寡情笆摨辣銵TML捆 |
882 | -function createFileRow(fi,aL,aD,aR,aO){ | |
883 | - fi.fileName = fi.fileName.replace(/\'/g,''').replace(/</g,'<').replace(/>/g,'>'); | |
990 | +function createFileRow(fi, aL, aD, aR, aO) { | |
991 | + fi.fileName = fi.fileName.replace(/\'/g, ''').replace(/</g, '<') | |
992 | + .replace(/>/g, '>'); | |
884 | 993 | var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"' |
885 | - + fi.fileId + '"' + ")' ondblclick='checkConsFile(event,"+'"'+fi.fileId+'"'+")' id='" + fi.fileId | |
994 | + + fi.fileId + '"' + ")' ondblclick='checkConsFile(event," + '"' | |
995 | + + fi.fileId + '"' + ")' id='" + fi.fileId | |
886 | 996 | + "' class='filerow'><td>" + fi.fileName |
887 | 997 | + "</td><td class='hidden-xs'>" + fi.fileCreationDate + "</td>"; |
888 | - if(fi.fileSize=="0"){ | |
889 | - fileRow=fileRow+"<td><1MB</td>"; | |
890 | - }else{ | |
891 | - fileRow=fileRow+"<td>" + fi.fileSize + "MB</td>"; | |
998 | + if (fi.fileSize == "0") { | |
999 | + fileRow = fileRow + "<td><1MB</td>"; | |
1000 | + } else { | |
1001 | + fileRow = fileRow + "<td>" + fi.fileSize + "MB</td>"; | |
892 | 1002 | } |
893 | - fileRow=fileRow +"<td class='hidden-xs'>" + fi.fileCreator + "</td><td>"; | |
1003 | + fileRow = fileRow + "<td class='hidden-xs'>" + fi.fileCreator + "</td><td>"; | |
894 | 1004 | if (aL) { |
895 | 1005 | fileRow = fileRow |
896 | 1006 | + "<button onclick='showDownloadModel(" |
... | ... | @@ -901,15 +1011,15 @@ function createFileRow(fi,aL,aD,aR,aO){ |
901 | 1011 | + '"' |
902 | 1012 | + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 銝蝸</button>"; |
903 | 1013 | // 撖嫣畾撘辣 |
904 | - var suffix=getSuffix(fi.fileName); | |
1014 | + var suffix = getSuffix(fi.fileName); | |
905 | 1015 | switch (suffix) { |
906 | 1016 | case "mp4": |
907 | 1017 | fileRow = fileRow |
908 | - + "<button onclick='playVideo(" | |
909 | - + '"' | |
910 | - + fi.fileId | |
911 | - + '"' | |
912 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
1018 | + + "<button onclick='playVideo(" | |
1019 | + + '"' | |
1020 | + + fi.fileId | |
1021 | + + '"' | |
1022 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
913 | 1023 | break; |
914 | 1024 | case "webm": |
915 | 1025 | case "mov": |
... | ... | @@ -917,22 +1027,22 @@ function createFileRow(fi,aL,aD,aR,aO){ |
917 | 1027 | case "wmv": |
918 | 1028 | case "mkv": |
919 | 1029 | case "flv": |
920 | - if(folderView.enableFFMPEG){ | |
1030 | + if (folderView.enableFFMPEG) { | |
921 | 1031 | fileRow = fileRow |
922 | - + "<button onclick='playVideo(" | |
923 | - + '"' | |
924 | - + fi.fileId | |
925 | - + '"' | |
926 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
1032 | + + "<button onclick='playVideo(" | |
1033 | + + '"' | |
1034 | + + fi.fileId | |
1035 | + + '"' | |
1036 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
927 | 1037 | } |
928 | 1038 | break; |
929 | 1039 | case "pdf": |
930 | 1040 | fileRow = fileRow |
931 | - + "<button onclick='pdfView(" | |
932 | - + '"' | |
933 | - + fi.filePath | |
934 | - + '"' | |
935 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
1041 | + + "<button onclick='pdfView(" | |
1042 | + + '"' | |
1043 | + + fi.fileId | |
1044 | + + '"' | |
1045 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
936 | 1046 | break; |
937 | 1047 | case "jpg": |
938 | 1048 | case "jpeg": |
... | ... | @@ -940,46 +1050,46 @@ function createFileRow(fi,aL,aD,aR,aO){ |
940 | 1050 | case "png": |
941 | 1051 | case "bmp": |
942 | 1052 | fileRow = fileRow |
943 | - + "<button onclick='showPicture(" | |
944 | - + '"' | |
945 | - + fi.fileId | |
946 | - + '"' | |
947 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> </button>"; | |
1053 | + + "<button onclick='showPicture(" | |
1054 | + + '"' | |
1055 | + + fi.fileId | |
1056 | + + '"' | |
1057 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-picture'></span> </button>"; | |
948 | 1058 | break; |
949 | 1059 | case "mp3": |
950 | 1060 | case "wav": |
951 | 1061 | case "ogg": |
952 | 1062 | fileRow = fileRow |
953 | - + "<button onclick='playAudio(" | |
954 | - + '"' | |
955 | - + fi.fileId | |
956 | - + '"' | |
957 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
1063 | + + "<button onclick='playAudio(" | |
1064 | + + '"' | |
1065 | + + fi.fileId | |
1066 | + + '"' | |
1067 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-play'></span> </button>"; | |
958 | 1068 | break; |
959 | 1069 | case "docx": |
960 | 1070 | fileRow = fileRow |
961 | - + "<button onclick='docxView(" | |
962 | - + '"' | |
963 | - + fi.fileId | |
964 | - + '"' | |
965 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
1071 | + + "<button onclick='docxView(" | |
1072 | + + '"' | |
1073 | + + fi.fileId | |
1074 | + + '"' | |
1075 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
966 | 1076 | break; |
967 | 1077 | case "txt": |
968 | 1078 | fileRow = fileRow |
969 | - + "<button onclick='txtView(" | |
970 | - + '"' | |
971 | - + fi.fileId | |
972 | - + '"' | |
973 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
1079 | + + "<button onclick='txtView(" | |
1080 | + + '"' | |
1081 | + + fi.fileId | |
1082 | + + '"' | |
1083 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
974 | 1084 | break; |
975 | 1085 | case "ppt": |
976 | 1086 | case "pptx": |
977 | 1087 | fileRow = fileRow |
978 | - + "<button onclick='pptView(" | |
979 | - + '"' | |
980 | - + fi.fileId | |
981 | - + '"' | |
982 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
1088 | + + "<button onclick='pptView(" | |
1089 | + + '"' | |
1090 | + + fi.fileId | |
1091 | + + '"' | |
1092 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-eye-open'></span> 憸</button>"; | |
983 | 1093 | break; |
984 | 1094 | default: |
985 | 1095 | break; |
... | ... | @@ -1019,13 +1129,13 @@ function createFileRow(fi,aL,aD,aR,aO){ |
1019 | 1129 | } |
1020 | 1130 | if (aL && folderView.showFileChain == 'true') { |
1021 | 1131 | fileRow = fileRow |
1022 | - + "<button onclick='getFileChain(" | |
1023 | - + '"' | |
1024 | - + fi.fileId | |
1025 | - + '","' | |
1026 | - + fi.fileName | |
1027 | - + '"' | |
1028 | - + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> </button>"; | |
1132 | + + "<button onclick='getFileChain(" | |
1133 | + + '"' | |
1134 | + + fi.fileId | |
1135 | + + '","' | |
1136 | + + fi.fileName | |
1137 | + + '"' | |
1138 | + + ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> </button>"; | |
1029 | 1139 | } |
1030 | 1140 | if (!aR && !aD && !aL && !aO) { |
1031 | 1141 | fileRow = fileRow + "--"; |
... | ... | @@ -1035,11 +1145,21 @@ function createFileRow(fi,aL,aD,aR,aO){ |
1035 | 1145 | } |
1036 | 1146 | |
1037 | 1147 | // 銝銝芣辣憭孵笆鞊∠笆摨辣銵TML捆 |
1038 | -function createNewFolderRow(f,aD,aR,aO){ | |
1039 | - f.folderName = f.folderName.replace(/\'/g,''').replace(/</g,'<').replace(/>/g,'>'); | |
1040 | - var folderRow = "<tr id='"+f.folderId+"' onclick='checkfile(event,"+'"'+f.folderId+'"'+")' ondblclick='checkConsFile(event,"+'"'+f.folderId+'"'+")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder(" | |
1041 | - + '"' + f.folderId + '"' | |
1042 | - + ")' class='btn btn-link btn-xs'>/" | |
1148 | +function createNewFolderRow(f, aD, aR, aO) { | |
1149 | + f.folderName = f.folderName.replace(/\'/g, ''').replace(/</g, '<') | |
1150 | + .replace(/>/g, '>'); | |
1151 | + var folderRow = "<tr id='" | |
1152 | + + f.folderId | |
1153 | + + "' onclick='checkfile(event," | |
1154 | + + '"' | |
1155 | + + f.folderId | |
1156 | + + '"' | |
1157 | + + ")' ondblclick='checkConsFile(event," | |
1158 | + + '"' | |
1159 | + + f.folderId | |
1160 | + + '"' | |
1161 | + + ")' class='filerow' iskfolder='true' ><td><button onclick='entryFolder(" | |
1162 | + + '"' + f.folderId + '"' + ")' class='btn btn-link btn-xs'>/" | |
1043 | 1163 | + f.folderName + "</button></td><td class='hidden-xs'>" |
1044 | 1164 | + f.folderCreationDate + "</td><td>--</td><td class='hidden-xs'>" |
1045 | 1165 | + f.folderCreator + "</td><td>"; |
... | ... | @@ -1081,7 +1201,7 @@ function createNewFolderRow(f,aD,aR,aO){ |
1081 | 1201 | return folderRow; |
1082 | 1202 | } |
1083 | 1203 | |
1084 | -var folderTypes=['撘','隞','隞遣'];// 辣憭寧漲隞塚撠憭改 | |
1204 | +var folderTypes = [ '撘', '隞', '隞遣' ];// 辣憭寧漲隞塚撠憭改 | |
1085 | 1205 | |
1086 | 1206 | // 蝷箸撱箸辣憭寞芋 |
1087 | 1207 | function showNewFolderModel() { |
... | ... | @@ -1089,15 +1209,15 @@ function showNewFolderModel() { |
1089 | 1209 | } |
1090 | 1210 | |
1091 | 1211 | // 靽格撱箸辣憭寧漲漣 |
1092 | -function changeNewFolderType(type){ | |
1212 | +function changeNewFolderType(type) { | |
1093 | 1213 | $("#newfoldertype").text(folderTypes[type]); |
1094 | - $("#foldername").attr("folderConstraintLevel",type+""); | |
1214 | + $("#foldername").attr("folderConstraintLevel", type + ""); | |
1095 | 1215 | } |
1096 | 1216 | |
1097 | 1217 | // 遣辣憭 |
1098 | 1218 | function createfolder() { |
1099 | 1219 | var fn = $("#foldername").val(); |
1100 | - var fc=$("#foldername").attr("folderConstraintLevel"); | |
1220 | + var fc = $("#foldername").attr("folderConstraintLevel"); | |
1101 | 1221 | var reg = new RegExp("[\/\|\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g"); |
1102 | 1222 | if (fn.length == 0) { |
1103 | 1223 | showFolderAlert("內嚗辣憭孵妍銝銝箇征"); |
... | ... | @@ -1176,6 +1296,7 @@ function showDeleteFolderModel(folderId, folderName) { |
1176 | 1296 | "<button id='dmbutton' type='button' class='btn btn-danger' onclick='deleteFolder(" |
1177 | 1297 | + '"' + folderId + '"' + ")'></button>"); |
1178 | 1298 | $("#dmbutton").attr('disabled', false); |
1299 | + $("#cancelDeleteFolderBtn").attr('disabled', false); | |
1179 | 1300 | $('#deleteFolderMessage').text( |
1180 | 1301 | "內嚗&摰蝠摨辣憭對" + folderName + "]捆銋砲憭"); |
1181 | 1302 | $('#deleteFolderModal').modal('toggle'); |
... | ... | @@ -1184,6 +1305,7 @@ function showDeleteFolderModel(folderId, folderName) { |
1184 | 1305 | // 銵辣憭 |
1185 | 1306 | function deleteFolder(folderId) { |
1186 | 1307 | $("#dmbutton").attr('disabled', true); |
1308 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1187 | 1309 | $('#deleteFolderMessage').text("內嚗迤嚗窈蝔..."); |
1188 | 1310 | $.ajax({ |
1189 | 1311 | type : "POST", |
... | ... | @@ -1199,24 +1321,29 @@ function deleteFolder(folderId) { |
1199 | 1321 | if (result == "noAuthorized") { |
1200 | 1322 | $('#deleteFolderMessage').text("內嚗鋡急辣憭孵仃韐"); |
1201 | 1323 | $("#dmbutton").attr('disabled', false); |
1324 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1202 | 1325 | } else if (result == "errorParameter") { |
1203 | 1326 | $('#deleteFolderMessage').text("內嚗銝迤蝖殷辣憭孵仃韐"); |
1204 | 1327 | $("#dmbutton").attr('disabled', false); |
1328 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1205 | 1329 | } else if (result == "cannotDeleteFolder") { |
1206 | 1330 | $('#deleteFolderMessage').text("內嚗秤嚗辣憭"); |
1207 | 1331 | $("#dmbutton").attr('disabled', false); |
1332 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1208 | 1333 | } else if (result == "deleteFolderSuccess") { |
1209 | 1334 | $('#deleteFolderModal').modal('hide'); |
1210 | 1335 | showFolderView(locationpath); |
1211 | 1336 | } else { |
1212 | 1337 | $('#deleteFolderMessage').text("內嚗秤嚗辣憭"); |
1213 | 1338 | $("#dmbutton").attr('disabled', false); |
1339 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1214 | 1340 | } |
1215 | 1341 | } |
1216 | 1342 | }, |
1217 | 1343 | error : function() { |
1218 | 1344 | $('#deleteFolderMessage').text("內嚗秤嚗辣憭"); |
1219 | 1345 | $("#dmbutton").attr('disabled', false); |
1346 | + $("#cancelDeleteFolderBtn").attr('disabled', true); | |
1220 | 1347 | } |
1221 | 1348 | }); |
1222 | 1349 | } |
... | ... | @@ -1232,15 +1359,15 @@ function showRenameFolderModel(folderId, folderName, type) { |
1232 | 1359 | } |
1233 | 1360 | |
1234 | 1361 | // 靽格蝻辣憭寧漲漣 |
1235 | -function changeEditFolderType(type){ | |
1362 | +function changeEditFolderType(type) { | |
1236 | 1363 | $("#editfoldertype").text(folderTypes[type]); |
1237 | - $("#newfoldername").attr("folderConstraintLevel",type+""); | |
1364 | + $("#newfoldername").attr("folderConstraintLevel", type + ""); | |
1238 | 1365 | } |
1239 | 1366 | |
1240 | 1367 | // 銵辣憭 |
1241 | 1368 | function renameFolder(folderId) { |
1242 | 1369 | var newName = $("#newfoldername").val(); |
1243 | - var fc=$("#newfoldername").attr("folderConstraintLevel"); | |
1370 | + var fc = $("#newfoldername").attr("folderConstraintLevel"); | |
1244 | 1371 | var reg = new RegExp("[\/\|\\\\\*\\<\\>\\?\\:\\&\\$" + '"' + "]+", "g"); |
1245 | 1372 | if (newName.length == 0) { |
1246 | 1373 | showRFolderAlert("內嚗辣憭孵妍銝銝箇征"); |
... | ... | @@ -1299,12 +1426,12 @@ function showRFolderAlert(txt) { |
1299 | 1426 | function showUploadFileModel() { |
1300 | 1427 | $("#uploadFileAlert").hide(); |
1301 | 1428 | $("#uploadFileAlert").text(""); |
1302 | - if(isUpLoading==false){ | |
1429 | + if (isUpLoading == false) { | |
1303 | 1430 | $("#filepath").removeAttr("disabled"); |
1304 | 1431 | $("#uploadfile").val(""); |
1305 | 1432 | $("#filepath").val(""); |
1306 | 1433 | $("#pros").width("0%"); |
1307 | - $("#pros").attr('aria-valuenow','0'); | |
1434 | + $("#pros").attr('aria-valuenow', '0'); | |
1308 | 1435 | $("#umbutton").attr('disabled', false); |
1309 | 1436 | $("#filecount").text(""); |
1310 | 1437 | $("#uploadstatus").html(""); |
... | ... | @@ -1321,7 +1448,7 @@ function checkpath() { |
1321 | 1448 | } |
1322 | 1449 | |
1323 | 1450 | // 葉辣 |
1324 | -function getInputUpload(){ | |
1451 | +function getInputUpload() { | |
1325 | 1452 | fs = $("#uploadfile").get(0).files; |
1326 | 1453 | showfilepath(); |
1327 | 1454 | } |
... | ... | @@ -1345,12 +1472,12 @@ function showfilepath() { |
1345 | 1472 | |
1346 | 1473 | // 璉辣憭 |
1347 | 1474 | function checkUploadFile() { |
1348 | - if(isUpLoading==false && isImporting == false){ | |
1349 | - if(fs!=null&&fs.length>0){ | |
1350 | - $("#filepath").attr("disabled","disabled"); | |
1475 | + if (isUpLoading == false && isImporting == false) { | |
1476 | + if (fs != null && fs.length > 0) { | |
1477 | + $("#filepath").attr("disabled", "disabled"); | |
1351 | 1478 | $("#umbutton").attr('disabled', true); |
1352 | - isUpLoading=true; | |
1353 | - repeModelList=null; | |
1479 | + isUpLoading = true; | |
1480 | + repeModelList = null; | |
1354 | 1481 | $("#uploadFileAlert").hide(); |
1355 | 1482 | $("#uploadFileAlert").text(""); |
1356 | 1483 | var filenames = new Array(); |
... | ... | @@ -1358,62 +1485,67 @@ function checkUploadFile() { |
1358 | 1485 | var maxFileIndex = 0; |
1359 | 1486 | for (var i = 0; i < fs.length; i++) { |
1360 | 1487 | filenames[i] = fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi, "$1"); |
1361 | - if(fs[i].size > maxSize){ | |
1488 | + if (fs[i].size > maxSize) { | |
1362 | 1489 | maxSize = fs[i].size; |
1363 | 1490 | maxFileIndex = i; |
1364 | 1491 | } |
1365 | 1492 | } |
1366 | 1493 | var namelist = JSON.stringify(filenames); |
1367 | - | |
1368 | - $.ajax({ | |
1369 | - type : "POST", | |
1370 | - dataType : "text", | |
1371 | - data : { | |
1372 | - folderId : locationpath, | |
1373 | - namelist : namelist, | |
1374 | - maxSize : maxSize, | |
1375 | - maxFileIndex : maxFileIndex | |
1376 | - }, | |
1377 | - url : "homeController/checkUploadFile.ajax", | |
1378 | - success : function(result) { | |
1379 | - if (result == "mustLogin") { | |
1380 | - window.location.href = "prv/login.html"; | |
1381 | - } else { | |
1382 | - switch (result) { | |
1383 | - case "errorParameter": | |
1384 | - showUploadFileAlert("內嚗銝迤蝖殷憪"); | |
1385 | - break; | |
1386 | - case "noAuthorized": | |
1387 | - showUploadFileAlert("內嚗鋡急憪"); | |
1388 | - break; | |
1389 | - case "filesTotalOutOfLimit": | |
1390 | - showUploadFileAlert("內嚗砲辣憭孵辣歇颲曆銝凋憭辣隞亙銝隞辣憭孵"); | |
1391 | - break; | |
1392 | - default: | |
1393 | - var resp=eval("("+result+")"); | |
1394 | - if(resp.checkResult == "fileTooLarge"){ | |
1395 | - showUploadFileAlert("內嚗辣["+resp.overSizeFile+"]妖頞憭折嚗"+resp.maxUploadFileSize+"嚗憪"); | |
1396 | - }else if(resp.checkResult == "hasExistsNames"){ | |
1397 | - repeList=resp.pereFileNameList; | |
1398 | - repeIndex=0; | |
1399 | - selectFileUpLoadModelStart(); | |
1400 | - }else if(resp.checkResult == "permitUpload"){ | |
1401 | - doupload(1); | |
1402 | - }else { | |
1403 | - showUploadFileAlert("內嚗秤嚗憪"); | |
1494 | + | |
1495 | + $ | |
1496 | + .ajax({ | |
1497 | + type : "POST", | |
1498 | + dataType : "text", | |
1499 | + data : { | |
1500 | + folderId : locationpath, | |
1501 | + namelist : namelist, | |
1502 | + maxSize : maxSize, | |
1503 | + maxFileIndex : maxFileIndex | |
1504 | + }, | |
1505 | + url : "homeController/checkUploadFile.ajax", | |
1506 |