User:Emmanuelbinen/common.js

$(function confirmLogout { var $logoutLink = $('#pt-logout a');

if ($logoutLink.length === 0 || !mw.config.get('wgUserName')) { return; }

$logoutLink.on('click', function(event) {   event.preventDefault;    var confirmationMessage = mw.message('Stay Loged In?').plain;

if (confirm(confirmationMessage)) { window.bldkDingExposedInterface(mw.message('logging-out-notify'), 'default', 'long'); new mw.Api.postWithEditToken({       action: 'logout'      }).then(function {        location.reload;      }); } }); });