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;

View file

@ -3,7 +3,7 @@
color: #68b5d4;
}
.cof-chat {
color: #f7f7f7;
color: #d9d9d9;
}
.cof-chat_time {
color: #f7f7f7;
@ -45,7 +45,7 @@
color: #77dfd8;
}
.cof-chat_nick_self {
color: #f7f7f7;
color: #d9d9d9;
}
.cof-chat_nick_other {
color: #77dfd8;
@ -116,6 +116,7 @@
.cob-chat {
}
.cob-chat_time {
color: #999;
}
.cob-chat_time_delimiters {
}
@ -259,7 +260,7 @@
/* WeeChat colors, foreground */
.cwf-default {
color: #f7f7f7;
color: #d9d9d9;
}
.cwf-black {
color: #000000;
@ -1904,22 +1905,22 @@
}
/* attributes overrides */
.a-bold {
.a-b {
font-weight: bold;
}
.a-no-bold {
.a-no-b {
font-weight: normal;
}
.a-italic {
.a-i {
font-style: italic;
}
.a-no-italic {
.a-no-i {
font-style: normal;
}
.a-underline {
.a-u {
text-decoration: underline;
}
.a-no-underline {
.a-no-u {
text-decoration: none;
}
.a-reset {

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]),