mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Removed flash, renamed file, unbroken logout / login request notifications
Closes #354 * Reintroduced the redirect functionality (not logged in, tries to go to `/settings/user/`, is sent to `/login/` with info notification, after login user is taken to `/settings/user/) * Reintroduced the "Successfully logged out" message * Added middleware to scrub passive notifications from `ghost.notifications` after one use basically mimicing client side passive notifications * Removed flash from everywhere. Even from package.json. * Renamed flashed.hbs to notifications.hbs, modified default.hbs accordingly * Added function to parse GET variables on client side
This commit is contained in:
parent
d39d43bc47
commit
2f6098d653
@ -99,8 +99,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// Getting URL vars
|
||||||
|
getUrlVariables: function () {
|
||||||
|
var vars = [],
|
||||||
|
hash,
|
||||||
|
hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'),
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < hashes.length; i += 1) {
|
||||||
|
hash = hashes[i].split('=');
|
||||||
|
vars.push(hash[0]);
|
||||||
|
vars[hash[0]] = hash[1];
|
||||||
|
}
|
||||||
|
return vars;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,14 +45,16 @@
|
|||||||
submitHandler: function (event) {
|
submitHandler: function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var email = this.$el.find('.email').val(),
|
var email = this.$el.find('.email').val(),
|
||||||
password = this.$el.find('.password').val();
|
password = this.$el.find('.password').val(),
|
||||||
|
redirect = this.getUrlVariables().r;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/ghost/login/',
|
url: '/ghost/login/',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
email: email,
|
email: email,
|
||||||
password: password
|
password: password,
|
||||||
|
redirect: redirect
|
||||||
},
|
},
|
||||||
success: function (msg) {
|
success: function (msg) {
|
||||||
window.location.href = msg.redirect;
|
window.location.href = msg.redirect;
|
||||||
|
Loading…
Reference in New Issue
Block a user