You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/13 01:18:28 UTC

svn commit: r1492483 - in /incubator/climate/trunk/rcmet/src/main/ui/app: index.html js/services.js js/services/ js/services/SelectedDatasetInformation.js

Author: joyce
Date: Wed Jun 12 23:18:27 2013
New Revision: 1492483

URL: http://svn.apache.org/r1492483
Log:
CLIMATE-99 progress - Moves selectedDatasetInformation to new file

Added:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/services/
    incubator/climate/trunk/rcmet/src/main/ui/app/js/services/SelectedDatasetInformation.js
Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/index.html
    incubator/climate/trunk/rcmet/src/main/ui/app/js/services.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/index.html
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/index.html?rev=1492483&r1=1492482&r2=1492483&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/index.html (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/index.html Wed Jun 12 23:18:27 2013
@@ -229,6 +229,7 @@
   <script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
   <script src="js/app.js"></script>
   <script src="js/services.js"></script>
+  <script src="js/services/SelectedDatasetInformation.js"></script>
   <script src="js/controllers/WorldMapCtrl.js"></script>
   <script src="js/controllers/ParameterSelectCtrl.js"></script>
   <script src="js/controllers/DatasetDisplayCtrl.js"></script>

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/services.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/services.js?rev=1492483&r1=1492482&r2=1492483&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/services.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/services.js Wed Jun 12 23:18:27 2013
@@ -6,34 +6,6 @@
 // Demonstrate how to register services
 // In this case it is a simple value service.
 angular.module('rcmes').
-	service('selectedDatasetInformation', function() {
-		var datasets = [];
-
-		return {
-			getDatasets: function() {
-				return datasets;
-			},
-			getDatasetCount: function() {
-				return datasets.length;
-			},
-			// TODO: Define the structure of the objects that are added with addDataset.
-			addDataset: function(dataset) {
-				// All datasets need a shouldDisplay attribute that is used when rendering
-				// the overlays on the map!
-				dataset.shouldDisplay = true;
-				// The regrid attribute indicates which dataset should be used for spatial regridding
-				dataset.regrid = false;
-
-				datasets.push(dataset);
-			},
-			removeDataset: function(index) {
-				datasets.splice(index, 1);
-			},
-			clearDatasets: function() {
-				datasets.length = 0;
-			},
-		};
-	}).
 	service('regionSelectParams', function() {
 		var parameters = {
 			"areValid" : true,

Added: incubator/climate/trunk/rcmet/src/main/ui/app/js/services/SelectedDatasetInformation.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/services/SelectedDatasetInformation.js?rev=1492483&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/services/SelectedDatasetInformation.js (added)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/services/SelectedDatasetInformation.js Wed Jun 12 23:18:27 2013
@@ -0,0 +1,47 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.You may obtain a copy of the License at
+// 
+// http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Service for giving controllers access to the information on datasets that 
+// the user has selected for evaluation.
+angular.module('rcmes').service('selectedDatasetInformation', function() {
+	var datasets = [];
+
+	return {
+		getDatasets: function() {
+			return datasets;
+		},
+		getDatasetCount: function() {
+			return datasets.length;
+		},
+		// TODO: Define the structure of the objects that are added with addDataset.
+		addDataset: function(dataset) {
+			// All datasets need a shouldDisplay attribute that is used when rendering
+			// the overlays on the map!
+			dataset.shouldDisplay = true;
+			// The regrid attribute indicates which dataset should be used for spatial regridding
+			dataset.regrid = false;
+
+			datasets.push(dataset);
+		},
+		removeDataset: function(index) {
+			datasets.splice(index, 1);
+		},
+		clearDatasets: function() {
+			datasets.length = 0;
+		},
+	};
+});