private void uxInsertIFrame_Click(object sender, System.EventArgs e) { HideErrors(); bool mobileErrors = false; bool desktopErrors = false; if (string.IsNullOrEmpty(desktopEmbed.Text) || desktopEmbed.Text.Trim().Equals(_desktopPHText)) { uxDesktopError.Text = "Desktop code is required."; uxDesktopError.Show(); desktopErrors = true; } if (!desktopErrors && !ValidDesktopInput(desktopEmbed.Text)) { uxDesktopError.Text = Resources.IFrameControl_uxInsertIFrame_Click_DesktopEmbedd; uxDesktopError.Show(); desktopErrors = true; } if (DesktopIFrame != null && !desktopErrors && !IFramesIsSecure(DesktopIFrame.DocumentNode.SelectNodes("//iframe"), out InsecureDesktopURL)) { uxDesktopError.Text = Resources.IFrameControl_uxInsertIFrame_Click_Insecure_Multimedia; uxDesktopError.Show(); uxDesktophttpsPreview.Visible = true; desktopErrors = true; } if (!ValidMobileInput(mobileEmbed.Text)) { uxMobileError.Text = Resources.IFrameControl_uxInsertIFrame_Click_DesktopEmbedd; uxMobileError.Show(); mobileErrors = true; } if (MobileIFrame != null && !mobileErrors && !IFramesIsSecure(MobileIFrame.DocumentNode.SelectNodes("//iframe"), out InsecureMobileURL)) { uxMobileError.Text = Resources.IFrameControl_uxInsertIFrame_Click_Insecure_Multimedia; uxMobileError.Show(); uxMobilehttpsPreview.Visible = true; mobileErrors = true; } if (!mobileErrors && !desktopErrors) { mobileEmbed.Text = mobileEmbed.Text.Trim().Equals(_mobilePHText) ? String.Empty : mobileEmbed.Text; //set mobile text to empty if it is the placeholder text InsertIFrame(uxIFrameHeader.Text, uxIFrameTitle.Text, uxIFrameCaption.Text, uxIFrameSource.Text, SuggestedURL.GetSuggestedUrl(desktopEmbed.Text), SuggestedURL.GetSuggestedUrl(mobileEmbed.Text)); InitializeValues(); } else { MessageBox.Show(Resources.IFrameControl_uxInsertIFrame_Click_Multimedia_Error); } }
public static void Open(string originalUrl, Action <string> callback) { string suggestedUrl = GetSuggestedUrl(originalUrl); var suggestedFrom = new SuggestedURL(suggestedUrl, callback); suggestedFrom.ShowDialog(Globals.SitecoreAddin.Application.ActiveDocument as IWin32Window); }
private void uxDesktophttpsPreview_Click(object sender, EventArgs e) { SuggestedURL.Open(InsecureDesktopURL, this.InsertDesktopUrl); }
private void uxMobilehttpsPreview_Click(object sender, EventArgs e) { SuggestedURL.Open(InsecureMobileURL, this.InsertMobileUrl); }