diff --git a/TODO b/TODO index 3dae88e9..4a642b97 100644 --- a/TODO +++ b/TODO @@ -2,9 +2,6 @@ This is transient file that lists functionalities to be implemented before first major release. everything related to posts: - - post listing - - better thumbnail loading - - single post view - editing - ability to loop video posts @@ -22,9 +19,6 @@ everything related to posts: - post notes should be visible in post edit history. (move post snapshot factory methods to PostService) -everything related to users: - - better avatar loading - everything related to tags: - tag listing - tag autocompletion (difficult) diff --git a/public_html/css/post-list.css b/public_html/css/post-list.css index 37cc1079..f1ac5f99 100644 --- a/public_html/css/post-list.css +++ b/public_html/css/post-list.css @@ -32,6 +32,8 @@ } .post-small img { display: block; + border: 0; + background: white; } .post-small a:focus, diff --git a/public_html/js/Presenters/GlobalCommentListPresenter.js b/public_html/js/Presenters/GlobalCommentListPresenter.js index 8faaf1d6..84b66a39 100644 --- a/public_html/js/Presenters/GlobalCommentListPresenter.js +++ b/public_html/js/Presenters/GlobalCommentListPresenter.js @@ -83,6 +83,7 @@ App.Presenters.GlobalCommentListPresenter = function( postTemplate: templates.post, }) + ''); + util.loadImagesNicely($post.find('img')); var presenter = App.DI.get('postCommentListPresenter'); presenter.init({ diff --git a/public_html/js/Presenters/PostCommentListPresenter.js b/public_html/js/Presenters/PostCommentListPresenter.js index 61cce239..1e6b7105 100644 --- a/public_html/js/Presenters/PostCommentListPresenter.js +++ b/public_html/js/Presenters/PostCommentListPresenter.js @@ -100,6 +100,7 @@ App.Presenters.PostCommentListPresenter = function( canEditComment: auth.isLoggedIn(comment.user.name) ? privileges.editOwnComments : privileges.editAllComments, canDeleteComment: auth.isLoggedIn(comment.user.name) ? privileges.deleteOwnComments : privileges.deleteAllComments, }) + ''); + util.loadImagesNicely($item.find('img')); $targetList.append($item); $item.find('a.edit').click(function(e) { e.preventDefault(); diff --git a/public_html/js/Presenters/PostListPresenter.js b/public_html/js/Presenters/PostListPresenter.js index ef181dec..52367a7a 100644 --- a/public_html/js/Presenters/PostListPresenter.js +++ b/public_html/js/Presenters/PostListPresenter.js @@ -92,10 +92,12 @@ App.Presenters.PostListPresenter = function( } _.each(posts, function(post) { - $target.append(jQuery('
  • ' + templates.listItem({ + var $post = jQuery('
  • ' + templates.listItem({ searchArgs: searchArgs, post: post, - }) + '
  • ')); + }) + '') + util.loadImagesNicely($post.find('img')); + $target.append($post); }); } diff --git a/public_html/js/Presenters/UserListPresenter.js b/public_html/js/Presenters/UserListPresenter.js index cc35e0c8..a86bbc15 100644 --- a/public_html/js/Presenters/UserListPresenter.js +++ b/public_html/js/Presenters/UserListPresenter.js @@ -77,10 +77,12 @@ App.Presenters.UserListPresenter = function( } _.each(users, function(user) { - $target.append(jQuery('
  • ' + templates.listItem({ + var $item = jQuery('
  • ' + templates.listItem({ user: user, formatRelativeTime: util.formatRelativeTime, - }) + '
  • ')); + }) + ''); + util.loadImagesNicely($item.find('img')); + $target.append($item); }); } diff --git a/public_html/js/Presenters/UserPresenter.js b/public_html/js/Presenters/UserPresenter.js index e54827aa..311a6501 100644 --- a/public_html/js/Presenters/UserPresenter.js +++ b/public_html/js/Presenters/UserPresenter.js @@ -70,6 +70,7 @@ App.Presenters.UserPresenter = function( canChangeBrowsingSettings: userBrowsingSettingsPresenter.getPrivileges().canChangeBrowsingSettings, canChangeAccountSettings: _.any(userAccountSettingsPresenter.getPrivileges()), canDeleteAccount: userAccountRemovalPresenter.getPrivileges().canDeleteAccount})); + util.loadImagesNicely($el.find('img')); userBrowsingSettingsPresenter.render(); userAccountSettingsPresenter.render(); userAccountRemovalPresenter.render(); diff --git a/public_html/js/Util.js b/public_html/js/Util.js index 63dfaf5c..73f9207b 100644 --- a/public_html/js/Util.js +++ b/public_html/js/Util.js @@ -24,6 +24,13 @@ App.Util = function(_, jQuery, promise) { return exitConfirmationEnabled; } + function loadImagesNicely($img) { + $img.css('opacity', '0'); + $img.bind('load', function() { + $img.animate({opacity: 1}, 'fast'); + }); + } + function parseComplexRouteArgs(args) { var result = {}; args = (args || '').split(/;/); @@ -189,6 +196,7 @@ App.Util = function(_, jQuery, promise) { disableExitConfirmation: disableExitConfirmation, isExitConfirmationEnabled: isExitConfirmationEnabled, transparentPixel: transparentPixel, + loadImagesNicely: loadImagesNicely, }; }; diff --git a/public_html/templates/comment-list-item.tpl b/public_html/templates/comment-list-item.tpl index 35fe3bfe..86421f3d 100644 --- a/public_html/templates/comment-list-item.tpl +++ b/public_html/templates/comment-list-item.tpl @@ -4,7 +4,7 @@ <% } %> - <%= comment.user.name || 'Anonymous user' %> diff --git a/public_html/templates/history.tpl b/public_html/templates/history.tpl index d8ead058..9d7e072a 100644 --- a/public_html/templates/history.tpl +++ b/public_html/templates/history.tpl @@ -13,7 +13,7 @@ <% } %> - <%= userName || 'Anonymous user' %> diff --git a/public_html/templates/home.tpl b/public_html/templates/home.tpl index 915ca507..8dd3dded 100644 --- a/public_html/templates/home.tpl +++ b/public_html/templates/home.tpl @@ -35,7 +35,7 @@ <% } %> - <%= post.user.name || 'Anonymous user' %> diff --git a/public_html/templates/post-list-item.tpl b/public_html/templates/post-list-item.tpl index 3d646bfe..26be73ae 100644 --- a/public_html/templates/post-list-item.tpl +++ b/public_html/templates/post-list-item.tpl @@ -7,7 +7,7 @@ <% } %> title="<%= _.map(post.tags, function(tag) { return '#' + tag.name; }).join(', ') %>"> - <%= post.idMarkdown %> + <%= post.idMarkdown %> <% if (post.favoriteCount || post.score || post.commentCount) { %>
    diff --git a/public_html/templates/post.tpl b/public_html/templates/post.tpl index adfe76c1..2b4e55fa 100644 --- a/public_html/templates/post.tpl +++ b/public_html/templates/post.tpl @@ -89,7 +89,7 @@ <% } %> - <%= post.user.name || 'Anonymous user' %> diff --git a/public_html/templates/user-list-item.tpl b/public_html/templates/user-list-item.tpl index ca36dcfd..c4ad5d33 100644 --- a/public_html/templates/user-list-item.tpl +++ b/public_html/templates/user-list-item.tpl @@ -1,6 +1,6 @@
    - <%= user.name %> + <%= user.name %>

    diff --git a/public_html/templates/user.tpl b/public_html/templates/user.tpl index 4f98a55a..c11c5368 100644 --- a/public_html/templates/user.tpl +++ b/public_html/templates/user.tpl @@ -3,7 +3,7 @@
    - Avatar + Avatar
    <%= user.name %>