diff --git a/.DS_Store b/.DS_Store
index 64a7334..802fe87 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/README.md b/README.md
index edcf2f0..e4af5f6 100644
--- a/README.md
+++ b/README.md
@@ -76,9 +76,10 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
> 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
-### 常规更新v1.0.14
-_本次更新修复了一些已经发现的重要问题,推荐所有用户升级。_
-+ 修正了文件导出功能中,“覆盖”与“保留两者”的实际操作相反的问题。这一问题是由于编码时疏忽造成的,其可能会导致用户在导出时意外丢失文件,请及时更新修正。
+### 新版本v1.0.15
+_本次更新增加了提高可用性的新功能,同时修复了一些已知问题,推荐所有用户升级。_
++ Word文档在线预览——现在,众多用户期待已久的Word文档在线预览功能正式上线,方便办公使用。Word预览功能提供docx格式的在线打开和预览,且该功能无需额外安装任何插件,可免费用于商业用途。注:在线预览展示的格式可能会与官方Word格式有所差异。
++ 修正“上传”权限可能导致的越权问题——当用户具备“上传”权限时,可能会恶意上传同名文件并覆盖原文件,从而导致原文件丢失。为避免该漏洞导致的越权现象,现已将其修复为:当用户上传同名文件时,如仅具备“上传”权限,则能选择“跳过”和“保留两者”;如同时具备“删除”权限,可额外选择“覆盖”,从而避免您的文件丢失。
> 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
diff --git a/fonts/COPYING b/fonts/COPYING
new file mode 100644
index 0000000..30438f8
--- /dev/null
+++ b/fonts/COPYING
@@ -0,0 +1,341 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
diff --git a/kiftd-1.0.14-RELEASE.jar b/fonts/wqy-zenhei.ttc
similarity index 51%
rename from kiftd-1.0.14-RELEASE.jar
rename to fonts/wqy-zenhei.ttc
index 9c46c1d..a89ec00 100644
Binary files a/kiftd-1.0.14-RELEASE.jar and b/fonts/wqy-zenhei.ttc differ
diff --git a/kiftd-1.0.15-RELEASE.jar b/kiftd-1.0.15-RELEASE.jar
new file mode 100644
index 0000000..3141d54
Binary files /dev/null and b/kiftd-1.0.15-RELEASE.jar differ
diff --git "a/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" "b/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf"
index 16427bb..2c30715 100644
Binary files "a/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" and "b/kiftd\350\257\264\346\230\216\346\226\207\346\241\243.pdf" differ
diff --git a/webContext/home.html b/webContext/home.html
index 502af36..8d44240 100644
--- a/webContext/home.html
+++ b/webContext/home.html
@@ -382,7 +382,7 @@ 提示:存在同名文件!
全部应用
- 覆盖
跳过
diff --git a/webContext/js/home.js b/webContext/js/home.js
index 4dd1533..6d081e4 100644
--- a/webContext/js/home.js
+++ b/webContext/js/home.js
@@ -777,6 +777,13 @@ function showFolderTable(folderView) {
+ fi.fileId
+ '"'
+ ")' class='btn btn-link btn-xs'> 播放";
+ } else if(getSuffix(fi.fileName) == "docx"){
+ fileRow = fileRow
+ + " 预览 ";
}
}
if (aD) {
@@ -1124,6 +1131,12 @@ var repeModelList;// 这个是对每一个重复文件选取的上传模式,
// 针对同名文件,选择上传的模式:跳过(skip)、覆盖(cover)和保留两者(both)
function selectFileUpLoadModelStart(){
+ var authList = originFolderView.authList;
+ if(checkAuth(authList, "D")){
+ $("#uploadcoverbtn").show();
+ }else{
+ $("#uploadcoverbtn").hide();
+ }
$("#selectFileUpLoadModelAlert").show();
$("#repeFileName").text(repeList[repeIndex]);
}
@@ -1444,6 +1457,10 @@ function pdfView(filePath) {
window.open("/pdfview/web/viewer.html?file=/fileblocks/" + filePath);
}
+function docxView(fileId){
+ window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/" + fileId);
+}
+
// 查看图片
function showPicture(fileId) {
$.ajax({
@@ -2064,7 +2081,7 @@ function selectFileMoveModel(t){
}
}
-
+// 发送移动文件请求
function sendMoveFilesReq(){
// 执行移动行为
var strOptMap = JSON.stringify(strMoveOptMap);
diff --git a/webContext/js/home.min.js b/webContext/js/home.min.js
index 946f18e..58548ad 100644
--- a/webContext/js/home.min.js
+++ b/webContext/js/home.min.js
@@ -1,2 +1,2 @@
-function changeFilesTableStyle(){var a=$(window).width();800>a?($("#filetableheadera").addClass("filetableheaderstyle"),$(".hiddenColumn").hide(),$(".rightbtn").hide(),$("#vicetbbox").show(),$("#filetableoptmenusreach").hide()):($("#filetableheadera").removeClass("filetableheaderstyle"),$(".hiddenColumn").show(),$(".rightbtn").show(),$("#vicetbbox").hide(),$("#filetableoptmenusreach").show()),768>a?($("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){"mustLogin"==a&&(window.location.href="login.html"),$("#serverOS").text(a)},error:function(){$("#serverOS").html("获取失败,点击重试 ")}})}function showFolderView(fid){startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){endLoading(),"mustLogin"==result?window.location.href="login.html":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView))},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新 "),$("#publishTime").html("获取失败,请尝试刷新 "),$("#parentlistbox").html("获取失败,请尝试刷新 ")}})}function startLoading(){$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled","disabled"),$("#accountpwd").removeAttr("disabled","disabled"),$("#dologinButton").removeAttr("disabled","disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append("
"+b.folderName+" ")}):$("#parentFolderList").html("无 "),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").addClass("glyphicon-home")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append("注销 ["+a.account+"] "),$("#tb2").append("注销 ["+a.account+"] ")):($("#tb").append("登入 "),$("#tb2").append("登入 "));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),$("#fileListDropDown li a").attr("href","javascript:void(0);"),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()")),checkAuth(b,"L")?$("#packageDownloadBox").html(" 打包下载 "):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","startMoveFile()"),void 0!==checkedMovefiles&&checkedMovefiles.length>0&&($("#cutSignTx").text("粘贴("+checkedMovefiles.length+")"),$("#cutSignTx").addClass("cuted"))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root")}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e;$("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("../ -- -- -- -- "),b=a.authList,c=!1,d=!1,e=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),$.each(a.folderList,function(a,b){var e="/"+b.folderName+" "+b.folderCreationDate+" -- "+b.folderCreator+" ";c&&(e=e+" 删除 "),d&&(e=e+" 编辑 "),d||c||(e+="--"),e+=" ",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var f=""+b.fileName+" "+b.fileCreationDate+" ";"0"==b.fileSize?f+="<1MB ":f=f+""+b.fileSize+"MB ",f=f+""+b.fileCreator+" ",e&&(f=f+" 下载 ","mp4"==getSuffix(b.fileName)||"webm"==getSuffix(b.fileName)||"mov"==getSuffix(b.fileName)?f=f+" 播放 ":"pdf"==getSuffix(b.fileName)?f=f+" 预览 ":"jpg"==getSuffix(b.fileName)||"jpeg"==getSuffix(b.fileName)||"gif"==getSuffix(b.fileName)||"png"==getSuffix(b.fileName)||"bmp"==getSuffix(b.fileName)?f=f+" 查看 ":("mp3"==getSuffix(b.fileName)||"wav"==getSuffix(b.fileName)||"ogg"==getSuffix(b.fileName))&&(f=f+" 播放 ")),c&&(f=f+" 删除 "),d&&(f=f+" 重命名 "),d||c||e||(f+="--"),f+=" ",$("#foldertable").append(f)}),changeFilesTableStyle()}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>20?showFolderAlert("提示:文件夹名称太长。"):c.test(a)?($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showFolderAlert("提示:您的操作未被授权,创建文件夹失败。"):"errorParameter"==a?showFolderAlert("提示:参数不正确,创建文件夹失败。"):"cannotCreateFolder"==a?showFolderAlert("提示:出现意外错误,可能未能创建文件夹。"):"nameOccupied"==a?showFolderAlert("提示:该名称已被占用,请选取其他名称。"):"createFolderSuccess"==a?($("#newFolderModal").modal("hide"),showFolderView(locationpath)):($("#newFolderModal").modal("hide"),showFolderView(locationpath))},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}})):showFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。")}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html("删除 "),$("#dmbutton").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html("修改 "),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>20?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)?($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}})):showRFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。")}function showRFolderAlert(a){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),filenames=new Array,i=0;i1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),xhr.onloadend=function(){if(200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("未找到要上传的文件[失败]
")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").addClass("alert"),$("#uploadFileAlert").addClass("alert-danger"),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function showDownloadModel(a,b){$("#downloadModal").modal("toggle"),$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html(""+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+a+" "),$("#downloadFileBox").html("开始下载 "),$("#dlmbutton").attr("disabled",!1)}function dodownload(a){$("#dlmbutton").attr("disabled",!0),$("#downloadFileName").text("提示:准备开始下载,请稍候..."),setTimeout("$('#downloadModal').modal('hide');",800),window.location.href="homeController/downloadFile.do?fileId="+a}function showDeleteFileModel(a,b){$("#deleteFileBox").html("删除 "),$("#dfmbutton").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html("修改 "),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\s\\\\*\\<\\>"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:空格 引号 / * | < > 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function abortUpload(){isUpLoading=!1,null!=xhr&&(xhr.abort(),$("#umbutton").attr("disabled",!1),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#filecount").text("")),$("#uploadfile").val(""),$("#filepath").val(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/fileblocks/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b "):$(a).append(" ");viewer=$(a),viewer.viewer({loop:!1,hidden:function(){viewer.data("viewer").destroy(),viewer=null}})}viewer.viewer("view",pvl.index),viewer.viewer("show",!0)}function createViewListByPage(){var a,b,c;if(null==viewer){for(a=document.createElement("ul"),b=(viewerPageIndex-1)*viewerPageSize,viewerPageIndex>1&&$(a).append(" "),c=0;viewerPageSize>c&&c "):$(a).append(" ");viewerTotal>viewerPageIndex&&$(a).append(" "),viewer=$(a),viewer.viewer({loop:!1,view:function(a){0==a.detail.index&&1!=viewerPageIndex?(viewerPageIndex--,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewerPageIndex>1?viewer.viewer("view",viewerPageSize):viewer.viewer("view",viewerPageSize-1)):(a.detail.index==viewerPageSize+1||a.detail.index==viewerPageSize&&1==viewerPageIndex)&&(viewerPageIndex++,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewer.viewer("view",1))},hidden:function(){viewer.data("viewer").destroy(),viewer.empty(),viewer=null}})}}function isShift(a){var b=window.event||a;return b.shiftKey?!0:!1}function checkfile(a,b){isShift(a)?$("#"+b).hasClass("info")?$("#"+b).removeClass("info"):$("#"+b).addClass("info"):($(".filerow").removeClass("info"),$("#"+b).addClass("info"))}function checkConsFile(a,b){var c,d,e;if(isShift(a)&&(c=$("#"+b),d=c.index(),e=$(".filerow.info:last").index(),-1!=e))if(d>e)for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.prev();else for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.next()}function getCheckedFilesAndFolders(){var b,c,d,e,a=new Object;for(a.size=0,b=new Array,c=new Array,d=$(".info").get(),e=0;e开始下载"),$("#dclmbutton").attr("disabled",!1)),$("#downloadAllCheckedModal").modal("toggle")}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?$("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。")}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html("全部删除 "),$("#deleteFileMessage").text("提示:确定要彻底删除这"+a.size+"项么?该操作不可恢复!")),$("#deleteFileModal").modal("toggle")}function deleteAllChecked(){var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html(" ")}),ap.on("play",function(){$("#playOrPause").html(" ")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()
-},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("全部移动 "),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):($("#cutSignTx").html("粘贴("+checkedMovefiles.size+") +V "),$("#cutSignTx").addClass("cuted")))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath},url:"homeController/confirmMoveFiles.ajax",success:function(result){"mustLogin"==result?window.location.href="login.html":"noAuthorized"==result?($("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1)):"errorParameter"==result?($("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"cannotMoveFiles"==result?($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"confirmMoveFiles"==result?(strMoveOptMap={},sendMoveFilesReq()):result.startsWith("duplicationFileName:")?(repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName),$("#selectFileMoveModelAlert").show()):result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)repeIndexrepeIndex?repeIndexc;c++)b.test(originFolderView.folderList[c].folderName)&&screenedFoldrView.folderList.push(originFolderView.folderList[c]);for(c=0,d=originFolderView.fileList.length;d>c;c++)b.test(originFolderView.fileList[c].fileName)&&screenedFoldrView.fileList.push(originFolderView.fileList[c]);$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}else screenedFoldrView=null,showOriginFolderView()}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}endLoading()}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,locationpath="root",parentpath="null",isUpLoading=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:单击 :选中某一文件Shift +单击 :选中多个文件Shift +双击 :选中连续的文件Shitf +A :选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS(),showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#accountid").val(""),$("#accountpwd").val("")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b"+folderTypes[b]+" ")}else $("#foldertypelist").append(""+folderTypes[0]+" ")}),$("#newFolderModal").on("shown.bs.modal",function(){$("#foldername").focus()}),$("#uploadFileModal").on("hidden.bs.modal",function(){isUpLoading&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b"+folderTypes[b]+" ");else $("#editfoldertypelist").append(""+folderTypes[0]+" ")}),document.ondragover=function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)},document.ondrop=function(a){var b,c,d,e,f,g;if(a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1),null!=folderView.authList)if(checkAuth(folderView.authList,"U"))if(isUpLoading)alert("提示:您正在执行另一项上传任务,请在上传窗口关闭后再试。");else if(window.ActiveXObject||"ActiveXObject"in window)alert("提示:IE浏览器不支持拖拽上传。您可以使用现代浏览器或将浏览模式切换为“极速模式”来体验该功能。");else{if(b=null!=a.dataTransfer?a.dataTransfer:window.event.dataTransfer,c=!0,void 0!==b.items)for(d=0;d +C"),$("#cutSignTx").removeClass("cuted"),$("#moveFilesBox").html("")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),$("#folderInfoModal").on("show.bs.modal",function(){var b=folderView.folder;$("#fim_name").text(b.folderName),$("#fim_creator").text(b.folderCreator),$("#fim_folderCreationDate").text(b.folderCreationDate),$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")})}),folderTypes=["公开的","仅小组","仅创建者"];
\ No newline at end of file
+function changeFilesTableStyle(){var a=$(window).width();800>a?($("#filetableheadera").addClass("filetableheaderstyle"),$(".hiddenColumn").hide(),$(".rightbtn").hide(),$("#vicetbbox").show(),$("#filetableoptmenusreach").hide()):($("#filetableheadera").removeClass("filetableheaderstyle"),$(".hiddenColumn").show(),$(".rightbtn").show(),$("#vicetbbox").hide(),$("#filetableoptmenusreach").show()),768>a?($("#filetableheadera").attr("data-toggle","collapse"),$("#filetableheadera").attr("data-target","#filetableoptmenu"),$("#mdropdownicon").html("(点击展开/折叠菜单)")):($("#filetableheadera").attr("data-toggle","modal"),$("#filetableheadera").attr("data-target","#folderInfoModal"),$("#mdropdownicon").html(""))}function doAlert(){alert("错误:无法连接到kiftd服务器,请检查您的网络连接或查看服务器运行状态。")}function getServerOS(){$.ajax({type:"POST",dataType:"text",data:{},url:"homeController/getServerOS.ajax",success:function(a){"mustLogin"==a&&(window.location.href="login.html"),$("#serverOS").text(a)},error:function(){$("#serverOS").html("获取失败,点击重试 ")}})}function showFolderView(fid){startLoading(),$.ajax({type:"POST",dataType:"text",data:{fid:fid},url:"homeController/getFolderView.ajax",success:function(result){endLoading(),"mustLogin"==result?window.location.href="login.html":"notAccess"==result?window.location.href="/":(folderView=eval("("+result+")"),locationpath=folderView.folder.folderId,parentpath=folderView.folder.folderParent,constraintLevel=folderView.folder.folderConstraint,screenedFoldrView=null,$("#sreachKeyWordIn").val(""),showParentList(folderView),showAccountView(folderView),showPublishTime(folderView),originFolderView=$.extend(!0,{},folderView),$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),showFolderTable(folderView))},error:function(){endLoading(),doAlert(),$("#tb").html("获取失败,请尝试刷新 "),$("#publishTime").html("获取失败,请尝试刷新 "),$("#parentlistbox").html("获取失败,请尝试刷新 ")}})}function startLoading(){$("#loadingModal").modal({backdrop:"static",keyboard:!1}),$("#loadingModal").modal("show"),$("#loadingModal").addClass("shown")}function endLoading(){$("#loadingModal").modal("hide"),$("#loadingModal").removeClass("shown")}function startLogin(){$("#accountid").attr("disabled","disabled"),$("#accountpwd").attr("disabled","disabled"),$("#dologinButton").attr("disabled","disabled")}function finishLogin(){$("#accountid").removeAttr("disabled","disabled"),$("#accountpwd").removeAttr("disabled","disabled"),$("#dologinButton").removeAttr("disabled","disabled")}function dologin(){var accountId=$("#accountid").val(),accountPwd=$("#accountpwd").val(),check="y";0==accountId.length?($("#accountidbox").addClass("has-error"),check="n"):$("#accountidbox").removeClass("has-error"),0==accountPwd.length?($("#accountpwdbox").addClass("has-error"),check="n"):$("#accountpwdbox").removeClass("has-error"),"y"==check&&(startLogin(),$.ajax({url:"homeController/getPublicKey.ajax",type:"POST",data:{},dataType:"text",success:function(result){var encrypted,publicKeyInfo=eval("("+result+")"),date=new Date,loginInfo='{accountId:"'+accountId+'",accountPwd:"'+accountPwd+'",time:"'+publicKeyInfo.time+'"}',encrypt=new JSEncrypt;encrypt.setPublicKey(publicKeyInfo.publicKey),encrypted=encrypt.encrypt(loginInfo),sendLoginInfo(encrypted)},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}}))}function sendLoginInfo(a){$.ajax({type:"POST",dataType:"text",url:"homeController/doLogin.ajax",data:{encrypted:a},success:function(a){switch(finishLogin(),$("#alertbox").removeClass("alert"),$("#alertbox").removeClass("alert-danger"),$("#alertbox").text(""),a){case"permitlogin":$("#accountidbox").removeClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#loginModal").modal("hide"),showFolderView(locationpath);break;case"accountnotfound":$("#accountidbox").addClass("has-error"),$("#accountpwdbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,账户不存在或未设置");break;case"accountpwderror":$("#accountpwdbox").addClass("has-error"),$("#accountidbox").removeClass("has-error"),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,密码错误或未设置");break;case"error":$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");break;default:$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:无法登录,未知错误")}},error:function(){finishLogin(),$("#alertbox").addClass("alert"),$("#alertbox").addClass("alert-danger"),$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态")}})}function dologout(){$("#logoutModal").modal("hide"),$.ajax({url:"homeController/doLogout.ajax",type:"POST",data:{},dataType:"text",success:function(a){"SUCCESS"==a&&showFolderView(locationpath)},error:function(){doAlert()}})}function showParentList(a){$("#parentFolderList").html("");var b=a.folder;a.parentList.length>0?$.each(a.parentList,function(a,b){$("#parentFolderList").append(""+b.folderName+" ")}):$("#parentFolderList").html("无 "),b.folderName.length>6?$("#currentFolderName").text(b.folderName.substr(0,6)+"..."):$("#currentFolderName").text(b.folderName),"ROOT"==b.folderName?($("#folderIconSpan").removeClass("glyphicon-folder-close"),$("#folderIconSpan").addClass("glyphicon-home")):($("#folderIconSpan").removeClass("glyphicon-home"),$("#folderIconSpan").addClass("glyphicon-folder-close"))}function showAccountView(a){$("#tb,#tb2").html(""),account=a.account,null!=a.account?($("#tb").append("注销 ["+a.account+"] "),$("#tb2").append("注销 ["+a.account+"] ")):($("#tb").append("登入 "),$("#tb2").append("登入 "));var b=a.authList;$("#fileListDropDown li").addClass("disabled"),$("#fileListDropDown li a").attr("onclick",""),$("#fileListDropDown li a").attr("href","javascript:void(0);"),null!=b&&(checkAuth(b,"C")&&($("#createFolderButtonLi").removeClass("disabled"),$("#createFolderButtonLi a").attr("onclick","showNewFolderModel()")),checkAuth(b,"U")&&($("#uploadFileButtonLi").removeClass("disabled"),$("#uploadFileButtonLi a").attr("onclick","showUploadFileModel()")),checkAuth(b,"L")?$("#packageDownloadBox").html(" 打包下载 "):$("#packageDownloadBox").html(""),checkAuth(b,"D")&&($("#deleteSeelectFileButtonLi").removeClass("disabled"),$("#deleteSeelectFileButtonLi a").attr("onclick","showDeleteAllCheckedModel()")),checkAuth(b,"M")&&($("#cutFileButtonLi").removeClass("disabled"),$("#cutFileButtonLi a").attr("onclick","startMoveFile()"),void 0!==checkedMovefiles&&checkedMovefiles.length>0&&($("#cutSignTx").text("粘贴("+checkedMovefiles.length+")"),$("#cutSignTx").addClass("cuted"))))}function checkAuth(a,b){var c=!1;return $.each(a,function(a,d){d==b&&(c=!0)}),c}function showPublishTime(a){$("#publishTime").html("");var b="";b=null!=a.publishTime?a.publishTime:"--",$("#publishTime").text(b)}function refreshFolderView(){null!=locationpath&&locationpath.length>0?showFolderView(locationpath):showFolderView("root")}function returnPF(){null!=parentpath&&"null"!=parentpath?showFolderView(parentpath):showFolderView("root")}function showFolderTable(a){var b,c,d,e;$("#foldertable").html(""),null!=parentpath&&"null"!=parentpath&&$("#foldertable").append("../ -- -- -- -- "),b=a.authList,c=!1,d=!1,e=!1,checkAuth(b,"D")&&(c=!0),checkAuth(b,"R")&&(d=!0),checkAuth(b,"L")&&(e=!0),$.each(a.folderList,function(a,b){var e="/"+b.folderName+" "+b.folderCreationDate+" -- "+b.folderCreator+" ";c&&(e=e+" 删除 "),d&&(e=e+" 编辑 "),d||c||(e+="--"),e+=" ",$("#foldertable").append(e)}),$.each(a.fileList,function(a,b){var f=""+b.fileName+" "+b.fileCreationDate+" ";"0"==b.fileSize?f+="<1MB ":f=f+""+b.fileSize+"MB ",f=f+""+b.fileCreator+" ",e&&(f=f+" 下载 ","mp4"==getSuffix(b.fileName)||"webm"==getSuffix(b.fileName)||"mov"==getSuffix(b.fileName)?f=f+" 播放 ":"pdf"==getSuffix(b.fileName)?f=f+" 预览 ":"jpg"==getSuffix(b.fileName)||"jpeg"==getSuffix(b.fileName)||"gif"==getSuffix(b.fileName)||"png"==getSuffix(b.fileName)||"bmp"==getSuffix(b.fileName)?f=f+" 查看 ":"mp3"==getSuffix(b.fileName)||"wav"==getSuffix(b.fileName)||"ogg"==getSuffix(b.fileName)?f=f+" 播放 ":"docx"==getSuffix(b.fileName)&&(f=f+" 预览 ")),c&&(f=f+" 删除 "),d&&(f=f+" 重命名 "),d||c||e||(f+="--"),f+=" ",$("#foldertable").append(f)}),changeFilesTableStyle()}function showNewFolderModel(){$("#newFolderModal").modal("show")}function changeNewFolderType(a){$("#newfoldertype").text(folderTypes[a]),$("#foldername").attr("folderConstraintLevel",a+"")}function createfolder(){var a=$("#foldername").val(),b=$("#foldername").attr("folderConstraintLevel"),c=new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==a.length?showFolderAlert("提示:文件夹名称不能为空。"):a.length>20?showFolderAlert("提示:文件夹名称太长。"):c.test(a)?($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{parentId:locationpath,folderName:a,folderConstraint:b},url:"homeController/newFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showFolderAlert("提示:您的操作未被授权,创建文件夹失败。"):"errorParameter"==a?showFolderAlert("提示:参数不正确,创建文件夹失败。"):"cannotCreateFolder"==a?showFolderAlert("提示:出现意外错误,可能未能创建文件夹。"):"nameOccupied"==a?showFolderAlert("提示:该名称已被占用,请选取其他名称。"):"createFolderSuccess"==a?($("#newFolderModal").modal("hide"),showFolderView(locationpath)):($("#newFolderModal").modal("hide"),showFolderView(locationpath))},error:function(){showFolderAlert("提示:出现意外错误,可能未能创建文件夹")}})):showFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。")}function showFolderAlert(a){$("#folderalert").addClass("alert"),$("#folderalert").addClass("alert-danger"),$("#foldernamebox").addClass("has-error"),$("#folderalert").text(a)}function entryFolder(a){showFolderView(a)}function showDeleteFolderModel(a,b){$("#deleteFolderBox").html("删除 "),$("#dmbutton").attr("disabled",!1),$("#deleteFolderMessage").text("提示:确定要彻底删除文件夹:["+b+"]及其全部内容么?该操作不可恢复"),$("#deleteFolderModal").modal("toggle")}function deleteFolder(a){$("#dmbutton").attr("disabled",!0),$("#deleteFolderMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{folderId:a},url:"homeController/deleteFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFolderMessage").text("提示:您的操作未被授权,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFolderMessage").text("提示:参数不正确,删除文件夹失败"),$("#dmbutton").attr("disabled",!1)):"cannotDeleteFolder"==a?($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)):"deleteFolderSuccess"==a?($("#deleteFolderModal").modal("hide"),showFolderView(locationpath)):($("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1))},error:function(){$("#deleteFolderMessage").text("提示:出现意外错误,可能未能删除文件夹"),$("#dmbutton").attr("disabled",!1)}})}function showRenameFolderModel(a,b,c){$("#renameFolderBox").html("修改 "),$("#newfoldername").val(b),changeEditFolderType(c),$("#renameFolderModal").modal("show")}function changeEditFolderType(a){$("#editfoldertype").text(folderTypes[a]),$("#newfoldername").attr("folderConstraintLevel",a+"")}function renameFolder(a){var b=$("#newfoldername").val(),c=$("#newfoldername").attr("folderConstraintLevel"),d=new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$","g");0==b.length?showRFolderAlert("提示:文件夹名称不能为空。"):b.length>20?showRFolderAlert("提示:文件夹名称太长。"):d.test(b)?($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$.ajax({type:"POST",dataType:"text",data:{folderId:a,newName:b,folderConstraint:c},url:"homeController/renameFolder.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?showRFolderAlert("提示:您的操作未被授权,编辑失败。"):"errorParameter"==a?showRFolderAlert("提示:参数不正确,编辑失败,请刷新后重试。"):"nameOccupied"==a?showRFolderAlert("提示:该名称已被占用,请选取其他名称。"):"renameFolderSuccess"==a?($("#renameFolderModal").modal("hide"),showFolderView(locationpath)):showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")},error:function(){showRFolderAlert("提示:出现意外错误,可能未能编辑文件夹,请刷新后重试。")}})):showRFolderAlert("提示:文件夹名只能包含英文字母、数组、汉字和下划线。")}function showRFolderAlert(a){$("#newfolderalert").addClass("alert"),$("#newfolderalert").addClass("alert-danger"),$("#folderrenamebox").addClass("has-error"),$("#newfolderalert").text(a)}function showUploadFileModel(){$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),0==isUpLoading&&($("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#selectFileUpLoadModelAsAll").removeAttr("checked"),$("#selectFileUpLoadModelAlert").hide()),$("#uploadFileModal").modal("show")}function checkpath(){$("#uploadfile").click()}function getInputUpload(){fs=$("#uploadfile").get(0).files,showfilepath()}function showfilepath(){var b,a="";for(b=0;b0){for($("#filepath").attr("disabled","disabled"),$("#umbutton").attr("disabled",!0),isUpLoading=!0,repeModelList=null,$("#uploadFileAlert").removeClass("alert"),$("#uploadFileAlert").removeClass("alert-danger"),$("#uploadFileAlert").text(""),filenames=new Array,i=0;i1&&$("#filecount").text("("+a+"/"+b+")"),$("#uploadstatus").prepend(""+d+"[正在上传...]
"),xhr=new XMLHttpRequest,e=new FormData,e.append("file",c),e.append("folderId",locationpath),null!=repeModelList&&null!=repeModelList[d]){if("skip"==repeModelList[d])return $("#uls_"+a).text("[已完成]"),b>a?(doupload(a+1),void 0):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath),void 0);e.append("repeType",repeModelList[d])}xhr.open("POST","homeController/douploadFile.ajax",!0),xhr.upload.addEventListener("progress",uploadProgress,!1),xhr.send(e),xhr.onloadend=function(){if(200===xhr.status){var c=xhr.responseText;"uploadsuccess"==c?($("#uls_"+a).text("[已完成]"),b>a?doupload(a+1):(isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadfile").val(""),$("#filepath").val(""),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#umbutton").attr("disabled",!1),$("#filecount").text(""),$("#uploadstatus").text(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath))):"uploaderror"==c?(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")):(showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]"))}else showUploadFileAlert("提示:出现意外错误,文件:["+d+"]上传失败,上传被中断。"),$("#uls_"+a).text("[失败]")}}else showUploadFileAlert("提示:要上传的文件不存在。"),$("#uploadstatus").prepend("未找到要上传的文件[失败]
")}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(100*a.loaded/a.total);$("#pros").width(b+"%"),$("#pros").attr("aria-valuenow",""+b)}}function showUploadFileAlert(a){isUpLoading=!1,$("#filepath").removeAttr("disabled"),$("#uploadFileAlert").addClass("alert"),$("#uploadFileAlert").addClass("alert-danger"),$("#uploadFileAlert").text(a),$("#umbutton").attr("disabled",!1)}function showDownloadModel(a,b){$("#downloadModal").modal("toggle"),$("#downloadFileName").text("提示:您确认要下载文件:["+b+"]么?"),$("#downloadHrefBox").html(""+window.location.protocol+"//"+window.location.host+"/homeController/downloadFile.do?fileId="+a+" "),$("#downloadFileBox").html("开始下载 "),$("#dlmbutton").attr("disabled",!1)}function dodownload(a){$("#dlmbutton").attr("disabled",!0),$("#downloadFileName").text("提示:准备开始下载,请稍候..."),setTimeout("$('#downloadModal').modal('hide');",800),window.location.href="homeController/downloadFile.do?fileId="+a}function showDeleteFileModel(a,b){$("#deleteFileBox").html("删除 "),$("#dfmbutton").attr("disabled",!1),$("#deleteFileMessage").text("提示:确定要彻底删除文件:["+b+"]么?该操作不可恢复"),$("#deleteFileModal").modal("toggle")}function deleteFile(a){$("#dfmbutton").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{fileId:a},url:"homeController/deleteFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,删除失败"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除文件"),$("#dfmbutton").attr("disabled",!1)}})}function showRenameFileModel(a,b){$("#newFileNamealert").removeClass("alert"),$("#newFileNamealert").removeClass("alert-danger"),$("#filerenamebox").removeClass("has-error"),$("#newFileNamealert").text(""),$("#renameFileBox").html("修改 "),$("#newfilename").val(b),$("#renameFileModal").modal("toggle")}function renameFile(a){var b=new RegExp('[/|\\s\\\\*\\<\\>"]+',"g"),c=$("#newfilename").val();c.length>0?c.length<128?b.test(c)||0==c.indexOf(".")?showRFileAlert("提示:文件名中不应含有:空格 引号 / * | < > 且不能以“.”开头。"):$.ajax({type:"POST",dataType:"text",data:{fileId:a,newFileName:c},url:"homeController/renameFile.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"cannotRenameFile"==a?showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。"):"renameFileSuccess"==a?($("#renameFileModal").modal("hide"),showFolderView(locationpath)):"errorParameter"==a?showRFileAlert("提示:参数错误,重命名失败,请刷新后重试。"):"nameOccupied"==a?showRFileAlert("提示:该名称已被占用,请选取其他名称。"):"noAuthorized"==a?showRFileAlert("提示:您的操作未被授权,重命名失败,请刷新后重试。"):showRFileAlert("提示:出现意外错误,可能未能重命名文件,请刷新后重试。")},error:function(){showRFileAlert("提示:出现意外错误,可能未能重命名文件。")}}):showRFileAlert("提示:文件名称太长。"):showRFileAlert("提示:文件名不能为空。")}function showRFileAlert(a){$("#newFileNamealert").addClass("alert"),$("#newFileNamealert").addClass("alert-danger"),$("#filerenamebox").addClass("has-error"),$("#newFileNamealert").text(a)}function abortUpload(){isUpLoading=!1,null!=xhr&&(xhr.abort(),$("#umbutton").attr("disabled",!1),$("#pros").width("0%"),$("#pros").attr("aria-valuenow","0"),$("#filecount").text("")),$("#uploadfile").val(""),$("#filepath").val(""),$("#uploadstatus").html(""),$("#selectcount").text(""),$("#uploadFileModal").modal("hide"),showFolderView(locationpath)}function getSuffix(a){var b=a.lastIndexOf("."),c=a.length,d=a.substring(b+1,c);return d.toLowerCase()}function playVideo(a){window.open("quickview/video.html?fileId="+a)}function pdfView(a){window.open("/pdfview/web/viewer.html?file=/fileblocks/"+a)}function docxView(a){window.open("/pdfview/web/viewer.html?file=/resourceController/getWordView/"+a)}function showPicture(fileId){$.ajax({url:"homeController/getPrePicture.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){if("ERROR"!=result)if(pvl=eval("("+result+")"),pvl.pictureViewList.length<=viewerPageSize)createViewList();else{viewerPageIndex=Math.ceil((pvl.index+1)/viewerPageSize),viewerTotal=Math.ceil(pvl.pictureViewList.length/viewerPageSize),createViewListByPage();var innerIndex=pvl.index-(viewerPageIndex-1)*viewerPageSize;viewerPageIndex>1&&innerIndex++,viewer.viewer("view",innerIndex),viewer.viewer("show",!0)}else alert("错误:无法定位要预览的文件或该操作未被授权。")},error:function(){alert("错误:请求失败,请刷新重试。")}})}function createViewList(){var a,b;if(null==viewer){for(a=document.createElement("ul"),b=0;b "):$(a).append(" ");viewer=$(a),viewer.viewer({loop:!1,hidden:function(){viewer.data("viewer").destroy(),viewer=null}})}viewer.viewer("view",pvl.index),viewer.viewer("show",!0)}function createViewListByPage(){var a,b,c;if(null==viewer){for(a=document.createElement("ul"),b=(viewerPageIndex-1)*viewerPageSize,viewerPageIndex>1&&$(a).append(" "),c=0;viewerPageSize>c&&c "):$(a).append(" ");viewerTotal>viewerPageIndex&&$(a).append(" "),viewer=$(a),viewer.viewer({loop:!1,view:function(a){0==a.detail.index&&1!=viewerPageIndex?(viewerPageIndex--,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewerPageIndex>1?viewer.viewer("view",viewerPageSize):viewer.viewer("view",viewerPageSize-1)):(a.detail.index==viewerPageSize+1||a.detail.index==viewerPageSize&&1==viewerPageIndex)&&(viewerPageIndex++,viewer.data("viewer").destroy(),viewer.empty(),viewer=null,createViewListByPage(),viewer.viewer("view",1))},hidden:function(){viewer.data("viewer").destroy(),viewer.empty(),viewer=null}})}}function isShift(a){var b=window.event||a;return b.shiftKey?!0:!1}function checkfile(a,b){isShift(a)?$("#"+b).hasClass("info")?$("#"+b).removeClass("info"):$("#"+b).addClass("info"):($(".filerow").removeClass("info"),$("#"+b).addClass("info"))}function checkConsFile(a,b){var c,d,e;if(isShift(a)&&(c=$("#"+b),d=c.index(),e=$(".filerow.info:last").index(),-1!=e))if(d>e)for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.prev();else for(;c[0]&&!c.hasClass("info");)c.addClass("info"),c=c.next()}function getCheckedFilesAndFolders(){var b,c,d,e,a=new Object;for(a.size=0,b=new Array,c=new Array,d=$(".info").get(),e=0;e开始下载"),$("#dclmbutton").attr("disabled",!1)),$("#downloadAllCheckedModal").modal("toggle")}function downloadAllChecked(){$("#dclmbutton").attr("disabled",!0);var a=getCheckedFilesAndFolders();$("#downloadAllCheckedName").text("提示:服务器正在对选中资源进行压缩(共"+a.size+"项),这可能需要一些时间(文件越大耗时越长),压缩完成将自动开始下载。"),$.ajax({url:"homeController/getPackTime.ajax",type:"POST",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var b;"0"!=a?(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒(预计耗时:"+a+")")},1e3)):(b=0,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒"),zipTimer=setInterval(function(){b++,$("#downloadAllCheckedLoad").text("已耗时:"+b+"秒")},1e3))},error:function(){$("#downloadAllCheckedLoad").text("(无法获取预计耗时)")}}),$.ajax({type:"POST",url:"homeController/downloadCheckedFiles.ajax",data:{strIdList:a.filesId,strFidList:a.foldersId},dataType:"text",success:function(a){var c,d;null!=zipTimer&&window.clearInterval(zipTimer),"ERROR"==a?$("#downloadAllCheckedName").text("提示:压缩过程出错。无法完成压缩,请重试或告知管理员。"):($("#downloadAllCheckedLoad").text(""),$("#downloadAllCheckedName").text("提示:压缩完成!准备开始下载..."),setTimeout("$('#downloadAllCheckedModal').modal('hide');",800),c=document.createElement("form"),c.action="homeController/downloadCheckedFilesZip.do",c.method="post",c.style.display="none",d=document.createElement("input"),d.name="zipId",d.value=a,c.appendChild(d),document.body.appendChild(c),c.submit())},error:function(){$("#downloadAllCheckedName").text("提示:请求失败。无法完成压缩,请重试或告知管理员。")}})}function showDeleteAllCheckedModel(){$("#deleteFileBox").html("");var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!1),0==a.size?$("#deleteFileMessage").html(checkFilesTip):($("#deleteFileBox").html("全部删除 "),$("#deleteFileMessage").text("提示:确定要彻底删除这"+a.size+"项么?该操作不可恢复!")),$("#deleteFileModal").modal("toggle")}function deleteAllChecked(){var a=getCheckedFilesAndFolders();$("#dfmbutton").attr("disabled",!0),$("#deleteFileMessage").text("提示:正在删除,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:a.filesId,strFidList:a.foldersId},url:"homeController/deleteCheckedFiles.ajax",success:function(a){"mustLogin"==a?window.location.href="login.html":"noAuthorized"==a?($("#deleteFileMessage").text("提示:您的操作未被授权,删除失败"),$("#dfmbutton").attr("disabled",!1)):"errorParameter"==a?($("#deleteFileMessage").text("提示:参数不正确,未能全部删除文件"),$("#dfmbutton").attr("disabled",!1)):"cannotDeleteFile"==a?($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)):"deleteFileSuccess"==a?($("#deleteFileModal").modal("hide"),showFolderView(locationpath)):($("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1))},error:function(){$("#deleteFileMessage").text("提示:出现意外错误,可能未能删除全部文件"),$("#dfmbutton").attr("disabled",!1)}})}function playAudio(fileId){$("#audioPlayerModal").modal("show"),null==ap&&(ap=new APlayer({container:document.getElementById("aplayer"),lrcType:3,mutex:!0,volume:.7,theme:"#EDEDED",audio:[]}),ap.on("pause",function(){$("#playOrPause").html(" ")
+}),ap.on("play",function(){$("#playOrPause").html(" ")})),ap.list.clear(),$.ajax({url:"homeController/playAudios.ajax",data:{fileId:fileId},type:"POST",dataType:"text",success:function(result){var ail=eval("("+result+")");ap.list.add(ail.as),ap.list.switch(ail.index),audio_play()},error:function(){alert("错误:无法获取音乐列表,请稍后再试"),closeAudioPlayer()}})}function closeAudioPlayer(){$("#audioPlayerModal").modal("hide"),ap.seek(0),ap.pause()}function audio_playOrPause(){ap.toggle()}function audio_play(){ap.play()}function audio_pasue(){ap.pause()}function audio_fw(){ap.skipForward()}function audio_bw(){ap.skipBack()}function audio_vulome_up(){ap.volume(ap.audio.volume+.1,!0)}function audio_vulome_down(){ap.volume(ap.audio.volume-.1,!0)}function sortbyfn(){$("#sortByFN").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return a.fileName.localeCompare(b.fileName,"zh")}),folderView.folderList.sort(function(a,b){return a.folderName.localeCompare(b.folderName,"zh")}),showFolderTable(folderView)}function sortbycd(){$("#sortByFN").removeClass(),$("#sortByCD").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){var c=a.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.fileCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),folderView.folderList.sort(function(a,b){var c=a.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),d=b.folderCreationDate.replace("年","-").replace("月","-").replace("日",""),e=new Date(Date.parse(c)).getTime()-new Date(Date.parse(d)).getTime();return-1*e}),showFolderTable(folderView)}function sortbyfs(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").addClass("glyphicon glyphicon-triangle-bottom"),$("#sortByCN").removeClass(),folderView.fileList.sort(function(a,b){return b.fileSize-a.fileSize}),showFolderTable(folderView)}function sortbycn(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").addClass("glyphicon glyphicon-triangle-bottom"),folderView.fileList.sort(function(a,b){return a.fileCreator.localeCompare(b.fileCreator,"zh")}),folderView.folderList.sort(function(a,b){return a.folderCreator.localeCompare(b.folderCreator,"zh")}),showFolderTable(folderView)}function showOriginFolderView(){$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=null!=screenedFoldrView?$.extend(!0,{},screenedFoldrView):$.extend(!0,{},originFolderView),showFolderTable(folderView)}function startMoveFile(){$("#cutSignTx").hasClass("cuted")&&void 0!==checkedMovefiles?($("#moveFilesMessage").text("提示:确定将这"+checkedMovefiles.size+"项移动到当前位置么?"),$("#moveFilesBox").html("全部移动 "),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):(checkedMovefiles=getCheckedFilesAndFolders(),void 0==checkedMovefiles||0==checkedMovefiles.size?($("#moveFilesMessage").html(checkFilesTip),$("#selectFileMoveModelAsAll").removeAttr("checked"),$("#selectFileMoveModelAlert").hide(),$("#moveFilesModal").modal("show")):($("#cutSignTx").html("粘贴("+checkedMovefiles.size+") +V "),$("#cutSignTx").addClass("cuted")))}function doMoveFiles(){$("#dmvfbutton").attr("disabled",!0),$("#moveFilesMessage").text("提示:正在移动,请稍候..."),$.ajax({type:"POST",dataType:"text",data:{strIdList:checkedMovefiles.filesId,strFidList:checkedMovefiles.foldersId,locationpath:locationpath},url:"homeController/confirmMoveFiles.ajax",success:function(result){"mustLogin"==result?window.location.href="login.html":"noAuthorized"==result?($("#moveFilesMessage").text("提示:您的操作未被授权,移动失败"),$("#dmvfbutton").attr("disabled",!1)):"errorParameter"==result?($("#moveFilesMessage").text("提示:参数不正确,未能全部移动文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"cannotMoveFiles"==result?($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1)):"confirmMoveFiles"==result?(strMoveOptMap={},sendMoveFilesReq()):result.startsWith("duplicationFileName:")?(repeMap=eval("("+result.substring(20)+")"),repeIndex=0,strMoveOptMap={},mRepeSize=repeMap.repeFolders.length+repeMap.repeNodes.length,repeMap.repeFolders.length>0?$("#mrepeFileName").text(repeMap.repeFolders[repeIndex].folderName):$("#mrepeFileName").text(repeMap.repeNodes[repeIndex].fileName),$("#selectFileMoveModelAlert").show()):result.startsWith("CANT_MOVE_TO_INSIDE:")?$("#moveFilesMessage").text("错误:不能将一个文件夹移动到其自身内部:"+result.substring(20)):($("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件,请刷新后重试"),$("#dmvfbutton").attr("disabled",!1))},error:function(){$("#moveFilesMessage").text("提示:出现意外错误,可能未能移动全部文件"),$("#dmvfbutton").attr("disabled",!1)}})}function selectFileMoveModel(a){if($("#selectFileMoveModelAsAll").prop("checked")){for(;mRepeSize>repeIndex;)repeIndexrepeIndex?repeIndexc;c++)b.test(originFolderView.folderList[c].folderName)&&screenedFoldrView.folderList.push(originFolderView.folderList[c]);for(c=0,d=originFolderView.fileList.length;d>c;c++)b.test(originFolderView.fileList[c].fileName)&&screenedFoldrView.fileList.push(originFolderView.fileList[c]);$("#sortByFN").removeClass(),$("#sortByCD").removeClass(),$("#sortByFS").removeClass(),$("#sortByCN").removeClass(),folderView=$.extend(!0,{},screenedFoldrView),showFolderTable(folderView)}else screenedFoldrView=null,showOriginFolderView()}catch(e){alert("错误:搜索关键字有误。请在特殊符号(例如“*”)前加上“\\”进行转义。")}endLoading()}var ap,zipTimer,folderView,originFolderView,fs,checkedMovefiles,constraintLevel,account,xhr,viewer,viewerPageIndex,viewerTotal,pvl,folderTypes,repeList,repeIndex,repeModelList,repeMap,strMoveOptMap,mRepeSize,screenedFoldrView,locationpath="root",parentpath="null",isUpLoading=!1,viewerPageSize=15,checkFilesTip="提示:您还未选择任何文件,请先选中一些文件后再执行本操作:单击 :选中某一文件Shift +单击 :选中多个文件Shift +双击 :选中连续的文件Shitf +A :选中/取消选中所有文件";$(function(){window.onresize=function(){changeFilesTableStyle()},getServerOS(),showFolderView("root"),$(document).click(function(a){var b=$("#filetable")[0],c=a.srcElement;c||(c=a.target),c===b||$.contains(b,a.target)||$(".filerow").removeClass("info")}),$("#audioPlayerModal").on("hidden.bs.modal",function(){null!=ap&&(ap.seek(0),ap.pause())}),$("#downloadAllCheckedModal").on("hidden.bs.modal",function(){null!=zipTimer&&window.clearInterval(zipTimer)}),$("#loginModal").on("hidden.bs.modal",function(){$("#accountid").val(""),$("#accountpwd").val("")}),$(".modal").on("shown.bs.modal",function(){$(this).addClass("shown")}),$(".modal").on("hidden.bs.modal",function(){$(this).removeClass("shown")}),$("body").keypress(function(a){var c,b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return 13==b?("sreachKeyWordIn"===document.activeElement.id?doSearchFile():(c=$(".shown .btn-primary"),null!=c.get(0)&&c.click()),!1):void 0}),$("#loginModal").on("shown.bs.modal",function(){$("#accountid").focus()}),$("#newFolderModal").on("show.bs.modal",function(){if($("#folderalert").removeClass("alert"),$("#folderalert").removeClass("alert-danger"),$("#foldernamebox").removeClass("has-error"),$("#folderalert").text(""),$("#foldername").val(""),$("#foldertypelist").html(""),null!=account){$("#foldername").attr("folderConstraintLevel",constraintLevel+""),$("#newfoldertype").text(folderTypes[constraintLevel]);for(var b=constraintLevel;b"+folderTypes[b]+" ")}else $("#foldertypelist").append(""+folderTypes[0]+" ")}),$("#newFolderModal").on("shown.bs.modal",function(){$("#foldername").focus()}),$("#uploadFileModal").on("hidden.bs.modal",function(){isUpLoading&&($("#operationMenuBox").attr("data-placement","top"),$("#operationMenuBox").attr("data-trigger","focus"),$("#operationMenuBox").attr("data-title","上传中"),$("#operationMenuBox").attr("data-content","您可以重新打开上传窗口查看上传进度。"),$("#operationMenuBox").popover(),$("#operationMenuBox").popover("show"),setTimeout(function(){$("#operationMenuBox").attr("data-title",""),$("#operationMenuBox").attr("data-content",""),$("#operationMenuBox").popover("destroy")},2e3))}),$("#renameFolderModal").on("show.bs.modal",function(){if($("#newfolderalert").removeClass("alert"),$("#newfolderalert").removeClass("alert-danger"),$("#folderrenamebox").removeClass("has-error"),$("#newfolderalert").text(""),$("#editfoldertypelist").html(""),null!=account)for(var b=constraintLevel;b"+folderTypes[b]+" ");else $("#editfoldertypelist").append(""+folderTypes[0]+" ")}),document.ondragover=function(a){a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1)},document.ondrop=function(a){var b,c,d,e,f,g;if(a.preventDefault?(a.preventDefault(),a.stopPropagation()):(window.event.cancelBubble=!0,window.event.returnValue=!1),null!=folderView.authList)if(checkAuth(folderView.authList,"U"))if(isUpLoading)alert("提示:您正在执行另一项上传任务,请在上传窗口关闭后再试。");else if(window.ActiveXObject||"ActiveXObject"in window)alert("提示:IE浏览器不支持拖拽上传。您可以使用现代浏览器或将浏览模式切换为“极速模式”来体验该功能。");else{if(b=null!=a.dataTransfer?a.dataTransfer:window.event.dataTransfer,c=!0,void 0!==b.items)for(d=0;d +C"),$("#cutSignTx").removeClass("cuted"),$("#moveFilesBox").html("")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)}),$("#folderInfoModal").on("show.bs.modal",function(){var b=folderView.folder;$("#fim_name").text(b.folderName),$("#fim_creator").text(b.folderCreator),$("#fim_folderCreationDate").text(b.folderCreationDate),$("#fim_statistics").text("共包含 "+folderView.folderList.length+" 个文件夹, "+folderView.fileList.length+" 个文件。")}),$("#downloadModal").on("hidden.bs.modal",function(){$("#downloadURLCollapse").collapse("hide")})}),folderTypes=["公开的","仅小组","仅创建者"];
\ No newline at end of file
diff --git a/webContext/pdfview/web/loading.gif b/webContext/pdfview/web/loading.gif
new file mode 100644
index 0000000..13f0f64
Binary files /dev/null and b/webContext/pdfview/web/loading.gif differ
diff --git a/webContext/pdfview/web/viewer.html b/webContext/pdfview/web/viewer.html
index 9098f42..693b738 100644
--- a/webContext/pdfview/web/viewer.html
+++ b/webContext/pdfview/web/viewer.html
@@ -33,6 +33,73 @@
+
+
@@ -458,5 +525,30 @@
+
+
+