Merge pull request #580 from glowing-bear/prefixlimit
Limit prefix parts to at most 25 chars
This commit is contained in:
commit
b0dd67336a
2 changed files with 13 additions and 1 deletions
|
@ -280,7 +280,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
|
|||
<span class="cof-chat_time cob-chat_time coa-chat_time" ng-bind="::(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" ng-bind="::(bufferline.date|date:'mm')"></span><span class="seconds"><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" ng-bind="::(bufferline.date|date:'ss')"></span></span>
|
||||
</span>
|
||||
</td>
|
||||
<td class="prefix"><a ng-click="addMention(bufferline.prefix)"><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text"></span></a></td><!--
|
||||
<td class="prefix"><a ng-click="addMention(bufferline.prefix)"><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span></a></td><!--
|
||||
--><td class="message"><!--
|
||||
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!--
|
||||
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:'_blank' | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'mathjax':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
|
||||
|
|
|
@ -167,4 +167,16 @@ weechat.filter('mathjax', function() {
|
|||
};
|
||||
});
|
||||
|
||||
weechat.filter('prefixlimit', function() {
|
||||
return function(input, chars) {
|
||||
if (isNaN(chars)) return input;
|
||||
if (chars <= 0) return '';
|
||||
if (input && input.length > chars) {
|
||||
input = input.substring(0, chars);
|
||||
return input + '+';
|
||||
}
|
||||
return input;
|
||||
};
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue