diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js index 5bf8adb0e3..8c55bef965 100644 --- a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js +++ b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js @@ -155,8 +155,27 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); }, openModalWindow: function(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback) { //need to create the modal on the top window if the top window has a client manager, if not, create it on the current window + + //get our angular navigation service + var injector = getRootInjector(); + var dialogService = injector.get("dialogService"); + + var dialog = dialogService.open({ + template: url, + width: width, + height: height, + iframe: true, + show: true, + callback: function (result) { + dialog.hide(); + } + }); - throw "Not implemented!"; + // var m = new Umbraco.Controls.ModalWindow(); + // this._modal.push(m); + // m.open(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback); + + //throw "Not implemented!"; ////if this is the top window, or if the top window doesn't have a client manager, create the modal in this manager //if (window == this.mainWindow() || !this.mainWindow().UmbClientMgr) { diff --git a/src/Umbraco.Web.UI.Client/src/app.js b/src/Umbraco.Web.UI.Client/src/app.js index df6099dd7f..921d490c19 100644 --- a/src/Umbraco.Web.UI.Client/src/app.js +++ b/src/Umbraco.Web.UI.Client/src/app.js @@ -4,4 +4,4 @@ var app = angular.module('umbraco', [ 'umbraco.resources', 'umbraco.services', 'umbraco.security' -]); \ No newline at end of file +]); diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_module.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_module.js index 86d23a8b13..ac14bd4a6a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_module.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/_module.js @@ -1 +1 @@ -angular.module("umbraco.mocks", ['ngMockE2E']); \ No newline at end of file +angular.module("umbraco.mocks", []); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/content.mocks.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/content.mocks.js index 0e2c57d442..4e35d03085 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/content.mocks.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/content.mocks.js @@ -2,9 +2,28 @@ angular.module('umbraco.mocks'). factory('contentMocks', ['$httpBackend', 'mocksUtills', function ($httpBackend, mocksUtills) { 'use strict'; + function returnEmptyNode(status, data, headers) { + var response = returnNodebyId(200, "", null); + var node = response[1]; + var parentId = mocksUtills.getParameterByName(data, "parentId") || 1234; + + node.name = ""; + node.id = 0; + node.parentId = parentId; + + $(node.tabs).each(function(i,tab){ + $(tab.properties).each(function(i, property){ + property.value = ""; + }); + }); + + return response; + } + function returnNodebyId(status, data, headers) { - var id = mocksUtills.getParameterByName(data, "id") || 1234; - + var id = mocksUtills.getParameterByName(data, "id") || "1234"; + id = parseInt(id, 10); + var node = { name: "My content with id: " + id, updateDate: new Date(), @@ -83,7 +102,15 @@ angular.module('umbraco.mocks'). $httpBackend .whenGET(mocksUtills.urlRegex('/umbraco/UmbracoApi/Content/GetById')) .respond(returnNodebyId); + + $httpBackend + .whenGET(mocksUtills.urlRegex('/umbraco/UmbracoApi/Content/GetEmpty')) + .respond(returnEmptyNode); + + }, + + expectGetById: function() { $httpBackend .expectGET(mocksUtills.urlRegex('/umbraco/UmbracoApi/Content/GetById')); diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/media.mocks.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/media.mocks.js new file mode 100644 index 0000000000..84c2bc5fe2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/media.mocks.js @@ -0,0 +1,92 @@ +angular.module('umbraco.mocks'). + factory('mediaMocks', ['$httpBackend', 'mocksUtills', function ($httpBackend, mocksUtills) { + 'use strict'; + + function returnNodebyId(status, data, headers) { + var id = mocksUtills.getParameterByName(data, "id") || 1234; + + var node = { + name: "My content with id: " + id, + updateDate: new Date(), + publishDate: new Date(), + id: id, + parentId: 1234, + icon: "icon-file-alt", + owner: {name: "Administrator", id: 0}, + updater: {name: "Per Ploug Krogslund", id: 1}, + + tabs: [ + { + label: "Child documents", + alias: "tab00", + id: 0, + active: true, + properties: [ + { alias: "list", label: "List", view: "listview", value: "", hideLabel: true } + ] + }, + { + label: "Content", + alias: "tab01", + id: 1, + properties: [ + { alias: "bodyText", label: "Body Text", description:"Here you enter the primary article contents", view: "rte", value: "

askjdkasj lasjd

" }, + { alias: "textarea", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "map", label: "Map", view: "googlemaps", value: "37.4419,-122.1419", config: { mapType: "ROADMAP", zoom: 4 } }, + { alias: "media", label: "Media picker", view: "mediapicker", value: "" }, + { alias: "content", label: "Content picker", view: "contentpicker", value: "" } + ] + }, + { + label: "Sample Editor", + alias: "tab02", + id: 2, + properties: [ + { alias: "datepicker", label: "Datepicker", view: "datepicker", config: { rows: 7 } }, + { alias: "tags", label: "Tags", view: "tags", value: ""} + ] + }, + { + label: "Grid", + alias: "tab03", + id: 3, + properties: [ + { alias: "grid", label: "Grid", view: "grid", controller: "umbraco.grid", value: "test", hideLabel: true } + ] + },{ + label: "WIP", + alias: "tab04", + id: 4, + properties: [ + { alias: "tes", label: "Stuff", view: "test", controller: "umbraco.embeddedcontent", value: "", + + config: { + fields: [ + { alias: "embedded", label: "Embbeded", view: "textstring", value: ""}, + { alias: "embedded2", label: "Embbeded 2", view: "contentpicker", value: ""}, + { alias: "embedded3", label: "Embbeded 3", view: "textarea", value: ""}, + { alias: "embedded4", label: "Embbeded 4", view: "datepicker", value: ""} + ] + } + } + ] + } + ] + }; + return [200, node, null]; + } + + + + return { + register: function() { + $httpBackend + .whenGET(mocksUtills.urlRegex('/umbraco/UmbracoApi/Content/GetById')) + .respond(returnNodebyId); + }, + expectGetById: function() { + $httpBackend + .expectGET(mocksUtills.urlRegex('/umbraco/UmbracoApi/Content/GetById')); + } + }; + }]); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/tree.mocks.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/tree.mocks.js index 1fcf118560..11b2b24d24 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/tree.mocks.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/tree.mocks.js @@ -1,8 +1,8 @@ -angular.module('umbraco.mocks'). - factory('treeMocks', ['$httpBackend', 'mocksUtills', function ($httpBackend, mocksUtills) { - 'use strict'; - - function getMenuItems() { +angular.module('umbraco.mocks'). + factory('treeMocks', ['$httpBackend', 'mocksUtills', function ($httpBackend, mocksUtills) { + 'use strict'; + + function getMenuItems() { return [ { name: "Create", cssclass: "plus", alias: "create" }, @@ -22,88 +22,91 @@ angular.module('umbraco.mocks'). { name: "Public Access", cssclass: "group", alias: "publicaccess" }, { seperator: true, name: "Reload", cssclass: "refresh", alias: "users" } - ]; + ]; } - function _getChildren(options) { - if (options === undefined) { - options = {}; - } - var section = options.section || 'content'; - var treeItem = options.node; - - var iLevel = treeItem.level + 1; + function returnChildren(status, data, headers) { + + var id = mocksUtills.getParameterByName(data, "id"); + var section = mocksUtills.getParameterByName(data, "treeType"); + var level = mocksUtills.getParameterByName(data, "level")+1; + var url = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren?treeType=" + section + "&id=1234&level=" + level; //hack to have create as default content action var action; - if (section === "content") { - action = "create"; + if (section === "content") { + action = "create"; } - return [ - { name: "child-of-" + treeItem.name, id: iLevel + "" + 1234, icon: "icon-file-alt", view: section + "/edit/" + iLevel + "" + 1234, children: [], expanded: false, hasChildren: true, level: iLevel, defaultAction: action, menu: getMenuItems() }, - { name: "random-name-" + section, id: iLevel + "" + 1235, icon: "icon-file-alt", view: section + "/edit/" + iLevel + "" + 1235, children: [], expanded: false, hasChildren: true, level: iLevel, defaultAction: action, menu: getMenuItems() }, - { name: "random-name-" + section, id: iLevel + "" + 1236, icon: "icon-file-alt", view: section + "/edit/" + iLevel + "" + 1236, children: [], expanded: false, hasChildren: true, level: iLevel, defaultAction: action, menu: getMenuItems() }, - { name: "random-name-" + section, id: iLevel + "" + 1237, icon: "icon-file-alt", view: "common/legacy/1237?p=" + encodeURI("developer/contentType.aspx?idequal1234"), children: [], expanded: false, hasChildren: true, level: iLevel, defaultAction: action, menu: getMenuItems() } - ]; + var children = [ + { name: "child-of-" + section, childNodesUrl:url, id: level + "" + 1234, icon: "icon-file-alt", view: section + "/edit/" + level + "" + 1234, children: [], expanded: false, hasChildren: true, level: level, defaultAction: action, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: level + "" + 1235, icon: "icon-file-alt", view: section + "/edit/" + level + "" + 1235, children: [], expanded: false, hasChildren: true, level: level, defaultAction: action, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: level + "" + 1236, icon: "icon-file-alt", view: section + "/edit/" + level + "" + 1236, children: [], expanded: false, hasChildren: true, level: level, defaultAction: action, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: level + "" + 1237, icon: "icon-file-alt", view: "common/legacy/1237?p=" + encodeURI("developer/contentType.aspx?idequal1234"), children: [], expanded: false, hasChildren: true, level: level, defaultAction: action, menu: getMenuItems() } + ]; + + return [200, children, null]; } - function returnApplicationTrees(status, data, headers) { - var section = mocksUtills.getParameterByName(data, "application"); - + function returnApplicationTrees(status, data, headers) { + var section = mocksUtills.getParameterByName(data, "application"); + var url = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren?treeType=" + section + "&id=1234&level=1"; var t; - switch (section) { + switch (section) { case "content": t = [ - { name: "My website", id: 1234, icon: "icon-home", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, - { name: "Components", id: 1235, icon: "icon-cogs", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, - { name: "Archieve", id: 1236, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, - { name: "Recycle Bin", id: 1237, icon: "icon-trash", view: section + "/trash/view/", children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() } + { name: "My website", id: 1234, childNodesUrl:url, icon: "icon-home", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, + { name: "Components", id: 1235, childNodesUrl:url, icon: "icon-cogs", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, + { name: "Archieve", id: 1236, childNodesUrl:url, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() }, + { name: "Recycle Bin", id: 1237, childNodesUrl:url, icon: "icon-trash", view: section + "/trash/view/", children: [], expanded: false, hasChildren: true, level: 1, defaultAction: "create", menu: getMenuItems() } ]; break; case "developer": t = [ - { name: "Data types", id: 1234, icon: "icon-folder-close", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Macros", id: 1235, icon: "icon-folder-close", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Pacakges", id: 1236, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "XSLT Files", id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Razor Files", id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } + { name: "Data types", childNodesUrl:url, id: 1234, icon: "icon-folder-close", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Macros", childNodesUrl:url, id: 1235, icon: "icon-folder-close", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Pacakges", childNodesUrl:url, id: 1236, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "XSLT Files", childNodesUrl:url, id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Razor Files", childNodesUrl:url, id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } ]; break; case "settings": t = [ - { name: "Stylesheets", id: 1234, icon: "icon-folder-close", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Templates", id: 1235, icon: "icon-folder-close", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Dictionary", id: 1236, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Media types", id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "Document types", id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } + { name: "Stylesheets", childNodesUrl:url, id: 1234, icon: "icon-folder-close", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Templates", childNodesUrl:url, id: 1235, icon: "icon-folder-close", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Dictionary", childNodesUrl:url, id: 1236, icon: "icon-folder-close", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Media types", childNodesUrl:url, id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "Document types", childNodesUrl:url, id: 1237, icon: "icon-folder-close", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } ]; break; default: t = [ - { name: "random-name-" + section, id: 1234, icon: "icon-home", defaultAction: "create", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "random-name-" + section, id: 1235, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "random-name-" + section, id: 1236, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, - { name: "random-name-" + section, id: 1237, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } + { name: "random-name-" + section, childNodesUrl:url, id: 1234, icon: "icon-home", defaultAction: "create", view: section + "/edit/" + 1234, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: 1235, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1235, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: 1236, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1236, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() }, + { name: "random-name-" + section, childNodesUrl:url, id: 1237, icon: "icon-folder-close", defaultAction: "create", view: section + "/edit/" + 1237, children: [], expanded: false, hasChildren: true, level: 1, menu: getMenuItems() } ]; - break; + break; } - return [200, t, null]; + return [200, t, null]; } - - - return { - register: function() { - + + + return { + register: function() { + $httpBackend .whenGET(mocksUtills.urlRegex('/umbraco/UmbracoTrees/ApplicationTreeApi/GetApplicationTrees')) - .respond(returnApplicationTrees); - - - } - }; + .respond(returnApplicationTrees); + + $httpBackend + .whenGET(mocksUtills.urlRegex('/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren')) + .respond(returnChildren); + + } + }; }]); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.httpbackend.js b/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.httpbackend.js index 3f39a186b0..2c0568bf65 100644 --- a/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.httpbackend.js +++ b/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.httpbackend.js @@ -21,5 +21,4 @@ function initBackEnd($httpBackend, contentMocks, treeMocks, userMocks, contentTy } - umbracoAppDev.run(initBackEnd); diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js index 9ab49814a8..466ba5bb9f 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js @@ -33,9 +33,26 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { return { getById: function (id) { + return $http.get(getContentUrl(id)) + .then(function(response) { + + _.each(response.data.tabs, function (item) { + item.active = false; + }); + if (response.data.tabs.length > 0){ + response.data.tabs[0].active = true; + } + + return response.data; + },function(response) { + throw new Error('Failed to retreive data for content id ' + id); + }); + + /* + var deferred = $q.defer(); - + //go and get the data $http.get(getContentUrl(id)). success(function (data, status, headers, config) { @@ -53,7 +70,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { deferred.reject('Failed to retreive data for content id ' + id); }); - return deferred.promise; + return deferred.promise;*/ }, getByIds: function (ids) { diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js index b9baa4655d..d2d6503249 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js @@ -3,7 +3,7 @@ * @name umbraco.resources.contentTypeResource * @description Loads in data for content types **/ -function contentTypeResource($q, $http) { +function contentTypeResource($q, $http, $rootScope) { /** internal method to get the api url */ function getChildContentTypesUrl(contentId) { @@ -43,15 +43,15 @@ function contentTypeResource($q, $http) { //return all types allowed under given document getAllowedTypes: function (contentId) { - var deferred = $q.defer(); - $http.get(getChildContentTypesUrl(contentId)) - .success(function (data, status, headers, config) { - deferred.resolve(data); - }). - error(function (data, status, headers, config) { - deferred.reject('Failed to retreive data for content id ' + contentId); + //var deferred = $q.defer(); + //getChildContentTypesUrl(contentId)) + + return $http.get(getChildContentTypesUrl(contentId)) + .then(function(response) { + return response.data; + },function(response) { + throw new Error('Failed to retreive data for content id ' + contentId); }); - return deferred.promise; } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index 95c4740418..153f55ce63 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -2,8 +2,8 @@ angular.module("umbraco").controller("Umbraco.Editors.DatepickerController", function ($scope, notificationsService, scriptLoader) { scriptLoader.load([ - 'views/propertyeditors/umbraco/datepicker/bootstrap.datepicker.js', - 'css!/belle/views/propertyeditors/umbraco/datepicker/bootstrap.datepicker.css' + 'views/propertyeditors/datepicker/bootstrap.datepicker.js', + 'css!/belle/views/propertyeditors/datepicker/bootstrap.datepicker.css' ]).then( function () { //The Datepicker js and css files are available and all components are ready to use. diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html index 0b225cfff5..78586d3888 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html @@ -1,3 +1,3 @@
- +
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/iframe.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/iframe.html index 84a31a02ca..999135f47d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/iframe.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/iframe.html @@ -3,7 +3,7 @@ - + @@ -63,7 +63,7 @@ - + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js index 5cfbe4149d..67746cd402 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/tags/tags.controller.js @@ -4,8 +4,8 @@ angular.module("umbraco") scriptLoader.load( [ - 'views/propertyeditors/umbraco/tags/bootstrap-tags.custom.js', - 'css!views/propertyeditors/umbraco/tags/bootstrap-tags.custom.css' + 'views/propertyeditors/tags/bootstrap-tags.custom.js', + 'css!views/propertyeditors/tags/bootstrap-tags.custom.css' ]).then(function(){ // Get data from tagsFactory diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/contentFactory.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/contentFactory.spec.js index 4eb229b1d2..51d0d49a8d 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/common/services/contentFactory.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/contentFactory.spec.js @@ -3,7 +3,7 @@ describe('content factory tests', function () { beforeEach(module('umbraco.services')); beforeEach(module('umbraco.resources')); - beforeEach(module('umbraco.httpbackend')); + beforeEach(module('umbraco.mocks')); beforeEach(inject(function ($injector) { $rootScope = $injector.get('$rootScope'); @@ -21,6 +21,8 @@ describe('content factory tests', function () { describe('global content factory crud', function () { + + it('should return a content object, given an id', function () { var doc; contentFactory.getById(1234).then(function(result){ @@ -28,6 +30,7 @@ describe('content factory tests', function () { }); $rootScope.$digest(); + $httpBackend.flush(); expect(doc).toNotBe(undefined); expect(doc.id).toBe(1234); @@ -36,10 +39,15 @@ describe('content factory tests', function () { it('should return a content children collection given an id', function () { var collection = contentFactory.getChildren(1234, undefined); + $rootScope.$digest(); + $httpBackend.flush(); expect(collection.resultSet.length).toBe(10); collection = contentFactory.getChildren(1234,{take: 5, offset: 1, filter: ""}); + $rootScope.$digest(); + $httpBackend.flush(); + expect(collection.resultSet.length).toBe(5); - }); + }); }); }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/contenttypeFactory.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/contenttypeFactory.spec.js index 2af946c46c..390820552c 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/common/services/contenttypeFactory.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/contenttypeFactory.spec.js @@ -1,40 +1,36 @@ describe('content type factory tests', function () { var $rootScope, $httpBackend, contentTypeResource, m; - beforeEach(module('ngMockE2E')); + // beforeEach(module('ngMockE2E')); beforeEach(module('umbraco.resources')); - beforeEach(module('umbraco.httpbackend')); + beforeEach(module('umbraco.mocks')); - beforeEach(inject(function ($injector, contentTypeMocks) { - $rootScope = $injector.get('$rootScope'); - $httpBackend = $injector.get('$httpBackend'); - m = contentTypeMocks; - m.register(); - - contentTypeResource = $injector.get('contentTypeResource'); + beforeEach(inject(function ($injector) { + $rootScope = $injector.get('$rootScope'); + $httpBackend = $injector.get('$httpBackend'); + mocks = $injector.get("contentTypeMocks"); + mocks.register(); + contentTypeResource = $injector.get('contentTypeResource'); })); - describe('global content type factory crud', function () { + it('should return a content type object, given an id', function () { - var ct1; contentTypeResource.getContentType(1234).then(function(result){ ct1 = result; }); $rootScope.$digest(); - $rootScope.$apply(); - - console.log("ct1:", ct1); expect(ct1).toNotBe(undefined); expect(ct1.id).toBe(1234); }); + it('should return a allowed content type collection given a document id', function(){ - m.expectAllowedChildren(); + // m.expectAllowedChildren(); var collection; contentTypeResource.getAllowedTypes(1234).then(function(result){ @@ -43,7 +39,8 @@ describe('content type factory tests', function () { $rootScope.$digest(); - $rootScope.$apply(); + $httpBackend.flush(); + expect(collection.length).toBe(3); }); }); diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml index b15b462841..824d8f906b 100644 --- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml @@ -47,9 +47,7 @@ *@ -
-
@@ -57,6 +55,7 @@
+ diff --git a/src/Umbraco.Web.UI/umbraco/index.html b/src/Umbraco.Web.UI/umbraco/index.html index d715deb792..cd60633009 100644 --- a/src/Umbraco.Web.UI/umbraco/index.html +++ b/src/Umbraco.Web.UI/umbraco/index.html @@ -1,30 +1,30 @@ - - - - - - - - Umbraco - - - - -
- - - -
-
-
-
-
-
- - - - - - - - + + + + + + + + Umbraco + + + + +
+ + + +
+
+
+
+
+
+ + + + + + + +