[snowy] Add a description to the search entry, but clear it when you focus in



commit 8bf409a1a86c4d4ed529ea5d9bffc3b3459db35b
Author: Brad Taylor <brad getcoded net>
Date:   Wed May 13 18:05:40 2009 -0400

    Add a description to the search entry, but clear it when you focus in
---
 notes/templates/notes/base.html |   17 ++++++++++++++++-
 site_media/css/screen.css       |    5 +++++
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/notes/templates/notes/base.html b/notes/templates/notes/base.html
index d9047f6..312f323 100644
--- a/notes/templates/notes/base.html
+++ b/notes/templates/notes/base.html
@@ -1,5 +1,20 @@
 {% extends "site_base.html" %}
 
+{% load i18n %}
+
 {% block sidebar %}
-<input type="text" id="search" name="search" accesskey="s">
+<input type="text" id="search" class="dim" name="search" accesskey="s" value="{% trans "Search your notes" %}">
+{% endblock %}
+
+{% block extra_body %}
+<script type="text/javascript">
+$(document).ready(function() {
+    var undim = function () {
+        $("#search").removeClass("dim")
+                    .val("")
+                    .unbind("focus", undim);
+    }
+    $("#search").bind("focus", undim);
+});
+</script>
 {% endblock %}
diff --git a/site_media/css/screen.css b/site_media/css/screen.css
index d96a75c..27746ec 100644
--- a/site_media/css/screen.css
+++ b/site_media/css/screen.css
@@ -91,6 +91,11 @@ table#container {
     color: #FFFFFF;
 }
 
+#sidebar input#search.dim {
+    color: #aba49e;
+    font-style: italic;
+}
+
 #sidebar .selected {
     background-color: #d6e1c7;
     color: #545247



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]