Commit fc247676 authored by Frank Nägler's avatar Frank Nägler Committed by Christian Kuhn
Browse files

[TASK] Optimize button in LoginRefresh

Switch order of buttons and logic in LoginRefresh Dialog.

Resolves: #68168
Releases: master
Change-Id: Ie097f647d42a5bfdb2b596f164f9e1fa98d02560
Reviewed-on: http://review.typo3.org/41300


Reviewed-by: Jan Helke's avatarJan Helke <typo3@helke.de>
Tested-by: Jan Helke's avatarJan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 6defeb4a
......@@ -464,10 +464,11 @@ class BackendController {
'be_locked' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.be_locked'),
'refresh_login_countdown_singular' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown_singular'),
'refresh_login_countdown' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown'),
'login_about_to_expire' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire'),
'login_about_to_expire' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.login_refresh_about_to_expire'),
'login_about_to_expire_title' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire_title'),
'refresh_login_abort_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_abort_button'),
'refresh_login_confirm_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_confirm_button'),
'refresh_login_refresh_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_refresh_button'),
'refresh_direct_logout_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_direct_logout_button'),
'tabs_closeAll' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.closeAll'),
'tabs_closeOther' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.closeOther'),
'tabs_close' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.close'),
......
......@@ -88,6 +88,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
*/
LoginRefresh.initializeTimeoutModal = function() {
LoginRefresh.$timeoutModal = LoginRefresh.generateModal(LoginRefresh.identifier.loginrefresh);
LoginRefresh.$timeoutModal.addClass('t3-modal-notice');
LoginRefresh.$timeoutModal.find('.modal-header h4').text(TYPO3.LLL.core.login_about_to_expire_title);
LoginRefresh.$timeoutModal.find('.modal-body').append(
$('<p />').text(TYPO3.LLL.core.login_about_to_expire),
......@@ -103,7 +104,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
)
);
LoginRefresh.$timeoutModal.find('.modal-footer').append(
$('<button />', {class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_refresh_button).on('click', function() {
$('<button />', {class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_abort_button).on('click', function() {
$.ajax({
url: TYPO3.settings.ajaxUrls['BackendLogin::isTimedOut'],
method: 'GET',
......@@ -112,11 +113,10 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
}
});
}),
$('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_direct_logout_button).on('click', function() {
$('<button />', {class: 'btn btn-primary t3js-active', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_login_confirm_button).on('click', function() {
top.location.href = TYPO3.configuration.siteUrl + LoginRefresh.logoutUrl;
})
);
LoginRefresh.registerDefaultModalEvents(LoginRefresh.$timeoutModal);
$('body').append(LoginRefresh.$timeoutModal);
......@@ -192,6 +192,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
}
LoginRefresh.$loginForm = LoginRefresh.generateModal(LoginRefresh.identifier.loginFormModal);
LoginRefresh.$loginForm.addClass('t3-modal-notice');
LoginRefresh.$loginForm.find('.modal-header h4').text(TYPO3.LLL.core.refresh_login_title);
LoginRefresh.$loginForm.find('.modal-body').append(
$('<p />').text(TYPO3.LLL.core.login_expired),
......@@ -204,10 +205,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
)
);
LoginRefresh.$loginForm.find('.modal-footer').append(
$('<button />', {type: 'submit', form: 'beLoginRefresh', class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_button),
$('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_direct_logout_button).on('click', function() {
top.location.href = TYPO3.configuration.siteUrl + LoginRefresh.logoutUrl;
})
$('<button />', {type: 'submit', form: 'beLoginRefresh', class: 'btn btn-primary', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_button)
);
LoginRefresh.registerDefaultModalEvents(LoginRefresh.$loginForm).on('submit', LoginRefresh.submitForm);
......@@ -353,6 +351,8 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
LoginRefresh.startTask();
}).on('shown.bs.modal', function() {
LoginRefresh.stopTask();
// focus the button which was configured as active button
LoginRefresh.$timeoutModal.find('.modal-footer .t3js-active').first().focus();
});
return $modal;
......
......@@ -638,6 +638,15 @@ Do you want to refresh it now?</source>
<trans-unit id="mess.login_about_to_expire">
<source>Your TYPO3 login is about to expire. Please confirm that you want to stay logged in.</source>
</trans-unit>
<trans-unit id="mess.refresh_login_abort_button">
<source>Abort</source>
</trans-unit>
<trans-unit id="mess.refresh_login_confirm_button">
<source>Log me out</source>
</trans-unit>
<trans-unit id="mess.login_refresh_about_to_expire">
<source>Your TYPO3 login is about to expire. Please confirm that you want to be logged out.</source>
</trans-unit>
<trans-unit id="mess.login_about_to_expire_title">
<source>TYPO3 login expiration notice</source>
</trans-unit>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment