From: David ‘Bombe’ Roden Date: Fri, 5 Nov 2010 08:58:47 +0000 (+0100) Subject: Add WoT identicons as avatars. X-Git-Tag: 0.2-RC1~30 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f75d7f9540350fcc16098770739c429a3f755bde;p=Sone.git Add WoT identicons as avatars. --- diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index 875d6aa..22e411b 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -138,6 +138,16 @@ textarea { border-bottom: none; } +#sone .post > .avatar { + position: absolute; +} + +#sone .post > .inner-part { + margin-left: 48px; + padding-left: 0.5em; + min-height: 48px; +} + #sone .post .author { display: inline; font-weight: bold; @@ -149,7 +159,6 @@ textarea { } #sone .post .status-line { - clear: both; margin-top: 0.5ex; font-size: 85%; } @@ -201,6 +210,16 @@ textarea { padding-top: 0.2ex; } +#sone .post .reply > .avatar { + position: absolute; +} + +#sone .post .reply > .inner-part { + margin-left: 36px; + padding-left: 0.5em; + min-height: 36px; +} + #sone .post .reply { clear: both; background-color: #f0f0ff; diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 695503c..66314e1 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -297,16 +297,16 @@ function getReplyId(element) { function likePost(postId) { $.getJSON("ajax/like.ajax", { "type": "post", "post" : postId, "formPassword": getFormPassword() }, function() { - $("#sone .post#" + postId + " > .status-line .like").addClass("hidden"); - $("#sone .post#" + postId + " > .status-line .unlike").removeClass("hidden"); + $("#sone .post#" + postId + " > .inner-part > .status-line .like").addClass("hidden"); + $("#sone .post#" + postId + " > .inner-part > .status-line .unlike").removeClass("hidden"); updatePostLikes(postId); }); } function unlikePost(postId) { $.getJSON("ajax/unlike.ajax", { "type": "post", "post" : postId, "formPassword": getFormPassword() }, function() { - $("#sone .post#" + postId + " > .status-line .unlike").addClass("hidden"); - $("#sone .post#" + postId + " > .status-line .like").removeClass("hidden"); + $("#sone .post#" + postId + " > .inner-part > .status-line .unlike").addClass("hidden"); + $("#sone .post#" + postId + " > .inner-part > .status-line .like").removeClass("hidden"); updatePostLikes(postId); }); } @@ -314,9 +314,9 @@ function unlikePost(postId) { function updatePostLikes(postId) { $.getJSON("ajax/getLikes.ajax", { "type": "post", "post": postId }, function(data, textStatus) { if (data.success) { - $("#sone .post#" + postId + " > .status-line .likes").toggleClass("hidden", data.likes == 0) - $("#sone .post#" + postId + " > .status-line .likes span.like-count").text(data.likes); - $("#sone .post#" + postId + " > .status-line .likes > span").attr("title", generateSoneList(data.sones)); + $("#sone .post#" + postId + " > .inner-part > .status-line .likes").toggleClass("hidden", data.likes == 0) + $("#sone .post#" + postId + " > .inner-part > .status-line .likes span.like-count").text(data.likes); + $("#sone .post#" + postId + " > .inner-part > .status-line .likes > span").attr("title", generateSoneList(data.sones)); } }); } diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 5f0d567..19a5f38 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -34,7 +34,7 @@ $(document).ready(function() { $("#sone .post").each(function() { postId = $(this).attr("id"); - enhanceDeletePostButton("#sone .post#" + postId + " > .status-line .delete button", postId); + enhanceDeletePostButton("#sone .post#" + postId + " > .inner-part > .status-line .delete button", postId); (function(postId) { $("#sone .post#" + postId + " .reply").each(function() { replyId = $(this).attr("id"); @@ -104,11 +104,11 @@