From d216069e2951ad148363148c067d8ea4aa045b01 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 15 Jul 2013 18:24:04 -0400 Subject: [PATCH] search.js: Kill off get_object_parts() (imported from commit fabfa6c3bf8cb0749ba1379882eda8cb9c8316ed) --- zephyr/static/js/search.js | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/zephyr/static/js/search.js b/zephyr/static/js/search.js index 4ac059d298..ef46bb500a 100644 --- a/zephyr/static/js/search.js +++ b/zephyr/static/js/search.js @@ -80,35 +80,6 @@ function describe(operators) { }).join(', '); } -function get_object_parts(obj) { - // N.B. action is *not* escaped by the caller - switch (obj.action) { - case 'stream': - return {prefix: 'Narrow to stream', query: get_query(obj), suffix: ''}; - - case 'private_message': - return {prefix: 'Narrow to private messages with', - - query: get_person(obj), - suffix: ''}; - - case 'sender': - return {prefix: 'Narrow to messages sent by', - query: get_person(obj), - suffix: ''}; - - case 'operators': - // HACK: This label needs to be distinct from the above, because of the - // way we identify action objects by their labels. Using two spaces - // after 'Narrow to' ensures this, and is invisible with standard HTML - // whitespace handling. - return {prefix: '', - query: describe(obj.operators), - suffix: ''}; - } - return {prefix: 'Error', query: 'Error', suffix: 'Error'}; -} - function get_label(obj) { switch (obj.action) { case 'stream': @@ -319,9 +290,9 @@ exports.initialize = function () { return prefix + ' ' + stream; } - var parts = get_object_parts(obj); - parts.query = Handlebars.Utils.escapeExpression(parts.query); - return parts.prefix + " " + parts.query + " " + parts.suffix; + var description = describe(obj.operators); + description = Handlebars.Utils.escapeExpression(description); + return description; }, matcher: function (item) { return true;