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/css/hyperkitty-user.css | 7 +++++++ hyperkitty/static/js/hyperkitty.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) (limited to 'hyperkitty/static') diff --git a/hyperkitty/static/css/hyperkitty-user.css b/hyperkitty/static/css/hyperkitty-user.css index 49edfa6..77d9ad4 100644 --- a/hyperkitty/static/css/hyperkitty-user.css +++ b/hyperkitty/static/css/hyperkitty-user.css @@ -84,3 +84,10 @@ table.user-data label, table.user-data input { margin-bottom: 0; } + + +.ajaxloader { + margin-top: 0; + margin-left: 0; + position: absolute; +} 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