/// <summary> /// On Load /// </summary> /// <param name="e"> /// The e. /// </param> protected override void OnLoad(EventArgs e) { Assert.ArgumentNotNull(e, "e"); base.OnLoad(e); if (!Sitecore.Context.ClientPage.IsEvent) { var url2 = new RichTextEditorUrl { Conversion = RichTextEditorUrl.HtmlConversion.DoNotConvert, Disabled = this.Disabled, FieldID = this.FieldID, ID = this.ID, ItemID = this.ItemID, Language = this.ItemLanguage, Mode = "ContentEditor", Source = this.Source, Url = string.Empty, Value = this.Value, Version = this.ItemVersion }; var urlReturn = url2.GetUrl().ToString(); if (this.GetViewStateString("Source").Contains("&")) { urlReturn = this.GetViewStateString("Source").Split('&').Aggregate(urlReturn, (current, queryString) => current + "&" + queryString); } this.handle = url2.Handle; this.setValueOnPreRender = true; this.SourceUri = urlReturn; } }
/// <summary>Handles the Accept_ click event.</summary> protected void OnAccept() { SaveRichTextContentArgs richTextContentArgs = new SaveRichTextContentArgs(this.Request.Form["FieldText"]); richTextContentArgs.Content = WebEditUtil.RepairLinks(richTextContentArgs.Content); using (new LongRunningOperationWatcher(250, "saveRichTextContent", new string[0])) CorePipeline.Run("saveRichTextContent", (PipelineArgs)richTextContentArgs); if (!RichTextEditorUrl.Parse(this.Context.Request.RawUrl).ShowInFrameBasedDialog) { SheerResponse.Eval(string.Format("scRichText.saveRichText({0})", (object)StringUtil.EscapeJavascriptString(richTextContentArgs.Content))); } else { SheerResponse.SetDialogValue(richTextContentArgs.Content); } SheerResponse.Eval("EditorPage.scCloseEditor();"); }
/// <summary> /// Edit Text Button /// </summary> /// <param name="args"> /// The args. /// </param> private new void EditText(ClientPipelineArgs args) { Assert.ArgumentNotNull(args, "args"); if (!this.Disabled) { if (args.IsPostBack) { if ((args.Result != null) && (args.Result != "undefined")) { this.UpdateHtml(args); } } else { var url2 = new RichTextEditorUrl { Conversion = RichTextEditorUrl.HtmlConversion.DoNotConvert, Disabled = this.Disabled, FieldID = this.FieldID, ID = this.ID, ItemID = this.ItemID, Language = this.ItemLanguage, Mode = string.Empty, Source = this.Source, Url = "/sitecore/shell/Controls/Rich Text Editor/EditorPage.aspx", Value = this.Value, Version = this.ItemVersion }; var urlReturn = url2.GetUrl().ToString(); if (this.GetViewStateString("Source").Contains("&")) { urlReturn = this.GetViewStateString("Source").Split('&').Aggregate(urlReturn, (current, queryString) => current + "&" + queryString); } this.handle = url2.Handle; var id = MainUtil.GetMD5Hash(this.Source + this.ItemLanguage); SheerResponse.Eval(string.Concat(new object[] { "scContent.editRichText(\"", urlReturn, "\", \"", id.ToShortID(), "\", ", StringUtil.EscapeJavascriptString(this.Value), ")" })); args.WaitForPostBack(); } } }