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,7 +4,7 @@ var gulp = require('gulp'); | ||
4 | // var sass = require('gulp-sass'); | 4 | // var sass = require('gulp-sass'); |
5 | var sass = require('gulp-ruby-sass'); | 5 | var sass = require('gulp-ruby-sass'); |
6 | var connect = require('gulp-connect'); | 6 | var connect = require('gulp-connect'); |
7 | - | 7 | + |
8 | // gulp.task('sass', function () { | 8 | // gulp.task('sass', function () { |
9 | // gulp.src('./sass/**/*.scss') | 9 | // gulp.src('./sass/**/*.scss') |
10 | // .pipe(sass().on('error', sass.logError)) | 10 | // .pipe(sass().on('error', sass.logError)) |
@@ -20,16 +20,17 @@ gulp.task('sass', function() { | @@ -20,16 +20,17 @@ gulp.task('sass', function() { | ||
20 | .pipe(gulp.dest('.')) | 20 | .pipe(gulp.dest('.')) |
21 | .pipe(connect.reload()); | 21 | .pipe(connect.reload()); |
22 | }); | 22 | }); |
23 | - | 23 | + |
24 | gulp.task('watch', function () { | 24 | gulp.task('watch', function () { |
25 | gulp.watch('./sass/**/*.sass', ['sass']); | 25 | gulp.watch('./sass/**/*.sass', ['sass']); |
26 | }); | 26 | }); |
27 | 27 | ||
28 | gulp.task('connect', function() { | 28 | gulp.task('connect', function() { |
29 | connect.server({ | 29 | connect.server({ |
30 | + port: 8080, | ||
30 | root: [__dirname], | 31 | root: [__dirname], |
31 | livereload: true | 32 | livereload: true |
32 | }); | 33 | }); |
33 | }); | 34 | }); |
34 | 35 | ||
35 | -gulp.task('default', ['sass','connect','watch']); | ||
36 | \ No newline at end of file | 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,6 +23,7 @@ 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'; | ||
26 | var dialoga_community = 19195; | 27 | var dialoga_community = 19195; |
27 | var proposal_discussion = '103358'; //participa | 28 | var proposal_discussion = '103358'; //participa |
28 | var cat_saude = 180; | 29 | var cat_saude = 180; |
@@ -31,18 +32,45 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -31,18 +32,45 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
31 | // var cat_reducao_da_pobreza = 183; | 32 | // var cat_reducao_da_pobreza = 183; |
32 | var recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i'; | 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 | //Detects for localhost settings | 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 | if(patt.test(window.location.href)){ | 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 | var BARRA_ADDED = false; | 74 | var BARRA_ADDED = false; |
47 | var HIDE_BARRA_DO_GOVERNO = false; | 75 | var HIDE_BARRA_DO_GOVERNO = false; |
48 | 76 | ||
@@ -1302,8 +1330,10 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1302,8 +1330,10 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
1302 | var oCaptcha_serpro_gov_br; | 1330 | var oCaptcha_serpro_gov_br; |
1303 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); | 1331 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); |
1304 | window.lastCaptcha = oCaptcha_serpro_gov_br; | 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 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); | 1337 | oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'serpro_captcha_component_'); |
1308 | 1338 | ||
1309 | e.preventDefault(); | 1339 | e.preventDefault(); |