diff --git a/css/glowingbear.css b/css/glowingbear.css index d62d9d8..9c7d540 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -477,10 +477,21 @@ h2 span, h2 small { /* bold hash before channels */ li.buffer.channel a span:last-of-type:before { color: #888; - content: "#"; 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 { color: #444; } diff --git a/index.html b/index.html index 9e26d30..215a5cc 100644 --- a/index.html +++ b/index.html @@ -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"> </form> </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 }}"> <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> diff --git a/js/handlers.js b/js/handlers.js index 0e3381b..4418389 100644 --- a/js/handlers.js +++ b/js/handlers.js @@ -74,7 +74,8 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific var old = models.getBuffer(buffer); old.fullName = obj.full_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) { diff --git a/js/models.js b/js/models.js index ea4324f..559950c 100644 --- a/js/models.js +++ b/js/models.js @@ -15,7 +15,10 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) // weechat properties var fullName = message.full_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 number = message.number; var pointer = message.pointers[0]; @@ -226,6 +229,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) fullName: fullName, shortName: shortName, trimmedName: trimmedName, + prefix: prefix, number: number, title: title, lines: lines,