Fix non-#channels and single-symbol channels (#)

This commit is contained in:
Lorenz Hübschle-Schneider 2014-11-20 12:57:19 +01:00
parent ec21b21e38
commit 9b7a778186
4 changed files with 20 additions and 4 deletions

View File

@ -477,10 +477,21 @@ h2 span, h2 small {
/* bold hash before channels */ /* bold hash before channels */
li.buffer.channel a span:last-of-type:before { li.buffer.channel a span:last-of-type:before {
color: #888; color: #888;
content: "#";
font-weight: bold; font-weight: bold;
} }
li.buffer.channel_hash a span:last-of-type:before {
content: '#';
}
li.buffer.channel_plus a span:last-of-type:before {
content: '+';
}
li.buffer.channel_ampersand a span:last-of-type:before {
content: '&';
}
li.buffer.channel.active a span:last-of-type:before { li.buffer.channel.active a span:last-of-type:before {
color: #444; color: #444;
} }

View File

@ -234,7 +234,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<input class="form-control favorite-font" type="text" id="bufferFilter" ng-model="search" ng-keydown="handleSearchBoxKey($event)" placeholder="Search"> <input class="form-control favorite-font" type="text" id="bufferFilter" ng-model="search" ng-keydown="handleSearchBoxKey($event)" placeholder="Search">
</form> </form>
</li> </li>
<li class="buffer" ng-class="{'active': buffer.active, 'indent': buffer.indent, 'channel': buffer.type === 'channel', 'private': buffer.type === 'private'}" ng-repeat="(key, buffer) in (filteredBuffers = (getBuffers() | toArray:'withidx' | filter:{fullName:search} | filter:hasUnread | orderBy:predicate | getBufferQuickKeys:this))"> <li class="buffer" ng-class="{'active': buffer.active, 'indent': buffer.indent, 'channel': buffer.type === 'channel', 'channel_hash': buffer.prefix === '#', 'channel_plus': buffer.prefix === '+', 'channel_ampersand': buffer.prefix === '&', 'private': buffer.type === 'private'}" ng-repeat="(key, buffer) in (filteredBuffers = (getBuffers() | toArray:'withidx' | filter:{fullName:search} | filter:hasUnread | orderBy:predicate | getBufferQuickKeys:this))">
<a href="#" ng-click="setActiveBuffer(buffer.id)" title="{{ buffer.fullName }}"> <a href="#" ng-click="setActiveBuffer(buffer.id)" title="{{ buffer.fullName }}">
<span class="badge pull-right" ng-class="{'danger': buffer.notification}" ng-if="buffer.notification || buffer.unread" ng-bind="buffer.notification || buffer.unread"></span> <span class="badge pull-right" ng-class="{'danger': buffer.notification}" ng-if="buffer.notification || buffer.unread" ng-bind="buffer.notification || buffer.unread"></span>
<span class="buffer-quick-key">{{ buffer.$quickKey }}</span> <span class="buffer-quick-key">{{ buffer.$quickKey }}</span>

View File

@ -74,7 +74,8 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
var old = models.getBuffer(buffer); var old = models.getBuffer(buffer);
old.fullName = obj.full_name; old.fullName = obj.full_name;
old.shortName = obj.short_name; old.shortName = obj.short_name;
old.trimmedName = obj.short_name.replace(/^[#&+]/, ''); old.trimmedName = obj.short_name.replace(/^[#&+]/, '') || ' ';
old.prefix = ['#', '&', '+'].indexOf(obj.short_name.charAt(0)) >= 0 ? obj.short_name.charAt(0) : '';
}; };
var handleBufferLocalvarChanged = function(message) { var handleBufferLocalvarChanged = function(message) {

View File

@ -15,7 +15,10 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
// weechat properties // weechat properties
var fullName = message.full_name; var fullName = message.full_name;
var shortName = message.short_name; var shortName = message.short_name;
var trimmedName = shortName.replace(/^[#&+]/, ''); // just use a space if the rest of the channel name is empty ('#')
var trimmedName = shortName.replace(/^[#&+]/, '') || ' ';
// get channel identifier
var prefix = ['#', '&', '+'].indexOf(shortName.charAt(0)) >= 0 ? shortName.charAt(0) : '';
var title = message.title; var title = message.title;
var number = message.number; var number = message.number;
var pointer = message.pointers[0]; var pointer = message.pointers[0];
@ -226,6 +229,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
fullName: fullName, fullName: fullName,
shortName: shortName, shortName: shortName,
trimmedName: trimmedName, trimmedName: trimmedName,
prefix: prefix,
number: number, number: number,
title: title, title: title,
lines: lines, lines: lines,