diff --git a/src/app/config.js b/src/app/config.js index 85b7b2661b..bf86091b78 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -87,6 +87,12 @@ angular controller: 'settingsController', data: { pageTitle: 'Settings' } }) + .state('backend.settingsDomains', { + url: '^/settings/domains', + templateUrl: 'app/settings/views/settingsDomains.html', + controller: 'settingsDomainsController', + data: { pageTitle: 'Domain Settings' } + }) .state('backend.tools', { url: '^/tools', templateUrl: 'app/tools/views/tools.html', diff --git a/src/app/global/mainController.js b/src/app/global/mainController.js index 990f3b2a7f..571b569b2a 100644 --- a/src/app/global/mainController.js +++ b/src/app/global/mainController.js @@ -48,10 +48,6 @@ angular $scope.$broadcast('vaultAddFolder'); }; - $scope.domains = function () { - $scope.$broadcast('settingsDomains'); - }; - $scope.import = function () { $scope.$broadcast('toolsImport'); }; diff --git a/src/app/settings/settingsController.js b/src/app/settings/settingsController.js index 7a7714449f..7e81cd931e 100644 --- a/src/app/settings/settingsController.js +++ b/src/app/settings/settingsController.js @@ -67,14 +67,6 @@ }); }; - $scope.domains = function () { - $uibModal.open({ - animation: true, - templateUrl: 'app/settings/views/settingsDomains.html', - controller: 'settingsDomainsController' - }); - }; - $scope.delete = function () { $uibModal.open({ animation: true, diff --git a/src/app/settings/settingsDomainsController.js b/src/app/settings/settingsDomainsController.js index 7bdaa1e9f2..834aebe39d 100644 --- a/src/app/settings/settingsDomainsController.js +++ b/src/app/settings/settingsDomainsController.js @@ -1,9 +1,7 @@ angular .module('bit.settings') - .controller('settingsDomainsController', function ($scope, $state, apiService, $uibModalInstance, toastr, $analytics, $uibModal) { - $analytics.eventTrack('settingsDomainsController', { category: 'Modal' }); - + .controller('settingsDomainsController', function ($scope, $state, apiService, toastr, $analytics, $uibModal) { $scope.globalEquivalentDomains = []; $scope.equivalentDomains = []; @@ -44,7 +42,6 @@ animation: true, templateUrl: 'app/settings/views/settingsAddEditEquivalentDomain.html', controller: 'settingsAddEditEquivalentDomainController', - size: 'sm', resolve: { domainIndex: function () { return i; }, domains: function () { return i !== null ? $scope.equivalentDomains[i] : null; } @@ -65,7 +62,15 @@ }); }; - $scope.save = function () { + $scope.saveGlobal = function () { + $scope.globalPromise = save(); + }; + + $scope.saveCustom = function () { + $scope.customPromise = save(); + }; + + var save = function () { var request = { ExcludedGlobalEquivalentDomains: [], EquivalentDomains: [] @@ -89,13 +94,8 @@ request.ExcludedGlobalEquivalentDomains = null; } - $scope.submitPromise = apiService.settings.putDomains(request, function (domains) { - $scope.close(); + return apiService.settings.putDomains(request, function (domains) { toastr.success('Domains have been updated.', 'Success!'); }).$promise; }; - - $scope.close = function () { - $uibModalInstance.dismiss('cancel'); - }; }); diff --git a/src/app/settings/views/settingsAddEditEquivalentDomain.html b/src/app/settings/views/settingsAddEditEquivalentDomain.html index 62387688c6..e51b50781e 100644 --- a/src/app/settings/views/settingsAddEditEquivalentDomain.html +++ b/src/app/settings/views/settingsAddEditEquivalentDomain.html @@ -17,10 +17,12 @@ * -

- Only "base" domains are allowed. Do not enter subdomains. - For example, enter "google.com" instead of "www.google.com". + Only "base" domains are allowed. Do not enter subdomains. For example, enter "google.com" instead of + "www.google.com". +

+

+ You can also enter "androidapp://package.name" to associate an android app with other website domains.

diff --git a/src/app/settings/views/settingsDomains.html b/src/app/settings/views/settingsDomains.html index 3cd05ce332..8feddec45d 100644 --- a/src/app/settings/views/settingsDomains.html +++ b/src/app/settings/views/settingsDomains.html @@ -1,83 +1,94 @@ - -
-