Commit 1f86d5eea1674b5598289dcef18a78c2aa96129e
1 parent
f4b205d6
Exists in
master
and in
5 other branches
setting private token initially to null
Showing
1 changed file
with
10 additions
and
31 deletions
Show diff stats
js/main.js
| @@ -23,7 +23,6 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -23,7 +23,6 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 23 | var lastHash = window.location.hash; | 23 | var lastHash = window.location.hash; |
| 24 | 24 | ||
| 25 | var host = 'http://login.dialoga.gov.br'; | 25 | var host = 'http://login.dialoga.gov.br'; |
| 26 | - var serpro_captcha_clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | ||
| 27 | var dialoga_community = 19195; | 26 | var dialoga_community = 19195; |
| 28 | var proposal_discussion = '103358'; //participa | 27 | var proposal_discussion = '103358'; //participa |
| 29 | var cat_saude = 180; | 28 | var cat_saude = 180; |
| @@ -32,35 +31,16 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -32,35 +31,16 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 32 | // var cat_reducao_da_pobreza = 183; | 31 | // var cat_reducao_da_pobreza = 183; |
| 33 | var recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i'; | 32 | var recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i'; |
| 34 | 33 | ||
| 35 | - // There are two modes for development | ||
| 36 | - // 1: Remote API | ||
| 37 | - // 2: Local API | ||
| 38 | - // For (1) use port 3000 -> rails s | ||
| 39 | - // For (2) use port 3001 -> rails s -p 3001 | ||
| 40 | - // | ||
| 41 | - // For (2) set at /etc/hosts: | ||
| 42 | - // | ||
| 43 | - //127.0.0.1 participa.br | ||
| 44 | - //127.0.0.1 dialoga.gov.br | ||
| 45 | - //127.0.0.1 login.dialoga.gov.br | ||
| 46 | - //127.0.0.1 noosfero.com | ||
| 47 | 34 | ||
| 48 | //Detects for localhost settings | 35 | //Detects for localhost settings |
| 49 | - var patt = new RegExp(':300[0-1]/'); | ||
| 50 | - var localDevelopment = false; | 36 | + var patt = new RegExp(':3001/'); |
| 51 | if(patt.test(window.location.href)){ | 37 | if(patt.test(window.location.href)){ |
| 52 | - localDevelopment = true; | ||
| 53 | - patt = new RegExp(':3000/'); | ||
| 54 | - if(patt.test(window.location.href)){ | ||
| 55 | - host = 'http://noosfero.com:3000'; | ||
| 56 | - }else{ | ||
| 57 | - host = 'http://noosfero.com:3001'; | ||
| 58 | - dialoga_community = 104; | 38 | + host = 'http://noosfero.com:3001'; |
| 39 | + dialoga_community = 104; | ||
| 59 | // proposal_discussion = '413'; //Eugênio | 40 | // proposal_discussion = '413'; //Eugênio |
| 60 | - proposal_discussion = '392'; //Evandro | ||
| 61 | - recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | ||
| 62 | - cat_saude = 23; | ||
| 63 | - } | 41 | + proposal_discussion = '392'; //Evandro |
| 42 | + recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | ||
| 43 | + cat_saude = 23; | ||
| 64 | } | 44 | } |
| 65 | 45 | ||
| 66 | var BARRA_ADDED = false; | 46 | var BARRA_ADDED = false; |
| @@ -72,6 +52,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -72,6 +52,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 72 | var API = { | 52 | var API = { |
| 73 | articles: '', | 53 | articles: '', |
| 74 | proposals: '/api/v1/articles/{topic_id}/children', | 54 | proposals: '/api/v1/articles/{topic_id}/children', |
| 55 | + | ||
| 75 | }; | 56 | }; |
| 76 | 57 | ||
| 77 | API.getProposalsURL = function (topicId){ | 58 | API.getProposalsURL = function (topicId){ |
| @@ -94,7 +75,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -94,7 +75,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 94 | }; | 75 | }; |
| 95 | 76 | ||
| 96 | return { | 77 | return { |
| 97 | - /*private_token: '375bee7e17d0021af7160ce664874618',*/ | 78 | + private_token: null, |
| 98 | getProposalId: function() { | 79 | getProposalId: function() { |
| 99 | var regexProposals = /\d.*\/propostas\/*.*/; | 80 | var regexProposals = /\d.*\/propostas\/*.*/; |
| 100 | var proposalId = 0; | 81 | var proposalId = 0; |
| @@ -1321,10 +1302,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1321,10 +1302,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
| 1321 | var oCaptcha_serpro_gov_br; | 1302 | var oCaptcha_serpro_gov_br; |
| 1322 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); | 1303 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); |
| 1323 | window.lastCaptcha = oCaptcha_serpro_gov_br; | 1304 | window.lastCaptcha = oCaptcha_serpro_gov_br; |
| 1324 | - oCaptcha_serpro_gov_br.clienteId = serpro_captcha_clienteId; | ||
| 1325 | - if(!localDevelopment) { | ||
| 1326 | - oCaptcha_serpro_gov_br.url = "/captchaserpro" | ||
| 1327 | - } | 1305 | + oCaptcha_serpro_gov_br.clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; |
| 1306 | + oCaptcha_serpro_gov_br.url = "/captchaserpro" | ||
| 1328 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); | 1307 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); |
| 1329 | 1308 | ||
| 1330 | e.preventDefault(); | 1309 | e.preventDefault(); |