From 7de057dcb0a0082ae79aea5fbe9601182a0d4f0c Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Wed, 12 Dec 2012 14:04:08 -0500 Subject: [PATCH] Remove unescaped use of stream name in subscriptions page. This was causing issues with our ability to unsubscribe from streams with " in their names. The solution here is a bit hacky, since it depends on the JavaScript being fairly aware of the layout of the DOM, which is not great. But it works. This fixes Trac #328. (imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9) --- zephyr/jstemplates/subscription.html | 3 +-- zephyr/static/js/subs.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/jstemplates/subscription.html b/zephyr/jstemplates/subscription.html index 37895768b6..b9fe9143ed 100644 --- a/zephyr/jstemplates/subscription.html +++ b/zephyr/jstemplates/subscription.html @@ -8,8 +8,7 @@ + onclick="subs.unsubscribe_button_click(event);">Unsubscribe {{/with}} diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js index e448c79e67..3d3ce31205 100644 --- a/zephyr/static/js/subs.js +++ b/zephyr/static/js/subs.js @@ -229,7 +229,8 @@ function ajaxSubscribe(stream) { }); } -exports.unsubscribe = function (stream) { +exports.unsubscribe_button_click = function (e) { + var stream = $(e.target).parent().prev().find('.subscription_name').text(); $.ajax({ type: "POST", url: "/json/subscriptions/remove",