diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 94781a6529..726f23c45d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -280,7 +280,7 @@ function navigationService($rootScope, $route, $routeParams, $log, $location, $q * @param {Event} event the click event triggering the method, passed from the DOM element */ showMenu: function(args) { - + var deferred = $q.defer(); var self = this; @@ -410,37 +410,7 @@ function navigationService($rootScope, $route, $routeParams, $log, $location, $q }); } }, - - /** - * @ngdoc method - * @name umbraco.services.navigationService#showUserDialog - * @methodOf umbraco.services.navigationService - * - * @description - * Opens the user dialog, next to the sections navigation - * template is located in views/common/dialogs/user.html - */ - showUserDialog: function () { - // hide tray and close help dialog - if (service.helpDialog) { - service.helpDialog.close(); - } - service.hideTray(); - - if (service.userDialog) { - service.userDialog.close(); - service.userDialog = undefined; - } - - service.userDialog = dialogService.open( - { - template: "views/common/dialogs/user.html", - modalClass: "umb-modal-left", - show: true - }); - - return service.userDialog; - }, + /** * @ngdoc method diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js deleted file mode 100644 index 5e5363ae6c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js +++ /dev/null @@ -1,25 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.ApprovedColorPickerController", function ($scope, $http, umbPropEditorHelper, assetsService) { - assetsService.loadJs("lib/cssparser/cssparser.js", $scope) - .then(function () { - - var cssPath = $scope.dialogData.cssPath; - $scope.cssClass = $scope.dialogData.cssClass; - - $scope.classes = []; - - $scope.change = function (newClass) { - $scope.model.value = newClass; - } - - $http.get(cssPath) - .success(function (data) { - var parser = new CSSParser(); - $scope.classes = parser.parse(data, false, false).cssRules; - $scope.classes.splice(0, 0, "noclass"); - }) - - assetsService.loadCss("/App_Plugins/Lecoati.uSky.Grid/lib/uSky.Grid.ApprovedColorPicker.css", $scope); - assetsService.loadCss(cssPath, $scope); - }); -}); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html deleted file mode 100644 index 91b53f4d78..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
-
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js deleted file mode 100644 index e33c37ab05..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js +++ /dev/null @@ -1,50 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.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; - - 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; - }); - - }); - - - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html deleted file mode 100644 index b9428fb242..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html +++ /dev/null @@ -1,58 +0,0 @@ -
-
-

Help

