").after(lnk);
- }
- };
-
- return directive;
-
- }
-
- angular.module('umbraco.directives').directive('umbPasswordToggle', PasswordToggleDirective);
-
-})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js
index 0003658600..21a1f181a6 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js
@@ -57,13 +57,13 @@ For extra details about options and events take a look here: https://refreshless
**/
-(function() {
- 'use strict';
+(function () {
+ 'use strict';
- var umbRangeSlider = {
+ var umbRangeSlider = {
template: '
',
- controller: UmbRangeSliderController,
- bindings: {
+ controller: UmbRangeSliderController,
+ bindings: {
ngModel: '<',
options: '<',
onSetup: '&?',
@@ -73,15 +73,15 @@ For extra details about options and events take a look here: https://refreshless
onChange: '&?',
onStart: '&?',
onEnd: '&?'
- }
+ }
};
-
- function UmbRangeSliderController($element, $timeout, $scope, assetsService) {
-
+
+ function UmbRangeSliderController($element, $timeout, $scope, assetsService) {
+
const ctrl = this;
let sliderInstance = null;
- ctrl.$onInit = function() {
+ ctrl.$onInit = function () {
// load css file for the date picker
assetsService.loadCss('lib/nouislider/nouislider.min.css', $scope);
@@ -94,13 +94,13 @@ For extra details about options and events take a look here: https://refreshless
};
- function grabElementAndRun() {
- $timeout(function() {
+ function grabElementAndRun() {
+ $timeout(function () {
const element = $element.find('.umb-range-slider')[0];
- setSlider(element);
- }, 0, true);
+ setSlider(element);
+ }, 0, true);
}
-
+
function setSlider(element) {
sliderInstance = element;
@@ -117,82 +117,82 @@ For extra details about options and events take a look here: https://refreshless
// create new slider
noUiSlider.create(sliderInstance, options);
-
- if (ctrl.onSetup) {
- ctrl.onSetup({
- slider: sliderInstance
- });
+
+ if (ctrl.onSetup) {
+ ctrl.onSetup({
+ slider: sliderInstance
+ });
}
// If has ngModel set the date
- if (ctrl.ngModel) {
+ if (ctrl.ngModel) {
sliderInstance.noUiSlider.set(ctrl.ngModel);
}
// destroy the slider instance when the dom element is removed
- angular.element(element).on('$destroy', function() {
+ $(element).on('$destroy', function () {
sliderInstance.noUiSlider.off();
});
setUpCallbacks();
- // Refresh the scope
- $scope.$applyAsync();
+ // Refresh the scope
+ $scope.$applyAsync();
}
-
+
function setUpCallbacks() {
- if(sliderInstance) {
+ if (sliderInstance) {
// bind hook for update
- if(ctrl.onUpdate) {
- sliderInstance.noUiSlider.on('update', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onUpdate({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onUpdate) {
+ sliderInstance.noUiSlider.on('update', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onUpdate({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
// bind hook for slide
- if(ctrl.onSlide) {
- sliderInstance.noUiSlider.on('slide', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onSlide({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onSlide) {
+ sliderInstance.noUiSlider.on('slide', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onSlide({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
// bind hook for set
- if(ctrl.onSet) {
- sliderInstance.noUiSlider.on('set', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onSet({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onSet) {
+ sliderInstance.noUiSlider.on('set', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onSet({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
// bind hook for change
- if(ctrl.onChange) {
- sliderInstance.noUiSlider.on('change', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onChange({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onChange) {
+ sliderInstance.noUiSlider.on('change', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onChange({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
// bind hook for start
- if(ctrl.onStart) {
- sliderInstance.noUiSlider.on('start', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onStart({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onStart) {
+ sliderInstance.noUiSlider.on('start', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onStart({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
// bind hook for end
- if(ctrl.onEnd) {
- sliderInstance.noUiSlider.on('end', function (values, handle, unencoded, tap, positions) {
- $timeout(function() {
- ctrl.onEnd({values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions});
+ if (ctrl.onEnd) {
+ sliderInstance.noUiSlider.on('end', function (values, handle, unencoded, tap, positions) {
+ $timeout(function () {
+ ctrl.onEnd({ values: values, handle: handle, unencoded: unencoded, tap: tap, positions: positions });
});
});
}
@@ -201,7 +201,7 @@ For extra details about options and events take a look here: https://refreshless
}
}
-
+
angular.module('umbraco.directives').component('umbRangeSlider', umbRangeSlider);
-
+
})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js
index 0512abe579..1682ef968e 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js
@@ -35,7 +35,7 @@
}
//set the model defaults
- if (!angular.isObject(vm.passwordValues)) {
+ if (!Utilities.isObject(vm.passwordValues)) {
//if it's not an object then just create a new one
vm.passwordValues = {
newPassword: null,
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/util/autoscale.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/util/autoscale.directive.js
index 029a4e420f..023692be86 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/util/autoscale.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/util/autoscale.directive.js
@@ -21,7 +21,7 @@ angular.module("umbraco.directives")
var totalOffset = 0;
var offsety = parseInt(attrs.autoScale, 10);
- var window = angular.element($window);
+ var window = $($window);
if (offsety !== undefined) {
totalOffset += offsety;
}
@@ -34,7 +34,7 @@ angular.module("umbraco.directives")
el.height(window.height() - (el.offset().top + totalOffset));
}
- var resizeCallback = function() {
+ var resizeCallback = function () {
setElementSize();
};
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/util/disabletabindex.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/util/disabletabindex.directive.js
index 759d05df71..d43282715e 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/util/disabletabindex.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/util/disabletabindex.directive.js
@@ -1,46 +1,46 @@
angular.module("umbraco.directives")
.directive('disableTabindex', function (tabbableService) {
- return {
- restrict: 'A', //Can only be used as an attribute,
- scope: {
- "disableTabindex": "<"
- },
- link: function (scope, element, attrs) {
+ return {
+ restrict: 'A', //Can only be used as an attribute,
+ scope: {
+ "disableTabindex": "<"
+ },
+ link: function (scope, element, attrs) {
- if(scope.disableTabindex) {
- //Select the node that will be observed for mutations (native DOM element not jQLite version)
- var targetNode = element[0];
+ if (scope.disableTabindex) {
+ //Select the node that will be observed for mutations (native DOM element not jQLite version)
+ var targetNode = element[0];
- //Watch for DOM changes - so when the property editor subview loads in
- //We can be notified its updated the child elements inside the DIV we are watching
- var observer = new MutationObserver(domChange);
+ //Watch for DOM changes - so when the property editor subview loads in
+ //We can be notified its updated the child elements inside the DIV we are watching
+ var observer = new MutationObserver(domChange);
- // Options for the observer (which mutations to observe)
- var config = { attributes: true, childList: true, subtree: true };
+ // Options for the observer (which mutations to observe)
+ var config = { attributes: true, childList: true, subtree: true };
- function domChange(mutationsList, observer) {
- for(var mutation of mutationsList) {
+ function domChange(mutationsList, observer) {
+ for (var mutation of mutationsList) {
- //DOM items have been added or removed
- if (mutation.type == 'childList') {
+ //DOM items have been added or removed
+ if (mutation.type == 'childList') {
- //Check if any child items in mutation.target contain an input
- var childInputs = tabbableService.tabbable(mutation.target);
+ //Check if any child items in mutation.target contain an input
+ var childInputs = tabbableService.tabbable(mutation.target);
- //For each item in childInputs - override or set HTML attribute tabindex="-1"
- angular.forEach(childInputs, function(element){
- angular.element(element).attr('tabindex', '-1');
- });
+ //For each item in childInputs - override or set HTML attribute tabindex="-1"
+ angular.forEach(childInputs, function (element) {
+ $(element).attr('tabindex', '-1');
+ });
+ }
}
}
+
+ // Start observing the target node for configured mutations
+ //GO GO GO
+ observer.observe(targetNode, config);
}
- // Start observing the target node for configured mutations
- //GO GO GO
- observer.observe(targetNode, config);
}
-
- }
- };
-});
+ };
+ });
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valpropertymsg.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valpropertymsg.directive.js
index 149c2b5087..68ca771eeb 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valpropertymsg.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valpropertymsg.directive.js
@@ -101,7 +101,7 @@ function valPropertyMsg(serverValidationManager, localizationService) {
var errCount = 0;
for (var e in formCtrl.$error) {
- if (angular.isArray(formCtrl.$error[e])) {
+ if (Utilities.isArray(formCtrl.$error[e])) {
errCount++;
}
}
@@ -111,8 +111,8 @@ function valPropertyMsg(serverValidationManager, localizationService) {
// is the only one, then we'll clear.
if (errCount === 0
- || (errCount === 1 && angular.isArray(formCtrl.$error.valPropertyMsg))
- || (formCtrl.$invalid && angular.isArray(formCtrl.$error.valServer))) {
+ || (errCount === 1 && Utilities.isArray(formCtrl.$error.valPropertyMsg))
+ || (formCtrl.$invalid && Utilities.isArray(formCtrl.$error.valServer))) {
scope.errorMsg = "";
formCtrl.$setValidity('valPropertyMsg', true);
} else if (showValidation && scope.errorMsg === "") {
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
index 524b5f7efe..1f5aaaa1c2 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
@@ -40,7 +40,7 @@
function link(scope, el, attr, ctrl) {
//if there are no containing form or valFormManager controllers, then we do nothing
- if (!ctrl || !angular.isArray(ctrl) || ctrl.length !== 2 || !ctrl[0] || !ctrl[1]) {
+ if (!ctrl || !Utilities.isArray(ctrl) || ctrl.length !== 2 || !ctrl[0] || !ctrl[1]) {
return;
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/filters/umbwordlimit.filter.js b/src/Umbraco.Web.UI.Client/src/common/filters/umbwordlimit.filter.js
index c02624409f..93f0bddc96 100644
--- a/src/Umbraco.Web.UI.Client/src/common/filters/umbwordlimit.filter.js
+++ b/src/Umbraco.Web.UI.Client/src/common/filters/umbwordlimit.filter.js
@@ -13,7 +13,7 @@
function umbWordLimitFilter() {
return function (collection, property) {
- if (!angular.isString(collection)) {
+ if (!Utilities.isString(collection)) {
return collection;
}
@@ -35,4 +35,4 @@
angular.module('umbraco.filters').filter('umbWordLimit', umbWordLimitFilter);
-})();
\ No newline at end of file
+})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/interceptors/donotpostdollarvariablesrequest.interceptor.js b/src/Umbraco.Web.UI.Client/src/common/interceptors/donotpostdollarvariablesrequest.interceptor.js
index 03373089d7..f3dd60bdce 100644
--- a/src/Umbraco.Web.UI.Client/src/common/interceptors/donotpostdollarvariablesrequest.interceptor.js
+++ b/src/Umbraco.Web.UI.Client/src/common/interceptors/donotpostdollarvariablesrequest.interceptor.js
@@ -1,40 +1,40 @@
-(function() {
- 'use strict';
-
+(function () {
+ 'use strict';
+
function removeProperty(obj, propertyPrefix) {
for (var property in obj) {
if (obj.hasOwnProperty(property)) {
-
+
if (property.startsWith(propertyPrefix) && obj[property] !== undefined) {
obj[property] = undefined;
}
-
+
if (typeof obj[property] === "object") {
removeProperty(obj[property], propertyPrefix);
}
}
}
-
+
}
-
- function transform(data){
+
+ function transform(data) {
removeProperty(data, "$");
}
-
+
function doNotPostDollarVariablesRequestInterceptor($q, urlHelper) {
return {
//dealing with requests:
- 'request': function(config) {
- if(config.method === "POST"){
- var clone = angular.copy(config);
+ 'request': function (config) {
+ if (config.method === "POST") {
+ var clone = Utilities.copy(config);
transform(clone.data);
return clone;
}
-
+
return config;
}
};
- }
+ }
angular.module('umbraco.interceptors').factory('doNotPostDollarVariablesOnPostRequestInterceptor', doNotPostDollarVariablesRequestInterceptor);
})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js b/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js
index 30daaf5837..bf748975a1 100644
--- a/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js
+++ b/src/Umbraco.Web.UI.Client/src/common/interceptors/security.interceptor.js
@@ -44,7 +44,7 @@
var headers = config.headers ? config.headers : {};
//Here we'll check if we should ignore the error (either based on the original header set or the request configuration)
- if (headers["x-umb-ignore-error"] === "ignore" || config.umbIgnoreErrors === true || (angular.isArray(config.umbIgnoreStatus) && config.umbIgnoreStatus.indexOf(rejection.status) !== -1)) {
+ if (headers["x-umb-ignore-error"] === "ignore" || config.umbIgnoreErrors === true || (Utilities.isArray(config.umbIgnoreStatus) && config.umbIgnoreStatus.indexOf(rejection.status) !== -1)) {
//exit/ignore
return $q.reject(rejection);
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/datatype.mocks.js b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/datatype.mocks.js
index 054f0aa66d..e70f483bf4 100644
--- a/src/Umbraco.Web.UI.Client/src/common/mocks/resources/datatype.mocks.js
+++ b/src/Umbraco.Web.UI.Client/src/common/mocks/resources/datatype.mocks.js
@@ -1,113 +1,113 @@
angular.module('umbraco.mocks').
- factory('dataTypeMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) {
- 'use strict';
-
- function returnById(status, data, headers) {
+ factory('dataTypeMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) {
+ 'use strict';
- if (!mocksUtils.checkAuth()) {
- return [401, null, null];
- }
+ function returnById(status, data, headers) {
- var id = mocksUtils.getParameterByName(data, "id") || 1234;
+ if (!mocksUtils.checkAuth()) {
+ return [401, null, null];
+ }
- var selectedId = String.CreateGuid();
+ var id = mocksUtils.getParameterByName(data, "id") || 1234;
- var dataType = mocksUtils.getMockDataType(id, selectedId);
-
- return [200, dataType, null];
- }
-
- function returnEmpty(status, data, headers) {
+ var selectedId = String.CreateGuid();
- if (!mocksUtils.checkAuth()) {
- return [401, null, null];
- }
+ var dataType = mocksUtils.getMockDataType(id, selectedId);
- var response = returnById(200, "", null);
- var node = response[1];
+ return [200, dataType, null];
+ }
- node.name = "";
- node.selectedEditor = "";
- node.id = 0;
- node.preValues = [];
+ function returnEmpty(status, data, headers) {
- return response;
- }
-
- function returnPreValues(status, data, headers) {
+ if (!mocksUtils.checkAuth()) {
+ return [401, null, null];
+ }
- if (!mocksUtils.checkAuth()) {
- return [401, null, null];
- }
+ var response = returnById(200, "", null);
+ var node = response[1];
- var editorId = mocksUtils.getParameterByName(data, "editorId") || "83E9AD36-51A7-4440-8C07-8A5623AC6979";
+ node.name = "";
+ node.selectedEditor = "";
+ node.id = 0;
+ node.preValues = [];
- var preValues = [
- {
- label: "Custom pre value 1 for editor " + editorId,
- description: "Enter a value for this pre-value",
- key: "myPreVal",
- view: "requiredfield",
- validation: [
- {
- type: "Required"
- }
- ]
- },
- {
- label: "Custom pre value 2 for editor " + editorId,
- description: "Enter a value for this pre-value",
- key: "myPreVal",
- view: "requiredfield",
- validation: [
- {
- type: "Required"
- }
- ]
- }
- ];
- return [200, preValues, null];
- }
-
- function returnSave(status, data, headers) {
- if (!mocksUtils.checkAuth()) {
- return [401, null, null];
- }
+ return response;
+ }
- var postedData = angular.fromJson(headers);
+ function returnPreValues(status, data, headers) {
- var dataType = mocksUtils.getMockDataType(postedData.id, postedData.selectedEditor);
- dataType.notifications = [{
- header: "Saved",
- message: "Data type saved",
- type: 0
- }];
+ if (!mocksUtils.checkAuth()) {
+ return [401, null, null];
+ }
- return [200, dataType, null];
- }
+ var editorId = mocksUtils.getParameterByName(data, "editorId") || "83E9AD36-51A7-4440-8C07-8A5623AC6979";
- return {
- register: function() {
-
- $httpBackend
- .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/PostSave'))
- .respond(returnSave);
-
- $httpBackend
- .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById'))
- .respond(returnById);
-
- $httpBackend
- .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetEmpty'))
- .respond(returnEmpty);
-
- $httpBackend
- .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetPreValues'))
- .respond(returnPreValues);
- },
- expectGetById: function() {
- $httpBackend
- .expectGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById'));
- }
- };
- }]);
+ var preValues = [
+ {
+ label: "Custom pre value 1 for editor " + editorId,
+ description: "Enter a value for this pre-value",
+ key: "myPreVal",
+ view: "requiredfield",
+ validation: [
+ {
+ type: "Required"
+ }
+ ]
+ },
+ {
+ label: "Custom pre value 2 for editor " + editorId,
+ description: "Enter a value for this pre-value",
+ key: "myPreVal",
+ view: "requiredfield",
+ validation: [
+ {
+ type: "Required"
+ }
+ ]
+ }
+ ];
+ return [200, preValues, null];
+ }
+
+ function returnSave(status, data, headers) {
+ if (!mocksUtils.checkAuth()) {
+ return [401, null, null];
+ }
+
+ var postedData = JSON.parse(headers);
+
+ var dataType = mocksUtils.getMockDataType(postedData.id, postedData.selectedEditor);
+ dataType.notifications = [{
+ header: "Saved",
+ message: "Data type saved",
+ type: 0
+ }];
+
+ return [200, dataType, null];
+ }
+
+ return {
+ register: function () {
+
+ $httpBackend
+ .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/PostSave'))
+ .respond(returnSave);
+
+ $httpBackend
+ .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById'))
+ .respond(returnById);
+
+ $httpBackend
+ .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetEmpty'))
+ .respond(returnEmpty);
+
+ $httpBackend
+ .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetPreValues'))
+ .respond(returnPreValues);
+ },
+ expectGetById: function () {
+ $httpBackend
+ .expectGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById'));
+ }
+ };
+ }]);
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js
index cc9da4dbef..078ad2ad43 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js
@@ -30,7 +30,7 @@ function authResource($q, $http, umbRequestHelper, angularHelper) {
umbRequestHelper.getApiUrl(
"authenticationApiBaseUrl",
"PostSend2FACode"),
- angular.toJson(provider)),
+ Utilities.toJson(provider)),
'Could not send code');
},
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 d714ea4938..7bc2a9d2c8 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
@@ -610,10 +610,10 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
//converts the value to a js bool
function toBool(v) {
- if (angular.isNumber(v)) {
+ if (Utilities.isNumber(v)) {
return v > 0;
}
- if (angular.isString(v)) {
+ if (Utilities.isString(v)) {
return v === "true";
}
if (typeof v === "boolean") {
@@ -1003,10 +1003,10 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
loginPageId: loginPageId,
errorPageId: errorPageId
};
- if (angular.isArray(groups) && groups.length) {
+ if (Utilities.isArray(groups) && groups.length) {
publicAccess.groups = groups;
}
- else if (angular.isArray(usernames) && usernames.length) {
+ else if (Utilities.isArray(usernames) && usernames.length) {
publicAccess.usernames = usernames;
}
else {
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/currentuser.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/currentuser.resource.js
index e10837ceca..60b87e919f 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/currentuser.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/currentuser.resource.js
@@ -87,7 +87,7 @@ function currentUserResource($q, $http, umbRequestHelper, umbDataFormatter) {
umbRequestHelper.getApiUrl(
"currentUserApiBaseUrl",
"PostSetInvitedUserPassword"),
- angular.toJson(newPassword)),
+ Utilities.toJson(newPassword)),
'Failed to change password');
},
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
index e4e3cc6f3f..e24f4786eb 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/media.resource.js
@@ -348,10 +348,10 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
//converts the value to a js bool
function toBool(v) {
- if (angular.isNumber(v)) {
+ if (Utilities.isNumber(v)) {
return v > 0;
}
- if (angular.isString(v)) {
+ if (Utilities.isString(v)) {
return v === "true";
}
if (typeof v === "boolean") {
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js
index d21edbbab8..c45e173a98 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/member.resource.js
@@ -53,10 +53,10 @@ function memberResource($q, $http, umbDataFormatter, umbRequestHelper) {
//converts the value to a js bool
function toBool(v) {
- if (angular.isNumber(v)) {
+ if (Utilities.isNumber(v)) {
return v > 0;
}
- if (angular.isString(v)) {
+ if (Utilities.isString(v)) {
return v === "true";
}
if (typeof v === "boolean") {
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/angularhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/angularhelper.service.js
index 8cba83328f..f2ff711ac9 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/angularhelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/angularhelper.service.js
@@ -33,7 +33,7 @@ function angularHelper($q) {
//this is sequential promise chaining, it's not pretty but we need to do it this way.
//$q.all doesn't execute promises in sequence but that's what we want to do here.
- if (!angular.isArray(promises)) {
+ if (!Utilities.isArray(promises)) {
throw "promises must be an array";
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
index 6673002981..30e59e9a88 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js
@@ -256,7 +256,7 @@ angular.module('umbraco.services')
load: function (pathArray, scope, defaultAssetType) {
var promise;
- if (!angular.isArray(pathArray)) {
+ if (!Utilities.isArray(pathArray)) {
throw "pathArray must be an array";
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
index 20a47ae32c..5cf54ad6a0 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js
@@ -10,7 +10,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, editorSt
function isValidIdentifier(id) {
//empty id <= 0
- if (angular.isNumber(id)) {
+ if (Utilities.isNumber(id)) {
if (id === 0) {
return false;
}
@@ -39,7 +39,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, editorSt
/** Used by the content editor and mini content editor to perform saving operations */
contentEditorPerformSave: function (args) {
- if (!angular.isObject(args)) {
+ if (!Utilities.isObject(args)) {
throw "args must be an object";
}
if (!args.scope) {
@@ -152,7 +152,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, editorSt
here we'll build the buttons according to the chars of the user. */
configureContentEditorButtons: function (args) {
- if (!angular.isObject(args)) {
+ if (!Utilities.isObject(args)) {
throw "args must be an object";
}
if (!args.content) {
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js
index 305e4a694d..1be66cc68f 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js
@@ -7,21 +7,21 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
var contentTypeHelperService = {
- createIdArray: function(array) {
+ createIdArray: function (array) {
- var newArray = [];
+ var newArray = [];
- angular.forEach(array, function(arrayItem){
+ angular.forEach(array, function (arrayItem) {
- if(angular.isObject(arrayItem)) {
- newArray.push(arrayItem.id);
- } else {
- newArray.push(arrayItem);
- }
+ if (Utilities.isObject(arrayItem)) {
+ newArray.push(arrayItem.id);
+ } else {
+ newArray.push(arrayItem);
+ }
- });
+ });
- return newArray;
+ return newArray;
},
@@ -30,18 +30,18 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
var modelsResource = $injector.has("modelsBuilderManagementResource") ? $injector.get("modelsBuilderManagementResource") : null;
var modelsBuilderEnabled = Umbraco.Sys.ServerVariables.umbracoPlugins.modelsBuilder.enabled;
if (modelsBuilderEnabled && modelsResource) {
- modelsResource.buildModels().then(function(result) {
+ modelsResource.buildModels().then(function (result) {
deferred.resolve(result);
//just calling this to get the servar back to life
modelsResource.getModelsOutOfDateStatus();
- }, function(e) {
+ }, function (e) {
deferred.reject(e);
});
}
- else {
- deferred.resolve(false);
+ else {
+ deferred.resolve(false);
}
return deferred.promise;
},
@@ -49,10 +49,10 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
checkModelsBuilderStatus: function () {
var deferred = $q.defer();
var modelsResource = $injector.has("modelsBuilderManagementResource") ? $injector.get("modelsBuilderManagementResource") : null;
- var modelsBuilderEnabled = (Umbraco && Umbraco.Sys && Umbraco.Sys.ServerVariables && Umbraco.Sys.ServerVariables.umbracoPlugins && Umbraco.Sys.ServerVariables.umbracoPlugins.modelsBuilder && Umbraco.Sys.ServerVariables.umbracoPlugins.modelsBuilder.enabled === true);
-
+ var modelsBuilderEnabled = (Umbraco && Umbraco.Sys && Umbraco.Sys.ServerVariables && Umbraco.Sys.ServerVariables.umbracoPlugins && Umbraco.Sys.ServerVariables.umbracoPlugins.modelsBuilder && Umbraco.Sys.ServerVariables.umbracoPlugins.modelsBuilder.enabled === true);
+
if (modelsBuilderEnabled && modelsResource) {
- modelsResource.getModelsOutOfDateStatus().then(function(result) {
+ modelsResource.getModelsOutOfDateStatus().then(function (result) {
//Generate models buttons should be enabled if it is 0
deferred.resolve(result.status === 0);
});
@@ -64,37 +64,37 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
},
makeObjectArrayFromId: function (idArray, objectArray) {
- var newArray = [];
+ var newArray = [];
- for (var idIndex = 0; idArray.length > idIndex; idIndex++) {
- var id = idArray[idIndex];
+ for (var idIndex = 0; idArray.length > idIndex; idIndex++) {
+ var id = idArray[idIndex];
- for (var objectIndex = 0; objectArray.length > objectIndex; objectIndex++) {
- var object = objectArray[objectIndex];
- if (id === object.id) {
- newArray.push(object);
- }
- }
+ for (var objectIndex = 0; objectArray.length > objectIndex; objectIndex++) {
+ var object = objectArray[objectIndex];
+ if (id === object.id) {
+ newArray.push(object);
+ }
+ }
- }
+ }
- return newArray;
+ return newArray;
},
- validateAddingComposition: function(contentType, compositeContentType) {
+ validateAddingComposition: function (contentType, compositeContentType) {
//Validate that by adding this group that we are not adding duplicate property type aliases
- var propertiesAdding = _.flatten(_.map(compositeContentType.groups, function(g) {
- return _.map(g.properties, function(p) {
+ var propertiesAdding = _.flatten(_.map(compositeContentType.groups, function (g) {
+ return _.map(g.properties, function (p) {
return p.alias;
});
}));
- var propAliasesExisting = _.filter(_.flatten(_.map(contentType.groups, function(g) {
- return _.map(g.properties, function(p) {
+ var propAliasesExisting = _.filter(_.flatten(_.map(contentType.groups, function (g) {
+ return _.map(g.properties, function (p) {
return p.alias;
});
- })), function(f) {
+ })), function (f) {
return f !== null && f !== undefined;
});
@@ -108,7 +108,7 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
return [];
},
- mergeCompositeContentType: function(contentType, compositeContentType) {
+ mergeCompositeContentType: function (contentType, compositeContentType) {
//Validate that there are no overlapping aliases
var overlappingAliases = this.validateAddingComposition(contentType, compositeContentType);
@@ -116,107 +116,107 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
throw new Error("Cannot add this composition, these properties already exist on the content type: " + overlappingAliases.join());
}
- angular.forEach(compositeContentType.groups, function(compositionGroup) {
+ angular.forEach(compositeContentType.groups, function (compositionGroup) {
- // order composition groups based on sort order
- compositionGroup.properties = $filter('orderBy')(compositionGroup.properties, 'sortOrder');
+ // order composition groups based on sort order
+ compositionGroup.properties = $filter('orderBy')(compositionGroup.properties, 'sortOrder');
- // get data type details
- angular.forEach(compositionGroup.properties, function(property) {
- dataTypeResource.getById(property.dataTypeId)
- .then(function(dataType) {
- property.dataTypeIcon = dataType.icon;
- property.dataTypeName = dataType.name;
- });
- });
+ // get data type details
+ angular.forEach(compositionGroup.properties, function (property) {
+ dataTypeResource.getById(property.dataTypeId)
+ .then(function (dataType) {
+ property.dataTypeIcon = dataType.icon;
+ property.dataTypeName = dataType.name;
+ });
+ });
- // set inherited state on tab
- compositionGroup.inherited = true;
+ // set inherited state on tab
+ compositionGroup.inherited = true;
- // set inherited state on properties
- angular.forEach(compositionGroup.properties, function(compositionProperty) {
- compositionProperty.inherited = true;
- });
+ // set inherited state on properties
+ angular.forEach(compositionGroup.properties, function (compositionProperty) {
+ compositionProperty.inherited = true;
+ });
- // set tab state
- compositionGroup.tabState = "inActive";
+ // set tab state
+ compositionGroup.tabState = "inActive";
- // if groups are named the same - merge the groups
- angular.forEach(contentType.groups, function(contentTypeGroup) {
+ // if groups are named the same - merge the groups
+ angular.forEach(contentType.groups, function (contentTypeGroup) {
- if (contentTypeGroup.name === compositionGroup.name) {
+ if (contentTypeGroup.name === compositionGroup.name) {
- // set flag to show if properties has been merged into a tab
- compositionGroup.groupIsMerged = true;
+ // set flag to show if properties has been merged into a tab
+ compositionGroup.groupIsMerged = true;
- // make group inherited
- contentTypeGroup.inherited = true;
+ // make group inherited
+ contentTypeGroup.inherited = true;
- // add properties to the top of the array
- contentTypeGroup.properties = compositionGroup.properties.concat(contentTypeGroup.properties);
+ // add properties to the top of the array
+ contentTypeGroup.properties = compositionGroup.properties.concat(contentTypeGroup.properties);
- // update sort order on all properties in merged group
- contentTypeGroup.properties = contentTypeHelperService.updatePropertiesSortOrder(contentTypeGroup.properties);
+ // update sort order on all properties in merged group
+ contentTypeGroup.properties = contentTypeHelperService.updatePropertiesSortOrder(contentTypeGroup.properties);
+
+ // make parentTabContentTypeNames to an array so we can push values
+ if (contentTypeGroup.parentTabContentTypeNames === null || contentTypeGroup.parentTabContentTypeNames === undefined) {
+ contentTypeGroup.parentTabContentTypeNames = [];
+ }
+
+ // push name to array of merged composite content types
+ contentTypeGroup.parentTabContentTypeNames.push(compositeContentType.name);
+
+ // make parentTabContentTypes to an array so we can push values
+ if (contentTypeGroup.parentTabContentTypes === null || contentTypeGroup.parentTabContentTypes === undefined) {
+ contentTypeGroup.parentTabContentTypes = [];
+ }
+
+ // push id to array of merged composite content types
+ contentTypeGroup.parentTabContentTypes.push(compositeContentType.id);
+
+ // get sort order from composition
+ contentTypeGroup.sortOrder = compositionGroup.sortOrder;
+
+ // splice group to the top of the array
+ var contentTypeGroupCopy = Utilities.copy(contentTypeGroup);
+ var index = contentType.groups.indexOf(contentTypeGroup);
+ contentType.groups.splice(index, 1);
+ contentType.groups.unshift(contentTypeGroupCopy);
+
+ }
+
+ });
+
+ // if group is not merged - push it to the end of the array - before init tab
+ if (compositionGroup.groupIsMerged === false || compositionGroup.groupIsMerged === undefined) {
// make parentTabContentTypeNames to an array so we can push values
- if (contentTypeGroup.parentTabContentTypeNames === null || contentTypeGroup.parentTabContentTypeNames === undefined) {
- contentTypeGroup.parentTabContentTypeNames = [];
+ if (compositionGroup.parentTabContentTypeNames === null || compositionGroup.parentTabContentTypeNames === undefined) {
+ compositionGroup.parentTabContentTypeNames = [];
}
// push name to array of merged composite content types
- contentTypeGroup.parentTabContentTypeNames.push(compositeContentType.name);
+ compositionGroup.parentTabContentTypeNames.push(compositeContentType.name);
// make parentTabContentTypes to an array so we can push values
- if (contentTypeGroup.parentTabContentTypes === null || contentTypeGroup.parentTabContentTypes === undefined) {
- contentTypeGroup.parentTabContentTypes = [];
+ if (compositionGroup.parentTabContentTypes === null || compositionGroup.parentTabContentTypes === undefined) {
+ compositionGroup.parentTabContentTypes = [];
}
// push id to array of merged composite content types
- contentTypeGroup.parentTabContentTypes.push(compositeContentType.id);
+ compositionGroup.parentTabContentTypes.push(compositeContentType.id);
- // get sort order from composition
- contentTypeGroup.sortOrder = compositionGroup.sortOrder;
+ // push group before placeholder tab
+ contentType.groups.unshift(compositionGroup);
- // splice group to the top of the array
- var contentTypeGroupCopy = angular.copy(contentTypeGroup);
- var index = contentType.groups.indexOf(contentTypeGroup);
- contentType.groups.splice(index, 1);
- contentType.groups.unshift(contentTypeGroupCopy);
+ }
- }
+ });
- });
+ // sort all groups by sortOrder property
+ contentType.groups = $filter('orderBy')(contentType.groups, 'sortOrder');
- // if group is not merged - push it to the end of the array - before init tab
- if (compositionGroup.groupIsMerged === false || compositionGroup.groupIsMerged === undefined) {
-
- // make parentTabContentTypeNames to an array so we can push values
- if (compositionGroup.parentTabContentTypeNames === null || compositionGroup.parentTabContentTypeNames === undefined) {
- compositionGroup.parentTabContentTypeNames = [];
- }
-
- // push name to array of merged composite content types
- compositionGroup.parentTabContentTypeNames.push(compositeContentType.name);
-
- // make parentTabContentTypes to an array so we can push values
- if (compositionGroup.parentTabContentTypes === null || compositionGroup.parentTabContentTypes === undefined) {
- compositionGroup.parentTabContentTypes = [];
- }
-
- // push id to array of merged composite content types
- compositionGroup.parentTabContentTypes.push(compositeContentType.id);
-
- // push group before placeholder tab
- contentType.groups.unshift(compositionGroup);
-
- }
-
- });
-
- // sort all groups by sortOrder property
- contentType.groups = $filter('orderBy')(contentType.groups, 'sortOrder');
-
- return contentType;
+ return contentType;
},
@@ -224,22 +224,22 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
var groups = [];
- angular.forEach(contentType.groups, function(contentTypeGroup){
+ angular.forEach(contentType.groups, function (contentTypeGroup) {
- if( contentTypeGroup.tabState !== "init" ) {
+ if (contentTypeGroup.tabState !== "init") {
var idIndex = contentTypeGroup.parentTabContentTypes.indexOf(compositeContentType.id);
var nameIndex = contentTypeGroup.parentTabContentTypeNames.indexOf(compositeContentType.name);
var groupIndex = contentType.groups.indexOf(contentTypeGroup);
- if( idIndex !== -1 ) {
+ if (idIndex !== -1) {
var properties = [];
// remove all properties from composite content type
- angular.forEach(contentTypeGroup.properties, function(property){
- if(property.contentTypeId !== compositeContentType.id) {
+ angular.forEach(contentTypeGroup.properties, function (property) {
+ if (property.contentTypeId !== compositeContentType.id) {
properties.push(property);
}
});
@@ -252,22 +252,22 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
contentTypeGroup.parentTabContentTypeNames.splice(nameIndex, 1);
// remove inherited state if there are no inherited properties
- if(contentTypeGroup.parentTabContentTypes.length === 0) {
+ if (contentTypeGroup.parentTabContentTypes.length === 0) {
contentTypeGroup.inherited = false;
}
// remove group if there are no properties left
- if(contentTypeGroup.properties.length > 1) {
+ if (contentTypeGroup.properties.length > 1) {
//contentType.groups.splice(groupIndex, 1);
groups.push(contentTypeGroup);
}
} else {
- groups.push(contentTypeGroup);
+ groups.push(contentTypeGroup);
}
} else {
- groups.push(contentTypeGroup);
+ groups.push(contentTypeGroup);
}
// update sort order on properties
@@ -281,67 +281,67 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
updatePropertiesSortOrder: function (properties) {
- var sortOrder = 0;
+ var sortOrder = 0;
- angular.forEach(properties, function(property) {
- if( !property.inherited && property.propertyState !== "init") {
- property.sortOrder = sortOrder;
- }
- sortOrder++;
- });
+ angular.forEach(properties, function (property) {
+ if (!property.inherited && property.propertyState !== "init") {
+ property.sortOrder = sortOrder;
+ }
+ sortOrder++;
+ });
- return properties;
+ return properties;
},
- getTemplatePlaceholder: function() {
+ getTemplatePlaceholder: function () {
- var templatePlaceholder = {
- "name": "",
- "icon": "icon-layout",
- "alias": "templatePlaceholder",
- "placeholder": true
- };
+ var templatePlaceholder = {
+ "name": "",
+ "icon": "icon-layout",
+ "alias": "templatePlaceholder",
+ "placeholder": true
+ };
- return templatePlaceholder;
+ return templatePlaceholder;
},
- insertDefaultTemplatePlaceholder: function(defaultTemplate) {
+ insertDefaultTemplatePlaceholder: function (defaultTemplate) {
- // get template placeholder
- var templatePlaceholder = contentTypeHelperService.getTemplatePlaceholder();
+ // get template placeholder
+ var templatePlaceholder = contentTypeHelperService.getTemplatePlaceholder();
- // add as default template
- defaultTemplate = templatePlaceholder;
+ // add as default template
+ defaultTemplate = templatePlaceholder;
- return defaultTemplate;
+ return defaultTemplate;
},
- insertTemplatePlaceholder: function(array) {
+ insertTemplatePlaceholder: function (array) {
- // get template placeholder
- var templatePlaceholder = contentTypeHelperService.getTemplatePlaceholder();
+ // get template placeholder
+ var templatePlaceholder = contentTypeHelperService.getTemplatePlaceholder();
- // add as selected item
- array.push(templatePlaceholder);
+ // add as selected item
+ array.push(templatePlaceholder);
- return array;
+ return array;
- },
+ },
- insertChildNodePlaceholder: function (array, name, icon, id) {
+ insertChildNodePlaceholder: function (array, name, icon, id) {
- var placeholder = {
- "name": name,
- "icon": icon,
- "id": id
- };
+ var placeholder = {
+ "name": name,
+ "icon": icon,
+ "id": id
+ };
- array.push(placeholder);
+ array.push(placeholder);
- }
+ }
};
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 9c935086a0..538bd41ce0 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
@@ -164,14 +164,14 @@ When building a custom infinite editor view you can use the same components as a
"use strict";
function editorService(eventsService, keyboardService, $timeout) {
-
-
+
+
let editorsKeyboardShorcuts = [];
var editors = [];
var isEnabled = true;
var lastElementInFocus = null;
-
-
+
+
// events for backdrop
eventsService.on("appState.backdrop", function (name, args) {
if (args.show === true) {
@@ -180,7 +180,7 @@ When building a custom infinite editor view you can use the same components as a
focus();
}
});
-
+
/**
* @ngdoc method
@@ -205,7 +205,7 @@ When building a custom infinite editor view you can use the same components as a
function getNumberOfEditors() {
return editors.length;
};
-
+
/**
* @ngdoc method
* @name umbraco.services.editorService#blur
@@ -232,7 +232,7 @@ When building a custom infinite editor view you can use the same components as a
* Method to tell editors that they are gaining focus again.
*/
function focus() {
- if(isEnabled === false) {
+ if (isEnabled === false) {
/* keyboard shortcuts will be overwritten by the new infinite editor
so we need to store the shortcuts for the current editor so they can be rebound
when the infinite editor closes
@@ -241,7 +241,7 @@ When building a custom infinite editor view you can use the same components as a
isEnabled = true;
}
}
-
+
/**
* @ngdoc method
* @name umbraco.services.editorService#open
@@ -305,7 +305,7 @@ When building a custom infinite editor view you can use the same components as a
// delay required to map the properties to the correct editor due
// to another delay in the closing animation of the editor
- $timeout(function() {
+ $timeout(function () {
// rebind keyboard shortcuts for the new editor in focus
rebindKeyboardShortcuts();
@@ -651,7 +651,7 @@ When building a custom infinite editor view you can use the same components as a
editor.view = "views/mediatypes/edit.html";
open(editor);
}
-
+
/**
* @ngdoc method
* @name umbraco.services.editorService#memberTypeEditor
@@ -928,21 +928,21 @@ When building a custom infinite editor view you can use the same components as a
open(editor);
}
- /**
- * @ngdoc method
- * @name umbraco.services.editorService#memberPicker
- * @methodOf umbraco.services.editorService
- *
- * @description
- * Opens a member picker in infinite editing, the submit callback returns an array of selected items
- *
- * @param {Object} editor rendering options
- * @param {Boolean} editor.multiPicker Pick one or multiple items
- * @param {Function} editor.submit Callback function when the submit button is clicked. Returns the editor model object
- * @param {Function} editor.close Callback function when the close button is clicked.
- *
- * @returns {Object} editor object
- */
+ /**
+ * @ngdoc method
+ * @name umbraco.services.editorService#memberPicker
+ * @methodOf umbraco.services.editorService
+ *
+ * @description
+ * Opens a member picker in infinite editing, the submit callback returns an array of selected items
+ *
+ * @param {Object} editor rendering options
+ * @param {Boolean} editor.multiPicker Pick one or multiple items
+ * @param {Function} editor.submit Callback function when the submit button is clicked. Returns the editor model object
+ * @param {Function} editor.close Callback function when the close button is clicked.
+ *
+ * @returns {Object} editor object
+ */
function memberPicker(editor) {
editor.view = "views/common/infiniteeditors/treepicker/treepicker.html";
if (!editor.size) editor.size = "small";
@@ -985,7 +985,7 @@ When building a custom infinite editor view you can use the same components as a
*
*/
function unbindKeyboardShortcuts() {
- const shortcuts = angular.copy(keyboardService.keyboardEvent);
+ const shortcuts = Utilities.copy(keyboardService.keyboardEvent);
editorsKeyboardShorcuts.push(shortcuts);
// unbind the current shortcuts because we only want to
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js b/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js
index 41614a3bee..9e0285d58d 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js
@@ -27,10 +27,10 @@ function fileManager($rootScope) {
setFiles: function (args) {
//propertyAlias, files
- if (!angular.isString(args.propertyAlias)) {
+ if (!Utilities.isString(args.propertyAlias)) {
throw "args.propertyAlias must be a non empty string";
}
- if (!angular.isObject(args.files)) {
+ if (!Utilities.isObject(args.files)) {
throw "args.files must be an object";
}
@@ -40,7 +40,7 @@ function fileManager($rootScope) {
}
var metaData = [];
- if (angular.isArray(args.metaData)) {
+ if (Utilities.isArray(args.metaData)) {
metaData = args.metaData;
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js
index 0555318bae..9d84c3c616 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js
@@ -83,7 +83,7 @@ function formHelper(angularHelper, serverValidationManager, notificationsService
if (!args || !args.notifications) {
return false;
}
- if (angular.isArray(args.notifications)) {
+ if (Utilities.isArray(args.notifications)) {
for (var i = 0; i < args.notifications.length; i++) {
notificationsService.showNotification(args.notifications[i]);
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/listviewhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/listviewhelper.service.js
index 20d014ab0f..28156e70c3 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/listviewhelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/listviewhelper.service.js
@@ -332,14 +332,14 @@
selection.length = 0;
- if (angular.isArray(items)) {
+ if (Utilities.isArray(items)) {
for (i = 0; items.length > i; i++) {
var item = items[i];
item.selected = false;
}
}
- if(angular.isArray(folders)) {
+ if(Utilities.isArray(folders)) {
for (i = 0; folders.length > i; i++) {
var folder = folders[i];
folder.selected = false;
@@ -366,7 +366,7 @@
var checkbox = $event.target;
var clearSelection = false;
- if (!angular.isArray(items)) {
+ if (!Utilities.isArray(items)) {
return;
}
@@ -413,7 +413,7 @@
function selectAllItemsToggle(items, selection) {
- if (!angular.isArray(items)) {
+ if (!Utilities.isArray(items)) {
return;
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js
index a91f9d51e4..5b79b9c327 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js
@@ -62,12 +62,12 @@ function macroService() {
val = val ? val : "";
//need to detect if the val is a string or an object
var keyVal;
- if (angular.isString(val)) {
+ if (Utilities.isString(val)) {
keyVal = key + "=\"" + (val ? val : "") + "\" ";
}
else {
//if it's not a string we'll send it through the json serializer
- var json = angular.toJson(val);
+ var json = Utilities.toJson(val);
//then we need to url encode it so that it's safe
var encoded = encodeURIComponent(json);
keyVal = key + "=\"" + encoded + "\" ";
@@ -142,7 +142,7 @@ function macroService() {
if (item.value !== null && item.value !== undefined && !_.isString(item.value)) {
try {
- val = angular.toJson(val);
+ val = Utilities.toJson(val);
}
catch (e) {
// not json
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
index 244573d79c..75c9dccc30 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js
@@ -45,7 +45,7 @@ function mediaHelper(umbRequestHelper, $http, $log) {
//this performs a simple check to see if we have a media file as value
//it doesnt catch everything, but better then nothing
- if (angular.isString(item.value) && item.value.indexOf(mediaRoot) === 0) {
+ if (Utilities.isString(item.value) && item.value.indexOf(mediaRoot) === 0) {
return true;
}
@@ -143,7 +143,7 @@ function mediaHelper(umbRequestHelper, $http, $log) {
*/
resolveFileFromEntity: function (mediaEntity, thumbnail) {
- var mediaPath = angular.isObject(mediaEntity.metaData) ? mediaEntity.metaData.MediaPath : null;
+ var mediaPath = Utilities.isObject(mediaEntity.metaData) ? mediaEntity.metaData.MediaPath : null;
if (!mediaPath) {
//don't throw since this image legitimately might not contain a media path, but output a warning
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 ab9cfb63d2..0198907119 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
@@ -26,60 +26,60 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
navReadyPromise.resolve(mainTreeApi);
});
-
+
//A list of query strings defined that when changed will not cause a reload of the route
var nonRoutingQueryStrings = ["mculture", "cculture", "lq", "sr"];
var retainedQueryStrings = ["mculture"];
-
+
function setMode(mode) {
switch (mode) {
- case 'tree':
- appState.setGlobalState("navMode", "tree");
- appState.setGlobalState("showNavigation", true);
- appState.setMenuState("showMenu", false);
- appState.setMenuState("showMenuDialog", false);
- appState.setGlobalState("stickyNavigation", false);
- appState.setGlobalState("showTray", false);
- break;
- case 'menu':
- appState.setGlobalState("navMode", "menu");
- appState.setGlobalState("showNavigation", true);
- appState.setMenuState("showMenu", true);
- appState.setMenuState("showMenuDialog", false);
- appState.setGlobalState("stickyNavigation", true);
- break;
- case 'dialog':
- appState.setGlobalState("navMode", "dialog");
- appState.setGlobalState("stickyNavigation", true);
- appState.setGlobalState("showNavigation", true);
- appState.setMenuState("showMenu", false);
- appState.setMenuState("showMenuDialog", true);
- appState.setMenuState("allowHideMenuDialog", true);
- break;
- case 'search':
- appState.setGlobalState("navMode", "search");
- appState.setGlobalState("stickyNavigation", false);
- appState.setGlobalState("showNavigation", true);
- appState.setMenuState("showMenu", false);
- appState.setSectionState("showSearchResults", true);
- appState.setMenuState("showMenuDialog", false);
- break;
- default:
- appState.setGlobalState("navMode", "default");
- appState.setMenuState("showMenu", false);
- appState.setMenuState("showMenuDialog", false);
- appState.setMenuState("allowHideMenuDialog", true);
- appState.setSectionState("showSearchResults", false);
- appState.setGlobalState("stickyNavigation", false);
- appState.setGlobalState("showTray", false);
- appState.setMenuState("currentNode", null);
+ case 'tree':
+ appState.setGlobalState("navMode", "tree");
+ appState.setGlobalState("showNavigation", true);
+ appState.setMenuState("showMenu", false);
+ appState.setMenuState("showMenuDialog", false);
+ appState.setGlobalState("stickyNavigation", false);
+ appState.setGlobalState("showTray", false);
+ break;
+ case 'menu':
+ appState.setGlobalState("navMode", "menu");
+ appState.setGlobalState("showNavigation", true);
+ appState.setMenuState("showMenu", true);
+ appState.setMenuState("showMenuDialog", false);
+ appState.setGlobalState("stickyNavigation", true);
+ break;
+ case 'dialog':
+ appState.setGlobalState("navMode", "dialog");
+ appState.setGlobalState("stickyNavigation", true);
+ appState.setGlobalState("showNavigation", true);
+ appState.setMenuState("showMenu", false);
+ appState.setMenuState("showMenuDialog", true);
+ appState.setMenuState("allowHideMenuDialog", true);
+ break;
+ case 'search':
+ appState.setGlobalState("navMode", "search");
+ appState.setGlobalState("stickyNavigation", false);
+ appState.setGlobalState("showNavigation", true);
+ appState.setMenuState("showMenu", false);
+ appState.setSectionState("showSearchResults", true);
+ appState.setMenuState("showMenuDialog", false);
+ break;
+ default:
+ appState.setGlobalState("navMode", "default");
+ appState.setMenuState("showMenu", false);
+ appState.setMenuState("showMenuDialog", false);
+ appState.setMenuState("allowHideMenuDialog", true);
+ appState.setSectionState("showSearchResults", false);
+ appState.setGlobalState("stickyNavigation", false);
+ appState.setGlobalState("showTray", false);
+ appState.setMenuState("currentNode", null);
- if (appState.getGlobalState("isTablet") === true) {
- appState.setGlobalState("showNavigation", false);
- }
+ if (appState.getGlobalState("isTablet") === true) {
+ appState.setGlobalState("showNavigation", false);
+ }
- break;
+ break;
}
}
@@ -88,7 +88,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @param {any} requestPath
*/
function pathToRouteParts(requestPath) {
- if (!angular.isString(requestPath)) {
+ if (!Utilities.isString(requestPath)) {
throw "The value for requestPath is not a string";
}
var pathAndQuery = requestPath.split("#")[1];
@@ -114,7 +114,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
}
var service = {
-
+
/**
* @ngdoc method
* @name umbraco.services.navigationService#isRouteChangingNavigation
@@ -130,11 +130,11 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
*/
isRouteChangingNavigation: function (currUrlParams, nextUrlParams) {
- if (angular.isString(currUrlParams)) {
+ if (Utilities.isString(currUrlParams)) {
currUrlParams = pathToRouteParts(currUrlParams);
}
- if (angular.isString(nextUrlParams)) {
+ if (Utilities.isString(nextUrlParams)) {
nextUrlParams = pathToRouteParts(nextUrlParams);
}
@@ -151,7 +151,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
var nextRoutingKeys = _.difference(_.keys(nextUrlParams), nonRoutingQueryStrings);
var diff1 = _.difference(currRoutingKeys, nextRoutingKeys);
var diff2 = _.difference(nextRoutingKeys, currRoutingKeys);
-
+
//if the routing parameter keys are the same, we'll compare their values to see if any have changed and if so then the routing will be allowed.
if (diff1.length === 0 && diff2.length === 0) {
var partsChanged = 0;
@@ -223,7 +223,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @param {Object} nextRouteParams The next route parameters
*/
retainQueryStrings: function (currRouteParams, nextRouteParams) {
- var toRetain = angular.copy(nextRouteParams);
+ var toRetain = Utilities.copy(nextRouteParams);
var updated = false;
_.each(retainedQueryStrings, function (r) {
@@ -260,7 +260,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* and load the dashboard related to the section
* @param {string} sectionAlias The alias of the section
*/
- changeSection: function(sectionAlias, force) {
+ changeSection: function (sectionAlias, force) {
setMode("default-opensection");
if (force && appState.getSectionState("currentSection") === sectionAlias) {
@@ -360,19 +360,19 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
TODO: Delete this if not required
*/
- _syncPath: function(path, forceReload) {
+ _syncPath: function (path, forceReload) {
return navReadyPromise.promise.then(function () {
return mainTreeApi.syncTree({ path: path, forceReload: forceReload });
});
},
-
- reloadNode: function(node) {
+
+ reloadNode: function (node) {
return navReadyPromise.promise.then(function () {
return mainTreeApi.reloadNode(node);
});
},
-
- reloadSection: function(sectionAlias) {
+
+ reloadSection: function (sectionAlias) {
return navReadyPromise.promise.then(function () {
treeService.clearCache({ section: sectionAlias });
return mainTreeApi.load(sectionAlias);
@@ -387,11 +387,11 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @description
* Hides the tree by hiding the containing dom element
*/
- hideTree: function() {
+ hideTree: function () {
if (appState.getGlobalState("isTablet") === true && !appState.getGlobalState("stickyNavigation")) {
//reset it to whatever is in the url
- appState.setSectionState("currentSection", $routeParams.section);
+ appState.setSectionState("currentSection", $routeParams.section);
setMode("default-hidesectiontree");
}
@@ -409,19 +409,19 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
*
* @param {Event} event the click event triggering the method, passed from the DOM element
*/
- showMenu: function(args) {
-
+ showMenu: function (args) {
+
var self = this;
return treeService.getMenu({ treeNode: args.node })
- .then(function(data) {
+ .then(function (data) {
//check for a default
//NOTE: event will be undefined when a call to hideDialog is made so it won't re-load the default again.
// but perhaps there's a better way to deal with with an additional parameter in the args ? it works though.
if (data.defaultAlias && !args.skipDefault) {
- var found = _.find(data.menuItems, function(item) {
+ var found = _.find(data.menuItems, function (item) {
return item.alias = data.defaultAlias;
});
@@ -450,7 +450,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
return $q.resolve();
});
-
+
},
/**
@@ -461,7 +461,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @description
* Hides the menu by hiding the containing dom element
*/
- hideMenu: function() {
+ hideMenu: function () {
//SD: Would we ever want to access the last action'd node instead of clearing it here?
appState.setMenuState("currentNode", null);
appState.setMenuState("menuActions", []);
@@ -483,14 +483,14 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
appState.setMenuState("currentNode", node);
- if (action.metaData && action.metaData["actionRoute"] && angular.isString(action.metaData["actionRoute"])) {
+ if (action.metaData && action.metaData["actionRoute"] && Utilities.isString(action.metaData["actionRoute"])) {
//first check if the menu item simply navigates to a route
var parts = action.metaData["actionRoute"].split("?");
$location.path(parts[0]).search(parts.length > 1 ? parts[1] : "");
this.hideNavigation();
return;
}
- else if (action.metaData && action.metaData["jsAction"] && angular.isString(action.metaData["jsAction"])) {
+ else if (action.metaData && action.metaData["jsAction"] && Utilities.isString(action.metaData["jsAction"])) {
//we'll try to get the jsAction from the injector
var menuAction = action.metaData["jsAction"].split('.');
@@ -532,7 +532,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
});
}
},
-
+
/**
* @ngdoc method
@@ -553,7 +553,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @param {Scope} args.scope current scope passed to the dialog
* @param {Object} args.action the clicked action containing `name` and `alias`
*/
- showDialog: function(args) {
+ showDialog: function (args) {
if (!args) {
throw "showDialog is missing the args parameter";
@@ -578,20 +578,20 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
if (args.action.metaData["actionView"]) {
templateUrl = args.action.metaData["actionView"];
}
- else {
+ else {
var treeAlias = treeService.getTreeAlias(args.node);
if (!treeAlias) {
throw "Could not get tree alias for node " + args.node.id;
- }
+ }
templateUrl = this.getTreeTemplateUrl(treeAlias, args.action.alias);
}
setMode("dialog");
- if(templateUrl) {
+ if (templateUrl) {
appState.setMenuState("dialogTemplateUrl", templateUrl);
}
-
+
},
/**
* @ngdoc method
@@ -607,7 +607,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* we will also check for a 'packageName' for the current tree, if it exists then the convention will be:
* for example: /App_Plugins/{mypackage}/backoffice/{treetype}/create.html
*/
- getTreeTemplateUrl: function(treeAlias, action) {
+ getTreeTemplateUrl: function (treeAlias, action) {
var packageTreeFolder = treeService.getTreePackageFolder(treeAlias);
if (packageTreeFolder) {
return Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
@@ -661,7 +661,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @description
* shows the search pane
*/
- showSearch: function() {
+ showSearch: function () {
setMode("search");
},
/**
@@ -672,7 +672,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @description
* hides the search pane
*/
- hideSearch: function() {
+ hideSearch: function () {
setMode("default-hidesearch");
},
/**
@@ -683,7 +683,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
* @description
* hides any open navigation panes and resets the tree, actions and the currently selected node
*/
- hideNavigation: function() {
+ hideNavigation: function () {
appState.setMenuState("menuActions", []);
setMode("default");
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js b/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js
index e5701b9de0..196e0e3baa 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js
@@ -245,7 +245,7 @@ angular.module('umbraco.services')
* @param {Int} index index where the notication should be removed from
*/
remove: function (index) {
- if(angular.isObject(index)){
+ if (Utilities.isObject(index)){
var i = nArray.indexOf(index);
angularHelper.safeApply($rootScope, function() {
nArray.splice(i, 1);
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/servervalidationmgr.service.js b/src/Umbraco.Web.UI.Client/src/common/services/servervalidationmgr.service.js
index b9bfa51122..e2e51a6c28 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/servervalidationmgr.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/servervalidationmgr.service.js
@@ -25,7 +25,7 @@ function serverValidationManager($timeout) {
}
function getFieldErrors(self, fieldName) {
- if (!angular.isString(fieldName)) {
+ if (!Utilities.isString(fieldName)) {
throw "fieldName must be a string";
}
@@ -36,10 +36,10 @@ function serverValidationManager($timeout) {
}
function getPropertyErrors(self, propertyAlias, culture, fieldName) {
- if (!angular.isString(propertyAlias)) {
+ if (!Utilities.isString(propertyAlias)) {
throw "propertyAlias must be a string";
}
- if (fieldName && !angular.isString(fieldName)) {
+ if (fieldName && !Utilities.isString(fieldName)) {
throw "fieldName must be a string";
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
index 957308a111..4580d5ec07 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js
@@ -485,7 +485,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
//now we need to check if this custom config key is defined in our baseline, if it is we don't want to
//overwrite the baseline config item if it is an array, we want to concat the items in the array, otherwise
//if it's an object it will overwrite the baseline
- if (angular.isArray(config[i]) && angular.isArray(tinyMceConfig.customConfig[i])) {
+ if (Utilities.isArray(config[i]) && Utilities.isArray(tinyMceConfig.customConfig[i])) {
//concat it and below this concat'd array will overwrite the baseline in angular.extend
tinyMceConfig.customConfig[i] = config[i].concat(tinyMceConfig.customConfig[i]);
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tour.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tour.service.js
index 8fcab445b3..a11a9d6c82 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/tour.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/tour.service.js
@@ -9,7 +9,7 @@
'use strict';
function tourService(eventsService, currentUserResource, $q, tourResource) {
-
+
var tours = [];
var currentTour = null;
@@ -18,14 +18,16 @@
*/
function registerAllTours() {
tours = [];
- return tourResource.getTours().then(function(tourFiles) {
- angular.forEach(tourFiles, function (tourFile) {
- angular.forEach(tourFile.tours, function(newTour) {
+ return tourResource.getTours().then(function (tourFiles) {
+ tourFiles.forEach(tourFile => {
+
+ tourFile.tours.forEach(newTour => {
validateTour(newTour);
validateTourRegistration(newTour);
- tours.push(newTour);
+ tours.push(newTour);
});
});
+
eventsService.emit("appState.tour.updatedTours", tours);
});
}
@@ -74,7 +76,7 @@
tour.disabled = true;
currentUserResource
.saveTourStatus({ alias: tour.alias, disabled: tour.disabled, completed: tour.completed }).then(
- function() {
+ function () {
eventsService.emit("appState.tour.end", tour);
currentTour = null;
deferred.resolve(tour);
@@ -96,7 +98,7 @@
tour.completed = true;
currentUserResource
.saveTourStatus({ alias: tour.alias, disabled: tour.disabled, completed: tour.completed }).then(
- function() {
+ function () {
eventsService.emit("appState.tour.complete", tour);
currentTour = null;
deferred.resolve(tour);
@@ -130,10 +132,10 @@
function getGroupedTours() {
var deferred = $q.defer();
var tours = getTours();
- setTourStatuses(tours).then(function() {
+ setTourStatuses(tours).then(function () {
var groupedTours = [];
tours.forEach(function (item) {
-
+
if (item.contentType === null || item.contentType === '') {
var groupExists = false;
var newGroup = {
@@ -149,9 +151,9 @@
}
groupExists = true;
- if(item.hidden === false){
- group.tours.push(item);
- }
+ if (item.hidden === false) {
+ group.tours.push(item);
+ }
}
});
@@ -162,7 +164,7 @@
newGroup.groupOrder = item.groupOrder;
}
- if(item.hidden === false){
+ if (item.hidden === false) {
newGroup.tours.push(item);
groupedTours.push(newGroup);
}
@@ -242,14 +244,14 @@
throw "Tour " + tour.alias + " is missing the required sections";
}
}
-
+
/**
* Validates a tour before it gets registered in the service
* @param {any} tour
*/
function validateTourRegistration(tour) {
// check for existing tours with the same alias
- angular.forEach(tours, function (existingTour) {
+ tours.forEach(existingTour => {
if (existingTour.alias === tour.alias) {
throw "A tour with the alias " + tour.alias + " is already registered";
}
@@ -265,16 +267,17 @@
var deferred = $q.defer();
currentUserResource.getTours().then(function (storedTours) {
- angular.forEach(storedTours, function (storedTour) {
+ storedTours.forEach(storedTour => {
+
if (storedTour.completed === true) {
- angular.forEach(tours, function (tour) {
+ tours.forEach(tour => {
if (storedTour.alias === tour.alias) {
tour.completed = true;
}
});
}
if (storedTour.disabled === true) {
- angular.forEach(tours, function (tour) {
+ tours.forEach(tour => {
if (storedTour.alias === tour.alias) {
tour.disabled = true;
}
@@ -296,7 +299,7 @@
getCurrentTour: getCurrentTour,
getGroupedTours: getGroupedTours,
getTourByAlias: getTourByAlias,
- getToursForDoctype : getToursForDoctype
+ getToursForDoctype: getToursForDoctype
};
return service;
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js
index 3c9846fc43..0d6216f7cc 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js
@@ -47,7 +47,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
/** Internal method to track expanded paths on a tree */
_trackExpandedPaths: function (node, expandedPaths) {
- if (!node.children || !angular.isArray(node.children) || node.children.length == 0) {
+ if (!node.children || !Utilities.isArray(node.children) || node.children.length == 0) {
return;
}
@@ -174,7 +174,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
//we determine this based on the server variables
if (Umbraco.Sys.ServerVariables.umbracoPlugins &&
Umbraco.Sys.ServerVariables.umbracoPlugins.trees &&
- angular.isArray(Umbraco.Sys.ServerVariables.umbracoPlugins.trees)) {
+ Utilities.isArray(Umbraco.Sys.ServerVariables.umbracoPlugins.trees)) {
var found = _.find(Umbraco.Sys.ServerVariables.umbracoPlugins.trees, function (item) {
return invariantEquals(item.alias, treeAlias);
@@ -473,7 +473,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
for (var i = 0; i < treeNode.children.length; i++) {
var child = treeNode.children[i];
- if (child.children && angular.isArray(child.children) && child.children.length > 0) {
+ if (child.children && Utilities.isArray(child.children) && child.children.length > 0) {
//recurse
found = this.getDescendantNode(child, id);
if (found) {
@@ -773,7 +773,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
if (!args.path) {
throw "No path defined on args object for syncTree";
}
- if (!angular.isArray(args.path)) {
+ if (!Utilities.isArray(args.path)) {
throw "Path must be an array";
}
if (args.path.length < 1) {
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbdataformatter.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbdataformatter.service.js
index 906cf58e12..bae099f26d 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/umbdataformatter.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/umbdataformatter.service.js
@@ -158,7 +158,7 @@
var currGroups = saveModel.userGroups;
var formattedGroups = [];
for (var i = 0; i < currGroups.length; i++) {
- if (!angular.isString(currGroups[i])) {
+ if (!Utilities.isString(currGroups[i])) {
formattedGroups.push(currGroups[i].alias);
}
else {
@@ -229,7 +229,7 @@
var currSections = saveModel.sections;
var formattedSections = [];
for (var i = 0; i < currSections.length; i++) {
- if (!angular.isString(currSections[i])) {
+ if (!Utilities.isString(currSections[i])) {
formattedSections.push(currSections[i].alias);
}
else {
@@ -242,7 +242,7 @@
var currUsers = saveModel.users;
var formattedUsers = [];
for (var j = 0; j < currUsers.length; j++) {
- if (!angular.isNumber(currUsers[j])) {
+ if (!Utilities.isNumber(currUsers[j])) {
formattedUsers.push(currUsers[j].id);
}
else {
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js
index 0d766dc7d8..edf698c8a7 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js
@@ -44,7 +44,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
*/
dictionaryToQueryString: function (queryStrings) {
- if (angular.isArray(queryStrings)) {
+ if (Utilities.isArray(queryStrings)) {
return _.map(queryStrings, function (item) {
var key = null;
var val = null;
@@ -59,7 +59,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
return encodeURIComponent(key) + "=" + encodeURIComponent(val);
}).join("&");
}
- else if (angular.isObject(queryStrings)) {
+ else if (Utilities.isObject(queryStrings)) {
//this allows for a normal object to be passed in (ie. a dictionary)
return decodeURIComponent($.param(queryStrings));
@@ -91,7 +91,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
}
return Umbraco.Sys.ServerVariables["umbracoUrls"][apiName] + actionName +
- (!queryStrings ? "" : "?" + (angular.isString(queryStrings) ? queryStrings : this.dictionaryToQueryString(queryStrings)));
+ (!queryStrings ? "" : "?" + (Utilities.isString(queryStrings) ? queryStrings : this.dictionaryToQueryString(queryStrings)));
},
@@ -129,7 +129,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
var err = {
//NOTE: the default error message here should never be used based on the above docs!
- errorMsg: (angular.isString(opts) ? opts : 'An error occurred!'),
+ errorMsg: (Utilities.isString(opts) ? opts : 'An error occurred!'),
data: data,
status: status
};
@@ -254,7 +254,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
// so we know which property it belongs to on the server side
var fileKey = "file_" + args.files[f].alias + "_" + (args.files[f].culture ? args.files[f].culture : "");
- if (angular.isArray(args.files[f].metaData) && args.files[f].metaData.length > 0) {
+ if (Utilities.isArray(args.files[f].metaData) && args.files[f].metaData.length > 0) {
fileKey += ("_" + args.files[f].metaData.join("_"));
}
formData.append(fileKey, args.files[f].file);
@@ -322,7 +322,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
//validate input, jsonData can be an array of key/value pairs or just one key/value pair.
if (!jsonData) { throw "jsonData cannot be null"; }
- if (angular.isArray(jsonData)) {
+ if (Utilities.isArray(jsonData)) {
_.each(jsonData, function (item) {
if (!item.key || !item.value) { throw "jsonData array item must have both a key and a value property"; }
});
@@ -340,13 +340,13 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
transformRequest: function(data) {
var formData = new FormData();
//add the json data
- if (angular.isArray(data)) {
+ if (Utilities.isArray(data)) {
_.each(data, function(item) {
- formData.append(item.key, !angular.isString(item.value) ? angular.toJson(item.value) : item.value);
+ formData.append(item.key, !Utilities.isString(item.value) ? Utilities.toJson(item.value) : item.value);
});
}
else {
- formData.append(data.key, !angular.isString(data.value) ? angular.toJson(data.value) : data.value);
+ formData.append(data.key, !Utilities.isString(data.value) ? Utilities.toJson(data.value) : data.value);
}
//call the callback
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
index 5b4e516289..de6fbaf782 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/user.service.js
@@ -128,7 +128,7 @@ angular.module('umbraco.services')
function setUserTimeoutInternal(newTimeout) {
var asNumber = parseFloat(newTimeout);
- if (!isNaN(asNumber) && currentUser && angular.isNumber(asNumber)) {
+ if (!isNaN(asNumber) && currentUser && Utilities.isNumber(asNumber)) {
currentUser.remainingAuthSeconds = newTimeout;
lastServerTimeoutSet = new Date();
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
index a7ff9def21..58ef342f44 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js
@@ -206,11 +206,11 @@ function umbSessionStorage($window) {
return {
get: function (key) {
- return angular.fromJson(storage["umb_" + key]);
+ return JSON.parse(storage["umb_" + key]);
},
set: function (key, value) {
- storage["umb_" + key] = angular.toJson(value);
+ storage["umb_" + key] = Utilities.toJson(value);
}
};
diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js
index d5c5166d21..ce824f63c0 100644
--- a/src/Umbraco.Web.UI.Client/src/init.js
+++ b/src/Umbraco.Web.UI.Client/src/init.js
@@ -34,7 +34,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
else {
const introTourShown = localStorageService.get("introTourShown");
- if(!introTourShown){
+ if (!introTourShown) {
// Go & show email marketing tour (ONLY when intro tour is completed or been dismissed)
tourService.getTourByAlias("umbEmailMarketing").then(function (emailMarketingTour) {
// Only show the email marketing tour one time - dismissing it or saying no will make sure it never appears again
@@ -45,7 +45,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
// Only show the email tour once per logged in session
// The localstorage key is removed on logout or user session timeout
const emailMarketingTourShown = localStorageService.get("emailMarketingTourShown");
- if(!emailMarketingTourShown){
+ if (!emailMarketingTourShown) {
tourService.startTour(emailMarketingTour);
localStorageService.set("emailMarketingTourShown", true);
}
@@ -89,7 +89,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
currentRouteParams = toRetain;
}
else {
- currentRouteParams = angular.copy(current.params);
+ currentRouteParams = Utilities.copy(current.params);
}
@@ -183,7 +183,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
currentRouteParams = toRetain;
}
else {
- currentRouteParams = angular.copy(next.params);
+ currentRouteParams = Utilities.copy(next.params);
}
//always clear the 'sr' query string (soft redirect) if it exists
@@ -191,7 +191,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService',
currentRouteParams.sr = null;
$route.updateParams(currentRouteParams);
}
-
+
}
}
});
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-dashboard.less b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-dashboard.less
index 52ff2c2b01..03153973ff 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/application/umb-dashboard.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/application/umb-dashboard.less
@@ -31,6 +31,6 @@
border: none;
}
-.umb-dashboard__header .umb-tabs-nav .umb-tab > a {
+.umb-dashboard__header .umb-tabs-nav .umb-tab > .umb-tab-button {
padding-bottom: 25px;
}
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less
index 4ebfa94b6f..3c4a037b0b 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less
@@ -5,7 +5,7 @@
border-right: 5px solid @brownGrayLight;
display: flex;
justify-content: space-between;
- margin: -10px -5px 10px;
+ margin: -10px -1px 10px;
position: relative;
top: 0;
box-sizing: border-box;
@@ -34,6 +34,7 @@
transition: box-shadow 240ms;
position:sticky;
z-index: 30;
+ width: calc(100% + 2px);
&.umb-sticky-bar--active {
box-shadow: 0 6px 3px -3px rgba(0,0,0,.16);
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less
index d2a3bdedb1..e81df77772 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less
@@ -1,6 +1,7 @@
.umb-editors {
.absolute();
overflow: hidden;
+ z-index: 7500;
.umb-editor {
box-shadow: 0px 0 30px 0 rgba(0,0,0,.3);
@@ -104,4 +105,4 @@
i {
margin-right:5px;
}
-}
\ No newline at end of file
+}
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/overlays.less b/src/Umbraco.Web.UI.Client/src/less/components/overlays.less
index eb8740b385..f4402dec7b 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/overlays.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/overlays.less
@@ -2,7 +2,7 @@
position: fixed;
overflow: hidden;
background: @white;
- z-index: @zindexUmbOverlay;
+ z-index: 7501;
animation: fadeIn 0.2s;
box-shadow: 0 10px 50px rgba(0,0,0,0.1), 0 6px 20px rgba(0,0,0,0.16);
text-align: left;
diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-tabs.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-tabs.less
index ee784787fa..15b317aa45 100644
--- a/src/Umbraco.Web.UI.Client/src/less/components/umb-tabs.less
+++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-tabs.less
@@ -13,25 +13,31 @@
top: 1px;
}
-.umb-tab > a {
-
+.umb-tab-button {
display: flex;
justify-content: center;
align-items: center;
position: relative;
-
+
cursor: pointer;
//border-bottom: 4px solid transparent;
color: @ui-light-type;
padding: 5px 20px 15px 20px;
transition: color 150ms ease-in-out;
+
&:focus {
color: @ui-light-type-hover;
+
+ body:not(.tabbing-active) &{
+ outline: none;
+ }
}
+
&:hover {
color: @ui-light-type-hover;
text-decoration: none;
}
+
&::after {
content: "";
height: 0px;
@@ -42,12 +48,21 @@
bottom: 0;
border-radius: 3px 3px 0 0;
opacity: 0;
- transition: all .2s linear;
+ transition: all 0.2s linear;
+ }
+
+ &--expand > i {
+ height: 5px;
+ width: 5px;
+ border-radius: 50%;
+ background: @black;
+ display: inline-block;
+ margin: 0 5px 0 0;
+ opacity: 0.6;
}
}
-
-.umb-tab--active > a {
+.umb-tab--active > .umb-tab-button {
color: @ui-light-active-type;
//border-bottom-color: @ui-active;
/*
@@ -64,19 +79,19 @@
}
}
-.show-validation .umb-tab--error > a,
-.show-validation .umb-tab--error > a:hover,
-.show-validation .umb-tab--error > a:focus {
- color: @white !important;
- background-color: @red !important;
- border-color: @errorBorder;
+.show-validation .umb-tab--error > .umb-tab-button,
+.show-validation .umb-tab--error > .umb-tab-button:hover,
+.show-validation .umb-tab--error > .umb-tab-button:focus {
+ color: @white !important;
+ background-color: @red !important;
+ border-color: @errorBorder;
}
-.show-validation .umb-tab--error a:before {
- content: "\e25d";
- font-family: 'icomoon';
- margin-right: 5px;
- vertical-align: top;
+.show-validation .umb-tab--error .umb-tab-button:before {
+ content: "\e25d";
+ font-family: "icomoon";
+ margin-right: 5px;
+ vertical-align: top;
}
// tabs tray
@@ -86,20 +101,10 @@
left: auto;
}
-.umb-tabs-tray > a {
+.umb-tabs-tray > .umb-tab-button {
cursor: pointer;
}
.umb-tabs-tray-item--active {
border-left: 2px solid @ui-active;
}
-
-.umb-tab--expand > a > i {
- height: 5px;
- width: 5px;
- border-radius: 50%;
- background: @black;
- display: inline-block;
- margin: 0 5px 0 0;
- opacity: .6;
-}
diff --git a/src/Umbraco.Web.UI.Client/src/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/navigation.controller.js
index 281be2d331..ee8d13e320 100644
--- a/src/Umbraco.Web.UI.Client/src/navigation.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/navigation.controller.js
@@ -68,7 +68,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
args.event.stopPropagation();
args.event.preventDefault();
- if (n.metaData && n.metaData["jsClickCallback"] && angular.isString(n.metaData["jsClickCallback"]) && n.metaData["jsClickCallback"] !== "") {
+ if (n.metaData && n.metaData["jsClickCallback"] && Utilities.isString(n.metaData["jsClickCallback"]) && n.metaData["jsClickCallback"] !== "") {
//this is a legacy tree node!
var jsPrefix = "javascript:";
var js;
@@ -142,7 +142,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
var isInit = false;
var evts = [];
-
+
//Listen for global state changes
evts.push(eventsService.on("appState.globalState.changed", function (e, args) {
if (args.key === "showNavigation") {
@@ -200,7 +200,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
$scope.treeApi.load({ section: $scope.currentSection, customTreeParams: $scope.customTreeParams, cacheKey: $scope.treeCacheKey });
});
}
-
+
//show/hide search results
if (args.key === "showSearchResults") {
$scope.showSearchResults = args.value;
@@ -222,7 +222,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
} else {
$location.search("mculture", null);
}
-
+
var currentEditorState = editorState.getCurrent();
if (currentEditorState && currentEditorState.path) {
$scope.treeApi.syncTree({ path: currentEditorState.path, activate: true });
@@ -233,13 +233,13 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
//Emitted when a language is created or an existing one saved/edited
evts.push(eventsService.on("editors.languages.languageSaved", function (e, args) {
- if(args.isNew){
+ if (args.isNew) {
//A new language has been created - reload languages for tree
loadLanguages().then(function (languages) {
$scope.languages = languages;
});
}
- else if(args.language.isDefault){
+ else if (args.language.isDefault) {
//A language was saved and was set to be the new default (refresh the tree, so its at the top)
loadLanguages().then(function (languages) {
$scope.languages = languages;
@@ -282,7 +282,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
/**
* For multi language sites, this ensures that mculture is set to either the last selected language or the default one
- */
+ */
function ensureMainCulture() {
if ($location.search().mculture) {
return;
@@ -295,7 +295,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
$timeout(function () {
$scope.selectLanguage(language);
});
- }
+ }
/**
* Based on the current state of the application, this configures the scope variables that control the main tree and language drop down
@@ -432,7 +432,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
//the nav is ready, let the app know
eventsService.emit("app.navigationReady", { treeApi: $scope.treeApi });
-
+
}
});
});
@@ -469,7 +469,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
// add the selected culture to a cookie so the user will log back into the same culture later on (cookie lifetime = one year)
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 365);
- $cookies.put("UMB_MCULTURE", language.culture, {path: "/", expires: expireDate});
+ $cookies.put("UMB_MCULTURE", language.culture, { path: "/", expires: expireDate });
// close the language selector
$scope.page.languageSelectorIsOpen = false;
@@ -495,9 +495,10 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
//execute them sequentially
// set selected language to active
- angular.forEach($scope.languages, function(language){
+ $scope.languages.forEach(language => {
language.active = false;
});
+
language.active = true;
angularHelper.executeSequentialPromises(promises);
@@ -538,7 +539,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
closeTree();
};
- $scope.onOutsideClick = function() {
+ $scope.onOutsideClick = function () {
closeTree();
};
diff --git a/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js b/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js
index dc40338d01..5ff8dd3633 100644
--- a/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/preview/preview.controller.js
@@ -6,8 +6,8 @@
var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.services'])
.controller("previewController", function ($scope, $window, $location) {
-
- $scope.currentCulture = {iso:'', title:'...', icon:'icon-loading'}
+
+ $scope.currentCulture = { iso: '', title: '...', icon: 'icon-loading' }
var cultures = [];
$scope.tabbingActive = false;
@@ -21,7 +21,7 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
window.addEventListener('mousedown', disableTabbingActive);
}
}
-
+
function disableTabbingActive(evt) {
$scope.tabbingActive = false;
$scope.$digest();
@@ -113,10 +113,10 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
$scope.sizeOpen = false;
$scope.cultureOpen = false;
- $scope.toggleSizeOpen = function() {
+ $scope.toggleSizeOpen = function () {
$scope.sizeOpen = toggleMenu($scope.sizeOpen);
}
- $scope.toggleCultureOpen = function() {
+ $scope.toggleCultureOpen = function () {
$scope.cultureOpen = toggleMenu($scope.cultureOpen);
}
@@ -132,8 +132,8 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
$scope.sizeOpen = false;
$scope.cultureOpen = false;
}
-
- $scope.windowClickHandler = function() {
+
+ $scope.windowClickHandler = function () {
closeOthers();
}
function windowBlurHandler() {
@@ -141,16 +141,16 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
$scope.$digest();
}
- var win = angular.element($window);
+ var win = $($window);
win.on("blur", windowBlurHandler);
-
+
$scope.$on("$destroy", function () {
- win.off("blur", handleBlwindowBlurHandlerur );
+ win.off("blur", handleBlwindowBlurHandlerur);
});
-
- function setPageUrl(){
+
+ function setPageUrl() {
$scope.pageId = $location.search().id || getParameterByName("id");
var culture = $location.search().culture || getParameterByName("culture");
@@ -204,27 +204,27 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
/* Change culture */
/*****************************************************************************/
$scope.changeCulture = function (iso) {
- if($location.search().culture !== iso) {
+ if ($location.search().culture !== iso) {
$scope.frameLoaded = false;
$scope.currentCultureIso = iso;
$location.search("culture", iso);
setPageUrl();
}
};
- $scope.registerCulture = function(iso, title, isDefault) {
- var cultureObject = {iso: iso, title: title, isDefault: isDefault};
+ $scope.registerCulture = function (iso, title, isDefault) {
+ var cultureObject = { iso: iso, title: title, isDefault: isDefault };
cultures.push(cultureObject);
}
- $scope.$watch("currentCultureIso", function(oldIso, newIso) {
+ $scope.$watch("currentCultureIso", function (oldIso, newIso) {
// if no culture is selected, we will pick the default one:
if ($scope.currentCultureIso === null) {
- $scope.currentCulture = cultures.find(function(culture) {
+ $scope.currentCulture = cultures.find(function (culture) {
return culture.isDefault === true;
})
return;
}
- $scope.currentCulture = cultures.find(function(culture) {
+ $scope.currentCulture = cultures.find(function (culture) {
return culture.iso === $scope.currentCultureIso;
})
});
@@ -252,7 +252,7 @@ var app = angular.module("umbraco.preview", ['umbraco.resources', 'umbraco.servi
});
}
- function hideUmbracoPreviewBadge (iframe) {
+ function hideUmbracoPreviewBadge(iframe) {
if (iframe && iframe.contentDocument && iframe.contentDocument.getElementById("umbracoPreviewBadge")) {
iframe.contentDocument.getElementById("umbracoPreviewBadge").style.display = "none";
}
diff --git a/src/Umbraco.Web.UI.Client/src/utilities.js b/src/Umbraco.Web.UI.Client/src/utilities.js
index bd12506358..71d904427b 100644
--- a/src/Umbraco.Web.UI.Client/src/utilities.js
+++ b/src/Umbraco.Web.UI.Client/src/utilities.js
@@ -66,6 +66,34 @@
*/
const isObject = val => val !== null && typeof val === 'object';
+ const isWindow = obj => obj && obj.window === obj;
+
+ const isScope = obj => obj && obj.$evalAsync && obj.$watch;
+
+ const toJsonReplacer = (key, value) => {
+ var val = value;
+ if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
+ val = undefined;
+ } else if (isWindow(value)) {
+ val = '$WINDOW';
+ } else if (value && window.document === value) {
+ val = '$DOCUMENT';
+ } else if (isScope(value)) {
+ val = '$SCOPE';
+ }
+ return val;
+ }
+ /**
+ * Equivalent to angular.toJson
+ */
+ const toJson = (obj, pretty) => {
+ if (isUndefined(obj)) return undefined;
+ if (!isNumber(pretty)) {
+ pretty = pretty ? 2 : null;
+ }
+ return JSON.stringify(obj, toJsonReplacer, pretty);
+ }
+
let _utilities = {
noop: noop,
copy: copy,
@@ -77,7 +105,8 @@
isDefined: isDefined,
isString: isString,
isNumber: isNumber,
- isObject: isObject
+ isObject: isObject,
+ toJson: toJson
};
if (typeof (window.Utilities) === 'undefined') {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/compositions/compositions.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/compositions/compositions.controller.js
index 7cfa02f95a..aa0cd54dff 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/compositions/compositions.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/compositions/compositions.controller.js
@@ -17,7 +17,7 @@
/* make a copy of the init model so it is possible to roll
back the changes on cancel */
- oldModel = angular.copy($scope.model);
+ oldModel = Utilities.copy($scope.model);
if (!$scope.model.title) {
$scope.model.title = "Compositions";
@@ -39,7 +39,7 @@
});
}
-
+
function isSelected(alias) {
if ($scope.model.contentType.compositeContentTypes.indexOf(alias) !== -1) {
@@ -68,7 +68,7 @@
or the confirm checkbox has been checked */
if (compositionRemoved) {
vm.allowSubmit = false;
- localizationService.localize("general_remove").then(function(value) {
+ localizationService.localize("general_remove").then(function (value) {
const dialog = {
view: "views/common/infiniteeditors/compositions/overlays/confirmremove.html",
title: value,
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
index 47607b7f0b..a9803b70f9 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js
@@ -1,7 +1,7 @@
//used for the media picker dialog
angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
function ($scope, eventsService, entityResource, mediaResource, mediaHelper, udiParser, userService, localizationService, editorService) {
-
+
var vm = this;
var dialogOptions = $scope.model;
@@ -16,7 +16,7 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
if (!$scope.model.title) {
localizationService.localize("defaultdialogs_selectLink")
- .then(function(value) {
+ .then(function (value) {
$scope.model.title = value;
});
}
@@ -59,7 +59,7 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
if (dialogOptions.currentTarget) {
// clone the current target so we don't accidentally update the caller's model while manipulating $scope.model.target
- $scope.model.target = angular.copy(dialogOptions.currentTarget);
+ $scope.model.target = Utilities.copy(dialogOptions.currentTarget);
// if we have a node ID, we fetch the current node to build the form data
if ($scope.model.target.id || $scope.model.target.udi) {
@@ -194,7 +194,7 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
tree: "content"
});
},
- close: function() {
+ close: function () {
editorService.close();
}
};
@@ -251,13 +251,13 @@ angular.module("umbraco").controller("Umbraco.Editors.LinkPickerController",
}
function close() {
- if($scope.model && $scope.model.close) {
+ if ($scope.model && $scope.model.close) {
$scope.model.close();
}
}
function submit() {
- if($scope.model && $scope.model.submit) {
+ if ($scope.model && $scope.model.submit) {
$scope.model.submit($scope.model);
}
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macropicker/macropicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macropicker/macropicker.controller.js
index dfc77f786c..83c49d604f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macropicker/macropicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macropicker/macropicker.controller.js
@@ -8,9 +8,9 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
$scope.noMacroParams = false;
function onInit() {
- if(!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectMacro").then(function(value){
- $scope.model.title = value;
+ if (!$scope.model.title) {
+ localizationService.localize("defaultdialogs_selectMacro").then(function (value) {
+ $scope.model.title = value;
});
}
}
@@ -26,8 +26,8 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
}
};
- $scope.close = function() {
- if($scope.model.close) {
+ $scope.close = function () {
+ if ($scope.model.close) {
$scope.model.close();
}
}
@@ -42,7 +42,7 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
.then(function (data) {
//go to next page if there are params otherwise we can just exit
- if (!angular.isArray(data) || data.length === 0) {
+ if (!Utilities.isArray(data) || data.length === 0) {
if (insertIfNoParameters) {
$scope.model.submit($scope.model);
@@ -51,7 +51,7 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
}
} else {
-
+
$scope.wizardStep = "paramSelect";
$scope.model.macroParams = data;
@@ -71,7 +71,7 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
if (val.detectIsJson()) {
try {
//Parse it to json
- prop.value = angular.fromJson(val);
+ prop.value = JSON.parse(val);
}
catch (e) {
// not json
@@ -104,13 +104,13 @@ function MacroPickerController($scope, entityResource, macroResource, umbPropEdi
entityResource.getAll("Macro", ($scope.model.dialogData && $scope.model.dialogData.richTextEditor && $scope.model.dialogData.richTextEditor === true) ? "UseInEditor=true" : null)
.then(function (data) {
- if (angular.isArray(data) && data.length == 0) {
+ if (Utilities.isArray(data) && data.length == 0) {
$scope.nomacros = true;
}
//if 'allowedMacros' is specified, we need to filter
- if (angular.isArray($scope.model.dialogData.allowedMacros) && $scope.model.dialogData.allowedMacros.length > 0) {
- $scope.macros = _.filter(data, function(d) {
+ if (Utilities.isArray($scope.model.dialogData.allowedMacros) && $scope.model.dialogData.allowedMacros.length > 0) {
+ $scope.macros = _.filter(data, function (d) {
return _.contains($scope.model.dialogData.allowedMacros, d.alias);
});
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
index 6728486a0d..7a4db7cbc5 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js
@@ -1,13 +1,13 @@
//used for the media picker dialog
angular.module("umbraco")
.controller("Umbraco.Editors.MediaPickerController",
- function ($scope, $timeout, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage) {
+ function ($scope, $timeout, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage) {
var vm = this;
-
+
vm.submit = submit;
vm.close = close;
-
+
vm.toggle = toggle;
vm.upload = upload;
vm.dragLeave = dragLeave;
@@ -26,7 +26,7 @@ angular.module("umbraco")
vm.shouldShowUrl = shouldShowUrl;
var dialogOptions = $scope.model;
-
+
$scope.disableFolderSelect = (dialogOptions.disableFolderSelect && dialogOptions.disableFolderSelect !== "0") ? true : false;
$scope.disableFocalPoint = (dialogOptions.disableFocalPoint && dialogOptions.disableFocalPoint !== "0") ? true : false;
$scope.onlyImages = (dialogOptions.onlyImages && dialogOptions.onlyImages !== "0") ? true : false;
@@ -133,21 +133,21 @@ angular.module("umbraco")
// media object so we need to look it up
var id = $scope.target.udi ? $scope.target.udi : $scope.target.id;
var altText = $scope.target.altText;
-
+
// ID of a UDI or legacy int ID still could be null/undefinied here
// As user may dragged in an image that has not been saved to media section yet
if (id) {
entityResource.getById(id, "Media")
- .then(function (node) {
- $scope.target = node;
- if (ensureWithinStartNode(node)) {
- selectMedia(node);
- $scope.target.url = mediaHelper.resolveFileFromEntity(node);
- $scope.target.thumbnail = mediaHelper.resolveFileFromEntity(node, true);
- $scope.target.altText = altText;
- openDetailsDialog();
- }
- }, gotoStartNode);
+ .then(function (node) {
+ $scope.target = node;
+ if (ensureWithinStartNode(node)) {
+ selectMedia(node);
+ $scope.target.url = mediaHelper.resolveFileFromEntity(node);
+ $scope.target.thumbnail = mediaHelper.resolveFileFromEntity(node, true);
+ $scope.target.altText = altText;
+ openDetailsDialog();
+ }
+ }, gotoStartNode);
} else {
// No ID set - then this is going to be a tmpimg that has not been uploaded
// User editing this will want to be changing the ALT text
@@ -156,15 +156,15 @@ angular.module("umbraco")
}
}
- function upload(v) {
- angular.element(".umb-file-dropzone .file-select").trigger("click");
+ function upload() {
+ $(".umb-file-dropzone .file-select").trigger("click");
}
- function dragLeave(el, event) {
+ function dragLeave() {
$scope.activeDrag = false;
}
- function dragEnter(el, event) {
+ function dragEnter() {
$scope.activeDrag = true;
}
@@ -240,16 +240,16 @@ angular.module("umbraco")
}
} else {
if ($scope.showDetails) {
-
+
$scope.target = media;
-
+
// handle both entity and full media object
if (media.image) {
$scope.target.url = media.image;
} else {
$scope.target.url = mediaHelper.resolveFile(media);
}
-
+
openDetailsDialog();
} else {
selectMedia(media);
@@ -301,7 +301,7 @@ angular.module("umbraco")
$timeout(function () {
if ($scope.multiPicker) {
var images = _.rest($scope.images, $scope.images.length - files.length);
- _.each(images, function(image) {
+ _.each(images, function (image) {
selectMedia(image);
});
} else {
@@ -341,7 +341,7 @@ angular.module("umbraco")
return false;
}
- function gotoStartNode(err) {
+ function gotoStartNode() {
gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
}
@@ -373,7 +373,7 @@ angular.module("umbraco")
if (vm.searchOptions.filter) {
searchMedia();
} else {
-
+
// reset pagination
vm.searchOptions = {
pageNumber: 1,
@@ -383,7 +383,7 @@ angular.module("umbraco")
filter: '',
dataTypeKey: dataTypeKey
};
-
+
getChildren($scope.currentFolder.id);
}
});
@@ -411,9 +411,9 @@ angular.module("umbraco")
entityResource.getPagedDescendants($scope.filterOptions.excludeSubFolders ? $scope.currentFolder.id : $scope.startNodeId, "Media", vm.searchOptions)
.then(function (data) {
// update image data to work with image grid
- angular.forEach(data.items, function (mediaItem) {
- setMediaMetaData(mediaItem);
- });
+ if (data.items) {
+ data.items.forEach(mediaItem => setMediaMetaData(mediaItem));
+ }
// update images
$scope.images = data.items ? data.items : [];
@@ -497,7 +497,7 @@ angular.module("umbraco")
var folderImage = $scope.images[folderIndex];
var imageIsSelected = false;
- if ($scope.model && angular.isArray($scope.model.selection)) {
+ if ($scope.model && Utilities.isArray($scope.model.selection)) {
for (var selectedIndex = 0;
selectedIndex < $scope.model.selection.length;
selectedIndex++) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
index 11d80d562d..f6118e1523 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js
@@ -76,7 +76,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
/**
* Performs the initialization of this component
*/
- function onInit () {
+ function onInit() {
if (vm.showLanguageSelector) {
// load languages
@@ -96,7 +96,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
if (vm.treeAlias === "content") {
vm.entityType = "Document";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectContent").then(function(value){
+ localizationService.localize("defaultdialogs_selectContent").then(function (value) {
$scope.model.title = value;
});
}
@@ -104,7 +104,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
else if (vm.treeAlias === "documentTypes") {
vm.entityType = "DocumentType";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectContentType").then(function(value){
+ localizationService.localize("defaultdialogs_selectContentType").then(function (value) {
$scope.model.title = value;
});
}
@@ -112,7 +112,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
else if (vm.treeAlias === "member" || vm.section === "member") {
vm.entityType = "Member";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectMember").then(function(value) {
+ localizationService.localize("defaultdialogs_selectMember").then(function (value) {
$scope.model.title = value;
});
}
@@ -120,7 +120,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
else if (vm.treeAlias === "memberTypes") {
vm.entityType = "MemberType";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectMemberType").then(function(value){
+ localizationService.localize("defaultdialogs_selectMemberType").then(function (value) {
$scope.model.title = value;
});
}
@@ -128,7 +128,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
else if (vm.treeAlias === "media" || vm.section === "media") {
vm.entityType = "Media";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectMedia").then(function(value){
+ localizationService.localize("defaultdialogs_selectMedia").then(function (value) {
$scope.model.title = value;
});
}
@@ -136,7 +136,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
else if (vm.treeAlias === "mediaTypes") {
vm.entityType = "MediaType";
if (!$scope.model.title) {
- localizationService.localize("defaultdialogs_selectMediaType").then(function(value){
+ localizationService.localize("defaultdialogs_selectMediaType").then(function (value) {
$scope.model.title = value;
});
}
@@ -176,7 +176,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
if (angular.isFunction($scope.model.filter)) {
$scope.model.filterAdvanced = true;
}
- else if (angular.isObject($scope.model.filter)) {
+ else if (Utilities.isObject($scope.model.filter)) {
$scope.model.filterAdvanced = true;
}
else {
@@ -189,7 +189,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
if ($scope.model.filter.startsWith("{")) {
$scope.model.filterAdvanced = true;
//convert to object
- $scope.model.filter = angular.fromJson($scope.model.filter);
+ $scope.model.filter = JSON.parse($scope.model.filter);
}
}
}
@@ -218,7 +218,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
}
var queryString = $.param(queryParams); //create the query string from the params object
-
+
if (!queryString) {
vm.customTreeParams = $scope.model.customTreeParams;
}
@@ -243,7 +243,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
$timeout(function () {
//reload the tree with it's updated querystring args
vm.dialogTreeApi.load(vm.section).then(function () {
-
+
//create the list of promises
var promises = [];
for (var i = 0; i < expandedPaths.length; i++) {
@@ -258,7 +258,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
function toggleLanguageSelector() {
vm.languageSelectorIsOpen = !vm.languageSelectorIsOpen;
};
-
+
function nodeExpandedHandler(args) {
//store the reference to the expanded node path
@@ -271,7 +271,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
openMiniListView(args.node);
}
- if (angular.isArray(args.children)) {
+ if (Utilities.isArray(args.children)) {
//iterate children
_.each(args.children,
@@ -446,7 +446,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
// be allowed to be clicked on
nodes = _.filter(nodes,
function (n) {
- return !angular.isObject(n.metaData.listViewNode);
+ return !Utilities.isObject(n.metaData.listViewNode);
});
if ($scope.model.filterAdvanced) {
@@ -673,17 +673,17 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
}
function submit(model) {
- if($scope.model.submit) {
+ if ($scope.model.submit) {
$scope.model.submit(model);
}
}
function close() {
- if($scope.model.close) {
+ if ($scope.model.close) {
$scope.model.close();
}
}
-
+
//initialize
onInit();
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js
index 060ef77a5d..0ed5239449 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js
@@ -102,6 +102,10 @@ angular.module("umbraco")
});
}
+ $scope.linkProvider = function (e) {
+ e.target.submit();
+ }
+
$scope.unlink = function (e, loginProvider, providerKey) {
var result = confirm("Are you sure you want to unlink this account?");
if (!result) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.html
index 531feef892..8b12d061f3 100644
--- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.html
+++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.html
@@ -49,12 +49,11 @@
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/healthcheck.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/healthcheck.controller.js
index 8631b09a45..f5ceb877c8 100644
--- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/healthcheck.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/healthcheck.controller.js
@@ -1,4 +1,4 @@
-(function() {
+(function () {
"use strict";
function HealthCheckController($scope, healthCheckResource) {
@@ -22,7 +22,7 @@
// Get a (grouped) list of all health checks
healthCheckResource.getAllChecks()
- .then(function(response) {
+ .then(function (response) {
vm.groups = response;
});
@@ -33,11 +33,11 @@
var totalInfo = 0;
// count total number of statusses
- angular.forEach(group.checks,
- function(check) {
- angular.forEach(check.status,
- function(status) {
- switch (status.resultType) {
+ group.checks.forEach(check => {
+
+ if (check.status) {
+ check.status.forEach(status => {
+ switch (status.resultType) {
case SUCCESS:
totalSuccess = totalSuccess + 1;
break;
@@ -50,9 +50,10 @@
case INFO:
totalInfo = totalInfo + 1;
break;
- }
- });
- });
+ }
+ });
+ }
+ });
group.totalSuccess = totalSuccess;
group.totalError = totalError;
@@ -66,7 +67,7 @@
check.loading = true;
check.status = null;
healthCheckResource.getStatus(check.id)
- .then(function(response) {
+ .then(function (response) {
check.loading = false;
check.status = response;
});
@@ -75,7 +76,7 @@
function executeAction(check, index, action) {
check.loading = true;
healthCheckResource.executeAction(action)
- .then(function(response) {
+ .then(function (response) {
check.status[index] = response;
check.loading = false;
});
@@ -94,24 +95,22 @@
group.checkCounter = 0;
group.loading = true;
- angular.forEach(checks,
- function(check) {
+ checks.forEach(check => {
+ check.loading = true;
- check.loading = true;
+ healthCheckResource.getStatus(check.id)
+ .then(function (response) {
+ check.status = response;
+ group.checkCounter = group.checkCounter + 1;
+ check.loading = false;
- healthCheckResource.getStatus(check.id)
- .then(function(response) {
- check.status = response;
- group.checkCounter = group.checkCounter + 1;
- check.loading = false;
-
- // when all checks are done, set global group result
- if (group.checkCounter === checks.length) {
- setGroupGlobalResultType(group);
- group.loading = false;
- }
- });
- });
+ // when all checks are done, set global group result
+ if (group.checkCounter === checks.length) {
+ setGroupGlobalResultType(group);
+ group.loading = false;
+ }
+ });
+ });
}
function openGroup(group) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js
index e1334aa816..732aa898a7 100644
--- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js
@@ -97,7 +97,7 @@ function DocumentTypesCreateController($scope, $location, navigationService, con
$scope.error = err;
//show any notifications
- if (angular.isArray(err.data.notifications)) {
+ if (Utilities.isArray(err.data.notifications)) {
for (var i = 0; i < err.data.notifications.length; i++) {
notificationsService.showNotification(err.data.notifications[i]);
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/languages/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/languages/edit.controller.js
index 5f1c46de4c..96441e6101 100644
--- a/src/Umbraco.Web.UI.Client/src/views/languages/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/languages/edit.controller.js
@@ -57,7 +57,7 @@
};
if ($routeParams.create) {
- vm.page.name = vm.labels.addLanguage;
+ vm.page.name = vm.labels.addLanguage;
}
});
@@ -87,14 +87,14 @@
if (!$routeParams.create) {
- promises.push(languageResource.getById($routeParams.id).then(function(lang) {
+ promises.push(languageResource.getById($routeParams.id).then(function (lang) {
vm.language = lang;
vm.page.name = vm.language.name;
/* we need to store the initial default state so we can disable the toggle if it is the default.
we need to prevent from not having a default language. */
- vm.initIsDefault = angular.copy(vm.language.isDefault);
+ vm.initIsDefault = Utilities.copy(vm.language.isDefault);
makeBreadcrumbs();
@@ -182,12 +182,12 @@
function toggleDefault() {
// it shouldn't be possible to uncheck the default language
- if(vm.initIsDefault) {
+ if (vm.initIsDefault) {
return;
}
vm.language.isDefault = !vm.language.isDefault;
- if(vm.language.isDefault) {
+ if (vm.language.isDefault) {
vm.showDefaultLanguageInfo = true;
} else {
vm.showDefaultLanguageInfo = false;
diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js
index 70688f045c..63750ff0f2 100644
--- a/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/packages/edit.controller.js
@@ -40,7 +40,7 @@
vm.versionRegex = /^(\d+\.)(\d+\.)(\*|\d+)$/;
function onInit() {
-
+
if (create) {
// Pre populate package with some values
packageResource.getEmpty().then(scaffold => {
@@ -78,7 +78,7 @@
});
-
+
localizationService.localizeMany(["buttons_save", "packager_includeAllChildNodes"]).then(function (values) {
vm.labels.button = values[0];
vm.labels.includeAllChildNodes = values[1];
@@ -232,7 +232,7 @@
function openFilePicker() {
- let selection = angular.copy(vm.package.files);
+ let selection = Utilities.copy(vm.package.files);
const filePicker = {
title: "Select files",
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js
index b4381b699b..9ad2c87ab4 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/colorpicker.controller.js
@@ -19,7 +19,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.ColorPickerControl
// Make an array from the dictionary
var items = [];
- if (angular.isArray($scope.model.prevalues)) {
+ if (Utilities.isArray($scope.model.prevalues)) {
for (var i in $scope.model.prevalues) {
var oldValue = $scope.model.prevalues[i];
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/multivalues.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/multivalues.controller.js
index 3da57943f9..c37c382dac 100644
--- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/multivalues.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/multivalues.controller.js
@@ -7,7 +7,7 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiValuesControl
$scope.hasError = false;
$scope.focusOnNew = false;
- if (!angular.isArray($scope.model.value)) {
+ if (!Utilities.isArray($scope.model.value)) {
//make an array from the dictionary
var items = [];
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 951b76193f..0359043da4 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
@@ -118,7 +118,7 @@ angular.module('umbraco')
}
function populate(data) {
- if (angular.isArray(data)) {
+ if (Utilities.isArray(data)) {
_.each(data, function (item, i) {
$scope.add(item);
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js
index 030119ac2b..7a5954f504 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js
@@ -24,7 +24,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.ChangePasswordCont
}
//set the model defaults
- if (!angular.isObject($scope.model.value)) {
+ if (!Utilities.isObject($scope.model.value)) {
//if it's not an object then just create a new one
$scope.model.value = {
newPassword: null,
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js
index 297bf23cef..10668808a5 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js
@@ -10,7 +10,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.CheckboxListContro
function init() {
// currently the property editor will onyl work if our input is an object.
- if (angular.isObject($scope.model.config.items)) {
+ if (Utilities.isObject($scope.model.config.items)) {
// formatting the items in the dictionary into an array
var sortedItems = [];
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js
index ba2ad72191..e2f502e463 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js
@@ -25,7 +25,7 @@ function ColorPickerController($scope, $timeout) {
initActiveColor();
}
- if (!angular.isArray($scope.model.config.items)) {
+ if (!Utilities.isArray($scope.model.config.items)) {
//make an array from the dictionary
var items = [];
for (var i in $scope.model.config.items) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js
index 91c6e673b9..2cbad88a43 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/multicolorpicker.controller.js
@@ -55,7 +55,7 @@
});
});
- if (!angular.isArray($scope.model.value)) {
+ if (!Utilities.isArray($scope.model.value)) {
//make an array from the dictionary
var items = [];
for (var i in $scope.model.value) {
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 5df324c60f..238872db40 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
@@ -152,7 +152,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
dataTypeKey: $scope.model.dataTypeKey,
currentNode: editorState ? editorState.current : null,
callback: function (data) {
- if (angular.isArray(data)) {
+ if (Utilities.isArray(data)) {
_.each(data, function (item, i) {
$scope.add(item);
});
@@ -233,7 +233,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
$scope.currentPicker = dialogOptions;
$scope.currentPicker.submit = function (model) {
- if (angular.isArray(model.selection)) {
+ if (Utilities.isArray(model.selection)) {
_.each(model.selection, function (item, i) {
$scope.add(item);
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js
index a6d615cdd1..a8979c949b 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js
@@ -45,14 +45,14 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.DropdownFlexibleCo
$scope.model.value = [$scope.model.singleDropdownValue];
}
- if (angular.isArray($scope.model.config.items)) {
+ if (Utilities.isArray($scope.model.config.items)) {
//PP: I dont think this will happen, but we have tests that expect it to happen..
//if array is simple values, convert to array of objects
- if(!angular.isObject($scope.model.config.items[0])){
+ if (!Utilities.isObject($scope.model.config.items[0])){
$scope.model.config.items = convertArrayToDictionaryArray($scope.model.config.items);
}
}
- else if (angular.isObject($scope.model.config.items)) {
+ else if (Utilities.isObject($scope.model.config.items)) {
$scope.model.config.items = convertObjectToDictionaryArray($scope.model.config.items);
}
else {
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js
index 0f8a8df895..1370550631 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js
@@ -4,7 +4,7 @@ angular.module("umbraco")
function onInit() {
- var embedPreview = angular.isObject($scope.control.value) && $scope.control.value.preview ? $scope.control.value.preview : $scope.control.value;
+ var embedPreview = Utilities.isObject($scope.control.value) && $scope.control.value.preview ? $scope.control.value.preview : $scope.control.value;
$scope.trustedValue = embedPreview ? $sce.trustAsHtml(embedPreview) : null;
@@ -19,7 +19,7 @@ angular.module("umbraco")
$scope.setEmbed = function () {
- var original = angular.isObject($scope.control.value) ? $scope.control.value : null;
+ var original = Utilities.isObject($scope.control.value) ? $scope.control.value : null;
var embed = {
original: original,
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js
index 67ec951512..2568f62cf4 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js
@@ -185,7 +185,7 @@ angular.module("umbraco")
var rteId = value.id;
if ($.inArray(rteId, notIncludedRte) < 0) {
-
+
// remember this RTEs settings, cause we need to update it later.
var editor = _.findWhere(tinyMCE.editors, { id: rteId })
if (editor) {
@@ -197,17 +197,17 @@ angular.module("umbraco")
}
else {
$(event.target).find(".umb-rte").each(function () {
-
+
var rteId = $(this).attr("id");
-
+
if ($.inArray(rteId, notIncludedRte) < 0) {
-
+
// remember this RTEs settings, cause we need to update it later.
var editor = _.findWhere(tinyMCE.editors, { id: rteId })
if (editor) {
draggedRteSettings[rteId] = editor.settings;
}
-
+
notIncludedRte.splice(0, 0, $(this).attr("id"));
}
});
@@ -227,12 +227,12 @@ angular.module("umbraco")
// reset dragged RTE settings in case a RTE isn't dragged
draggedRteSettings = {};
notIncludedRte = [];
-
+
ui.item[0].style.display = "block";
ui.item.find(".umb-rte").each(function (key, value) {
-
+
var rteId = value.id;
-
+
// remember this RTEs settings, cause we need to update it later.
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
@@ -255,17 +255,17 @@ angular.module("umbraco")
ui.item.offsetParent().find(".umb-rte").each(function (key, value) {
var rteId = value.id;
if ($.inArray(rteId, notIncludedRte) < 0) {
-
+
var editor = _.findWhere(tinyMCE.editors, { id: rteId });
if (editor) {
draggedRteSettings[rteId] = editor.settings;
}
-
+
// add all dragged's neighbouring RTEs in the new cell
notIncludedRte.splice(0, 0, rteId);
}
});
-
+
// reconstruct the dragged RTE (could be undefined when dragging something else than RTE)
if (draggedRteSettings !== undefined) {
tinyMCE.init(draggedRteSettings);
@@ -327,13 +327,13 @@ angular.module("umbraco")
title: title,
availableItems: area.$allowedEditors,
event: event,
- submit: function(model) {
+ submit: function (model) {
if (model.selectedItem) {
$scope.addControl(model.selectedItem, area, index);
overlayService.close();
}
},
- close: function() {
+ close: function () {
overlayService.close();
}
});
@@ -345,7 +345,7 @@ angular.module("umbraco")
// *********************************************
$scope.addTemplate = function (template) {
- $scope.model.value = angular.copy(template);
+ $scope.model.value = Utilities.copy(template);
//default row data
_.forEach($scope.model.value.sections, function (section) {
@@ -387,7 +387,7 @@ angular.module("umbraco")
$scope.addRow = function (section, layout, isInit) {
//copy the selected layout into the rows collection
- var row = angular.copy(layout);
+ var row = Utilities.copy(layout);
// Init row value
row = $scope.initRow(row);
@@ -408,7 +408,7 @@ angular.module("umbraco")
setTimeout(function () {
var newRowEl = $element.find("[data-rowid='" + row.$uniqueId + "']");
- if(newRowEl !== null) {
+ if (newRowEl !== null) {
newRowEl.focus();
}
}, 0);
@@ -467,13 +467,13 @@ angular.module("umbraco")
var styles, config;
if (itemType === 'control') {
styles = null;
- config = angular.copy(gridItem.editor.config.settings);
+ config = Utilities.copy(gridItem.editor.config.settings);
} else {
- styles = _.filter(angular.copy($scope.model.config.items.styles), function (item) { return shouldApply(item, itemType, gridItem); });
- config = _.filter(angular.copy($scope.model.config.items.config), function (item) { return shouldApply(item, itemType, gridItem); });
+ styles = _.filter(Utilities.copy($scope.model.config.items.styles), function (item) { return shouldApply(item, itemType, gridItem); });
+ config = _.filter(Utilities.copy($scope.model.config.items.config), function (item) { return shouldApply(item, itemType, gridItem); });
}
- if (angular.isObject(gridItem.config)) {
+ if (Utilities.isObject(gridItem.config)) {
_.each(config, function (cfg) {
var val = gridItem.config[cfg.key];
if (val) {
@@ -482,7 +482,7 @@ angular.module("umbraco")
});
}
- if (angular.isObject(gridItem.styles)) {
+ if (Utilities.isObject(gridItem.styles)) {
_.each(styles, function (style) {
var val = gridItem.styles[style.key];
if (val) {
@@ -739,13 +739,13 @@ angular.module("umbraco")
//if nothing is found, set it to 12
if (!$scope.model.config.items.columns) {
$scope.model.config.items.columns = 12;
- } else if (angular.isString($scope.model.config.items.columns)) {
+ } else if (Utilities.isString($scope.model.config.items.columns)) {
$scope.model.config.items.columns = parseInt($scope.model.config.items.columns);
}
if ($scope.model.value && $scope.model.value.sections && $scope.model.value.sections.length > 0 && $scope.model.value.sections[0].rows && $scope.model.value.sections[0].rows.length > 0) {
- if ($scope.model.value.name && angular.isArray($scope.model.config.items.templates)) {
+ if ($scope.model.value.name && Utilities.isArray($scope.model.config.items.templates)) {
//This will occur if it is an existing value, in which case
// we need to determine which layout was applied by looking up
@@ -756,14 +756,14 @@ angular.module("umbraco")
return t.name === $scope.model.value.name;
});
- if (found && angular.isArray(found.sections) && found.sections.length === $scope.model.value.sections.length) {
+ if (found && Utilities.isArray(found.sections) && found.sections.length === $scope.model.value.sections.length) {
//Cool, we've found the template associated with our current value with matching sections counts, now we need to
// merge this template data on to our current value (as if it was new) so that we can preserve what is and isn't
// allowed for this template based on the current config.
_.each(found.sections, function (templateSection, index) {
- angular.extend($scope.model.value.sections[index], angular.copy(templateSection));
+ angular.extend($scope.model.value.sections[index], Utilities.copy(templateSection));
});
}
@@ -835,7 +835,7 @@ angular.module("umbraco")
return null;
} else {
//make a copy to not touch the original config
- original = angular.copy(original);
+ original = Utilities.copy(original);
original.styles = row.styles;
original.config = row.config;
original.hasConfig = gridItemHasConfig(row.styles, row.config);
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 7fdefb4d78..5048c479bb 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
@@ -256,7 +256,7 @@