From 3c01ad1b686c0e3bdda6ec600066a57f3bdb089d Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Tue, 29 Oct 2013 12:34:16 +0100 Subject: [PATCH 1/8] Fix bug with switching to core buffer when buffer is closed --- js/models.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/models.js b/js/models.js index 79f5070..bb9a41b 100644 --- a/js/models.js +++ b/js/models.js @@ -361,15 +361,17 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) /* * Closes a weechat buffer. Sets the first buffer - * as active. + * as active, if the closing buffer was active before * * @param bufferId id of the buffer to close * @return undefined */ this.closeBuffer = function(bufferId) { - + var wasActive = this.model['buffers'][bufferId.id].active; + if(wasActive) { + var firstBuffer = _.keys(this.model['buffers'])[0]; + this.setActiveBuffer(firstBuffer); + } delete(this.model['buffers'][bufferId.id]); - var firstBuffer = _.keys(this.model['buffers'])[0]; - this.setActiveBuffer(firstBuffer); } }]); From 70abe58afe3640281e695afbe198ed22cb440edf Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Tue, 29 Oct 2013 12:50:02 +0100 Subject: [PATCH 2/8] New keyboard shortcut alt-n: toggle nicklist --- js/websockets.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/websockets.js b/js/websockets.js index c1d5995..ff222c2 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -771,6 +771,13 @@ weechat.directive('inputBar', function() { return true; } + // Left Alt+n -> toggle nicklist + if ($event.altKey && !$event.ctrlKey && code == 78) { + $event.preventDefault(); + $scope.nonicklist = !$scope.nonicklist; + return true; + } + // Alt+A -> switch to buffer with activity if ($event.altKey && (code == 97 || code == 65)) { $event.preventDefault(); From f7b0b6fffebcc689be4b29380f3d5b073ee3a36e Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Thu, 31 Oct 2013 00:12:31 +0100 Subject: [PATCH 3/8] make the buffers list static width instead of relative --- css/glowingbear.css | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index e400f81..457ec49 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -140,7 +140,7 @@ input[type=text], input[type=password], .badge { } #topbar .title { position: fixed; - left: 14%; + left: 145px; /* sidebar */ overflow: hidden; } #topbar .actions { @@ -160,10 +160,9 @@ input[type=text], input[type=password], .badge { } #sidebar { position: fixed; - width: 12%; + width: 140px; min-height: 100%; height: 100%; - min-width: 130px; overflow: auto; padding-top: 35px; /* topbar */ font-size: smaller; @@ -232,7 +231,7 @@ input[type=text], input[type=password], .badge { position: relative; height: 99%; overflow-y: auto; - margin-left: 14%; /* sidebar */ + margin-left: 145px; /* sidebar */ width: auto; top: 25px; /* topbar */ padding-bottom: 10px; @@ -245,7 +244,7 @@ input[type=text], input[type=password], .badge { } .navbar-fixed-bottom { - margin: 0 5px 0 14%; + margin: 0 5px 0 145px; /* sidebar */ } .navbar-inverse { background-color: #181818; @@ -263,6 +262,9 @@ input[type=text], input[type=password], .badge { width: 100%; text-align: center; } + #bufferlines { + padding-bottom: 55px; /* navbar fixed bottom */ + } .navbar-fixed-bottom { margin: 0 5px 0 5px; } From c2ce47e217301feb94f9c5c3ddc15152660d7578 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Thu, 31 Oct 2013 00:18:10 +0100 Subject: [PATCH 4/8] remove connection infos from title bar I find the connection info very displeasing to the eye, so I removed it and added it to a hover on the icon instead. I don't see the point of displaying where you are connected, and I want the interface to be uncluttered by default. --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index cbcfb8e..d98c6bd 100644 --- a/index.html +++ b/index.html @@ -150,9 +150,8 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
- brand + brand
-
{{ host }}:{{ port }}
- - + + - + From 6dd35fa890123cc31b77055e38453e5f4a6c67d6 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sat, 2 Nov 2013 17:22:22 +0100 Subject: [PATCH 8/8] Split messages with newline into multiple messages --- css/glowingbear.css | 6 ++++-- directives/input.html | 5 +++-- js/websockets.js | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 983c98d..b44c71a 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -105,8 +105,10 @@ body { padding-bottom:70px; } -input#sendMessage { +#sendMessage { width: 100%; + height: 36px; + resize: none; } #footer button { border-radius: 0; @@ -114,7 +116,7 @@ input#sendMessage { .panel input, .panel .input-group { max-width: 300px; } -input[type=text], input[type=password], .badge { +input[type=text], input[type=password], #sendMessage, .badge { border: 0; border-radius: 0; color: #ccc; diff --git a/directives/input.html b/directives/input.html index 43fd60d..181748f 100644 --- a/directives/input.html +++ b/directives/input.html @@ -1,6 +1,7 @@ -
+
- + diff --git a/js/websockets.js b/js/websockets.js index ff222c2..db1d9af 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -731,7 +731,11 @@ weechat.directive('inputBar', function() { // Send the message to the websocket $scope.sendMessage = function() { - connection.sendMessage($scope.command); + // Split the command into multiple commands based on line breaks + var commands = $scope.command.split(/\r?\n/); + commands.forEach(function(c) { + connection.sendMessage(c); + }); $scope.command = ""; } @@ -808,6 +812,15 @@ weechat.directive('inputBar', function() { return true; } + // Enter to submit, shift-enter for newline + if (code == 13 && !$event.shiftKey) { + $event.preventDefault(); + // Prevent inprog + setTimeout(function() {$('#inputform').submit();},0); + return true; + } + + } }
{{ bufferline.date | date:'HH' }}:{{ bufferline.date | date:'mm' }} @@ -265,9 +265,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
-
+