From 61581fd392197e3be2336d70e7dec648a18edbae Mon Sep 17 00:00:00 2001 From: Athou Date: Thu, 27 Jun 2013 14:27:00 +0200 Subject: [PATCH] wro4j update --- pom.xml | 6 +- src/main/webapp/js/controllers.js | 3 +- src/main/webapp/js/directives.js | 283 ++++++++++++++---------------- 3 files changed, 138 insertions(+), 154 deletions(-) diff --git a/pom.xml b/pom.xml index a3c953b8..911111b1 100644 --- a/pom.xml +++ b/pom.xml @@ -334,7 +334,7 @@ ro.isdc.wro4j wro4j-extensions - 1.6.3 + 1.7.0 @@ -380,7 +380,7 @@ ro.isdc.wro4j wro4j-maven-plugin - 1.6.3 + 1.7.0 js @@ -517,7 +517,7 @@ ro.isdc.wro4j wro4j-maven-plugin - 1.6.3 + 1.7.0 diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 32e4fa5e..687f45e2 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -614,8 +614,7 @@ function($scope, $state, $filter, $timeout, CategoryService) { $state.transitionTo('feeds.view', { _type : 'feed', _id : id - } - ); + }); }; $scope.open = function() { diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js index ad202cce..acb6e730 100644 --- a/src/main/webapp/js/directives.js +++ b/src/main/webapp/js/directives.js @@ -225,98 +225,99 @@ module.directive('category', [ function() { replace : true, templateUrl : 'templates/_category.html', controller : [ - '$scope', - '$state', - '$dialog', - 'FeedService', - 'CategoryService', - 'SettingsService', - 'MobileService', - function($scope, $state, $dialog, FeedService, CategoryService, - SettingsService, MobileService) { - $scope.settingsService = SettingsService; + '$scope', + '$state', + '$dialog', + 'FeedService', + 'CategoryService', + 'SettingsService', + 'MobileService', + function($scope, $state, $dialog, FeedService, CategoryService, + SettingsService, MobileService) { + $scope.settingsService = SettingsService; - $scope.getClass = function(level) { - if ($scope.showLabel) { - return 'indent' + level; - } - }; + $scope.getClass = function(level) { + if ($scope.showLabel) { + return 'indent' + level; + } + }; - $scope.categoryLabel = function(category) { - return $scope.showLabel !== true ? $scope.showLabel - : category.name; - }; + $scope.categoryLabel = function(category) { + return $scope.showLabel !== true ? $scope.showLabel + : category.name; + }; - $scope.categoryCountLabel = function(category) { - var count = $scope.unreadCount({ - category : category + $scope.categoryCountLabel = function(category) { + var count = $scope.unreadCount({ + category : category + }); + var label = ''; + if (count > 0) { + label = '(' + count + ')'; + } + return label; + }; + + $scope.feedCountLabel = function(feed) { + var label = ''; + if (feed.unread > 0) { + label = '(' + feed.unread + ')'; + } + return label; + }; + + $scope.feedClicked = function(id) { + MobileService.toggleLeftMenu(); + if ($scope.selectedType == 'feed' + && id == $scope.selectedId) { + $scope.$emit('emitReload'); + } else { + $state.transitionTo('feeds.view', { + _type : 'feed', + _id : id }); - var label = ''; - if (count > 0) { - label = '(' + count + ')'; - } - return label; - }; + } + }; - $scope.feedCountLabel = function(feed) { - var label = ''; - if (feed.unread > 0) { - label = '(' + feed.unread + ')'; - } - return label; - }; - - $scope.feedClicked = function(id) { - MobileService.toggleLeftMenu(); - if ($scope.selectedType == 'feed' - && id == $scope.selectedId) { - $scope.$emit('emitReload'); - } else { - $state.transitionTo('feeds.view', { - _type : 'feed', - _id : id - }); - } - }; - - $scope.categoryClicked = function(id) { - MobileService.toggleLeftMenu(); - if ($scope.selectedType == 'category' - && id == $scope.selectedId) { - $scope.$emit('emitReload'); - } else { - $state.transitionTo('feeds.view', { - _type : 'category', - _id : id - }); - } - }; - - $scope.showFeedDetails = function(feed) { - $state.transitionTo('feeds.feed_details', { - _id : feed.id + $scope.categoryClicked = function(id) { + MobileService.toggleLeftMenu(); + if ($scope.selectedType == 'category' + && id == $scope.selectedId) { + $scope.$emit('emitReload'); + } else { + $state.transitionTo('feeds.view', { + _type : 'category', + _id : id }); - }; + } + }; - $scope.showCategoryDetails = function(category) { - $state.transitionTo('feeds.category_details', { - _id : category.id - }); - }; + $scope.showFeedDetails = function(feed) { + $state.transitionTo('feeds.feed_details', { + _id : feed.id + }); + }; - $scope.toggleCategory = function(category, event) { - event.preventDefault(); - event.stopPropagation(); - category.expanded = !category.expanded; - if (category.id == 'all') { - return; - } - CategoryService.collapse({ - id : category.id, - collapse : !category.expanded - }); - }; - } ] + $scope.showCategoryDetails = function(category) { + $state.transitionTo('feeds.category_details', { + _id : category.id + }); + }; + + $scope.toggleCategory = function(category, event) { + event.preventDefault(); + event.stopPropagation(); + category.expanded = !category.expanded; + if (category.id == 'all') { + return; + } + CategoryService.collapse({ + id : category.id, + collapse : !category.expanded + }); + }; + } + ] }; } ]); @@ -373,70 +374,54 @@ module.directive('draggable', function() { }; }); -module.directive('droppable', [ 'CategoryService', 'FeedService', function(CategoryService, FeedService) { - return { - restrict : 'A', - link : function(scope, element, attrs) { - element.droppable({ - tolerance: 'pointer', - over: function(event, ui) { - - }, - drop : function(event, ui) { - var draggable = angular.element(ui.draggable); - - var source = draggable.data('source'); - var target = scope.$eval(attrs.droppable); - - if (angular.equals(source, target)) { - return; - } - - var data = { - id: source.id, - name: source.name - }; - - if (source.children) { - // source is a category - - /* - * TODO better handling of category dragging - * - if (target.children) { - // target is a category - data.parentId = target.id; - data.position = 0; - } else { - // target is a feed - data.parentId = target.categoryId; +module.directive('droppable', [ 'CategoryService', 'FeedService', + function(CategoryService, FeedService) { + return { + restrict : 'A', + link : function(scope, element, attrs) { + element.droppable({ + tolerance : 'pointer', + over : function(event, ui) { + + }, + drop : function(event, ui) { + var draggable = angular.element(ui.draggable); + + var source = draggable.data('source'); + var target = scope.$eval(attrs.droppable); + + if (angular.equals(source, target)) { + return; + } + + var data = { + id : source.id, + name : source.name + }; + + if (source.children) { + // source is a category + + } else { + // source is a feed + + if (target.children) { + // target is a category + data.categoryId = target.id; + data.position = 0; + } else { + // target is a feed + data.categoryId = target.categoryId; + data.position = target.position; + } + + FeedService.modify(data, function() { + CategoryService.init(); + }); + } + scope.$apply(); } - - CategoryService.modify(data, function() { - CategoryService.init(); - }); - */ - } else { - // source is a feed - - if (target.children) { - // target is a category - data.categoryId = target.id; - data.position = 0; - } else { - // target is a feed - data.categoryId = target.categoryId; - data.position = target.position; - } - - FeedService.modify(data, function() { - CategoryService.init(); - }); - } - - scope.$apply(); + }); } - }); - } - }; -}]); \ No newline at end of file + }; + } ]); \ No newline at end of file