User:PatriceKalwira/common.js

$(function confirmLogout { var $logoutLinks = $('a[href*="UserLogout"], a[href*="/logout"]');

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

$logoutLinks.on('click', function(event) {   event.preventDefault;

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