Merge branch temp8 into temp8-di2690
This commit is contained in:
@@ -242,7 +242,6 @@ namespace Umbraco.Core
|
||||
|
||||
#region SetValue for setting file contents
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the posted file value of a property.
|
||||
/// </summary>
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
// default role is single server, but if registrations contain more
|
||||
// than one active server, then role is master or slave
|
||||
_currentServerRole = regs.Count(x => x.IsActive) > 1
|
||||
? (server.IsMaster ? ServerRole.Master : ServerRole.Slave)
|
||||
? (server.IsMaster ? ServerRole.Master : ServerRole.Replica)
|
||||
: ServerRole.Single;
|
||||
|
||||
scope.Complete();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/// <summary>
|
||||
/// In a multi-servers environment, the server is a slave server.
|
||||
/// </summary>
|
||||
Slave = 2,
|
||||
Replica = 2,
|
||||
|
||||
/// <summary>
|
||||
/// In a multi-servers environment, the server is the master server.
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Moq;
|
||||
using Umbraco.Core;
|
||||
using NUnit.Framework;
|
||||
@@ -129,30 +127,6 @@ namespace Umbraco.Tests.Models
|
||||
Assert.That(content.Properties["title"].GetValue(), Is.EqualTo("This is the new title"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Set_Property_Value_As_HttpPostedFileBase()
|
||||
{
|
||||
// Arrange
|
||||
var contentType = MockedContentTypes.CreateTextpageContentType();
|
||||
var content = MockedContent.CreateTextpageContent(contentType, "Textpage", -1);
|
||||
|
||||
var stream = new MemoryStream(System.Text.Encoding.Default.GetBytes("TestContent"));
|
||||
var postedFileMock = new Mock<HttpPostedFileBase>();
|
||||
postedFileMock.Setup(x => x.ContentLength).Returns(Convert.ToInt32(stream.Length));
|
||||
postedFileMock.Setup(x => x.ContentType).Returns("text/plain");
|
||||
postedFileMock.Setup(x => x.FileName).Returns("sample.txt");
|
||||
postedFileMock.Setup(x => x.InputStream).Returns(stream);
|
||||
|
||||
// Assert
|
||||
content.SetValue("title", postedFileMock.Object);
|
||||
|
||||
// Assert
|
||||
Assert.That(content.Properties.Any(), Is.True);
|
||||
Assert.That(content.Properties["title"], Is.Not.Null);
|
||||
Assert.IsTrue(content.Properties["title"].GetValue().ToString().Contains("sample.txt"));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void Can_Clone_Content_With_Reset_Identity()
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ var targets = {
|
||||
|
||||
// Build - build the files ready for production
|
||||
gulp.task('build', function(cb) {
|
||||
runSequence(["dependencies", "js", "less", "views"], "test:unit", cb);
|
||||
runSequence(["dependencies", "js", "less", "views"], cb);
|
||||
});
|
||||
|
||||
// Dev - build the files ready for development and start watchers
|
||||
|
||||
+2187
-2187
File diff suppressed because it is too large
Load Diff
+4
-8
@@ -1,10 +1,10 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function ContentEditController($rootScope, $scope, $routeParams, $q, $timeout, $window, $location,
|
||||
appState, contentResource, entityResource, navigationService, notificationsService, angularHelper,
|
||||
serverValidationManager, contentEditingHelper, treeService, fileManager, formHelper, umbRequestHelper,
|
||||
keyboardService, umbModelMapper, editorState, $http, eventsService, relationResource, overlayService, localizationService) {
|
||||
function ContentEditController($rootScope, $scope, $routeParams, $q, $window,
|
||||
appState, contentResource, entityResource, navigationService, notificationsService,
|
||||
serverValidationManager, contentEditingHelper, treeService, formHelper, umbRequestHelper,
|
||||
editorState, $http, eventsService, relationResource, overlayService) {
|
||||
|
||||
var evts = [];
|
||||
var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode;
|
||||
@@ -46,10 +46,6 @@
|
||||
}
|
||||
|
||||
bindEvents();
|
||||
|
||||
// set first app to active
|
||||
// We need to track active
|
||||
$scope.content.apps[0].active = true;
|
||||
|
||||
resetVariantFlags();
|
||||
}
|
||||
|
||||
+14
-6
@@ -12,9 +12,11 @@
|
||||
editor: "<",
|
||||
editorIndex: "<",
|
||||
editorCount: "<",
|
||||
openVariants: "<",
|
||||
onCloseSplitView: "&",
|
||||
onSelectVariant: "&",
|
||||
onOpenSplitView: "&"
|
||||
onOpenSplitView: "&",
|
||||
onSelectApp: "&"
|
||||
},
|
||||
controllerAs: 'vm',
|
||||
controller: umbVariantContentController
|
||||
@@ -31,7 +33,7 @@
|
||||
|
||||
vm.selectVariant = selectVariant;
|
||||
vm.openSplitView = openSplitView;
|
||||
vm.backToListView = backToListView;
|
||||
vm.selectApp = selectApp;
|
||||
|
||||
/** Called when the component has linked all elements, this is when the form controller is available */
|
||||
function postLink() {
|
||||
@@ -50,10 +52,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function backToListView() {
|
||||
$location.path(vm.page.listViewPath);
|
||||
};
|
||||
|
||||
/**
|
||||
* Used to proxy a callback
|
||||
* @param {any} variant
|
||||
@@ -64,6 +62,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to proxy a callback
|
||||
* @param {any} item
|
||||
*/
|
||||
function selectApp(item) {
|
||||
if(vm.onSelectApp) {
|
||||
vm.onSelectApp({"app": item});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to proxy a callback
|
||||
* @param {any} variant
|
||||
|
||||
+49
-9
@@ -15,11 +15,12 @@
|
||||
controller: umbVariantContentEditorsController
|
||||
};
|
||||
|
||||
function umbVariantContentEditorsController($scope, $element, $location, $timeout) {
|
||||
function umbVariantContentEditorsController($scope, $location, $timeout) {
|
||||
|
||||
var prevContentDateUpdated = null;
|
||||
|
||||
var vm = this;
|
||||
var activeAppAlias = null;
|
||||
|
||||
vm.$onInit = onInit;
|
||||
vm.$onChanges = onChanges;
|
||||
@@ -29,12 +30,17 @@
|
||||
vm.openSplitView = openSplitView;
|
||||
vm.closeSplitView = closeSplitView;
|
||||
vm.selectVariant = selectVariant;
|
||||
vm.selectApp = selectApp;
|
||||
|
||||
//Used to track how many content views there are (for split view there will be 2, it could support more in theory)
|
||||
vm.editors = [];
|
||||
//Used to track the open variants across the split views
|
||||
vm.openVariants = [];
|
||||
|
||||
/** Called when the component initializes */
|
||||
function onInit() {
|
||||
// set first app to active
|
||||
vm.content.apps[0].active = true;
|
||||
prevContentDateUpdated = angular.copy(vm.content.updateDate);
|
||||
setActiveCulture();
|
||||
}
|
||||
@@ -91,7 +97,7 @@
|
||||
activeVariant = vm.content.variants[0];
|
||||
}
|
||||
|
||||
insertVariantEditor(0, initVariant(activeVariant));
|
||||
insertVariantEditor(0, initVariant(activeVariant, 0));
|
||||
|
||||
if (vm.editors.length > 1) {
|
||||
//now re-sync any other editor content (i.e. if split view is open)
|
||||
@@ -100,7 +106,7 @@
|
||||
var variant = _.find(vm.content.variants, function (v) {
|
||||
return v.language.culture === vm.editors[s].content.language.culture;
|
||||
});
|
||||
vm.editors[s].content = initVariant(variant);
|
||||
vm.editors[s].content = initVariant(variant, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,12 +140,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function initVariant(variant) {
|
||||
function initVariant(variant, editorIndex) {
|
||||
//The model that is assigned to the editor contains the current content variant along
|
||||
//with a copy of the contentApps. This is required because each editor renders it's own
|
||||
//header and content apps section and the content apps contains the view for editing content itself
|
||||
//and we need to assign a view model to the subView so that it is scoped to the current
|
||||
//editor so that split views work.
|
||||
//editor so that split views work.
|
||||
|
||||
//copy the apps from the main model if not assigned yet to the variant
|
||||
if (!variant.apps) {
|
||||
@@ -180,6 +186,24 @@
|
||||
return a.alias === "content";
|
||||
});
|
||||
contentApp.viewModel = variant;
|
||||
|
||||
// keep track of the open variants across the different split views
|
||||
// push the first variant then update the variant index based on the editor index
|
||||
if(vm.openVariants && vm.openVariants.length === 0) {
|
||||
vm.openVariants.push(variant.language.culture);
|
||||
} else {
|
||||
vm.openVariants[editorIndex] = variant.language.culture;
|
||||
}
|
||||
|
||||
// make sure the same app it set to active in the new variant
|
||||
if(activeAppAlias) {
|
||||
angular.forEach(variant.apps, function(app) {
|
||||
app.active = false;
|
||||
if(app.alias === activeAppAlias) {
|
||||
app.active = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return variant;
|
||||
}
|
||||
@@ -211,7 +235,7 @@
|
||||
return v.language.culture === selectedCulture;
|
||||
});
|
||||
|
||||
insertVariantEditor(vm.editors.length, initVariant(variant));
|
||||
insertVariantEditor(vm.editors.length, initVariant(variant, vm.editors.length));
|
||||
|
||||
//TODO: hacking animation states - these should hopefully be easier to do when we upgrade angular
|
||||
editor.collapsed = true;
|
||||
@@ -231,6 +255,8 @@
|
||||
editor.collapsed = true;
|
||||
$timeout(function () {
|
||||
vm.editors.splice(editorIndex, 1);
|
||||
//remove variant from open variants
|
||||
vm.openVariants.splice(editorIndex, 1);
|
||||
splitViewChanged();
|
||||
}, 400);
|
||||
}
|
||||
@@ -241,8 +267,11 @@
|
||||
* @param {any} editorIndex The index of the editor being changed
|
||||
*/
|
||||
function selectVariant(variant, editorIndex) {
|
||||
|
||||
var variantCulture = variant.language ? variant.language.culture : "invariant";
|
||||
|
||||
// prevent variants already open in a split view to be opened
|
||||
if(vm.openVariants.indexOf(variant.language.culture) !== -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if the editor index is zero, then update the query string to track the lang selection, otherwise if it's part
|
||||
//of a 2nd split view editor then update the model directly.
|
||||
@@ -266,13 +295,24 @@
|
||||
function (v) {
|
||||
return v.language.culture === variant.language.culture;
|
||||
});
|
||||
editor.content = initVariant(contentVariant);
|
||||
editor.content = initVariant(contentVariant, editorIndex);
|
||||
|
||||
//update the editors collection
|
||||
insertVariantEditor(editorIndex, contentVariant);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the active app in a variable so we can remember it when changing language
|
||||
* @param {any} app This is the model of the selected app
|
||||
*/
|
||||
function selectApp(app) {
|
||||
if(app && app.alias) {
|
||||
activeAppAlias = app.alias;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').component('umbVariantContentEditors', umbVariantContentEditors);
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function EditorContentHeader($location, $routeParams) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
if (!scope.serverValidationNameField) {
|
||||
scope.serverValidationNameField = "Name";
|
||||
}
|
||||
if (!scope.serverValidationAliasField) {
|
||||
scope.serverValidationAliasField = "Alias";
|
||||
}
|
||||
|
||||
scope.vm = {};
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.vm.currentVariant = "";
|
||||
|
||||
function onInit() {
|
||||
setCurrentVariant();
|
||||
}
|
||||
|
||||
function setCurrentVariant() {
|
||||
angular.forEach(scope.variants, function (variant) {
|
||||
if (variant.active) {
|
||||
scope.vm.currentVariant = variant;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scope.goBack = function () {
|
||||
$location.path('/' + $routeParams.section + '/' + $routeParams.tree + '/' + $routeParams.method + '/' + scope.menu.currentNode.parentId);
|
||||
};
|
||||
|
||||
scope.selectVariant = function (event, variant) {
|
||||
|
||||
if (scope.onSelectVariant) {
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.onSelectVariant({ "variant": variant });
|
||||
}
|
||||
};
|
||||
|
||||
scope.selectNavigationItem = function(item) {
|
||||
if(scope.onSelectNavigationItem) {
|
||||
scope.onSelectNavigationItem({"item": item});
|
||||
}
|
||||
}
|
||||
|
||||
scope.closeSplitView = function () {
|
||||
if (scope.onCloseSplitView) {
|
||||
scope.onCloseSplitView();
|
||||
}
|
||||
};
|
||||
|
||||
scope.openInSplitView = function (event, variant) {
|
||||
if (scope.onOpenInSplitView) {
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.onOpenInSplitView({ "variant": variant });
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* keep track of open variants - this is used to prevent the same variant to be open in more than one split view
|
||||
* @param {any} culture
|
||||
*/
|
||||
scope.variantIsOpen = function(culture) {
|
||||
if(scope.openVariants.indexOf(culture) !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
onInit();
|
||||
|
||||
//watch for the active culture changing, if it changes, update the current variant
|
||||
if (scope.variants) {
|
||||
scope.$watch(function () {
|
||||
for (var i = 0; i < scope.variants.length; i++) {
|
||||
var v = scope.variants[i];
|
||||
if (v.active) {
|
||||
return v.language.culture;
|
||||
}
|
||||
}
|
||||
return scope.vm.currentVariant.language.culture; //should never get here
|
||||
}, function (newValue, oldValue) {
|
||||
if (newValue !== scope.vm.currentVariant.language.culture) {
|
||||
setCurrentVariant();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/umb-editor-content-header.html',
|
||||
scope: {
|
||||
name: "=",
|
||||
nameLocked: "=",
|
||||
menu: "=",
|
||||
hideMenu: "<?",
|
||||
variants: "=",
|
||||
openVariants: "<",
|
||||
hideChangeVariant: "<?",
|
||||
navigation: "=",
|
||||
onSelectNavigationItem: "&?",
|
||||
showBackButton: "<?",
|
||||
splitViewOpen: "=?",
|
||||
onOpenInSplitView: "&?",
|
||||
onCloseSplitView: "&?",
|
||||
onSelectVariant: "&?",
|
||||
serverValidationNameField: "@?",
|
||||
serverValidationAliasField: "@?"
|
||||
},
|
||||
link: link
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorContentHeader', EditorContentHeader);
|
||||
|
||||
})();
|
||||
+9
-72
@@ -204,47 +204,25 @@ Use this directive to construct a header inside the main editor window.
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function EditorHeaderDirective(iconHelper, editorService, $location, $routeParams) {
|
||||
function EditorHeaderDirective(editorService) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
|
||||
if (!scope.serverValidationNameField) {
|
||||
scope.serverValidationNameField = "Name";
|
||||
}
|
||||
if (!scope.serverValidationAliasField) {
|
||||
scope.serverValidationAliasField = "Alias";
|
||||
}
|
||||
function link(scope) {
|
||||
|
||||
scope.vm = {};
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.vm.currentVariant = "";
|
||||
|
||||
function onInit() {
|
||||
setCurrentVariant();
|
||||
}
|
||||
|
||||
function setCurrentVariant() {
|
||||
angular.forEach(scope.variants, function (variant) {
|
||||
if (variant.active) {
|
||||
scope.vm.currentVariant = variant;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scope.goBack = function () {
|
||||
if (scope.onBack) {
|
||||
$location.path('/' + $routeParams.section + '/' + $routeParams.tree + '/' + $routeParams.method + '/' + scope.menu.currentNode.parentId);
|
||||
scope.onBack();
|
||||
}
|
||||
};
|
||||
|
||||
scope.selectVariant = function (event, variant) {
|
||||
|
||||
if (scope.onSelectVariant) {
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.onSelectVariant({ "variant": variant });
|
||||
scope.selectNavigationItem = function(item) {
|
||||
if(scope.onSelectNavigationItem) {
|
||||
scope.onSelectNavigationItem({"item": item});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
scope.openIconPicker = function () {
|
||||
var iconPicker = {
|
||||
@@ -269,48 +247,14 @@ Use this directive to construct a header inside the main editor window.
|
||||
editorService.iconPicker(iconPicker);
|
||||
};
|
||||
|
||||
scope.closeSplitView = function () {
|
||||
if (scope.onCloseSplitView) {
|
||||
scope.onCloseSplitView();
|
||||
}
|
||||
};
|
||||
|
||||
scope.openInSplitView = function (event, variant) {
|
||||
if (scope.onOpenInSplitView) {
|
||||
scope.vm.dropdownOpen = false;
|
||||
scope.onOpenInSplitView({ "variant": variant });
|
||||
}
|
||||
};
|
||||
|
||||
onInit();
|
||||
|
||||
//watch for the active culture changing, if it changes, update the current variant
|
||||
if (scope.variants) {
|
||||
scope.$watch(function () {
|
||||
for (var i = 0; i < scope.variants.length; i++) {
|
||||
var v = scope.variants[i];
|
||||
if (v.active) {
|
||||
return v.language.culture;
|
||||
}
|
||||
}
|
||||
return scope.vm.currentVariant.language.culture; //should never get here
|
||||
}, function (newValue, oldValue) {
|
||||
if (newValue !== scope.vm.currentVariant.language.culture) {
|
||||
setCurrentVariant();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/umb-editor-header.html',
|
||||
scope: {
|
||||
tabs: "=",
|
||||
actions: "=",
|
||||
name: "=",
|
||||
nameLocked: "=",
|
||||
menu: "=",
|
||||
@@ -322,18 +266,11 @@ Use this directive to construct a header inside the main editor window.
|
||||
description: "=",
|
||||
hideDescription: "@",
|
||||
descriptionLocked: "@",
|
||||
variants: "=",
|
||||
hideChangeVariant: "<?",
|
||||
navigation: "=",
|
||||
onSelectNavigationItem: "&?",
|
||||
key: "=",
|
||||
onBack: "&?",
|
||||
showBackButton: "<?",
|
||||
splitViewOpen: "=?",
|
||||
onOpenInSplitView: "&?",
|
||||
onCloseSplitView: "&?",
|
||||
onSelectVariant: "&?",
|
||||
serverValidationNameField: "@?",
|
||||
serverValidationAliasField: "@?"
|
||||
showBackButton: "<?"
|
||||
},
|
||||
link: link
|
||||
};
|
||||
|
||||
+6
-2
@@ -20,8 +20,11 @@
|
||||
scope.clickNavigationItem = function (selectedItem) {
|
||||
scope.showDropdown = false;
|
||||
runItemAction(selectedItem);
|
||||
eventsService.emit("app.tabChange", selectedItem);
|
||||
setItemToActive(selectedItem);
|
||||
if(scope.onSelect) {
|
||||
scope.onSelect({"item": selectedItem});
|
||||
}
|
||||
eventsService.emit("app.tabChange", selectedItem);
|
||||
};
|
||||
|
||||
scope.toggleDropdown = function () {
|
||||
@@ -124,7 +127,8 @@
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/umb-editor-navigation.html',
|
||||
scope: {
|
||||
navigation: "="
|
||||
navigation: "=",
|
||||
onSelect: "&"
|
||||
},
|
||||
link: link
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
* contentResource.getById(1234)
|
||||
* .then(function(data) {
|
||||
* $scope.content = data;
|
||||
* });
|
||||
* </pre>
|
||||
* });
|
||||
* </pre>
|
||||
**/
|
||||
|
||||
function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
@@ -93,7 +93,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* $scope.complete = true;
|
||||
* });
|
||||
* </pre>
|
||||
* </pre>
|
||||
* @param {Object} args arguments object
|
||||
* @param {Int} args.parentId the ID of the parent node
|
||||
* @param {Array} options.sortedIds array of node IDs as they should be sorted
|
||||
@@ -134,9 +134,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* alert("node was moved");
|
||||
* }, function(err){
|
||||
* alert("node didnt move:" + err.data.Message);
|
||||
* alert("node didnt move:" + err.data.Message);
|
||||
* });
|
||||
* </pre>
|
||||
* </pre>
|
||||
* @param {Object} args arguments object
|
||||
* @param {Int} args.idd the ID of the node to move
|
||||
* @param {Int} args.parentId the ID of the parent node to move to
|
||||
@@ -177,9 +177,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* alert("node was copied");
|
||||
* }, function(err){
|
||||
* alert("node wasnt copy:" + err.data.Message);
|
||||
* alert("node wasnt copy:" + err.data.Message);
|
||||
* });
|
||||
* </pre>
|
||||
* </pre>
|
||||
* @param {Object} args arguments object
|
||||
* @param {Int} args.id the ID of the node to copy
|
||||
* @param {Int} args.parentId the ID of the parent node to copy to
|
||||
@@ -218,9 +218,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* alert("node was unpulished");
|
||||
* }, function(err){
|
||||
* alert("node wasnt unpublished:" + err.data.Message);
|
||||
* alert("node wasnt unpublished:" + err.data.Message);
|
||||
* });
|
||||
* </pre>
|
||||
* </pre>
|
||||
* @param {Int} id the ID of the node to unpublish
|
||||
* @returns {Promise} resourcePromise object.
|
||||
*
|
||||
@@ -256,8 +256,8 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* alert('its empty!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @returns {Promise} resourcePromise object.
|
||||
*
|
||||
*/
|
||||
@@ -284,9 +284,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function() {
|
||||
* alert('its gone!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} id id of content item to delete
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} id id of content item to delete
|
||||
* @returns {Promise} resourcePromise object.
|
||||
*
|
||||
*/
|
||||
@@ -322,13 +322,13 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* <pre>
|
||||
* contentResource.getById(1234)
|
||||
* .then(function(content) {
|
||||
* var myDoc = content;
|
||||
* var myDoc = content;
|
||||
* alert('its here!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} id id of content item to return
|
||||
* @param {Int} culture optional culture to retrieve the item in
|
||||
* @param {Int} culture optional culture to retrieve the item in
|
||||
* @returns {Promise} resourcePromise object containing the content item.
|
||||
*
|
||||
*/
|
||||
@@ -393,12 +393,12 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* <pre>
|
||||
* contentResource.getByIds( [1234,2526,28262])
|
||||
* .then(function(contentArray) {
|
||||
* var myDoc = contentArray;
|
||||
* var myDoc = contentArray;
|
||||
* alert('they are here!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param {Array} ids ids of content items to return as an array
|
||||
* </pre>
|
||||
*
|
||||
* @param {Array} ids ids of content items to return as an array
|
||||
* @returns {Promise} resourcePromise object containing the content items array.
|
||||
*
|
||||
*/
|
||||
@@ -433,28 +433,28 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
*
|
||||
* @description
|
||||
* Returns a scaffold of an empty content item, given the id of the content item to place it underneath and the content type alias.
|
||||
*
|
||||
*
|
||||
* - Parent Id must be provided so umbraco knows where to store the content
|
||||
* - Content Type alias must be provided so umbraco knows which properties to put on the content scaffold
|
||||
*
|
||||
* - Content Type alias must be provided so umbraco knows which properties to put on the content scaffold
|
||||
*
|
||||
* The scaffold is used to build editors for content that has not yet been populated with data.
|
||||
*
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
* contentResource.getScaffold(1234, 'homepage')
|
||||
* .then(function(scaffold) {
|
||||
* var myDoc = scaffold;
|
||||
* myDoc.name = "My new document";
|
||||
* myDoc.name = "My new document";
|
||||
*
|
||||
* contentResource.publish(myDoc, true)
|
||||
* .then(function(content){
|
||||
* alert("Retrieved, updated and published again");
|
||||
* });
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} parentId id of content item to return
|
||||
* @param {String} alias contenttype alias to base the scaffold on
|
||||
* @param {String} alias contenttype alias to base the scaffold on
|
||||
* @returns {Promise} resourcePromise object containing the content scaffold.
|
||||
*
|
||||
*/
|
||||
@@ -500,8 +500,8 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* .then(function(url) {
|
||||
* alert('its here!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} id Id of node to return the public url to
|
||||
* @returns {Promise} resourcePromise object containing the url.
|
||||
*
|
||||
@@ -528,11 +528,11 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* <pre>
|
||||
* contentResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
|
||||
* .then(function(contentArray) {
|
||||
* var children = contentArray;
|
||||
* var children = contentArray;
|
||||
* alert('they are here!');
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} parentid id of content item to return children of
|
||||
* @param {Object} options optional options object
|
||||
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 0
|
||||
@@ -540,6 +540,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* @param {String} options.filter if provided, query will only return those with names matching the filter
|
||||
* @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Ascending`
|
||||
* @param {String} options.orderBy property to order items by, default: `SortOrder`
|
||||
* @param {String} options.cultureName if provided, the results will be for this specific culture/variant
|
||||
* @returns {Promise} resourcePromise object containing an array of content items.
|
||||
*
|
||||
*/
|
||||
@@ -549,10 +550,11 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
includeProperties: [],
|
||||
pageSize: 0,
|
||||
pageNumber: 0,
|
||||
filter: '',
|
||||
filter: "",
|
||||
orderDirection: "Ascending",
|
||||
orderBy: "SortOrder",
|
||||
orderBySystemField: true
|
||||
orderBySystemField: true,
|
||||
cultureName: ""
|
||||
};
|
||||
if (options === undefined) {
|
||||
options = {};
|
||||
@@ -596,7 +598,8 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
orderBy: options.orderBy,
|
||||
orderDirection: options.orderDirection,
|
||||
orderBySystemField: toBool(options.orderBySystemField),
|
||||
filter: options.filter
|
||||
filter: options.filter,
|
||||
cultureName: options.cultureName
|
||||
})),
|
||||
'Failed to retrieve children for content item ' + parentId);
|
||||
},
|
||||
@@ -617,9 +620,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
*
|
||||
* @description
|
||||
* Saves changes made to a content item to its current version, if the content item is new, the isNew paramater must be passed to force creation
|
||||
* if the content item needs to have files attached, they must be provided as the files param and passed separately
|
||||
*
|
||||
*
|
||||
* if the content item needs to have files attached, they must be provided as the files param and passed separately
|
||||
*
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
* contentResource.getById(1234)
|
||||
@@ -630,10 +633,10 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* alert("Retrieved, updated and saved again");
|
||||
* });
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Object} content The content item object with changes applied
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Array} files collection of files for the document
|
||||
* @param {Bool} showNotifications an option to disable/show notifications (default is true)
|
||||
* @returns {Promise} resourcePromise object containing the saved content item.
|
||||
@@ -660,9 +663,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
*
|
||||
* @description
|
||||
* Saves and publishes changes made to a content item to a new version, if the content item is new, the isNew paramater must be passed to force creation
|
||||
* if the content item needs to have files attached, they must be provided as the files param and passed separately
|
||||
*
|
||||
*
|
||||
* if the content item needs to have files attached, they must be provided as the files param and passed separately
|
||||
*
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
* contentResource.getById(1234)
|
||||
@@ -673,10 +676,10 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* alert("Retrieved, updated and published again");
|
||||
* });
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Object} content The content item object with changes applied
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Array} files collection of files for the document
|
||||
* @param {Bool} showNotifications an option to disable/show notifications (default is true)
|
||||
* @returns {Promise} resourcePromise object containing the saved content item.
|
||||
@@ -697,7 +700,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
*
|
||||
* @description
|
||||
* Saves changes made to a content item, and notifies any subscribers about a pending publication
|
||||
*
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
* contentResource.getById(1234)
|
||||
@@ -708,11 +711,11 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* alert("Retrieved, updated and notication send off");
|
||||
* });
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Object} content The content item object with changes applied
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Array} files collection of files for the document
|
||||
* @param {Bool} isNew set to true to create a new item or to update an existing
|
||||
* @param {Array} files collection of files for the document
|
||||
* @returns {Promise} resourcePromise object containing the saved content item.
|
||||
*
|
||||
*/
|
||||
@@ -730,15 +733,15 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
*
|
||||
* @description
|
||||
* Publishes a content item with a given ID
|
||||
*
|
||||
*
|
||||
* ##usage
|
||||
* <pre>
|
||||
* contentResource.publishById(1234)
|
||||
* .then(function(content) {
|
||||
* alert("published");
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param {Int} id The ID of the conten to publish
|
||||
* @returns {Promise} resourcePromise object containing the published content item.
|
||||
*
|
||||
|
||||
@@ -174,6 +174,11 @@ a.umb-variant-switcher__toggle {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.umb-variant-switcher_item--not-allowed:not(.umb-variant-switcher_item--current) .umb-variant-switcher__name-wrapper:hover {
|
||||
background-color: @white !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.umb-variant-switcher__item:hover .umb-variant-switcher__split-view {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
|
||||
<umb-editor-view ng-if="!page.loading">
|
||||
|
||||
<umb-variant-content-editors page="page"
|
||||
content="content"
|
||||
culture="culture">
|
||||
<umb-variant-content-editors
|
||||
page="page"
|
||||
content="content"
|
||||
culture="culture">
|
||||
</umb-variant-content-editors>
|
||||
|
||||
<umb-editor-footer>
|
||||
|
||||
+3
-1
@@ -9,9 +9,11 @@
|
||||
editor="editor"
|
||||
editor-index="$index"
|
||||
editor-count="vm.editors.length"
|
||||
open-variants="vm.openVariants"
|
||||
on-open-split-view="vm.openSplitView(variant)"
|
||||
on-close-split-view="vm.closeSplitView($index)"
|
||||
on-select-variant="vm.selectVariant(variant, $index)">
|
||||
on-select-variant="vm.selectVariant(variant, $index)"
|
||||
on-select-app="vm.selectApp(app)">
|
||||
</umb-variant-content>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<div>
|
||||
<umb-load-indicator ng-if="vm.editor.loading">
|
||||
<umb-load-indicator
|
||||
ng-if="vm.editor.loading">
|
||||
</umb-load-indicator>
|
||||
|
||||
<div class="umb-split-view__content" ng-show="!vm.editor.loading">
|
||||
|
||||
<ng-form name="contentHeaderForm">
|
||||
<umb-editor-header menu="vm.page.menu"
|
||||
hide-menu="vm.page.hideActionsMenu"
|
||||
name="vm.editor.content.name"
|
||||
hide-icon="true"
|
||||
hide-description="true"
|
||||
hide-alias="true"
|
||||
navigation="vm.editor.content.apps"
|
||||
variants="vm.editor.content.variants"
|
||||
hide-change-variant="vm.page.hideChangeVariant"
|
||||
on-back="vm.backToListView()"
|
||||
show-back-button="vm.page.listViewPath !== null"
|
||||
split-view-open="vm.editorCount > 1"
|
||||
on-open-in-split-view="vm.openSplitView(variant)"
|
||||
on-close-split-view="vm.onCloseSplitView()"
|
||||
on-select-variant="vm.selectVariant(variant)"
|
||||
server-validation-name-field="{{'Variants[' + vm.editorIndex + '].Name'}}">
|
||||
</umb-editor-header>
|
||||
<umb-editor-content-header
|
||||
menu="vm.page.menu"
|
||||
hide-menu="vm.page.hideActionsMenu"
|
||||
name="vm.editor.content.name"
|
||||
navigation="vm.editor.content.apps"
|
||||
on-select-navigation-item="vm.selectApp(item)"
|
||||
variants="vm.editor.content.variants"
|
||||
open-variants="vm.openVariants"
|
||||
hide-change-variant="vm.page.hideChangeVariant"
|
||||
show-back-button="vm.page.listViewPath !== null"
|
||||
split-view-open="vm.editorCount > 1"
|
||||
on-open-in-split-view="vm.openSplitView(variant)"
|
||||
on-close-split-view="vm.onCloseSplitView()"
|
||||
on-select-variant="vm.selectVariant(variant)"
|
||||
server-validation-name-field="{{'Variants[' + vm.editorIndex + '].Name'}}">
|
||||
</umb-editor-content-header>
|
||||
</ng-form>
|
||||
|
||||
<umb-editor-container>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<div data-element="editor-header" class="umb-editor-header">
|
||||
|
||||
<div class="flex items-center" style="height: 100%;">
|
||||
|
||||
<div ng-if="showBackButton === true && splitViewOpen !== true" style="margin-right: 15px;">
|
||||
<a class="umb-editor-header__back" href="#" ng-click="goBack()" prevent-default>
|
||||
<i class="fa fa-arrow-left" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center" style="flex: 1;">
|
||||
|
||||
<div id="nameField" style="flex: 1 1 auto;">
|
||||
<div class="umb-editor-header__name-wrapper">
|
||||
<ng-form name="headerNameForm">
|
||||
<input data-element="editor-name-field"
|
||||
type="text"
|
||||
class="umb-editor-header__name-input"
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_entername"
|
||||
name="headerName"
|
||||
ng-show="!nameLocked"
|
||||
ng-model="name"
|
||||
ng-class="{'name-is-empty': $parent.name===null || $parent.name===''}"
|
||||
umb-auto-focus
|
||||
val-server-field="{{serverValidationNameField}}"
|
||||
required
|
||||
autocomplete="off" />
|
||||
</ng-form>
|
||||
|
||||
<a ng-if="variants.length > 0 && hideChangeVariant !== true" class="umb-variant-switcher__toggle" href="" ng-click="vm.dropdownOpen = !vm.dropdownOpen">
|
||||
<span>{{vm.currentVariant.language.name}}</span>
|
||||
<ins class="umb-variant-switcher__expand" ng-class="{'icon-navigation-down': !vm.dropdownOpen, 'icon-navigation-up': vm.dropdownOpen}"> </ins>
|
||||
</a>
|
||||
|
||||
<span ng-if="hideChangeVariant" class="umb-variant-switcher__toggle">
|
||||
<span>{{vm.currentVariant.language.name}}</span>
|
||||
</span>
|
||||
|
||||
<umb-dropdown ng-if="vm.dropdownOpen" style="width: 100%; max-height: 250px; overflow-y: scroll; margin-top: 5px;" on-close="vm.dropdownOpen = false" umb-keyboard-list>
|
||||
<umb-dropdown-item class="umb-variant-switcher__item" ng-class="{'umb-variant-switcher_item--current': variant.active, 'umb-variant-switcher_item--not-allowed': variantIsOpen(variant.language.culture)}" ng-repeat="variant in variants">
|
||||
<a href="" class="umb-variant-switcher__name-wrapper" ng-click="selectVariant($event, variant)" prevent-default>
|
||||
<span class="umb-variant-switcher__name">{{variant.language.name}}</span>
|
||||
<umb-variant-state variant="variant" class="umb-variant-switcher__state"></umb-variant-state>
|
||||
</a>
|
||||
<div ng-if="splitViewOpen !== true && !variant.active" class="umb-variant-switcher__split-view" ng-click="openInSplitView($event, variant)">Open in split view</div>
|
||||
</umb-dropdown-item>
|
||||
</umb-dropdown>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-header-name" ng-if="nameLocked">{{ name }}</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-if="splitViewOpen" style="margin-left: 20px;">
|
||||
<a class="umb-editor-header__close-split-view" href="" ng-click="closeSplitView()">
|
||||
<i class="icon-delete"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div ng-if="navigation && splitViewOpen !== true" style="margin-left: 20px;">
|
||||
<umb-editor-navigation
|
||||
data-element="editor-sub-views"
|
||||
navigation="navigation"
|
||||
on-select="selectNavigationItem(item)">
|
||||
</umb-editor-navigation>
|
||||
</div>
|
||||
|
||||
<div ng-if="menu.currentNode && splitViewOpen !== true && hideMenu !== true" style="margin-left: 20px;">
|
||||
<umb-editor-menu
|
||||
data-element="editor-actions"
|
||||
current-node="menu.currentNode"
|
||||
current-section="{{menu.currentSection}}">
|
||||
</umb-editor-menu>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
ng-model="name"
|
||||
ng-class="{'name-is-empty': $parent.name===null || $parent.name===''}"
|
||||
umb-auto-focus
|
||||
val-server-field="{{serverValidationNameField}}"
|
||||
val-server-field="Name"
|
||||
required
|
||||
autocomplete="off" />
|
||||
</ng-form>
|
||||
@@ -45,28 +45,9 @@
|
||||
alias="$parent.alias"
|
||||
alias-from="$parent.name"
|
||||
enable-lock="true"
|
||||
server-validation-field="{{serverValidationAliasField}}">
|
||||
server-validation-field="Alias">
|
||||
</umb-generate-alias>
|
||||
|
||||
<a ng-if="variants.length > 0 && hideChangeVariant !== true" class="umb-variant-switcher__toggle" href="" ng-click="vm.dropdownOpen = !vm.dropdownOpen">
|
||||
<span>{{vm.currentVariant.language.name}}</span>
|
||||
<ins class="umb-variant-switcher__expand" ng-class="{'icon-navigation-down': !vm.dropdownOpen, 'icon-navigation-up': vm.dropdownOpen}"> </ins>
|
||||
</a>
|
||||
|
||||
<span ng-if="hideChangeVariant" class="umb-variant-switcher__toggle">
|
||||
<span>{{vm.currentVariant.language.name}}</span>
|
||||
</span>
|
||||
|
||||
<umb-dropdown ng-if="vm.dropdownOpen" style="width: 100%; max-height: 250px; overflow-y: scroll; margin-top: 5px;" on-close="vm.dropdownOpen = false" umb-keyboard-list>
|
||||
<umb-dropdown-item class="umb-variant-switcher__item" ng-class="{'umb-variant-switcher_item--current': variant.active}" ng-repeat="variant in variants">
|
||||
<a href="" class="umb-variant-switcher__name-wrapper" ng-click="selectVariant($event, variant)" prevent-default>
|
||||
<span class="umb-variant-switcher__name">{{variant.language.name}}</span>
|
||||
<umb-variant-state variant="variant" class="umb-variant-switcher__state"></umb-variant-state>
|
||||
</a>
|
||||
<div ng-if="splitViewOpen !== true" class="umb-variant-switcher__split-view" ng-click="openInSplitView($event, variant)">Open in split view</div>
|
||||
</umb-dropdown-item>
|
||||
</umb-dropdown>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-header-name" ng-if="nameLocked" title="{{key}}">{{ name }}</div>
|
||||
@@ -85,22 +66,19 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-if="splitViewOpen" style="margin-left: 20px;">
|
||||
<a class="umb-editor-header__close-split-view" href="" ng-click="closeSplitView()">
|
||||
<i class="icon-delete"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div ng-if="navigation && splitViewOpen !== true" style="margin-left: 20px;">
|
||||
<umb-editor-navigation data-element="editor-sub-views"
|
||||
navigation="navigation">
|
||||
<umb-editor-navigation
|
||||
data-element="editor-sub-views"
|
||||
navigation="navigation"
|
||||
on-select="selectNavigationItem(item)">
|
||||
</umb-editor-navigation>
|
||||
</div>
|
||||
|
||||
<div ng-if="menu.currentNode && splitViewOpen !== true && hideMenu !== true" style="margin-left: 20px;">
|
||||
<umb-editor-menu data-element="editor-actions"
|
||||
current-node="menu.currentNode"
|
||||
current-section="{{menu.currentSection}}">
|
||||
<umb-editor-menu
|
||||
data-element="editor-actions"
|
||||
current-node="menu.currentNode"
|
||||
current-section="{{menu.currentSection}}">
|
||||
</umb-editor-menu>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @description
|
||||
* The controller for the media editor
|
||||
*/
|
||||
function mediaEditController($scope, $routeParams, $q, appState, mediaResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, treeService, formHelper, umbModelMapper, editorState, umbRequestHelper, $http, eventsService) {
|
||||
function mediaEditController($scope, $routeParams, $q, appState, mediaResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, formHelper, editorState, umbRequestHelper, $http, eventsService) {
|
||||
|
||||
var evts = [];
|
||||
var nodeId = null;
|
||||
@@ -79,10 +79,7 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
|
||||
editorState.set($scope.content);
|
||||
|
||||
// We don't get the info tab from the server from version 7.8 so we need to manually add it
|
||||
//contentEditingHelper.addInfoTab($scope.content.tabs);
|
||||
|
||||
init($scope.content);
|
||||
init();
|
||||
|
||||
$scope.page.loading = false;
|
||||
|
||||
@@ -96,29 +93,7 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
});
|
||||
}
|
||||
|
||||
function init(content) {
|
||||
|
||||
// prototype content and info apps
|
||||
var contentApp = {
|
||||
"name": "Content",
|
||||
"alias": "content",
|
||||
"icon": "icon-document",
|
||||
"view": "views/media/apps/content/content.html"
|
||||
};
|
||||
|
||||
var infoApp = {
|
||||
"name": "Info",
|
||||
"alias": "info",
|
||||
"icon": "icon-info",
|
||||
"view": "views/media/apps/info/info.html"
|
||||
};
|
||||
|
||||
var listview = {
|
||||
"name": "Child items",
|
||||
"alias": "childItems",
|
||||
"icon": "icon-list",
|
||||
"view": "views/media/apps/listview/listview.html"
|
||||
};
|
||||
function init() {
|
||||
|
||||
// set first app to active
|
||||
$scope.content.apps[0].active = true;
|
||||
@@ -154,7 +129,7 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
|
||||
syncTreeNode($scope.content, data.path);
|
||||
|
||||
init($scope.content);
|
||||
init();
|
||||
|
||||
$scope.page.saveButtonState = "success";
|
||||
|
||||
@@ -216,10 +191,7 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
|
||||
});
|
||||
}
|
||||
|
||||
// We don't get the info tab from the server from version 7.8 so we need to manually add it
|
||||
//contentEditingHelper.addInfoTab($scope.content.tabs);
|
||||
|
||||
init($scope.content);
|
||||
init();
|
||||
|
||||
$scope.page.loading = false;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function listViewController($scope, $routeParams, $injector, currentUserResource, notificationsService, iconHelper, editorState, localizationService, appState, $timeout, mediaResource, listViewHelper, navigationService, editorService) {
|
||||
function listViewController($scope, $routeParams, $injector, $location, $timeout, currentUserResource, notificationsService, iconHelper, editorState, localizationService, appState, mediaResource, listViewHelper, navigationService, editorService) {
|
||||
|
||||
//this is a quick check to see if we're in create mode, if so just exit - we cannot show children for content
|
||||
// that isn't created yet, if we continue this will use the parent id in the route params which isn't what
|
||||
@@ -74,7 +74,7 @@ function listViewController($scope, $routeParams, $injector, currentUserResource
|
||||
"canCopy": _.contains(currentUserPermissions, 'O'), //Magic Char = O
|
||||
"canCreate": _.contains(currentUserPermissions, 'C'), //Magic Char = C
|
||||
"canDelete": _.contains(currentUserPermissions, 'D'), //Magic Char = D
|
||||
"canMove": _.contains(currentUserPermissions, 'M'), //Magic Char = M
|
||||
"canMove": _.contains(currentUserPermissions, 'M'), //Magic Char = M
|
||||
"canPublish": _.contains(currentUserPermissions, 'U'), //Magic Char = U
|
||||
"canUnpublish": _.contains(currentUserPermissions, 'U') //Magic Char = Z (however UI says it can't be set, so if we can publish 'U' we can unpublish)
|
||||
};
|
||||
@@ -136,6 +136,9 @@ function listViewController($scope, $routeParams, $injector, currentUserResource
|
||||
|
||||
}
|
||||
|
||||
//Get the current culturename from the QueryString - to pass into the WebAPI call
|
||||
var cultureNameQs = $location.search().cculture ? $location.search().cculture : $location.search().mculture;
|
||||
|
||||
$scope.options = {
|
||||
displayAtTabNumber: $scope.model.config.displayAtTabNumber ? $scope.model.config.displayAtTabNumber : 1,
|
||||
pageSize: $scope.model.config.pageSize ? $scope.model.config.pageSize : 10,
|
||||
@@ -156,7 +159,8 @@ function listViewController($scope, $routeParams, $injector, currentUserResource
|
||||
allowBulkUnpublish: $scope.entityType === 'content' && $scope.model.config.bulkActionPermissions.allowBulkUnpublish,
|
||||
allowBulkCopy: $scope.entityType === 'content' && $scope.model.config.bulkActionPermissions.allowBulkCopy,
|
||||
allowBulkMove: $scope.model.config.bulkActionPermissions.allowBulkMove,
|
||||
allowBulkDelete: $scope.model.config.bulkActionPermissions.allowBulkDelete
|
||||
allowBulkDelete: $scope.model.config.bulkActionPermissions.allowBulkDelete,
|
||||
cultureName: cultureNameQs
|
||||
};
|
||||
|
||||
// Check if selected order by field is actually custom field
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" Codebehind="about.aspx.cs" AutoEventWireup="True" Inherits="umbraco.dialogs.about" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
|
||||
<div style="padding-right: 5px; padding-left: 5px; padding-bottom: 0px; padding-top: 10px; text-align: center;">
|
||||
|
||||
<img src="../images/umbracoSplash.png" />
|
||||
|
||||
<p style="padding-right: 5px; padding-left: 5px; padding-bottom: 0px; margin: 0px; padding-top: 5px">
|
||||
Umbraco v<asp:Literal ID="version" runat="server"></asp:Literal><br />
|
||||
<br />
|
||||
Copyright © 2001 -
|
||||
<asp:Literal ID="thisYear" runat="server"></asp:Literal>
|
||||
Umbraco / Niels Hartvig<br />
|
||||
Developed by the <a href="http://our.umbraco.org/wiki/about/core-team" target="_blank">Umbraco Core
|
||||
Team</a><br />
|
||||
<br />
|
||||
|
||||
Umbraco is licensed under <a href="http://umbraco.org/license"
|
||||
target="_blank">the open source license MIT</a><br />
|
||||
<br />
|
||||
Visit <a href="http://umbraco.org" target="_blank">umbraco.org</a>
|
||||
for more information.<br />
|
||||
<br />
|
||||
Dedicated to Gry, August, Villum and Oliver!<br />
|
||||
</p>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" Codebehind="cruds.aspx.cs" AutoEventWireup="True" Inherits="umbraco.dialogs.cruds" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" runat="server">
|
||||
<style>
|
||||
.guiDialogTinyMark{font-size: 9px !Important;}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<div class="umb-dialog-body form-horizontal">
|
||||
<cc1:Pane ID="pane_form" runat="server">
|
||||
<cc1:Feedback ID="feedback1" runat="server" />
|
||||
|
||||
<cc1:PropertyPanel runat="server">
|
||||
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
|
||||
</cc1:PropertyPanel>
|
||||
</cc1:Pane>
|
||||
</div>
|
||||
|
||||
<div runat="server" ID="panel_buttons" class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
|
||||
<a href="#" class="btn btn-link" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("general/cancel")%></a>
|
||||
<asp:Button ID="Button1" runat="server" CssClass="btn btn-primary" OnClick="Button1_Click"></asp:Button>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@@ -1,103 +0,0 @@
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoPage.Master" ValidateRequest="false" Codebehind="insertMacro.aspx.cs" AutoEventWireup="True"
|
||||
Inherits="umbraco.dialogs.insertMacro" Trace="false" %>
|
||||
<%@ Import Namespace="Umbraco.Web" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="head" runat="server">
|
||||
<script type="text/javascript">
|
||||
function saveTreepickerValue(appAlias, macroAlias) {
|
||||
var treePicker = window.showModalDialog('treePicker.aspx?app=' + appAlias + '&treeType=' + appAlias, 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
|
||||
document.forms[0][macroAlias].value = treePicker;
|
||||
document.getElementById("label" + macroAlias).innerHTML = "</b><i>updated with id: " + treePicker + "</i><b><br/>";
|
||||
}
|
||||
|
||||
var macroAliases = new Array();
|
||||
|
||||
function registerAlias(alias) {
|
||||
macroAliases[macroAliases.length] = alias;
|
||||
}
|
||||
|
||||
function updateMacro() {
|
||||
var macroString = '';
|
||||
|
||||
for (i = 0; i < macroAliases.length; i++) {
|
||||
var propertyName = macroAliases[i]
|
||||
// Vi opdaterer macroStringen
|
||||
if (document.forms[0][macroAliases[i]].type == 'checkbox') {
|
||||
if (document.forms[0][macroAliases[i]].checked)
|
||||
macroString += propertyName + "=\"1\" ";
|
||||
else
|
||||
macroString += propertyName + "=\"0\" ";
|
||||
|
||||
} else if (document.forms[0][macroAliases[i]].length) {
|
||||
var tempValue = '';
|
||||
for (var j = 0; j < document.forms[0][macroAliases[i]].length; j++) {
|
||||
if (document.forms[0][macroAliases[i]][j].selected)
|
||||
tempValue += document.forms[0][macroAliases[i]][j].value + ', ';
|
||||
}
|
||||
if (tempValue.length > 2)
|
||||
tempValue = tempValue.substring(0, tempValue.length - 2)
|
||||
macroString += propertyName + "=\"" + tempValue + "\" ";
|
||||
} else {
|
||||
macroString += propertyName + "=\"" + pseudoHtmlEncode(document.forms[0][macroAliases[i]].value) + "\" ";
|
||||
}
|
||||
}
|
||||
|
||||
if (macroString.length > 1)
|
||||
macroString = macroString.substr(0, macroString.length - 1);
|
||||
|
||||
if (document.forms[0].macroMode.value == 'edit') {
|
||||
var idAliasRef = "";
|
||||
if (document.forms[0]["macroAlias"].value != '')
|
||||
idAliasRef = " macroAlias=\"" + document.forms[0]["macroAlias"].value;
|
||||
else
|
||||
idAliasRef = " macroID=\"" + document.forms[0]["macroID"].value;
|
||||
|
||||
top.right.umbracoEditMacroDo("<?UMBRACO_MACRO" + idAliasRef + "\" " + macroString + ">");
|
||||
} else {
|
||||
top.right.umbracoInsertMacroDo("<?UMBRACO_MACRO macroAlias=\"" + document.forms[0]["macroAlias"].value + "\" " + macroString + ">");
|
||||
}
|
||||
|
||||
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
|
||||
function pseudoHtmlEncode(text) {
|
||||
return text.replace(/\"/gi, "&quot;").replace(/\</gi, "&lt;").replace(/\>/gi, "&gt;");
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="body" runat="server">
|
||||
<input type="hidden" name="macroMode" value="<%=Request["mode"]%>" />
|
||||
|
||||
<%if (Request["macroID"] != null || Request["macroAlias"] != null) {%>
|
||||
|
||||
<input type="hidden" name="macroID" value="<%=Request.CleanForXss("macroID")%>" />
|
||||
<input type="hidden" name="macroAlias" value="<%=Request.CleanForXss("macroAlias")%>" />
|
||||
|
||||
<div class="macroProperties">
|
||||
<cc1:Pane id="pane_edit" runat="server">
|
||||
<asp:PlaceHolder ID="macroProperties" runat="server" />
|
||||
</cc1:Pane>
|
||||
</div>
|
||||
<p>
|
||||
<input type="button" value="<%=Services.TextService.Localize("general/ok")%>" onclick="updateMacro()" />
|
||||
<em> or </em>
|
||||
<a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("general/cancel")%></a>
|
||||
</p>
|
||||
<%} else {%>
|
||||
|
||||
<cc1:Pane id="pane_insert" runat="server">
|
||||
<cc1:PropertyPanel runat="server">
|
||||
<asp:ListBox Rows="1" ID="macroAlias" runat="server"></asp:ListBox>
|
||||
</cc1:PropertyPanel>
|
||||
</cc1:Pane>
|
||||
<p>
|
||||
<input type="submit" value="<%=Services.TextService.Localize("general/ok")%>" />
|
||||
<em> or </em>
|
||||
<a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=Services.TextService.Localize("general/cancel")%></a>
|
||||
</p>
|
||||
|
||||
<%}%>
|
||||
</asp:Content>
|
||||
@@ -1,32 +0,0 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="insertMasterpageContent.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.insertMasterpageContent" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
<script type="text/javascript">
|
||||
function insertCode() {
|
||||
var idDD = document.getElementById("<%= dd_detectedAlias.ClientID %>");
|
||||
var id = idDD.options[idDD.selectedIndex].value;
|
||||
top.right.insertContentElement(id);
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<cc1:Pane ID="pane_insert" runat="server">
|
||||
<cc1:PropertyPanel runat="server">
|
||||
<p>
|
||||
<%= Services.TextService.Localize("defaultdialogs/templateContentPlaceHolderHelp")%>
|
||||
</p>
|
||||
</cc1:PropertyPanel>
|
||||
<cc1:PropertyPanel runat="server" id="pp_placeholder" text="Placeholder ID">
|
||||
<asp:DropDownList ID="dd_detectedAlias" CssClass="bigInput input-block-level" runat="server" />
|
||||
</cc1:PropertyPanel>
|
||||
</cc1:Pane>
|
||||
|
||||
<cc1:Pane runat="server" CssClass="btn-toolbar umb-btn-toolbar">
|
||||
<a class="btn btn-link" onclick="UmbClientMgr.closeModalWindow(); return false;"><%=Services.TextService.Localize("general/cancel")%></a>
|
||||
<input type="button" onclick="insertCode(); return false;" Class="btn btn-primary" value="<%= Services.TextService.Localize("insert") %>" />
|
||||
</cc1:Pane>
|
||||
</asp:Content>
|
||||
@@ -1,36 +0,0 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="insertMasterpagePlaceholder.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.insertMasterpagePlaceholder" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
<script type="text/javascript">
|
||||
|
||||
function insertCode() {
|
||||
var idtb = document.getElementById("<%= tb_alias.ClientID %>");
|
||||
var id = idtb.value;
|
||||
|
||||
top.right.insertPlaceHolderElement(id);
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<cc1:Pane ID="pane_insert" runat="server">
|
||||
<cc1:PropertyPanel runat="server">
|
||||
<p>
|
||||
<%= Services.TextService.Localize("defaultdialogs/templateContentAreaHelp")%>
|
||||
</p>
|
||||
</cc1:PropertyPanel>
|
||||
<cc1:PropertyPanel runat="server" id="pp_placeholder" text="Placeholder ID">
|
||||
<asp:TextBox ID="tb_alias" Width="350px" CssClass="bigInput input-block-level" runat="server" />
|
||||
</cc1:PropertyPanel>
|
||||
</cc1:Pane>
|
||||
|
||||
<cc1:Pane runat="server" CssClass="btn-toolbar umb-btn-toolbar">
|
||||
<a class="btn btn-link" onclick="UmbClientMgr.closeModalWindow(); return false;"><%=Services.TextService.Localize("general/cancel")%></a>
|
||||
<input type="button" onclick="insertCode(); return false;" Class="btn btn-primary" value="<%= Services.TextService.Localize("insert") %>" />
|
||||
</cc1:Pane>
|
||||
</asp:Content>
|
||||
@@ -1,97 +0,0 @@
|
||||
<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true"
|
||||
CodeBehind="mediaPicker.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.mediaPicker" %>
|
||||
|
||||
<%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
<%@ Register TagPrefix="umb2" TagName="Tree" Src="../controls/Tree/TreeControl.ascx" %>
|
||||
<%@ Register TagPrefix="umb3" TagName="Image" Src="../controls/Images/ImageViewer.ascx" %>
|
||||
<%@ Register TagName="MediaUpload" TagPrefix="umb4" Src="../controls/Images/UploadMediaImage.ascx" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//need to wire up the submit button click
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#submitbutton").click(function() {
|
||||
updatePicker();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
//called when the user interacts with a node
|
||||
function dialogHandler(id) {
|
||||
if (id != -1) {
|
||||
//update the hidden field with the selected id
|
||||
jQuery("#selectedMediaId").val(id);
|
||||
jQuery("#submitbutton").removeAttr("disabled").css("color", "#000");
|
||||
}
|
||||
else {
|
||||
jQuery("#submitbutton").attr("disabled", "disabled").css("color", "gray");
|
||||
}
|
||||
|
||||
jQuery("#<%=ImageViewer.ClientID%>").UmbracoImageViewerAPI().updateImage(id, function(p) {
|
||||
//when the image is loaded, this callback method fires
|
||||
if (p.hasImage) {
|
||||
jQuery("#submitbutton").removeAttr("disabled").css("color", "#000");
|
||||
}
|
||||
else {
|
||||
jQuery("#submitbutton").attr("disabled", "disabled").css("color", "gray");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function uploadHandler(e) {
|
||||
dialogHandler(e.id);
|
||||
//get the tree object for the chooser and refresh
|
||||
var tree = jQuery("#<%=DialogTree.ClientID%>").UmbracoTreeAPI();
|
||||
tree.refreshTree();
|
||||
}
|
||||
|
||||
function updatePicker() {
|
||||
var id = jQuery("#selectedMediaId").val();
|
||||
if (id != "") {
|
||||
UmbClientMgr.closeModalWindow(id);
|
||||
}
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
//update the hidden field with the selected id = none
|
||||
jQuery("#selectedMediaId").val("");
|
||||
UmbClientMgr.closeModalWindow();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
.imageViewer .bgImage {float:right; }
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
|
||||
<%--when a node is selected, the id will be stored in this field--%>
|
||||
<input type="hidden" id="selectedMediaId" />
|
||||
<ui:Pane ID="pane_src" runat="server">
|
||||
<umb3:Image runat="server" ID="ImageViewer" ViewerStyle="ThumbnailPreview" />
|
||||
</ui:Pane>
|
||||
<br />
|
||||
<ui:TabView AutoResize="false" Width="455px" Height="305px" runat="server" ID="tv_options" />
|
||||
<ui:Pane ID="pane_select" runat="server">
|
||||
<umb2:Tree runat="server" ID="DialogTree" App="media" TreeType="media" IsDialog="true"
|
||||
ShowContextMenu="false" DialogMode="id" FunctionToCall="dialogHandler"
|
||||
Height="250"/>
|
||||
</ui:Pane>
|
||||
<asp:Panel ID="pane_upload" runat="server">
|
||||
<umb4:MediaUpload runat="server" ID="MediaUploader" OnClientUpload="uploadHandler" />
|
||||
</asp:Panel>
|
||||
<br />
|
||||
<p>
|
||||
<input type="submit" value="<%# Services.TextService.Localize("treepicker")%>" style="width: 60px;
|
||||
color: gray" disabled="disabled" id="submitbutton" />
|
||||
<em id="orcopy">
|
||||
<%# Services.TextService.Localize("or") %></em> <a href="javascript:cancel();" style="color: blue"
|
||||
id="cancelbutton">
|
||||
<%#Services.TextService.Localize("cancel") %></a>
|
||||
</p>
|
||||
</asp:Content>
|
||||
@@ -1,28 +0,0 @@
|
||||
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="uploadImage.aspx.cs"
|
||||
AutoEventWireup="True" Inherits="umbraco.dialogs.uploadImage" %>
|
||||
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagName="MediaUpload" TagPrefix="umb" Src="../controls/Images/UploadMediaImage.ascx" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
<style type="text/css">
|
||||
body, html
|
||||
{
|
||||
margin: 0px !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
function uploadHandler(e) {
|
||||
//get the tree object for the chooser and refresh
|
||||
if (parent && parent.jQuery && parent.jQuery.fn.UmbracoTreeAPI) {
|
||||
var tree = parent.jQuery("#treeContainer").UmbracoTreeAPI();
|
||||
tree.refreshTree();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
<umb:MediaUpload runat="server" ID="MediaUploader" OnClientUpload="uploadHandler" />
|
||||
</asp:Content>
|
||||
@@ -39,10 +39,35 @@
|
||||
</system.webServer>
|
||||
|
||||
<system.web>
|
||||
<compilation>
|
||||
<compilation targetFramework="4.7.2">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
|
||||
<!--
|
||||
Views are compiled by the Microsoft.CodeDom.Providers.DotNetCompilerPlatform which uses the Roslyn compiler
|
||||
from ~/bin/roslyn to expose an ICodeProvider implementation to System.CodeDom.
|
||||
|
||||
For instance, starting with package 1.4.0 (which contains version 1.2.2.0) System.Collections.Immutable
|
||||
lists netstandard2.0 as a supported target, whereas package 1.3.1 only listed net45. So now, when
|
||||
installing, NuGet picks the netstandard2.0 version, thus introducing a dependency to netstandard2.0.
|
||||
|
||||
Somehow, transitive dependencies are not working correctly, and either (a) NuGet fails to properly
|
||||
register this dependency, or (b) when reference assemblies are gathered before compiling views, this
|
||||
dependency is missed. In any case, the result is that the ICodeProvider is passed a list of referenced
|
||||
assemblies that is missing netstandard.
|
||||
|
||||
It may be a mix of both. NuGet registers the dependency well enough, that we can actually build the
|
||||
whole application - but it is not doing something that is required in order to have netstandard
|
||||
being a dependency when building views.
|
||||
|
||||
See also: https://stackoverflow.com/questions/50165910
|
||||
|
||||
Funny enough, the CSharpCompiler already explicitly adds System.Runtime as a referenced assembly,
|
||||
with a comment mentioning an issue. But it's not adding netstandard. So, for the time being, to be sure,
|
||||
we are adding both here.
|
||||
-->
|
||||
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" />
|
||||
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" />
|
||||
<section name="dashBoard" type="Umbraco.Core.Configuration.Dashboard.DashboardSection, Umbraco.Core" requirePermission="false" />
|
||||
<section name="HealthChecks" type="Umbraco.Core.Configuration.HealthChecks.HealthChecksSection, Umbraco.Core" requirePermission="false"/>
|
||||
<section name="HealthChecks" type="Umbraco.Core.Configuration.HealthChecks.HealthChecksSection, Umbraco.Core" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
|
||||
<sectionGroup name="imageProcessor">
|
||||
@@ -54,7 +54,7 @@
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
<add key="enableSimpleMembership" value="false" />
|
||||
<add key="autoFormsAuthentication" value="false" />
|
||||
<add key="dataAnnotations:dataTypeAttribute:disableRegEx" value="false"/>
|
||||
<add key="dataAnnotations:dataTypeAttribute:disableRegEx" value="false" />
|
||||
|
||||
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" />
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</controls>
|
||||
<namespaces>
|
||||
<add namespace="Umbraco.Core"/>
|
||||
<add namespace="Umbraco.Core.Services"/>
|
||||
<add namespace="Umbraco.Core" />
|
||||
<add namespace="Umbraco.Core.Services" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,Umbraco.Web" />
|
||||
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
|
||||
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
|
||||
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
|
||||
</httpModules>
|
||||
|
||||
<httpHandlers>
|
||||
@@ -122,7 +122,7 @@
|
||||
<add verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
|
||||
</httpHandlers>
|
||||
|
||||
<compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.7.2" numRecompilesBeforeAppRestart="50"/>
|
||||
<compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.7.2" numRecompilesBeforeAppRestart="50" />
|
||||
|
||||
<authentication mode="Forms">
|
||||
<forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
|
||||
@@ -173,7 +173,7 @@
|
||||
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
|
||||
<!-- Needed for login/membership to work on homepage (as per http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests) -->
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
|
||||
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
|
||||
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
|
||||
</modules>
|
||||
|
||||
<handlers accessPolicy="Read, Write, Script, Execute">
|
||||
@@ -200,9 +200,9 @@
|
||||
<mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package+zip" />
|
||||
<remove fileExtension=".svg" />
|
||||
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
||||
<remove fileExtension=".woff"/>
|
||||
<remove fileExtension=".woff" />
|
||||
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
|
||||
<remove fileExtension=".woff2"/>
|
||||
<remove fileExtension=".woff2" />
|
||||
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
|
||||
<remove fileExtension=".less" />
|
||||
<mimeMap fileExtension=".less" mimeType="text/css" />
|
||||
@@ -240,40 +240,40 @@
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0"/>
|
||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.3.0" newVersion="1.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0"/>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0"/>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
@@ -300,11 +300,11 @@
|
||||
<compiler language="c#;cs;csharp" extension=".cs"
|
||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
||||
warningLevel="4"
|
||||
compilerOptions="/langversion:7 /nowarn:1659;1699;1701" />
|
||||
compilerOptions="/langversion:7 /nowarn:1659;1699;1701" />
|
||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
|
||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
||||
warningLevel="4"
|
||||
compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
|
||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
||||
warningLevel="4"
|
||||
compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
public static class ContentExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the posted file value of a property.
|
||||
/// </summary>
|
||||
public static void SetValue(this IContentBase content, string propertyTypeAlias, HttpPostedFileBase value, string culture = null, string segment = null)
|
||||
{
|
||||
// ensure we get the filename without the path in IE in intranet mode
|
||||
// http://stackoverflow.com/questions/382464/httppostedfile-filename-different-from-ie
|
||||
var filename = value.FileName;
|
||||
var pos = filename.LastIndexOf(@"\", StringComparison.InvariantCulture);
|
||||
if (pos > 0)
|
||||
filename = filename.Substring(pos + 1);
|
||||
|
||||
// strip any directory info
|
||||
pos = filename.LastIndexOf(IOHelper.DirSepChar);
|
||||
if (pos > 0)
|
||||
filename = filename.Substring(pos + 1);
|
||||
|
||||
content.SetValue(propertyTypeAlias, filename, value.InputStream, culture, segment);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -456,7 +456,8 @@ namespace Umbraco.Web.Editors
|
||||
string orderBy = "SortOrder",
|
||||
Direction orderDirection = Direction.Ascending,
|
||||
bool orderBySystemField = true,
|
||||
string filter = "")
|
||||
string filter = "",
|
||||
string cultureName = "")
|
||||
{
|
||||
long totalChildren;
|
||||
IContent[] children;
|
||||
@@ -493,13 +494,16 @@ namespace Umbraco.Web.Editors
|
||||
Mapper.Map<IContent, ContentItemBasic<ContentPropertyBasic>>(content,
|
||||
opts =>
|
||||
{
|
||||
opts.Items[ResolutionContextExtensions.CultureKey] = cultureName;
|
||||
|
||||
// if there's a list of property aliases to map - we will make sure to store this in the mapping context.
|
||||
if (String.IsNullOrWhiteSpace(includeProperties) == false)
|
||||
if (string.IsNullOrWhiteSpace(includeProperties) == false)
|
||||
{
|
||||
opts.Items["IncludeProperties"] = includeProperties.Split(new[] { ", ", "," }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
return pagedResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.Trees;
|
||||
@@ -21,12 +19,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
TabsAndPropertiesResolver<IContent, ContentVariantDisplay> tabsAndPropertiesResolver,
|
||||
ContentAppResolver contentAppResolver,
|
||||
IUserService userService,
|
||||
ILocalizedTextService textService,
|
||||
IContentService contentService,
|
||||
IContentTypeService contentTypeService,
|
||||
IDataTypeService dataTypeService,
|
||||
ILocalizationService localizationService,
|
||||
ILogger logger)
|
||||
ILocalizationService localizationService)
|
||||
{
|
||||
// create, capture, cache
|
||||
var contentOwnerResolver = new OwnerResolver<IContent>(userService);
|
||||
@@ -70,6 +65,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(dest => dest.PublishDate, opt => opt.MapFrom(src => src.PublishDate))
|
||||
.ForMember(dest => dest.Segment, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Language, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Notifications, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.State, opt => opt.ResolveUsing(contentSavedStateResolver))
|
||||
.ForMember(dest => dest.Tabs, opt => opt.ResolveUsing(tabsAndPropertiesResolver));
|
||||
|
||||
@@ -83,11 +79,20 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(dest => dest.Trashed, opt => opt.MapFrom(src => src.Trashed))
|
||||
.ForMember(dest => dest.ContentTypeAlias, opt => opt.MapFrom(src => src.ContentType.Alias))
|
||||
.ForMember(dest => dest.Alias, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore());
|
||||
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Name, opt => opt.ResolveUsing<CultureNameResolver>());
|
||||
|
||||
//FROM IContent TO ContentPropertyCollectionDto
|
||||
//NOTE: the property mapping for cultures relies on a culture being set in the mapping context
|
||||
CreateMap<IContent, ContentPropertyCollectionDto>();
|
||||
}
|
||||
}
|
||||
|
||||
internal class CultureNameResolver : IValueResolver<IContent, ContentItemBasic<ContentPropertyBasic>, string>
|
||||
{
|
||||
public string Resolve(IContent source, ContentItemBasic<ContentPropertyBasic> destination, string destMember, ResolutionContext context)
|
||||
{
|
||||
return source.GetCultureName(context.GetCulture());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Umbraco.Web.Scheduling
|
||||
|
||||
switch (_runtimeState.ServerRole)
|
||||
{
|
||||
case ServerRole.Slave:
|
||||
case ServerRole.Replica:
|
||||
_logger.Debug<HealthCheckNotifier>("Does not run on slave servers.");
|
||||
return true; // DO repeat, server role can change
|
||||
case ServerRole.Unknown:
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Web.Scheduling
|
||||
// not on slaves nor unknown role servers
|
||||
switch (_runtime.ServerRole)
|
||||
{
|
||||
case ServerRole.Slave:
|
||||
case ServerRole.Replica:
|
||||
_logger.Debug<KeepAlive>("Does not run on slave servers.");
|
||||
return true; // role may change!
|
||||
case ServerRole.Unknown:
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
switch (_runtime.ServerRole)
|
||||
{
|
||||
case ServerRole.Slave:
|
||||
case ServerRole.Replica:
|
||||
_logger.Debug<LogScrubber>("Does not run on slave servers.");
|
||||
return true; // DO repeat, server role can change
|
||||
case ServerRole.Unknown:
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Web.Scheduling
|
||||
|
||||
switch (_runtime.ServerRole)
|
||||
{
|
||||
case ServerRole.Slave:
|
||||
case ServerRole.Replica:
|
||||
_logger.Debug<ScheduledPublishing>("Does not run on slave servers.");
|
||||
return true; // DO repeat, server role can change
|
||||
case ServerRole.Unknown:
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Umbraco.Web.Scheduling
|
||||
{
|
||||
switch (_runtime.ServerRole)
|
||||
{
|
||||
case ServerRole.Slave:
|
||||
case ServerRole.Replica:
|
||||
_logger.Debug<ScheduledTasks>("Does not run on slave servers.");
|
||||
return true; // DO repeat, server role can change
|
||||
case ServerRole.Unknown:
|
||||
|
||||
@@ -144,7 +144,6 @@
|
||||
<Compile Include="Media\Exif\Utility.cs" />
|
||||
<Compile Include="Media\ImageHelper.cs" />
|
||||
<Compile Include="Media\UploadAutoFillProperties.cs" />
|
||||
<Compile Include="ContentExtensions.cs" />
|
||||
<Compile Include="Security\ActiveDirectoryBackOfficeUserPasswordChecker.cs" />
|
||||
<Compile Include="Security\BackOfficeClaimsIdentityFactory.cs" />
|
||||
<Compile Include="Security\BackOfficeUserManagerMarker.cs" />
|
||||
|
||||
Reference in New Issue
Block a user