User:Naohiro19/logoutconfirm.js

// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY. // You can use/modify/redistribute without any permission.

// *** CUSTOMIZE SECTION var logoutconfirm_message = "!!ATTENTION!!\nAre you sure you want to log out?"; // ***

function install_logoutconfirm { var e = document.getElementById('pt-logout'); e = e.getElementsByTagName('a')[0]; if(e.addEventListener) e.addEventListener("click", logoutconfirm, false); else if(e.attachEvent) e.attachEvent("onclick", logoutconfirm); } function logoutconfirm(e) { if(confirm(logoutconfirm_message)) return true; if(e.preventDefault) e.preventDefault; else if(window.event) event.returnValue = false; return false; } addOnloadHook(install_logoutconfirm);