Merge pull request #81 from torhve/master

Misc
This commit is contained in:
David Cormier 2013-11-06 05:43:37 -08:00
commit 52630d7901
6 changed files with 49 additions and 21 deletions

View file

@ -105,8 +105,10 @@ body {
padding-bottom:70px; padding-bottom:70px;
} }
input#sendMessage { #sendMessage {
width: 100%; width: 100%;
height: 36px;
resize: none;
} }
#footer button { #footer button {
border-radius: 0; border-radius: 0;
@ -114,7 +116,7 @@ input#sendMessage {
.panel input, .panel .input-group { .panel input, .panel .input-group {
max-width: 300px; max-width: 300px;
} }
input[type=text], input[type=password], .badge { input[type=text], input[type=password], #sendMessage, .badge {
border: 0; border: 0;
border-radius: 0; border-radius: 0;
color: #ccc; color: #ccc;
@ -140,7 +142,7 @@ input[type=text], input[type=password], .badge {
} }
#topbar .title { #topbar .title {
position: fixed; position: fixed;
left: 14%; left: 145px; /* sidebar */
overflow: hidden; overflow: hidden;
} }
#topbar .actions { #topbar .actions {
@ -160,10 +162,9 @@ input[type=text], input[type=password], .badge {
} }
#sidebar { #sidebar {
position: fixed; position: fixed;
width: 12%; width: 140px;
min-height: 100%; min-height: 100%;
height: 100%; height: 100%;
min-width: 130px;
overflow: auto; overflow: auto;
padding-top: 35px; /* topbar */ padding-top: 35px; /* topbar */
font-size: smaller; font-size: smaller;
@ -232,10 +233,11 @@ input[type=text], input[type=password], .badge {
position: relative; position: relative;
height: 99%; height: 99%;
overflow-y: auto; overflow-y: auto;
margin-left: 14%; /* sidebar */ margin-left: 145px; /* sidebar */
width: auto; width: auto;
top: 25px; /* topbar */ top: 25px; /* topbar */
padding-bottom: 10px; padding-bottom: 10px;
margin-right: -5px;
} }
.withnicklist { .withnicklist {
margin-right: 100px !important; /* nicklist */ margin-right: 100px !important; /* nicklist */
@ -245,7 +247,7 @@ input[type=text], input[type=password], .badge {
} }
.navbar-fixed-bottom { .navbar-fixed-bottom {
margin: 0 5px 0 14%; margin: 0 5px 0 145px; /* sidebar */
} }
.navbar-inverse { .navbar-inverse {
background-color: #181818; background-color: #181818;
@ -263,6 +265,9 @@ input[type=text], input[type=password], .badge {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
#bufferlines {
padding-bottom: 55px; /* navbar fixed bottom */
}
.navbar-fixed-bottom { .navbar-fixed-bottom {
margin: 0 5px 0 5px; margin: 0 5px 0 5px;
} }

View file

@ -45,7 +45,8 @@
color: #77dfd8; color: #77dfd8;
} }
.cof-chat_nick_self { .cof-chat_nick_self {
color: #fff1bd; color: #ffffff;
font-weight: bold;
} }
.cof-chat_nick_other { .cof-chat_nick_other {
color: #77dfd8; color: #77dfd8;

View file

@ -1,6 +1,7 @@
<form class="form form-horizontal" ng-submit="sendMessage()"> <form class="form form-horizontal" id="inputform" ng-submit="sendMessage()">
<div class="input-group"> <div class="input-group">
<input id="sendMessage" type="text" class="form-control monospace" autocomplete="off" ng-model="command" autofocus> <textarea id="sendMessage" class="form-control monospace" ng-trim="false" rows="1" autocomplete="off" ng-model="command" autofocus>
</textarea>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default btn-primary">Send</button> <button class="btn btn-default btn-primary">Send</button>
</span> </span>

View file

@ -150,9 +150,8 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<div class="content" ng-show="connected"> <div class="content" ng-show="connected">
<div id="topbar" class="horizontal-line"> <div id="topbar" class="horizontal-line">
<div class="brand"> <div class="brand">
<img alt="brand" src="img/favicon.png"> <img alt="brand" src="img/favicon.png" title="Connected to {{ host }}:{{ port}}">
</div> </div>
<div id="connection-infos" class="monospace">{{ host }}:{{ port }}</div>
<div class="title" ng-bind-html="activeBuffer().title | linky:'_blank'"></div> <div class="title" ng-bind-html="activeBuffer().title | linky:'_blank'"></div>
<div class="actions pull-right vertical-line-left"> <div class="actions pull-right vertical-line-left">
<div class="dropdown pull-left"> <div class="dropdown pull-left">
@ -243,8 +242,8 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
</ul> </ul>
</div> </div>
<table> <table>
<tbody> <tbody ng-repeat="bufferline in (bufferlines = activeBuffer().lines)">
<tr class="bufferline" ng-repeat-start="bufferline in (bufferlines = activeBuffer().lines)"> <tr class="bufferline">
<td ng-hide="notimestamp" class="time"> <td ng-hide="notimestamp" class="time">
<span class="date" ng-class="{'repeated-time': bufferline.shortTime==bufferlines[$index-1].shortTime}"> <span class="date" ng-class="{'repeated-time': bufferline.shortTime==bufferlines[$index-1].shortTime}">
<span class="cof-chat_time cob-chat_time coa-chat_time">{{ bufferline.date | date:'HH' }}</span><span class="cof-chat_time_delimiters cob-chat_time_delimiters coa-chat_time_delimiters">:</span><span class="cof-chat_time cob-chat_time coa-chat_time">{{ bufferline.date | date:'mm' }}</span> <span class="cof-chat_time cob-chat_time coa-chat_time">{{ bufferline.date | date:'HH' }}</span><span class="cof-chat_time_delimiters cob-chat_time_delimiters coa-chat_time_delimiters">:</span><span class="cof-chat_time cob-chat_time coa-chat_time">{{ bufferline.date | date:'mm' }}</span>
@ -266,9 +265,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
</div> </div>
</td> </td>
</tr> </tr>
<tr class="readmarker" ng-repeat-end ng-show="activeBuffer().lastSeen==$index"> <tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
<td colspan="3"> <td colspan="3">
<hr ng-if="activeBuffer().lastSeen==$index" id="readmarker"> <hr id="readmarker">
</td> </td>
</tr> </tr>
</tbody> </tbody>

View file

@ -361,15 +361,17 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
/* /*
* Closes a weechat buffer. Sets the first buffer * 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 * @param bufferId id of the buffer to close
* @return undefined * @return undefined
*/ */
this.closeBuffer = function(bufferId) { this.closeBuffer = function(bufferId) {
var wasActive = this.model['buffers'][bufferId.id].active;
delete(this.model['buffers'][bufferId.id]); if(wasActive) {
var firstBuffer = _.keys(this.model['buffers'])[0]; var firstBuffer = _.keys(this.model['buffers'])[0];
this.setActiveBuffer(firstBuffer); this.setActiveBuffer(firstBuffer);
} }
delete(this.model['buffers'][bufferId.id]);
}
}]); }]);

View file

@ -731,7 +731,11 @@ weechat.directive('inputBar', function() {
// Send the message to the websocket // Send the message to the websocket
$scope.sendMessage = function() { $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 = ""; $scope.command = "";
} }
@ -771,6 +775,13 @@ weechat.directive('inputBar', function() {
return true; 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 // Alt+A -> switch to buffer with activity
if ($event.altKey && (code == 97 || code == 65)) { if ($event.altKey && (code == 97 || code == 65)) {
$event.preventDefault(); $event.preventDefault();
@ -801,6 +812,15 @@ weechat.directive('inputBar', function() {
return true; 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;
}
} }
} }