From ea032ba8b321fad5e896750eae508456676041c1 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Thu, 23 May 2013 15:45:22 +0200 Subject: Display the last viewed threads in the user profile --- hyperkitty/static/js/hyperkitty.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'hyperkitty/static/js/hyperkitty.js') diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index fc8e461..5fcb539 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -419,6 +419,35 @@ function update_list_properties(url) { } +/* + * Last viewed threads in the user's profile + */ +function update_last_views(base_url) { + var container = $(".views"); + var loader = container.prev(".ajaxloader"); + function _update(url) { + loader.show(); + $.ajax({ + url: url, + success: function(data) { + container.html(data); + container.find(".pager a").click(function(e) { + e.preventDefault(); + _update(base_url + $(this).attr("href")); + }); + }, + error: function(jqXHR, textStatus, errorThrown) { + //alert(jqXHR.responseText); + }, + complete: function(jqXHR, textStatus) { + loader.hide(); + } + }); + } + _update(base_url); +} + + /* * Misc. */ -- cgit