Merge branch 'master' into gh-pages

This commit is contained in:
Tor Hveem 2013-10-07 17:01:35 +02:00
commit cdb12bff43
3 changed files with 33 additions and 6 deletions

View file

@ -1,3 +1,5 @@
html {
}
body {
color: white;
background-color: #222;
@ -6,10 +8,14 @@ body {
padding-bottom:70px;
padding-top: 70px;
}
.content {
height: 100%;
min-height: 100%;
display: block;
}
.bufferlines {
font-family: monospace;
overflow: scroll-y;
height: 100%;
overflow-y: auto;
}
.navbar-fixed-bottom {

View file

@ -69,7 +69,7 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<button class="btn btn-lg btn-primary" ng-click="connect()">Connect!</button>
</form>
</div>
<div ng-show="connected">
<div class="content" ng-show="connected">
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

View file

@ -270,7 +270,7 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'pluginManager', function($
var handleLine = function(line, initial) {
var buffer_line = {}
var date = line['date'];
var date = line['date']*1000;
var prefix = colors.parse(line['prefix']);
var text = colors.parse(line['message']);
var buffer = line['buffer'];
@ -306,7 +306,7 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'pluginManager', function($
}
}
$rootScope.buffers[buffer]['lines'].push(buffer_line);
$rootScope.addLine(buffer, buffer_line);
buffer_line['date'] = date;
@ -553,8 +553,29 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', 'connection
$rootScope.buffers[key]['unread'] = '';
$rootScope.activeBuffer = $rootScope.buffers[key];
$rootScope.pageTitle = $rootScope.activeBuffer['short_name'] + ' | ' + $rootScope.activeBuffer['title'];
$rootScope.scrollToBottom();
};
$rootScope.$watch('activeBuffer', function(newVal, oldVal) {
if (newVal && newVal !== oldVal) {
$rootScope.scrollToBottom();
}
});
$rootScope.addLine = function(buffer, line) {
$rootScope.buffers[buffer]['lines'].push(line);
// Scroll if needed
if ($rootScope.activeBuffer['id'] == buffer) {
$rootScope.scrollToBottom();
}
}
$rootScope.scrollToBottom = function() {
setTimeout(function() {
window.scrollTo(0, window.scrollMaxY);
});
}
$scope.sendMessage = function() {
connection.sendMessage($scope.command);
$scope.command = "";
@ -565,7 +586,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', 'connection
}
$rootScope.getLines = function() {
var count = 20;
connection.getLines(20);
connection.getLines(count);
}
/* Function gets called from bufferLineAdded code if user should be notified */