|
|
|
@ -497,11 +497,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
// Find next buffer with activity and switch to it
|
|
|
|
|
angular.forEach($scope.buffers, function(buffer) { |
|
|
|
|
if(buffer.notification) { |
|
|
|
|
console.log('a', buffer.id); |
|
|
|
|
$scope.setActiveBuffer(buffer.id); |
|
|
|
|
return false; |
|
|
|
|
}else if((parseInt(buffer.unread) || 0) > 0) { |
|
|
|
|
console.log('b',buffer.id); |
|
|
|
|
$scope.setActiveBuffer(buffer.id); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -510,15 +508,19 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.handleKeyPress = function($event) { |
|
|
|
|
// Support different browser quirks
|
|
|
|
|
var code = $event.keyCode ? $event.keyCode : $event.charCode; |
|
|
|
|
|
|
|
|
|
//console.log('keypress', $event.charCode, $event.altKey);
|
|
|
|
|
|
|
|
|
|
// Handle alt-a
|
|
|
|
|
if($event.altKey && $event.charCode == '97') { |
|
|
|
|
if($event.altKey && (code == 97 || code == 65)) { |
|
|
|
|
$event.preventDefault(); |
|
|
|
|
$rootScope.switchToActivityBuffer(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
// Handle ctrl-g
|
|
|
|
|
if($event.ctrlKey && $event.charCode == '103') { |
|
|
|
|
if($event.ctrlKey && (code == 103 || code == 71)) { |
|
|
|
|
document.querySelector('#bufferFilter').focus(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|