From fe40288514ca8da6d8027e1d5deeecdabb27f6ff Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:02:59 +0100 Subject: [PATCH 1/6] fixes dublicate hotkey in legacy editors --- .../lib/umbraco/compat.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js b/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js index 2a166c8a1a..3cc91174e8 100644 --- a/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js +++ b/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js @@ -31,8 +31,7 @@ $.ctrl("S", function(){ var link = $(".umb-panel-header .btn-primary"); - var b = link.click(); - + //this is made of bad, to work around webforms horrible wiring if(!link.hasClass("client-side") && link.attr("href").indexOf("javascript:") == 0){ eval(link.attr('href').replace('javascript:','')); @@ -59,23 +58,26 @@ $.ctrl = function(key, callback, args) { var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; var isCtrl = false; + $(document).keydown(function(e) { if(!args) args=[]; // IE barks when args is null var modKey = isMac ? e.metaKey : e.ctrlKey; - if(modKey){ - isCtrl = true; - } + //if(modKey){ + // isCtrl = true; + //} - if(isCtrl && e.keyCode == key.charCodeAt(0)) { + if(modKey && e.keyCode == key.charCodeAt(0)) { callback.apply(this, args); return false; } - }).keyup(function(e) { + }); + + /*.keyup(function(e) { var modKey = isMac ? e.metaKey : e.ctrlKey; if(modKey){ isCtrl = false; } - }); + }); */ }; })(jQuery); \ No newline at end of file From 0ab2b740040a7bd91e6a489123e00f0263076dad Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:03:19 +0100 Subject: [PATCH 2/6] fixes missing legacy icons in IE --- .../src/common/directives/umbtreeitem.directive.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js index d86e26d2b6..d5e59cfd35 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js @@ -33,10 +33,10 @@ angular.module("umbraco.directives") }, template: '
  • ' + - '' + + '' + '' + - '' + - '{{node.name}}' + + '' + + '{{node.name}}' + '' + '
    ' + '
    ' + @@ -167,6 +167,10 @@ angular.module("umbraco.directives") scope.expandActivePath(scope.node, scope.activetree, scope.path); scope.node.stateCssClass = (scope.node.cssClasses || []).join(" "); + if(scope.node.style){ + $(element).find("i").attr("style", scope.node.style); + } + var template = '
    '; var newElement = angular.element(template); $compile(newElement)(scope); From f03e9ecebec8e94b8dca3e3ad5185e4118a5960f Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:03:34 +0100 Subject: [PATCH 3/6] adds check to dialog swiping --- .../src/common/services/dialog.service.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js index 6d584763dc..4c918da849 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js @@ -66,7 +66,7 @@ angular.module('umbraco.services') var scope = options.scope || $rootScope.$new(); //Modal dom obj and unique id - dialog.element = $('
    '); + dialog.element = $('
    '); var id = dialog.template.replace('.html', '').replace('.aspx', '').replace(/[\/|\.|:\&\?\=]/g, "-") + '-' + scope.$id; if (options.inline) { @@ -158,6 +158,15 @@ angular.module('umbraco.services') dialog.element.modal(name); }; + scope.swipeHide = function(e){ + if($rootScope.touchDevice){ + var selection = window.getSelection(); + if(selection.type !== "Range"){ + scope.hide(); + } + } + }; + scope.hide = function() { dialog.element.modal('hide'); From bfa325163dbc681f9a9c18637db6afd077958d1e Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:03:59 +0100 Subject: [PATCH 4/6] adds fall-back icon to content types --- .../src/common/services/util.service.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js index 839411a90b..7f1d483223 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js @@ -454,10 +454,10 @@ function iconHelper($q) { /** Used by the create dialogs for content/media types to format the data so that the thumbnails are styled properly */ formatContentTypeThumbnails: function (contentTypes) { for (var i = 0; i < contentTypes.length; i++) { + if (contentTypes[i].thumbnailIsClass === undefined || contentTypes[i].thumbnailIsClass) { contentTypes[i].cssClass = this.convertFromLegacyIcon(contentTypes[i].thumbnail); - } - else { + }else { contentTypes[i].style = "background-image: url('" + contentTypes[i].thumbnailFilePath + "');height:36px; background-position:4px 0px; background-repeat: no-repeat;background-size: 35px 35px;"; //we need an 'icon-' class in there for certain styles to work so if it is image based we'll add this contentTypes[i].cssClass = "custom-file"; @@ -468,6 +468,11 @@ function iconHelper($q) { formatContentTypeIcons: function (contentTypes) { for (var i = 0; i < contentTypes.length; i++) { contentTypes[i].icon = this.convertFromLegacyIcon(contentTypes[i].icon); + + //couldnt find replacement + if(contentTypes[i].icon.indexOf(".") > 0){ + contentTypes[i].icon = "icon-document-dashed-line"; + } } return contentTypes; }, From 289caa791a0fb84d1241676394f932699abd451f Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:04:40 +0100 Subject: [PATCH 5/6] moves touch device prop to rootscope --- .../src/views/common/main.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js index 9141369783..1adef8072f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/main.controller.js @@ -8,14 +8,14 @@ * The main application controller * */ -function MainController($scope, $location, $routeParams, $rootScope, $timeout, $http, $log, notificationsService, userService, navigationService, legacyJsLoader, updateChecker) { +function MainController($scope, $rootScope, $location, $routeParams, $rootScope, $timeout, $http, $log, notificationsService, userService, navigationService, legacyJsLoader, updateChecker) { var legacyTreeJsLoaded = false; //detect if the current device is touch-enabled //todo, move this out of the controller - $scope.touchDevice = ("ontouchstart" in window || window.touch || window.navigator.msMaxTouchPoints===5 || window.DocumentTouch && document instanceof DocumentTouch); - navigationService.touchDevice = $scope.touchDevice; + $rootScope.touchDevice = ("ontouchstart" in window || window.touch || window.navigator.msMaxTouchPoints===5 || window.DocumentTouch && document instanceof DocumentTouch); + navigationService.touchDevice = $rootScope.touchDevice; //the null is important because we do an explicit bool check on this in the view //the avatar is by default the umbraco logo From cad0f8bb2aa6ea2816ab323b618378ac22e57d55 Mon Sep 17 00:00:00 2001 From: perploug Date: Tue, 12 Nov 2013 10:05:26 +0100 Subject: [PATCH 6/6] WIP on photo folderresiizng on IE --- .../common/directives/html/umbphotofolder.directive.js | 9 +++++---- src/Umbraco.Web.UI.Client/src/less/property-editors.less | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/html/umbphotofolder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/html/umbphotofolder.directive.js index 49cea5dbf5..83d30e7c3c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/html/umbphotofolder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/html/umbphotofolder.directive.js @@ -103,18 +103,19 @@ angular.module("umbraco.directives.html") // if total width is slightly smaller than // actual div width then add 1 to each // photo width till they match - i = 0; - while (tw < w) { + + /*i = 0; + while (tw < w-1) { row.photos[i].style.width++; i = (i + 1) % c; tw++; - } + }*/ // if total width is slightly bigger than // actual div width then subtract 1 from each // photo width till they match i = 0; - while (tw > w) { + while (tw > w-1) { row.photos[i].style.width--; i = (i + 1) % c; tw--; diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 9e4d0b267a..d79fa5a1fc 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -200,7 +200,7 @@ ul.color-picker li a { // -------------------------------------------------- .umb-photo-folder .picrow{ - width: 100%; + overflow-y: hidden; } .umb-photo-folder .picrow a, .umb-photo-preview{