aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-05-04 08:57:19 -0400
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-05-04 17:23:53 -0400
commit8521c876d4b2ce69ff5d4313493017f26aa2cd6b (patch)
tree36b2c4ee9f3237502a7f15c0a8e6c132ad7a53a7 /p/scripts
parent2f51556f775045689abcde413c765cd08b85058a (diff)
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.
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js8
1 files changed, 8 insertions, 0 deletions
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();
}