From 8521c876d4b2ce69ff5d4313493017f26aa2cd6b Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 4 May 2014 08:57:19 -0400 Subject: Add user queries It's an intermediary step to remove the favorite button. I add a button to store the current query as a favorite query. It redirects automatically to the configuration page where it is possible to name and remove user queries. To make the queries more straigtforward, I removed the default behavior when searching for a string. This way, when we search for a string, the filter is not defaulted to all articles. --- p/scripts/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index aeb044e88..0b3ebf735 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -992,6 +992,13 @@ function init_share_observers() { }); } +function init_queries_observers() { + $('.post').on('click', '.query.remove', function(e) { + e.preventDefault(); + $(this).parents('.form-group').remove(); + }); +} + function init_feed_observers() { $('select[id="category"]').on('change', function() { var detail = $('#new_category_name').parent(); @@ -1046,6 +1053,7 @@ function init_all() { window.setInterval(refreshUnreads, 120000); } else { init_share_observers(); + init_queries_observers(); init_feed_observers(); init_password_observers(); } -- cgit v1.2.3