diff --git a/src/main/resources/i18n/en.properties b/src/main/resources/i18n/en.properties index 1954e53b..9c589268 100644 --- a/src/main/resources/i18n/en.properties +++ b/src/main/resources/i18n/en.properties @@ -87,6 +87,8 @@ details.queued_for_refresh=Queued for refresh details.feed_url=Feed URL details.generate_api_key_first=Generate an API key in your profile first. details.unsubscribe=Unsubscribe +details.unsubscribe_confirmation=Are you sure you want to unsubscribe from this feed? +details.delete_category_confirmation=Are you sure you want to delete this category? details.category_details=Category details details.tag_details=Tag details details.parent_category=Parent category @@ -103,6 +105,7 @@ profile.generate_new_api_key=Generate new API key profile.generate_new_api_key_info=Changing password will generate a new API key profile.opml_export=OPML export profile.delete_account=Delete account +profile.delete_account_confirmation=Delete your acount? There's no turning back! about.rest_api=REST API about.keyboard_shortcuts=Keyboard shortcuts diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index ac1b557f..3746915b 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -268,8 +268,8 @@ module.controller('CategoryTreeCtrl', ['$scope', '$timeout', '$stateParams', '$w }); }]); -module.controller('FeedDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedService', 'CategoryService', 'ProfileService', '$dialog', - function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService, $dialog) { +module.controller('FeedDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedService', 'CategoryService', 'ProfileService', + function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService) { $scope.CategoryService = CategoryService; $scope.user = ProfileService.get(); @@ -290,30 +290,15 @@ module.controller('FeedDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedS $scope.unsubscribe = function() { var sub = $scope.sub; - var title = 'Unsubscribe'; - var msg = 'Unsubscribe from ' + sub.name + '?'; - var btns = [{ - result : 'cancel', - label : 'Cancel' - }, { - result : 'ok', - label : 'OK', - cssClass : 'btn-primary' - }]; - - $dialog.messageBox(title, msg, btns).open().then(function(result) { - if (result == 'ok') { - var data = { - id : sub.id - }; - FeedService.unsubscribe(data, function() { - CategoryService.init(); - }); - $state.transitionTo('feeds.view', { - _id : 'all', - _type : 'category' - }); - } + var data = { + id : sub.id + }; + FeedService.unsubscribe(data, function() { + CategoryService.init(); + }); + $state.transitionTo('feeds.view', { + _id : 'all', + _type : 'category' }); }; @@ -335,7 +320,7 @@ module.controller('FeedDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedS }]); module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedService', 'CategoryService', 'ProfileService', - '$dialog', function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService, $dialog) { + function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService) { $scope.CategoryService = CategoryService; $scope.user = ProfileService.get(); @@ -382,29 +367,14 @@ module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'F $scope.deleteCategory = function() { var category = $scope.category; - var title = 'Delete category'; - var msg = 'Delete category ' + category.name + ' ?'; - var btns = [{ - result : 'cancel', - label : 'Cancel' - }, { - result : 'ok', - label : 'OK', - cssClass : 'btn-primary' - }]; - - $dialog.messageBox(title, msg, btns).open().then(function(result) { - if (result == 'ok') { - CategoryService.remove({ - id : category.id - }, function() { - CategoryService.init(); - }); - $state.transitionTo('feeds.view', { - _id : 'all', - _type : 'category' - }); - } + CategoryService.remove({ + id : category.id + }, function() { + CategoryService.init(); + }); + $state.transitionTo('feeds.view', { + _id : 'all', + _type : 'category' }); }; @@ -425,8 +395,8 @@ module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'F }; }]); -module.controller('TagDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedService', 'CategoryService', 'ProfileService', '$dialog', - function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService, $dialog) { +module.controller('TagDetailsCtrl', ['$scope', '$state', '$stateParams', 'FeedService', 'CategoryService', 'ProfileService', + function($scope, $state, $stateParams, FeedService, CategoryService, ProfileService) { $scope.CategoryService = CategoryService; $scope.user = ProfileService.get(); @@ -1334,8 +1304,8 @@ module.controller('ManageUsersCtrl', ['$scope', '$state', '$location', 'AdminUse }; }]); -module.controller('ManageUserCtrl', ['$scope', '$state', '$stateParams', '$dialog', 'AdminUsersService', - function($scope, $state, $stateParams, $dialog, AdminUsersService) { +module.controller('ManageUserCtrl', ['$scope', '$state', '$stateParams', 'AdminUsersService', + function($scope, $state, $stateParams, AdminUsersService) { $scope.user = $stateParams._id ? AdminUsersService.get({ id : $stateParams._id }) : { @@ -1362,26 +1332,11 @@ module.controller('ManageUserCtrl', ['$scope', '$state', '$stateParams', '$dialo }, alertFunction); }; $scope.remove = function() { - var title = 'Delete user'; - var msg = 'Delete user ' + $scope.user.name + ' ?'; - var btns = [{ - result : 'cancel', - label : 'Cancel' - }, { - result : 'ok', - label : 'OK', - cssClass : 'btn-primary' - }]; - - $dialog.messageBox(title, msg, btns).open().then(function(result) { - if (result == 'ok') { - AdminUsersService.remove({ - id : $scope.user.id - }, function() { - $state.transitionTo('admin.userlist'); - }, alertFunction); - } - }); + AdminUsersService.remove({ + id : $scope.user.id + }, function() { + $state.transitionTo('admin.userlist'); + }, alertFunction); }; }]); @@ -1412,8 +1367,8 @@ module.controller('SettingsCtrl', ['$scope', '$location', 'SettingsService', 'An }; }]); -module.controller('ProfileCtrl', ['$scope', '$location', '$dialog', 'ProfileService', 'AnalyticsService', - function($scope, $location, $dialog, ProfileService, AnalyticsService) { +module.controller('ProfileCtrl', ['$scope', '$location', 'ProfileService', 'AnalyticsService', + function($scope, $location, ProfileService, AnalyticsService) { AnalyticsService.track(); @@ -1437,23 +1392,8 @@ module.controller('ProfileCtrl', ['$scope', '$location', '$dialog', 'ProfileServ }); }; $scope.deleteAccount = function() { - var title = 'Delete account'; - var msg = 'Delete your acount? There\'s no turning back!'; - var btns = [{ - result : 'cancel', - label : 'Cancel' - }, { - result : 'ok', - label : 'OK', - cssClass : 'btn-primary' - }]; - - $dialog.messageBox(title, msg, btns).open().then(function(result) { - if (result == 'ok') { - ProfileService.deleteAccount({}); - window.location.href = 'logout'; - } - }); + ProfileService.deleteAccount({}); + window.location.href = 'logout'; }; }]); diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js index 79f80c9b..bc3af58b 100644 --- a/src/main/webapp/js/directives.js +++ b/src/main/webapp/js/directives.js @@ -15,6 +15,22 @@ module.directive('focus', ['$timeout', function($timeout) { }; }]); +module.directive('confirmClick', [function() { + return { + priority : -1, + restrict : 'A', + link : function(scope, element, attrs) { + element.bind('click', function(e) { + var message = attrs.confirmClick; + if (message && !confirm(message)) { + e.stopImmediatePropagation(); + e.preventDefault(); + } + }); + } + }; +}]); + /** * Open a popup window pointing to the url in the href attribute */ @@ -154,8 +170,8 @@ module.directive('category', [function() { restrict : 'E', replace : true, templateUrl : 'templates/_category.html', - controller : ['$scope', '$state', '$dialog', 'FeedService', 'CategoryService', 'SettingsService', 'MobileService', - function($scope, $state, $dialog, FeedService, CategoryService, SettingsService, MobileService) { + controller : ['$scope', '$state', 'FeedService', 'CategoryService', 'SettingsService', 'MobileService', + function($scope, $state, FeedService, CategoryService, SettingsService, MobileService) { $scope.settingsService = SettingsService; $scope.getClass = function(level) { diff --git a/src/main/webapp/sass/generic/_misc.scss b/src/main/webapp/sass/generic/_misc.scss index 29fb68bb..79bee382 100644 --- a/src/main/webapp/sass/generic/_misc.scss +++ b/src/main/webapp/sass/generic/_misc.scss @@ -6,6 +6,14 @@ padding-left: 20px; } +body .modal { + display: block; +} + +body .modal-backdrop { + opacity: 0.5; +} + .pointer { cursor: pointer; } diff --git a/src/main/webapp/templates/_feedsearch.html b/src/main/webapp/templates/_feedsearch.html index fbdb837d..8abb3647 100644 --- a/src/main/webapp/templates/_feedsearch.html +++ b/src/main/webapp/templates/_feedsearch.html @@ -1,25 +1,29 @@
- -
\ No newline at end of file diff --git a/src/main/webapp/templates/admin.useredit.html b/src/main/webapp/templates/admin.useredit.html index f8f8bd97..8bb33823 100644 --- a/src/main/webapp/templates/admin.useredit.html +++ b/src/main/webapp/templates/admin.useredit.html @@ -40,7 +40,7 @@
- +
diff --git a/src/main/webapp/templates/feeds.category_details.html b/src/main/webapp/templates/feeds.category_details.html index 5fa7a15f..174dacec 100644 --- a/src/main/webapp/templates/feeds.category_details.html +++ b/src/main/webapp/templates/feeds.category_details.html @@ -39,7 +39,8 @@
- +
diff --git a/src/main/webapp/templates/feeds.feed_details.html b/src/main/webapp/templates/feeds.feed_details.html index 0d8450e8..4976d629 100644 --- a/src/main/webapp/templates/feeds.feed_details.html +++ b/src/main/webapp/templates/feeds.feed_details.html @@ -18,8 +18,8 @@
- ${global.required} + + ${global.required}
@@ -28,7 +28,8 @@
${global.required} + + ${global.required}
@@ -70,8 +71,8 @@
- - + +
diff --git a/src/main/webapp/templates/feeds.view.html b/src/main/webapp/templates/feeds.view.html index 5c74fb75..c11000bf 100644 --- a/src/main/webapp/templates/feeds.view.html +++ b/src/main/webapp/templates/feeds.view.html @@ -126,11 +126,15 @@ "{{name}}" ${view.no_unread_items}
-
diff --git a/src/main/webapp/templates/profile.html b/src/main/webapp/templates/profile.html index f273ffe7..5886372c 100644 --- a/src/main/webapp/templates/profile.html +++ b/src/main/webapp/templates/profile.html @@ -57,7 +57,7 @@
- +