diff --git a/src/managed/OpenLiveWriter.Localization/DisplayMessages.xml b/src/managed/OpenLiveWriter.Localization/DisplayMessages.xml index cd4caec5..120e570e 100644 --- a/src/managed/OpenLiveWriter.Localization/DisplayMessages.xml +++ b/src/managed/OpenLiveWriter.Localization/DisplayMessages.xml @@ -649,7 +649,7 @@ Type="Exclamation" Buttons="YesNo" Title="Open Live Writer" - Text="{0} Not a valid URL. Do you want to continue?" + Text="{0} Not a valid URL. Do you want to go back and edit the URL?" comment:Text="{0} - the url that was entered"/> {0} Not a valid URL. -Do you want to continue? +Do you want to go back and edit the URL? {0} - the url that was entered Open Live Writer diff --git a/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/WebImages/WebImageForm.cs b/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/WebImages/WebImageForm.cs index 34f78a1a..2ccb8a37 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/WebImages/WebImageForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/WebImages/WebImageForm.cs @@ -48,8 +48,12 @@ namespace OpenLiveWriter.PostEditor.ImageInsertion.WebImages { if (!UrlHelper.IsUrl(_source.SourceImageLink)) { - if (DisplayMessage.Show(MessageId.InputIsNotUrl, this, _source.SourceImageLink) == System.Windows.Forms.DialogResult.No) + //Ask if they want to go back and correct the link or just abort it altogether + if (DisplayMessage.Show(MessageId.InputIsNotUrl, this, _source.SourceImageLink) == System.Windows.Forms.DialogResult.Yes) + { + _source.TabSelected(); return; + } } DialogResult = System.Windows.Forms.DialogResult.OK; } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs index 6fad3cc3..10e1313a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs @@ -7,8 +7,10 @@ using System.Drawing; using System.Globalization; using System.IO; using mshtml; +using OpenLiveWriter.Controls; using OpenLiveWriter.CoreServices; using OpenLiveWriter.Extensibility.ImageEditing; +using OpenLiveWriter.Localization; using OpenLiveWriter.PostEditor.PostHtmlEditing.ImageEditing.Decorators; namespace OpenLiveWriter.PostEditor.PostHtmlEditing @@ -93,8 +95,15 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing imgHtmlElement.setAttribute("height", oldHeight, 0); if (!String.IsNullOrEmpty(oldWidth)) imgHtmlElement.setAttribute("width", oldWidth, 0); - - info = new ImagePropertiesInfo(new Uri(imgSrc), new Size(width, height), remoteImageDecoratorsList); + Uri infoUri; + if (Uri.TryCreate(imgSrc, UriKind.Absolute, out infoUri)) + { + info = new ImagePropertiesInfo(infoUri, new Size(width, height), remoteImageDecoratorsList); + } + else + { + info = new ImagePropertiesInfo(new Uri("http://www.example.com"), new Size(width, height), remoteImageDecoratorsList); + } info.ImgElement = imgHtmlElement; // Sets the correct inline image size and image size name for the remote image.