+ num = 0;
+ $.each($scope.facility_names, function(i, facility_name) {
+ num += $scope.testbed_names[facility_name].length;
+ });
+ prev_num_selected = prev_selected.length;
+ num_selected = selected.length;
+
+ if ((prev_num_selected != 0) && (prev_num_selected != num)) {
+ // Remove previous filter
+ // XXX We should have a joint facility/testbed filter
+ filter = ['testbed_name', 'included', prev_selected];
+ manifold.raise_event($scope.instance.options.query_uuid, FILTER_REMOVED, filter);
+ }
+
+ if (num_selected != num) {
+ // XXX We should have a joint facility/testbed filter
+ filter = ['testbed_name', 'included', selected];
+ manifold.raise_event($scope.instance.options.query_uuid, FILTER_ADDED, filter);
+ }
+ };
+
+ /* Return object reference */
+ return (this);
+ }
+
+ // Define the Controller as the constructor function.
+ app.controller("TestbedsCtrl", Controller);
+
+})(angular, ManifoldApp);
+
+(function($){
+ var TestbedsPlugin = Plugin.extend({
+
+ /** XXX to check
+ * @brief Plugin constructor
+ * @param options : an associative array of setting values
+ * @param element :
+ * @return : a jQuery collection of objects on which the plugin is
+ * applied, which allows to maintain chainability of calls
+ */
+ init: function(options, element)
+ {
+ // Call the parent constructor, see FAQ when forgotten
+ this._super(options, element);
+
+ /* Member variables */
+ this.testbeds = Array();
+
+ this._get_scope().instance = this;
+
+ /* Handlers */
+ this.listen_query(options.query_uuid);
+ this.listen_query(options.query_networks_uuid, 'networks');
+ },
+
+
+ /* HANDLERS */