Merge pull request #70 from torhve/master

Chat time style
This commit is contained in:
David Cormier 2013-10-26 11:45:21 -07:00
commit df83aa91f3
5 changed files with 1953 additions and 1940 deletions

View file

@ -57,6 +57,9 @@ td.time {
vertical-align: top;
}
.repeated-time {
display: none;
}
td.prefix {
text-align: right;
vertical-align: top;

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@
<link rel="shortcut icon" type="image/png" href="img/favicon.png" >
<link href="css/style.css" rel="stylesheet" media="screen">
<link href="css/glowingbear.css" rel="stylesheet" media="screen">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-sanitize.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
@ -18,7 +19,6 @@
<script type="text/javascript" src="js/models.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/favico-0.3.0.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
</head>
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)">
@ -216,9 +216,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<div id="bufferlines">
<table>
<tbody>
<tr class="bufferline" ng-repeat-start="bufferline in activeBuffer().lines">
<tr class="bufferline" ng-repeat-start="bufferline in (bufferlines = activeBuffer().lines)">
<td ng-hide="notimestamp" class="time">
<span class="date text-muted">
<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>
</td>

View file

@ -4,7 +4,7 @@
*/
var models = angular.module('weechatModels', []);
models.service('models', ['$rootScope', function($rootScope) {
models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) {
/*
* Buffer class
*/
@ -61,6 +61,7 @@ models.service('models', ['$rootScope', function($rootScope) {
this.BufferLine = function(message) {
var buffer = message['buffer'];
var date = message['date'];
var shortTime = $filter('date')(date, 'HH:mm');
function addClasses(textElements) {
var typeToClassPrefixFg = {
@ -118,6 +119,7 @@ models.service('models', ['$rootScope', function($rootScope) {
prefix: prefix,
content: content,
date: date,
shortTime: shortTime,
buffer: buffer,
tags: tags_array,
highlight: highlight,

View file

@ -194,10 +194,17 @@
*/
WeeChatProtocol._attrNameFromChar = function(ch) {
var chars = {
'*': 'bold',
'!': 'reverse',
'/': 'italic',
'_': 'underline'
// WeeChat protocol
'*': 'b',
'!': 'r',
'/': 'i',
'_': 'u',
// some extension often used (IRC?)
'\x01': 'b',
'\x02': 'r',
'\x03': 'i',
'\x04': 'u'
};
if (ch in chars) {
@ -323,7 +330,7 @@
// foreground color with F
// "F" + (A)STD
// "F" + (A)EXT
regex: /^F(?:([*!\/_|]*)(\d{2})|@([*!\/_|]*)(\d{5}))/,
regex: /^F(?:([*!\/_|]*)(\d{2})|@([\x01\x02\x03\x04*!\/_|]*)(\d{5}))/,
fn: function(m) {
var ret = {
bgColor: null
@ -359,7 +366,7 @@
// "*" + (A)STD + "," + EXT
// "*" + (A)EXT + "," + STD
// "*" + (A)EXT + "," + EXT
regex: /^\*(?:([*!\/_|]*)(\d{2})|@([*!\/_|]*)(\d{5})),(\d{2}|@\d{5})/,
regex: /^\*(?:([\x01\x02\x03\x04*!\/_|]*)(\d{2})|@([\x01\x02\x03\x04*!\/_|]*)(\d{5})),(\d{2}|@\d{5})/,
fn: function(m) {
var ret = {};
@ -379,7 +386,7 @@
// foreground color with * (+ attributes) (fall back, must be checked before previous case)
// "*" + (A)STD
// "*" + (A)EXT
regex: /^\*([*!\/_|]*)(\d{2}|@\d{5})/,
regex: /^\*([\x01\x02\x03\x04*!\/_|]*)(\d{2}|@\d{5})/,
fn: function(m) {
return {
fgColor: WeeChatProtocol._getColorObj(m[2]),