From 0cee1b73918990cc5823e1e938605e3a6c644837 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Oct 2010 21:01:18 +0200 Subject: [PATCH] Redesign and consolidate. --- src/main/resources/static/css/sone.css | 11 +++--- src/main/resources/static/javascript/sone.js | 29 +++++++++++++++ src/main/resources/templates/include/head.html | 18 +++++---- .../resources/templates/include/updateStatus.html | 8 ++++ src/main/resources/templates/index.html | 43 +--------------------- 5 files changed, 53 insertions(+), 56 deletions(-) create mode 100644 src/main/resources/templates/include/updateStatus.html 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 @@ -