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

@@ -1,17 +1,11 @@
<?xml version="1.0"?>
<embed>
<!-- Flickr Settings-->
<provider name="Flickr" type="Umbraco.Web.Media.EmbedProviders.Flickr, umbraco">
<provider name="Flickr" type="Umbraco.Web.Media.EmbedProviders.OEmbedPhoto, umbraco">
<urlShemeRegex><![CDATA[flickr\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.flickr.com/services/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Screenr Settings -->
<provider name="Screenr" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco" supportsDimensions="False">
<urlShemeRegex><![CDATA[screenr\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.screenr.com/api/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- SlideShare Settings -->
<provider name="SlideShare" type="Umbraco.Web.Media.EmbedProviders.OEmbedRich, umbraco">
<urlShemeRegex><![CDATA[slideshare\.net/]]></urlShemeRegex>
@@ -20,16 +14,54 @@
<param name="format">xml</param>
</requestParams>
</provider>
<!-- Kickstarter Settings-->
<provider name="Kickstarter" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[kickstarter\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.kickstarter.com/services/oembed]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Getty Images Settings-->
<provider name="GettyImages" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[gty\.im/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://embed.gettyimages.com/oembed]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Poll Everywhere Settigs -->
<provider name="PollEverywhere" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[polleverywhere\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.polleverywhere.com/services/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Poll Daddy Settigs -->
<provider name="PollDaddy" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[polldaddy\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://polldaddy.com/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- IFTTT Settigs -->
<provider name="IFTTT" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[ifttt\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.ifttt.com/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Instagram Settigs -->
<provider name="Instagram" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[instagram\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://api.instagram.com/oembed]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Rdio Settigs -->
<provider name="Rdio" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, umbraco">
<urlShemeRegex><![CDATA[rdio\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.rdio.com/api/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- SoundCloud Settigs -->
<provider name="SoundCloud" type="Umbraco.Web.Media.EmbedProviders.OEmbedRich, umbraco">
<urlShemeRegex><![CDATA[soundcloud\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://soundcloud.com/oembed]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Twitgoo Settings , not an OEmbed one -->
<provider name="Twitgoo" type="Umbraco.Web.Media.EmbedProviders.Twitgoo, umbraco">
<urlShemeRegex><![CDATA[twitgoo\.com/]]></urlShemeRegex>
</provider>
<!-- Youtube Settings -->
<provider name="Youtube" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco">
<urlShemeRegex><![CDATA[youtu(?:\.be|be\.com)/(?:(.*)v(/|=)|(.*/)?)([a-zA-Z0-9-_]+)]]></urlShemeRegex>
@@ -67,5 +99,21 @@
<urlShemeRegex><![CDATA[vimeo\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://vimeo.com/api/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
</provider>
<!-- Ted -->
<provider name="Ted" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco">
<urlShemeRegex><![CDATA[ted\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.ted.com/talks/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Screenr Settings -->
<provider name="Screenr" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco" supportsDimensions="False">
<urlShemeRegex><![CDATA[screenr\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.screenr.com/api/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"></requestParams>
</provider>
<!-- Twitgoo Settings , not an OEmbed one -->
<provider name="Twitgoo" type="Umbraco.Web.Media.EmbedProviders.Twitgoo, umbraco">
<urlShemeRegex><![CDATA[twitgoo\.com/]]></urlShemeRegex>
</provider>
</embed>

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));
}
}
}

View File

@@ -302,6 +302,7 @@
<Compile Include="ApplicationContextExtensions.cs" />
<Compile Include="AreaRegistrationContextExtensions.cs" />
<Compile Include="HtmlHelperBackOfficeExtensions.cs" />
<Compile Include="Media\EmbedProviders\Flickr.cs" />
<Compile Include="PropertyEditors\DatePreValueEditor.cs" />
<Compile Include="Security\Identity\GetUserSecondsMiddleWare.cs" />
<Compile Include="Media\EmbedProviders\OEmbedJson.cs" />