melody
Version:
simple publishing platform
24 lines (19 loc) • 615 B
text/jade
form.ui.form.large(action="/posts", method="post")
input(type="hidden", name="_author", value="#{user._id}")
.field
label Title
input(type="text", name="title")
.field(rows="2")
label Content
textarea(name="content", rows="2")
.field.right.floated
button.ui.right.floated.primary.submit.button Post
i.icon.right.chevron
script.
$('body').on('keyup', 'textarea[name=content]', function(e) {
e.preventDefault();
var $self = $(this);
var count = $self.val().length;
$self.parent().parent().find('*[data-bind=count]').html(count);
return false;
});