{I" class:ETI"BundledAsset;FI"logical_path;TI"notices.js;FI" pathname;TI"_/Users/usabilitymonitor/Desktop/Github/social_networking/app/assets/javascripts/notices.js;FI"content_type;TI"application/javascript;TI" mtime;Tl+¢¿UI" length;Tiê I" digest;TI"%44d5dfdd0187925c81b6d2f097a07e10;FI" source;TI"ê (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(); }()); ;TI"required_assets_digest;TI"%0d74155995859eec55860e0f22ed31a4;FI" _version;TI"%069e88c06b889877799890854d7f4c40;F