From 30cde0411c9011e4e8b20c12c20d6b070e76ac61 Mon Sep 17 00:00:00 2001 From: Leonardo Merlin Date: Thu, 17 Sep 2015 09:20:07 -0300 Subject: [PATCH] Update dist --- dist/assets/images/icons/sprite.png | Bin 134427 -> 0 bytes dist/assets/images/icons/tema-reducao-da-pobreza-small.png | Bin 1347 -> 0 bytes dist/assets/images/icons/tema-reducao-da-pobreza.png | Bin 2814 -> 0 bytes dist/index.html | 4 ++-- dist/scripts/app-6d8377f604.js | 5 +++++ dist/scripts/app-8299c8d1bb.js | 5 ----- dist/styles/app-208d0858f3.css | 1 - dist/styles/app-e194f766c1.css | 1 + 8 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 dist/scripts/app-6d8377f604.js delete mode 100644 dist/scripts/app-8299c8d1bb.js delete mode 100644 dist/styles/app-208d0858f3.css create mode 100644 dist/styles/app-e194f766c1.css diff --git a/dist/assets/images/icons/sprite.png b/dist/assets/images/icons/sprite.png index 65c7a5d..811c6af 100644 Binary files a/dist/assets/images/icons/sprite.png and b/dist/assets/images/icons/sprite.png differ diff --git a/dist/assets/images/icons/tema-reducao-da-pobreza-small.png b/dist/assets/images/icons/tema-reducao-da-pobreza-small.png index d4ef133..1273269 100644 Binary files a/dist/assets/images/icons/tema-reducao-da-pobreza-small.png and b/dist/assets/images/icons/tema-reducao-da-pobreza-small.png differ diff --git a/dist/assets/images/icons/tema-reducao-da-pobreza.png b/dist/assets/images/icons/tema-reducao-da-pobreza.png index 8c87c08..4eb6de1 100644 Binary files a/dist/assets/images/icons/tema-reducao-da-pobreza.png and b/dist/assets/images/icons/tema-reducao-da-pobreza.png differ diff --git a/dist/index.html b/dist/index.html index 40610b3..52b6ec1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,3 +1,3 @@ -Dialoga Brasil
Dialoga Brasil
\ No newline at end of file +
\ No newline at end of file diff --git a/dist/scripts/app-6d8377f604.js b/dist/scripts/app-6d8377f604.js new file mode 100644 index 0000000..685e9b7 --- /dev/null +++ b/dist/scripts/app-6d8377f604.js @@ -0,0 +1,5 @@ +!function(){"use strict";angular.module("dialoga",["ngAnimate","ngCookies","ngTouch","ngSanitize","ui.router","ngStorage","720kb.socialshare","slugifier","ncy-angular-breadcrumb","ngMessages"])}(),function(){"use strict";function e(e,a,o,s,r){var t=this;t.DialogaService=e,t.$scope=a,t.$location=o,t.$filter=s,t.$log=r,t.init(),t.loadData(),r.debug("RankingPageController")}angular.module("dialoga").controller("RankingPageController",e),e.$inject=["DialogaService","$scope","$location","$filter","$log"],e.prototype.init=function(){var e=this;e.page=1,e.per_page=20,e.themes=null,e.selectedTheme=null,e.filtredPrograms=null,e.selectedProgram=null,e.proposals=null,e.filtredProposals=null,e.query=null,e.search=e.$location.search(),e.loading=null,e.error=null},e.prototype.loadData=function(){var e=this;e.loading=!0,e.loadingThemes=!0,e.DialogaService.getThemes(function(a){e.themes=a,e.loadingThemes=!1;var o=null;if(e.search.tema){var s=e.themes.filter(function(a){return a.slug===e.search.tema});s&&s.length>0&&(o=s[0],e.selectedTheme=o)}o||(e.selectedTheme=e.themes[Math.floor(Math.random()*e.themes.length)]);var r=e.selectedTheme.id;e.loadPrograms(r,function(){e.loadProposals(),e.loading=!1})},function(a){e.error=a,e.$log.error(a),e.loadingThemes=!1,e.loading=!1})},e.prototype.loadPrograms=function(e,a){var o=this;o.DialogaService.getProgramsByThemeId(e,function(e){o.filtredPrograms=e;var s=null;if(o.search.programa){var r=o.filtredPrograms.filter(function(e){return e.slug===o.search.programa});r&&r.length>0&&(s=r[0],o.selectedProgram=s)}s||(o.selectedProgram=o.filtredPrograms[Math.floor(Math.random()*o.filtredPrograms.length)]),a&&a()},function(e){o.$log.error(e),a&&a()})},e.prototype.loadProposals=function(){var e=this;e.loadingProposals=!0,e.DialogaService.getProposals({page:e.page,per_page:e.per_page},function(a){e.proposals=a.articles,e.filtredProposals=e.proposals,e.loadingProposals=!1,e.attachListeners()},function(a){e.error=a,e.$log.error(a),e.loadingProposals=!1})},e.prototype.attachListeners=function(){var e=this;e.$scope.$on("change-selectedCategory",function(a,o){e.selectedTheme=o}),e.$scope.$watch("pageRanking.selectedTheme",function(a){e.search.tema=a?a.slug:null,e.$location.search("tema",e.search.tema),e.selectedTheme&&e.selectedTheme.id&&e.loadPrograms(e.selectedTheme.id,function(){e.filterProposals()})}),e.$scope.$on("change-selectedTopic",function(a,o){e.selectedProgram=o}),e.$scope.$watch("pageRanking.selectedProgram",function(a){e.search.programa=a?a.slug:null,e.$location.search("programa",e.search.programa),e.filterProposals()}),e.$scope.$watch("pageRanking.query",function(a){e.search.filtro=a?a:null,e.$location.search("filtro",e.search.filtro),e.filterProposals()})},e.prototype.resetFilterValues=function(){var e=this;e.query=null,e.selectedTheme=null},e.prototype.changePage=function(e){var a=this;a.page=e,a.filterProposals(e)},e.prototype.filterProposals=function(e,a){var o=this;if(o.loadingProposals)return void o.$log.debug("Content is not loaded yet.");var s=e||o.page,r=a||o.per_page,t=o.query,i=o.selectedProgram;if(i){var l={page:s,per_page:r,parent_id:i.id};t&&(l.query=t),o.loadingProposals=!0,o.DialogaService.searchProposals(l,function(e){o.total_proposals=parseInt(e._obj.headers("total")),o.filtredProposals=e.articles,o.loadingProposals=!1},function(e){o.error=e,o.$log.error(e),o.loadingProposals=!1})}else o.filtredProposals=[]}}(),function(){"use strict";function e(e,a,o,s,r){var t=this;t.DialogaService=e,t.$scope=a,t.$location=o,t.$filter=s,t.$log=r,t.init(),t.loadData(),r.debug("PropostasPageController")}angular.module("dialoga").controller("PropostasPageController",e),e.$inject=["DialogaService","$scope","$location","$filter","$log"],e.prototype.init=function(){var e=this;e.themes=null,e.selectedTheme=null,e.filtredPrograms=null,e.selectedProgram=null,e.proposals=null,e.filtredProposals=null,e.query=null,e.search=e.$location.search(),e.loading=null,e.error=null},e.prototype.loadData=function(){var e=this;e.loading=!0,e.loadingThemes=!0,e.DialogaService.getThemes(function(a){e.themes=a,e.loadingThemes=!1,e.loading=!1,e.loadProposals(function(){e.attachListeners()})},function(a){e.error=a,e.$log.error(a),e.loadingThemes=!1,e.loading=!1})},e.prototype.loadProposals=function(e){var a=this;a.loadingProposals=!0,a.DialogaService.getProposals({},function(o){a.proposals=o.articles,a.filtredProposals=a.proposals,a.loadingProposals=!1,a.loading=!1,e&&e()},function(e){a.error=e,a.$log.error(e),a.loadingProposals=!1,a.loading=!1})},e.prototype.attachListeners=function(){var e=this;e.$scope.$on("change-selectedCategory",function(a,o){e.selectedTheme=o}),e.$scope.$watch("pagePropostas.selectedTheme",function(a,o){e.search.tema=a?a.slug:null,e.$location.search("tema",e.search.tema),e.filtredProposals=e.getFiltredProposals()}),e.$scope.$on("change-selectedTopic",function(a,o){e.selectedProgram=o}),e.$scope.$watch("pagePropostas.selectedProgram",function(a,o){e.search.programa=a?a.slug:null,e.$location.search("programa",e.search.programa),e.filtredProposals=e.getFiltredProposals()}),e.$scope.$watch("pagePropostas.query",function(a){e.search.filtro=a?a:null,e.$location.search("filtro",e.search.filtro),e.filtredProposals=e.getFiltredProposals()})},e.prototype.resetFilterValues=function(){var e=this;e.query=null,e.selectedTheme=null},e.prototype.getFiltredProposals=function(){var e=this;if(!e.proposals)return e.$log.info("No proposals loaded yet. Abort."),null;var a=e.proposals,o=a,s=e.query,r=e.selectedTheme,t=e.selectedProgram,i=e.$filter("filter");return r&&(o=e._filterByCategory(o,r)),t&&(o=e._filterByProgram(o,t)),s&&(o=i(o,s,!1)),o},e.prototype._filterByCategory=function(e,a){if(e=e||[],!a)return e;for(var o=[],s=0;s0)){var d=n.pop();o.push(d),p=!0}p||(c=!1)}return o}}(),function(){"use strict";function e(e,a,o,s,r,t,i,l,n,c,p,d){var g=this;g.DialogaService=e,g.PATH=a,g.VOTE_OPTIONS=o,g.PROPOSAL_STATUS=s,g.$state=r,g.$location=t,g.$scope=i,g.$rootScope=l,g.$element=n,g.$timeout=c,g.$sce=p,g.$log=d,g.init(),g.loadData(),g.attachListeners(),g.$rootScope.focusMainContent(),g.$log.debug("ProgramaPageController")}angular.module("dialoga").controller("ProgramaPageController",e),e.$inject=["DialogaService","PATH","VOTE_OPTIONS","PROPOSAL_STATUS","$state","$location","$scope","$rootScope","$element","$timeout","$sce","$log"],e.prototype.init=function(){var e=this;e.article=null,e.category=null,e.loading=null,e.loadingTopProposals=null,e.loadingProposalBox=null,e.sendProposalRedirectURI=null,e.search=e.$location.search(),e.error=!1},e.prototype.loadData=function(){var e=this;e.loading=!0,e.proposalStatus=null;var a=e.$state.params.slug;a||(e.$log.error("slug not defined."),e.$log.info("Rollback to home page."),e.$state.go("inicio",{},{location:!0})),e.DialogaService.getProgramBySlug(a,function(o){e.article=o,e.category=e.article.categories[0],e.sendProposalRedirectURI="state=programa&task=send-proposal&slug="+a,e.$rootScope.contentTitle=e.article.title,!e.banner&&e.article.image&&(e.banner={src:e.PATH.image+e.article.image.url,alt:"Imagem de destaque do conteúdo"}),e.article.body&&!e.article.bodyTrusted&&(e.article.bodyTrusted=e.$sce.trustAsHtml(e.article.body)),e.loadingTopProposals=!0,e.DialogaService.getProposalsByTopicId(e.article.id,{},function(a){e.proposals=a.articles,e.proposalsTopFive=e.proposals.slice(0,5),e.proposalsTopRated=e.proposals.slice(0,3),e.loadingTopProposals=!1},function(a){e.$log.error(a),e.loadingTopProposals=!1}),e.loadingProposalBox=!0,e.search.proposal_id?e.loadProposalById(e.search.proposal_id):e.loadRandomProposal(),e.loading=!1},function(a){e.$log.error(a),e.error=a,e.loading=!1})},e.prototype.attachListeners=function(){var e=this;e.$scope.$on("proposal-carousel:showProposalsList",function(){e.showProposalsList()}),e.$scope.$on("cadastro-proposa:startSendProposal",function(a,o){e.proposalStatus=e.PROPOSAL_STATUS.SENDING,e.DialogaService.createProposal(o,e.article.id,function(a){e.$log.debug("response",a),e.proposalStatus=e.PROPOSAL_STATUS.SUCCESS},function(a){e.$log.error(a),e.proposalStatus=e.PROPOSAL_STATUS.ERROR})}),e.$scope.$on("proposal-box:vote",function(a,o){var s=o.proposal_id,r=o.OPTION;switch(r){case e.VOTE_OPTIONS.UP:case e.VOTE_OPTIONS.DOWN:case e.VOTE_OPTIONS.SKIP:e.vote(s,r);break;default:e.$log.error("Vote option not handled:",r)}})},e.prototype.loadProposalById=function(e){var a=this;a.DialogaService.getProposalById(e,{limit:"1"},a._handleSuccessOnGetProposal.bind(a),a._handleErrorOnGetProposal.bind(a))},e.prototype.loadRandomProposal=function(){var e=this;e.DialogaService.getProposalsByTopicId(e.article.id,{order:"random()",limit:"1"},e._handleSuccessOnGetProposal.bind(e),e._handleErrorOnGetProposal.bind(e))},e.prototype._handleSuccessOnGetProposal=function(e){var a=this;if(e&&e.articles){var o=e.articles.length;a.randomProposal=e.articles[Math.floor(Math.random()*o)],a.loadingProposalBox=!1,a.$scope.$broadcast("proposal-box:proposal-loaded",{success:!0})}a.search.proposal_id&&a.$timeout(function(){var e=angular.element(".focused-proposal");e&&e.length>0&&angular.element("body").animate({scrollTop:e.offset().top},"fast")},300)},e.prototype._handleErrorOnGetProposal=function(e){var a=this;a.$log.error(e),a.$scope.$broadcast("proposal-box:proposal-loaded",{error:!0})},e.prototype.voteSkip=function(){var e=this;e.loadRandomProposal()},e.prototype.vote=function(e,a){var o=this;return a===o.VOTE_OPTIONS.SKIP?void o.voteSkip():void(o.$rootScope.currentUser&&o.DialogaService.voteProposal(e,{value:a},function(e){o.$log.debug("response",e),e.success=!0,o.$scope.$broadcast("proposal-box:vote-response",e)},function(e){o.$log.error("error",e),e.error=!0,o.$scope.$broadcast("proposal-box:vote-response",e)}))},e.prototype.voteHasBeenComputed=function(){},e.prototype.showProposalsList=function(){var e=this;e.findAndShow("#section-proposal-list")},e.prototype.hideProposalsList=function(){var e=this;e.findAndHide("#section-proposal-list")},e.prototype.showProposalForm=function(){var e=this;e.findAndShow("#section-proposal-form")},e.prototype.hideProposalForm=function(){var e=this;e.findAndHide("#section-proposal-form")},e.prototype.findAndShow=function(e){var a=this,o=a.$element.find(e);o.slideDown(),angular.element("body").animate({scrollTop:o.offset().top},"fast")},e.prototype.findAndHide=function(e){var a=this;a.$element.find(e).slideUp()},e.prototype.sendAnotherProposal=function(){var e=this;e.proposalStatus=null}}(),function(){"use strict";function e(e,a,o,s){var r=this;r.DialogaService=e,r.$log=s,r.init(),r.loadData(),r.$log.debug("SitemapPageController")}function a(e){for(var a={},o=e.length,s=0;o>s;s++){var r=e[s],t=r.categories[0],i=a[t.slug]||{};angular.isArray(i.programs)||(i=t,i.programs=[],a[i.slug]=i),i.programs.push(r)}return a}angular.module("dialoga").controller("SitemapPageController",e),e.$inject=["DialogaService","$state","$sce","$log"],e.prototype.init=function(){var e=this;e.programsPerThemes=null},e.prototype.loadData=function(){var e=this;e.DialogaService.getPrograms(function(o){e.programsPerThemes=a(o)},function(a){e.error=a,e.$log.error(a)})}}(),function(){"use strict";function e(e,a,o,s,r,t){var i=this;i.DialogaService=e,i.$scope=a,i.$location=o,i.$filter=s,i.$sce=r,i.$log=t,i.init(),i.loadData(),i.attachListeners(),i.$log.debug("InicioPageController")}function a(e){for(var a=[],o={},s=0;s0)){var p=l.pop();a.push(p),c=!0}c||(n=!1)}return a}function o(){var e=document.createElement("script");e.src="https://www.youtube.com/iframe_api";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}function s(){var e=angular.element.find(".js-iframe iframe"),a=window.YT.Player;new a(e[0],{events:{onReady:r}})}function r(e){e.target.playVideo(),t(1e3)}function t(e){var a=angular.element.find(".video-background");angular.element(a).fadeOut(e||100)}angular.module("dialoga").controller("InicioPageController",e),e.$inject=["DialogaService","$scope","$location","$filter","$sce","$log"],e.prototype.init=function(){var e=this;e.article=null,e.events=null,e.featuredEvent=null,e.themes=null,e.selectedTheme=null,e.programs=null,e.filtredPrograms=null,e.query=null,e.search=e.$location.search(),e.search.tema&&(e._filtredByThemeSlug=e.search.tema),e.search.filtro&&(e._filtredByQuery=e.search.filtro),(e.search.tema||e.search.filtro)&&(e.loadingFilter=!0),e.loading=null,e.error=null},e.prototype.loadData=function(){function e(){a.loadingThemes=!0,a.DialogaService.getThemes(function(e){a.themes=e,a.loadingThemes=!1,a.filter()},function(e){a.$log.error("Error on getThemes.",e),a.loadingThemes=!1,a.errorThemes=e}),a.loadingPrograms=!0,a.DialogaService.getProgramsRandom({},function(e){a.programs=a.article.children,a.filtredPrograms=e.articles,a.loadingPrograms=!1,a.filter()},function(e){a.$log.error("Error on getPrograms.",e),a.loadingPrograms=!1,a.errorPrograms=e})}var a=this;a.loading=!0,a.DialogaService.getHome(function(o){a.article=o.article,a.article.videoIsLoaded&&t(2e3),e(),a.loading=!1},function(e){a.$log.error("Error on getHome.",e),a.loading=!1,a.error=e}),a.loadingEvents=!0,a.DialogaService.getEvents({},function(e){a.events=e,a.loadingEvents=!1},function(e){a.$log.error("Error on getEvents.",e),a.loadingEvents=!1,a.eventsError=e})},e.prototype.attachListeners=function(){var e=this;e.$scope.$on("change-selectedCategory",function(a,o){e.selectedTheme=o}),e.$scope.$watch("pageInicio.selectedTheme",function(a){e.search.tema=a?a.slug:null,e.$location.search("tema",e.search.tema),e.loadingFilter||(e.filtredPrograms=e.getFiltredPrograms())}),e.$scope.$watch("pageInicio.query",function(a){e.search.filtro=a?a:null,e.$location.search("filtro",e.search.filtro),e.loadingFilter||(e.filtredPrograms=e.getFiltredPrograms())})},e.prototype.showVideo=function(){var e=this;return e.article.videoIsLoaded?(t(0),void e.$log.debug("The content already cached. Show-it!")):(o(),window.onYouTubeIframeAPIReady=window.onYouTubeIframeAPIReady||s,window.onYouTubePlayerReady=window.onYouTubePlayerReady||r,void(e.article.videoIsLoaded=!0))},e.prototype.filter=function(){var e=this;if(e.loadingThemes||e.loadingPrograms)return void e.$log.info("No programs or themes loaded yet. Abort.");if(e._filtredByThemeSlug){var a=e._filtredByThemeSlug;e.DialogaService.getThemeBySlug(a,function(a){e.selectedTheme=a},function(a){e.$log.error('Error when try to "getThemeBySlug"',a)})}e._filtredByQuery&&(e.query=e._filtredByQuery),(e._filtredByThemeSlug||e._filtredByQuery)&&(e.filtredPrograms=e.getFiltredPrograms(),e.loadingFilter=!1)},e.prototype.showAllPrograms=function(e){var a=this;e.stopPropagation(),a.resetFilterValues(),a.filtredPrograms=a.getFiltredPrograms()},e.prototype.resetFilterValues=function(){var e=this;e.query=null,e.selectedTheme=null},e.prototype.getFiltredPrograms=function(){var e=this;if(!e.programs)return e.$log.debug("No programs loaded yet. Abort."),null;var o=e.programs,s=o,r=e.query,t=e.selectedTheme,i=e.$filter("filter");return t&&(s=e._filterByCategory(s,t)),r&&(s=i(s,r,!1)),r||t||(s=a(s)),s},e.prototype._filterByCategory=function(e,a){var o=this;if(e=e||[],!a)return e;for(var s=[],r=0;r0&&(e.params=JSON.parse('{"'+decodeURI(a).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}'),e.hasRedirect=!0),e.currentUser=e.Session.getCurrentUser(),e.$scope.$on(e.AUTH_EVENTS.loginSuccess,function(){e.currentUser=e.Session.getCurrentUser()}),e.$scope.$on(e.AUTH_EVENTS.logoutSuccess,function(){e.currentUser=e.Session.getCurrentUser()})},e.prototype.loadData=function(){var e=this;e.loadingTerms=!0,e.DialogaService.getTerms(function(a){e.loadingTerms=!1,e.terms=a.article},function(a){e.loadingTerms=!1,e.error=a})},e.prototype.attachListeners=function(){var e=this;e.$scope.$on(e.AUTH_EVENTS.registerSuccess,function(a,o){e.$log.debug("TODO: handle register success"),e.$log.debug("[register success] response",o)}),e.$scope.$on(e.AUTH_EVENTS.registerFailed,function(a,o){e.$log.debug("TODO: handle register error"),e.$log.debug("[register error] response",o);var s=o.data.message;e.errorMessage=s}),e.$scope.$on("oauthClientPluginResult",function(a,o){e.$log.debug("response",o)});var a=null;a=e.$interval(function(){var o=angular.element("#serpro_captcha");o&&o.length>0&&(e.$window.initCaptcha(o[0]),e.$interval.cancel(a),a=void 0)},200)},e.prototype.onClickLogout=function(){var e=this;e.AuthService.logout()},e.prototype.submitSignup=function(e,a){var o=this,s=e.target,r=angular.element(s),t=r.find('[name="txtToken_captcha_serpro_gov_br"]');a.txtToken_captcha_serpro_gov_br=t.val(),o.AuthService.register(a).then(function(e){o.$log.debug("register success.response",e),o.messageTitle="Cadastro efetuado com sucesso!",o.successMessage="Verifique seu e-mail para confirmar o cadastro.",o.redirectBack()},function(e){o.$log.debug("register error.response",e);var a=e.data.message;o.errorMessage=a,500===e.data.code&&(o.internalError=!0)})},e.prototype.submitSignin=function(e){var a=this;a.AuthService.login(e).then(function(e){a.$log.debug("user",e),a.successMessage="Login efetuado com sucesso!",a.redirectBack()},function(){})},e.prototype.submitRecover=function(e,a){var o=this,s={login:a.login.$modelValue,captcha_text:a.captcha_text.$modelValue},r=e.target,t=angular.element(r),i=t.find('[name="txtToken_captcha_serpro_gov_br"]');s.txtToken_captcha_serpro_gov_br=i.val(),o.AuthService.forgotPassword(s).then(function(e){o.$log.debug("recover success.response",e),o.successRecoverMessageTitle="Pedido enviado sucesso!",o.successRecoverMessage="Verifique seu e-mail. Em instantes você receberá um e-mail com um link para redefinir sua senha."},function(e){o.$log.debug("recover error.response",e);var a=e.data.message;o.errorRecoverMessage=a,500===e.data.code&&(o.internalError=!0)})["catch"](function(e){o.$log.debug("recover catch.error",e)})},e.prototype.redirectBack=function(){var e=this;if(!e.hasRedirect)return void e.$log.debug("No redirect params defined.");e.countdown=e.delay;var a=null;a=e.$interval(function(){e.countdown--,e.countdown<=0&&(e.$interval.cancel(a),a=void 0)},1e3),e.$timeout(function(){var a=e.params.state;switch(a){case"inicio":e.$state.go(a,{event_id:e.params.event_id,task:e.params.task});break;case"programa":e.$state.go(a,{slug:e.params.slug,task:e.params.task,proposal_id:e.params.proposal_id});break;default:e.$log.debug("State not handled yet:",a)}},1e3*e.delay)},e.prototype.authWithFacebook=function(){var e=this,a="http://hom.login.dialoga.gov.br/plugin/oauth_client/facebook?oauth_client_popup=true&id="+e.APP.facebook_app_id;e.$window.oauthClientAction(a)},e.prototype.authWithGooglePlus=function(){var e=this,a="http://hom.login.dialoga.gov.br/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id="+e.APP.goople_app_id;e.$window.oauthClientAction(a)}}(),function(){"use strict";function e(e,a,o,s,r){var t=this;t.DialogaService=e,t.$rootScope=a,t.$state=o,t.$sce=s,t.$log=r,t.init(),t.loadData(),t.$rootScope.focusMainContent(),t.$log.debug("ArticlePageController")}angular.module("dialoga").controller("ArticlePageController",e),e.$inject=["DialogaService","$rootScope","$state","$sce","$log"],e.prototype.init=function(){var e=this;e.page=e.$state.current.name,e.article=null,e.loading=!0,e.$log.debug("vm.page",e.page)},e.prototype.loadData=function(){function e(e){o.loading=!1,o.article=e.article}function a(e){o.loading=!1,o.error=e}var o=this;switch(o.page){case"sobre":o.DialogaService.getAbout(e,a);break;case"termos-de-uso":o.DialogaService.getTerms(e,a);break;default:o.$log.debug("Page not handled:",o.page)}}}(),function(){"use strict";function e(){function e(e){e.debug("validationMessagesController");var a=this;a.$log=e,a.init()}e.$inject=["$log"],e.prototype.init=function(){var e=this;e.required||(e.required="Ops, o campo é obrigatório."),e.minlength||(e.minlength="O campo deve ser maior."),e.maxlength||(e.maxlength="O campo deve ser menor"),e.email||(e.email="O endereço de e-mail deve ser válido")};var a={restrict:"E",templateUrl:"app/components/validation-messages/validation-messages.html",scope:{field:"=",required:"=",minlength:"=",maxlength:"=",email:"="},controller:e,controllerAs:"vm",bindToController:!0};return a}angular.module("dialoga").directive("validationMessages",e)}(),function(){"use strict";function e(e,a,o){function s(a,o){return e.get(a,o).then(t)["catch"](i)}function r(a,o){return e.post(a,o).then(t)["catch"](i)}function t(e){return o.debug("[SUCCESS]",e),e.data._obj=e,e.data}function i(e){return o.debug("[ERROR]",e),o.error("XHR Failed on Service.\n"+angular.toJson(e.data,!0)),a.reject(angular.isObject(e.data)&&e.data.message?e.data:"An unknown error occurred.")}o.debug("UtilService");var l={get:s,post:r,handleSuccess:t,handleError:i};return l}angular.module("dialoga").factory("UtilService",e),e.$inject=["$http","$q","$log"]}(),function(){"use strict";function e(){function e(e,a){a.debug("TopicsSelectController");var o=this;o.$rootScope=e,o.$log=a,o.init()}e.$inject=["$rootScope","$log"],e.prototype.init=function(){},e.prototype.selectTopic=function(){var e=this;return null===e.selectedTopic?void e.$log.debug("Default topic selected."):void e.$rootScope.$broadcast("change-selectedTopic",e.selectedTopic)};var a={restrict:"E",templateUrl:"app/components/topics-select/topics-select.html",scope:{topics:"=",selectedTopic:"="},controller:e,controllerAs:"vm",bindToController:!0};return a}angular.module("dialoga").directive("topicsSelect",e)}(),function(){"use strict";function e(){function e(e,a,o,s,r){r.debug("TopicListController");var t=this;t.$scope=e,t.$element=a,t.$location=o,t.$filter=s,t.$log=r,t.defaultLimit=6,t.init()}e.$inject=["$scope","$element","$location","$filter","$log"],e.prototype.init=function(){var e=this;if(!e.article)return void e.$log.debug("no article to display. Tip: use a ng-if before use this directive");if(e.categories=e.article.categories,e.programs=e.article.children,e.orderCriteries=[{label:"Título",name:"titulo"},{label:"Tema",name:"tema"},{label:"Aleatório",name:"aleatorio"}],e.filtredProgramList=e.getFiltredPrograms(),e.search=e.$location.search(),e.query=e.search&&e.search.filtro?e.search.filtro:null,e.limitTo=e.search&&e.search.limite?parseInt(e.search.limite,10):e.defaultLimit,e.categoryFilter=e.search&&e.search.tema?e.getCategoryBySlug(e.search.tema):null,e.orderCriteria=e.search&&e.search.ordem?{name:e.search.ordem}:null,e.reverse=e.search&&e.search.reverso?!0:!1,!angular.equals({},e.search)){var a=e.$element;angular.element("body").animate({scrollTop:a.offset().top},"slow")}e.$scope.$watch("vm.query",function(a){e.search.filtro=a?a:null,e.$location.search("filtro",e.search.filtro),e.limitTo=e.search.filtro?e.programs.length:e.defaultLimit,e.filtredProgramList=e.getFiltredPrograms()}),e.$scope.$watch("vm.limitTo",function(a){e.search.limite=a&&a!==e.defaultLimit?a:null,e.$location.search("limite",e.search.limite),e.filtredProgramList=e.getFiltredPrograms()}),e.$scope.$watch("vm.categoryFilter",function(a){e.search.tema=a?a.slug:null,e.$location.search("tema",e.search.tema),e.search.tema&&(e.limitTo=e.programs.length),e.filtredProgramList=e.getFiltredPrograms()}),e.$scope.$watch("vm.orderCriteria",function(a){e.search.ordem=a&&a.name?a.name:null,e.$location.search("ordem",e.search.ordem),e.filtredProgramList=e.getFiltredPrograms()}),e.$scope.$watch("vm.reverse",function(a){e.search.reverso=a?a:null,e.$location.search("reverso",e.search.reverso),e.filtredProgramList=e.getFiltredPrograms()})},e.prototype.resetFilterValues=function(){var e=this;e.query=null,e.limitTo=e.defaultLimit,e.categoryFilter=null,e.orderCriteria=null},e.prototype.getIconClasses=function(e){var a=this;return a.$log.debug("[TODO] getIconClasses of category:",e),"glyphicon glyphicon-exclamation-sign"},e.prototype.getCategoryBySlug=function(e){var a=this,o=null;return angular.forEach(a.categories,function(a){a.slug===e&&(o=a)}),o},e.prototype.filterByCategory=function(e,a){var o=this;a.stopPropagation(),o.categoryFilter=e!==o.categoryFilter?e:null},e.prototype.showAll=function(e){var a=this;e.stopPropagation(),a.resetFilterValues(),a.limitTo=a.programs.length},e.prototype.getFiltredPrograms=function(){var e=this,o=e.programs,s=o,r=e.query,t=e.categoryFilter,i=e.orderCriteria?e.orderCriteria:{name:"aleatorio"},l=e.$filter("filter"),n=e.$filter("orderBy"),c=e.$filter("limitTo"),p=e.limitTo?e.limitTo:4;switch(t&&(s=a(s,t)),r&&(s=l(s,r,!1)),i.name){case"titulo":s=n(s,"title",e.reverse);break;case"tema":s=n(s,"categories[0].name",e.reverse);break;case"more_participants":e.$log.info("Criteria not handled yet: ",i);break;case"aleatorio":s=e.filterShuffle(s),e.reverse&&(s=s.slice().reverse());break;default:e.$log.warn("Criteria not matched: ",i)}return s=c(s,p)},e.prototype.filterShuffle=function(e){for(var a=[],s={},r=0;r0)){var d=n.pop();a.push(d),p=!0}p||(c=!1)}return a};var s={restrict:"E",templateUrl:"app/components/programas/programas.html",scope:{article:"="},controller:e,controllerAs:"vm",bindToController:!0};return s}function a(e,a){if(e=e||[],!a)return e;for(var o=[],s=0;sÉ calculada pelo saldo de interações das propostas (curtidas - não curtidas) dividido pela diferença de exibições entre elas.

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.

" +})}e.$inject=["$state","$element","$timeout","$log"],e.prototype.init=function(){var e=this;if(!e.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};e.$timeout(function(){a.call(e)},1e3)},e.prototype.showContent=function(e){var a=this;a.$state.go("programa",{slug:e.parent.slug,proposal_id:e.id},{location:!0,reload:!0})};var o={restrict:"E",templateUrl:"app/components/proposal-list/proposal-list.html",scope:{proposals:"="},controller:e,controllerAs:"vm",bindToController:!0};return o}angular.module("dialoga").directive("proposalList",e)}(),function(){"use strict";function e(){function e(e,a,o,s,r,t){t.debug("ProposalGridController");var i=this;i.$scope=e,i.$rootScope=a,i.$element=o,i.$location=s,i.$filter=r,i.$log=t,i.init(),i.attachListeners()}e.$inject=["$scope","$rootScope","$element","$location","$filter","$log"],e.prototype.init=function(){},e.prototype.attachListeners=function(){};var a={restrict:"E",templateUrl:"app/components/proposal-grid/proposal-grid.html",scope:{proposals:"="},controller:e,controllerAs:"vm",bindToController:!0};return a}angular.module("dialoga").directive("proposalGrid",e)}(),function(){"use strict";function e(){function e(e,a,o,s,r){r.debug("ProposalCarouselController");var t=this;t.$scope=e,t.$state=a,t.$element=o,t.$timeout=s,t.$log=r,t.init()}e.$inject=["$scope","$state","$element","$timeout","$log"],e.prototype.init=function(){var e=this;if(!e.proposals)throw{name:"NotDefined",message:'The attribute "proposals" is undefined.'};e.activeIndex=0,e.loading=!1,e.proposalsLength=e.proposals.length},e.prototype.swipeLeft=function(){var e=this;e.activeIndex=e.activeIndex0?--e.activeIndex:e.proposalsLength-1},e.prototype.switchProposal=function(e){var a=this;e>=0&&e=0;s--){var r=_.themes[s];if(r&&r.slug&&r.slug===e){o=r;break}}a(o)}_.themes?s(_.themes):p(s,o)}function g(e,a){_.programs?e(_.programs):l(function(){if(!_.hasOwnProperty("programs"))throw{name:"NotFound",message:'"programs" is not defined. "article.children" was handled?'};e(_.programs)},a)}function u(e,a,o){function s(){var o=_.programs.filter(function(a){return angular.equals(a.slug,e)?!0:!1});a(o[0])}_.programs?s():g(s,o)}function v(e,a,o){function s(){var o=_.programs.filter(function(a){var o=a.categories[0];return o&&angular.equals(o.id,e)?!0:!1});a(o)}_.programs?s():g(s,o)}function m(e,a,s){if(_.programsRandom)a(_.programsRandom);else{var t=!!_.programs,i=k.serviceDialoga+"random_topics/"+o.articleId.home,l=null;l=t?["id","title","slug"]:[];var n=angular.extend({"fields[]":l},e);r.get(i,{params:n}).then(function(e){x(t,e,a)})["catch"](function(e){s(e)})}}function h(e,a,r){var t=angular.extend({},e);s.getEvents(o.communityId,t,a,r)}function f(e){if(_.questions)e(_.questions);else{var a=[];_.questions=a,e(_.questions)}}function b(e,a,o){s.searchTopics({query:e},a,o)}function y(e,a,o){s.searchProposals(e,a,o)}function P(e){var o=e.article["abstract"];o=A(o),o=C(o),e.article["abstract"]=o,e.article.abstractTrusted=a.trustAsHtml(o)}function $(e){e.article.slug||(e.article.slug=t.slugify(e.article.title));for(var a=e.article.children.length-1;a>=0;a--){var o=e.article.children[a];o.slug||(o.slug=t.slugify(o.title))}}function w(e){_.hasOwnProperty("themes")||(_.themes=e.article.categories),T(e)}function S(e){_.hasOwnProperty("programs")||(_.programs=e.article.children,_.programs_count=e.article.children_count)}function T(e){e.article.categories}function x(e,a,o){if(e){for(var s=[],r=a.articles,t=_.programs.length-1;t>=0;t--)for(var i=_.programs[t],l=r.length-1;l>=0;l--){var n=r[l];n.id===i.id&&s.push(i)}a.articles=s}o(a)}function A(e){var a='