Permalink
Browse files

Toys section and a character counter for Krista.

  • Loading branch information...
jbarnette committed Jan 25, 2009
1 parent 402328f commit 71c9c4e9f5658ff03fe7565f3ecef0a5fb504c15
Showing with 66 additions and 1 deletion.
  1. +2 −0 _includes/head.html
  2. +1 −0 _includes/presence.html
  3. +1 −1 about.markdown
  4. +19 −0 javascripts/jquery-1.3.1.min.js
  5. +31 −0 toys/characters.markdown
  6. +12 −0 toys/index.markdown
View
@@ -7,3 +7,5 @@
<link href="http://feeds2.feedburner.com/jbarnette"
rel="alternate" title="John Barnette"
type="application/atom+xml" />
+
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
View
@@ -1,5 +1,6 @@
<ul class="presence">
<li class="about"><a href="/about.html">about</a></li>
+ <li class="toys"><a href="/toys/index.html">toys</a></li>
<li class="email"><a href="mailto:jbarnette@gmail.com">email</a></li>
<li><a href="http://twitter.com/jbarnette">twitter</a></li>
<li><a href="http://github.com/jbarnette">github</a></li>
View
@@ -5,7 +5,7 @@ title: About
<style>
li.about { display:none; }
-li.email { border-left: 0; }
+li.toys { border-left: 0; }
</style>
## About Me

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,31 @@
+---
+layout: post
+title: Character Counter
+---
+
+<div style="text-align:center">
+ <textarea id="text" rows="10" cols="60">Type stuff here.</textarea>
+
+ <h2>
+ about
+ <span id="words">0</span> words,
+ <span id="chars">0</span> characters.
+ </h2>
+</div>
+
+<script type="text/javascript">
+ function updateCounts() {
+ var text = $("#text")
+ var chars = $("#chars")
+ var words = $("#words")
+
+ words.html(text.val().split(/\s+/).length)
+ chars.html(text.val().length)
+ }
+
+ $(document).ready(function() {
+ $("#text").keyup(updateCounts)
+ updateCounts()
+ $("#text").focus().select()
+ })
+</script>
View
@@ -0,0 +1,12 @@
+---
+layout: default
+title: Toys
+---
+
+<style>
+li.toys { display:none; }
+</style>
+
+## Toys
+
+* [Character Counter](/toys/characters.html)

0 comments on commit 71c9c4e

Please sign in to comment.