Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/client/jade/login.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ html.login
link(rel='stylesheet', href='/bower_components/octicons/octicons/octicons.css')
script(type='text/javascript', src='/dist/animatedSVG/js/snap.svg-min.js')
script(type='text/javascript', src='/dist/animatedSVG/js/svgicons.js')
script(type='text/javascript', src='/dist/js/translatron-login.js')

body.login
main
Expand All @@ -20,4 +21,6 @@ html.login

input.inputField(type='password', name='password', placeholder="Enter password")

input.inputField(canny-mod="loginAnchor")

button.button.octicon.octicon-sign-in(type='submit') let me in
2 changes: 2 additions & 0 deletions lib/client/js/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var canny = require('canny');
canny.add('loginAnchor', require('./uiModules/loginAnchor.js'));
22 changes: 22 additions & 0 deletions lib/client/js/uiModules/loginAnchor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var loginAnchor = (function () {
"use strict";

return {
add: function (node) {

var location = document.location.href,
anchor = '';

if (location.indexOf('#') > -1) {
anchor = '#' + location.split('#').pop();
}

node.setAttribute('type', 'hidden');
node.setAttribute('name', 'from');
node.setAttribute('value', anchor);
}
};

}());

module.exports = loginAnchor;
4 changes: 2 additions & 2 deletions lib/client/less/menuRight.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
overflow: hidden;

&.c-inView{
// border-right: 1px solid #333;
box-shadow: 3px 0 #666;
border-right: 3px solid #666;

ul li{
height: 1.1em;
Expand Down Expand Up @@ -80,6 +79,7 @@
margin-left: 0;
box-sizing: content-box;
> li {
border-right: 3px solid transparent;
padding-top:.3em;
}
}
Expand Down
5 changes: 5 additions & 0 deletions lib/server/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ module.exports = function (app) {
}),
function(req, res) {
var backURL = req.header('Referer') || '/';

if (req.body.from && req.body.from.length > 0) {
backURL += req.body.from;
}

res.redirect(backURL);
}
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"scripts": {
"postinstall": "bower install",
"test": "jasmine && karma start karma.conf.js",
"prestart": "browserify --debug lib/client/js/main.js -o dist/js/translatron.js && lessc lib/client/less/main.less dist/css/translatron.css",
"prestart": "browserify --debug lib/client/js/main.js -o dist/js/translatron.js && browserify --debug lib/client/js/login.js -o dist/js/translatron-login.js && lessc lib/client/less/main.less dist/css/translatron.css",
"start": "node app.js"
},
"devDependencies": {
Expand Down