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

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" Inherits="CuteEditor.EditorUtilityPage" %>
  2. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
  3. <script runat="server">
  4. override protected void OnInit(EventArgs args)
  5. {
  6. if(Context.Request.QueryString["IsFrame"]==null)
  7. {
  8. string FrameSrc="OuterEditorFull.aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
  9. CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[NewTemplate]]",FrameSrc);
  10. Context.Response.End();
  11. }
  12. base.OnInit(args);
  13. this.Load += new System.EventHandler(this.Page_Load); 
  14. }
  15. </script>
  16. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19. <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.1)" />
  20. <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" />
  21. <link href="Load.ashx?type=style&file=dialog.css" type="text/css" rel="stylesheet" />
  22. <!--[if IE]>
  23. <link href="Load.ashx?type=style&file=IE.css" type="text/css" rel="stylesheet" />
  24. <![endif]-->
  25. <title>[[NewTemplate]]</title>
  26. </head>
  27. <body bgcolor="white">
  28. <form runat="server" id="Form1">
  29. <CE:EDITOR 
  30. id="OuterEditor" 
  31. AutoConfigure="Full"
  32. ShowDecreaseButton="false" 
  33. ShowEnlargeButton="false" 
  34. runat="server"
  35. DisableItemList="print,DocumentPropertyPage,ToFullPage,FromFullPage,CssStyle,InsertTemplate"
  36. >
  37. </CE:EDITOR>
  38. </form>
  39. </body>
  40. </html>
  41. <script runat="server">
  42. void Page_Load(object sender, System.EventArgs e)
  43. {
  44. CuteEditor.ToolControl tc = OuterEditor.ToolControls["insertcustombutonhere"];
  45. if(tc!=null)
  46. {
  47. System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image ();
  48. Image1.ToolTip = "Close";
  49. Image1.ImageUrl = "../Themes/custom/images/close.gif";
  50. Image1.CssClass = "CuteEditorButton";
  51. SetMouseEvents(Image1);
  52. Image1.Attributes["onclick"]="top.returnValue=null; top.close();";
  53. System.Web.UI.WebControls.Image Image2 = new System.Web.UI.WebControls.Image ();
  54. Image2.ToolTip = "Add uneditable regions";
  55. Image2.ImageUrl = "../Themes/custom/images/noneditable.gif";
  56. Image2.CssClass = "CuteEditorButton";
  57. SetMouseEvents(Image2);
  58. Image2.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('noneditable');";
  59. tc.Control.Controls.Add(Image2);
  60. tc.Control.Controls.Add(Image1);
  61. }
  62. bool isnew = true;
  63. string filename = Request.QueryString["f"];
  64. if(System.IO.File.Exists(HttpContext.Current.Server.MapPath(filename)))
  65. {
  66. isnew = false;
  67. }
  68. else
  69. {
  70. if(!filename.EndsWith(".htm")&& !filename.EndsWith(".html"))
  71.  filename=filename+".htm";
  72. }
  73. if (!IsPostBack) 
  74. {
  75. if(!isnew)
  76. {
  77. OuterEditor.LoadHtml(filename);
  78. }
  79. }
  80. else
  81. OuterEditor.SaveFile(filename); 
  82. HttpContext.Current.Response.Write("<script language='javascript'>top.returnValue=true;top.close();</scr" + "ipt>");
  83.     } 
  84.     if(OuterEditor.BrowserType==BrowserType.CompatibleIE)
  85.     {
  86. OuterEditor.FullPage=true;
  87.     }
  88. }
  89. void SetMouseEvents(WebControl control)
  90. {
  91. control.Attributes["onmouseover"]="CuteEditor_ButtonCommandOver(this)";
  92. control.Attributes["onmouseout"]="CuteEditor_ButtonCommandOut(this)";
  93. control.Attributes["onmousedown"]="CuteEditor_ButtonCommandDown(this)";
  94. control.Attributes["onmouseup"]="CuteEditor_ButtonCommandUp(this)";
  95. control.Attributes["ondragstart"]="CuteEditor_CancelEvent()";
  96. }
  97. </script>