Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
A. Vatsaev committed Oct 20, 2016
1 parent d52c20c commit 8330ac6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions dist/assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ body.addEventListener('submit', function (ev){
button.disabled = true
button.className = ''
button.innerHTML = 'Please Wait'
invite(channel ? channel.value : null, coc && coc.checked ? 1 : 0, email.value, function (err, msg){
var gcaptcha_response = form.elements['g-recaptcha-response']
invite(channel ? channel.value : null, coc && coc.checked ? 1 : 0, email.value, gcaptcha_response.value, function (err, msg){
if (err) {
button.removeAttribute('disabled')
button.className = 'error'
Expand All @@ -31,10 +32,11 @@ body.addEventListener('submit', function (ev){
})
})

function invite (channel, coc, email, fn){
function invite (channel, coc, email, gcaptcha_response_value, fn){
request
.post(data.path + 'invite')
.send({
"g-recaptcha-response": gcaptcha_response_value,
coc: coc,
channel: channel,
email: email
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function slackin(_ref) {
}

var email = req.body.email;
var captcha_response = req.body.captcha_response;
var captcha_response = req.body['g-recaptcha-response'];

if (!email) {
return res.status(400).json({ msg: 'No email provided' });
Expand Down
4 changes: 2 additions & 2 deletions dist/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function log(slack, silent) {

slack.on('ready', function () {
if (!slack.org.logo && !silent) {
console.warn('\u001b[92mWARN: no logo configured\u001b[39m');
console.warn('\x1B[92mWARN: no logo configured\x1B[39m');
}
});
}
Expand All @@ -60,7 +60,7 @@ function log(slack, silent) {
}

if (args) {
args[0] = new Date() + ' ' + args[0];
args[0] = new Date() + ' \u2013 ' + args[0];
}

if (silent) return debug.apply(undefined, args);
Expand Down
2 changes: 1 addition & 1 deletion dist/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function splash(_ref) {
var pink = '#E01563';

function style() {
var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

var logo = _ref2.logo;
var active = _ref2.active;
Expand Down
2 changes: 1 addition & 1 deletion lib/assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var request = superagent
// elements
var form = body.querySelector('form#invite')
var channel = form.elements['channel'] || {}
var gcaptcha_response = form.elements['g-recaptcha-response']
var email = form.elements['email']
var coc = form.elements['coc']
var button = body.querySelector('button')
Expand All @@ -20,6 +19,7 @@ body.addEventListener('submit', function (ev){
button.disabled = true
button.className = ''
button.innerHTML = 'Please Wait'
var gcaptcha_response = form.elements['g-recaptcha-response']
invite(channel ? channel.value : null, coc && coc.checked ? 1 : 0, email.value, gcaptcha_response.value, function (err, msg){
if (err) {
button.removeAttribute('disabled')
Expand Down

0 comments on commit 8330ac6

Please sign in to comment.