{:uriI"file:///Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js?type=application/javascript&pipeline=self&id=6797b5a75b53366bf299f808feb13672dba94aca81d71766672345b2c6bdcca6:ET:load_pathI"T/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts;T: filenameI"/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js;T: nameI"1social_networking/services/home-tool-service;T:logical_pathI"9social_networking/services/home-tool-service.self.js;T:content_typeI"application/javascript;T: sourceI" ;(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 }; 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 }); }; 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); })(); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"file-digest:///Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/social_networking/services/home-tool-service.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%YϬ*z@y r`g4 ˌ5E: lengthi :dependencies_digest"%'HV}lpj yu ?O܇5:idI"E6797b5a75b53366bf299f808feb13672dba94aca81d71766672345b2c6bdcca6;F: mtimel+U