From 9b2a527cb7713f739e043624f47686c86e422c0c Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Thu, 26 Mar 2015 14:41:19 +0100 Subject: [PATCH] Limit prefix parts to at most 25 chars --- index.html | 2 +- js/filters.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index bde5371..b1e1da4 100644 --- a/index.html +++ b/index.html @@ -280,7 +280,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel :: -
diff --git a/js/filters.js b/js/filters.js index bc098c5..6fe60e4 100644 --- a/js/filters.js +++ b/js/filters.js @@ -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; + }; +}); + })();