- Umbraco version {{version}} -
- -
-
-
-
Help topics for: {{sectionName}}
- - - -
- -
-
Video chapters for: {{sectionName}}
- - - - -
-
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js deleted file mode 100644 index 7f7eed8e4c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js +++ /dev/null @@ -1,19 +0,0 @@ -//used for the icon picker dialog -angular.module("umbraco") - .controller("Umbraco.Dialogs.IconPickerController", - function ($scope, iconHelper) { - - iconHelper.getIcons().then(function(icons){ - $scope.icons = icons; - }); - - $scope.submitClass = function(icon){ - if($scope.color) { - $scope.submit(icon + " " + $scope.color); - } - else { - $scope.submit(icon); - } - }; - } - ); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html deleted file mode 100644 index f21fdf0b06..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html +++ /dev/null @@ -1,57 +0,0 @@ -
-
-
- -
-
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js deleted file mode 100644 index dbb86e87ec..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * @ngdoc controller - * @name Umbraco.Dialogs.InsertMacroController - * @function - * - * @description - * The controller for the custom insert macro dialog. Until we upgrade the template editor to be angular this - * is actually loaded into an iframe with full html. - */ -function InsertMacroController($scope, entityResource, macroResource, umbPropEditorHelper, macroService, formHelper) { - - /** changes the view to edit the params of the selected macro */ - function editParams() { - //get the macro params if there are any - macroResource.getMacroParameters($scope.selectedMacro.id) - .then(function (data) { - - //go to next page if there are params otherwise we can just exit - if (!angular.isArray(data) || data.length === 0) { - //we can just exist! - submitForm(); - - } else { - $scope.wizardStep = "paramSelect"; - $scope.macroParams = data; - - //fill in the data if we are editing this macro - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroParamsDictionary) { - _.each($scope.dialogData.macroData.macroParamsDictionary, function (val, key) { - var prop = _.find($scope.macroParams, function (item) { - return item.alias == key; - }); - if (prop) { - - if (_.isString(val)) { - //we need to unescape values as they have most likely been escaped while inserted - val = _.unescape(val); - - //detect if it is a json string - if (val.detectIsJson()) { - try { - //Parse it to json - prop.value = angular.fromJson(val); - } - catch (e) { - // not json - prop.value = val; - } - } - else { - prop.value = val; - } - } - else { - prop.value = val; - } - } - }); - - } - } - }); - } - - /** submit the filled out macro params */ - function submitForm() { - - //collect the value data, close the dialog and send the data back to the caller - - //create a dictionary for the macro params - var paramDictionary = {}; - _.each($scope.macroParams, function (item) { - - var val = item.value; - - if (item.value != null && item.value != undefined && !_.isString(item.value)) { - try { - val = angular.toJson(val); - } - catch (e) { - // not json - } - } - - //each value needs to be xml escaped!! since the value get's stored as an xml attribute - paramDictionary[item.alias] = _.escape(val); - - }); - - //need to find the macro alias for the selected id - var macroAlias = $scope.selectedMacro.alias; - - //get the syntax based on the rendering engine - var syntax; - if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "WebForms") { - syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - else if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "Mvc") { - syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - else { - syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - - $scope.submit({ syntax: syntax, macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - - $scope.macros = []; - $scope.selectedMacro = null; - $scope.wizardStep = "macroSelect"; - $scope.macroParams = []; - - $scope.submitForm = function () { - - if (formHelper.submitForm({ scope: $scope })) { - - formHelper.resetForm({ scope: $scope }); - - if ($scope.wizardStep === "macroSelect") { - editParams(); - } - else { - submitForm(); - } - - } - }; - - //here we check to see if we've been passed a selected macro and if so we'll set the - //editor to start with parameter editing - if ($scope.dialogData && $scope.dialogData.macroData) { - $scope.wizardStep = "paramSelect"; - } - - //get the macro list - pass in a filter if it is only for rte - entityResource.getAll("Macro", ($scope.dialogData && $scope.dialogData.richTextEditor && $scope.dialogData.richTextEditor === true) ? "UseInEditor=true" : null) - .then(function (data) { - - //if 'allowedMacros' is specified, we need to filter - if (angular.isArray($scope.dialogData.allowedMacros) && $scope.dialogData.allowedMacros.length > 0) { - $scope.macros = _.filter(data, function(d) { - return _.contains($scope.dialogData.allowedMacros, d.alias); - }); - } - else { - $scope.macros = data; - } - - - //check if there's a pre-selected macro and if it exists - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroAlias) { - var found = _.find(data, function (item) { - return item.alias === $scope.dialogData.macroData.macroAlias; - }); - if (found) { - //select the macro and go to next screen - $scope.selectedMacro = found; - editParams(); - return; - } - } - //we don't have a pre-selected macro so ensure the correct step is set - $scope.wizardStep = "macroSelect"; - }); - - -} - -angular.module("umbraco").controller("Umbraco.Dialogs.InsertMacroController", InsertMacroController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html deleted file mode 100644 index 70889f2cd7..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html +++ /dev/null @@ -1,50 +0,0 @@ -
-
- - - -
- - - - - - - -
- -
{{$parent.$parent.selectedMacro.name}}
- -
    -
  • - - - - - - - -
  • -
- -
- -
- -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js deleted file mode 100644 index 81b86fc969..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @ngdoc controller - * @name Umbraco.Dialogs.LegacyDeleteController - * @function - * - * @description - * The controller for deleting content - */ -function LegacyDeleteController($scope, legacyResource, treeService, navigationService) { - - $scope.performDelete = function() { - - //mark it for deletion (used in the UI) - $scope.currentNode.loading = true; - - legacyResource.deleteItem({ - nodeId: $scope.currentNode.id, - nodeType: $scope.currentNode.nodeType, - alias: $scope.currentNode.name, - }).then(function () { - $scope.currentNode.loading = false; - //TODO: Need to sync tree, etc... - treeService.removeNode($scope.currentNode); - navigationService.hideMenu(); - }); - - }; - - $scope.cancel = function() { - navigationService.hideDialog(); - }; -} - -angular.module("umbraco").controller("Umbraco.Dialogs.LegacyDeleteController", LegacyDeleteController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html deleted file mode 100644 index e6c757ef1e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- -
-

- Are you sure you want to delete {{currentNode.name}} ? -

- - - - -
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js deleted file mode 100644 index 5055f088c7..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js +++ /dev/null @@ -1,147 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController", - function ($scope, eventsService, dialogService, entityResource, contentResource, mediaHelper, userService, localizationService) { - var dialogOptions = $scope.dialogOptions; - - var searchText = "Search..."; - localizationService.localize("general_search").then(function (value) { - searchText = value + "..."; - }); - - $scope.dialogTreeApi = {}; - $scope.target = {}; - $scope.searchInfo = { - searchFromId: null, - searchFromName: null, - showSearch: false, - results: [], - selectedSearchResults: [] - } - - if (dialogOptions.currentTarget) { - $scope.target = dialogOptions.currentTarget; - - //if we have a node ID, we fetch the current node to build the form data - if ($scope.target.id || $scope.target.udi) { - - var id = $scope.target.udi ? $scope.target.udi : $scope.target.id; - - if (!$scope.target.path) { - entityResource.getPath(id, "Document").then(function (path) { - $scope.target.path = path; - //now sync the tree to this path - $scope.dialogTreeApi.syncTree({ path: $scope.target.path, tree: "content" }); - }); - } - - contentResource.getNiceUrl(id).then(function (url) { - $scope.target.url = url; - }); - } - } - - function nodeSelectHandler(args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - if (args.node.metaData.listViewNode) { - //check if list view 'search' node was selected - - $scope.searchInfo.showSearch = true; - $scope.searchInfo.searchFromId = args.node.metaData.listViewNode.id; - $scope.searchInfo.searchFromName = args.node.metaData.listViewNode.name; - } - else { - eventsService.emit("dialogs.linkPicker.select", args); - - if ($scope.currentNode) { - //un-select if there's a current one selected - $scope.currentNode.selected = false; - } - - $scope.currentNode = args.node; - $scope.currentNode.selected = true; - $scope.target.id = args.node.id; - $scope.target.udi = args.node.udi; - $scope.target.name = args.node.name; - - if (args.node.id < 0) { - $scope.target.url = "/"; - } - else { - contentResource.getNiceUrl(args.node.id).then(function (url) { - $scope.target.url = url; - }); - } - - if (!angular.isUndefined($scope.target.isMedia)) { - delete $scope.target.isMedia; - } - } - } - - function nodeExpandedHandler(args) { - if (angular.isArray(args.children)) { - - //iterate children - _.each(args.children, function (child) { - //check if any of the items are list views, if so we need to add a custom - // child: A node to activate the search - if (child.metaData.isContainer) { - child.hasChildren = true; - child.children = [ - { - level: child.level + 1, - hasChildren: false, - name: searchText, - metaData: { - listViewNode: child, - }, - cssClass: "icon umb-tree-icon sprTree icon-search", - cssClasses: ["not-published"] - } - ]; - } - }); - } - } - - $scope.switchToMediaPicker = function () { - userService.getCurrentUser().then(function (userData) { - dialogService.mediaPicker({ - startNodeId: userData.startMediaIds.length == 0 ? -1 : userData.startMediaIds[0], - callback: function(media) { - $scope.target.id = media.id; - $scope.target.isMedia = true; - $scope.target.name = media.name; - $scope.target.url = mediaHelper.resolveFile(media); - } - }); - }); - }; - - $scope.hideSearch = function () { - $scope.searchInfo.showSearch = false; - $scope.searchInfo.searchFromId = null; - $scope.searchInfo.searchFromName = null; - $scope.searchInfo.results = []; - } - - // method to select a search result - $scope.selectResult = function (evt, result) { - result.selected = result.selected === true ? false : true; - nodeSelectHandler(evt, {event: evt, node: result}); - }; - - //callback when there are search results - $scope.onSearchResults = function (results) { - $scope.searchInfo.results = results; - $scope.searchInfo.showSearch = true; - }; - - $scope.onTreeInit = function () { - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - $scope.dialogTreeApi.callbacks.treeNodeExpanded(nodeExpandedHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html deleted file mode 100644 index 5d1bbd8f80..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html +++ /dev/null @@ -1,75 +0,0 @@ -
- - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js deleted file mode 100644 index 5b66ac3bab..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js +++ /dev/null @@ -1,14 +0,0 @@ -//used for the macro picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.MacroPickerController", function ($scope, macroFactory, umbPropEditorHelper) { - $scope.macros = macroFactory.all(true); - $scope.dialogMode = "list"; - - $scope.configureMacro = function(macro){ - $scope.dialogMode = "configure"; - $scope.dialogData.macro = macroFactory.getMacro(macro.alias); - //set the correct view for each item - for (var i = 0; i < dialogData.macro.properties.length; i++) { - dialogData.macro.properties[i].editorView = umbPropEditorHelper.getViewPath(dialogData.macro.properties[i].view); - } - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html deleted file mode 100644 index 87fa0e7fe8..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html +++ /dev/null @@ -1,38 +0,0 @@ -
- - - - -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js deleted file mode 100644 index f337dbce18..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js +++ /dev/null @@ -1,134 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco") - .controller("Umbraco.Dialogs.MediaPickerController", - function($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, mediaTypeHelper, eventsService, treeService) { - - var dialogOptions = $scope.dialogOptions; - - $scope.onlyImages = dialogOptions.onlyImages; - $scope.showDetails = dialogOptions.showDetails; - $scope.multiPicker = (dialogOptions.multiPicker && dialogOptions.multiPicker !== "0") ? true : false; - $scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1; - $scope.cropSize = dialogOptions.cropSize; - - //preload selected item - $scope.target = undefined; - if (dialogOptions.currentTarget) { - $scope.target = dialogOptions.currentTarget; - } - - $scope.acceptedMediatypes = []; - mediaTypeHelper.getAllowedImagetypes($scope.startNodeId) - .then(function(types) { - $scope.acceptedMediatypes = types; - }); - - $scope.upload = function(v) { - angular.element(".umb-file-dropzone-directive .file-select").click(); - }; - - $scope.dragLeave = function(el, event) { - $scope.activeDrag = false; - }; - - $scope.dragEnter = function(el, event) { - $scope.activeDrag = true; - }; - - $scope.submitFolder = function(e) { - if (e.keyCode === 13) { - e.preventDefault(); - - mediaResource - .addFolder($scope.newFolderName, $scope.currentFolder.id) - .then(function(data) { - $scope.showFolderInput = false; - $scope.newFolderName = ""; - - //we've added a new folder so lets clear the tree cache for that specific item - treeService.clearCache({ - cacheKey: "__media", //this is the main media tree cache key - childrenOf: data.parentId //clear the children of the parent - }); - - $scope.gotoFolder(data); - }); - } - }; - - $scope.gotoFolder = function(folder) { - if (!folder) { - folder = { id: -1, name: "Media", icon: "icon-folder" }; - } - - if (folder.id > 0) { - entityResource.getAncestors(folder.id, "media") - .then(function(anc) { - // anc.splice(0,1); - $scope.path = _.filter(anc, - function(f) { - return f.path.indexOf($scope.startNodeId) !== -1; - }); - }); - - mediaTypeHelper.getAllowedImagetypes(folder.id) - .then(function(types) { - $scope.acceptedMediatypes = types; - }); - } else { - $scope.path = []; - } - - //mediaResource.rootMedia() - mediaResource.getChildren(folder.id) - .then(function(data) { - $scope.searchTerm = ""; - $scope.images = data.items ? data.items : []; - }); - - $scope.currentFolder = folder; - }; - - - $scope.clickHandler = function(image, ev, select) { - ev.preventDefault(); - - if (image.isFolder && !select) { - $scope.gotoFolder(image); - } else { - eventsService.emit("dialogs.mediaPicker.select", image); - - //we have 3 options add to collection (if multi) show details, or submit it right back to the callback - if ($scope.multiPicker) { - $scope.select(image); - image.cssclass = ($scope.dialogData.selection.indexOf(image) > -1) ? "selected" : ""; - } else if ($scope.showDetails) { - $scope.target = image; - $scope.target.url = mediaHelper.resolveFile(image); - } else { - $scope.submit(image); - } - } - }; - - $scope.exitDetails = function() { - if (!$scope.currentFolder) { - $scope.gotoFolder(); - } - - $scope.target = undefined; - }; - - $scope.onUploadComplete = function() { - $scope.gotoFolder($scope.currentFolder); - }; - - $scope.onFilesQueue = function() { - $scope.activeDrag = false; - }; - - //default root item - if (!$scope.target) { - $scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" }); - } - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html deleted file mode 100644 index c974cf7adf..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html +++ /dev/null @@ -1,161 +0,0 @@ -
- -
- - - -
- - -
- - -
- -
- - -
- -
- -
- -
- -
-
- - - - - - - -
- -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js deleted file mode 100644 index 8962bf91a3..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js +++ /dev/null @@ -1,37 +0,0 @@ -//used for the member picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.MemberGroupPickerController", - function($scope, eventsService, entityResource, searchService, $log) { - var dialogOptions = $scope.dialogOptions; - $scope.dialogTreeApi = {}; - $scope.multiPicker = dialogOptions.multiPicker; - - /** Method used for selecting a node */ - function select(text, id) { - - if (dialogOptions.multiPicker) { - $scope.select(id); - } - else { - $scope.submit(id); - } - } - - function nodeSelectHandler(args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - eventsService.emit("dialogs.memberGroupPicker.select", args); - - //This is a tree node, so we don't have an entity to pass in, it will need to be looked up - //from the server in this method. - select(args.node.name, args.node.id); - - //toggle checked state - args.node.selected = args.node.selected === true ? false : true; - } - - function onTreeInit() { - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html deleted file mode 100644 index 23b8bb93e0..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html +++ /dev/null @@ -1,35 +0,0 @@ -
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html deleted file mode 100644 index 89bb3383de..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html +++ /dev/null @@ -1 +0,0 @@ -{{propertyTypeToRender}} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js deleted file mode 100644 index 0c1cb5b62e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js +++ /dev/null @@ -1,79 +0,0 @@ -angular.module("umbraco").controller("Umbraco.Dialogs.RteEmbedController", function ($scope, $http, umbRequestHelper) { - $scope.form = {}; - $scope.form.url = ""; - $scope.form.width = 360; - $scope.form.height = 240; - $scope.form.constrain = true; - $scope.form.preview = ""; - $scope.form.success = false; - $scope.form.info = ""; - $scope.form.supportsDimensions = false; - - var origWidth = 500; - var origHeight = 300; - - $scope.showPreview = function() { - - if ($scope.form.url) { - $scope.form.show = true; - $scope.form.preview = "
"; - $scope.form.info = ""; - $scope.form.success = false; - - $http({ method: 'GET', url: umbRequestHelper.getApiUrl("embedApiBaseUrl", "GetEmbed"), params: { url: $scope.form.url, width: $scope.form.width, height: $scope.form.height } }) - .success(function (data) { - - $scope.form.preview = ""; - - switch (data.Status) { - case 0: - //not supported - $scope.form.info = "Not supported"; - break; - case 1: - //error - $scope.form.info = "Could not embed media - please ensure the URL is valid"; - break; - case 2: - $scope.form.preview = data.Markup; - $scope.form.supportsDimensions = data.SupportsDimensions; - $scope.form.success = true; - break; - } - }) - .error(function () { - $scope.form.supportsDimensions = false; - $scope.form.preview = ""; - $scope.form.info = "Could not embed media - please ensure the URL is valid"; - }); - } else { - $scope.form.supportsDimensions = false; - $scope.form.preview = ""; - $scope.form.info = "Please enter a URL"; - } - }; - - $scope.changeSize = function (type) { - var width, height; - - if ($scope.form.constrain) { - width = parseInt($scope.form.width, 10); - height = parseInt($scope.form.height, 10); - if (type == 'width') { - origHeight = Math.round((width / origWidth) * height); - $scope.form.height = origHeight; - } else { - origWidth = Math.round((height / origHeight) * width); - $scope.form.width = origWidth; - } - } - if ($scope.form.url != "") { - $scope.showPreview(); - } - - }; - - $scope.insert = function(){ - $scope.submit($scope.form.preview); - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html deleted file mode 100644 index 7bf24c086f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ /dev/null @@ -1,36 +0,0 @@ -
-
- - - -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js deleted file mode 100644 index 6dae664a3d..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js +++ /dev/null @@ -1,102 +0,0 @@ -angular.module("umbraco").controller('Umbraco.Dialogs.Template.QueryBuilderController', - function($scope, $http, dialogService){ - - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetAllowedProperties").then(function(response) { - $scope.properties = response.data; - }); - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetContentTypes").then(function (response) { - $scope.contentTypes = response.data; - }); - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetFilterConditions").then(function (response) { - $scope.conditions = response.data; - }); - - - $scope.query = { - contentType: { - name: "Everything" - }, - source:{ - name: "My website" - }, - filters:[ - { - property:undefined, - operator: undefined - } - ], - sort:{ - property:{ - alias: "", - name: "", - }, - direction: "ascending" - } - }; - - - - $scope.chooseSource = function(query){ - dialogService.contentPicker({ - callback: function (data) { - - if (data.id > 0) { - query.source = { id: data.id, name: data.name }; - } else { - query.source.name = "My website"; - delete query.source.id; - } - } - }); - }; - - var throttledFunc = _.throttle(function() { - - $http.post("backoffice/UmbracoApi/TemplateQuery/PostTemplateQuery", $scope.query).then(function (response) { - $scope.result = response.data; - }); - - }, 200); - - $scope.$watch("query", function(value) { - throttledFunc(); - }, true); - - $scope.getPropertyOperators = function (property) { - - var conditions = _.filter($scope.conditions, function(condition) { - var index = condition.appliesTo.indexOf(property.type); - return index >= 0; - }); - return conditions; - }; - - - $scope.addFilter = function(query){ - query.filters.push({}); - }; - - $scope.trashFilter = function (query) { - query.filters.splice(query,1); - }; - - $scope.changeSortOrder = function(query){ - if(query.sort.direction === "ascending"){ - query.sort.direction = "descending"; - }else{ - query.sort.direction = "ascending"; - } - }; - - $scope.setSortProperty = function(query, property){ - query.sort.property = property; - if(property.type === "datetime"){ - query.sort.direction = "descending"; - }else{ - query.sort.direction = "ascending"; - } - }; - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html deleted file mode 100644 index 80ea07d003..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html +++ /dev/null @@ -1,158 +0,0 @@ -
- - - -
- -
-

Build a query

-
- - - - -
- -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js deleted file mode 100644 index 17e593ff86..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js +++ /dev/null @@ -1,8 +0,0 @@ -angular.module("umbraco").controller('Umbraco.Dialogs.Template.SnippetController', - function($scope) { - $scope.type = $scope.dialogOptions.type; - $scope.section = { - name: "", - required: false - }; - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html deleted file mode 100644 index 0d6c05091c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html +++ /dev/null @@ -1,37 +0,0 @@ -
-
- -
-
Configure the section
-
- - - - -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js deleted file mode 100644 index e6d0da2b6f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js +++ /dev/null @@ -1,428 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController", - function ($scope, entityResource, eventsService, $log, searchService, angularHelper, $timeout, localizationService, treeService) { - - var tree = null; - var dialogOptions = $scope.dialogOptions; - $scope.dialogTreeApi = {}; - $scope.section = dialogOptions.section; - $scope.treeAlias = dialogOptions.treeAlias; - $scope.multiPicker = dialogOptions.multiPicker; - $scope.hideHeader = true; - $scope.searchInfo = { - searchFromId: dialogOptions.startNodeId, - searchFromName: null, - showSearch: false, - results: [], - selectedSearchResults: [] - } - - //create the custom query string param for this tree - $scope.customTreeParams = dialogOptions.startNodeId ? "startNodeId=" + dialogOptions.startNodeId : ""; - $scope.customTreeParams += dialogOptions.customTreeParams ? "&" + dialogOptions.customTreeParams : ""; - - var searchText = "Search..."; - localizationService.localize("general_search").then(function (value) { - searchText = value + "..."; - }); - - // Allow the entity type to be passed in but defaults to Document for backwards compatibility. - var entityType = dialogOptions.entityType ? dialogOptions.entityType : "Document"; - - - //min / max values - if (dialogOptions.minNumber) { - dialogOptions.minNumber = parseInt(dialogOptions.minNumber, 10); - } - if (dialogOptions.maxNumber) { - dialogOptions.maxNumber = parseInt(dialogOptions.maxNumber, 10); - } - - if (dialogOptions.section === "member") { - entityType = "Member"; - } - else if (dialogOptions.section === "media") { - entityType = "Media"; - } - - //Configures filtering - if (dialogOptions.filter) { - - dialogOptions.filterExclude = false; - dialogOptions.filterAdvanced = false; - - //used advanced filtering - if (angular.isFunction(dialogOptions.filter)) { - dialogOptions.filterAdvanced = true; - } - else if (angular.isObject(dialogOptions.filter)) { - dialogOptions.filterAdvanced = true; - } - else { - if (dialogOptions.filter.startsWith("!")) { - dialogOptions.filterExclude = true; - dialogOptions.filter = dialogOptions.filter.substring(1); - } - - //used advanced filtering - if (dialogOptions.filter.startsWith("{")) { - dialogOptions.filterAdvanced = true; - //convert to object - dialogOptions.filter = angular.fromJson(dialogOptions.filter); - } - } - } - - function nodeExpandedHandler(ev, args) { - if (angular.isArray(args.children)) { - - //iterate children - _.each(args.children, function (child) { - - //check if any of the items are list views, if so we need to add some custom - // children: A node to activate the search, any nodes that have already been - // selected in the search - if (child.metaData.isContainer) { - child.hasChildren = true; - child.children = [ - { - level: child.level + 1, - hasChildren: false, - parent: function () { - return child; - }, - name: searchText, - metaData: { - listViewNode: child, - }, - cssClass: "icon-search", - cssClasses: ["not-published"] - } - ]; - //add base transition classes to this node - child.cssClasses.push("tree-node-slide-up"); - - var listViewResults = _.filter($scope.searchInfo.selectedSearchResults, function(i) { - return i.parentId == child.id; - }); - _.each(listViewResults, function(item) { - child.children.unshift({ - id: item.id, - name: item.name, - cssClass: "icon umb-tree-icon sprTree " + item.icon, - level: child.level + 1, - metaData: { - isSearchResult: true - }, - hasChildren: false, - parent: function () { - return child; - } - }); - }); - } - - //now we need to look in the already selected search results and - // toggle the check boxes for those ones that are listed - var exists = _.find($scope.searchInfo.selectedSearchResults, function (selected) { - return child.id == selected.id; - }); - if (exists) { - child.selected = true; - } - }); - - //check filter - performFiltering(args.children); - } - } - - //gets the tree object when it loads - function treeLoadedHandler(args) { - tree = args.tree; - } - - //wires up selection - function nodeSelectHandler(ev, args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - if (args.node.metaData.listViewNode) { - //check if list view 'search' node was selected - - $scope.searchInfo.showSearch = true; - $scope.searchInfo.searchFromId = args.node.metaData.listViewNode.id; - $scope.searchInfo.searchFromName = args.node.metaData.listViewNode.name; - - //add transition classes - var listViewNode = args.node.parent(); - listViewNode.cssClasses.push('tree-node-slide-up-hide-active'); - } - else if (args.node.metaData.isSearchResult) { - //check if the item selected was a search result from a list view - - //unselect - select(args.node.name, args.node.id); - - //remove it from the list view children - var listView = args.node.parent(); - listView.children = _.reject(listView.children, function(child) { - return child.id == args.node.id; - }); - - //remove it from the custom tracked search result list - $scope.searchInfo.selectedSearchResults = _.reject($scope.searchInfo.selectedSearchResults, function (i) { - return i.id == args.node.id; - }); - } - else { - eventsService.emit("dialogs.treePickerController.select", args); - - if (args.node.filtered) { - return; - } - - //This is a tree node, so we don't have an entity to pass in, it will need to be looked up - //from the server in this method. - select(args.node.name, args.node.id); - - //toggle checked state - args.node.selected = args.node.selected === true ? false : true; - } - } - - /** Method used for selecting a node */ - function select(text, id, entity) { - //if we get the root, we just return a constructed entity, no need for server data - if (id < 0) { - if ($scope.multiPicker) { - $scope.select(id); - } - else { - var node = { - alias: null, - icon: "icon-folder", - id: id, - name: text - }; - $scope.submit(node); - } - } - else { - - if ($scope.multiPicker) { - $scope.select(Number(id)); - } - else { - - $scope.hideSearch(); - - //if an entity has been passed in, use it - if (entity) { - $scope.submit(entity); - } else { - //otherwise we have to get it from the server - entityResource.getById(id, entityType).then(function (ent) { - $scope.submit(ent); - }); - } - } - } - } - - function performFiltering(nodes) { - - if (!dialogOptions.filter) { - return; - } - - //remove any list view search nodes from being filtered since these are special nodes that always must - // be allowed to be clicked on - nodes = _.filter(nodes, function(n) { - return !angular.isObject(n.metaData.listViewNode); - }); - - if (dialogOptions.filterAdvanced) { - - //filter either based on a method or an object - var filtered = angular.isFunction(dialogOptions.filter) - ? _.filter(nodes, dialogOptions.filter) - : _.where(nodes, dialogOptions.filter); - - angular.forEach(filtered, function (value, key) { - value.filtered = true; - if (dialogOptions.filterCssClass) { - if (!value.cssClasses) { - value.cssClasses = []; - } - value.cssClasses.push(dialogOptions.filterCssClass); - } - }); - } else { - var a = dialogOptions.filter.toLowerCase().replace(/\s/g, '').split(','); - angular.forEach(nodes, function (value, key) { - - var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0; - - if (!dialogOptions.filterExclude && !found || dialogOptions.filterExclude && found) { - value.filtered = true; - - if (dialogOptions.filterCssClass) { - if (!value.cssClasses) { - value.cssClasses = []; - } - value.cssClasses.push(dialogOptions.filterCssClass); - } - } - }); - } - } - - $scope.multiSubmit = function (result) { - entityResource.getByIds(result, entityType).then(function (ents) { - $scope.submit(ents); - }); - }; - - /** method to select a search result */ - $scope.selectResult = function (evt, result) { - - if (result.filtered) { - return; - } - - result.selected = result.selected === true ? false : true; - - //since result = an entity, we'll pass it in so we don't have to go back to the server - select(result.name, result.id, result); - - //add/remove to our custom tracked list of selected search results - if (result.selected) { - $scope.searchInfo.selectedSearchResults.push(result); - } - else { - $scope.searchInfo.selectedSearchResults = _.reject($scope.searchInfo.selectedSearchResults, function(i) { - return i.id == result.id; - }); - } - - //ensure the tree node in the tree is checked/unchecked if it already exists there - if (tree) { - var found = treeService.getDescendantNode(tree.root, result.id); - if (found) { - found.selected = result.selected; - } - } - - }; - - $scope.hideSearch = function () { - - //Traverse the entire displayed tree and update each node to sync with the selected search results - if (tree) { - - //we need to ensure that any currently displayed nodes that get selected - // from the search get updated to have a check box! - function checkChildren(children) { - _.each(children, function (child) { - //check if the id is in the selection, if so ensure it's flagged as selected - var exists = _.find($scope.searchInfo.selectedSearchResults, function (selected) { - return child.id == selected.id; - }); - //if the curr node exists in selected search results, ensure it's checked - if (exists) { - child.selected = true; - } - //if the curr node does not exist in the selected search result, and the curr node is a child of a list view search result - else if (child.metaData.isSearchResult) { - //if this tree node is under a list view it means that the node was added - // to the tree dynamically under the list view that was searched, so we actually want to remove - // it all together from the tree - var listView = child.parent(); - listView.children = _.reject(listView.children, function(c) { - return c.id == child.id; - }); - } - - //check if the current node is a list view and if so, check if there's any new results - // that need to be added as child nodes to it based on search results selected - if (child.metaData.isContainer) { - - child.cssClasses = _.reject(child.cssClasses, function(c) { - return c === 'tree-node-slide-up-hide-active'; - }); - - var listViewResults = _.filter($scope.searchInfo.selectedSearchResults, function (i) { - return i.parentId == child.id; - }); - _.each(listViewResults, function (item) { - var childExists = _.find(child.children, function(c) { - return c.id == item.id; - }); - if (!childExists) { - var parent = child; - child.children.unshift({ - id: item.id, - name: item.name, - cssClass: "icon umb-tree-icon sprTree " + item.icon, - level: child.level + 1, - metaData: { - isSearchResult: true - }, - hasChildren: false, - parent: function () { - return parent; - } - }); - } - }); - } - - //recurse - if (child.children && child.children.length > 0) { - checkChildren(child.children); - } - }); - } - checkChildren(tree.root.children); - } - - - $scope.searchInfo.showSearch = false; - $scope.searchInfo.searchFromId = dialogOptions.startNodeId; - $scope.searchInfo.searchFromName = null; - $scope.searchInfo.results = []; - } - - $scope.onSearchResults = function(results) { - - //filter all items - this will mark an item as filtered - performFiltering(results); - - //now actually remove all filtered items so they are not even displayed - results = _.filter(results, function(item) { - return !item.filtered; - }); - - $scope.searchInfo.results = results; - - //sync with the curr selected results - _.each($scope.searchInfo.results, function (result) { - var exists = _.find($scope.dialogData.selection, function (selectedId) { - return result.id == selectedId; - }); - if (exists) { - result.selected = true; - } - }); - - $scope.searchInfo.showSearch = true; - }; - - $scope.onTreeInit = function () { - $scope.dialogTreeApi.callbacks.treeLoaded(treeLoadedHandler); - $scope.dialogTreeApi.callbacks.treeNodeExpanded(nodeExpandedHandler); - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html deleted file mode 100644 index 9d17148042..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
-
- - - - -
-
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js deleted file mode 100644 index e7444b8119..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js +++ /dev/null @@ -1,167 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource, currentUserResource, formHelper) { - - $scope.history = historyService.getCurrent(); - $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion; - $scope.showPasswordFields = false; - $scope.changePasswordButtonState = "init"; - - $scope.externalLoginProviders = externalLoginInfo.providers; - $scope.externalLinkLoginFormAction = Umbraco.Sys.ServerVariables.umbracoUrls.externalLinkLoginsUrl; - var evts = []; - evts.push(eventsService.on("historyService.add", function (e, args) { - $scope.history = args.all; - })); - evts.push(eventsService.on("historyService.remove", function (e, args) { - $scope.history = args.all; - })); - evts.push(eventsService.on("historyService.removeAll", function (e, args) { - $scope.history = []; - })); - - $scope.logout = function () { - - //Add event listener for when there are pending changes on an editor which means our route was not successful - var pendingChangeEvent = eventsService.on("valFormManager.pendingChanges", function (e, args) { - //one time listener, remove the event - pendingChangeEvent(); - $scope.close(); - }); - - - //perform the path change, if it is successful then the promise will resolve otherwise it will fail - $scope.close(); - $location.path("/logout"); - }; - - $scope.gotoHistory = function (link) { - $location.path(link); - $scope.close(); - }; - - //Manually update the remaining timeout seconds - function updateTimeout() { - $timeout(function () { - if ($scope.remainingAuthSeconds > 0) { - $scope.remainingAuthSeconds--; - $scope.$digest(); - //recurse - updateTimeout(); - } - - }, 1000, false); // 1 second, do NOT execute a global digest - } - - function updateUserInfo() { - //get the user - userService.getCurrentUser().then(function (user) { - $scope.user = user; - if ($scope.user) { - $scope.remainingAuthSeconds = $scope.user.remainingAuthSeconds; - $scope.canEditProfile = _.indexOf($scope.user.allowedSections, "users") > -1; - //set the timer - updateTimeout(); - - authResource.getCurrentUserLinkedLogins().then(function(logins) { - //reset all to be un-linked - for (var provider in $scope.externalLoginProviders) { - $scope.externalLoginProviders[provider].linkedProviderKey = undefined; - } - - //set the linked logins - for (var login in logins) { - var found = _.find($scope.externalLoginProviders, function (i) { - return i.authType == login; - }); - if (found) { - found.linkedProviderKey = logins[login]; - } - } - }); - } - }); - } - - $scope.unlink = function (e, loginProvider, providerKey) { - var result = confirm("Are you sure you want to unlink this account?"); - if (!result) { - e.preventDefault(); - return; - } - - authResource.unlinkLogin(loginProvider, providerKey).then(function (a, b, c) { - updateUserInfo(); - }); - } - - updateUserInfo(); - - //remove all event handlers - $scope.$on('$destroy', function () { - for (var e = 0; e < evts.length; e++) { - evts[e](); - } - - }); - - /* ---------- UPDATE PASSWORD ---------- */ - - //create the initial model for change password property editor - $scope.changePasswordModel = { - alias: "_umb_password", - view: "changepassword", - config: {}, - value: {} - }; - - //go get the config for the membership provider and add it to the model - authResource.getMembershipProviderConfig().then(function(data) { - $scope.changePasswordModel.config = data; - //ensure the hasPassword config option is set to true (the user of course has a password already assigned) - //this will ensure the oldPassword is shown so they can change it - // disable reset password functionality beacuse it does not make sense for the current user. - $scope.changePasswordModel.config.hasPassword = true; - $scope.changePasswordModel.config.disableToggle = true; - $scope.changePasswordModel.config.enableReset = false; - }); - - $scope.changePassword = function() { - - if (formHelper.submitForm({ scope: $scope })) { - - $scope.changePasswordButtonState = "busy"; - - currentUserResource.changePassword($scope.changePasswordModel.value).then(function(data) { - - //if the password has been reset, then update our model - if (data.value) { - $scope.changePasswordModel.value.generatedPassword = data.value; - } - - formHelper.resetForm({ scope: $scope, notifications: data.notifications }); - - $scope.changePasswordButtonState = "success"; - - }, function (err) { - - formHelper.handleError(err); - - $scope.changePasswordButtonState = "error"; - - }); - - } - - }; - - $scope.togglePasswordFields = function() { - clearPasswordFields(); - $scope.showPasswordFields = !$scope.showPasswordFields; - } - - function clearPasswordFields() { - $scope.changePasswordModel.value.newPassword = ""; - $scope.changePasswordModel.confirm = ""; - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html deleted file mode 100644 index 4ad5226eb1..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ /dev/null @@ -1,119 +0,0 @@ -
-
-
-
- -
-
-

{{user.name}}

- Umbraco version {{version}} -

- - : {{remainingAuthSeconds | timespan}} - -

- -
- -
-
- -
- -
- - - Edit - - - - - -
- -
- -
External login providers
- -
- -
- - -
- - -
- -
- -
-
- -
- -
- -
Change password
- -
- - - - - - - - - -
- -
- -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js deleted file mode 100644 index f32c188d63..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js +++ /dev/null @@ -1,97 +0,0 @@ -angular.module("umbraco") -.controller("Umbraco.PropertyEditors.GoogleMapsController", - function ($element, $rootScope, $scope, notificationsService, dialogService, assetsService, $log, $timeout) { - - assetsService.loadJs('https://www.google.com/jsapi', $scope) - .then(function () { - google.load("maps", "3", - { - callback: initMap, - other_params: "sensor=false" - }); - }); - - function initMap() { - //Google maps is available and all components are ready to use. - var valueArray = $scope.model.value.split(','); - var latLng = new google.maps.LatLng(valueArray[0], valueArray[1]); - var mapDiv = document.getElementById($scope.model.alias + '_map'); - var mapOptions = { - zoom: $scope.model.config.zoom, - center: latLng, - mapTypeId: google.maps.MapTypeId[$scope.model.config.mapType] - }; - var geocoder = new google.maps.Geocoder(); - var map = new google.maps.Map(mapDiv, mapOptions); - - var marker = new google.maps.Marker({ - map: map, - position: latLng, - draggable: true - }); - - google.maps.event.addListener(map, 'click', function (event) { - - dialogService.mediaPicker({ - callback: function (data) { - var image = data.selection[0].src; - - var latLng = event.latLng; - var marker = new google.maps.Marker({ - map: map, - icon: image, - position: latLng, - draggable: true - }); - - google.maps.event.addListener(marker, "dragend", function (e) { - var newLat = marker.getPosition().lat(); - var newLng = marker.getPosition().lng(); - - codeLatLng(marker.getPosition(), geocoder); - - //set the model value - $scope.model.vvalue = newLat + "," + newLng; - }); - - } - }); - }); - - var tabShown = function(e) { - google.maps.event.trigger(map, 'resize'); - }; - - //listen for tab changes - if (tabsCtrl != null) { - tabsCtrl.onTabShown(function (args) { - tabShown(); - }); - } - - $element.closest('.umb-panel.tabbable').on('shown', '.nav-tabs a', tabShown); - - $scope.$on('$destroy', function () { - $element.closest('.umb-panel.tabbable').off('shown', '.nav-tabs a', tabShown); - }); - } - - function codeLatLng(latLng, geocoder) { - geocoder.geocode({ 'latLng': latLng }, - function (results, status) { - if (status == google.maps.GeocoderStatus.OK) { - var location = results[0].formatted_address; - $rootScope.$apply(function () { - notificationsService.success("Peter just went to: ", location); - }); - } - }); - } - - //here we declare a special method which will be called whenever the value has changed from the server - //this is instead of doing a watch on the model.value = faster - $scope.model.onValueChanged = function (newVal, oldVal) { - //update the display val again if it has changed from the server - initMap(); - }; - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html deleted file mode 100644 index 972108ed7b..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js deleted file mode 100644 index 255abd85f4..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js +++ /dev/null @@ -1,27 +0,0 @@ -//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 -angular.module('umbraco').controller("Umbraco.PropertyEditors.EmbeddedContentController", - function($rootScope, $scope, $log){ - - $scope.showForm = false; - $scope.fakeData = []; - - $scope.create = function(){ - $scope.showForm = true; - $scope.fakeData = angular.copy($scope.model.config.fields); - }; - - $scope.show = function(){ - $scope.showCode = true; - }; - - $scope.add = function(){ - $scope.showForm = false; - if ( !($scope.model.value instanceof Array)) { - $scope.model.value = []; - } - - $scope.model.value.push(angular.copy($scope.fakeData)); - $scope.fakeData = []; - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html deleted file mode 100644 index 113aeae349..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html +++ /dev/null @@ -1,18 +0,0 @@ -
- - -
- - -
- - - -
- json: {{model.value|json}} -
-
\ No newline at end of file