{I" class:ETI"ProcessedAsset;FI"logical_path;TI"8social_networking/controllers/profile-controller.js;FI" pathname;TI"ƒ/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+ÍUI" length;TizI" digest;TI"%9567ea1fb778379547389ea0254bec3e;FI" source;TI"z;(function() { "use strict"; // Provide interaction with a participant's profile. function ProfileCtrl(alertService, profileId, Profiles, Nudges) { var self = this; this._profiles = Profiles; this._nudges = Nudges; this.alertService = alertService; this.getAlerts = function() { return alertService.getAlerts(); }; this.profile = {}; this.removeAlert = function(alert) { alertService.removeAlert(alert); }; this._profiles.getOne(profileId).then(function(profile) { self.id = profile.id; self.profile = profile; self.iconSrc = ''; }).catch(function(error) { alertService.addError(error); }); } // Send a nudge from one participant to another. ProfileCtrl.prototype.nudge = function(recipientId) { var self = this; this._nudges.create(recipientId) .then(function(response) { self.nudgeAlert = response.message; }) .catch(function(response) { self.alertService.addError(response.data.error); }); }; ProfileCtrl.prototype.updateProfileIcon = function(iconName) { var self = this; this.iconSrc = iconName; this._profiles.update(this) .then(function(profile) { self.profile.iconSrc = profile.iconSrc; }) .catch(function(response) { self.alertService.addError(response.data.error); }); $('#icon-selection-button').click(); }; // Create a module and register the controllers. angular.module('socialNetworking.controllers') .controller('ProfileCtrl', ['alertService', 'profileId', 'Profiles', 'Nudges', ProfileCtrl]); })(); ;TI"dependency_digest;TI"%04c4c4c9b28b00b022491c8116ae943e;FI"required_paths;T[I"ƒ/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;FI"dependency_paths;T[{I" path;TI"ƒ/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/controllers/profile-controller.js;F@I"2015-08-13T16:37:05-05:00;T@I"%9567ea1fb778379547389ea0254bec3e;FI" _version;TI"%883b724e06f474a3db2deee10c127ab9;F