From 337861295c2c8e5407edb4daee53c6dfc370d1ad Mon Sep 17 00:00:00 2001 From: Matthew Zagaja Date: Mon, 14 Dec 2015 10:34:11 -0500 Subject: [PATCH 1/2] Mark @ replies as bold in answers. --- client/styles/global.css | 1 - client/views/list/list.js | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/styles/global.css b/client/styles/global.css index bbc62aa8..60df84e0 100644 --- a/client/styles/global.css +++ b/client/styles/global.css @@ -12,7 +12,6 @@ body { * { text-indent:0px!important; - font-weight:normal!important; } a { diff --git a/client/views/list/list.js b/client/views/list/list.js index e3c47bd0..a27f384b 100644 --- a/client/views/list/list.js +++ b/client/views/list/list.js @@ -41,6 +41,9 @@ Template.list.onRendered(function() { document.title = "Live Question Tool"; $('#topinputcontainer').hide(); $('head').append(''); + $('span.answertext').html(function() { + return $('span.answertext').html().replace(/(@\S+)/g, "$1"); + }); }); Template.list.helpers({ From 9a9845f9e6042ef20fb57d28e60eb7584b3cb195 Mon Sep 17 00:00:00 2001 From: Matthew Zagaja Date: Mon, 14 Dec 2015 11:28:20 -0500 Subject: [PATCH 2/2] Previous implementation was buggy so this one now persists the changes better. --- client/views/list/list.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/views/list/list.js b/client/views/list/list.js index a27f384b..ada085e6 100644 --- a/client/views/list/list.js +++ b/client/views/list/list.js @@ -41,9 +41,6 @@ Template.list.onRendered(function() { document.title = "Live Question Tool"; $('#topinputcontainer').hide(); $('head').append(''); - $('span.answertext').html(function() { - return $('span.answertext').html().replace(/(@\S+)/g, "$1"); - }); }); Template.list.helpers({ @@ -190,6 +187,7 @@ Template.list.helpers({ if(a > 2) { questions[i].answer[a].isHidden = true; } + questions[i].answer[a].text = questions[i].answer[a].text.replace(/\B(@\S+)/g, "$1"); var urlRegex = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g; questions[i].answer[a].text = questions[i].answer[a].text.replace(urlRegex, function(url) { if(url.charAt(url.length-1) == ")") {