Merge branch 'dev-v7' into 7.3.0

Conflicts:
	src/umbraco.cms/businesslogic/Dictionary.cs
This commit is contained in:
Shannon
2015-02-23 13:18:01 +01:00
14 changed files with 83 additions and 51 deletions

View File

@@ -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"

View File

@@ -137,6 +137,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) {
@@ -152,6 +178,7 @@ angular.module("umbraco.directives")
}
_toolbar.css("visibility", "hidden");
$('.umb-panel-body').off('scroll', pinToolbar);
});
});
@@ -159,17 +186,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);
});
});
@@ -177,17 +199,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);
});
});

View File

@@ -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) {

View File

@@ -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

View File

@@ -160,8 +160,7 @@
border-top: 1px solid @grayLighter;
padding: 10px 0 10px 0;
margin-bottom: 17px;
position: fixed;
bottom: 0px;
left: 100px;

View File

@@ -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';

View File

@@ -23,6 +23,7 @@
// -------------------------
@blue: #2e8aea;
@blueDark: #0064cd;
@blueLight: #add8e6;
@green: #46a546;
@red: #9d261d;
@yellow: #ffc40d;

View File

@@ -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){