diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-05-27 10:36:27 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-05-27 10:36:27 +0200 |
commit | c9c34eedef5a7250cee04af30601c54200021dfa (patch) | |
tree | 9c59887e62b3927d8f6253042e671ad279c75684 /pyaggr3g470r/static | |
parent | Try to fix a problem with Python 3.4.3 and test 'ensure_future' with Python d... (diff) | |
parent | Removed debug message. (diff) | |
download | newspipe-c9c34eedef5a7250cee04af30601c54200021dfa.tar.gz newspipe-c9c34eedef5a7250cee04af30601c54200021dfa.tar.bz2 newspipe-c9c34eedef5a7250cee04af30601c54200021dfa.zip |
Merge branch 'master' of bitbucket.org:cedricbonhomme/pyaggr3g470r
Diffstat (limited to 'pyaggr3g470r/static')
-rw-r--r-- | pyaggr3g470r/static/js/articles.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pyaggr3g470r/static/js/articles.js b/pyaggr3g470r/static/js/articles.js index a5ac82d0..bb31f6d8 100644 --- a/pyaggr3g470r/static/js/articles.js +++ b/pyaggr3g470r/static/js/articles.js @@ -24,6 +24,23 @@ if (typeof jQuery === 'undefined') { throw new Error('Requires jQuery') } +function ($) { + // Mark an article as read when it is opened in a new table + $('.open-article').on('click', function(e) { + var feed_id = $(this).parent().parent().attr("data-feed"); + var filter = $('#filters').attr("data-filter"); + if (filter == "unread") { + $(this).parent().parent().remove(); + $("#total-unread").text(parseInt($("#total-unread").text()) - 1); + if (parseInt($("#unread-"+feed_id).text()) == 1) { + $("#unread-"+feed_id).remove(); + } else { + $("#unread-"+feed_id).text(parseInt($("#unread-"+feed_id).text()) - 1); + } + } + }); + + + // Mark an article as read or unread. $('.readed').on('click', function() { var article_id = $(this).parent().parent().parent().attr("data-article"); @@ -90,6 +107,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Requires jQuery') } }); }); + + // Like or unlike an article $('.like').on('click', function() { var article_id = $(this).parent().parent().parent().attr("data-article"); @@ -145,6 +164,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Requires jQuery') } }); + // Delete all duplicate articles (used in the page /duplicates) $('.delete-all').click(function(){ var data = []; |