diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index c204831b1a..555c8f6b7a 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -15,6 +15,8 @@ en-US umbraco + + @@ -29,51 +31,50 @@ - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104,4 +105,4 @@ - + diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index c5b1b98a5f..c2f9ca0222 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -16,9 +16,10 @@ umbraco - + + diff --git a/src/SQLCE4Umbraco/SqlCE4Umbraco.csproj b/src/SQLCE4Umbraco/SqlCE4Umbraco.csproj index 0689a7a7d4..2904410748 100644 --- a/src/SQLCE4Umbraco/SqlCE4Umbraco.csproj +++ b/src/SQLCE4Umbraco/SqlCE4Umbraco.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties SQLCE4Umbraco SQLCE4Umbraco - v4.5 + v4.6.2 512 diff --git a/src/SQLCE4Umbraco/app.config b/src/SQLCE4Umbraco/app.config index 1f5a6442ad..6d9f461c6f 100644 --- a/src/SQLCE4Umbraco/app.config +++ b/src/SQLCE4Umbraco/app.config @@ -4,7 +4,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Core/BindingRedirects.cs b/src/Umbraco.Core/BindingRedirects.cs new file mode 100644 index 0000000000..2ee54a369b --- /dev/null +++ b/src/Umbraco.Core/BindingRedirects.cs @@ -0,0 +1,48 @@ +using System; +using System.Reflection; +using System.Text.RegularExpressions; +using System.Web; +using Umbraco.Core; + +namespace Umbraco.Core +{ + /// + /// Manages any assembly binding redirects that cannot be done via config + /// + internal class BindingRedirects + { + public static void Initialize() + { + // this only gets called when an assembly can't be resolved + AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; + } + + private static readonly Regex Log4NetAssemblyPattern = new Regex("log4net, Version=([\\d\\.]+?), Culture=neutral, PublicKeyToken=null", RegexOptions.Compiled); + private const string Log4NetReplacement = "log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a"; + + /// + /// This is used to do an assembly binding redirect via code - normally required due to signature changes in assemblies + /// + /// + /// + /// + private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + { + //log4net: + // Use regex to match and replace + if (Log4NetAssemblyPattern.IsMatch(args.Name) && args.Name != Log4NetReplacement) + { + return Assembly.Load(Log4NetAssemblyPattern.Replace(args.Name, Log4NetReplacement)); + } + + //AutoMapper: + // ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again + // do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stackoverflow + if (args.Name.StartsWith("AutoMapper") && args.Name.EndsWith("PublicKeyToken=null")) + return Assembly.Load(args.Name.Replace(", PublicKeyToken=null", ", PublicKeyToken=be96cd2c38ef1005")); + + return null; + + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/FileResources/Files.Designer.cs b/src/Umbraco.Core/FileResources/Files.Designer.cs index 456dae221f..500f9bf36c 100644 --- a/src/Umbraco.Core/FileResources/Files.Designer.cs +++ b/src/Umbraco.Core/FileResources/Files.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.0 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index 9580c05d5e..f4f634d974 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -819,40 +819,10 @@ namespace Umbraco.Core.Services return Attempt.Fail(); } - string partialViewHeader; - switch (partialViewType) - { - case PartialViewType.PartialView: - partialViewHeader = PartialViewHeader; - break; - case PartialViewType.PartialViewMacro: - partialViewHeader = PartialViewMacroHeader; - break; - default: - throw new ArgumentOutOfRangeException("partialViewType"); - } - if (snippetName.IsNullOrWhiteSpace() == false) { - //create the file - var snippetPathAttempt = TryGetSnippetPath(snippetName); - if (snippetPathAttempt.Success == false) - { - throw new InvalidOperationException("Could not load snippet with name " + snippetName); - } + partialView.Content = GetPartialViewMacroSnippetContent(snippetName, partialViewType); - using (var snippetFile = new StreamReader(System.IO.File.OpenRead(snippetPathAttempt.Result))) - { - var snippetContent = snippetFile.ReadToEnd().Trim(); - - //strip the @inherits if it's there - snippetContent = StripPartialViewHeader(snippetContent); - - var content = string.Format("{0}{1}{2}", - partialViewHeader, - Environment.NewLine, snippetContent); - partialView.Content = content; - } } using (var uow = _fileUowProvider.GetUnitOfWork()) @@ -998,6 +968,55 @@ namespace Umbraco.Core.Services } } + public string GetPartialViewSnippetContent(string snippetName) + { + return GetPartialViewMacroSnippetContent(snippetName, PartialViewType.PartialView); + } + + public string GetPartialViewMacroSnippetContent(string snippetName) + { + return GetPartialViewMacroSnippetContent(snippetName, PartialViewType.PartialViewMacro); + } + + private string GetPartialViewMacroSnippetContent(string snippetName, PartialViewType partialViewType) + { + if (snippetName.IsNullOrWhiteSpace()) + throw new ArgumentNullException("snippetName"); + + string partialViewHeader; + switch (partialViewType) + { + case PartialViewType.PartialView: + partialViewHeader = PartialViewHeader; + break; + case PartialViewType.PartialViewMacro: + partialViewHeader = PartialViewMacroHeader; + break; + default: + throw new ArgumentOutOfRangeException("partialViewType"); + } + + // Try and get the snippet path + var snippetPathAttempt = TryGetSnippetPath(snippetName); + if (snippetPathAttempt.Success == false) + { + throw new InvalidOperationException("Could not load snippet with name " + snippetName); + } + + using (var snippetFile = new StreamReader(System.IO.File.OpenRead(snippetPathAttempt.Result))) + { + var snippetContent = snippetFile.ReadToEnd().Trim(); + + //strip the @inherits if it's there + snippetContent = StripPartialViewHeader(snippetContent); + + var content = string.Format("{0}{1}{2}", + partialViewHeader, + Environment.NewLine, snippetContent); + return content; + } + } + public void SetPartialViewMacroFileContent(string filepath, Stream content) { // FIXME FTW would we use a READONLY unit of work to SET FILE CONTENT diff --git a/src/Umbraco.Core/Services/IFileService.cs b/src/Umbraco.Core/Services/IFileService.cs index 5115a25087..453d199bfe 100644 --- a/src/Umbraco.Core/Services/IFileService.cs +++ b/src/Umbraco.Core/Services/IFileService.cs @@ -331,6 +331,13 @@ namespace Umbraco.Core.Services /// The content of the macro partial view. Stream GetPartialViewMacroFileContentStream(string filepath); + /// + /// Gets the content of a macro partial view snippet as a string + /// + /// The name of the snippet + /// + string GetPartialViewMacroSnippetContent(string snippetName); + /// /// Sets the content of a macro partial view. /// @@ -352,6 +359,13 @@ namespace Umbraco.Core.Services /// The content of the partial view. Stream GetPartialViewFileContentStream(string filepath); + /// + /// Gets the content of a partial view snippet as a string. + /// + /// The name of the snippet + /// The content of the partial view. + string GetPartialViewSnippetContent(string snippetName); + /// /// Sets the content of a partial view. /// diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index ddede387b3..5e47d23486 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties Umbraco.Core Umbraco.Core - v4.5 + v4.6.2 512 ..\ true @@ -53,8 +53,8 @@ ..\packages\ImageProcessor.2.5.2\lib\net45\ImageProcessor.dll True - - ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll + + ..\packages\log4net.2.0.5\lib\net45-full\log4net.dll ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll @@ -80,15 +80,14 @@ ..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Owin.1.0\lib\net40\Owin.dll - - ..\packages\semver.1.1.2\lib\net45\Semver.dll + + ..\packages\Semver.2.0.4\lib\net452\Semver.dll @@ -132,6 +131,7 @@ + diff --git a/src/Umbraco.Core/UmbracoApplicationBase.cs b/src/Umbraco.Core/UmbracoApplicationBase.cs index 662cbb12bb..a2d2797ecd 100644 --- a/src/Umbraco.Core/UmbracoApplicationBase.cs +++ b/src/Umbraco.Core/UmbracoApplicationBase.cs @@ -49,8 +49,7 @@ namespace Umbraco.Core LogHelper.Error(msg, exception); }; - // this only gets called when an assembly can't be resolved - AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve; + BindingRedirects.Initialize(); //boot up the application GetBootManager() @@ -68,23 +67,7 @@ namespace Umbraco.Core if (scopeProvider != null) // can be mocked... scopeProvider.Reset(); } - - /// - /// Called when an assembly can't be resolved. In here we can do magic with the assembly name and try loading another. - /// This is used for loading a signed assembly of AutoMapper (v. 3.1+) without having to recompile old code. - /// - /// - /// - /// - private Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEventArgs args) - { - // ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again - // do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stackoverflow - if (args.Name.StartsWith("AutoMapper") && args.Name.EndsWith("PublicKeyToken=null")) - return Assembly.Load(args.Name.Replace(", PublicKeyToken=null", ", PublicKeyToken=be96cd2c38ef1005")); - return null; - } - + /// /// Initializes the Umbraco application /// diff --git a/src/Umbraco.Core/app.config b/src/Umbraco.Core/app.config index 1f5a6442ad..6d9f461c6f 100644 --- a/src/Umbraco.Core/app.config +++ b/src/Umbraco.Core/app.config @@ -4,7 +4,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Core/packages.config b/src/Umbraco.Core/packages.config index 01a4d71f82..702330dbbd 100644 --- a/src/Umbraco.Core/packages.config +++ b/src/Umbraco.Core/packages.config @@ -3,7 +3,7 @@ - + @@ -12,9 +12,9 @@ - + - + \ No newline at end of file diff --git a/src/Umbraco.Tests.Benchmarks/App.config b/src/Umbraco.Tests.Benchmarks/App.config index a988966f23..4fecf67bbd 100644 --- a/src/Umbraco.Tests.Benchmarks/App.config +++ b/src/Umbraco.Tests.Benchmarks/App.config @@ -1,7 +1,7 @@  - + @@ -43,6 +43,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj b/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj index 39d77bbc26..0b0da403fb 100644 --- a/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj +++ b/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj @@ -9,10 +9,11 @@ Properties Umbraco.Tests.Benchmarks Umbraco.Tests.Benchmarks - v4.5 + v4.6.2 512 + AnyCPU @@ -59,8 +60,17 @@ ..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\lib\net40\Microsoft.Diagnostics.Tracing.TraceEvent.dll - - ..\packages\System.Collections.Immutable.1.1.37\lib\dotnet\System.Collections.Immutable.dll + + ..\packages\System.AppContext.4.1.0\lib\net46\System.AppContext.dll + True + + + ..\packages\System.Collections.Immutable.1.2.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + True + + + + ..\packages\System.Console.4.0.0\lib\net46\System.Console.dll True @@ -70,19 +80,81 @@ ..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll + + ..\packages\System.Diagnostics.FileVersionInfo.4.0.0\lib\net46\System.Diagnostics.FileVersionInfo.dll + True + + + ..\packages\System.Diagnostics.StackTrace.4.0.1\lib\net46\System.Diagnostics.StackTrace.dll + + + ..\packages\System.IO.FileSystem.4.0.1\lib\net46\System.IO.FileSystem.dll + True + + + ..\packages\System.IO.FileSystem.Primitives.4.0.1\lib\net46\System.IO.FileSystem.Primitives.dll + True + - - ..\packages\System.Reflection.Metadata.1.2.0\lib\portable-net45+win8\System.Reflection.Metadata.dll + + + ..\packages\System.Reflection.4.1.0\lib\net462\System.Reflection.dll + + + ..\packages\System.Reflection.Metadata.1.3.0\lib\portable-net45+win8\System.Reflection.Metadata.dll + + + ..\packages\System.Runtime.4.1.0\lib\net462\System.Runtime.dll + + + ..\packages\System.Runtime.Extensions.4.1.0\lib\net462\System.Runtime.Extensions.dll + + + ..\packages\System.Runtime.InteropServices.4.1.0\lib\net462\System.Runtime.InteropServices.dll + + + ..\packages\System.Security.Cryptography.Algorithms.4.2.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.0.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + + + ..\packages\System.Security.Cryptography.Primitives.4.0.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.1.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + + + ..\packages\System.Text.Encoding.CodePages.4.0.1\lib\net46\System.Text.Encoding.CodePages.dll + True ..\packages\System.Threading.Tasks.Extensions.4.0.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Thread.4.0.0\lib\net46\System.Threading.Thread.dll + True + + + ..\packages\System.Xml.XmlDocument.4.0.1\lib\net46\System.Xml.XmlDocument.dll + True + + + ..\packages\System.Xml.XPath.4.0.1\lib\net46\System.Xml.XPath.dll + True + + + ..\packages\System.Xml.XPath.XDocument.4.0.1\lib\net46\System.Xml.XPath.XDocument.dll + True + diff --git a/src/Umbraco.Tests.Benchmarks/packages.config b/src/Umbraco.Tests.Benchmarks/packages.config index c4d2ba1df2..7a8b84c7d4 100644 --- a/src/Umbraco.Tests.Benchmarks/packages.config +++ b/src/Umbraco.Tests.Benchmarks/packages.config @@ -10,16 +10,45 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Umbraco.Tests/App.config b/src/Umbraco.Tests/App.config index 1684b8d504..0f8fa70862 100644 --- a/src/Umbraco.Tests/App.config +++ b/src/Umbraco.Tests/App.config @@ -91,7 +91,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs b/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs index d42cac22b3..55eec4b23e 100644 --- a/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs +++ b/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18034 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -93,19 +93,20 @@ namespace Umbraco.Tests.Migrations.SqlScripts { ///, [userTypeDefaultPermissions] nvarchar(50) NULL ///); ///GO - ///CREATE TABLE [umbracoUserLogins] ( - /// [contextID] uniqueidentifier NOT NULL - ///, [userID] int NOT NULL - ///, [timeout] bigint NOT NULL - ///); - ///GO ///CREATE TABLE [umbracoUser2NodePermission] ( /// [userId] int NOT NULL ///, [nodeId] int NOT NULL ///, [permission] nchar(1) NOT NULL ///); ///GO - ///CREATE TABLE [umbracoUser2Nod [rest of string was truncated]";. + ///CREATE TABLE [umbracoUser2NodeNotify] ( + /// [userId] int NOT NULL + ///, [nodeId] int NOT NULL + ///, [action] nchar(1) NOT NULL + ///); + ///GO + ///CREATE TABLE [umbracoUser] ( + /// [id] in [rest of string was truncated]";. /// internal static string SqlCe_SchemaAndData_4110 { get { diff --git a/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs b/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs index bcc287e2ae..c640d21aa7 100644 --- a/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs +++ b/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs b/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs index a37e2cf266..c09ce53b04 100644 --- a/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs +++ b/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34011 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index 79fe540e95..ab02087091 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties Umbraco.Tests Umbraco.Tests - v4.5 + v4.6.2 512 ..\ true @@ -64,8 +64,8 @@ ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll + + ..\packages\log4net.2.0.5\lib\net45-full\log4net.dll ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll @@ -82,9 +82,8 @@ ..\packages\Moq.4.1.1309.0919\lib\net40\Moq.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\NUnit.2.6.2\lib\nunit.framework.dll @@ -92,8 +91,8 @@ ..\packages\Owin.1.0\lib\net40\Owin.dll - - ..\packages\semver.1.1.2\lib\net45\Semver.dll + + ..\packages\Semver.2.0.4\lib\net452\Semver.dll diff --git a/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs b/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs index ce86c80041..d79535420a 100644 --- a/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.0 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Umbraco.Tests/packages.config b/src/Umbraco.Tests/packages.config index 09765d376b..383854f5fd 100644 --- a/src/Umbraco.Tests/packages.config +++ b/src/Umbraco.Tests/packages.config @@ -3,7 +3,7 @@ - + @@ -17,11 +17,11 @@ - + - + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js index b6e35d9d7b..e83bb4f14e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js @@ -77,39 +77,6 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) { "Failed to retrieve data for template with alias: " + alias); }, - - /** - * @ngdoc method - * @name umbraco.resources.codefileResource#getScaffold - * @methodOf umbraco.resources.codefileResource - * - * @description - * Returns a scaffold of an empty codefile item - * - * The scaffold is used to build editors for code file editors that has not yet been populated with data. - * - * ##usage - *
-         * codefileResource.getScaffold()
-         *    .then(function(template) {
-         *        alert('its here!');
-         *    });
-         * 
- * - * @returns {Promise} resourcePromise object containing the codefile scaffold. - * - */ - getScaffold: function (id) { - - return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "templateApiBaseUrl", - "GetScaffold", - [{ id: id }])), - "Failed to retrieve data for empty template"); - }, - /** * @ngdoc method * @name umbraco.resources.codefileResource#deleteByPath @@ -176,7 +143,70 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) { "PostSave"), codeFile), "Failed to save data for code file " + codeFile.virtualPath); + }, + + /** + * @ngdoc method + * @name umbraco.resources.codefileResource#getSnippets + * @methodOf umbraco.resources.codefileResource + * + * @description + * Gets code snippets for a given file type + * + * ##usage + *
+         * codefileResource.getSnippets("partialViews")
+         *    .then(function(snippets) {
+         *        alert('its here!');
+         *    });
+         * 
+ * + * @param {string} file type: (partialViews, partialViewMacros) + * @returns {Promise} resourcePromise object. + * + */ + getSnippets: function (fileType) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "codeFileApiBaseUrl", + "GetSnippets?type=" + fileType )), + "Failed to get snippet for" + fileType); + }, + + /** + * @ngdoc method + * @name umbraco.resources.codefileResource#getScaffold + * @methodOf umbraco.resources.codefileResource + * + * @description + * Returns a scaffold of an empty codefile item. + * + * The scaffold is used to build editors for code file editors that has not yet been populated with data. + * + * ##usage + *
+         * codefileResource.getScaffold("partialViews", "Breadcrumb")
+         *    .then(function(data) {
+         *        alert('its here!');
+         *    });
+         * 
+ * + * @param {string} File type: (scripts, partialViews, partialViewMacros). + * @param {string} Snippet name (Ex. Breadcrumb). + * @returns {Promise} resourcePromise object. + * + */ + + getScaffold: function (type, id, snippetName) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "codeFileApiBaseUrl", + "GetScaffold?type=" + type + "&id=" + id + "&snippetName=" + snippetName)), + "Failed to get scaffold for" + type); } + }; } diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.controller.js new file mode 100644 index 0000000000..3b3fb0f9f5 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.controller.js @@ -0,0 +1,55 @@ +(function () { + "use strict"; + + function PartialViewMacrosCreateController($scope, codefileResource, $location, navigationService) { + + var vm = this; + var node = $scope.dialogOptions.currentNode; + + vm.snippets = []; + vm.showSnippets = false; + vm.creatingFolder = false; + + vm.createPartialViewMacro = createPartialViewMacro; + vm.showCreateFolder = showCreateFolder; + vm.createFolder = createFolder; + vm.showCreateFromSnippet = showCreateFromSnippet; + + function onInit() { + codefileResource.getSnippets('partialViewMacros') + .then(function(snippets) { + vm.snippets = snippets; + }); + } + + function createPartialViewMacro(selectedSnippet) { + + var snippet = null; + + if(selectedSnippet && selectedSnippet.fileName) { + snippet = selectedSnippet.fileName; + } + + $location.path("/developer/partialviewmacros/edit/" + node.id).search("create", "true").search("snippet", snippet); + navigationService.hideMenu(); + + } + + function showCreateFolder() { + vm.creatingFolder = true; + } + + function createFolder() { + + } + + function showCreateFromSnippet() { + vm.showSnippets = true; + } + + onInit(); + + } + + angular.module("umbraco").controller("Umbraco.Editors.PartialViewMacros.CreateController", PartialViewMacrosCreateController); +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html new file mode 100644 index 0000000000..aa8796ae7a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html @@ -0,0 +1,75 @@ +
+ + + + + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js index c402f42ee7..4860773b02 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js @@ -227,10 +227,19 @@ function init() { //we need to load this somewhere, for now its here. assetsService.loadCss("lib/ace-razor-mode/theme/razor_chrome.css"); + if ($routeParams.create) { - codefileResource.getScaffold().then(function (partialViewMacro) { + + var snippet = "Empty"; + + if($routeParams.snippet) { + snippet = $routeParams.snippet; + } + + codefileResource.getScaffold("partialViewMacros", $routeParams.id, snippet).then(function (partialViewMacro) { ready(partialViewMacro); }); + } else { codefileResource.getByPath('partialViewMacros', $routeParams.id).then(function (partialViewMacro) { ready(partialViewMacro); diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.controller.js new file mode 100644 index 0000000000..5aeaa28935 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.controller.js @@ -0,0 +1,55 @@ +(function () { + "use strict"; + + function PartialViewsCreateController($scope, codefileResource, $location, navigationService) { + + var vm = this; + var node = $scope.dialogOptions.currentNode; + + vm.snippets = []; + vm.showSnippets = false; + vm.creatingFolder = false; + + vm.createPartialView = createPartialView; + vm.showCreateFolder = showCreateFolder; + vm.createFolder = createFolder; + vm.showCreateFromSnippet = showCreateFromSnippet; + + function onInit() { + codefileResource.getSnippets('partialViews') + .then(function(snippets) { + vm.snippets = snippets; + }); + } + + function createPartialView(selectedSnippet) { + + var snippet = null; + + if(selectedSnippet && selectedSnippet.fileName) { + snippet = selectedSnippet.fileName; + } + + $location.path("/settings/partialviews/edit/" + node.id).search("create", "true").search("snippet", snippet); + navigationService.hideMenu(); + + } + + function showCreateFolder() { + vm.creatingFolder = true; + } + + function createFolder() { + + } + + function showCreateFromSnippet() { + vm.showSnippets = true; + } + + onInit(); + + } + + angular.module("umbraco").controller("Umbraco.Editors.PartialViews.CreateController", PartialViewsCreateController); +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html new file mode 100644 index 0000000000..fc9bf98c4f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html @@ -0,0 +1,75 @@ +
+ + + + + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js index dc388a906b..a493ed30c1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js @@ -227,15 +227,25 @@ function init() { //we need to load this somewhere, for now its here. assetsService.loadCss("lib/ace-razor-mode/theme/razor_chrome.css"); + if ($routeParams.create) { - codefileResource.getScaffold().then(function (partialView) { + + var snippet = "Empty"; + + if($routeParams.snippet) { + snippet = $routeParams.snippet; + } + + codefileResource.getScaffold("partialViews", $routeParams.id, snippet).then(function (partialView) { ready(partialView); }); + } else { codefileResource.getByPath('partialViews', $routeParams.id).then(function (partialView) { ready(partialView); }); } + } function ready(partialView) { diff --git a/src/Umbraco.Web.UI.Client/src/views/scripts/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/scripts/create.controller.js new file mode 100644 index 0000000000..1729693d83 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/scripts/create.controller.js @@ -0,0 +1,33 @@ +(function () { + "use strict"; + + function ScriptsCreateController($scope, $location, navigationService) { + + var vm = this; + var node = $scope.dialogOptions.currentNode; + + vm.creatingFolder = false; + vm.folderName = ""; + vm.fileExtension = ""; + + vm.createFile = createFile; + vm.showCreateFolder = showCreateFolder; + vm.createFolder = createFolder; + + function createFile() { + $location.path("/settings/scripts/edit/" + node.id).search("create", "true"); + navigationService.hideMenu(); + } + + function showCreateFolder() { + vm.creatingFolder = true; + } + + function createFolder() { + + } + + } + + angular.module("umbraco").controller("Umbraco.Editors.Scripts.CreateController", ScriptsCreateController); +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/scripts/create.html b/src/Umbraco.Web.UI.Client/src/views/scripts/create.html new file mode 100644 index 0000000000..d57ead3b15 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/scripts/create.html @@ -0,0 +1,47 @@ + + + diff --git a/src/Umbraco.Web.UI.Client/src/views/scripts/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/scripts/edit.controller.js index cd10ae75d5..d2a5fcbc0e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/scripts/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/scripts/edit.controller.js @@ -79,7 +79,7 @@ assetsService.loadCss("lib/ace-razor-mode/theme/razor_chrome.css"); if ($routeParams.create) { - codefileResource.getScaffold().then(function (script) { + codefileResource.getScaffold("scripts", $routeParams.id).then(function (script) { ready(script); }); } else { diff --git a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs index 962354c575..27ed7eb256 100644 --- a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs +++ b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18408 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace Umbraco.Web.UI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 55c8d8aed2..f580b3c5df 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -1,5 +1,5 @@  - + 9.0.30729 @@ -37,7 +37,7 @@ 4.0 - v4.5 + v4.6.2 true 44319 @@ -142,9 +142,8 @@ ..\packages\ImageProcessor.Web.4.8.2\lib\net45\ImageProcessor.Web.dll True
- - False - ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll + + ..\packages\log4net.2.0.5\lib\net45-full\log4net.dll False @@ -203,9 +202,8 @@ False ..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Owin.1.0\lib\net40\Owin.dll diff --git a/src/Umbraco.Web.UI/packages.config b/src/Umbraco.Web.UI/packages.config index ce3ef29c96..e113042d59 100644 --- a/src/Umbraco.Web.UI/packages.config +++ b/src/Umbraco.Web.UI/packages.config @@ -8,7 +8,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 444ecc2e3d..f6823e766f 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -197,6 +197,11 @@ Document Type without a template New folder New data type + New javascript file + New empty partial view + New partial view from snippet + New empty partial view macro + New partial view macro from snippet Browse your website diff --git a/src/Umbraco.Web.UI/web.Template.Debug.config b/src/Umbraco.Web.UI/web.Template.Debug.config index 9ad3174a28..2ca0b6003a 100644 --- a/src/Umbraco.Web.UI/web.Template.Debug.config +++ b/src/Umbraco.Web.UI/web.Template.Debug.config @@ -382,7 +382,7 @@ xdt:Locator="Condition(_defaultNamespace:assemblyIdentity[@name='Newtonsoft.Json']])"/> - + + + + + + +
diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index 10c64797f4..52cfb000b6 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -394,7 +394,7 @@ - + @@ -425,7 +425,10 @@ - + + + + diff --git a/src/Umbraco.Web/Editors/CodeFileController.cs b/src/Umbraco.Web/Editors/CodeFileController.cs index 58dd28a15e..bcb6630c0a 100644 --- a/src/Umbraco.Web/Editors/CodeFileController.cs +++ b/src/Umbraco.Web/Editors/CodeFileController.cs @@ -1,7 +1,12 @@ using AutoMapper; +using System.Collections.Generic; +using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; +using ClientDependency.Core; +using Umbraco.Core; +using Umbraco.Core.IO; using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Web.Models.ContentEditing; @@ -9,7 +14,6 @@ using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Umbraco.Web.Trees; -using Umbraco.Core.IO; namespace Umbraco.Web.Editors { @@ -32,11 +36,13 @@ namespace Umbraco.Web.Editors { case Core.Constants.Trees.PartialViews: var view = new PartialView(display.VirtualPath); + view.Content = display.Content; var result = Services.FileService.CreatePartialView(view, display.Snippet, Security.CurrentUser.Id); return result.Success == true ? Request.CreateResponse(HttpStatusCode.OK) : Request.CreateNotificationValidationErrorResponse(result.Exception.Message); case Core.Constants.Trees.PartialViewMacros: var viewMacro = new PartialView(display.VirtualPath); + viewMacro.Content = display.Content; var resultMacro = Services.FileService.CreatePartialViewMacro(viewMacro, display.Snippet, Security.CurrentUser.Id); return resultMacro.Success == true ? Request.CreateResponse(HttpStatusCode.OK) : Request.CreateNotificationValidationErrorResponse(resultMacro.Exception.Message); @@ -105,6 +111,95 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } + /// + /// Used to get a list of available templates/snippets to base a new Partial View og Partial View Macro from + /// + /// This is a string but will be 'partialViews', 'partialViewMacros' + /// Returns a list of if a correct type is sent + public IEnumerable GetSnippets(string type) + { + if (string.IsNullOrWhiteSpace(type)) + { + throw new HttpResponseException(HttpStatusCode.BadRequest); + } + + IEnumerable snippets; + switch (type) + { + case Core.Constants.Trees.PartialViews: + snippets = Services.FileService.GetPartialViewSnippetNames( + //ignore these - (this is taken from the logic in "PartialView.ascx.cs") + "Gallery", + "ListChildPagesFromChangeableSource", + "ListChildPagesOrderedByProperty", + "ListImagesFromMediaFolder"); + break; + case Core.Constants.Trees.PartialViewMacros: + snippets = Services.FileService.GetPartialViewSnippetNames(); + break; + default: + throw new HttpResponseException(HttpStatusCode.NotFound); + } + + return snippets.Select(snippet => new SnippetDisplay() {Name = snippet.SplitPascalCasing().ToFirstUpperInvariant(), FileName = snippet}); + } + + /// + /// Used to scaffold the json object for the editors for 'scripts', 'partialViews', 'partialViewMacros' + /// + /// This is a string but will be 'scripts' 'partialViews', 'partialViewMacros' + /// + /// + /// + public CodeFileDisplay GetScaffold(string type, string id = null, string snippetName = null) + { + if (string.IsNullOrWhiteSpace(type)) + { + throw new HttpResponseException(HttpStatusCode.BadRequest); + } + + if (id.IsNullOrWhiteSpace()) + id = string.Empty; + + CodeFileDisplay codeFileDisplay; + + switch (type) + { + case Core.Constants.Trees.PartialViews: + codeFileDisplay = Mapper.Map(new PartialView(string.Empty)); + codeFileDisplay.VirtualPath = SystemDirectories.PartialViews; + if (snippetName.IsNullOrWhiteSpace() == false) + codeFileDisplay.Content = Services.FileService.GetPartialViewSnippetContent(snippetName); + break; + case Core.Constants.Trees.PartialViewMacros: + codeFileDisplay = Mapper.Map(new PartialView(string.Empty)); + codeFileDisplay.VirtualPath = SystemDirectories.MacroPartials; + if (snippetName.IsNullOrWhiteSpace() == false) + codeFileDisplay.Content = Services.FileService.GetPartialViewMacroSnippetContent(snippetName); + break; + case Core.Constants.Trees.Scripts: + codeFileDisplay = Mapper.Map(new Script(string.Empty)); + codeFileDisplay.VirtualPath = SystemDirectories.Scripts; + break; + default: + throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Unsupported editortype")); + } + + // Make sure that the root virtual path ends with '/' + codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.EnsureEndsWith("/"); + + if (id.IsNullOrWhiteSpace() == false && id != Core.Constants.System.Root.ToInvariantString()) + { + codeFileDisplay.VirtualPath += id.TrimStart("/").EnsureEndsWith("/"); + } + + codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.TrimStart("~"); + codeFileDisplay.Path = Url.GetTreePathFromFilePath(id); + codeFileDisplay.FileType = type; + + return codeFileDisplay; + } + /// /// Used to delete a specific file from disk via the FileService /// @@ -150,7 +245,7 @@ namespace Umbraco.Web.Editors } /// - /// Used to save/update an existing file after its initial creation + /// Used to create or update a 'partialview', 'partialviewmacro' or 'script' file /// /// /// The updated CodeFileDisplay model @@ -166,81 +261,56 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } - switch (display.FileType) { case Core.Constants.Trees.PartialViews: - var view = Services.FileService.GetPartialView(display.VirtualPath); - if (view != null) + var partialViewResult = CreateOrUpdatePartialView(display); + if (partialViewResult.Success) { - // might need to find the path - var orgPath = view.OriginalPath.Substring(0, view.OriginalPath.IndexOf(view.Name)); - view.Path = orgPath + display.Name; - view.Content = display.Content; - - //Save the file and update the response to reflect any name and path changes - var result = Services.FileService.SavePartialView(view, Security.CurrentUser.Id); - if (result.Success == true) - { - display = Mapper.Map(result.Result, display); - display.Path = Url.GetTreePathFromFilePath(view.Path); - return display; - } - - display.AddErrorNotification( - Services.TextService.Localize("speechBubbles/partialViewErrorHeader"), - Services.TextService.Localize("speechBubbles/partialViewErrorText")); - } - else - { - throw new HttpResponseException(HttpStatusCode.NotFound); + display = Mapper.Map(partialViewResult.Result, display); + display.Path = Url.GetTreePathFromFilePath(partialViewResult.Result.Path); + return display; } + + display.AddErrorNotification( + Services.TextService.Localize("speechBubbles/partialViewErrorHeader"), + Services.TextService.Localize("speechBubbles/partialViewErrorText")); break; case Core.Constants.Trees.PartialViewMacros: - var viewMacro = Services.FileService.GetPartialViewMacro(display.VirtualPath); - if (viewMacro != null) + var partialViewMacroResult = CreateOrUpdatePartialViewMacro(display); + if (partialViewMacroResult.Success) { - viewMacro.Content = display.Content; - viewMacro.Path = display.Name; - - //save the file and update the display to reflect any path and name changes - var result = Services.FileService.SavePartialViewMacro(viewMacro, Security.CurrentUser.Id); - if (result.Success == true) - { - display = Mapper.Map(result.Result, display); - display.Path = Url.GetTreePathFromFilePath(result.Result.Path); - return display; - } - - display.AddErrorNotification( - Services.TextService.Localize("speechBubbles/partialViewErrorHeader"), - Services.TextService.Localize("speechBubbles/partialViewErrorText")); - } - else - { - throw new HttpResponseException(HttpStatusCode.NotFound); + display = Mapper.Map(partialViewMacroResult.Result, display); + display.Path = Url.GetTreePathFromFilePath(partialViewMacroResult.Result.Path); + return display; } + + display.AddErrorNotification( + Services.TextService.Localize("speechBubbles/partialViewErrorHeader"), + Services.TextService.Localize("speechBubbles/partialViewErrorText")); break; case Core.Constants.Trees.Scripts: + var virtualPath = display.VirtualPath; var script = Services.FileService.GetScriptByName(display.VirtualPath); if (script != null) { - script.Content = display.Content; script.Path = display.Name; - - Services.FileService.SaveScript(script, Security.CurrentUser.Id); display = Mapper.Map(script, display); display.Path = Url.GetTreePathFromFilePath(script.Path); return display; - } else { - throw new HttpResponseException(HttpStatusCode.NotFound); + var fileName = EnsurePartialViewExtension(display.Name, ".js"); + script = new Script(virtualPath + fileName); } + + script.Content = display.Content; + + Services.FileService.SaveScript(script, Security.CurrentUser.Id); break; default: @@ -249,5 +319,74 @@ namespace Umbraco.Web.Editors return display; } + + private Attempt CreateOrUpdatePartialView(CodeFileDisplay display) + { + Attempt partialViewResult; + string virtualPath = NormalizeVirtualPath(display.VirtualPath, SystemDirectories.PartialViews); + var view = Services.FileService.GetPartialView(virtualPath); + if (view != null) + { + // might need to find the path + var orgPath = view.OriginalPath.Substring(0, view.OriginalPath.IndexOf(view.Name)); + view.Path = orgPath + display.Name; + + view.Content = display.Content; + partialViewResult = Services.FileService.SavePartialView(view, Security.CurrentUser.Id); + } + else + { + var fileName = EnsurePartialViewExtension(display.Name, ".cshtml"); + view = new PartialView(virtualPath + fileName); + view.Content = display.Content; + partialViewResult = Services.FileService.CreatePartialView(view, display.Snippet, Security.CurrentUser.Id); + } + + return partialViewResult; + } + + private string NormalizeVirtualPath(string virtualPath, string systemDirectory) + { + if (virtualPath.IsNullOrWhiteSpace()) + return string.Empty; + + systemDirectory = systemDirectory.TrimStart("~"); + systemDirectory = systemDirectory.Replace('\\', '/'); + virtualPath = virtualPath.TrimStart("~"); + virtualPath = virtualPath.Replace('\\', '/'); + virtualPath = virtualPath.ReplaceFirst(systemDirectory, string.Empty); + + return virtualPath; + } + + private Attempt CreateOrUpdatePartialViewMacro(CodeFileDisplay display) + { + Attempt partialViewMacroResult; + var virtualPath = display.VirtualPath ?? string.Empty; + var viewMacro = Services.FileService.GetPartialViewMacro(virtualPath); + if (viewMacro != null) + { + viewMacro.Content = display.Content; + viewMacro.Path = display.Name; + partialViewMacroResult = Services.FileService.SavePartialViewMacro(viewMacro, Security.CurrentUser.Id); + } + else + { + var fileName = EnsurePartialViewExtension(display.Name, ".cshtml"); + viewMacro = new PartialView(virtualPath + fileName); + viewMacro.Content = display.Content; + partialViewMacroResult = Services.FileService.CreatePartialViewMacro(viewMacro, display.Snippet, Security.CurrentUser.Id); + } + + return partialViewMacroResult; + } + + private string EnsurePartialViewExtension(string value, string extension) + { + if (value.EndsWith(extension) == false) + value += extension; + + return value; + } } } diff --git a/src/Umbraco.Web/Models/ContentEditing/SnippetDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/SnippetDisplay.cs new file mode 100644 index 0000000000..e05f8c5c89 --- /dev/null +++ b/src/Umbraco.Web/Models/ContentEditing/SnippetDisplay.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Umbraco.Web.Models.ContentEditing +{ + [DataContract(Name = "scriptFile", Namespace = "")] + public class SnippetDisplay + { + [DataMember(Name = "name", IsRequired = true)] + public string Name { get; set; } + + [DataMember(Name = "fileName", IsRequired = true)] + public string FileName { get; set; } + } +} diff --git a/src/Umbraco.Web/Mvc/Strings.Designer.cs b/src/Umbraco.Web/Mvc/Strings.Designer.cs index 02a44fbbd7..243a7f7dd9 100644 --- a/src/Umbraco.Web/Mvc/Strings.Designer.cs +++ b/src/Umbraco.Web/Mvc/Strings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -65,8 +65,8 @@ namespace Umbraco.Web.Mvc { ///<configuration> /// /// <configSections> - /// <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - /// <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> + /// <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + /// <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> /// <section name="page [rest of string was truncated]";. /// internal static string WebConfigTemplate { diff --git a/src/Umbraco.Web/Properties/Settings1.Designer.cs b/src/Umbraco.Web/Properties/Settings1.Designer.cs index 3f63c8d5cd..55e957a383 100644 --- a/src/Umbraco.Web/Properties/Settings1.Designer.cs +++ b/src/Umbraco.Web/Properties/Settings1.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace Umbraco.Web.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs b/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs index 10daa56dbe..61d9c17cef 100644 --- a/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs +++ b/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs @@ -34,13 +34,26 @@ namespace Umbraco.Web.Trees if (id == Constants.System.Root.ToInvariantString()) { - + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); //refresh action menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); return menu; } + if (id.EndsWith(FileSearchPattern.TrimStart("*")) == false) + { + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); + //refresh action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); + } + // TODO: Wire up new delete dialog menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias))); return menu; diff --git a/src/Umbraco.Web/Trees/PartialViewsTreeController.cs b/src/Umbraco.Web/Trees/PartialViewsTreeController.cs index 7a88def826..96da9a2e33 100644 --- a/src/Umbraco.Web/Trees/PartialViewsTreeController.cs +++ b/src/Umbraco.Web/Trees/PartialViewsTreeController.cs @@ -33,13 +33,26 @@ namespace Umbraco.Web.Trees if (id == Constants.System.Root.ToInvariantString()) { - + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); //refresh action menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); return menu; } + if (id.EndsWith(FileSearchPattern.TrimStart("*")) == false) + { + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); + //refresh action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); + } + // TODO: Wire up new delete dialog menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias))); return menu; diff --git a/src/Umbraco.Web/Trees/ScriptTreeController.cs b/src/Umbraco.Web/Trees/ScriptTreeController.cs index ae19dbcf48..c7d4e728aa 100644 --- a/src/Umbraco.Web/Trees/ScriptTreeController.cs +++ b/src/Umbraco.Web/Trees/ScriptTreeController.cs @@ -1,4 +1,5 @@ -using Umbraco.Core; +using System.Linq; +using Umbraco.Core; using Umbraco.Core.IO; using umbraco.BusinessLogic.Actions; using Umbraco.Web.Models.Trees; @@ -30,13 +31,26 @@ namespace Umbraco.Web.Trees if (id == Constants.System.Root.ToInvariantString()) { - + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); //refresh action menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); return menu; } + if (id.EndsWith(FileSearchPattern.TrimStart("*")) == false) + { + //set the default to create + menu.DefaultMenuAlias = ActionNew.Instance.Alias; + //create action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias))); + //refresh action + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); + } + // TODO: Wire up new delete dialog menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias))); return menu; diff --git a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs index 3b8bfd9385..8c7087939d 100644 --- a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs +++ b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -62,21 +62,21 @@ namespace Umbraco.Web.UI.JavaScript { /// /// Looks up a localized string similar to [ - /// 'lib/jquery/jquery-2.0.3.min.js', + /// 'lib/jquery/jquery.min.js', /// 'lib/angular/1.1.5/angular.min.js', - /// 'lib/underscore/underscore.js', + /// 'lib/underscore/underscore-min.js', /// - /// 'lib/jquery/jquery-ui-1.10.3.custom.min.js', + /// 'lib/jquery-ui/jquery-ui.min.js', + /// 'lib/jquery-ui-touch-punch/jquery.ui.touch-punch.js', /// /// 'lib/angular/1.1.5/angular-cookies.min.js', /// 'lib/angular/1.1.5/angular-mobile.js', /// 'lib/angular/1.1.5/angular-sanitize.min.js', /// /// 'lib/angular/angular-ui-sortable.js', - /// - /// 'lib/jquery/jquery.upload/js/jquery.fileupload.js', - /// 'lib/jquery/jquery.upload/js/load-image.min.js', - /// 'lib/jquery/jquery.upload/js/ [rest of string was truncated]";. + /// + /// 'lib/angular-dynamic-locale/tmhDynamicLocale.min.js', + /// 'lib/ng-file-upload/ng-file-upload.min. [rest of string was truncated]";. /// internal static string JsInitialize { get { @@ -90,7 +90,9 @@ namespace Umbraco.Web.UI.JavaScript { /// UmbClientMgr.setUmbracoPath('"##UmbracoPath##"'); /// /// jQuery(document).ready(function () { + /// /// angular.bootstrap(document, ['umbraco']); + /// /// }); ///});. /// diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 826924a731..a3784ced4e 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1,5 +1,5 @@  - + 9.0.30729 @@ -36,7 +36,7 @@ 4.0 - v4.5 + v4.6.2 ..\ true @@ -159,15 +159,14 @@ ..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\Owin.1.0\lib\net40\Owin.dll - - ..\packages\semver.1.1.2\lib\net45\Semver.dll + + ..\packages\Semver.2.0.4\lib\net452\Semver.dll System @@ -338,6 +337,7 @@ + diff --git a/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs b/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs index ad6323da86..5e753fa7f8 100644 --- a/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs +++ b/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.34003. +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. // #pragma warning disable 1591 @@ -23,7 +23,7 @@ namespace Umbraco.Web.org.umbraco.our { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="RepositorySoap", Namespace="http://packages.umbraco.org/webservices/")] @@ -480,7 +480,7 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -549,7 +549,7 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -738,7 +738,7 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1586.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://packages.umbraco.org/webservices/")] public enum SubmitStatus { @@ -757,11 +757,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void CategoriesCompletedEventHandler(object sender, CategoriesCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CategoriesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -783,11 +783,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void ModulesCompletedEventHandler(object sender, ModulesCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ModulesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -809,11 +809,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void ModulesCategorizedCompletedEventHandler(object sender, ModulesCategorizedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ModulesCategorizedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -835,11 +835,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void NitrosCompletedEventHandler(object sender, NitrosCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class NitrosCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -861,11 +861,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void NitrosCategorizedCompletedEventHandler(object sender, NitrosCategorizedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class NitrosCategorizedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -887,11 +887,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void authenticateCompletedEventHandler(object sender, authenticateCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class authenticateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -913,11 +913,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void fetchPackageCompletedEventHandler(object sender, fetchPackageCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -939,11 +939,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void fetchPackageByVersionCompletedEventHandler(object sender, fetchPackageByVersionCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchPackageByVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -965,11 +965,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void fetchProtectedPackageCompletedEventHandler(object sender, fetchProtectedPackageCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchProtectedPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -991,11 +991,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void SubmitPackageCompletedEventHandler(object sender, SubmitPackageCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SubmitPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -1017,11 +1017,11 @@ namespace Umbraco.Web.org.umbraco.our { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void PackageByGuidCompletedEventHandler(object sender, PackageByGuidCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.33440")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class PackageByGuidCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { diff --git a/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs b/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs index e68ae400f5..9e35deb713 100644 --- a/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs +++ b/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.18444. +// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. // #pragma warning disable 1591 @@ -23,7 +23,7 @@ namespace Umbraco.Web.org.umbraco.update { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="CheckForUpgradeSoap", Namespace="http://update.umbraco.org/")] @@ -180,7 +180,7 @@ namespace Umbraco.Web.org.umbraco.update { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -225,7 +225,7 @@ namespace Umbraco.Web.org.umbraco.update { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1586.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://update.umbraco.org/")] public enum UpgradeType { @@ -253,15 +253,15 @@ namespace Umbraco.Web.org.umbraco.update { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void InstallCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] public delegate void CheckUpgradeCompletedEventHandler(object sender, CheckUpgradeCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CheckUpgradeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { diff --git a/src/Umbraco.Web/app.config b/src/Umbraco.Web/app.config index 2b15194775..0e2734a4bb 100644 --- a/src/Umbraco.Web/app.config +++ b/src/Umbraco.Web/app.config @@ -41,7 +41,7 @@ - + @@ -69,4 +69,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Web/packages.config b/src/Umbraco.Web/packages.config index 21ef6804be..84e8a07098 100644 --- a/src/Umbraco.Web/packages.config +++ b/src/Umbraco.Web/packages.config @@ -24,9 +24,9 @@ - + - + diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs index 9aa180110b..3adaf973ca 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18034 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/UmbracoExamine/UmbracoExamine.csproj b/src/UmbracoExamine/UmbracoExamine.csproj index 34b99ddf9a..efa5eeed41 100644 --- a/src/UmbracoExamine/UmbracoExamine.csproj +++ b/src/UmbracoExamine/UmbracoExamine.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties UmbracoExamine UmbracoExamine - v4.5 + v4.6.2 512 diff --git a/src/UmbracoExamine/app.config b/src/UmbracoExamine/app.config index a0794caa99..c79842ade3 100644 --- a/src/UmbracoExamine/app.config +++ b/src/UmbracoExamine/app.config @@ -12,7 +12,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.MacroEngines/Resources/Strings.Designer.cs b/src/umbraco.MacroEngines/Resources/Strings.Designer.cs index 236db870a0..1acc353daf 100644 --- a/src/umbraco.MacroEngines/Resources/Strings.Designer.cs +++ b/src/umbraco.MacroEngines/Resources/Strings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/umbraco.MacroEngines/app.config b/src/umbraco.MacroEngines/app.config index cc98223bd1..6863fed4c8 100644 --- a/src/umbraco.MacroEngines/app.config +++ b/src/umbraco.MacroEngines/app.config @@ -4,7 +4,7 @@ - + @@ -44,4 +44,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.MacroEngines/packages.config b/src/umbraco.MacroEngines/packages.config index fdd7b5d593..bc7e6fe4c1 100644 --- a/src/umbraco.MacroEngines/packages.config +++ b/src/umbraco.MacroEngines/packages.config @@ -11,6 +11,6 @@ - + \ No newline at end of file diff --git a/src/umbraco.MacroEngines/umbraco.MacroEngines.csproj b/src/umbraco.MacroEngines/umbraco.MacroEngines.csproj index 8684da25af..bdc6f91e0b 100644 --- a/src/umbraco.MacroEngines/umbraco.MacroEngines.csproj +++ b/src/umbraco.MacroEngines/umbraco.MacroEngines.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties umbraco.MacroEngines umbraco.MacroEngines - v4.5 + v4.6.2 512 @@ -60,9 +60,8 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/umbraco.businesslogic/app.config b/src/umbraco.businesslogic/app.config index a0794caa99..c79842ade3 100644 --- a/src/umbraco.businesslogic/app.config +++ b/src/umbraco.businesslogic/app.config @@ -12,7 +12,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.businesslogic/umbraco.businesslogic.csproj b/src/umbraco.businesslogic/umbraco.businesslogic.csproj index 851a6a3c8c..e8b090e26f 100644 --- a/src/umbraco.businesslogic/umbraco.businesslogic.csproj +++ b/src/umbraco.businesslogic/umbraco.businesslogic.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -37,7 +37,7 @@ 3.5 true - v4.5 + v4.6.2 http://localhost/businesslogic/ true Web diff --git a/src/umbraco.cms/app.config b/src/umbraco.cms/app.config index a0794caa99..c79842ade3 100644 --- a/src/umbraco.cms/app.config +++ b/src/umbraco.cms/app.config @@ -12,7 +12,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs b/src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs index 81909bb6a5..0d0b9c03e2 100644 --- a/src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs +++ b/src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18034 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/umbraco.cms/packages.config b/src/umbraco.cms/packages.config index 46e6d733a1..400a4dea20 100644 --- a/src/umbraco.cms/packages.config +++ b/src/umbraco.cms/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 89c2db4032..aefb57e24a 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -36,7 +36,7 @@ 3.5 - v4.5 + v4.6.2 publish\ true Disk @@ -116,9 +116,8 @@ ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll System diff --git a/src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs b/src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs index 75268145d4..cf53229e77 100644 --- a/src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs +++ b/src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18034 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -62,16 +62,17 @@ namespace umbraco.uicontrols.TreePicker { /// /// Looks up a localized string similar to /// <reference path="/umbraco_client/Application/NamespaceManager.js" /> - /// - ///Umbraco.Sys.registerNamespace("Umbraco.Controls"); - /// - ///(function($) { - /// Umbraco.Controls.TreePicker = function(clientId, label, itemIdValueClientID, itemTitleClientID, itemPickerUrl, width, height, showHeader, umbracoPath) { - /// var obj = { - /// _itemPickerUrl: itemPickerUrl, - /// _webServiceUrl: umbracoPath + "/webservices/legacyAjaxCalls.asmx/GetNodeBreadcrumbs", - /// _label: label, - /// _wid [rest of string was truncated]";. + ///(function ($) { + /// $(document).ready(function () { + /// // Tooltip only Text + /// $('.umb-tree-picker a.choose').click(function () { + /// var that = this; + /// var s = $(that).data("section"); + /// UmbClientMgr.openAngularModalWindow({ + /// template: 'views/common/dialogs/treepicker.html', + /// section: s, + /// callback: function (data) { + /// //this [rest of string was truncated]";. /// internal static string BaseTreePicker { get { diff --git a/src/umbraco.controls/app.config b/src/umbraco.controls/app.config index a0794caa99..c79842ade3 100644 --- a/src/umbraco.controls/app.config +++ b/src/umbraco.controls/app.config @@ -12,7 +12,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.controls/umbraco.controls.csproj b/src/umbraco.controls/umbraco.controls.csproj index 9c2d016b93..3cff539619 100644 --- a/src/umbraco.controls/umbraco.controls.csproj +++ b/src/umbraco.controls/umbraco.controls.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -23,7 +23,7 @@ 3.5 - v4.5 + v4.6.2 publish\ true Disk diff --git a/src/umbraco.datalayer/app.config b/src/umbraco.datalayer/app.config index 1f5a6442ad..6d9f461c6f 100644 --- a/src/umbraco.datalayer/app.config +++ b/src/umbraco.datalayer/app.config @@ -4,7 +4,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.datalayer/packages.config b/src/umbraco.datalayer/packages.config index 7cabfc99ad..3537761ce9 100644 --- a/src/umbraco.datalayer/packages.config +++ b/src/umbraco.datalayer/packages.config @@ -1,6 +1,5 @@  - \ No newline at end of file diff --git a/src/umbraco.datalayer/umbraco.datalayer.csproj b/src/umbraco.datalayer/umbraco.datalayer.csproj index ab86b3532c..9452e2f39d 100644 --- a/src/umbraco.datalayer/umbraco.datalayer.csproj +++ b/src/umbraco.datalayer/umbraco.datalayer.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -23,7 +23,7 @@ 3.5 - v4.5 + v4.6.2 publish\ true Disk @@ -68,9 +68,6 @@ false - - ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll - ..\packages\Microsoft.ApplicationBlocks.Data.1.0.1559.20655\lib\Microsoft.ApplicationBlocks.Data.dll diff --git a/src/umbraco.editorControls/app.config b/src/umbraco.editorControls/app.config index 1d7a37c980..554506d233 100644 --- a/src/umbraco.editorControls/app.config +++ b/src/umbraco.editorControls/app.config @@ -16,7 +16,7 @@ - + @@ -53,4 +53,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs b/src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs index a7743a55be..30cc94f1de 100644 --- a/src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs +++ b/src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18034 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/umbraco.editorControls/umbraco.editorControls.csproj b/src/umbraco.editorControls/umbraco.editorControls.csproj index b837daf06e..56d7e7ea86 100644 --- a/src/umbraco.editorControls/umbraco.editorControls.csproj +++ b/src/umbraco.editorControls/umbraco.editorControls.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -37,7 +37,7 @@ 3.5 true - v4.5 + v4.6.2 http://localhost/umbraco.editorControls/ true Web diff --git a/src/umbraco.interfaces/umbraco.interfaces.csproj b/src/umbraco.interfaces/umbraco.interfaces.csproj index 28bd27603f..85070859f7 100644 --- a/src/umbraco.interfaces/umbraco.interfaces.csproj +++ b/src/umbraco.interfaces/umbraco.interfaces.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -36,7 +36,7 @@ 3.5 - v4.0 + v4.6.2 publish\ true Disk @@ -77,6 +77,7 @@ full prompt AllRules.ruleset + false bin\Release\ @@ -100,6 +101,7 @@ pdbonly prompt AllRules.ruleset + false diff --git a/src/umbraco.providers/app.config b/src/umbraco.providers/app.config index a0794caa99..c79842ade3 100644 --- a/src/umbraco.providers/app.config +++ b/src/umbraco.providers/app.config @@ -12,7 +12,7 @@ - + @@ -32,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/umbraco.providers/umbraco.providers.csproj b/src/umbraco.providers/umbraco.providers.csproj index 102e9098da..0e07ce6328 100644 --- a/src/umbraco.providers/umbraco.providers.csproj +++ b/src/umbraco.providers/umbraco.providers.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -23,7 +23,7 @@ 3.5 - v4.5 + v4.6.2 publish\ true Disk