climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1492496 - in /incubator/climate/trunk/rcmet/src/main/ui/app/js: ./ controllers/
Date Wed, 12 Jun 2013 23:20:27 GMT
Author: joyce
Date: Wed Jun 12 23:20:26 2013
New Revision: 1492496

URL: http://svn.apache.org/r1492496
Log:
Resolves CLIMATE-104 - Move controllers to new module

- Adds new component to App object called Controllers. All new
  controllers are created under this module.
- Adds new controller module as a dependency of the primary application
  module.
- Adjusts the route provider in app.js so that the controllers are
  pointed to properly. The old style breaks when the controllers are
  defined in a new module.

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetDisplayCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ObservationSelectCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/RcmedSelectionCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/SettingsCtrl.js
    incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js Wed Jun 12 23:20:26 2013
@@ -6,12 +6,13 @@ var App =  App || {};
 
 App.Services = angular.module('rcmes.services', []);
 App.Directives = angular.module('rcmes.directives', []);
+App.Controllers = angular.module('rcmes.controllers', []);
 
-angular.module('rcmes', ['rcmes.services', 'rcmes.directives', 'ui.date']).
+angular.module('rcmes', ['rcmes.services', 'rcmes.directives', 'rcmes.controllers', 'ui.date']).
 	config(['$routeProvider', function($routeProvider) {
 		$routeProvider.
-			when('/obs', {templateUrl: 'partials/selectObservation.html',   controller: ObservationSelectCtrl}).
-			when('/rcmed', {templateUrl: 'partials/selectRcmed.html', controller: RcmedSelectionCtrl}).
+			when('/obs', {templateUrl: 'partials/selectObservation.html', controller: 'ObservationSelectCtrl'}).
+			when('/rcmed', {templateUrl: 'partials/selectRcmed.html', controller: 'RcmedSelectionCtrl'}).
 			otherwise({redirectTo: '/obs'});
 	}]).
 	run(function($rootScope) {

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetDisplayCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetDisplayCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetDisplayCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/DatasetDisplayCtrl.js Wed
Jun 12 23:20:26 2013
@@ -16,7 +16,8 @@
 //
 
 // Controller for dataset display
-function DatasetDisplayCtrl($rootScope, $scope, selectedDatasetInformation) {
+App.Controllers.controller('DatasetDisplayCtrl', ['$rootScope', '$scope', 'selectedDatasetInformation',

+function($rootScope, $scope, selectedDatasetInformation) {
 	$scope.datasets = selectedDatasetInformation.getDatasets();
 
 	$scope.removeDataset = function($index) {
@@ -28,4 +29,4 @@ function DatasetDisplayCtrl($rootScope, 
 			$scope.datasets[i].regrid = ((i == index) ? $scope.datasets[i].regrid : false);
 		}
 	}
-}
+}]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ObservationSelectCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ObservationSelectCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ObservationSelectCtrl.js
(original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ObservationSelectCtrl.js
Wed Jun 12 23:20:26 2013
@@ -16,7 +16,8 @@
 //
 
 // Controller for observation selection in modal
-function ObservationSelectCtrl($rootScope, $scope, $http, $q, $timeout, selectedDatasetInformation)
{
+App.Controllers.controller('ObservationSelectCtrl', ['$rootScope', '$scope', '$http', '$q',
'$timeout', 'selectedDatasetInformation',
+function($rootScope, $scope, $http, $q, $timeout, selectedDatasetInformation) {
 	// Grab a copy of the datasets so we can display a count to the user!
 	$scope.datasetCount = selectedDatasetInformation.getDatasets();
 
@@ -188,4 +189,4 @@ function ObservationSelectCtrl($rootScop
 	$scope.shouldDisableLoadButton = function() {
 		return $scope.loadingFile;
 	}
-}
+}]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/ParameterSelectCtrl.js Wed
Jun 12 23:20:26 2013
@@ -16,8 +16,9 @@
 //
 
 // Controller for dataset parameter selection/modification
-function ParameterSelectCtrl($rootScope, $scope, $http, $timeout, selectedDatasetInformation,

-							 regionSelectParams, evaluationSettings) {
+App.Controllers.controller('ParameterSelectCtrl', ['$rootScope', '$scope', '$http', '$timeout',

+						   'selectedDatasetInformation', 'regionSelectParams', 'evaluationSettings', 
+function($rootScope, $scope, $http, $timeout, selectedDatasetInformation, regionSelectParams,
evaluationSettings) {
 	$scope.datasets = selectedDatasetInformation.getDatasets();
 
 	// The min/max lat/lon values from the selected datasets
@@ -253,4 +254,4 @@ function ParameterSelectCtrl($rootScope,
 			$scope.displayParams.areValid = true;
 			$rootScope.$broadcast('redrawOverlays', []);
 		}, true);
-}
+}]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/RcmedSelectionCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/RcmedSelectionCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/RcmedSelectionCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/RcmedSelectionCtrl.js Wed
Jun 12 23:20:26 2013
@@ -15,7 +15,8 @@
 // limitations under the License.
 //
 
-function RcmedSelectionCtrl($rootScope, $scope, $http, $timeout, selectedDatasetInformation)
{
+App.Controllers.controller('RcmedSelectionCtrl', ['$rootScope', '$scope', '$http', '$timeout',
'selectedDatasetInformation', 
+function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) {
 	// Grab a copy of the datasets so we can display a count to the user!
 	$scope.datasetCount = selectedDatasetInformation.getDatasets();
 	$scope.fileAdded = false;
@@ -101,4 +102,4 @@ function RcmedSelectionCtrl($rootScope, 
 
 	// Grab the available observations from RCMED
 	getObservations();
-}
+}]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/SettingsCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/SettingsCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/SettingsCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/SettingsCtrl.js Wed Jun 12
23:20:26 2013
@@ -15,6 +15,7 @@
 // limitations under the License.
 //
 
-function SettingsCtrl($scope, evaluationSettings) {
+App.Controllers.controller('SettingsCtrl', ['$scope', 'evaluationSettings',
+function($scope, evaluationSettings) {
 	$scope.settings = evaluationSettings.getSettings();
-}
+}]);

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js?rev=1492496&r1=1492495&r2=1492496&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/controllers/WorldMapCtrl.js Wed Jun 12
23:20:26 2013
@@ -16,7 +16,8 @@
 //
 
 // Controller for the world map
-function WorldMapCtrl($rootScope, $scope, selectedDatasetInformation, regionSelectParams)
{
+App.Controllers.controller('WorldMapCtrl', ['$rootScope', '$scope', 'selectedDatasetInformation',
'regionSelectParams',
+function($rootScope, $scope, selectedDatasetInformation, regionSelectParams) {
 	$scope.datasets = selectedDatasetInformation.getDatasets();
 	$scope.regionParams = regionSelectParams.getParameters();
 
@@ -85,4 +86,4 @@ function WorldMapCtrl($rootScope, $scope
 	$scope.$watch('datasets', function() {
 		$scope.updateMap();
 	}, true);
-};
+}]);



Mime
View raw message