diff --git a/Novicell.Umbraco.OEmbed.Web/.gitignore b/Novicell.Umbraco.OEmbed.Web/.gitignore new file mode 100644 index 0000000..d183720 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/.gitignore @@ -0,0 +1,478 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +## +## Umbraco CMS +## + +# JSON schema file for appsettings.json +appsettings-schema.json + +# Packages created from the backoffice (package.xml/package.zip) +/umbraco/Data/CreatedPackages/ + +# Temp folder containing Examine indexes, NuCache, MediaCache, etc. +/umbraco/Data/TEMP/ + +# SQLite database files +/umbraco/Data/*.sqlite.db +/umbraco/Data/*.sqlite.db-shm +/umbraco/Data/*.sqlite.db-wal + +# Log files +/umbraco/Logs/ + +# Media files +/wwwroot/media/ diff --git a/Novicell.Umbraco.OEmbed.Web/Composer/AdvanceOEmbedComposer.cs b/Novicell.Umbraco.OEmbed.Web/Composer/AdvanceOEmbedComposer.cs new file mode 100644 index 0000000..9dd64f8 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Composer/AdvanceOEmbedComposer.cs @@ -0,0 +1,13 @@ +using Novicell.OEmbed.Web.Manifest; +using Umbraco.Cms.Core.Composing; + +namespace Novicell.OEmbed.Web.Composer +{ + public class AdvanceOEmbedComposer : IComposer + { + public void Compose(IUmbracoBuilder builder) + { + builder.ManifestFilters().Append(); + } + } +} diff --git a/Novicell.Umbraco.OEmbed.Web/Manifest/AdvanceOEmbedManifestFilter.cs b/Novicell.Umbraco.OEmbed.Web/Manifest/AdvanceOEmbedManifestFilter.cs new file mode 100644 index 0000000..c831139 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Manifest/AdvanceOEmbedManifestFilter.cs @@ -0,0 +1,27 @@ +using Umbraco.Cms.Core.Manifest; + +namespace Novicell.OEmbed.Web.Manifest +{ + /// + public class AdvanceOEmbedManifestFilter : IManifestFilter + { + /// + public void Filter(List manifests) + { + manifests.Add(new PackageManifest + { + PackageName = Novicell.OEmbed.Core.Constants.Package.Alias, + BundleOptions = BundleOptions.Independent, + Scripts = new[] + { + Core.Constants.Package.PluginFolder + "Scripts/Controller/OEmbed.Controller.js" + }, + Stylesheets = new[] + { + Core.Constants.Package.PluginFolder + "Styles/OEmbed.css" + }, + Version = Novicell.OEmbed.Core.Constants.Package.Version + }); + } + } +} diff --git a/Novicell.Umbraco.OEmbed.Web/Novicell.OEmbed.Web.csproj b/Novicell.Umbraco.OEmbed.Web/Novicell.OEmbed.Web.csproj new file mode 100644 index 0000000..03547df --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Novicell.OEmbed.Web.csproj @@ -0,0 +1,34 @@ + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + true + + + + + false + false + + + diff --git a/Novicell.Umbraco.OEmbed.Web/Program.cs b/Novicell.Umbraco.OEmbed.Web/Program.cs new file mode 100644 index 0000000..d5313b5 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Program.cs @@ -0,0 +1,19 @@ +namespace Novicell.OEmbed.Web +{ + public class Program + { + public static void Main(string[] args) + => CreateHostBuilder(args) + .Build() + .Run(); + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureUmbracoDefaults() + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStaticWebAssets(); + webBuilder.UseStartup(); + }); + } +} diff --git a/src/Novicell.Umbraco.OEmbed.Website/Properties/launchSettings.json b/Novicell.Umbraco.OEmbed.Web/Properties/launchSettings.json similarity index 58% rename from src/Novicell.Umbraco.OEmbed.Website/Properties/launchSettings.json rename to Novicell.Umbraco.OEmbed.Web/Properties/launchSettings.json index eb72577..2101218 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Properties/launchSettings.json +++ b/Novicell.Umbraco.OEmbed.Web/Properties/launchSettings.json @@ -1,10 +1,11 @@ { + "$schema": "https://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:6278", - "sslPort": 44348 + "applicationUrl": "http://localhost:61969", + "sslPort": 44393 } }, "profiles": { @@ -15,12 +16,14 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "Umbraco.Web.UI.NetCore": { + "Umbraco.Web.UI": { "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:44393;http://localhost:61969", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:44348;http://localhost:6278" + } } } } diff --git a/Novicell.Umbraco.OEmbed.Web/PropertyEditors/AdvanceOEmbedPrropertyEditor.cs b/Novicell.Umbraco.OEmbed.Web/PropertyEditors/AdvanceOEmbedPrropertyEditor.cs new file mode 100644 index 0000000..f94dd48 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/PropertyEditors/AdvanceOEmbedPrropertyEditor.cs @@ -0,0 +1,27 @@ +using Umbraco.Cms.Core.IO; +using Umbraco.Cms.Core.PropertyEditors; +using Umbraco.Cms.Core.Services; + +namespace Novicell.OEmbed.Web.PropertyEditors +{ + /// + /// Represents a AdvanceOEmbed property editor. + /// + [DataEditor( + alias: Novicell.OEmbed.Core.Constants.Package.Alias, + name: Novicell.OEmbed.Core.Constants.Package.Name, + view: Novicell.OEmbed.Core.Constants.Package.PluginFolder + "ombed.propertyeditor.html", + Group = Umbraco.Cms.Core.Constants.PropertyEditors.Groups.Media, + Icon = "icon-picture", + ValueType = ValueTypes.Json)] + public class AdvanceOEmbedPrropertyEditor: DataEditor + { + /// + /// Initializes a new instance of the class. + /// + public AdvanceOEmbedPrropertyEditor(IDataValueEditorFactory dataValueEditorFactory) + : base(dataValueEditorFactory) + { + } + } +} diff --git a/src/Novicell.Umbraco.OEmbed.Website/Startup.cs b/Novicell.Umbraco.OEmbed.Web/Startup.cs similarity index 71% rename from src/Novicell.Umbraco.OEmbed.Website/Startup.cs rename to Novicell.Umbraco.OEmbed.Web/Startup.cs index 305f6dc..5237990 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Startup.cs +++ b/Novicell.Umbraco.OEmbed.Web/Startup.cs @@ -1,13 +1,4 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Extensions; - -namespace Novicell.Umbraco.OEmbed.Website +namespace Novicell.OEmbed.Web { public class Startup { @@ -15,12 +6,12 @@ public class Startup private readonly IConfiguration _config; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// The Web Host Environment - /// The Configuration + /// The web hosting environment. + /// The configuration. /// - /// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337 + /// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337. /// public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) { @@ -29,24 +20,27 @@ public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) } /// - /// Configures the services + /// Configures the services. /// + /// The services. /// /// This method gets called by the runtime. Use this method to add services to the container. - /// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + /// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940. /// public void ConfigureServices(IServiceCollection services) { services.AddUmbraco(_env, _config) - .AddBackOffice() + .AddBackOffice() .AddWebsite() .AddComposers() .Build(); } /// - /// Configures the application + /// Configures the application. /// + /// The application builder. + /// The web hosting environment. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Site.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Frontpage.cshtml similarity index 67% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Site.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Frontpage.cshtml index e980fc1..284e8c6 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Site.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Frontpage.cshtml @@ -1,8 +1,6 @@ @using Umbraco.Cms.Web.Common.PublishedModels; -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @using ContentModels = Umbraco.Cms.Web.Common.PublishedModels; @{ Layout = null; - var home = Model.Descendant(); - this.Context.Response.Redirect(home.Url()); } \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/blocklist/default.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/blocklist/default.cshtml similarity index 67% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/blocklist/default.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/blocklist/default.cshtml index 1c4f33b..accca2e 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/blocklist/default.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/blocklist/default.cshtml @@ -1,12 +1,13 @@ @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ - if (!Model.Any()) { return; } + if (Model?.Any() != true) { return; } }
@foreach (var block in Model) { if (block?.ContentUdi == null) { continue; } var data = block.Content; - @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block) + + @await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block) }
diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3-fluid.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3-fluid.cshtml similarity index 74% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3-fluid.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3-fluid.cshtml index 7e349bd..b92734e 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3-fluid.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3-fluid.cshtml @@ -7,14 +7,15 @@ Razor helpers located at the bottom of this file *@ -@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) +@if (Model is JObject && Model?.sections is not null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
@if (oneColumn) { - foreach (var section in Model.sections) { + foreach (var section in Model.sections) + {
@foreach (var row in section.rows) { @@ -22,12 +23,15 @@ }
} - }else { + } + else + {
- @foreach (var s in Model.sections) { + @foreach (var sec in Model.sections) + {
-
- @foreach (var row in s.rows) +
+ @foreach (var row in sec.rows) { renderRow(row); } @@ -39,38 +43,46 @@
} -@functions { - private void renderRow(dynamic row) +@functions{ + + private async Task renderRow(dynamic row) {
- @foreach ( var area in row.areas ) { + @foreach (var area in row.areas) + {
- @foreach (var control in area.controls) { - if (control !=null && control.editor != null && control.editor.view != null ) { - @Html.Partial("grid/editors/base", (object)control) + @foreach (var control in area.controls) + { + if (control?.editor?.view != null) + { + @await Html.PartialAsync("grid/editors/base", (object)control) } }
-
} +
+ }
} } -@functions { +@functions{ + public static HtmlString RenderElementAttributes(dynamic contentItem) { var attrs = new List(); JObject cfg = contentItem.config; - if(cfg != null) + if (cfg != null) + { foreach (JProperty property in cfg.Properties()) { var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); attrs.Add(property.Name + "=\"" + propertyValue + "\""); } + } JObject style = contentItem.styles; diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3.cshtml similarity index 71% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3.cshtml index cf35714..8863788 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/bootstrap3.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/bootstrap3.cshtml @@ -3,14 +3,15 @@ @using Newtonsoft.Json.Linq @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) +@if (Model is JObject && Model?.sections is not null) { - var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; + var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
@if (oneColumn) { - foreach (var section in Model.sections) { + foreach (var section in Model.sections) + {
@foreach (var row in section.rows) { @@ -18,13 +19,16 @@ }
} - }else { + } + else + {
- @foreach (var s in Model.sections) { + @foreach (var sec in Model.sections) + {
-
- @foreach (var row in s.rows) +
+ @foreach (var row in sec.rows) { renderRow(row, false); } @@ -37,25 +41,29 @@
} -@functions { +@functions{ - private void renderRow(dynamic row, bool singleColumn) + private async Task renderRow(dynamic row, bool singleColumn) {
@if (singleColumn) { @:
}
- @foreach ( var area in row.areas ) { + @foreach (var area in row.areas) + {
- @foreach (var control in area.controls) { - if (control !=null && control.editor != null && control.editor.view != null ) { - @Html.Partial("grid/editors/base", (object)control) + @foreach (var control in area.controls) + { + if (control?.editor?.view != null) + { + @await Html.PartialAsync("grid/editors/base", (object)control) } }
-
} +
+ }
@if (singleColumn) { @:
@@ -65,23 +73,26 @@ } +@functions{ -@functions { public static HtmlString RenderElementAttributes(dynamic contentItem) { var attrs = new List(); JObject cfg = contentItem.config; - if(cfg != null) + if (cfg != null) + { foreach (JProperty property in cfg.Properties()) { var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); attrs.Add(property.Name + "=\"" + propertyValue + "\""); } + } JObject style = contentItem.styles; - if (style != null) { + if (style != null) + { var cssVals = new List(); foreach (JProperty property in style.Properties()) { diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/base.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/base.cshtml similarity index 60% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/base.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/base.cshtml index c108f88..e40543b 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/base.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/base.cshtml @@ -1,23 +1,27 @@ @model dynamic -@functions { +@try +{ + string editor = EditorView(Model); + @await Html.PartialAsync(editor, Model as object) +} +catch (Exception ex) +{ +
@ex.ToString()
+} + +@functions{ + public static string EditorView(dynamic contentItem) { string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); - view = view.ToLower().Replace(".html", ".cshtml"); + view = view.Replace(".html", ".cshtml"); - if (!view.Contains("/")) { + if (!view.Contains("/")) + { view = "grid/editors/" + view; } return view; } } -@try -{ - string editor = EditorView(Model); - @Html.Partial(editor, (object)Model) -} -catch (Exception ex) { -
@ex.ToString()
-} diff --git a/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/embed.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/embed.cshtml new file mode 100644 index 0000000..74c8fe2 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/embed.cshtml @@ -0,0 +1,11 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +@if (Model is not null) +{ + string embedValue = Convert.ToString(Model.value); + embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; + +
+ @Html.Raw(embedValue) +
+} diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/macro.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/macro.cshtml similarity index 92% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/macro.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/macro.cshtml index 0e9661e..a4450d1 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/macro.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/macro.cshtml @@ -1,6 +1,6 @@ @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@if (Model.value != null) +@if (Model?.value is not null) { string macroAlias = Model.value.macroAlias.ToString(); var parameters = new Dictionary(); diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/media.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/media.cshtml similarity index 95% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/media.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/media.cshtml index 6c64b8d..bc3b111 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/media.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/media.cshtml @@ -2,10 +2,13 @@ @using Umbraco.Cms.Core.Media @using Umbraco.Cms.Core.PropertyEditors.ValueConverters @inject IImageUrlGenerator ImageUrlGenerator -@if (Model.value != null) + +@if (Model?.value is not null) { var url = Model.value.image; - if(Model.editor.config != null && Model.editor.config.size != null){ + + if (Model.editor.config != null && Model.editor.config.size != null) + { if (Model.value.coordinates != null) { url = ImageCropperTemplateCoreExtensions.GetCropUrl( diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/rte.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/rte.cshtml similarity index 79% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/rte.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/rte.cshtml index 33e720f..9445666 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/rte.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/rte.cshtml @@ -5,9 +5,9 @@ @inject HtmlImageSourceParser HtmlImageSourceParser; @{ - - var value = HtmlLocalLinkParser.EnsureInternalLinks(Model.value.ToString()); + var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString()); value = HtmlUrlParser.EnsureUrls(value); value = HtmlImageSourceParser.EnsureImageSources(value); } + @Html.Raw(value) diff --git a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/textstring.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/textstring.cshtml similarity index 57% rename from src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/textstring.cshtml rename to Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/textstring.cshtml index 17d8e2d..d4152a5 100644 --- a/src/Novicell.Umbraco.OEmbed.Website/Views/Partials/grid/editors/textstring.cshtml +++ b/Novicell.Umbraco.OEmbed.Web/Views/Partials/grid/editors/textstring.cshtml @@ -1,10 +1,10 @@ @using System.Web @model dynamic -@if (Model.editor.config.markup != null) +@if (Model?.editor.config.markup is not null) { string markup = Model.editor.config.markup.ToString(); - markup = markup.Replace("#value#", Html.ReplaceLineBreaks(HttpUtility.HtmlEncode((string)Model.value.ToString())).ToString()); + markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString()); if (Model.editor.config.style != null) { @@ -18,6 +18,6 @@ else { -
@Model.value
+
@Model?.value
} diff --git a/Novicell.Umbraco.OEmbed.Web/Views/_ViewImports.cshtml b/Novicell.Umbraco.OEmbed.Web/Views/_ViewImports.cshtml new file mode 100644 index 0000000..9e939f3 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/Views/_ViewImports.cshtml @@ -0,0 +1,9 @@ +@using Umbraco.Extensions +@using Novicell.OEmbed.Web +@using Umbraco.Cms.Web.Common.PublishedModels +@using Umbraco.Cms.Web.Common.Views +@using Umbraco.Cms.Core.Models.PublishedContent +@using Microsoft.AspNetCore.Html +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Smidge +@inject Smidge.SmidgeHelper SmidgeHelper diff --git a/Novicell.Umbraco.OEmbed.Web/appsettings.Development.json b/Novicell.Umbraco.OEmbed.Web/appsettings.Development.json new file mode 100644 index 0000000..91cd2da --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/appsettings.Development.json @@ -0,0 +1,34 @@ +{ + "$schema": "./appsettings-schema.json", + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + } + ] + } + } + ] + }, + "Umbraco": { + "CMS": { + "Content": { + "MacroErrors": "Throw" + }, + "Hosting": { + "Debug": true + }, + "RuntimeMinification": { + "UseInMemoryCache": true, + "CacheBuster": "Timestamp" + } + } + } +} diff --git a/Novicell.Umbraco.OEmbed.Web/appsettings.json b/Novicell.Umbraco.OEmbed.Web/appsettings.json new file mode 100644 index 0000000..6ef6be5 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/appsettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "./appsettings-schema.json", + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "System": "Warning" + } + } + }, + "Umbraco": { + "CMS": { + "Global": { + "Id": "24016af2-0688-443a-8567-adeb594a7f17", + "SanitizeTinyMce": true + }, + "Content": { + "ContentVersionCleanupPolicy": { + "EnableCleanup": true + } + } + } + }, + "ConnectionStrings": { + "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True", + "umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite" + } +} \ No newline at end of file diff --git a/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Scripts/OEmbed.Controller.js b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Scripts/OEmbed.Controller.js new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Scripts/OEmbed.Controller.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Styles/OEmbed.css b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Styles/OEmbed.css new file mode 100644 index 0000000..46800d1 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/Styles/OEmbed.css @@ -0,0 +1,2 @@ +body { +} diff --git a/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/ombed.propertyeditor.html b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/ombed.propertyeditor.html new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.Web/wwwroot/App_Plugins/ombed.propertyeditor.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Novicell.Umbraco.OEmbed.Web/wwwroot/favicon.ico b/Novicell.Umbraco.OEmbed.Web/wwwroot/favicon.ico new file mode 100644 index 0000000..c0749dd Binary files /dev/null and b/Novicell.Umbraco.OEmbed.Web/wwwroot/favicon.ico differ diff --git a/Novicell.Umbraco.OEmbed.sln b/Novicell.Umbraco.OEmbed.sln new file mode 100644 index 0000000..aa22c24 --- /dev/null +++ b/Novicell.Umbraco.OEmbed.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novicell.OEmbed.Core", "Novicell.Umbraco.OEmbed\Novicell.OEmbed.Core.csproj", "{1BBD0925-61E0-42C6-BA1D-2546968DDEF1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novicell.OEmbed.Web", "Novicell.OEmbed.Web\Novicell.OEmbed.Web.csproj", "{48B09BBB-7612-4D59-8ECC-81F42CABA8B3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1BBD0925-61E0-42C6-BA1D-2546968DDEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BBD0925-61E0-42C6-BA1D-2546968DDEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BBD0925-61E0-42C6-BA1D-2546968DDEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BBD0925-61E0-42C6-BA1D-2546968DDEF1}.Release|Any CPU.Build.0 = Release|Any CPU + {48B09BBB-7612-4D59-8ECC-81F42CABA8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48B09BBB-7612-4D59-8ECC-81F42CABA8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48B09BBB-7612-4D59-8ECC-81F42CABA8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48B09BBB-7612-4D59-8ECC-81F42CABA8B3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CBF91C9F-0C24-409A-92F1-031957B79EB1} + EndGlobalSection +EndGlobal diff --git a/Novicell.Umbraco.OEmbed/Constants.cs b/Novicell.Umbraco.OEmbed/Constants.cs new file mode 100644 index 0000000..b346c14 --- /dev/null +++ b/Novicell.Umbraco.OEmbed/Constants.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Novicell.OEmbed.Core +{ + /// + /// Defines constants. + /// + public static partial class Constants + { + /// + /// Defines constants for gernal packeage data. + /// + public static class Package + { + public const string Name = "Novicell.Umbraco.OEmbed"; + public const string Alias = "novicellUmbracoOEmbed"; + public const string Version = "2.0.0"; + public const string PluginFolder = $"/App_Plugins/{Alias}/"; + public const string PluginAreaName = "Novicell"; + } + } +} diff --git a/Novicell.Umbraco.OEmbed/Novicell.OEmbed.Core.csproj b/Novicell.Umbraco.OEmbed/Novicell.OEmbed.Core.csproj new file mode 100644 index 0000000..c8beabd --- /dev/null +++ b/Novicell.Umbraco.OEmbed/Novicell.OEmbed.Core.csproj @@ -0,0 +1,16 @@ + + + net6.0 + . + Novicell.Umbraco.OEmbed + Novicell.Umbraco.OEmbed + Novicell.Umbraco.OEmbed + ... + umbraco plugin package + + + + + + + diff --git a/assets/images/icon.png b/assets/images/icon.png deleted file mode 100644 index 163fc23..0000000 Binary files a/assets/images/icon.png and /dev/null differ diff --git a/assets/umbraco/data/umbraco.sdf b/assets/umbraco/data/umbraco.sdf deleted file mode 100644 index 960db02..0000000 Binary files a/assets/umbraco/data/umbraco.sdf and /dev/null differ diff --git a/src/Novicell.Umbraco.OEmbed.Tests/AutodiscoverEmbedProviderTests.cs b/src/Novicell.Umbraco.OEmbed.Tests/AutodiscoverEmbedProviderTests.cs deleted file mode 100644 index 668c0c1..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/AutodiscoverEmbedProviderTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Novicell.Umbraco.OEmbed.Services; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - [Trait("Category", "Providers")] - public class AutodiscoverEmbedProviderTests - { - [Fact] - public void CanAutodiscoverParameters() - { - var url = new Uri("http://example.com/oembed?a=1&b=2"); - - var provider = new OEmbedDiscoveryService.AutodiscoverEmbedProvider(url); - - Assert.NotNull(provider); - Assert.Equal("http://example.com/oembed", provider.ApiEndpoint); - - Assert.NotEmpty(provider.RequestParams); - Assert.Contains(provider.RequestParams, x => x.Key == "a"); - Assert.Contains(provider.RequestParams, x => x.Key == "b"); - - Assert.Equal("1", provider.RequestParams["a"]); - Assert.Equal("2", provider.RequestParams["b"]); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Tests/HttpClientFactory.cs b/src/Novicell.Umbraco.OEmbed.Tests/HttpClientFactory.cs deleted file mode 100644 index 52d0674..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/HttpClientFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Net.Http; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - public class HttpClientFactory : IHttpClientFactory - { - public HttpClient CreateClient(string name) => new(); - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Tests/Novicell.Umbraco.OEmbed.Tests.csproj b/src/Novicell.Umbraco.OEmbed.Tests/Novicell.Umbraco.OEmbed.Tests.csproj deleted file mode 100644 index d2ddb07..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/Novicell.Umbraco.OEmbed.Tests.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - net5.0 - - false - - - - True - - - - True - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - diff --git a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_DiscoverFromUrl_Tests.cs b/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_DiscoverFromUrl_Tests.cs deleted file mode 100644 index 281084a..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_DiscoverFromUrl_Tests.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Novicell.Umbraco.OEmbed.Services; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - [Trait("Category", "Integration")] - public class OEmbedDiscoveryService_DiscoverFromUrl_Tests - { - private readonly IHttpClientFactory _httpClientFactory = new HttpClientFactory(); - - [Fact] - public async void CanNotDiscoverInvalidUrl() - { - var url = new Uri("https://0.0.0.0/not-found"); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - - var provider = await discovery.DiscoverFromUrlAsync(url); - - Assert.False(provider.Success); - Assert.Null(provider.Result); - } - - [Fact] - public async Task CanDiscoverFlickrEndpoint() - { - var url = new Uri("https://www.flickr.com/photos/percipientstudios/18009929763"); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - - var provider = await discovery.DiscoverFromUrlAsync(url); - - Assert.True(provider.Success); - Assert.NotNull(provider.Result); - Assert.Equal("https://www.flickr.com/services/oembed", provider.Result.ApiEndpoint); - - Assert.StartsWith(provider.Result.RequestParams["url"], url.AbsoluteUri); - } - - [Fact] - public async Task CanDiscoverVimeoEndpoint() - { - var url = new Uri("https://vimeo.com/371827688"); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - - var provider = await discovery.DiscoverFromUrlAsync(url); - - Assert.True(provider.Success); - Assert.NotNull(provider.Result); - - Assert.Equal("https://vimeo.com/api/oembed.json", provider.Result.ApiEndpoint); - - // use StartsWith, as Vimeo appends some data to the url in the url-param - Assert.StartsWith(url.AbsoluteUri, provider.Result.RequestParams["url"]); - } - - [Fact] - public async Task CanDiscoverYoutubeEndpoint() - { - var url = new Uri("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - - var provider = await discovery.DiscoverFromUrlAsync(url); - - Assert.True(provider.Success); - Assert.NotNull(provider.Result); - - Assert.Equal("https://www.youtube.com/oembed", provider.Result.ApiEndpoint); - - Assert.Equal("json", provider.Result.RequestParams["format"]); - Assert.Equal(url.AbsoluteUri, provider.Result.RequestParams["url"]); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInHtml_Tests.cs b/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInHtml_Tests.cs deleted file mode 100644 index e77dbcd..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInHtml_Tests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using Novicell.Umbraco.OEmbed.Services; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - public class OEmbedDiscoveryService_FindOEmbedEndpointInHtml_Tests - { - [Fact] - public void CanOEmbedEndpointFromHtml() - { - const string html = ""; - - var endpoint = OEmbedDiscoveryService.FindOEmbedEndpointInHtml(html); - - Assert.NotNull(endpoint); - Assert.Equal(new Uri("https://example.com/oembed/"), endpoint); - } - - [Fact] - public void CanNotOEmbedEndpointFromHtml() - { - const string html = ""; - - var endpoint = OEmbedDiscoveryService.FindOEmbedEndpointInHtml(html); - - Assert.Null(endpoint); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInLinkHeader_Tests.cs b/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInLinkHeader_Tests.cs deleted file mode 100644 index 037a583..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedDiscoveryService_FindOEmbedEndpointInLinkHeader_Tests.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Novicell.Umbraco.OEmbed.Services; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - public class OEmbedDiscoveryService_FindOEmbedEndpointInLinkHeader_Tests - { - [Fact] - public void CanFindAlternateOEmbedUrlFromLinkHeader() - { - const string linkHeaderValue = "; rel=alternate; type=application/json+oembed"; - - var endpoint = OEmbedDiscoveryService.FindOEmbedEndpointInLinkHeader(new[] - { - linkHeaderValue - }); - - Assert.NotNull(endpoint); - Assert.Equal(new Uri("https://example.com/oembed/"), endpoint); - } - - [Fact] - public void CanNotFindAlternateOEmbedUrlFromLinkHeaderWithoutOEmbedType() - { - const string linkHeaderValue = "; rel=alternate; type=not-text/not-json"; - - var endpoint = OEmbedDiscoveryService.FindOEmbedEndpointInLinkHeader(new[] - { - linkHeaderValue - }); - - Assert.Null(endpoint); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceIntegrationTests.cs b/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceIntegrationTests.cs deleted file mode 100644 index aece828..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceIntegrationTests.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; -using Novicell.Umbraco.OEmbed.Configuration.Models; -using Novicell.Umbraco.OEmbed.Services; -using Umbraco.Cms.Core.Media; -using Umbraco.Cms.Core.Media.EmbedProviders; -using Umbraco.Cms.Infrastructure.Serialization; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - [Trait("Category", "Integration")] - public class OEmbedServiceIntegrationTests - { - private readonly EmbedProvidersCollection YouTubeOnlyEmbedProvidersCollection; - private readonly EmbedProvidersCollection SoundCloudOnlyEmbedProvidersCollection; - private readonly EmbedProvidersCollection EmptyEmbedProvidersCollection; - private readonly IHttpClientFactory _httpClientFactory = new HttpClientFactory(); - - public OEmbedServiceIntegrationTests() - { - var jsonSerializer = new JsonNetSerializer(); - - YouTubeOnlyEmbedProvidersCollection = new EmbedProvidersCollection(() => new[] - { - new YouTube(jsonSerializer), - }); - - SoundCloudOnlyEmbedProvidersCollection = new EmbedProvidersCollection(() => new[] - { - new Soundcloud(jsonSerializer), - }); - - EmptyEmbedProvidersCollection = new EmbedProvidersCollection(Array.Empty); - } - - [Fact] - public async Task EmbedSoundcloudRichFromKnownProvider() - { - var oembed = new OEmbedService(SoundCloudOnlyEmbedProvidersCollection, _httpClientFactory, null, null); - var embed = await oembed.GetOEmbedAsync(new Uri("https://soundcloud.com/dj_zanderz/mellemfingamuzik-jungle-zanderz-remix-demo"), 0, 0); - Assert.True(embed.Success); - Assert.NotNull(embed.Result); - Assert.StartsWith("MellemFingaMuzik", embed.Result.Title); - } - - [Fact] - public async Task EmbedYouTubeVideoFromKnownProvider() - { - var oembed = new OEmbedService(YouTubeOnlyEmbedProvidersCollection, _httpClientFactory, null,null); - var embed = await oembed.GetOEmbedAsync(new Uri("https://www.youtube.com/watch?v=dQw4w9WgXcQ"), 0, 0); - Assert.True(embed.Success); - Assert.NotNull(embed.Result); - Assert.StartsWith("Rick Astley", embed.Result.Title); - } - - [Fact] - public async Task EmbedYouTubeVideoFromAutodiscover() - { - var settings = new OptionsWrapper(new OEmbedSettings - { - Autodiscover = true, - }); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - var oembed = new OEmbedService(EmptyEmbedProvidersCollection, _httpClientFactory, discovery, settings); - var embed = await oembed.GetOEmbedAsync(new Uri("https://www.youtube.com/watch?v=dQw4w9WgXcQ"), 0, 0); - Assert.True(embed.Success); - Assert.NotNull(embed.Result); - Assert.StartsWith("Rick Astley", embed.Result.Title); - } - - [Fact] - public async Task EmbedVimeoVideoFromAutodiscover() - { - var settings = new OptionsWrapper(new OEmbedSettings - { - Autodiscover = true, - }); - - var discovery = new OEmbedDiscoveryService(_httpClientFactory); - var oembed = new OEmbedService(EmptyEmbedProvidersCollection, _httpClientFactory, discovery, settings); - var embed = await oembed.GetOEmbedAsync(new Uri("https://vimeo.com/251769074"), 0, 0); - Assert.True(embed.Success); - Assert.NotNull(embed.Result); - Assert.StartsWith("Welcome to Umbraco HQ", embed.Result.Title); - - if (embed.Result.TryGetValue("upload_date", out var uploadDateValue) && - DateTime.TryParse(uploadDateValue, out var uploadDate)) - { - /*Assert.NotNull(uploadDate);*/ - Assert.NotEqual(default, uploadDate); - } - } - - [Fact] - public async Task FailWhenNoProvidersEnabled() - { - var settings = new OptionsWrapper(new OEmbedSettings - { - Autodiscover = false, - }); - - var oembed = new OEmbedService(EmptyEmbedProvidersCollection, _httpClientFactory, null, settings); - - var embed = await oembed.GetOEmbedAsync(new Uri("https://www.youtube.com/watch?v=0BPL5tT9_2Y"), 0, 0); - Assert.False(embed.Success); - Assert.IsType(embed.Exception); - } - - [Fact] - public async Task FailWhenNoProvidersGiven() - { - var oembed = new OEmbedService(null, _httpClientFactory, null, null); - - var embed = await oembed.GetOEmbedAsync(new Uri("https://www.youtube.com/watch?v=0BPL5tT9_2Y"), 0, 0); - Assert.False(embed.Success); - Assert.IsType(embed.Exception); - } - } -} diff --git a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceUnitTests.cs b/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceUnitTests.cs deleted file mode 100644 index 9abfccd..0000000 --- a/src/Novicell.Umbraco.OEmbed.Tests/OEmbedServiceUnitTests.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Threading.Tasks; -using Novicell.Umbraco.OEmbed.Services; -using Xunit; - -namespace Novicell.Umbraco.OEmbed.Tests -{ - [Trait("Category", "Services")] - public class OEmbedServiceUnitTests - { - [Fact] - public async Task EmbedFromVimeoJson() - { - // example from https://vimeo.com/api/oembed.json?url=https%3A%2F%2Fvimeo.com%2F251769074 - - const string json = "{\"type\":\"video\",\"version\":\"1.0\",\"provider_name\":\"Vimeo\",\"provider_url\":\"https:\\/\\/vimeo.com\\/\",\"title\":\"Welcome to Umbraco HQ\",\"author_name\":\"Umbraco\",\"author_url\":\"https:\\/\\/vimeo.com\\/umbraco\",\"is_plus\":\"0\",\"account_type\":\"pro\",\"html\":\"", - "url": null, - "height": 113, - "width": 200, - "cache_age": null - } -}]]> - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Content/site1.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Content/site1.config deleted file mode 100644 index f7e2d17..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Content/site1.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - /site1 - false - site - 2021-07-11T22:34:49 - - 0 - - - - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/home.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/home.config deleted file mode 100644 index 8e7d012..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/home.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - Home - icon-home color-black - folder.png - - False - False - Nothing - false - site - - pageContent - site - - Home - - - - - - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/pagecontent.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/pagecontent.config deleted file mode 100644 index cd1bf64..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/pagecontent.config +++ /dev/null @@ -1,44 +0,0 @@ - - - - Page Content - icon-defrag color-purple - folder.png - - False - False - Nothing - false - Compositions - - - - - - - - 2fcebd66-a228-461b-897b-6c184feba9c3 - Video - pageVideo - 238d60ea-7686-4172-98d4-b617235e132b - Novicell.OEmbed - false - - - 0 - Content - Nothing - - - false - - - - - Content - content - Group - 0 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/site.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/site.config deleted file mode 100644 index cb4ff12..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/ContentTypes/site.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - Site - icon-umb-translation color-green - folder.png - - True - False - Nothing - false - - Site - - - - - - home - - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ApprovedColor.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ApprovedColor.config deleted file mode 100644 index ca11632..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ApprovedColor.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Approved Color - Umbraco.ColorPicker - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/CheckboxList.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/CheckboxList.config deleted file mode 100644 index 354bf20..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/CheckboxList.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Checkbox list - Umbraco.CheckBoxList - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ContentPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ContentPicker.config deleted file mode 100644 index 233af08..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ContentPicker.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - Content Picker - Umbraco.ContentPicker - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePicker.config deleted file mode 100644 index 3f9c5c2..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePicker.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Date Picker - Umbraco.DateTime - Date - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePickerWithTime.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePickerWithTime.config deleted file mode 100644 index 2c289d1..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DatePickerWithTime.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Date Picker with time - Umbraco.DateTime - Date - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Dropdown.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Dropdown.config deleted file mode 100644 index 4be476b..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Dropdown.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Dropdown - Umbraco.DropDown.Flexible - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DropdownMultiple.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DropdownMultiple.config deleted file mode 100644 index 1407630..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/DropdownMultiple.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Dropdown multiple - Umbraco.DropDown.Flexible - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageCropper.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageCropper.config deleted file mode 100644 index ccd9162..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageCropper.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Image Cropper - Umbraco.ImageCropper - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageMediaPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageMediaPicker.config deleted file mode 100644 index cc84a6a..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ImageMediaPicker.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - Image Media Picker - Umbraco.MediaPicker3 - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelBigint.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelBigint.config deleted file mode 100644 index 909f50d..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelBigint.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (bigint) - Umbraco.Label - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDatetime.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDatetime.config deleted file mode 100644 index 7163ac9..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDatetime.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (datetime) - Umbraco.Label - Date - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDecimal.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDecimal.config deleted file mode 100644 index 045b4f5..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelDecimal.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (decimal) - Umbraco.Label - Decimal - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelInteger.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelInteger.config deleted file mode 100644 index 19ea1dc..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelInteger.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (integer) - Umbraco.Label - Integer - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelString.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelString.config deleted file mode 100644 index af5067c..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelString.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (string) - Umbraco.Label - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelTime.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelTime.config deleted file mode 100644 index df2170a..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/LabelTime.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Label (time) - Umbraco.Label - Date - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewContent.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewContent.config deleted file mode 100644 index c2ad8bd..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewContent.config +++ /dev/null @@ -1,54 +0,0 @@ - - - - List View - Content - Umbraco.ListView - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMedia.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMedia.config deleted file mode 100644 index 59fdbcc..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMedia.config +++ /dev/null @@ -1,54 +0,0 @@ - - - - List View - Media - Umbraco.ListView - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMembers.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMembers.config deleted file mode 100644 index 5a08349..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/ListViewMembers.config +++ /dev/null @@ -1,60 +0,0 @@ - - - - List View - Members - Umbraco.ListView - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPicker.config deleted file mode 100644 index c4d9283..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPicker.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - Media Picker - Umbraco.MediaPicker3 - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPickerLegacy.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPickerLegacy.config deleted file mode 100644 index 08c6991..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MediaPickerLegacy.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - Media Picker (legacy) - Umbraco.MediaPicker - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MemberPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MemberPicker.config deleted file mode 100644 index 260c185..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MemberPicker.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - Member Picker - Umbraco.MemberPicker - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultiURLPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultiURLPicker.config deleted file mode 100644 index f8f7413..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultiURLPicker.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - Multi URL Picker - Umbraco.MultiUrlPicker - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleImageMediaPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleImageMediaPicker.config deleted file mode 100644 index f0a8d0b..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleImageMediaPicker.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - Multiple Image Media Picker - Umbraco.MediaPicker3 - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPicker.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPicker.config deleted file mode 100644 index 6bae71f..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPicker.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - Multiple Media Picker - Umbraco.MediaPicker3 - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPickerLegacy.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPickerLegacy.config deleted file mode 100644 index 9d3d9ee..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/MultipleMediaPickerLegacy.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - Multiple Media Picker (legacy) - Umbraco.MediaPicker - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Numeric.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Numeric.config deleted file mode 100644 index cd6d29b..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Numeric.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - Numeric - Umbraco.Integer - Integer - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/OEmbedVideo.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/OEmbedVideo.config deleted file mode 100644 index 7fc2fc4..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/OEmbedVideo.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - OEmbed Video - Novicell.OEmbed - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Radiobox.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Radiobox.config deleted file mode 100644 index a166cb7..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Radiobox.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Radiobox - Umbraco.RadioButtonList - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/RichtextEditor.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/RichtextEditor.config deleted file mode 100644 index b8d9e11..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/RichtextEditor.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - Richtext editor - Umbraco.TinyMCE - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Tags.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Tags.config deleted file mode 100644 index fc1025e..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Tags.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - Tags - Umbraco.Tags - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textarea.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textarea.config deleted file mode 100644 index a495b9e..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textarea.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - Textarea - Umbraco.TextArea - Ntext - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textstring.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textstring.config deleted file mode 100644 index dc90bf0..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Textstring.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Textstring - Umbraco.TextBox - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Truefalse.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Truefalse.config deleted file mode 100644 index 7b65efb..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/Truefalse.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - True/false - Umbraco.TrueFalse - Integer - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadArticle.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadArticle.config deleted file mode 100644 index 1d76dc8..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadArticle.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - Upload Article - Umbraco.UploadField - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadAudio.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadAudio.config deleted file mode 100644 index 66b66ca..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadAudio.config +++ /dev/null @@ -1,28 +0,0 @@ - - - - Upload Audio - Umbraco.UploadField - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadFile.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadFile.config deleted file mode 100644 index bdd8d01..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadFile.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - Upload File - Umbraco.UploadField - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVectorGraphics.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVectorGraphics.config deleted file mode 100644 index 6088f33..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVectorGraphics.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - Upload Vector Graphics - Umbraco.UploadField - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVideo.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVideo.config deleted file mode 100644 index fb8f018..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/DataTypes/UploadVideo.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - Upload Video - Umbraco.UploadField - Nvarchar - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Languages/en-us.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Languages/en-us.config deleted file mode 100644 index c2fe77b..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Languages/en-us.config +++ /dev/null @@ -1,6 +0,0 @@ - - - en-US - false - true - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Media/lion.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Media/lion.config deleted file mode 100644 index 84dd29b..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Media/lion.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - /Lion - false - Image - 2021-07-21T17:36:42 - - 0 - - - - - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/file.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/file.config deleted file mode 100644 index 5570b83..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/file.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - File - icon-document - icon-document - - True - False - Nothing - false - - - - - 0000001a-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 2 - File - - - false - - - 00000019-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 1 - File - - - false - - - 00000018-0000-0000-0000-000000000000 - File - umbracoFile - 84c6b441-31df-4ffe-b67e-67d5bc3ae65a - Umbraco.UploadField - true - - - 0 - File - - - false - - - - - - File - file - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/folder.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/folder.config deleted file mode 100644 index 8565321..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/folder.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - Folder - icon-folder - icon-folder - - True - False - Nothing - false - - - - - Folder - Image - File - umbracoMediaVideo - umbracoMediaAudio - umbracoMediaArticle - umbracoMediaVectorGraphics - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/image.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/image.config deleted file mode 100644 index b3c99a8..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/image.config +++ /dev/null @@ -1,100 +0,0 @@ - - - - Image - icon-picture - icon-picture - - True - False - Nothing - false - - - - - 00000009-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 3 - Image - - - false - - - 0000000a-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 4 - Image - - - false - - - 00000006-0000-0000-0000-000000000000 - Image - umbracoFile - 1df9f033-e6d4-451f-b8d2-e0cbc50a836f - Umbraco.ImageCropper - true - - - 0 - Image - - - false - - - 00000008-0000-0000-0000-000000000000 - Height - umbracoHeight - 8e7f995c-bd81-4627-9932-c40e568ec788 - Umbraco.Label - false - - - 2 - Image - - - false - - - 00000007-0000-0000-0000-000000000000 - Width - umbracoWidth - 8e7f995c-bd81-4627-9932-c40e568ec788 - Umbraco.Label - false - - - 1 - Image - - - false - - - - - - Image - image - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaarticle.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaarticle.config deleted file mode 100644 index 327d496..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaarticle.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - Article - icon-article - icon-article - - True - False - Nothing - false - - - - - 00000030-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 2 - Article - - - false - - - 0000002f-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 1 - Article - - - false - - - 0000002e-0000-0000-0000-000000000000 - Article - umbracoFile - bc1e266c-dac4-4164-bf08-8a1ec6a7143d - Umbraco.UploadField - true - - - 0 - Article - - - false - - - - - - Article - article - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaaudio.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaaudio.config deleted file mode 100644 index 186d2d5..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediaaudio.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - Audio - icon-sound-waves - icon-sound-waves - - True - False - Nothing - false - - - - - 0000002d-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 2 - Audio - - - false - - - 0000002c-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 1 - Audio - - - false - - - 0000002b-0000-0000-0000-000000000000 - Audio - umbracoFile - 8f430dd6-4e96-447e-9dc0-cb552c8cd1f3 - Umbraco.UploadField - true - - - 0 - Audio - - - false - - - - - - Audio - audio - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavectorgraphics.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavectorgraphics.config deleted file mode 100644 index 89c8192..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavectorgraphics.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - Vector Graphics (SVG) - icon-picture - icon-picture - - True - False - Nothing - false - - - - - 00000033-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 2 - Vector Graphics - - - false - - - 00000032-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 1 - Vector Graphics - - - false - - - 00000031-0000-0000-0000-000000000000 - Vector Graphics - umbracoFile - 215cb418-2153-4429-9aef-8c0f0041191b - Umbraco.UploadField - true - - - 0 - Vector Graphics - - - false - - - - - - Vector Graphics - vectorGraphics - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavideo.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavideo.config deleted file mode 100644 index b3bfd9d..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MediaTypes/umbracomediavideo.config +++ /dev/null @@ -1,70 +0,0 @@ - - - - Video - icon-video - icon-video - - True - False - Nothing - false - - - - - 0000002a-0000-0000-0000-000000000000 - Size - umbracoBytes - 930861bf-e262-4ead-a704-f99453565708 - Umbraco.Label - false - - - 2 - Video - - - false - - - 00000029-0000-0000-0000-000000000000 - Type - umbracoExtension - f0bc4bfb-b499-40d6-ba86-058885a5178c - Umbraco.Label - false - - - 1 - Video - - - false - - - 00000028-0000-0000-0000-000000000000 - Video - umbracoFile - 70575fe7-9812-4396-bbe1-c81a76db71b5 - Umbraco.UploadField - true - - - 0 - Video - - - false - - - - - - Video - video - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MemberTypes/member.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MemberTypes/member.config deleted file mode 100644 index 9b1f242..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/MemberTypes/member.config +++ /dev/null @@ -1,151 +0,0 @@ - - - - Member - icon-user - icon-user - - False - False - Nothing - false - - - - - e79dccfb-0000-0000-0000-000000000000 - Is Approved - umbracoMemberApproved - 92897bc6-a5f3-4ffe-ae27-f2e7e33dda49 - Umbraco.TrueFalse - false - - - 2 - Membership - false - false - true - - - false - - - 2a280588-0000-0000-0000-000000000000 - Comments - umbracoMemberComments - c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3 - Umbraco.TextArea - false - - - 0 - Membership - false - false - true - - - false - - - 0f2ea539-0000-0000-0000-000000000000 - Failed Password Attempts - umbracoMemberFailedPasswordAttempts - 8e7f995c-bd81-4627-9932-c40e568ec788 - Umbraco.Label - false - - - 1 - Membership - false - false - true - - - false - - - 3a7bc3c6-0000-0000-0000-000000000000 - Last Lockout Date - umbracoMemberLastLockoutDate - 0e9794eb-f9b5-4f20-a788-93acd233a7e4 - Umbraco.Label - false - - - 4 - Membership - false - false - true - - - false - - - b5e309ba-0000-0000-0000-000000000000 - Last Login Date - umbracoMemberLastLogin - 0e9794eb-f9b5-4f20-a788-93acd233a7e4 - Umbraco.Label - false - - - 5 - Membership - false - false - true - - - false - - - ded56d3f-0000-0000-0000-000000000000 - Last Password Change Date - umbracoMemberLastPasswordChangeDate - 0e9794eb-f9b5-4f20-a788-93acd233a7e4 - Umbraco.Label - false - - - 6 - Membership - false - false - true - - - false - - - c36093d2-0000-0000-0000-000000000000 - Is Locked Out - umbracoMemberLockedOut - 92897bc6-a5f3-4ffe-ae27-f2e7e33dda49 - Umbraco.TrueFalse - false - - - 3 - Membership - false - false - true - - - false - - - - - - Membership - membership - Group - 1 - - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/home.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/home.config deleted file mode 100644 index c83dc33..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/home.config +++ /dev/null @@ -1,5 +0,0 @@ - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/site.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/site.config deleted file mode 100644 index 59b23ed..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/Templates/site.config +++ /dev/null @@ -1,5 +0,0 @@ - - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/usync.config b/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/usync.config deleted file mode 100644 index 072721c..0000000 --- a/src/Novicell.Umbraco.OEmbed.Website/uSync/v9/usync.config +++ /dev/null @@ -1,4 +0,0 @@ - - - 2021-09-09T19:20:19 - \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed.sln b/src/Novicell.Umbraco.OEmbed.sln deleted file mode 100644 index ad0b4ea..0000000 --- a/src/Novicell.Umbraco.OEmbed.sln +++ /dev/null @@ -1,70 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.6.30114.105 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Novicell.Umbraco.OEmbed.Website", "Novicell.Umbraco.OEmbed.Website\Novicell.Umbraco.OEmbed.Website.csproj", "{EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Novicell.Umbraco.OEmbed", "Novicell.Umbraco.OEmbed\Novicell.Umbraco.OEmbed.csproj", "{68E10957-CF84-4D57-9C67-ADE2039D3503}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{BF432BD5-D2A8-4CAB-A805-589B64CF741C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Novicell.Umbraco.OEmbed.Tests", "Novicell.Umbraco.OEmbed.Tests\Novicell.Umbraco.OEmbed.Tests.csproj", "{079ED247-77E3-4E31-B39B-ED6511E3B91B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|x64.ActiveCfg = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|x64.Build.0 = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|x86.ActiveCfg = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Debug|x86.Build.0 = Debug|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|Any CPU.Build.0 = Release|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|x64.ActiveCfg = Release|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|x64.Build.0 = Release|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|x86.ActiveCfg = Release|Any CPU - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2}.Release|x86.Build.0 = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|x64.ActiveCfg = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|x64.Build.0 = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|x86.ActiveCfg = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Debug|x86.Build.0 = Debug|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|Any CPU.Build.0 = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|x64.ActiveCfg = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|x64.Build.0 = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|x86.ActiveCfg = Release|Any CPU - {68E10957-CF84-4D57-9C67-ADE2039D3503}.Release|x86.Build.0 = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|x64.ActiveCfg = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|x64.Build.0 = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|x86.ActiveCfg = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Debug|x86.Build.0 = Debug|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|Any CPU.Build.0 = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|x64.ActiveCfg = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|x64.Build.0 = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|x86.ActiveCfg = Release|Any CPU - {079ED247-77E3-4E31-B39B-ED6511E3B91B}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {EC79CF03-B2DB-4664-AEBE-C6527A9AE3F2} = {BF432BD5-D2A8-4CAB-A805-589B64CF741C} - {079ED247-77E3-4E31-B39B-ED6511E3B91B} = {BF432BD5-D2A8-4CAB-A805-589B64CF741C} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2F18F0F5-C3E9-431B-8C34-99D240197BFD} - EndGlobalSection -EndGlobal diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/da-dk.xml b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/da-dk.xml deleted file mode 100644 index 4794030..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/da-dk.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Novicell - https://novicell.com - - - Url er ikke udfyldt. - Ugyldig url angivet. - Ingen udgiver konfigureret for denne url. - Indlejring ikke fundet. - Typen af indlejring er ikke gyldig (skal være %type%). - - diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/en-us.xml b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/en-us.xml deleted file mode 100644 index 4199260..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/Lang/en-us.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Novicell - https://novicell.com - - - No url provided. - Invalid url. - No provider configured for the given url, please review the url. - Embed not found, please review url. - Embed type is not valid (must be %type%). - - diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.css b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.css deleted file mode 100644 index ea88be7..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.css +++ /dev/null @@ -1,47 +0,0 @@ -.novicell-oembed-property-editor -.novicell-oembed-property-editor__preview -.umb-node-preview__actions { - align-items: start; -} - -.novicell-oembed-property-editor -.novicell-oembed-property-editor__preview -.umb-node-preview__content { - overflow: unset; -} - -.novicell-oembed-preview .novicell-oembed-preview__frame, -.novicell-oembed-preview .novicell-oembed-preview__photo { - max-width: 100%; -} - -.novicell-oembed-preview__container { - max-width: 100%; - width: 100%; -} - -.novicell-oembed-preview__container--fixed-ratio { - position: relative; - padding-top: 0; -} - -.novicell-oembed-preview .novicell-oembed-preview__frame { - width: 100%; - height: 0; -} - -.novicell-oembed-preview -.novicell-oembed-preview__container--fixed-ratio -.novicell-oembed-preview__frame { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - height: 100%; -} - -.novicell-oembed-preview .__info { - position: unset; - opacity: unset; -} diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.editor.html b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.editor.html deleted file mode 100644 index d713d68..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.editor.html +++ /dev/null @@ -1,42 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.js b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.js deleted file mode 100644 index 1d7fc8e..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.js +++ /dev/null @@ -1,287 +0,0 @@ -(function (window) { - "use strict"; - - var angular = window.angular; - var Utilities = window.Utilities; - var _ = window._; - - var mapFromUmbracoSettings = function (settingsKey) { - var getSetting = function (key, umbracoSettings) { - return (umbracoSettings || window.Umbraco.Sys.ServerVariables.umbracoSettings)[ - key - ]; - }; - return function (p, umbracoSettings) { - return getSetting(settingsKey, umbracoSettings) + p; - }; - }; - - var mapFromAppPluginsPath = mapFromUmbracoSettings("appPluginsPath"); - var mapFromUmbracoPath = mapFromUmbracoSettings("umbracoPath"); - - var previewController = function ($sce) { - var vm = this; - - vm.aspectRatio = null; - - var createSrcDoc = function (html, aspectRatio) { - if (Utilities.isUndefined(html) || !Utilities.isString(html)) - { - return null; - } - - var element = window.document.createElement("div"); - - element.insertAdjacentHTML("afterbegin", html); - - if (aspectRatio > 0) - { - element.style.width = "100%"; - element.style.height = "100%"; - } - - var srcdoc = [ - "", - aspectRatio > 0 ? - "" : - "", - "", - element.outerHTML, - "" - ]; - - return $sce.trustAsHtml(srcdoc.join("")); - }; - - vm.observeFrame = function (frame) { - function createMutationObserver(document, callback) { - var target = document.querySelector("body"), - config = { - attributes: true, - attributeOldValue: false, - characterData: true, - characterDataOldValue: false, - childList: true, - subtree: true - }, - observer = new MutationObserver(callback); - - observer.observe(target, config); - } - - var updateFrameSize = function (width, height) { - //frame.width = width; - frame.style.height = height + "px"; - }; - - var contentWindow = frame.contentWindow; - - createMutationObserver( - contentWindow.document, - _.debounce( - function (/*mutations*/) { - var e = contentWindow.document.documentElement; - updateFrameSize(e.offsetWidth, e.offsetHeight); - }, - 1 - ) - ); - }; - - var round = function (n, d) { - var m = Math.pow(10, d); - return Math.round(n * m) / m; - }; - - vm.$onChanges = function (/*changes*/) { - // we only get updates on the model (oembed obj) - - if (vm.model) { - vm.aspectRatio = - isNaN(vm.model.width) || isNaN(vm.model.height) - ? null - : round(vm.model.height / vm.model.width, 4); - - vm.srcdoc = createSrcDoc(vm.model.html, vm.aspectRatio); - } else { - vm.srcdoc = null; - vm.aspectRatio = null; - } - }; - }; - - var previewComponent = { - transclude: true, - bindings: { - model: "<" - }, - bindToController: true, - controller: previewController, - controllerAs: "vm", - templateUrl: function () { - return mapFromAppPluginsPath("/Novicell.OEmbed/oembed.preview.html"); - } - }; - - // - angular - .module("umbraco.directives") - .component("novicellOembedPreview", previewComponent); - - var propertyEditorController = function ( - $scope, - editorService, - angularHelper - ) { - var vm = this; - - vm.add = function () { - openOEmbedEditor(null); - }; - - vm.remove = function () { - $scope.model.value = null; - setDirty(); - }; - - vm.edit = function () { - openOEmbedEditor(_.clone($scope.model.value)); - }; - - function setDirty() { - angularHelper.getCurrentForm($scope).$setDirty(); - } - - function openOEmbedEditor(value) { - var editor = { - view: mapFromAppPluginsPath("/Novicell.OEmbed/oembed.editor.html"), - size: "small", - value: value, - config: $scope.model.config, - submit: function (model) { - $scope.model.value = model.value; - editorService.close(); - setDirty(); - }, - close: function () { - editorService.close(); - } - }; - - editorService.open(editor); - } - }; - - angular - .module("umbraco") - .controller( - "Novicell.OEmbed.PropertyEditorController", - propertyEditorController - ); - - var editorController = function ( - $scope, - formHelper, - localizationService, - novicellOEmbedResource - ) { - var vm = this; - - // public - vm.preview = null; - - vm.submit = function () { - if ($scope.model && $scope.model.submit) { - $scope.model.submit($scope.model); - } - }; - - vm.close = function () { - if ($scope.model && $scope.model.close) { - $scope.model.close(); - } - }; - - vm.update = function () { - var args = { scope: $scope, skipValidation: true }; - if (!formHelper.submitForm(args)) { - return; - } - - var url = $scope.model.value.url; - - if (Utilities.isString(url) && url !== "") { - novicellOEmbedResource.getOEmbed(url, $scope.model.config.type) - .then(function (data/*, status, headers, config*/) { - $scope.model.value.oembed = data; - }, function (data/*, status, headers, config*/) { - formHelper.handleError(data); - $scope.model.value.oembed = null; - }); - } else { - $scope.model.value.oembed = null; - } - }; - - vm.validateMandatory = function () { - - var validate = function (model) { - - if (!model.validation.mandatory) - { - return true; - } - - var value = model.value; - - return Utilities.isObject(value) && - Utilities.isString(value.url) && - Utilities.isObject(value.oembed); - }; - - return { - isValid: validate($scope.model), - errorMsg: "Value cannot be empty", - errorKey: "required" - }; - }; - - vm.$onInit = function () { - if (!$scope.model.title) { - localizationService.localize("general_embed").then(function (value) { - $scope.model.title = value; - }); - } - }; - }; - - angular - .module("umbraco") - .controller("Novicell.OEmbed.EditorController", editorController); - - angular - .module('umbraco.resources') - .factory('novicellOEmbedResource', - function ($http, umbRequestHelper) { - - var endpoint = mapFromUmbracoPath("/backoffice/novicell/oembed/"); - - // the factory object returned - return { - // this calls the ApiController we setup earlier - getOEmbed: function (url, type) { - - var requestConfig = { - cache: true, - umbIgnoreErrors: true, - params: { 'url': url, 'type': type } - }; - - return umbRequestHelper.resourcePromise( - $http.get(endpoint + "Get", requestConfig), - "Failed to retrieve OEmbed"); - } - }; - } - ); -})(window); diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.preview.html b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.preview.html deleted file mode 100644 index 59be3e2..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.preview.html +++ /dev/null @@ -1,35 +0,0 @@ -
-
-
-
-
- -
-
-
- -
-
- -
-
-
-
- - by - - - - () - -
-
-
-
-
diff --git a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.propertyeditor.html b/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.propertyeditor.html deleted file mode 100644 index 76f1f63..0000000 --- a/src/Novicell.Umbraco.OEmbed/App_Plugins/Novicell.OEmbed/oembed.propertyeditor.html +++ /dev/null @@ -1,25 +0,0 @@ -
-
-
-
- -
-
- - -
-
-
- - -
\ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Composing/OEmbedComposer.cs b/src/Novicell.Umbraco.OEmbed/Composing/OEmbedComposer.cs deleted file mode 100644 index 2e4a098..0000000 --- a/src/Novicell.Umbraco.OEmbed/Composing/OEmbedComposer.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Linq; -using Novicell.Umbraco.OEmbed.Services; -using Umbraco.Cms.Core.Composing; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Extensions; - -namespace Novicell.Umbraco.OEmbed.Composing -{ - public class OEmbedComposer : IComposer - { - public void Compose(IUmbracoBuilder builder) - { - // if the IOEmbedService Service is registered then we assume this has been added before so we don't do it again. - // - borrowed from Kevin Jump - thx ;) - var registration = builder.Services - .FirstOrDefault(x => x.ServiceType.Implements()); - if (registration != null) - { - return; - } - - builder.AddNovicellOEmbed(); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Configuration/Models/OEmbedSettings.cs b/src/Novicell.Umbraco.OEmbed/Configuration/Models/OEmbedSettings.cs deleted file mode 100644 index d13845d..0000000 --- a/src/Novicell.Umbraco.OEmbed/Configuration/Models/OEmbedSettings.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Novicell.Umbraco.OEmbed.Configuration.Models -{ - public class OEmbedSettings - { - internal const string SectionKey = nameof(Novicell) + ":" + nameof(OEmbed); - - public bool Autodiscover { get; init; } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Controllers/OEmbedController.cs b/src/Novicell.Umbraco.OEmbed/Controllers/OEmbedController.cs deleted file mode 100644 index 637ee26..0000000 --- a/src/Novicell.Umbraco.OEmbed/Controllers/OEmbedController.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; -using System.ComponentModel; -using System.Threading; -using Novicell.Umbraco.OEmbed.PropertyEditors; -using Umbraco.Cms.Web.BackOffice.Controllers; -using Umbraco.Cms.Web.Common.Attributes; -using Umbraco.Cms.Web.Common.Authorization; -using Umbraco.Cms.Core.Services; -using Umbraco.Extensions; -using System.Collections.Generic; -using System.Threading.Tasks; -using Novicell.Umbraco.OEmbed.Services; - -namespace Novicell.Umbraco.OEmbed.Controllers -{ - /// - /// A controller used for the embed dialog - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [PluginController(OEmbedPropertyEditor.PluginAreaName), IsBackOffice] - [Authorize(Policy = AuthorizationPolicies.BackOfficeAccess)] - public class OEmbedController : UmbracoAuthorizedJsonController - { - private readonly ILocalizedTextService _localizedTextService; - private readonly IOEmbedService _oembedService; - - public OEmbedController( - ILocalizedTextService localizedTextService, - IOEmbedService oembedService) - { - _localizedTextService = localizedTextService; - _oembedService = oembedService; - } - - public async Task Get(string url, int maxwidth = 0, int maxheight = 0, string type = null) - { - Uri _url = null; - - if (string.IsNullOrWhiteSpace(url)) - { - var errorMessage = _localizedTextService.Localize("novicellOEmbed", "url_missing"); - ModelState.AddModelError(nameof(url), errorMessage); - } - else if (!Uri.TryCreate(url, UriKind.Absolute, out _url)) - { - var errorMessage = _localizedTextService.Localize("novicellOEmbed", "url_invalid"); - ModelState.AddModelError(nameof(url), errorMessage); - } - - if (maxwidth < 0) - { - ModelState.AddModelError(nameof(maxwidth), "Must be higher than 0"); - } - - if (maxheight < 0) - { - ModelState.AddModelError(nameof(maxheight), "Must be higher than 0"); - } - - if (!ModelState.IsValid) - { - return ValidationProblem(modelStateDictionary: ModelState); - } - - var embed = await _oembedService.GetOEmbedAsync(_url, maxwidth, maxheight); - - if (embed.Success) - { - var result = embed.Result; - - if (!string.IsNullOrWhiteSpace(type) && !type.InvariantEquals(result?.Type)) - { - var tokens = new Dictionary { { nameof(type), type } }; - var errorMessage = _localizedTextService.Localize("novicellOEmbed", "embed_type_invalid", Thread.CurrentThread.CurrentUICulture, tokens); - ModelState.AddModelError(nameof(url), errorMessage); - } - } - else if (embed.Exception is OEmbedUrlNotSupportedException) - { - var errorMessage = _localizedTextService.Localize("novicellOEmbed", "url_not_supported"); - ModelState.AddModelError(nameof(url), errorMessage); - } - else if (embed.Exception is OEmbedException e) - { - ModelState.AddModelError(nameof(url), e.Message); - } - else if (embed.Result is null) - { - var errorMessage = _localizedTextService.Localize("novicellOEmbed", "embed_not_found"); - ModelState.AddModelError(nameof(url), errorMessage); - } - - if (!ModelState.IsValid) - { - return ValidationProblem(modelStateDictionary: ModelState); - } - - return Ok(embed.Result); - } - } - -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Models/OEmbedResponse.cs b/src/Novicell.Umbraco.OEmbed/Models/OEmbedResponse.cs deleted file mode 100644 index b70d153..0000000 --- a/src/Novicell.Umbraco.OEmbed/Models/OEmbedResponse.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Novicell.Umbraco.OEmbed.Models -{ - [DataContract] - public class OEmbedResponse - { - [DataMember(Name = "type")] - public string Type { get; set; } - - [DataMember(Name = "version")] - public string Version { get; set; } - - [DataMember(Name = "title")] - public string Title { get; set; } - - [DataMember(Name = "author_name")] - public string AuthorName { get; set; } - - [DataMember(Name = "author_url")] - public string AuthorUrl { get; set; } - - [DataMember(Name = "provider_name")] - public string ProviderName { get; set; } - - [DataMember(Name = "provider_url")] - public string ProviderUrl { get; set; } - - [DataMember(Name = "thumbnail_url")] - public string ThumbnailUrl { get; set; } - - [DataMember(Name = "thumbnail_height")] - public int? ThumbnailHeight { get; set; } - - [DataMember(Name = "thumbnail_width")] - public int? ThumbnailWidth { get; set; } - - [DataMember(Name = "html")] - public string Html { get; set; } - - [DataMember(Name = "url")] - public string Url { get; set; } - - [DataMember(Name = "height")] - public int? Height { get; set; } - - [DataMember(Name = "width")] - public int? Width { get; set; } - - [DataMember(Name = "cache_age")] - public int? CacheAge { get; set; } - - [JsonExtensionData] - // ReSharper disable once CollectionNeverUpdated.Local - private readonly IDictionary _additionalData = new Dictionary(); - - public bool TryGetValue(string key, [MaybeNullWhen(false)] out T value) - { - value = default; - - if (_additionalData.TryGetValue(key, out var token)) - { - value = token.ToObject(); - - return true; - } - - return false; - } - - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Models/OEmbedType.cs b/src/Novicell.Umbraco.OEmbed/Models/OEmbedType.cs deleted file mode 100644 index 8f5749a..0000000 --- a/src/Novicell.Umbraco.OEmbed/Models/OEmbedType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Novicell.Umbraco.OEmbed.Models -{ - internal enum OEmbedType - { - Video, - Photo, - Link, - Rich, - } -} diff --git a/src/Novicell.Umbraco.OEmbed/Models/OEmbedValue.cs b/src/Novicell.Umbraco.OEmbed/Models/OEmbedValue.cs deleted file mode 100644 index 331ffc9..0000000 --- a/src/Novicell.Umbraco.OEmbed/Models/OEmbedValue.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Novicell.Umbraco.OEmbed.Models -{ - public class OEmbedValue - { - public string Url { get; set; } - - public OEmbedResponse OEmbed { get; set; } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Novicell.Umbraco.OEmbed.csproj b/src/Novicell.Umbraco.OEmbed/Novicell.Umbraco.OEmbed.csproj deleted file mode 100644 index 4dcb673..0000000 --- a/src/Novicell.Umbraco.OEmbed/Novicell.Umbraco.OEmbed.csproj +++ /dev/null @@ -1,56 +0,0 @@ - - - net5.0 - . - Novicell.Umbraco.OEmbed - Novicell.Umbraco.OEmbed - Novicell.Umbraco.OEmbed - OEmbed propertyeditor for Umbraco. - Novicell.Umbraco.OEmbed - novicell umbraco oembed plugin propertyeditor editor video embed link photo image - - False - https://github.com/Novicell/Novicell.Umbraco.OEmbed - https://github.com/Novicell/Novicell.Umbraco.OEmbed - MIT - icon.png - - - True - - - True - - - - - - - - - - true - Always - - - True - build - - - - - - - - - - - <_Parameter1>$(AssemblyName).Tests - - - - - - - - diff --git a/src/Novicell.Umbraco.OEmbed/OEmbedException.cs b/src/Novicell.Umbraco.OEmbed/OEmbedException.cs deleted file mode 100644 index c4cba17..0000000 --- a/src/Novicell.Umbraco.OEmbed/OEmbedException.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Novicell.Umbraco.OEmbed -{ - public class OEmbedException : Exception - { - protected OEmbedException() - { - } - - protected OEmbedException(string message) - : base(message) - { - } - - protected OEmbedException(string message, Exception innerException) - : base(message, innerException) - { - } - - protected OEmbedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/OEmbedUrlNotSupportedException.cs b/src/Novicell.Umbraco.OEmbed/OEmbedUrlNotSupportedException.cs deleted file mode 100644 index edbe41e..0000000 --- a/src/Novicell.Umbraco.OEmbed/OEmbedUrlNotSupportedException.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Novicell.Umbraco.OEmbed -{ - public class OEmbedUrlNotSupportedException : OEmbedException - { - public OEmbedUrlNotSupportedException() - { - - } - - public OEmbedUrlNotSupportedException(string message) - : base(message) - { - } - - public OEmbedUrlNotSupportedException(string message, Exception innerException) - : base(message, innerException) - { - } - - protected OEmbedUrlNotSupportedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfiguration.cs b/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfiguration.cs deleted file mode 100644 index fd4ff47..0000000 --- a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Umbraco.Cms.Core.PropertyEditors; - -namespace Novicell.Umbraco.OEmbed.PropertyEditors -{ - public class OEmbedConfiguration - { - [ConfigurationField("type", "Type", "radiobuttonlist", Description = "Allowed Type")] - public string Type { get; set; } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationEditor.cs b/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationEditor.cs deleted file mode 100644 index 8f09543..0000000 --- a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Novicell.Umbraco.OEmbed.Models; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Core.PropertyEditors; - -namespace Novicell.Umbraco.OEmbed.PropertyEditors -{ - public class OEmbedConfigurationEditor : ConfigurationEditor - { - public OEmbedConfigurationEditor(IIOHelper ioHelper) : base(ioHelper) - { - var type = Field(nameof(OEmbedConfiguration.Type)); - ConfigureTypeField(type); - } - - private static void ConfigureTypeField(ConfigurationField field) - { - var types = new[] - { - Tuple.Create(nameof(OEmbedType.Video), "Video"), - Tuple.Create(nameof(OEmbedType.Photo), "Photo"), - Tuple.Create(nameof(OEmbedType.Rich), "Rich"), - Tuple.Create(nameof(OEmbedType.Link), "Link"), - Tuple.Create("", "(Any)"), - }; - - field.Validators.Add(new OEmbedConfigurationTypeFieldValidator(field.Key)); - field.Config = new Dictionary - { - { - "prevalues", types - .Select(x => new {key = x.Item1, value = x.Item1, label = x.Item2}) - } - }; - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationTypeFieldValidator.cs b/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationTypeFieldValidator.cs deleted file mode 100644 index 9dc4388..0000000 --- a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedConfigurationTypeFieldValidator.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Novicell.Umbraco.OEmbed.Models; -using Umbraco.Cms.Core.PropertyEditors; - -namespace Novicell.Umbraco.OEmbed.PropertyEditors -{ - internal class OEmbedConfigurationTypeFieldValidator : IManifestValueValidator - { - private readonly string _memberName; - - public OEmbedConfigurationTypeFieldValidator(string memberName) - { - _memberName = memberName; - } - - public IEnumerable Validate(object value, string valueType, object dataTypeConfiguration) - { - if (value?.ToString() is not { } s || string.IsNullOrWhiteSpace(s)) - { - yield break; - } - - if (!Enum.TryParse(s, true, out OEmbedType _)) - { - yield return new ValidationResult("The value " + value + " is not a valid OEmbed type", - new[] {_memberName}); - } - } - - public string ValidationName => "OEmbedType"; - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyEditor.cs b/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyEditor.cs deleted file mode 100644 index ab2cb51..0000000 --- a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyEditor.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Core.PropertyEditors; -using Umbraco.Cms.Core.WebAssets; - -namespace Novicell.Umbraco.OEmbed.PropertyEditors -{ - /// - [DataEditor(PropertyEditorAlias, "Novicell OEmbed", - PluginFolder + "oembed.propertyeditor.html", Group = "media", ValueType = ValueTypes.Json)] - internal class OEmbedPropertyEditor : DataEditor - { - public class OEmbedJavaScriptFile : JavaScriptFile - { - public OEmbedJavaScriptFile() : base(PluginFolder + "oembed.js") { } - } - - public class OEmbedCssFile : CssFile - { - public OEmbedCssFile() : base(PluginFolder + "oembed.css") { } - } - - private const string PluginFolder = "/App_Plugins/" + PropertyEditorAlias + "/"; - public const string PropertyEditorAlias = "Novicell.OEmbed"; - public const string PluginAreaName = "Novicell"; - - private readonly IIOHelper _ioHelper; - - public OEmbedPropertyEditor( - IDataValueEditorFactory dataValueEditorFactory, - IIOHelper ioHelper) - : base(dataValueEditorFactory) - { - _ioHelper = ioHelper; - } - - protected override IConfigurationEditor CreateConfigurationEditor() - { - return new OEmbedConfigurationEditor(_ioHelper); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyValueConverter.cs b/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyValueConverter.cs deleted file mode 100644 index 18f44dc..0000000 --- a/src/Novicell.Umbraco.OEmbed/PropertyEditors/OEmbedPropertyValueConverter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using Newtonsoft.Json; -using Novicell.Umbraco.OEmbed.Models; -using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.PropertyEditors; -using Umbraco.Extensions; - -namespace Novicell.Umbraco.OEmbed.PropertyEditors -{ - public class OEmbedPropertyValueConverter : PropertyValueConverterBase - { - /// - public override bool IsConverter(IPublishedPropertyType propertyType) - => propertyType.EditorAlias == OEmbedPropertyEditor.PropertyEditorAlias; - - /// - public override Type GetPropertyValueType(IPublishedPropertyType propertyType) - => typeof(OEmbedValue); - - /// - public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType) - => PropertyCacheLevel.Element; - - /// - public override object ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, - PropertyCacheLevel referenceCacheLevel, object inter, bool preview) - { - if (inter == null) - return null; - - var model = JsonConvert.DeserializeObject((string)inter); - - return model; - } - - /// - public override object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, object source, - bool preview) - { - if (source is not string json || - string.IsNullOrWhiteSpace(json) || - !json.DetectIsJson()) - { - return null; - } - - return json; - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Services/IOEmbedDiscoveryService.cs b/src/Novicell.Umbraco.OEmbed/Services/IOEmbedDiscoveryService.cs deleted file mode 100644 index 4e51df6..0000000 --- a/src/Novicell.Umbraco.OEmbed/Services/IOEmbedDiscoveryService.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Threading.Tasks; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Media; - -namespace Novicell.Umbraco.OEmbed.Services -{ - public interface IOEmbedDiscoveryService - { - /// - /// Discover the OEmbed endpoint of the provided url. - /// - /// - /// https://oembed.com/#section4 - /// oEmbed providers can choose to make their oEmbed support discoverable by adding - /// elements to the head of their existing (X)HTML documents. - /// The URLs contained within the href attribute should be the full oEmbed endpoint - /// plus URL and any needed format parameter. No other request parameters should be - /// included in this URL. - /// The type attribute must contain either application/json+oembed for JSON responses, - /// or text/xml+oembed for XML. - /// - /// The url of the (X)HTML document that contains the resource that should be embedded. - /// If discovered, an that describes the endpoint. - Task> DiscoverFromUrlAsync(Uri url); - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Services/IOEmbedService.cs b/src/Novicell.Umbraco.OEmbed/Services/IOEmbedService.cs deleted file mode 100644 index c656f20..0000000 --- a/src/Novicell.Umbraco.OEmbed/Services/IOEmbedService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Threading.Tasks; -using Novicell.Umbraco.OEmbed.Models; -using Umbraco.Cms.Core; - -namespace Novicell.Umbraco.OEmbed.Services -{ - public interface IOEmbedService - { - Task> GetOEmbedAsync(Uri url, int maxwidth, int maxheight); - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Services/OEmbedDiscoveryService.cs b/src/Novicell.Umbraco.OEmbed/Services/OEmbedDiscoveryService.cs deleted file mode 100644 index d564857..0000000 --- a/src/Novicell.Umbraco.OEmbed/Services/OEmbedDiscoveryService.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using System.Web; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Media; - -namespace Novicell.Umbraco.OEmbed.Services -{ - internal class OEmbedDiscoveryService : OEmbedServiceBase, IOEmbedDiscoveryService - { - private const string TypeAttributeName = "type"; - private const string RelAttributeName = "rel"; - - private readonly IHttpClientFactory _httpClientFactory; - - public OEmbedDiscoveryService(IHttpClientFactory httpClientFactory) - { - _httpClientFactory = httpClientFactory; - } - - /// - /// Discover the OEmbed endpoint of the provided url. - /// - /// - /// https://oembed.com/#section4 - /// oEmbed providers can choose to make their oEmbed support discoverable by adding - /// elements to the head of their existing (X)HTML documents. - /// The URLs contained within the href attribute should be the full oEmbed endpoint - /// plus URL and any needed format parameter. No other request parameters should be - /// included in this URL. - /// The type attribute must contain either application/json+oembed for JSON responses, - /// or text/xml+oembed for XML. - /// - /// The url of the (X)HTML document that contains the resource that should be embedded. - /// If discovered, an that describes the endpoint. - public async Task> DiscoverFromUrlAsync(Uri url) - { - var client = _httpClientFactory.CreateClient(); - - Uri endpoint; - - try - { - var response = await client.GetAsync(url); - - response.EnsureSuccessStatusCode(); - - var content = await response.Content.ReadAsStringAsync(); - - endpoint = FindOEmbedEndpointInHtml(content); - - if(endpoint == null && response.Headers.TryGetValues("Link", out var link)) - { - endpoint = FindOEmbedEndpointInLinkHeader(link); - } - - } - catch (HttpRequestException e) - { - if (e.StatusCode == HttpStatusCode.NotFound) - { - return Attempt.Fail(null); - } - - return Attempt.Fail(null, new Exception($"Error downloading html from '{url}'", e)); - } - catch (Exception e) - { - return Attempt.Fail(null, e); - } - - if (endpoint != null) - { - if (!endpoint.IsAbsoluteUri) - { - endpoint = new Uri(url, endpoint); - } - - var provider = new AutodiscoverEmbedProvider(endpoint); - - return Attempt.Succeed((IEmbedProvider)provider); - } - - return Attempt.Fail(null); - } - - /// - /// Find the endpoint defined in a link-header. - /// - /// The link-header values from the page being disvored. - /// The endpoint found in one of the provided link-header values. - internal static Uri FindOEmbedEndpointInLinkHeader(IEnumerable linkHeaderValues) - { - var links = new List<(string Href, string MediaType)>(); - - foreach (var headerValue in linkHeaderValues) - { - var inputs = headerValue.Split(new[] { ';' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); - - if (!inputs.Any()) - { - continue; - } - - var url = inputs[0].StartsWith('<') && inputs[0].EndsWith('>') ? - inputs[0][1..^1] : null; - - if (url == null) - { - continue; - } - - if (!inputs.Skip(1) - .Where(x => x.StartsWith(RelAttributeName)) - .Any(x => IsAlternateOrAlternative(x[(RelAttributeName.Length + 1)..]))) - { - continue; - } - - var type = inputs.Skip(1) - .Where(x => x.StartsWith(TypeAttributeName)) - .Select(x => x[(TypeAttributeName.Length + 1)..]) - .FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)); - - if (type == null) - { - continue; - } - - links.Add((url, type)); - } - - return GetOEmbedEndpointFromLinks(links.ToArray()); - } - - /// - /// Find the endpoint defined in a link-element found in the html. - /// - /// The html content of the page being discovered. - /// The endpoint found in a link-element in the html. - internal static Uri FindOEmbedEndpointInHtml(string html) - { - var doc = new HtmlAgilityPack.HtmlDocument(); - - doc.LoadHtml(html); - - var links = doc.DocumentNode.Descendants() - .Where(e => e.NodeType == HtmlAgilityPack.HtmlNodeType.Element && e.Name == "link") - .Select(x => new - { - Href = HttpUtility.HtmlDecode(x.GetAttributeValue("href", string.Empty)), - Rel = HttpUtility.HtmlDecode(x.GetAttributeValue(RelAttributeName, string.Empty)), - Type = HttpUtility.HtmlDecode(x.GetAttributeValue(TypeAttributeName, string.Empty)), - }) - .Where(x => IsAlternateOrAlternative(x.Rel?.ToLowerInvariant())) - .Where(x => !string.IsNullOrWhiteSpace(x.Href)) - .ToList(); - - return GetOEmbedEndpointFromLinks(links.Select(x => (x.Href, x.Type)).ToArray()); - } - - private static Uri GetOEmbedEndpointFromLinks(ICollection<(string Href, string MediaType)> links) - { - if (!links.Any()) - { - return null; - } - - foreach (var p in new Func[] { - t => IsJson(t, OEmbedMediaTypeSuffix), - t => IsXml(t, OEmbedMediaTypeSuffix), }) - { - foreach(var (href, _) in links.Where(x => p(x.MediaType))) - { - if (Uri.TryCreate(href, UriKind.RelativeOrAbsolute, out var _url)) - { - return _url; - } - } - } - - return null; - } - - internal sealed class AutodiscoverEmbedProvider : IEmbedProvider - { - public AutodiscoverEmbedProvider(Uri endpoint) - { - if (endpoint == null) throw new ArgumentNullException(nameof(endpoint)); - - ApiEndpoint = endpoint.GetLeftPart(UriPartial.Path); - - RequestParams = GetRequestParameters(endpoint.Query); - } - - private static Dictionary GetRequestParameters(string query) - { - if (string.IsNullOrWhiteSpace(query)) - { - return null; - } - - var queryString = HttpUtility.ParseQueryString(query); - - if (queryString.Count > 0) - { - var requestParameters = new Dictionary(); - foreach (var key in queryString.AllKeys) - { - requestParameters[key!] = queryString.Get(key); - } - return requestParameters; - } - - return null; - } - - public string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - { - throw new NotImplementedException(); - } - - public string ApiEndpoint { get; } - - public Dictionary RequestParams { get; } - - public string[] UrlSchemeRegex => null; - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/Services/OEmbedService.cs b/src/Novicell.Umbraco.OEmbed/Services/OEmbedService.cs deleted file mode 100644 index cdcca4f..0000000 --- a/src/Novicell.Umbraco.OEmbed/Services/OEmbedService.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Web; -using System.Xml.Linq; -using Microsoft.Extensions.Options; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Novicell.Umbraco.OEmbed.Configuration.Models; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Media.EmbedProviders; - -namespace Novicell.Umbraco.OEmbed.Services -{ - internal class OEmbedService : OEmbedServiceBase, IOEmbedService - { - private readonly EmbedProvidersCollection _providers; - private readonly IHttpClientFactory _httpClientFactory; - private readonly IOEmbedDiscoveryService _discoveryService; - private readonly OEmbedSettings _settings; - - public OEmbedService( - EmbedProvidersCollection providers, - IHttpClientFactory httpClientFactory, - IOEmbedDiscoveryService discoveryService, - IOptions settings) - { - _providers = providers; - _httpClientFactory = httpClientFactory; - _discoveryService = discoveryService; - _settings = settings?.Value; - } - - public async Task> GetOEmbedAsync(Uri url, int maxwidth, int maxheight) - { - var _url = await GetOEmbedUrlAsync(url, maxwidth, maxheight); - - if (_url == null) - { - return Attempt.Fail(null, new OEmbedUrlNotSupportedException()); - } - - var client = _httpClientFactory.CreateClient(); - - var result = await FetchOEmbedFromUrlAsync(_url, client); - - return result; - } - - private async Task GetOEmbedUrlAsync(Uri url, int maxwidth, int maxheight) - { - var isUrlMatch = new Func((input, patterns) - => patterns.Any(p => Regex.IsMatch(input, p, RegexOptions.IgnoreCase))); - - var provider = _providers? - .Where(x => x.UrlSchemeRegex != null) - .FirstOrDefault(x => isUrlMatch(url.AbsoluteUri, x.UrlSchemeRegex)); - - if (provider == null && _settings?.Autodiscover == true) - { - var discovered = await _discoveryService.DiscoverFromUrlAsync(url); - - if (discovered.Success) - { - provider = discovered.Result; - } - } - - switch (provider) - { - case null: - return null; - - case EmbedProviderBase providerBase: - { - var providerUrl = providerBase.GetEmbedProviderUrl(url.ToString(), maxwidth, maxheight); - - return string.IsNullOrWhiteSpace(providerUrl) ? null : new Uri(providerUrl); - } - default: - return BuildProviderOEmbedUrl(provider.ApiEndpoint, provider.RequestParams, url, maxwidth, maxheight); - } - } - - private static async Task> FetchOEmbedFromUrlAsync(Uri url, HttpClient client) - { - var response = await client.GetAsync(url); - - try - { - response.EnsureSuccessStatusCode(); - } - catch (HttpRequestException e) - { - return Attempt.Fail(null, e); - } - - var mediaType = response.Content.Headers.ContentType?.MediaType; - - var json = IsJson(mediaType) ? await response.Content.ReadAsStringAsync() : null; - - if (json == null && IsXml(mediaType)) - { - var xml = await response.Content.ReadAsStringAsync(); - json = ConvertXmlToJson(xml); - } - - if (string.IsNullOrWhiteSpace(json)) - { - return Attempt.Fail(new Exception($"Invalid response - content type '{mediaType ?? "unkown"}' not supported")); - } - - var result = DeserializeResponse(json); - - return Attempt.Succeed(result); - } - - internal static T DeserializeResponse(string json) - { - var result = JsonConvert.DeserializeObject(json, new JsonSerializerSettings - { - //MissingMemberHandling = MissingMemberHandling.Ignore, - Error = (_, args) => - { - args.ErrorContext.Handled = true; - }, - }); - - return result; - } - - private static Uri BuildProviderOEmbedUrl(string endpoint, IDictionary parameters, Uri url, int maxwidth, int maxheight) - { - if (string.IsNullOrWhiteSpace(endpoint)) - { - return null; - } - - var builder = new UriBuilder(endpoint); - - var queryString = HttpUtility.ParseQueryString(builder.Query); - - if (parameters != null) - { - foreach (var (key, value) in parameters) - { - queryString[key] = HttpUtility.UrlEncode(value); - } - } - - queryString[nameof(url)] = url.ToString(); - - if (maxwidth > 0) - { - queryString[nameof(maxwidth)] = maxwidth.ToString(); - } - - if (maxheight > 0) - { - queryString[nameof(maxheight)] = maxheight.ToString(); - } - - builder.Query = queryString.ToString() ?? string.Empty; - - return builder.Uri; - } - - internal static string ConvertXmlToJson(string text) - { - var x = XDocument.Parse(text); - - if (x.Root == null) - { - return null; - } - - var o = new JObject(); - foreach (var e in x.Root.Elements()) - { - var propertyName = new string(e.Name.LocalName - .Select(c => char.IsLetterOrDigit(c) ? c : '_' /* hi there ^_^ */) - .ToArray()); - - o[propertyName] = e.Value; - } - - return o.ToString(Formatting.None); - } - } -} diff --git a/src/Novicell.Umbraco.OEmbed/Services/OEmbedServiceBase.cs b/src/Novicell.Umbraco.OEmbed/Services/OEmbedServiceBase.cs deleted file mode 100644 index 457f299..0000000 --- a/src/Novicell.Umbraco.OEmbed/Services/OEmbedServiceBase.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Linq; -using System.Net.Mime; - -namespace Novicell.Umbraco.OEmbed.Services -{ - internal abstract class OEmbedServiceBase - { - internal static string OEmbedMediaTypeSuffix = "+oembed"; - - private static readonly string[] XmlMediaTypes - = new[] { MediaTypeNames.Text.Xml, MediaTypeNames.Application.Xml }; - - private static readonly string[] JsonMediaTypes - = new[] { MediaTypeNames.Application.Json }; - - internal static bool IsJson(string mediaType, string suffix = null) - => IsAnyOfWithSuffix(mediaType, suffix ?? string.Empty, JsonMediaTypes); - - internal static bool IsXml(string mediaType, string suffix = null) - => IsAnyOfWithSuffix(mediaType, suffix??string.Empty, XmlMediaTypes); - - internal static bool IsAlternateOrAlternative(string rel) - => IsAnyOf(rel, "alternate", "alternative"); - - private static bool IsAnyOf(string input, params string[] options) - { - if (string.IsNullOrWhiteSpace(input)) - { - return false; - } - - return options.Any(x => x.Equals(input, StringComparison.InvariantCultureIgnoreCase)); - } - - private static bool IsAnyOfWithSuffix(string input, string suffix, params string[] options) - { - return IsAnyOf(input, options.Select(x => x + suffix).ToArray()); - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/UmbracoBuilderExtensions.cs b/src/Novicell.Umbraco.OEmbed/UmbracoBuilderExtensions.cs deleted file mode 100644 index 00d893d..0000000 --- a/src/Novicell.Umbraco.OEmbed/UmbracoBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; -using Novicell.Umbraco.OEmbed.Configuration.Models; -using Novicell.Umbraco.OEmbed.PropertyEditors; -using Novicell.Umbraco.OEmbed.Services; -using Umbraco.Cms.Core.DependencyInjection; - -namespace Novicell.Umbraco.OEmbed -{ - public static class UmbracoBuilderExtensions - { - public static IUmbracoBuilder AddNovicellOEmbed(this IUmbracoBuilder builder, - Action defaultOptions = default) - { - // load up the settings. - var options = builder.Services.AddOptions() - .Bind(builder.Config.GetSection(OEmbedSettings.SectionKey)); - - if (defaultOptions != default) - { - options.Configure(defaultOptions); - } - - options.ValidateDataAnnotations(); - - builder.BackOfficeAssets() - .Append() - .Append(); - - builder.Services.AddScoped(); - - builder.Services.AddScoped(); - - return builder; - } - } -} \ No newline at end of file diff --git a/src/Novicell.Umbraco.OEmbed/build/Novicell.Umbraco.OEmbed.targets b/src/Novicell.Umbraco.OEmbed/build/Novicell.Umbraco.OEmbed.targets deleted file mode 100644 index cd109c9..0000000 --- a/src/Novicell.Umbraco.OEmbed/build/Novicell.Umbraco.OEmbed.targets +++ /dev/null @@ -1,26 +0,0 @@ - - - - $(MSBuildThisFileDirectory)..\App_Plugins\Novicell.OEmbed\**\*.* - - - - - - - - - - - - - - - - - - -