From 4a41e32fef0f3b2c3e2024d341e384d67ea5d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 6 Nov 2014 14:21:40 +0100 Subject: [PATCH] Ask before sending /quit --- js/inputbar.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/inputbar.js b/js/inputbar.js index e83919b..e65a327 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -78,6 +78,13 @@ weechat.directive('inputBar', function() { // Split the command into multiple commands based on line breaks _.each($scope.command.split(/\r?\n/), function(line) { + // Ask before a /quit + if (line === '/quit' || line.indexOf('/quit ') === 0) { + if (!window.confirm("Are you sure you want to quit WeeChat? This will prevent you from connecting with Glowing Bear until you restart WeeChat on the command line!")) { + // skip this line + return; + } + } connection.sendMessage(line); });