Removed registerFileResolver methods on image cropper and file upload property editors.
This commit is contained in:
@@ -41,37 +41,5 @@
|
||||
};
|
||||
|
||||
angular.module("umbraco")
|
||||
.controller('Umbraco.PropertyEditors.FileUploadController', fileUploadController)
|
||||
.run(function (mediaHelper, umbRequestHelper, assetsService) {
|
||||
if (mediaHelper && mediaHelper.registerFileResolver) {
|
||||
// NOTE: The 'entity' can be either a normal media entity or an "entity" returned from the entityResource
|
||||
// they contain different data structures so if we need to query against it we need to be aware of this.
|
||||
mediaHelper.registerFileResolver("Umbraco.UploadField", function (property, entity, thumbnail) {
|
||||
if (thumbnail) {
|
||||
if (mediaHelper.detectIfImageByExtension(property.value)) {
|
||||
|
||||
// Get default big thumbnail from image processor
|
||||
return mediaHelper.getProcessedImageUrl(property.value,
|
||||
{
|
||||
animationprocessmode: "first",
|
||||
cacheBusterValue: moment(entity.updateDate).format("YYYYMMDDHHmmss"),
|
||||
width: 500
|
||||
})
|
||||
.then(function (url) {
|
||||
return url;
|
||||
});
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return property.value;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
.controller('Umbraco.PropertyEditors.FileUploadController', fileUploadController);
|
||||
})();
|
||||
|
||||
@@ -214,55 +214,4 @@ angular.module('umbraco')
|
||||
$scope.$on('$destroy', function () {
|
||||
unsubscribe();
|
||||
});
|
||||
})
|
||||
.run(function (mediaHelper, umbRequestHelper) {
|
||||
if (mediaHelper && mediaHelper.registerFileResolver) {
|
||||
|
||||
//NOTE: The 'entity' can be either a normal media entity or an "entity" returned from the entityResource
|
||||
// they contain different data structures so if we need to query against it we need to be aware of this.
|
||||
mediaHelper.registerFileResolver("Umbraco.ImageCropper", function (property, entity, thumbnail) {
|
||||
if (property.value && property.value.src) {
|
||||
if (thumbnail === true) {
|
||||
return mediaHelper.getProcessedImageUrl(property.value.src,
|
||||
{
|
||||
animationprocessmode: "first",
|
||||
mode: "max",
|
||||
width: 500
|
||||
})
|
||||
.then(function (url) {
|
||||
return url;
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
return property.value.src;
|
||||
}
|
||||
|
||||
//this is a fallback in case the cropper has been asssigned a upload field
|
||||
}
|
||||
else if (angular.isString(property.value)) {
|
||||
if (thumbnail) {
|
||||
|
||||
if (mediaHelper.detectIfImageByExtension(property.value)) {
|
||||
|
||||
var thumbnailUrl = umbRequestHelper.getApiUrl(
|
||||
"imagesApiBaseUrl",
|
||||
"GetBigThumbnail",
|
||||
[{ originalImagePath: property.value }]);
|
||||
|
||||
return thumbnailUrl;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
return property.value;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user