design improvements, and add time to each line

This commit is contained in:
Tor Hveem 2013-10-06 19:15:34 +02:00
parent 4db0a985c5
commit 6455256b9e
3 changed files with 33 additions and 10 deletions

View file

@ -1,7 +1,10 @@
body {
font-family: monospace;
background-color: black;
color: white;
padding: 5px;
}
.bufferlines {
font-family: sans-serif;
}
.color-light-green {

View file

@ -53,10 +53,15 @@
</div>
<div ng-show="connected">
<span class="label" ng-class="{'label-success': content.notification }" ng-repeat="(key, content) in buffers | toArray | orderBy:'content.number':true">
<a ng-click="setActiveBuffer(key)">{{ content.full_name }}</a>
</span>
<div ng-repeat="bufferline in activeBuffer.lines">
<ul class="nav nav-pills">
<li class="label" ng-class="{'label-success': content.notification }" ng-repeat="(key, content) in buffers | toArray | orderBy:'content.number':true">
<a ng-click="setActiveBuffer(content.id)">{{ content.full_name }}</a>
</li>
</ul>
<div class="bufferlines" ng-repeat="bufferline in activeBuffer.lines">
<span class="date muted">
{{ bufferline.date }}
</span>
<span ng-repeat="part in bufferline.message" class="text" style="{{ part.fg }}">
{{ part.text }}
@ -77,10 +82,16 @@
</div>
<form ng-submit="sendMessage()">
<input type="text" ng-model="command"></input>
<input type="submit" class="btn btn-primary"></button>
</form>
<div class="navbar navbar-inverse navbar-fixed-bottom">
<form class="form form-horizontal" ng-submit="sendMessage()">
<div class="input-group">
<input type="text" class="form-control" ng-model="command"></input>
<span class="input-group-btn">
<button class="btn btn-default btn-primary">Send</button>
</span>
</div>
</form>
</div>
</div>
</div>
</body>

View file

@ -1,3 +1,7 @@
Number.prototype.pad = function (len) {
return (new Array(len+1).join("0") + this).slice(-len);
}
var weechat = angular.module('weechat', ['localStorage']);
weechat.filter('toArray', function () {
'use strict';
@ -270,6 +274,9 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'pluginManager', function($
var handleBufferLineAdded = function(message) {
var buffer_line = {}
var date = message['objects'][0]['content'][0]['date'];
date = new Date(parseInt(date, 10) * 1000);
var datestring = date.getHours().pad(2) + ':' + date.getMinutes().pad(2);
var prefix = colors.parse(message['objects'][0]['content'][0]['prefix']);
var text = colors.parse(message['objects'][0]['content'][0]['message']);
var buffer = message['objects'][0]['content'][0]['buffer'];
@ -300,6 +307,8 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'pluginManager', function($
$rootScope.buffers[buffer]['lines'].push(buffer_line);
buffer_line['date'] = datestring;
if(highlight || _.contains(tags_array, 'notify_private')) {
$rootScope.createHighlight(prefix, text, message, buffer, additionalContent);