From: David ‘Bombe’ Roden Date: Tue, 19 Oct 2010 19:01:18 +0000 (+0200) Subject: Redesign and consolidate. X-Git-Tag: 0.1-RC1~189 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0cee1b73918990cc5823e1e938605e3a6c644837;p=Sone.git Redesign and consolidate. --- diff --git a/src/main/resources/static/css/sone.css b/src/main/resources/static/css/sone.css index ef6b0d7..919b033 100644 --- a/src/main/resources/static/css/sone.css +++ b/src/main/resources/static/css/sone.css @@ -31,9 +31,8 @@ color: rgb(255, 172, 0); } -#sone #sidebar { - width: 200px; - position: absolute; +#sone #profile { + height: 80px; } #sone .profile-link { @@ -68,8 +67,7 @@ } #sone #main { - margin-left: 200px; - padding-left: 1em; + padding: 1em; } #sone .post { @@ -89,6 +87,7 @@ #sone .post .status-line { clear: both; + margin-top: 0.5ex; font-size: 85%; } @@ -242,6 +241,6 @@ font-weight: bold; } -#sone input.createpost.default, input.reply-input.default { +#sone input.status-input.default, input.reply-input.default { color: #888; } diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 44cff7c..97c3da5 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -16,3 +16,32 @@ function registerInputTextareaSwap(inputSelector, defaultText) { } }); } + +/* hide all the “create reply” forms until a link is clicked. */ +function addCommentLinks() { + $("#sone .post").each(function() { + postId = $(this).attr("id"); + commentElement = (function(postId) { + var commentElement = $("
Comment
").addClass("show-reply-form").click(function() { + replyElement = $("#sone .post#" + postId + " .create-reply"); + replyElement.removeClass("hidden"); + replyElement.removeClass("light"); + (function(replyElement) { + replyElement.find("input.reply-input").blur(function() { + if ($(this).hasClass("default")) { + replyElement.addClass("light"); + } + }).focus(function() { + replyElement.removeClass("light"); + }); + })(replyElement); + replyElement.find("input.reply-input").focus(); + }); + return commentElement; + })(postId); + $(this).find(".create-reply").addClass("hidden"); + $(this).find(".status-line .time").each(function() { + $(this).after(commentElement.clone(true)); + }); + }); +} diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 9b27cc7..b1d01bc 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -3,17 +3,19 @@ -