Commit f4b205d695fc497d909c8533b291961774f1f456
Exists in
master
and in
5 other branches
Merge branch 'master' of gitlab.com:participa/proposal-app
Showing
1 changed file
with
30 additions
and
9 deletions
Show diff stats
js/main.js
| ... | ... | @@ -23,6 +23,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 23 | 23 | var lastHash = window.location.hash; |
| 24 | 24 | |
| 25 | 25 | var host = 'http://login.dialoga.gov.br'; |
| 26 | + var serpro_captcha_clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | |
| 26 | 27 | var dialoga_community = 19195; |
| 27 | 28 | var proposal_discussion = '103358'; //participa |
| 28 | 29 | var cat_saude = 180; |
| ... | ... | @@ -31,16 +32,35 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 31 | 32 | // var cat_reducao_da_pobreza = 183; |
| 32 | 33 | var recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i'; |
| 33 | 34 | |
| 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 | |
| 34 | 47 | |
| 35 | 48 | //Detects for localhost settings |
| 36 | - var patt = new RegExp(':3001/'); | |
| 49 | + var patt = new RegExp(':300[0-1]/'); | |
| 50 | + var localDevelopment = false; | |
| 37 | 51 | if(patt.test(window.location.href)){ |
| 38 | - host = 'http://noosfero.com:3001'; | |
| 39 | - dialoga_community = 104; | |
| 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; | |
| 40 | 59 | // proposal_discussion = '413'; //Eugênio |
| 41 | - proposal_discussion = '392'; //Evandro | |
| 42 | - recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | |
| 43 | - cat_saude = 23; | |
| 60 | + proposal_discussion = '392'; //Evandro | |
| 61 | + recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | |
| 62 | + cat_saude = 23; | |
| 63 | + } | |
| 44 | 64 | } |
| 45 | 65 | |
| 46 | 66 | var BARRA_ADDED = false; |
| ... | ... | @@ -52,7 +72,6 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 52 | 72 | var API = { |
| 53 | 73 | articles: '', |
| 54 | 74 | proposals: '/api/v1/articles/{topic_id}/children', |
| 55 | - | |
| 56 | 75 | }; |
| 57 | 76 | |
| 58 | 77 | API.getProposalsURL = function (topicId){ |
| ... | ... | @@ -1302,8 +1321,10 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 1302 | 1321 | var oCaptcha_serpro_gov_br; |
| 1303 | 1322 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); |
| 1304 | 1323 | window.lastCaptcha = oCaptcha_serpro_gov_br; |
| 1305 | - oCaptcha_serpro_gov_br.clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | |
| 1306 | - oCaptcha_serpro_gov_br.url = "/captchaserpro" | |
| 1324 | + oCaptcha_serpro_gov_br.clienteId = serpro_captcha_clienteId; | |
| 1325 | + if(!localDevelopment) { | |
| 1326 | + oCaptcha_serpro_gov_br.url = "/captchaserpro" | |
| 1327 | + } | |
| 1307 | 1328 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); |
| 1308 | 1329 | |
| 1309 | 1330 | e.preventDefault(); | ... | ... |