resourcesIcons.jsp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html" %>
  3. <html>
  4. <head>
  5. <title>设置图标</title>
  6. <%@include file="/commons/include/form.jsp" %>
  7. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/FlexUploadDialog.js"></script>
  8. <script type="text/javascript">
  9. var selectedImg=null;
  10. $(function(){
  11. $("#imgList img").click(function(){
  12. if(selectedImg){
  13. $(selectedImg).removeClass('selected');
  14. }
  15. $(this).addClass('selected');
  16. selectedImg=this;
  17. });
  18. //上传图标
  19. $("#iconForm").ajaxForm({success:showResponse});
  20. $("a.upload").click(function(){
  21. if($("#iconFile").val()==''){
  22. $.ligerDialog.warn("请选择图标文件","提示信息");
  23. }else{
  24. $("#iconForm").submit();
  25. }
  26. });
  27. $("a.del").click(function(){
  28. if(selectedImg){
  29. var iconPath=$(selectedImg).attr('path');
  30. $.post('delFile.ht',{path:iconPath},function(data){
  31. showResponse(data);
  32. });
  33. }
  34. });
  35. });
  36. function showResponse(responseText){
  37. var obj=new com.hotent.form.ResultMessage(responseText);
  38. if(obj.isSuccess()){//成功
  39. $.ligerDialog.success(obj.getMessage(),"提示信息",function(){
  40. window.location.reload();
  41. });
  42. }else{//失败
  43. $.ligerDialog.err('出错信息',"保存文件图标失败",obj.getMessage());
  44. }
  45. };
  46. </script>
  47. <style type="text/css">
  48. html { overflow-x: hidden; overflow-y: auto; }
  49. #imgList{
  50. overflow: auto;
  51. }
  52. #imgList img {
  53. cursor: pointer;
  54. border-width: 1px;
  55. border-style: solid;
  56. border-color: transparent;
  57. padding: 1px;
  58. }
  59. #imgList .selected {
  60. border-color: #86a9d1;
  61. background-color:#c3dcfc;
  62. }
  63. </style>
  64. </head>
  65. <body>
  66. <div class="panel">
  67. <div class="panel-top">
  68. <div class="tbar-title">
  69. <span class="tbar-label">资源图标</span>
  70. </div>
  71. <div class="panel-toolbar">
  72. <form id="iconForm" method="post" action="uploadIcon.ht">
  73. <div class="group"><input type="file" id="iconFile" name="iconFile" /></div>
  74. <div class="l-bar-separator"></div>
  75. <div class="group"><a class="link upload" href="javascript:;"><span></span>上传</a></div>
  76. <div class="l-bar-separator"></div><div class="l-bar-separator"></div><div class="l-bar-separator"></div><div class="l-bar-separator"></div>
  77. <div class="group"><a class="link del" href="javascript:;"><span></span>删除</a></div>
  78. <input type="hidden" name="path" id="iconPath" value="${iconPath}" />
  79. </form>
  80. </div>
  81. </div>
  82. <div class="panel-body" id="imgList">
  83. <c:if test="${empty iconList}">
  84. <span >暂无资源图标</span>
  85. </c:if>
  86. <c:forEach items="${iconList}" var="d" varStatus="status">
  87. <img src="${ctx}${iconPath}/${d}" title="${d}" path="${iconPath}/${d}" />
  88. </c:forEach>
  89. </div>
  90. </div>
  91. </body>
  92. </html>