diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js index 577ffe0176ef..4993b013c73a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js @@ -1,7 +1,7 @@ (function () { 'use strict'; - function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper, editorService) { + function MediaNodeInfoDirective($timeout, $location, eventsService, userService, dateHelper, editorService, mediaHelper) { function link(scope, element, attrs, ctrl) { @@ -28,6 +28,9 @@ // make sure dates are formatted to the user's locale formatDatesToLocal(); + + // set media file extension initially + setMediaExtension(); } function formatDatesToLocal() { @@ -49,6 +52,10 @@ } } + function setMediaExtension() { + scope.node.extension = mediaHelper.getFileExtension(scope.nodeUrl); + } + scope.openMediaType = function (mediaType) { var editor = { id: mediaType.id, @@ -62,6 +69,16 @@ editorService.mediaTypeEditor(editor); }; + scope.openSVG = function () { + var popup = window.open('', '_blank'); + var html = '' + + ''; + + popup.document.open(); + popup.document.write(html); + popup.document.close(); + } + // watch for content updates - reload content when node is saved, published etc. scope.$watch('node.updateDate', function(newValue, oldValue){ if(!newValue) { return; } @@ -72,6 +89,9 @@ // Update the create and update dates formatDatesToLocal(); + + //Update the media file format + setMediaExtension(); }); //ensure to unregister from all events! diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index f411437b1dd2..ee175c36f256 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -12,9 +12,15 @@