commit
52630d7901
6 changed files with 49 additions and 21 deletions
|
@ -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;
|
||||
|
@ -140,7 +142,7 @@ input[type=text], input[type=password], .badge {
|
|||
}
|
||||
#topbar .title {
|
||||
position: fixed;
|
||||
left: 14%;
|
||||
left: 145px; /* sidebar */
|
||||
overflow: hidden;
|
||||
}
|
||||
#topbar .actions {
|
||||
|
@ -160,10 +162,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,10 +233,11 @@ 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;
|
||||
margin-right: -5px;
|
||||
}
|
||||
.withnicklist {
|
||||
margin-right: 100px !important; /* nicklist */
|
||||
|
@ -245,7 +247,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 +265,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;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
color: #77dfd8;
|
||||
}
|
||||
.cof-chat_nick_self {
|
||||
color: #fff1bd;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
.cof-chat_nick_other {
|
||||
color: #77dfd8;
|
||||
|
|
|
@ -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">
|
||||
<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">
|
||||
<button class="btn btn-default btn-primary">Send</button>
|
||||
</span>
|
||||
|
|
11
index.html
11
index.html
|
@ -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 id="topbar" class="horizontal-line">
|
||||
<div class="brand">
|
||||
<img alt="brand" src="img/favicon.png">
|
||||
<img alt="brand" src="img/favicon.png" title="Connected to {{ host }}:{{ port}}">
|
||||
</div>
|
||||
<div id="connection-infos" class="monospace">{{ host }}:{{ port }}</div>
|
||||
<div class="title" ng-bind-html="activeBuffer().title | linky:'_blank'"></div>
|
||||
<div class="actions pull-right vertical-line-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>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="bufferline" ng-repeat-start="bufferline in (bufferlines = activeBuffer().lines)">
|
||||
<tbody ng-repeat="bufferline in (bufferlines = activeBuffer().lines)">
|
||||
<tr class="bufferline">
|
||||
<td ng-hide="notimestamp" class="time">
|
||||
<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>
|
||||
|
@ -266,9 +265,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="readmarker" ng-repeat-end ng-show="activeBuffer().lastSeen==$index">
|
||||
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
|
||||
<td colspan="3">
|
||||
<hr ng-if="activeBuffer().lastSeen==$index" id="readmarker">
|
||||
<hr id="readmarker">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
10
js/models.js
10
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);
|
||||
}
|
||||
}]);
|
||||
|
|
|
@ -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 = "";
|
||||
}
|
||||
|
||||
|
@ -771,6 +775,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();
|
||||
|
@ -801,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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue