# HG changeset patch # User neko259 # Date 2015-09-28 08:04:24 # Node ID dff9bff435222ec271206fc4ed515dce0671c19a # Parent ed9d00787cb7ebbaef2e97f81d422616dfd82e29 Speed up loading favorite list. Add reflinks to the list to see favorite threads diff --git a/boards/static/js/main.js b/boards/static/js/main.js --- a/boards/static/js/main.js +++ b/boards/static/js/main.js @@ -62,21 +62,18 @@ function updateFavPosts() { allNewPostCount += newPostCount; if (includePostBody) { - var post = $(dict.post); - - var id = post.find('.post_id'); - var title = post.find('.title'); - var favThreadNode = $('
'); - favThreadNode.append(id); + favThreadNode.append($(dict.post_url)); favThreadNode.append(' '); - favThreadNode.append(title); + favThreadNode.append($('' + dict.title + '')); if (newPostCount > 0) { favThreadNode.append(' (+' + newPostCount + ")"); } favoriteThreadPanel.append(favThreadNode); + + addRefLinkPreview(favThreadNode[0]); } }); diff --git a/boards/views/api.py b/boards/views/api.py --- a/boards/views/api.py +++ b/boards/views/api.py @@ -263,8 +263,8 @@ def api_get_new_posts(request): fav_thread_dict['new_post_count'] = new_post_count if include_posts: - fav_thread_dict['post'] = op.get_post_data( - format_type=DIFF_TYPE_HTML) + fav_thread_dict['post_url'] = op.get_link_view() + fav_thread_dict['title'] = op.title if new_post_count > 0: fav_thread_dict['newest_post_link'] = new_posts.first()\ .get_absolute_url()