Gecko_InsertMedia.aspx
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:12k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" Inherits="CuteEditor.Dialogs.FileBrowserPage" %>
  2. <%@ Register TagPrefix="CE" Assembly="CuteEditor" Namespace="CuteEditor" %>
  3. <script runat="server">
  4. override protected void OnInit(EventArgs args)
  5. {
  6. if(Context.Request.QueryString["IsFrame"]==null)
  7. {
  8. string FrameSrc="Gecko_InsertMedia.aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
  9. CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[InsertMedia]]",FrameSrc);
  10. Context.Response.End();
  11. }
  12. base.OnInit(args);
  13. }
  14. //Power By CuteEditor.cn
  15. //该源码下载自www.51aspx.com(51aspx.com)
  16. </script>
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19. <title></title>
  20. <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.1)" />
  21. <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" />
  22. <link href="Load.ashx?type=style&file=dialog.css" type="text/css" rel="stylesheet" />
  23. <!--[if IE]>
  24. <link href="Load.ashx?type=style&file=IE.css" type="text/css" rel="stylesheet" />
  25. <![endif]-->
  26. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogHead.js"></script>
  27. <script type="text/javascript">
  28. var OxO93e7=[]; function PostBackAction(){ <%=Page.ClientScript.GetPostBackEventReference(hiddenAction,"")%> ;}  ;
  29. </script>
  30. <style type="text/css">
  31. .row
  32. {
  33. height:22px;
  34. }
  35. .cb
  36. {
  37. vertical-align:middle;
  38. }
  39. .itemimg
  40. {
  41. vertical-align:middle;
  42. }
  43. .editimg
  44. {
  45. vertical-align:middle;
  46. }
  47. .cell1
  48. {
  49. vertical-align:middle;
  50. }
  51. .cell2
  52. {
  53. vertical-align:middle;
  54. }
  55. .cell3
  56. {
  57. vertical-align:middle;
  58.     
  59. text-align:right;
  60. padding-right:4px;
  61. }
  62. .cb
  63. {
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <form runat="server" enctype="multipart/form-data" id="Form1">
  69. <!-- start hidden -->
  70. <input type="hidden" runat="server" id="hiddenDirectory" /> <input type="hidden" runat="server" id="hiddenFile" />
  71. <input type="hidden" runat="server" enableviewstate="false" id="hiddenAlert" /> <input type="hidden" runat="server" enableviewstate="false" id="hiddenAction" onserverchange="hiddenAction_ServerChange" />
  72. <input type="hidden" runat="server" enableviewstate="false" id="hiddenActionData" />
  73. <!-- end hidden -->
  74. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  75. <tr>
  76. <td style="width:20">
  77. <asp:Image id="Image1" Runat="server" ImageUrl="../Load.ashx?type=image&file=openfolder.gif"></asp:Image>
  78. </td>
  79. <td style="width:240" class="normal">
  80. <asp:Label Runat="server" id="FolderDescription"></asp:Label>
  81. </td>
  82. <td>
  83. <asp:ImageButton id="CreateDir" BorderWidth="1" Runat="server" AlternateText="[[Createdirectory]]" onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" ImageUrl="../Load.ashx?type=image&file=newfolder.gif" Visible="true"
  84. OnClick="CreateDir_Click" />
  85. <asp:ImageButton id="Copy" BorderWidth="1" Runat="server" AlternateText="[[Copyfiles]]" onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);"
  86. ImageUrl="../Load.ashx?type=image&file=Copy.gif" Visible="true" OnClick="Copy_Click" />
  87. <asp:ImageButton id="Move" BorderWidth="1" Runat="server" AlternateText="[[Movefiles]]" onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);"
  88. ImageUrl="../Load.ashx?type=image&file=move.gif" Visible="true" OnClick="Move_Click" />
  89. <img style="display:none" src="../Load.ashx?type=image&file=zoom_in.gif" onclick="Zoom_In();" alt="[[ZoomIn]]" class="dialogButton"
  90. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  91. <img style="display:none" src="../Load.ashx?type=image&file=zoom_out.gif" onclick="Zoom_Out();" alt="[[ZoomOut]]" class="dialogButton"
  92. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  93. <img style="display:none" src="../Load.ashx?type=image&file=Actualsize.gif" onclick="Actualsize();" alt="[[ActualSize]]" class="dialogButton"
  94. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  95. </td>
  96. </tr>
  97. </table>
  98. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  99. <tr>
  100. <td valign="top" style="white-space:nowrap;width:250">
  101. <div style="border: 1.5pt inset; vertical-align: middle; overflow: auto; width: 250;background-color: white; height: 250px">
  102. <asp:Table id="FoldersAndFiles" Runat="server" CellSpacing="1" CellPadding="1" Width="100%" CssClass="sortable">
  103. <asp:TableRow BackColor="#f0f0f0">
  104. <asp:TableHeaderCell Width="16px" >
  105. <asp:ImageButton id="Delete" Runat="server" AlternateText="[[Deletefiles]]"
  106. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" ImageUrl="../Load.ashx?type=image&file=s_cut.gif"
  107. Visible="true" OnClick="Delete_Click" />
  108. </asp:TableHeaderCell>
  109. <asp:TableHeaderCell Width="16px" >
  110. <asp:ImageButton id="DoRefresh" Runat="server" AlternateText="[[Refresh]]" ImageUrl="../Load.ashx?type=image&file=s_refresh.gif"
  111. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" Visible="true"
  112. OnClick="DoRefresh_Click" />
  113. </asp:TableHeaderCell>
  114. <asp:TableHeaderCell id="name_Cell" Width="136px" CssClass="filelistHeadCol" Font-Bold="False">[[Name]]</asp:TableHeaderCell>
  115. <asp:TableHeaderCell id="size_Cell" Width="72px" CssClass="filelistHeadCol" Font-Bold="False">[[Count]]/[[Size]]</asp:TableHeaderCell>
  116. <asp:TableHeaderCell id="op_Cell"  Width="16px">&nbsp;</asp:TableHeaderCell>
  117. </asp:TableRow>
  118. </asp:Table>
  119. </div>
  120. </td>
  121. <td valign="top">
  122. <div style="text-align: left; overflow: auto; background-color: white; border: 1.5pt inset;
  123.                         width: 300px; height: 240px; overflow: auto; text-align: center; vertical-align: top;
  124.                         padding: 10px;">
  125. <div id="divpreview" style="background-color:white; width:100%;height:100%;">
  126. &nbsp;</div>
  127. </div>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td colspan="2" style="height:2">
  132. </td>
  133. </tr>
  134. </table>
  135. <table border="0" cellspacing="0" cellpadding="0" width="99%">
  136. <tr>
  137. <td valign="top">
  138. <fieldset>
  139. <legend>
  140. [[Properties]]</legend>
  141. <table border="0" cellpadding="4" cellspacing="0" class="normal">
  142. <tr>
  143. <td>
  144. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  145. <tr>
  146. <td style="width:100">
  147. [[Width]]:</td>
  148. <td>
  149. <input type="text" name="Width" id="Width" style="width: 80px;" onchange="do_preview()"
  150. onpropertychange="do_preview()" value="200" /></td>
  151. </tr>
  152. <tr>
  153. <td>
  154. [[Height]]:</td>
  155. <td>
  156. <input type="text" name="Height" id="Height" style="width: 80px;" onchange="do_preview()"
  157. onpropertychange="do_preview()" value="200" /></td>
  158. </tr>
  159. <tr>
  160. <td>
  161. [[AutoStart]]:</td>
  162. <td>
  163. <input type="checkbox" name="Transparency" onchange="do_preview()" onpropertychange="do_preview()"
  164. id="AutoStart" checked="checked" value="AutoStart" /></td>
  165. </tr>
  166. <tr>
  167. <td style="height: 24px">
  168. [[ShowControls]]:</td>
  169. <td style="height: 24px">
  170. <input type="checkbox" name="Transparency" onchange="do_preview()" onpropertychange="do_preview()"
  171. id="ShowControls" checked="checked" value="ShowControls" /></td>
  172. </tr>
  173. <tr>
  174. <td>
  175. [[ShowStatusBar]]:</td>
  176. <td>
  177. <input type="checkbox" name="Transparency" onchange="do_preview()" onpropertychange="do_preview()"
  178. id="ShowStatusBar" checked="checked" value="ShowStatusBar" /></td>
  179. </tr>
  180. </table>
  181. </td>
  182. </tr>
  183. </table>
  184. </fieldset>
  185. </td>
  186. <td style="width:10">
  187. </td>
  188. <td valign="top">
  189. <fieldset style="margin-bottom:5px">
  190. <legend>
  191. [[Insert]]</legend>
  192. <table border="0" cellpadding="4" cellspacing="0">
  193. <tr>
  194. <td>
  195. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  196. <tr>
  197. <td valign="middle">
  198. [[Url]]:</td>
  199. <td>
  200. <input type="text" id="TargetUrl" size="40" name="TargetUrl" runat="server" /></td>
  201. </tr>
  202. </table>
  203. </td>
  204. </tr>
  205. </table>
  206. </fieldset>
  207. <fieldset id="fieldsetUpload">
  208. <legend>
  209. [[Upload]] ([[MaxFileSizeAllowed]]
  210. <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxMediaSize * 1024)%>
  211. )</legend>
  212. <table border="0" cellspacing="1" cellpadding="0" width="98%" class="normal">
  213. <tr>
  214. <td style="height:10">
  215. </td>
  216. </tr>
  217. <tr>
  218. <td valign="top" style="width:54%;font-size: 8pt; vertical-align: middle; font-family: MS Sans Serif">
  219. <CE:UploadSingleFile id="InputFile" runat="server"></CE:UploadSingleFile>
  220. </td>
  221. </tr>
  222. <tr>
  223. <td style="width:8">
  224. </td>
  225. </tr>
  226. <tr>
  227. <td style="width:5">
  228. </td>
  229. </tr>
  230. <tr>
  231. <td>
  232. <span style="white-space:nowrap">
  233. [[MaxFolderSizeAllowed]]: <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxMediaFolderSize * 1024)%>.
  234. [[Used]]: <%= CuteEditor.Impl.FileStorage.FormatSize(fs.GetDirectorySize(fs.VirtualRoot)) %>
  235. <span style="background-color:green;height:3px;width:40px;font-size:3px">
  236. <span style="background-color:red;height:3px;width:<%= GetUsedSpaceBarWidth() %>px;font-size:3px"></span>
  237. </span>
  238. </span>
  239. </td>
  240. </tr>
  241. </table>
  242. </fieldset>
  243. <div style="padding-top:10px;">
  244. <input class="inputbuttoninsert" type="button" value="[[Insert]]" onclick="do_insert()" id="Button1"/>
  245. &nbsp;&nbsp;&nbsp; 
  246. <input class="inputbuttoncancel" type="button" value="[[Cancel]]" onclick="do_cancel()" id="Button2"/>
  247. </div>
  248. </td>
  249. </tr>
  250. </table>
  251. </form>
  252. </body>
  253. <script runat="server">
  254. protected override void InitOfType()
  255. {
  256. fs.VirtualRoot=CuteEditor.EditorUtility.ProcessWebPath(Context,null,secset.MediaGalleryPath).TrimEnd('/')+"/";
  257. }
  258.     protected override void GetFiles(ArrayList files)
  259.     {
  260.         foreach (string ext in secset.MediaFilters)
  261.         {
  262.             if (ext == null || ext.Length == 0) continue;
  263.             files.AddRange(fs.GetFileItems(CurrentDirectory, secset.FileNamePrefix + "*" + ext));
  264.         }
  265.     }
  266.     protected override bool AllowFileName(string filename)
  267.     {
  268.         filename = filename.ToLower();
  269.         foreach (string ext in secset.MediaFilters)
  270.         {
  271.             if (ext == null || ext.Length == 0) continue;
  272.             if(filename.EndsWith(ext.ToLower()))
  273.                 return true;
  274.         }
  275.         return false;
  276.     }
  277.     protected override string CheckUploadData(ref byte[] data)
  278.     {
  279.  if (fs.GetDirectorySize(fs.VirtualRoot) >= secset.MaxMediaFolderSize * 1024)
  280.            return "Media folder size exceeds the limit: "+ CuteEditor.Impl.FileStorage.FormatSize(secset.MaxMediaFolderSize * 1024);
  281.         if (data.Length >= secset.MaxMediaSize * 1024)
  282.             return "Media size exceeds "+CuteEditor.Impl.FileStorage.FormatSize(secset.MaxMediaSize * 1024)+" limit: "+ CuteEditor.Impl.FileStorage.FormatSize(data.Length);
  283.         return null;
  284.     }
  285.     protected int GetUsedSpaceBarWidth()
  286.     {
  287.       int w = Convert.ToInt32(40*fs.GetDirectorySize(fs.VirtualRoot)/(secset.MaxMediaFolderSize * 1024));
  288.       if(w<1)
  289. w=1;
  290.   if(w>40)
  291. w=40;
  292.       return w;      
  293.     }
  294. </script>
  295. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogFoot.js"></script>
  296. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=Dialog_InsertMedia.js"></script>
  297. </html>