fileManager.jsp 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>文件管理管理</title>
  6. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  7. <meta name="decorator" content="ani"/>
  8. </head>
  9. <body>
  10. <script type="text/javascript">
  11. function play(url, type) {
  12. // var $a = $("<video></video>").attr("href", url);
  13. //var $a = $("<img></img>").attr("src", url).attr("width", "100%").attr("height", "100%");
  14. if(type == 'video'){
  15. jp.open({
  16. type: 1,
  17. title: false,
  18. area: ['900px', '560px'],
  19. shade: 0.8,
  20. closeBtn: 0,
  21. scrolling: "no",
  22. shadeClose: true,
  23. content: '<video scrolling="no" autoplay height="100%" style="scrolling:no;background-color: black;" width="100%" src="'+url+'" controls="controls">'
  24. + 'Your browser does not support the video tag.'
  25. + '</video>'
  26. });
  27. }else if(type == 'audio'){
  28. jp.open({
  29. type: 1,
  30. title: false,
  31. shade: 0.8,
  32. closeBtn: 0,
  33. shadeClose: true,
  34. content: '<audio autoplay width="400px" src="'+url+'" controls="controls">'
  35. + 'Your browser does not support the audio tag.'
  36. + '</audio>'
  37. });
  38. }else if(type == 'image'){
  39. jp.showPic(url)
  40. }else if(type =='pdf' || type == 'text' || type == 'code'){
  41. jp.open({
  42. type: 2,
  43. title: false,
  44. area: ['900px', '560px'],
  45. shade: 0.8,
  46. closeBtn: 0,
  47. scrolling: "no",
  48. shadeClose: true,
  49. content: url
  50. });
  51. }else{
  52. jp.info("不支持的预览格式!");
  53. }
  54. }
  55. jeeplus.ready(function(){
  56. jeeplus.ui({
  57. view:"filemanager",
  58. id:"fm",
  59. url:"${ctx}/sys/file/data",
  60. readonly: false,
  61. handlers:{
  62. "upload" : "${ctx}/sys/file/upload",
  63. "download" : "${ctx}/sys/file/download",
  64. "copy" : "${ctx}/sys/file/copy",
  65. "move" : "${ctx}/sys/file/move",
  66. "remove" : "${ctx}/sys/file/remove",
  67. "rename" : "${ctx}/sys/file/rename",
  68. "create" : "${ctx}/sys/file/createFolder"
  69. }
  70. });
  71. var actions = $$("fm").getMenu();
  72. actions.attachEvent("onItemClick", function(id, e){
  73. var target = this.nh.id.row?this.nh.id.row:this.nh.id;
  74. if(id == "view"){
  75. jp.post("${ctx}/sys/file/getUrl",{dir:target},function (data) {
  76. play(data.body.url,data.body.type);
  77. })
  78. $$("fm").getMenu().hide();
  79. }
  80. });
  81. });
  82. </script>
  83. </body>
  84. </html>