X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Ftemplates%2Findex.html;h=3955d3b64732d9b268081d6e9748a0b48fdb31f4;hb=db1981cee6635b3d9e56cb37d795bbe931046330;hp=3a5bb70af28bdcf56d2d4352e4d5ae6515b7cfc3;hpb=55479b7bdd317aefedcf2094f442a63d10d36bdd;p=Sone.git diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 3a5bb70..3955d3b 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -4,6 +4,31 @@ /* register input field/textarea swap. */ $(document).ready(function() { registerInputTextareaSwap("#sone input.createpost", "What are you doing?"); + registerInputTextareaSwap("#sone input.reply-input", "Write a Reply…"); + + /* hide all the “create reply” forms until a link is clicked. */ + $("#sone .post").each(function() { + postId = $(this).attr("id"); + (function(postId) { + 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(); + }); + })(postId); + $(this).find(".create-reply").addClass("hidden"); + $(this).find(".status-line .time").after(commentElement); + }); }); @@ -30,9 +55,9 @@
<%= Page.Index.PostList.Text.NoPostYet|l10n|html>
<%/foreach> - +

<%= Page.Index.AddSone.Title|l10n|html>

- +
<%= Page.Index.AddSone.Description|l10n|html>