/* Sone Main CSS File */
+/* first, override some fproxy rules. */
+#sone .post .reply div,#sone .post .time,#sone .post .delete,#sone .post .show-reply-form
+ {
+ font-size: inherit;
+}
+
+#sone form {
+ margin: 0px;
+}
+
+/* now for the real stuff. */
+
#sone {
width: 50em;
margin: auto;
padding: 1ex;
}
-#sone .post .reply div, #sone .post .time, #sone .post .delete, #sone .post .show-reply-form {
- font-size: inherit; /* or else fproxy's css rules will fuck us. */
-}
-
#sone .post .reply .time {
float: none;
display: inline;
#sone .post .create-reply {
clear: both;
+ background-color: #eef;
+ padding: 0.5ex;
+}
+
+#sone .post .create-reply.light button {
+ display: none;
}
#sone h1 {
font-weight: bold;
}
-#sone input.createpost.default, input.create-reply.default {
+#sone input.createpost.default, input.reply-input.default {
color: #888;
-}
\ No newline at end of file
+}
<form method="post" action="createReply.html">
<input type="hidden" name="formPassword" value="<% formPassword|html>" />
<input type="hidden" name="post" value="<% post.id>" />
- <input type="text" class="create-reply" name="text" value="" />
+ <input type="text" class="reply-input" name="text" value="" />
<button type="submit"><%= View.Post.SendReply|l10n|html></button>
</form>
</div>
/* register input field/textarea swap. */
$(document).ready(function() {
registerInputTextareaSwap("#sone input.createpost", "What are you doing?");
- registerInputTextareaSwap("#sone input.create-reply", "Write a Reply…");
+ 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 = $("<div>Comment</div>").addClass("show-reply-form").click(function() {
- $("#sone .post#" + postId + " .create-reply").removeClass("hidden");
+ 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.create-reply").focus();
});
})(postId);
$(this).find(".create-reply").addClass("hidden");