Merge pull request #457 from torhve/compactbufferlist

Compact bufferlist
This commit is contained in:
Tor Hveem 2014-09-17 13:27:25 +02:00
commit c6ccd38f8e
4 changed files with 29 additions and 5 deletions

View file

@ -204,7 +204,7 @@ input[type=text], input[type=password], #sendMessage, .badge {
#sidebar .badge { #sidebar .badge {
border-radius: 0; border-radius: 0;
margin-right: -15px; margin-right: -10px;
} }
#sidebar ul.indented li.indent span.buffername { #sidebar ul.indented li.indent span.buffername {
@ -224,7 +224,7 @@ input[type=text], input[type=password], #sendMessage, .badge {
overflow-x: hidden; overflow-x: hidden;
right: 0; right: 0;
top: 0; top: 0;
padding-top: 35px; padding-top: 39px;
padding-left: 5px; padding-left: 5px;
padding-bottom: 35px; padding-bottom: 35px;
z-index: 2; z-index: 2;
@ -256,6 +256,7 @@ input[type=text], input[type=password], #sendMessage, .badge {
.nav-pills > li > a { .nav-pills > li > a {
border-radius: 0; border-radius: 0;
color: #ddd; color: #ddd;
padding: 5px 10px;
} }
.nav-pills > li > a:hover, .nav-pills > li > a:hover span { .nav-pills > li > a:hover, .nav-pills > li > a:hover span {
color: #222; color: #222;
@ -511,6 +512,24 @@ h2 span, h2 small {
display: none; display: none;
} }
} }
/* bold hash before channels */
li.buffer.channel a span:last-of-type:before {
color: #888;
content: "#";
font-weight: bold;
}
li.buffer.channel.active a span:last-of-type:before {
color: #444;
}
li.buffer.channel.active a:hover span:last-of-type:before {
color: #222;
}
li.buffer.indent.private a {
padding-left: 17px;
}
.make-thinner { .make-thinner {
padding-right: -15px; padding-right: -15px;

View file

@ -233,10 +233,10 @@ $ 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 }" ng-repeat="(key, buffer) in (filteredBuffers = (getBuffers() | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate))"> <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 | filter:{fullName:search} | filter:hasUnread | orderBy:predicate))">
<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="buffername">{{ buffer.shortName || buffer.fullName }}</span> <span class="buffername">{{ buffer.trimmedName || buffer.fullName }}</span>
</a> </a>
</li> </li>
</ul> </ul>

View file

@ -71,6 +71,7 @@ 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(/^[#&+]/, '');
}; };
var handleBufferLocalvarChanged = function(message) { var handleBufferLocalvarChanged = function(message) {
@ -80,7 +81,8 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
var localvars = obj.local_variables; var localvars = obj.local_variables;
if (old !== undefined && localvars !== undefined) { if (old !== undefined && localvars !== undefined) {
// Update indendation status // Update indentation status
old.type = localvars.type;
old.indent = (['channel', 'private'].indexOf(localvars.type) >= 0); old.indent = (['channel', 'private'].indexOf(localvars.type) >= 0);
} }
}; };

View file

@ -12,6 +12,7 @@ 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(/^[#&+]/, '');
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];
@ -221,6 +222,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
id: pointer, id: pointer,
fullName: fullName, fullName: fullName,
shortName: shortName, shortName: shortName,
trimmedName: trimmedName,
number: number, number: number,
title: title, title: title,
lines: lines, lines: lines,
@ -238,6 +240,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
getNicklistByTime: getNicklistByTime, getNicklistByTime: getNicklistByTime,
serverSortKey: serverSortKey, serverSortKey: serverSortKey,
indent: indent, indent: indent,
type: type,
history: history, history: history,
addToHistory: addToHistory, addToHistory: addToHistory,
getHistoryUp: getHistoryUp, getHistoryUp: getHistoryUp,