From 9eb91284acdb4472f3273e65c8e79af2595f0731 Mon Sep 17 00:00:00 2001
From: Rafael Diego
",a.error.message+="Este problema já foi registrado em nossos servidores.
",a.error.message+="Por favor, tente novamente mais tarde."),a.proposalStatus=a.PROPOSAL_STATUS.ERROR})}),a.$scope.$on("proposal-box:vote",function(e,o){var s=o.proposal_id,r=o.OPTION;switch(r){case a.VOTE_OPTIONS.UP:case a.VOTE_OPTIONS.DOWN:case a.VOTE_OPTIONS.SKIP:a.vote(s,r);break;default:a.$log.error("Vote option not handled:",r)}})},a.prototype.loadProposalById=function(a){var e=this;e.DialogaService.getProposalById(a,{limit:"1"},e._handleSuccessOnGetProposal.bind(e),e._handleErrorOnGetProposal.bind(e))},a.prototype.loadRandomProposal=function(){var a=this;a.DialogaService.getProposalsByTopicId(a.article.id,{order:"random()",limit:"1"},a._handleSuccessOnGetProposal.bind(a),a._handleErrorOnGetProposal.bind(a))},a.prototype._handleSuccessOnGetProposal=function(a){var e=this;if(a&&a.articles){var o=a.articles.length;e.randomProposal=a.articles[Math.floor(Math.random()*o)],e.loadingProposalBox=!1,e.$scope.$broadcast("proposal-box:proposal-loaded",{success:!0})}e.search.proposal_id&&e.$timeout(function(){var a=angular.element(".focused-proposal");a&&a.length>0&&angular.element("body").animate({scrollTop:a.offset().top},"fast")},300)},a.prototype._handleErrorOnGetProposal=function(a){var e=this;e.$log.error(a),e.$scope.$broadcast("proposal-box:proposal-loaded",{error:!0})},a.prototype.voteSkip=function(){var a=this;a.loadRandomProposal()},a.prototype.vote=function(a,e){var o=this;return e===o.VOTE_OPTIONS.SKIP?void o.voteSkip():void(o.$rootScope.currentUser&&o.DialogaService.voteProposal(a,{value:e},function(a){o.$log.debug("response",a),a.success=!0,o.$scope.$broadcast("proposal-box:vote-response",a)},function(a){o.$log.error("error",a),a.error=!0,o.$scope.$broadcast("proposal-box:vote-response",a)}))},a.prototype.voteHasBeenComputed=function(){},a.prototype.showProposalsList=function(){var a=this;a.findAndShow("#section-proposal-list")},a.prototype.hideProposalsList=function(){var a=this;a.findAndHide("#section-proposal-list")},a.prototype.showProposalForm=function(){var a=this;a.findAndShow("#section-proposal-form")},a.prototype.hideProposalForm=function(){var a=this;a.findAndHide("#section-proposal-form")},a.prototype.findAndShow=function(a){var e=this,o=e.$element.find(a);o.slideDown(),angular.element("body").animate({scrollTop:o.offset().top},"fast")},a.prototype.findAndHide=function(a){var e=this;e.$element.find(a).slideUp()},a.prototype.sendAnotherProposal=function(){var a=this;a.proposalStatus=null}}(),function(){"use strict";function a(a,e,o,s){var r=this;r.DialogaService=a,r.$log=s,r.init(),r.loadData(),r.$log.debug("SitemapPageController")}function e(a){for(var e={},o=a.length,s=0;o>s;s++){var r=a[s],t=r.categories[0],i=e[t.slug]||{};angular.isArray(i.programs)||(i=t,i.programs=[],e[i.slug]=i),i.programs.push(r)}return e}angular.module("dialoga").controller("SitemapPageController",a),a.$inject=["DialogaService","$state","$sce","$log"],a.prototype.init=function(){var a=this;a.programsPerThemes=null},a.prototype.loadData=function(){var a=this;a.DialogaService.getPrograms(function(o){a.programsPerThemes=e(o)},function(e){a.error=e,a.$log.error(e)})}}(),function(){"use strict";function a(a,e,o,s,r,t){var i=this;i.DialogaService=a,i.$scope=e,i.$location=o,i.$filter=s,i.$sce=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$log.debug("InicioPageController")}function e(a){for(var e=[],o={},s=0;s
O objetivo dessa correção é compensar o saldo de interações e a diferença de exibições das propostas que não tiveram muitas oportunidades de visualização ou das propostas que tiveram mais oportunidades de visualização que a média.
Com essa correção, é possível comparar propostas que entraram em diferentes momentos, durante todo o período da consulta.
"})}a.$inject=["$state","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.$timeout(function(){e.call(a)},1e3)},a.prototype.showContent=function(a){var e=this;e.$state.go("programa",{slug:a.parent.slug,proposal_id:a.id},{location:!0,reload:!0})};var o={restrict:"E",templateUrl:"app/components/proposal-list/proposal-list.html",scope:{proposals:"="},controller:a,controllerAs:"vm",bindToController:!0};return o}angular.module("dialoga").directive("proposalList",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r,t){t.debug("ProposalGridController");var i=this;i.$scope=a,i.$rootScope=e,i.$element=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.attachListeners()}a.$inject=["$scope","$rootScope","$element","$location","$filter","$log"],a.prototype.init=function(){},a.prototype.attachListeners=function(){};var e={restrict:"E",templateUrl:"app/components/proposal-grid/proposal-grid.html",scope:{proposals:"="},controller:a,controllerAs:"vm",bindToController:!0};return e}angular.module("dialoga").directive("proposalGrid",a)}(),function(){"use strict";function a(){function a(a,e,o,s,r){r.debug("ProposalCarouselController");var t=this;t.$scope=a,t.$state=e,t.$element=o,t.$timeout=s,t.$log=r,t.init()}a.$inject=["$scope","$state","$element","$timeout","$log"],a.prototype.init=function(){var a=this;if(!a.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};a.activeIndex=0,a.loading=!1,a.proposalsLength=a.proposals.length},a.prototype.swipeLeft=function(){var a=this;a.activeIndex=a.activeIndex