From ade2c50c05873a17e5fb855badeb47d23147bae4 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sat, 18 Jul 2020 22:00:40 +0200 Subject: [PATCH 1/3] Downgrade rich text for buffers --- js/models.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/models.js b/js/models.js index 62ed94d..ddc93ea 100644 --- a/js/models.js +++ b/js/models.js @@ -18,6 +18,10 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo this.outgoingQueries = []; var parseRichText = function(text) { + if(!text) { + return [{text}]; + } + var textElements = weeChat.Protocol.rawText2Rich(text), typeToClassPrefixFg = { 'option': 'cof-', @@ -64,8 +68,8 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo */ this.Buffer = function(message) { // weechat properties - var fullName = message.full_name; - var shortName = message.short_name; + var fullName = parseRichText(message.full_name)[0].text; + var shortName = parseRichText(message.short_name)[0].text; var hidden = message.hidden; // If it's a channel, trim away the prefix (#, &, or +). If that is empty and the buffer // has a short name, use a space (because the prefix will be displayed separately, and we don't want From 85dc498fdd79094b5a9c06f2a85da70a794883d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 21 Jul 2020 13:53:34 +0200 Subject: [PATCH 2/3] Fix ES6 syntax in models.js This broke the tests and the minification / update process on latest/pull.glowing-bear.org --- js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/models.js b/js/models.js index ddc93ea..d555790 100644 --- a/js/models.js +++ b/js/models.js @@ -19,7 +19,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var parseRichText = function(text) { if(!text) { - return [{text}]; + return [{'text': text}]; } var textElements = weeChat.Protocol.rawText2Rich(text), From 3858c0ff0c4d6c62ebd05c9ed02efe7ec1741b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 21 Jul 2020 14:00:32 +0200 Subject: [PATCH 3/3] Remove useless linksForCordova filter We deprecated the cordova app long ago --- js/filters.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/js/filters.js b/js/filters.js index 193abcf..83d0f59 100644 --- a/js/filters.js +++ b/js/filters.js @@ -146,17 +146,6 @@ weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) { }; }]); -// This is used by the cordova app to change link targets to "window.open(, '_system')" -// so that they're opened in a browser window and don't navigate away from Glowing Bear -weechat.filter('linksForCordova', ['$sce', function($sce) { - return function(text) { - // XXX TODO this needs to be improved - text = text.replace(/