Commit e140c729540546b2fa6da536625fa44b1305645b
1 parent
1f86d5ee
Exists in
master
and in
5 other branches
changes to add 8080 port
Showing
2 changed files
with
44 additions
and
13 deletions
Show diff stats
gulpfile.js
| ... | ... | @@ -4,7 +4,7 @@ var gulp = require('gulp'); |
| 4 | 4 | // var sass = require('gulp-sass'); |
| 5 | 5 | var sass = require('gulp-ruby-sass'); |
| 6 | 6 | var connect = require('gulp-connect'); |
| 7 | - | |
| 7 | + | |
| 8 | 8 | // gulp.task('sass', function () { |
| 9 | 9 | // gulp.src('./sass/**/*.scss') |
| 10 | 10 | // .pipe(sass().on('error', sass.logError)) |
| ... | ... | @@ -20,16 +20,17 @@ gulp.task('sass', function() { |
| 20 | 20 | .pipe(gulp.dest('.')) |
| 21 | 21 | .pipe(connect.reload()); |
| 22 | 22 | }); |
| 23 | - | |
| 23 | + | |
| 24 | 24 | gulp.task('watch', function () { |
| 25 | 25 | gulp.watch('./sass/**/*.sass', ['sass']); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | 28 | gulp.task('connect', function() { |
| 29 | 29 | connect.server({ |
| 30 | + port: 8080, | |
| 30 | 31 | root: [__dirname], |
| 31 | 32 | livereload: true |
| 32 | 33 | }); |
| 33 | 34 | }); |
| 34 | 35 | |
| 35 | -gulp.task('default', ['sass','connect','watch']); | |
| 36 | 36 | \ No newline at end of file |
| 37 | +gulp.task('default', ['sass','connect','watch']); | ... | ... |
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,18 +32,45 @@ 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 | |
| 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 | |
| 35 | 47 | //Detects for localhost settings |
| 36 | - var patt = new RegExp(':3001/'); | |
| 48 | + var patt = new RegExp(':300[0-1]/|8080/'); | |
| 49 | + var localDevelopment = false; | |
| 50 | + | |
| 37 | 51 | if(patt.test(window.location.href)){ |
| 38 | - host = 'http://noosfero.com:3001'; | |
| 39 | - dialoga_community = 104; | |
| 40 | -// proposal_discussion = '413'; //Eugênio | |
| 41 | - proposal_discussion = '392'; //Evandro | |
| 42 | - recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | |
| 43 | - cat_saude = 23; | |
| 52 | + localDevelopment = true; | |
| 53 | + patt = new RegExp(':3000/'); | |
| 54 | + | |
| 55 | + if(patt.test(window.location.href)){ | |
| 56 | + host = 'http://noosfero.com:3000'; | |
| 57 | + }else if (new RegExp(':3001/').test(window.location.href)){ | |
| 58 | + host = 'http://noosfero.com:3001'; | |
| 59 | + dialoga_community = 104; | |
| 60 | + // proposal_discussion = '413'; //Eugênio | |
| 61 | + proposal_discussion = '392'; //Evandro | |
| 62 | + recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | |
| 63 | + cat_saude = 23; | |
| 64 | + } else { //ABNER | |
| 65 | + host = 'http://noosfero.com:3000'; | |
| 66 | + dialoga_community = 105; | |
| 67 | + proposal_discussion = '392'; //Evandro | |
| 68 | + recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | |
| 69 | + cat_saude = 23; | |
| 70 | + } | |
| 44 | 71 | } |
| 45 | 72 | |
| 73 | + | |
| 46 | 74 | var BARRA_ADDED = false; |
| 47 | 75 | var HIDE_BARRA_DO_GOVERNO = false; |
| 48 | 76 | |
| ... | ... | @@ -1302,8 +1330,10 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 1302 | 1330 | var oCaptcha_serpro_gov_br; |
| 1303 | 1331 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); |
| 1304 | 1332 | window.lastCaptcha = oCaptcha_serpro_gov_br; |
| 1305 | - oCaptcha_serpro_gov_br.clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | |
| 1306 | - oCaptcha_serpro_gov_br.url = "/captchaserpro" | |
| 1333 | + oCaptcha_serpro_gov_br.clienteId = serpro_captcha_clienteId; | |
| 1334 | + if(!localDevelopment) { | |
| 1335 | + oCaptcha_serpro_gov_br.url = "/captchaserpro" | |
| 1336 | + } | |
| 1307 | 1337 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); |
| 1308 | 1338 | |
| 1309 | 1339 | e.preventDefault(); | ... | ... |