From 9137166bbe349f51af57c0e193dfcd4a6f401243 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 18 Mar 2014 18:15:54 +0100 Subject: [PATCH] Added method "mediaStream.url.buddy" to get url of buddy image. --- static/js/services/buddylist.js | 3 +-- static/js/services/mediastream.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/services/buddylist.js b/static/js/services/buddylist.js index 0c77771f..7280ccfc 100644 --- a/static/js/services/buddylist.js +++ b/static/js/services/buddylist.js @@ -325,8 +325,7 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text! } if (url.indexOf("img:") === 0) { - url = url.substr(4); - status.buddyPicture = status.buddyPictureLocalUrl = mediaStream.config.B + "static/img/buddy/s46/"+url; + status.buddyPicture = status.buddyPictureLocalUrl = mediaStream.url.buddy(url.substr(4)); } }; diff --git a/static/js/services/mediastream.js b/static/js/services/mediastream.js index e12ac363..dfdfb2a3 100644 --- a/static/js/services/mediastream.js +++ b/static/js/services/mediastream.js @@ -69,6 +69,9 @@ define([ id = $window.encodeURIComponent(id); return $window.location.protocol+'//'+$window.location.host+context.Cfg.B+id; }, + buddy: function(id) { + return $window.location.protocol+'//'+$window.location.host+context.Cfg.B+"static/img/buddy/s46/"+id; + }, api: function(path) { return (context.Cfg.B || "/") + "api/v1/" + path; }