From 505b5410405bee415ea57cc9abf3e3a94f551e6c Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 16 Aug 2019 15:39:46 +1000 Subject: [PATCH 1/5] Removing the MiniProfiler routes if solution is not in debug mode. --- .../Profiling/WebProfilerProvider.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs index ffd1871ecc..e0dcfcf9b1 100644 --- a/src/Umbraco.Web/Profiling/WebProfilerProvider.cs +++ b/src/Umbraco.Web/Profiling/WebProfilerProvider.cs @@ -1,7 +1,10 @@ using System; +using System.Linq; using System.Threading; using System.Web; +using System.Web.Routing; using StackExchange.Profiling; +using Umbraco.Core.Configuration; namespace Umbraco.Web.Profiling { @@ -24,6 +27,20 @@ namespace Umbraco.Web.Profiling { // booting... _bootPhase = BootPhase.Boot; + + // Remove Mini Profiler routes when not in debug mode + if (GlobalSettings.DebugMode == false) + { + //NOTE: Keep the global fully qualified name, for some reason without it I was getting null refs + var prefix = global::StackExchange.Profiling.MiniProfiler.Settings.RouteBasePath.Replace("~/", string.Empty); + + using (RouteTable.Routes.GetWriteLock()) + { + var routes = RouteTable.Routes.Where(x => x is Route r && r.Url.StartsWith(prefix)).ToList(); + foreach(var r in routes) + RouteTable.Routes.Remove(r); + } + } } /// @@ -118,4 +135,4 @@ namespace Umbraco.Web.Profiling } } } -} \ No newline at end of file +} From 6e1314ae304a63b605ca62e87d74fdd3281eb1bb Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 16 Aug 2019 15:58:13 +1000 Subject: [PATCH 2/5] Removing legacy service --- .../umbraco/webservices/legacyAjaxCalls.asmx.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index 1929477181..a29e44a92b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -36,19 +36,7 @@ namespace umbraco.presentation.webservices public class legacyAjaxCalls : UmbracoAuthorizedWebService { private User _currentUser; - - [WebMethod] - public bool ValidateUser(string username, string password) - { - if (ValidateCredentials(username, password)) - { - var u = new BusinessLogic.User(username); - BasePage.doLogin(u); - return true; - } - return false; - } - + /// /// method to accept a string value for the node id. Used for tree's such as python /// and xslt since the file names are the node IDs From 6f83d3c865198b2b2c979102f51655c9bc3879ee Mon Sep 17 00:00:00 2001 From: elitsa Date: Fri, 16 Aug 2019 13:34:25 +0200 Subject: [PATCH 3/5] Add special checks and preview for svg files media files. (cherry picked from commit defcb727f94301faa0b08496f88852bf75657791) --- .../media/umbmedianodeinfo.directive.js | 35 +++++++++++++++---- .../components/media/umb-media-node-info.html | 10 ++++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js index efdeceb78f..677dccf3bb 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js @@ -1,25 +1,29 @@ (function () { 'use strict'; - function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper) { + function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper, mediaHelper) { function link(scope, element, attrs, ctrl) { var evts = []; - + function onInit() { // If logged in user has access to the settings section // show the open anchors - if the user doesn't have // access, contentType is null, see MediaModelMapper scope.allowOpen = scope.node.contentType !== null; - + // get document type details scope.mediaType = scope.node.contentType; // set the media link initially setMediaLink(); + // make sure dates are formatted to the user's locale formatDatesToLocal(); + + // set media file extension initially + setMediaExtension(); } function formatDatesToLocal() { @@ -30,26 +34,43 @@ }); } - function setMediaLink(){ + function setMediaLink() { scope.nodeUrl = scope.node.mediaLink; } + function setMediaExtension() { + scope.node.extension = mediaHelper.getFileExtension(scope.nodeUrl); + } + scope.openMediaType = function (mediaType) { // remove first "#" from url if it is prefixed else the path won't work var url = "/settings/mediaTypes/edit/" + mediaType.id; $location.path(url); }; + scope.openSVG = function () { + var popup = window.open('', '_blank'); + var html = '' + + ''; + + popup.document.open(); + popup.document.write(html); + popup.document.close(); + } + // watch for content updates - reload content when node is saved, published etc. - scope.$watch('node.updateDate', function(newValue, oldValue){ - if(!newValue) { return; } - if(newValue === oldValue) { return; } + scope.$watch('node.updateDate', function (newValue, oldValue) { + if (!newValue) { return; } + if (newValue === oldValue) { return; } // Update the media link setMediaLink(); // Update the create and update dates formatDatesToLocal(); + + //Update the media file format + setMediaExtension(); }); //ensure to unregister from all events! diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index 7cfcb835a5..5ee68e5cff 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -12,9 +12,15 @@ From 2cc5256c00da40af6afe84ad5d1fc2517cef86a7 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Sat, 17 Aug 2019 23:54:49 +0200 Subject: [PATCH 4/5] Fixed typo in "ng-container" (cherry picked from commit 7a7adfb61fd6e008fd5a0b402d90ea983d1001a1) --- .../src/views/components/media/umb-media-node-info.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index 5ee68e5cff..3f71ae2d18 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -12,12 +12,12 @@