puts the Flickr provider back for backwards compat, adds a todo and updates the release config with all providers

This commit is contained in:
Shannon
2015-06-25 17:10:45 +02:00
parent 5487ec1d5f
commit fdf53b8550
4 changed files with 88 additions and 12 deletions

View File

@@ -8,6 +8,8 @@ using Umbraco.Core.Media;
namespace Umbraco.Web.Media.EmbedProviders
{
//TODO: Make all Http calls async
public abstract class AbstractOEmbedProvider: IEmbedProvider
{
public virtual bool SupportsDimensions

View File

@@ -0,0 +1,25 @@
using System;
using System.ComponentModel;
using System.Web;
namespace Umbraco.Web.Media.EmbedProviders
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This is no longer used and will be removed from the codebase in the future, for Flickr, use the Umbraco.Web.Media.EmbedProviders.OEmbedPhoto provider")]
public class Flickr : AbstractOEmbedProvider
{
public override string GetMarkup(string url, int maxWidth, int maxHeight)
{
var flickrUrl = BuildFullUrl(url, maxWidth, maxHeight);
var doc = GetXmlResponse(flickrUrl);
string imageUrl = doc.SelectSingleNode("/oembed/url").InnerText;
string imageWidth = doc.SelectSingleNode("/oembed/width").InnerText;
string imageHeight = doc.SelectSingleNode("/oembed/height").InnerText;
string imageTitle = doc.SelectSingleNode("/oembed/title").InnerText;
return string.Format("<img src=\"{0}\" width\"{1}\" height=\"{2}\" alt=\"{3}\" />",
imageUrl, imageWidth, imageHeight, HttpUtility.HtmlEncode(imageTitle));
}
}
}