mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Switched to spaces
This commit is contained in:
@ -2,38 +2,38 @@ var App = App || {};
|
||||
App.Presenters = App.Presenters || {};
|
||||
|
||||
App.Presenters.LogoutPresenter = function(
|
||||
jQuery,
|
||||
promise,
|
||||
router,
|
||||
auth,
|
||||
topNavigationPresenter,
|
||||
messagePresenter) {
|
||||
jQuery,
|
||||
promise,
|
||||
router,
|
||||
auth,
|
||||
topNavigationPresenter,
|
||||
messagePresenter) {
|
||||
|
||||
var $messages = jQuery('#content');
|
||||
var $messages = jQuery('#content');
|
||||
|
||||
function init(params, loaded) {
|
||||
topNavigationPresenter.select('logout');
|
||||
topNavigationPresenter.changeTitle('Logout');
|
||||
promise.wait(auth.logout())
|
||||
.then(function() {
|
||||
loaded();
|
||||
$messages.empty();
|
||||
var $messageDiv = messagePresenter.showInfo($messages, 'Logged out. <a href="">Back to main page</a>');
|
||||
$messageDiv.find('a').click(mainPageLinkClicked);
|
||||
}).fail(function(response) {
|
||||
messagePresenter.showError(($messages, response.json && response.json.error || response) + '<br/>Reload the page to continue.');
|
||||
loaded();
|
||||
});
|
||||
}
|
||||
function init(params, loaded) {
|
||||
topNavigationPresenter.select('logout');
|
||||
topNavigationPresenter.changeTitle('Logout');
|
||||
promise.wait(auth.logout())
|
||||
.then(function() {
|
||||
loaded();
|
||||
$messages.empty();
|
||||
var $messageDiv = messagePresenter.showInfo($messages, 'Logged out. <a href="">Back to main page</a>');
|
||||
$messageDiv.find('a').click(mainPageLinkClicked);
|
||||
}).fail(function(response) {
|
||||
messagePresenter.showError(($messages, response.json && response.json.error || response) + '<br/>Reload the page to continue.');
|
||||
loaded();
|
||||
});
|
||||
}
|
||||
|
||||
function mainPageLinkClicked(e) {
|
||||
e.preventDefault();
|
||||
router.navigateToMainPage();
|
||||
}
|
||||
function mainPageLinkClicked(e) {
|
||||
e.preventDefault();
|
||||
router.navigateToMainPage();
|
||||
}
|
||||
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
return {
|
||||
init: init
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user