diff --git a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.css b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.css index 1523e55..700b47a 100644 --- a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.css +++ b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.css @@ -20,7 +20,7 @@ .unesting-items { - margin-top: -15px; + /*margin-top: -15px;*/ } /*.unesting-item .unesting-items { @@ -37,13 +37,30 @@ position: relative; } +.unesting-item.is-hidden .unesting-item-header .unesting-icons > .hidden-toggle +{ + opacity: 1; + color: #d42054; +} + +.unesting-item.is-hidden .unesting-item-header-content, +.unesting-item.is-hidden .unesting-item-header-inner > i +{ + opacity: 0.4; +} + +.unesting-item.is-hidden .unesting-item-header-content-text +{ + display: none; +} + .unesting-item.is-active > .unesting-item-header:after, .unesting-item.is-active > .unesting-item-header:before { position: absolute; content: ' '; display: inline-block; - left: 5px; + left: 36px; bottom: -19px; border: 10px solid transparent; border-top-color: white; @@ -57,17 +74,22 @@ border-top-color: #e9e9eb; } -.unesting-item:last-child .unesting-item-header +.unesting-content .unesting-item.is-active > .unesting-item-header:after +{ + border-top-color: #faf8f8; +} + +/*.unesting-item:last-child .unesting-item-header { border-bottom: none; -} +}*/ .unesting-item-header-inner { line-height: 20px; position: relative; margin-top: 1px; - padding: 15px 5px; + padding: 20px 5px; color: #1b264f; border-radius: 3px 3px 0 0; border-bottom: none; @@ -76,14 +98,14 @@ /*.unesting-item:nth-child(2n+1) .unesting-item-header-inner { - background: #faf9f9; + background: #faf8f8; }*/ .unesting-item-header-inner > i { position: absolute; top: 50%; - margin-top: -13px; + margin-top: -12px; left: 3px; font-size: 1.4rem; z-index: 1; @@ -103,7 +125,7 @@ left: -46px; width: 46px; top: -16px; - background: #faf9f9; + background: #faf8f8; z-index: 0; bottom: -15px; } @@ -142,8 +164,6 @@ .unesting-icons { - opacity: 0; - transition: opacity .12s ease-in-out; position: absolute; right: 0; top: 50%; @@ -153,7 +173,13 @@ grid-gap: 8px; } -.unesting-item-header:hover .unesting-icons +.unesting-icons > * +{ + transition: opacity .12s ease-in-out; + opacity: 0; +} + +.unesting-item-header:hover .unesting-icons > * { opacity: 1; } @@ -173,6 +199,11 @@ transition: background 0.12s ease; } +.unesting-icon.is-negative:hover +{ + color: #d42054; +} + .unesting-icon:hover { background: #f6f4f4; @@ -231,18 +262,24 @@ .unesting-item.is-active > .unesting-content { - background: #faf9f9; - margin: 0 -20px; - border-left: none; + background: #faf8f8; + margin: 0 -20px 0 0; + border-left: 1px solid #e9e9eb; border-right: none; border-radius: 0; border-top: 1px solid #e9e9eb; } +.hidelabel .unesting-item.is-active > .unesting-content +{ + margin: 0 -20px; + border-left: none; +} + .unesting-content .unesting-item.is-active > .unesting-content { background: white; - margin: 0 -20px; + margin: 0 -20px 0 0; border-left: 1px solid #e9e9eb; } @@ -252,6 +289,19 @@ } +/* nested content in nested content */ + +.unesting-item .unesting-item .unesting-item-header-content.--has-icon +{ + border-left-color: #e9e9eb; +} + +.unesting-item .unesting-item .unesting-item-header +{ + border-bottom-color: #e9e9eb; +} + + /* media */ .unesting-media { @@ -330,6 +380,14 @@ } +/* settings */ + +.umb-property[unesting-property="uNestingHide"] +{ + display: none; +} + + /* data type overrides */ .unesting-item .umb-sortable-thumbnails li { @@ -347,4 +405,15 @@ .btn { font-size: 14px; +} + +.tabLink.active::before +{ + display: none; +} + +.tabLink:not(.active) +{ + background: rgba(255,255,255,0.5); + font-weight: 400; } \ No newline at end of file diff --git a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.editor.html b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.editor.html new file mode 100644 index 0000000..14a4066 --- /dev/null +++ b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.editor.html @@ -0,0 +1,13 @@ +
+
+ + + + + +
+ +

{{property.notSupportedMessage}}

+ +
+
\ No newline at end of file diff --git a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.html b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.html index ef08fef..69aab37 100644 --- a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.html +++ b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.html @@ -14,7 +14,7 @@
-
+
@@ -28,7 +28,7 @@
- -
diff --git a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.js b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.js index 2abfe28..cc3f981 100644 --- a/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.js +++ b/UmbracoPackages/App_Plugins/brothers.uNesting/uNesting.js @@ -14,6 +14,10 @@ angular.module('umbraco.services').config(['$httpProvider', function ($httpProvi { request.url = '/App_Plugins/brothers.uNesting/uNesting.doctypepicker.html'; } + else if (request.url.indexOf(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + "/views/propertyeditors/nestedcontent/nestedcontent.editor.html") === 0) + { + request.url = '/App_Plugins/brothers.uNesting/uNesting.editor.html'; + } return request || $q.when(request); } @@ -24,7 +28,7 @@ angular.module('umbraco.services').config(['$httpProvider', function ($httpProvi -angular.module("umbraco").controller("brothers.uNesting.DocTypePickerController", function ($scope) +angular.module("umbraco").controller("brothers.uNesting.DocTypePickerController", function ($scope, $controller) { angular.extend(this, $controller('Umbraco.PropertyEditors.NestedContent.DocTypePickerController', { $scope: $scope })); }); @@ -33,6 +37,20 @@ angular.module("umbraco").controller("brothers.uNesting.DocTypePickerController" angular.module("umbraco").controller("brothers.uNesting.PropertyEditorController", function ($scope, $controller, $http, $compile) { angular.extend(this, $controller('Umbraco.PropertyEditors.NestedContent.PropertyEditorController', { $scope: $scope })); + + $scope.clickHide = function ($event, node) + { + //syncCurrentNode(); + console.info(node); + $event.stopPropagation(); + //clipboardService.copy("elementType", node.contentTypeAlias, node); + //$event.stopPropagation(); + }; + + $scope.canHide = function (item) + { + return typeof item['uNestingHide'] !== 'undefined'; + }; }); diff --git a/UmbracoPackages/MediaExtendedController.cs b/UmbracoPackages/MediaExtendedController.cs new file mode 100644 index 0000000..2dfdd53 --- /dev/null +++ b/UmbracoPackages/MediaExtendedController.cs @@ -0,0 +1,52 @@ +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq; +using System.Web.Http; +using Umbraco.Core; +using Umbraco.Core.Cache; +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; +using Umbraco.Core.Persistence; +using Umbraco.Core.Services; +using Umbraco.Web; +using Umbraco.Web.Editors; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi.Filters; +using Constants = Umbraco.Core.Constants; + +namespace UmbracoPackages +{ + /// + /// This controller is decorated with the UmbracoApplicationAuthorizeAttribute which means that any user requesting + /// access to ALL of the methods on this controller will need access to the media application. + /// + [PluginController("UmbracoApi")] + [UmbracoApplicationAuthorize(Constants.Applications.Media)] + public class MediaExtendedController : ContentControllerBase + { + public MediaExtendedController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper) { } + + + /// + /// Return media for the specified UDIs + /// + /// + /// + public Dictionary GetByUdis([FromUri]Udi[] ids) + { + var foundMedia = Services.MediaService.GetByIds(ids.Select(x => (x as GuidUdi).Guid)); + return foundMedia.ToDictionary(media => (Udi)media.GetUdi(), media => + { + string json = media.GetValue("umbracoFile"); + return JsonConvert.DeserializeObject(json).Src; + }); + } + + + class SrcData + { + public string Src { get; set; } + } + } +} diff --git a/UmbracoPackages/UmbracoPackages.csproj b/UmbracoPackages/UmbracoPackages.csproj index 3bf90ef..31dfd2a 100644 --- a/UmbracoPackages/UmbracoPackages.csproj +++ b/UmbracoPackages/UmbracoPackages.csproj @@ -395,10 +395,10 @@ - - + + @@ -470,6 +470,7 @@ + @@ -490,7 +491,6 @@ - diff --git a/UmbracoPackages/config/ClientDependency.config b/UmbracoPackages/config/ClientDependency.config index aea78e9..7e8c306 100644 --- a/UmbracoPackages/config/ClientDependency.config +++ b/UmbracoPackages/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - +