From 4e1ccec7be022ae8917e2114182f74ca53c99538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 20 May 2014 11:44:22 +0100 Subject: [PATCH] Also assemble the contents in the preLink-function --- directives/bufferline.html | 1 - js/glowingbear.js | 24 ++++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/directives/bufferline.html b/directives/bufferline.html index 2a8f82c..2dd3535 100644 --- a/directives/bufferline.html +++ b/directives/bufferline.html @@ -6,5 +6,4 @@
- diff --git a/js/glowingbear.js b/js/glowingbear.js index 7afa9c2..fad7fe8 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1246,20 +1246,36 @@ weechat.directive('bufferLine', function() { link: { pre: function preLink(scope, iElement, iAttrs, controller) { var prefix = ""; - for (var partNum in scope.bufferline.prefix) { - var part = scope.bufferline.prefix[partNum]; + var part, partNum, classNum; + for (partNum in scope.bufferline.prefix) { + part = scope.bufferline.prefix[partNum]; prefix = angular.element("" + part.text + ""); - for (var classNum in part.classes) { + for (classNum in part.classes) { prefix.addClass(part.classes[classNum]); } iElement.find('td.prefix a').append(prefix); } + + var content; + for (partNum in scope.bufferline.content) { + part = scope.bufferline.content[partNum]; + content = scope.irclinky(part.text); + prefix = angular.element('' + content + ''); + for (classNum in part.classes) { + prefix.addClass(part.classes[classNum]); + } + iElement.find('td.message').append(prefix); + } } }, - controller: function($rootScope, $scope) { + controller: function($rootScope, $scope, $filter) { // pass through the nick click action $scope.addMention = $rootScope.addMention; + + $scope.irclinky = function(text) { + return $filter('irclinky')(text, '_blank'); + }; } };