puts the Flickr provider back for backwards compat, adds a todo and updates the release config with all providers
This commit is contained in:
@@ -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
|
||||
|
||||
25
src/Umbraco.Web/Media/EmbedProviders/Flickr.cs
Normal file
25
src/Umbraco.Web/Media/EmbedProviders/Flickr.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user