diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
index c4dfc133a9..64bd8dc096 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
@@ -7,6 +7,7 @@
keyboardService, umbModelMapper, editorState, $http, eventsService, relationResource, overlayService, localizationService) {
var evts = [];
+ var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode;
//setup scope vars
$scope.defaultButton = null;
@@ -21,6 +22,8 @@
$scope.page.isNew = $scope.isNew ? true : false;
$scope.page.buttonGroupState = "init";
$scope.page.culture = $scope.culture;
+ $scope.page.hideActionsMenu = infiniteMode ? true : false;
+ $scope.page.hideChangeVariant = infiniteMode ? true : false;
$scope.allowOpen = true;
// add all editors to an editors array to support split view
@@ -31,8 +34,12 @@
};
function init(content) {
-
- createButtons(content);
+
+ if(infiniteMode) {
+ createInfiniteModeButtons(content);
+ } else {
+ createButtons(content);
+ }
editorState.set($scope.content);
@@ -157,7 +164,9 @@
// if there are any and then clear them so the collection no longer persists them.
serverValidationManager.executeAndClearAllSubscriptions();
- syncTreeNode($scope.content, data.path, true);
+ if(!infiniteMode) {
+ syncTreeNode($scope.content, data.path, true);
+ }
resetLastListPageNumber($scope.content);
@@ -185,6 +194,23 @@
}
+ // create infinite editing buttons
+ function createInfiniteModeButtons(content) {
+
+ $scope.page.allowInfinitePublishAndClose = false;
+ $scope.page.allowInfiniteSaveAndClose = false;
+
+ // check for publish rights
+ if(_.contains(content.allowedActions, "U")) {
+ $scope.page.allowInfinitePublishAndClose = true;
+
+ // check for save rights
+ } else if( _.contains(content.allowedActions, "A")) {
+ $scope.page.allowInfiniteSaveAndClose = true;
+ }
+
+ }
+
/** Syncs the content item to it's tree node - this occurs on first load and after saving */
function syncTreeNode(content, path, initialLoad) {
@@ -221,7 +247,10 @@
}).then(function (data) {
//success
init($scope.content);
- syncTreeNode($scope.content, data.path);
+
+ if(!infiniteMode) {
+ syncTreeNode($scope.content, data.path);
+ }
$scope.page.buttonGroupState = "success";
return $q.when(data);
@@ -311,7 +340,9 @@
init($scope.content);
- syncTreeNode($scope.content, data.path);
+ if(!infiniteMode) {
+ syncTreeNode($scope.content, data.path);
+ }
$scope.page.buttonGroupState = "success";
@@ -505,6 +536,30 @@
}, 500);
};
+ /* publish method used in infinite editing */
+ $scope.publishAndClose = function(content) {
+ $scope.publishAndCloseButtonState = "busy";
+ performSave({ saveMethod: contentResource.publish, action: "publish" }).then(function(){
+ if($scope.infiniteModel.submit) {
+ $scope.infiniteModel.contentNode = content;
+ $scope.infiniteModel.submit($scope.infiniteModel);
+ }
+ $scope.publishAndCloseButtonState = "success";
+ }).catch(angular.noop);;
+ };
+
+ /* save method used in infinite editing */
+ $scope.saveAndClose = function(content) {
+ $scope.saveAndCloseButtonState = "busy";
+ performSave({ saveMethod: $scope.saveMethod(), action: "save" }).then(function(){
+ if($scope.infiniteModel.submit) {
+ $scope.infiniteModel.contentNode = content;
+ $scope.infiniteModel.submit($scope.infiniteModel);
+ }
+ $scope.saveAndCloseButtonState = "success";
+ }).catch(angular.noop);;
+ };
+
function moveNode(node, target) {
contentResource.move({ "parentId": target.id, "id": node.id })
@@ -516,7 +571,9 @@
}
// sync the destination node
- navigationService.syncTree({ tree: "content", path: path, forceReload: true, activate: false });
+ if(!infiniteMode) {
+ navigationService.syncTree({ tree: "content", path: path, forceReload: true, activate: false });
+ }
$scope.page.buttonRestore = "success";
notificationsService.success("Successfully restored " + node.name + " to " + target.name);
@@ -533,8 +590,8 @@
// methods for infinite editing
$scope.close = function() {
- if($scope.model.close) {
- $scope.model.close($scope.model);
+ if($scope.infiniteModel.close) {
+ $scope.infiniteModel.close($scope.infiniteModel);
}
};
@@ -563,7 +620,7 @@
getMethod: "&",
getScaffoldMethod: "&?",
culture: "=?",
- model: "=?"
+ infiniteModel: "=?"
}
};
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js
index cff26ae2e1..f29f41656d 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js
@@ -313,6 +313,7 @@ Use this directive to construct a header inside the main editor window.
name: "=",
nameLocked: "=",
menu: "=",
+ hideMenu: "",
icon: "=",
hideIcon: "@",
alias: "=",
@@ -321,6 +322,7 @@ Use this directive to construct a header inside the main editor window.
hideDescription: "@",
descriptionLocked: "@",
variants: "=",
+ hideChangeVariant: "",
navigation: "=",
key: "=",
onBack: "&?",
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umblaunchminieditor.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umblaunchminieditor.directive.js
deleted file mode 100644
index 11b934ce96..0000000000
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umblaunchminieditor.directive.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
-* @ngdoc directive
-* @name umbraco.directives.directive:umbLaunchMiniEditor
-* @restrict E
-* @function
-* @description
-* Used on a button to launch a mini content editor editor dialog
-**/
-angular.module("umbraco.directives")
- .directive('umbLaunchMiniEditor', function (miniEditorHelper) {
- return {
- restrict: 'A',
- replace: false,
- scope: {
- node: '=umbLaunchMiniEditor',
- },
- link: function(scope, element, attrs) {
-
- element.click(function() {
- miniEditorHelper.launchMiniEditor(scope.node);
- });
-
- }
- };
- });
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
index 4ab253092b..0bbfe34fe1 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
@@ -85,6 +85,23 @@
open(editor);
}
+ /**
+ * @ngdoc method
+ * @name umbraco.services.editorService#contentPicker
+ * @methodOf umbraco.services.editorService
+ *
+ * @description
+ * Opens a content picker in infinite editing, the submit callback returns an array of selected items
+ * @returns {Object} editor object
+ */
+ function contentPicker(editor) {
+ editor.view = "views/common/infiniteeditors/treepicker/treepicker.html";
+ editor.size = "small";
+ editor.section = "content";
+ editor.treeAlias = "content";
+ open(editor);
+ }
+
/**
* @ngdoc method
* @name umbraco.services.editorService#mediaEditor
@@ -174,16 +191,99 @@
open(editor);
}
+ function queryBuilder(editor) {
+ editor.view = "views/common/infiniteeditors/querybuilder/querybuilder.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ function treePicker(editor) {
+ editor.view = "views/common/infiniteeditors/treepicker/treepicker.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ function nodePermissions(editor) {
+ editor.view = "views/common/infiniteeditors/nodepermissions/nodepermissions.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ function insertCodeSnippet(editor) {
+ editor.view = "views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ /**
+ * @ngdoc method
+ * @name umbraco.services.editorService#userGroupPicker
+ * @methodOf umbraco.services.editorService
+ *
+ * @description
+ * Opens the user group picker in infinite editing, the submit callback returns an array of the selected user groups
+ * @param {Callback} editor.submit Submits the editor
+ * @param {Callback} editor.close Closes the editor
+ * @returns {Object} editor object
+ */
+ function userGroupPicker(editor) {
+ editor.view = "views/common/infiniteeditors/usergrouppicker/usergrouppicker.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ /**
+ * @ngdoc method
+ * @name umbraco.services.editorService#sectionPicker
+ * @methodOf umbraco.services.editorService
+ *
+ * @description
+ * Opens the section picker in infinite editing, the submit callback returns an array of the selected sections
+ * @param {Callback} editor.submit Submits the editor
+ * @param {Callback} editor.close Closes the editor
+ * @returns {Object} editor object
+ */
+ function sectionPicker(editor) {
+ editor.view = "views/common/infiniteeditors/sectionpicker/sectionpicker.html";
+ editor.size = "small";
+ open(editor);
+ }
+
+ /**
+ * @ngdoc method
+ * @name umbraco.services.editorService#sectionPicker
+ * @methodOf umbraco.services.editorService
+ *
+ * @description
+ * Opens the section picker in infinite editing, the submit callback returns an array of the selected users
+ * @param {Callback} editor.submit Submits the editor
+ * @param {Callback} editor.close Closes the editor
+ * @returns {Object} editor object
+ */
+ function userPicker(editor) {
+ editor.view = "views/common/infiniteeditors/userpicker/userpicker.html";
+ editor.size = "small";
+ open(editor);
+ }
+
var service = {
getEditors: getEditors,
open: open,
close: close,
mediaEditor: mediaEditor,
contentEditor: contentEditor,
+ contentPicker: contentPicker,
mediaPicker: mediaPicker,
iconPicker: iconPicker,
documentTypeEditor: documentTypeEditor,
- mediaTypeEditor: mediaTypeEditor
+ mediaTypeEditor: mediaTypeEditor,
+ queryBuilder: queryBuilder,
+ treePicker: treePicker,
+ nodePermissions: nodePermissions,
+ insertCodeSnippet: insertCodeSnippet,
+ userGroupPicker: userGroupPicker,
+ sectionPicker: sectionPicker,
+ userPicker: userPicker
};
return service;
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/minieditorhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/minieditorhelper.service.js
deleted file mode 100644
index 693457c7e8..0000000000
--- a/src/Umbraco.Web.UI.Client/src/common/services/minieditorhelper.service.js
+++ /dev/null
@@ -1,89 +0,0 @@
-(function () {
- 'use strict';
-
- function miniEditorHelper(dialogService, editorState, fileManager, contentEditingHelper, $q) {
-
- var launched = false;
-
- function launchMiniEditor(node) {
-
- var deferred = $q.defer();
-
- launched = true;
-
- //We need to store the current files selected in the file manager locally because the fileManager
- // is a singleton and is shared globally. The mini dialog will also be referencing the fileManager
- // and we don't want it to be sharing the same files as the main editor. So we'll store the current files locally here,
- // clear them out and then launch the dialog. When the dialog closes, we'll reset the fileManager to it's previous state.
- var currFiles = _.groupBy(fileManager.getFiles(), "alias");
- fileManager.clearFiles();
-
- //We need to store the original editorState entity because it will need to change when the mini editor is loaded so that
- // any property editors that are working with editorState get given the correct entity, otherwise strange things will
- // start happening.
- var currEditorState = editorState.getCurrent();
-
- dialogService.open({
- template: "views/common/dialogs/content/edit.html",
- id: node.id,
- closeOnSave: true,
- tabFilter: ["Generic properties"],
- callback: function (data) {
-
- //set the node name back
- node.name = data.name;
-
- //reset the fileManager to what it was
- fileManager.clearFiles();
- _.each(currFiles, function (val, key) {
- fileManager.setFiles(key, _.map(currFiles['upload'], function (i) { return i.file; }));
- });
-
- //reset the editor state
- editorState.set(currEditorState);
-
- //Now we need to check if the content item that was edited was actually the same content item
- // as the main content editor and if so, update all property data
- if (data.id === currEditorState.id) {
- var changed = contentEditingHelper.reBindChangedProperties(currEditorState, data);
- }
-
- launched = false;
-
- deferred.resolve(data);
-
- },
- closeCallback: function () {
- //reset the fileManager to what it was
- fileManager.clearFiles();
- _.each(currFiles, function (val, key) {
- fileManager.setFiles(key, _.map(currFiles['upload'], function (i) { return i.file; }));
- });
-
- //reset the editor state
- editorState.set(currEditorState);
-
- launched = false;
-
- deferred.reject();
-
- }
- });
-
- return deferred.promise;
-
- }
-
- var service = {
- launchMiniEditor: launchMiniEditor
- };
-
- return service;
-
- }
-
-
- angular.module('umbraco.services').factory('miniEditorHelper', miniEditorHelper);
-
-
-})();
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor.less b/src/Umbraco.Web.UI.Client/src/less/components/editor.less
index 7e37b622d3..e7564ca2ca 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/editor.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/editor.less
@@ -136,6 +136,9 @@ a.umb-editor-header__close-split-view:hover {
font-size: 13px;
color: @gray-4;
background-color: @white;
+}
+
+a.umb-variant-switcher__toggle {
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
&:hover {
background-color: @gray-10;
diff --git a/src/Umbraco.Web.UI.Client/src/less/tree.less b/src/Umbraco.Web.UI.Client/src/less/tree.less
index 201ea238bf..d5ef7ccec5 100644
--- a/src/Umbraco.Web.UI.Client/src/less/tree.less
+++ b/src/Umbraco.Web.UI.Client/src/less/tree.less
@@ -162,6 +162,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+ flex: 1 0 auto;
}
.umb-tree li > div:hover a:not(.umb-options) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.controller.js
deleted file mode 100644
index c4aa39930d..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.controller.js
+++ /dev/null
@@ -1,103 +0,0 @@
-function ContentEditDialogController($scope, editorState, $routeParams, $q, $timeout, $window, appState, contentResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, treeService, fileManager, formHelper, umbRequestHelper, umbModelMapper, $http) {
-
- $scope.defaultButton = null;
- $scope.subButtons = [];
- var dialogOptions = $scope.$parent.dialogOptions;
-
- // This is a helper method to reduce the amount of code repitition for actions: Save, Publish, SendToPublish
- function performSave(args) {
- contentEditingHelper.contentEditorPerformSave({
- saveMethod: args.saveMethod,
- scope: $scope,
- content: $scope.content
- }).then(function (content) {
- //success
- if (dialogOptions.closeOnSave) {
- $scope.submit(content);
- }
-
- }, function(err) {
- //error
- });
- }
-
- function filterTabs(entity, blackList) {
- if (blackList) {
- _.each(entity.tabs, function (tab) {
- tab.hide = _.contains(blackList, tab.alias);
- });
- }
-
- return entity;
- };
-
- function init(content) {
- var buttons = contentEditingHelper.configureContentEditorButtons({
- create: $routeParams.create,
- content: content,
- methods: {
- saveAndPublish: $scope.saveAndPublish,
- sendToPublish: $scope.sendToPublish,
- save: $scope.save,
- unPublish: angular.noop
- }
- });
- $scope.defaultButton = buttons.defaultButton;
- $scope.subButtons = buttons.subButtons;
-
- //This is a total hack but we have really no other way of sharing data to the property editors of this
- // content item, so we'll just set the property on the content item directly
- $scope.content.isDialogEditor = true;
-
- editorState.set($scope.content);
- }
-
- //check if the entity is being passed in, otherwise load it from the server
- if (angular.isObject(dialogOptions.entity)) {
- $scope.loaded = true;
- $scope.content = filterTabs(dialogOptions.entity, dialogOptions.tabFilter);
- init($scope.content);
- }
- else {
- contentResource.getById(dialogOptions.id)
- .then(function(data) {
- $scope.loaded = true;
- $scope.content = filterTabs(data, dialogOptions.tabFilter);
- init($scope.content);
- //in one particular special case, after we've created a new item we redirect back to the edit
- // route but there might be server validation errors in the collection which we need to display
- // after the redirect, so we will bind all subscriptions which will show the server validation errors
- // if there are any and then clear them so the collection no longer persists them.
- serverValidationManager.executeAndClearAllSubscriptions();
- });
- }
-
- $scope.sendToPublish = function () {
- performSave({ saveMethod: contentResource.sendToPublish });
- };
-
- $scope.saveAndPublish = function () {
- performSave({ saveMethod: contentResource.publish });
- };
-
- $scope.save = function () {
- performSave({ saveMethod: contentResource.save });
- };
-
- // this method is called for all action buttons and then we proxy based on the btn definition
- $scope.performAction = function (btn) {
-
- if (!btn || !angular.isFunction(btn.handler)) {
- throw "btn.handler must be a function reference";
- }
-
- if (!$scope.busy) {
- btn.handler.apply(this);
- }
- };
-
-}
-
-
-angular.module("umbraco")
- .controller("Umbraco.Dialogs.Content.EditController", ContentEditDialogController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.html
deleted file mode 100644
index a5b73d1c98..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.controller.js
similarity index 80%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.controller.js
index e4c27fa63b..90d3e945a4 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function InsertOverlayController($scope, localizationService) {
+ function InsertOverlayController($scope, localizationService, editorService) {
var vm = this;
@@ -9,6 +9,7 @@
vm.openPageFieldOverlay = openPageFieldOverlay;
vm.openDictionaryItemOverlay = openDictionaryItemOverlay;
vm.openPartialOverlay = openPartialOverlay;
+ vm.close = close;
function onInit() {
@@ -88,8 +89,7 @@
var subtitle = values[1];
var emptyStateMessage = values[2];
- vm.dictionaryItemOverlay = {
- view: "treepicker",
+ var dictionaryItemPicker = {
section: "settings",
treeAlias: "dictionary",
entityType: "dictionary",
@@ -97,25 +97,22 @@
title: title,
subtitle: subtitle,
emptyStateMessage: emptyStateMessage,
- show: true,
select: function(node){
-
$scope.model.insert = {
"type": "dictionary",
"node": node
};
-
$scope.model.submit($scope.model);
-
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
},
- close: function(model) {
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ close: function() {
+ editorService.close();
}
};
+
+ editorService.treePicker(dictionaryItemPicker);
+
});
}
@@ -123,8 +120,7 @@
localizationService.localize("template_insertPartialView").then(function(value){
var title = value;
- vm.partialItemOverlay = {
- view: "treepicker",
+ var partialItemPicker = {
section: "settings",
treeAlias: "partialViews",
entityType: "partialView",
@@ -136,32 +132,32 @@
}
},
filterCssClass: "not-allowed",
- show: true,
- select: function(node){
-
+ select: function(node) {
$scope.model.insert = {
"type": "partial",
"node": node
};
-
- $scope.model.submit($scope.model);
-
- vm.partialItemOverlay.show = false;
- vm.partialItemOverlay = null;
+ $scope.model.submit($scope.model);
+ editorService.close();
},
-
- close: function (model) {
- vm.partialItemOverlay.show = false;
- vm.partialItemOverlay = null;
+ close: function () {
+ editorService.close();
}
};
+ editorService.treePicker(partialItemPicker);
});
}
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
onInit();
}
- angular.module("umbraco").controller("Umbraco.Overlays.InsertOverlay", InsertOverlayController);
+ angular.module("umbraco").controller("Umbraco.Editors.InsertOverlay", InsertOverlayController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html
new file mode 100644
index 0000000000..2cc5cb2e5c
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.controller.js
similarity index 52%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.controller.js
index 68e1c4cd86..15802feed9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.controller.js
@@ -5,21 +5,34 @@
var vm = this;
- function onInit() {
+ vm.submit = submit;
+ vm.close = close;
+ function onInit() {
// set default title
if(!$scope.model.title) {
localizationService.localize("defaultdialogs_permissionsEdit").then(function(value){
$scope.model.title = value + " " + $scope.model.node.name;
});
}
-
+ }
+
+ function submit() {
+ if($scope.model.submit) {
+ $scope.model.submit($scope.model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
}
onInit();
}
- angular.module("umbraco").controller("Umbraco.Overlays.NodePermissionsController", NodePermissionsController);
+ angular.module("umbraco").controller("Umbraco.Editors.NodePermissionsController", NodePermissionsController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.html
new file mode 100644
index 0000000000..d41fc862b7
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/nodepermissions/nodepermissions.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js
similarity index 90%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js
index 7c1c6c78f3..fc273ab089 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.controller.js
@@ -1,7 +1,7 @@
(function() {
"use strict";
- function QueryBuilderOverlayController($scope, templateQueryResource, localizationService) {
+ function QueryBuilderOverlayController($scope, templateQueryResource, localizationService, editorService) {
var everything = "";
var myWebsite = "";
@@ -31,6 +31,8 @@
vm.setFilterTerm = setFilterTerm;
vm.changeConstraintValue = changeConstraintValue;
vm.datePickerChange = datePickerChange;
+ vm.submit = submit;
+ vm.close = close;
function onInit() {
@@ -87,33 +89,24 @@
}
function chooseSource(query) {
- vm.contentPickerOverlay = {
- view: "treepicker",
- section: "content",
- treeAlias: "content",
- show: true,
+ var contentPicker = {
submit: function(model) {
-
var selectedNodeId = model.selection[0].id;
var selectedNodeName = model.selection[0].name;
-
if (selectedNodeId > 0) {
query.source = { id: selectedNodeId, name: selectedNodeName };
} else {
query.source.name = myWebsite;
delete query.source.id;
}
-
throttledFunc();
-
- vm.contentPickerOverlay.show = false;
- vm.contentPickerOverlay = null;
+ editorService.close();
},
- close: function(oldModel) {
- vm.contentPickerOverlay.show = false;
- vm.contentPickerOverlay = null;
+ close: function() {
+ editorService.close();
}
};
+ editorService.contentPicker(contentPicker);
}
function getPropertyOperators(property) {
@@ -194,6 +187,18 @@
}
}
+ function submit(model) {
+ if($scope.model.submit) {
+ $scope.model.submit(model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
var throttledFunc = _.throttle(function() {
templateQueryResource.postTemplateQuery(vm.query)
@@ -216,6 +221,6 @@
});
}
- angular.module("umbraco").controller("Umbraco.Overlays.QueryBuilderController", QueryBuilderOverlayController);
+ angular.module("umbraco").controller("Umbraco.Editors.QueryBuilderController", QueryBuilderOverlayController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html
new file mode 100644
index 0000000000..e7f0cd9a1b
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/querybuilder/querybuilder.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ where
+
+
+ and
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{model.result.resultCount}} items, returned in {{model.result.executionTime}} ms
+
+
+
+
+ {{model.result.queryExpression}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.controller.js
similarity index 84%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.controller.js
index f39da7074d..d6e8978e38 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.controller.js
@@ -9,6 +9,8 @@
vm.loading = false;
vm.selectSection = selectSection;
+ vm.submit = submit;
+ vm.close = close;
//////////
@@ -80,10 +82,22 @@
});
}
+ function submit(model) {
+ if($scope.model.submit) {
+ $scope.model.submit(model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
onInit();
}
- angular.module("umbraco").controller("Umbraco.Overlays.SectionPickerController", SectionPickerController);
+ angular.module("umbraco").controller("Umbraco.Editors.SectionPickerController", SectionPickerController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.html
new file mode 100644
index 0000000000..8ca1993dcc
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/sectionpicker/sectionpicker.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
similarity index 98%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
index da6d2582e3..5b5de1b393 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
@@ -1,5 +1,5 @@
//used for the media picker dialog
-angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
+angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
function ($scope,
$q,
entityResource,
@@ -63,6 +63,8 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
vm.hideSearch = hideSearch;
vm.closeMiniListView = closeMiniListView;
vm.selectListViewNode = selectListViewNode;
+ vm.submit = submit;
+ vm.close = close;
function initDialogTree() {
vm.dialogTreeApi.callbacks.treeLoaded(treeLoadedHandler);
@@ -97,7 +99,7 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
});
}
}
- else if (vm.treeAlias === "member" || vm.section) {
+ else if (vm.treeAlias === "member" || vm.section === "member") {
vm.entityType = "Member";
if (!$scope.model.title) {
localizationService.localize("defaultdialogs_selectMember").then(function(value){
@@ -609,6 +611,18 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
function closeMiniListView() {
vm.miniListView = undefined;
}
+
+ function submit(model) {
+ if($scope.model.submit) {
+ $scope.model.submit(model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
//initialize
onInit();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.html
new file mode 100644
index 0000000000..7270abbc7c
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.html
@@ -0,0 +1,111 @@
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.controller.js
similarity index 82%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.controller.js
index 72d56f7884..8e075e1ab4 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.controller.js
@@ -9,6 +9,8 @@
vm.loading = false;
vm.selectUserGroup = selectUserGroup;
+ vm.submit = submit;
+ vm.close = close;
//////////
@@ -75,10 +77,22 @@
}
+ function submit(model) {
+ if($scope.model.submit) {
+ $scope.model.submit(model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
onInit();
}
- angular.module("umbraco").controller("Umbraco.Overlays.UserGroupPickerController", UserGroupPickerController);
+ angular.module("umbraco").controller("Umbraco.Editors.UserGroupPickerController", UserGroupPickerController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.html
new file mode 100644
index 0000000000..e97d80648b
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/usergrouppicker/usergrouppicker.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No user groups have been added
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.controller.js
similarity index 86%
rename from src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.controller.js
rename to src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.controller.js
index 2ccd17934b..2bd73a5558 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.controller.js
@@ -12,6 +12,8 @@
vm.selectUser = selectUser;
vm.searchUsers = searchUsers;
vm.changePageNumber = changePageNumber;
+ vm.submit = submit;
+ vm.close = close;
//////////
@@ -102,10 +104,22 @@
getUsers();
}
+ function submit(model) {
+ if($scope.model.submit) {
+ $scope.model.submit(model);
+ }
+ }
+
+ function close() {
+ if($scope.model.close) {
+ $scope.model.close();
+ }
+ }
+
onInit();
}
- angular.module("umbraco").controller("Umbraco.Overlays.UserPickerController", UserPickerController);
+ angular.module("umbraco").controller("Umbraco.Editors.UserPickerController", UserPickerController);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.html
new file mode 100644
index 0000000000..bc6c8b5761
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/userpicker/userpicker.html
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.controller.js
deleted file mode 100644
index 29f4be0261..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.controller.js
+++ /dev/null
@@ -1,57 +0,0 @@
-angular.module("umbraco")
- .controller("Umbraco.Overlays.HelpController", function ($scope, $location, $routeParams, helpService, userService, localizationService) {
- $scope.section = $routeParams.section;
- $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion;
- $scope.model.subtitle = "Umbraco version" + " " + $scope.version;
-
- if(!$scope.model.title) {
- localizationService.localize("general_help").then(function(value) {
- $scope.model.title = value;
- });
- }
-
- if(!$scope.section){
- $scope.section = "content";
- }
-
- $scope.sectionName = $scope.section;
-
- var rq = {};
- rq.section = $scope.section;
-
- //translate section name
- localizationService.localize("sections_" + rq.section).then(function (value) {
- $scope.sectionName = value;
- });
-
- userService.getCurrentUser().then(function(user){
-
- rq.lang = user.locale;
-
- if($routeParams.url){
- rq.path = decodeURIComponent($routeParams.url);
-
- if(rq.path.indexOf(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath) === 0){
- rq.path = rq.path.substring(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath.length);
- }
-
- if(rq.path.indexOf(".aspx") > 0){
- rq.path = rq.path.substring(0, rq.path.indexOf(".aspx"));
- }
-
- }else{
- rq.path = rq.section + "/" + $routeParams.tree + "/" + $routeParams.method;
- }
-
- helpService.findHelp(rq).then(function(topics){
- $scope.topics = topics;
- });
-
- helpService.findVideos(rq).then(function(videos){
- $scope.videos = videos;
- });
-
- });
-
-
- });
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.html
deleted file mode 100644
index ecfdd24828..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/help/help.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
Help topics for : {{sectionName}}
-
-
-
-
-
-
Video chapters for : {{sectionName}}
-
-
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html
deleted file mode 100644
index 19005ccc69..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html
+++ /dev/null
@@ -1,46 +0,0 @@
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.html
deleted file mode 100644
index 7578266562..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/nodepermissions/nodepermissions.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html
deleted file mode 100644
index d469c45181..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- where
-
-
- and
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{model.result.resultCount}} items, returned in {{model.result.executionTime}} ms
-
-
-
-
-{{model.result.queryExpression}}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.html
deleted file mode 100644
index 577dab63b2..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/sectionpicker/sectionpicker.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html
deleted file mode 100644
index ef9b063739..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/treepicker/treepicker.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
{{vm.selectedLanguage.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ vm.emptyStateMessage }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.html
deleted file mode 100644
index 4768052844..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/usergrouppicker/usergrouppicker.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No user groups have been added
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.html
deleted file mode 100644
index 517a63f60b..0000000000
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/userpicker/userpicker.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
index 750b20986f..c5cecb2190 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
@@ -16,12 +16,14 @@
+
+
+
+
+
+
-
+
{{vm.currentVariant.language.name}}
+
+ {{vm.currentVariant.language.name}}
+
+
@@ -102,7 +106,7 @@
-
+
+ infinite-model="model">
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js
index 00551ff8ba..c58a5573a9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function partialViewMacrosEditController($scope, $routeParams, codefileResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, angularHelper, $timeout, contentEditingHelper, localizationService, templateHelper, macroResource) {
+ function partialViewMacrosEditController($scope, $routeParams, codefileResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, angularHelper, $timeout, contentEditingHelper, localizationService, templateHelper, macroResource, editorService) {
var vm = this;
@@ -121,50 +121,38 @@
}
function openInsertOverlay() {
-
- vm.insertOverlay = {
- view: "insert",
+ var insertOverlay = {
allowedTypes: {
macro: true,
dictionary: true,
umbracoField: true
},
- hideSubmitButton: true,
- show: true,
submit: function(model) {
-
switch(model.insert.type) {
case "macro":
var macroObject = macroService.collectValueData(model.insert.selectedMacro, model.insert.macroParams, "Mvc");
insert(macroObject.syntax);
break;
-
case "dictionary":
var code = templateHelper.getInsertDictionarySnippet(model.insert.node.name);
insert(code);
break;
-
case "umbracoField":
insert(model.insert.umbracoField);
break;
}
-
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
-
+ editorService.close();
},
close: function(oldModel) {
// close the dialog
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
-
+ editorService.insertCodeSnippet(insertOverlay);
}
-
function openMacroOverlay() {
vm.macroPickerOverlay = {
@@ -224,56 +212,46 @@
var title = values[0];
var emptyStateMessage = values[1];
- vm.dictionaryItemOverlay = {
- view: "treepicker",
+ var dictionaryPicker = {
section: "settings",
treeAlias: "dictionary",
entityType: "dictionary",
multiPicker: false,
- show: true,
title: title,
emptyStateMessage: emptyStateMessage,
select: function(node){
-
var code = templateHelper.getInsertDictionarySnippet(node.name);
insert(code);
-
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
},
close: function (model) {
// close dialog
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.treePicker(dictionaryPicker);
+
});
}
function openQueryBuilderOverlay() {
- vm.queryBuilderOverlay = {
- view: "querybuilder",
- show: true,
+ var queryBuilder = {
submit: function (model) {
-
var code = templateHelper.getQuerySnippet(model.result.queryExpression);
insert(code);
-
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ editorService.close();
},
-
close: function (model) {
// close dialog
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.queryBuilder(queryBuilder);
}
/* Local functions */
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html
index c3877aa8d1..810b1cb8ae 100644
--- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html
@@ -76,13 +76,6 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js
index f6e017a8e9..d5a17c83c7 100644
--- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function PartialViewsEditController($scope, $routeParams, codefileResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, angularHelper, $timeout, contentEditingHelper, localizationService, templateHelper) {
+ function PartialViewsEditController($scope, $routeParams, codefileResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, angularHelper, $timeout, contentEditingHelper, localizationService, templateHelper, editorService) {
var vm = this;
@@ -126,16 +126,12 @@
}
function openInsertOverlay() {
-
- vm.insertOverlay = {
- view: "insert",
+ var insertOverlay = {
allowedTypes: {
macro: true,
dictionary: true,
umbracoField: true
},
- hideSubmitButton: true,
- show: true,
submit: function(model) {
switch(model.insert.type) {
@@ -143,30 +139,24 @@
var macroObject = macroService.collectValueData(model.insert.selectedMacro, model.insert.macroParams, "Mvc");
insert(macroObject.syntax);
break;
-
case "dictionary":
var code = templateHelper.getInsertDictionarySnippet(model.insert.node.name);
insert(code);
break;
-
case "umbracoField":
insert(model.insert.umbracoField);
break;
}
-
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
-
+ editorService.close();
},
- close: function(oldModel) {
+ close: function() {
// close the dialog
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
-
+ editorService.insertCodeSnippet(insertOverlay);
}
@@ -229,57 +219,45 @@
var title = values[0];
var emptyStateMessage = values[1];
- vm.dictionaryItemOverlay = {
- view: "treepicker",
+ var dictionaryItem = {
section: "settings",
treeAlias: "dictionary",
entityType: "dictionary",
multiPicker: false,
- show: true,
title: title,
emptyStateMessage: emptyStateMessage,
select: function(node){
-
var code = templateHelper.getInsertDictionarySnippet(node.name);
insert(code);
-
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
},
close: function (model) {
// close dialog
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.treePicker(dictionaryItem);
});
}
function openQueryBuilderOverlay() {
- vm.queryBuilderOverlay = {
- view: "querybuilder",
- show: true,
+ var queryBuilder = {
title: "Query for content",
-
submit: function (model) {
-
var code = templateHelper.getQuerySnippet(model.result.queryExpression);
insert(code);
-
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ editorService.close();
},
-
- close: function (model) {
+ close: function () {
// close dialog
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.queryBuilder(queryBuilder);
}
/* Local functions */
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html
index ef5dae7adf..4a16ad4ebf 100644
--- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html
@@ -84,13 +84,6 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js
index 3e1999cfb0..a4b54b0e10 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js
@@ -1,6 +1,6 @@
//this controller simply tells the dialogs service to open a mediaPicker window
//with a specified callback, this callback will receive an object with a selection on it
-function mediaPickerController($scope, dialogService, entityResource, $log, iconHelper) {
+function mediaPickerController($scope, dialogService, entityResource, $log, iconHelper, editorService) {
function trim(str, chr) {
var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g');
@@ -14,7 +14,6 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
$scope.sortable = false;
var dialogOptions = {
- view: "treepicker",
multiPicker: false,
entityType: "Media",
section: "media",
@@ -27,30 +26,26 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
angular.extend(dialogOptions, $scope.model.config);
}
- $scope.openContentPicker = function() {
- $scope.contentPickerOverlay = dialogOptions;
- $scope.contentPickerOverlay.show = true;
+ $scope.openTreePicker = function () {
+ var treePicker = dialogOptions;
- $scope.contentPickerOverlay.submit = function(model) {
+ treePicker.submit = function (model) {
+ if (treePicker.multiPicker) {
+ _.each(model.selection, function (item, i) {
+ $scope.add(item);
+ });
+ } else {
+ $scope.clear();
+ $scope.add(model.selection[0]);
+ }
+ editorService.close();
+ };
- if ($scope.contentPickerOverlay.multiPicker) {
- _.each(model.selection, function (item, i) {
- $scope.add(item);
- });
- }
- else {
- $scope.clear();
- $scope.add(model.selection[0]);
- }
+ treePicker.close = function () {
+ editorService.close();
+ };
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
-
- $scope.contentPickerOverlay.close = function(oldModel) {
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
+ editorService.treePicker(treePicker);
}
$scope.remove =function(index){
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html
index a130c54277..03bcad9289 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html
@@ -11,23 +11,16 @@
allow-remove="allowRemove"
allow-edit="allowEdit"
on-remove="remove($index)"
- on-edit="openContentPicker()">
+ on-edit="openTreePicker()">
Add
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js
index 5c84bf8c01..1c61baf54a 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js
@@ -3,7 +3,7 @@
angular.module('umbraco')
.controller("Umbraco.PrevalueEditors.TreePickerController",
- function ($scope, dialogService, entityResource, $log, iconHelper) {
+ function ($scope, dialogService, entityResource, $log, iconHelper, editorService) {
$scope.renderModel = [];
$scope.ids = [];
@@ -12,7 +12,6 @@ angular.module('umbraco')
$scope.sortable = false;
var config = {
- view: "treepicker",
multiPicker: false,
entityType: "Document",
type: "content",
@@ -51,28 +50,24 @@ angular.module('umbraco')
}
$scope.openContentPicker = function () {
- $scope.treePickerOverlay = config;
- $scope.treePickerOverlay.section = config.type;
- $scope.treePickerOverlay.show = true;
-
- $scope.treePickerOverlay.submit = function (model) {
+ var treePicker = config;
+ treePicker.section = config.type;
+ treePicker.submit = function (model) {
if (config.multiPicker) {
populate(model.selection);
} else {
populate(model.selection[0]);
}
-
- $scope.treePickerOverlay.show = false;
- $scope.treePickerOverlay = null;
+ editorService.close();
};
- $scope.treePickerOverlay.close = function (oldModel) {
- $scope.treePickerOverlay.show = false;
- $scope.treePickerOverlay = null;
+ treePicker.close = function () {
+ editorService.close();
};
- }
+ editorService.treePicker(treePicker);
+ };
$scope.remove = function (index) {
$scope.renderModel.splice(index, 1);
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html
index 7d68a9c82e..ae260b4502 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html
@@ -23,11 +23,4 @@
Add
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js
index 5a53e00e1c..6d5d205fa1 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.controller.js
@@ -3,7 +3,7 @@
angular.module('umbraco')
.controller("Umbraco.PrevalueEditors.TreeSourceController",
- function($scope, dialogService, entityResource, $log, iconHelper){
+ function($scope, dialogService, entityResource, $log, iconHelper, editorService){
if (!$scope.model) {
$scope.model = {};
@@ -33,20 +33,21 @@ angular.module('umbraco')
$scope.openContentPicker =function(){
- $scope.treePickerOverlay = {
- view: "treepicker",
+ var treePicker = {
idType: $scope.model.config.idType,
section: $scope.model.value.type,
treeAlias: $scope.model.value.type,
multiPicker: false,
- show: true,
submit: function(model) {
var item = model.selection[0];
populate(item);
- $scope.treePickerOverlay.show = false;
- $scope.treePickerOverlay = null;
+ editorService.close();
+ },
+ close: function() {
+ editorService.close();
}
};
+ editorService.treePicker(treePicker);
};
$scope.clear = function() {
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
index df9f64db9f..4ad6fd5986 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treesource.html
@@ -77,11 +77,4 @@
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
index c51b375dc6..919f0fee39 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
@@ -10,10 +10,9 @@
* @param {any} angularHelper
* @param {any} navigationService
* @param {any} $location
- * @param {any} miniEditorHelper
* @param {any} localizationService
*/
-function contentPickerController($scope, entityResource, editorState, iconHelper, $routeParams, angularHelper, navigationService, $location, miniEditorHelper, localizationService) {
+function contentPickerController($scope, entityResource, editorState, iconHelper, $routeParams, angularHelper, navigationService, $location, localizationService, editorService) {
var unsubscribe;
@@ -117,7 +116,6 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
//the dialog options for the picker
var dialogOptions = {
- view: "treepicker",
multiPicker: $scope.model.config.multiPicker,
entityType: entityType,
filterCssClass: "not-allowed not-published",
@@ -185,28 +183,24 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
}
//dialog
- $scope.openContentPicker = function() {
- $scope.contentPickerOverlay = dialogOptions;
- $scope.contentPickerOverlay.show = true;
+ $scope.openContentPicker = function () {
+ $scope.contentPicker = dialogOptions;
- $scope.contentPickerOverlay.submit = function(model) {
+ $scope.contentPicker.submit = function (model) {
+ if (angular.isArray(model.selection)) {
+ _.each(model.selection, function (item, i) {
+ $scope.add(item);
+ });
+ }
+ angularHelper.getCurrentForm($scope).$setDirty();
+ editorService.close();
+ }
- if (angular.isArray(model.selection)) {
- _.each(model.selection, function (item, i) {
- $scope.add(item);
- });
- }
+ $scope.contentPicker.close = function () {
+ editorService.close();
+ }
- angularHelper.getCurrentForm($scope).$setDirty();
-
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- }
-
- $scope.contentPickerOverlay.close = function(oldModel) {
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- }
+ editorService.contentPicker($scope.contentPicker);
};
@@ -246,17 +240,25 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
$scope.renderModel = [];
};
- $scope.openMiniEditor = function(node) {
- miniEditorHelper.launchMiniEditor(node).then(function(updatedNode){
- // update the node
- node.name = updatedNode.name;
- node.published = updatedNode.hasPublishedVersion;
- if(entityType !== "Member") {
- entityResource.getUrl(updatedNode.id, entityType).then(function(data){
- node.url = data;
- });
+ $scope.openContentEditor = function(node) {
+ var contentEditor = {
+ id: node.id,
+ submit: function(model) {
+ // update the node
+ node.name = model.contentNode.name;
+ node.published = model.contentNode.hasPublishedVersion;
+ if(entityType !== "Member") {
+ entityResource.getUrl(model.contentNode.id, entityType).then(function(data){
+ node.url = data;
+ });
+ }
+ editorService.close();
+ },
+ close: function() {
+ editorService.close();
}
- });
+ };
+ editorService.contentEditor(contentEditor);
};
//when the scope is destroyed we need to unsubscribe
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html
index 6571dfcc03..0a41119a48 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html
@@ -15,7 +15,7 @@
allow-remove="allowRemoveButton"
allow-open="model.config.showOpenButton && allowOpenButton && !dialogEditor"
on-remove="remove($index)"
- on-open="openMiniEditor(node)">
+ on-open="openContentEditor(node)">
@@ -77,11 +77,4 @@
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.controller.js
index f8d5751ea1..fcb3e81fe9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.controller.js
@@ -1,6 +1,6 @@
//this controller simply tells the dialogs service to open a memberPicker window
//with a specified callback, this callback will receive an object with a selection on it
-function memberPickerController($scope, dialogService, entityResource, $log, iconHelper, angularHelper){
+function memberPickerController($scope, dialogService, entityResource, $log, iconHelper, angularHelper, editorService){
function trim(str, chr) {
var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^' + chr + '+|' + chr + '+$', 'g');
@@ -11,7 +11,6 @@ function memberPickerController($scope, dialogService, entityResource, $log, ico
$scope.allowRemove = true;
var dialogOptions = {
- view: "treepicker",
multiPicker: false,
entityType: "Member",
section: "member",
@@ -39,26 +38,24 @@ function memberPickerController($scope, dialogService, entityResource, $log, ico
angular.extend(dialogOptions, $scope.model.config);
}
- $scope.openMemberPicker = function() {
- $scope.memberPickerOverlay = dialogOptions;
- $scope.memberPickerOverlay.show = true;
+ $scope.openMemberPicker = function () {
- $scope.memberPickerOverlay.submit = function(model) {
+ var memberPicker = dialogOptions;
- if (model.selection) {
- _.each(model.selection, function(item, i) {
- $scope.add(item);
- });
- }
+ memberPicker.submit = function (model) {
+ if (model.selection) {
+ _.each(model.selection, function (item, i) {
+ $scope.add(item);
+ });
+ }
+ editorService.close();
+ };
- $scope.memberPickerOverlay.show = false;
- $scope.memberPickerOverlay = null;
- };
+ memberPicker.close = function () {
+ editorService.close();
+ };
- $scope.memberPickerOverlay.close = function(oldModel) {
- $scope.memberPickerOverlay.show = false;
- $scope.memberPickerOverlay = null;
- };
+ editorService.treePicker(memberPicker);
};
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.html
index 4d4d531876..d8f04eeae5 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/memberpicker/memberpicker.html
@@ -18,11 +18,4 @@
Add
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
index e0ba9e57b3..8aea4fb97f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js
@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.RelatedLinksController",
- function ($rootScope, $scope, dialogService, iconHelper) {
+ function ($rootScope, $scope, dialogService, iconHelper, editorService) {
if (!$scope.model.value) {
$scope.model.value = [];
@@ -18,61 +18,47 @@
$scope.currentEditLink = null;
$scope.hasError = false;
- $scope.internal = function($event) {
- $scope.currentEditLink = null;
+ $scope.internal = function ($event) {
+ $scope.currentEditLink = null;
- $scope.contentPickerOverlay = {
- view: "treepicker",
+ var contentPicker = {
section: "content",
treeAlias: "content",
multiPicker: false,
- show: true,
- idType: $scope.model.config.idType ? $scope.model.config.idType : "int"
+ idType: $scope.model.config.idType ? $scope.model.config.idType : "int",
+ submit: function (model) {
+ select(model.selection[0]);
+ editorService.close();
+ },
+ close: function () {
+ editorService.close();
+ }
};
- $scope.contentPickerOverlay.submit = function(model) {
+ editorService.treePicker(contentPicker);
- select(model.selection[0]);
-
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
-
- $scope.contentPickerOverlay.close = function(oldModel) {
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
-
- $event.preventDefault();
+ $event.preventDefault();
};
$scope.selectInternal = function ($event, link) {
- $scope.currentEditLink = link;
+ $scope.currentEditLink = link;
- $scope.contentPickerOverlay = {
- view: "treepicker",
+ var contentPicker = {
section: "content",
treeAlias: "content",
multiPicker: false,
- show: true,
- idType: $scope.model.config.idType ? $scope.model.config.idType : "int"
+ idType: $scope.model.config.idType ? $scope.model.config.idType : "int",
+ submit: function (model) {
+ select(model.selection[0]);
+ editorService.close();
+ },
+ close: function () {
+ editorService.close();
+ }
};
-
- $scope.contentPickerOverlay.submit = function(model) {
-
- select(model.selection[0]);
-
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
-
- $scope.contentPickerOverlay.close = function(oldModel) {
- $scope.contentPickerOverlay.show = false;
- $scope.contentPickerOverlay = null;
- };
-
- $event.preventDefault();
+ editorService.treePicker(contentPicker);
+ $event.preventDefault();
};
$scope.edit = function (idx) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html
index c9c81b3021..221e7666f7 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html
@@ -88,11 +88,4 @@
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
index a1d0d44af6..8eb4488a9c 100644
--- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function TemplatesEditController($scope, $routeParams, $timeout, templateResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, treeService, contentEditingHelper, localizationService, angularHelper, templateHelper) {
+ function TemplatesEditController($scope, $routeParams, $timeout, templateResource, assetsService, notificationsService, editorState, navigationService, appState, macroService, treeService, contentEditingHelper, localizationService, angularHelper, templateHelper, editorService) {
var vm = this;
var oldMasterTemplateAlias = null;
@@ -326,57 +326,43 @@
vm.closeShortcuts = closeShortcuts;
function openInsertOverlay() {
-
- vm.insertOverlay = {
- view: "insert",
+ var insertOverlay = {
allowedTypes: {
macro: true,
dictionary: true,
partial: true,
umbracoField: true
},
- hideSubmitButton: true,
- show: true,
submit: function(model) {
-
switch(model.insert.type) {
-
case "macro":
var macroObject = macroService.collectValueData(model.insert.selectedMacro, model.insert.macroParams, "Mvc");
insert(macroObject.syntax);
break;
-
case "dictionary":
var code = templateHelper.getInsertDictionarySnippet(model.insert.node.name);
insert(code);
break;
-
case "partial":
var code = templateHelper.getInsertPartialSnippet(model.insert.node.parentId, model.insert.node.name);
insert(code);
break;
-
case "umbracoField":
insert(model.insert.umbracoField);
break;
}
-
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
-
+ editorService.close();
},
close: function(oldModel) {
// close the dialog
- vm.insertOverlay.show = false;
- vm.insertOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
-
+ editorService.insertCodeSnippet(insertOverlay);
}
-
function openMacroOverlay() {
vm.macroPickerOverlay = {
@@ -436,31 +422,28 @@
var title = values[0];
var emptyStateMessage = values[1];
- vm.dictionaryItemOverlay = {
- view: "treepicker",
+ var dictionaryItem = {
section: "settings",
treeAlias: "dictionary",
entityType: "dictionary",
multiPicker: false,
- show: true,
title: title,
emptyStateMessage: emptyStateMessage,
select: function(node){
var code = templateHelper.getInsertDictionarySnippet(node.name);
insert(code);
-
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
},
close: function (model) {
// close dialog
- vm.dictionaryItemOverlay.show = false;
- vm.dictionaryItemOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.treePicker(dictionaryItem);
+
});
}
@@ -470,13 +453,11 @@
localizationService.localize("template_insertPartialView").then(function(value){
var title = value;
- vm.partialItemOverlay = {
- view: "treepicker",
+ var partialItem = {
section: "settings",
treeAlias: "partialViews",
entityType: "partialView",
multiPicker: false,
- show: true,
title: title,
filter: function(i) {
if(i.name.indexOf(".cshtml") === -1 && i.name.indexOf(".vbhtml") === -1) {
@@ -485,45 +466,36 @@
},
filterCssClass: "not-allowed",
select: function(node){
-
var code = templateHelper.getInsertPartialSnippet(node.parentId, node.name);
insert(code);
-
- vm.partialItemOverlay.show = false;
- vm.partialItemOverlay = null;
+ editorService.close();
},
close: function (model) {
// close dialog
- vm.partialItemOverlay.show = false;
- vm.partialItemOverlay = null;
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+
+ editorService.treePicker(partialItem);
});
}
function openQueryBuilderOverlay() {
- vm.queryBuilderOverlay = {
- view: "querybuilder",
- show: true,
+ var queryBuilder = {
submit: function (model) {
-
var code = templateHelper.getQuerySnippet(model.result.queryExpression);
insert(code);
-
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ editorService.close();
},
-
- close: function (model) {
- // close dialog
- vm.queryBuilderOverlay.show = false;
- vm.queryBuilderOverlay = null;
+ close: function () {
+ editorService.close();
// focus editor
vm.editor.focus();
}
};
+ editorService.queryBuilder(queryBuilder);
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html
index 636a463058..0b1b574e70 100644
--- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html
@@ -124,13 +124,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js
index c9a0c48d8c..a65b9602ec 100644
--- a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function UserEditController($scope, eventsService, $q, $timeout, $location, $routeParams, formHelper, usersResource, userService, contentEditingHelper, localizationService, notificationsService, mediaHelper, Upload, umbRequestHelper, usersHelper, authResource, dateHelper) {
+ function UserEditController($scope, eventsService, $q, $timeout, $location, $routeParams, formHelper, usersResource, userService, contentEditingHelper, localizationService, notificationsService, mediaHelper, Upload, umbRequestHelper, usersHelper, authResource, dateHelper, editorService) {
var vm = this;
@@ -197,40 +197,33 @@
}
function openUserGroupPicker() {
- vm.userGroupPicker = {
- view: "usergrouppicker",
+ var oldSelection = angular.copy(vm.user.userGroups);
+ var userGroupPicker = {
selection: vm.user.userGroups,
- closeButtonLabel: vm.labels.cancel,
- show: true,
submit: function (model) {
// apply changes
if (model.selection) {
vm.user.userGroups = model.selection;
}
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ editorService.close();
},
- close: function (oldModel) {
- // rollback on close
- if (oldModel.selection) {
- vm.user.userGroups = oldModel.selection;
- }
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ close: function () {
+ // roll back the selection
+ vm.user.userGroups = oldSelection;
+ editorService.close();
}
};
+ editorService.userGroupPicker(userGroupPicker);
}
function openContentPicker() {
- vm.contentPicker = {
+ var contentPicker = {
title: vm.labels.selectContentStartNode,
- view: "treepicker",
section: "content",
treeAlias: "content",
multiPicker: true,
selection: vm.user.startContentIds,
hideHeader: false,
- show: true,
submit: function (model) {
// select items
if (model.selection) {
@@ -242,22 +235,18 @@
multiSelectItem(item, vm.user.startContentIds);
});
}
- // close overlay
- vm.contentPicker.show = false;
- vm.contentPicker = null;
+ editorService.close();
},
- close: function (oldModel) {
- // close overlay
- vm.contentPicker.show = false;
- vm.contentPicker = null;
+ close: function () {
+ editorService.close();
}
};
+ editorService.treePicker(contentPicker);
}
function openMediaPicker() {
- vm.mediaPicker = {
+ var mediaPicker = {
title: vm.labels.selectMediaStartNode,
- view: "treepicker",
section: "media",
treeAlias: "media",
entityType: "media",
@@ -276,15 +265,14 @@
});
}
// close overlay
- vm.mediaPicker.show = false;
- vm.mediaPicker = null;
+ editorService.close();
},
- close: function (oldModel) {
+ close: function () {
// close overlay
- vm.mediaPicker.show = false;
- vm.mediaPicker = null;
+ editorService.close();
}
};
+ editorService.treePicker(mediaPicker);
}
function multiSelectItem(item, selection) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/users/user.html b/src/Umbraco.Web.UI.Client/src/views/users/user.html
index 32c1c3d641..c34f0791d5 100644
--- a/src/Umbraco.Web.UI.Client/src/views/users/user.html
+++ b/src/Umbraco.Web.UI.Client/src/views/users/user.html
@@ -65,22 +65,4 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js
index 3c5c083477..d78095a90f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function UsersController($scope, $timeout, $location, $routeParams, usersResource, userGroupsResource, userService, localizationService, contentEditingHelper, usersHelper, formHelper, notificationsService, dateHelper) {
+ function UsersController($scope, $timeout, $location, $routeParams, usersResource, userGroupsResource, userService, localizationService, contentEditingHelper, usersHelper, formHelper, notificationsService, dateHelper, editorService) {
var vm = this;
var localizeSaving = localizationService.localize("general_saving");
@@ -300,16 +300,13 @@
return _.find(users, function (u) { return u.id === userId });
}
- function openBulkUserGroupPicker(event) {
+ function openBulkUserGroupPicker() {
var firstSelectedUser = getUserFromArrayById(vm.selection[0], vm.users);
vm.selectedBulkUserGroups = _.clone(firstSelectedUser.userGroups);
- vm.userGroupPicker = {
- view: "usergrouppicker",
+ var userGroupPicker = {
selection: vm.selectedBulkUserGroups,
- closeButtonLabelKey: "general_cancel",
- show: true,
submit: function (model) {
usersResource.setUserGroupsOnUsers(model.selection, vm.selection).then(function (data) {
// sorting to ensure they show up in right order when updating the UI
@@ -323,42 +320,36 @@
user.userGroups = vm.selectedBulkUserGroups;
});
vm.selectedBulkUserGroups = [];
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ editorService.close();
clearSelection();
}, angular.noop);
},
- close: function (oldModel) {
+ close: function () {
vm.selectedBulkUserGroups = [];
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ editorService.close();
}
};
+ editorService.userGroupPicker(userGroupPicker);
}
- function openUserGroupPicker(event) {
- vm.userGroupPicker = {
- view: "usergrouppicker",
+ function openUserGroupPicker() {
+ var oldSelection = angular.copy(vm.newUser.userGroups);
+ var userGroupPicker = {
selection: vm.newUser.userGroups,
- closeButtonLabelKey: "general_cancel",
- show: true,
submit: function (model) {
// apply changes
if (model.selection) {
vm.newUser.userGroups = model.selection;
}
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ editorService.close();
},
- close: function (oldModel) {
+ close: function () {
// rollback on close
- if (oldModel.selection) {
- vm.newUser.userGroups = oldModel.selection;
- }
- vm.userGroupPicker.show = false;
- vm.userGroupPicker = null;
+ vm.newUser.userGroups = oldSelection;
+ editorService.close();
}
};
+ editorService.userGroupPicker(userGroupPicker);
}
function removeSelectedUserGroup(index, selection) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html
index abf2f80ff2..71dfaa686c 100644
--- a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html
+++ b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html
@@ -538,11 +538,4 @@
-
-
-
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
index e8d26d8270..28b8f65dd3 100644
--- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
+++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
@@ -124,6 +124,7 @@
Numeric List
Insert macro
Insert picture
+ Publish and close
Edit relations
Return to list
Save