From 16577d70660b47a62ca7c5f106c47eb9d0fc7731 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 25 May 2014 13:32:21 +0200 Subject: [PATCH] removed trailing spaces --- README.md | 2 +- lib/captcha.js | 2 +- package.json | 2 +- routes/user.js | 34 +++++++++++++++++----------------- views/home.jade | 2 +- views/layout.jade | 6 +++--- views/login.jade | 2 +- views/user.jade | 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 47c6552..b585595 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You also need `UglifyJS` installed globally: ### Install binb Once you have redis server up and running type: - + $ make install Then run `$ npm start` or `$ node app.js` to start the app. diff --git a/lib/captcha.js b/lib/captcha.js index 4b33747..01d93ab 100644 --- a/lib/captcha.js +++ b/lib/captcha.js @@ -23,7 +23,7 @@ Captcha.prototype.initialize = function() { while (this.code.length < 4) { this.code += characters[Math.floor(Math.random() * characters.length)]; } - + var ctx = this.canvas.getContext('2d'); ctx.fillStyle = '#DDDDDD'; diff --git a/package.json b/package.json index 93543da..d6e35d2 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,5 @@ "start": "node app.js" }, "subdomain": "binb", - "version": "0.4.8-4" + "version": "0.4.8-5" } diff --git a/routes/user.js b/routes/user.js index c7c033a..c9c5e9a 100644 --- a/routes/user.js +++ b/routes/user.js @@ -69,13 +69,13 @@ exports.sliceLeaderboard = function(req, res, next) { /** * Change password middlewares. */ - + exports.validateChangePasswd = function(req, res, next) { if (!req.session.user || req.body.oldpassword === undefined || req.body.newpassword === undefined) { return res.send(400); } - + var errors = {}; if (req.body.oldpassword.trim() === '') { @@ -90,12 +90,12 @@ exports.validateChangePasswd = function(req, res, next) { else if(req.body.newpassword === req.body.oldpassword) { errors.newpassword = "can't be changed to the old one"; } - + if (errors.oldpassword || errors.newpassword) { req.session.errors = errors; return res.redirect(req.url); } - + next(); }; @@ -156,7 +156,7 @@ exports.validateLogin = function(req, res, next) { if (req.body.password.trim() === '') { errors.password = "can't be empty"; } - + req.session.oldvalues = {username: req.body.username}; if (errors.username || errors.password) { req.session.errors = errors; @@ -246,18 +246,18 @@ exports.validateSignUp = function(req, res, next) { if (req.body.captcha !== req.session.captchacode) { errors.captcha = 'no match'; } - + // Save old values to repopulate the fields in case of future errors req.session.oldvalues = { username: req.body.username, email: req.body.email }; - + if (errors.username || errors.email || errors.password || errors.captcha) { req.session.errors = errors; return res.redirect(req.url); } - + next(); }; @@ -326,28 +326,28 @@ exports.createAccount = function(req, res, next) { /** * Recover password middlewares. */ - + exports.validateRecoverPasswd = function(req, res, next) { if (req.body.email === undefined || req.body.captcha === undefined) { return res.send(400); } var errors = {}; - + if (!utils.isEmail(req.body.email)) { errors.email = 'is not an email address'; } if (req.body.captcha !== req.session.captchacode) { errors.captcha = 'no match'; } - + req.session.oldvalues = {email: req.body.email}; - + if (errors.email || errors.captcha) { req.session.errors = errors; return res.redirect(req.url); } - + next(); }; @@ -393,9 +393,9 @@ exports.resetPasswd = function(req, res, next) { if (req.body.password === undefined) { return res.send(400); } - + var errors = {}; - + // Validate new password if (req.body.password.trim() === '') { errors.password = "can't be empty"; @@ -407,12 +407,12 @@ exports.resetPasswd = function(req, res, next) { if (!req.query.token) { errors.alert = 'Missing token.'; } - + if (errors.password || errors.alert) { req.session.errors = errors; return res.redirect(req.url); } - + var key = 'token:' + req.query.token; db.get([key], function(err, user) { if (err) { diff --git a/views/home.jade b/views/home.jade index 9d77d6f..cf889d8 100644 --- a/views/home.jade +++ b/views/home.jade @@ -55,6 +55,6 @@ block sections span(id=item) | Players -append scripts +append scripts script(src="/static/js/primus.min.js") script(src="/static/js/home.min.js") diff --git a/views/layout.jade b/views/layout.jade index a4db376..1eacdc0 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -37,11 +37,11 @@ html footer #footer-inner #copy © 2012-2014 Luigi Pinca - iframe#facebook-button(allowTransparency="true", frameborder="0", scrolling="no", + iframe#facebook-button(allowTransparency="true", frameborder="0", scrolling="no", src!="//www.facebook.com/plugins/like.php?action=like&colorscheme=light&href=http%3A%2F%2Fbinb.nodejitsu.com&layout=button_count&locale=en_US&share=true&show_faces=false") iframe#twitter-button(allowtransparency="true", frameborder="0", scrolling="no", src="//platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fbinb.nodejitsu.com") - iframe#github-button(allowtransparency="true", frameborder="0", scrolling="0", + iframe#github-button(allowtransparency="true", frameborder="0", scrolling="0", src="http://ghbtns.com/github-btn.html?user=lpinca&repo=binb&type=watch&count=true") span.footer-info . Optimized for Google Chrome. a#nodejitsu-logo.icons(target="_blank", href="http://nodejitsu.com/") @@ -55,7 +55,7 @@ html (function() { var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true; - uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + + uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/LSMjFAQRifhD6BjOG2KWw.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s); diff --git a/views/login.jade b/views/login.jade index dfe1d12..39e7ef1 100644 --- a/views/login.jade +++ b/views/login.jade @@ -2,7 +2,7 @@ extends layout block title title binb :: login - + block nav ul.nav.pull-right li diff --git a/views/user.jade b/views/user.jade index 2fabd83..5bee7f0 100644 --- a/views/user.jade +++ b/views/user.jade @@ -2,7 +2,7 @@ extends layout block title title binb :: #{username} info - + block brand a.brand(href="#") .icons.logo #{slogan} -- 2.54.0