diff --git a/index.html b/index.html index a249c6b..9483b33 100644 --- a/index.html +++ b/index.html @@ -151,6 +151,7 @@
  • ALT-a: Focus on next buffer with activity
  • ALT-<: Switch to previous active buffer
  • ALT-g: Focus on buffer list filter
  • +
  • ALT-h: Clear unread counters in every buffer (locally)
  • Esc-Esc: Disconnect (double-tap)
  • Arrow keys: Navigate history, or navigate quick search buffer results.
  • Tab: Complete nick
  • diff --git a/js/connection.js b/js/connection.js index 4c74347..f5f03b5 100644 --- a/js/connection.js +++ b/js/connection.js @@ -420,6 +420,10 @@ weechat.factory('connection', } }; + var sendHotlistClearAll = function() { + sendMessage("/input hotlist_clear"); + }; + var requestNicklist = function(bufferId, callback) { // Prevent requesting nicklist for all buffers if bufferId is invalid if (!bufferId) { @@ -513,6 +517,7 @@ weechat.factory('connection', sendMessage: sendMessage, sendCoreCommand: sendCoreCommand, sendHotlistClear: sendHotlistClear, + sendHotlistClearAll: sendHotlistClearAll, fetchMoreLines: fetchMoreLines, requestNicklist: requestNicklist, attemptReconnect: attemptReconnect diff --git a/js/inputbar.js b/js/inputbar.js index a4fc48b..4777988 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -357,6 +357,16 @@ weechat.directive('inputBar', function() { return true; } + // Alt-h -> Toggle all as read + if ($event.altKey && !$event.ctrlKey && code === 72) { + var buffers = models.getBuffers(); + _.each(buffers, function(buffer) { + buffer.unread = 0; + buffer.notification = 0; + }); + connection.sendHotlistClearAll(); + } + var caretPos; // Arrow up -> go up in history