From 03969fd687c79af8d5935e5da7f269a6e34984f2 Mon Sep 17 00:00:00 2001 From: Vilen Tambovtsev Date: Fri, 13 Feb 2015 12:21:16 +0300 Subject: [PATCH 01/11] Fix dictionary key access Looks like someone does not know how to use a dictionary --- src/umbraco.cms/businesslogic/Dictionary.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/umbraco.cms/businesslogic/Dictionary.cs b/src/umbraco.cms/businesslogic/Dictionary.cs index cd32162fa7..872c8e0e92 100644 --- a/src/umbraco.cms/businesslogic/Dictionary.cs +++ b/src/umbraco.cms/businesslogic/Dictionary.cs @@ -93,7 +93,6 @@ namespace umbraco.cms.businesslogic /// public class DictionaryItem { - private string _key; internal Guid UniqueId { get; private set; } @@ -118,13 +117,12 @@ namespace umbraco.cms.businesslogic { EnsureCache(); - var item = DictionaryItems.Values.SingleOrDefault(x => x.key == key); - - if (item == null) + if (!DictionaryItems.ContainsKey(key)) { throw new ArgumentException("No key " + key + " exists in dictionary"); } + var item = DictionaryItems[key]; this.id = item.id; this._key = item.key; this.ParentId = item.ParentId; From ee78e3815b558ef6fe5f0092f6f39d7249e05bd5 Mon Sep 17 00:00:00 2001 From: AussieInSeattle Date: Tue, 17 Feb 2015 19:32:25 -0800 Subject: [PATCH 02/11] U4-6288 Changes --- .../directives/grid/grid.rte.directive.js | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js index fd617a497e..69f549885a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js @@ -134,6 +134,32 @@ angular.module("umbraco.directives") }, 400); }); + + // pin toolbar to top of screen if we have focus and it scrolls off the screen + var pinToolbar = function () { + + var _toolbar = $(editor.editorContainer).find(".mce-toolbar"); + var toolbarHeight = _toolbar.height(); + + var _tinyMce = $(editor.editorContainer); + var tinyMceRect = _tinyMce[0].getBoundingClientRect(); + var tinyMceTop = tinyMceRect.top; + var tinyMceBottom = tinyMceRect.bottom; + + if (tinyMceTop < 100 && (tinyMceBottom > (100 + toolbarHeight))) { + _toolbar + .css("visibility", "visible") + .css("position", "fixed") + .css("top", "100px") + .css("margin-top", "0"); + } else { + _toolbar + .css("visibility", "visible") + .css("position", "absolute") + .css("top", "auto") + .css("margin-top", (-toolbarHeight - 2) + "px"); + } + }; //when we leave the editor (maybe) editor.on('blur', function (e) { @@ -149,6 +175,7 @@ angular.module("umbraco.directives") } _toolbar.css("visibility", "hidden"); + $('.umb-panel-body').off('scroll', pinToolbar); }); }); @@ -156,17 +183,12 @@ angular.module("umbraco.directives") editor.on('focus', function (e) { angularHelper.safeApply(scope, function () { - var _toolbar = $(editor.editorContainer) - .find(".mce-toolbar"); - if(scope.onFocus){ scope.onFocus(); } - var toolbarHeight = -_toolbar.height() - 2; - _toolbar - .css("visibility", "visible") - .css("margin-top", toolbarHeight + "px"); + pinToolbar(); + $('.umb-panel-body').on('scroll', pinToolbar); }); }); @@ -174,17 +196,12 @@ angular.module("umbraco.directives") editor.on('click', function (e) { angularHelper.safeApply(scope, function () { - var _toolbar = $(editor.editorContainer) - .find(".mce-toolbar"); - if(scope.onClick){ scope.onClick(); } - var toolbarHeight = -_toolbar.height() - 2; - _toolbar - .css("visibility", "visible") - .css("margin-top", toolbarHeight + "px"); + pinToolbar(); + $('.umb-panel-body').on('scroll', pinToolbar); }); }); From f94d280e2735c8294773f09c7eda0b69fd3c94f7 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 19 Feb 2015 09:23:07 +0100 Subject: [PATCH 03/11] Removes unnecessary dummy files. Some directories are old and not needed, plus they all get created on app startup anyway. --- build/Build.bat | 13 ------------- build/NuSpecs/UmbracoCms.nuspec | 10 ++-------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/build/Build.bat b/build/Build.bat index 7e6e418b26..0b30dc6a2e 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -47,19 +47,6 @@ ECHO Performing MSBuild and producing Umbraco binaries zip files ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project attrib +h ..\src\Umbraco.Web.UI.Client\node_modules -ECHO Adding dummy files to include in the NuGet package so that empty folders actually get created -SET dummytext=This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. -ECHO %dummytext% > .\_BuildOutput\WebApp\App_Code\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\App_Data\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\App_Plugins\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\css\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\masterpages\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\media\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\scripts\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\usercontrols\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\Views\Partials\dummy.txt -ECHO %dummytext% > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt - ECHO Adding Web.config transform files to the NuGet package REN .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index a184b79d5d..1c035a4ffc 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -20,14 +20,8 @@ - - - - - - + - @@ -35,7 +29,7 @@ - + From b724a185b7f0c12902fc391c0ec1158033bdb94d Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 19 Feb 2015 09:37:56 +0100 Subject: [PATCH 04/11] Pushes the ascii art down one line as it looked a bit weird because the cursor is on the first line by default after installing --- build/NuSpecs/tools/Readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/build/NuSpecs/tools/Readme.txt b/build/NuSpecs/tools/Readme.txt index d5121fe521..f020e1b70d 100644 --- a/build/NuSpecs/tools/Readme.txt +++ b/build/NuSpecs/tools/Readme.txt @@ -1,3 +1,4 @@ + _ _ __ __ ____ _____ _____ ____ | | | | \/ | _ \| __ \ /\ / ____/ __ \ | | | | \ / | |_) | |__) | / \ | | | | | | From c96b866f1d77d1aaccb96d8e6d08654263bbc590 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Feb 2015 10:35:06 +0100 Subject: [PATCH 05/11] Fixes bower config for jquery --- src/Umbraco.Web.UI.Client/bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/bower.json b/src/Umbraco.Web.UI.Client/bower.json index 19e458cdbf..4f7a01e20e 100644 --- a/src/Umbraco.Web.UI.Client/bower.json +++ b/src/Umbraco.Web.UI.Client/bower.json @@ -34,7 +34,7 @@ "": "underscore-min.{js,map}" }, "jquery": { - "": "dist/jquery.min.{js,map}" + "": "jquery.min.{js,map}" }, "jquery-file-upload": { "": "**/jquery.{fileupload,fileupload-process,fileupload-angular,fileupload-image}.js" From b73c7fbb16b60ca8999e35430a546faeaf27427c Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Feb 2015 11:34:43 +0100 Subject: [PATCH 06/11] Fixes: U4-6284 UmbracoCms.7.2.2-build.26 - missing feedback when file is too large --- .../imaging/umbimagefolder.directive.js | 34 ++++++++++++++----- .../services/umbrequesthelper.service.js | 10 ++++-- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/imaging/umbimagefolder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/imaging/umbimagefolder.directive.js index baf533fa4c..10f4663588 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/imaging/umbimagefolder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/imaging/umbimagefolder.directive.js @@ -4,7 +4,7 @@ * @restrict E * @function **/ -function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHelper, mediaResource, imageHelper) { +function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHelper, mediaResource, imageHelper, notificationsService) { return { restrict: 'E', replace: true, @@ -53,10 +53,9 @@ function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHel scope.images = data.items; }); } - - //when one is finished - scope.$on('fileuploaddone', function(e, data) { - scope.$apply(function() { + + function checkComplete(e, data) { + scope.$apply(function () { //remove the amount of files complete //NOTE: function is here instead of in the loop otherwise jshint blows up function findFile(file) { return file === data.files[i]; } @@ -66,13 +65,13 @@ function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHel } //when none are left resync everything - var remaining = _.filter(scope.files, function(file) { return file.completed !== true; }); + var remaining = _.filter(scope.files, function (file) { return file.completed !== true; }); if (remaining.length === 0) { scope.progress = 100; //just the ui transition isn't too abrupt, just wait a little here - $timeout(function() { + $timeout(function () { scope.progress = 0; scope.files = []; scope.uploading = false; @@ -88,7 +87,11 @@ function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHel } }); - + } + + //when one is finished + scope.$on('fileuploaddone', function(e, data) { + checkComplete(e, data); }); //This handler gives us access to the file 'preview', this is the only handler that makes this available for whatever reason @@ -100,6 +103,21 @@ function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHel }); }); + //This is a bit of a hack to check for server errors, currently if there's a non + //known server error we will tell them to check the logs, otherwise we'll specifically + //check for the file size error which can only be done with dodgy string checking + scope.$on('fileuploadfail', function (e, data) { + if (data.jqXHR.status === 500 && data.jqXHR.responseText.indexOf("Maximum request length exceeded") >= 0) { + notificationsService.error(data.errorThrown, "The image file size was too big, check with your site administrator to adjust the maximum size allowed"); + + } + else { + notificationsService.error(data.errorThrown, data.jqXHR.statusText); + } + + checkComplete(e, data); + }); + //This executes prior to the whole processing which we can use to get the UI going faster, //this also gives us the start callback to invoke to kick of the whole thing scope.$on('fileuploadadd', function(e, data) { diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js index 48254d0292..382c80c3e2 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js @@ -221,8 +221,14 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ //when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled. if (status >= 500 && status < 600) { - //show a ysod dialog - if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) { + //This is a bit of a hack to check if the error is due to a file being uploaded that is too large, + // we have to just check for the existence of a string value but currently that is the best way to + // do this since it's very hacky/difficult to catch this on the server + if (data.indexOf("Maximum request length exceeded") >= 0) { + notificationsService.error("Server error", "The image file size was too big, check with your site administrator to adjust the maximum size allowed"); + } + else if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) { + //show a ysod dialog dialogService.ysodDialog({ errorMsg: 'An error occurred', data: data From 20ceceffe0312b50bd0ad4b3a0fb7f197527ebea Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Feb 2015 11:43:08 +0100 Subject: [PATCH 07/11] Fixes: U4-5932 Grid editor has JS errors --- .../src/views/propertyeditors/grid/grid.controller.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js index e4cb4e380d..f802173a25 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js @@ -509,8 +509,11 @@ angular.module("umbraco") if(area.grid > 0){ var currentArea = row.areas[areaIndex]; - area.config = currentArea.config; - area.styles = currentArea.styles; + + if (currentArea) { + area.config = currentArea.config; + area.styles = currentArea.styles; + } //copy over existing controls into the new areas if(row.areas.length > areaIndex && row.areas[areaIndex].controls){ From 5f10ed99aaaccbe8d62f277cea9f6b04443ded04 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 19 Feb 2015 14:14:30 +0100 Subject: [PATCH 08/11] Revert "U4-4565 Add margin to bottom bar" This reverts commit c1cc8a3824c598a3356f4687c0ff516d3a863825. --- src/Umbraco.Web.UI.Client/src/less/panel.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index d9766e6f67..7fc2d061ea 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -160,8 +160,7 @@ border-top: 1px solid @grayLighter; padding: 10px 0 10px 0; - - margin-bottom: 17px; + position: fixed; bottom: 0px; left: 100px; From 2da3ec27dbbf13b261de75386a77519cc76ae41e Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Feb 2015 14:55:00 +0100 Subject: [PATCH 09/11] fixes punycode reference --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index f3308bac7f..b9af07a7bb 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -885,6 +885,7 @@ + From d54e09c40b00ebb6edf578ed75cc4e7c9614f8b8 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 20 Feb 2015 09:12:30 +0100 Subject: [PATCH 10/11] fixes jjj - no idea what happened there --- .../umbraco.presentation/umbraco/Trees/loadPackager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index 534b952cdd..5df6cc6f2a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -93,7 +93,7 @@ namespace umbraco /// The tree. public override void Render(ref XmlTree tree) { - string[,] items = { { "BrowseRepository.aspx", "Install from repository" }, { "CreatePackage.aspx", "Createdjjj Packages" }, { "installedPackages.aspx", "Installedjj packages" }, { "StarterKits.aspx", "Starter kit" }, { "installer.aspx", "Install local package" } }; + string[,] items = { { "BrowseRepository.aspx", "Install from repository" }, { "CreatePackage.aspx", "Created Packages" }, { "installedPackages.aspx", "Installed packages" }, { "StarterKits.aspx", "Starter kit" }, { "installer.aspx", "Install local package" } }; for (int i = 0; i <= items.GetUpperBound(0); i++) From 9a89b6048ab9715d9c2ad1f93586a59e82f48f9e Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 20 Feb 2015 09:43:21 +0100 Subject: [PATCH 11/11] Merge branch '7.2.0_U4-5236' of https://github.com/bjarnef/Umbraco-CMS into bjarnef-7.2.0_U4-5236 Conflicts: src/Umbraco.Web.UI.Client/src/less/tree.less --- src/Umbraco.Web.UI.Client/src/less/tree.less | 4 ++++ src/Umbraco.Web.UI.Client/src/less/variables.less | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less index f6de10a0c6..b26778ef26 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tree.less +++ b/src/Umbraco.Web.UI.Client/src/less/tree.less @@ -266,6 +266,10 @@ div.not-allowed > i.icon,div.not-allowed > a{ cursor: not-allowed; } +// override small icon color +.umb-tree li.current > div:before { + color: @blueLight; +} div.is-container:before{ content:"\e04e"; font-family: 'icomoon'; diff --git a/src/Umbraco.Web.UI.Client/src/less/variables.less b/src/Umbraco.Web.UI.Client/src/less/variables.less index 47b10a79b7..ec73e62c0c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/variables.less +++ b/src/Umbraco.Web.UI.Client/src/less/variables.less @@ -23,6 +23,7 @@ // ------------------------- @blue: #2e8aea; @blueDark: #0064cd; +@blueLight: #add8e6; @green: #46a546; @red: #9d261d; @yellow: #ffc40d;