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

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_InsertFlash.Aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
  9. CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[InsertFlash]]",FrameSrc);
  10. Context.Response.End();
  11. }
  12. base.OnInit(args);
  13. }
  14. </script>
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head>
  17. <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.1)" />
  18. <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" />
  19. <meta http-equiv="Cache-Control" content="no-cache" />
  20. <meta http-equiv="Pragma" content="no-cache" />
  21. <meta http-equiv="EXPIRES" content="0" />
  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. <title></title>
  27. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogHead.js"></script>
  28. <script type="text/javascript">
  29. var OxOcb7e=[]; function PostBackAction(){ <%=Page.ClientScript.GetPostBackEventReference(hiddenAction,"")%> ;}  ;
  30. </script>
  31. <style type="text/css">
  32. .row { HEIGHT: 22px }
  33. .cb { VERTICAL-ALIGN: middle }
  34. .itemimg { VERTICAL-ALIGN: middle }
  35. .editimg { VERTICAL-ALIGN: middle }
  36. .cell1 { VERTICAL-ALIGN: middle }
  37. .cell2 { VERTICAL-ALIGN: middle }
  38. .cell3 { PADDING-RIGHT: 4px; VERTICAL-ALIGN: middle; TEXT-ALIGN: right }
  39. .cb { }
  40. </style>
  41. </head>
  42. <body>
  43. <form runat="server" enctype="multipart/form-data" id="Form1">
  44. <!-- start hidden -->
  45. <input type="hidden" runat="server" id="hiddenDirectory" /> 
  46. <input type="hidden" runat="server" id="hiddenFile" />
  47. <input type="hidden" runat="server" enableviewstate="false" id="hiddenAlert" /> 
  48. <input type="hidden" runat="server" enableviewstate="false" id="hiddenAction" onserverchange="hiddenAction_ServerChange" />
  49. <input type="hidden" runat="server" enableviewstate="false" id="hiddenActionData" />
  50. <!-- end hidden -->
  51. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  52. <tr>
  53. <td style="width:20">
  54. <asp:Image id="Image1" Runat="server" ImageUrl="../Load.ashx?type=image&file=openfolder.gif"></asp:Image>
  55. </td>
  56. <td style="width:240" class="normal">
  57. <asp:Label Runat="server" id="FolderDescription"></asp:Label>
  58. </td>
  59. <td>
  60. <asp:ImageButton id="CreateDir" BorderWidth="1" Runat="server" AlternateText="[[Createdirectory]]" ImageUrl="../Load.ashx?type=image&file=newfolder.gif"
  61. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" Visible="true"
  62. OnClick="CreateDir_Click" />
  63. <asp:ImageButton id="Copy" BorderWidth="1" Runat="server" AlternateText="[[Copyfiles]]" ImageUrl="../Load.ashx?type=image&file=Copy.gif"
  64. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" Visible="true"
  65. OnClick="Copy_Click" />
  66. <asp:ImageButton id="Move" BorderWidth="1" Runat="server" AlternateText="[[Movefiles]]" ImageUrl="../Load.ashx?type=image&file=move.gif"
  67. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" Visible="true"
  68. OnClick="Move_Click" />
  69. <img style="display:none" src="../Load.ashx?type=image&file=zoom_in.gif" onclick="Zoom_In();" alt="[[ZoomIn]]" class="dialogButton"
  70. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  71. <img style="display:none" src="../Load.ashx?type=image&file=zoom_out.gif" onclick="Zoom_Out();" alt="[[ZoomOut]]" class="dialogButton"
  72. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  73. <img style="display:none" src="../Load.ashx?type=image&file=Actualsize.gif" onclick="Actualsize();" alt="[[ActualSize]]" class="dialogButton"
  74. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  75. </td>
  76. </tr>
  77. </table>
  78. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  79. <tr>
  80. <td valign="top" style="white-space:nowrap;width:250">
  81. <div style="BORDER: 1.5pt inset;  VERTICAL-ALIGN: middle; OVERFLOW: auto; WIDTH: 250; HEIGHT: 240px; Padding:0; BACKGROUND-COLOR: white">
  82. <asp:Table id="FoldersAndFiles" Runat="server" CellSpacing="1" CellPadding="1" Width="100%" CssClass="sortable">
  83. <asp:TableRow BackColor="#f0f0f0">
  84. <asp:TableHeaderCell Width="16px" >
  85. <asp:ImageButton id="Delete" Runat="server" AlternateText="[[Deletefiles]]"
  86. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" ImageUrl="../Load.ashx?type=image&file=s_cut.gif"
  87. Visible="true" OnClick="Delete_Click" />
  88. </asp:TableHeaderCell>
  89. <asp:TableHeaderCell Width="16px" >
  90. <asp:ImageButton id="DoRefresh" Runat="server" AlternateText="[[Refresh]]" ImageUrl="../Load.ashx?type=image&file=s_refresh.gif"
  91. onMouseOver="CuteEditor_ColorPicker_ButtonOver(this);" Visible="true"
  92. OnClick="DoRefresh_Click" />
  93. </asp:TableHeaderCell>
  94. <asp:TableHeaderCell id="name_Cell" Width="136px" CssClass="filelistHeadCol" Font-Bold="False">[[Name]]</asp:TableHeaderCell>
  95. <asp:TableHeaderCell id="size_Cell" Width="72px" CssClass="filelistHeadCol" Font-Bold="False">[[Count]]/[[Size]]</asp:TableHeaderCell>
  96. <asp:TableHeaderCell id="op_Cell"  Width="16px">&nbsp;</asp:TableHeaderCell>
  97. </asp:TableRow>
  98. </asp:Table>
  99. </div>
  100. </td>
  101. <td valign="top">
  102. <div style="BORDER: 1.5pt inset; VERTICAL-ALIGN: top; OVERFLOW: auto; WIDTH: 315px; HEIGHT: 240px; BACKGROUND-COLOR: white; TEXT-ALIGN: center">
  103. <div id="divpreview" style="BACKGROUND-COLOR: white">
  104. &nbsp;</div>
  105. </div>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td colspan="2" style="height:2">
  110. </td>
  111. </tr>
  112. </table>
  113. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  114. <tr>
  115. <td valign="top">
  116. <fieldset>
  117. <legend>
  118. [[Properties]]</legend>
  119. <table border="0" cellpadding="4" cellspacing="0" id="Table3">
  120. <tr>
  121. <td>
  122. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  123. <tr>
  124. <td style="width:110">[[Width]]:</td>
  125. <td style="width:120"><input type="text" name="Width" id="Width" style="WIDTH : 80px" onchange="do_preview()"
  126. onpropertychange="do_preview()" onkeypress="return CancelEventIfNotDigit()" value="200" /></td>
  127. </tr>
  128. <tr>
  129. <td>[[Height]]:</td>
  130. <td><input type="text" name="Height" id="Height" style="WIDTH : 80px" onchange="do_preview()"
  131. onpropertychange="do_preview()" onkeypress="return CancelEventIfNotDigit()" value="200" /></td>
  132. </tr>
  133. <tr>
  134. <td>[[Backgroundcolor]]:</td>
  135. <td><input autocomplete="off" type="text" id="bgColortext" name="bgColortext" size="7" style="WIDTH:57px" />
  136. <img id="s_bgColortext" src="../images/colorpicker.gif" onclick="SelectColor();" alt="" />
  137. </td>
  138. </tr>
  139. <tr>
  140. <td>[[Quality]]:
  141. </td>
  142. <td><select name="Quality" id="Quality" style="WIDTH : 80px" onchange="do_preview()" onpropertychange="do_preview()"
  143. runat="server">
  144. <option selected="selected" value="high">High</option>
  145. <option value="medium">Medium</option>
  146. <option value="low">Low</option>
  147. </select>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td style="width:100">[[Scale]]:</td>
  152. <td>
  153. <select name="Scale" style="WIDTH : 80px" id="Scale" onchange="do_preview()" onpropertychange="do_preview()">
  154. <option selected="selected" value="">[[Default]]</option>
  155. <option value="Noborder">[[Noborder]]</option>
  156. <option value="Exactfit">[[Exactfit]]</option>
  157. </select>
  158. </td>
  159. </tr>
  160. </table>
  161. </td>
  162. </tr>
  163. </table>
  164. </fieldset>
  165. <fieldset>
  166. <legend>[[Layout]]</legend>
  167. <table border="0" cellpadding="4" cellspacing="0" width="100%">
  168. <tr>
  169. <td>
  170. <table border="0" cellpadding="1" cellspacing="0" class="normal" width="100%">
  171. <tr>
  172. <td style="width:100">[[Alignment]]:</td>
  173. <td>
  174. <select name="Align" style="WIDTH : 80px" id="Align" onchange="do_preview()" onpropertychange="do_preview()">
  175. <option id="optNotSet" selected="selected" value="">[[Notset]]</option>
  176. <option id="optLeft" value="left">[[Left]]</option>
  177. <option id="optRight" value="right">[[Right]]</option>
  178. <option id="optTexttop" value="textTop">[[Texttop]]</option>
  179. <option id="optAbsMiddle" value="absMiddle">[[Absmiddle]]</option>
  180. <option id="optBaseline" value="baseline">[[Baseline]]</option>
  181. <option id="optAbsBottom" value="absBottom">[[Absbottom]]</option>
  182. <option id="optBottom" value="bottom">[[Bottom]]</option>
  183. <option id="optMiddle" value="middle">[[Middle]]</option>
  184. <option id="optTop" value="top">[[Top]]</option>
  185. </select>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td valign="middle" style="width:110">[[Horizontal]]:</td>
  190. <td><input type="text" size="2" name="HSpace" onchange="do_preview()" onpropertychange="do_preview()"
  191. onkeypress="return CancelEventIfNotDigit()" style="WIDTH:80px" id="HSpace" />
  192. </td>
  193. </tr>
  194. <tr>
  195. <td valign="middle">[[Vertical]]:</td>
  196. <td><input type="text" size="2" name="VSpace" onchange="do_preview()" onpropertychange="do_preview()"
  197. onkeypress="return CancelEventIfNotDigit()" style="WIDTH:80px" id="VSpace" /></td>
  198. </tr>
  199. </table>
  200. </td>
  201. </tr>
  202. </table>
  203. </fieldset>
  204. </td>
  205. <td style="width:10">
  206. </td>
  207. <td valign="top">
  208. <fieldset style="margin-bottom:5px">
  209. <legend>
  210. [[Insert]]</legend>
  211. <table border="0" cellpadding="4" cellspacing="0">
  212. <tr>
  213. <td>
  214. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  215. <tr>
  216. <td valign="middle" style="width:100">
  217. [[Url]]:</td>
  218. <td>
  219. <input type="text" id="TargetUrl" size="43" name="TargetUrl" runat="server" />
  220. </td>
  221. </tr>
  222. <tr>
  223. <td colspan="2">
  224. <input type="checkbox" checked="checked" id="chk_Loop" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Loop]]&nbsp;&nbsp;
  225. <input type="checkbox" checked="checked" id="chk_Autoplay" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Autoplay]]&nbsp;&nbsp;
  226. <input type="checkbox" checked="checked" id="chk_Transparency" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Transparency]]&nbsp;
  227. </td>
  228. </tr>
  229. </table>
  230. </td>
  231. </tr>
  232. </table>
  233. </fieldset>
  234. <fieldset id="fieldsetUpload">
  235. <legend>
  236. [[Upload]] ([[MaxFileSizeAllowed]]
  237. <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashSize * 1024)%>
  238. )</legend>
  239. <table border="0" cellspacing="2" cellpadding="0" width="98%" class="normal">
  240. <tr>
  241. <td valign="top" style="width:54%; FONT-SIZE: 8pt; VERTICAL-ALIGN: middle;">
  242. <CE:UploadSingleFile id="InputFile" runat="server"></CE:UploadSingleFile>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td style="width:8">
  247. </td>
  248. </tr>
  249. <tr>
  250. <td style="width:5">
  251. </td>
  252. </tr>
  253. <tr>
  254. <td style="white-space:nowrap">
  255. [[MaxFolderSizeAllowed]]: <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashFolderSize * 1024)%>.
  256. [[Used]]: <%= CuteEditor.Impl.FileStorage.FormatSize(fs.GetDirectorySize(fs.VirtualRoot)) %>
  257. <span style="background-color:green;height:3px;width:40px;font-size:3px">
  258. <span style="background-color:red;height:3px;width:<%= GetUsedSpaceBarWidth() %>px;font-size:3px"></span>
  259. </span>
  260. </td>
  261. </tr>
  262. </table>
  263. </fieldset>
  264. <div style="padding-top:4px;">
  265. <input class="inputbuttoninsert" type="button" value="[[Insert]]" onclick="do_insert()" />&nbsp;&nbsp;&nbsp;
  266. <input class="inputbuttoncancel" type="button" value="[[Cancel]]" onclick="do_cancel()" />
  267. </div>
  268. </td>
  269. </tr>
  270. </table>
  271. </form>
  272. <script runat="server">
  273. protected override void InitOfType()
  274. {
  275. fs.VirtualRoot=CuteEditor.EditorUtility.ProcessWebPath(Context,null,secset.FlashGalleryPath).TrimEnd('/')+"/";
  276. }
  277.     protected override void GetFiles(ArrayList files)
  278.     {
  279.         files.AddRange(fs.GetFileItems(CurrentDirectory, secset.FileNamePrefix + "*.swf"));
  280.     }
  281.     protected override bool AllowFileName(string filename)
  282.     {
  283.         filename = filename.ToLower();
  284.         return filename.EndsWith(".swf");
  285.     }
  286.     protected override string CheckUploadData(ref byte[] data)
  287.     {
  288. if (fs.GetDirectorySize(fs.VirtualRoot) >= secset.MaxFlashFolderSize * 1024)
  289.            return "Flash folder size exceeds the limit: "+ CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashFolderSize * 1024);
  290. if (data.Length >= secset.MaxFlashSize * 1024)
  291.             return "Flash size exceeds "+CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashSize * 1024)+" limit: "+ CuteEditor.Impl.FileStorage.FormatSize(data.Length);
  292.         return null;
  293.     }
  294.     
  295.     protected int GetUsedSpaceBarWidth()
  296.     {
  297.       int w = Convert.ToInt32(40*fs.GetDirectorySize(fs.VirtualRoot)/(secset.MaxFlashFolderSize * 1024));
  298.       if(w<1)
  299. w=1;
  300.   if(w>40)
  301. w=40;
  302.       return w;      
  303.     }
  304. </script>
  305. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogFoot.js"></script>
  306. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=Dialog_InsertFlash.js"></script>
  307. </body>
  308. </html>