{:uriI"file:///Users/ericcf/work/social_networking/app/assets/javascripts/notices.js?type=application/javascript&pipeline=self&id=0864f323b7aab8feb5a102d75ba2e49602e20299cc8c5f4b794dca180f0e20e4:ET:load_pathI"@/Users/ericcf/work/social_networking/app/assets/javascripts;T: filenameI"K/Users/ericcf/work/social_networking/app/assets/javascripts/notices.js;T: nameI" notices;T:logical_pathI"notices.self.js;T:content_typeI"application/javascript;T: sourceI" (function() { "use strict"; function Notice() { var toastTimeout = 7000; this.actionNotice = function(actionType, description, participantId) { var self = this; this.behaviorPostNotice(actionType, description, participantId); setTimeout( function () { self.incentivePostNotice(actionType, description, participantId); }, 3000); }; this.incentivePostNotice = function(actionType, description, participantId) { var self = this; $.ajax({ type: "POST", url: "/participant_incentives/complete", data: { "participant_id": participantId, "action_type": actionType }, success: function (data, status) { if ('success' === status) { self.incentivRealTimeToast(description); } } }); }; this.behaviorPostNotice = function(actionType, description, participantId) { var self = this; $.ajax({ type: "POST", url: "/participant_behaviors/complete", data: { "participant_id": participantId, "action_type": actionType }, success: function (data, status) { if ('success' === status) { self.behaviorRealTimeToast(description); } } }); }; this.incentiveToastView = function(incentiveId, description) { this.realTimeToast("incentive", description); setTimeout( function () { $.ajax({ type: "PATCH", url: "/participant_incentives/" + incentiveId + "/complete" }); }, toastTimeout); }; this.behaviorToastView = function(behaviorId, description) { this.realTimeToast("behavior", description); setTimeout( function () { $.ajax({ type: "PATCH", url: "/participant_behaviors/" + behaviorId + "/complete" }); }, toastTimeout); }; this.incentivRealTimeToast = function(description) { this.realTimeToast('incentive', description); }; this.behaviorRealTimeToast = function(description) { this.realTimeToast('behavior', description); }; this.realTimeToast = function(type, description) { $.toaster( { title: 'Congratulations', priority: 'success', message: 'you completed the ' + type + ': ' + description, settings: {timeout: toastTimeout} }); }; } window.Notice = new Notice(); }()); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"Yfile-digest:///Users/ericcf/work/social_networking/app/assets/javascripts/notices.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"% 0¯pW0e,>7 D+H #: lengthi :dependencies_digest"%6#YކB m 4 Ɩj9:idI"E0864f323b7aab8feb5a102d75ba2e49602e20299cc8c5f4b794dca180f0e20e4;F: mtimel+a3W