{I" class:ETI"ProcessedAsset;FI"logical_path;TI"4social_networking/services/home-tool-service.js;FI" pathname;TI"u/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+æ#\TI" length;Ti) I" digest;TI"%f325a5c423d930d7c7bf6116f228ec68;FI" source;TI") ;(function() { 'use strict'; // Returns an object that stores the state of the Home Tool. function HomeToolService() { // The default values for an 'On Your Mind Statement'. var onYourMindStatementDefaults = { description: '' }; // Stores the state of the Home Tool. function HomeTool() { this._mode = HomeTool.MODES.FEED; this._onYourMindStatementModel = {}; this._commentModel = {}; this._selectedItem = null; } // Tool modes triggered by user actions. HomeTool.MODES = { PROFILES: 0, FEED: 1, ON_YOUR_MIND_ENTRY: 2, COMMENT_ON: 3 }; HomeTool.prototype.MODES = HomeTool.MODES; HomeTool.prototype.getMode = function() { return this._mode; }; HomeTool.prototype.setMode = function(mode) { this._mode = mode; }; // Prepare to edit an 'On Your Mind Statement'. HomeTool.prototype.editOnYourMindStatement = function() { this._setOnYourMindStatementModel(); this.setMode(this.MODES.ON_YOUR_MIND_ENTRY); }; HomeTool.prototype.newCommentOn = function(item) { this._setCommentModel({ text: '', itemType: item.className, itemId: item.id }); this.setMode(this.MODES.COMMENT_ON); }; HomeTool.prototype.getOnYourMindStatementModel = function() { return this._onYourMindStatementModel; }; HomeTool.prototype.getCommentModel = function() { return this._commentModel; }; HomeTool.prototype.setSelectedItem = function(item) { this._selectedItem = item; }; HomeTool.prototype.getSelectedItem = function() { return this._selectedItem; }; // Reset On Your Mind Statement properties to defaults. HomeTool.prototype._setOnYourMindStatementModel = function() { this._copyOnYourMindStatement(onYourMindStatementDefaults, this._onYourMindStatementModel); }; // Copy On Your Mind Statement properties. HomeTool.prototype._copyOnYourMindStatement = function(src, dst) { dst.description = src.description; }; // Reset Comment properties to defaults. HomeTool.prototype._setCommentModel = function(attributes) { this._copyComment(attributes, this._commentModel); }; // Copy Comment properties. HomeTool.prototype._copyComment = function(src, dst) { dst.text = src.text; dst.itemId = src.itemId; dst.itemType = src.itemType; }; return new HomeTool(); } angular.module('socialNetworking.services') .service('homeTool', HomeToolService); })(); ;TI"dependency_digest;TI"%b5f89c753cd1a35ef1c29414f4aef7b3;FI"required_paths;T[I"u/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js;FI"dependency_paths;T[{I" path;TI"u/Users/ems408/workspace/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js;FI" mtime;TI"2014-11-06T19:44:06-06:00;TI" digest;TI"%f325a5c423d930d7c7bf6116f228ec68;FI" _version;TI"%b910479f035fc02c55a3e167aaa8a0b8;F