From 1d37238a893b473041d2d2b2139ef1831af1c49b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 4 Mar 2013 17:42:30 -0500 Subject: [PATCH] Prettify display of narrowing in our search box. (imported from commit ccb7f4798a949751a396845baf399591b5d83fb3) --- zephyr/static/js/narrow.js | 8 +++++--- zephyr/static/js/zephyr.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index b21d4ddf9e..0942628f72 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -43,7 +43,10 @@ exports.public_operators = function () { ['subject', 'my amazing subject'] These are not keys in a JavaScript object, because we - might need to support multiple operators of the same type. */ + might need to support multiple operators of the same type. + + Results are not escaped in any way. +*/ function unparse(operators) { var parts = []; $.each(operators, function (index, elem) { @@ -54,8 +57,7 @@ function unparse(operators) { // a colon are glued together to form a search term. parts.push(elem[1]); } else { - // FIXME: URI encoding will look really ugly - parts.push(elem[0] + ':' + encodeURIComponent(elem[1]).toLowerCase()); + parts.push(elem[0] + ':' + elem[1].toLowerCase()); } }); return parts.join(' '); diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index bfede640a5..06404687bf 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -292,7 +292,7 @@ function add_message_metadata(message, dummy) { case 'private': message.is_private = true; - message.reply_to = get_private_message_recipient(message, 'email'); + message.reply_to = get_private_message_recipient(message, 'email').replace(/ /g, ""); message.display_reply_to = get_private_message_recipient(message, 'full_name'); involved_people = message.display_recipient;