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

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="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. <title></title>
  23. <link href="Load.ashx?type=style&file=dialog.css" type="text/css" rel="stylesheet" />
  24. <!--[if IE]>
  25. <link href="Load.ashx?type=style&file=IE.css" type="text/css" rel="stylesheet" />
  26. <![endif]-->
  27. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogHead.js"></script>
  28. <script type="text/javascript" >
  29. var OxO5b88=[]; 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 src="../Load.ashx?type=image&file=zoom_in.gif" onclick="Zoom_In();" alt="[[ZoomIn]]" class="dialogButton"
  70. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  71. <img src="../Load.ashx?type=image&file=zoom_out.gif" onclick="Zoom_Out();" alt="[[ZoomOut]]" class="dialogButton"
  72. onmouseover="CuteEditor_ColorPicker_ButtonOver(this);" /> 
  73. <img 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">&nbsp;</div>
  104. </div>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td colspan="2" style="height:2">
  109. </td>
  110. </tr>
  111. </table>
  112. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  113. <tr>
  114. <td valign="top">
  115. <fieldset>
  116. <legend>[[Properties]]</legend>
  117. <table border="0" cellpadding="4" cellspacing="0" id="Table3">
  118. <tr>
  119. <td>
  120. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  121. <tr>
  122. <td style="width:110">[[Width]]:</td>
  123. <td style="width:120">
  124.     <input type="text" name="Width" id="Width" style="WIDTH : 80px" onchange="do_preview()" onpropertychange="do_preview()" onkeypress="return CancelEventIfNotDigit()" value="200" />
  125. </td>
  126. </tr>
  127. <tr>
  128. <td>[[Height]]:</td>
  129. <td>
  130.     <input type="text" name="Height" id="Height" style="WIDTH : 80px" onchange="do_preview()"
  131. onpropertychange="do_preview()" onkeypress="return CancelEventIfNotDigit()" value="200" />
  132.     </td>
  133. </tr>
  134. <tr>
  135. <td>[[Backgroundcolor]]:</td>
  136. <td><input type="text" id="bgColortext" name="bgColortext" size="7" style="WIDTH:57px" />
  137. <img alt="" src="../Load.ashx?type=image&file=colorpicker.gif" style='vertical-align:inherit;behavior:url(Load.ashx?type=htc&file=ColorPicker.htc)'
  138. oncolorchange="bgColortext.value=this.selectedColor; bgColortext.style.backgroundColor=this.selectedColor; this.style.backgroundColor=this.selectedColor" />
  139. </td>
  140. </tr>
  141. <tr>
  142. <td>[[Quality]]:
  143. </td>
  144. <td><select name="Quality" id="Quality" style="WIDTH : 80px" onchange="do_preview()" onpropertychange="do_preview()">
  145. <option selected="selected" value="high">High</option>
  146. <option value="medium">Medium</option>
  147. <option value="low">Low</option>
  148. </select>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td style="width:100">[[Scale]]:</td>
  153. <td>
  154. <select name="Scale" style="WIDTH : 80px" id="Scale" onchange="do_preview()" onpropertychange="do_preview()">
  155. <option selected="selected" value="">[[Default]]</option>
  156. <option value="Noborder">[[Noborder]]</option>
  157. <option value="Exactfit">[[Exactfit]]</option>
  158. </select>
  159. </td>
  160. </tr>
  161. </table>
  162. </td>
  163. </tr>
  164. </table>
  165. </fieldset>
  166. <fieldset>
  167. <legend>[[Layout]]</legend>
  168. <table border="0" cellpadding="4" cellspacing="0" width="100%">
  169. <tr>
  170. <td>
  171. <table border="0" cellpadding="1" cellspacing="0" class="normal" width="100%">
  172. <tr>
  173. <td style="width:100">[[Alignment]]:</td>
  174. <td>
  175. <select name="Align" style="WIDTH : 80px" id="Align" onchange="do_preview()" onpropertychange="do_preview()">
  176. <option id="optNotSet" selected="selected" value="">[[Notset]]</option>
  177. <option id="optLeft" value="left">[[Left]]</option>
  178. <option id="optRight" value="right">[[Right]]</option>
  179. <option id="optTexttop" value="textTop">[[Texttop]]</option>
  180. <option id="optAbsMiddle" value="absMiddle">[[Absmiddle]]</option>
  181. <option id="optBaseline" value="baseline">[[Baseline]]</option>
  182. <option id="optAbsBottom" value="absBottom">[[Absbottom]]</option>
  183. <option id="optBottom" value="bottom">[[Bottom]]</option>
  184. <option id="optMiddle" value="middle">[[Middle]]</option>
  185. <option id="optTop" value="top">[[Top]]</option>
  186. </select>
  187. </td>
  188. </tr>
  189. <tr>
  190. <td valign="middle" style="width:110px">[[Horizontal]]:</td>
  191. <td><input type="text" size="2" name="HSpace" onchange="do_preview()" onpropertychange="do_preview()"
  192. onkeypress="return CancelEventIfNotDigit()" style="WIDTH:80px" id="HSpace" />
  193. </td>
  194. </tr>
  195. <tr>
  196. <td valign="middle">[[Vertical]]:</td>
  197. <td>
  198.     <input type="text" size="2" name="VSpace" onchange="do_preview()" onpropertychange="do_preview()"
  199. onkeypress="return CancelEventIfNotDigit()" style="WIDTH:80px" id="VSpace" />
  200. </td>
  201. </tr>
  202. </table>
  203. </td>
  204. </tr>
  205. </table>
  206. </fieldset>
  207. </td>
  208. <td style="width:10">
  209. </td>
  210. <td valign="top">
  211. <fieldset style="margin-bottom:5px">
  212. <legend>
  213. [[Insert]]</legend>
  214. <table border="0" cellpadding="4" cellspacing="0">
  215. <tr>
  216. <td>
  217. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  218. <tr>
  219. <td valign="middle" style="width:100">
  220. [[Url]]:</td>
  221. <td>
  222. <input type="text" id="TargetUrl" size="43" name="TargetUrl" runat="server" /></td>
  223. </tr>
  224. <tr>
  225. <td colspan="2">
  226. <input type="checkbox" checked="checked" id="chk_Loop" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Loop]]&nbsp;&nbsp;
  227. <input type="checkbox" checked="checked" id="chk_Autoplay" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Autoplay]]&nbsp;&nbsp;
  228. <input type="checkbox" checked="checked" id="chk_Transparency" onchange="do_preview()" onpropertychange="do_preview()" />&nbsp;[[Transparency]]&nbsp;
  229. </td>
  230. </tr>
  231. </table>
  232. </td>
  233. </tr>
  234. </table>
  235. </fieldset>
  236. <fieldset id="fieldsetUpload">
  237. <legend>
  238. [[Upload]] ([[MaxFileSizeAllowed]]
  239. <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashSize * 1024)%>
  240. )</legend>
  241. <table border="0" cellspacing="2" cellpadding="0" width="98%" class="normal">
  242. <tr>
  243. <td style="Height:10">
  244. </td>
  245. </tr>
  246. <tr>
  247. <td valign="top" style="font-size: 8pt; VERTICAL-ALIGN: middle;width:54%">
  248. <CE:UploadSingleFile id="InputFile" runat="server"></CE:UploadSingleFile>
  249. </td>
  250. </tr>
  251. <tr>
  252. <td style="width:8">
  253. </td>
  254. </tr>
  255. <tr>
  256. <td style="width:5">
  257. </td>
  258. </tr>
  259. <tr>
  260. <td>
  261. <span style="white-space:nowrap">
  262. [[MaxFolderSizeAllowed]]: <%= CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashFolderSize * 1024)%>.
  263. [[Used]]: <%= CuteEditor.Impl.FileStorage.FormatSize(fs.GetDirectorySize(fs.VirtualRoot)) %>
  264. <span style="background-color:green;height:3px;width:40px;font-size:3px">
  265. <span style="background-color:red;height:3px;width:<%= GetUsedSpaceBarWidth() %>px;font-size:3px"></span>
  266. </span>
  267. </span>
  268. </td>
  269. </tr>
  270. </table>
  271. </fieldset>
  272. <div style="padding-top:10px;">
  273. <input class="inputbuttoninsert" type="button" value="[[Insert]]" onclick="do_insert()" />&nbsp;&nbsp;&nbsp;
  274. <input class="inputbuttoncancel" type="button" value="[[Cancel]]" onclick="do_cancel()" />
  275. </div>
  276. </td>
  277. </tr>
  278. </table>
  279. </form>
  280. <script runat="server">
  281. protected override void InitOfType()
  282. {
  283. fs.VirtualRoot=CuteEditor.EditorUtility.ProcessWebPath(Context,null,secset.FlashGalleryPath).TrimEnd('/')+"/";
  284. }
  285.     protected override void GetFiles(ArrayList files)
  286.     {
  287.         files.AddRange(fs.GetFileItems(CurrentDirectory, secset.FileNamePrefix + "*.swf"));
  288.     }
  289.     protected override bool AllowFileName(string filename)
  290.     {
  291.         filename = filename.ToLower();
  292.         return filename.EndsWith(".swf");
  293.     }
  294.     protected override string CheckUploadData(ref byte[] data)
  295.     {
  296. if (fs.GetDirectorySize(fs.VirtualRoot) >= secset.MaxFlashFolderSize * 1024)
  297.            return "Flash folder size exceeds the limit: "+ CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashFolderSize * 1024);
  298. if (data.Length >= secset.MaxFlashSize * 1024)
  299.             return "Flash size exceeds "+CuteEditor.Impl.FileStorage.FormatSize(secset.MaxFlashSize * 1024)+" limit: "+ CuteEditor.Impl.FileStorage.FormatSize(data.Length);
  300.         return null;
  301.     }
  302.     
  303.     protected int GetUsedSpaceBarWidth()
  304.     {
  305.       int w = Convert.ToInt32(40*fs.GetDirectorySize(fs.VirtualRoot)/(secset.MaxFlashFolderSize * 1024));
  306.       if(w<1)
  307. w=1;
  308.   if(w>40)
  309. w=40;
  310.       return w;      
  311.     }
  312. </script>
  313. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogFoot.js"></script>
  314. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=Dialog_InsertFlash.js"></script>
  315. </body>
  316. </html>